Commit 990b47e8 by 杨明

fixed

1 parent e54783c7
......@@ -15,6 +15,11 @@
"js-message": "1.0.7"
}
},
"@amap/amap-jsapi-loader": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz",
"integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw=="
},
"@ampproject/remapping": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz",
......@@ -1839,75 +1844,6 @@
"webpack-chain": "^6.4.0",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^4.2.2"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
}
}
},
"@vue/cli-shared-utils": {
......@@ -6347,14 +6283,16 @@
}
},
"glsx-components": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/glsx-components/-/glsx-components-1.5.2.tgz",
"integrity": "sha512-5/LaPu0B1uT7Kzl6oyIqyFT/NXIz2w7HNstiRtHaUQN1waSrPPPtzRRwywJg6CSSL+p994NaqPRnX696NAYzKg==",
"version": "1.5.7",
"resolved": "https://registry.npmjs.org/glsx-components/-/glsx-components-1.5.7.tgz",
"integrity": "sha512-WEWt1Ev7uf8VgILrEr15ZHxOreqWEVEY2WRP5EmZKzYKTVF/7dQU/oI84+Xo4vSmlz7ltblaATyrwm1U1LDnHg==",
"requires": {
"@amap/amap-jsapi-loader": "^1.0.1",
"core-js": "^3.6.5",
"element-ui": "^2.15.6",
"glsx-common": "^1.4.9",
"vue": "^2.6.11",
"vue-amap": "^0.5.10",
"vuedraggable": "^2.24.3"
}
},
......@@ -12433,6 +12371,21 @@
"integrity": "sha512-WRbjgmYzgXkCV7zNVpy5YgrHgbBv126rMALQQMrmzOVC4GM2waQ9x7xtm8VU+1yF2kWyPzI9zbZ48n4vSxwfSA==",
"dev": true
},
"uppercamelcase": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/uppercamelcase/-/uppercamelcase-1.1.0.tgz",
"integrity": "sha512-C7YEMvhgrvTEKEEVqA7LXNID/1TvvIwYZqNIKLquS6y/MGSkRQAav9LnTTILlC1RqUM8eTVBOe1U/fnB652PRA==",
"requires": {
"camelcase": "^1.2.1"
},
"dependencies": {
"camelcase": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
"integrity": "sha512-wzLkDa4K/mzI1OSITC+DUyjgIl/ETNHE9QvYgy6J6Jvqyyz4C0Xfd+lQhb19sX2jMpZV4IssUn0VDVmglV+s4g=="
}
}
},
"uri-js": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
......@@ -12622,6 +12575,14 @@
"csstype": "^3.1.0"
}
},
"vue-amap": {
"version": "0.5.10",
"resolved": "https://registry.npmjs.org/vue-amap/-/vue-amap-0.5.10.tgz",
"integrity": "sha512-9ViNCev1vx32+zZ5RvF/TmUZNbwL9QrdA2/OnD2GlXMfQBkJy7D08Vb7379t6guqnopDPtWJ8K6gg72h9+4GUg==",
"requires": {
"uppercamelcase": "^1.1.0"
}
},
"vue-cli-plugin-element": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/vue-cli-plugin-element/-/vue-cli-plugin-element-1.0.1.tgz",
......@@ -12708,6 +12669,75 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": {
"version": "3.5.4",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.4.tgz",
......
......@@ -14,7 +14,7 @@
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.5.2",
"glsx-components": "^1.5.7",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuex": "^3.1.2",
......
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-10 16:49:31
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2023-05-12 11:03:04
* @FilePath: \outbound\src\api\modules\calendar.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { http } from '@/main'
const url = '/rop-scrm-marketing/router'
const calendarList = params => {
params.method = 'marketing.api.calendar.page'
return http({
url,
method: 'GET',
data: params,
sign: true
})
}
const calendarDetail = params => {
params.method = 'marketing.api.calendar.detail'
return http({
url,
method: 'GET',
data: params,
sign: true
})
}
const calendarUpdate = params => {
params.method = 'marketing.api.calendar.update'
return http({
url,
method: 'GET',
data: params,
sign: true
})
}
const getEquityListApi = params => {
params.method = 'scrm.api.coupon.equity.list.merchant'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
const brandList = params => {
params.method = 'scrm.api.equity.goods.brand.list.all'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const couponTemplate = params => {
params.method = 'scrm.api.coupon.template.page'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
const couponTemplateDetails = params => {
params.method = 'scrm.api.coupon.template.details.page'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { calendarList, calendarDetail, calendarUpdate, getEquityListApi, brandList, couponTemplate, couponTemplateDetails }
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-10 16:40:01
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-22 16:25:00
* @FilePath: \outbound\src\components\glsx-combi-form\common.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/**
* 时间控件-限制月份
*/
......@@ -22,3 +30,20 @@ export const rangetimePickerOptions = {
return false
}
}
export const beforeRangePickerOptions = {
disabledDate(date) {
if (date > new Date()) {
return true
}
return false
}
}
export const afterRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
if (date < yesterday) {
return true
}
return false
}
}
<!-- 搜索 -->
<template>
<div class="glsx-combi-form gl-form-page gl-form-min">
<el-form :ref="formRef" :inline="inline" :model="formObj" :label-width="labelWidth" :rules="formRules" size="mini" class="glsx-combi-form-block">
<div :class="['glsx-combi-form', isEdit ? 'gl-form-page' : '']">
<el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :class="{ 'no-label': !item.label, tips: item.tips }" :label="item.label ? item.label + ':' : ''" :prop="item.name">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '154px' : labelWidth" :class="[{ 'no-label': !item.label, isBlock: isBlock }, { textBox: item.type == 'textBox' }]" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span>
<el-popover placement="top" :width="item.tipsWidth || 200" trigger="hover">
<div>
{{ item.tips }}
<span class="tips-jump" v-if="item.jumpLabel" @click="item.handleJump">{{ item.jumpLabel }}</span>
</div>
<img slot="reference" class="tips-icon" src="./images/icon-tip.png" />
</el-popover>
:
</span>
<span v-else-if="!item.isHide && item.label && !item.tips" slot="label">
<span class="combi-form-label" :style="{ width: item.labelWidth || labelWidth }">{{ item.label }}:</span>
</span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<el-input v-else-if="item.type === 'input'" :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" @keydown.native="e => handleInputDown(e, item)"></el-input>
<!-- 选择-输入框 -->
<el-input v-else-if="item.type === 'selectInput'" :placeholder="'请输入' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label" v-model.trim="searchSelectObj[item.selectName].value" :clearable="item.isClear || false" class="input-with-select">
<el-select v-model="searchSelectObj[item.selectName].attr" style="width: 130px" slot="prepend" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
</el-input>
<!-- 选择-时间选择框 -->
<template v-else-if="item.type === 'selectDatePicker'">
<el-select v-model="searchSelectObj[item.selectName].attr" style="width: 130px" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
<el-date-picker v-model="searchSelectObj[item.selectName].value" style="width: calc(100% - 130px)" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]"></el-date-picker>
</template>
<!-- 选择-时间选择框 -->
<template v-else-if="item.type === 'selectTimePicker'">
<el-time-picker is-range v-model="formObj[item.name]" :value-format="item.format || ''" :style="{ width: item.width || defaultWidth }" :picker-options="item.pickerOptions || ''" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
</template>
<!-- 双选择框 -->
<template v-else-if="item.type === 'selectDouble'">
<el-select v-model="searchSelectObj[item.selectName].attr" style="width: 130px" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
<el-select v-model="searchSelectObj[item.selectName].value" style="width: calc(100% - 130px)" :placeholder="'请选择' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label">
<el-option label="全部" value=""></el-option>
<el-option v-for="subItem in item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]"></el-option>
</el-select>
</template>
<span v-else-if="item.type === 'showTxt'">{{ formObj[item.name] }}</span>
<div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :prefix-icon="item.prefixIcon" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="suffix">{{ item.append }}</span>
</el-input>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- 选择框 -->
<el-select v-else-if="item.type === 'select'" :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="'请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.optionList" :key="item.optionId ? subItem[item.optionId] : subItem" :label="item.optionLabel ? subItem[item.optionLabel] : subItem" :value="item.optionId ? subItem[item.optionId] : subItem" :disabled="subItem.isDisabled || false"></el-option>
</el-select>
<!-- 计数器 -->
<template v-else-if="item.type === 'inputNumber'"></template>
<div v-else-if="item.type === 'select'">
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option>
</el-select>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- radio -->
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]" :disabled="subItem.isDisabled || false">{{ subItem[item.optionLabel] }}</el-radio>
</el-radio-group>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]"></el-date-picker>
<div v-else-if="item.type === 'radio'">
<el-radio-group v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled" :label="subItem[item.optionId]">
{{ subItem[item.optionLabel] }}
<slot :name="subItem.suffixSonSlot" :scope="subItem"></slot>
</el-radio>
</el-radio-group>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :type="item.dateType || 'daterange'" :disabled="item.isDisabled" :value-format="item.valueFormat" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]"></el-date-picker>
<template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p>
<slot :name="item.prefixSlot" :scope="item"></slot>
<div v-if="!item.isDisabled" :style="{ width: item.width || defaultWidth }">
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<div class="add" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('addStyle') ? item.uploadStyle.addStyle : ''">+</div>
<!-- <span v-if="item.maxPhotoNum > 1" class="number">{{ formObj[item.name].length }}/{{ item.maxPhotoNum }}</span> -->
<span class="number" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('fontSize') ? item.uploadStyle.fontSize : ''">上传{{ item.uploadType == 'video' ? '视频' : '图片' }}</span>
<input v-if="item.uploadType == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" accept="video/mp4" @change="e => handleUploadChange(e, item)" />
<input v-else type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" />
</div>
</div>
<template>
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length : formObj[item.name]">
<span v-if="Array.isArray(formObj[item.name])">
<span v-for="(subItem, subIndex) in formObj[item.name]" :key="subIndex" class="muti-imgs img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="typeof subItem == 'object' ? subItem.content : subItem"></video>
<img v-else class="img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="typeof subItem == 'object' ? subItem.content : subItem" />
<span class="img-btns" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<span class="btn-item">
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item, subIndex)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(typeof subItem == 'object' ? subItem.content : subItem, item)"></i>
</span>
</span>
</span>
</span>
<span v-else class="muti-imgs">
<video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="formObj[item.name]"></video>
<img v-else class="img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="formObj[item.name]" />
<span class="img-btns" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<span class="btn-item">
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(formObj[item.name], item)"></i>
</span>
</span>
</span>
</div>
</template>
<slot :name="item.suffixSlot" :scope="item"></slot>
</template>
</el-form-item>
</template>
<slot></slot>
<slot name="footer"></slot>
</el-form>
</div>
</template>
<script>
import { rangePickerOptions, rangetimePickerOptions } from './common'
import { beforeRangePickerOptions, afterRangePickerOptions } from './common'
export default {
name: 'glsx-combi-form',
data() {
return {
pickerOption: {
rangePickerOptions: rangePickerOptions,
rangetimePickerOptions: rangetimePickerOptions
beforeRangePickerOptions: beforeRangePickerOptions,
afterRangePickerOptions: afterRangePickerOptions
},
subdistrict: 2,
dialogMapVisible: false,
targetItem: {},
isImgVisible: false,
dialogObj: {
url: '',
uploadType: 'img'
}
}
},
props: {
formRef: {
type: String,
default: 'formRef'
isBlock: {
type: Boolean,
default: false
},
defaultWidth: {
type: String,
default: '432px'
},
formRef: {
type: String,
default: 'formRef'
},
isEdit: {
type: Boolean,
default: false
},
labelWidth: {
type: String,
// 默认是四个字符长度
default: '154px'
},
formData: {
......@@ -98,15 +153,9 @@ export default {
searchSelectObj: {
type: Object,
default: () => {}
},
inline: {
type: Boolean,
default: true
}
},
mounted() {},
methods: {
// 选择框-添加其他属性
selectAddAttr(value, targetItem) {
......@@ -116,15 +165,197 @@ export default {
if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) {
item.keyFn()
}
},
handleInputBlur(e, item) {
item.inputBlur && item.inputBlur(e, item)
},
// 图片
handleUploadChange(e, targetItem) {
var reader = new FileReader()
var file = e.srcElement.files[0]
var uploadType = targetItem.uploadType || 'img',
IMGTYPE = ['image/jpeg', 'image/png', 'image/jpg']
if (targetItem.supportGif) IMGTYPE.push('image/gif')
// 默认1MB
const limitSize = targetItem.limitSize || 1
const isLt = file.size / 1024 / 1024 < limitSize
const isType = uploadType == 'img' ? IMGTYPE.includes(file.type) : ['video/mp4'].includes(file.type)
const maxPhotoNum = targetItem.maxPhotoNum || 1
const wdithLt = targetItem.wdithLt || 300
const heightLt = targetItem.heightLt || 300
if (Array.isArray(this.formObj[targetItem.name]) && maxPhotoNum == this.formObj[targetItem.name].length) {
this.$message.error('只能上传' + maxPhotoNum + (uploadType == 'img' ? '张图片' : '个视频'))
document.getElementById(targetItem.name + 'file').value = ''
return true
}
if (!isType) {
this.$message.error(uploadType == 'img' ? '上传图片不是jpg、jpeg或png的格式!' : '上传视频不是MP4的格式!')
document.getElementById(targetItem.name + 'file').value = ''
return true
}
if (!isLt) {
this.$message.error('上传' + (uploadType == 'img' ? '图片' : '视频') + '大小不能超过' + limitSize + 'MB!')
document.getElementById(targetItem.name + 'file').value = ''
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
if (uploadType == 'img') {
var image = new Image()
image.src = e.target.result
image.onload = () => {
var imgWidth = image.width
var imgHeight = image.height
if (targetItem.hasPixel && (imgWidth > wdithLt || imgHeight > heightLt)) {
this.$message.error('图片尺寸最大为' + wdithLt + '像素*' + heightLt + '像素')
} else {
targetItem.handleUpload(e, file, targetItem, this.formObj)
}
}
} else {
targetItem.handleUpload(e, file, targetItem, this.formObj)
}
}
document.getElementById(targetItem.name + 'file').value = ''
},
// 图片删除
handleImgDelete(targetItem, subIndex = -1) {
Array.isArray(this.formObj[targetItem.name]) ? this.formObj[targetItem.name].splice(subIndex, 1) : (this.formObj[targetItem.name] = '')
targetItem.handleDelete && targetItem.handleDelete(subIndex)
// this.$emit('handleImgDelete', targetItem)
},
// 图片查看
handleImgLook(src, targetItem) {
this.isImgVisible = true
this.dialogObj = {
url: src,
uploadType: targetItem.uploadType || 'img'
}
},
// 获取富文本框内容
handleTextBoxChange(val, targetItem) {
this.formObj[targetItem.name] = val
},
handleTextBoxFocus(targetItem) {
this.$refs[targetItem.name + 'TextBox'][0].setEdit(this.formObj[targetItem.name])
},
// 禁用富文本
forbidEdit() {
setTimeout(() => {
this.$refs.textBox.forbidEdit()
}, 2000)
},
// 地图
handleSelectMap(targetItem) {
this.targetItem = targetItem
this.dialogMapVisible = true
this.$nextTick(() => {
if (this.formObj[targetItem.attrObj.fullAddress] && !this.$refs.mapForm.address) {
this.$refs.mapForm.address = this.formObj[targetItem.attrObj.fullAddress]
this.$refs.mapForm.lnglat = this.formObj[targetItem.attrObj.lng] ? [this.formObj[targetItem.attrObj.lng], this.formObj[targetItem.attrObj.lat]] : []
// this.$refs.mapForm.addMarker([this.formObj[targetItem.attrObj.lng], this.formObj[targetItem.attrObj.lat]])
}
})
},
getAddress() {
let mapInfo = this.$refs.mapForm
if (!mapInfo.address) {
this.$message({
message: '请选择地址',
type: 'error',
customClass: 'message-Z-zinde'
})
return
}
this.formObj[this.targetItem.attrObj.fullAddress] = mapInfo.address
this.formObj[this.targetItem.attrObj.lat] = mapInfo.lnglat[1]
this.formObj[this.targetItem.attrObj.lng] = mapInfo.lnglat[0]
// var fullAddress = mapInfo.geocoderAddress.addressComponent || this.formObj[this.targetItem.attrObj.fullAddress]
var fullAddress = mapInfo.geocoderAddress.addressComponent
// if (!fullAddress) {
// this.dialogMapVisible = false
// return
// }
var provincecode = mapInfo.geocoderAddress.adcode || this.formObj[this.targetItem.attrObj.provinceCode]
this.formObj[this.targetItem.attrObj.provinceCode] = provincecode
// 获取省市
var province = ''
var city = ''
province = fullAddress.province
city = fullAddress.city ? fullAddress.city : fullAddress.district
const municipalities = ['北京市', '天津市', '上海市', '重庆市']
var municipality = municipalities.find(item => item == province)
if (municipality) {
city = city.slice(0, 2) + '城区'
if (municipality === '重庆市') {
provincecode = provincecode.slice(0, 4)
provincecode == 5001 ? (city = city.slice(0, 2) + '城区') : (city = city.slice(0, 2) + '郊县')
}
}
// 判断省市是否匹配
if (this.formObj[this.targetItem.attrObj.provinceName]) {
if (this.formObj[this.targetItem.attrObj.provinceName] !== province && this.formObj[this.targetItem.attrObj.cityName] !== city) {
this.$message({
message: '您选择的地址错误,请重新选择',
type: 'error',
customClass: 'message-Z-zinde'
})
this.formObj[this.formObj[this.targetItem.attrObj.fullAddress]] = ''
return
}
}
this.dialogMapVisible = false
this.formObj[this.targetItem.attrObj.provinceName] = province
this.formObj[this.targetItem.attrObj.cityName] = city
// 当直接点击选择地址时,获取省市ID
this.$refs.provinceForm[0].init(province, city)
},
// 获取省
handleSelectProvince(val, targetItem) {
this.formObj[targetItem.attrObj.fullAddress] = ''
this.formObj[targetItem.attrObj.cityName] = ''
this.formObj[targetItem.attrObj.provinceName] = val.provinceName
this.formObj[targetItem.attrObj.provinceCode] = val.provinceCode
},
// 获取市
handleSelectCity(val, targetItem) {
if (val.cityName) {
this.formObj[targetItem.attrObj.cityName] = val.cityName
this.formObj[targetItem.attrObj.cityCode] = val.cityCode
} else {
this.formObj[targetItem.attrObj.cityName] = ''
this.formObj[targetItem.attrObj.cityCode] = ''
}
this.formObj[targetItem.attrObj.fullAddress] = ''
}
}
}
</script>
<style scoped lang="scss">
.glsx-combi-form .no-label.el-form-item--mini .el-form-item__content,
.el-form-item--mini .el-form-item__label {
<style>
/* .glsx-combi-form {
min-width: 922px;
} */
/* .glsx-combi-form .glsx-combi-form-block {
padding: 16px 40px 0;
} */
.glsx-combi-form .isBlock {
display: block !important;
}
/* .glsx-combi-form .el-form-item {
width: 65%;
} */
.glsx-combi-form .no-label.el-form-item--small .el-form-item__content {
width: 100%;
}
.glsx-combi-form .el-form-item--small.el-form-item {
margin: 0 30px 20px 0;
}
.glsx-combi-form .el-form-item--small .el-form-item__label {
padding: 0;
}
/* .glsx-combi-form .el-form-item--small .el-form-item__content {
width: calc(100% - 85px);
} */
.glsx-combi-form .el-col {
margin-bottom: 10px;
}
......@@ -134,7 +365,6 @@ export default {
.glsx-combi-form .item-height {
height: 37px;
}
.glsx-combi-form input::-webkit-outer-spin-button,
.glsx-combi-form input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
......@@ -142,28 +372,133 @@ export default {
.glsx-combi-form input[type='number'] {
-moz-appearance: textfield !important;
}
.glsx-combi-form .input-with-select .el-input-group__prepend {
background-color: #fff;
}
.glsx-combi-form .tips {
margin: 0;
/* 提示图标 */
/* .glsx-combi-form .tips-block {
position: relative;
} */
.glsx-combi-form .tips-label {
margin-right: 2px;
}
.glsx-combi-form /deep/ .el-input-number {
width: 85px !important;
.el-input {
width: 100% !important;
}
.el-input__inner {
height: 28px !important;
line-height: 28px !important;
// width:45px;
}
.el-input-number__decrease,
.el-input-number__increase {
background-color: #fff !important;
width: 20px !important;
}
.glsx-combi-form .tips-icon {
display: inline-block;
width: 14px;
height: 14px;
margin-right: 0px !important;
vertical-align: middle;
cursor: pointer;
}
.glsx-combi-form .combi-form-label {
/* display: inline-block; */
box-sizing: border-box;
}
/* 图片上传 */
.glsx-combi-form .photo-top-tips {
/* height: 36px; */
margin: 0 0;
color: #999999;
}
.glsx-combi-form .img-w-h {
width: 80px;
height: 80px;
}
.glsx-combi-form .activity-img {
position: relative;
color: #999999;
background-color: #f7f7f7;
border: 1px dotted #d9d9d9;
cursor: pointer;
margin-top: 10px;
}
.glsx-combi-form .activity-Input {
position: absolute;
top: 0;
left: 0;
}
.glsx-combi-form .muti-imgs {
display: inline-block;
position: relative;
margin: 10px 8px 0 0;
}
.activity-img .add {
position: absolute;
top: 40%;
font-size: 40px;
left: 50%;
transform: translate3d(-50%, -50%, 0);
}
.activity-img .number {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
font-size: 14px;
width: 100%;
text-align: center;
}
.muti-imgs .img-btns {
display: none;
height: 100%;
position: absolute;
width: 80px;
height: 80px;
left: 0;
top: 0;
z-index: 2;
color: #fff;
background: rgba(0, 0, 0, 0.5);
}
.glsx-combi-form .el-icon-delete,
.glsx-combi-form .el-icon-zoom-in {
cursor: pointer;
}
.muti-imgs .img-btns .btn-item {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.muti-imgs .img-btns .btn-item {
display: flex;
width: 70%;
justify-content: space-around;
}
.muti-imgs:hover .img-btns {
display: block;
}
.glsx-combi-form .dialog-img {
width: 100%;
height: 100%;
}
.glsx-combi-form .dialog-look {
text-align: center;
}
.glsx-combi-form .dialog-video {
width: 50%;
height: 50%;
}
/* 图片上传 */
.glsx-combi-form .el-tag.el-tag--info .el-tag__close {
color: #e8e8ea;
background-color: #5850ff !important;
}
.glsx-combi-form .el-tag.el-tag--info {
border-color: #5850ff;
}
.glsx-combi-form .el-tag--plain.el-tag--info .el-tag__close:hover {
background-color: #e8e8ea;
}
.glsx-combi-form .el-tag.el-tag--info .el-tag__close:hover {
background-color: #e8e8ea;
}
.textBox .el-form-item__content {
width: 62%;
/* background: #096; */
}
.tips-jump {
color: #5850ff;
cursor: pointer;
}
</style>
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-10 16:40:01
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-22 15:05:09
* @FilePath: \outbound\src\setup\qiankun.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import Vue from 'vue'
import { message, messageBox } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
......@@ -20,7 +28,7 @@ export async function bootstrap({ history, common, messenger, globalState }) {
Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
const routesData = common.utils.deepClone(globalState.routers)
......
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-10 17:17:31
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-22 16:16:01
* @FilePath: \outbound\src\views\calendar\add.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div>
<div class="main-box">
<glsx-combi-form class="edit-form-container" :isBlock="true" ref="editFormRef" formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="activityTimeHtml">
<div class="activity-time-container" :style="{ 'margin-left': defaultLabelWidth }">
<el-date-picker v-model="editForm.activityTime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy/MM/dd"></el-date-picker>
</div>
</template>
<div slot="selectGoodsBtn">
<div class="play-panel">
<div class="card-panel">
<el-tabs type="card" v-model="editForm.couponTemplateId" @tab-click="changeCouponTemplate">
<el-tab-pane :label="item.name" :name="item.id" v-for="item in couponTemplateList" :key="item.id"></el-tab-pane>
</el-tabs>
<div class="chose-panel" v-loading="goodsLoading">
<el-button type="default" size="small" class="el-icon-plus select-btn" @click="handleGoodsAdd">选择福利券</el-button>
<div style="width: 772px" v-if="selectedGoodsList && selectedGoodsList.length">
<div class="goods-panel">
<el-table :data="selectedGoodsList" border style="width: 100%">
<el-table-column type="index" label="序号" width="70"></el-table-column>
<el-table-column prop="brandName" label="品牌" width="130"></el-table-column>
<el-table-column prop="goodsName" label="商户名称" width="150"></el-table-column>
<el-table-column prop="couponAmount" label="数量" width="70"></el-table-column>
<el-table-column prop="denomination" label="劵面额" width="90">
<template slot-scope="scope">{{ (scope.row.denomination / 100).toFixed(2) }}元</template>
</el-table-column>
<el-table-column prop="effectiveDays" label="有效期" width="80">
<template slot-scope="scope">{{ scope.row.effectiveDays }}天</template>
</el-table-column>
<el-table-column prop="status" label="状态" width="80">
<template slot-scope="scope">{{ scope.row.status == 1 ? '未生效' : scope.row.status == 2 ? '生效中' : scope.row.status == 3 ? '已失效' : '' }}</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button @click="handleDeleteGoods(scope.row)" type="text" size="small">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>
</div>
</div>
</glsx-combi-form>
<div class="preview-panel">
<PhoneView :editForm="editForm"></PhoneView>
</div>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSave">提交</el-button>
</GLFooter>
<select-goods-dialog v-if="isSelectGoodsVisible" :isSelectGoodsVisible="isSelectGoodsVisible" :selectedGoodsLists="selectedGoodsList" @handleGoodsConfirm="handleGoodsConfirm" @handleGoodsClose="handleGoodsClose"></select-goods-dialog>
</div>
</template>
<script>
import selectGoodsDialog from './components/SelectGoodsDialog'
import PhoneView from './components/PhoneView'
export default {
name: 'addCalendar',
data() {
return {
isSelectGoodsVisible: false,
goodsLoading: false,
editForm: {},
couponTemplateList: [],
selectedGoodsList: [],
editFormData: [
{
label: '营销标题',
name: 'title',
type: 'input',
maxlength: 12
},
{
label: '营销副标题',
name: 'subTitle',
type: 'input',
maxlength: 20
},
{
label: '活动时间',
name: 'activityTime',
addHtml: 'activityTimeHtml',
isHide: false
},
{
label: '关键字',
name: 'sharedWords',
type: 'input',
maxlength: 20
},
{
label: '场景选择',
name: 'marketingType',
type: 'radio',
optionList: [
{
optionId: 1,
optionLabel: '道路救援'
},
{
optionId: 2,
optionLabel: '定保招揽'
},
{
optionId: 5,
optionLabel: '续保招揽'
},
{
optionId: 6,
optionLabel: '节假日关怀'
}
],
optionId: 'optionId',
optionLabel: 'optionLabel'
},
{
label: '平台福利',
name: 'goodsList',
addHtml: 'selectGoodsBtn',
tips: '平台提供了种类丰富的权益商品,可进一步提升产品套餐的受众,强烈推荐!'
},
{
label: '销售价格/元',
name: 'platformBenefits',
type: 'input',
maxlength: 20,
isDisabled: true
}
],
editRule: {
title: [{ required: true, message: '请输入活动名称', trigger: 'input' }],
goodsList: [{ required: true, message: '请选择平台福利', trigger: 'change' }]
}
}
},
components: {
selectGoodsDialog,
PhoneView
},
mounted() {
this.couponTemplate()
const { id } = this.$route.query
this.calendarDetail(id)
},
watch: {
//金额根据已选择状态为“生效中”福利券:sum(券面额*数量计算)
selectedGoodsList(val) {
this.editForm.goodsList = val.length ? 1 : null
const platformBenefits = val.reduce((prev, cur) => {
console.log(prev, cur.denomination * cur.couponAmount)
if (cur.status == 2) prev = prev + cur.denomination * cur.couponAmount
return prev
}, 0)
this.editForm.platformBenefits = (platformBenefits / 100).toFixed(2)
}
},
methods: {
calendarDetail(id) {
this.$apis.calendar.calendarDetail({ id }).then(res => {
this.editForm = this.$common.utils.deepClone(res) || {}
if (res.startTime) {
this.$set(this.editForm, 'activityTime', [res.startTime, res.endTime])
}
this.selectedGoodsList = this.editForm.couponItemList
})
},
handleCancel() {
this.$router.push('/calendar/index')
},
handleSave() {
this.$refs.editFormRef.$refs.editChildRef.validate(valid => {
if (valid) {
this.addOrUpdate()
}
})
},
getCouponInfoParams() {
var param = this.$common.utils.deepClone(this.editForm)
const d = param.activityTime
if (d && d.length > 0) {
param.startTime = d[0]
param.endTime = d[1]
}
param.platformBenefits = (param.platformBenefits * 100).toFixed(0) //存的分,需乘100
param.couponItemList = this.selectedGoodsList.map(item => {
return {
couponId: item.id,
couponAmount: item.couponAmount
}
})
delete param.goodsList
delete param.couponTemplateName
delete param.couponTemplateId
delete param.activityTime
delete param.status
delete param.platformBenefits
return param
},
addOrUpdate() {
this.loading = true
var params = this.getCouponInfoParams()
this.$apis.calendar
.calendarUpdate(params)
.then(res => {
if (res) {
this.$message.success('操作成功')
this.handleCancel()
}
})
.finally(() => {
this.loading = false
})
},
//选择商品优惠券
handleGoodsAdd() {
this.handleGoodsClose()
},
handleGoodsClose() {
this.isSelectGoodsVisible = !this.isSelectGoodsVisible
},
handleGoodsConfirm(selectedData) {
this.$refs.editFormRef.$refs.editChildRef.clearValidate('goodsList')
this.selectedGoodsList = selectedData || []
// this.setNameHide('goodsListBlock')
this.handleGoodsClose()
},
handleDeleteGoods(row) {
const index = this.selectedGoodsList.findIndex(k => k.id == row.id)
this.selectedGoodsList.splice(index, 1)
// this.setNameHide('goodsListBlock')
},
//获取优惠券模板
couponTemplate() {
this.$apis.calendar.couponTemplate({ pageSize: 10000, pageNum: 1 }).then(res => {
this.couponTemplateList = res.list || []
})
},
changeCouponTemplate(tab, event) {
// this.$refs.editFormRef.$refs[this.editChildRef].clearValidate('goodsList')
const templateId = tab.name
this.editForm.couponTemplateId = templateId
this.editForm.couponTemplateName = tab.label
this.couponTemplateDetails(templateId)
},
//获取优惠券模板详情
couponTemplateDetails(templateId) {
this.goodsLoading = true
this.$apis.calendar.couponTemplateDetails({ templateId, pageSize: 10000, pageNum: 1 }).then(res => {
this.selectedGoodsList = res.list || []
this.selectedGoodsList.forEach(item => (item.id = item.couponId))
this.goodsLoading = false
})
}
}
}
</script>
<style lang="scss">
.main-box {
background: #fff;
padding: 20px;
min-height: calc(100vh - 180px);
display: flex;
margin-bottom: 16px;
.el-form-item__content {
width: auto;
}
.preview-panel {
width: 400px;
margin-left: auto;
.preview-bg {
width: 280px;
height: 556px;
}
}
.play-panel {
.card-panel {
width: 710px;
.el-tabs__nav {
border: none;
}
.el-tabs__header {
margin: 0;
}
.el-tabs__item {
background: #fafafa;
border: 1px solid #e5e5e5;
border-radius: 4px 4px 0 0;
border-right: 1px solid #e5e5e5;
border-top: 1px solid #e5e5e5;
border-left: 1px solid #e5e5e5 !important;
border-bottom: none;
margin-right: 1px;
width: auto;
&.is-active {
color: #5850ff;
background: #fff;
font-weight: 600;
}
}
}
.choseRow {
display: flex;
height: auto;
.choseItem {
display: inline-block;
cursor: pointer;
line-height: 40px;
height: 40px;
background: #fafafa;
border-radius: 4px 4px 0 0;
border: 1px solid #e5e5e5;
border-bottom: none;
margin-right: 1px;
padding: 0 20px;
&.active {
color: #5850ff;
background: #fff;
font-weight: 600;
}
}
}
.chose-panel {
.select-btn {
margin-bottom: 10px;
}
.waiting-box {
width: 278px;
height: 278px;
margin: 15px auto 0;
}
padding: 20px;
width: 784px;
min-height: 296px;
background: #ffffff;
border: 1px solid #e5e5e5;
border-radius: 0 4px 4px 4px;
}
}
.activity-time-container {
width: 400px;
}
}
</style>
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-15 15:08:32
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-22 16:23:56
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\MarketingRight.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="review-body">
<img src="@/assets/phone.png" class="review-phone" />
<div class="review-title_top">{{ detail.title }}</div>
<div class="review-content">
<div class="review-main">
<div class="review-bg-img">
<img :src="detail.backgroundImg" v-if="detail.backgroundImg" />
</div>
</div>
<div class="review-package">
<div class="review-goods" v-if="detail.couponItemList && detail.couponItemList.length">
<div class="goods-item" v-for="(item, index) in detail.couponItemList" :key="index">
<div class="service-logo"></div>
<div class="service-desc">
<div class="title">{{ item.brandName }}{{ item.goodsName }}</div>
<div class="content">x{{ item.couponAmount }} 抵扣券</div>
</div>
<div class="service-price">
{{ (item.denomination / 100).toFixed(2) }}
<span>元</span>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
detail: {},
discount: {
2: '折扣券',
3: '代金券',
4: '兑换券',
7: '服务券'
}
}
},
props: {
editForm: {
type: Object,
default: () => {}
}
},
watch: {
editForm: {
handler(val) {
console.log(val)
this.detail = val
},
deep: true,
immediate: true
}
}
}
</script>
<style lang="scss" scoped>
.review-body {
margin: 10px auto;
width: 305px;
height: 645px;
position: relative;
.review-phone {
width: 100%;
}
.review-title_top {
position: absolute;
top: 38px;
left: 0px;
width: 100%;
text-align: center;
line-height: 40px;
}
.review-footer {
position: absolute;
bottom: 52px;
left: 109px;
color: #f13c3d;
font-size: 22px;
label {
font-size: 12px;
}
}
.review-content {
position: absolute;
width: calc(100% - 20px);
height: 504px;
overflow-y: auto;
top: 77px;
left: 13px;
.review-main {
position: relative;
img {
width: 275px;
}
}
.review-package {
background: #ddd8c0;
padding: 16px;
.review-equity,
.review-service,
.review-goods {
background: #ffffff;
border-radius: 12px;
padding: 10px;
margin-bottom: 10px;
}
.service-item {
height: 48px;
background-image: linear-gradient(117deg, #ffead3 3%, #f0ca90 92%);
border-radius: 4px;
display: flex;
align-items: center;
padding: 4px;
margin-top: 5px;
&:first-child {
margin-top: 0px;
}
.service-title {
width: 74%;
height: 40px;
background: #ffffff;
border-radius: 6px;
font-size: 14px;
color: #333333;
line-height: 40px;
padding-left: 12px;
}
.service-time {
color: #8e5310;
text-align: center;
flex: 1;
font-size: 12px;
line-height: 48px;
}
}
.coupon-item {
height: 48px;
background: #fff5f3;
border-radius: 4px;
display: flex;
align-items: center;
padding: 4px;
margin-top: 5px;
&:first-child {
margin-top: 0px;
}
.service-title {
width: 64%;
height: 40px;
background: #ffffff;
border-radius: 6px;
font-size: 14px;
color: #333333;
line-height: 40px;
padding: 0px 12px;
display: flex;
justify-content: space-between;
span {
font-size: 14px;
color: #333333;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
&:last-child {
font-size: 11px;
color: #9b9b9b;
}
}
}
.service-time {
color: #fc5b32;
text-align: center;
flex: 1;
font-size: 12px;
line-height: 48px;
}
}
.goods-item {
display: flex;
border-bottom: 1px solid #f8f7f2;
padding: 5px;
&:last-child {
border-bottom: none;
}
.service-logo {
width: 32px;
height: 32px;
margin-right: 10px;
}
.service-desc {
width: 55%;
.title {
font-size: 12px;
color: #111111;
}
.content {
font-size: 11px;
color: #9b9b9b;
}
}
.service-price {
margin-left: auto;
color: #fc5b32;
font-size: 14px;
span {
font-size: 12px;
}
}
}
.review-address {
.title {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 32px;
background: rgba(255, 255, 255, 0.8);
border-radius: 8px 8px 0 0;
padding: 0px 10px;
box-sizing: border-box;
}
.title-l {
font-size: 15px;
color: #333333;
}
.title-r {
font-size: 10px;
color: #9b9b9b;
letter-spacing: 2px;
span {
margin-right: 5px;
}
}
.address {
display: flex;
padding: 10px;
background: #ffffff;
.store {
font-weight: 500;
font-size: 14px;
color: #2c2c2c;
line-height: 20px;
}
.detail {
font-weight: 400;
font-size: 12px;
color: #656566;
margin: 2px 0 8px 0;
}
}
}
.review-line {
color: #999999;
font-size: 12px;
font-weight: 400;
background: #ffffff;
border-radius: 4px;
padding: 14px 10px;
margin: 10px 0px;
box-sizing: border-box;
display: flex;
align-items: center;
img {
width: 36px;
margin-right: 10px;
}
i {
margin-left: auto;
color: #fc643e;
}
}
}
}
}
</style>
<!-- 选择礼包弹窗 -->
<template>
<GLDialog mode="big" class="muti-gift" bigTitle="选择内容" :hasFooter="hasFooter" :before-close="handleGoodsClose" @onOk="handleGoodsConfirm" @onCancel="handleGoodsClose" :visible.sync="isSelectGoodsVisible">
<div class="flex-box">
<div class="gift-table">
<el-tabs class="gift-tabs" v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="卡券" name="card"></el-tab-pane>
<el-tab-pane label="直充" name="recharge"></el-tab-pane>
</el-tabs>
<div>
<glsx-combi-form :isEdit="false" labelWidth="70px" class="p-16" style="padding-bottom: 0px;" ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</span>
</glsx-combi-form>
<GLTable v-loading="loading" v-show="activeName == 'card'" ref="cardRef" :tableData="GoodsList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable">
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="stock" slot-scope="scope">
<span>{{ scope.scope.limitStockFlag == 1 ? scope.scope.stock : '无限制' }}</span>
</span>
<span slot="useType" slot-scope="scope">
<span>{{ toRestrictLabelText(scope.scope) }}</span>
</span>
</GLTable>
<GLTable v-loading="loading" v-show="activeName == 'recharge'" ref="rechargeRef" :tableData="GoodsList" :noDataImg="url" :tableParams="tableParamsL" @refreshTable="getList" @selectionTable="handleSelectionTable">
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="stock" slot-scope="scope">
<span>{{ scope.scope.limitStockFlag == 1 ? scope.scope.stock : '无限制' }}</span>
</span>
<span slot="useType" slot-scope="scope">
<span>{{ toRestrictLabelText(scope.scope) }}</span>
</span>
</GLTable>
</div>
</div>
<div class="selected-list">
<p class="list-title p-16">已选({{ selectedSum }})</p>
<div class="list-gifts">
<div v-for="(item, index) in orderShow" :key="index">
<div class="gift-box" v-if="selectedList[item].list.length">
<div class="gift-label">
<img class="muti-icon" :src="require(`@/assets/coupon/${item}.png`)" />
</div>
<div class="gift-content">
<div class="gift-item" :key="subItem.id" v-for="(subItem, subIndex) in selectedList[item].list">
<img class="muti-icon" src="@/assets/muti-selected.png" @click="handleGoodsDelete(item, subIndex)" />
<el-tooltip effect="dark" placement="top" :disabled="couponString(subItem).length <= 8">
<p :class="['gift-coupon-name', 'ellipsis-1']">{{ couponString(subItem) > 8 ? couponString(subItem).slice(0, 8) + '...' : couponString(subItem) }}</p>
<div slot="content">{{ couponString(subItem) }}</div>
</el-tooltip>
<div class="gift-sum">
<el-input-number class="sum-input" v-model="subItem.couponAmount" :min="1" :max="9999" size="mini" label="描述文字"></el-input-number>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</GLDialog>
</template>
<script>
import url from '@/assets/empty.png'
// import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectGoodsDialog',
data() {
return {
// 表格组件
isMount: false,
activeName: 'card',
userInfo: {},
GoodsList: [],
fnCallBack: false,
url: url,
loading: true,
selectedSum: 0,
selectedList: {
card: {
appearance: 1,
list: []
},
// 直充
recharge: {
appearance: 2,
list: []
}
},
initSelected: '',
scopeApplication: [
{
confId: '1',
confName: '旗下所有店通用'
},
{
confId: '2',
confName: '旗下品牌店通用'
}
],
orderShow: ['card', 'recharge'],
numToCoupon: {
1: 'card',
2: 'recharge'
},
// 搜索
searchForm: {
brandName: ''
},
searchFormData: [
{
label: '商品品牌',
name: 'brandName',
type: 'select',
maxlength: 30,
width: '185px',
placeholder: '请选择商品品牌',
optionList: [],
optionId: 'brandName',
optionLabel: 'brandName',
optionsName: 'brandName',
isClear: true
},
{
label: '商品名称',
name: 'goodsName',
type: 'input',
maxlength: 30,
width: '185px',
placeholder: '请输入商品名称',
isClear: true
}
],
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '品牌',
prop: 'brandName',
width: 120
},
{
label: '商品名称',
prop: 'goodsName',
width: 180
},
{
label: '劵面额',
prop: 'denomination',
formatter: cellValue => {
return isNaN(cellValue.denomination) ? cellValue.denomination : (cellValue.denomination / 100).toFixed(2) + '元'
}
},
{
label: '有效期',
prop: 'effectiveDays',
formatter: cellValue => {
return cellValue.effectiveDays + '天'
}
}
]
},
tableParamsL: {}
}
},
props: {
isSelectGoodsVisible: {
type: Boolean,
default: false
},
merchantId: [String, Number],
selectedGoodsLists: {
type: Object,
default: () => []
}
},
// components: {
// glsxDialog
// },
mounted() {
for (let i in this.selectedList) {
this.selectedGoodsLists.forEach(item => {
if (item.appearance == this.selectedList[i].appearance) this.selectedList[i].list.push(item)
})
}
this.initSelected = this.$common.utils.deepClone(this.selectedList)
this.getList({}, true)
this.brandList('brandName')
},
methods: {
couponString(val) {
return `${isNaN(val.denomination) ? val.denomination : (val.denomination / 100).toFixed(2) + '元'}${val.brandName}${val.goodsName}${this.activeName == 'recharge' ? val.rechargeDenomination : ''}`
},
filterDenomination(val) {
return isNaN(val) ? val : (val / 100).toFixed(2) + '元'
},
brandList(name) {
this.$apis.calendar
.brandList({
pageNum: 1,
pageSize: 10000,
supplier: 'HW'
})
.then(res => {
const i = this.searchFormData.findIndex(item => item.optionsName == name)
this.searchFormData[i].optionList = res
console.log(this.searchFormData[i].optionList)
})
},
getList(page, isResetPage = false, isMount = false) {
this.tableParamsL = this.$common.utils.deepClone(this.tableParams)
this.tableParamsL.tableColumns.splice(3, 0, {
label: '直充面额',
prop: 'rechargeDenomination',
width: 100
})
var params = {
...this.searchForm,
appearance: this.activeName == 'card' ? 1 : 2,
status: 2,
pageNum: isResetPage ? 1 : this.$refs[this.activeName + 'Ref'].page.pageNum,
pageSize: isResetPage ? 10 : this.$refs[this.activeName + 'Ref'].page.pageSize
}
this.loading = true
this.$apis.calendar
.getEquityListApi(params)
.then(res => {
// 重置分页组件
if (this.$refs[this.activeName + 'Ref'] && isResetPage) {
this.$refs[this.activeName + 'Ref'].page.pageNum = 1
this.$refs[this.activeName + 'Ref'].page.pageSize = 10
}
this.GoodsList = res.list
// this.fnCallBack = true
this.$refs[this.activeName + 'Ref'].tableTotal = res.total
this.recoverySelected()
this.recoveryTotal()
this.$nextTick(() => {
this.initSelected = null
})
this.$refs[this.activeName + 'Ref'].tableHeightValues = '50vh'
})
.finally(() => {
this.loading = false
})
},
handleTabClick() {
this.getList({}, true)
this.recoverySelected()
},
handleSearch() {
this.getList({}, true)
this.recoverySelected()
},
handleReset() {
this.searchForm = {}
this.handleSearch()
},
// 恢复选择
addSelected() {
this.$nextTick(() => {
// this.$refs[this.activeName + 'Ref'].$refs[this.tableParams.mutiSelectName + 'MutiTable'].clearSelection()
var list = this.$common.utils.deepClone(this.selectedList[this.activeName].list)
if (list && list.length) {
list.forEach(row => {
var idx = this.GoodsList.findIndex(k => k.id == row.id)
if (idx != -1) {
this.$refs[this.activeName + 'Ref'].$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.GoodsList[idx], true)
}
})
}
})
},
recoverySelected() {
// 翻页,去掉已选项
var selectedData = this.$refs[this.activeName + 'Ref'].mutiSelectArr.list
console.log(selectedData, '4444444444444444')
var deleteList = []
this.addSelected()
if (selectedData) {
selectedData.forEach(item => {
if (this.selectedList[this.activeName].list.findIndex(subItem => subItem.id == item.id) == -1) {
deleteList.push(item)
}
})
this.deleteSelected(deleteList)
}
},
// 删除选中
deleteSelected(deleteList) {
this.$nextTick(() => {
deleteList.forEach(row => {
var idx = this.GoodsList.findIndex(k => k.id == row.id)
if (idx != -1) {
this.$refs[this.activeName + 'Ref'].$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.GoodsList[idx], false)
}
})
})
},
handleGoodsDelete(attr, idx) {
var deleteList = this.selectedList[attr].list.splice(idx, 1)
this.deleteSelected(deleteList)
this.recoveryTotal()
},
// 计算已选张数
recoveryTotal() {
this.selectedSum = 0
for (let i in this.selectedList) {
this.selectedSum += this.selectedList[i].list.length
}
},
// getSelectionTable(list, val) {
// var currentIdList = this.GoodsList.map(item => item.id)
// var selectedIdList = list.map(item => item.id)
// val.forEach((item, index) => {
// const idx = currentIdList.indexOf(item.id)
// const idxs = selectedIdList.indexOf(item.id)
// if (idx == -1 && idxs == -1) {
// val.splice(index, 1)
// }
// })
// return val
// },
// 选择/取消
handleSelectionTable(val) {
console.log(val)
const selectedList = this.initSelected ? this.initSelected[this.activeName].list : this.selectedList[this.activeName].list
var list = this.$common.utils.deepClone(selectedList)
// const val = this.getSelectionTable(list, valp)
var count = 0
var currentIdList = this.GoodsList.map(item => item.id)
val
.map(item => item.id)
.forEach(k => {
if (currentIdList.indexOf(k) != -1) {
count = count + 1
}
})
if (count <= this.GoodsList.length || count == 0 || !val.length) {
this.selectedList[this.activeName].list = []
}
val.forEach(item => {
let isSelected = list.find(k => k.id == item.id)
console.log(this.selectedList[this.activeName].list, item.id)
if (this.selectedList[this.activeName].list.findIndex(k => k.id == item.id) == '-1') {
this.selectedList[this.activeName].list.push({
id: item.id,
goodId: item.goodId,
appearance: item.appearance,
brandName: item.brandName,
couponAmount: isSelected ? list.find(k => k.id == item.id).couponAmount : 1,
goodsName: item.goodsName,
denomination: item.denomination,
effectiveDays: item.effectiveDays,
rechargeDenomination: item.rechargeDenomination,
status: item.status
})
}
})
this.recoveryTotal()
},
handleGoodsConfirm() {
// if (!this.GoodsList.length) {
// var params = {
// addOrEdit: 1,
// groupOrStore: this.userInfo.accountLevel == 4 ? 2 : 1,
// $title: '新建礼包'
// }
// this.$router.push({
// path: '/productGroup/editProduct',
// query: params
// })
// return true
// }
var selectedData = []
for (let i in this.selectedList) {
selectedData.push(...this.selectedList[i].list)
}
if (selectedData.length == 0) {
this.$message.error('请选择平台福利券')
return
}
this.$emit('handleGoodsConfirm', selectedData)
},
handleGoodsClose() {
this.$emit('handleGoodsClose')
}
}
}
</script>
<style lang="scss">
.muti-gift .flex-box {
display: flex;
}
.muti-gift .el-form-item__content {
width: auto;
}
.el-message {
z-index: 9999 !important;
}
.muti-gift .el-tabs__active-bar {
display: block;
}
.muti-gift .el-tabs__nav-scroll {
display: block;
border-bottom: 1px solid #eeeeee;
}
.muti-gift .el-tabs__item {
width: 120px;
padding: 0 20px;
text-align: center;
font-weight: 400;
font-size: 16px;
color: #717171;
height: 36px !important;
line-height: 36px !important;
}
.muti-gift .el-tabs__item:hover,
.muti-gift .el-tabs__item.is-active {
color: #5f5efb;
background: #fff !important;
border-width: 0px !important;
}
.muti-gift .m-t-10 {
margin-top: 10px;
}
.muti-gift .gift-table {
width: calc(100% - 280px);
border: 1px solid #eeeeee;
margin-right: 10px;
}
.muti-gift .p-16 {
padding: 10px;
}
.muti-gift .selected-list {
width: 280px;
border-radius: 2px;
border: 1px solid #eeeeee;
.list-title {
font-size: 16px;
border-bottom: 1px solid #f1f1f1;
}
.list-gifts {
height: 61vh;
overflow-y: scroll;
}
.gift-box {
padding: 16px;
.gift-label {
color: #999999;
margin-bottom: 14px;
}
.gift-content {
border-bottom: 1px solid #e5e5e5;
.gift-item {
margin-bottom: 20px;
display: inline-flex;
align-items: center;
.muti-icon {
cursor: pointer;
}
.gift-coupon-name {
display: inline-block;
width: 109px;
margin: 0 5px 0 7px;
}
.gift-sum {
display: inline-block;
width: 82px;
text-align: right;
.el-input-number--mini .el-input__inner {
padding: 0 10px;
}
.sum-input {
display: inline-block;
width: 82px;
}
.el-input--mini .el-input__inner {
border: 0px;
}
.el-input-number--mini .el-input-number__decrease,
.el-input-number--mini .el-input-number__increase {
width: 20px !important;
border: 0px;
background-color: #fff;
}
}
.gift-tips {
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
color: #999999;
background-color: #eeeded;
margin-right: 7px;
}
}
.gift-item:last-child {
margin-bottom: 0;
}
}
.gift-content:last-child {
border-bottom: 0px;
}
}
}
</style>
<template>
<div class="calendar">
<!-- <div class="flex head">
<el-button type="primary" size="small" icon="el-icon-plus" @click="handleAdd">新增营销</el-button>
<div class="head-info flex">
<p>结合门店营销活动,指定客户创建智能营销,提高活动转化率</p>
<el-popover placement="top" width="560" trigger="hover" content="通过导入的客户,门店可通过智能外呼及智能短信,结合营销活动的需要向离店用户进行智能营销,可实现标准、高效的营销同时实现用户线上化。">
<img src="@/images/question.png" slot="reference" class="count-item-question" />
</el-popover>
</div>
</div> -->
<div class="container">
<GLCombiForm :rowNumber="1" ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<!-- 表格区域 开始 -->
<GLTable ref="calendarRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="imStatus" slot-scope="scope">
<div :class="['task_icon', scope.scope.imStatus == 1 ? 'task_icon1' : 'task_icon2']"></div>
{{ scope.scope.imStatus == 1 ? '待处理' : scope.scope.imStatus == 2 ? '已完成' : '删除' }}
</template>
<template slot="status" slot-scope="scope">
<div :class="['task_icon', scope.scope.status == 0 ? 'task_icon1' : 'task_icon2']">{{ scope.scope.status == 0 ? '待发布' : scope.scope.status == 1 ? '已发布' : '已失效' }}</div>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleAdd(scope.scope)">修改</el-button>
</div>
</GLTable>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
data() {
return {
url: url,
tableSearchForm: {
imName: '',
imStatus: '',
createDate: []
},
searchForm: {},
// 搜索
searchFormData: [
{
label: '营销类型状态',
name: 'status',
type: 'select',
optionList: [
{ text: '全部', id: '' },
{ text: '待发布', id: 0 },
{ text: '已发布', id: 1 }
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '营销主题',
name: 'title',
type: 'input'
}
],
getListApi: this.$apis.calendar.calendarList,
tableParams: {
listName: 'data',
tableOption: true,
tableColumns: [
{
label: '营销名称',
prop: 'marketingTypeStr',
line: 1,
width: 350
},
{
label: '营销主题',
prop: 'title'
},
{
label: '营销副标题',
prop: 'subTitle'
},
{
label: '活动时间',
prop: 'startTime'
},
{
label: '平台福利合计/元',
prop: 'platformBenefits',
width: 200,
formatter(val) {
return val.platformBenefits / 100
}
},
{
label: '状态',
prop: 'status',
addHtml: 'status'
// formatter(val) {
// return val.status == 0 ? '待发布' : val.status == 1 ? '已发布' : '已失效'
// }
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }
}
},
methods: {
handleAdd(row) {
this.$router.push({
path: '/calendar/add?id=' + row.id
})
},
getParams() {
var params = JSON.parse(JSON.stringify(this.tableSearchForm))
if (this.tableSearchForm.createDate.length) {
params.startTime = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.tableSearchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
params.taskStatus = this.currentIndex
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = this.getParams()
delete this.searchForm.createDate
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.calendarRef.data.length ? (this.$refs.calendarRef.tableHeightValues = '') : this.$refs.calendarRef.setTableHeightFun()
},
handleSearch() {
this.$refs.calendarRef.refreshTable()
},
handleReset() {
this.tableSearchForm = {
imName: '',
imStatus: '',
createDate: []
}
this.searchForm = {
imName: '',
imStatus: '',
startTime: '',
endTime: ''
}
this.handleSearch()
}
}
}
</script>
<style lang="scss" scoped>
.calendar {
.head {
margin-bottom: 16px;
}
.head-info {
font-weight: 400;
font-size: 14px;
color: #666666;
p {
margin: 0 4px 0 12px;
line-height: 16px;
}
.count-item-question {
width: 14px;
height: 14px;
display: inline-block;
}
}
.task_icon {
position: relative;
width: auto;
height: auto;
&::after {
content: '';
position: absolute;
top: 4px;
left: -10px;
width: 6px;
height: 6px;
border-radius: 4px;
}
&.task_icon1 {
&::after {
background: #fdb757;
}
}
&.task_icon2 {
&::after {
background: #2cca74;
}
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!