Commit d7e3174a authored by 李驰骋's avatar 李驰骋

报工添加SIZE与指令

parent 9db3f6af
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
v-model="open" v-model="open"
width="1800rpx" width="1800rpx"
> >
<view class="feedback-card" v-for="feedback in feedbackForms"> <view class="feedback-card" v-for="(feedback,i) in feedbackForms">
<u-form label-width="100px" :model="feedback" :rules="rules"> <u-form label-width="100px" :model="feedback" :rules="rules">
<u-row> <u-row>
<u-col span="6"> <u-col span="6">
...@@ -141,23 +141,18 @@ ...@@ -141,23 +141,18 @@
size="mini" size="mini"
>报工人员</u-button> >报工人员</u-button>
</u-form-item> </u-form-item>
</u-form-item>
</u-col> </u-col>
</u-row> </u-row>
<u-row> <u-row>
<u-col span="6"> <u-col span="6">
<u-form-item label="编排单号" prop="quantity"> <u-form-item label="编排单号" prop="quantity">
<!-- <u-input v-model="feedback.arrangeCode" ></u-input> -->
{{ feedback.arrangeCode }} {{ feedback.arrangeCode }}
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<u-form-item label="生产工单" prop="workorderId"> <u-form-item label="生产工单" prop="workorderId">
<!-- <u-input v-model="feedback.nickName" @change=""></u-input> --> <uni-data-select v-model="feedback.workorderId" :localdata="feedback.workorderOption" @change="workorderSelect($event, i)"></uni-data-select>
<!-- <uni-data-select :localdata="reasonList" @change="changeReason"></uni-data-select> -->
<uni-data-select :localdata="feedback.workorderList" @change="workorderSelect($event, feedback)"></uni-data-select>
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
...@@ -175,8 +170,6 @@ ...@@ -175,8 +170,6 @@
</u-row> </u-row>
<u-row> <u-row>
<u-col span="6"> <u-col span="6">
<!-- <u-form-item label="是否打印" prop="printName">
<u-input v-model="feedback.printName"></u-input> -->
<u-form-item label="是否打印" prop="printName"> <u-form-item label="是否打印" prop="printName">
<view class="uni-list-item__extra"> <view class="uni-list-item__extra">
<u-radio-group v-model="feedback.printName"> <u-radio-group v-model="feedback.printName">
...@@ -187,6 +180,27 @@ ...@@ -187,6 +180,27 @@
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
<view v-if="feedback.isLastProcess">
<u-row>
<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>
</u-col>
<u-col span="6">
<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-row>
<u-row>
<u-col span="6">
<u-form-item label="净重(KG)" prop="netWeight">
<u-number-box :min="0" :positive-integer="false" v-model="feedback.netWeight"></u-number-box>
</u-form-item>
</u-col>
</u-row>
</view>
</u-form> </u-form>
</view> </view>
</u-modal> </u-modal>
...@@ -1234,14 +1248,23 @@ userTempVisible: false, ...@@ -1234,14 +1248,23 @@ userTempVisible: false,
stopReasonChange(e) { stopReasonChange(e) {
this.stopReason += e; this.stopReason += e;
}, },
workorderSelect(id, row) { workorderSelect(id, index) {
console.log(id, row); const row = this.feedbackForms[index];
if(!id){
row.sizeList = [];
row.directiveList = [];
row.workorderSoSizeItemId = '';
row.workorderSoDirectiveId = '';
return;
}
row.workorderId = id; row.workorderId = id;
const items = row.workorderList.find((item) => item.value === id); const items = row.workorderList.find((item) => item.workorderId === id);
console.log(items, 'items'); row.workorderCode = items.workorderCode;
row.workorderCode = items.text; row.printName = items.workorderCode;
row.printName = items.text; row.sizeList = row.sizeData[id];
console.log(row, 'rows'); row.directiveList = row.directiveData[id];
row.packByDirective = items.packByDirective;
row.packBySize = items.packBySize;
}, },
stopReas(abnormalType) { stopReas(abnormalType) {
...@@ -1278,19 +1301,35 @@ userTempVisible: false, ...@@ -1278,19 +1301,35 @@ userTempVisible: false,
}); });
}); });
}, },
stopWorkorder(item) { getWorkorderWithSizeAndDirective(item) {
// 查询原因
this.$u.api this.$u.api
.getWorkorder({ .getWorkorderWithSizeAndDirective({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
arrangeCode: item.arrangeCode arrangeCode: item.arrangeCode
}) })
.then((res) => { .then((res) => {
item.workorderList = res.rows.map((item) => { item.workorderList = res.rows;
item.workorderOption = res.rows.map((temp) => {
if(temp.saleDirectiveList!=null){
item.directiveData[temp.workorderId] = temp.saleDirectiveList.map(temp2=>{
return {
value: temp2.workorderSoDirectiveId,
text: temp2.clientCmd
}
});
}
if(temp.sizeList2!=null){
item.sizeData[temp.workorderId] = temp.sizeList2.map(temp2=>{
return {
value: temp2.workorderSoSizeItemId,
text: temp2.standardSize
}
});
}
return { return {
value: item.workorderId, value: temp.workorderId,
text: item.workorderCode text: temp.workorderCode
}; };
}); });
}); });
...@@ -1455,12 +1494,21 @@ userTempVisible: false, ...@@ -1455,12 +1494,21 @@ userTempVisible: false,
quantityQualify: defQualify,//默认为排产数量-合格数-不合格数 quantityQualify: defQualify,//默认为排产数量-合格数-不合格数
quantityUnqualify: 0, quantityUnqualify: 0,
printName: '', printName: '',
lastProcess: item.isLastProcess==1,//未工序
nickName: this.vuex_user.nickName, nickName: this.vuex_user.nickName,
workorderId: 0, workorderId: 0,
workorderCode: null, workorderCode: null,
workorderList: [] workorderSoDirectiveId: '',
workorderSoSizeItemId: '',
netWeight: '',
workorderList: [],
workorderOption: [],
directiveList:[],
sizeList:[],
directiveData: {},
sizeData: {},
}; };
this.stopWorkorder(feedback); this.getWorkorderWithSizeAndDirective(feedback);
this.feedbackForms.push(feedback); this.feedbackForms.push(feedback);
}); });
this.open = true; this.open = true;
...@@ -1504,6 +1552,16 @@ userTempVisible: false, ...@@ -1504,6 +1552,16 @@ userTempVisible: false,
this.$u.toast('请填写合格/不合格产品数量!'); this.$u.toast('请填写合格/不合格产品数量!');
return; 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;
}
}
//如果工单
this.$u.api this.$u.api
.feedback({ .feedback({
taskWorkunitId: item.taskWorkunitId, taskWorkunitId: item.taskWorkunitId,
...@@ -1527,7 +1585,10 @@ userTempVisible: false, ...@@ -1527,7 +1585,10 @@ userTempVisible: false,
workorderId: item.workorderId, workorderId: item.workorderId,
workorderCode: item.workorderCode, workorderCode: item.workorderCode,
workstationName: item.workstationName, workstationName: item.workstationName,
startTime: item.scheduleStartDate startTime: item.scheduleStartDate,
workorderSoDirectiveId: item.workorderSoDirectiveId,
workorderSoSizeItemId: item.workorderSoSizeItemId,
netWeight: item.netWeight
}) })
.then((res) => { .then((res) => {
if (res.code === 200) { 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