|
@@ -57,11 +57,13 @@ export default {
|
|
set(){},
|
|
set(){},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- watch: {},
|
|
|
|
|
|
+ watch: {
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
//
|
|
//
|
|
async open(prop) {
|
|
async open(prop) {
|
|
this.visible = await this.fetchItem(prop);
|
|
this.visible = await this.fetchItem(prop);
|
|
|
|
+ this.supplier = '';
|
|
},
|
|
},
|
|
//
|
|
//
|
|
hide() {
|
|
hide() {
|
|
@@ -85,9 +87,8 @@ export default {
|
|
})),
|
|
})),
|
|
}));
|
|
}));
|
|
|
|
|
|
- this.showData = _.cloneDeep(this.data);
|
|
|
|
-
|
|
|
|
console.log(this.data,'this.data');
|
|
console.log(this.data,'this.data');
|
|
|
|
+ this.showData = _.cloneDeep(this.data);
|
|
return true;
|
|
return true;
|
|
} else {
|
|
} else {
|
|
return false;
|
|
return false;
|
|
@@ -111,7 +112,7 @@ export default {
|
|
}))
|
|
}))
|
|
.filter((item) => item.orderPriceVos.length);
|
|
.filter((item) => item.orderPriceVos.length);
|
|
console.log(params,'params');
|
|
console.log(params,'params');
|
|
- try {
|
|
|
|
|
|
+ try {
|
|
// try
|
|
// try
|
|
const { msg, code } = await ADD(params);
|
|
const { msg, code } = await ADD(params);
|
|
if (code === 200) {
|
|
if (code === 200) {
|
|
@@ -153,7 +154,39 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
handleSelect(prop){
|
|
handleSelect(prop){
|
|
- console.log(prop,'prop');
|
|
|
|
|
|
+ console.log(this.data,'handleSelect');
|
|
|
|
+
|
|
|
|
+ // this.tableColumns = this.tableColumns.map(({ item, attr }) =>{
|
|
|
|
+
|
|
|
|
+ // if(item['key'] === 'supplierName'){
|
|
|
|
+ // item.filter = [prop.value];
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // return {
|
|
|
|
+ // item: {...item},
|
|
|
|
+ // attr: {...attr},
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // })
|
|
|
|
+
|
|
|
|
+ // this.$refs.superTable.forEach(item =>{
|
|
|
|
+
|
|
|
|
+ // let { onFilter, onFilters } = item;
|
|
|
|
+
|
|
|
|
+ // let supplierFilter = {
|
|
|
|
+ // item:{
|
|
|
|
+ // key: 'supplierName',
|
|
|
|
+ // title: '供应商',
|
|
|
|
+ // filterabled:true,
|
|
|
|
+
|
|
|
|
+ // },
|
|
|
|
+ // attr: {}
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // onFilters(supplierFilter);
|
|
|
|
+ // onFilter();
|
|
|
|
+ // })
|
|
|
|
+
|
|
this.showData = this.data.map(item => {
|
|
this.showData = this.data.map(item => {
|
|
return {
|
|
return {
|
|
...item,
|
|
...item,
|
|
@@ -162,13 +195,86 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
handleClear(){
|
|
handleClear(){
|
|
- this.showData = _.cloneDeep(this.data);
|
|
|
|
|
|
+ this.showData = _.cloneDeep(this.data);
|
|
},
|
|
},
|
|
// 对象数组去重
|
|
// 对象数组去重
|
|
uniqueFunc(arr, uniId){
|
|
uniqueFunc(arr, uniId){
|
|
const res = new Map();
|
|
const res = new Map();
|
|
return arr.filter((item) => !res.has(item[uniId]) && res.set(item[uniId], 1));
|
|
return arr.filter((item) => !res.has(item[uniId]) && res.set(item[uniId], 1));
|
|
},
|
|
},
|
|
|
|
+ changeQuantity(prop,value){
|
|
|
|
+
|
|
|
|
+ this.data = this.data.map(item =>{
|
|
|
|
+
|
|
|
|
+ if(item.id === prop.id){
|
|
|
|
+
|
|
|
|
+ item.orderPriceVos = item.orderPriceVos.map(order =>{
|
|
|
|
+
|
|
|
|
+ if(order.id === value.id){
|
|
|
|
+
|
|
|
|
+ return value;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return order;
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ // item.orderPriceVos.forEach(order =>{
|
|
|
|
+
|
|
|
|
+ // if(order.id === value.id){
|
|
|
|
+
|
|
|
|
+ // let change = prop.orderPriceVos.filter(order => order.id === value.id);
|
|
|
|
+
|
|
|
|
+ // order = {...change};
|
|
|
|
+
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // })
|
|
|
|
+ }
|
|
|
|
+ return item;
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ changeDatePlan(prop,value){
|
|
|
|
+
|
|
|
|
+ this.data = this.data.map(item =>{
|
|
|
|
+
|
|
|
|
+ if(item.id === prop.id){
|
|
|
|
+
|
|
|
|
+ item.orderPriceVos = item.orderPriceVos.map(order =>{
|
|
|
|
+
|
|
|
|
+ if(order.id === value.id){
|
|
|
|
+
|
|
|
|
+ return value;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return order;
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return item;
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ changeNote(prop,value){
|
|
|
|
+
|
|
|
|
+ this.data = this.data.map(item =>{
|
|
|
|
+
|
|
|
|
+ if(item.id === prop.id){
|
|
|
|
+
|
|
|
|
+ item.orderPriceVos = item.orderPriceVos.map(order =>{
|
|
|
|
+
|
|
|
|
+ if(order.id === value.id){
|
|
|
|
+
|
|
|
|
+ return value;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return order;
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return item;
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
},
|
|
},
|
|
created() {},
|
|
created() {},
|
|
mounted() {},
|
|
mounted() {},
|
|
@@ -210,7 +316,7 @@ export default {
|
|
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
- <!-- <el-row style="padding: 0 16px;">
|
|
|
|
|
|
+ <el-row style="padding: 0 16px;">
|
|
<el-col>
|
|
<el-col>
|
|
<el-autocomplete
|
|
<el-autocomplete
|
|
class="inline-input"
|
|
class="inline-input"
|
|
@@ -223,10 +329,10 @@ export default {
|
|
@clear="handleClear"
|
|
@clear="handleClear"
|
|
></el-autocomplete>
|
|
></el-autocomplete>
|
|
</el-col>
|
|
</el-col>
|
|
- </el-row> -->
|
|
|
|
|
|
+ </el-row>
|
|
|
|
|
|
|
|
|
|
- <div v-for="(item, index) in data" :key="index" class="m-4">
|
|
|
|
|
|
+ <div v-for="(item, index) in showData" :key="index" class="m-4">
|
|
|
|
|
|
<template v-if="item.orderPriceVos.length">
|
|
<template v-if="item.orderPriceVos.length">
|
|
<el-descriptions>
|
|
<el-descriptions>
|
|
@@ -255,6 +361,7 @@ export default {
|
|
</el-descriptions>
|
|
</el-descriptions>
|
|
|
|
|
|
<el-super-table
|
|
<el-super-table
|
|
|
|
+ ref="superTable"
|
|
v-model="item.orderPriceVos"
|
|
v-model="item.orderPriceVos"
|
|
:columns="tableColumns"
|
|
:columns="tableColumns"
|
|
:size="$attrs.size"
|
|
:size="$attrs.size"
|
|
@@ -267,6 +374,25 @@ export default {
|
|
v-model="scope.row[scope.item.key]"
|
|
v-model="scope.row[scope.item.key]"
|
|
:size="$attrs.size"
|
|
:size="$attrs.size"
|
|
:max="scope.attr.max(scope.row)"
|
|
:max="scope.attr.max(scope.row)"
|
|
|
|
+ @change="changeQuantity(item,scope.row)"
|
|
|
|
+ >
|
|
|
|
+ </component>
|
|
|
|
+ </template>
|
|
|
|
+ <template slot="arrivalDatePlan" slot-scope="scope">
|
|
|
|
+ <component
|
|
|
|
+ v-bind="scope.attr"
|
|
|
|
+ v-model="scope.row[scope.item.key]"
|
|
|
|
+ :size="$attrs.size"
|
|
|
|
+ @change="changeDatePlan"
|
|
|
|
+ >
|
|
|
|
+ </component>
|
|
|
|
+ </template>
|
|
|
|
+ <template slot="note" slot-scope="scope">
|
|
|
|
+ <component
|
|
|
|
+ v-bind="scope.attr"
|
|
|
|
+ v-model="scope.row[scope.item.key]"
|
|
|
|
+ :size="$attrs.size"
|
|
|
|
+ @change="changeNote"
|
|
>
|
|
>
|
|
</component>
|
|
</component>
|
|
</template>
|
|
</template>
|