Commit 03aa5a12 authored by 张海景's avatar 张海景

update:修改生产报工问题

parent 97faa944
......@@ -22,10 +22,10 @@
<uni-easyinput type="text" suffixIcon="scan" v-model="tableParams.workorderCode" @iconClick="iconClickWorkorderCode" placeholder="请输入生产工单编号" />
</u-form-item>
<u-form-item name="allowProduce" label-width="80px" label="当前可加工">
<uni-data-checkbox v-model="tableParams.allowProduce" @change="getTaskList" :localdata="allowProduceLocal"></uni-data-checkbox>
<uni-data-checkbox v-model="tableParams.allowProduce" @change="getTaskList()" :localdata="allowProduceLocal"></uni-data-checkbox>
</u-form-item>
<u-form-item name="allowProduce">
<u-button @click="getTaskList" type="primary" size="medium">搜索</u-button>
<u-button @click="getTaskList()" type="primary" size="medium">搜索</u-button>
</u-form-item>
</u-form>
</view>
......@@ -155,7 +155,7 @@
</u-row>
<u-row>
<u-col span="6">
<u-form-item label="合格品数量:" prop="quantityQualify">
<u-form-item label="报工数量:" prop="quantityQualify">
<u-number-box :min="0" @change="quantityChanged" v-model="feedback.quantityQualify"></u-number-box>
</u-form-item>
</u-col>
......@@ -190,7 +190,7 @@
</u-row>
<view v-if="feedback.isLastProcess">
<u-row>
<u-col span="6">
<!-- <u-col span="6">
<u-form-item label="工单指令:" prop="workorderSoDirectiveId">
<uni-data-select v-model="feedback.workorderSoDirectiveId" :localdata="feedback.directiveList"></uni-data-select>
</u-form-item>
......@@ -199,6 +199,26 @@
<u-form-item label="工单SIZE:" prop="workorderSoSizeItemId">
<uni-data-select v-model="feedback.workorderSoSizeItemId" :localdata="feedback.sizeList"></uni-data-select>
</u-form-item>
</u-col> -->
<u-col span="2">
<u-form-item label="包装数量:" prop="packNum">
{{feedback.packNum}}
</u-form-item>
</u-col>
<u-col span="3">
<u-form-item label="包装类型:" prop="packType">
<dict-tag :options="dict.type.pro_pack_type" :value="feedback.packType" />
</u-form-item>
</u-col>
<u-col span="2">
<u-form-item label="包装单位:" prop="packUnitOfMeasure">
{{feedback.packUnitOfMeasure}}
</u-form-item>
</u-col>
<u-col span="5">
<u-form-item label-width="150px" label="LOSS数是否单独包装:" prop="lossIndividuallyWrap">
<dict-tag :options="dict.type.sap_yes_no" :value="feedback.lossIndividuallyWrap" />
</u-form-item>
</u-col>
</u-row>
<u-row>
......@@ -225,11 +245,22 @@
<u-tabs :list="listTabPro" :is-scroll="false" :show-bar="false" :current="feedback.currentTabPro" @change="handleChangeTabPro($event, feedback)"></u-tabs>
<!-- 指令列表 -->
<view v-show="feedback.currentTabPro === 0">
<zb-table :columns="feedback.tableDirectiveColumn" :stripe="true" :border="true" :data="feedback.tableDirectiveData"></zb-table>
<zb-table :columns="feedback.tableDirectiveColumn" :stripe="true" :border="true" :data="feedback.tableDirectiveData">
<template slot="reportQuantity" slot-scope="scope">
<!-- {{ scope.row }} -->
<u-input v-model="scope.row.reportQuantity" @blur="handleChangeReportQuantity(feedback)"></u-input>
</template>
</zb-table>
</view>
<!-- SIZE列表 -->
<view v-show="feedback.currentTabPro === 1">
<zb-table :columns="feedback.tableSizeColumn" :stripe="true" :border="true" :data="feedback.tableSizeData"></zb-table>
<zb-table :columns="feedback.tableSizeColumn" :stripe="true" :border="true" :data="feedback.tableSizeData">
<template slot="reportQuantity" slot-scope="scope">
<!-- {{ scope.row }} -->
<u-input v-model="scope.row.reportQuantity" @blur="handleChangeReportQuantity(feedback)"></u-input>
</template>
</zb-table>
</view>
</view>
</view>
......@@ -730,6 +761,7 @@ import { handleError } from 'vue';
import AppScan from '../../../components/AppScan/AppScan.vue';
export default {
name: 'ProdReport',
dicts: ['pro_pack_type', 'sap_yes_no'],
mixins: [cameraAuthMixin],
components: {
SearchInput,
......@@ -1150,6 +1182,20 @@ export default {
uni.$off('taskStatusChanged');
},
methods: {
handleChangeReportQuantity(rows) {
let sum = 0
if (rows.tableSizeData.length > 0) {
sum += rows.tableSizeData.reduce((previousValue, item) => {
return previousValue + Number(item.reportQuantity)
},0)
}
if(rows.tableDirectiveData.length > 0) {
sum += rows.tableDirectiveData.reduce((previousValue, item) => {
return previousValue + Number(item.reportQuantity)
},0)
}
rows.quantityQualify = sum
},
handleSubmitConfirmlKnifeTemp() {
this.knifeTempVisible = true
this.$refs.appScan.closed()
......@@ -1444,11 +1490,7 @@ export default {
console.log(id, '9999');
const row = this.feedbackForms[index];
if (!id) {
row.sizeList = [];
row.directiveList = [];
row.workorderSoSizeItemId = '';
row.printContents = row.arrangeCode;
row.workorderSoDirectiveId = '';
row.tableDirectiveData = [];
row.tableSizeColumn = [];
row.tableSizeData = [];
......@@ -1465,8 +1507,6 @@ export default {
row.printName = items.workorderCode;
//row.printContents =row.arrangeCode+row.workorderCode
row.printContents = row.workorderCode;
row.sizeList = row.sizeData[id];
row.directiveList = row.directiveData[id];
row.packByDirective = items.packByDirective;
row.packBySize = items.packBySize;
},
......@@ -1542,22 +1582,6 @@ export default {
this.getWorkorderDirectiveList(res.rows[0].workorderId, index);
this.getWorkorderSizeList(res.rows[0].workorderId, index);
}
if (res.rows[0].sizeList2 != null) {
item.sizeList = res.rows[0].sizeList2.map((temp2) => {
return {
value: temp2.workorderSoSizeItemId,
text: temp2.standardSize
};
});
}
if (res.rows[0].saleDirectiveList != null) {
item.directiveList = res.rows[0].saleDirectiveList.map((temp2) => {
return {
value: temp2.workorderSoDirectiveId,
text: temp2.clientCmd
};
});
}
item.packByDirective = res.rows[0].packByDirective;
item.packBySize = res.rows[0].packBySize;
}
......@@ -1733,6 +1757,7 @@ export default {
},
doFeedback() {
// this.reset();
console.log(this.dict.type, 'this.dicts.type')
this.feedbackForms = [];
this.tableSelectData.forEach((item, index) => {
let defQualify = item.quantity - item.quantityQualify - item.quantityUnqualify;
......@@ -1746,21 +1771,17 @@ export default {
taskWorkunitId: item.taskWorkunitId,
feedbackChannel: 'PAD',
quantity: item.quantity,
quantityQualify: Number(defQualify), //默认为排产数量-合格数-不合格数
quantityQualify: item.quantityWait, //默认为排产数量-合格数-不合格数
quantityUnqualify: 0,
printName: '',
lastProcess: item.isLastProcess == 1, //未工序
nickName: this.vuex_user.nickName,
workorderId: 0,
workorderCode: null,
workorderSoDirectiveId: '',
workorderSoSizeItemId: '',
netWeight: 0,
minPackageNum: 0,
workorderList: [],
workorderOption: [],
directiveList: [],
sizeList: [],
directiveData: {},
sizeData: {},
printContents: item.arrangeCode,
......@@ -1768,6 +1789,13 @@ export default {
whether: '',
printTemplate: '',
tableDirectiveColumn: [
{
name: 'reportQuantity',
label: '本次包装数量',
width: 130,
type: 'slot',
slot: 'reportQuantity'
},
{
name: 'clientCmd',
label: '指令号',
......@@ -1790,9 +1818,10 @@ export default {
},
{
name: 'quantityQualify',
label: '合格品数量',
label: '已包装数量',
width: 130
}
},
],
tableDirectiveData: [],
tableSizeColumn: [],
......@@ -1842,6 +1871,13 @@ export default {
columns.push(obj);
}
}
columns.unshift({
name: 'reportQuantity',
label: '本次包装数量',
width: 130,
type: 'slot',
slot: 'reportQuantity'
})
row.tableSizeColumn = columns;
row.tableSizeData = res.data.sizeList;
}
......@@ -1885,22 +1921,23 @@ export default {
this.$u.toast('请填写合格/不合格产品数量!');
return;
}
if (item.lastProcess) {
//最后工序
if (item.packByDirective == 'Y' && !item.workorderSoDirectiveId) {
this.$u.toast('订单按指令包装,指令码必选!');
return;
} else if (item.packBySize == 'Y' && !item.workorderSoSizeItemId) {
this.$u.toast('订单按SIZE包装,SIZE必选!');
return;
}
}
// if (item.lastProcess) {
// //最后工序
// }
console.log(this.vuex_printConnect, 'this.vuex_printConnect');
if ((item.printTemplate || item.whether == '1') && !this.vuex_printConnect) {
this.$u.toast('打印机连接失败');
return;
}
console.log(item, 'item');
const directData = item.tableDirectiveData.map(v => {
return { workorderSoDirectiveId: v.workorderSoDirectiveId,reportQuantity: v.reportQuantity}
})
const sizeData = item.tableSizeData.map(v => {
return {workorderSoSizeItemId:v.workorderSoSizeItemId, reportQuantity: v.reportQuantity}
})
console.log(directData, sizeData)
debugger;
//工单
this.$u.api
......@@ -1928,12 +1965,12 @@ export default {
workstationName: item.workstationName,
startTime: item.scheduleStartDate,
printTemplate: item.printTemplate,
workorderSoDirectiveId: item.workorderSoDirectiveId,
workorderSoSizeItemId: item.workorderSoSizeItemId,
netWeight: item.netWeight,
createTime: item.createTime,
minPackageNum: item.minPackageNum,
printContents: item.whether == '1' ? item.printContents : null
printContents: item.whether == '1' ? item.printContents : null,
// directiveReportData: directData,
// sizeReportData: sizeData
})
.then((res) => {
if (res.code === 200) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment