Commit 372ea4f2 authored by 张海景's avatar 张海景

update:修改排产数量改成任务数量

parent af17e432
...@@ -15,73 +15,71 @@ ...@@ -15,73 +15,71 @@
<!-- </view>--> <!-- </view>-->
<view> <view>
<u-form :model="tableParams" labelAlign="right" class="tableForm"> <u-form :model="tableParams" labelAlign="right" class="tableForm">
<u-form-item label="编排单号" label-width="70px" name="arrangeCode"> <u-form-item label="编排单号" label-width="70px" name="arrangeCode">
<uni-easyinput type="text" suffixIcon="scan" v-model="tableParams.arrangeCode" @iconClick="iconClickArrangeCode" placeholder="请输入编排单号" /> <uni-easyinput type="text" suffixIcon="scan" v-model="tableParams.arrangeCode" @iconClick="iconClickArrangeCode" placeholder="请输入编排单号" />
</u-form-item> </u-form-item>
<u-form-item label="生产工单编号" label-width="100px" name="workorderCode"> <u-form-item label="生产工单编号" label-width="100px" name="workorderCode">
<uni-easyinput type="text" suffixIcon="scan" v-model="tableParams.workorderCode" @iconClick="iconClickWorkorderCode" placeholder="请输入生产工单编号" /> <uni-easyinput type="text" suffixIcon="scan" v-model="tableParams.workorderCode" @iconClick="iconClickWorkorderCode" placeholder="请输入生产工单编号" />
</u-form-item> </u-form-item>
<u-form-item name="allowProduce" label-width="80px" label="当前可加工"> <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>
<u-form-item name="allowProduce" > <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-item>
</u-form> </u-form>
</view> </view>
<view class="prod-body-left-task"> <view class="prod-body-left-task">
<zb-table <zb-table
ref="zbtable" ref="zbtable"
:columns="tableColumn" :columns="tableColumn"
:stripe="true" :stripe="true"
rowKey="taskWorkunitId" rowKey="taskWorkunitId"
:isTrClassStyle="isTrClassStyle" :isTrClassStyle="isTrClassStyle"
@rowClick="rowClick" @rowClick="rowClick"
@toggleRowSelection="toggleRowSelection" @toggleRowSelection="toggleRowSelection"
@toggleAllSelection="toggleAllSelection" @toggleAllSelection="toggleAllSelection"
:border="true" :border="true"
:data="tableData" :data="tableData"
> ></zb-table>
</zb-table>
</view> </view>
<view class="prod-body-left-num">可选订单数:{{ tableData.length }}</view> <view class="prod-body-left-num">可选订单数:{{ tableData.length }}</view>
<!-- <view class="prod-body-left-bom"> --> <!-- <view class="prod-body-left-bom"> -->
<!-- <view class="prod-body-left-bom-type">--> <!-- <view class="prod-body-left-bom-type">-->
<!-- <u-subsection :list="typeList" :current="currentType" type="primary" font-size="28"--> <!-- <u-subsection :list="typeList" :current="currentType" type="primary" font-size="28"-->
<!-- @change="typeChange"></u-subsection>--> <!-- @change="typeChange"></u-subsection>-->
<!-- </view>--> <!-- </view>-->
<!-- <view class="prod-body-left-bom-table">--> <!-- <view class="prod-body-left-bom-table">-->
<!-- <u-form>--> <!-- <u-form>-->
<!-- <u-row gutter="16">--> <!-- <u-row gutter="16">-->
<!-- <u-col span="3">--> <!-- <u-col span="3">-->
<!-- <u-form-item label="任务单号" label-width="150">--> <!-- <u-form-item label="任务单号" label-width="150">-->
<!-- {{ curTaskInfo.taskCode }}--> <!-- {{ curTaskInfo.taskCode }}-->
<!-- </u-form-item>--> <!-- </u-form-item>-->
<!-- </u-col>--> <!-- </u-col>-->
<!-- <u-col span="4">--> <!-- <u-col span="4">-->
<!-- <u-form-item label="物料条码" label-width="150">--> <!-- <u-form-item label="物料条码" label-width="150">-->
<!-- <SearchInput v-model="materialRecordInfo.materialBatchNumber" placeholder="请输入物料条码"--> <!-- <SearchInput v-model="materialRecordInfo.materialBatchNumber" placeholder="请输入物料条码"-->
<!-- hassearchbtn="true"--> <!-- hassearchbtn="true"-->
<!-- @inputchange="(val)=>{materialRecordInfo.materialBatchNumber=val}"/>--> <!-- @inputchange="(val)=>{materialRecordInfo.materialBatchNumber=val}"/>-->
<!-- </u-form-item>--> <!-- </u-form-item>-->
<!-- </u-col>--> <!-- </u-col>-->
<!-- <u-col span="2">--> <!-- <u-col span="2">-->
<!-- <u-form-item label="数量">--> <!-- <u-form-item label="数量">-->
<!-- <u-number-box :min="0" v-model="materialRecordInfo.quantity"></u-number-box>--> <!-- <u-number-box :min="0" v-model="materialRecordInfo.quantity"></u-number-box>-->
<!-- </u-form-item>--> <!-- </u-form-item>-->
<!-- </u-col>--> <!-- </u-col>-->
<!-- <u-col span="1">--> <!-- <u-col span="1">-->
<!-- <u-button type="primary" size="mini" @click="commonClick('MaterialUsageRecord')">添加</u-button>--> <!-- <u-button type="primary" size="mini" @click="commonClick('MaterialUsageRecord')">添加</u-button>-->
<!-- </u-col>--> <!-- </u-col>-->
<!-- <u-col span="1">--> <!-- <u-col span="1">-->
<!-- </u-col>--> <!-- </u-col>-->
<!-- <u-col span="5">--> <!-- <u-col span="5">-->
<!-- </u-col>--> <!-- </u-col>-->
<!-- </u-row>--> <!-- </u-row>-->
<!-- </u-form>--> <!-- </u-form>-->
<!-- <zb-table :columns="issusLineColumn" :stripe="true" :fit="true" :border="true" :data="issusLineList"></zb-table> --> <!-- <zb-table :columns="issusLineColumn" :stripe="true" :fit="true" :border="true" :data="issusLineList"></zb-table> -->
<!-- </view>--> <!-- </view>-->
<!-- </view> --> <!-- </view> -->
</view> </view>
<scroll-view class="prod-body-right" scroll-y> <scroll-view class="prod-body-right" scroll-y>
...@@ -114,8 +112,8 @@ ...@@ -114,8 +112,8 @@
width="1800rpx" width="1800rpx"
> >
<view> <view>
<scroll-view style="max-height:600px;" scroll-y="true" class="scroll-Y"> <scroll-view style="max-height: 600px" scroll-y="true" class="scroll-Y">
<view class="feedback-card" v-for="(feedback,i) in feedbackForms" :key="i"> <view class="feedback-card" v-for="(feedback, i) in feedbackForms" :key="i">
<u-form label-width="80px" :model="feedback" :rules="rules" labelAlign="right"> <u-form label-width="80px" :model="feedback" :rules="rules" labelAlign="right">
<u-row> <u-row>
<u-col span="6"> <u-col span="6">
...@@ -137,13 +135,9 @@ ...@@ -137,13 +135,9 @@
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<u-form-item label="报工人:" prop="nickName"> <u-form-item label="报工人:" prop="nickName">
<u-input v-model="feedback.nickName"></u-input> <u-input v-model="feedback.nickName"></u-input>
<u-button <u-button @tap="getCode(feedback)" type="success" size="mini">报工人员</u-button>
@tap="getCode(feedback)" </u-form-item>
type="success"
size="mini"
>报工人员</u-button>
</u-form-item>
</u-col> </u-col>
</u-row> </u-row>
...@@ -155,8 +149,7 @@ ...@@ -155,8 +149,7 @@
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<u-form-item label="生产工单:" prop="workorderId"> <u-form-item label="生产工单:" prop="workorderId">
<uni-data-select v-model="feedback.workorderId" <uni-data-select v-model="feedback.workorderId" :localdata="feedback.workorderOption" @change="workorderSelect($event, i)"></uni-data-select>
:localdata="feedback.workorderOption" @change="workorderSelect($event, i)"></uni-data-select>
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
...@@ -184,10 +177,10 @@ ...@@ -184,10 +177,10 @@
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<u-form-item v-if="feedback.whether=='1'" label="打印内容:" prop="printContents"> <u-form-item v-if="feedback.whether == '1'" label="打印内容:" prop="printContents">
{{feedback.printContents}} {{ feedback.printContents }}
<!-- <u-input v-model="feedback."></u-input> --> <!-- <u-input v-model="feedback."></u-input> -->
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
<view v-if="feedback.isLastProcess"> <view v-if="feedback.isLastProcess">
...@@ -217,12 +210,7 @@ ...@@ -217,12 +210,7 @@
<u-col span="6"> <u-col span="6">
<u-form-item label="打印模板:" prop="printTemplate"> <u-form-item label="打印模板:" prop="printTemplate">
<u-input v-model="feedback.printTemplate" placeholder="请选择打印模板"></u-input> <u-input v-model="feedback.printTemplate" placeholder="请选择打印模板"></u-input>
<u-button <u-button @tap="getPrintTemplate(feedback)" type="success" style="margin-left: 20rpx" size="mini">选择打印模板</u-button>
@tap="getPrintTemplate(feedback)"
type="success"
style="margin-left:20rpx;"
size="mini"
>选择打印模板</u-button>
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
...@@ -278,9 +266,9 @@ ...@@ -278,9 +266,9 @@
</u-col> </u-col>
</u-row> </u-row>
</u-form> --> </u-form> -->
<dModelList :data="dModelData" @action="upDownGetList"/> <dModelList :data="dModelData" @action="upDownGetList" />
</u-modal> </u-modal>
<!-- //生产报工报工人员 --> <!-- //生产报工报工人员 -->
<u-modal <u-modal
title="报工人员" title="报工人员"
@confirm="userDetermine()" @confirm="userDetermine()"
...@@ -288,7 +276,7 @@ ...@@ -288,7 +276,7 @@
:title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '37px', 'padding-top': '0px' }" :title-style="{ 'background-color': '#1E3770', color: '#FFFFFF', 'line-height': '37px', 'padding-top': '0px' }"
v-model="userTempVisible" v-model="userTempVisible"
width="1300rpx" width="1300rpx"
> >
<view class="feedback-card"> <view class="feedback-card">
<userPersonnel ref="userPersonnelRef" v-if="userTempVisible" :data="usePersonData" /> <userPersonnel ref="userPersonnelRef" v-if="userTempVisible" :data="usePersonData" />
</view> </view>
...@@ -305,11 +293,11 @@ ...@@ -305,11 +293,11 @@
<u-form label-width="120px" :model="stopReasonForm" :rules="rules"> <u-form label-width="120px" :model="stopReasonForm" :rules="rules">
<u-form-item label="暂停原因" prop="reason"> <u-form-item label="暂停原因" prop="reason">
<!-- <uni-data-select v-model="stopReasonForm.reason" :localdata="exception" @change="stopReas"></uni-data-select> --> <!-- <uni-data-select v-model="stopReasonForm.reason" :localdata="exception" @change="stopReas"></uni-data-select> -->
<uni-data-select v-model="stopReasonForm.reason" :localdata="causeList" @change="stopCause"></uni-data-select> <uni-data-select v-model="stopReasonForm.reason" :localdata="causeList" @change="stopCause"></uni-data-select>
</u-form-item> </u-form-item>
<u-form-item label="暂停描述" prop="desc"> <u-form-item label="暂停描述" prop="desc">
<!-- <uni-data-selec v-model="stopReasonForm.desc" :localdata="reasonList" type=“textarea”></uni-data-select> --> <!-- <uni-data-selec v-model="stopReasonForm.desc" :localdata="reasonList" type=“textarea”></uni-data-select> -->
<u-input v-model="stopReasonForm.desc" type="textarea"></u-input> <u-input v-model="stopReasonForm.desc" type="textarea"></u-input>
</u-form-item> </u-form-item>
</u-form> </u-form>
</view> </view>
...@@ -324,7 +312,7 @@ ...@@ -324,7 +312,7 @@
width="1300rpx" width="1300rpx"
> >
<view class="feedback-card"> <view class="feedback-card">
<u-form label-width="70px" labelAlign ="right" :model="ExceptionForms" :rules="rules"> <u-form label-width="70px" labelAlign="right" :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" />
...@@ -444,20 +432,20 @@ ...@@ -444,20 +432,20 @@
width="1300rpx" width="1300rpx"
> >
<view class="list-bar"> <view class="list-bar">
<u-form label-width="100px" :model="curTaskInfo"> <u-form label-width="100px" :model="curTaskInfo">
<u-row> <u-row>
<u-col span="6"> <u-col span="6">
<u-form-item label="编排单号"> <u-form-item label="编排单号">
{{ curTaskInfo.arrangeCode }} {{ curTaskInfo.arrangeCode }}
</u-form-item> </u-form-item>
</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 v-model="curTaskInfo.workorderCode" @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>
</u-form> </u-form>
<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' }">
<uni-table ref="materialRequestTable" border stripe :loading="loading" emptyText="未查询到数据"> <uni-table ref="materialRequestTable" border stripe :loading="loading" emptyText="未查询到数据">
<uni-tr> <uni-tr>
...@@ -613,7 +601,7 @@ ...@@ -613,7 +601,7 @@
<zb-table :columns="tableDetailColumn" :stripe="true" :border="true" :data="tableDataDetail"></zb-table> <zb-table :columns="tableDetailColumn" :stripe="true" :border="true" :data="tableDataDetail"></zb-table>
</view> </view>
</u-modal> </u-modal>
<!-- //查询图片生产工单 --> <!-- //查询图片生产工单 -->
<u-modal <u-modal
title="生产工单" title="生产工单"
show-cancel-button show-cancel-button
...@@ -670,7 +658,7 @@ ...@@ -670,7 +658,7 @@
</view> </view>
</u-modal> </u-modal>
<u-modal <u-modal
title="作业分派" title="作业分派"
@confirm="handleSubmitJobAssignment" @confirm="handleSubmitJobAssignment"
show-cancel-button show-cancel-button
...@@ -685,11 +673,7 @@ ...@@ -685,11 +673,7 @@
</u-form-item> </u-form-item>
<u-form-item label="工作单元"> <u-form-item label="工作单元">
<u-input disabled v-model="jobAssignmentForm.workunitName" placeholder="选择工作单元"></u-input> <u-input disabled v-model="jobAssignmentForm.workunitName" placeholder="选择工作单元"></u-input>
<u-button <u-button @tap="workunitVisible = true" type="success" size="mini">选择工作单元</u-button>
@tap="workunitVisible = true"
type="success"
size="mini"
>选择工作单元</u-button>
</u-form-item> </u-form-item>
</u-form> </u-form>
</view> </view>
...@@ -717,7 +701,7 @@ import userPersonnel from './components/userPersonnel.vue'; ...@@ -717,7 +701,7 @@ import userPersonnel from './components/userPersonnel.vue';
import printTemplate from './components/printTemplate.vue'; import printTemplate from './components/printTemplate.vue';
import workunitList from './components/workunitList.vue'; import workunitList from './components/workunitList.vue';
import UButton from '../../../uview-ui/components/u-button/u-button.vue'; import UButton from '../../../uview-ui/components/u-button/u-button.vue';
import { handleError } from "vue"; import { handleError } from 'vue';
export default { export default {
name: 'ProdReport', name: 'ProdReport',
components: { components: {
...@@ -738,10 +722,11 @@ export default { ...@@ -738,10 +722,11 @@ export default {
}, },
listTabPro: [ listTabPro: [
{ {
name: '指令列表' name: '指令列表'
}, { },
name: 'SIZE列表' {
} name: 'SIZE列表'
}
], ],
tableParams: { tableParams: {
allowProduce: 1, allowProduce: 1,
...@@ -763,7 +748,7 @@ export default { ...@@ -763,7 +748,7 @@ export default {
desc: null desc: null
}, },
screenHeight: 768, screenHeight: 768,
usePersonData: {}, usePersonData: {},
title: '生产报工', title: '生产报工',
proVisible: false, proVisible: false,
errorVisible: false, errorVisible: false,
...@@ -806,7 +791,7 @@ export default { ...@@ -806,7 +791,7 @@ export default {
{ {
value: 'DEVI', value: 'DEVI',
text: '设备异常' text: '设备异常'
}, }
], ],
stopReason: '', stopReason: '',
stopReasonVisible: false, stopReasonVisible: false,
...@@ -884,7 +869,7 @@ export default { ...@@ -884,7 +869,7 @@ export default {
label: '编排单号', label: '编排单号',
width: 85, width: 85,
cellFun: (row, index) => { cellFun: (row, index) => {
console.log(row, index) console.log(row, index);
this.tableDataDetail = row.proWorkorderList; this.tableDataDetail = row.proWorkorderList;
this.showRowDeatilFlag = true; this.showRowDeatilFlag = true;
} }
...@@ -892,7 +877,7 @@ export default { ...@@ -892,7 +877,7 @@ export default {
{ {
name: 'scheduleStartDateStr', name: 'scheduleStartDateStr',
label: '计划开始时间', label: '计划开始时间',
width: 95, width: 95
}, },
{ {
name: 'scheduleEndDateStr', name: 'scheduleEndDateStr',
...@@ -901,8 +886,8 @@ export default { ...@@ -901,8 +886,8 @@ export default {
}, },
{ {
name: 'quantity', name: 'quantity',
label: '排产数量', label: '任务数量',
width: 70, width: 70
}, },
{ {
name: 'quantityWait', name: 'quantityWait',
...@@ -919,7 +904,7 @@ export default { ...@@ -919,7 +904,7 @@ export default {
ERROR_STOP: '异常停工', ERROR_STOP: '异常停工',
FINISH: '完工' FINISH: '完工'
}, },
width: 65, width: 65
}, },
// { // {
// name: 'date', // name: 'date',
...@@ -953,13 +938,13 @@ export default { ...@@ -953,13 +938,13 @@ export default {
{ {
name: 'quantityQualify', name: 'quantityQualify',
label: '合格数量', label: '合格数量',
width: 70, width: 70
}, },
{ {
name: 'quantityUnqualify', name: 'quantityUnqualify',
label: '不合格数量', label: '不合格数量',
width: 80, width: 80
}, }
// { // {
// name: 'clientName', // name: 'clientName',
// label: '作业人员', // label: '作业人员',
...@@ -972,12 +957,12 @@ export default { ...@@ -972,12 +957,12 @@ export default {
feedbackForms: [], feedbackForms: [],
ExceptionForms: { ExceptionForms: {
abnormalType: null, abnormalType: null,
abnormalReason:null abnormalReason: null
}, },
viewSopPicture: [], viewSopPicture: [],
viewSop: [], viewSop: [],
reasonList: [], reasonList: [],
causeList: [], causeList: [],
workorderList: [], workorderList: [],
materialUsageRecordList: [], materialUsageRecordList: [],
materialusagerecordLoading: false, materialusagerecordLoading: false,
...@@ -1030,7 +1015,7 @@ export default { ...@@ -1030,7 +1015,7 @@ export default {
feedingInspectionList: [], feedingInspectionList: [],
recoilMaterialList: [], recoilMaterialList: [],
materialRequestList: [], materialRequestList: [],
materialRequestArrays: [], materialRequestArrays: [],
materialReturnList: [], materialReturnList: [],
materialRequestFormData: { materialRequestFormData: {
itemName: null, itemName: null,
...@@ -1122,7 +1107,7 @@ export default { ...@@ -1122,7 +1107,7 @@ export default {
}, },
methods: { methods: {
handleChangeTabPro(index, row) { handleChangeTabPro(index, row) {
row.currentTabPro = index row.currentTabPro = index;
}, },
onPreviewTap(url) { onPreviewTap(url) {
uni.previewImage({ uni.previewImage({
...@@ -1139,30 +1124,26 @@ export default { ...@@ -1139,30 +1124,26 @@ export default {
// } // }
// }, // },
iconClickArrangeCode() { iconClickArrangeCode() {
uni.scanCode( uni.scanCode({
{ success: (res) => {
success:(res)=> { console.log(res, 'res');
console.log(res, 'res') this.getTaskList({ arrangeCode: res.result });
this.getTaskList({arrangeCode: res.result}) },
}, fail: () => {
fail: ()=> { this.$u.toast('扫码失败,请重新扫描');
this.$u.toast('扫码失败,请重新扫描')
}
} }
) });
}, },
iconClickWorkorderCode(data) { iconClickWorkorderCode(data) {
uni.scanCode( uni.scanCode({
{ success: (res) => {
success:(res)=> { console.log(res, 'res');
console.log(res, 'res') this.getTaskList({ workorderCode: res.result });
this.getTaskList({workorderCode: res.result}) },
}, fail: () => {
fail: ()=> { this.$u.toast('扫码失败,请重新扫描');
this.$u.toast('扫码失败,请重新扫描')
}
} }
) });
}, },
numclik(...arg) { numclik(...arg) {
console.log('99999999', arg); console.log('99999999', arg);
...@@ -1175,10 +1156,10 @@ export default { ...@@ -1175,10 +1156,10 @@ export default {
// console.log(row, i, 999) // console.log(row, i, 999)
var oDate1 = new Date(); var oDate1 = new Date();
var oDate2 = new Date(row.scheduleEndDate); var oDate2 = new Date(row.scheduleEndDate);
if(oDate1.getTime() > oDate2.getTime()){ if (oDate1.getTime() > oDate2.getTime()) {
return true; //第一个大 return true; //第一个大
} else { } else {
return false; //第二个大 return false; //第二个大
} }
}, },
commonClick(oper) { commonClick(oper) {
...@@ -1198,8 +1179,8 @@ export default { ...@@ -1198,8 +1179,8 @@ export default {
} else { } else {
this.$u.api.changeCheckMachineTool({ this.$u.api.changeCheckMachineTool({
taskWorkunitId: item.taskWorkunitId taskWorkunitId: item.taskWorkunitId
}) });
this.changeStatus(item.taskId, item.taskWorkunitId,'BEGINNING',item.workunitId, false); this.changeStatus(item.taskId, item.taskWorkunitId, 'BEGINNING', item.workunitId, false);
} }
}); });
if (status) { if (status) {
...@@ -1208,13 +1189,13 @@ export default { ...@@ -1208,13 +1189,13 @@ export default {
} }
break; break;
case 'StopTask': case 'StopTask':
this.stopCause(); this.stopCause();
this.stopReason = ''; this.stopReason = '';
this.stopReasonVisible = true; this.stopReasonVisible = true;
break; break;
case 'FinshTask': case 'FinshTask':
this.tableSelectData.forEach((item) => { this.tableSelectData.forEach((item) => {
this.changeStatus(item.taskId, item.taskWorkunitId,'FINISHED',item.workunitId); this.changeStatus(item.taskId, item.taskWorkunitId, 'FINISHED', item.workunitId);
}); });
break; break;
case 'Prod': case 'Prod':
...@@ -1259,22 +1240,22 @@ export default { ...@@ -1259,22 +1240,22 @@ export default {
this.jobAssignmentForm = { this.jobAssignmentForm = {
quantity: 1, quantity: 1,
workunitName: null workunitName: null
} };
this.jobAssignmentVisible = true this.jobAssignmentVisible = true;
}, },
handleSubmitWorkunit() { handleSubmitWorkunit() {
this.jobAssignmentForm.workunitId = this.$refs.workunitRef.tableSelectData[0].workunitId this.jobAssignmentForm.workunitId = this.$refs.workunitRef.tableSelectData[0].workunitId;
this.jobAssignmentForm.workunitName = this.$refs.workunitRef.tableSelectData[0].workunitName this.jobAssignmentForm.workunitName = this.$refs.workunitRef.tableSelectData[0].workunitName;
}, },
handleSubmitJobAssignment() { handleSubmitJobAssignment() {
let datas = Object.assign({}, this.tableSelectData[0]) let datas = Object.assign({}, this.tableSelectData[0]);
datas.taskWorkunit = this.jobAssignmentForm datas.taskWorkunit = this.jobAssignmentForm;
delete datas.proWorkorderList delete datas.proWorkorderList;
this.$u.api.putProtaskSplit(datas).then((res) => { this.$u.api.putProtaskSplit(datas).then((res) => {
// console.log(res, 'res333') // console.log(res, 'res333')
if (res.code === 200) { if (res.code === 200) {
this.jobAssignmentVisible = false this.jobAssignmentVisible = false;
this.getTaskList() this.getTaskList();
} }
}); });
}, },
...@@ -1352,13 +1333,13 @@ export default { ...@@ -1352,13 +1333,13 @@ export default {
}); });
}, },
rowClick(row, index) { rowClick(row, index) {
this.$refs.zbtable.toggleRowSelection(row) this.$refs.zbtable.toggleRowSelection(row);
this.curTaskInfo = row; this.curTaskInfo = row;
this.getMaterialUsageRecordList(); this.getMaterialUsageRecordList();
}, },
getCode(row){ getCode(row) {
this.usePersonData = row this.usePersonData = row;
this.userTempVisible=true; this.userTempVisible = true;
}, },
toggleAllSelection(checked, arr) { toggleAllSelection(checked, arr) {
// console.log(arr, 'this.tableSelectData'); // console.log(arr, 'this.tableSelectData');
...@@ -1371,14 +1352,14 @@ export default { ...@@ -1371,14 +1352,14 @@ export default {
knifeTemp() { knifeTemp() {
// this.$u.toast('刀具校验通过!'); // this.$u.toast('刀具校验通过!');
}, },
userDetermine(){ userDetermine() {
console.log(this.$refs.userPersonnelRef.tableSelectData, 'this.$refs.userPersonnelRef.tableSelectData') console.log(this.$refs.userPersonnelRef.tableSelectData, 'this.$refs.userPersonnelRef.tableSelectData');
this.usePersonData.nickName=this.$refs.userPersonnelRef.tableSelectData[0].nickName this.usePersonData.nickName = this.$refs.userPersonnelRef.tableSelectData[0].nickName;
this.usePersonData.userName = this.$refs.userPersonnelRef.tableSelectData[0]?.userName this.usePersonData.userName = this.$refs.userPersonnelRef.tableSelectData[0]?.userName;
}, },
stopReasonSubmit() { stopReasonSubmit() {
this.tableSelectData.forEach((item) => { this.tableSelectData.forEach((item) => {
this.changeStop(item.taskId, item.taskWorkunitId,'PAUSE', item.workunitId); this.changeStop(item.taskId, item.taskWorkunitId, 'PAUSE', item.workunitId);
}); });
this.getTaskList(); this.getTaskList();
}, },
...@@ -1386,30 +1367,30 @@ export default { ...@@ -1386,30 +1367,30 @@ export default {
this.stopReason += e; this.stopReason += e;
}, },
workorderSelect(id, index) { workorderSelect(id, index) {
console.log(id, '9999') console.log(id, '9999');
const row = this.feedbackForms[index]; const row = this.feedbackForms[index];
if(!id){ if (!id) {
row.sizeList = []; row.sizeList = [];
row.directiveList = []; row.directiveList = [];
row.workorderSoSizeItemId = ''; row.workorderSoSizeItemId = '';
row.printContents = row.arrangeCode row.printContents = row.arrangeCode;
row.workorderSoDirectiveId = ''; row.workorderSoDirectiveId = '';
row.tableDirectiveData = [] row.tableDirectiveData = [];
row.tableSizeColumn = [] row.tableSizeColumn = [];
row.tableSizeData = [] row.tableSizeData = [];
return; return;
} else { } else {
if (row.isLastProcess) { if (row.isLastProcess) {
this.getWorkorderDirectiveList(id, index) this.getWorkorderDirectiveList(id, index);
this.getWorkorderSizeList(id, index) this.getWorkorderSizeList(id, index);
} }
} }
row.workorderId = id; row.workorderId = id;
const items = row.workorderList.find((item) => item.workorderId === id); const items = row.workorderList.find((item) => item.workorderId === id);
row.workorderCode = items.workorderCode; row.workorderCode = items.workorderCode;
row.printName = items.workorderCode; row.printName = items.workorderCode;
//row.printContents =row.arrangeCode+row.workorderCode //row.printContents =row.arrangeCode+row.workorderCode
row.printContents =row.workorderCode row.printContents = row.workorderCode;
row.sizeList = row.sizeData[id]; row.sizeList = row.sizeData[id];
row.directiveList = row.directiveData[id]; row.directiveList = row.directiveData[id];
row.packByDirective = items.packByDirective; row.packByDirective = items.packByDirective;
...@@ -1439,7 +1420,7 @@ export default { ...@@ -1439,7 +1420,7 @@ export default {
.detail({ .detail({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
abnormalType:'WORK' abnormalType: 'WORK'
}) })
.then((res) => { .then((res) => {
this.causeList = res.rows.map((item) => { this.causeList = res.rows.map((item) => {
...@@ -1460,48 +1441,48 @@ export default { ...@@ -1460,48 +1441,48 @@ export default {
.then((res) => { .then((res) => {
item.workorderList = res.rows; item.workorderList = res.rows;
//如果只关联一个订单,默认选中 //如果只关联一个订单,默认选中
if(res.rows.length==1){ if (res.rows.length == 1) {
item.printContents = res.rows[0].workorderCode item.printContents = res.rows[0].workorderCode;
item.workorderId = res.rows[0].workorderId; item.workorderId = res.rows[0].workorderId;
item.workorderCode = res.rows[0].workorderCode; item.workorderCode = res.rows[0].workorderCode;
if (item.isLastProcess) { if (item.isLastProcess) {
this.getWorkorderDirectiveList(res.rows[0].workorderId, index) this.getWorkorderDirectiveList(res.rows[0].workorderId, index);
this.getWorkorderSizeList(res.rows[0].workorderId, index) this.getWorkorderSizeList(res.rows[0].workorderId, index);
} }
if(res.rows[0].sizeList2!=null){ if (res.rows[0].sizeList2 != null) {
item.sizeList = res.rows[0].sizeList2.map(temp2=>{ item.sizeList = res.rows[0].sizeList2.map((temp2) => {
return { return {
value: temp2.workorderSoSizeItemId, value: temp2.workorderSoSizeItemId,
text: temp2.standardSize text: temp2.standardSize
} };
}); });
} }
if(res.rows[0].saleDirectiveList!=null){ if (res.rows[0].saleDirectiveList != null) {
item.directiveList = res.rows[0].saleDirectiveList.map(temp2=>{ item.directiveList = res.rows[0].saleDirectiveList.map((temp2) => {
return { return {
value: temp2.workorderSoDirectiveId, value: temp2.workorderSoDirectiveId,
text: temp2.clientCmd text: temp2.clientCmd
} };
}); });
} }
item.packByDirective = res.rows[0].packByDirective; item.packByDirective = res.rows[0].packByDirective;
item.packBySize = res.rows[0].packBySize; item.packBySize = res.rows[0].packBySize;
} }
item.workorderOption = res.rows.map((temp) => { item.workorderOption = res.rows.map((temp) => {
if(temp.saleDirectiveList!=null){ if (temp.saleDirectiveList != null) {
item.directiveData[temp.workorderId] = temp.saleDirectiveList.map(temp2=>{ item.directiveData[temp.workorderId] = temp.saleDirectiveList.map((temp2) => {
return { return {
value: temp2.workorderSoDirectiveId, value: temp2.workorderSoDirectiveId,
text: temp2.clientCmd text: temp2.clientCmd
} };
}); });
} }
if(temp.sizeList2!=null){ if (temp.sizeList2 != null) {
item.sizeData[temp.workorderId] = temp.sizeList2.map(temp2=>{ item.sizeData[temp.workorderId] = temp.sizeList2.map((temp2) => {
return { return {
value: temp2.workorderSoSizeItemId, value: temp2.workorderSoSizeItemId,
text: temp2.standardSize text: temp2.standardSize
} };
}); });
} }
return { return {
...@@ -1515,7 +1496,7 @@ export default { ...@@ -1515,7 +1496,7 @@ export default {
getTaskList(params) { getTaskList(params) {
this.form = {}; this.form = {};
const t = this; const t = this;
this.tableData= [] this.tableData = [];
this.$u.api this.$u.api
.getTaskList({ .getTaskList({
workunitId: t.vuex_workunit.workunitId, workunitId: t.vuex_workunit.workunitId,
...@@ -1525,13 +1506,13 @@ export default { ...@@ -1525,13 +1506,13 @@ export default {
.then((res) => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
// 过滤可加工数量为0的数据 // 过滤可加工数量为0的数据
this.tableData = res.rows.map(item => { this.tableData = res.rows.map((item) => {
return { return {
...item, ...item,
scheduleStartDateStr: item.scheduleStartDate.substring(2, 16), scheduleStartDateStr: item.scheduleStartDate.substring(2, 16),
scheduleEndDateStr: item.scheduleEndDate.substring(2, 16), scheduleEndDateStr: item.scheduleEndDate.substring(2, 16)
} };
}) });
if (this.tableData.length > 0) { if (this.tableData.length > 0) {
this.curTaskInfo = this.tableData[0]; this.curTaskInfo = this.tableData[0];
this.getMaterialUsageRecordList(); this.getMaterialUsageRecordList();
...@@ -1596,20 +1577,20 @@ export default { ...@@ -1596,20 +1577,20 @@ export default {
} }
}); });
}, },
changeStatus(taskId, taskWorkunitId, status,workunitId, showToast ) { changeStatus(taskId, taskWorkunitId, status, workunitId, showToast) {
// this.form.status = status; // this.form.status = status;
this.$u.api this.$u.api
.changeStatus({ .changeStatus({
taskId: taskId, taskId: taskId,
status: status, status: status,
taskWorkunitId: taskWorkunitId, taskWorkunitId: taskWorkunitId,
workunitId: workunitId, workunitId: workunitId,
attr1: this.stopReason attr1: this.stopReason
}) })
.then((res) => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
let showToastData = showToast === false? false: true let showToastData = showToast === false ? false : true;
if(showToastData) { if (showToastData) {
this.$u.toast('变更成功'); this.$u.toast('变更成功');
} }
this.getTaskList(); this.getTaskList();
...@@ -1617,23 +1598,23 @@ export default { ...@@ -1617,23 +1598,23 @@ export default {
}); });
}, },
//暂停作业 //暂停作业
changeStop(taskId, taskWorkunitId, status , workunitId) { changeStop(taskId, taskWorkunitId, status, workunitId) {
// this.form.status = status; // this.form.status = status;
this.$u.api this.$u.api
.changeStatus({ .changeStatus({
taskId: taskId, taskId: taskId,
status: status, status: status,
taskWorkunitId: taskWorkunitId, taskWorkunitId: taskWorkunitId,
workunitId: workunitId, workunitId: workunitId,
attr1: this.stopReasonForm.reason, attr1: this.stopReasonForm.reason,
attr2: this.stopReasonForm.desc attr2: this.stopReasonForm.desc
}) })
.then((res) => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.$u.toast('变更成功'); this.$u.toast('变更成功');
this.getTaskList(); this.getTaskList();
} }
}); });
}, },
// reset() { // reset() {
// this.feedbackForm = { // this.feedbackForm = {
...@@ -1650,20 +1631,20 @@ export default { ...@@ -1650,20 +1631,20 @@ export default {
this.feedbackForm.quantity = this.feedbackForm.quantityQualify + this.feedbackForm.quantityUnqualify; this.feedbackForm.quantity = this.feedbackForm.quantityQualify + this.feedbackForm.quantityUnqualify;
}, },
getPrintTemplate(row) { getPrintTemplate(row) {
this.printTemplateData = row this.printTemplateData = row;
this.printTemplateVisible = true this.printTemplateVisible = true;
}, },
handleSubmitPrintTemplate() { handleSubmitPrintTemplate() {
this.printTemplateData.printTemplate = this.$refs.printTemplateRef.tableSelectData[0].name this.printTemplateData.printTemplate = this.$refs.printTemplateRef.tableSelectData[0].name;
this.printTemplateVisible = false this.printTemplateVisible = false;
}, },
doFeedback() { doFeedback() {
// this.reset(); // this.reset();
this.feedbackForms = []; this.feedbackForms = [];
this.tableSelectData.forEach((item, index) => { this.tableSelectData.forEach((item, index) => {
let defQualify = item.quantity-item.quantityQualify-item.quantityUnqualify; let defQualify = item.quantity - item.quantityQualify - item.quantityUnqualify;
defQualify = defQualify<0?0:defQualify; defQualify = defQualify < 0 ? 0 : defQualify;
defQualify = defQualify>item.quantityWait?item.quantityWait:defQualify; defQualify = defQualify > item.quantityWait ? item.quantityWait : defQualify;
const feedback = { const feedback = {
...item, ...item,
workstationId: item.workstationId, workstationId: item.workstationId,
...@@ -1672,10 +1653,10 @@ export default { ...@@ -1672,10 +1653,10 @@ export default {
taskWorkunitId: item.taskWorkunitId, taskWorkunitId: item.taskWorkunitId,
feedbackChannel: 'PAD', feedbackChannel: 'PAD',
quantity: item.quantity, quantity: item.quantity,
quantityQualify: Number(defQualify),//默认为排产数量-合格数-不合格数 quantityQualify: Number(defQualify), //默认为排产数量-合格数-不合格数
quantityUnqualify: 0, quantityUnqualify: 0,
printName: '', printName: '',
lastProcess: item.isLastProcess==1,//未工序 lastProcess: item.isLastProcess == 1, //未工序
nickName: this.vuex_user.nickName, nickName: this.vuex_user.nickName,
workorderId: 0, workorderId: 0,
workorderCode: null, workorderCode: null,
...@@ -1685,8 +1666,8 @@ export default { ...@@ -1685,8 +1666,8 @@ export default {
minPackageNum: 0, minPackageNum: 0,
workorderList: [], workorderList: [],
workorderOption: [], workorderOption: [],
directiveList:[], directiveList: [],
sizeList:[], sizeList: [],
directiveData: {}, directiveData: {},
sizeData: {}, sizeData: {},
printContents: item.arrangeCode, printContents: item.arrangeCode,
...@@ -1717,7 +1698,7 @@ export default { ...@@ -1717,7 +1698,7 @@ export default {
name: 'quantityQualify', name: 'quantityQualify',
label: '合格品数量', label: '合格品数量',
width: 130 width: 130
}, }
], ],
tableDirectiveData: [], tableDirectiveData: [],
tableSizeColumn: [], tableSizeColumn: [],
...@@ -1737,14 +1718,14 @@ export default { ...@@ -1737,14 +1718,14 @@ export default {
workorderId: id workorderId: id
}) })
.then((res) => { .then((res) => {
console.log(res, '88999res') console.log(res, '88999res');
if (res.code === 200) { if (res.code === 200) {
row.tableDirectiveData = res.rows row.tableDirectiveData = res.rows;
} }
// row.tableDirectiveData = [] // row.tableDirectiveData = []
// row.tableSizeColumn = [] // row.tableSizeColumn = []
// row.tableSizeData = [] // row.tableSizeData = []
}) });
}, },
// 获取SIZE列表 // 获取SIZE列表
getWorkorderSizeList(id, index) { getWorkorderSizeList(id, index) {
...@@ -1754,8 +1735,8 @@ export default { ...@@ -1754,8 +1735,8 @@ export default {
workorderId: id workorderId: id
}) })
.then((res) => { .then((res) => {
console.log(res, '88999resSize') console.log(res, '88999resSize');
let columns = [] let columns = [];
if (res.code === 200) { if (res.code === 200) {
for (const key in res.data.columns) { for (const key in res.data.columns) {
if (res.data.columns.hasOwnProperty.call(res.data.columns, key)) { if (res.data.columns.hasOwnProperty.call(res.data.columns, key)) {
...@@ -1763,20 +1744,20 @@ export default { ...@@ -1763,20 +1744,20 @@ export default {
let obj = { let obj = {
name: key, name: key,
label: element label: element
} };
columns.push(obj) columns.push(obj);
} }
} }
row.tableSizeColumn = columns row.tableSizeColumn = columns;
row.tableSizeData = res.data.sizeList row.tableSizeData = res.data.sizeList;
} }
}) });
}, },
doException() { doException() {
this.ExceptionForms = { this.ExceptionForms = {
abnormalType: null, abnormalType: null,
abnormalReason:null abnormalReason: null
}; };
const item = this.tableSelectData[0]; const item = this.tableSelectData[0];
Object.assign(this.ExceptionForms, { Object.assign(this.ExceptionForms, {
...@@ -1797,9 +1778,8 @@ export default { ...@@ -1797,9 +1778,8 @@ export default {
async newlyAddss() { async newlyAddss() {
const res = await this.$u.api.abnormal.newlyAdd(this.ExceptionForms); const res = await this.$u.api.abnormal.newlyAdd(this.ExceptionForms);
this.$u.toast('上报成功'); this.$u.toast('上报成功');
this.getTaskList(); this.getTaskList();
}, },
cancel() { cancel() {
this.proVisible = false; this.proVisible = false;
...@@ -1811,19 +1791,20 @@ export default { ...@@ -1811,19 +1791,20 @@ export default {
this.$u.toast('请填写合格/不合格产品数量!'); this.$u.toast('请填写合格/不合格产品数量!');
return; return;
} }
if(item.lastProcess){//最后工序 if (item.lastProcess) {
if(item.packByDirective=='Y' && !item.workorderSoDirectiveId){ //最后工序
if (item.packByDirective == 'Y' && !item.workorderSoDirectiveId) {
this.$u.toast('订单按指令包装,指令码必选!'); this.$u.toast('订单按指令包装,指令码必选!');
return; return;
}else if(item.packBySize=='Y' && !item.workorderSoSizeItemId){ } else if (item.packBySize == 'Y' && !item.workorderSoSizeItemId) {
this.$u.toast('订单按SIZE包装,SIZE必选!'); this.$u.toast('订单按SIZE包装,SIZE必选!');
return; return;
} }
} }
console.log(this.vuex_printConnect, 'this.vuex_printConnect') console.log(this.vuex_printConnect, 'this.vuex_printConnect');
if((item.printTemplate || item.whether=='1') && !this.vuex_printConnect) { if ((item.printTemplate || item.whether == '1') && !this.vuex_printConnect) {
this.$u.toast('打印机连接失败'); this.$u.toast('打印机连接失败');
return return;
} }
//工单 //工单
this.$u.api this.$u.api
...@@ -1831,7 +1812,7 @@ export default { ...@@ -1831,7 +1812,7 @@ export default {
taskWorkunitId: item.taskWorkunitId, taskWorkunitId: item.taskWorkunitId,
taskId: item.taskId, taskId: item.taskId,
taskCode: item.taskCode, taskCode: item.taskCode,
quantityFeedback: item.quantityQualify+item.quantityUnqualify, quantityFeedback: item.quantityQualify + item.quantityUnqualify,
quantityQualify: item.quantityQualify, quantityQualify: item.quantityQualify,
quantityUnqualify: item.quantityUnqualify, quantityUnqualify: item.quantityUnqualify,
userName: item.userName || this.vuex_user.userName, userName: item.userName || this.vuex_user.userName,
...@@ -1855,56 +1836,53 @@ export default { ...@@ -1855,56 +1836,53 @@ export default {
workorderSoSizeItemId: item.workorderSoSizeItemId, workorderSoSizeItemId: item.workorderSoSizeItemId,
netWeight: item.netWeight, netWeight: item.netWeight,
minPackageNum: item.minPackageNum, minPackageNum: item.minPackageNum,
printContents: item.whether=='1'?item.printContents: null printContents: item.whether == '1' ? item.printContents : null
}) })
.then((res) => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.proVisible = false; this.proVisible = false;
if (res.msg === '操作成功') { if (res.msg === '操作成功') {
this.$u.toast('上报成功'); this.$u.toast('上报成功');
if(item.printTemplate) { if (item.printTemplate) {
let params = {} let params = {};
res.data.forEach(datas => { res.data.forEach((datas) => {
params = { params = {
reportName: 'mysql:'+item.printTemplate, reportName: 'mysql:' + item.printTemplate,
values: {
proWorkorder: datas.proWorkorder,
size: datas.size,
directive: datas.directive
}
}
datas.packagePrintList.forEach(v => {
params.values.packagePrint = v
this.printPdfSocket(params)
})
})
}
if(item.whether=='1'){
this.printPdfSocket({
reportName: 'mysql:qrcode-50*50-2',
values: { values: {
detail: [ proWorkorder: datas.proWorkorder,
{ size: datas.size,
directive: datas.directive
}
};
datas.packagePrintList.forEach((v) => {
params.values.packagePrint = v;
this.printPdfSocket(params);
});
});
}
if (item.whether == '1') {
this.printPdfSocket({
reportName: 'mysql:qrcode-50*50-2',
values: {
detail: [
{
barcode: item.printContents, barcode: item.printContents,
gp: item.printContents gp: item.printContents
}, }
], ]
}, }
}) });
}
}
if (!res.msg) {
this.$u.toast('上报成功');
} else {
this.$u.toast(res.msg);
} }
this.getTaskList();
} }
if (!res.msg) {
}); this.$u.toast('上报成功');
} else {
}) this.$u.toast(res.msg);
}
this.getTaskList();
}
});
});
}, },
feedingInspectionShow() { feedingInspectionShow() {
this.feedingInspectionVisible = true; this.feedingInspectionVisible = true;
...@@ -1930,7 +1908,7 @@ export default { ...@@ -1930,7 +1908,7 @@ export default {
const taskInfo = this.tableSelectData[0]; const taskInfo = this.tableSelectData[0];
uni.scanCode({ uni.scanCode({
success: function (res) { success: function (res) {
t.$u.api.validateFeedingInspection({ plnr: res.result,taskId: taskInfo.taskId }).then((res2) => { t.$u.api.validateFeedingInspection({ plnr: res.result, taskId: taskInfo.taskId }).then((res2) => {
if (res2.code === 200) { if (res2.code === 200) {
t.feedingInspectionLoadAndScan(true); t.feedingInspectionLoadAndScan(true);
} }
...@@ -1998,15 +1976,15 @@ export default { ...@@ -1998,15 +1976,15 @@ export default {
}, },
materialRequestShow() { materialRequestShow() {
this.materialRequestVisible = true; this.materialRequestVisible = true;
const taskInfo = this.tableSelectData[0]; const taskInfo = this.tableSelectData[0];
this.curTaskInfo = this.tableSelectData[0]; this.curTaskInfo = this.tableSelectData[0];
this.curTaskInfo.workorderOption = this.curTaskInfo.proWorkorderList.map((s) => { this.curTaskInfo.workorderOption = this.curTaskInfo.proWorkorderList.map((s) => {
return { value: s.workorderId, text: s.workorderCode }; return { value: s.workorderId, text: s.workorderCode };
}); });
this.$u.api.listMaterialRequest({ taskId: taskInfo.taskId }).then((res) => { this.$u.api.listMaterialRequest({ taskId: taskInfo.taskId }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.materialRequestList = res.data; this.materialRequestList = res.data;
this.materialRequestArrays = this.materialRequestList.concat([]) this.materialRequestArrays = this.materialRequestList.concat([]);
} }
}); });
}, },
...@@ -2023,14 +2001,14 @@ export default { ...@@ -2023,14 +2001,14 @@ export default {
const rst = []; const rst = [];
const taskInfo = this.tableSelectData[0]; const taskInfo = this.tableSelectData[0];
const t = this; const t = this;
const items = this.curTaskInfo.workorderOption.find((item) => item.text === this.curTaskInfo.workorderCode ); const items = this.curTaskInfo.workorderOption.find((item) => item.text === this.curTaskInfo.workorderCode);
console.log( this.curTaskInfo.workorderOption , this.curTaskInfo.workorderCode, items) console.log(this.curTaskInfo.workorderOption, this.curTaskInfo.workorderCode, items);
this.materialRequestArrays.forEach((s) => { this.materialRequestArrays.forEach((s) => {
if (s.applyNum != null) { if (s.applyNum != null) {
rst.push({ rst.push({
itemId: s.itemId, itemId: s.itemId,
taskWorkunitId: this.curTaskInfo.taskWorkunitId, taskWorkunitId: this.curTaskInfo.taskWorkunitId,
workorderCode: items?.text, workorderCode: items?.text,
taskId: taskInfo.taskId, taskId: taskInfo.taskId,
applyNum: s.applyNum, applyNum: s.applyNum,
applyType: 1 applyType: 1
...@@ -2061,8 +2039,8 @@ export default { ...@@ -2061,8 +2039,8 @@ export default {
viewiPctureShow() { viewiPctureShow() {
this.materialReturn = true; this.materialReturn = true;
// this.viewSopPicture = this.tableSelectData[0]; // this.viewSopPicture = this.tableSelectData[0];
const taskInfo = this.tableSelectData[0]; const taskInfo = this.tableSelectData[0];
this.curTaskInfo = this.tableSelectData[0]; this.curTaskInfo = this.tableSelectData[0];
this.$u.api.viewpicture.viewWorkorder({ taskId: this.curTaskInfo.taskId }).then((res) => { this.$u.api.viewpicture.viewWorkorder({ taskId: this.curTaskInfo.taskId }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.viewSopPicture = res.data; this.viewSopPicture = res.data;
...@@ -2078,19 +2056,18 @@ export default { ...@@ -2078,19 +2056,18 @@ export default {
} }
}); });
}, },
materialReturnWorkorderProcessItem(id) { materialReturnWorkorderProcessItem(id) {
if(!id){ if (!id) {
this.materialRequestArrays = this.materialRequestList.concat([]) this.materialRequestArrays = this.materialRequestList.concat([]);
}else{ } else {
this.$u.api.getWproworkOrderProcessItem({ workorderId: id, processId: this.curTaskInfo.processId}).then((res) => { this.$u.api.getWproworkOrderProcessItem({ workorderId: id, processId: this.curTaskInfo.processId }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.materialRequestArrays = this.materialRequestList.concat(res.rows) this.materialRequestArrays = this.materialRequestList.concat(res.rows);
} }
}); });
}
} },
},
materialReturnFormShow(line) { materialReturnFormShow(line) {
this.materialReturnFormVisible = true; this.materialReturnFormVisible = true;
this.materialReturnFormData = { this.materialReturnFormData = {
...@@ -2128,17 +2105,17 @@ export default { ...@@ -2128,17 +2105,17 @@ export default {
workOrderId: s.workorderId, workOrderId: s.workorderId,
batchNo: s.batchCode, batchNo: s.batchCode,
packNo: s.packNo, packNo: s.packNo,
isQualified: s.isQualified, isQualified: s.isQualified
} };
if (this.materialReturnFormData.workorderCode) { if (this.materialReturnFormData.workorderCode) {
data.workorderCode = this.materialReturnFormData.workorderCode data.workorderCode = this.materialReturnFormData.workorderCode;
} else { } else {
data.workorderCode = this.curTaskInfo.workorderOption.flatMap(it => it.value).join(',') data.workorderCode = this.curTaskInfo.workorderOption.flatMap((it) => it.value).join(',');
} }
return data return data;
}); });
if (this.materialReturnList.length === 0) { if (this.materialReturnList.length === 0) {
return return;
} }
this.$u.api.addMaterialReturn(rst).then((res) => { this.$u.api.addMaterialReturn(rst).then((res) => {
this.materialReturnFormVisible = false; this.materialReturnFormVisible = false;
...@@ -2172,9 +2149,9 @@ export default { ...@@ -2172,9 +2149,9 @@ export default {
width: 40%; width: 40%;
} }
.tableForm{ .tableForm {
display:flex; display: flex;
margin:20rpx 0rpx; margin: 20rpx 0rpx;
} }
.task_card { .task_card {
...@@ -2243,8 +2220,8 @@ export default { ...@@ -2243,8 +2220,8 @@ export default {
height: calc(100vh - 200rpx); height: calc(100vh - 200rpx);
min-height: 400rpx; min-height: 400rpx;
border: 1px solid rgb(232, 232, 232); border: 1px solid rgb(232, 232, 232);
/deep/ .item-tr.trbg .item-td{ /deep/ .item-tr.trbg .item-td {
background:#fb9461 !important; background: #fb9461 !important;
// color:#fff !important; // color:#fff !important;
} }
} }
......
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