From cd75a5272b7db9e45423c43d54d6d2abaeaf142b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com>
Date: Fri, 15 Mar 2024 17:36:12 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E4=BA=A7=E7=95=8C?=
=?UTF-8?q?=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
hw-ui/src/api/board/fifthFloor.js | 8 +
hw-ui/src/views/board/fifthFloor/index.vue | 248 +++++++++++++++++----
2 files changed, 209 insertions(+), 47 deletions(-)
diff --git a/hw-ui/src/api/board/fifthFloor.js b/hw-ui/src/api/board/fifthFloor.js
index fbacd55..aba6e44 100644
--- a/hw-ui/src/api/board/fifthFloor.js
+++ b/hw-ui/src/api/board/fifthFloor.js
@@ -35,3 +35,11 @@ export function completeProductPlanDetail(query) {
data: query
})
}
+// 获取图纸
+export function getPlanDrawings(query) {
+ return request({
+ url: '/mes/api/getProductPlanDrawings',
+ method: 'get',
+ params: query
+ })
+}
diff --git a/hw-ui/src/views/board/fifthFloor/index.vue b/hw-ui/src/views/board/fifthFloor/index.vue
index 2564832..8afa6f1 100644
--- a/hw-ui/src/views/board/fifthFloor/index.vue
+++ b/hw-ui/src/views/board/fifthFloor/index.vue
@@ -8,7 +8,7 @@
@@ -90,24 +93,27 @@
>
+
+ {{ (scope.row.attachId || '').split(',').length }}
+
- {{ scope.row.planAmount - scope.row.completeAmount }}
+ {{ (scope.row.attachId || '').split(',').length - scope.row.completeAmount }}
-
-
- 开始
-
-
-
- 继续
-
- 退库
+ 条码打印
@@ -175,7 +151,7 @@
-
当日产量
+
每周产量
@@ -204,6 +180,87 @@
确 定
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 申请领料
+
+
@@ -214,8 +271,10 @@ import {
completeProductPlanDetail,
getNewestProductPlanDetail,
getProductPlans,
- startNextProductPlanDetail
+ startNextProductPlanDetail,
+ getPlanDrawings
} from "@/api/board/fifthFloor";
+import {applyRawOutstock, getStockTotal, getWarehouses} from "@/api/board/firstFloor";
const setState = (e)=>{
if(e === '1'){
@@ -239,8 +298,12 @@ export default {
nowNum1: 1,
totalNum1: 0,
getMaterialsModel:false,
+ dialogVisible: false,
form: {},
+ form1: {},
tableData: [],
+ warehouseList: [],
+ searchMaterialValue: '',
}
},
async mounted() {
@@ -443,6 +506,19 @@ export default {
this.form.planDetailStatus = setState(val.data.planDetailStatus)
})
},
+ 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
+ }
+ }) || []
+ })
+
+ },
// 设置图表信息
getInfo(e) {
this.$refs.chart1_1.setData({
@@ -763,12 +839,29 @@ export default {
})
},
// 开始继续
- async startNextProduction(e){
- const data = await startNextProductPlanDetail({planId: e.planId})
- this.form = data.data
- this.form.materialId = e.materialId
- this.form.materialName = e.materialName
- this.form.planDetailStatus = setState(data.data.planDetailStatus)
+ 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)
+ })
+ getNewestProductPlanDetail({planId: val.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(){
@@ -800,7 +893,68 @@ export default {
message: '已取消'
});
})
- }
+ },
+
+ // 领料页面
+ getMaterials() {
+ this.searchMaterialValue = ''
+ this.dialogVisible = true
+ this.form1 = {
+ warehouseId: '',
+ planId: this.form.row.planId,
+ planCode: this.form.row.planCode,
+ planDetailCode: this.form.row.planDetailCode,
+ applyReason: '',
+ taskType: '1',
+ wmsRawOutstockDetailList: []
+ }
+ // 获取仓库信息
+ getWarehouses({"warehouseFloor":5}).then(e => {
+ this.warehouseList = e.data
+
+ this.form1.warehouseId = e.data[0]?.warehouseId
+ this.searchMaterial("");
+ })
+
+ },
+
+ // 物料搜索
+ searchMaterial(val) {
+ getStockTotal({
+ warehouseId:this.form1.warehouseId,
+ materialName: val
+ }).then(e => {
+ this.form1.wmsRawOutstockDetailList = e.data.map(r => {
+ return {
+ materialId: r.materialId,
+ materialCode: r.materialCode,
+ materialName: r.materialName,
+ availableAmount: r.totalAmount-r.occupyAmount-r.frozenAmount,
+ unavailableAmount: r.occupyAmount+r.frozenAmount,
+ planAmount: r.planAmount
+ }
+ })
+ })
+ },
+
+
+ warehouseChange(warehouseId){
+ this.form.wmsRawOutstockDetailList =[];
+ this.form.warehouseId = warehouseId;
+ this.getStockTotal();
+ },
+
+ receiveMaterial() {
+ applyRawOutstock(this.form).then(e => {
+ if (e.code === 200) {
+ this.dialogVisible = false
+ this.$message({
+ message: '领料完成',
+ type: 'success'
+ });
+ }
+ })
+ },
}
}