Commit 85856be0 by zhouzy

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

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