...
|
...
|
@@ -93,12 +93,12 @@ |
|
|
this.productList(params);
|
|
|
},
|
|
|
methods: {
|
|
|
params(){
|
|
|
params() {
|
|
|
let data = {
|
|
|
pageNo: 1
|
|
|
};
|
|
|
|
|
|
if(!this.useFilterSign) {
|
|
|
if (!this.useFilterSign) {
|
|
|
return data;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -115,7 +115,7 @@ |
|
|
let modelVal;
|
|
|
_.each(mapKeys, (v, k) => {
|
|
|
modelVal = this.filters[v].model;
|
|
|
if((modelVal+'').length) {
|
|
|
if ((modelVal+'').length) {
|
|
|
data[k] = this.filters[v].model;
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -123,7 +123,7 @@ |
|
|
const ot = data.isOvertime;
|
|
|
const date = data.startTime;
|
|
|
|
|
|
if(date && moment(date).isValid()) {
|
|
|
if (date && moment(date).isValid()) {
|
|
|
data.startTime = +moment(date).format('X');
|
|
|
data.endTime = +moment(date).add(1, 'days').format('X');
|
|
|
} else {
|
...
|
...
|
@@ -138,7 +138,7 @@ |
|
|
|
|
|
return data;
|
|
|
},
|
|
|
productList(params){
|
|
|
productList(params) {
|
|
|
service.allotPurchaseList(
|
|
|
_.merge(params || {}, {
|
|
|
statusList: [1],
|
...
|
...
|
@@ -152,23 +152,23 @@ |
|
|
const fmt = 'YYYY-MM-DD HH:mm:ss';
|
|
|
const list = data.records;
|
|
|
|
|
|
_.each(list, i => {
|
|
|
i.createTime = moment(i.createTime).format(fmt);
|
|
|
i._disabled = i.isOvertime === 'Y';
|
|
|
// 当前需发数
|
|
|
i._needDeliver = i.buyingNums - i.lackNum - i.shipmentsNums;
|
|
|
_.each(list, (v, i) => {
|
|
|
v._rowIndex = i; // 当前行index
|
|
|
v._disabled = v.isOvertime === 'Y';
|
|
|
v.createTime = moment(v.createTime).format(fmt);
|
|
|
v._needDeliver = v.buyingNums - v.lackNum - v.shipmentsNums; // 当前需发数
|
|
|
});
|
|
|
|
|
|
this.table.list = list;
|
|
|
this.page.total = data.totalCount;
|
|
|
},
|
|
|
filterSearch(){
|
|
|
filterSearch() {
|
|
|
this.useFilterSign = true;
|
|
|
const params = this.params();
|
|
|
this.productList(params);
|
|
|
this.page.current = 1;
|
|
|
},
|
|
|
clearFilter(){
|
|
|
clearFilter() {
|
|
|
this.filters = Store().filters;
|
|
|
this.useFilterSign = false;
|
|
|
this.productList(this.params());
|
...
|
...
|
@@ -180,17 +180,22 @@ |
|
|
this.productList(params);
|
|
|
this.page.current = page;
|
|
|
},
|
|
|
selectChange(rows){
|
|
|
this.table.list[0]._changeDisabled = true;
|
|
|
selectChange(rows) {
|
|
|
this.deliverRows = rows;
|
|
|
},
|
|
|
deliverChange(data) {
|
|
|
const i = data.index;
|
|
|
const v = data.value;
|
|
|
this.table.list[i]._inputDeliverNum = +v;
|
|
|
const index = data.index;
|
|
|
const value = data.value;
|
|
|
this.table.list[index]._inputDeliverNum = +value;
|
|
|
|
|
|
_.each(this.deliverRows, item => {
|
|
|
if (item._rowIndex === index) {
|
|
|
item._inputDeliverNum = value;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
deliver(){
|
|
|
if(this.checkDeliver()) {
|
|
|
deliver() {
|
|
|
if (this.checkDeliver()) {
|
|
|
this.$refs.deliverModal.show();
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -198,33 +203,33 @@ |
|
|
const rows = this.deliverRows;
|
|
|
const len = rows.length;
|
|
|
|
|
|
if(!len) {
|
|
|
if (!len) {
|
|
|
this.$Message.error('请勾选要发货的订单');
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
// let invalidRows = [];
|
|
|
// _.each(rows, (v) => {
|
|
|
// if(!v._inputDeliverNum ||
|
|
|
// !_.isFinite(+v._inputDeliverNum) ||
|
|
|
// v._inputDeliverNum > v._needDeliver) {
|
|
|
// invalidRows.push(i.productSku);
|
|
|
// }
|
|
|
// });
|
|
|
//
|
|
|
// if(invalidRows.length) {
|
|
|
// let sku = '';
|
|
|
//
|
|
|
// _.each(invalidRows, (v) => {
|
|
|
// sku += v;
|
|
|
// });
|
|
|
// this.$Message.error(`请输入大于0且不大于当前需发数的发货数字${sku}`, 5)
|
|
|
// return false;
|
|
|
// }
|
|
|
let invalidRows = [];
|
|
|
_.each(rows, (v) => {
|
|
|
if (!v._inputDeliverNum ||
|
|
|
!_.isFinite(+v._inputDeliverNum) ||
|
|
|
v._inputDeliverNum > v._needDeliver) {
|
|
|
invalidRows.push(i.productSku);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
if (invalidRows.length) {
|
|
|
let sku = '';
|
|
|
|
|
|
_.each(invalidRows, (v) => {
|
|
|
sku += v;
|
|
|
});
|
|
|
this.$Message.error(`请输入大于0且不大于当前需发数的发货数字`, 5)
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
},
|
|
|
deliverSuccess(){
|
|
|
deliverSuccess() {
|
|
|
this.$Message.success('发货成功');
|
|
|
this.productList(this.params());
|
|
|
this.page.current = 1;
|
...
|
...
|
@@ -232,11 +237,11 @@ |
|
|
setModel(k, v) {
|
|
|
this.filters[k].model = v;
|
|
|
},
|
|
|
dateChange(date){
|
|
|
dateChange(date) {
|
|
|
this.setModel('orderTime', date);
|
|
|
},
|
|
|
rowClassName(row) {
|
|
|
if(row.isOvertime === 'Y') {
|
|
|
if (row.isOvertime === 'Y') {
|
|
|
return 'over-time';
|
|
|
}
|
|
|
return '';
|
...
|
...
|
@@ -251,7 +256,7 @@ |
|
|
const inputLackNum = row.inputLackNum;
|
|
|
const needDeliver = row._needDeliver;
|
|
|
|
|
|
if(!inputLackNum || inputLackNum > needDeliver) {
|
|
|
if (!inputLackNum || inputLackNum > needDeliver) {
|
|
|
this.$Message.error('请输入缺货数量,且缺货数量不能大于当前需发数', 3);
|
|
|
return;
|
|
|
}
|
...
|
...
|
@@ -262,7 +267,7 @@ |
|
|
this.productList(this.params());
|
|
|
this.page.current = 1;
|
|
|
},
|
|
|
exportList(){
|
|
|
exportList() {
|
|
|
const href = "/Api/erp/allotExportForUnSend"
|
|
|
window.open(href, '_blank');
|
|
|
|
...
|
...
|
|