|
@@ -12,43 +12,45 @@
|
|
element-loading-background="rgba(0, 0, 0, 0.8)">
|
|
element-loading-background="rgba(0, 0, 0, 0.8)">
|
|
<el-form :model="form" ref="form" :rules="rules" label-width="150px">
|
|
<el-form :model="form" ref="form" :rules="rules" label-width="150px">
|
|
<div class="form-title"><span>基本信息</span></div>
|
|
<div class="form-title"><span>基本信息</span></div>
|
|
- <el-form-item label="实体卡名称:" prop="goodsName">
|
|
|
|
- <el-input style="width: 100%;" v-model="form.goodsName" placeholder="请输入实体卡名称" maxlength="50"
|
|
|
|
|
|
+ <el-form-item label="实体卡名称:" prop="cardName">
|
|
|
|
+ <el-input style="width: 100%;" v-model="form.cardName" placeholder="请输入实体卡名称" maxlength="50"
|
|
show-word-limit />
|
|
show-word-limit />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="实体卡价格:" prop="goodsSnapshot">
|
|
|
|
- <el-input-number v-model="form.goodsSnapshot" placeholder="请输入实体卡价格" controls-position="right">
|
|
|
|
|
|
+ <el-form-item label="实体卡价格:" prop="price">
|
|
|
|
+ <el-input-number v-model="form.price" placeholder="请输入实体卡价格" controls-position="right">
|
|
</el-input-number>
|
|
</el-input-number>
|
|
|
|
+ <span>元</span>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="消费日期:" prop="useExpireDateRadio">
|
|
|
|
- <el-radio-group v-model="form.useExpireDateRadio" @input="radioInputs">
|
|
|
|
|
|
+ <div class="form-title"><span>使用规则</span></div>
|
|
|
|
+ <el-form-item label="使用期限:" prop="useType">
|
|
|
|
+ <el-radio-group v-model="form.useType" @input="radioInputs">
|
|
<div style="display: flex;flex-direction: column;padding-top: 10px;">
|
|
<div style="display: flex;flex-direction: column;padding-top: 10px;">
|
|
<div>
|
|
<div>
|
|
- <el-radio label="1">不限</el-radio>
|
|
|
|
|
|
+ <el-radio :label="1">永久生效</el-radio>
|
|
</div>
|
|
</div>
|
|
<div style="display: flex;align-items: center;margin-top: 25px;">
|
|
<div style="display: flex;align-items: center;margin-top: 25px;">
|
|
- <el-radio style="display: flex;align-items: center;" label="2">
|
|
|
|
|
|
+ <el-radio style="display: flex;align-items: center;" :label="2">
|
|
<div style="display: flex;align-items: center;">
|
|
<div style="display: flex;align-items: center;">
|
|
- <el-form-item label="" label-width="0" :prop="'useExpireDateDay'">
|
|
|
|
- <span>自购买后</span>
|
|
|
|
- <el-input-number :disabled="form.useExpireDateRadio != 2" v-model="form.useExpireDateDay"
|
|
|
|
|
|
+ <el-form-item label="" label-width="0" :prop="'useDay'">
|
|
|
|
+ <span>指定</span>
|
|
|
|
+ <el-input-number :disabled="form.useType != 2" v-model="form.useDay"
|
|
placeholder="请输入天数" controls-position="right">
|
|
placeholder="请输入天数" controls-position="right">
|
|
</el-input-number>
|
|
</el-input-number>
|
|
- <span>天可使用</span>
|
|
|
|
|
|
+ <span>天数有效</span>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
</el-radio>
|
|
</el-radio>
|
|
</div>
|
|
</div>
|
|
<div style="display: flex;align-items: center;margin-top: 25px;">
|
|
<div style="display: flex;align-items: center;margin-top: 25px;">
|
|
- <el-radio style="display: flex;align-items: center;" label="3">
|
|
|
|
|
|
+ <el-radio style="display: flex;align-items: center;" :label="3">
|
|
<div style="display: flex;align-items: center;">
|
|
<div style="display: flex;align-items: center;">
|
|
- <el-form-item label="" label-width="0" :prop="'useExpireDateTime'">
|
|
|
|
|
|
+ <el-form-item label="" label-width="0" :prop="'useEndDay'">
|
|
<span>指定</span>
|
|
<span>指定</span>
|
|
- <el-date-picker :disabled="form.useExpireDateRadio != 3" v-model="form.useExpireDateTime"
|
|
|
|
- type="daterange" range-separator="至" start-placeholder="开始日期" value-format="yyyy-MM-dd"
|
|
|
|
- end-placeholder="结束日期">
|
|
|
|
|
|
+ <el-date-picker :disabled="form.useType != 3" v-model="form.useEndDay"
|
|
|
|
+ type="date" placeholder="请选择日期" value-format="yyyy-MM-dd"
|
|
|
|
+ >
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
- <span>日期范围内使用</span>
|
|
|
|
|
|
+ <span>结束日期</span>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
</el-radio>
|
|
</el-radio>
|
|
@@ -57,109 +59,84 @@
|
|
</div>
|
|
</div>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="生效日期:" prop="isAuth">
|
|
|
|
- <el-radio-group v-model="form.isAuth">
|
|
|
|
|
|
+ <el-form-item label="生效日期:" prop="effectiveDateType">
|
|
|
|
+ <el-radio-group v-model="form.effectiveDateType">
|
|
<el-radio :label="1">制卡之日生效</el-radio>
|
|
<el-radio :label="1">制卡之日生效</el-radio>
|
|
<el-radio :label="2">激活之日生效</el-radio>
|
|
<el-radio :label="2">激活之日生效</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<div class="form-title"><span>激活规则</span></div>
|
|
<div class="form-title"><span>激活规则</span></div>
|
|
- <el-form-item label="激活后完善信息:" prop="backStatus">
|
|
|
|
- <el-checkbox-group>
|
|
|
|
- <el-checkbox label="真实姓名"></el-checkbox>
|
|
|
|
- <el-checkbox label="身份证号"></el-checkbox>
|
|
|
|
- <el-checkbox label="需实名制认证"></el-checkbox>
|
|
|
|
- <el-checkbox label="所在地区"></el-checkbox>
|
|
|
|
- <el-checkbox label="手机号"></el-checkbox>
|
|
|
|
- <el-checkbox label="需短信验证"></el-checkbox>
|
|
|
|
|
|
+ <el-form-item label="激活后完善信息:" prop="activationRule">
|
|
|
|
+ <el-checkbox-group v-model="form.activationRule">
|
|
|
|
+ <el-checkbox
|
|
|
|
+ v-for="dict in dict.type.activation_rule"
|
|
|
|
+ :key="dict.value"
|
|
|
|
+ :label="dict.value">{{dict.label}}</el-checkbox>
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="提前退票" prop="backStatusRadio">
|
|
|
|
- <div style="display: flex;align-items: center;">
|
|
|
|
- <el-radio-group v-model="form.backStatusRadio" @input="radioInputss">
|
|
|
|
- <el-radio label="-1">不限</el-radio>
|
|
|
|
- <el-radio label="-2">{{ '' }}</el-radio>
|
|
|
|
- </el-radio-group>
|
|
|
|
- <div style="display: flex;align-items: center;">
|
|
|
|
- 需提前
|
|
|
|
- <el-form-item label="" label-width="0" :prop="'backStatusDay'">
|
|
|
|
- <el-input-number :disabled="form.backStatusRadio != -2" v-model="form.backStatusDay" placeholder="请输入天数"
|
|
|
|
- controls-position="right">
|
|
|
|
- </el-input-number>
|
|
|
|
- </el-form-item>
|
|
|
|
- 天,在
|
|
|
|
- <el-form-item label="" label-width="0" :prop="'backStatusTime'">
|
|
|
|
- <el-time-picker :disabled="form.backStatusRadio != -2" v-model="form.backStatusTime"
|
|
|
|
- value-format="HH:mm" placeholder="任意时间点">
|
|
|
|
- </el-time-picker>
|
|
|
|
- </el-form-item>
|
|
|
|
- 点前退票
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="过期未核销" prop="expiredProcess">
|
|
|
|
- <el-radio-group v-model="form.expiredProcess">
|
|
|
|
- <el-radio :label="1">自动退款</el-radio>
|
|
|
|
- <el-radio :label="2">自动核销</el-radio>
|
|
|
|
- </el-radio-group>
|
|
|
|
- </el-form-item>
|
|
|
|
- <div class="form-title"><span>特殊票种</span></div>
|
|
|
|
- <el-form-item label="指定年龄" prop="ageRadio">
|
|
|
|
|
|
+ <div class="form-title"><span>权益规则</span></div>
|
|
|
|
+ <el-form-item label="支持储值" prop="isStorageValue">
|
|
<div style="display: flex;align-items: center;">
|
|
<div style="display: flex;align-items: center;">
|
|
- <el-radio-group v-model="form.ageRadio" @input="radioInputsss">
|
|
|
|
- <el-radio label="-1">不限</el-radio>
|
|
|
|
- <el-radio label="-2">{{ '' }}</el-radio>
|
|
|
|
|
|
+ <el-radio-group v-model="form.isStorageValue" @input="radioInputsss">
|
|
|
|
+ <el-radio :label="0">不可储值</el-radio>
|
|
|
|
+ <el-radio :label="1">可储值</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
<div style="display: flex;align-items: center;">
|
|
<div style="display: flex;align-items: center;">
|
|
- 年龄限购
|
|
|
|
- <el-form-item label="" label-width="0" prop="ageMin">
|
|
|
|
- <el-input-number :disabled="form.ageRadio != -2" v-model="form.ageMin" placeholder="请输入年龄"
|
|
|
|
|
|
+ <el-form-item label="最小储值金额" label-width="120px" prop="minAmount">
|
|
|
|
+ <el-input-number :disabled="form.isStorageValue != 1" v-model="form.minAmount" placeholder="请输入最小储值金额"
|
|
controls-position="right">
|
|
controls-position="right">
|
|
</el-input-number>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- 至
|
|
|
|
- <el-form-item label="" label-width="0" prop="ageMax">
|
|
|
|
- <el-input-number :disabled="form.ageRadio != -2" v-model="form.ageMax" placeholder="请输入年龄"
|
|
|
|
|
|
+ <el-form-item label="最大储值金额" label-width="120px" prop="maxAmount">
|
|
|
|
+ <el-input-number :disabled="form.isStorageValue != 1" v-model="form.maxAmount" placeholder="请输入最大储值金额"
|
|
controls-position="right">
|
|
controls-position="right">
|
|
</el-input-number>
|
|
</el-input-number>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="指定性别" prop="sex">
|
|
|
|
- <el-radio-group v-model="form.sex">
|
|
|
|
- <el-radio :label="-1">不限</el-radio>
|
|
|
|
- <el-radio :label="1">男</el-radio>
|
|
|
|
- <el-radio :label="2">女</el-radio>
|
|
|
|
|
|
+ <el-form-item label="支持积分" prop="isCredit">
|
|
|
|
+ <el-radio-group v-model="form.isCredit">
|
|
|
|
+ <el-radio :label="0">不可积分</el-radio>
|
|
|
|
+ <el-radio :label="1">可积分</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
|
+ <span style="color: #ccc;">(积分跟随实体卡卡号,实体卡不与电子会员的积分融合,不支持实体卡与电子会员的绑定)</span>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="指定地点" prop="areaRadio">
|
|
|
|
|
|
+ <el-form-item label="折扣权益:">
|
|
<div style="display: flex;align-items: center;">
|
|
<div style="display: flex;align-items: center;">
|
|
- <el-radio-group v-model="form.areaRadio" @input="value => radioInput('area', value)">
|
|
|
|
- <el-radio label="-1">不限</el-radio>
|
|
|
|
- <el-radio label="-2">{{ '' }}</el-radio>
|
|
|
|
- </el-radio-group>
|
|
|
|
- <div style="display: flex;align-items: center;">
|
|
|
|
- 限定区域,区域身份证号
|
|
|
|
- <el-form-item label="" label-width="0" prop="area">
|
|
|
|
- <el-input :disabled="form.areaRadio != -2" placeholder="请输入身份证号" v-model="form.area">
|
|
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <span style="">多个以,隔开</span>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <el-form-item label="基本折扣:" prop="discountValue" label-width="100px">
|
|
|
|
+ <el-input-number style="width: 150px;" v-model="form.discountValue" controls-position="right" placeholder="请输入基本折扣"></el-input-number>
|
|
|
|
+ <span style="padding-bottom: 15px;">%</span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-button style="margin-left: 15px;" v-if="!form.discountGoodList||form.discountGoodList.length==0" type="primary" @click="addClassifyList">添加单品</el-button>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div v-for="(item,index) in form.discountGoodList" :key="index" style="margin-top: 10px;display: flex;align-items: center;">
|
|
|
|
+ <el-form-item label="单品折扣:" label-width="100px">
|
|
|
|
+ <el-select v-model="form.discountGoodList[index].goodId" clearable placeholder="请选择单品">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in scenicAreaProducts"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :value="item.value">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-input-number style="width: 150px;margin-left: 20px;" v-model="form.discountGoodList[index].discountValue" placeholder="请输入单品折扣" controls-position="right"></el-input-number>
|
|
|
|
+ <span style="padding-bottom: 15px;">%</span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-button style="margin-left: 15px;" v-if="form.discountGoodList.length==(index+1)" type="primary" @click="addClassifyList">添加单品</el-button>
|
|
|
|
+ <el-button style="margin-left: 15px;" type="danger" @click="clearClassifyList(index)">移除</el-button>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item>
|
|
|
|
- <el-button @click="reset">重置表单</el-button>
|
|
|
|
- <el-button v-if="form && form.goodsId" type="primary" @click="submitForm()" :loading="loading"
|
|
|
|
- element-loading-text="提交中..." element-loading-spinner="el-icon-loading"
|
|
|
|
- element-loading-background="rgba(0, 0, 0, 0.8)">
|
|
|
|
- {{ loading ? '提交中...' : '保存编辑' }}
|
|
|
|
- </el-button>
|
|
|
|
- <el-button type="primary" @click="submitForm(true)" :loading="loading" element-loading-text="提交中..."
|
|
|
|
- element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)">
|
|
|
|
- {{ loading ? '提交中...' : '新增票种规格' }}
|
|
|
|
- </el-button>
|
|
|
|
|
|
+ <el-form-item label="积分权益:">
|
|
|
|
+ <el-form-item label="积分成长系数:" prop="integralRatio" label-width="120px">
|
|
|
|
+ <el-input-number style="width: 150px;" v-model="form.integralRatio" placeholder="请输入积分成长系数" controls-position="right"></el-input-number>
|
|
|
|
+ <span style="padding-bottom: 15px;font-size: 12px;color: #ccc;">(用户下单获取积分值=实付金额**积分规则基础系数*会员成长系数会员系数越大,获得成长值越多,建议数值设置不要过大)</span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="持卡须知" prop="remark">
|
|
|
|
+ <el-input style="width: 100%;" type="textarea" v-model="form.remark" placeholder="请输入实体卡名称" maxlength="200"
|
|
|
|
+ show-word-limit />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
@@ -186,7 +163,7 @@ import {
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "addAndEdit",
|
|
name: "addAndEdit",
|
|
- dicts: ['tourism_scenicAreaTickets_status', 'tourism_scenicAreaTickets_type', 'tourism_scenicAreaTickets_type'],
|
|
|
|
|
|
+ dicts: ['activation_rule'],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
title: "",
|
|
title: "",
|
|
@@ -196,47 +173,34 @@ export default {
|
|
loadingText: "拼命加载数据中...",
|
|
loadingText: "拼命加载数据中...",
|
|
formStatus: null, // 0/null : 加载中 1 : 获取详情成功 2 : 获取详情失败
|
|
formStatus: null, // 0/null : 加载中 1 : 获取详情成功 2 : 获取详情失败
|
|
configUrl: {
|
|
configUrl: {
|
|
- add: '/merchant/merchantPerformAuditorium/saveMerchantGoods', // 新增地址
|
|
|
|
- details: '/merchant/merchantPerformAuditorium/merchantGoodsDetail', // 规格详情
|
|
|
|
- list: '/merchant/merchantPerformAuditorium/merchantGoodsList',// 规格列表
|
|
|
|
- edit: '/merchant/merchantPerformAuditorium/saveMerchantGoods', // 编辑地址
|
|
|
|
- updateStatusById: '/goods/goods/updateStatus',
|
|
|
|
|
|
+ add: '/merchant/merchantEntitycardConfig/insertOrUpdate', // 新增地址
|
|
|
|
+ details: '/merchant/merchantEntitycardConfig/selectById', // 规格详情
|
|
|
|
+ edit: '/merchant/merchantEntitycardConfig/insertOrUpdate', // 编辑地址
|
|
},
|
|
},
|
|
performId: null,
|
|
performId: null,
|
|
form: {
|
|
form: {
|
|
id: undefined,
|
|
id: undefined,
|
|
|
|
+ activationRule: []
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
- goodsName: [{ required: true, message: "请输入票种规格名称", trigger: ["change", "blur"] }],
|
|
|
|
- goodsSnapshot: [{ required: true, message: "请输入规格描述", trigger: ["change", "blur"] }],
|
|
|
|
-
|
|
|
|
- dayTypeRadio: [{ required: true, message: "请选择日期类型", trigger: ["change", "blur"] }],
|
|
|
|
- dayType: [{ required: false, message: "请选择时间范围", trigger: ["change", "blur"] }],
|
|
|
|
|
|
+ cardName: [{ required: true, message: "请输入实体卡名称", trigger: ["change", "blur"] }],
|
|
|
|
+ price: [{ required: true, message: "请输入实体卡价格", trigger: ["change", "blur"] }],
|
|
|
|
|
|
- useExpireDateRadio: [{ required: true, message: "请选择费日期", trigger: ["change", "blur"] }],
|
|
|
|
- useExpireDateDay: [{ required: false, message: "请输入天数", trigger: ["change", "blur"] }],
|
|
|
|
- useExpireDateTime: [{ required: false, message: "请选择时间", trigger: ["change", "blur"] }],
|
|
|
|
|
|
+ useType: [{ required: true, message: "请选择使用期限", trigger: ["change", "blur"] }],
|
|
|
|
+ useDay: [{ required: false, message: "请输入天数", trigger: ["change", "blur"] }],
|
|
|
|
+ useEndDay: [{ required: false, message: "请选择日期", trigger: ["change", "blur"] }],
|
|
|
|
|
|
- salePrice: [{ required: true, message: "请输入小程序价格", trigger: ["change", "blur"] }],
|
|
|
|
- originalPrice: [{ required: true, message: "请输入规划价格", trigger: ["change", "blur"] }],
|
|
|
|
|
|
+ effectiveDateType: [{ required: true, message: "请选择生效日期", trigger: ["change", "blur"] }],
|
|
|
|
+ activationRule: [{ required: true, message: "请选择激活后完善信息", trigger: ["change", "blur"] }],
|
|
|
|
|
|
- isAuth: [{ required: true, message: "请选择实名购票", trigger: ["change", "blur"] }],
|
|
|
|
- oneMany: [{ required: true, message: "请选择实名要求", trigger: ["change", "blur"] }],
|
|
|
|
- backStatus: [{ required: true, message: "请选择退票政策", trigger: ["change", "blur"] }],
|
|
|
|
|
|
+ isStorageValue: [{ required: true, message: "请选择支持储值", trigger: ["change", "blur"] }],
|
|
|
|
+ minAmount: [{ required: false, message: "请输入最小储值金额", trigger: ["change", "blur"] }],
|
|
|
|
+ maxAmount: [{ required: false, message: "请输入最大储值金额", trigger: ["change", "blur"] }],
|
|
|
|
|
|
- backStatusRadio: [{ required: true, message: "请选择提前退票", trigger: ["change", "blur"] }],
|
|
|
|
- backStatusDay: [{ required: false, message: "请输入时间", trigger: ["change", "blur"] }],
|
|
|
|
- backStatusTime: [{ required: false, message: "请选择时间点", trigger: ["change", "blur"] }],
|
|
|
|
|
|
+ isCredit: [{ required: true, message: "请选择支持积分", trigger: ["change", "blur"] }],
|
|
|
|
|
|
- expiredProcess: [{ required: true, message: "请选择过期未核销", trigger: ["change", "blur"] }],
|
|
|
|
- ageRadio: [{ required: true, message: "请选择指定年龄", trigger: ["change", "blur"] }],
|
|
|
|
- ageMin: [{ required: false, message: "请输入年龄限购", trigger: ["change", "blur"] }],
|
|
|
|
- ageMax: [{ required: false, message: "请输入年龄限购", trigger: ["change", "blur"] }],
|
|
|
|
-
|
|
|
|
- sex: [{ required: true, message: "请选择指定性别", trigger: ["change", "blur"] }],
|
|
|
|
-
|
|
|
|
- areaRadio: [{ required: true, message: "请选择指定地点", trigger: ["change", "blur"] }],
|
|
|
|
- area: [{ required: false, message: "请输入身份证", trigger: ["change", "blur"] }],
|
|
|
|
|
|
+ discountValue: [{ required: true, message: "请输入基本折扣", trigger: ["change", "blur"] }],
|
|
|
|
+ integralRatio: [{ required: true, message: "请输入积分成长系数", trigger: ["change", "blur"] }],
|
|
},
|
|
},
|
|
tableList: [],// 景点产品关联
|
|
tableList: [],// 景点产品关联
|
|
};
|
|
};
|
|
@@ -271,14 +235,21 @@ export default {
|
|
},
|
|
},
|
|
/** 获取详情 */
|
|
/** 获取详情 */
|
|
async getTableDeatilsFun(row) {
|
|
async getTableDeatilsFun(row) {
|
|
- const id = row.goodsId
|
|
|
|
|
|
+ const id = row.id
|
|
this.loading = true
|
|
this.loading = true
|
|
try {
|
|
try {
|
|
- let res = await getTableDeatilsByIdApi(this.configUrl.details, { goodsId: id })
|
|
|
|
|
|
+ let res = await getTableDeatilsByIdApi(this.configUrl.details, { id })
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
let obj = {
|
|
let obj = {
|
|
...res.data,
|
|
...res.data,
|
|
|
|
+ activationRule: res.data.activationRule?res.data.activationRule.split(','):[]
|
|
|
|
+ }
|
|
|
|
+ if(obj.isStorageValue==1) {
|
|
|
|
+ obj['minAmount'] = obj.storageConfig.minAmount
|
|
|
|
+ obj['maxAmount'] = obj.storageConfig.maxAmount
|
|
}
|
|
}
|
|
|
|
+ this.radioInputs(obj.useType)
|
|
|
|
+ this.radioInputsss(obj.isStorageValue)
|
|
this.$set(this, 'form', JSON.parse(JSON.stringify(obj)))
|
|
this.$set(this, 'form', JSON.parse(JSON.stringify(obj)))
|
|
this.formStatus = 1
|
|
this.formStatus = 1
|
|
} else {
|
|
} else {
|
|
@@ -306,12 +277,27 @@ export default {
|
|
if (valid) {
|
|
if (valid) {
|
|
this.loadingText = "提交数据中..."
|
|
this.loadingText = "提交数据中..."
|
|
this.loading = true
|
|
this.loading = true
|
|
|
|
+ let params = JSON.parse(JSON.stringify(this.form))
|
|
|
|
+ if(params.isStorageValue == 1) {
|
|
|
|
+ params['storageConfig'] = {
|
|
|
|
+ isCredit: this.form.isCredit,
|
|
|
|
+ minAmount: this.form.minAmount,
|
|
|
|
+ maxAmount: this.form.maxAmount
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ delete params.minAmount
|
|
|
|
+ delete params.maxAmount
|
|
addTableApi(this.configUrl.edit, {
|
|
addTableApi(this.configUrl.edit, {
|
|
...this.form,
|
|
...this.form,
|
|
|
|
+ activationRule: this.form.activationRule?this.form.activationRule.join(','):null,
|
|
|
|
+ storageConfig: {
|
|
|
|
+ minAmount: this.form.minAmount,
|
|
|
|
+ maxAmount: this.form.maxAmount
|
|
|
|
+ }
|
|
}).then(response => {
|
|
}).then(response => {
|
|
this.$modal.msgSuccess(`${this.form.goodsId ? '编辑' : '新增'}成功`);
|
|
this.$modal.msgSuccess(`${this.form.goodsId ? '编辑' : '新增'}成功`);
|
|
this.loading = false
|
|
this.loading = false
|
|
- this.$set(this, 'form', {})
|
|
|
|
|
|
+ this.$set(this, 'form', {activationRule:[]})
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs.form.clearValidate();
|
|
this.$refs.form.clearValidate();
|
|
})
|
|
})
|
|
@@ -324,71 +310,6 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- resetFormData(type) {
|
|
|
|
- let params = JSON.parse(JSON.stringify(this.form))
|
|
|
|
-
|
|
|
|
- if (params.dayTypeRadio == -1) { // 日期类型
|
|
|
|
- params.dayType = null
|
|
|
|
- } else {
|
|
|
|
- params.dayType = params.dayType ? params.dayType.join('~') : null
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (params.useExpireDateRadio == 1) { // 消费日期
|
|
|
|
- params['useExpireDate'] = JSON.stringify({
|
|
|
|
- type: 1,
|
|
|
|
- value: null
|
|
|
|
- })
|
|
|
|
- } else if (params.useExpireDateRadio == 2) {
|
|
|
|
- params['useExpireDate'] = JSON.stringify({
|
|
|
|
- type: 2,
|
|
|
|
- value: params.useExpireDateDay
|
|
|
|
- })
|
|
|
|
- } else if (params.useExpireDateRadio == 3) {
|
|
|
|
- params['useExpireDate'] = JSON.stringify({
|
|
|
|
- type: 3,
|
|
|
|
- value: params.useExpireDateTime ? params.useExpireDateTime.join('~') : null
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (params.backStatusRadio == -1) { // 提前退票
|
|
|
|
- params['goodsPerformRefundRule'] = null
|
|
|
|
- } else if (params.backStatusRadio == -2) {
|
|
|
|
- params['goodsPerformRefundRule'] = {
|
|
|
|
- days: params.backStatusDay,
|
|
|
|
- hour: params.backStatusTime,
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- params['goodsPerformSpecial'] = {}
|
|
|
|
- params.goodsPerformSpecial['sex'] = params.sex == -1 ? null : params.sex
|
|
|
|
- if (params.ageRadio == -1) { // 指定年龄
|
|
|
|
- params.goodsPerformSpecial['age'] = null
|
|
|
|
- } else if (params.ageRadio == -2) {
|
|
|
|
- params.goodsPerformSpecial['age'] = params.ageMin + "~" + params.ageMax
|
|
|
|
- }
|
|
|
|
- if (params.areaRadio == -1) { // 指定年龄
|
|
|
|
- params.goodsPerformSpecial['area'] = null
|
|
|
|
- } else if (params.areaRadio == -2) {
|
|
|
|
- params.goodsPerformSpecial['area'] = params.area
|
|
|
|
- }
|
|
|
|
- if (type) {
|
|
|
|
- params['goodsId'] = null
|
|
|
|
- } else {
|
|
|
|
- params['goodsId'] = params.goodsId
|
|
|
|
- }
|
|
|
|
- delete params.dayTypeRadio
|
|
|
|
- delete params.useExpireDateRadio
|
|
|
|
- delete params.backStatusRadio
|
|
|
|
- delete params.ageRadio
|
|
|
|
- delete params.areaRadio
|
|
|
|
- delete params.useExpireDateTime
|
|
|
|
- delete params.useExpireDateDay
|
|
|
|
- delete params.ageMax
|
|
|
|
- delete params.ageMin
|
|
|
|
- delete params.backStatusDay
|
|
|
|
- delete params.backStatusTime
|
|
|
|
- delete params.sex
|
|
|
|
- return params
|
|
|
|
- },
|
|
|
|
/**
|
|
/**
|
|
* 重置
|
|
* 重置
|
|
* @date 2023-11-22
|
|
* @date 2023-11-22
|
|
@@ -397,7 +318,7 @@ export default {
|
|
reset() {
|
|
reset() {
|
|
if (this.$refs["form"]) {
|
|
if (this.$refs["form"]) {
|
|
//this.$refs["form"].resetFields();
|
|
//this.$refs["form"].resetFields();
|
|
- this.$set(this, 'form', {})
|
|
|
|
|
|
+ this.$set(this, 'form', {activationRule:[]})
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs["form"].clearValidate();
|
|
this.$refs["form"].clearValidate();
|
|
})
|
|
})
|
|
@@ -412,61 +333,50 @@ export default {
|
|
this.reset();
|
|
this.reset();
|
|
this.open = false;
|
|
this.open = false;
|
|
},
|
|
},
|
|
- handleAdd() {
|
|
|
|
- this.$set(this, 'form', {})
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.$refs["form"].clearValidate();
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- /** */
|
|
|
|
- radioInput(key, value) {
|
|
|
|
- console.log('key,value===', key, value)
|
|
|
|
- if (value == -2) {
|
|
|
|
- this.rules[key][0].required = true
|
|
|
|
- } else {
|
|
|
|
- this.rules[key][0].required = false
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
/** */
|
|
/** */
|
|
radioInputs(value) {
|
|
radioInputs(value) {
|
|
if (value == 1) {
|
|
if (value == 1) {
|
|
- this.rules.useExpireDateDay[0].required = false
|
|
|
|
- this.rules.useExpireDateTime[0].required = false
|
|
|
|
- this.$refs.form.clearValidate('useExpireDateTime');
|
|
|
|
- this.$refs.form.clearValidate('useExpireDateDay');
|
|
|
|
|
|
+ this.rules.useDay[0].required = false
|
|
|
|
+ this.rules.useEndDay[0].required = false
|
|
|
|
+ this.$refs.form.clearValidate('useDay');
|
|
|
|
+ this.$refs.form.clearValidate('useEndDay');
|
|
} else if (value == 2) {
|
|
} else if (value == 2) {
|
|
- this.rules.useExpireDateDay[0].required = true
|
|
|
|
- this.rules.useExpireDateTime[0].required = false
|
|
|
|
- this.$refs.form.clearValidate('useExpireDateTime');
|
|
|
|
|
|
+ this.rules.useDay[0].required = true
|
|
|
|
+ this.rules.useEndDay[0].required = false
|
|
|
|
+ this.$refs.form.clearValidate('useEndDay');
|
|
} else if (value == 3) {
|
|
} else if (value == 3) {
|
|
- this.rules.useExpireDateDay[0].required = false
|
|
|
|
- this.rules.useExpireDateTime[0].required = true
|
|
|
|
- this.$refs.form.clearValidate('useExpireDateDay');
|
|
|
|
|
|
+ this.rules.useDay[0].required = false
|
|
|
|
+ this.rules.useEndDay[0].required = true
|
|
|
|
+ this.$refs.form.clearValidate('useDay');
|
|
}
|
|
}
|
|
},
|
|
},
|
|
/** */
|
|
/** */
|
|
- radioInputss(value) {
|
|
|
|
- if (value == -1) {
|
|
|
|
- this.rules.backStatusDay[0].required = false
|
|
|
|
- this.rules.backStatusTime[0].required = false
|
|
|
|
- this.$refs.form.clearValidate('backStatusDay');
|
|
|
|
- this.$refs.form.clearValidate('backStatusTime');
|
|
|
|
- } else if (value == -2) {
|
|
|
|
- this.rules.backStatusDay[0].required = true
|
|
|
|
- this.rules.backStatusTime[0].required = true
|
|
|
|
|
|
+ radioInputsss(value) {
|
|
|
|
+ if (value == 0) {
|
|
|
|
+ this.rules.minAmount[0].required = false
|
|
|
|
+ this.rules.maxAmount[0].required = false
|
|
|
|
+ this.$refs.form.clearValidate('minAmount');
|
|
|
|
+ this.$refs.form.clearValidate('maxAmount');
|
|
|
|
+ } else if (value == 1) {
|
|
|
|
+ this.rules.minAmount[0].required = true
|
|
|
|
+ this.rules.maxAmount[0].required = true
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- /** */
|
|
|
|
- radioInputsss(value) {
|
|
|
|
- if (value == -1) {
|
|
|
|
- this.rules.ageMin[0].required = false
|
|
|
|
- this.rules.ageMax[0].required = false
|
|
|
|
- this.$refs.form.clearValidate('ageMin');
|
|
|
|
- this.$refs.form.clearValidate('ageMax');
|
|
|
|
- } else if (value == -2) {
|
|
|
|
- this.rules.ageMin[0].required = true
|
|
|
|
- this.rules.ageMax[0].required = true
|
|
|
|
|
|
+ /** 填加单品 */
|
|
|
|
+ addClassifyList(){
|
|
|
|
+ let list = []
|
|
|
|
+ if(this.form.discountGoodList) {
|
|
|
|
+ list = JSON.parse(JSON.stringify(this.form.discountGoodList))
|
|
}
|
|
}
|
|
|
|
+ list.push({
|
|
|
|
+ goodId: null,
|
|
|
|
+ discountValue: null
|
|
|
|
+ })
|
|
|
|
+ this.$set(this.form,'discountGoodList',list)
|
|
|
|
+ },
|
|
|
|
+ /** 移除单品 */
|
|
|
|
+ clearClassifyList(index) {
|
|
|
|
+ this.form.discountGoodList.splice(index,1)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
};
|
|
};
|