|
@@ -663,7 +663,21 @@ export default {
|
|
|
},
|
|
|
//初始化查询
|
|
|
async created() {
|
|
|
-
|
|
|
+ //获取时间
|
|
|
+ let date = new Date();
|
|
|
+ let year = date.getFullYear();
|
|
|
+ let month = date.getMonth() + 1;
|
|
|
+ let day = date.getDate();
|
|
|
+ if (month < 10) {
|
|
|
+ month = "0" + month;
|
|
|
+ }
|
|
|
+ if (day < 10) {
|
|
|
+ day = "0" + day;
|
|
|
+ }
|
|
|
+ let hours = String(date.getHours()).padStart(2, '0');
|
|
|
+ let minutes = String(date.getMinutes()).padStart(2, '0');
|
|
|
+ let seconds = String(date.getSeconds()).padStart(2, '0');
|
|
|
+ let nowDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
this.rowHeight = (window.innerHeight - 130) + 'px'
|
|
|
this.customerContact = await this.getColumnData(this.getColumnName(24), customerContact);
|
|
|
this.advantageProject = await this.getColumnData(this.getColumnName(25), advantageProject);
|
|
@@ -712,18 +726,22 @@ export default {
|
|
|
this.form.totalQuantity = 0
|
|
|
this.form.purchaseAmount = 0
|
|
|
this.form.deliveryStatus = '录入'
|
|
|
- console.log('456', this.detailData.form);
|
|
|
+ // console.log('456', this.detailData.form);
|
|
|
this.form.orderItemsList = []
|
|
|
|
|
|
if (this.detailData.id) {
|
|
|
this.queryData(this.detailData.id)
|
|
|
} else if (this.detailData.form) {
|
|
|
- console.log('1132452345', this.detailData.form);
|
|
|
-
|
|
|
+ // console.log('1132452345', this.detailData.form);
|
|
|
this.form = JSON.parse(this.detailData.form);
|
|
|
- console.log(this.form);
|
|
|
+ // console.log(this.form);
|
|
|
this.$set(this.form, 'orgId', this.form.id);
|
|
|
this.$set(this.form, 'srcId', this.form.id);
|
|
|
+ this.$set(this.form,"purchaseMode",'现金采购');
|
|
|
+ this.$set(this.form,"warehouseType",'自有库');
|
|
|
+ // this.$set(this.form,"storageId",'仓库');
|
|
|
+ this.$set(this.form,"businessDate",nowDate);
|
|
|
+
|
|
|
delete this.form.createTime
|
|
|
delete this.form.id
|
|
|
delete this.form.sysNo
|
|
@@ -782,7 +800,7 @@ export default {
|
|
|
"storageTypeId": e
|
|
|
}
|
|
|
storageDesc(queryParams).then(res => {
|
|
|
- console.log(res.data.data);
|
|
|
+ // console.log(res.data.data);
|
|
|
this.storageQuantityList = res.data.data.records
|
|
|
|
|
|
})
|
|
@@ -877,17 +895,14 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
handleStorageNameChange(row) {
|
|
|
- console.log(row)
|
|
|
this.choiceIndexT = row.$index
|
|
|
- console.log(row.storageId);
|
|
|
let index
|
|
|
- console.log(row.storageQuantityList);
|
|
|
+ // console.log(row.storageQuantityList);
|
|
|
if (row.storageQuantityList.length > 0) {
|
|
|
|
|
|
index = row.storageQuantityList.findIndex(function (item) {
|
|
|
return item.storageId === row.storageId;
|
|
|
});
|
|
|
- console.log(index);
|
|
|
this.contactsData[this.choiceIndexT].storageName = row.storageQuantityList[index].storageName;
|
|
|
this.contactsData[this.choiceIndexT].storageId = row.storageQuantityList[index].storageId;
|
|
|
} else {
|
|
@@ -895,11 +910,10 @@ export default {
|
|
|
"storageTypeId": this.form.storageId
|
|
|
}
|
|
|
storageDesc(queryParams).then(res => {
|
|
|
- console.log(res.data.data);
|
|
|
+
|
|
|
index = res.data.data.records.findIndex(function (item) {
|
|
|
return item.id === row.storageId;
|
|
|
});
|
|
|
- console.log(index);
|
|
|
this.contactsData[this.choiceIndexT].storageName = res.data.data.records[index].cname;
|
|
|
this.contactsData[this.choiceIndexT].storageId = res.data.data.records[index].id;
|
|
|
})
|
|
@@ -976,14 +990,13 @@ export default {
|
|
|
choice(row) {
|
|
|
this.dialogCost = !this.dialogCost
|
|
|
this.choiceData = true
|
|
|
- console.log(row)
|
|
|
+ // console.log(row)
|
|
|
this.choiceIndex = row.$index
|
|
|
},
|
|
|
//点击商品明细选择触发
|
|
|
commodityChoice(row) {
|
|
|
this.dialogVisible = !this.dialogVisible
|
|
|
this.commodityData = true
|
|
|
- console.log(row)
|
|
|
this.choiceIndexT = row.$index
|
|
|
},
|
|
|
//点击仓库
|
|
@@ -1029,7 +1042,7 @@ export default {
|
|
|
// this.advantageProjectForm = this.advantageProjectForm.concat(this.tableDataCost)
|
|
|
if (this.tableDataCost.length > 0) {
|
|
|
for (let item in this.tableDataCost) {
|
|
|
- console.log(this.tableDataCost[item])
|
|
|
+ // console.log(this.tableDataCost[item])
|
|
|
this.tableDataCost[item].itemId = this.tableDataCost[item].id
|
|
|
this.tableDataCost[item].feeName = this.tableDataCost[item].cname
|
|
|
this.tableDataCost[item].sort = this.maxFeeNum + 1
|
|
@@ -1111,12 +1124,10 @@ export default {
|
|
|
},
|
|
|
//选中触发
|
|
|
selectionChange(list) {
|
|
|
- console.log(list);
|
|
|
this.tableData = list
|
|
|
},
|
|
|
//费用选中触发
|
|
|
selectionChangeCost(list) {
|
|
|
- console.log(list);
|
|
|
this.tableDataCost = list
|
|
|
},
|
|
|
//导入页左商品类型查询
|
|
@@ -1195,7 +1206,7 @@ export default {
|
|
|
onLoad(page, params = {}) {
|
|
|
this.loading = true;
|
|
|
getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
|
|
|
- console.log(res)
|
|
|
+
|
|
|
const data = res.data.data;
|
|
|
this.page.total = data.total;
|
|
|
this.data = data.records;
|
|
@@ -1218,7 +1229,7 @@ export default {
|
|
|
feesTypeId: this.treeDeptIdCost
|
|
|
})
|
|
|
customerList(queryParams).then(res => {
|
|
|
- console.log(res)
|
|
|
+ // console.log(res)
|
|
|
const data = res.data.data;
|
|
|
this.pageCost.total = data.total;
|
|
|
this.dataCost = data.records;
|
|
@@ -1269,6 +1280,12 @@ export default {
|
|
|
if (this.contactsData.length == 0) {
|
|
|
return this.$message.error('商品信息为空')
|
|
|
}
|
|
|
+ for(let k=0;k<this.contactsData.length;k++){
|
|
|
+ if (!this.contactsData[k].storageId) {
|
|
|
+ return this.$message.error('请选择库区')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (contrastObj(this.form, this.oldForm) ||
|
|
|
contrastList(this.contactsData, this.oldGoodsList) ||
|
|
|
// contrastList(this.advantageProjectData, this.oldFeesList) ||
|
|
@@ -1335,13 +1352,21 @@ export default {
|
|
|
editCustomer(isBack = false, type) {
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
+ this.contactsData.forEach(item=>{
|
|
|
+ if(!item.storageId){
|
|
|
+ this.$message.error('请选择库区')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log('4353',this.contactsData.storageId);
|
|
|
this.form.deliveryAmount = 0
|
|
|
this.form.totalQuantity = 0
|
|
|
- this.form.purchaseAmount = 0
|
|
|
+ // this.form.purchaseAmount = 0
|
|
|
this.contactsData.forEach(item => {
|
|
|
this.form.deliveryAmount = Number(this.form.deliveryAmount) + Number(item.deliveryAmount)
|
|
|
this.form.totalQuantity = Number(this.form.totalQuantity) + Number(item.actualQuantity)
|
|
|
- this.form.purchaseAmount = Number(this.form.purchaseAmount) + Number(item.deliveryAmount)
|
|
|
+ // this.form.purchaseAmount = Number(this.form.purchaseAmount) + Number(item.deliveryAmount)
|
|
|
+ this.form.purchaseAmount = Number(this.form.purchaseAmount)
|
|
|
this.form.deliveryAmount = (this.form.deliveryAmount).toFixed(2)
|
|
|
this.form.purchaseAmount = (this.form.purchaseAmount).toFixed(2)
|
|
|
})
|