|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
|
|
|
:options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
|
|
|
- :operation="operation" :exportList="exportList">
|
|
|
+ :operation="operation()" :exportList="exportList">
|
|
|
<el-dialog title="" width="1000px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
|
|
|
:show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
|
|
|
<zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
|
|
@@ -33,23 +33,12 @@ import selectMember from "@/components/selectComponent/selectMember.vue"
|
|
|
import selectGoods from "@/components/selectComponent/selectGoods.vue"
|
|
|
import { MEMBER_CURRENT_TYPE_FILTER } from "@/filters/index.js"
|
|
|
import ImageUpload from '@/components/file-upload'
|
|
|
+import operation_mixin from '@/components/template/operation_mixin.js'
|
|
|
export default {
|
|
|
components: { TemplatePage, selectMember, selectGoods, ImageUpload },
|
|
|
- mixins: [import_mixin],
|
|
|
+ mixins: [import_mixin,operation_mixin],
|
|
|
data() {
|
|
|
return {
|
|
|
- // 事件组合
|
|
|
- optionsEvensGroup: [
|
|
|
- [
|
|
|
- [
|
|
|
- {
|
|
|
- name: '新增优惠券',
|
|
|
- isRole: true,
|
|
|
- click: this.addData
|
|
|
- }
|
|
|
- ],
|
|
|
- ],
|
|
|
- ],
|
|
|
// 表格属性
|
|
|
tableAttributes: {
|
|
|
// 启用勾选列
|
|
@@ -92,6 +81,20 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ // 事件组合
|
|
|
+ optionsEvensGroup() {
|
|
|
+ return [
|
|
|
+ [
|
|
|
+ [
|
|
|
+ this.optionsEvensAuth("add", {
|
|
|
+ click: () => {
|
|
|
+ this.addData
|
|
|
+ }
|
|
|
+ })
|
|
|
+ ],
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ },
|
|
|
isService() {
|
|
|
if (this.formData.receiveCrowd == 3) {
|
|
|
return true;
|
|
@@ -467,51 +470,62 @@ export default {
|
|
|
selectionChange(data) {
|
|
|
this.recordSelected = data
|
|
|
},
|
|
|
- // 表格操作列
|
|
|
- operation(h, { row, index, column }) {
|
|
|
- return (
|
|
|
- <div class='operation-btns'>
|
|
|
- <el-button type="text" onClick={() => {
|
|
|
- getCouponDetail({ couponId: row.couponId }).then(res => {
|
|
|
- Object.assign(this.formData, res.data, {
|
|
|
- receiveDate: res.data.obtainStartTime ? [res.data.obtainStartTime, res.data.obtainEndTime] : [],
|
|
|
- activeDate: res.data.activeStartTime ? [res.data.activeStartTime, res.data.activeEndTime] : [],
|
|
|
- imgSrc: res.data.imgSrc ? [{ url: res.data.imgSrc }] : [],
|
|
|
- })
|
|
|
- this.formDialogType = 2
|
|
|
- this.openForm()
|
|
|
- })
|
|
|
- }}>查看</el-button>
|
|
|
- {row.releaseFlag === 'WAIT' ? <el-button type="text" onClick={() => {
|
|
|
- getCouponDetail({ couponId: row.couponId }).then(res => {
|
|
|
- Object.assign(this.formData, res.data, {
|
|
|
- receiveDate: res.data.obtainStartTime ? [res.data.obtainStartTime, res.data.obtainEndTime] : [],
|
|
|
- activeDate: res.data.activeStartTime ? [res.data.activeStartTime, res.data.activeEndTime] : [],
|
|
|
- imgSrc: res.data.imgSrc ? [{ url: res.data.imgSrc }] : [],
|
|
|
- })
|
|
|
- this.formDialogType = 1
|
|
|
- this.openForm()
|
|
|
- })
|
|
|
- }}>编辑</el-button> : null}
|
|
|
- {row.releaseFlag === 'START' ? <el-popconfirm
|
|
|
- title="确定取消吗?"
|
|
|
- onConfirm={() => {
|
|
|
- changeFlag(row.couponId)
|
|
|
- }}
|
|
|
- >
|
|
|
- <el-button type="text" slot="reference">取消</el-button>
|
|
|
- </el-popconfirm> : null}
|
|
|
- {row.releaseFlag === 'START' ? <el-popconfirm
|
|
|
- title="确定补发业务员优惠券吗?"
|
|
|
- onConfirm={() => {
|
|
|
- reissueCoupon(row.couponId)
|
|
|
- }}
|
|
|
- >
|
|
|
- <el-button type="text" slot="reference">补发业务员优惠券</el-button>
|
|
|
- </el-popconfirm> : null}
|
|
|
- </div>
|
|
|
- )
|
|
|
- },
|
|
|
+ // 表格操作列
|
|
|
+ operation() {
|
|
|
+ return this.operationBtn({
|
|
|
+ detail: {
|
|
|
+ btnType: 'text',
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ getCouponDetail({ couponId: row.couponId }).then(res => {
|
|
|
+ Object.assign(this.formData, res.data, {
|
|
|
+ receiveDate: res.data.obtainStartTime ? [res.data.obtainStartTime, res.data.obtainEndTime] : [],
|
|
|
+ activeDate: res.data.activeStartTime ? [res.data.activeStartTime, res.data.activeEndTime] : [],
|
|
|
+ imgSrc: res.data.imgSrc ? [{ url: res.data.imgSrc }] : [],
|
|
|
+ })
|
|
|
+ this.formDialogType = 2
|
|
|
+ this.openForm()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ edit: {
|
|
|
+ btnType: 'text',
|
|
|
+ conditions: ({ row, index, column }) => {
|
|
|
+ return row.releaseFlag === 'WAIT'
|
|
|
+ },
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ getCouponDetail({ couponId: row.couponId }).then(res => {
|
|
|
+ Object.assign(this.formData, res.data, {
|
|
|
+ receiveDate: res.data.obtainStartTime ? [res.data.obtainStartTime, res.data.obtainEndTime] : [],
|
|
|
+ activeDate: res.data.activeStartTime ? [res.data.activeStartTime, res.data.activeEndTime] : [],
|
|
|
+ imgSrc: res.data.imgSrc ? [{ url: res.data.imgSrc }] : [],
|
|
|
+ })
|
|
|
+ this.formDialogType = 1
|
|
|
+ this.openForm()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ cancel: {
|
|
|
+ btnType: 'text',
|
|
|
+ prompt: '确定取消吗?',
|
|
|
+ conditions: ({ row, index, column }) => {
|
|
|
+ return row.releaseFlag === 'START'
|
|
|
+ },
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ changeFlag(row.couponId)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ reissue: {
|
|
|
+ btnType: 'text',
|
|
|
+ prompt: '确定补发业务员优惠券吗?',
|
|
|
+ conditions: ({ row, index, column }) => {
|
|
|
+ return row.releaseFlag === 'START'
|
|
|
+ },
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ reissueCoupon(row.couponId)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
+ },
|
|
|
addData() {
|
|
|
this.formDialogType = 0
|
|
|
this.openForm()
|