Commit b499f16a by zhouzy

新建界面改动及接口变化

1 parent 6d69ec58
...@@ -10026,7 +10026,7 @@ ...@@ -10026,7 +10026,7 @@
}, },
"resize-observer-polyfill": { "resize-observer-polyfill": {
"version": "1.5.1", "version": "1.5.1",
"resolved": "https://r.cnpmjs.org/resize-observer-polyfill/download/resize-observer-polyfill-1.5.1.tgz", "resolved": "https://registry.npm.taobao.org/resize-observer-polyfill/download/resize-observer-polyfill-1.5.1.tgz",
"integrity": "sha1-DpAg3T0hAkRY1OvSfiPkAmmBBGQ=" "integrity": "sha1-DpAg3T0hAkRY1OvSfiPkAmmBBGQ="
}, },
"resolve": { "resolve": {
......
...@@ -8,4 +8,14 @@ export const orderApi = { ...@@ -8,4 +8,14 @@ export const orderApi = {
getOrderList(data = {}) { getOrderList(data = {}) {
return request(data, 'dj.api.get.equity.order.list.get') return request(data, 'dj.api.get.equity.order.list.get')
}, },
}
export const orderApi = {
/**获取财务管理列表*/
getBalanceList(data = {}) {
return request(data, 'dj.api.get.equity.order.balance.list.get')
},
/** 获取订单列表*/
getOrderList(data = {}) {
return request(data, 'dj.api.get.equity.order.list.get')
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -45,10 +45,10 @@ ...@@ -45,10 +45,10 @@
</div> </div>
</div> </div>
<div class="firstpickerContainer"> <div class="firstpickerContainer">
权益套餐: 门店:
<el-select <el-select
v-model="batchListSearch.defineId" v-model="batchListSearch.merchantId"
placeholder="请选择权益套餐" placeholder="请选择门店"
> >
<el-option <el-option
v-for="(item, index) in baseDate.equityList" v-for="(item, index) in baseDate.equityList"
...@@ -72,21 +72,26 @@ ...@@ -72,21 +72,26 @@
class="demo-form-inline" class="demo-form-inline"
> >
<span class="itemLeftContainer"> <span class="itemLeftContainer">
<el-form-item label="门店:">
{{ cardsInformationForm.storeName }}
</el-form-item>
</span>
<span class="itemRightContainer">
<el-form-item label="权益卡名称:"> <el-form-item label="权益卡名称:">
{{ cardsInformationForm.memberName }} {{ cardsInformationForm.memberName }}
</el-form-item> </el-form-item>
</span> </span>
<span class="itemRightContainer"> <span class="itemLeftContainer">
<el-form-item label="批次:"> <el-form-item label="批次:">
{{ cardsInformationForm.batchId }} {{ cardsInformationForm.batchId }}
</el-form-item> </el-form-item>
</span> </span>
<span class="itemLeftContainer"> <span class="itemRightContainer">
<el-form-item label="生成日期:"> <el-form-item label="生成日期:">
{{ date_format(cardsInformationForm.createdDateStr) }} {{ date_format(cardsInformationForm.createdDateStr) }}
</el-form-item> </el-form-item>
</span> </span>
<span class="itemRightContainer"> <span class="itemLeftContainer">
<el-form-item label="已激活:"> <el-form-item label="已激活:">
{{ cardsInformationForm.activationCount || "0" }}({{ {{ cardsInformationForm.activationCount || "0" }}({{
ChangeDecimalToPercentage( ChangeDecimalToPercentage(
...@@ -96,14 +101,11 @@ ...@@ -96,14 +101,11 @@
}}) }})
</el-form-item> </el-form-item>
</span> </span>
<span class="itemLeftContainer"> <span class="itemRightContainer">
<el-form-item label="生成张数:"> <el-form-item label="生成张数:">
{{ cardsInformationForm.number }} {{ cardsInformationForm.number }}
</el-form-item> </el-form-item>
</span> </span>
<span class="itemRightContainer">
<el-form-item label=""> </el-form-item>
</span>
</el-form> </el-form>
<h2>权益明细:</h2> <h2>权益明细:</h2>
<el-form <el-form
...@@ -188,12 +190,12 @@ ...@@ -188,12 +190,12 @@
class="demo-ruleForm" class="demo-ruleForm"
> >
<el-form-item <el-form-item
label="关联权益套餐:" label="关联门店:"
prop="relatedRightsPackage" prop="relatedRightsPackage"
> >
<el-select <el-select
v-model="generateRightCardsForm.relatedRightsPackage" v-model="generateRightCardsForm.relatedStores"
placeholder="请选择关联权益套餐" placeholder="请选择关联门店"
value-key="id" value-key="id"
@change="generateCardsformat" @change="generateCardsformat"
> >
...@@ -240,6 +242,7 @@ ...@@ -240,6 +242,7 @@
>确 定</el-button> >确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 批次管理分页表格 -->
<div class="tablecontainer"> <div class="tablecontainer">
<d2-table <d2-table
ref="batchDetailTable" ref="batchDetailTable"
...@@ -287,7 +290,7 @@ ...@@ -287,7 +290,7 @@
设备SN: 设备SN:
<div class="Input"> <div class="Input">
<el-input <el-input
v-model="collectionListSearch.condition.sn" v-model="collectionListSearch.sn"
placeholder="请输入设备SN" placeholder="请输入设备SN"
size="small" size="small"
></el-input> ></el-input>
...@@ -297,7 +300,7 @@ ...@@ -297,7 +300,7 @@
账号: 账号:
<div class="Input"> <div class="Input">
<el-input <el-input
v-model="collectionListSearch.condition.mobile" v-model="collectionListSearch.mobile"
placeholder="请输入账号" placeholder="请输入账号"
size="small" size="small"
></el-input> ></el-input>
...@@ -332,10 +335,10 @@ ...@@ -332,10 +335,10 @@
></el-cascader> ></el-cascader>
</div> --> </div> -->
<div class="firstpickerContainer"> <div class="firstpickerContainer">
权益套餐: 门店:
<el-select <el-select
v-model="collectionListSearch.condition.defineId" v-model="collectionListSearch.merchantId"
placeholder="请选择权益套餐" placeholder="请选择门店"
> >
<el-option <el-option
v-for="(item, index) in baseDate.equityList" v-for="(item, index) in baseDate.equityList"
...@@ -352,82 +355,7 @@ ...@@ -352,82 +355,7 @@
></el-cascader> --> ></el-cascader> -->
</div> </div>
</div> </div>
<!-- 导出按钮 -->
<!-- <el-button type="primary" style="margin-left: 80px;margin-top: 20px" @click="dataExport">数据导出</el-button> -->
<!-- 模拟查看按钮 -->
</div> </div>
<!-- 详情弹窗 -->
<el-dialog
title="权益明细"
:visible.sync="detailsVisible"
width="1200px"
:before-close="detailClose"
>
<div>用户信息:</div>
<el-form
:inline="true"
:model="userInformationForm"
class="demo-form-inline"
>
<span class="topFirstItem">
<el-form-item label="账号:">
{{ userInformationForm.mobile }}
</el-form-item>
</span>
<span class="topItem">
<el-form-item label="激活时间:">
{{ this.date_format(userInformationForm.updatedDate) }}
</el-form-item>
</span>
<span class="topItem">
<el-form-item label="权益卡有效期:">
{{ this.date_format(userInformationForm.validitDate) }}
</el-form-item>
</span>
</el-form>
<div>权益卡信息:</div>
<el-form
:inline="true"
:model="rightsCardInformationForm"
class="demo-form-inline"
>
<span class="itemLeftContainer">
<el-form-item label="权益卡卡号:">
{{ rightsCardInformationForm.cardNo }}
</el-form-item>
</span>
<span class="itemRightContainer">
<el-form-item label="激活码:">
{{ rightsCardInformationForm.activationCode }}
</el-form-item>
</span>
<span class="itemLeftContainer">
<el-form-item label="权益卡名称:">
<!-- {{ rightsCardInformationForm.memberCardDefine?rightsCardInformationForm.memberCardDefine.memberName:""}} -->
{{ rightsCardInformationForm.memberCardDefine.memberName }}
</el-form-item>
</span>
</el-form>
<div>权益明细:</div>
<!-- 领用详情界面弹窗表格 -->
<d2-table
ref="detailTable"
:tableParams="collectiondetailTable"
:getListApi="getMemberCardDetail"
:searchForm="collectPoupdetailTable"
>
</d2-table>
<span
slot="footer"
class="dialog-footer"
>
<el-button @click="detailsVisible = false">取 消</el-button>
<el-button
type="primary"
@click="detailsVisible = false"
>确 定</el-button>
</span>
</el-dialog>
<!-- 领用界面表格 --> <!-- 领用界面表格 -->
<div class="tablecontainer"> <div class="tablecontainer">
<d2-table <d2-table
...@@ -437,16 +365,6 @@ ...@@ -437,16 +365,6 @@
:getListApi="listRequisitionMemberCard" :getListApi="listRequisitionMemberCard"
:beforeSearchFn="changeCollectionDataFormat" :beforeSearchFn="changeCollectionDataFormat"
> >
<span
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
>
<el-button
type="text"
@click="startcollectiondetails(scope.scope)"
>查看详情</el-button>
</span>
</d2-table> </d2-table>
</div> </div>
</div> </div>
...@@ -469,13 +387,13 @@ import { exportExcel } from '@/common.js' ...@@ -469,13 +387,13 @@ import { exportExcel } from '@/common.js'
import { import {
generateMemberBatch, generateMemberBatch,
// getlistMemberInfo, // getlistMemberInfo,
getlistByCardName, // getlistByCardName,
// getdetailsMemberInfo, // getdetailsMemberInfo,
listMemberBatch, // listMemberBatch,
listMemberCard, // listMemberCard,
listRequisitionMemberCard, // listRequisitionMemberCard,
getMemberCardDetail, // getMemberCardDetail,
exportMemberCard // exportMemberCard
// exportMemberCardByBatchId // exportMemberCardByBatchId
// getmemberRights // getmemberRights
} from '@/api/test' } from '@/api/test'
...@@ -483,12 +401,6 @@ import { ...@@ -483,12 +401,6 @@ import {
export default { export default {
data() { data() {
return { return {
// 开始时间and结束时间
// startData:"",
// endData:"",
// getmemberRights:getmemberRights,
// exportMemberCard: exportMemberCard,
// rate: ChangeDecimalToPercentage(this.cardsInformationForm.activationCount/this.cardsInformationForm.number),
exportMemberCard: exportMemberCard, exportMemberCard: exportMemberCard,
colletionDate: '', colletionDate: '',
batchDate: '', batchDate: '',
...@@ -502,13 +414,13 @@ export default { ...@@ -502,13 +414,13 @@ export default {
}, },
// 领用弹窗列表搜索 // 领用弹窗列表搜索
collectionListSearch: { collectionListSearch: {
condition: { // condition: {
beginTime: '' || null, startTime: '' || null,
endTime: '' || null, endTime: '' || null,
sn: '', sn: '',
mobile: '', mobile: '',
defineId: '' || null merchantId: '' || null
} // }
}, },
// 批次弹窗列表搜索项 // 批次弹窗列表搜索项
batchPopupListSearch: { batchPopupListSearch: {
...@@ -518,12 +430,12 @@ export default { ...@@ -518,12 +430,12 @@ export default {
}, },
getlistMemberBatch: listMemberBatch, getlistMemberBatch: listMemberBatch,
// 批次列表搜索项 // 批次列表搜索项
selectBatchId: ''||null, selectBatchId: '' || null,
batchListSearch: { batchListSearch: {
batchId: ''||null , batchNo: '' || null,
defineId: '' || null, merchantId: '' || null,
createdDateStart: '', startTime: '',
createdDateEnd: '' endTime: ''
}, },
dialogVisible: false, dialogVisible: false,
activeName: 'first', activeName: 'first',
...@@ -560,11 +472,11 @@ export default { ...@@ -560,11 +472,11 @@ export default {
], ],
// 批次管理表格 // 批次管理表格
MemberBatchVo: { MemberBatchVo: {
count: '', num: '',
defineCode: '', // defineCode: '',
// merchantId: "", merchantId: '',
// merchantName: "", merchantName: '',
remark: '' remarks: ''
}, },
batchTableParams: { batchTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
...@@ -573,26 +485,26 @@ export default { ...@@ -573,26 +485,26 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '批次', label: '批次',
prop: 'batchId' prop: 'batchNo'
}, },
{ {
label: '权益套餐', label: '门店',
prop: 'memberName' prop: 'merchantName'
}, },
{ {
label: '生成数量', label: '生成数量',
prop: 'number' prop: 'num'
// width: 110, // width: 110,
// tagLabel: true // tagLabel: true
}, },
{ {
label: '激活数量', label: '激活数量',
prop: 'activationCount', prop: 'recipientCount',
// minWidth: '200' // minWidth: '200'
formatter: (cellValue) => { formatter: (cellValue) => {
if (cellValue.activationCount) { if (cellValue.recipientCount) {
return cellValue.activationCount return cellValue.recipientCount
} else { } else {
return 0 return 0
} }
...@@ -600,9 +512,9 @@ export default { ...@@ -600,9 +512,9 @@ export default {
}, },
{ {
label: '生成时间', label: '生成时间',
prop: 'createdDateStr', prop: 'createdDate',
formatter: (cellValue) => { formatter: (cellValue) => {
return this.date_format(cellValue.createdDateStr) return this.date_format(cellValue.createdDate)
} }
// formatter: (cellValue) => { // formatter: (cellValue) => {
...@@ -670,7 +582,6 @@ export default { ...@@ -670,7 +582,6 @@ export default {
collectionTableParams: { collectionTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list', listName: 'list',
tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '卡号', label: '卡号',
...@@ -697,19 +608,19 @@ export default { ...@@ -697,19 +608,19 @@ export default {
// // minWidth: '200' // // minWidth: '200'
// }, // },
{ {
label: '权益套餐', label: '门店',
prop: 'memberName', prop: 'merchantName',
minWidth: '200', minWidth: '200',
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.memberCardDefine.memberName return cellValue.merchantName
} }
}, },
{ {
label: '生成时间', label: '生成时间',
prop: 'updatedDate', prop: 'activeTime',
minWidth: '200', minWidth: '200',
formatter: (cellValue) => { formatter: (cellValue) => {
return this.date_format(cellValue.updatedDate) return this.date_format(cellValue.activeTime)
} }
}, },
{ {
...@@ -725,8 +636,9 @@ export default { ...@@ -725,8 +636,9 @@ export default {
prop: 'status', prop: 'status',
formatter: (cellValue) => { formatter: (cellValue) => {
return { return {
1: '已激活', "-1":'初始化',
0: '未激活' "1": '已激活',
"0": '未激活',
}[cellValue.status] }[cellValue.status]
}, },
minWidth: '200' minWidth: '200'
...@@ -735,11 +647,11 @@ export default { ...@@ -735,11 +647,11 @@ export default {
}, },
// 批量生成权益卡弹窗表格 // 批量生成权益卡弹窗表格
generateRightCardsForm: { generateRightCardsForm: {
relatedRightsPackage: '', relatedStores: '',
cardsNumber: '', cardsNumber: '',
remarks: '', remarks: '',
Id: '', merchantId: '',
Code: '' merchantName: ''
}, },
rules: { rules: {
// applicableChannel: [{ required: true, message: "请选择渠道", trigger: "change" }], // applicableChannel: [{ required: true, message: "请选择渠道", trigger: "change" }],
...@@ -749,11 +661,6 @@ export default { ...@@ -749,11 +661,6 @@ export default {
cardsNumber: [{ required: true, message: '请填写张数 ', trigger: 'blur' }] cardsNumber: [{ required: true, message: '请填写张数 ', trigger: 'blur' }]
}, },
// 将id转化成cardId // 将id转化成cardId
// 领用详情界面弹窗
collectPoupdetailTable: {
cardId: ''
},
// 用户详情 // 用户详情
userInformationForm: { userInformationForm: {
detailsVisible: false, detailsVisible: false,
...@@ -768,51 +675,6 @@ export default { ...@@ -768,51 +675,6 @@ export default {
memberName: '', memberName: '',
memberCardDefine: {} memberCardDefine: {}
}, },
// 详情界面table
// 详情弹框权益明细table
collectiondetailTable: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'memberRights',
tableOption: false,
tableColumns: [
{
label: '权益名',
prop: 'name'
// minWidth: '200'
},
{
label: '状态',
prop: 'rightStatus',
formatter: (cellValue) => {
return '正常'
}
},
{
label: '有效期',
prop: 'validitDate',
formatter: (cellValue) => {
var date = cellValue.validitDate.split(' ')[0].split('-')
return `${date[0]}年${date[1]}月${date[2]}日`
}
},
{
label: '剩余次数',
prop: 'brief',
// minWidth: '200'
formatter: () => {
return '不限制'
}
},
{
label: '权益说明',
prop: 'brief',
// minWidth: '200'
formatter: () => {
return '暂无说明'
}
}
]
},
// 批次管理详情弹窗 // 批次管理详情弹窗
cardsInformationForm: { cardsInformationForm: {
batchdetailsVisible: false, batchdetailsVisible: false,
...@@ -822,7 +684,8 @@ export default { ...@@ -822,7 +684,8 @@ export default {
batchId: '', batchId: '',
generateNumber: '', generateNumber: '',
activation: '', activation: '',
memberName: '' memberName: '',
storeName:''
}, },
// 权益明细 // 权益明细
BatchDetailInformationForm: { BatchDetailInformationForm: {
...@@ -879,9 +742,6 @@ export default { ...@@ -879,9 +742,6 @@ export default {
this.baseDate.equityList = res this.baseDate.equityList = res
}) })
}, },
activated() {
console.log(1111)
},
methods: { methods: {
fetch(url, params) { fetch(url, params) {
return new Promise((resolve) => { return new Promise((resolve) => {
...@@ -911,11 +771,11 @@ export default { ...@@ -911,11 +771,11 @@ export default {
// 领用界面导出 // 领用界面导出
exportCollection() { exportCollection() {
var data = { var data = {
beginTime: this.collectionListSearch.condition.beginTime, beginTime: this.collectionListSearch. startTime,
endTime: this.collectionListSearch.condition.endTime, endTime: this.collectionListSearch.endTime,
sn: this.collectionListSearch.condition.sn, sn: this.collectionListSearch.sn,
mobile: this.collectionListSearch.condition.mobile, mobile: this.collectionListSearch.mobile,
defineId: this.collectionListSearch.condition.defineId defineId: this.collectionListSearch. merchantId
} }
const url = const url =
...@@ -956,8 +816,8 @@ export default { ...@@ -956,8 +816,8 @@ export default {
// 批量生成change // 批量生成change
generateCardsformat(e) { generateCardsformat(e) {
console.log(e) console.log(e)
this.generateRightCardsForm.Id = e.id this.generateRightCardsForm.merchantId = e.id
this.generateRightCardsForm.Code = e.defineCode this.generateRightCardsForm.merchantName = e.defineCode
}, },
// 去重 // 去重
...@@ -972,16 +832,16 @@ export default { ...@@ -972,16 +832,16 @@ export default {
// 改变批次日期数据格式 // 改变批次日期数据格式
changeBatchDataFormat() { changeBatchDataFormat() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.batchListSearch.createdDateEnd = this.batchDate this.batchListSearch.endTime = this.batchDate
? this.batchDate[1] + ' 23:59:59' ? this.batchDate[1] + ' 23:59:59'
: '' : ''
this.batchListSearch.createdDateStart = this.batchDate this.batchListSearch.startTime = this.batchDate
? this.batchDate[0] + ' 00:00:01' ? this.batchDate[0] + ' 00:00:01'
: '' : ''
if(this.selectBatchId){ if (this.selectBatchId) {
this.batchListSearch.batchId = +this.selectBatchId this.batchListSearch.batchNo = +this.selectBatchId
}else{ } else {
this.batchListSearch.batchId = null this.batchListSearch.batchNo = null
} }
console.log(this.batchListSearch) console.log(this.batchListSearch)
resolve() resolve()
...@@ -991,18 +851,18 @@ export default { ...@@ -991,18 +851,18 @@ export default {
changeCollectionDataFormat() { changeCollectionDataFormat() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if ( if (
this.collectionListSearch.condition.sn.length > 2 || this.collectionListSearch.sn.length > 2 ||
this.collectionListSearch.condition.sn.length < 1 this.collectionListSearch.sn.length < 1
) { ) {
if ( if (
this.collectionListSearch.condition.mobile.length > 2 || this.collectionListSearch.mobile.length > 2 ||
this.collectionListSearch.condition.mobile.length < 1 this.collectionListSearch.mobile.length < 1
) { ) {
console.log(this.colletionDate) console.log(this.colletionDate)
this.collectionListSearch.condition.endTime = this.colletionDate this.collectionListSearch.endTime = this.colletionDate
? this.colletionDate[1] + ' 23:59:59' ? this.colletionDate[1] + ' 23:59:59'
: '' || undefined : '' || undefined
this.collectionListSearch.condition.beginTime = this.colletionDate this.collectionListSearch.startTime = this.colletionDate
? this.colletionDate[0] + ' 00:00:01' ? this.colletionDate[0] + ' 00:00:01'
: '' || undefined : '' || undefined
resolve() resolve()
...@@ -1076,13 +936,13 @@ export default { ...@@ -1076,13 +936,13 @@ export default {
// 批量制造卡片 // 批量制造卡片
generateCards(formName) { generateCards(formName) {
var params = { var params = {
count: +this.generateRightCardsForm.cardsNumber, num: +this.generateRightCardsForm.cardsNumber,
defineId: +this.generateRightCardsForm.Id, merchantId: +this.generateRightCardsForm.merchantId,
defineCode: this.generateRightCardsForm.Code, merchantName: this.generateRightCardsForm.merchantName,
// merchantId: this.merchantId, // merchantId: this.merchantId,
// merchantName: this.merchantName + '', // merchantName: this.merchantName + '',
// remarks清空后转为空字符串,不然会undefined // remarks清空后转为空字符串,不然会undefined
remark: this.generateRightCardsForm.remarks || '' remarks: this.generateRightCardsForm.remarks || ''
} }
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
...@@ -1169,7 +1029,7 @@ h2 { ...@@ -1169,7 +1029,7 @@ h2 {
margin-left: 10px; margin-left: 10px;
} }
.firstpickerContainer { .firstpickerContainer {
margin-left: 20px; margin-left: 50px;
margin-top: 20px; margin-top: 20px;
} }
.lastpickerContainer { .lastpickerContainer {
......
import App from './index.vue'
import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common'
base.getConfig().then(data => {
const { vue, config } = data
vue.use(GlsxVueCommon, config)
base.render(App)
})
<!-- -->
<template>
<div class="container">
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="200px"
class="demo-ruleForm"
label-position="right"
>
<div class="baseinformation">基础信息</div>
<div class="itemContainer">
<el-form-item
label="权益卡名称:"
prop="name"
>
<el-input
v-model="ruleForm.name"
style="width: 60%"
id="name"
size="mini"
></el-input>
</el-form-item>
<el-form-item
label="权益卡说明:"
prop="explain"
>
<el-input
maxlength="200"
type="textarea"
v-model="ruleForm.explain"
style="width: 60%"
id="explain"
size="mini"
></el-input>
</el-form-item>
<el-form-item
label="套餐有效期:"
prop="validity"
>领卡时起
<el-input-number
v-model="ruleForm.validity"
controls-position="right"
:min="1"
:max="999"
size="mini"
id="validity"
></el-input-number>
月内有效
</el-form-item>
</div>
<div>权益配置</div>
<div class="itemContainer">
<el-form-item>
<el-checkbox
v-model="ruleForm.currencyCheckbox"
@change="startcurrencyInputioncheck"
>停驶返嘀币</el-checkbox>
</el-form-item>
<el-form-item
label="返嘀币(天):"
prop="currencyInpution"
>
<el-input-number
v-model="ruleForm.currencyInpution"
size="mini"
style="width: 60%"
:disabled="!ruleForm.currencyCheckbox"
id="currencyInpution"
:min="0"
:max="999"
controls-position="right"
></el-input-number>
</el-form-item>
</div>
<div class="itemContainer">
<el-form-item>
<el-checkbox
v-model="ruleForm.oilCheckbox"
@change="startoilInputioncheck"
>加油无忧</el-checkbox>
</el-form-item>
<el-form-item
label="油站推荐半径:"
prop="oilInpution"
>
<el-input-number
v-model="ruleForm.oilInpution"
size="mini"
style="width: 60%"
:disabled="!ruleForm.oilCheckbox"
id="oilInpution"
:min="0"
:max="999"
controls-position="right"
></el-input-number>公里
</el-form-item>
<el-form-item
label="加油优惠推送最长间隔 :"
prop="timeInpution"
>
<el-input-number
v-model="ruleForm.timeInpution"
placeholder="若车主近期无加油记录,系统将触发该规则进行消息推送"
size="mini"
style="width: 60%"
:disabled="!ruleForm.oilCheckbox"
id="timeInpution"
type="number"
:min="0"
:max="999"
controls-position="right"
></el-input-number>天
</el-form-item>
</div>
<div class="itemContainer">
<el-form-item>
<el-checkbox
v-model="ruleForm.worryFreeCheckbox"
@change="startpushCollisioncheck"
>出险无忧</el-checkbox>
</el-form-item>
<!-- <el-form-item
label="启用碰撞推送:"
prop="pushCollision"
>
<el-switch
v-model="ruleForm.pushCollision"
active-text="开"
inactive-text="关"
active-color="#13ce66"
inactive-color="#ff4949"
:disabled="!ruleForm.worryFreeCheckbox"
>
</el-switch>
</el-form-item> -->
</div>
<div class="itemContainer">
<el-form-item>
<el-checkbox
v-model="ruleForm.specialOfferCheckbox"
@change="startrebateRatiocheck"
>特惠商品</el-checkbox>
</el-form-item>
<el-form-item
label="嘀币返利比例(%):"
prop="rebateRatio"
>
<el-input-number
v-model="ruleForm.rebateRatio"
size="mini"
placeholder="如设置10%,代表消费100元返利10嘀币"
style="width: 60%"
:disabled="!ruleForm.specialOfferCheckbox"
id="rebateRatio"
type="number"
:min="0"
:max="999"
controls-position="right"
></el-input-number>
</el-form-item>
<el-form-item>
<el-checkbox v-model="ruleForm.rescueCheckbox">救援无忧</el-checkbox>
</el-form-item>
<el-form-item>
<el-checkbox v-model="ruleForm.creditCheckbox">微众车主信用分期</el-checkbox>
</el-form-item>
<el-form-item>
<el-checkbox v-model="ruleForm.meituanCheckbox">美团外卖,天天好劵</el-checkbox>
</el-form-item>
</div>
<div class="buttonContainer">
<el-button
size="middle"
@click="cancel"
>取消</el-button>
<el-button
:plain="true"
size="middle"
@click="jump('ruleForm')"
type="primary"
>提交</el-button>
</div>
</el-form>
</div>
</template>
<script>
import { insertMemberCardDefineRf } from '@/api/test'
export default {
data() {
// var currencyInputionCheck = (rule, value, callback) => {
// if (!value&&this.rules.currencyInpution[0].required==true) {
// return callback(new Error('请填写嘀币值'));
// }
// if (!Number.isInteger(value)&&this.rules.currencyInpution[0].required==true) {
// this.$refs.ruleForm.clearValidate()
// callback(new Error('请输入数字值'));
// }
// };
return {
// MemberCardDefineRightsVo:{
// description:ruleForm.explain,
// equityItemJson:,
// name:ruleForm.name,
// validitVaule:""
// },
ruleForm: {
name: '',
explain: '',
validity: 1,
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
currencyCheckbox: false,
currencyInpution: '',
oilCheckbox: false,
oilInpution: '',
timeInpution: '',
worryFreeCheckbox: false,
pushCollision: false,
rebateRatio: '',
specialOfferCheckbox: false,
exchangeStandard: false,
rescueCheckbox: false,
creditCheckbox: false,
// rescueWorryFree: null,
creditInstallment: null,
meiTuan: null,
meituanCheckbox: false
},
rules: {
name: [
{
required: true,
message: '请输入长度在2-10以内的权益卡名称',
trigger: 'blur'
},
{ min: 2, max: 10, message: '长度在 2 到 10 个字符', trigger: 'blur' }
],
validity: [{ required: true, message: '请选择有效期', trigger: 'blur' }],
currencyInpution: [{ required: false, message: '请填写加油半径', trigger: 'blur' }],
timeInpution: [{ required: false, message: '请填写时间间隔', trigger: 'blur' }],
rebateRatio: [{ required: false, message: '请填写嘀币返利比例', trigger: 'blur' }]
// currencyInpution: [
// { required: true, message: "请填写返回的嘀币数", trigger: "blur" },
// ],
// oilInpution: [{ required: true, message: "请填写推荐半径", trigger: "blur" }],
// timeInpution: [{ required: true, message: "请填写最大天数", trigger: "blur" }],
// rebateRatio: [{ required: true, message: "请填写返利比例", trigger: "blur" }],
}
}
},
activated() {
console.log(1111)
},
methods: {
// 开启input验证
startcurrencyInputioncheck() {
this.rules.currencyInpution[0].required = !this.rules.currencyInpution[0].required
this.$refs.ruleForm.clearValidate()
this.ruleForm.currencyInpution = ''
},
startoilInputioncheck() {
this.rules.timeInpution[0].required = !this.rules.timeInpution[0].required
this.$refs.ruleForm.clearValidate()
this.ruleForm.timeInpution = ''
this.ruleForm.oilInpution = ''
},
startpushCollisioncheck() {
this.rules.pushCollision[0].required = !this.rules.pushCollision[0].required
this.$refs.ruleForm.clearValidate()
this.ruleForm.pushCollision = ''
},
startrebateRatiocheck() {
this.rules.rebateRatio[0].required = !this.rules.rebateRatio[0].required
this.$refs.ruleForm.clearValidate()
this.ruleForm.rebateRatio = ''
},
// 检验跳转
jumpScroll(nameId) {
var dom = document.getElementById(nameId)
document.documentElement.scrollTop = dom.clientHeight
// document.getElementById(nameId).scrollIntoView()
},
cancel() {
window.history.go(-1)
this.ruleForm = {}
},
clear(params, arr = []) {
// console.log(params);
for (let i in params) {
if (params[i] instanceof Array) {
for (let j in params[i]) this.clear(params[i][j])
}
if (params[i] instanceof Object) this.clear((params[i]))
if ((params[i] == '' || params[i] == null || params[i] == undefined) && !arr.find(item => item == i)) delete params[i]
}
// console.log(params);
return params
},
jump(formName) {
let submit = false
this.jumpScroll('validity')
var equityItemJson = {
returnDicoins: +this.ruleForm.currencyInpution,
oilworry: {
oilRecommendRadius: +this.ruleForm.oilInpution,
oilRemindInterval: +this.ruleForm.timeInpution
},
collisionPush: this.ruleForm.pushCollision,
dicoinRebateRatio: +this.ruleForm.rebateRatio,
// rescueWorryFree: this.ruleForm.rescueWorryFree,
creditInstallment: this.ruleForm.creditInstallment,
meiTuan: this.ruleForm.meiTuan
}
var equityItem = this.clear(equityItemJson)
console.log(this.ruleForm);
var params = {
memberDescription: this.ruleForm.explain,
memberName: this.ruleForm.name,
validitVaule: this.ruleForm.validity || 0,
rightsList: []
}
// console.log(params, '-----')
if (this.ruleForm.currencyCheckbox) {
params.rightsList.push({
rightsId: 20,
equityItemJson: JSON.stringify({ returnDicoins: equityItem.returnDicoins })
})
submit = true
}
if (this.ruleForm.oilCheckbox) {
params.rightsList.push({
rightsId: 21,
equityItemJson: JSON.stringify(equityItem.oilworry)
})
submit = true
}
if (this.ruleForm.worryFreeCheckbox) {
params.rightsList.push({
rightsId: 22
// equityItemJson: JSON.stringify(equityItem)
})
submit = true
}
if (this.ruleForm.specialOfferCheckbox) {
params.rightsList.push({
rightsId: 23,
equityItemJson: JSON.stringify({ dicoinRebateRatio: equityItem.dicoinRebateRatio })
})
submit = true
}
if (this.ruleForm.rescueCheckbox) {
params.rightsList.push({
rightsId: 24
// equityItemJson: JSON.stringify(equityItem)
})
submit = true
}
if (this.ruleForm.creditCheckbox) {
params.rightsList.push({
rightsId: 25
// equityItemJson: JSON.stringify(equityItem)
})
submit = true
}
if (this.ruleForm.meituanCheckbox) {
params.rightsList.push({
rightsId: 26
// equityItemJson: JSON.stringify(equityItem)
})
submit = true
}
this.$refs[formName].validate((valid, options) => {
if (valid) {
if (submit == true) {
var data = this.clear(params, ['validitVaule'])
insertMemberCardDefineRf(data).then((res) => {
if (res > 0) {
window.history.go(-1)
this.ruleForm = {}
// this.$message({
// message: '增加成功!',
// type: 'success'
// })
} else {
this.$message({
message: '增加失败!',
type: 'error'
})
}
})
} else {
this.$message({
message: '请至少选择一项服务!',
type: 'error'
})
}
} else {
console.log(Object.keys(options))
// 转换成prop对应的id,需要分别转,最好id取唯一的prop值
// var temp = {
// "name": 'nameId'
// }
// this.jumpScroll(temp[Object.keys(options)[0]])
this.jumpScroll(Object.keys(options)[0])
// console.log('----------------')
return false
}
})
// if (this.ruleForm.name) {
// if (this.submit == true) {
// insertMemberCardDefineRf(params).then((res) => {
// // console.log(res)
// if (res > 0) {
// window.history.go(-1);
// ruleForm = {};
// } else {
// this.$message({
// message: "增加失败",
// type: "error",
// });
// }
// });
// } else {
// this.$message({
// message: "需开通至少一项服务",
// type: "error",
// });
// }
// } else {
// this.$message({
// message: "权益卡名称不能为空",
// type: "error",
// });
// }
}
// inableInpution(checkStatus, inputStatus) {
// this[inputStatus] = !this[checkStatus]
// // if(this.stopdriving==true){
// // this. stopdrivingInpution=false
// // }else{
// // this. stopdrivingInpution=true
// // }
// }
}
}
</script>
<style>
* {
padding: 0;
margin: 0;
border: 0;
}
.container {
height: 900px;
margin-left: 100px;
margin-top: 20px;
}
.itemContainer {
margin-left: 20px;
margin-top: 20px;
}
.buttonContainer {
margin-left: 40%;
margin-top: 50px;
}
</style>
<!-- --> <!-- -->
<template> <template>
<div class="contianer"> <div class="contianer">
<div class="button"> <div class="topline">
<el-button <div class="button">
type="primary" <el-button
@click="addCard" type="primary"
>新建权益卡</el-button> @click="addCard"
>新建权益卡</el-button>
</div>
<el-select
v-model="searchForm.merchantName"
filterable
placeholder="请选择门店"
>
<el-option
v-for="(item,index) in storeOptions"
:key="index"
:label="item.storeName"
:value="item.storeValue"
>
</el-option>
</el-select>
<div class="buttonContainer">
<el-button
:id="tableParams.btnId"
type="primary"
icon="el-icon-search"
>搜索</el-button>
</div>
</div> </div>
<div class="tablecontainer"> <div class="tablecontainer">
<d2-table <d2-table
ref="recordTable" ref="recordTable"
...@@ -19,15 +42,154 @@ ...@@ -19,15 +42,154 @@
slot-scope="scope" slot-scope="scope"
:data="scope.scope" :data="scope.scope"
> >
<el-button type="text"></el-button> <el-button
type="text"
@click="edit(scope.scope)"
>编辑</el-button>
<el-button
type="text"
@click="copy(scope.scope)"
>复制</el-button>
</span> </span>
</d2-table> </d2-table>
</div> </div>
<!-- 新建权益卡弹窗 -->
<el-dialog
title=""
:visible.sync="dialogVisible"
width="985px"
>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="120px"
class="demo-ruleForm"
label-position="left"
>
<!-- 基础表单 -->
<div class="baseinformation"> <span class="titleText">基本信息</span> </div>
<div class="form">
<el-form-item
label="名称"
prop="name"
style="width: 30%"
id="name"
>
<el-input
v-model="ruleForm.name"
maxlength="10"
type="text"
size="mini"
></el-input>
</el-form-item>
<el-form-item
label="卡片样式:"
prop="cardStyle"
>
<div class="imageList">
<div
v-for="(item,index) in product"
:key="index"
:id=item.id
@click="changeStyle(item.id)"
class="imgCtn"
>
<img
:src="item.imgSrc"
alt=""
class="imageItem"
>
</div>
</div>
</el-form-item>
<el-form-item
label="渠道门店"
prop="store"
>
<el-select
v-model="ruleForm.store"
filterable
placeholder="请选择门店"
size="mini"
>
<el-option
v-for="(item,index) in storeOptions"
:key="index"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="有效期:"
prop="resource"
>
<el-radio-group v-model="ruleForm.resource">
<el-radio
label="永久有效"
@change="e => controlSwitch(e, 'disable')"
>永久有效</el-radio>
<el-radio
:label="month"
@change="e => controlSwitch(e, 'input')"
>领取时起<el-input-number
v-model="month"
controls-position="right"
:min="1"
:max="999"
id="month"
:disabled="inputSwitch"
size="mini"
change=""
></el-input-number>
天内有效</el-radio>
<el-radio
:label="data"
@change="e => controlSwitch(e, 'data')"
>
<el-date-picker
v-model="data"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:disabled="dataSwitch"
size="mini"
>
</el-date-picker>
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="使用说明:"
prop="desc"
>
<el-input
type="textarea"
v-model="ruleForm.desc"
maxlength="500"
></el-input>
</el-form-item>
</div>
<div class="buttonCtn">
<el-form-item>
<el-button
type="primary"
@click="submitForm('ruleForm')"
>提交</el-button>
<el-button @click="resetForm('ruleForm')">取消</el-button>
</el-form-item>
</div>
</el-form>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
function date_format (d) { function date_format(d) {
var date = new Date(d) var date = new Date(d)
var Y = date.getFullYear() + '-' var Y = date.getFullYear() + '-'
var M = var M =
...@@ -38,12 +200,69 @@ function date_format (d) { ...@@ -38,12 +200,69 @@ function date_format (d) {
import { listMemberCardDefine } from '@/api/test' import { listMemberCardDefine } from '@/api/test'
// import {memberCardDetails} from "@/api/test"; // import {memberCardDetails} from "@/api/test";
export default { export default {
data () { data() {
return { return {
//门店搜索下拉框
store: '',
//弹窗界面
merchantName:'',
dialogVisible: false,
src: './images/yiquan.jpg',
inputSwitch: true,
dataSwitch: true,
storeOptions: [],
month: '',
data: '',
ruleForm: {
name: '',
cardStyle: '',
desc: '',
store: '',
resource: '',
},
product: [
{
id: "firstImg",
imgSrc: require("./images/yiquan.jpg"),
},
{
id: "secondImg",
imgSrc: require("./images/yiquan.jpg"),
},
{
id: "thirdImg",
imgSrc: require("./images/yiquan.jpg"),
},
{
id: "forthImg",
imgSrc: require("./images/yiquan.jpg"),
},
],
rules: {
name: [
{ required: true, message: '请输入名称', trigger: 'change' },
{ min: 1, max: 15, message: '请输入是15字以内的名称', trigger: 'blur' }
],
resource: [
{ required: true, message: '请选择有效期类型', trigger: 'change' }
],
cardStyle: [
{ required: true, message: '请选择卡片', trigger: 'change' }
],
desc: [
{ min: 0, max: 10, message: '请输入500字以内的名称', trigger: 'blur' }
],
store: [
{ required: true, message: '请选择门店', trigger: 'change' }
],
},
//权益卡管理界面
date_format, date_format,
getListApi: listMemberCardDefine, getListApi: listMemberCardDefine,
// getListApi: none, // getListApi: none,
searchForm: null, searchForm: {
merchantName: ''
},
tableParams: { tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list', listName: 'list',
...@@ -55,6 +274,18 @@ export default { ...@@ -55,6 +274,18 @@ export default {
// minWidth: '200' // minWidth: '200'
}, },
{ {
label: '门店名称',
prop: 'store',
minWidth: '200',
formatter: (cellValue) => {
let arr = []
cellValue.memberRights.map(e => {
if (e) arr.push(e.name)
})
return arr.join('、')
}
},
{
label: '有效期', label: '有效期',
prop: 'dateExpire', prop: 'dateExpire',
formatter: (cellValue) => { formatter: (cellValue) => {
...@@ -66,29 +297,12 @@ export default { ...@@ -66,29 +297,12 @@ export default {
} }
}, },
{ {
label: '权益内容', label: '领卡用户',
prop: 'name',
minWidth: '200',
formatter: (cellValue) => {
const arr = []
cellValue.memberRights.map(e => {
if (e) arr.push(e.name)
})
return arr.join('、')
}
},
{
label: '领卡人数',
prop: 'activationCount' prop: 'activationCount'
// width: 110, // width: 110,
// tagLabel: true // tagLabel: true
}, },
{ {
label: '创建时间',
prop: 'createdDateStr'
// minWidth: '200'
},
{
label: '状态', label: '状态',
prop: 'status', prop: 'status',
formatter: (cellValue) => { formatter: (cellValue) => {
...@@ -96,7 +310,11 @@ export default { ...@@ -96,7 +310,11 @@ export default {
1: '正常' 1: '正常'
}[cellValue.status] }[cellValue.status]
} }
},
{
label: '创建时间',
prop: 'createdDateStr'
// minWidth: '200'
}, },
{ {
label: '备注', label: '备注',
...@@ -108,27 +326,102 @@ export default { ...@@ -108,27 +326,102 @@ export default {
} }
} }
}, },
mounted () { mounted() {
// 门店下拉框的的获取
// getStoreList({}).then((res) => {
// this.storeOptions = res
// })
}, },
methods: { methods: {
addCard () { //编辑
window.location.href = '/customer/newEquityCard.html' edit(row) {
console.log(row)
this.dialogVisible = true
this.ruleForm = row
},
//复制
copy(row) {
console.log(row)
this.dialogVisible = true
this.ruleForm = row
} },
// handleEdit() { addCard() {
// // }, this.dialogVisible = true
// updateRightCardTable(params = {}) { },
// var _this = this; groupChange(value) {
// request console.log(value);
// .req("/rightCardManagement", params) },
// .then(function (res) { //弹窗界面
// console.log(res); //clear imageStyle
// _this. = res. rightsCardManagement; clearStyle() {
// }) var firstImgStyle = document.getElementById('firstImg')
// .catch(function (error) { var secondImgStyle = document.getElementById('secondImg')
// console.log(error); var thirdImgStyle = document.getElementById('thirdImg')
// }); var forthImgStyle = document.getElementById('forthImg')
// }, firstImgStyle.style.background = secondImgStyle.style.background = thirdImgStyle.style.background = forthImgStyle.style.background = "rgb(240, 240, 240)"
},
//change imageStyle
changeStyle(cd) {
// console.log(cd)
this.clearStyle()
var imgItem = document.getElementById(cd)
imgItem.style.background = "rgb(255, 173, 134)"
this.ruleForm.cardStyle = cd
this.$refs.ruleForm.validateField('cardStyle')
console.log(this.ruleForm)
},
//checkbox的input开关
controlSwitch(value, cd) {
console.log(value)
if (cd == 'disable') {
this.inputSwitch = this.dataSwitch = true
this.ruleForm.month = ''
this.ruleForm.data = ''
} else if (cd == 'input') {
this.inputSwitch = false
this.dataSwitch = true
this.ruleForm.data = ''
} else {
this.inputSwitch = true
this.dataSwitch = false
this.ruleForm.month = ''
}
},
//提交验证
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
console.log(this.month);
// Interface(this.ruleForm).then((res) => {
// console.log(res)
// if (res > 0) {
// this.ruleForm = {};
// this.dialogVisible = false
// this.$message({
// message: "添加成功",
// type: "success",
// });
// } else {
// this.$message({
// message: "增加失败",
// type: "error",
// });
// }
// });
// } else {
// this.$message({
// message: "请正确填写信息",
// type: "error",
// });
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
this.dialogVisible = false
},
} }
} }
</script> </script>
...@@ -138,14 +431,92 @@ export default { ...@@ -138,14 +431,92 @@ export default {
margin: 0; margin: 0;
border: 0; border: 0;
} }
.button {
margin-left: 20px;
margin-top: 20px;
}
.tablecontainer { .tablecontainer {
margin-top: 20px; margin-top: 20px;
margin-left: 20px; margin-left: 20px;
margin-right: 20px; margin-right: 20px;
} }
/* 弹窗界面样式 */
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 14px;
color: #8c939d;
width: 40px;
height: 30px;
line-height: 30px;
text-align: center;
}
.avatar {
width: 40px;
height: 30px;
display: block;
}
.baseinformation {
width: 100%;
background: #d3d3d3;
height: 60px;
line-height: 60px;
margin-top: -40px;
}
.titleText {
margin-left: 20px;
}
.form {
margin-top: 20px;
margin-left: 40px;
}
.explain {
color: #d3d3d3;
}
.buttonCtn {
text-align: center;
margin-left: -100px;
}
.carEquCtn {
background: #f0f0f0;
}
.shopEquCtn {
background: #f0f0f0;
}
.imageList {
display: flex;
flex-direction: row;
}
.imageItem {
width: 150px;
height: 60px;
}
.imgCtn {
background: rgb(240, 240, 240);
width: 170px;
text-align: center;
padding: 10px;
height: 80px;
margin-right: 20px;
}
.topline {
display: flex;
flex-direction: row;
margin-left: 20px;
margin-top: 20px;
}
.button {
margin-right: 40px;
}
.buttonContainer {
margin-left: 40px;
}
.el-dialog__headerbtn {
display: none;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!