From 71790ef8fede50105a4e6dfc5430871b90a5c4b9 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 06 三月 2024 12:22:09 +0800
Subject: [PATCH] 销售订单-->提交oa
---
src/views/product/workbench/batchproductout-form-new.vue | 98 ++++++++++++++++++++++++++++++-------------------
1 files changed, 60 insertions(+), 38 deletions(-)
diff --git a/src/views/product/workbench/batchproductout-form-new.vue b/src/views/product/workbench/batchproductout-form-new.vue
index 66bd976..3ec06c5 100644
--- a/src/views/product/workbench/batchproductout-form-new.vue
+++ b/src/views/product/workbench/batchproductout-form-new.vue
@@ -12,7 +12,7 @@
title="姹囨姤浜у嚭"
:visible.sync="innerVisible"
append-to-body
- @close="$emit('update:currshowlist', false)"
+ @close="handleClose"
:show="currshowlist"
:close-on-click-modal="false"
class="batch-product-out-form"
@@ -57,9 +57,9 @@
><el-col :span="2" class="batch-product-out-form-header-col"
><span>闆朵欢鍚嶇О</span></el-col
>
- <el-col :span="4" class="batch-product-out-form-header-col"
+ <!-- <el-col :span="4" class="batch-product-out-form-header-col"
><span>搴忓垪鍙�</span></el-col
- >
+ > -->
<!-- <el-col :span="2" class="batch-product-out-form-header-col"
><span>杞藉叿缂栧彿</span></el-col
>
@@ -78,9 +78,9 @@
<el-col :span="1" class="batch-product-out-form-header-col"
><span>鍗曚綅</span></el-col
>
- <el-col :span="2" class="batch-product-out-form-header-col"
+ <!-- <el-col :span="2" class="batch-product-out-form-header-col"
><span>WDR鍙�</span></el-col
- >
+ > -->
<!-- <el-col :span="1" class="batch-product-out-form-header-col"
><span>鍒嗘鎻忚堪</span></el-col
> -->
@@ -133,11 +133,11 @@
<span class="inline-el-hidden">{{ item.partName }}</span>
</el-tooltip>
</el-col>
- <el-col :span="4" class="batch-product-out-form-body-col l-mes">
+ <!-- <el-col :span="4" class="batch-product-out-form-body-col l-mes"> -->
<!-- <span>{{ item.outBatchNo }}</span> -->
- <el-input v-model="item.outBatchNo">
+ <!-- <el-input v-model="item.outBatchNo">
</el-input>
- </el-col>
+ </el-col> -->
<!-- <el-col :span="2" class="batch-product-out-form-body-col l-mes">
<el-input v-model="item.reelNumber"></el-input>
</el-col>
@@ -156,17 +156,22 @@
<el-col :span="1" class="batch-product-out-form-body-col">
<span>{{ item.unit }}</span>
</el-col>
- <el-col :span="2" class="batch-product-out-form-body-col l-mes">
+ <!-- <el-col :span="2" class="batch-product-out-form-body-col l-mes">
<el-input v-model="item.wdr"></el-input>
- </el-col>
+ </el-col> -->
<!-- <el-col :span="1" class="batch-product-out-form-body-col l-mes">
<el-input v-model="item.segmentDesc"></el-input>
</el-col> -->
<el-col :span="2" class="batch-product-out-form-body-col l-mes">
- <el-input v-model="item.outNum"></el-input>
+ <span v-text="item.outNum"></span>
</el-col>
<el-col :span="2" class="batch-product-out-form-body-col l-mes">
- <el-input v-model="item.scrapQty"></el-input>
+ <el-select v-model="item.scrapQty">
+ <el-option label="0" value="0">
+ </el-option>
+ <el-option label="1" value="1">
+ </el-option>
+ </el-select>
</el-col>
<!-- <el-col :span="1" class="batch-product-out-form-body-col l-mes">
<el-input v-model="item.reelWeight"></el-input>
@@ -191,7 +196,7 @@
<el-input v-model="item.remark"></el-input>
</el-col>-->
<el-col :span="2" class="batch-product-out-form-body-col l-mes">
- <el-input v-model="item.mainRemark"></el-input>
+ <el-input v-model="item.remark"></el-input>
</el-col>
<el-col :span="1" class="batch-product-out-form-body-col">
<span
@@ -359,6 +364,7 @@
data() {
return {
innerVisible: false,
+ staffNameList: [],
personSelection: [],
saveDisabled: false,
currDutyInitproducts: [], // 鐢ㄤ簬缂撳瓨椤甸潰涓師鏈夌殑staff浜у嚭璁板綍锛屽苟涓旀槸灞炰簬褰撳墠鐝涓嬬殑锛岀敤浜庡嬀閫変汉鍛樻椂浣滀负鍘熸暟鎹弬鐓�
@@ -374,6 +380,36 @@
}
},
methods: {
+ initProductList(){
+ let val = this.personSelection
+ //鎸変汉鍛樻姤宸�
+ if(this.groupStatus){
+ this.products = []
+ this.addProductOutForPerson()
+ }else{
+ //鎸夌粍鎶ュ伐
+ let nameList = []
+ val.forEach(obj=>{
+ nameList.push(obj.staffName)
+ })
+ let staffName = Array.from(new Set(nameList)).join(",")
+ if(staffName!=''){
+ this.products = this.productList
+ this.products.forEach(item=>{
+ item.staffName = staffName
+ item.outNum=1
+ })
+ }else{
+ this.products = []
+ }
+ }
+ },
+ handleClose(){
+ this.$emit('update:currshowlist', false)
+ this.$nextTick(()=>{
+ this.$refs.productOutPersonList.clearSelection()
+ })
+ },
isNumber(value) {
var reg = /^[0-9]+(.[0-9]{1,4})?$/
if (
@@ -419,6 +455,9 @@
// 鍐嶅幓涓巔roducts(姝や负椤甸潰鐨勫疄鏃舵暟鎹紝鐢ㄦ埛鏈夋敼鍔ㄥ嵆鏇存柊)瀵规瘮锛屽皢鍏朵腑瀛樺湪鐨勭浉鍚屼汉鍛樼殑鐢熶骇鏁伴噺鍜岀敓浜ф壒娆″悓姝ヨ繃鏉ワ紝鑻roducts涓敓浜ф暟閲忔垨鐢熶骇鎵规涓嶅瓨鍦ㄥ�硷紝鍒欎笉杩涜鍚屾锛屾部鐢ㄥ師鏉ョ殑銆�
// 鏈�鍚庯紝灏嗙粍瑁呭ソ鐨勯�変腑浜哄憳淇℃伅锛屾洿鏂板埌products(鎸夌収鐝杩涜)锛屾敞鎰忔洿鏂颁箣鍚庨�変腑浜哄憳淇℃伅鍦╬roducts浣嶇疆椤哄簭
this.personSelection = val
+ if(this.currshowlist){
+ this.initProductList()
+ }
},
// 鏍规嵁閫変腑鐨勪汉鍛橈紝鐢熸垚浜哄憳浜у嚭淇℃伅锛屽苟涓旀斁鍦ㄥ彸杈瑰垪琛ㄧ殑鏈�鍓嶉潰
addProductOutForPerson() {
@@ -445,7 +484,8 @@
newProduct.partNo = this.parentInfo.partNo
newProduct.partName = this.parentInfo.partName
newProduct.outBatchNo = oriOutBatchNo
- newProduct.productQty = 0
+ newProduct.productQty = 1
+ newProduct.outNum = 1
newProduct.unit = this.parentInfo.unit
newProduct.productStaffs = productStaffs
newProduct.productStaffIds = productStaffIds
@@ -502,20 +542,21 @@
saveProductOuts2() {
this.clickDateArr.push(new Date().getTime())
var productOutputList = []
- this.productList.forEach(a=>{
+ this.products.forEach(a=>{
productOutputList.push({
partId: a.partId,
productQty: a.outNum,
outBatchNo: a.outBatchNo,
scrapQty: a.scrapQty,
remark: a.remark,
- wdr: a.wdr,
+ wdr: a.wdr,
staffNo: a.staffNo,
staffName: a.staffName,
status: a.status,
dutyRecordId: a.dutyRecordId,
productStaffIds: a.productStaffIds,
- productStaffs: a.productStaffs
+ productStaffs: a.productStaffs,
+ sortNo: a.sortNo
})
})
var productMains = {
@@ -701,7 +742,6 @@
// this.saveDisabled = false
// })
// .catch((error) => {
- // console.log('澶辫触' + new Date().getTime())
// this.saveDisabled = false
// })
} else {
@@ -746,7 +786,6 @@
// this.saveDisabled = false
// })
// .catch((error) => {
- // console.log('澶辫触' + new Date().getTime())
// this.saveDisabled = false
// })
})
@@ -764,7 +803,6 @@
}
})
.catch((error) => {
- console.log('澶辫触' + new Date().getTime())
this.saveDisabled = false
})
} else {
@@ -780,7 +818,6 @@
}
})
.catch((error) => {
- console.log('澶辫触' + new Date().getTime())
this.saveDisabled = false
})
}
@@ -819,9 +856,6 @@
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
- // console.log('==========')
- // console.log(nowListIndex)
- // console.log(oriList[nowListIndex])
const list = []
list.push(oriList[nowListIndex])
// 灏嗘暟鎹殑鐩樻暟 鍒嗘垚娈靛悗 鏇存柊姝ゆ鐩樻暟
@@ -834,10 +868,6 @@
}
}
- // console.log(idx)
- // console.log(submitCount)
- // console.log(list)
- // console.log(listDisNumber)
//
// setTimeout(() => {
// loading.close()
@@ -862,9 +892,6 @@
if (data.code == 0) {
// 杩斿洖鎶ュ伐涓昏〃id锛岀敤浜庡埛鏂伴〉闈�
var productMainId = data.data
- // console.log(idx)
- // console.log(submitCount)
- // console.log(listDisNumber)
loading.close()
// 宸插畬鎴愭暟鎹� 娑堟伅璁板綍
this.messageMap['' + nowListIndex] =
@@ -883,7 +910,6 @@
} else {
// 鎵归噺鎻愪氦瀹屾垚锛屽埛鏂版姤宸ラ〉闈㈡暟鎹�
this.$emit('refreshProductOutputList', productMainId)
- console.log(this.messageMap)
this.$message.success('鏂板鎴愬姛')
this.innerVisible = false
}
@@ -895,7 +921,6 @@
})
.catch((error) => {
loading.close()
- console.log('澶辫触' + new Date().getTime())
this.saveDisabled = false
this.showError()
})
@@ -940,7 +965,6 @@
// this.saveDisabled = false
// })
// .catch((error) => {
- // console.log('澶辫触' + new Date().getTime())
// this.saveDisabled = false
// })
} else {
@@ -981,7 +1005,6 @@
// this.saveDisabled = false
// })
// .catch((error) => {
- // console.log('澶辫触' + new Date().getTime())
// this.saveDisabled = false
// })
})
@@ -999,7 +1022,6 @@
}
})
.catch((error) => {
- console.log('澶辫触' + new Date().getTime())
this.saveDisabled = false
})
}
@@ -1055,14 +1077,14 @@
this.products.push(this.productList[i])
}
this.$nextTick(() => {
- this.$refs.productOutPersonList.clearSelection()
+ this.$refs.productOutPersonList.toggleAllSelection()
})
} else {
for (let i = 0; i < this.productList.length; i++) {
this.products.push(this.productList[i])
}
this.$nextTick(() => {
- this.$refs.productOutPersonList.clearSelection()
+ this.$refs.productOutPersonList.toggleAllSelection()
})
}
}
--
Gitblit v1.9.3