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

报工添加SIZE与指令

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