|
@@ -18,10 +18,11 @@
|
|
|
element-loading-spinner="''"
|
|
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
>
|
|
|
- <div style="display: flex;">
|
|
|
+ <div style="display: flex">
|
|
|
<!-- 票种规格 -->
|
|
|
<div style="width: 400px;">
|
|
|
<div><el-button
|
|
|
+ v-if="false"
|
|
|
type="primary"
|
|
|
plain
|
|
|
icon="el-icon-plus"
|
|
@@ -30,117 +31,259 @@
|
|
|
>添加票种和规格</el-button></div>
|
|
|
<el-table :data="tableList">
|
|
|
<el-table-column type="index" label="序号" align="center" />
|
|
|
- <el-table-column label="门票名称" align="center" key="name" prop="name" />
|
|
|
- <el-table-column label="门票名称" align="center" key="name1" prop="name1" />
|
|
|
+ <el-table-column label="票种规格名称" align="center" key="goodsName" prop="goodsName" />
|
|
|
+ <el-table-column label="发布状态" align="center" key="status" prop="status">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <switchBox
|
|
|
+ :defaultChecked="true"
|
|
|
+ v-model="scope.row.status"
|
|
|
+ @changeFun="openAttraction(scope.row)"
|
|
|
+ :disabled="false"
|
|
|
+ :active-value="1"
|
|
|
+ :inactive-value="0"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
label="操作"
|
|
|
align="center"
|
|
|
- class-name="small-padding fixed-width"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
+ <el-button type="primary" @click="getTableDeatilsFun(scope.row)" icon="el-icon-edit" circle></el-button>
|
|
|
+ <el-button type="danger" icon="el-icon-delete" circle></el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<!-- 规格信息 -->
|
|
|
- <div style="width: calc( 100% - 400px );padding-left: 40px;box-sizing: border-box;">
|
|
|
+ <div style="width: calc( 100% - 400px ); padding-left: 40px;box-sizing: border-box;">
|
|
|
<el-form :model="form" ref="form" :rules="rules" label-width="130px">
|
|
|
<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" show-word-limit />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="规格描述:" prop="goodsSnashot">
|
|
|
- <el-input style="width: 100%;" v-model="form.goodsSnashot" placeholder="请输入规格描述" maxlength="50" show-word-limit />
|
|
|
+ <el-form-item label="规格描述:" prop="goodsSnapshot">
|
|
|
+ <el-input style="width: 100%;" v-model="form.goodsSnapshot" placeholder="请输入规格描述" maxlength="50" show-word-limit />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="日期类型" prop="dayType">
|
|
|
- <el-radio-group v-model="form.dayType">
|
|
|
- <el-radio-button label="null">日历票</el-radio-button>
|
|
|
- <el-radio-button label="YYYY-MM-DD~YYYY-MM-DD">期票,日期范围内有效</el-radio-button>
|
|
|
- </el-radio-group>
|
|
|
+ <el-form-item label="日期类型:" :prop="'dayTypeRadio'">
|
|
|
+ <div style="display: flex;align-items: center;">
|
|
|
+ <el-radio-group v-model="form.dayTypeRadio" @input="value => radioInput('dayType',value)">
|
|
|
+ <div style="display: flex;align-items: center;">
|
|
|
+ <el-radio label="-1">日历票</el-radio>
|
|
|
+ <el-radio style="display: flex;align-items: center;" label="-2">
|
|
|
+ <el-form-item label="" label-width="0" :prop="'dayType'">
|
|
|
+ <span>期票,</span>
|
|
|
+ <el-date-picker
|
|
|
+ :disabled="!form.dayTypeRadio||form.dayTypeRadio==-1"
|
|
|
+ v-model="form.dayType"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="至"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ <span>内有效</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-radio>
|
|
|
+ </div>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="消费日期" prop="useExpireDate">
|
|
|
- <el-radio-group v-model="form.useExpireDate">
|
|
|
- <el-radio
|
|
|
- v-for="dict in dict.type.tourism_scenicAreaTickets_useExpireDate"
|
|
|
- :label="Number(dict.value)"
|
|
|
- >{{ dict.label }}</el-radio>
|
|
|
+ <el-form-item label="消费日期:" prop="useExpireDateRadio">
|
|
|
+ <el-radio-group v-model="form.useExpireDateRadio" @input="radioInputs">
|
|
|
+ <div style="display: flex;flex-direction: column;padding-top: 10px;">
|
|
|
+ <div>
|
|
|
+ <el-radio label="1">不限</el-radio>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex;align-items: center;margin-top: 25px;">
|
|
|
+ <el-radio style="display: flex;align-items: center;" label="2">
|
|
|
+ <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"
|
|
|
+ placeholder="请输入天数"
|
|
|
+ controls-position="right">
|
|
|
+ </el-input-number>
|
|
|
+ <span>天可使用</span>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </el-radio>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex;align-items: center;margin-top: 25px;">
|
|
|
+ <el-radio style="display: flex;align-items: center;" label="3">
|
|
|
+ <div style="display: flex;align-items: center;">
|
|
|
+ <el-form-item label="" label-width="0" :prop="'useExpireDateTime'">
|
|
|
+ <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>
|
|
|
+ <span>日期范围内使用</span>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </el-radio>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="销售价格">
|
|
|
<div style="display: flex;">
|
|
|
- <el-form-item label="小程序价格:" prop="saleprice">
|
|
|
- <el-input style="width: 100%;" v-model="form.saleprice" placeholder="请输入小程序价格" maxlength="50" show-word-limit />
|
|
|
+ <el-form-item label="小程序价格:" prop="salePrice">
|
|
|
+ <el-input-number
|
|
|
+ v-model="form.salePrice"
|
|
|
+ placeholder="请输入小程序价格"
|
|
|
+ controls-position="right">
|
|
|
+ </el-input-number>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="规划价格:" prop="originalPrice">
|
|
|
- <el-input style="width: 100%;" v-model="form.originalPrice" placeholder="请输入规划价格" maxlength="50" show-word-limit />
|
|
|
+ <el-input-number
|
|
|
+ v-model="form.originalPrice"
|
|
|
+ placeholder="请输入规划价格"
|
|
|
+ controls-position="right">
|
|
|
+ </el-input-number>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="实名购票" prop="type">
|
|
|
- <el-radio-group v-model="form.type">
|
|
|
- <el-radio
|
|
|
- v-for="dict in dict.type.tourism_scenicAreaTickets_type"
|
|
|
- :label="Number(dict.value)"
|
|
|
- >{{ dict.label }}</el-radio>
|
|
|
+ <el-form-item label="实名购票" prop="isAuth">
|
|
|
+ <el-radio-group v-model="form.isAuth">
|
|
|
+ <el-radio :label="1">实名</el-radio>
|
|
|
+ <el-radio :label="2">不实名</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="实名要求" prop="oneMany">
|
|
|
+ <el-form-item v-if="form.isAuth==1" label="实名要求" prop="oneMany">
|
|
|
<el-radio-group v-model="form.oneMany">
|
|
|
- <el-radio
|
|
|
- v-for="dict in dict.type.tourism_scenicAreaTickets_oneMany"
|
|
|
- :label="Number(dict.value)"
|
|
|
- >{{ dict.label }}</el-radio>
|
|
|
+ <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="backStatus">
|
|
|
<el-radio-group v-model="form.backStatus">
|
|
|
- <el-radio
|
|
|
- v-for="dict in dict.type.tourism_scenicAreaTickets_backStatus"
|
|
|
- :label="Number(dict.value)"
|
|
|
- >{{ dict.label }}</el-radio>
|
|
|
+ <el-radio :label="1">允许退票</el-radio>
|
|
|
+ <el-radio :label="2">不允许退票</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="提前退票" prop="type">
|
|
|
- <el-radio-group v-model="form.type">
|
|
|
- <el-radio
|
|
|
- v-for="dict in dict.type.tourism_scenicAreaTickets_type"
|
|
|
- :label="Number(dict.value)"
|
|
|
- >{{ dict.label }}</el-radio>
|
|
|
- </el-radio-group>
|
|
|
+ <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
|
|
|
- v-for="dict in dict.type.tourism_scenicAreaTickets_expiredProcess"
|
|
|
- :label="Number(dict.value)"
|
|
|
- >{{ dict.label }}</el-radio>
|
|
|
+ <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="type">
|
|
|
- <el-radio-group v-model="form.type">
|
|
|
- <el-radio
|
|
|
- v-for="dict in dict.type.tourism_scenicAreaTickets_type"
|
|
|
- :label="Number(dict.value)"
|
|
|
- >{{ dict.label }}</el-radio>
|
|
|
- </el-radio-group>
|
|
|
+ <el-form-item label="指定年龄" prop="ageRadio">
|
|
|
+ <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>
|
|
|
+ <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="请输入年龄"
|
|
|
+ controls-position="right">
|
|
|
+ </el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ 至
|
|
|
+ <el-form-item label="" label-width="0" prop="ageMax">
|
|
|
+ <el-input-number
|
|
|
+ :disabled="form.ageRadio!=-2"
|
|
|
+ v-model="form.ageMax"
|
|
|
+ placeholder="请输入年龄"
|
|
|
+ controls-position="right">
|
|
|
+ </el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="指定性别" prop="type">
|
|
|
- <el-radio-group v-model="form.type">
|
|
|
- <el-radio
|
|
|
- v-for="dict in dict.type.tourism_scenicAreaTickets_type"
|
|
|
- :label="Number(dict.value)"
|
|
|
- >{{ dict.label }}</el-radio>
|
|
|
+ <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-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="指定地点" prop="type">
|
|
|
- <el-radio-group v-model="form.type">
|
|
|
- <el-radio
|
|
|
- v-for="dict in dict.type.tourism_scenicAreaTickets_type"
|
|
|
- :label="Number(dict.value)"
|
|
|
- >{{ dict.label }}</el-radio>
|
|
|
- </el-radio-group>
|
|
|
+ <el-form-item label="指定地点" prop="areaRadio">
|
|
|
+ <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>
|
|
|
+ </div>
|
|
|
+ </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>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -148,17 +291,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer" v-if="formStatus==1">
|
|
|
- <el-button @click="cancel">取消</el-button>
|
|
|
- <el-button
|
|
|
- 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 @click="cancel">关闭</el-button>
|
|
|
</span>
|
|
|
<!-- 添加或修改对话框 End -->
|
|
|
</el-dialog>
|
|
@@ -189,14 +322,41 @@ export default {
|
|
|
list: '/merchant/merchantPerformAuditorium/merchantGoodsList',// 规格列表
|
|
|
edit: '/merchant/merchantPerformAuditorium/saveMerchantGoods', // 编辑地址
|
|
|
},
|
|
|
+ performId: null,
|
|
|
form: {
|
|
|
id: undefined,
|
|
|
},
|
|
|
rules: {
|
|
|
- name: [{ required: true, message: "请输入门票名称", trigger: ["change","blur"] }],
|
|
|
- posterUrl: [{ required: true, message: "请上传图片", trigger: ["change","blur"] }],
|
|
|
- performSnapshot: [{ required: true, message: "请输产品介绍", trigger: ["change","blur"] }],
|
|
|
- performNotice: [{ required: true, message: "请输购票须知", trigger: ["change","blur"] }],
|
|
|
+ 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"] }],
|
|
|
+
|
|
|
+ useExpireDateRadio: [{ required: true, message: "请选择费日期", trigger: ["change","blur"] }],
|
|
|
+ useExpireDateDay: [{ required: false, message: "请输入天数", trigger: ["change","blur"] }],
|
|
|
+ useExpireDateTime: [{ required: false, message: "请选择时间", trigger: ["change","blur"] }],
|
|
|
+
|
|
|
+ salePrice: [{ required: true, message: "请输入小程序价格", trigger: ["change","blur"] }],
|
|
|
+ originalPrice: [{ 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"] }],
|
|
|
+
|
|
|
+ backStatusRadio: [{ required: true, message: "请选择提前退票", trigger: ["change","blur"] }],
|
|
|
+ backStatusDay: [{ required: false, message: "请输入时间", trigger: ["change","blur"] }],
|
|
|
+ backStatusTime: [{ required: false, 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"] }],
|
|
|
},
|
|
|
tableList: [],// 景点产品关联
|
|
|
};
|
|
@@ -210,18 +370,8 @@ export default {
|
|
|
this.actionUrlLoading = false
|
|
|
this.model = model
|
|
|
this.formStatus = 0
|
|
|
- if(model=='ADD') { // 新增
|
|
|
- this.$set(this,'form',row)
|
|
|
- this.formStatus = 1
|
|
|
- }else if(model=='EDIT') { // 新增
|
|
|
- let obj = {
|
|
|
- ...row
|
|
|
- }
|
|
|
- this.$set(this,'form',obj)
|
|
|
- this.formStatus = 1
|
|
|
- }else if(model=='EDITInit') { // 新增
|
|
|
- await this.getTableListFun(row)
|
|
|
- }
|
|
|
+ await this.getTableListFun(row)
|
|
|
+ this.$set(this,'form',{})
|
|
|
this.loading = false
|
|
|
this.$nextTick(()=>{
|
|
|
if(this.$refs["form"]) {
|
|
@@ -229,9 +379,10 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- /** 获取详情 */
|
|
|
+ /** 获取列表详情 */
|
|
|
async getTableListFun(row) {
|
|
|
const id = row.performId
|
|
|
+ this.performId = id
|
|
|
this.loading = true
|
|
|
try {
|
|
|
let res = await getTableDeatilsByIdApi(this.configUrl.list,{performId: id})
|
|
@@ -254,14 +405,60 @@ export default {
|
|
|
},
|
|
|
/** 获取详情 */
|
|
|
async getTableDeatilsFun(row) {
|
|
|
- const id = row.performId
|
|
|
+ const id = row.goodsId
|
|
|
this.loading = true
|
|
|
try {
|
|
|
let res = await getTableDeatilsByIdApi(this.configUrl.details,{goodsId: id})
|
|
|
if(res.code == 200) {
|
|
|
let obj = {
|
|
|
- ...res.data
|
|
|
+ ...res.data,
|
|
|
+ useExpireDate: res.data.useExpireDate?res.data.useExpireDate.type:'1',
|
|
|
+ backStatusRadio: res.data.goodsPerformRefundRule?'-2':'-1',
|
|
|
+ }
|
|
|
+ if(res.data.dayType){
|
|
|
+ obj['dayTypeRadio'] = '-2'
|
|
|
+ obj['dayType'] = res.data.dayType.split('~')
|
|
|
+ }else {
|
|
|
+ obj['dayTypeRadio'] = '-1'
|
|
|
+ }
|
|
|
+ if(!res.data.useExpireDate){
|
|
|
+ obj['useExpireDateRadio'] = '1'
|
|
|
+ }else {
|
|
|
+ let sss = JSON.parse(res.data.useExpireDate)
|
|
|
+ if(sss.type==2){
|
|
|
+ obj['useExpireDateRadio'] = '2'
|
|
|
+ obj['useExpireDateDay'] = sss.value
|
|
|
+ }else if(sss.type==3) {
|
|
|
+ obj['useExpireDateRadio'] = '3'
|
|
|
+ obj['useExpireDateTime'] = sss.value.split('~')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(res.data.goodsPerformRefundRule) {
|
|
|
+ obj['backStatusDay'] = res.data.goodsPerformRefundRule.days
|
|
|
+ obj['backStatusTime'] = res.data.goodsPerformRefundRule.hour
|
|
|
+ }
|
|
|
+ if( !res.data.goodsPerformSpecial ) {
|
|
|
+ obj['ageRadio'] = "-1"
|
|
|
}
|
|
|
+ if( res.data.goodsPerformSpecial && res.data.goodsPerformSpecial.age ) {
|
|
|
+ obj['ageRadio'] = "-2"
|
|
|
+ obj['ageMin'] = res.data.goodsPerformSpecial.age.split('~')[0]
|
|
|
+ obj['ageMax'] = res.data.goodsPerformSpecial.age.split('~')[1]
|
|
|
+ }else {
|
|
|
+ obj['ageRadio'] = "-1"
|
|
|
+ }
|
|
|
+ if( res.data.goodsPerformSpecial && res.data.goodsPerformSpecial.sex ) {
|
|
|
+ obj['sex'] = res.data.goodsPerformSpecial.sex
|
|
|
+ }else {
|
|
|
+ obj['sex'] = -1
|
|
|
+ }
|
|
|
+ if( res.data.goodsPerformSpecial && res.data.goodsPerformSpecial.area ) {
|
|
|
+ obj['areaRadio'] = "-2"
|
|
|
+ obj['area'] = res.data.goodsPerformSpecial.area
|
|
|
+ }else {
|
|
|
+ obj['areaRadio'] = "-1"
|
|
|
+ }
|
|
|
+
|
|
|
this.$set(this,'form',JSON.parse(JSON.stringify(obj)))
|
|
|
this.formStatus = 1
|
|
|
}else {
|
|
@@ -283,40 +480,116 @@ export default {
|
|
|
* @date 2023-11-22
|
|
|
* @returns {any}
|
|
|
*/
|
|
|
- submitForm() {
|
|
|
+ submitForm(type) {
|
|
|
+ console.log("dsfsfds=======",type,this.form)
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
this.loadingText = "提交数据中..."
|
|
|
this.loading = true
|
|
|
- if (this.model != 'ADD') {
|
|
|
- addTableApi(
|
|
|
- this.configUrl.edit,{
|
|
|
- ...this.form
|
|
|
- }).then(response => {
|
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
- this.loading = false
|
|
|
- this.open = false;
|
|
|
- this.$emit('refresh')
|
|
|
- }).catch(()=>{
|
|
|
- this.$message.error("修改失败!!!");
|
|
|
- this.loading = false
|
|
|
+ addTableApi(this.configUrl.edit,{
|
|
|
+ ...this.resetFormData(type),
|
|
|
+ }).then(response => {
|
|
|
+ this.$modal.msgSuccess(`${ this.form.goodsId ? '编辑':'新增' }成功`);
|
|
|
+ this.loading = false
|
|
|
+ this.$set(this,'form',{})
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.$refs.form.clearValidate();
|
|
|
})
|
|
|
- } else {
|
|
|
- addTableApi(this.configUrl.edit,{
|
|
|
- ...this.form
|
|
|
- }).then(response => {
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
- this.loading = false
|
|
|
- this.open = false;
|
|
|
- this.$emit('refresh')
|
|
|
- }).catch(()=>{
|
|
|
- this.$message.error("新增失败!!!");
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- }
|
|
|
+ this.getTableListFun({performId:this.performId})
|
|
|
+ //this.open = false;
|
|
|
+ //this.$emit('refresh')
|
|
|
+ }).catch(()=>{
|
|
|
+ this.$message.error(`${ this.form.goodsId ? '编辑':'新增' }失败!!!`);
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 修改状态
|
|
|
+ * @date 2023-11-22
|
|
|
+ * @returns {any}
|
|
|
+ */
|
|
|
+ openAttraction(row) {
|
|
|
+ console.log("row======",row)
|
|
|
+ this.$modal.confirm(`是否确认${row.status == 0 ? '上架' : '下架'} ${row.goodsName}点位吗?`).then( () => {
|
|
|
+ return addTableApi(this.configUrl.edit,{
|
|
|
+ ...row,
|
|
|
+ status: row.status == 0 ? 1 : 0
|
|
|
+ });
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess(`${row.status == 0 ? '上架' : '下架'}成功`);
|
|
|
+ }).catch((e) => {
|
|
|
+ console.error("失败====",e)
|
|
|
+ });
|
|
|
+ },
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ params['performId'] = this.performId
|
|
|
+ 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
|
|
@@ -324,7 +597,11 @@ export default {
|
|
|
*/
|
|
|
reset() {
|
|
|
if(this.$refs["form"]) {
|
|
|
- this.$refs["form"].clearValidate();
|
|
|
+ //this.$refs["form"].resetFields();
|
|
|
+ this.$set(this,'form',{})
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.$refs["form"].clearValidate();
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
@@ -337,7 +614,60 @@ export default {
|
|
|
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) {
|
|
|
+ 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');
|
|
|
+ }else if( value == 2 ) {
|
|
|
+ this.rules.useExpireDateDay[0].required = true
|
|
|
+ this.rules.useExpireDateTime[0].required = false
|
|
|
+ this.$refs.form.clearValidate('useExpireDateTime');
|
|
|
+ }else if( value == 3 ) {
|
|
|
+ this.rules.useExpireDateDay[0].required = false
|
|
|
+ this.rules.useExpireDateTime[0].required = true
|
|
|
+ this.$refs.form.clearValidate('useExpireDateDay');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /** */
|
|
|
+ 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 == -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
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
};
|