Merge branch 'dwb' of https://e.coding.net/g-cphe0354/cashier/cashier-web
This commit is contained in:
commit
db12b59981
|
|
@ -1,5 +1,4 @@
|
|||
<template>
|
||||
<!-- XXX模块 -->
|
||||
<div style="padding: 15px;">
|
||||
<!-- 表格 -->
|
||||
<Content></Content>
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
<el-form-item label="选择优惠卷">
|
||||
<el-button type="primary" @click="addgoods();">添加优惠券</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item v-for="(item, index) in datas.DialogForm.coupons" :label="item.title">
|
||||
<el-form-item v-for="(item, index) in datas.DialogForm.couponsList" :label="item.title">
|
||||
<el-input-number v-model="item.number" min="1" controls-position="right" placeholder="请输入数量" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
|
@ -77,6 +77,7 @@ const datas = reactive({
|
|||
address: "",
|
||||
remark: "",
|
||||
coupons: [],
|
||||
couponsList: []
|
||||
},
|
||||
// 优惠券
|
||||
rules: {
|
||||
|
|
@ -96,7 +97,10 @@ onMounted(() => {
|
|||
})
|
||||
})
|
||||
function selectShopRes(item) {
|
||||
datas.DialogForm.coupons = item
|
||||
item.forEach(ele => {
|
||||
ele.number = 1
|
||||
})
|
||||
datas.DialogForm.couponsList = item
|
||||
}
|
||||
function addgoods() {
|
||||
shopListRef.value.opens()
|
||||
|
|
@ -121,7 +125,7 @@ function add() {
|
|||
async function handleEdit(row) {
|
||||
datas.title = '编辑数据'
|
||||
datas.DialogForm = row
|
||||
datas.DialogForm.coupons = row.couponList
|
||||
datas.DialogForm.couponsList = row.couponList
|
||||
// 有图片
|
||||
// datas.DialogForm.goodsImageUrl = res.goodsImageUrl.split(',')
|
||||
myDialogRef.value.open()
|
||||
|
|
@ -131,9 +135,11 @@ async function confirm() {
|
|||
if (valid) {
|
||||
let res = null
|
||||
let obj = {}
|
||||
datas.DialogForm.coupons.forEach(element => {
|
||||
obj[element.id] = element.number || 1
|
||||
});
|
||||
if (Array.isArray(datas.DialogForm.couponsList)) {
|
||||
datas.DialogForm.couponsList.forEach(element => {
|
||||
obj[element.id] = element.number || 1
|
||||
});
|
||||
}
|
||||
datas.DialogForm.coupons = JSON.stringify(obj)
|
||||
if (datas.title == '新增数据') {
|
||||
// 图片处理
|
||||
|
|
|
|||
Loading…
Reference in New Issue