Commit c0027c0f by 王志慧

Merge branch 'saas+v4.20.0' of http://192.168.3.233:8090/saas/scrm-micro-inventory into saas+v4.20.0

2 parents ffade1a1 ea36e006
...@@ -59,6 +59,18 @@ const updateCouponApi = params => { ...@@ -59,6 +59,18 @@ const updateCouponApi = params => {
}) })
} }
const deleteCouponApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.life.merchant.coupon.delete`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 分页查找园区店 // 分页查找园区店
const commodityAddSeviceMerchant = function(params) { const commodityAddSeviceMerchant = function(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
...@@ -82,4 +94,16 @@ const getDistinctColum = function(params) { ...@@ -82,4 +94,16 @@ const getDistinctColum = function(params) {
sign: true sign: true
}) })
} }
export default { getListApi, getDetailListApi, getTypeList, addCouponApi, updateCouponApi, commodityAddSeviceMerchant, getDistinctColum }
const exportCoupon = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.life.merchant.coupon.exportExcel'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getListApi, getDetailListApi, getTypeList, addCouponApi, updateCouponApi, deleteCouponApi, commodityAddSeviceMerchant, getDistinctColum, exportCoupon }
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
let cfg = require('./conf.js') let cfg = require('./conf.js')
import { Http, utils } from 'glsx-common' import { Http, utils } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) { export const fetchConfig = function(isEnv = true) {
// if (isEnv) { // if (isEnv) {
// let { request } = cfg // let { request } = cfg
// Object.assign(request, { timeout }) // Object.assign(request, { timeout })
......
...@@ -62,3 +62,12 @@ export function getOptionsList(that, formName, hasAll = true, refreshSigle) { ...@@ -62,3 +62,12 @@ export function getOptionsList(that, formName, hasAll = true, refreshSigle) {
}) })
} }
} }
export function aToExport(url) {
var a = document.createElement('a')
a.setAttribute('id', 'exportToExport')
a.setAttribute('href', url)
a.setAttribute('target', '_blank')
document.body.appendChild(a)
a.click()
}
<!-- 新增/编辑优惠券 --> <!-- 新增/编辑优惠券 -->
<template> <template>
<div> <div>
<GLDialog :bigTitle="!couponInfo ? '新增精品礼券' : '编辑精品礼券'" mode="big" :visible.sync="couponsVisible" @onCancel="handleAdd" @onOk="handleAddConfirm"> <GLDialog :bigTitle="!couponInfo ? '新增精品礼券' : '编辑精品礼券'" mode="big" :visible.sync="couponsVisible" :before-close="handleAdd" @onCancel="handleAdd" @onOk="handleAddConfirm">
<el-form ref="couponAddForm" :model="couponsForm" :rules="formRules" label-width="140px"> <el-form ref="couponAddForm" :model="couponsForm" :rules="formRules" label-width="140px">
<el-form-item label="精品礼券名称:" prop="couponName"> <el-form-item label="精品礼券名称:" prop="couponName">
<el-input style="width: 216px;" v-model="couponsForm.couponName" placeholder="给礼券起个名字" maxlength="20" /> <el-input style="width: 216px;" v-model="couponsForm.couponName" placeholder="给礼券起个名字" maxlength="20" />
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
{ required: true, message: '请输入券码数量', trigger: 'blur' }, { required: true, message: '请输入券码数量', trigger: 'blur' },
{ validator: validateAccount, trigger: 'blur' } { validator: validateAccount, trigger: 'blur' }
]"> ]">
<el-input-number v-model="couponsForm.amount" :min="1" :max="999" size="mini" /> <el-input-number v-model="couponsForm.amount" :min="1" :max="99999" size="mini" />
</el-form-item> </el-form-item>
</template> </template>
<el-form-item v-if="!couponInfo" label="批量发放门店:" prop="merchantCouponDTOList" :rules="[{ required: true, message: '请选择门店', trigger: 'change' }]"> <el-form-item v-if="!couponInfo" label="批量发放门店:" prop="merchantCouponDTOList" :rules="[{ required: true, message: '请选择门店', trigger: 'change' }]">
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</el-button> </el-button>
<selected-show-table :table-data="couponsForm.merchantCouponDTOList" @handleTableStoreDelete="handleTableStoreDelete"> <selected-show-table :table-data="couponsForm.merchantCouponDTOList" @handleTableStoreDelete="handleTableStoreDelete">
<span slot="num" slot-scope="scope"> <span slot="num" slot-scope="scope">
<el-input-number v-model="couponsNumList[scope.scope.index]" :min="1" :max="999" size="mini" @change="handleNumChange(scope.scope.index)" /> <el-input-number v-model="couponsNumList[scope.scope.index]" :min="1" :max="99999" size="mini" @change="handleNumChange(scope.scope.index)" />
<span class="car-error-txt" style="display: inline-block; padding-top: 2px;" v-show="!couponsNumList[scope.scope.index]">请输入数量</span> <span class="car-error-txt" style="display: inline-block; padding-top: 2px;" v-show="!couponsNumList[scope.scope.index]">请输入数量</span>
</span> </span>
</selected-show-table> </selected-show-table>
...@@ -169,6 +169,14 @@ export default { ...@@ -169,6 +169,14 @@ export default {
}, },
handleAdd() { handleAdd() {
// this.couponsVisible = !this.couponsVisible // this.couponsVisible = !this.couponsVisible
this.couponsForm = {
couponName: '',
couponType: '',
couponTypeName: '',
chargeFlag: 'N',
remark: this.remarkTemp,
merchantCouponDTOList: []
}
this.$emit('couponClose', false) this.$emit('couponClose', false)
this.$refs.couponAddForm && this.$refs.couponAddForm.resetFields() this.$refs.couponAddForm && this.$refs.couponAddForm.resetFields()
}, },
...@@ -203,10 +211,10 @@ export default { ...@@ -203,10 +211,10 @@ export default {
return true return true
} }
this.couponsForm.merchantCouponDTOList = selectedData this.couponsForm.merchantCouponDTOList = selectedData
this.couponsNumList = new Array(selectedData.length).fill(999) this.couponsNumList = new Array(selectedData.length).fill(99999)
this.couponsForm.merchantCouponDTOList.forEach((item, idx) => { this.couponsForm.merchantCouponDTOList.forEach((item, idx) => {
if (!item.hasOwnProperty('amount')) { if (!item.hasOwnProperty('amount')) {
item.amount = 999 item.amount = 99999
} else { } else {
this.couponsNumList[idx] = item.amount this.couponsNumList[idx] = item.amount
} }
...@@ -255,6 +263,14 @@ export default { ...@@ -255,6 +263,14 @@ export default {
type: 'success', type: 'success',
title: res.message || '操作成功' title: res.message || '操作成功'
}) })
this.couponsForm = {
couponName: '',
couponType: '',
couponTypeName: '',
chargeFlag: 'N',
remark: this.remarkTemp,
merchantCouponDTOList: []
}
this.$refs.couponAddForm && this.$refs.couponAddForm.resetFields() this.$refs.couponAddForm && this.$refs.couponAddForm.resetFields()
this.$emit('couponClose', true) this.$emit('couponClose', true)
}) })
......
<template> <template>
<div class="purchase"> <div class="purchase">
<div class="container"> <div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm :key="refresh" ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header"> <div class="table-header">
<GLButton type="primary" size="small" @click="handleEdit('add', {})" fn="新增">新增</GLButton>
</div>
<el-tabs v-model="activeName" type="card" @tab-click="handleTabChange"> <el-tabs v-model="activeName" type="card" @tab-click="handleTabChange">
<el-tab-pane label="店面列表" name="storeList"> <el-tab-pane label="店面列表" name="storeList"></el-tab-pane>
<store-list ref="storeList" :parent-search-form="parentSearchForm" /> <el-tab-pane label="领用明细" name="couponsDetail"></el-tab-pane>
</el-tab-pane>
<el-tab-pane label="领用明细" name="couponsDetail">
<coupons-detail ref="couponsDetail" :parent-search-form="parentSearchForm" />
</el-tab-pane>
</el-tabs> </el-tabs>
<div class="btn">
<GLButton type="primary" size="small" @click="handleEdit('add', {})" fn="新增">新增</GLButton>
<el-button size="small" @click="handleExport">导出</el-button>
</div>
</div>
<!-- 店面列表 - 表格区域 开始 --> <!-- 店面列表 - 表格区域 开始 -->
<GLTable v-show="activeName == 'storeList'" ref="storeRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @sortChange="sortChange"> <GLTable v-show="activeName == 'storeList'" ref="storeRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @sortChange="sortChange">
...@@ -36,7 +34,7 @@ ...@@ -36,7 +34,7 @@
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import constData from './constant/data' import constData from './constant/data'
import editCouponsDialog from './components/editCouponsDialog' import editCouponsDialog from './components/editCouponsDialog'
import { getOptionsList } from '@/utils/index' import { getOptionsList, aToExport } from '@/utils/index'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
// import baseList from './constant/baseList' // import baseList from './constant/baseList'
export default { export default {
...@@ -47,6 +45,7 @@ export default { ...@@ -47,6 +45,7 @@ export default {
}, },
data() { data() {
return { return {
refresh: new Date(),
size: 'small', size: 'small',
url: url, url: url,
activeName: 'storeList', activeName: 'storeList',
...@@ -108,17 +107,11 @@ export default { ...@@ -108,17 +107,11 @@ export default {
} }
}, },
{ {
label: '区域',
prop: 'region',
formatter: cellValue => {
return cellValue.yqMerchantInfo?.region || ''
}
},
{
label: '门店名称', label: '门店名称',
prop: 'merchantName', prop: 'merchantName',
width: '200px',
formatter: cellValue => { formatter: cellValue => {
return cellValue.merchantName + ' - ' + cellValue.yqMerchantName return cellValue.merchantName + (cellValue.yqMerchantName ? ' - ' + cellValue.yqMerchantName : '')
} }
}, },
{ {
...@@ -205,9 +198,6 @@ export default { ...@@ -205,9 +198,6 @@ export default {
type: 'text', type: 'text',
fn: '删除' fn: '删除'
}, },
// condition: row => {
// return !row.goodsStatus
// },
listeners: { listeners: {
click: row => this.handleDelete(row) click: row => this.handleDelete(row)
} }
...@@ -222,7 +212,7 @@ export default { ...@@ -222,7 +212,7 @@ export default {
label: '领用时间', label: '领用时间',
prop: 'createdDate', prop: 'createdDate',
sortable: 'custom', sortable: 'custom',
width: '160px', width: '180px',
formatter: cellValue => { formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
} }
...@@ -234,17 +224,22 @@ export default { ...@@ -234,17 +224,22 @@ export default {
{ {
label: '手机号', label: '手机号',
prop: 'customerPhone', prop: 'customerPhone',
width: '120px' width: '140px'
}, },
{ {
label: '礼券名称', label: '礼券名称',
prop: 'couponName' prop: 'couponName'
}, },
{ {
label: '类型',
prop: 'couponTypeName'
},
{
label: '门店名称', label: '门店名称',
prop: 'merchantName', prop: 'merchantName',
width: '200px',
formatter: cellValue => { formatter: cellValue => {
return cellValue.merchantName + ' - ' + cellValue.yqMerchantName return cellValue.merchantName + (cellValue.yqMerchantName ? ' - ' + cellValue.yqMerchantName : '')
} }
}, },
{ {
...@@ -255,13 +250,12 @@ export default { ...@@ -255,13 +250,12 @@ export default {
optionId: 'confId', optionId: 'confId',
optionLabel: 'confValue' optionLabel: 'confValue'
} }
// optionList: []
}, },
{ {
label: '核销状态', label: '核销状态',
prop: 'usedFlag', prop: 'usedFlag',
width: '100px', width: '100px',
formatter: (cellValue) => { formatter: cellValue => {
return { return {
N: '待核销', N: '待核销',
Y: '已核销' Y: '已核销'
...@@ -272,27 +266,21 @@ export default { ...@@ -272,27 +266,21 @@ export default {
optionId: 'confId', optionId: 'confId',
optionLabel: 'confValue' optionLabel: 'confValue'
} }
// optionList: [{ confValue: '待核销', confId: 'N' }, { confValue: '已核销', confId: 'Y' }]
}, },
{ {
label: '核销人', label: '核销人',
prop: 'sellerName' prop: 'sellerName'
// optionConfig: {
// searchItemName: 'sellerNameList',
// optionId: 'confId',
// optionLabel: 'confValue'
// }
// optionList: []
}, },
{ {
label: '核销时间', label: '核销时间',
prop: 'usedTime', prop: 'usedTime',
sortable: 'custom', sortable: 'custom',
width: '160px', width: '180px',
formatter: cellValue => { formatter: cellValue => {
return cellValue.usedTime ? dayjs(cellValue.usedTime).format('YYYY-MM-DD HH:mm:ss') : '' return cellValue.usedTime ? dayjs(cellValue.usedTime).format('YYYY-MM-DD HH:mm:ss') : ''
} }
}] }
]
}, },
// 新增 // 新增
couponsVisible: false, couponsVisible: false,
...@@ -329,7 +317,6 @@ export default { ...@@ -329,7 +317,6 @@ export default {
getDistinctColum() { getDistinctColum() {
// columType属性类型(1:发券人;2:转化人) // columType属性类型(1:发券人;2:转化人)
this.$apis.coupons.getDistinctColum({ columType: 2, currentPage: 1, pageSize: 100 }).then(res => { this.$apis.coupons.getDistinctColum({ columType: 2, currentPage: 1, pageSize: 100 }).then(res => {
console.log(res)
let _list = [] let _list = []
res.forEach(item => { res.forEach(item => {
_list.push({ _list.push({
...@@ -365,7 +352,6 @@ export default { ...@@ -365,7 +352,6 @@ export default {
}, },
changeFormAttr(formName, attrName, labelList, attrValue) { changeFormAttr(formName, attrName, labelList, attrValue) {
console.log(this[formName])
labelList.forEach(item => { labelList.forEach(item => {
let idx = this[formName].findIndex(k => k.label == item) let idx = this[formName].findIndex(k => k.label == item)
this[formName][idx][attrName] = attrValue this[formName][idx][attrName] = attrValue
...@@ -374,6 +360,7 @@ export default { ...@@ -374,6 +360,7 @@ export default {
// tab切换 // tab切换
handleTabChange() { handleTabChange() {
this.refresh = new Date()
let storeAttrList = ['状态'] let storeAttrList = ['状态']
let couponAttrList = ['发券人', '核销状态', '核销人'] let couponAttrList = ['发券人', '核销状态', '核销人']
this.changeFormAttr('searchFormData', 'isHide', storeAttrList, this.activeName != 'storeList') this.changeFormAttr('searchFormData', 'isHide', storeAttrList, this.activeName != 'storeList')
...@@ -383,7 +370,6 @@ export default { ...@@ -383,7 +370,6 @@ export default {
// 停用 // 停用
handleStop(row) { handleStop(row) {
console.log(row)
let params = { let params = {
id: row.id, id: row.id,
enabledFlag: row.enabledFlag === 'Y' ? 'N' : 'Y' enabledFlag: row.enabledFlag === 'Y' ? 'N' : 'Y'
...@@ -394,7 +380,22 @@ export default { ...@@ -394,7 +380,22 @@ export default {
// 删除 // 删除
handleDelete(row) { handleDelete(row) {
this.secondConfirm(this, '删除提示', '是否确认删除该礼券?') let params = {
id: row.id
}
this.secondConfirm(this, '删除提示', '是否确认删除该礼券?', 'coupons', 'deleteCouponApi', params)
},
// 导出
handleExport() {
let params = {
...this.searchForm,
currentPage: 1,
pageSize: 9999
}
this.$apis.coupons.exportCoupon(params).then(res => {
aToExport(res.data)
})
}, },
// 排序 // 排序
...@@ -433,4 +434,12 @@ export default { ...@@ -433,4 +434,12 @@ export default {
} }
</script> </script>
<style scoped> <style scoped>
.table-header {
position: relative;
}
.btn {
position: absolute;
right: 0;
top: 0;
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!