Commit eab0ad21 by zhangquan

弹窗优惠券回显

1 parent 6043b1c5
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
<img v-if="scope.scope.appearance == 1" src="@/assets/conpon.png" alt="" /> <img v-if="scope.scope.appearance == 1" src="@/assets/conpon.png" alt="" />
<img v-else src="@/assets/directCharge.png" alt="" /> <img v-else src="@/assets/directCharge.png" alt="" />
{{ scope.scope.appearance == 2 ? scope.scope.productName + (scope.scope.denomination || '') : scope.scope.productName }} {{ scope.scope.appearance == 2 ? scope.scope.productName + (scope.scope.denomination || '') : scope.scope.productName }}
<!-- {{ scope.scope.appearance == 2 ? scope.scope.productName + (scope.scope.rechargeDenomination ? Number((Number(scope.scope.rechargeDenomination) / 100).toFixed(2)) + '元' : '') : scope.scope.productName }} -->
</div> </div>
<div class="conpon_cost" slot="conponCost" slot-scope="scope"> <div class="conpon_cost" slot="conponCost" slot-scope="scope">
<el-input :class="{ lowerZero: Number(scope.scope.newCost) <= 0 || Number(scope.scope.newCost) >= Number(scope.scope.salesPrice) }" v-model="scope.scope.newCost" @input="formatNum(scope.scope.id, scope.scope.newCost)" /> <el-input :class="{ lowerZero: Number(scope.scope.newCost) <= 0 || Number(scope.scope.newCost) >= Number(scope.scope.salesPrice) }" v-model="scope.scope.newCost" @input="formatNum(scope.scope.id, scope.scope.newCost)" />
...@@ -215,6 +214,9 @@ export default { ...@@ -215,6 +214,9 @@ export default {
padding: 32px 30px; padding: 32px 30px;
min-height: 600px; min-height: 600px;
position: relative; position: relative;
/deep/ .glsx-combi-form {
padding-bottom: 30px;
}
.good_name { .good_name {
img { img {
width: 40px; width: 40px;
...@@ -246,10 +248,11 @@ export default { ...@@ -246,10 +248,11 @@ export default {
width: 432px; width: 432px;
} }
.btn { .btn {
width: 100%; padding: 0 20px;
position: absolute; position: absolute;
bottom: 10px; bottom: 10px;
text-align: center; left: 50%;
transform: translateX(-50%);
} }
.error_ctnr { .error_ctnr {
/deep/ .el-dialog__body { /deep/ .el-dialog__body {
......
...@@ -125,6 +125,8 @@ export default { ...@@ -125,6 +125,8 @@ export default {
curType: 1, curType: 1,
showTable: true, showTable: true,
copyList: [], copyList: [],
conponList: [],
directChargeList: [],
pageSizes: [5, 10, 20, 30, 40], pageSizes: [5, 10, 20, 30, 40],
dialogSearchForm: { dialogSearchForm: {
brandName: '', brandName: '',
...@@ -172,17 +174,21 @@ export default { ...@@ -172,17 +174,21 @@ export default {
handleOk() { handleOk() {
this.$refs.tableRef.refreshTable() this.$refs.tableRef.refreshTable()
}, },
handleRest(type) { resetParam(type) {
let { appearance } = this.dialogSearchForm let { appearance } = this.dialogSearchForm
this.dialogSearchForm = { this.dialogSearchForm = {
brandName: '', brandName: '',
productName: '', productName: '',
appearance: type || appearance appearance: type || appearance
} }
},
handleRest(type) {
this.resetParam(type)
this.handleOk() this.handleOk()
}, },
changeConponType(type) { changeConponType(type) {
if (this.curType == type) return if (this.curType == type) return
this.getBeforeChangeList(type)
this.showTable = false this.showTable = false
this.curType = type this.curType = type
this.$nextTick() this.$nextTick()
...@@ -190,16 +196,26 @@ export default { ...@@ -190,16 +196,26 @@ export default {
this.tableParams['tableColumns'] = type == 2 ? [...dialogColumns1] : [...dialogColumns] this.tableParams['tableColumns'] = type == 2 ? [...dialogColumns1] : [...dialogColumns]
}) })
.then(() => { .then(() => {
this.resetParam(type)
this.showTable = true this.showTable = true
this.handleRest(type)
}) })
},
// this.$set(this.tableParams, 'tableColumns', type == 2 ? [...dialogColumns1] : [...dialogColumns]) getBeforeChangeList(type = 1) {
let list = this.$refs?.tableRef?.mutiSelectArr?.[this.tableParams?.mutiSelectName] || []
this[type == 2 ? 'conponList' : 'directChargeList'] = [...list]
}, },
onOk() { onOk() {
let selectedList = this.curType == 2 ? this.conponList : this.directChargeList
let list = this.$refs?.tableRef?.mutiSelectArr?.[this.tableParams?.mutiSelectName] || [] let list = this.$refs?.tableRef?.mutiSelectArr?.[this.tableParams?.mutiSelectName] || []
list = [...selectedList, ...list]
for (let i = 0; i < this.selectedGoodsList.length; i++) {
let idx = list.findIndex(item => item.id == this.selectedGoodsList[i].id)
if (idx > -1) {
list.splice(idx, 1)
}
}
list.map(item => this.$set(item, 'newCost', Number((item.lineationPrice - item.costPrice).toFixed(2)))) list.map(item => this.$set(item, 'newCost', Number((item.lineationPrice - item.costPrice).toFixed(2))))
this.$emit('confirmDialog', [...list]) this.$emit('confirmDialog', [...list, ...this.selectedGoodsList])
this.handleClose() this.handleClose()
}, },
onCancel() { onCancel() {
...@@ -209,11 +225,10 @@ export default { ...@@ -209,11 +225,10 @@ export default {
this.$emit('closeDialog') this.$emit('closeDialog')
}, },
setTableFinishFun() { setTableFinishFun() {
this.copyList = [...this.selectedGoodsList] this.copyList = [...this.selectedGoodsList, ...this[this.curType == 1 ? 'conponList' : 'directChargeList']]
this.copyList.forEach(row => { this.copyList.forEach(row => {
this.$nextTick(() => { this.$nextTick(() => {
let idx = this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data.findIndex(item => item.id == row.id) let idx = this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data.findIndex(item => item.id == row.id)
console.log(idx)
if (idx > -1) { if (idx > -1) {
try { try {
this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data[idx], true) this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data[idx], true)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!