From a2bce22a3a4df5f4662c373e57c07fa4268aeee1 Mon Sep 17 00:00:00 2001 From: 小小儁爺 <1694218219@qq.com> Date: 星期五, 13 六月 2025 09:02:52 +0800 Subject: [PATCH] 1.修改工单打印模板 --- src/views/workOrder/workOrderList.vue | 736 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 672 insertions(+), 64 deletions(-) diff --git a/src/views/workOrder/workOrderList.vue b/src/views/workOrder/workOrderList.vue index 1f71997..ec1c5a3 100644 --- a/src/views/workOrder/workOrderList.vue +++ b/src/views/workOrder/workOrderList.vue @@ -8,7 +8,11 @@ <el-button v-waves type="success" icon="el-icon-connection" @click="send">娲惧彂</el-button> </div> - <!-- <el-button v-waves icon="el-icon-switch-button" @click="orderClose">鍏抽棴宸ュ崟</el-button>--> + <!-- <el-button v-waves type="primary" @click="batchUpdate"><i--> + <!-- class="el-icon-edit"--> + <!-- style="margin-right: 0;"--> + <!-- /> 鎵归噺缁戝畾--> + <!-- </el-button>--> </div> <div class="bodyTopFormGroup"> @@ -175,6 +179,20 @@ <div v-if="row.status==='SCHED'">宸叉帓绋�</div> </template> </el-table-column> + + <el-table-column + prop="isstep" + label="宸ヨ壓鐘舵��" + sortable="custom" + width="110" + show-tooltip-when-overflow + > + <template slot-scope="{row}"> + <el-tag v-if="row.isstep==='Y'" type="success" size="mini">宸茬粦瀹�</el-tag> + <el-tag v-if="row.isstep==='N'" type="danger" size="mini">鏈粦瀹�</el-tag> + </template> + </el-table-column> + <el-table-column prop="wo_code" label="宸ュ崟缂栧彿" @@ -266,6 +284,13 @@ sortable="custom" show-tooltip-when-overflow width="100" + /> + <el-table-column + prop="printcount" + label="鎵撳嵃娆℃暟" + sortable="custom" + show-tooltip-when-overflow + width="110" /> <el-table-column prop="priuserdefnvc1" @@ -445,7 +470,7 @@ :style="{color:$store.state.settings.theme}" class="el-icon-printer" style="cursor: pointer;margin-right: 15px" - @click="handlePrint(row.wo_code,row.saleOrderCod,row)" + @click="handlePrint(row.wo_code,row.saleOrderCode,row)" /> </el-tooltip> @@ -707,8 +732,8 @@ :popper-append-to-body="false" style="width: 200px;" placeholder="璇烽�夋嫨杞﹂棿" - @change="getMesOrderNewStepContent" > + <!-- @change="getMesOrderNewStepContent"--> <!-- @change="sourceType? getMesOrderNewStepContent():routecodeChange()"--> <el-option v-for="item in wkshopArr" @@ -1400,14 +1425,14 @@ <div id="printMe" style="padding: 30px"> <!-- <div v-for="(item,index) in tableDataPrint" :key="index">--> <div> - <div style="font-size: 26px; text-align: center">娴佺▼鍗�</div> + <div style="font-size: 32px; text-align: center;font-weight:bolder;">娴佺▼鍗�</div> <div style="display: flex;justify-content: space-around;margin-top: 20px; position: relative;"> - <div style="width: 78%"> + <div style="width: 200%"> <el-form ref="formApprove" :model="formApprove" - label-width="80px" + label-width="100px" inline style="display: flex;justify-content: space-between" > @@ -1466,20 +1491,20 @@ </div> </el-form> </div> - <div - id="qrCode0" - style="width: 22%;height:90px; - margin-top: 20px; - overflow-y: scroll;display: flex; - justify-content: center; - position: relative;" - > - <div id="qrCode00" ref="qrCodeDiv00" /> - </div> - <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" /> - <div - style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px" - /> + <!-- <div--> + <!-- id="qrCode0"--> + <!-- style="width: 22%;height:90px;--> + <!-- margin-top: 20px;--> + <!-- overflow-y: scroll;display: flex;--> + <!-- justify-content: center;--> + <!-- position: relative;"--> + <!-- >--> + <!-- <div id="qrCode00" ref="qrCodeDiv00" />--> + <!-- </div>--> + <!-- <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" />--> + <!-- <div--> + <!-- style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px"--> + <!-- />--> </div> <el-table @@ -1487,26 +1512,25 @@ :data="tableDataPrint[0]" border class="tableDataPrint" - :header-cell-style="{ background: '#c0c0c0',textAlign:'center',color:'#000',borderColor:'#000'}" - :cell-style="{textAlign: 'center',color:'#000',borderColor:'#000'}" + :header-cell-style="{ background: '#c0c0c0',textAlign:'center',color:'#000',borderColor:'#000',fontSize:'18px',padding:'2px 0'}" + :cell-style="{textAlign: 'center',color:'#000',borderColor:'#000',fontSize:'18px',padding:'5px 0'}" style="width: 100%;margin-top: 20px;text-align: center;border-color: #000" > <el-table-column id="column0" prop="seq" - label="宸ュ簭鍙�" + label="搴忓彿" width="70" align="center" /> <el-table-column id="column1" prop="stepqrcode" - label="宸ュ簭浜岀淮鐮�" + label="浜岀淮鐮�" width="100" align="center" > <template slot-scope="{row}"> - <div :id="'qrCode'+row.seq" :ref="'qrCodeDiv'+row.seq" :key="'qrCodeDiv'+row.seq" class="tableColumn" /> </template> </el-table-column> @@ -1552,11 +1576,11 @@ <div style="font-size: 26px; text-align: center">娴佺▼鍗�</div> <div style="display: flex;justify-content: space-around;margin-top: 20px; position: relative;"> - <div style="width: 78%"> + <div style="width: 200%"> <el-form ref="formApprove" :model="formApprove" - label-width="80px" + label-width="100px" inline style="display: flex;justify-content: space-between" > @@ -1595,20 +1619,20 @@ </div> </el-form> </div> - <div - id="qrCode1" - style="width: 22%;height:90px; - margin-top: 20px; - overflow-y: scroll;display: flex; - justify-content: center; - position: relative;" - > - <div id="qrCode01" ref="qrCodeDiv01" /> - </div> - <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" /> - <div - style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px" - /> + <!-- <div--> + <!-- id="qrCode1"--> + <!-- style="width: 22%;height:90px;--> + <!-- margin-top: 20px;--> + <!-- overflow-y: scroll;display: flex;--> + <!-- justify-content: center;--> + <!-- position: relative;"--> + <!-- >--> + <!-- <div id="qrCode01" ref="qrCodeDiv01" />--> + <!-- </div>--> + <!-- <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" />--> + <!-- <div--> + <!-- style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px"--> + <!-- />--> </div> <el-table @@ -1616,21 +1640,21 @@ :data="tableDataPrint[1]" border class="tableDataPrint" - :header-cell-style="{ background: '#c0c0c0',textAlign:'center',color:'#000',borderColor:'#000'}" - :cell-style="{textAlign: 'center',color:'#000',borderColor:'#000'}" + :header-cell-style="{ background: '#c0c0c0',textAlign:'center',color:'#000',borderColor:'#000',fontSize:'18px',padding:'2px 0'}" + :cell-style="{textAlign: 'center',color:'#000',borderColor:'#000',fontSize:'18px',padding:'5px 0'}" style="width: 100%;margin-top: 20px;text-align: center;border-color: #000" > <el-table-column id="column0" prop="seq" - label="宸ュ簭鍙�" + label="搴忓彿" width="70" align="center" /> <el-table-column id="column1" prop="stepqrcode" - label="宸ュ簭浜岀淮鐮�" + label="浜岀淮鐮�" width="100" align="center" > @@ -1683,7 +1707,7 @@ <el-button v-waves @click="dialogVisibleBackPreview">杩� 鍥�</el-button> <!-- <el-button v-waves v-if="operation==='add'" type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>--> <!-- <el-button v-waves type="primary" @click="dialogVisibleConfirm">纭� 瀹�/鎵� 鍗�</el-button>--> - <el-button v-waves v-print="printObj" type="primary">鎵� 鍗�</el-button> + <el-button v-waves v-print="printObj" type="primary" @click="printObjGetApi">鎵� 鍗�</el-button> </div> </span> </el-dialog> @@ -2336,6 +2360,255 @@ </span> </el-dialog> + <!-- 鎵归噺淇敼--> + <el-dialog + v-el-drag-dialog + title="鎵归噺淇敼" + :visible.sync="dialogVisibleBatchUpdate" + width="1200px" + top="8vh" + :close-on-click-modal="false" + @closed="handleCloseBatchUpdate" + @close="handleCloseBatchUpdate" + > + + <div + v-if="formData3.filter(i => !i.routecode).length>0&&mesSetting.route" + style="display: flex;align-items: center" + > + <div style="height: 34px;width: 80%;margin-bottom: 10px;"> + <el-alert + :title="'褰撳墠閫変腑'+multipleSelection.length+'涓伐鍗曪紝鏈�'+(formData3.filter(i => !i.routecode).length)+'涓伐鍗曟湭鎸囧畾宸ヨ壓璺嚎锛岃鍏堟寚瀹氾紒'" + type="error" + :closable="false" + /> + </div> + <el-button + v-waves + type="text" + style="margin-left: 20px;" + @click="dialogVisibleBatchUpdate=false;$router.push('../materialManager/inventoryList')" + >鐐瑰嚮璺宠浆瀛樿揣缁戝畾宸ヨ壓 + </el-button> + </div> + + <div v-for="(i,index) in formData3" :key="index" class="customDiv"> + + <el-form + ref="dialogForm" + inline + :model="i" + label-width="110px" + > + + <el-divider content-position="left">鍩烘湰淇℃伅 {{ index + 1 }}</el-divider> + + <el-form-item + label="宸ュ崟鐘舵��" + prop="mesorderstus" + > + <div style="width: 200px;">{{ erporderstusArr.find(item => item.code === i.mesorderstus).name }}</div> + </el-form-item> + <el-form-item label="宸ュ崟缂栧彿" prop="mesordercode"> + <div style="width: 200px;">{{ i.mesordercode }}</div> + </el-form-item> + <el-form-item label="宸ュ崟绫诲瀷" prop="mesorderstus"> + <div style="width: 200px;">{{ ordertypeArr.find(item => item.code === i.ordertype).name }}</div> + </el-form-item> + <el-form-item label="婧愬崟鍗曞彿"> + <div style="width: 200px;">{{ i.sourceorder }}</div> + </el-form-item> + <el-form-item label="宸ュ崟鏁伴噺" prop="mesqty"> + <div style="width: 200px;">{{ i.mesqty }}</div> + </el-form-item> + + <el-form-item label="鎵�灞炶溅闂�" prop="wkshopcode"> + <el-select + v-model="i.wkshopcode" + filterable + :popper-append-to-body="false" + style="width: 200px;" + placeholder="璇烽�夋嫨杞﹂棿" + > + <!-- @change="val=>getMesOrderNewStepContentBatchUpdate(val,index)"--> + <el-option + v-for="item in wkshopArr" + :key="item.torg_code" + :label="item.torg_name" + :value="item.torg_code" + /> + </el-select> + </el-form-item> + + <el-form-item + label="浜у搧鍚嶇О" + prop="partcode" + > + <div style="width: 200px;">{{ partArr.find(item => item.partcode === i.partcode).partname }}</div> + </el-form-item> + <el-form-item + label="浜у搧缂栫爜" + prop="partcode" + > + <div style="width: 200px;">{{ i.partcode }}</div> + </el-form-item> + + <el-form-item label="浜у搧瑙勬牸" prop="partspec"> + <div style="width: 200px;">{{ + partArr.find(item => item.partcode === i.partcode).partspec ? partArr.find(item => item.partcode === i.partcode).partspec : '/' + }} + </div> + </el-form-item> + <el-form-item v-if="mesSetting.route" label="宸ヨ壓璺嚎" prop="wkshopcode"> + <el-select + v-model="i.routecode" + filterable + :popper-append-to-body="false" + style="width: 200px;" + placeholder="璇烽�夋嫨宸ヨ壓璺嚎" + @change="val=>routecodeChangeBatchUpdate(val,index)" + > + <el-option + v-for="item in i.routecodeArr" + :key="item.route_code" + :label="item.route_name" + :value="item.route_code" + /> + </el-select> + </el-form-item> + + <el-form-item label="棰勮浜や粯鏃ユ湡" prop="deliverydate"> + <el-date-picker + v-model="i.deliverydate" + type="date" + size="mini" + :clearable="false" + class="dateMini" + :picker-options="pickerOptions" + format="yyyy-MM-dd" + value-format="yyyy-MM-dd" + placeholder="閫夋嫨鏃ユ湡" + /> + </el-form-item> + <el-form-item label="宸ュ簭鏉ユ簮" required> + <el-switch + v-model="i.sourceType" + style="width: 200px;" + inactive-text="鍩虹璁剧疆" + active-text="鍘嗗彶鏈�鏂�" + :disabled="!i.wkshopcode" + @change="val=>sourceTypeChangeBatchUpdate(val,index)" + /> + </el-form-item> + + <el-divider content-position="left">宸ュ簭淇℃伅 {{ index + 1 }}</el-divider> + + <div style="display: flex;align-items: center"> + <div style="font-weight: bolder">宸ュ簭閫夋嫨锛�</div> + + <el-select + v-model="i.stepSelectedValue" + class="stepSelectedValueClass" + style="width: 930px;" + multiple + placeholder="璇烽�夋嫨鐩稿搴斿伐搴�" + @change="val=>stepSelectedValueChangeBatchUpdate(val,index)" + > + <el-option + v-for="item in stepSelectArr" + :key="item.stepcode" + :label="item.stepname" + :value="item.stepcode" + /> + </el-select> + </div> + + <el-table + :ref="'stepTableDataRef'+index" + :key="index" + :data="i.stepTableData" + border + :row-class-name="tableRowClassName" + height="300" + :header-cell-style="{ + background: '#f8f8fa', padding: '0', color: '#000', fontWeight: 500 + }" + :cell-style="{padding: '5px 0'}" + style="width: 100%;margin-top: 15px;" + highlight-current-row + row-key="stepcode" + > + <el-table-column + type="index" + label="搴忓彿" + width="50" + /> + <el-table-column + prop="stepcode" + show-tooltip-when-overflow + label="宸ュ簭缂栫爜" + /> + <el-table-column + prop="stepname" + label="宸ュ簭鍚嶇О" + show-tooltip-when-overflow + /> + <el-table-column + prop="stepprice" + label="鐢熶骇鍗曚环" + show-tooltip-when-overflow + > + <template slot-scope="{row}"> + <el-input + v-model="row.stepprice" + placeholder="璇疯緭鍏ュ伐搴忓崟浠�" + oninput="value=value.replace(/[^0-9.]/g,'')" + style="width: 100%" + /> + </template> + </el-table-column> + <el-table-column + label="鎿嶄綔" + width="120" + > + <template slot-scope="scope"> + <div class="operationClass"> + <!-- <i--> + <!-- class="el-icon-rank"--> + <!-- :style="{color:$store.state.settings.theme}"--> + <!-- style="cursor: move"--> + <!-- />--> + <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top"> + <i + class="el-icon-delete" + :style="{color:$store.state.settings.theme}" + style="margin-left: 15px;" + @click="stepDelBatchUpdate(index,scope.$index)" + /> + </el-tooltip> + </div> + </template> + </el-table-column> + </el-table> + + </el-form> + + </div> + + <span slot="footer" class="dialog-footer"> + <div class="footerButton"> + <el-button v-waves @click="dialogVisibleCancelBatchUpdate">鍙� 娑�</el-button> + <el-button + v-waves + type="primary" + :loading="$store.state.app.buttonIsDisabled" + :disabled="$store.state.app.buttonIsDisabled" + @click="dialogVisibleConfirmBatchUpdate" + >纭� 瀹�</el-button> + </div> + </span> + </el-dialog> + </div> </template> @@ -2349,9 +2622,9 @@ import waves from '@/directive/waves' import { AddMesOrderCodeSearch, - AddUpdateMesOrder, DeleteMesOrder, + AddUpdateMesOrder, AddUpdateMesOrderList, DeleteMesOrder, MesBadOrderSearch, MesOrderDistribution, MesOrderNewStepContent, MesOrderProcessSopSearch, - MesOrderSearch, MesOrderSopSearch, + MesOrderSearch, MesOrderSopSearch, UpdateMesOrderPrintCount, UpdateMesOrderStepListSearch, UpdateMesOrderStepSearch } from '@/api/WorkOrder' import { PartSelect } from '@/api/ProductModel' @@ -2360,7 +2633,7 @@ import ElDragSelect from '@/components/DragSelect' import { MesOrderPrintSearch } from '@/api/GridReport' // base on element-ui import DateType from '@/components/DateType' -import { PartSelectRpute, RouteSelectStep } from '@/api/basicSettings' +import { PartSelectRpute, PartSelectRputeList, RouteSelectStep, RouteSelectStepList } from '@/api/basicSettings' import { DeviceSopSearch } from '@/api/DeviceManager' export default { @@ -2645,7 +2918,10 @@ }, sopArr: [], routeCode: '', // 宸ヨ壓璺嚎code - partCode: '' + partCode: '', + + dialogVisibleBatchUpdate: false, // 鎵归噺淇敼 + formData3: [] } }, watch: { @@ -2672,6 +2948,7 @@ activated() { window.addEventListener('resize', this.getHeight) this.getHeight() + this.handleRequest() }, created() { this.handleRequest() @@ -2685,6 +2962,279 @@ // }) }, methods: { + stepDelBatchUpdate(index, ind) { + this.formData3[index].stepTableData.splice(ind, 1) + this.formData3[index].stepSelectedValue = this.formData3[index].stepTableData.map(i => i.stepcode) + }, + // 鎵归噺淇敼 + async batchUpdate() { + if (this.multipleSelection.length === 0) { + return this.$message.info('璇峰厛鍕鹃�夌浉瀵瑰簲鐨勫伐鍗曪紒') + } + const loading = this.$loading({ + lock: true, + text: '姝e湪鍔犺浇鏁版嵁锛岃绋嶇瓑...', + spinner: 'el-icon-loading', + customClass: 'osloading', + background: 'rgba(0, 0, 0, 0.7)' + }) + + const data2 = [] + const data3 = [] + this.formData3 = [] + + const partcodeArr = [] + + this.multipleSelection.forEach(i => { + partcodeArr.push({ + partcode: i.partcode + }) + + if (this.mesSetting.route) { + data2.push( + { partcode: i.partcode, routecode: i.route_code ? i.route_code : i.default_route } + ) + } + + data3.push({ + sourceid: i.sourceid, + sourcewo: i.m_po, + wocode: i.wo_code, + data_sources: i.data_sources + }) + + this.formData3.push({ + mesorderstus: i.status, // 宸ュ崟鐘舵�佺爜 + mesordercode: i.wo_code, // 宸ュ崟缂栧彿 + ordertype: i.wotype, // 宸ュ崟绫诲瀷 + sourceorderid: i.sourceid, // 婧愬崟id + sourceorder: i.m_po, // 婧愬崟鍗曞彿 + partcode: i.partcode, // 浜у搧缂栫爜 + partname: i.partname, // 浜у搧鍚嶇О + partspec: i.partspec, // 浜у搧瑙勬牸 + mesqty: i.plan_qty, // 宸ュ崟鏁伴噺 + wkshopcode: i.wkshp_code, // 鐢熶骇杞﹂棿缂栫爜 + wkshopname: i.wkshp_name, // 鐢熶骇杞﹂棿鍚嶇О + deliverydate: i.saleOrderDeliveryDate.substring(0, 11), // 浜や粯鏃堕棿 + data_sources: i.data_sources, // 鏁版嵁鏉ユ簮 + sourceType: this.sourceType, // 宸ュ簭鏉ユ簮 + routecode: i.route_code ? i.route_code : i.default_route, // 宸ヨ壓璺嚎 + routecodeArr: [], // 宸ヨ壓璺嚎鏁扮粍 + stepSelectedValue: [], // 涓嬫媺閫変腑鍊� + stepTableData: []// 宸ュ簭琛ㄥ�� + }) + }) + const { data: res3 } = await UpdateMesOrderStepListSearch(data3) + res3.forEach((i, index) => { + if (i.stepdata.length > 0) { + this.formData3[index].stepTableData = i.stepdata + this.formData3[index].stepSelectedValue = i.stepdata.map(j => j.stepcode) + } + }) + + const { data: res } = await PartSelectRputeList(partcodeArr) + if (this.mesSetting.route) { + res.forEach((i, index) => { + if (i.routedata.length > 0) { + this.formData3[index].routecodeArr = i.routedata + } + }) + } else { + this.formData3.forEach((i, index) => { + if (i.stepTableData.length === 0) { + i.stepTableData = res[index].stepdata + i.stepSelectedValue = res[index].stepdata.length > 0 ? res[index].stepdata.map(j => j.stepcode) : [] + } + }) + } + + if (this.mesSetting.route) { + const { data: res2 } = await RouteSelectStepList(data2) + this.formData3.forEach((i, index) => { + if (i.stepTableData.length === 0) { + i.stepTableData = res2[index].stepdata + i.stepSelectedValue = res2[index].stepdata.length > 0 ? res2[index].stepdata.map(j => j.stepcode) : [] + } + }) + } + + // this.formData3 = this.multipleSelection + this.dialogVisibleBatchUpdate = true + loading.close() + }, + // 瀵硅瘽妗嗗叧闂� + handleCloseBatchUpdate() { + this.multipleSelection = [] + this.formData3 = [] + this.$refs.tableDataRef.clearSelection() + }, + dialogVisibleCancelBatchUpdate() { + this.dialogVisibleBatchUpdate = false + }, + async dialogVisibleConfirmBatchUpdate() { + this.$store.state.app.buttonIsDisabled = true + let flag = false + const data = [] + this.formData3.forEach((i, index) => { + const workListSub = [] + if (i.stepTableData.length > 0) { + i.stepTableData.forEach((it, j) => { + workListSub.push( + { + stepseq: j + 1, + stepcode: it.stepcode, + stepprice: it.stepprice, + isbott: j === 0 ? 'Y' : 'N', + isend: j === i.stepTableData.length - 1 ? 'Y' : 'N' + } + ) + }) + } else { + flag = true + } + + data.push({ + wostatus: i.mesorderstus, // 宸ュ崟鐘舵�� + wocode: i.mesordercode, // 宸ュ崟鍙� + wotype: i.ordertype, // 宸ュ崟绫诲瀷 + sourceid: i.sourceorderid, // 婧愬崟id + sourcewo: i.sourceorder, // 婧愬崟鍗曞彿 + partcode: i.partcode, // 浜у搧缂栧彿 + wkshopcode: i.wkshopcode, + woqty: i.mesqty, // 宸ュ崟鏁伴噺 + deliverydate: i.deliverydate, // 浜や粯鏃堕棿 + data_sources: i.data_sources, // 鏁版嵁鏉ユ簮 + isstep: workListSub.length > 0 ? 'Y' : 'N', // + difference: 0, // 鏁版嵁宸�� + routecode: i.routecode, + workListSub + }) + }) + if (flag) { + this.$store.state.app.buttonIsDisabled = false + return this.$message.error('鏁版嵁鏈淮鎶ゅソ锛岃鍏堟鏌ワ紒') + } + + const res = await AddUpdateMesOrderList(data) + if (res.code === '200') { + this.$message.success('淇敼鎿嶄綔鎴愬姛锛�') + this.$store.state.app.buttonIsDisabled = false + } + await this.getMesOrderSearch() + this.dialogVisibleBatchUpdate = false + }, + async sourceTypeChangeBatchUpdate(val, index) { + if (val) { + const data = { + routecode: this.formData3[index].routecode, + wkshopcode: this.formData3[index].wkshopcode, + partcode: this.formData3[index].partcode + } + const { data: res } = await MesOrderNewStepContent(data) + this.formData3[index].stepSelectedValue = [] + this.formData3[index].stepTableData = [] + + if (res.length > 0) { + res.forEach(i => { + this.formData3[index].stepTableData.push( + { + stepcode: i.step_code, + stepname: i.step_name, + stepprice: i.stepprice + } + ) + }) + this.formData3[index].stepSelectedValue = this.formData3[index].stepTableData.map(i => i.stepcode) + } + } else { + if (this.mesSetting.route) { + // this.routecodeChange() + const data = { + partcode: this.formData3[index].partcode, + routecode: this.formData3[index].routecode + } + const { data: res } = await RouteSelectStep(data) + this.formData3[index].stepSelectedValue = [] + this.formData3[index].stepTableData = [] + if (res.length > 0) { + res.sort((a, b) => a.step_seq - b.step_seq) + res.forEach(i => { + this.formData3[index].stepTableData.push( + { + stepcode: i.step_code, + stepname: i.step_name, + stepprice: i.unprice + } + ) + }) + this.formData3[index].stepSelectedValue = this.formData3[index].stepTableData.map(i => i.stepcode) + } + } else { + // this.getBasicProcessData() + const { data: res } = await PartSelectRpute({ partcode: this.formData3[index].partcode }) + res.sort((a, b) => a.step_seq - b.step_seq) + this.formData3[index].stepSelectedValue = [] + this.formData3[index].stepTableData = [] + res.forEach(i => { + this.formData3[index].stepTableData.push( + { + stepcode: i.step_code, + stepname: i.step_name, + stepprice: i.unprice + } + ) + }) + this.formData3[index].stepSelectedValue = this.formData3[index].stepTableData.map(i => i.stepcode) + } + } + }, + async getMesOrderNewStepContentBatchUpdate(val, index) { + const data = { + routecode: this.formData3[index].routecode, + wkshopcode: this.formData3[index].wkshopcode, + partcode: this.formData3[index].partcode + } + const { data: res } = await MesOrderNewStepContent(data) + this.formData3[index].stepSelectedValue = [] + this.formData3[index].stepTableData = [] + if (res.length > 0) { + res.forEach(i => { + this.formData3[index].stepTableData.push( + { + stepcode: i.step_code, + // stepname: i.stepname, + stepprice: i.stepprice + } + ) + }) + this.formData3[index].stepSelectedValue = this.formData3[index].stepTableData.map(i => i.stepcode) + } + }, + async routecodeChangeBatchUpdate(val, index) { + // this.sourceType + + const data = { + partcode: this.formData3[index].partcode, + routecode: this.formData3[index].routecode + } + const { data: res } = await RouteSelectStep(data) + + this.formData3[index].stepSelectedValue = [] + this.formData3[index].stepTableData = [] + if (res.length > 0) { + res.sort((a, b) => a.step_seq - b.step_seq) + res.forEach(i => { + this.formData3[index].stepTableData.push( + { + stepcode: i.step_code, + stepname: i.step_name, + stepprice: i.unprice + } + ) + }) + this.formData3[index].stepSelectedValue = this.formData3[index].stepTableData.map(i => i.stepcode) + } + }, // 寮瑰嚭妗嗗叧闂� handleSopClose() { this.SopDialogVisible = false @@ -2903,11 +3453,12 @@ this.dialogVisibleTask = false }, handleSelectionChange(val) { - this.multipleSelection = val.map(i => i.wo_code) + this.multipleSelection = val }, selected(row, index) { - return row.status === 'NEW' && row.isstep === 'Y' + return row.status === 'NEW' + // return row.status === 'NEW' && row.isstep === 'Y' }, // 娲惧彂 send() { @@ -2920,7 +3471,7 @@ cancelButtonText: '鍙栨秷', type: 'warning' }).then(() => { - MesOrderDistribution(this.multipleSelection).then(res => { + MesOrderDistribution(this.multipleSelection.map(i => i.wo_code)).then(res => { if (res.code === '200') { this.$notify.success('娲惧彂鎴愬姛!') this.getMesOrderSearch() @@ -2980,6 +3531,9 @@ this.dialogForm.mesqtyinit = row.plan_qty + this.dialogForm.paystartdate = row.plan_startdate + this.dialogForm.payenddate = row.plan_enddate + const data = { sourceid: this.dialogForm.sourceorderid, sourcewo: this.dialogForm.sourceorder, @@ -2988,13 +3542,17 @@ } const { data: res } = await UpdateMesOrderStepSearch(data) this.dialogForm.mesmaxqty = res.canupdate_qty - if (this.mesSetting.route) { // 鎸夊伐鑹鸿矾绾胯蛋妯″紡 if (!this.dialogForm.routecode) { await this.getPartcodeChangeDialog() + } else { + const { data: res } = await PartSelectRpute({ partcode: this.dialogForm.partcode }) + this.routecodeArr = res } if (res.stepdata.length > 0) { + this.stepTableData = [] + this.stepSelectedValue = [] res.stepdata.forEach(i => { this.stepTableData.push( { @@ -3198,6 +3756,10 @@ return this.$message.info('姝ゅ伐鍗曠殑鏈�澶т慨鏀规暟鍊间负锛�' + this.dialogForm.mesmaxqty) } + if (this.mesSetting.route && !this.dialogForm.routecode) { + return this.$message.error('璇烽�夋嫨宸ヨ壓璺嚎锛�') + } + const workListSub = [] this.stepTableData.forEach((i, j) => { workListSub.push( @@ -3225,6 +3787,8 @@ wkshopcode: this.dialogForm.wkshopcode, woqty: this.dialogForm.mesqty, // 宸ュ崟鏁伴噺 deliverydate: this.dialogForm.deliverydate, // 浜や粯鏃堕棿 + paystartdate: this.dialogForm.paystartdate, + payenddate: this.dialogForm.payenddate, data_sources: this.dialogForm.data_sources, // 鏁版嵁鏉ユ簮 isstep: workListSub.length > 0 ? 'Y' : 'N', // difference: this.dialogForm.mesqty - this.dialogForm.mesqtyinit, // 鏁版嵁宸�� @@ -3332,9 +3896,9 @@ item.forEach(i => { this.bindQRCode(i.seq, i.stepqrcode, 'small') }) - this.bindQRCode(index, this.formApprove.mesordercode, 'big') - const div = document.getElementById('qrCode' + index) - div.scrollTop = div.scrollHeight // 婊氬姩鏉′綅浜庢渶搴曢儴 + // this.bindQRCode(index, this.formApprove.mesordercode, 'big') + // const div = document.getElementById('qrCode' + index) + // div.scrollTop = div.scrollHeight // 婊氬姩鏉′綅浜庢渶搴曢儴 }) // const div = document.getElementById('qrCode') @@ -3385,8 +3949,8 @@ if (size === 'big') { new QRCode(this.$refs['qrCodeDiv0' + seq], { text: text, - width: size === 'big' ? 90 : 60, - height: size === 'big' ? 90 : 60, + width: size === 'big' ? 90 : 45, + height: size === 'big' ? 90 : 45, // colorDark: '#333333', // 浜岀淮鐮侀鑹� colorDark: '#000', // 浜岀淮鐮侀鑹� colorLight: '#ffffff', // 浜岀淮鐮佽儗鏅壊 @@ -3395,8 +3959,8 @@ } else { new QRCode(this.$refs['qrCodeDiv' + seq], { text: text, - width: size === 'big' ? 90 : 60, - height: size === 'big' ? 90 : 60, + width: size === 'big' ? 90 : 45, + height: size === 'big' ? 90 : 45, // colorDark: '#333333', // 浜岀淮鐮侀鑹� colorDark: '#000', // 浜岀淮鐮侀鑹� colorLight: '#ffffff', // 浜岀淮鐮佽儗鏅壊 @@ -3782,6 +4346,18 @@ stepSelectedValueChange(val) { // console.log(val, 123) }, + stepSelectedValueChangeBatchUpdate(val, index) { + console.log(val, index) + this.formData3[index].stepTableData = [] + + val.forEach(i => { + this.formData3[index].stepTableData.push({ + stepcode: i, + stepname: this.stepSelectArr.find(j => j.stepcode === i).stepname, + stepprice: 0 + }) + }) + }, getSummaries(param) { const { columns, data } = param const sums = [] @@ -3809,6 +4385,12 @@ this.$refs.tableDataRef.doLayout() }) return sums + }, + async printObjGetApi() { + const res = await UpdateMesOrderPrintCount({ wo_code: this.formApprove.mesordercode }) + if (res.code === '200') { + await this.getMesOrderSearch() + } } } } @@ -3823,8 +4405,8 @@ <style lang="scss" scoped> $main_color: #42b983; -.stepSelectedValueClass{ - ::v-deep input{ +.stepSelectedValueClass { + ::v-deep input { //min-height: 34px !important; height: 68px !important; } @@ -3970,7 +4552,18 @@ } .formContent { - width: 240px; + //width: 330px; + width: calc(50% - 10px); + display:flex; + + ::v-deep .el-form-item__label { + float: left; + } + + ::v-deep .el-form-item__content { + //float: left; + width: 240px; + } } </style> @@ -3986,6 +4579,12 @@ <style> .formContent .el-form-item__label { color: #000 !important; + font-size: 20px; +} + +.formContent .el-form-item__content { + color: #000 !important; + font-size: 20px; } </style> <!--鍏叡椤甸潰鏍峰紡--> @@ -4127,6 +4726,14 @@ height: 100% !important; } } + +.customDiv { + ::v-deep .el-divider:first-child { + width: 120%; + margin-left: -10%; + } +} + </style> <style> @@ -4140,3 +4747,4 @@ color: #fff !important; background: #42b983 !important; } +</style> -- Gitblit v1.9.3