From 768d890a8ecd901cff555ec4c82d107be7905add Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期四, 27 三月 2025 08:16:24 +0800
Subject: [PATCH] 1.批量报工 功能新增
---
src/views/workOrder/workOrderList.vue | 721 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 706 insertions(+), 15 deletions(-)
diff --git a/src/views/workOrder/workOrderList.vue b/src/views/workOrder/workOrderList.vue
index 712d54b..440763a 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="宸ュ崟缂栧彿"
@@ -267,6 +285,66 @@
show-tooltip-when-overflow
width="100"
/>
+ <!-- <el-table-column-->
+ <!-- prop="priuserdefnvc1"-->
+ <!-- label="瀹㈡埛鍚嶇О"-->
+ <!-- width="110"-->
+ <!-- sortable="custom"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- {{ row.priuserdefnvc1 ? row.priuserdefnvc1 : '/' }}-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="priuserdefnvc6"-->
+ <!-- label="瀹㈡埛缂栫爜"-->
+ <!-- width="110"-->
+ <!-- sortable="custom"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- {{ row.priuserdefnvc6 ? row.priuserdefnvc6 : '/' }}-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="priuserdefnvc2"-->
+ <!-- label="瀵瑰唴鍚嶇О"-->
+ <!-- width="110"-->
+ <!-- sortable="custom"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- {{ row.priuserdefnvc2 ? row.priuserdefnvc2 : '/' }}-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="priuserdefnvc3"-->
+ <!-- label="CTP鏃ユ湡"-->
+ <!-- width="110"-->
+ <!-- sortable="custom"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- {{ row.priuserdefnvc3 ? row.priuserdefnvc3 : '/' }}-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="priuserdefnvc4"-->
+ <!-- label="閽㈠垁缂栧彿"-->
+ <!-- width="110"-->
+ <!-- sortable="custom"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- {{ row.priuserdefnvc4 ? row.priuserdefnvc4 : '/' }}-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="priuserdefnvc5"-->
+ <!-- label="鐩掑瀷"-->
+ <!-- width="110"-->
+ <!-- sortable="custom"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- {{ row.priuserdefnvc5 ? row.priuserdefnvc5 : '/' }}-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
<el-table-column
prop="clerkuser"
label="閿�鍞笟鍔″憳"
@@ -385,7 +463,7 @@
:style="{color:$store.state.settings.theme}"
class="el-icon-printer"
style="cursor: pointer;margin-right: 15px"
- @click="handlePrint(row.wo_code,row.saleOrderCod)"
+ @click="handlePrint(row.wo_code,row.saleOrderCod,row)"
/>
</el-tooltip>
@@ -497,6 +575,11 @@
label="鏂欏簾鏁伴噺"
show-tooltip-when-overflow
prop="materielbad_qty"
+ />
+ <el-table-column
+ label="鎬诲彲鎶ユ暟閲�"
+ show-tooltip-when-overflow
+ prop="plan_qty"
/>
<el-table-column
label="寰呬骇鏁伴噺"
@@ -647,8 +730,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"
@@ -1373,6 +1456,26 @@
<el-form-item label="宸ュ崟鏁伴噺:" class="formContent">
{{ formApprove.plan_qty }}
</el-form-item>
+
+ <!-- <el-form-item label="瀹㈡埛鍚嶇О:" class="formContent">-->
+ <!-- {{ formApprove.priuserdefnvc1 }}-->
+ <!-- </el-form-item>-->
+ <!-- <el-form-item label="瀹㈡埛缂栫爜:" class="formContent">-->
+ <!-- {{ formApprove.priuserdefnvc6 }}-->
+ <!-- </el-form-item>-->
+ <!-- <el-form-item label="瀵瑰唴鍚嶇О:" class="formContent">-->
+ <!-- {{ formApprove.priuserdefnvc2 }}-->
+ <!-- </el-form-item>-->
+ <!-- <el-form-item label="CTP鏃ユ湡:" class="formContent">-->
+ <!-- {{ formApprove.priuserdefnvc3 }}-->
+ <!-- </el-form-item>-->
+ <!-- <el-form-item label="閽㈠垁缂栧彿:" class="formContent">-->
+ <!-- {{ formApprove.priuserdefnvc4 }}-->
+ <!-- </el-form-item>-->
+ <!-- <el-form-item label="鐩掑瀷:" class="formContent">-->
+ <!-- {{ formApprove.priuserdefnvc5 }}-->
+ <!-- </el-form-item>-->
+
<!-- <el-form-item label="宸ヨ壓璺嚎:" class="formContent">-->
<!-- {{ formApprove.routename }}-->
<!-- </el-form-item>-->
@@ -2256,6 +2359,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/inventoryList2')"
+ >鐐瑰嚮璺宠浆瀛樿揣缁戝畾宸ヨ壓
+ </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>
@@ -2269,9 +2621,9 @@
import waves from '@/directive/waves'
import {
AddMesOrderCodeSearch,
- AddUpdateMesOrder, DeleteMesOrder,
+ AddUpdateMesOrder, AddUpdateMesOrderList, DeleteMesOrder,
MesBadOrderSearch, MesOrderDistribution, MesOrderNewStepContent, MesOrderProcessSopSearch,
- MesOrderSearch, MesOrderSopSearch,
+ MesOrderSearch, MesOrderSopSearch, UpdateMesOrderStepListSearch,
UpdateMesOrderStepSearch
} from '@/api/WorkOrder'
import { PartSelect } from '@/api/ProductModel'
@@ -2280,7 +2632,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 {
@@ -2439,7 +2791,13 @@
partspec: '',
plan_qty: '',
routename: '',
- lm_date: ''
+ lm_date: '',
+ priuserdefnvc1: '',
+ priuserdefnvc2: '',
+ priuserdefnvc3: '',
+ priuserdefnvc4: '',
+ priuserdefnvc5: '',
+ priuserdefnvc6: ''
},
number: '',
dialogVisible2: false,
@@ -2559,7 +2917,10 @@
},
sopArr: [],
routeCode: '', // 宸ヨ壓璺嚎code
- partCode: ''
+ partCode: '',
+
+ dialogVisibleBatchUpdate: false, // 鎵归噺淇敼
+ formData3: []
}
},
watch: {
@@ -2568,6 +2929,7 @@
handler: function(val) {
// do something with the new and old value of stepSelectedValue
console.log(val, 1)
+ console.log(this.stepTableData, 3)
const arr = JSON.parse(JSON.stringify(this.stepTableData))
const arrStepcode = arr.map(i => i.stepcode)
this.stepTableData = []
@@ -2586,6 +2948,7 @@
activated() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
+ this.handleRequest()
},
created() {
this.handleRequest()
@@ -2599,6 +2962,280 @@
// })
},
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)
+ console.log(res3, 321)
+ 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
@@ -2817,11 +3454,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() {
@@ -2834,7 +3472,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()
@@ -2873,7 +3511,14 @@
this.$notify.info('宸插彇娑堝垹闄�')
})
},
-
+ // 瓒呮姤姣斾緥
+ rationChange(val, row) {
+ row.sumqty = Math.round(parseFloat(this.dialogForm.mesqty) * (1 + (parseFloat(val) > 0 ? parseFloat(val) / 100 : 0)))
+ },
+ // 鎵归噺淇敼鐨� 瓒呮姤姣斾緥
+ rationBatchChange(val, row, index) {
+ row.sumqty = Math.round(parseFloat(this.formData3[index].mesqty) * (1 + (parseFloat(val) > 0 ? parseFloat(val) / 100 : 0)))
+ },
// 淇敼鎸夐挳
async edit(operation, row) {
this.operation = operation
@@ -2902,13 +3547,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(
{
@@ -2941,6 +3590,7 @@
} else {
if (res.stepdata.length > 0) {
res.stepdata.forEach(i => {
+ console.log(i)
this.stepTableData.push(
{
stepcode: i.step_code,
@@ -3128,7 +3778,6 @@
if (workListSub.length === 0) {
return this.$message.info('宸ュ簭涓嶈兘涓虹┖锛�')
}
-
const data = {
wostatus: this.dialogForm.mesorderstus, // 宸ュ崟鐘舵��
wocode: this.dialogForm.mesordercode, // 宸ュ崟鍙�
@@ -3208,10 +3857,18 @@
this.dialogVisibleSearch = false
},
// 澶勭悊鎵撳嵃
- handlePrint(wo_code, saleOrderCode) {
+ handlePrint(wo_code, saleOrderCode, row) {
// const number = Math.random() * Math.random()
// this.number = number === 0 ? (10 + Math.random()) : number
// console.log(number)
+
+ this.formApprove.priuserdefnvc1 = row.priuserdefnvc1 ? row.priuserdefnvc1 : '/'
+ this.formApprove.priuserdefnvc2 = row.priuserdefnvc2 ? row.priuserdefnvc2 : '/'
+ this.formApprove.priuserdefnvc3 = row.priuserdefnvc3 ? row.priuserdefnvc3 : '/'
+ this.formApprove.priuserdefnvc4 = row.priuserdefnvc4 ? row.priuserdefnvc4 : '/'
+ this.formApprove.priuserdefnvc5 = row.priuserdefnvc5 ? row.priuserdefnvc5 : '/'
+ this.formApprove.priuserdefnvc6 = row.priuserdefnvc6 ? row.priuserdefnvc6 : '/'
+
this.formApprove.saleOrderCode = this.formApprove.saleOrderCode !== '' ? this.formApprove.saleOrderCode : saleOrderCode
const data2 = {
mesordercode: wo_code || this.dialogForm.mesordercode
@@ -3323,6 +3980,12 @@
this.formApprove.routename = ''
this.formApprove.lm_date = ''
+ this.formApprove.priuserdefnvc1 = ''
+ this.formApprove.priuserdefnvc2 = ''
+ this.formApprove.priuserdefnvc3 = ''
+ this.formApprove.priuserdefnvc4 = ''
+ this.formApprove.priuserdefnvc5 = ''
+ this.formApprove.priuserdefnvc6 = ''
// this.$refs.qrCodeDiv0.title = ''
this.tableDataPrint = []
@@ -3682,6 +4345,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 = []
@@ -4027,9 +4702,25 @@
height: 100% !important;
}
}
+
+.customDiv {
+ ::v-deep .el-divider:first-child {
+ width: 120%;
+ margin-left: -10%;
+ }
+}
+
</style>
<style>
+
.el-table .custom-row {
background: #f8f8fa;
}
</style>
+<style>
+.sortable-ghost {
+ opacity: .8;
+ color: #fff !important;
+ background: #42b983 !important;
+}
+</style>
--
Gitblit v1.9.3