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

update:修改生产管理下拉显示

parent 31051125
...@@ -198,22 +198,14 @@ ...@@ -198,22 +198,14 @@
width="1300rpx" width="1300rpx"
> >
<view class="feedback-card" style="height: 200px"> <view class="feedback-card" style="height: 200px">
<u-form label-width="120px" :model="feedback" :rules="rules"> <u-form label-width="120px" :model="stopReasonForm" :rules="rules">
<u-form-item label="暂停原因" prop="quantity"> <u-form-item label="暂停原因" prop="reason">
<uni-data-select :localdata="exception" @change="stopReas"></uni-data-select> <uni-data-select v-model="stopReasonForm.reason" :localdata="exception" @change="stopReas"></uni-data-select>
</u-form-item> </u-form-item>
<u-form-item label="暂停描述" prop="nickName"> <u-form-item label="暂停描述" prop="desc">
<uni-data-select :localdata="reasonList" @change="changeReason"></uni-data-select> <uni-data-select v-model="stopReasonForm.desc" :localdata="reasonList"></uni-data-select>
</u-form-item> </u-form-item>
</u-form> </u-form>
<!-- <uni-forms :modelValue="feedback" label-width="120px">
<uni-forms-item label="暂停原因" name="quantity">
<uni-data-select :localdata="exception" @change="stopReas"></uni-data-select>
</uni-forms-item>
<uni-forms-item label="暂停描述" name="nickName">
<uni-data-select :localdata="reasonList" @change="changeReason"></uni-data-select>
</uni-forms-item>
</uni-forms> -->
</view> </view>
</u-modal> </u-modal>
...@@ -226,7 +218,7 @@ ...@@ -226,7 +218,7 @@
width="1300rpx" width="1300rpx"
> >
<view class="feedback-card"> <view class="feedback-card">
<u-form label-width="90px" :rules="rules"> <u-form label-width="90px" :model="ExceptionForms" :rules="rules">
<!-- <u-form-item label="异常时间" prop="abnormalTime"> <!-- <u-form-item label="异常时间" prop="abnormalTime">
<u-input :border="true" v-model="ExceptionForms.abnormalTime"></u-input> <u-input :border="true" v-model="ExceptionForms.abnormalTime"></u-input>
<uni-datetime-picker class="times" type="date" :clear-icon="false" v-model="ExceptionForms.abnormalTime" /> <uni-datetime-picker class="times" type="date" :clear-icon="false" v-model="ExceptionForms.abnormalTime" />
...@@ -235,12 +227,12 @@ ...@@ -235,12 +227,12 @@
<u-row> <u-row>
<u-col span="6"> <u-col span="6">
<u-form-item label="异常类型" prop="abnormalType"> <u-form-item label="异常类型" prop="abnormalType">
<uni-data-select :localdata="exception" @change="stopReas"></uni-data-select> <uni-data-select v-model="ExceptionForms.abnormalType" :localdata="exception" @change="stopReas"></uni-data-select>
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<u-form-item label="原因" prop="abnormalReason"> <u-form-item label="原因" prop="abnormalReason">
<uni-data-select :localdata="reasonList" @change="changeReason"></uni-data-select> <uni-data-select v-model="ExceptionForms.abnormalReason" :localdata="reasonList"></uni-data-select>
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
...@@ -351,7 +343,7 @@ ...@@ -351,7 +343,7 @@
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<u-form-item label="生产工单" prop="workorderCode"> <u-form-item label="生产工单" prop="workorderCode">
<uni-data-select @change="materialReturnWorkorderProcessItem" :localdata="curTaskInfo.workorderOption"></uni-data-select> <uni-data-select v-model="curTaskInfo.workorderCode" @change="materialReturnWorkorderProcessItem" :localdata="curTaskInfo.workorderOption"></uni-data-select>
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
...@@ -416,7 +408,7 @@ ...@@ -416,7 +408,7 @@
width="1600rpx" width="1600rpx"
> >
<view class="list-bar"> <view class="list-bar">
<u-form label-width="100px"> <u-form :model="materialReturnFormData" label-width="100px">
<u-row> <u-row>
<u-col span="6"> <u-col span="6">
<u-form-item label="编排单号"> <u-form-item label="编排单号">
...@@ -425,7 +417,7 @@ ...@@ -425,7 +417,7 @@
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<u-form-item label="生产工单" prop="workorderCode"> <u-form-item label="生产工单" prop="workorderCode">
<uni-data-select @change="materialReturnWorkorderChange" :localdata="curTaskInfo.workorderOption"></uni-data-select> <uni-data-select v-model="materialReturnFormData.workorderCode" @change="materialReturnWorkorderChange" :localdata="curTaskInfo.workorderOption"></uni-data-select>
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
...@@ -561,8 +553,8 @@ ...@@ -561,8 +553,8 @@
> >
<view class="list-bar"> <view class="list-bar">
<scroll-view scroll-y="true" class="scroll-list" :style="{ height: this.screenHeight - 280 + 'px' }"> <scroll-view scroll-y="true" class="scroll-list" :style="{ height: this.screenHeight - 280 + 'px' }">
<view style="display: flex;justify-content: space-between;flex-wrap: wrap;"> <view style="display: flex; justify-content: space-between; flex-wrap: wrap">
<image v-for="(line, index) in viewSop" @click="onPreviewTap(line)" style="padding:10px;" class="u-avatar-demo" :src="line" mode="aspectFill"></image> <image v-for="(line, index) in viewSop" :key="index" @click="onPreviewTap(line)" style="padding: 10px" class="u-avatar-demo" :src="line" mode="aspectFill"></image>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
...@@ -581,6 +573,10 @@ export default { ...@@ -581,6 +573,10 @@ export default {
}, },
data() { data() {
return { return {
stopReasonForm: {
reason: null,
desc: null
},
screenHeight: 768, screenHeight: 768,
title: '生产报工', title: '生产报工',
open: false, open: false,
...@@ -793,7 +789,10 @@ export default { ...@@ -793,7 +789,10 @@ export default {
dModelData: [], dModelData: [],
tableSelectData: [], tableSelectData: [],
feedbackForms: [], feedbackForms: [],
ExceptionForms: {}, ExceptionForms: {
abnormalType: null,
abnormalReason:null
},
viewSopPicture: [], viewSopPicture: [],
viewSop: [], viewSop: [],
reasonList: [], reasonList: [],
...@@ -937,11 +936,11 @@ export default { ...@@ -937,11 +936,11 @@ export default {
uni.$off('taskStatusChanged'); uni.$off('taskStatusChanged');
}, },
methods: { methods: {
onPreviewTap(url){ onPreviewTap(url) {
uni.previewImage({ uni.previewImage({
current: url, current: url,
urls: this.viewSop urls: this.viewSop
}) });
}, },
cellClick(row, index, column) { cellClick(row, index, column) {
if (column.name === 'arrangeCode') { if (column.name === 'arrangeCode') {
...@@ -965,17 +964,17 @@ export default { ...@@ -965,17 +964,17 @@ export default {
this.getTaskList(); this.getTaskList();
break; break;
case 'StartTask': case 'StartTask':
let status = false let status = false;
this.tableSelectData.forEach((item) => { this.tableSelectData.forEach((item) => {
if(item.status === 'BEGINNING') { if (item.status === 'BEGINNING') {
status = true status = true;
} else { } else {
this.changeStatus(item.taskId, 'BEGINNING'); this.changeStatus(item.taskId, 'BEGINNING');
} }
}); });
if (status) { if (status) {
this.$u.toast('该任务已开工,请勿重复开工') this.$u.toast('该任务已开工,请勿重复开工');
return return;
} }
this.getTaskList(); this.getTaskList();
break; break;
...@@ -1060,8 +1059,11 @@ export default { ...@@ -1060,8 +1059,11 @@ export default {
const ps = { const ps = {
toolMachinesCode: '', toolMachinesCode: '',
arrangeCode: selectData.arrangeCode, arrangeCode: selectData.arrangeCode,
workunitId: selectData.workunitId, workunitId: this.vuex_workunit.workunitId,
workunitCode: this.vuex_workunit.workunitCode,
workunitName: this.vuex_workunit.workunitName,
processId: selectData.processId, processId: selectData.processId,
taskId: selectData.taskId,
workorderId: selectData.workorderId, workorderId: selectData.workorderId,
toolRequestUseId: data[0].toolRequestUseId, toolRequestUseId: data[0].toolRequestUseId,
toolMachinesRecordList: data.map((v) => { toolMachinesRecordList: data.map((v) => {
...@@ -1098,7 +1100,7 @@ export default { ...@@ -1098,7 +1100,7 @@ export default {
this.tableSelectData = arr; this.tableSelectData = arr;
}, },
toggleRowSelection(checked, arr) { toggleRowSelection(checked, arr) {
console.log(this.tableSelectData, 'this.tableSelectData') console.log(this.tableSelectData, 'this.tableSelectData');
this.tableSelectData = arr; this.tableSelectData = arr;
}, },
knifeTemp() { knifeTemp() {
...@@ -1113,21 +1115,17 @@ export default { ...@@ -1113,21 +1115,17 @@ export default {
stopReasonChange(e) { stopReasonChange(e) {
this.stopReason += e; this.stopReason += e;
}, },
changeReason(abnormalReason) {
this.ExceptionForms.abnormalReason = abnormalReason;
},
workorderSelect(id, row) { workorderSelect(id, row) {
console.log(id, row); console.log(id, row);
row.workorderId = id row.workorderId = id;
const items = row.workorderList.find((item) => item.value === id); const items = row.workorderList.find((item) => item.value === id);
console.log(items, 'items'); console.log(items, 'items');
row.workorderCode = items.text; row.workorderCode = items.text;
row.printName = items.text; row.printName = items.text;
console.log(row, 'rows') console.log(row, 'rows');
}, },
stopReas(abnormalType) { stopReas(abnormalType) {
this.ExceptionForms.abnormalType = abnormalType;
// 查询原因 // 查询原因
this.$u.api.abnormal this.$u.api.abnormal
.detail({ .detail({
...@@ -1189,7 +1187,7 @@ export default { ...@@ -1189,7 +1187,7 @@ export default {
this.materialusagerecordLoading = true; this.materialusagerecordLoading = true;
this.$u.api this.$u.api
.materialusagerecordList({ .materialusagerecordList({
workstationId: this.vuex_workstation.workstationId, workstationId: this.vuex_workstation?.workstationId,
depletionMethod: this.currentType + 1, depletionMethod: this.currentType + 1,
taskId: this.curTaskInfo.taskId taskId: this.curTaskInfo.taskId
}) })
...@@ -1293,7 +1291,10 @@ export default { ...@@ -1293,7 +1291,10 @@ export default {
}, },
doException() { doException() {
this.ExceptionForms = {}; this.ExceptionForms = {
abnormalType: null,
abnormalReason:null
};
const item = this.tableSelectData[0]; const item = this.tableSelectData[0];
Object.assign(this.ExceptionForms, { Object.assign(this.ExceptionForms, {
...item, ...item,
...@@ -1502,7 +1503,7 @@ export default { ...@@ -1502,7 +1503,7 @@ export default {
this.curTaskInfo.workorderOption = this.curTaskInfo.proWorkorderList.map((s) => { this.curTaskInfo.workorderOption = this.curTaskInfo.proWorkorderList.map((s) => {
return { value: s.workorderCode, text: s.workorderCode }; return { value: s.workorderCode, text: s.workorderCode };
}); });
this.$u.api.listMaterialReturn({ taskId: taskInfo.taskId, workorderCode: ''}).then((res) => { this.$u.api.listMaterialReturn({ taskId: taskInfo.taskId, workorderCode: '' }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
t.materialReturnList = res.data; t.materialReturnList = res.data;
} }
...@@ -1520,10 +1521,9 @@ export default { ...@@ -1520,10 +1521,9 @@ export default {
}); });
}, },
materialReturnWorkorderChange(s) { materialReturnWorkorderChange(s) {
this.materialReturnFormData.workorderCode = s;
const t = this; const t = this;
const taskInfo = this.tableSelectData[0]; const taskInfo = this.tableSelectData[0];
this.$u.api.listMaterialReturn({ taskId: taskInfo.taskId, workorderCode: s}).then((res) => { this.$u.api.listMaterialReturn({ taskId: taskInfo.taskId, workorderCode: s }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
t.materialReturnList = res.data; t.materialReturnList = res.data;
} }
...@@ -1576,7 +1576,7 @@ export default { ...@@ -1576,7 +1576,7 @@ export default {
batchNo: s.batchCode, batchNo: s.batchCode,
packNo: s.packNo, packNo: s.packNo,
isQualified: s.isQualified, isQualified: s.isQualified,
workorderCode: t.materialReturnFormData.workorderCode, workorderCode: t.materialReturnFormData.workorderCode
}); });
} }
}); });
......
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