|
@@ -509,7 +509,8 @@
|
|
|
:rules="{
|
|
:rules="{
|
|
|
required: false,
|
|
required: false,
|
|
|
pattern: numberReg,
|
|
pattern: numberReg,
|
|
|
- trigger: 'change'
|
|
|
|
|
|
|
+ trigger: 'change',
|
|
|
|
|
+ message: '请输入正确的重量'
|
|
|
}"
|
|
}"
|
|
|
:prop="'datasource.' + scope.$index + '.totalWeight'"
|
|
:prop="'datasource.' + scope.$index + '.totalWeight'"
|
|
|
>
|
|
>
|
|
@@ -999,6 +1000,7 @@
|
|
|
ref="selectStockLedgerDialogRef"
|
|
ref="selectStockLedgerDialogRef"
|
|
|
@changeParent="replaceTable"
|
|
@changeParent="replaceTable"
|
|
|
:isSupplier="isSupplier"
|
|
:isSupplier="isSupplier"
|
|
|
|
|
+ :showSaleCount="showSaleCount"
|
|
|
></selectStockLedgerDialog>
|
|
></selectStockLedgerDialog>
|
|
|
<commodityPriceListDialog
|
|
<commodityPriceListDialog
|
|
|
ref="commodityPriceListDialogRef"
|
|
ref="commodityPriceListDialogRef"
|
|
@@ -1193,9 +1195,15 @@
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
|
default: false
|
|
default: false
|
|
|
},
|
|
},
|
|
|
|
|
+ // 是否显示排序字段
|
|
|
showSortLine: {
|
|
showSortLine: {
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
|
default: false
|
|
default: false
|
|
|
|
|
+ },
|
|
|
|
|
+ // 是否显示库存式订单可填订单数量
|
|
|
|
|
+ showSaleCount: {
|
|
|
|
|
+ type: Boolean,
|
|
|
|
|
+ default: false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
@@ -2478,14 +2486,15 @@
|
|
|
});
|
|
});
|
|
|
this.changeCount();
|
|
this.changeCount();
|
|
|
},
|
|
},
|
|
|
- replaceTable(obj, idx) {
|
|
|
|
|
- obj.forEach(async (item, index) => {
|
|
|
|
|
|
|
+ async replaceTable(obj, idx) {
|
|
|
|
|
+ for (let index = 0; index < obj.length; index++) {
|
|
|
|
|
+ const item = obj[index];
|
|
|
let i = idx == -1 ? index : idx;
|
|
let i = idx == -1 ? index : idx;
|
|
|
let row = JSON.parse(JSON.stringify(this.defaultForm));
|
|
let row = JSON.parse(JSON.stringify(this.defaultForm));
|
|
|
row.key = this.form.datasource.length + 1;
|
|
row.key = this.form.datasource.length + 1;
|
|
|
let parasm = idx == -1 ? row : this.form.datasource[i];
|
|
let parasm = idx == -1 ? row : this.form.datasource[i];
|
|
|
this.$set(parasm, 'customerMark', this.customerMark);
|
|
this.$set(parasm, 'customerMark', this.customerMark);
|
|
|
-
|
|
|
|
|
|
|
+ this.$set(parasm, 'saleCount', item.saleCount);
|
|
|
this.$set(parasm, 'productId', item.productId);
|
|
this.$set(parasm, 'productId', item.productId);
|
|
|
this.$set(parasm, 'categoryName', item.productName);
|
|
this.$set(parasm, 'categoryName', item.productName);
|
|
|
this.$set(parasm, 'productCategoryId', item.categoryLevelId);
|
|
this.$set(parasm, 'productCategoryId', item.categoryLevelId);
|
|
@@ -2583,7 +2592,11 @@
|
|
|
if (idx == -1) {
|
|
if (idx == -1) {
|
|
|
this.form.datasource.push(row);
|
|
this.form.datasource.push(row);
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ // console.log(this.form.datasource);
|
|
|
|
|
+ if(this.showSaleCount){
|
|
|
|
|
+ this.changeCount();
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
remove(index) {
|
|
remove(index) {
|
|
|
this.form.datasource.splice(index, 1);
|
|
this.form.datasource.splice(index, 1);
|
|
@@ -2629,6 +2642,7 @@
|
|
|
validateForm(callback) {
|
|
validateForm(callback) {
|
|
|
this.$refs.form.validate((valid, obj) => {
|
|
this.$refs.form.validate((valid, obj) => {
|
|
|
if (obj) {
|
|
if (obj) {
|
|
|
|
|
+ console.log('validateForm', obj);
|
|
|
let messages = Object.keys(obj).map((key) => obj[key][0]);
|
|
let messages = Object.keys(obj).map((key) => obj[key][0]);
|
|
|
if (messages.length > 0) {
|
|
if (messages.length > 0) {
|
|
|
this.$message.warning(messages[0].message);
|
|
this.$message.warning(messages[0].message);
|