@@ -272,7 +279,6 @@ import {
getNewestProductPlanDetail,
getProductPlans,
startNextProductPlanDetail,
- getPlanDrawings,
applyRawOutstock,
getStockTotal,
getWarehouses
@@ -306,20 +312,14 @@ export default {
tableData: [],
warehouseList: [],
searchMaterialValue: '',
+ vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100,
}
},
async mounted() {
- const data = await getProductPlans({pageNum: 1, pageSize: 5}).then(e => {
+ getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5)
- this.$refs.table1.setCurrentRow(e.rows[0]);
- this.getInfo(e.rows[0])
- getNewestProductPlanDetail({planId: e.rows[0].planId}).then(val => {
- this.form = val.data
- this.form.materialId = e.rows[0].materialId
- this.form.materialName = e.rows[0].materialName
- this.form.planDetailStatus = setState(val.data.planDetailStatus)
- })
+ this.tableClick(e.rows[0])
})
this.$refs.chart2.setData({
tooltip: {
@@ -499,29 +499,28 @@ export default {
this.totalNum1 = Math.ceil(e.total / 5)
})
},
- getOrderInfo(e) {
- this.getInfo(e)
- getNewestProductPlanDetail({planId: e.planId}).then(val => {
- this.form = val.data
- this.form.materialId = e.materialId
- this.form.materialName = e.materialName
- this.form.planDetailStatus = setState(val.data.planDetailStatus)
- })
+ async startPlan(val) {
+ const data = await startNextProductPlanDetail({planId: val.planId})
+ if (data.code === 200) {
+ this.$message({
+ message: '已开始',
+ type: 'success'
+ });
+ }
+ this.form = data.data || {}
+ this.form.materialId = val.materialId
+ this.form.materialName = val.materialName
+ this.form.planDetailStatus = setState(data.data.planDetailStatus)
+ this.getInfo(val)
},
- async expandChange(e, rows) {
- this.drawingList = [e.planId]
- const data = await getPlanDrawings({planId: e.planId, attachId: e.attachId})
- this.$set(this.tableData, this.tableData.indexOf(e), {
- ...e, drawing: data?.data.map((v, i) => {
- return {
- ...v,
- planId: e.planId + '-' + i
- }
- }) || []
- })
-
+ async tableClick(val) {
+ const {data} = await getNewestProductPlanDetail({planId: val.planId})
+ this.form = data || {}
+ this.form.materialId = val.materialId
+ this.form.materialName = val.materialName
+ this.form.planDetailStatus = setState(data.planDetailStatus)
+ this.getInfo(val)
},
- // 设置图表信息
getInfo(e) {
this.$refs.chart1_1.setData({
series: [
@@ -703,7 +702,7 @@ export default {
center: ["50%", "50%"],
data: [
{
- value: (e.planAmount - e.completeAmount) === 0 ? 0.0001 : (e.planAmount - e.completeAmount),
+ value: Math.abs((e.planAmount - e.completeAmount) === 0 ? 0.0001 : (e.planAmount - e.completeAmount)),
label: {
normal: {
rich: {
@@ -840,30 +839,42 @@ export default {
],
})
},
- // 开始继续
- async startNextProduction(val, e) {
- const dataIndex = this.tableData.indexOf(val)
- const lineIndex = this.tableData[dataIndex].drawing.indexOf(e)
- this.$set(this.tableData?.[dataIndex]?.[lineIndex], 'dispatchFlag', false)
- await startNextProductPlanDetail({planId: val.planId, attachId: e.attachId})
- .catch(() => {
- this.$set(this.tableData?.[dataIndex]?.[lineIndex], 'dispatchFlag', true)
+ async finish() {
+
+ this.$confirm('确认计划完成?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(async () => {
+ const data = await completeProductPlanDetail({
+ planDetailId: this.form.planDetailId
+ })
+ if (data.code === 200) {
+ this.$message({
+ message: '已完成',
+ type: 'success'
+ });
+ }
+ getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
+ this.tableData = e.rows
+ this.totalNum1 = Math.ceil(e.total / 5)
+ this.tableClick(e.rows.find(v => v.planCode === this.form.planCode))
})
- getNewestProductPlanDetail({planId: val.planId}).then(val => {
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '已取消'
+ });
+ });
+ },
+ getOrderInfo(e) {
+ this.getInfo(e)
+ getNewestProductPlanDetail({planId: e.planId}).then(val => {
this.form = val.data
this.form.materialId = e.materialId
this.form.materialName = e.materialName
this.form.planDetailStatus = setState(val.data.planDetailStatus)
})
- const data = await getPlanDrawings({planId: val.planId, attachId: val.attachId})
- this.$set(this.tableData, this.tableData.indexOf(val), {
- ...val, drawing: data?.data.map((v, i) => {
- return {
- ...v,
- planId: val.planId + '-' + i
- }
- }) || []
- })
},
// 完成
accomplishPlan() {
diff --git a/hw-ui/src/views/board/fourthFloor/assemble.vue b/hw-ui/src/views/board/fourthFloor/assemble.vue
index 8f55a3c..029f111 100644
--- a/hw-ui/src/views/board/fourthFloor/assemble.vue
+++ b/hw-ui/src/views/board/fourthFloor/assemble.vue
@@ -217,20 +217,14 @@
title="领料"
width="40%">
-
-
+
+
-
-
-
-
-
-
-
-
+
+
-
+
@@ -243,12 +237,12 @@
:cell-style="{textAlign:'center'}"
:data="form.wmsRawOutstockDetailList"
:header-cell-style="{textAlign:'center'}"
- :max-height="19.13 * vw"
+ max-height="19.13vw"
style="width: 100%"
>
+
+
+
+
@@ -281,14 +286,6 @@
size="mini"
@change="searchMaterial"/>
-
-
- 删除
-
-
@@ -641,7 +638,6 @@ export default {
// 获取仓库信息
getWarehouses({"warehouseFloor":1}).then(e => {
this.warehouseList = e.data
-
this.form.warehouseId = e.data[0]?.warehouseId
this.searchMaterial("");
})