|
@@ -1,124 +1,123 @@
|
|
|
<template>
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="95%" append-to-body :close-on-click-modal="false"
|
|
|
- @close="cancel">
|
|
|
- <div class="form-dialog-box" v-loading="loading" :element-loading-text="loadingText"
|
|
|
- element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0)">
|
|
|
- <div v-loading="loading" :element-loading-text="''" element-loading-spinner="''"
|
|
|
- element-loading-background="rgba(0, 0, 0, 0.8)">
|
|
|
+ <el-dialog
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="open"
|
|
|
+ width="70%"
|
|
|
+ append-to-body
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ @close="cancel"
|
|
|
+ >
|
|
|
+ <div class="form-dialog-box"
|
|
|
+ v-loading="loading"
|
|
|
+ :element-loading-text="loadingText"
|
|
|
+ element-loading-spinner="el-icon-loading"
|
|
|
+ element-loading-background="rgba(0, 0, 0, 0)">
|
|
|
+ <div
|
|
|
+ v-loading="loading"
|
|
|
+ :element-loading-text="''"
|
|
|
+ element-loading-spinner="''"
|
|
|
+ element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
+ >
|
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
- <el-tab-pane label="基本信息" name="first"></el-tab-pane>
|
|
|
- <el-tab-pane label="使用规则" name="second"></el-tab-pane>
|
|
|
+ <el-tab-pane label="基本信息:" name="first"></el-tab-pane>
|
|
|
</el-tabs>
|
|
|
<el-form :model="form" ref="form" :rules="rules" label-width="120px">
|
|
|
<div v-show="activeName == 'first'">
|
|
|
- <el-form-item label="优惠券名称" prop="remark">
|
|
|
- <el-input style="width: 350px;" v-model="form.remark" placeholder="请输入优惠券名称" maxlength="50"
|
|
|
- show-word-limit />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="券种说明" prop="remark">
|
|
|
- <el-input style="width: 350px;" type="textarea" v-model="form.remark" placeholder="请输入券种说明"
|
|
|
- maxlength="200" show-word-limit />
|
|
|
- </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_memberInformation_biangeng_type" :label="dict.value">{{
|
|
|
- dict.label }}</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="优惠金额" class="is-required">
|
|
|
- <div style="display: flex;">
|
|
|
- <span>订单满</span>
|
|
|
- <el-form-item label="" prop="num">
|
|
|
- <el-input-number v-model="form.num" controls-position="right" :precision="0" :min="0"
|
|
|
- placeholder="请输入金额"></el-input-number>
|
|
|
- </el-form-item>
|
|
|
- <span>减</span>
|
|
|
- <el-form-item label="" prop="num">
|
|
|
- <el-input-number v-model="form.num" controls-position="right" :precision="0" :min="0"
|
|
|
- placeholder="请输入金额"></el-input-number>
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="发放数量" prop="num">
|
|
|
- <el-input-number v-model="form.num" controls-position="right" :precision="0" :min="0"
|
|
|
- placeholder="请输入发放数量"></el-input-number>
|
|
|
- <span>张</span>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="发放时间" prop="useExpireDateTime">
|
|
|
- <el-date-picker v-model="form.useExpireDateTime" type="daterange" range-separator="至"
|
|
|
- start-placeholder="开始日期" value-format="yyyy-MM-dd" end-placeholder="结束日期">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="使用有效期:" prop="useExpireDateRadio">
|
|
|
- <el-radio-group v-model="form.useExpireDateRadio" @input="radioInputs">
|
|
|
- <div style="display: flex;flex-direction: column;">
|
|
|
- <div style="display: flex;align-items: center;">
|
|
|
- <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>
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
- </el-radio>
|
|
|
+ <el-form-item label="活动名称:" prop="activityName">
|
|
|
+ <el-input style="width: 350px;" v-model="form.activityName" placeholder="请输入活动名称" maxlength="50" show-word-limit />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="封面" prop="image">
|
|
|
+ <div style="display: flex;">
|
|
|
+ <div
|
|
|
+ v-for="(item,index) in form.image"
|
|
|
+ :key="index"
|
|
|
+ style="width: 100px; height: 100px;position: relative;border: 1px solid #999;border-radius: 5px;margin-right: 20px;">
|
|
|
+ <el-image
|
|
|
+ style="width: 100%; height: 100%"
|
|
|
+ :src="item"
|
|
|
+ :preview-src-list="form.image">
|
|
|
+ </el-image>
|
|
|
+ <span @click="handleRemove(index)" style="position: absolute;top: -15px;right: -15px;color: red;font-size: 24px;z-index: 999;cursor: pointer;">
|
|
|
+ <i class="el-icon-error"></i>
|
|
|
+ </span>
|
|
|
</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
|
|
|
+ style="width: 100px; height: 100px;"
|
|
|
+ v-if="!form.image||form.image.length<1"
|
|
|
+ v-loading="actionUrlLoading"
|
|
|
+ element-loading-text="上传中..."
|
|
|
+ element-loading-spinner="el-icon-loading"
|
|
|
+ element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
+ >
|
|
|
+ <el-upload
|
|
|
+ class="avatar-uploader"
|
|
|
+ :action="actionUrl"
|
|
|
+ :data="{
|
|
|
+ bucket: 'tourism'
|
|
|
+ }"
|
|
|
+ :show-file-list="false"
|
|
|
+ :before-upload="beforeAvatarUpload"
|
|
|
+ :on-success="handleAvatarSuccess"
|
|
|
+ :on-progress="handleAvatarProgress"
|
|
|
+ :disabled="actionUrlLoading"
|
|
|
+ :on-error="handleAvatarError"
|
|
|
+ >
|
|
|
+ <i class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
+ </el-upload>
|
|
|
</div>
|
|
|
-
|
|
|
- </div>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="优惠券背景图" prop="imgUrl">
|
|
|
- <div style="display: flex;">
|
|
|
- <div v-for="(item, index) in form.imgUrl" :key="index"
|
|
|
- style="width: 100px; height: 100px;position: relative;border: 1px solid #999;border-radius: 5px;margin-right: 20px;">
|
|
|
- <el-image style="width: 100%; height: 100%" :src="item" :preview-src-list="form.imgUrl">
|
|
|
- </el-image>
|
|
|
- <span @click="handleRemove(index)"
|
|
|
- style="position: absolute;top: -15px;right: -15px;color: red;font-size: 24px;z-index: 999;cursor: pointer;">
|
|
|
- <i class="el-icon-error"></i>
|
|
|
- </span>
|
|
|
+
|
|
|
</div>
|
|
|
- <div style="width: 100px; height: 100px;" v-if="!form.imgUrl || form.imgUrl.length < 1"
|
|
|
- v-loading="actionUrlLoading" element-loading-text="上传中..." element-loading-spinner="el-icon-loading"
|
|
|
- element-loading-background="rgba(0, 0, 0, 0.8)">
|
|
|
- <el-upload class="avatar-uploader" :action="actionUrl" :data="{
|
|
|
- bucket: 'tourism'
|
|
|
- }" :show-file-list="false" :before-upload="beforeAvatarUpload" :on-success="handleAvatarSuccess"
|
|
|
- :on-progress="handleAvatarProgress" :disabled="actionUrlLoading" :on-error="handleAvatarError">
|
|
|
- <i class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
- </el-upload>
|
|
|
- </div>
|
|
|
-
|
|
|
- </div>
|
|
|
- <span>支持jpg、png,支持1MB大小以内的图片上传</span>
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div v-show="activeName == 'second'">
|
|
|
- <asEditor />
|
|
|
+ <span>建议尺寸375px X 392px,支持jpg/png/gif,支持1MB大小以内的图片上传</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="活动起止时间:" prop="eventTime">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.eventTime"
|
|
|
+ type="datetimerange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="选择模板:" prop="jsonObj">
|
|
|
+ <el-select style="width: 100%;" v-model="form.jsonObj" placeholder="请选择模板">
|
|
|
+ <el-option
|
|
|
+ v-for="item in jsonObjList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="优惠券:" prop="useUserRelid_2">
|
|
|
+ <selectCouponManagement
|
|
|
+ v-model="form.useUserRelid_2"
|
|
|
+ title="新增优惠券"
|
|
|
+ @submitForm="()=>$refs.form.validateField('useUserRelid_2')">
|
|
|
+ </selectCouponManagement>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="景区门票:" prop="useUserRelid_3">
|
|
|
+ <selectTicketOrders
|
|
|
+ v-model="form.useUserRelid_3"
|
|
|
+ title="新增景区门票"
|
|
|
+ @submitForm="()=>$refs.form.validateField('useUserRelid_3')">
|
|
|
+ </selectTicketOrders>
|
|
|
+ </el-form-item>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <span slot="footer" class="dialog-footer" v-if="formStatus == 1">
|
|
|
+ <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)">
|
|
|
+ <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>
|
|
|
</span>
|
|
@@ -127,16 +126,18 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {
|
|
|
+import {
|
|
|
getTableDeatilsByIdApi,
|
|
|
updateTableApi,
|
|
|
- addTableApi
|
|
|
-} from '@/api/CURD'
|
|
|
-import asEditor from "@/myComponents/asEditor"
|
|
|
+ addTableApi,
|
|
|
+ listTableApi,
|
|
|
+ } from '@/api/CURD'
|
|
|
+import selectCouponManagement from '../model/selectCouponManagement.vue'
|
|
|
+import selectTicketOrders from "../model/selectTicketOrders.vue"
|
|
|
export default {
|
|
|
name: "addAndEdit",
|
|
|
- dicts: ['tourism_memberInformation_biangeng_type'],
|
|
|
- components: {asEditor},
|
|
|
+ components: {selectCouponManagement,selectTicketOrders},
|
|
|
+ dicts: ['tourism_couponManagement_type','tourism_couponManagement_useUserType','tourism_couponManagement_receiveType','tourism_couponManagement_useConfig','goods_type'],
|
|
|
data() {
|
|
|
return {
|
|
|
title: "",
|
|
@@ -146,35 +147,33 @@ export default {
|
|
|
loadingText: "拼命加载数据中...",
|
|
|
formStatus: null, // 0/null : 加载中 1 : 获取详情成功 2 : 获取详情失败
|
|
|
configUrl: {
|
|
|
- add: '/member/memberInfo/updateCredit', // 新增地址
|
|
|
- details: '/member/memberInfo/detail', // 详情地址
|
|
|
- edit: '/member/memberInfo/updateCredit', // 编辑地址
|
|
|
+ list: '/merchant/merchantTemplate/pageList', // 列表地址
|
|
|
+ add: '/merchant/merchantActivityInfo/insertOrUpdate', // 新增地址
|
|
|
+ details: '/merchant/merchantActivityInfo/selectById', // 详情地址
|
|
|
+ edit: '/merchant/merchantActivityInfo/insertOrUpdate', // 编辑地址
|
|
|
},
|
|
|
form: {
|
|
|
id: undefined,
|
|
|
},
|
|
|
rules: {
|
|
|
- type: [{ required: true, message: "请选择积分变动", trigger: ["change", "blur"] }],
|
|
|
- num: [{ required: true, message: "请输入变动量", trigger: ["change", "blur"] }],
|
|
|
- remark: [{ 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"] }],
|
|
|
-
|
|
|
+ activityName: [{ required: true, message: "请输入活动名称", trigger: ["change","blur"] }],
|
|
|
+ image: [{ required: true, message: "请上传封面", trigger: ["change","blur"] }],
|
|
|
+ eventTime: [{ required: true, message: "请选择活动起止时间", trigger: ["change","blur"] }],
|
|
|
+ jsonObj: [{ required: true, message: "请选择模板", trigger: ["change","blur"] }],
|
|
|
+ useUserRelid_2: [{ required: true, message: "请选择优惠券", trigger: ["change","blur"] }],
|
|
|
+ useUserRelid_3: [{ required: true, message: "请选择景区门票", trigger: ["change","blur"] }],
|
|
|
},
|
|
|
|
|
|
activeName: 'first',
|
|
|
-
|
|
|
+
|
|
|
actionUrl: process.env.VUE_APP_BASE_API + process.env.VUE_APP_UPLOAD_IMAGE,
|
|
|
actionUrlLoading: false,
|
|
|
+
|
|
|
+ jsonObjList: []
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- async initData(title, model, row) {
|
|
|
+ async initData(title , model,row){
|
|
|
this.title = title
|
|
|
this.activeName = 'first'
|
|
|
this.open = true
|
|
@@ -182,27 +181,33 @@ export default {
|
|
|
this.loading = true
|
|
|
this.model = model
|
|
|
this.formStatus = 0
|
|
|
- if (model == 'ADD') { // 新增
|
|
|
- this.$set(this, 'form', {
|
|
|
+ this.getJsonObjList()
|
|
|
+ if(model=='ADD') { // 新增
|
|
|
+ this.$set(this,'form',{
|
|
|
...row,
|
|
|
- imgUrl: [],
|
|
|
+ eventTime: [], // 活动时间段
|
|
|
+ image: [],
|
|
|
+ useUserRelid_2: [],
|
|
|
+ useUserRelid_3: [],
|
|
|
})
|
|
|
this.formStatus = 1
|
|
|
- } else if (model == 'EDIT') { // 新增
|
|
|
+ }else if(model=='EDIT') { // 新增
|
|
|
let obj = {
|
|
|
...row,
|
|
|
- imgUrl: row.imgUrl ? row.imgUrl.split(',') : [],
|
|
|
+ image: row.image?row.image.split(','):[],
|
|
|
}
|
|
|
- this.$set(this, 'form', {
|
|
|
+ this.$set(this,'form',{
|
|
|
memberId: row.id
|
|
|
})
|
|
|
this.formStatus = 1
|
|
|
- } else if (model == 'EDITInit') { // 新增
|
|
|
+ }else if(model=='EDITInit') { // 新增
|
|
|
await this.getTableDeatilsFun(row)
|
|
|
}
|
|
|
this.loading = false
|
|
|
- this.$nextTick(() => {
|
|
|
- if (this.$refs["form"]) {
|
|
|
+ this.radioInputs(this.form.useType)
|
|
|
+ this.radioInput(this.form.receiveType)
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ if(this.$refs["form"]) {
|
|
|
this.$refs["form"].clearValidate();
|
|
|
}
|
|
|
})
|
|
@@ -212,15 +217,18 @@ export default {
|
|
|
const id = row.id
|
|
|
this.loading = true
|
|
|
try {
|
|
|
- let res = await getTableDeatilsByIdApi(this.configUrl.details, { id })
|
|
|
- if (res.code == 200) {
|
|
|
+ let res = await getTableDeatilsByIdApi(this.configUrl.details,{id})
|
|
|
+ if(res.code == 200) {
|
|
|
let obj = {
|
|
|
...res.data,
|
|
|
- imgUrl: res.data.imgUrl ? res.data.imgUrl.split(',') : [],
|
|
|
+ eventTime: [res.data.startDate,res.data.endDate], // 发放时间段
|
|
|
+ image: res.data.image?res.data.image.split(','):[],
|
|
|
+ useUserRelid_3: [],
|
|
|
+ useUserRelid_2: []
|
|
|
}
|
|
|
- this.$set(this, 'form', JSON.parse(JSON.stringify(obj)))
|
|
|
+ this.$set(this,'form',JSON.parse(JSON.stringify(obj)))
|
|
|
this.formStatus = 1
|
|
|
- } else {
|
|
|
+ }else {
|
|
|
this.$message.error('获取详情失败!!!');
|
|
|
this.formStatus = 2
|
|
|
this.loading = false
|
|
@@ -228,62 +236,84 @@ export default {
|
|
|
}
|
|
|
this.loading = false
|
|
|
} catch (error) {
|
|
|
- console.error('获取详情失败!!!!', error)
|
|
|
+ console.error('获取详情失败!!!!',error)
|
|
|
this.formStatus = 2
|
|
|
this.loading = false
|
|
|
this.open = false;
|
|
|
}
|
|
|
},
|
|
|
+ /** 查询模板列表 */
|
|
|
+ async getJsonObjList() {
|
|
|
+ try {
|
|
|
+ let res = await listTableApi(this.configUrl.list,{
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 999
|
|
|
+ })
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.jsonObjList = res.data.rows;
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ this.loading = false
|
|
|
+ this.open = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
/**
|
|
|
* 保存
|
|
|
* @date 2023-11-22
|
|
|
* @returns {any}
|
|
|
*/
|
|
|
submitForm() {
|
|
|
- this.$refs["form"].validate((valid, object) => {
|
|
|
+ this.$refs["form"].validate((valid ,object)=> {
|
|
|
if (valid) {
|
|
|
this.loadingText = "提交数据中..."
|
|
|
this.loading = true
|
|
|
+ let param = JSON.parse(JSON.stringify(this.form))
|
|
|
+ param['startDate'] = param.eventTime[0]
|
|
|
+ param['endDate'] = param.eventTime[1]
|
|
|
+
|
|
|
+ delete param.eventTime
|
|
|
+ delete param.useUserRelid_2
|
|
|
+ delete param.useUserRelid_3
|
|
|
if (this.model != 'ADD') {
|
|
|
addTableApi(
|
|
|
- this.configUrl.edit, {
|
|
|
- ...this.form,
|
|
|
- imgUrl: this.form.imgUrl ? this.form.imgUrl.join(',') : '',
|
|
|
- }).then(response => {
|
|
|
+ this.configUrl.edit,{
|
|
|
+ ...param,
|
|
|
+ image: param.image ? param.image.join(','):'',
|
|
|
+ }).then(response => {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.loading = false
|
|
|
this.open = false;
|
|
|
this.$emit('refresh')
|
|
|
- }).catch(() => {
|
|
|
+ }).catch(()=>{
|
|
|
this.$message.error("修改失败!!!");
|
|
|
this.loading = false
|
|
|
})
|
|
|
} else {
|
|
|
- addTableApi(this.configUrl.edit, {
|
|
|
- ...this.form,
|
|
|
- imgUrl: this.form.imgUrl ? this.form.imgUrl.join(',') : '',
|
|
|
- }).then(response => {
|
|
|
+ addTableApi(this.configUrl.edit,{
|
|
|
+ ...param,
|
|
|
+ image: param.image ? param.image.join(','):'',
|
|
|
+ }).then(response => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
this.loading = false
|
|
|
this.open = false;
|
|
|
this.$emit('refresh')
|
|
|
- }).catch(() => {
|
|
|
+ }).catch(()=>{
|
|
|
this.$message.error("新增失败!!!");
|
|
|
this.loading = false
|
|
|
})
|
|
|
}
|
|
|
- } else {
|
|
|
- console.log("fsdfsd===", valid, object)
|
|
|
- if (object && JSON.stringify(object) != '{}') {
|
|
|
+ }else {
|
|
|
+ console.log("fsdfsd===",valid,object)
|
|
|
+ if(object&&JSON.stringify(object)!='{}') {
|
|
|
let srt = ''
|
|
|
- for (let key in object) {
|
|
|
- if (object.hasOwnProperty(key)) {
|
|
|
+ for(let key in object) {
|
|
|
+ if(object.hasOwnProperty(key)) {
|
|
|
srt = srt + `[${object[key][0].message}],`
|
|
|
}
|
|
|
}
|
|
|
this.$message.error(srt);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -293,7 +323,7 @@ export default {
|
|
|
* @returns {any}
|
|
|
*/
|
|
|
reset() {
|
|
|
- if (this.$refs["form"]) {
|
|
|
+ if(this.$refs["form"]) {
|
|
|
this.$refs["form"].clearValidate();
|
|
|
}
|
|
|
},
|
|
@@ -310,46 +340,18 @@ export default {
|
|
|
handleClick() {
|
|
|
|
|
|
},
|
|
|
-
|
|
|
- /** */
|
|
|
- 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');
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
/** 上传图片 单张 */
|
|
|
handleAvatarSuccess(response, file, fileList) {
|
|
|
- console.log("res, file", response, file, fileList)
|
|
|
+ console.log("res, file",response, file, fileList)
|
|
|
this.actionUrlLoading = false
|
|
|
- if (response.code == 200) {
|
|
|
- this.form.imgUrl.push(response.data.url)
|
|
|
+ if(response.code == 200) {
|
|
|
+ this.form.imag.push(response.data.url)
|
|
|
}
|
|
|
},
|
|
|
beforeAvatarUpload(file) {
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 1;
|
|
|
- let testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
|
|
|
- let typeList = ['png', 'jepg', 'jpg']
|
|
|
+ const isLt2M = file.size / 1024 / 1024 <= 1;
|
|
|
+ let testmsg = file.name.substring(file.name.lastIndexOf('.')+1)
|
|
|
+ let typeList = ['png','jepg','jpg']
|
|
|
const isJPG = typeList.includes(testmsg);
|
|
|
if (!isJPG) {
|
|
|
this.$message.error(`上传图片图片只能是 ${typeList} 格式!`);
|
|
@@ -359,14 +361,14 @@ export default {
|
|
|
}
|
|
|
return isJPG && isLt2M;
|
|
|
},
|
|
|
- handleAvatarProgress() {
|
|
|
+ handleAvatarProgress(){
|
|
|
this.actionUrlLoading = true
|
|
|
},
|
|
|
handleAvatarError() {
|
|
|
this.actionUrlLoading = false
|
|
|
},
|
|
|
handleRemove(index) {
|
|
|
- this.form.imgUrl.splice(index, 1)
|
|
|
+ this.form.imag.splice(index,1)
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -379,18 +381,15 @@ export default {
|
|
|
min-height: 50vh;
|
|
|
max-height: 65vh;
|
|
|
overflow-y: auto;
|
|
|
-
|
|
|
>div {
|
|
|
width: 100%;
|
|
|
min-height: 50vh;
|
|
|
}
|
|
|
-
|
|
|
.form-title {
|
|
|
padding: 0 0 10px 0;
|
|
|
-
|
|
|
span {
|
|
|
display: flex;
|
|
|
- color: rgba(65, 80, 88, 1);
|
|
|
+ color: rgba(65,80,88,1);
|
|
|
font-size: 16px;
|
|
|
font-family: SourceHanSansSC;
|
|
|
font-weight: 700;
|
|
@@ -398,53 +397,44 @@ export default {
|
|
|
border-left: 4px solid rgb(22, 132, 252);
|
|
|
padding-left: 10px;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
::v-deep .ql-editor {
|
|
|
height: 400px;
|
|
|
}
|
|
|
-
|
|
|
.upload-btn {
|
|
|
width: 100px;
|
|
|
height: 100px;
|
|
|
background-color: #fbfdff;
|
|
|
border: dashed 1px #c0ccda;
|
|
|
border-radius: 5px;
|
|
|
-
|
|
|
i {
|
|
|
font-size: 30px;
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
-
|
|
|
&-text {
|
|
|
margin-top: -10px;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
.avatar {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-.el-table {
|
|
|
+.el-table{
|
|
|
.upload-btn {
|
|
|
width: 100px;
|
|
|
height: 100px;
|
|
|
background-color: #fbfdff;
|
|
|
border: dashed 1px #c0ccda;
|
|
|
border-radius: 5px;
|
|
|
-
|
|
|
i {
|
|
|
font-size: 30px;
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
-
|
|
|
&-text {
|
|
|
margin-top: -10px;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
.avatar {
|
|
|
cursor: pointer;
|
|
|
}
|
|
@@ -456,19 +446,15 @@ export default {
|
|
|
|
|
|
::v-deep .area-wrap-city.el-cascader {
|
|
|
line-height: normal;
|
|
|
-
|
|
|
.el-input {
|
|
|
cursor: pointer;
|
|
|
width: 100% !important;
|
|
|
height: 28px !important;
|
|
|
-
|
|
|
.el-input__inner {
|
|
|
display: none !important;
|
|
|
}
|
|
|
-
|
|
|
span.el-input__suffix {
|
|
|
position: inherit !important;
|
|
|
-
|
|
|
i.el-input__icon {
|
|
|
line-height: inherit;
|
|
|
margin-left: 5px;
|
|
@@ -477,7 +463,6 @@ export default {
|
|
|
|
|
|
.el-input__wrapper {
|
|
|
box-shadow: none;
|
|
|
-
|
|
|
input {
|
|
|
display: none;
|
|
|
}
|
|
@@ -500,31 +485,28 @@ export default {
|
|
|
}
|
|
|
|
|
|
::v-deep .avatar-uploader .el-upload {
|
|
|
- border: 1px dashed #d9d9d9;
|
|
|
- border-radius: 6px;
|
|
|
- cursor: pointer;
|
|
|
- position: relative;
|
|
|
- overflow: hidden;
|
|
|
-}
|
|
|
-
|
|
|
-::v-deep .avatar-uploader .el-upload:hover {
|
|
|
- border-color: #409EFF;
|
|
|
-}
|
|
|
-
|
|
|
-::v-deep .avatar-uploader-icon {
|
|
|
- font-size: 28px;
|
|
|
- color: #8c939d;
|
|
|
- width: 100px;
|
|
|
- height: 100px;
|
|
|
- line-height: 100px;
|
|
|
- text-align: center;
|
|
|
-}
|
|
|
-
|
|
|
-::v-deep .avatar {
|
|
|
- width: 100px;
|
|
|
- height: 100px;
|
|
|
- display: block;
|
|
|
-}
|
|
|
+ border: 1px dashed #d9d9d9;
|
|
|
+ border-radius: 6px;
|
|
|
+ cursor: pointer;
|
|
|
+ position: relative;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ ::v-deep .avatar-uploader .el-upload:hover {
|
|
|
+ border-color: #409EFF;
|
|
|
+ }
|
|
|
+ ::v-deep .avatar-uploader-icon {
|
|
|
+ font-size: 28px;
|
|
|
+ color: #8c939d;
|
|
|
+ width: 100px;
|
|
|
+ height: 100px;
|
|
|
+ line-height: 100px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ ::v-deep .avatar {
|
|
|
+ width: 100px;
|
|
|
+ height: 100px;
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
</style>
|
|
|
<style>
|
|
|
.custom-class-box {
|