From 221cc610f407b71973013de281fd19f7fc909e52 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 19 十二月 2023 10:44:08 +0800
Subject: [PATCH] modified: src/const/crud/customerOrder/customerOrderForm.js
---
src/views/product/workbench/batchproductout-form-new.vue | 302 +++++++++++++++++++++++++++++--------------------
1 files changed, 177 insertions(+), 125 deletions(-)
diff --git a/src/views/product/workbench/batchproductout-form-new.vue b/src/views/product/workbench/batchproductout-form-new.vue
index eae3304..3ec06c5 100644
--- a/src/views/product/workbench/batchproductout-form-new.vue
+++ b/src/views/product/workbench/batchproductout-form-new.vue
@@ -8,17 +8,17 @@
-->
<template>
<el-dialog
- width="95%"
- title="鎵归噺浜у嚭"
+ width="90%"
+ 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"
>
<div
- style="float: left;width: 15%;box-sizing: border-box;padding-right: 34px;position: relative"
+ style="float: left;width: 20%;box-sizing: border-box;padding-right: 34px;position: relative"
>
<el-table
stripe
@@ -48,7 +48,7 @@
style="position: absolute;top:0px;right: 0px;height: 100%;width: 34px;border-left: 1px solid #f4f2ea;border-right: 1px solid #f4f2ea;"
></div>
</div>
- <div style="float: left;width: 85%">
+ <div style="float: left;width: 80%">
<el-row style="">
<el-col :span="1" class="batch-product-out-form-header-col"
><span>搴忓彿</span></el-col
@@ -57,10 +57,10 @@
><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"
- ><span>SN鍙�</span></el-col
- >
- <el-col :span="2" 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
>
<el-col :span="1" class="batch-product-out-form-header-col"
@@ -68,34 +68,40 @@
>
<el-col :span="1" class="batch-product-out-form-header-col"
><span>姣忕洏浜ч噺</span></el-col
- >
- <el-col :span="1" class="batch-product-out-form-header-col"
+ > -->
+ <!-- <el-col :span="1" class="batch-product-out-form-header-col"
><span>璧峰绫虫爣</span></el-col
>
<el-col :span="1" class="batch-product-out-form-header-col"
><span>鎴绫虫爣</span></el-col
- >
+ > -->
<el-col :span="1" class="batch-product-out-form-header-col"
><span>鍗曚綅</span></el-col
>
- <el-col :span="1" 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
- >
- <el-col :span="1" class="batch-product-out-form-header-col"
+ > -->
+ <el-col :span="2" 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
>
- <el-col :span="1" class="batch-product-out-form-header-col"
+ <!-- <el-col :span="1" class="batch-product-out-form-header-col"
><span>鐩樺叿閲嶉噺</span></el-col
- >
- <el-col :span="1" class="batch-product-out-form-header-col"
+ > -->
+ <!-- <el-col :span="1" class="batch-product-out-form-header-col"
><span>姣涢噸</span></el-col
- >
+ > -->
<!--<el-col :span="1" class="batch-product-out-form-header-col"
><span>IFS鎵规鍙�</span></el-col
>-->
- <el-col :span="2" class="batch-product-out-form-header-col"
+ <el-col :span="3" class="batch-product-out-form-header-col"
><span>鐢熶骇浜哄憳</span></el-col
- ><el-col :span="1" class="batch-product-out-form-header-col"
+ ><el-col :span="2" class="batch-product-out-form-header-col"
><span>澶囨敞</span></el-col
>
<el-col :span="1" class="batch-product-out-form-header-col"
@@ -127,24 +133,12 @@
<span class="inline-el-hidden">{{ item.partName }}</span>
</el-tooltip>
</el-col>
- <el-col :span="4" class="batch-product-out-form-body-col">
- <span v-show="!item.batchNoEdit">{{ item.outBatchNo }}</span>
- <!--<el-input v-show="item.batchNoEdit" v-model="item.outBatchNo">
- <i
- slot="prefix"
- class="el-input__icon el-icon-search"
- style="cursor:pointer"
- @click="openOutPutBatch(item)"
- ></i>
- <i
- slot="suffix"
- class="el-input__icon el-icon-circle-close"
- style="cursor:pointer"
- @click="cleanOutBatchNo(item)"
- ></i>
- </el-input>-->
- </el-col>
- <el-col :span="2" 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>
+ </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>
<el-col :span="1" class="batch-product-out-form-body-col l-mes">
@@ -152,32 +146,43 @@
</el-col>
<el-col :span="1" class="batch-product-out-form-body-col l-mes">
<span>{{ item.productQty }}</span>
- </el-col>
- <el-col :span="1" class="batch-product-out-form-body-col l-mes">
+ </el-col> -->
+ <!-- <el-col :span="1" class="batch-product-out-form-body-col l-mes">
<el-input v-model="item.startMeterMark"></el-input>
</el-col>
<el-col :span="1" class="batch-product-out-form-body-col l-mes">
<el-input v-model="item.endMeterMark"></el-input>
- </el-col>
+ </el-col> -->
<el-col :span="1" class="batch-product-out-form-body-col">
<span>{{ item.unit }}</span>
</el-col>
- <el-col :span="1" 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 :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">
+ <span v-text="item.outNum"></span>
+ </el-col>
+ <el-col :span="2" class="batch-product-out-form-body-col l-mes">
+ <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.scrapQty"></el-input>
- </el-col>
- <el-col :span="1" class="batch-product-out-form-body-col l-mes">
+ <!-- <el-col :span="1" class="batch-product-out-form-body-col l-mes">
<el-input v-model="item.reelWeight"></el-input>
- </el-col>
- <el-col :span="1" class="batch-product-out-form-body-col l-mes">
+ </el-col> -->
+ <!-- <el-col :span="1" class="batch-product-out-form-body-col l-mes">
<el-input v-model="item.grossWeight"></el-input>
- </el-col>
+ </el-col> -->
<!--<el-col :span="1" class="batch-product-out-form-body-col l-mes">
<el-input v-model="item.ifsBatchNo"></el-input>
</el-col>-->
- <el-col :span="2" class="batch-product-out-form-body-col">
+ <el-col :span="3" class="batch-product-out-form-body-col">
<el-tooltip
class="item"
effect="dark"
@@ -190,8 +195,8 @@
<!--<el-col :span="1" class="batch-product-out-form-body-col l-mes">
<el-input v-model="item.remark"></el-input>
</el-col>-->
- <el-col :span="1" class="batch-product-out-form-body-col l-mes">
- <el-input v-model="item.mainRemark"></el-input>
+ <el-col :span="2" class="batch-product-out-form-body-col l-mes">
+ <el-input v-model="item.remark"></el-input>
</el-col>
<el-col :span="1" class="batch-product-out-form-body-col">
<span
@@ -205,19 +210,19 @@
</div>
</div>
<div slot="footer" class="dialog-footer">
- <div style="display: inline-block;width: 25%;float: left">
+ <!-- <div style="display: inline-block;width: 25%;float: left">
<el-button
style="margin-right: 34px"
type="primary"
@click="addProductOutForPerson"
>娣诲姞</el-button
>
- </div>
+ </div> -->
<el-button @click="innerVisible = false">鍙� 娑�</el-button>
<el-button
type="primary"
:disabled="saveDisabled"
- @click="saveProductOuts"
+ @click="saveProductOuts2"
>纭� 瀹�</el-button
>
</div>
@@ -314,7 +319,8 @@
batchSaveProductMain,
getShiftProductOutByOpIdAndWsId,
validateOverProduction,
- validateOverFeed
+ validateOverFeed,
+ submitProductMain
} from '@/api/product/personboard'
import ElButton from '../../../../node_modules/element-ui/packages/button/src/button.vue'
import OutPutBatch from './outputbatch.vue'
@@ -358,6 +364,7 @@
data() {
return {
innerVisible: false,
+ staffNameList: [],
personSelection: [],
saveDisabled: false,
currDutyInitproducts: [], // 鐢ㄤ簬缂撳瓨椤甸潰涓師鏈夌殑staff浜у嚭璁板綍锛屽苟涓旀槸灞炰簬褰撳墠鐝涓嬬殑锛岀敤浜庡嬀閫変汉鍛樻椂浣滀负鍘熸暟鎹弬鐓�
@@ -373,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 (
@@ -418,6 +455,9 @@
// 鍐嶅幓涓巔roducts(姝や负椤甸潰鐨勫疄鏃舵暟鎹紝鐢ㄦ埛鏈夋敼鍔ㄥ嵆鏇存柊)瀵规瘮锛屽皢鍏朵腑瀛樺湪鐨勭浉鍚屼汉鍛樼殑鐢熶骇鏁伴噺鍜岀敓浜ф壒娆″悓姝ヨ繃鏉ワ紝鑻roducts涓敓浜ф暟閲忔垨鐢熶骇鎵规涓嶅瓨鍦ㄥ�硷紝鍒欎笉杩涜鍚屾锛屾部鐢ㄥ師鏉ョ殑銆�
// 鏈�鍚庯紝灏嗙粍瑁呭ソ鐨勯�変腑浜哄憳淇℃伅锛屾洿鏂板埌products(鎸夌収鐝杩涜)锛屾敞鎰忔洿鏂颁箣鍚庨�変腑浜哄憳淇℃伅鍦╬roducts浣嶇疆椤哄簭
this.personSelection = val
+ if(this.currshowlist){
+ this.initProductList()
+ }
},
// 鏍规嵁閫変腑鐨勪汉鍛橈紝鐢熸垚浜哄憳浜у嚭淇℃伅锛屽苟涓旀斁鍦ㄥ彸杈瑰垪琛ㄧ殑鏈�鍓嶉潰
addProductOutForPerson() {
@@ -444,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
@@ -498,10 +539,40 @@
// row.outBatchNo = null
}
},
+ saveProductOuts2() {
+ this.clickDateArr.push(new Date().getTime())
+ var productOutputList = []
+ this.products.forEach(a=>{
+ productOutputList.push({
+ partId: a.partId,
+ productQty: a.outNum,
+ outBatchNo: a.outBatchNo,
+ scrapQty: a.scrapQty,
+ remark: a.remark,
+ wdr: a.wdr,
+ staffNo: a.staffNo,
+ staffName: a.staffName,
+ status: a.status,
+ dutyRecordId: a.dutyRecordId,
+ productStaffIds: a.productStaffIds,
+ productStaffs: a.productStaffs,
+ sortNo: a.sortNo
+ })
+ })
+ var productMains = {
+ productOutputList: productOutputList,
+ workstationId: this.parentInfo.workstationId,
+ operationTaskId: this.parentInfo.operationTaskId,
+ }
+ submitProductMain(productMains).then(res=>{
+ this.$emit('refreshProductOutputList', res.data.data)
+ this.innerVisible = false
+ })
+ },
saveProductOuts() {
var canClickFlag = true
this.clickDateArr.push(new Date().getTime())
- if (this.clickDateArr.length > 1) {
+ /* if (this.clickDateArr.length > 1) {
if (
this.clickDateArr[this.clickDateArr.length - 1] -
this.clickDateArr[this.clickDateArr.length - 2] <
@@ -510,7 +581,7 @@
// 灏忎簬2绉掑垯璁や负閲嶅鎻愪氦
canClickFlag = false
}
- }
+ } */
if (canClickFlag) {
this.saveDisabled = true
@@ -538,56 +609,56 @@
s_list = JSON.parse(JSON.stringify(p_list))
}
- if (s_list.length <= 0) {
+ /* if (s_list.length <= 0) {
this.$message.error('鎶ュ伐锛岃濉啓鐩樻暟锛�')
this.saveDisabled = false
return
- }
- let totalDisNumber = 0
- for (let i = 0; i < s_list.length; i++) {
- // 鐩樻暟鏍¢獙
- if (!this.isPositiveIntegerNumber(s_list[i].disNumber)) {
- validateFlag = false
- if (this.groupStatus) {
- validateMsg =
- '浜哄憳锛�' +
- s_list[i].staffName +
- '锛屾墍鍦ㄨ锛屻�愮洏鏁般�戣杈撳叆姝f暣鏁帮紒'
- } else {
- validateMsg = '绗�' + (i + 1) + '琛岋紝銆愮洏鏁般�戣杈撳叆姝f暣鏁帮紒'
- }
- break
- }
- totalDisNumber += s_list[i].disNumber - 0
- // 璧峰绫虫爣鏍¢獙
- if (!this.isNumber(s_list[i].startMeterMark)) {
- validateFlag = false
- validateMsg =
- '绗�' + (i + 1) + '琛岋紝銆愯捣濮嬬背鏍囥�戣杈撳叆闈炶礋鏁帮紝灏忔暟浣嶆渶澶�4浣嶏紒'
- break
- }
- // 鎴绫虫爣鏍¢獙
- if (!this.isNumber(s_list[i].endMeterMark)) {
- validateFlag = false
- validateMsg =
- '绗�' + (i + 1) + '琛岋紝銆愭埅姝㈢背鏍囥�戣杈撳叆闈炶礋鏁帮紝灏忔暟浣嶆渶澶�4浣嶏紒'
- break
- }
- // 鎴绫虫爣闇�澶т簬寮�濮嬬背鏍�
- if (
- Number(s_list[i].endMeterMark) < Number(s_list[i].startMeterMark)
- ) {
- validateFlag = false
- validateMsg =
- '绗�' + (i + 1) + '琛岋紝銆愭埅姝㈢背鏍囥�戦渶澶т簬銆愯捣濮嬬背鏍囥��'
- break
- }
- }
- const maxDisNumber = 2000 // 鏈�澶х洏鏁�
+ } */
+ // let totalDisNumber = 0
+ // for (let i = 0; i < s_list.length; i++) {
+ // // 鐩樻暟鏍¢獙
+ // /* if (!this.isPositiveIntegerNumber(s_list[i].disNumber)) {
+ // validateFlag = false
+ // if (this.groupStatus) {
+ // validateMsg =
+ // '浜哄憳锛�' +
+ // s_list[i].staffName +
+ // '锛屾墍鍦ㄨ锛屻�愮洏鏁般�戣杈撳叆姝f暣鏁帮紒'
+ // } else {
+ // validateMsg = '绗�' + (i + 1) + '琛岋紝銆愮洏鏁般�戣杈撳叆姝f暣鏁帮紒'
+ // }
+ // break
+ // } */
+ // totalDisNumber += s_list[i].disNumber - 0
+ // // 璧峰绫虫爣鏍¢獙
+ // if (!this.isNumber(s_list[i].startMeterMark)) {
+ // validateFlag = false
+ // validateMsg =
+ // '绗�' + (i + 1) + '琛岋紝銆愯捣濮嬬背鏍囥�戣杈撳叆闈炶礋鏁帮紝灏忔暟浣嶆渶澶�4浣嶏紒'
+ // break
+ // }
+ // // 鎴绫虫爣鏍¢獙
+ // if (!this.isNumber(s_list[i].endMeterMark)) {
+ // validateFlag = false
+ // validateMsg =
+ // '绗�' + (i + 1) + '琛岋紝銆愭埅姝㈢背鏍囥�戣杈撳叆闈炶礋鏁帮紝灏忔暟浣嶆渶澶�4浣嶏紒'
+ // break
+ // }
+ // // 鎴绫虫爣闇�澶т簬寮�濮嬬背鏍�
+ // if (
+ // Number(s_list[i].endMeterMark) < Number(s_list[i].startMeterMark)
+ // ) {
+ // validateFlag = false
+ // validateMsg =
+ // '绗�' + (i + 1) + '琛岋紝銆愭埅姝㈢背鏍囥�戦渶澶т簬銆愯捣濮嬬背鏍囥��'
+ // break
+ // }
+ // }
+ /* const maxDisNumber = 2000 // 鏈�澶х洏鏁�
if (totalDisNumber > maxDisNumber) {
validateMsg = '鎬荤洏鏁颁笉鑳藉ぇ浜�' + maxDisNumber + '锛�'
validateFlag = false
- }
+ } */
if (validateFlag) {
if (this.parentInfo.productOutId == null) {
// 褰撳墠鏄骇鍑虹殑鏂板
@@ -671,7 +742,6 @@
// this.saveDisabled = false
// })
// .catch((error) => {
- // console.log('澶辫触' + new Date().getTime())
// this.saveDisabled = false
// })
} else {
@@ -716,7 +786,6 @@
// this.saveDisabled = false
// })
// .catch((error) => {
- // console.log('澶辫触' + new Date().getTime())
// this.saveDisabled = false
// })
})
@@ -734,7 +803,6 @@
}
})
.catch((error) => {
- console.log('澶辫触' + new Date().getTime())
this.saveDisabled = false
})
} else {
@@ -750,7 +818,6 @@
}
})
.catch((error) => {
- console.log('澶辫触' + new Date().getTime())
this.saveDisabled = false
})
}
@@ -789,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])
// 灏嗘暟鎹殑鐩樻暟 鍒嗘垚娈靛悗 鏇存柊姝ゆ鐩樻暟
@@ -804,10 +868,6 @@
}
}
- // console.log(idx)
- // console.log(submitCount)
- // console.log(list)
- // console.log(listDisNumber)
//
// setTimeout(() => {
// loading.close()
@@ -832,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] =
@@ -853,7 +910,6 @@
} else {
// 鎵归噺鎻愪氦瀹屾垚锛屽埛鏂版姤宸ラ〉闈㈡暟鎹�
this.$emit('refreshProductOutputList', productMainId)
- console.log(this.messageMap)
this.$message.success('鏂板鎴愬姛')
this.innerVisible = false
}
@@ -865,7 +921,6 @@
})
.catch((error) => {
loading.close()
- console.log('澶辫触' + new Date().getTime())
this.saveDisabled = false
this.showError()
})
@@ -910,7 +965,6 @@
// this.saveDisabled = false
// })
// .catch((error) => {
- // console.log('澶辫触' + new Date().getTime())
// this.saveDisabled = false
// })
} else {
@@ -951,7 +1005,6 @@
// this.saveDisabled = false
// })
// .catch((error) => {
- // console.log('澶辫触' + new Date().getTime())
// this.saveDisabled = false
// })
})
@@ -969,7 +1022,6 @@
}
})
.catch((error) => {
- console.log('澶辫触' + new Date().getTime())
this.saveDisabled = false
})
}
@@ -1025,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