From 19bb512734fc1bd3524a45cc66dfda8caef2066b Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期三, 10 十二月 2025 08:05:45 +0800
Subject: [PATCH] 1.打印时自动派发
---
src/views/workOrder/workOrderList.vue | 197 +++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 165 insertions(+), 32 deletions(-)
diff --git a/src/views/workOrder/workOrderList.vue b/src/views/workOrder/workOrderList.vue
index b1a0f01..b6b8126 100644
--- a/src/views/workOrder/workOrderList.vue
+++ b/src/views/workOrder/workOrderList.vue
@@ -5,21 +5,21 @@
<div
class="bodyTopStatus"
>
- <div style="font-weight: bolder;">宸ュ崟鐘舵��</div>
- <div class="statusItem" :class="{statusItemLight:form.mesorderstus===''}" @click="statusChange('')">鍏ㄩ儴</div>
- <div class="statusItem" :class="{statusItemLight:form.mesorderstus==='NEW'}" @click="statusChange('NEW')">鏂拌鍗�</div>
- <div class="statusItem" :class="{statusItemLight:form.mesorderstus==='ALLO'}" @click="statusChange('ALLO')">宸叉淳鍙�</div>
- <div class="statusItem" :class="{statusItemLight:form.mesorderstus==='START'}" @click="statusChange('START')">寮�宸�</div>
- <div class="statusItem" :class="{statusItemLight:form.mesorderstus==='CLOSED'}" @click="statusChange('CLOSED')">瀹屽伐</div>
+ <div style="font-weight: bolder;">宸ュ崟鐘舵��:</div>
+ <div class="statusItem" :class="{statusItemLight:true}" @click="statusChange('')">鍏ㄩ儴</div>
+ <div class="statusItem" :class="{statusItemLight1:true}" @click="statusChange('NEW')">鏂拌鍗�</div>
+ <div class="statusItem" :class="{statusItemLight2:true}" @click="statusChange('ALLO')">宸叉淳鍙�</div>
+ <div class="statusItem" :class="{statusItemLight3:true}" @click="statusChange('START')">寮�宸�</div>
+ <div class="statusItem" :class="{statusItemLight4:true}" @click="statusChange('CLOSED')">瀹屽伐</div>
</div>
<div class="bodyTopButtonGroup" style="justify-content: space-between;margin-top: 5px;">
<div style="display: flex">
<el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
- <el-button v-waves type="success" icon="el-icon-connection" @click="send">娲惧彂</el-button>
+ <el-button v-waves type="success" icon="el-icon-connection" @click="send();tableDataDetail=[]">娲惧彂</el-button>
</div>
- <el-button v-waves type="primary" @click="batchUpdate"><i
+ <el-button v-waves type="primary" @click="batchUpdate();tableDataDetail=[]"><i
class="el-icon-edit"
style="margin-right: 0;"
/> 鎵归噺缁戝畾
@@ -39,6 +39,8 @@
<el-select
v-model="form.wkshopcode"
filterable
+ multiple
+ collapse-tags
:popper-append-to-body="false"
style="width: 200px"
placeholder="璇烽�夋嫨"
@@ -119,8 +121,8 @@
class="bodySearchReset"
:style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
>
- <el-button v-waves type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
- <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
+ <el-button v-waves type="primary" icon="el-icon-search" @click="search();tableDataDetail=[]">鏌ヨ</el-button>
+ <el-button v-waves type="info" icon="el-icon-refresh" @click="reset();tableDataDetail=[]">閲嶇疆</el-button>
</div>
</el-form>
@@ -152,7 +154,7 @@
border
:summary-method="getSummaries"
show-summary
- :row-class-name="tableRowClassName"
+ :row-class-name="tableRowClassName2"
:style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+80)+'px'}"
highlight-current-row
:header-cell-style="this.$headerCellStyle"
@@ -165,12 +167,14 @@
type="selection"
width="50"
:selectable="selected"
+ class-name="fixed-column"
/>
<el-table-column
prop="rowNum"
- width="50"
+ width="80"
label="搴忓彿"
fixed
+ class-name="fixed-column"
/>
<el-table-column
prop="status"
@@ -225,7 +229,7 @@
</el-table-column>
<el-table-column
prop="saleOrderCode"
- label="閿�鍞鍗�"
+ label="閿�鍞鍗�/棰勬祴鍗�"
sortable="custom"
show-tooltip-when-overflow
min-width="160"
@@ -288,7 +292,30 @@
<div v-else>/</div>
</template>
</el-table-column>
-
+ <el-table-column
+ prop="TopInventoryCode"
+ label="椤剁骇鐗╂枡缂栫爜"
+ sortable="custom"
+ show-tooltip-when-overflow
+ min-width="130"
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.TopInventoryCode">{{ row.TopInventoryCode }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="TopInventoryName"
+ label="椤剁骇鐗╂枡鍚嶇О"
+ sortable="custom"
+ show-tooltip-when-overflow
+ min-width="130"
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.TopInventoryName">{{ row.TopInventoryName }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
<el-table-column
prop="plan_qty"
label="宸ュ崟鏁�"
@@ -439,6 +466,7 @@
label="鎿嶄綔"
width="160"
fixed="right"
+ class-name="fixed-column"
>
<template slot-scope="{row}">
<div class="operationClass">
@@ -461,7 +489,7 @@
</el-tooltip>
<el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
- <i class="el-icon-delete" :style="{color:$store.state.settings.theme}" @click="del(row)" />
+ <i class="el-icon-delete" :style="{color:$store.state.settings.theme}" @click.stop="del(row)" />
</el-tooltip>
<el-tooltip class="item" effect="dark" content="鎵撳嵃宸ュ崟" placement="top">
@@ -500,7 +528,7 @@
align="right"
layout="total,prev, pager, next,sizes,jumper"
popper-class="select_bottom"
- @pagination="getMesOrderSearch"
+ @pagination="getMesOrderSearch();tableDataDetail=[]"
/>
<div class="elTableDiv">
@@ -730,6 +758,7 @@
v-model="dialogForm.mesqty"
oninput="value=value.replace(/[^\d]/g,'')"
style="width: 200px"
+ @input="mesqtyInputChange"
/>
<!-- oninput="value=value.replace(/[^0-9*.{1}0-9*]/g,'')"-->
</el-form-item>
@@ -782,6 +811,14 @@
<!-- </el-form-item>-->
<el-form-item label="浜у搧瑙勬牸" prop="partspec">
<el-input v-model="dialogForm.partspec" disabled style="width: 200px" />
+ </el-form-item>
+
+ <el-form-item v-if="operation!=='add'" label="椤剁骇鐗╂枡缂栫爜" prop="TopInventoryCode">
+ <el-input v-model="dialogForm.TopInventoryCode" disabled style="width: 200px" />
+ </el-form-item>
+
+ <el-form-item v-if="operation!=='add'" label="椤剁骇鐗╂枡鍚嶇О" prop="TopInventoryName">
+ <el-input v-model="dialogForm.TopInventoryName" disabled style="width: 200px" />
</el-form-item>
<!-- :disabled="dialogForm.partcode===''"-->
@@ -855,6 +892,7 @@
class="stepSelectedValueClass"
style="width: 930px;"
multiple
+ filterable
placeholder="璇烽�夋嫨鐩稿搴斿伐搴�"
@change="stepSelectedValueChange"
>
@@ -1502,6 +1540,9 @@
<el-form-item label="浜у搧瑙勬牸:" class="formContent">
{{ formApprove.partspec }}
</el-form-item>
+ <el-form-item label="椤剁骇鐗╂枡:" class="formContent">
+ {{ formApprove.TopInventoryName }}
+ </el-form-item>
<el-form-item label="宸ュ崟鏁伴噺:" class="formContent">
{{ formApprove.plan_qty }}
</el-form-item>
@@ -1599,22 +1640,29 @@
<el-table-column
id="column4"
prop="good_qty"
- width="100"
+ width="60"
align="center"
- label="鍚堟牸鏁伴噺"
+ label="鍚堟牸"
/>
<el-table-column
id="column5"
- width="100"
+ width="60"
prop="ng_qty"
align="center"
- label="涓嶈壇鏁伴噺"
+ label="涓嶈壇"
/>
<el-table-column
id="column6"
prop="desc"
align="center"
- width="120"
+ width="100"
+ label="妫�楠屽憳"
+ />
+ <el-table-column
+ id="column6"
+ prop="desc"
+ align="center"
+ width="100"
label="澶囨敞"
/>
</el-table>
@@ -1755,7 +1803,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="sendMesOrderDistribution">鎵� 鍗�</el-button>
</div>
</span>
</el-dialog>
@@ -2559,6 +2607,7 @@
class="stepSelectedValueClass"
style="width: 930px;"
multiple
+ filterable
placeholder="璇烽�夋嫨鐩稿搴斿伐搴�"
@change="val=>stepSelectedValueChangeBatchUpdate(val,index)"
>
@@ -2721,7 +2770,7 @@
tableHeight: 0,
username: '',
form: {
- wkshopcode: '', // 杞﹂棿缂栫爜
+ wkshopcode: [], // 杞﹂棿缂栫爜
mesorderstus: '', // 宸ュ崟鐘舵�佺爜
mesordercode: '', // 宸ュ崟缂栧彿
partcode: '', // 浜у搧缂栫爜
@@ -2770,7 +2819,9 @@
deliverydate: '', // 浜や粯鏃堕棿
data_sources: '', // 鏁版嵁鏉ユ簮
-
+ idTopInventory: '', // 椤剁骇鐗╂枡id
+ TopInventoryCode: '', // 椤剁骇鐗╂枡缂栫爜
+ TopInventoryName: '', // 椤剁骇鐗╂枡鍚嶇О
routecode: '', // 宸ヨ壓璺嚎
mesmaxqty: 0, // 宸ュ崟鐨勬渶澶у��
@@ -2855,7 +2906,7 @@
console.log('鎵ц浜嗘墦鍗�')
}
},
-
+ sendMesOrderWoCode: '',
formApprove: {
m_po: '', // 婧愬崟鍗曞彿
mesordercode: '',
@@ -2863,6 +2914,7 @@
partname: '',
partspec: '',
plan_qty: '',
+ TopInventoryName: '',
routename: '',
lm_date: '',
priuserdefnvc1: '',
@@ -3039,7 +3091,25 @@
// })
},
methods: {
+ // 鎵撳嵃鐨勬椂鍊欐墽琛屾淳鍙戜簨浠�
+ sendMesOrderDistribution() {
+ MesOrderDistribution([this.sendMesOrderWoCode]).then(res => {
+ if (res.code === '200') {
+ this.$notify.success('娲惧彂鎴愬姛!')
+ this.getMesOrderSearch()
+ }
+ })
+ },
+
+ mesqtyInputChange(val) {
+ if (this.stepTableData && this.stepTableData.length > 0) {
+ this.stepTableData.forEach(i => {
+ i.sumqty = Math.floor(parseFloat(val) * (1 + (parseFloat(i.ratio) / 100)))
+ })
+ }
+ },
statusChange(val) {
+ this.tableDataDetail = []
this.form.mesorderstus = val
this.getMesOrderSearch()
},
@@ -3436,6 +3506,20 @@
tableRowClassName({ row, rowIndex }) {
return 'custom-row'
},
+ tableRowClassName2({ row, rowIndex }) {
+ if (row.status === 'NEW') {
+ return 'custom-row1'
+ }
+ if (row.status === 'ALLO') {
+ return 'custom-row2'
+ }
+ if (row.status === 'START') {
+ return 'custom-row3'
+ }
+ if (row.status === 'CLOSED') {
+ return 'custom-row4'
+ }
+ },
handleRequest() {
this.getMesOrderSearch().then(res => {
if (res.code === '200') {
@@ -3455,7 +3539,7 @@
// }
const data = {
- wkshopcode: this.form.wkshopcode,
+ wkshopcode: this.form.wkshopcode.join(','),
mesorderstus: this.form.mesorderstus, // 宸ュ崟鐘舵�佺爜
mesordercode: this.form.mesordercode, // 宸ュ崟缂栧彿
partcode: this.form.partcode, // 浜у搧缂栫爜
@@ -3529,7 +3613,7 @@
// 閲嶇疆
reset(val) {
- this.form.wkshopcode = ''
+ this.form.wkshopcode = []
this.form.mesorderstus = ''
this.form.mesordercode = ''
this.form.partcode = ''
@@ -3628,6 +3712,7 @@
if (this.form.page > 1 && this.tableData.length === 1) {
this.form.page--
}
+ this.tableDataDetail = []
this.getMesOrderSearch()
}
})
@@ -3660,6 +3745,9 @@
this.dialogForm.routecode = row.route_code
this.dialogForm.deliverydate = row.saleOrderDeliveryDate.substring(0, 11)
this.dialogForm.mesqty = row.plan_qty
+ this.dialogForm.TopInventoryCode = row.TopInventoryCode
+ this.dialogForm.TopInventoryName = row.TopInventoryName
+ this.dialogForm.idTopInventory = row.idTopInventory
this.dialogForm.mesqtyinit = row.plan_qty
@@ -3872,7 +3960,9 @@
mesqty: '', // 宸ュ崟鏁伴噺
wkshopcode: '', // 鐢熶骇杞﹂棿缂栫爜
wkshopname: '', // 鐢熶骇杞﹂棿鍚嶇О
-
+ idTopInventory: '', // 椤剁骇鐗╂枡id
+ TopInventoryCode: '', // 椤剁骇鐗╂枡缂栫爜
+ TopInventoryName: '', // 椤剁骇鐗╂枡鍚嶇О
deliverydate: '', // 浜や粯鏃堕棿
data_sources: '' // 鏁版嵁鏉ユ簮
}
@@ -3934,7 +4024,7 @@
return this.$message.error('鏈夊簭鎶ュ伐鎯呭喌涓嬶紝瓒呮姤姣斾緥鍚庨亾宸ュ簭涓嶈兘澶т簬鍓嶉亾宸ュ簭锛�')
}
}
- console.log(isNaN(this.dialogForm.mesqty - this.dialogForm.mesqtyinit))
+ // console.log(isNaN(this.dialogForm.mesqty - this.dialogForm.mesqtyinit))
const data = {
wostatus: this.dialogForm.mesorderstus, // 宸ュ崟鐘舵��
wocode: this.dialogForm.mesordercode, // 宸ュ崟鍙�
@@ -3961,6 +4051,7 @@
// this.handlePrint()
this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇濆瓨鎴愬姛锛�')
this.getMesOrderSearch()
+ this.tableDataDetail = []
this.$store.state.app.buttonIsDisabled = false
} else {
this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇濆瓨澶辫触锛�')
@@ -4028,10 +4119,13 @@
this.formApprove.priuserdefnvc5 = row.priuserdefnvc5 ? row.priuserdefnvc5 : '/'
this.formApprove.priuserdefnvc6 = row.priuserdefnvc6 ? row.priuserdefnvc6 : '/'
+ this.formApprove.TopInventoryName = row.TopInventoryName || '/'
+
this.formApprove.saleOrderCode = this.formApprove.saleOrderCode !== '' ? this.formApprove.saleOrderCode : saleOrderCode
const data2 = {
mesordercode: wo_code || this.dialogForm.mesordercode
}
+ this.sendMesOrderWoCode = wo_code || this.dialogForm.mesordercode
MesOrderPrintSearch(data2).then(res2 => {
if (res2.code === '200') {
this.dialogVisibleApprove = true
@@ -4138,7 +4232,7 @@
this.formApprove.plan_qty = ''
this.formApprove.routename = ''
this.formApprove.lm_date = ''
-
+ this.formApprove.TopInventoryName = ''
this.formApprove.priuserdefnvc1 = ''
this.formApprove.priuserdefnvc2 = ''
this.formApprove.priuserdefnvc3 = ''
@@ -4522,7 +4616,7 @@
getSummaries(param) {
const { columns, data } = param
const sums = []
- const i = 9
+ const i = 13
columns.forEach((column, index) => {
if (index === i) {
sums[index] = '鎬绘暟'
@@ -4889,7 +4983,25 @@
.statusItemLight{
font-weight: bolder;
- color: #42b983;
+ //color: #42b983;
+ color: #000;
+}
+
+.statusItemLight1{
+ font-weight: bolder;
+ color: rgba(245, 108, 108, 1);
+}
+.statusItemLight2{
+ font-weight: bolder;
+ color: rgba(230, 162, 60, 1);
+}
+.statusItemLight3{
+ font-weight: bolder;
+ color: rgba(144, 147, 153, 1);
+}
+.statusItemLight4{
+ font-weight: bolder;
+ color: rgba(103, 194, 58, 1);
}
</style>
@@ -4898,6 +5010,27 @@
.el-table .custom-row {
background: #f8f8fa;
}
+
+.el-table .custom-row1 {
+ background: rgba(245, 108, 108, 0.4);
+}
+
+.el-table .custom-row2 {
+ background: rgba(230, 162, 60, 0.4);
+}
+
+.el-table .custom-row3 {
+ background: rgba(144, 147, 153, 0.4);
+}
+
+.el-table .custom-row4 {
+ background: rgba(103, 194, 58, 0.4);
+}
+
+.el-table .fixed-column {
+ background: #f8f8fa;
+}
+
</style>
<style>
.sortable-ghost {
--
Gitblit v1.9.3