From c4158c84f0b6b17ccb2818d80b963d803fb922b4 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期六, 30 三月 2024 16:56:23 +0800
Subject: [PATCH] 销售明细单确认发货完成替换接口,发货修改判断条件
---
src/views/sales/salesDetails/shipmentsDialog.vue | 280 +++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 196 insertions(+), 84 deletions(-)
diff --git a/src/views/sales/salesDetails/shipmentsDialog.vue b/src/views/sales/salesDetails/shipmentsDialog.vue
index 99b4e18..3b9f538 100644
--- a/src/views/sales/salesDetails/shipmentsDialog.vue
+++ b/src/views/sales/salesDetails/shipmentsDialog.vue
@@ -12,8 +12,8 @@
ref="form"
:model="editConfig.infomation"
:rules="rules"
- label-position="right"
- label-width="10%"
+ label-position="left"
+ label-width="90px"
size="mini"
style="height: 60vh; overflow-x: hidden"
>
@@ -23,15 +23,15 @@
<div class="basic-info-view">
<el-row>
<el-col :span="24">
- <el-form-item width="50%" label="浜や粯绫诲瀷" prop="addressee">
- <el-radio-group v-model="shipmentsType" @change="handleRadioChange">
+ <el-form-item width="50%" label="浜や粯绫诲瀷锛�" prop="deliverType">
+ <el-radio-group v-model="editConfig.infomation.deliverType" @change="handleRadioChange">
<el-radio :label="1">涓�娆″彂璐�</el-radio>
<el-radio :label="2">澶氭鍙戣揣</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
- <el-form-item label="鍏宠仈椤圭洰" prop="projectId">
+ <el-form-item label="鍏宠仈椤圭洰锛�" prop="projectId">
<el-select
v-model="editConfig.infomation.projectId"
placeholder="璇烽�夋嫨"
@@ -62,27 +62,24 @@
</el-col> -->
</el-row>
</div>
- <div class="product-view">
+ <div class="product-view" v-if="isCommonShow">
<CommonFormTableView
ref="commonFormTableView"
:detail-enter="isView ? true : false"
:selectBox="false"
+ :colOpenShow="true"
:addTypeIdMultiple="true"
pageName="quotation"
+ :isBorder="true"
:detailEnter="true"
- :isOperate="
- (autoCodeHeadersObj.Bjd == 'yes' && editConfig.infomation.quotation_number) ||
- autoCodeHeadersObj.Bjd != 'yes'
- ? true
- : false
- "
- :quotationNumber="autoCodeHeadersObj.Bjd == 'yes' ? editConfig.infomation.quotation_number : ''"
:product-table-list="productTableList"
+ :isOperate="true"
@inputContent="inputContent"
@addProductClick="addProductClick"
@getSelectArray="getSelectArray"
@emptyProductClick="emptyProductClick"
@clearupProduct="clearupProduct"
+ @selTableCol="selTableCol"
></CommonFormTableView>
</div>
<p class="tips tips_success" v-if="completely"><i class="el-icon-warning-outline"></i>{{ shipmentsMsg }}</p>
@@ -130,6 +127,17 @@
},
},
data() {
+ // 浜у搧淇℃伅
+ const productColumn = [
+ { label: "浜у搧缂栧彿", prop: "number",},
+ { label: "浜у搧鍚嶇О", prop: "name", min: 110 },
+ { label: "璁㈠崟鏁伴噺", prop: "orderAmount",min:110,},
+ { label: "璁㈠崟瀹屾垚鏁伴噺", min:120,prop: "finishAmount",},
+ { label: "鍙敤搴撳瓨", prop: "availableAmount",},
+ { label: "鏈彂璐ф暟閲�", prop: "leftAmount", min:120, },
+ { label: "鏈鍙戣揣鏁伴噺", prop: "outputAmount", min:120,inputFloat: true,isRequird:true,},
+ { label: "鍓╀綑鍙戣揣鏁伴噺", prop: "availableAmount",min:120,},
+ ]
return {
dialogWidth: "60%",
editConfig: this.editCommonConfig,
@@ -141,7 +149,15 @@
wechatOrderStatusOptions: [], // 寰俊璁㈠崟鐘舵��
currencyOptions: [{ id: 1, name: "浜烘皯甯�" }], // 甯佺
approvalWorkflowOptions: [], // 瀹℃壒娴佺▼
- productTableList: {},
+ productTableList: {
+ allcol: [],
+ showcol: ['浜у搧缂栧彿','浜у搧鍚嶇О', "璁㈠崟鏁伴噺", "璁㈠崟瀹屾垚鏁伴噺",],
+ tableData: [],
+ tableColumn: []
+ },
+ tableColumn: productColumn,
+ searchOptions: [],
+
showSummary: {
show: true,
total: true,
@@ -195,7 +211,6 @@
return time.getTime() > Date.now()
}
},
- shipmentsType:1,
options: [{
value: '1',
label: '浠撳簱1--搴撳瓨涓嶈冻鐨勬儏鍐�'
@@ -208,6 +223,7 @@
shipmentsMsg:"",
dissatisfy:false, // 涓�娆″彂璐�-涓嶈冻
completely:false, // 澶氭鍙戣揣锛屽厖瓒�
+ isCommonShow:true,
}
},
mounted(){
@@ -217,19 +233,22 @@
created() {
this.$store.dispatch("geClient")
this.setTableForm()
+ this.handleRadioChange()
this.getCommonData()
this.formInfo()
this.getUseSystemSet({ modeType: "xsmx" })
this.getProjectList()
this.getDeliveryPrepareInfo({
- saleDetailID: this.editCommonConfig.infomation.saleDetailID,
- saleDetailNumber: this.editCommonConfig.infomation.saleDetailNumber
+ saleDetailID: this.editCommonConfig.infomation.saleDetailID,
+ saleDetailNumber: this.editCommonConfig.infomation.saleDetailNumber
})
},
watch: {
"editClientManageConfig.visible"(val) {
if (val) {
+ this.handleRadioChange()
this.formInfo()
+
}
}
},
@@ -276,9 +295,11 @@
let isShipments=false
let shipmentsNum=false
this.shipmentsList.map((item)=>{
- if(this.shipmentsType===1){
- if(item.leftAmount<item.availableAmount){
+ if(this.editConfig.infomation.deliverType===1){
+ if(item.leftAmount<=item.availableAmount&&item.leftAmount>0){
isShipments=false
+ }else if(item.leftAmount<=0){
+ shipmentsNum=true
}else{
isShipments=true
}
@@ -289,6 +310,8 @@
shipmentsNum=true
}else if(!item.outputAmount){
shipmentsNum=true
+ }else if(item.leftAmount<=0){
+ isShipments=true
}else{
isShipments=false
}
@@ -318,7 +341,7 @@
this.shipmentsList.map((item)=>{
let obj={
number:item.number,
- outputAmount:this.shipmentsType===1?item.leftAmount:item.outputAmount // 鏈鍙戣揣鏁伴噺
+ outputAmount:this.editConfig.infomation.deliverType===1?item.leftAmount:item.outputAmount // 鏈鍙戣揣鏁伴噺
}
params.products.push(obj)
})
@@ -440,23 +463,51 @@
}
]
} else {
- this.tableData = this.editConfig.infomation.products
+ this.tableData = this.editConfig.infomation.products?this.editConfig.infomation.products:[]
this.tableData.map((item, index) => {
item.productId = index + 1
})
this.getQuotation(this.editConfig.infomation.saleChanceId, "鍏ㄩ儴浜у搧")
}
+ this.tableColumn=[
+ { label: "浜у搧缂栧彿", prop: "number", },
+ { label: "浜у搧鍚嶇О", prop: "name", min: 110 },
+ { label: "璁㈠崟鏁伴噺", prop: "orderAmount",},
+ { label: "璁㈠崟瀹屾垚鏁伴噺", min:120, prop: "finishAmount", }
+ ]
this.productTableList = {
tableData: this.tableData,
isReturn: true,
- tableColumn: [
- { label: "浜у搧缂栧彿", prop: "number" },
- { label: "浜у搧鍚嶇О", prop: "name", min: 110 },
- { label: "璁㈠崟鏁伴噺", prop: "orderAmount" },
- { label: "璁㈠崟瀹屾垚鏁伴噺", prop: "finishAmount" },
- // { label: "鍙敤搴撳瓨", prop: "unit" },
- ]
+ // tableColumn: [
+ // { label: "浜у搧缂栧彿", prop: "number",},
+ // { label: "浜у搧鍚嶇О", prop: "name",min: 110 },
+ // { label: "璁㈠崟鏁伴噺", prop: "orderAmount",},
+ // { label: "璁㈠崟瀹屾垚鏁伴噺", prop: "finishAmount",}
+ // ],
+ tableColumn: this.setColumnVisible(this.productTableList.showcol, this.tableColumn)
}
+ this.setTableList(this.productTableList)
+ },
+ setTableList(tableList) {
+ tableList.allcol = tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
+ this.searchOptions = []
+ for (let i = 0; i < tableList.tableColumn.length; i++) {
+ const label = tableList.tableColumn[i].label
+ const value = tableList.tableColumn[i].prop
+ this.searchOptions.push({ value: value, label: label })
+ }
+ },
+ setColumnVisible(showcol, tableColumn) {
+ return tableColumn.map((ele) => {
+ return {
+ ...ele,
+ isShowColumn: showcol.includes(ele.label)
+ }
+ })
+ },
+ selTableCol(val) {
+ this.productTableList.showcol = val
+ this.productTableList.tableColumn = this.setColumnVisible(val, this.tableColumn)
},
// 浜у搧鍒楄〃杈撳叆
inputContent(val, prop, row) {
@@ -530,76 +581,107 @@
}
},
// 閫夋嫨鍙戣揣鏂瑰紡
- handleRadioChange(value) {
+ handleRadioChange() {
+ let value=this.editConfig.infomation.deliverType
this.shipmentsList=[]
this.dissatisfy=false
this.completely=false
- if(value===1){
- this.productTableList.tableColumn=[
- { label: "浜у搧缂栧彿", prop: "number" },
- { label: "浜у搧鍚嶇О", prop: "name", min: 110 },
- { label: "璁㈠崟鏁伴噺", prop: "orderAmount" },
- { label: "璁㈠崟瀹屾垚鏁伴噺", prop: "finishAmount" },
- { label: "鍙敤搴撳瓨", prop: "availableAmount" },
+ this.isCommonShow=false;
+ this.$nextTick(()=>{
+ this.isCommonShow=true;
+ })
+ if(value==1){
+ this.productTableList.showcol= ['浜у搧缂栧彿','浜у搧鍚嶇О', "璁㈠崟鏁伴噺", "璁㈠崟瀹屾垚鏁伴噺","鍙敤搴撳瓨"]
+ this.productTableList.allcol= ["璁㈠崟鏁伴噺", "璁㈠崟瀹屾垚鏁伴噺","鍙敤搴撳瓨"]
+ this.tableColumn=[
+ { label: "浜у搧缂栧彿", prop: "number", },
+ { label: "浜у搧鍚嶇О", prop: "name",min: 110 },
+ { label: "璁㈠崟鏁伴噺", prop: "orderAmount",},
+ { label: "璁㈠崟瀹屾垚鏁伴噺", min:120, prop: "finishAmount", },
+ { label: "鍙敤搴撳瓨", prop: "availableAmount",},
]
+ this.productTableList.tableColumn=this.setColumnVisible(this.productTableList.showcol, this.tableColumn)
this.dissatisfy=false
let portion=0
+ // let noUsable=false
this.productTableList.tableData.map((item)=>{
- if(item.availableAmount>=item.leftAmount&&item.availableAmount>0){
+ item.availableAmount=Number(item.availableAmount)
+ item.leftAmount=Number(item.leftAmount)
+ item.finishAmount=Number(item.finishAmount)
+ item.orderAmount=Number(item.orderAmount)
+ console.log(item,"item")
+ if(item.availableAmount>=item.leftAmount&&item.availableAmount>0&&item.leftAmount>0){
portion++
this.shipmentsList.push(item)
}
+ // if(item.availableAmount<item.leftAmount){
+ // noUsable=true
+ // }
+ })
if(portion===0){// 娌℃湁浜у搧婊¤冻鍙戣揣鏉′欢
this.completely=false
this.dissatisfy=true
- this.shipmentsMsg="褰撳墠浠撳簱搴撳瓨涓嶈冻,涓嶈兘瀹屾垚涓�娆″彂璐�"
+ // if(noUsable){
+ // this.shipmentsMsg="鍙敤搴撳瓨涓嶆弧瓒虫湭鍙戣揣鏁伴噺,鏃犳硶鍙戣揣"
+ // }else{
+ // }
+ this.shipmentsMsg="鍙敤搴撳瓨鎴栨湭鍙戣揣鏁伴噺涓�0鎴栧綋鍓嶅彲鐢ㄥ簱瀛樹笉婊¤冻鏈彂璐ф暟閲忥紝涓嶈兘瀹屾垚涓�娆″彂璐�"
+
}else if(portion>0&&portion<this.productTableList.tableData.length){// 閮ㄥ垎浜у搧婊¤冻鍙戣揣鏉′欢
this.dissatisfy=false
this.completely=true
this.shipmentsMsg="鍙兘婊¤冻閮ㄥ垎鍙戣揣闇�姹傦紝鏄惁纭鍙戣揣"
- }else if(portion===this.productTableList.tableData.length){// 鍏呭垎婊¤冻
+ }else if(portion!==0){
this.dissatisfy=false
this.completely=true
+ console.log(portion,"portion")
this.shipmentsMsg="鑳芥弧瓒冲彂璐ч渶姹傦紝鐩存帴鍙戣揣鍚�"
}
- })
+
if(portion===this.productTableList.tableData.length){ // 鍏ㄩ儴婊¤冻鍙戣揣鏉′欢
this.dissatisfy=false
this.completely=false
this.completely=true
}
- }else if(value===2){
- this.productTableList.tableColumn= [
- { label: "浜у搧缂栧彿", prop: "number" },
- { label: "浜у搧鍚嶇О", prop: "name", min: 110 },
- { label: "璁㈠崟鏁伴噺", prop: "orderAmount" },
- { label: "璁㈠崟瀹屾垚鏁伴噺", prop: "finishAmount" },
- { label: "鍙敤搴撳瓨", prop: "availableAmount" },
- { label: "鏈彂璐ф暟閲�", prop: "leftAmount", },
- { label: "鏈鍙戣揣鏁伴噺", prop: "outputAmount", inputFloat: true,isRequird:true },
- { label: "鍓╀綑鍙戣揣鏁伴噺", prop: "availableAmount",},
+ }else if(value==2){
+ this.productTableList.showcol= ['浜у搧缂栧彿','浜у搧鍚嶇О', "璁㈠崟鏁伴噺", "璁㈠崟瀹屾垚鏁伴噺","鍙敤搴撳瓨","鏈彂璐ф暟閲�", "鏈鍙戣揣鏁伴噺","鍓╀綑鍙戣揣鏁伴噺",]
+ this.productTableList.allcol= [ "璁㈠崟鏁伴噺", "璁㈠崟瀹屾垚鏁伴噺","鍙敤搴撳瓨","鏈彂璐ф暟閲�", "鍓╀綑鍙戣揣鏁伴噺",]
+ this.tableColumn= [
+ { label: "浜у搧缂栧彿", prop: "number", },
+ { label: "浜у搧鍚嶇О", prop: "name", min: 110 ,},
+ { label: "璁㈠崟鏁伴噺", prop: "orderAmount", },
+ { label: "璁㈠崟瀹屾垚鏁伴噺", min:120, prop: "finishAmount" ,},
+ { label: "鍙敤搴撳瓨", prop: "availableAmount",},
+ { label: "鏈彂璐ф暟閲�", prop: "leftAmount", min:120, },
+ { label: "鏈鍙戣揣鏁伴噺", prop: "outputAmount", min:120,inputFloat: true,isRequird:true,},
+ { label: "鍓╀綑鍙戣揣鏁伴噺", prop: "availableAmount", min:120,},
]
+ this.productTableList.tableColumn=this.setColumnVisible(this.productTableList.showcol, this.tableColumn)
let portion=0
this.productTableList.tableData.map((item)=>{
- if(item.availableAmount>0){
+ item.availableAmount=Number(item.availableAmount)
+ item.leftAmount=Number(item.leftAmount)
+ item.finishAmount=Number(item.finishAmount)
+ item.orderAmount=Number(item.orderAmount)
+ if(item.availableAmount>0&&item.leftAmount>0){
portion++
this.shipmentsList.push(item)
}
- if(portion===0){ // 娌℃湁涓�浠朵骇鍝佽兘婊¤冻鍙戣揣鏉′欢
- this.completely=false
- this.dissatisfy=true
- this.shipmentsMsg="褰撳墠浠撳簱搴撳瓨涓�0,鏃犳硶鍙戣揣"
- }else if(portion>0&&portion<this.productTableList.tableData.length){
- this.dissatisfy=false
- this.completely=true
- this.shipmentsMsg="鍙兘婊¤冻閮ㄥ垎鍙戣揣闇�姹傦紝鏄惁纭鍙戣揣"
- }else if(portion===this.productTableList.tableData.length){
- this.dissatisfy=false
- this.completely=true
- this.shipmentsMsg="鑳芥弧瓒冲彂璐ч渶姹傦紝鐩存帴鍙戣揣鍚�"
- }
})
+ if(portion===0){ // 娌℃湁涓�浠朵骇鍝佽兘婊¤冻鍙戣揣鏉′欢
+ this.completely=false
+ this.dissatisfy=true
+ this.shipmentsMsg="鍙敤搴撳瓨鎴栨湭鍙戣揣鏁伴噺涓�0,鏃犳硶鍙戣揣"
+ }else if(portion>0&&portion<this.productTableList.tableData.length){
+ this.dissatisfy=false
+ this.completely=true
+ this.shipmentsMsg="鍙兘婊¤冻閮ㄥ垎鍙戣揣闇�姹傦紝鏄惁纭鍙戣揣"
+ }else if(portion===this.productTableList.tableData.length){
+ this.dissatisfy=false
+ this.completely=true
+ this.shipmentsMsg="鑳芥弧瓒冲彂璐ч渶姹傦紝鐩存帴鍙戣揣鍚�"
+ }
}
},
// 浜у搧鍏ュ簱淇℃伅
@@ -608,28 +690,33 @@
this.shipmentsList=[]
if(res&&res.code===200){
this.productTableList.tableData=res.data||[]
- if(this.shipmentsType===1){
+ if(this.editConfig.infomation.deliverType===1){
let portion=0
this.productTableList.tableData.map((item)=>{
- if(item.availableAmount>=item.leftAmount&&item.availableAmount>0){
+ item.availableAmount=Number(item.availableAmount)
+ item.leftAmount=Number(item.leftAmount)
+ item.finishAmount=Number(item.finishAmount)
+ item.orderAmount=Number(item.orderAmount)
+ if(item.availableAmount>=item.leftAmount&&item.availableAmount>0&&item.leftAmount>0){
portion++
this.shipmentsList.push(item)
}
- if(portion===0){// 娌℃湁浜у搧婊¤冻鍙戣揣鏉′欢
- this.completely=false
- this.dissatisfy=true
- this.shipmentsMsg="褰撳墠浜у搧鍙敤搴撳瓨涓�0,鏃犳硶鍙戣揣"
- }else if(portion>0&&portion<this.productTableList.tableData.length){
- this.dissatisfy=false
- this.completely=true
- this.shipmentsMsg="鍙兘婊¤冻閮ㄥ垎鍙戣揣闇�姹傦紝鏄惁纭鍙戣揣"
- // 閮ㄥ垎浜у搧婊¤冻鍙戣揣鏉′欢
- }else if(portion===this.productTableList.tableData.length){
- this.dissatisfy=false
- this.completely=true
- this.shipmentsMsg="鑳芥弧瓒冲彂璐ч渶姹傦紝鐩存帴鍙戣揣鍚�"
- }
})
+ console.log(portion,"portion2")
+ if(portion===0){// 娌℃湁浜у搧婊¤冻鍙戣揣鏉′欢
+ this.completely=false
+ this.dissatisfy=true
+ this.shipmentsMsg="鍙敤搴撳瓨鎴栨湭鍙戣揣鏁伴噺涓�0鎴栧綋鍓嶅彲鐢ㄥ簱瀛樹笉婊¤冻鏈彂璐ф暟閲忥紝涓嶈兘瀹屾垚涓�娆″彂璐�"
+ }else if(portion>0&&portion<this.productTableList.tableData.length){
+ this.dissatisfy=false
+ this.completely=true
+ this.shipmentsMsg="鍙兘婊¤冻閮ㄥ垎鍙戣揣闇�姹傦紝鏄惁纭鍙戣揣"
+ // 閮ㄥ垎浜у搧婊¤冻鍙戣揣鏉′欢
+ }else{
+ this.dissatisfy=false
+ this.completely=true
+ this.shipmentsMsg="鑳芥弧瓒冲彂璐ч渶姹傦紝鐩存帴鍙戣揣鍚�"
+ }
}
}
})
@@ -648,6 +735,9 @@
}
}
.basic-info {
+ padding: 0px 20px ;
+ .product-view{
+ }
.basic-info-title {
background-color: #f4f8fe;
padding-left: 10px;
@@ -683,7 +773,6 @@
.tips{
font-size: 16px;
display: flex;
- margin-left: 20px;
i{
font-size: 24px;
margin-right: 10px;
@@ -710,10 +799,33 @@
background-color: #f5f5f5;
height: 55px;
line-height: 55px;
+ text-align: right !important;
}
- .el-input__inner {
- text-align: left;
- }
+ // .el-input__inner {
+ // text-align: left;
+ // }
}
+ .el-table tr {
+ background-color: #fff;
+ }
+ .el-table th.el-table__cell.is-leaf{
+ background-color: #F1F3F8 !important;
+ }
+ .el-dialog__footer{
+ text-align: right !important;
+ padding-right: 20px;
+ }
+ .el-dialog__header {
+ background: #f5f7fa;
+ height: 50px !important;
+ line-height: 50px !important;
+ padding: 0;
+ font-weight: 600 !important;
+ font-size: 15px !important;
+ padding-left: 20px !important;
+ }
+ // .el-table{
+ // border: 1px solid #e1e1e1;
+ // }
}
</style>
--
Gitblit v1.8.0