|
@@ -213,7 +213,7 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="small"
|
|
|
:disabled="goodsDisable"
|
|
|
- @click="marketDialog = true"
|
|
|
+ @click="openMarketDialog"
|
|
|
>导入明细
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -245,6 +245,7 @@
|
|
|
:close-on-press-escape="false"
|
|
|
v-dialog-drag>
|
|
|
<market-detail
|
|
|
+ :marketParams="marketParams"
|
|
|
@closeFun="!marketDialog"
|
|
|
@importMarket="importMarket"
|
|
|
@close="closeMarkeDialog"
|
|
@@ -294,6 +295,7 @@ export default {
|
|
|
marketDialog: false,
|
|
|
customerContact: customerContact,
|
|
|
contactsForm: {},
|
|
|
+ marketParams:{},
|
|
|
contactsData: [],
|
|
|
currencyDic:[],
|
|
|
storageIdDic: [],
|
|
@@ -524,11 +526,23 @@ export default {
|
|
|
} else {
|
|
|
item.actualQuantity = item.orderQuantity;
|
|
|
}
|
|
|
-
|
|
|
- //查询库存
|
|
|
- getListOrgOrderNo(item.billNo,item.contractNumber,item.priceCategory).then(res => {
|
|
|
- this.creditList = res.data
|
|
|
- })
|
|
|
+ // 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
|
|
|
+ })
|
|
|
+ })
|
|
|
delete item.orderQuantity
|
|
|
delete item.id
|
|
|
})
|
|
@@ -594,39 +608,58 @@ export default {
|
|
|
//提单号带出合同号
|
|
|
bingOut(row) {
|
|
|
getListOrgOrderNo(row.billNo,this.form.storageId).then(res => {
|
|
|
- // if (res.data) {
|
|
|
- // this.contractDic = res.data;
|
|
|
- // row.contractNumber = res.data[0].orderNo
|
|
|
- // }
|
|
|
+ if (res.data) {
|
|
|
+ this.contractDic = res.data;
|
|
|
+ row.contractNumber = res.data[0].orderNo
|
|
|
+ }
|
|
|
}).catch(() => {
|
|
|
row.contractNumber = ''
|
|
|
})
|
|
|
this.sumOrderNo(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(row){
|
|
|
- if(row.cntrNo && !this.form.storageId){
|
|
|
- this.storageList = this.cntrNoList.map(item =>{
|
|
|
- if(item.cntrNo == row.cntrNo){
|
|
|
- let params = {
|
|
|
- storageId:item.storageId,
|
|
|
- stockName:item.stockName
|
|
|
+ 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
|
|
|
}
|
|
|
- return params
|
|
|
- }
|
|
|
- })
|
|
|
- }else if(!row.cntrNo && this.form.storageId){
|
|
|
- this.cntrNoList = this.storageList.map(item =>{
|
|
|
- if(item.storageId == row.storageId){
|
|
|
- return item.cntrNo
|
|
|
- }
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.selectInventory(row)
|
|
|
- }
|
|
|
- console.log( this.storageList)
|
|
|
- console.log( this.cntrNoList)
|
|
|
+ })
|
|
|
+ }else if(!item.cntrNo && this.form.storageId){
|
|
|
+ this.cntrNoList = this.creditList.map(i =>{
|
|
|
+ if(i.storageId == item.storageId){
|
|
|
+ return i.cntrNo
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.selectInventory(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
//查询库存
|
|
|
selectInventory(row) {
|
|
@@ -773,7 +806,17 @@ export default {
|
|
|
confirmGoods(this.form).then(res => {
|
|
|
if (res.data.success) {
|
|
|
this.$message.success("发货成功!")
|
|
|
- this.goodsDisable = res.data.data.deliveryStatus === "已发货" ? true : false
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.oldForm = Object.assign({}, res.data.data);
|
|
|
+ this.goodsDisable = res.data.data.deliveryStatus === "已发货" ? true : false;
|
|
|
+ if (this.form.deliveryItemsList) {
|
|
|
+ this.contactsData = this.form.deliveryItemsList
|
|
|
+ this.oldContactsData = this.deepClone(this.form.deliveryItemsList)
|
|
|
+ }
|
|
|
+ if (this.form.deliveryFilesList) {
|
|
|
+ this.upLoadData = this.form.deliveryFilesList
|
|
|
+ this.oldUpLoadData = this.deepClone(this.form.deliveryFilesList)
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
}).finally(() => {
|
|
@@ -790,7 +833,17 @@ export default {
|
|
|
cancelGoods(this.form).then(res => {
|
|
|
if (res.data.success) {
|
|
|
this.$message.success("撤销成功!")
|
|
|
- this.goodsDisable = res.data.data.deliveryStatus === "已发货" ? true : false
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.oldForm = Object.assign({}, res.data.data);
|
|
|
+ this.goodsDisable = res.data.data.deliveryStatus === "已发货" ? true : false;
|
|
|
+ if (this.form.deliveryItemsList) {
|
|
|
+ this.contactsData = this.form.deliveryItemsList
|
|
|
+ this.oldContactsData = this.deepClone(this.form.deliveryItemsList)
|
|
|
+ }
|
|
|
+ if (this.form.deliveryFilesList) {
|
|
|
+ this.upLoadData = this.form.deliveryFilesList
|
|
|
+ this.oldUpLoadData = this.deepClone(this.form.deliveryFilesList)
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
}).finally(() => {
|
|
@@ -853,6 +906,16 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ //打开导入销售
|
|
|
+ openMarketDialog(){
|
|
|
+ this.marketDialog = true
|
|
|
+ if(this.contactsData.length !=0){
|
|
|
+ this.marketParams = {
|
|
|
+ billNo:this.contactsData[0].billNo,
|
|
|
+ contractNumber:this.contactsData[0].contractNumber
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
//上传文件保存
|
|
|
upLoadSave(row, done, loading) {
|
|
|
this.upLoadData.push(row)
|