|
@@ -15,7 +15,7 @@
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
<el-form-item label="单据编号">
|
|
<el-form-item label="单据编号">
|
|
<el-input
|
|
<el-input
|
|
- v-model="base.billId"
|
|
|
|
|
|
+ v-model="base.updPriceBillId"
|
|
placeholder="系统自动生成"
|
|
placeholder="系统自动生成"
|
|
disabled
|
|
disabled
|
|
/>
|
|
/>
|
|
@@ -223,7 +223,7 @@
|
|
>
|
|
>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-input v-model="scope.row.batchPrice" />
|
|
|
|
|
|
+ <el-input v-model="scope.row.batchPrice" placeholder="请输入批发价"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -235,7 +235,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" />
|
|
|
|
|
|
+ <el-input v-model="scope.row.discAmount" placeholder="请输入格力折扣"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -329,7 +329,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" />
|
|
|
|
|
|
+ <el-input v-model="scope.row.qty" placeholder="请输入数量"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -371,9 +371,9 @@
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="item in scope.row.walleList"
|
|
v-for="item in scope.row.walleList"
|
|
- :key="item.walletId"
|
|
|
|
- :value="item.walletId"
|
|
|
|
- :label="item.walletName"
|
|
|
|
|
|
+ :key="item.walletId || item.id"
|
|
|
|
+ :value="item.walletId || item.id"
|
|
|
|
+ :label="item.walletName || item.name"
|
|
/> </el-select></template>
|
|
/> </el-select></template>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
@@ -431,22 +431,25 @@
|
|
<el-table-column
|
|
<el-table-column
|
|
align="center"
|
|
align="center"
|
|
label="销售类型"
|
|
label="销售类型"
|
|
- prop="saleTypeId"
|
|
|
|
|
|
+ prop="mainId"
|
|
min-width="160"
|
|
min-width="160"
|
|
show-overflow-tooltip
|
|
show-overflow-tooltip
|
|
>
|
|
>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-select
|
|
|
|
- v-model="scope.row.saleTypeId"
|
|
|
|
- placeholder="请选择销售类型"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in typeList"
|
|
|
|
- :label="item.name"
|
|
|
|
- :value="item.saleTypeId"
|
|
|
|
- />
|
|
|
|
- </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>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -541,6 +544,32 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
align="center"
|
|
align="center"
|
|
|
|
+ label="返利类型"
|
|
|
|
+ prop="rebateUseRate"
|
|
|
|
+ min-width="160"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ ><template slot-scope="scope">
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="scope.row.walletRebateId"
|
|
|
|
+ multiple
|
|
|
|
+ :disabled="scope.row.fang"
|
|
|
|
+ placeholder="请选择返利类型"
|
|
|
|
+ @change="handelRebateList($event, scope.$index, scope.row)"
|
|
|
|
+ @remove-tag="handleRemove2($event, scope.$index, scope.row)"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(item, index) in scope.row.rebateList"
|
|
|
|
+ :key="item.index"
|
|
|
|
+ :value="item.walletRebateId"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ align="center"
|
|
label="生效日期"
|
|
label="生效日期"
|
|
prop="startDate"
|
|
prop="startDate"
|
|
min-width="160"
|
|
min-width="160"
|
|
@@ -900,7 +929,6 @@ export default {
|
|
saleTypeId: ''
|
|
saleTypeId: ''
|
|
},
|
|
},
|
|
items: [],
|
|
items: [],
|
|
- centerDialogVisible: false,
|
|
|
|
materialLis: [],
|
|
materialLis: [],
|
|
materialId: '',
|
|
materialId: '',
|
|
rebateList: [],
|
|
rebateList: [],
|
|
@@ -917,7 +945,6 @@ export default {
|
|
startDate: '',
|
|
startDate: '',
|
|
userList: [],
|
|
userList: [],
|
|
centerDialogVisible: false,
|
|
centerDialogVisible: false,
|
|
-
|
|
|
|
selectData: [],
|
|
selectData: [],
|
|
walleList: [],
|
|
walleList: [],
|
|
fang: true,
|
|
fang: true,
|
|
@@ -981,10 +1008,11 @@ export default {
|
|
handleRemove(e, index, row) {
|
|
handleRemove(e, index, row) {
|
|
console.log(e)
|
|
console.log(e)
|
|
const copxyWall = JSON.parse(JSON.stringify(row.wallets))
|
|
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++) {
|
|
for (let i = 0; i < row.wallets.length; i++) {
|
|
- if (this.wall1.includes(e) && row.wallets[i].walletId == e) {
|
|
|
|
- console.log(454)
|
|
|
|
-
|
|
|
|
|
|
+ if (this.wall1.includes(e) && row.wallets[i].walletId === e) {
|
|
this.wall1.splice(i, 1)
|
|
this.wall1.splice(i, 1)
|
|
copxyWall.splice(i, 1)
|
|
copxyWall.splice(i, 1)
|
|
}
|
|
}
|
|
@@ -1002,11 +1030,11 @@ export default {
|
|
this.$set(row, 'wallets', copxyWall)
|
|
this.$set(row, 'wallets', copxyWall)
|
|
},
|
|
},
|
|
handelRebateList(e, index, row) {
|
|
handelRebateList(e, index, row) {
|
|
- console.log(row, 'kjkj')
|
|
|
|
const id = row.cid || row.updPriceBillId
|
|
const id = row.cid || row.updPriceBillId
|
|
if (e && e.length) {
|
|
if (e && e.length) {
|
|
for (let i = 0; i < e.length; i++) {
|
|
for (let i = 0; i < e.length; i++) {
|
|
if (!this.wall2.includes(e[e.length - 1])) {
|
|
if (!this.wall2.includes(e[e.length - 1])) {
|
|
|
|
+ console.log(44544)
|
|
this.$set(row, 'wallets', [
|
|
this.$set(row, 'wallets', [
|
|
...row.wallets,
|
|
...row.wallets,
|
|
{
|
|
{
|
|
@@ -1019,6 +1047,7 @@ export default {
|
|
])
|
|
])
|
|
this.wall2.push(e[e.length - 1])
|
|
this.wall2.push(e[e.length - 1])
|
|
}
|
|
}
|
|
|
|
+ console.log(row.wallets)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -1063,6 +1092,9 @@ 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: '',
|
|
@@ -1087,7 +1119,15 @@ 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: [],
|
|
|
|
|
|
+ wallets: [
|
|
|
|
+ {
|
|
|
|
+ type: 'COMMONLY',
|
|
|
|
+ id: '',
|
|
|
|
+ updPriceBillId: this.selectData[i].baseUnitId,
|
|
|
|
+ updPriceBillItemId: this.selectData[i].baseUnitId,
|
|
|
|
+ walletId:this.selectData[i].wallets[0].id
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
rebateWallets: [],
|
|
rebateWallets: [],
|
|
rebateList: [],
|
|
rebateList: [],
|
|
walletsId:[this.selectData[i].wallets[0].id],
|
|
walletsId:[this.selectData[i].wallets[0].id],
|
|
@@ -1149,6 +1189,41 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async getList() {
|
|
async getList() {
|
|
|
|
+ const params1 = {
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: -1,
|
|
|
|
+ saleCode: '',
|
|
|
|
+ saleName: '',
|
|
|
|
+ status: ''
|
|
|
|
+ }
|
|
|
|
+ getTypeList(params1).then((res) => {
|
|
|
|
+ this.typeList = res.data.records
|
|
|
|
+ })
|
|
|
|
+ getUserList({
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: -1,
|
|
|
|
+ adminWebsitId: '',
|
|
|
|
+ isCustomer: 0,
|
|
|
|
+ roleId: '',
|
|
|
|
+ status: '',
|
|
|
|
+ userName: ''
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ this.userList = res.data.records
|
|
|
|
+ })
|
|
|
|
+ this.listLoading = true
|
|
|
|
+ const params = {
|
|
|
|
+ pageNum: this.currentPage,
|
|
|
|
+ pageSize: 10 || this.pageSize,
|
|
|
|
+ keyword: this.screenForm.keyword,
|
|
|
|
+ specification: this.screenForm.specification,
|
|
|
|
+ bindMain: true
|
|
|
|
+ }
|
|
|
|
+ getMaterialList(params).then((res) => {
|
|
|
|
+ this.dataList = res.data.records
|
|
|
|
+ this.listTotal = res.data.total
|
|
|
|
+ this.listLoading = false
|
|
|
|
+ })
|
|
|
|
+
|
|
const rebateParams = {
|
|
const rebateParams = {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: -1,
|
|
pageSize: -1,
|
|
@@ -1165,8 +1240,7 @@ export default {
|
|
wall.data[u].walletName = wall.data[u].name
|
|
wall.data[u].walletName = wall.data[u].name
|
|
}
|
|
}
|
|
this.walleList = wall.data
|
|
this.walleList = wall.data
|
|
-
|
|
|
|
- if (this.$parent.show == 5) {
|
|
|
|
|
|
+ if (this.$parent.show === 5) {
|
|
getProductRriceDetail({ id: this.cid }).then((res) => {
|
|
getProductRriceDetail({ id: this.cid }).then((res) => {
|
|
for (let i = 0; i < res.data.items.length; i++) {
|
|
for (let i = 0; i < res.data.items.length; i++) {
|
|
const linshi = []
|
|
const linshi = []
|
|
@@ -1198,40 +1272,61 @@ export default {
|
|
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 = []
|
|
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)
|
|
this.$set(res.data.items[i], 'wallets', [
|
|
this.$set(res.data.items[i], 'wallets', [
|
|
...res.data.items[i].wallets,
|
|
...res.data.items[i].wallets,
|
|
- res.data.items[i].wallets2[p]
|
|
|
|
|
|
+ {
|
|
|
|
+ type: 'COMMONLY',
|
|
|
|
+ id: '',
|
|
|
|
+ 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', [
|
|
this.$set(res.data.items[i], 'rebateWallets', [
|
|
...res.data.items[i].rebateWallets,
|
|
...res.data.items[i].rebateWallets,
|
|
- res.data.items[i].wallets2[p]
|
|
|
|
|
|
+ {
|
|
|
|
+ type: 'REBATE',
|
|
|
|
+ id: '',
|
|
|
|
+ updPriceBillId: res.data.items[i].updPriceBillId,
|
|
|
|
+ updPriceBillItemId: res.data.items[i].updPriceBillId,
|
|
|
|
+ walletId: res.data.items[i].wallets2[p].walletId
|
|
|
|
+ }
|
|
])
|
|
])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
this.rebateList.forEach((k) => {
|
|
this.rebateList.forEach((k) => {
|
|
k.saleTypes.forEach((j) => {
|
|
k.saleTypes.forEach((j) => {
|
|
if (
|
|
if (
|
|
!linshi.includes(j.saleTypeId) &&
|
|
!linshi.includes(j.saleTypeId) &&
|
|
- j.saleTypeId == res.data.items[i].saleTypeId
|
|
|
|
|
|
+ j.saleTypeId === res.data.items[i].saleTypeId
|
|
) {
|
|
) {
|
|
- console.log(k, 998)
|
|
|
|
-
|
|
|
|
for (let w = 0; w < walletRebateIds.length; w++) {
|
|
for (let w = 0; w < walletRebateIds.length; w++) {
|
|
- if (walletRebateIds[w] != k.walletRebateId) {
|
|
|
|
- walletRebateIds.splice(w, 1)
|
|
|
|
|
|
+ if (walletRebateIds[w] !== k.walletRebateId) {
|
|
|
|
+ // walletRebateIds.splice(w, 1)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
rebateList.push(k)
|
|
rebateList.push(k)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
|
|
+ if (this.dataList.length){
|
|
|
|
+ for (let j = 0; j < res.data.items.length; j++) {
|
|
|
|
+ for (let k = 0; k < this.dataList.length; k++) {
|
|
|
|
+ if (res.data.items[j].materialId === this.dataList[k].id){
|
|
|
|
+ this.dataList[k].disabled = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 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
|
|
@@ -1244,40 +1339,7 @@ export default {
|
|
this.listLoading = false
|
|
this.listLoading = false
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- this.listLoading = true
|
|
|
|
- const params = {
|
|
|
|
- pageNum: this.currentPage,
|
|
|
|
- pageSize: 10 || this.pageSize,
|
|
|
|
- keyword: this.screenForm.keyword,
|
|
|
|
- specification: this.screenForm.specification,
|
|
|
|
- bindMain: true
|
|
|
|
- }
|
|
|
|
- getMaterialList(params).then((res) => {
|
|
|
|
- this.dataList = res.data.records
|
|
|
|
- this.listTotal = res.data.total
|
|
|
|
- this.listLoading = false
|
|
|
|
- })
|
|
|
|
- const params1 = {
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: -1,
|
|
|
|
- saleCode: '',
|
|
|
|
- saleName: '',
|
|
|
|
- status: ''
|
|
|
|
- }
|
|
|
|
- getTypeList(params1).then((res) => {
|
|
|
|
- this.typeList = res.data.records
|
|
|
|
- })
|
|
|
|
- getUserList({
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: -1,
|
|
|
|
- adminWebsitId: '',
|
|
|
|
- isCustomer: 0,
|
|
|
|
- roleId: '',
|
|
|
|
- status: '',
|
|
|
|
- userName: ''
|
|
|
|
- }).then((res) => {
|
|
|
|
- this.userList = res.data.records
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
@@ -1311,6 +1373,7 @@ export default {
|
|
// return;
|
|
// return;
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
+
|
|
const params = {
|
|
const params = {
|
|
...this.base,
|
|
...this.base,
|
|
items: this.items,
|
|
items: this.items,
|
|
@@ -1339,6 +1402,8 @@ export default {
|
|
// console.log(this.items[i]);
|
|
// console.log(this.items[i]);
|
|
|
|
|
|
// }
|
|
// }
|
|
|
|
+ console.log(this.items)
|
|
|
|
+ return
|
|
handleEdit({
|
|
handleEdit({
|
|
...this.base,
|
|
...this.base,
|
|
items: this.items,
|
|
items: this.items,
|