Commit 85856be0 by zhouzy

新建权益卡有效期为0不传值的问题

1 parent 20223106
...@@ -151,7 +151,6 @@ ...@@ -151,7 +151,6 @@
:getListApi="listMemberCard" :getListApi="listMemberCard"
:searchForm="batchPopupListSearch" :searchForm="batchPopupListSearch"
:beforeSearchFn="beforebatchPopupListSearch" :beforeSearchFn="beforebatchPopupListSearch"
> >
</d2-table> </d2-table>
<span <span
...@@ -465,7 +464,7 @@ function date_format(d) { ...@@ -465,7 +464,7 @@ function date_format(d) {
var D = date.getDate() + ' ' var D = date.getDate() + ' '
return Y + M + D return Y + M + D
} }
import axios from 'axios' // import axios from 'axios'
import { exportExcel } from '@/common.js' import { exportExcel } from '@/common.js'
import { import {
generateMemberBatch, generateMemberBatch,
...@@ -476,8 +475,8 @@ import { ...@@ -476,8 +475,8 @@ import {
listMemberCard, listMemberCard,
listRequisitionMemberCard, listRequisitionMemberCard,
getMemberCardDetail, getMemberCardDetail,
exportMemberCard, exportMemberCard
exportMemberCardByBatchId // exportMemberCardByBatchId
// getmemberRights // getmemberRights
} from '@/api/test' } from '@/api/test'
...@@ -506,7 +505,7 @@ export default { ...@@ -506,7 +505,7 @@ export default {
condition: { condition: {
beginTime: '' || null, beginTime: '' || null,
endTime: '' || null, endTime: '' || null,
sn: '' , sn: '',
mobile: '', mobile: '',
defineId: '' || null defineId: '' || null
} }
...@@ -526,7 +525,6 @@ export default { ...@@ -526,7 +525,6 @@ export default {
createdDateStart: '', createdDateStart: '',
createdDateEnd: '' createdDateEnd: ''
}, },
dialogVisible: false, dialogVisible: false,
activeName: 'first', activeName: 'first',
// 批次管理和领用管理picker // 批次管理和领用管理picker
...@@ -628,7 +626,7 @@ export default { ...@@ -628,7 +626,7 @@ export default {
// 批次管理弹窗table // 批次管理弹窗table
batchdetailPopupTable: { batchdetailPopupTable: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list", listName: 'list',
tableOption: false, tableOption: false,
tableColumns: [ tableColumns: [
{ {
...@@ -648,17 +646,14 @@ export default { ...@@ -648,17 +646,14 @@ export default {
label: '激活时间', label: '激活时间',
prop: 'updatedDate', prop: 'updatedDate',
formatter: (cellValue) => { formatter: (cellValue) => {
if(cellValue.status==0){ if (cellValue.status == 0) {
return '' return ''
} }
else{ else {
return this.date_format(cellValue.updatedDate); return this.date_format(cellValue.updatedDate)
}
} }
}, },
// width: 110,
// tagLabel: true
},
{ {
label: '状态', label: '状态',
prop: 'status', prop: 'status',
...@@ -799,7 +794,6 @@ export default { ...@@ -799,7 +794,6 @@ export default {
var date = cellValue.validitDate.split(' ')[0].split('-') var date = cellValue.validitDate.split(' ')[0].split('-')
return `${date[0]}年${date[1]}月${date[2]}日` return `${date[0]}年${date[1]}月${date[2]}日`
} }
}, },
{ {
label: '剩余次数', label: '剩余次数',
...@@ -816,7 +810,6 @@ export default { ...@@ -816,7 +810,6 @@ export default {
formatter: () => { formatter: () => {
return '暂无说明' return '暂无说明'
} }
} }
] ]
}, },
...@@ -907,7 +900,7 @@ export default { ...@@ -907,7 +900,7 @@ export default {
var data = { var data = {
batchId: this.batchPopupListSearch.batchId, batchId: this.batchPopupListSearch.batchId,
mobile: this.BatchDetailInformationForm.account, mobile: this.BatchDetailInformationForm.account,
cardNo:this.BatchDetailInformationForm.cardName cardNo: this.BatchDetailInformationForm.cardName
} }
const url = const url =
......
...@@ -220,7 +220,6 @@ export default { ...@@ -220,7 +220,6 @@ export default {
currencyInpution: [{ required: false, message: '请填写嘀币值', trigger: 'blur' }], currencyInpution: [{ required: false, message: '请填写嘀币值', trigger: 'blur' }],
timeInpution: [{ required: false, message: '请填写最长间隔', trigger: 'blur' }], timeInpution: [{ required: false, message: '请填写最长间隔', trigger: 'blur' }],
rebateRatio: [{ required: false, message: '嘀币返利比例', trigger: 'blur' }] rebateRatio: [{ required: false, message: '嘀币返利比例', trigger: 'blur' }]
// currencyInpution: [ // currencyInpution: [
// { required: true, message: "请填写返回的嘀币数", trigger: "blur" }, // { required: true, message: "请填写返回的嘀币数", trigger: "blur" },
// ], // ],
...@@ -261,27 +260,26 @@ export default { ...@@ -261,27 +260,26 @@ export default {
window.history.go(-1) window.history.go(-1)
this.ruleForm = {} this.ruleForm = {}
}, },
clear(params) { clear(params, arr = []) {
console.log(params); // console.log(params);
for (let i in params) { for (let i in params) {
if (params[i] instanceof Array) { if (params[i] instanceof Array) {
for (let j in params[i]) this.clear(params[i][j]) for (let j in params[i]) this.clear(params[i][j])
} }
if (params[i] instanceof Object) this.clear((params[i])) if (params[i] instanceof Object) this.clear((params[i]))
if (params[i] == '' || params[i] == null || params[i] == undefined) delete params[i] if ((params[i] == '' || params[i] == null || params[i] == undefined) && !arr.find(item => item == i) ) delete params[i]
} }
console.log(params); // console.log(params);
return params return params
}, },
jump(formName) { jump(formName) {
let submit = false let submit = false
this.jumpScroll('validity') this.jumpScroll('validity')
var equityItemJson = { var equityItemJson = {
returnDicoins: +this.ruleForm.currencyInpution, returnDicoins: +this.ruleForm.currencyInpution,
oilworry: { oilworry: {
oilRecommendRadius: +this.ruleForm.oilInpution, oilRecommendRadius: +this.ruleForm.oilInpution,
oilRemindInterval: +this.ruleForm.timeInpution, oilRemindInterval: +this.ruleForm.timeInpution
}, },
collisionPush: this.ruleForm.pushCollision, collisionPush: this.ruleForm.pushCollision,
dicoinRebateRatio: +this.ruleForm.rebateRatio, dicoinRebateRatio: +this.ruleForm.rebateRatio,
...@@ -290,13 +288,14 @@ export default { ...@@ -290,13 +288,14 @@ export default {
meiTuan: this.ruleForm.meiTuan meiTuan: this.ruleForm.meiTuan
} }
var equityItem = this.clear(equityItemJson) var equityItem = this.clear(equityItemJson)
console.log(this.ruleForm);
var params = { var params = {
memberDescription: this.ruleForm.explain, memberDescription: this.ruleForm.explain,
memberName: this.ruleForm.name, memberName: this.ruleForm.name,
validitVaule: this.ruleForm.validity, validitVaule: this.ruleForm.validity || 0,
rightsList: [] rightsList: []
} }
// console.log(params, '-----')
if (this.ruleForm.currencyCheckbox) { if (this.ruleForm.currencyCheckbox) {
params.rightsList.push({ params.rightsList.push({
rightsId: 20, rightsId: 20,
...@@ -313,7 +312,7 @@ export default { ...@@ -313,7 +312,7 @@ export default {
} }
if (this.ruleForm.worryFreeCheckbox) { if (this.ruleForm.worryFreeCheckbox) {
params.rightsList.push({ params.rightsList.push({
rightsId: 22, rightsId: 22
// equityItemJson: JSON.stringify(equityItem) // equityItemJson: JSON.stringify(equityItem)
}) })
submit = true submit = true
...@@ -321,27 +320,27 @@ export default { ...@@ -321,27 +320,27 @@ export default {
if (this.ruleForm.specialOfferCheckbox) { if (this.ruleForm.specialOfferCheckbox) {
params.rightsList.push({ params.rightsList.push({
rightsId: 23, rightsId: 23,
equityItemJson: JSON.stringify({dicoinRebateRatio: equityItem.dicoinRebateRatio}) equityItemJson: JSON.stringify({ dicoinRebateRatio: equityItem.dicoinRebateRatio })
}) })
submit = true submit = true
} }
if (this.ruleForm.rescueCheckbox) { if (this.ruleForm.rescueCheckbox) {
params.rightsList.push({ params.rightsList.push({
rightsId: 24, rightsId: 24
// equityItemJson: JSON.stringify(equityItem) // equityItemJson: JSON.stringify(equityItem)
}) })
submit = true submit = true
} }
if (this.ruleForm.creditCheckbox) { if (this.ruleForm.creditCheckbox) {
params.rightsList.push({ params.rightsList.push({
rightsId: 25, rightsId: 25
// equityItemJson: JSON.stringify(equityItem) // equityItemJson: JSON.stringify(equityItem)
}) })
submit = true submit = true
} }
if (this.ruleForm.meituanCheckbox) { if (this.ruleForm.meituanCheckbox) {
params.rightsList.push({ params.rightsList.push({
rightsId: 26, rightsId: 26
// equityItemJson: JSON.stringify(equityItem) // equityItemJson: JSON.stringify(equityItem)
}) })
submit = true submit = true
...@@ -349,7 +348,7 @@ export default { ...@@ -349,7 +348,7 @@ export default {
this.$refs[formName].validate((valid, options) => { this.$refs[formName].validate((valid, options) => {
if (valid) { if (valid) {
if (submit == true) { if (submit == true) {
var data = this.clear(params) var data = this.clear(params, ['validitVaule'])
insertMemberCardDefineRf(data).then((res) => { insertMemberCardDefineRf(data).then((res) => {
if (res > 0) { if (res > 0) {
window.history.go(-1) window.history.go(-1)
...@@ -379,7 +378,7 @@ export default { ...@@ -379,7 +378,7 @@ export default {
// } // }
// this.jumpScroll(temp[Object.keys(options)[0]]) // this.jumpScroll(temp[Object.keys(options)[0]])
this.jumpScroll(Object.keys(options)[0]) this.jumpScroll(Object.keys(options)[0])
console.log('----------------') // console.log('----------------')
return false return false
} }
}) })
...@@ -410,7 +409,6 @@ export default { ...@@ -410,7 +409,6 @@ export default {
// }); // });
// } // }
} }
// inableInpution(checkStatus, inputStatus) { // inableInpution(checkStatus, inputStatus) {
// this[inputStatus] = !this[checkStatus] // this[inputStatus] = !this[checkStatus]
// // if(this.stopdriving==true){ // // if(this.stopdriving==true){
......
...@@ -58,7 +58,11 @@ export default { ...@@ -58,7 +58,11 @@ export default {
label: '有效期', label: '有效期',
prop: 'dateExpire', prop: 'dateExpire',
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.dateExpire +'月' if (cellValue.dateExpire == 0) {
return '长期有效'
} else {
return cellValue.dateExpire + '月'
}
} }
}, },
{ {
...@@ -68,9 +72,8 @@ export default { ...@@ -68,9 +72,8 @@ export default {
formatter: (cellValue) => { formatter: (cellValue) => {
let arr = [] let arr = []
cellValue.memberRights.map(e => { cellValue.memberRights.map(e => {
if(e) arr.push(e.name) if (e) arr.push(e.name)
}) })
return arr.join('、') return arr.join('、')
} }
}, },
...@@ -82,7 +85,7 @@ export default { ...@@ -82,7 +85,7 @@ export default {
}, },
{ {
label: '创建时间', label: '创建时间',
prop: 'createdDateStr', prop: 'createdDateStr'
// minWidth: '200' // minWidth: '200'
}, },
{ {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!