Commit eab0ad21 by zhangquan

弹窗优惠券回显

1 parent 6043b1c5
......@@ -8,7 +8,6 @@
<img v-if="scope.scope.appearance == 1" src="@/assets/conpon.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.rechargeDenomination ? Number((Number(scope.scope.rechargeDenomination) / 100).toFixed(2)) + '元' : '') : scope.scope.productName }} -->
</div>
<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)" />
......@@ -215,6 +214,9 @@ export default {
padding: 32px 30px;
min-height: 600px;
position: relative;
/deep/ .glsx-combi-form {
padding-bottom: 30px;
}
.good_name {
img {
width: 40px;
......@@ -246,10 +248,11 @@ export default {
width: 432px;
}
.btn {
width: 100%;
padding: 0 20px;
position: absolute;
bottom: 10px;
text-align: center;
left: 50%;
transform: translateX(-50%);
}
.error_ctnr {
/deep/ .el-dialog__body {
......
......@@ -125,6 +125,8 @@ export default {
curType: 1,
showTable: true,
copyList: [],
conponList: [],
directChargeList: [],
pageSizes: [5, 10, 20, 30, 40],
dialogSearchForm: {
brandName: '',
......@@ -172,17 +174,21 @@ export default {
handleOk() {
this.$refs.tableRef.refreshTable()
},
handleRest(type) {
resetParam(type) {
let { appearance } = this.dialogSearchForm
this.dialogSearchForm = {
brandName: '',
productName: '',
appearance: type || appearance
}
},
handleRest(type) {
this.resetParam(type)
this.handleOk()
},
changeConponType(type) {
if (this.curType == type) return
this.getBeforeChangeList(type)
this.showTable = false
this.curType = type
this.$nextTick()
......@@ -190,16 +196,26 @@ export default {
this.tableParams['tableColumns'] = type == 2 ? [...dialogColumns1] : [...dialogColumns]
})
.then(() => {
this.resetParam(type)
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() {
let selectedList = this.curType == 2 ? this.conponList : this.directChargeList
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))))
this.$emit('confirmDialog', [...list])
this.$emit('confirmDialog', [...list, ...this.selectedGoodsList])
this.handleClose()
},
onCancel() {
......@@ -209,11 +225,10 @@ export default {
this.$emit('closeDialog')
},
setTableFinishFun() {
this.copyList = [...this.selectedGoodsList]
this.copyList = [...this.selectedGoodsList, ...this[this.curType == 1 ? 'conponList' : 'directChargeList']]
this.copyList.forEach(row => {
this.$nextTick(() => {
let idx = this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data.findIndex(item => item.id == row.id)
console.log(idx)
if (idx > -1) {
try {
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!