|
@@ -73,7 +73,7 @@
|
|
|
style="width: 100%"
|
|
|
></crop-select>
|
|
|
<el-select v-else-if="item.prop === 'storageId'" style="width: 100%" :disabled="goodsDisable || viewDisabled" @change="warehouseChange" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
|
|
|
- <el-option v-for="(item,index) in storageList" :key="index" :label="item.cname" :value="item.storageId"></el-option>
|
|
|
+ <el-option v-for="(item,index) in storageList" :key="index" :label="item.stockName" :value="item.storageId"></el-option>
|
|
|
</el-select>
|
|
|
<el-input type="textarea" v-else-if="(item.prop === 'deliveryRemarks')" :disabled="goodsDisable || viewDisabled" v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入"></el-input>
|
|
|
<el-input type="age" v-else v-model="form[item.prop]" :disabled="item.disabled?true:false || goodsDisable || viewDisabled" placeholder="请输入" size="small" autocomplete="off"></el-input>
|
|
@@ -204,7 +204,7 @@
|
|
|
style="width:90% !important;"
|
|
|
size="small"
|
|
|
placeholder="请选择"
|
|
|
- @change="selectCntrNoList(row)"
|
|
|
+ @change="selectInventory(row)"
|
|
|
clearable
|
|
|
filterable>
|
|
|
<el-option v-for="(item,index) in cntrNoList"
|
|
@@ -297,7 +297,7 @@ import marketDetail from "@/components/procurement/market";
|
|
|
import {selectJKGoodsNum} from "@/api/basicData/inventoryAccount"
|
|
|
import _ from "lodash";
|
|
|
import {generateShipment} from "@/api/importTrade/salesContract"
|
|
|
-import option from "../../purchase/contract/config/mainList.json";
|
|
|
+import { getOrgOrderNo } from "@/api/importTrade/salesContract"
|
|
|
|
|
|
export default {
|
|
|
name: "detailsPageEdit",
|
|
@@ -544,27 +544,14 @@ export default {
|
|
|
} else {
|
|
|
item.actualQuantity = item.orderQuantity;
|
|
|
}
|
|
|
- // this.checkCntrNoList(item)
|
|
|
- getListOrgOrderNo(item.billNo,item.contractNumber,item.priceCategory).then(res => {
|
|
|
- this.creditList = res.data
|
|
|
- this.storageList = this.creditList.map(item =>{
|
|
|
- let params ={
|
|
|
- storageId:item.storageId,
|
|
|
- stockName:item.stockName
|
|
|
- }
|
|
|
- return params
|
|
|
- })
|
|
|
- this.cntrNoList = this.creditList.map(item =>{
|
|
|
- let params ={
|
|
|
- cntrNo:item.cntrNo,
|
|
|
- }
|
|
|
- return params
|
|
|
- })
|
|
|
- })
|
|
|
+ //生成时 将合同号放到 明细合同下拉列表里 去重
|
|
|
+ this.contractDic.push({orderNo:item.contractNumber})
|
|
|
+ this.checkCntrNoList(item)
|
|
|
delete item.orderQuantity
|
|
|
delete item.id
|
|
|
})
|
|
|
this.contactsData = this.form.orderItemsList
|
|
|
+ this.contractDicList() //合同下拉列
|
|
|
this.sumOrderNo();
|
|
|
delete this.form.orderItemsList
|
|
|
}).finally(()=>{
|
|
@@ -605,7 +592,10 @@ export default {
|
|
|
})
|
|
|
this.$set(this.form, 'orderNo', Array.from(new Set(contractNumberList)).join(","))
|
|
|
if (row) {
|
|
|
+ //查询库存
|
|
|
this.selectInventory(row)
|
|
|
+ //查询箱号
|
|
|
+ this.checkCntrNoList(row)
|
|
|
}
|
|
|
},
|
|
|
//码单合计
|
|
@@ -625,59 +615,49 @@ export default {
|
|
|
},
|
|
|
//提单号带出合同号
|
|
|
bingOut(row) {
|
|
|
- getListOrgOrderNo(row.billNo,this.form.storageId).then(res => {
|
|
|
- if (res.data) {
|
|
|
- this.contractDic = res.data;
|
|
|
+ getOrgOrderNo(row.billNo).then(res => {
|
|
|
+ this.contractDic.push(res.data)
|
|
|
+ if(res.data.length !== 0){
|
|
|
row.contractNumber = res.data[0].orderNo
|
|
|
+ }else{
|
|
|
+ row.contractNumber = ''
|
|
|
}
|
|
|
- }).catch(() => {
|
|
|
- row.contractNumber = ''
|
|
|
})
|
|
|
- this.sumOrderNo(row);
|
|
|
- this.selectInventory(row)
|
|
|
+ this.contractDicList() //合同下拉列
|
|
|
+ this.sumOrderNo(row); //明细列表合成主表合同
|
|
|
+ this.checkCntrNoList(row) //箱号 仓库下拉列表
|
|
|
+ this.selectInventory(row) //查询库存
|
|
|
},
|
|
|
- // //查询 箱号 仓库list
|
|
|
- // checkCntrNoList(item){
|
|
|
- // getListOrgOrderNo(item.billNo,item.contractNumber,item.priceCategory).then(res => {
|
|
|
- // this.form.creditList = res.data
|
|
|
- // this.form.storageList = this.creditList.map(item =>{
|
|
|
- // let params ={
|
|
|
- // storageId:item.storageId,
|
|
|
- // stockName:item.stockName
|
|
|
- // }
|
|
|
- // return params
|
|
|
- // })
|
|
|
- // item.cntrNoList = this.creditList.map(item =>{
|
|
|
- // let params ={
|
|
|
- // cntrNo:item.cntrNo,
|
|
|
- // }
|
|
|
- // return params
|
|
|
- // })
|
|
|
- // })
|
|
|
- // },
|
|
|
- //选择箱号 或者 仓库
|
|
|
- selectCntrNoList(){
|
|
|
- this.contactsData.forEach(item =>{
|
|
|
- if(item.cntrNo && !this.form.storageId){
|
|
|
- this.storageList = this.creditList.map(i =>{
|
|
|
- if(i.cntrNo == item.cntrNo){
|
|
|
- let params = {
|
|
|
- storageId:i.storageId,
|
|
|
- stockName:i.stockName
|
|
|
- }
|
|
|
- return params
|
|
|
+ //合同号下拉合计
|
|
|
+ contractDicList(){
|
|
|
+ this.contractDic = this.contractDic.reduce((all, next) => all.some((atom) => atom['orderNo'] == next['orderNo']) ? all : [...all, next],[]);
|
|
|
+ },
|
|
|
+ //查询 箱号 仓库list
|
|
|
+ checkCntrNoList(item){
|
|
|
+ if(item.billNo && item.contractNumber && item.priceCategory){
|
|
|
+ getListOrgOrderNo(item.billNo,item.contractNumber,item.priceCategory).then(res => {
|
|
|
+ this.creditList = res.data
|
|
|
+ let storageList = this.creditList.reduce((all, next) => all.some((atom) => atom['storageId'] == next['storageId']) ? all : [...all, next],[]);
|
|
|
+ let cntrNoList = this.creditList.reduce((all, next) => all.some((atom) => atom['cntrNo'] == next['cntrNo']) ? all : [...all, next],[]);
|
|
|
+ storageList.map(item=>{
|
|
|
+ let param ={
|
|
|
+ storageId:item.storageId,
|
|
|
+ stockName:item.stockName
|
|
|
}
|
|
|
+ this.storageList.push(param)
|
|
|
})
|
|
|
- }else if(!item.cntrNo && this.form.storageId){
|
|
|
- this.cntrNoList = this.creditList.map(i =>{
|
|
|
- if(i.storageId == item.storageId){
|
|
|
- return i.cntrNo
|
|
|
+ cntrNoList.map(item=>{
|
|
|
+ let params ={
|
|
|
+ cntrNo:item.cntrNo,
|
|
|
}
|
|
|
+ this.cntrNoList.push(params)
|
|
|
})
|
|
|
- }else{
|
|
|
- this.selectInventory(item)
|
|
|
- }
|
|
|
- })
|
|
|
+ }).finally(()=>{
|
|
|
+ //再次去重
|
|
|
+ this.storageList = this.storageList.reduce((all, next) => all.some((atom) => atom['storageId'] == next['storageId']) ? all : [...all, next],[]);
|
|
|
+ this.cntrNoList = this.cntrNoList.reduce((all, next) => all.some((atom) => atom['cntrNo'] == next['cntrNo']) ? all : [...all, next],[]);
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
//查询库存
|
|
|
selectInventory(row) {
|
|
@@ -721,24 +701,8 @@ export default {
|
|
|
item.srcOrderNo = item.orderNo;
|
|
|
item.srcId = item.id;
|
|
|
//根据提单 合同 货品 查询箱号库存list
|
|
|
- getListOrgOrderNo(item.billNo,item.contractNumber,item.priceCategory).then(res => {
|
|
|
- this.creditList = res.data
|
|
|
- //push到现有的option上
|
|
|
- this.creditList.map(item =>{
|
|
|
- let params ={
|
|
|
- storageId:item.storageId,
|
|
|
- stockName:item.stockName
|
|
|
- }
|
|
|
- this.storageList.push(params)
|
|
|
- })
|
|
|
- //push到现有的option上
|
|
|
- this.creditList.map(item =>{
|
|
|
- let params ={
|
|
|
- cntrNo:item.cntrNo,
|
|
|
- }
|
|
|
- this.cntrNoList.push(params)
|
|
|
- })
|
|
|
- })
|
|
|
+ this.contractDic.push({orderNo:item.contractNumber})
|
|
|
+ this.checkCntrNoList(item)
|
|
|
this.selectInventory(item);
|
|
|
delete item.id
|
|
|
this.$refs.crudContact.rowCellAdd(item);
|
|
@@ -746,6 +710,7 @@ export default {
|
|
|
|
|
|
this.totalChange(); //计算码单 发票
|
|
|
this.sumOrderNo(); //合并合同号
|
|
|
+ this.contractDicList() //合同下拉列
|
|
|
this.marketDialog = false;
|
|
|
},
|
|
|
openDisabled(){
|
|
@@ -776,7 +741,6 @@ export default {
|
|
|
},
|
|
|
//商品编辑
|
|
|
rowCell(row, index) {
|
|
|
- console.log(row)
|
|
|
this.$refs.crudContact.rowCell(row, index)
|
|
|
},
|
|
|
//修改商品信息触发
|
|
@@ -947,6 +911,11 @@ export default {
|
|
|
this.goodsDisable = data.deliveryStatus === "已发货" ? true :false
|
|
|
if (data.deliveryItemsList) {
|
|
|
this.contactsData = this.form.deliveryItemsList
|
|
|
+ this.contactsData.map(item=>{
|
|
|
+ this.contractDic.push({orderNo:item.contractNumber})
|
|
|
+ this.checkCntrNoList(item)
|
|
|
+ this.contractDicList() //合同下拉列
|
|
|
+ })
|
|
|
this.oldContactsData = this.deepClone(this.form.deliveryItemsList)
|
|
|
}
|
|
|
if(data.deliveryFilesList){
|