Commit 5255a0e0 authored by 张海景's avatar 张海景

update:修改刀模板上下机参数

parent 881919ab
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
title="生产报工" title="生产报工"
@confirm="handleSubmitfeedback" @confirm="handleSubmitfeedback"
show-cancel-button show-cancel-button
:show-confirm-button="feedbackForms[0]&&feedbackForms[0].isPackage === '1'? false: true" :show-confirm-button="feedbackForms[0] && feedbackForms[0].isPackage === '1' ? false : true"
: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="proVisible" v-model="proVisible"
width="1800rpx" width="1800rpx"
...@@ -116,8 +116,8 @@ ...@@ -116,8 +116,8 @@
<!-- 是否包装工序isPackage为1是 --> <!-- 是否包装工序isPackage为1是 -->
<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+feedback.id"> <view class="feedback-card" v-for="(feedback, i) in feedbackForms" :key="i + feedback.id">
<view v-if="feedback.isPackage === '1'" > <view v-if="feedback.isPackage === '1'">
<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="4"> <u-col span="4">
...@@ -149,26 +149,26 @@ ...@@ -149,26 +149,26 @@
</u-col> </u-col>
<u-col span="4"> <u-col span="4">
<u-form-item label="报工人:" prop="nickName"> <u-form-item label="报工人:" prop="nickName">
{{feedback.nickName}} {{ feedback.nickName }}
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
<u-row> <u-row>
<u-col span="4"> <u-col span="4">
<u-form-item label="包装类型:" prop="packType"> <u-form-item label="包装类型:" prop="packType">
<dict-tag :options="dict.type.pro_pack_type" :value="feedback.packType" /> <dict-tag :options="dict.type.pro_pack_type" :value="feedback.packType" />
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="3"> <u-col span="3">
<u-form-item label="包装单位:" prop="packUnitOfMeasure"> <u-form-item label="包装单位:" prop="packUnitOfMeasure">
{{feedback.packUnitOfMeasure}} {{ feedback.packUnitOfMeasure }}
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="5"> <u-col span="5">
<u-form-item label-width="150px" label="LOSS数是否单独包装:" prop="lossIndividuallyWrap"> <u-form-item label-width="150px" label="LOSS数是否单独包装:" prop="lossIndividuallyWrap">
<dict-tag :options="dict.type.sap_yes_no" :value="feedback.lossIndividuallyWrap" /> <dict-tag :options="dict.type.sap_yes_no" :value="feedback.lossIndividuallyWrap" />
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
<u-row> <u-row>
<u-col span="4"> <u-col span="4">
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
<u-form-item label="包装数量:" prop="packNum"> <u-form-item label="包装数量:" prop="packNum">
<u-number-box :min="0" v-model="feedback.packNum" @blur="handleChangePackNum(feedback, i)"></u-number-box> <u-number-box :min="0" v-model="feedback.packNum" @blur="handleChangePackNum(feedback, i)"></u-number-box>
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="3"> <u-col span="3">
<u-form-item label="装箱数量:" prop="encasementNum"> <u-form-item label="装箱数量:" prop="encasementNum">
<u-number-box :min="0" v-model="feedback.encasementNum" @blur="handleChangePackNum(feedback, i)"></u-number-box> <u-number-box :min="0" v-model="feedback.encasementNum" @blur="handleChangePackNum(feedback, i)"></u-number-box>
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
<u-col span="6"> <u-col span="6">
<u-form-item label="检测人员:" prop="checkBy"> <u-form-item label="检测人员:" prop="checkBy">
<u-input disabled v-model="feedback.checkBy"></u-input> <u-input disabled v-model="feedback.checkBy"></u-input>
<u-button @tap="userVisible = true,useData = feedback;" type="success" size="mini">选择人员</u-button> <u-button @tap="(userVisible = true), (useData = feedback)" type="success" size="mini">选择人员</u-button>
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
<u-col span="6"> <u-col span="6">
<u-form-item label-width="120px" label="是否合并包装:" prop="mergePack"> <u-form-item label-width="120px" label="是否合并包装:" prop="mergePack">
<view class="uni-list-item__extra"> <view class="uni-list-item__extra">
<u-radio-group v-model="feedback.mergePack" @change="getWorkorderDirectiveList(feedback, i,true)"> <u-radio-group v-model="feedback.mergePack" @change="getWorkorderDirectiveList(feedback, i, true)">
<u-radio :name="1"></u-radio> <u-radio :name="1"></u-radio>
<u-radio :name="0"></u-radio> <u-radio :name="0"></u-radio>
</u-radio-group> </u-radio-group>
...@@ -239,11 +239,18 @@ ...@@ -239,11 +239,18 @@
</template> </template>
<template slot="peration" slot-scope="scope"> <template slot="peration" slot-scope="scope">
<!-- {{ scope.row }} --> <!-- {{ scope.row }} -->
<u-button v-if="Number(scope.row.packageNum) > Number(scope.row.feedbackQuantity)" @tap="handleSubmitPackageFeedback(feedback, scope.row)" type="success" style="margin-left: 20rpx" size="mini">打印/报工</u-button> <u-button
v-if="Number(scope.row.packageNum) > Number(scope.row.feedbackQuantity)"
@tap="handleSubmitPackageFeedback(feedback, scope.row)"
type="success"
style="margin-left: 20rpx"
size="mini"
>
打印/报工
</u-button>
<!-- <u-input v-model="scope.row.reportQuantity" type="number"></u-input> --> <!-- <u-input v-model="scope.row.reportQuantity" type="number"></u-input> -->
</template> </template>
</zb-table> </zb-table>
</view> </view>
<!-- 指令列表 --> <!-- 指令列表 -->
<view v-if="feedback.tableDirectiveData.length"> <view v-if="feedback.tableDirectiveData.length">
...@@ -262,7 +269,6 @@ ...@@ -262,7 +269,6 @@
<!-- <u-input v-model="scope.row.reportQuantity" type="number"></u-input> --> <!-- <u-input v-model="scope.row.reportQuantity" type="number"></u-input> -->
</template> </template>
</zb-table> </zb-table>
</view> </view>
<!-- SIZE列表 --> <!-- SIZE列表 -->
<view v-if="feedback.tableSizeData.length"> <view v-if="feedback.tableSizeData.length">
...@@ -343,10 +349,8 @@ ...@@ -343,10 +349,8 @@
</u-row> </u-row>
</u-form> </u-form>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
</u-modal> </u-modal>
<u-modal <u-modal
...@@ -384,15 +388,15 @@ ...@@ -384,15 +388,15 @@
: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="knifeTempVisible" v-model="knifeTempVisible"
width="100%" width="100%"
:content-style="{height: '87vh'}" :content-style="{ height: '87vh' }"
> >
<view style="display: flex;"> <view style="display: flex">
<view style="width:520px;"> <view style="width: 520px">
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<app-scan v-if="knifeTempAppScanVisible" ref="appScan" @getCode="handleUpdateKnifeTemp"></app-scan> <app-scan v-if="knifeTempAppScanVisible" ref="appScan" @getCode="handleUpdateKnifeTemp"></app-scan>
<!-- #endif --> <!-- #endif -->
</view> </view>
<dModelList :data="dModelData" @action="upDownGetList" @scan="handleAppScanKnifeTemp"/> <dModelList :data="dModelData" @action="upDownGetList" @scan="handleAppScanKnifeTemp" />
</view> </view>
</u-modal> </u-modal>
<!-- //生产报工报工人员 --> <!-- //生产报工报工人员 -->
...@@ -480,17 +484,17 @@ ...@@ -480,17 +484,17 @@
</u-modal> </u-modal>
<u-modal <u-modal
title="投料校验" title="投料校验"
@cancel="$refs.appScan.closed() , feedingInspectionVisible = false" @cancel="$refs.appScan.closed(), (feedingInspectionVisible = false)"
show-cancel-button show-cancel-button
cancelText="关闭" cancelText="关闭"
:show-confirm-button="false" :show-confirm-button="false"
: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="feedingInspectionVisible" v-model="feedingInspectionVisible"
width="100%" width="100%"
:content-style="{height: '87vh'}" :content-style="{ height: '87vh' }"
> >
<view style="display: flex;"> <view style="display: flex">
<view style="width:520px;" v-if="feedingInspectionVisible"> <view style="width: 520px" v-if="feedingInspectionVisible">
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<app-scan ref="appScan" @getCode="feedingInspectionScan"></app-scan> <app-scan ref="appScan" @getCode="feedingInspectionScan"></app-scan>
<!-- #endif --> <!-- #endif -->
...@@ -521,49 +525,48 @@ ...@@ -521,49 +525,48 @@
</uni-table> </uni-table>
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
</u-modal> </u-modal>
<u-modal <u-modal
title="反冲料登记" title="反冲料登记"
@cancel="$refs.appScan.closed() , recoilMaterialVisible = false" @cancel="$refs.appScan.closed(), (recoilMaterialVisible = false)"
show-cancel-button show-cancel-button
cancelText="关闭" cancelText="关闭"
:show-confirm-button="false" :show-confirm-button="false"
: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="recoilMaterialVisible" v-model="recoilMaterialVisible"
width="100%" width="100%"
:content-style="{height: '87vh'}" :content-style="{ height: '87vh' }"
> >
<view style="display: flex;"> <view style="display: flex">
<view style="width:520px;" v-if="recoilMaterialVisible"> <view style="width: 520px" v-if="recoilMaterialVisible">
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<app-scan ref="appScan" @getCode="recoilMaterialScan"></app-scan> <app-scan ref="appScan" @getCode="recoilMaterialScan"></app-scan>
<!-- #endif --> <!-- #endif -->
</view> </view>
<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' }">
<uni-table ref="qcTable" border stripe :loading="loading" emptyText="未查询到数据"> <uni-table ref="qcTable" border stripe :loading="loading" emptyText="未查询到数据">
<uni-tr> <uni-tr>
<uni-th width="100px" align="center">操作</uni-th> <uni-th width="100px" align="center">操作</uni-th>
<uni-th width="110px" align="center">产品物料编码</uni-th> <uni-th width="110px" align="center">产品物料编码</uni-th>
<uni-th width="300px" align="center">产品物料名称</uni-th> <uni-th width="300px" align="center">产品物料名称</uni-th>
<uni-th width="110px" align="center">批次号</uni-th> <uni-th width="110px" align="center">批次号</uni-th>
</uni-tr> </uni-tr>
<uni-tr v-for="(line, index) in recoilMaterialList" :key="index"> <uni-tr v-for="(line, index) in recoilMaterialList" :key="index">
<uni-td align="center"> <uni-td align="center">
<view class="uni-group"> <view class="uni-group">
<button class="uni-button" size="mini" type="primary" @click="recoilMaterialDelete(line)">删除</button> <button class="uni-button" size="mini" type="primary" @click="recoilMaterialDelete(line)">删除</button>
</view> </view>
</uni-td> </uni-td>
<uni-td align="center">{{ line.itemCode }}</uni-td> <uni-td align="center">{{ line.itemCode }}</uni-td>
<uni-td align="center">{{ line.itemName }}({{ line.specification }})/{{ line.unitOfMeasure }}</uni-td> <uni-td align="center">{{ line.itemName }}({{ line.specification }})/{{ line.unitOfMeasure }}</uni-td>
<uni-td align="center">{{ line.batchNo }}</uni-td> <uni-td align="center">{{ line.batchNo }}</uni-td>
</uni-tr> </uni-tr>
</uni-table> </uni-table>
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
</u-modal> </u-modal>
...@@ -856,7 +859,7 @@ import UButton from '../../../uview-ui/components/u-button/u-button.vue'; ...@@ -856,7 +859,7 @@ import UButton from '../../../uview-ui/components/u-button/u-button.vue';
import cameraAuthMixin from '@/components/AppScan/appScanMixins.js'; import cameraAuthMixin from '@/components/AppScan/appScanMixins.js';
import { handleError } from 'vue'; import { handleError } from 'vue';
import AppScan from '../../../components/AppScan/AppScan.vue'; import AppScan from '../../../components/AppScan/AppScan.vue';
import { debounce } from '@/utils/ruoyi' import { debounce } from '@/utils/ruoyi';
export default { export default {
name: 'ProdReport', name: 'ProdReport',
dicts: ['pro_pack_type', 'sap_yes_no'], dicts: ['pro_pack_type', 'sap_yes_no'],
...@@ -1280,7 +1283,7 @@ export default { ...@@ -1280,7 +1283,7 @@ export default {
recoilMaterialList: [], recoilMaterialList: [],
materialRequestList: [], materialRequestList: [],
materialRequestArrays: [], materialRequestArrays: [],
materialRequests: [], materialRequests: [],
materialReturnList: [], materialReturnList: [],
materialRequestFormData: { materialRequestFormData: {
itemName: null, itemName: null,
...@@ -1374,36 +1377,36 @@ export default { ...@@ -1374,36 +1377,36 @@ export default {
methods: { methods: {
handleChangePackNum(feedback, i) { handleChangePackNum(feedback, i) {
if (this.getWorkorderDirectiveLoading) { if (this.getWorkorderDirectiveLoading) {
return return;
} }
debounce(this.getWorkorderDirectiveList(feedback, i,true), 30000) debounce(this.getWorkorderDirectiveList(feedback, i, true), 30000);
}, },
handleSubmitConfirmlKnifeTemp() { handleSubmitConfirmlKnifeTemp() {
this.knifeTempVisible = true this.knifeTempVisible = true;
this.$refs.appScan.closed() this.$refs.appScan.closed();
this.knifeTempAppScanVisible = false this.knifeTempAppScanVisible = false;
this.knifeTempCancelText = '确认' this.knifeTempCancelText = '确认';
this.knifeTempType = null this.knifeTempType = null;
}, },
handleSubmitCancelKnifeTemp() { handleSubmitCancelKnifeTemp() {
this.knifeTempVisible = true this.knifeTempVisible = true;
this.$refs.appScan.closed() this.$refs.appScan.closed();
this.knifeTempAppScanVisible = false this.knifeTempAppScanVisible = false;
this.knifeTempCancelText = '取消' this.knifeTempCancelText = '取消';
}, },
handleAppScanKnifeTemp(type) { handleAppScanKnifeTemp(type) {
this.knifeTempAppScanVisible = true this.knifeTempAppScanVisible = true;
this.knifeTempType = type this.knifeTempType = type;
this.knifeTempCancelText = type === '1'? '关闭上机扫描': '关闭下机扫描' this.knifeTempCancelText = type === '1' ? '关闭上机扫描' : '关闭下机扫描';
this.getPemissionScan() this.getPemissionScan();
}, },
handleUpdateKnifeTemp(code) { handleUpdateKnifeTemp(code) {
console.log({ type: this.knifeTempType, sn: code, task_workunt_id: this.tableSelectData[0].taskWorkunitId }, code, 'code---handleUpdateKnifeTemp') console.log({ type: this.knifeTempType, sn: code, taskWorkunitId: this.tableSelectData[0].taskWorkunitId }, code, 'code---handleUpdateKnifeTemp');
this.$u.api.dModel.tmToolMachinesScancode({ type: this.knifeTempType, sn: code, task_workunt_id: this.tableSelectData[0].taskWorkunitId }).then((res) => { this.$u.api.dModel.tmToolMachinesScancode({ type: this.knifeTempType, sn: code, taskWorkunitId: this.tableSelectData[0].taskWorkunitId }).then((res) => {
console.log(res, 'res333') console.log(res, 'res333');
if (res.code === 200) { if (res.code === 200) {
this.$u.toast(this.knifeTempType === '1'? '上机成功': '下机成功') this.$u.toast(this.knifeTempType === '1' ? '上机成功' : '下机成功');
this.upDownGetList() this.upDownGetList();
} }
}); });
}, },
...@@ -1478,13 +1481,15 @@ export default { ...@@ -1478,13 +1481,15 @@ export default {
if (item.status === 'BEGINNING') { if (item.status === 'BEGINNING') {
status = true; status = true;
} else { } else {
this.$u.api.changeCheckMachineTool({ this.$u.api
taskWorkunitId: item.taskWorkunitId .changeCheckMachineTool({
}).then(res => { taskWorkunitId: item.taskWorkunitId
if(res.code === 200) { })
this.changeStatus(item.taskId, item.taskWorkunitId, 'BEGINNING', item.workunitId, false); .then((res) => {
} if (res.code === 200) {
}) this.changeStatus(item.taskId, item.taskWorkunitId, 'BEGINNING', item.workunitId, false);
}
});
} }
}); });
if (status) { if (status) {
...@@ -1505,7 +1510,7 @@ export default { ...@@ -1505,7 +1510,7 @@ export default {
case 'Prod': case 'Prod':
if (this.tableSelectData[0].status === 'PREPARE') { if (this.tableSelectData[0].status === 'PREPARE') {
this.$u.toast('工序未开工'); this.$u.toast('工序未开工');
return return;
} }
this.doFeedback(); this.doFeedback();
break; break;
...@@ -1603,34 +1608,34 @@ export default { ...@@ -1603,34 +1608,34 @@ export default {
async addDModelRecord(params) { async addDModelRecord(params) {
// const { data } = await this.$u.api.dModel.getToolsByProcessIdAndArrangeCode(params); // const { data } = await this.$u.api.dModel.getToolsByProcessIdAndArrangeCode(params);
// if (data?.length) { // if (data?.length) {
const [selectData] = this.tableSelectData; const [selectData] = this.tableSelectData;
const ps = { const ps = {
// toolMachinesCode: '', // toolMachinesCode: '',
// arrangeCode: selectData.arrangeCode, // arrangeCode: selectData.arrangeCode,
// workunitId: this.vuex_workunit.workunitId, // workunitId: this.vuex_workunit.workunitId,
// workunitCode: this.vuex_workunit.workunitCode, // workunitCode: this.vuex_workunit.workunitCode,
// workunitName: this.vuex_workunit.workunitName, // workunitName: this.vuex_workunit.workunitName,
// processId: selectData.processId, // processId: selectData.processId,
// taskId: selectData.taskId, // taskId: selectData.taskId,
taskWorkunitId: selectData.taskWorkunitId, taskWorkunitId: selectData.taskWorkunitId
// workorderId: selectData.workorderId, // workorderId: selectData.workorderId,
// toolRequestUseId: data[0].toolRequestUseId, // toolRequestUseId: data[0].toolRequestUseId,
// toolMachinesRecordList: data.map((v) => { // toolMachinesRecordList: data.map((v) => {
// return { // return {
// toolRequestUseItemId: v.toolRequestUseItemId, // toolRequestUseItemId: v.toolRequestUseItemId,
// type: 3, // type: 3,
// upDate: '', // upDate: '',
// downDate: '' // downDate: ''
// }; // };
// }) // })
}; };
// 新增 // 新增
const data2 = await this.$u.api.dModel.tmToolMachines(ps); const data2 = await this.$u.api.dModel.tmToolMachines(ps);
if (data2.code == 200) { if (data2.code == 200) {
const records = await this.$u.api.dModel.getRecordsByProcessIdAndArrangeCode(params); const records = await this.$u.api.dModel.getRecordsByProcessIdAndArrangeCode(params);
this.dModelData = records.data || []; this.dModelData = records.data || [];
this.knifeTempVisible = true; this.knifeTempVisible = true;
} }
// } // }
}, },
getIssusLinebyWorkorderCodes() { getIssusLinebyWorkorderCodes() {
...@@ -1685,16 +1690,16 @@ export default { ...@@ -1685,16 +1690,16 @@ export default {
row.tableSizeColumn = []; row.tableSizeColumn = [];
row.tableSizeData = []; row.tableSizeData = [];
row.tableOrderData = []; row.tableOrderData = [];
row.packNum = '' row.packNum = '';
row.packType = '' row.packType = '';
row.packUnitOfMeasure = '' row.packUnitOfMeasure = '';
row.lossIndividuallyWrap = undefined row.lossIndividuallyWrap = undefined;
row.currentTabPro = 0 row.currentTabPro = 0;
return; return;
} else { } else {
if (row.isPackage === '1') { if (row.isPackage === '1') {
row.packNum = items.usagePackNum row.packNum = items.usagePackNum;
row.encasementNum = items.usageEncasementNum row.encasementNum = items.usageEncasementNum;
this.getWorkorderDirectiveList(id, index); this.getWorkorderDirectiveList(id, index);
} }
} }
...@@ -1794,17 +1799,17 @@ export default { ...@@ -1794,17 +1799,17 @@ export default {
}; };
}); });
} }
return { return {
value: temp.workorderId, value: temp.workorderId,
text: temp.workorderCode text: temp.workorderCode
}; };
}); });
if (item.isPackage === '1'&&res.rows.length > 0) { if (item.isPackage === '1' && res.rows.length > 0) {
item.workorderId = res.rows[0].workorderId item.workorderId = res.rows[0].workorderId;
item.packNum = res.rows[0].usagePackNum item.packNum = res.rows[0].usagePackNum;
item.encasementNum = res.rows[0].usageEncasementNum item.encasementNum = res.rows[0].usageEncasementNum;
this.getWorkorderDirectiveList(res.rows[0].workorderId, index) this.getWorkorderDirectiveList(res.rows[0].workorderId, index);
} }
}); });
}, },
...@@ -1960,11 +1965,11 @@ export default { ...@@ -1960,11 +1965,11 @@ export default {
}, },
doFeedback() { doFeedback() {
// this.reset(); // this.reset();
console.log(this.dict.type, 'this.dicts.type') console.log(this.dict.type, 'this.dicts.type');
this.feedbackForms = []; this.feedbackForms = [];
let flagPackage = [] let flagPackage = [];
this.tableSelectData.forEach((item, index) => { this.tableSelectData.forEach((item, index) => {
flagPackage.push(item.isPackage === '1') flagPackage.push(item.isPackage === '1');
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;
...@@ -2051,147 +2056,147 @@ export default { ...@@ -2051,147 +2056,147 @@ export default {
tableOrderData: [], tableOrderData: [],
tableDirectiveData: [], tableDirectiveData: [],
currentTabPro: 0, currentTabPro: 0,
packNum:0, packNum: 0,
encasementNum: 0, encasementNum: 0,
mergePack: 0 mergePack: 0
}; };
this.getWorkorderWithSizeAndDirective(feedback, index); this.getWorkorderWithSizeAndDirective(feedback, index);
this.feedbackForms.push(feedback); this.feedbackForms.push(feedback);
}); });
console.log(flagPackage, Array.from(new Set(flagPackage))) console.log(flagPackage, Array.from(new Set(flagPackage)));
if (Array.from(new Set(flagPackage)).length === 2) { if (Array.from(new Set(flagPackage)).length === 2) {
this.$u.toast('包装工序禁止多选报工') this.$u.toast('包装工序禁止多选报工');
return return;
} }
// 如果选择了包装工序、非包装工序提示:“包装工序禁止多选报工” // 如果选择了包装工序、非包装工序提示:“包装工序禁止多选报工”
this.proVisible = true; this.proVisible = true;
}, },
// 获取指令列表 // 获取指令列表
getWorkorderDirectiveList(rows, index, flag) { getWorkorderDirectiveList(rows, index, flag) {
this.getWorkorderDirectiveLoading = true this.getWorkorderDirectiveLoading = true;
let row = this.feedbackForms[index]; let row = this.feedbackForms[index];
this.$u.api this.$u.api
.workOrderSoDirectiveApi({ .workOrderSoDirectiveApi({
"encasementNum": row.encasementNum, encasementNum: row.encasementNum,
"mergePack": row.mergePack || 0, mergePack: row.mergePack || 0,
"packNum": row.packNum, packNum: row.packNum,
"quantity": row.quantity, quantity: row.quantity,
"taskId": row.taskId, taskId: row.taskId,
"workorderId": row.workorderId workorderId: row.workorderId
}) })
.then((res) => { .then((res) => {
console.log(res, '88999res'); console.log(res, '88999res');
this.getWorkorderDirectiveLoading = false this.getWorkorderDirectiveLoading = false;
if (res.code === 200) { if (res.code === 200) {
this.copyFeedBackForms = JSON.parse(JSON.stringify(this.feedbackForms)) this.copyFeedBackForms = JSON.parse(JSON.stringify(this.feedbackForms));
console.log(this.copyFeedBackForms,'this.copyFeedBackForms88999') console.log(this.copyFeedBackForms, 'this.copyFeedBackForms88999');
if(res.data.directiveList) { if (res.data.directiveList) {
row.tableDirectiveData = res.data.directiveList.map(item => { row.tableDirectiveData = res.data.directiveList.map((item) => {
return { return {
...item, ...item,
reportQuantity: Number(item.packageNum) || 0 - Number(item.feedbackQuantity) || 0 reportQuantity: Number(item.packageNum) || 0 - Number(item.feedbackQuantity) || 0
} };
}) });
row.listTabPro = [ row.listTabPro = [
{ {
name: '指令列表' name: '指令列表'
} }
] ];
} else { } else {
row.tableDirectiveData = [] row.tableDirectiveData = [];
} }
if(res.data.orderPackageList) { if (res.data.orderPackageList) {
row.tableOrderData = res.data.orderPackageList.map(item => { row.tableOrderData = res.data.orderPackageList.map((item) => {
return { return {
...item, ...item,
reportQuantity: Number(item.packageNum) || 0 - Number(item.feedbackQuantity) || 0 reportQuantity: Number(item.packageNum) || 0 - Number(item.feedbackQuantity) || 0
} };
}) });
row.listTabPro = [ row.listTabPro = [
{ {
name: '报工列表' name: '报工列表'
} }
] ];
} else { } else {
row.tableOrderData = [] row.tableOrderData = [];
} }
if(res.data.sizeList) { if (res.data.sizeList) {
row.tableSizeData = res.data.sizeList.map(item => { row.tableSizeData = res.data.sizeList.map((item) => {
return { return {
...item, ...item,
reportQuantity: Number(item.packageNum) || 0 - Number(item.feedbackQuantity) || 0 reportQuantity: Number(item.packageNum) || 0 - Number(item.feedbackQuantity) || 0
} };
}) });
row.listTabPro = [ row.listTabPro = [
{ {
name: 'SIZE列表' name: 'SIZE列表'
} }
] ];
row.tableSizeColumn[1].label = res.data.sizeColumnName row.tableSizeColumn[1].label = res.data.sizeColumnName;
} else { } else {
row.tableSizeData = [] row.tableSizeData = [];
} }
} else { } else {
if (flag) { if (flag) {
console.log(this.copyFeedBackForms,'this.copyFeedBackForms') console.log(this.copyFeedBackForms, 'this.copyFeedBackForms');
// this.$set(this.feedbackForms, index, this.copyFeedBackForms[index]) // this.$set(this.feedbackForms, index, this.copyFeedBackForms[index])
this.$set(this.feedbackForms[index], 'packNum', this.copyFeedBackForms[index].packNum) this.$set(this.feedbackForms[index], 'packNum', this.copyFeedBackForms[index].packNum);
this.$set(this.feedbackForms[index], 'encasementNum', this.copyFeedBackForms[index].encasementNum) this.$set(this.feedbackForms[index], 'encasementNum', this.copyFeedBackForms[index].encasementNum);
this.$set(this.feedbackForms[index], 'mergePack', this.copyFeedBackForms[index].mergePack) this.$set(this.feedbackForms[index], 'mergePack', this.copyFeedBackForms[index].mergePack);
console.log(this.feedbackForms[index], '889row') console.log(this.feedbackForms[index], '889row');
} }
console.log(88999) console.log(88999);
} }
}) });
}, },
handleSubmitPackageFeedback(item, row) { handleSubmitPackageFeedback(item, row) {
if ((item.printTemplate) && !this.vuex_printConnect) { if (item.printTemplate && !this.vuex_printConnect) {
this.$u.toast('打印机连接失败'); this.$u.toast('打印机连接失败');
return; return;
} }
this.$u.api this.$u.api
.feedBackPackage({ .feedBackPackage({
taskWorkunitId: item.taskWorkunitId, taskWorkunitId: item.taskWorkunitId,
checkBy: item.checkBy, checkBy: item.checkBy,
encasementNum: item.encasementNum, encasementNum: item.encasementNum,
mergePack: item.mergePack, mergePack: item.mergePack,
packNum: item.packNum, packNum: item.packNum,
printTemplate: item.printTemplate, printTemplate: item.printTemplate,
quantityUnqualify: item.quantityUnqualify, quantityUnqualify: item.quantityUnqualify,
taskId: item.taskId, taskId: item.taskId,
feedbackTime: item.feedbackTime, feedbackTime: item.feedbackTime,
workorderId: item.workorderId, workorderId: item.workorderId,
'reportData.netWeight': row.netWeight, 'reportData.netWeight': row.netWeight,
'reportData.reportQuantity': row.reportQuantity, 'reportData.reportQuantity': row.reportQuantity,
'reportData.packageNum': row.packageNum, 'reportData.packageNum': row.packageNum,
'reportData.qrcode': row.qrcode, 'reportData.qrcode': row.qrcode,
'reportData.workorderSoDirectiveId': row.workorderSoDirectiveId, 'reportData.workorderSoDirectiveId': row.workorderSoDirectiveId,
'reportData.workorderSoSizeItemId': row.workorderSoSizeItemId 'reportData.workorderSoSizeItemId': row.workorderSoSizeItemId
}) })
.then((res) => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
// this.proVisible = false; // this.proVisible = false;
item.quantityUnqualify = 0 item.quantityUnqualify = 0;
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: { values: {
packagePrint: datas packagePrint: datas
} }
}; };
this.printPdfSocket(params); this.printPdfSocket(params);
}); });
}
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();
}
});
}, },
// 获取SIZE列表 // 获取SIZE列表
getWorkorderSizeList(id, index) { getWorkorderSizeList(id, index) {
...@@ -2212,9 +2217,9 @@ export default { ...@@ -2212,9 +2217,9 @@ export default {
label: element label: element
}; };
if (key === 'reportQuantity') { if (key === 'reportQuantity') {
obj.width = 130 obj.width = 130;
obj.type = 'slot' obj.type = 'slot';
obj.slot = 'reportQuantity' obj.slot = 'reportQuantity';
} }
columns.push(obj); columns.push(obj);
} }
...@@ -2306,7 +2311,7 @@ export default { ...@@ -2306,7 +2311,7 @@ export default {
netWeight: item.netWeight, netWeight: item.netWeight,
feedbackTime: item.feedbackTime, feedbackTime: item.feedbackTime,
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) {
...@@ -2353,7 +2358,7 @@ export default { ...@@ -2353,7 +2358,7 @@ export default {
}, },
feedingInspectionShow() { feedingInspectionShow() {
this.feedingInspectionVisible = true; this.feedingInspectionVisible = true;
this.getPemissionScan() this.getPemissionScan();
this.feedingInspectionLoadAndScan(); this.feedingInspectionLoadAndScan();
}, },
feedingInspectionLoadAndScan(bool) { feedingInspectionLoadAndScan(bool) {
...@@ -2368,7 +2373,7 @@ export default { ...@@ -2368,7 +2373,7 @@ export default {
}); });
}, },
feedingInspectionScan(barNumber) { feedingInspectionScan(barNumber) {
console.log(barNumber, '-----barNumberfeedingInspectionScan') console.log(barNumber, '-----barNumberfeedingInspectionScan');
const taskInfo = this.tableSelectData[0]; const taskInfo = this.tableSelectData[0];
this.$u.api.validateFeedingInspection({ plnr: barNumber, taskId: taskInfo.taskId }).then((res) => { this.$u.api.validateFeedingInspection({ plnr: barNumber, taskId: taskInfo.taskId }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
...@@ -2377,17 +2382,17 @@ export default { ...@@ -2377,17 +2382,17 @@ export default {
}); });
}, },
async getPemissionScan() { async getPemissionScan() {
/* #ifdef APP-PLUS */ /* #ifdef APP-PLUS */
if (!uni.getStorageSync('iosCameraAuth') && this.isIos) { if (!uni.getStorageSync('iosCameraAuth') && this.isIos) {
uni.setStorageSync('iosCameraAuth', true) uni.setStorageSync('iosCameraAuth', true);
} else { } else {
let bol = await this.getCameraAuth() let bol = await this.getCameraAuth();
if (!bol) { if (!bol) {
this.refusedCameraAuth() this.refusedCameraAuth();
return return;
} }
} }
/* #endif */ /* #endif */
}, },
validateFeedingInspection(line) { validateFeedingInspection(line) {
const t = this; const t = this;
...@@ -2404,7 +2409,7 @@ export default { ...@@ -2404,7 +2409,7 @@ export default {
}, },
recoilMaterialShow() { recoilMaterialShow() {
this.recoilMaterialVisible = true; this.recoilMaterialVisible = true;
this.getPemissionScan() this.getPemissionScan();
this.recoilMaterialLoadAndScan(); this.recoilMaterialLoadAndScan();
}, },
recoilMaterialLoadAndScan(bool) { recoilMaterialLoadAndScan(bool) {
...@@ -2420,14 +2425,13 @@ export default { ...@@ -2420,14 +2425,13 @@ export default {
}); });
}, },
recoilMaterialScan(barNumber) { recoilMaterialScan(barNumber) {
console.log(barNumber, '-----barNumberrecoilMaterialScan') console.log(barNumber, '-----barNumberrecoilMaterialScan');
const taskInfo = this.tableSelectData[0]; const taskInfo = this.tableSelectData[0];
this.$u.api.addRecoilMaterial({ taskId: taskInfo.taskId, plnr: barNumber }).then((res) => { this.$u.api.addRecoilMaterial({ taskId: taskInfo.taskId, plnr: barNumber }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.recoilMaterialLoadAndScan(true); this.recoilMaterialLoadAndScan(true);
} }
}); });
}, },
recoilMaterialDelete(line) { recoilMaterialDelete(line) {
const t = this; const t = this;
...@@ -2449,15 +2453,14 @@ export default { ...@@ -2449,15 +2453,14 @@ export default {
}); });
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.map(item => { this.materialRequestList = res.data.map((item) => {
return { return {
...item, ...item,
workorderCode: this.curTaskInfo.workorderCode workorderCode: this.curTaskInfo.workorderCode
} };
}) });
this.materialRequestArrays = this.materialRequestList.concat([]); this.materialRequestArrays = this.materialRequestList.concat([]);
} }
}); });
}, },
materialRequestFormShow(line) { materialRequestFormShow(line) {
...@@ -2540,21 +2543,21 @@ export default { ...@@ -2540,21 +2543,21 @@ export default {
if (!id) { if (!id) {
this.materialRequestArrays = this.materialRequestList.concat([]); this.materialRequestArrays = this.materialRequestList.concat([]);
} else { } else {
const items = this.curTaskInfo.workorderOption.find((item) => item.value === this.curTaskInfo.workorderCode); const items = this.curTaskInfo.workorderOption.find((item) => item.value === this.curTaskInfo.workorderCode);
console.log(items) console.log(items);
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) {
const list = res.rows.map(item=> { const list = res.rows.map((item) => {
return { return {
...item, ...item,
workorderCode: items.text workorderCode: items.text
} };
}) });
this.materialRequests = this.materialRequestList.concat(list); this.materialRequests = this.materialRequestList.concat(list);
this.materialRequestArrays = this.materialRequests.filter((item, index, self) => { this.materialRequestArrays = this.materialRequests.filter((item, index, self) => {
                            return self.findIndex(t => t.itemCode === item.itemCode) === index; return self.findIndex((t) => t.itemCode === item.itemCode) === index;
                        }); });
console.log(materialRequestArrays, 'materialRequestArrays') console.log(materialRequestArrays, 'materialRequestArrays');
} }
}); });
} }
......
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