|
@@ -74,15 +74,25 @@
|
|
</el-row>
|
|
</el-row>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
- <!-- <div class="btn-group clearfix"> <el-upload
|
|
|
|
- class="import-btn"
|
|
|
|
- :action="baseURL + 'student/import'"
|
|
|
|
- :http-request="handleImport"
|
|
|
|
- :file-list="importFileList"
|
|
|
|
- :show-file-list="false"
|
|
|
|
- >
|
|
|
|
- <el-button size="small">导入价格表</el-button>
|
|
|
|
- </el-upload></div> -->
|
|
|
|
|
|
+ <div class="btn-group clearfixs" v-if="!cid">
|
|
|
|
+ <el-upload
|
|
|
|
+ class="import-btn"
|
|
|
|
+ :action="baseURL + 'student/import'"
|
|
|
|
+ :http-request="handleImport"
|
|
|
|
+ :file-list="importFileList"
|
|
|
|
+ :show-file-list="false"
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ size="small"
|
|
|
|
+ >导入调价单</el-button>
|
|
|
|
+ </el-upload>
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="hanleDownloadFiles"
|
|
|
|
+ >下载模板</el-button>
|
|
|
|
+ </div>
|
|
<div class="mymain-container">
|
|
<div class="mymain-container">
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<div class="table">
|
|
<div class="table">
|
|
@@ -100,6 +110,7 @@
|
|
align="center"
|
|
align="center"
|
|
label="操作类型"
|
|
label="操作类型"
|
|
prop="nname"
|
|
prop="nname"
|
|
|
|
+ fixed="right"
|
|
min-width="160"
|
|
min-width="160"
|
|
show-overflow-tooltip
|
|
show-overflow-tooltip
|
|
>
|
|
>
|
|
@@ -223,7 +234,7 @@
|
|
>
|
|
>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-input v-model="scope.row.batchPrice" placeholder="请输入批发价"/>
|
|
|
|
|
|
+ <el-input v-model="scope.row.batchPrice" placeholder="请输入批发价" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -235,7 +246,7 @@
|
|
show-overflow-tooltip
|
|
show-overflow-tooltip
|
|
><template slot-scope="scope">
|
|
><template slot-scope="scope">
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-input v-model="scope.row.discAmount" placeholder="请输入格力折扣"/>
|
|
|
|
|
|
+ <el-input v-model="scope.row.discAmount" placeholder="请输入格力折扣" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -329,7 +340,7 @@
|
|
show-overflow-tooltip
|
|
show-overflow-tooltip
|
|
><template slot-scope="scope">
|
|
><template slot-scope="scope">
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-input v-model="scope.row.qty" placeholder="请输入数量"/>
|
|
|
|
|
|
+ <el-input v-model="scope.row.qty" placeholder="请输入数量" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -438,17 +449,17 @@
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
|
|
|
- <el-select
|
|
|
|
- v-model="scope.row.saleTypeId"
|
|
|
|
- placeholder="请选择销售类型"
|
|
|
|
- @change="handleSale($event, scope.$index, scope.row.id)"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in typeList"
|
|
|
|
- :label="item.saleName"
|
|
|
|
- :value="item.id"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="scope.row.saleTypeId"
|
|
|
|
+ placeholder="请选择销售类型"
|
|
|
|
+ @change="handleSale($event, scope.$index, scope.row.id)"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in typeList"
|
|
|
|
+ :label="item.saleName"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
@@ -900,7 +911,9 @@ import {
|
|
getWalletList,
|
|
getWalletList,
|
|
handleEdit
|
|
handleEdit
|
|
} from '@/api/basic_data/material'
|
|
} from '@/api/basic_data/material'
|
|
-import { handleImport } from '@/utils/util'
|
|
|
|
|
|
+
|
|
|
|
+import { downloadFiles, handleImport } from '@/utils/util'
|
|
|
|
+
|
|
import Mixin from '@/mixin/index'
|
|
import Mixin from '@/mixin/index'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -985,71 +998,68 @@ export default {
|
|
},
|
|
},
|
|
// xua
|
|
// xua
|
|
handelWallets(e, index, row) {
|
|
handelWallets(e, index, row) {
|
|
- console.log(row, 'kjkj4545')
|
|
|
|
- const id = row.cid || row.updPriceBillId
|
|
|
|
- if (e && e.length) {
|
|
|
|
- for (let i = 0; i < e.length; i++) {
|
|
|
|
- if (!this.wall1.includes(e[e.length - 1])) {
|
|
|
|
- this.$set(row, 'wallets', [
|
|
|
|
- ...row.wallets,
|
|
|
|
- {
|
|
|
|
- type: 'COMMONLY',
|
|
|
|
- id: '',
|
|
|
|
- updPriceBillId: id,
|
|
|
|
- updPriceBillItemId: id,
|
|
|
|
- walletId: e[e.length - 1]
|
|
|
|
- }
|
|
|
|
- ])
|
|
|
|
- this.wall1.push(e[e.length - 1])
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // const id = row.cid || row.updPriceBillId
|
|
|
|
+ // // if (e && e.length) {
|
|
|
|
+ // for (let i = 0; i < e.length; i++) {
|
|
|
|
+ // // if (!this.wall1.includes(e[e.length - 1])) {
|
|
|
|
+ // this.$set(row, 'wallets', [
|
|
|
|
+ // ...row.wallets,
|
|
|
|
+ // {
|
|
|
|
+ // type: 'COMMONLY',REBATE
|
|
|
|
+ // id: '',
|
|
|
|
+ // updPriceBillId: id,
|
|
|
|
+ // updPriceBillItemId: id,
|
|
|
|
+ // walletId: e[e.length - 1]
|
|
|
|
+ // }
|
|
|
|
+ // ])
|
|
|
|
+ // // this.wall1.push(e[e.length - 1])
|
|
|
|
+ // }
|
|
|
|
+ // // }
|
|
|
|
+ // // }
|
|
|
|
+ },
|
|
|
|
+ handelRebateList(e, index, row) {
|
|
|
|
+ // const id = row.cid || row.updPriceBillId
|
|
|
|
+ // if (e && e.length) {
|
|
|
|
+ // for (let i = 0; i < e.length; i++) {
|
|
|
|
+ // if (!this.wall2.includes(e[e.length - 1])) {
|
|
|
|
+ // console.log(44544)
|
|
|
|
+ // this.$set(row, 'wallets', [
|
|
|
|
+ // ...row.wallets,
|
|
|
|
+ // {
|
|
|
|
+ // type: 'REBATE',
|
|
|
|
+ // id: '',
|
|
|
|
+ // updPriceBillId: id,
|
|
|
|
+ // updPriceBillItemId: id,
|
|
|
|
+ // walletId: e[e.length - 1]
|
|
|
|
+ // }
|
|
|
|
+ // ])
|
|
|
|
+ // this.wall2.push(e[e.length - 1])
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
handleRemove(e, index, row) {
|
|
handleRemove(e, index, row) {
|
|
- console.log(e)
|
|
|
|
- const copxyWall = JSON.parse(JSON.stringify(row.wallets))
|
|
|
|
- if (row.wallets[0].walletId === e){
|
|
|
|
- copxyWall.splice(0, 1)
|
|
|
|
- }
|
|
|
|
- for (let i = 0; i < row.wallets.length; i++) {
|
|
|
|
- if (this.wall1.includes(e) && row.wallets[i].walletId === e) {
|
|
|
|
- this.wall1.splice(i, 1)
|
|
|
|
- copxyWall.splice(i, 1)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.$set(row, 'wallets', copxyWall)
|
|
|
|
|
|
+ // const copxyWall = JSON.parse(JSON.stringify(row.wallets))
|
|
|
|
+ // if (row.wallets[0].walletId === e) {
|
|
|
|
+ // copxyWall.splice(0, 1)
|
|
|
|
+ // }
|
|
|
|
+ // for (let i = 0; i < row.wallets.length; i++) {
|
|
|
|
+ // if (this.wall1.includes(e) && row.wallets[i].walletId === e) {
|
|
|
|
+ // this.wall1.splice(i, 1)
|
|
|
|
+ // copxyWall.splice(i, 1)
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // this.$set(row, 'wallets', copxyWall)
|
|
},
|
|
},
|
|
handleRemove2(e, index, row) {
|
|
handleRemove2(e, index, row) {
|
|
- const copxyWall = JSON.parse(JSON.stringify(row.wallets))
|
|
|
|
- for (let i = 0; i < row.wallets.length; i++) {
|
|
|
|
- if (this.wall2.includes(e) && row.wallets[i].walletId == e) {
|
|
|
|
- copxyWall.splice(i, 1)
|
|
|
|
- this.wall2.splice(i, 1)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.$set(row, 'wallets', copxyWall)
|
|
|
|
- },
|
|
|
|
- handelRebateList(e, index, row) {
|
|
|
|
- const id = row.cid || row.updPriceBillId
|
|
|
|
- if (e && e.length) {
|
|
|
|
- for (let i = 0; i < e.length; i++) {
|
|
|
|
- if (!this.wall2.includes(e[e.length - 1])) {
|
|
|
|
- console.log(44544)
|
|
|
|
- this.$set(row, 'wallets', [
|
|
|
|
- ...row.wallets,
|
|
|
|
- {
|
|
|
|
- type: 'REBATE',
|
|
|
|
- id: '',
|
|
|
|
- updPriceBillId: id,
|
|
|
|
- updPriceBillItemId: id,
|
|
|
|
- walletId: e[e.length - 1]
|
|
|
|
- }
|
|
|
|
- ])
|
|
|
|
- this.wall2.push(e[e.length - 1])
|
|
|
|
- }
|
|
|
|
- console.log(row.wallets)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // const copxyWall = JSON.parse(JSON.stringify(row.wallets))
|
|
|
|
+ // for (let i = 0; i < row.wallets.length; i++) {
|
|
|
|
+ // if (this.wall2.includes(e) && row.wallets[i].walletId == e) {
|
|
|
|
+ // copxyWall.splice(i, 1)
|
|
|
|
+ // this.wall2.splice(i, 1)
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // this.$set(row, 'wallets', copxyWall)
|
|
},
|
|
},
|
|
handleUser(e) {
|
|
handleUser(e) {
|
|
const adminCompany = this.userList.filter((k) => {
|
|
const adminCompany = this.userList.filter((k) => {
|
|
@@ -1092,9 +1102,6 @@ export default {
|
|
this.dataList[j].disabled = true
|
|
this.dataList[j].disabled = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
- console.log(this.selectData[i].wallets,'4444 ' )
|
|
|
|
this.items.push({
|
|
this.items.push({
|
|
baseUnitId: '',
|
|
baseUnitId: '',
|
|
batchPrice: '',
|
|
batchPrice: '',
|
|
@@ -1119,18 +1126,10 @@ export default {
|
|
saleTypeId: '',
|
|
saleTypeId: '',
|
|
specification: this.selectData[i].specification,
|
|
specification: this.selectData[i].specification,
|
|
startDate: this.selectData[i].startDate,
|
|
startDate: this.selectData[i].startDate,
|
|
- wallets: [
|
|
|
|
- {
|
|
|
|
- type: 'COMMONLY',
|
|
|
|
- id: '',
|
|
|
|
- updPriceBillId: this.selectData[i].baseUnitId,
|
|
|
|
- updPriceBillItemId: this.selectData[i].baseUnitId,
|
|
|
|
- walletId:this.selectData[i].wallets[0].id
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
|
|
+ wallets: [],
|
|
rebateWallets: [],
|
|
rebateWallets: [],
|
|
rebateList: [],
|
|
rebateList: [],
|
|
- walletsId:[this.selectData[i].wallets[0].id],
|
|
|
|
|
|
+ walletsId: [this.selectData[i].wallets[0].id],
|
|
walleList: this.selectData[i].wallets,
|
|
walleList: this.selectData[i].wallets,
|
|
isPublishArr: [
|
|
isPublishArr: [
|
|
{
|
|
{
|
|
@@ -1267,12 +1266,11 @@ export default {
|
|
bool: false
|
|
bool: false
|
|
}
|
|
}
|
|
]
|
|
]
|
|
-
|
|
|
|
|
|
+ res.data.items[i].wallets = []
|
|
res.data.items[i].walletsId = []
|
|
res.data.items[i].walletsId = []
|
|
res.data.items[i].walletRebateId = []
|
|
res.data.items[i].walletRebateId = []
|
|
res.data.items[i].rebateWallets = []
|
|
res.data.items[i].rebateWallets = []
|
|
- res.data.items[i].wallets = []
|
|
|
|
- console.log(res.data.items[i].wallets2,'8878')
|
|
|
|
|
|
+
|
|
for (let p = 0; p < res.data.items[i].wallets2.length; p++) {
|
|
for (let p = 0; p < res.data.items[i].wallets2.length; p++) {
|
|
if (res.data.items[i].wallets2[p].type === 'COMMONLY') {
|
|
if (res.data.items[i].wallets2[p].type === 'COMMONLY') {
|
|
walletIds.push(res.data.items[i].wallets2[p].walletId)
|
|
walletIds.push(res.data.items[i].wallets2[p].walletId)
|
|
@@ -1281,26 +1279,26 @@ export default {
|
|
{
|
|
{
|
|
type: 'COMMONLY',
|
|
type: 'COMMONLY',
|
|
id: '',
|
|
id: '',
|
|
- updPriceBillId: res.data.items[i].updPriceBillId,
|
|
|
|
- updPriceBillItemId: res.data.items[i].updPriceBillId,
|
|
|
|
- walletId: res.data.items[i].wallets2[p].walletId
|
|
|
|
|
|
+ updPriceBillId: res.data.items[i].updPriceBillId,
|
|
|
|
+ updPriceBillItemId: res.data.items[i].updPriceBillId,
|
|
|
|
+ walletId: res.data.items[i].wallets2[p].walletId
|
|
}
|
|
}
|
|
])
|
|
])
|
|
} else if (res.data.items[i].wallets2[p].type === 'REBATE') {
|
|
} else if (res.data.items[i].wallets2[p].type === 'REBATE') {
|
|
walletRebateIds.push(res.data.items[i].wallets2[p].walletId)
|
|
walletRebateIds.push(res.data.items[i].wallets2[p].walletId)
|
|
- console.log(walletRebateIds)
|
|
|
|
- this.$set(res.data.items[i], 'rebateWallets', [
|
|
|
|
- ...res.data.items[i].rebateWallets,
|
|
|
|
|
|
+ this.$set(res.data.items[i], 'wallets', [
|
|
|
|
+ ...res.data.items[i].wallets,
|
|
{
|
|
{
|
|
type: 'REBATE',
|
|
type: 'REBATE',
|
|
id: '',
|
|
id: '',
|
|
- updPriceBillId: res.data.items[i].updPriceBillId,
|
|
|
|
- updPriceBillItemId: res.data.items[i].updPriceBillId,
|
|
|
|
- walletId: res.data.items[i].wallets2[p].walletId
|
|
|
|
|
|
+ updPriceBillId: res.data.items[i].updPriceBillId,
|
|
|
|
+ updPriceBillItemId: res.data.items[i].updPriceBillId,
|
|
|
|
+ walletId: res.data.items[i].wallets2[p].walletId
|
|
}
|
|
}
|
|
])
|
|
])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ console.log(res.data.items[i].wallets)
|
|
this.rebateList.forEach((k) => {
|
|
this.rebateList.forEach((k) => {
|
|
k.saleTypes.forEach((j) => {
|
|
k.saleTypes.forEach((j) => {
|
|
if (
|
|
if (
|
|
@@ -1316,17 +1314,16 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
- if (this.dataList.length){
|
|
|
|
|
|
+ if (this.dataList.length) {
|
|
for (let j = 0; j < res.data.items.length; j++) {
|
|
for (let j = 0; j < res.data.items.length; j++) {
|
|
for (let k = 0; k < this.dataList.length; k++) {
|
|
for (let k = 0; k < this.dataList.length; k++) {
|
|
- if (res.data.items[j].materialId === this.dataList[k].id){
|
|
|
|
|
|
+ if (res.data.items[j].materialId === this.dataList[k].id) {
|
|
this.dataList[k].disabled = true
|
|
this.dataList[k].disabled = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// console.log(this.dataList)
|
|
// console.log(this.dataList)
|
|
}
|
|
}
|
|
-
|
|
|
|
this.$set(res.data.items[i], 'walletsId', walletIds)
|
|
this.$set(res.data.items[i], 'walletsId', walletIds)
|
|
this.$set(res.data.items[i], 'walletRebateId', walletRebateIds)
|
|
this.$set(res.data.items[i], 'walletRebateId', walletRebateIds)
|
|
res.data.items[i].walleList = this.walleList
|
|
res.data.items[i].walleList = this.walleList
|
|
@@ -1361,19 +1358,7 @@ export default {
|
|
// 如果没有返回值则默认返回false(全部无法选中)
|
|
// 如果没有返回值则默认返回false(全部无法选中)
|
|
},
|
|
},
|
|
hanleSbumit() {
|
|
hanleSbumit() {
|
|
- console.log(this.items, 45454)
|
|
|
|
- // for (let i = 0; i < this.items.length; i++) {
|
|
|
|
- // this.items[i].wallets = [
|
|
|
|
- // ...this.items[i].rebateWallets,
|
|
|
|
- // ...this.items[i].wallets,
|
|
|
|
- // ];
|
|
|
|
-
|
|
|
|
- // if (!this.items[i].mainId) {
|
|
|
|
- // this.$errorMsg("请选择销售类型");
|
|
|
|
- // return;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
|
|
+ this.filterWallets(this.items)
|
|
const params = {
|
|
const params = {
|
|
...this.base,
|
|
...this.base,
|
|
items: this.items,
|
|
items: this.items,
|
|
@@ -1390,20 +1375,7 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
hanleSave() {
|
|
hanleSave() {
|
|
- // for (let i = 0; i < this.items.length; i++) {
|
|
|
|
- // // const wallets = []
|
|
|
|
- // // if (this.items[i].wallets.length) {
|
|
|
|
- // // wallets = [...wallets,...this.items[i].wallets]
|
|
|
|
- // // }else if(this.items[i].rebateWallets.length){
|
|
|
|
- // // console.log(444);
|
|
|
|
- // // wallets = [...wallets,...this.items[i].rebateWallets]
|
|
|
|
- // // }
|
|
|
|
- // // this.items[i].wallets = wallets
|
|
|
|
- // console.log(this.items[i]);
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
- console.log(this.items)
|
|
|
|
- return
|
|
|
|
|
|
+ this.filterWallets(this.items)
|
|
handleEdit({
|
|
handleEdit({
|
|
...this.base,
|
|
...this.base,
|
|
items: this.items,
|
|
items: this.items,
|
|
@@ -1440,24 +1412,156 @@ export default {
|
|
async handleImport(param) {
|
|
async handleImport(param) {
|
|
this.importLoading = true
|
|
this.importLoading = true
|
|
const file = param.file
|
|
const file = param.file
|
|
- console.log(file, 123)
|
|
|
|
const formData = new FormData()
|
|
const formData = new FormData()
|
|
formData.append('file', file)
|
|
formData.append('file', file)
|
|
- // formData.append("policyId", this.searchForm.code);
|
|
|
|
- // formData.append("mainId", this.searchForm.mainId);
|
|
|
|
- const result = await handleImport('/policy/material/import', formData)
|
|
|
|
|
|
+
|
|
|
|
+ const result = await handleImport('/product-upd-price/material/import', formData)
|
|
this.importLoading = false
|
|
this.importLoading = false
|
|
this.importFileList = []
|
|
this.importFileList = []
|
|
- if (result.code == 200) {
|
|
|
|
|
|
+ if (result.code === 200) {
|
|
this.$alert(result.message, '导入成功', {
|
|
this.$alert(result.message, '导入成功', {
|
|
confirmButtonText: '确定'
|
|
confirmButtonText: '确定'
|
|
})
|
|
})
|
|
- this.handletwoList()
|
|
|
|
|
|
+
|
|
|
|
+ for (let i = 0; i < result.data.length; i++) {
|
|
|
|
+ const linshi = []
|
|
|
|
+ const rebateList = []
|
|
|
|
+ const walletIds = []
|
|
|
|
+ const walletRebateIds = []
|
|
|
|
+ result.data[i].isPublishArr = [
|
|
|
|
+ {
|
|
|
|
+ value: '是',
|
|
|
|
+ bool: true
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: '否',
|
|
|
|
+ bool: false
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ result.data[i].isPromoteArr = [
|
|
|
|
+ {
|
|
|
|
+ value: '是',
|
|
|
|
+ bool: true
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: '否',
|
|
|
|
+ bool: false
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ result.data[i].wallets = []
|
|
|
|
+ result.data[i].walletsId = []
|
|
|
|
+ result.data[i].walletRebateId = []
|
|
|
|
+ result.data[i].rebateWallets = []
|
|
|
|
+ result.data[i].saleTypes = this.typeList
|
|
|
|
+ result.data[i].mainId = result.data[i].saleTypeId
|
|
|
|
+ for (let p = 0; p < result.data[i].wallets2.length; p++) {
|
|
|
|
+ if (result.data[i].wallets2[p].type === 'COMMONLY') {
|
|
|
|
+ walletIds.push(result.data[i].wallets2[p].walletId)
|
|
|
|
+ this.$set(result.data[i], 'wallets', [
|
|
|
|
+ ...result.data[i].wallets,
|
|
|
|
+ {
|
|
|
|
+ type: 'COMMONLY',
|
|
|
|
+ id: '',
|
|
|
|
+ updPriceBillId: result.data[i].updPriceBillId,
|
|
|
|
+ updPriceBillItemId: result.data[i].updPriceBillId,
|
|
|
|
+ walletId: result.data[i].wallets2[p].walletId
|
|
|
|
+ }
|
|
|
|
+ ])
|
|
|
|
+ } else if (result.data[i].wallets2[p].type === 'REBATE') {
|
|
|
|
+ walletRebateIds.push(result.data[i].wallets2[p].walletId)
|
|
|
|
+ this.$set(result.data[i], 'wallets', [
|
|
|
|
+ ...result.data[i].wallets,
|
|
|
|
+ {
|
|
|
|
+ type: 'REBATE',
|
|
|
|
+ id: '',
|
|
|
|
+ updPriceBillId: result.data[i].updPriceBillId,
|
|
|
|
+ updPriceBillItemId: result.data[i].updPriceBillId,
|
|
|
|
+ walletId: result.data[i].wallets2[p].walletId
|
|
|
|
+ }
|
|
|
|
+ ])
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.rebateList.forEach((k) => {
|
|
|
|
+ k.saleTypes.forEach((j) => {
|
|
|
|
+ if (
|
|
|
|
+ !linshi.includes(j.saleTypeId) &&
|
|
|
|
+ j.saleTypeId === result.data[i].saleTypeId
|
|
|
|
+ ) {
|
|
|
|
+ for (let w = 0; w < walletRebateIds.length; w++) {
|
|
|
|
+ if (walletRebateIds[w] !== k.walletRebateId) {
|
|
|
|
+ // walletRebateIds.splice(w, 1)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ rebateList.push(k)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ this.$set(result.data[i], 'walletsId', walletIds)
|
|
|
|
+ this.$set(result.data[i], 'walletRebateId', walletRebateIds)
|
|
|
|
+ result.data[i].walleList = this.walleList
|
|
|
|
+ result.data[i].rebateList = rebateList
|
|
|
|
+ result.data[i].fang = false
|
|
|
|
+ }
|
|
|
|
+ if (this.dataList.length) {
|
|
|
|
+ for (let j = 0; j < result.data.length; j++) {
|
|
|
|
+ for (let k = 0; k < this.dataList.length; k++) {
|
|
|
|
+ if (result.data[j].materialId === this.dataList[k].id) {
|
|
|
|
+ this.dataList[k].disabled = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ function resArrs(arr1, arr2) {
|
|
|
|
+ return arr1.filter((v) => arr2.every((val) => val.materialId != v.id))
|
|
|
|
+ }
|
|
|
|
+ this.items = [...this.items,...resArrs(result.data,this.dataList)]
|
|
} else {
|
|
} else {
|
|
this.$alert(result.message, '导入失败', {
|
|
this.$alert(result.message, '导入失败', {
|
|
confirmButtonText: '确定'
|
|
confirmButtonText: '确定'
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ // 下载经销商模板
|
|
|
|
+ hanleDownloadFiles() {
|
|
|
|
+ downloadFiles('/product-upd-price/download')
|
|
|
|
+ },
|
|
|
|
+ filterWallets(array){
|
|
|
|
+ const wallets = []
|
|
|
|
+ for (let i = 0; i < array.length; i++) {
|
|
|
|
+ if (!array[i].walletsId.length) return
|
|
|
|
+ for (let j = 0; j < array[i].walleList.length; j++) {
|
|
|
|
+ for (let k = 0; k < array[i].walletsId.length; k++) {
|
|
|
|
+ if (array[i].walleList[j].id === array[i].walletsId[k]) {
|
|
|
|
+ wallets.push({
|
|
|
|
+ type: 'COMMONLY',
|
|
|
|
+ id: '',
|
|
|
|
+ updPriceBillId: array[i].cid || array[i].updPriceBillId,
|
|
|
|
+ updPriceBillItemId: array[i].cid || array[i].updPriceBillId,
|
|
|
|
+ walletId: array[i].walletsId[k]
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for (let k = 0; k < array[i].rebateList.length; k++) {
|
|
|
|
+ if (!array[i].walletRebateId.length) return
|
|
|
|
+ for (let j = 0; j < array[i].walletRebateId.length; j++) {
|
|
|
|
+ if (array[i].rebateList[k].walletRebateId === array[i].walletRebateId[j]) {
|
|
|
|
+ wallets.push({
|
|
|
|
+ type: 'REBATE',
|
|
|
|
+ id: '',
|
|
|
|
+ updPriceBillId: array[i].cid || array[i].updPriceBillId,
|
|
|
|
+ updPriceBillItemId: array[i].cid || array[i].updPriceBillId,
|
|
|
|
+ walletId: array[i].walletRebateId[j]
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ array[i].wallets = wallets
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1470,4 +1574,10 @@ export default {
|
|
.dia .el-select--normal {
|
|
.dia .el-select--normal {
|
|
width: 100%;
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
+.clearfixs{
|
|
|
|
+ display: flex;
|
|
|
|
+}
|
|
|
|
+.import-btn{
|
|
|
|
+ margin-right: 10px;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|