Commit d888cd34 by zhouzy

更改了一些基础bug

1 parent 64331f6c
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
批次: 批次:
<div class="Input"> <div class="Input">
<el-input <el-input
v-model="batchListSearch.batchId" v-model="selectBatchId"
placeholder="请输入批次号" placeholder="请输入批次号"
size="small" size="small"
></el-input> ></el-input>
...@@ -34,10 +34,10 @@ ...@@ -34,10 +34,10 @@
> >
</div> </div>
</div> </div>
<div class="block"> <div class="firstpickerContainer">
权益套餐: 权益套餐:
<el-select <el-select
v-model="batchListSearch.benefitPackagePickerList" v-model="batchListSearch.defineCode"
placeholder="请选择权益套餐" placeholder="请选择权益套餐"
> >
<el-option <el-option
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
></el-option> ></el-option>
</el-select> </el-select>
</div> </div>
<el-dialog <el-dialog
title="批次明细" title="批次明细"
:visible.sync="batchdetailsVisible" :visible.sync="batchdetailsVisible"
...@@ -167,7 +166,6 @@ ...@@ -167,7 +166,6 @@
<el-button type="primary" @click="generateCards">确 定</el-button> <el-button type="primary" @click="generateCards">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<div class="tablecontainer"> <div class="tablecontainer">
<d2-table <d2-table
ref="batchDetailTable" ref="batchDetailTable"
...@@ -197,6 +195,7 @@ ...@@ -197,6 +195,7 @@
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
size="small" size="small"
value-format="yyyy-MM-dd"
> >
</el-date-picker> </el-date-picker>
</div> </div>
...@@ -210,7 +209,7 @@ ...@@ -210,7 +209,7 @@
></el-input> ></el-input>
</div> </div>
</div> </div>
<div class="InputContainer"> <div class="lastInputContainer">
账号: 账号:
<div class="Input"> <div class="Input">
<el-input <el-input
...@@ -243,7 +242,7 @@ ...@@ -243,7 +242,7 @@
<div class="firstpickerContainer"> <div class="firstpickerContainer">
权益套餐: 权益套餐:
<el-select <el-select
v-model="collectionListSearch.benefitPackagePickerList" v-model="collectionListSearch.defineCode"
placeholder="请选择权益套餐" placeholder="请选择权益套餐"
> >
<el-option <el-option
...@@ -320,6 +319,7 @@ ...@@ -320,6 +319,7 @@
:searchForm="collectionListSearch" :searchForm="collectionListSearch"
:tableParams="collectionTableParams" :tableParams="collectionTableParams"
:getListApi="listRequisitionMemberCard" :getListApi="listRequisitionMemberCard"
> >
<span slot="auth-button" slot-scope="scope" :data="scope.scope"> <span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="startcollectiondetails(scope.scope)" <el-button type="text" @click="startcollectiondetails(scope.scope)"
...@@ -379,18 +379,20 @@ export default { ...@@ -379,18 +379,20 @@ export default {
}, },
// 批次弹窗列表搜索项 // 批次弹窗列表搜索项
batchPopupListSearch: { batchPopupListSearch: {
batchId: "", batchId: '',
cardNo:'',
// mobile:''
}, },
getlistMemberBatch: listMemberBatch, getlistMemberBatch: listMemberBatch,
// 批次列表搜索项 // 批次列表搜索项
selectBatchId: "",
batchListSearch: { batchListSearch: {
batchId: "", batchId: +"",
benefitPackagePickerList: "", defineCode: "",
createdDateStart:"", createdDateStart:"",
createdDateEnd:"" createdDateEnd:""
}, },
merchantId: 1, //领用列表搜索项
merchantName: "三只松鼠",
dialogVisible: false, dialogVisible: false,
beforeSearchFn: null, beforeSearchFn: null,
activeName: "first", activeName: "first",
...@@ -406,11 +408,11 @@ export default { ...@@ -406,11 +408,11 @@ export default {
children: [ children: [
{ {
value: "option1", value: "option1",
label: "", label: ""
}, },
{ {
value: "option2", value: "option2",
label: "", label: ""
}, },
], ],
}, },
...@@ -437,11 +439,11 @@ export default { ...@@ -437,11 +439,11 @@ export default {
children: [ children: [
{ {
value: "option1", value: "option1",
label: "选项一", label: "选项一"
}, },
{ {
value: "option2", value: "option2",
label: "选项二", label: "选项二"
}, },
], ],
}, },
...@@ -451,11 +453,11 @@ export default { ...@@ -451,11 +453,11 @@ export default {
children: [ children: [
{ {
value: "option3", value: "option3",
label: "选项一", label: "选项一"
}, },
{ {
value: "option4", value: "option4",
label: "选项二", label: "选项二"
}, },
], ],
}, },
...@@ -468,11 +470,11 @@ export default { ...@@ -468,11 +470,11 @@ export default {
children: [ children: [
{ {
value: "option1", value: "option1",
label: "选项一", label: "选项一"
}, },
{ {
value: "option2", value: "option2",
label: "选项二", label: "选项二"
}, },
], ],
}, },
...@@ -482,11 +484,11 @@ export default { ...@@ -482,11 +484,11 @@ export default {
children: [ children: [
{ {
value: "option3", value: "option3",
label: "选项一", label: "选项一"
}, },
{ {
value: "option4", value: "option4",
label: "选项二", label: "选项二"
}, },
], ],
}, },
...@@ -495,8 +497,8 @@ export default { ...@@ -495,8 +497,8 @@ export default {
MemberBatchVo: { MemberBatchVo: {
count: "", count: "",
defineCode: "", defineCode: "",
merchantId: "", // merchantId: "",
merchantName: "", // merchantName: "",
remark: "", remark: "",
}, },
batchTableParams: { batchTableParams: {
...@@ -506,27 +508,27 @@ export default { ...@@ -506,27 +508,27 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: "批次", label: "批次",
prop: "batchId", prop: "batchId"
}, },
{ {
label: "权益套餐", label: "权益套餐",
prop: "memberName", prop: "memberName"
}, },
{ {
label: "生成数量", label: "生成数量",
prop: "number", prop: "number"
// width: 110, // width: 110,
// tagLabel: true // tagLabel: true
}, },
{ {
label: "激活数量", label: "激活数量",
prop: "activationCount", prop: "activationCount"
// minWidth: '200' // minWidth: '200'
}, },
{ {
label: "生成时间", label: "生成时间",
prop: "createdDateStr", prop: "createdDateStr"
// formatter: (cellValue) => { // formatter: (cellValue) => {
// return { // return {
// 0: '进行中', // 0: '进行中',
...@@ -540,7 +542,7 @@ export default { ...@@ -540,7 +542,7 @@ export default {
{ {
label: "备注", label: "备注",
prop: "remarks", prop: "remarks",
minWidth: "200", minWidth: "200"
}, },
], ],
}, },
...@@ -553,27 +555,27 @@ export default { ...@@ -553,27 +555,27 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: "卡号", label: "卡号",
prop: "cardNo", prop: "cardNo"
// minWidth: '200' // minWidth: '200'
}, },
{ {
label: "激活码", label: "激活码",
prop: "activationCode", prop: "activationCode"
}, },
{ {
label: "账号", label: "账号",
prop: "mobile", prop: "mobile"
}, },
{ {
label: "激活时间", label: "激活时间",
prop: "updatedDate", prop: "updatedDate"
// width: 110, // width: 110,
// tagLabel: true // tagLabel: true
}, },
{ {
label: "状态", label: "状态",
prop: "status", prop: "status"
// formatter: (cellValue) => { // formatter: (cellValue) => {
// return { // return {
// 0: '进行中', // 0: '进行中',
...@@ -595,20 +597,20 @@ export default { ...@@ -595,20 +597,20 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: "卡号", label: "卡号",
prop: "cardNo", prop: "cardNo"
// minWidth: '200' // minWidth: '200'
}, },
{ {
label: "激活码", label: "激活码",
prop: "activationCode", prop: "activationCode"
}, },
{ {
label: "设备SN", label: "设备SN",
prop: "searchValue", prop: "searchValue"
}, },
{ {
label: "账号", label: "账号",
prop: "mobile", prop: "mobile"
// width: 110, // width: 110,
// tagLabel: true // tagLabel: true
}, },
...@@ -619,7 +621,7 @@ export default { ...@@ -619,7 +621,7 @@ export default {
// }, // },
{ {
label: "权益套餐", label: "权益套餐",
prop: "memberName", prop: "memberName"
// formatter: (cellValue) => { // formatter: (cellValue) => {
// return { // return {
// 0: '进行中', // 0: '进行中',
...@@ -636,7 +638,7 @@ export default { ...@@ -636,7 +638,7 @@ export default {
minWidth: "200", minWidth: "200",
formatter: (cellValue) => { formatter: (cellValue) => {
return this.date_format(cellValue.updatedDate); return this.date_format(cellValue.updatedDate);
}, }
}, },
{ {
label: "有效时间", label: "有效时间",
...@@ -644,21 +646,21 @@ export default { ...@@ -644,21 +646,21 @@ export default {
minWidth: "200", minWidth: "200",
formatter: (cellValue) => { formatter: (cellValue) => {
return this.date_format(cellValue.validitDate); return this.date_format(cellValue.validitDate);
}, }
}, },
{ {
label: "状态", label: "状态",
prop: "status", prop: "status",
minWidth: "200", minWidth: "200"
}, }
], ]
}, },
// 批量生成权益卡弹窗表格 // 批量生成权益卡弹窗表格
generateRightCardsForm: { generateRightCardsForm: {
applicableChannel: "", applicableChannel: "",
relatedRightsPackage: "", relatedRightsPackage: "",
cardsNumber: "", cardsNumber: "",
remarks: "", remarks: ""
}, },
rules: { rules: {
applicableChannel: [{ required: true, message: "请选择渠道", trigger: "change" }], applicableChannel: [{ required: true, message: "请选择渠道", trigger: "change" }],
...@@ -670,34 +672,34 @@ export default { ...@@ -670,34 +672,34 @@ export default {
// 详情界面弹窗 // 详情界面弹窗
// 用户详情 // 用户详情
cardId: "2473", cardId: '2473',
userInformationForm: { userInformationForm: {
detailsVisible: false, detailsVisible: false,
mobile: "", mobile: '',
validitDate: "", validitDate: '',
updatedDate: "", updatedDate: ''
}, },
// 权益卡信息 // 权益卡信息
rightsCardInformationForm: { rightsCardInformationForm: {
cardNo: "", cardNo: '',
activationCode: "", activationCode: '',
memberName: "", memberName: ''
}, },
// 详情界面table // 详情界面table
// 详情弹框权益明细table // 详情弹框权益明细table
detailTable: { detailTable: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list", listName: 'list',
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: "权益名", label: '权益名',
prop: "equityName", prop: 'equityName'
// minWidth: '200' // minWidth: '200'
}, },
{ {
label: "状态", label: '状态',
prop: "status", prop: 'status'
// formatter: (cellValue) => { // formatter: (cellValue) => {
// return { // return {
// 0: '进行中', // 0: '进行中',
...@@ -709,62 +711,56 @@ export default { ...@@ -709,62 +711,56 @@ export default {
// } // }
}, },
{ {
label: "有效期", label: '有效期',
prop: "termOfValidity", prop: 'termOfValidity'
}, },
{ {
label: "账号", label: '账号',
prop: "accountNumber", prop: 'accountNumber'
// width: 110, // width: 110,
// tagLabel: true // tagLabel: true
}, },
{ {
label: "剩余次数", label: '剩余次数',
prop: "remainingTimes", prop: 'remainingTimes'
// minWidth: '200' // minWidth: '200'
}, },
{ {
label: "权益说明", label: '权益说明',
prop: "Description ", prop: 'Description'
// minWidth: '200' // minWidth: '200'
}, }
], ]
}, },
// 批次管理详情弹窗 // 批次管理详情弹窗
cardsInformationForm: { cardsInformationForm: {
batchdetailsVisible: false, batchdetailsVisible: false,
cardName: "", cardName: '',
attributionChannel: "", attributionChannel: '',
generationDate: "", generationDate: '',
batch: "", batch: '',
generateNumber: "", generateNumber: '',
activation: "", activation: ''
},
// 权益卡信息
rightsCardInformationForm: {
cardNumber: "96",
activationCode: "123",
cardName: "23",
}, },
// 权益明细 // 权益明细
BatchDetailInformationForm: { BatchDetailInformationForm: {
cardName: "", cardName: '',
account: "", account: ''
}, },
// 批次管理详情弹框权益明细table // 批次管理详情弹框权益明细table
detailTable: { detailTable: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "", listName: '',
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: "权益名", label: '权益名',
prop: "equityName", prop: 'equityName'
// minWidth: '200' // minWidth: '200'
}, },
{ {
label: "状态", label: '状态',
prop: "status", prop: 'status'
// formatter: (cellValue) => { // formatter: (cellValue) => {
// return { // return {
// 0: '进行中', // 0: '进行中',
...@@ -776,132 +772,135 @@ export default { ...@@ -776,132 +772,135 @@ export default {
// } // }
}, },
{ {
label: "有效期", label: '有效期',
prop: "termOfValidity", prop: 'termOfValidity'
}, },
{ {
label: "账号", label: '账号',
prop: "accountNumber", prop: 'accountNumber'
// width: 110, // width: 110,
// tagLabel: true // tagLabel: true
}, },
{ {
label: "剩余次数", label: '剩余次数',
prop: "remainingTimes", prop: 'remainingTimes'
// minWidth: '200' // minWidth: '200'
}, },
{ {
label: "权益说明", label: '权益说明',
prop: "Description ", prop: 'Description'
// minWidth: '200' // minWidth: '200'
}, }
], ]
}, }
}; }
}, },
mounted() { mounted() {
getlistByCardName({}).then((res) => { getlistByCardName({}).then((res) => {
this.baseDate.equityList = res; this.baseDate.equityList = res
}); })
}, },
methods: { methods: {
// 打开领用详情界面 // 打开领用详情界面
startcollectiondetails(row) { startcollectiondetails(row) {
this.userInformationForm = row; this.userInformationForm = row
this.rightsCardInformationForm = row; this.rightsCardInformationForm = row
this.detailsVisible = true; this.detailsVisible = true
}, },
// 改变日期数据格式 // 改变日期数据格式
changeDataFormat() { changeDataFormat() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.batchListSearch.createdDateEnd = this.batchDate ? this.batchDate[1] : '' this.batchListSearch.createdDateEnd = this.batchDate ? this.batchDate[1] : ''
this.batchListSearch.createdDateStart = this.batchDate ? this.batchDate[0] : '' this.batchListSearch.createdDateStart = this.batchDate ? this.batchDate[0] : ''
this.batchListSearch.batchId=parseInt(this.selectBatchId)
console.log(this.batchListSearch) console.log(this.batchListSearch)
// this.batchListSearch.createdDateEnd=this.batchListSearch.batchDate[1] // this.batchListSearch.createdDateEnd=this.batchListSearch.batchDate[1]
// this.batchListSearch.createdDateStart=this.batchListSearch.batchDate[0] // this.batchListSearch.createdDateStart=this.batchListSearch.batchDate[0]
resolve(); resolve()
}); })
}, },
// 领用详情搜索 // 领用详情搜索
beforecollectionListSearch() { beforecollectionListSearch() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.batchPopupListSearch.batchId = this.cardsInformationForm.batchId; this.batchPopupListSearch.batchId = this.cardsInformationForm.batchId
resolve(); resolve()
}); })
}, },
// 批次管理弹窗搜索 // 批次管理弹窗搜索
beforebatchPopupListSearch() { beforebatchPopupListSearch() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.batchPopupListSearch.batchId = this.cardsInformationForm.batchId; this.batchPopupListSearch.batchId = +this.cardsInformationForm.batchId
resolve(); this.batchPopupListSearch.cardNo = this.BatchDetailInformationForm.cardName
}); // this.batchPopupListSearch.mobile = this.BatchDetailInformationForm.account
resolve()
})
}, },
handleClick(tab, event) {}, handleClick(tab, event) {},
handleChange(value) {}, handleChange(value) {},
// 关闭批量生成界面 // 关闭批量生成界面
handleClose(done) { handleClose(done) {
this.$confirm("确认关闭?") this.$confirm('确认关闭?')
.then((_) => { .then((_) => {
done(); done()
}) })
.catch((_) => {}); .catch((_) => {})
}, },
submitForm(formName) { submitForm(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
alert("submit!"); alert('submit!')
} else { } else {
console.log("error submit!!"); console.log('error submit!!')
return false; return false
} }
}); })
}, },
resetForm(formName) { resetForm(formName) {
this.$refs[formName].resetFields(); this.$refs[formName].resetFields()
}, },
// 批量制造卡片 // 批量制造卡片
generateCards() { generateCards() {
var params = { var params = {
count: this.generateRightCardsForm.cardsNumber + "", count: +this.generateRightCardsForm.cardsNumber ,
defineCode: this.generateRightCardsForm.relatedRightsPackage + "", defineCode: this.generateRightCardsForm.relatedRightsPackage + '',
merchantId: this.merchantId, // merchantId: this.merchantId,
merchantName: this.merchantName + "", // merchantName: this.merchantName + '',
remark: this.generateRightCardsForm.remarks + "", remark: this.generateRightCardsForm.remarks + ''
}; }
generateMemberBatch(params).then((res) => { generateMemberBatch(params).then((res) => {
console.log(res); console.log(res)
if (res > 0) { if (res > 0) {
this.$message({ this.$message({
message: "增添成功!", message: '增添成功!',
type: "success", type: 'success'
}); })
this.dialogVisible = false; this.dialogVisible = false
} else { } else {
this.$message({ this.$message({
message: "增添失败!", message: '增添失败!',
type: "error", type: 'error'
}); })
} }
}); })
}, },
// 批次详情弹窗 // 批次详情弹窗
batchdetails(row) { batchdetails(row) {
this.cardsInformationForm = row; this.cardsInformationForm = row
this.batchdetailsVisible = true; this.batchdetailsVisible = true
}, },
// dataExport(){ // dataExport(){
// } // }
// 关闭详情界面 // 关闭详情界面
detailClose(done) { detailClose(done) {
this.$confirm("确认关闭?") this.$confirm('确认关闭?')
.then(() => { .then(() => {
done(); done()
}) })
.catch(() => {}); .catch(() => {})
}, }
}, }
}; }
</script> </script>
<style> <style>
* { * {
...@@ -915,19 +914,26 @@ export default { ...@@ -915,19 +914,26 @@ export default {
.topline { .topline {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
margin-left: 25px;
} }
.linecontainer { .linecontainer {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
min-width: 576px; min-width: 576px;
} }
.InputContainer { .InputContainer {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
margin-left: 5%; margin-left: 20px;
}
.lastInputContainer {
display: flex;
flex-direction: row;
margin-left: 100px;
} }
.firstpickerContainer { .firstpickerContainer {
margin-left: 25px; margin-left: 20px;
margin-top: 20px; margin-top: 20px;
} }
.lastpickerContainer { .lastpickerContainer {
...@@ -941,10 +947,11 @@ export default { ...@@ -941,10 +947,11 @@ export default {
margin-left: 20px; margin-left: 20px;
} }
.buttonContainer { .buttonContainer {
margin-left: 20%; margin-left: 100px;
} }
.batchGeneration { .batchGeneration {
margin-left: 80px; margin-left: 100px;
margin-top: 10px; margin-top: 10px;
} }
</style> </style>
...@@ -37,8 +37,7 @@ ...@@ -37,8 +37,7 @@
<el-input-number <el-input-number
v-model="ruleForm.validity" v-model="ruleForm.validity"
controls-position="right" controls-position="right"
:min="0" :min="1"
:max="10"
size="mini" size="mini"
></el-input-number> ></el-input-number>
月内有效 月内有效
...@@ -155,6 +154,7 @@ export default { ...@@ -155,6 +154,7 @@ export default {
// name:ruleForm.name, // name:ruleForm.name,
// validitVaule:"" // validitVaule:""
// }, // },
submit: false,
ruleForm: { ruleForm: {
name: '', name: '',
explain: '', explain: '',
...@@ -183,10 +183,10 @@ export default { ...@@ -183,10 +183,10 @@ export default {
}, },
rules: { rules: {
name: [ name: [
{ required: true, message: '请输入权益卡名字', trigger: 'blur' }, { required: true, message: '请输入长度在2-10以内的权益卡名称', trigger: 'blur' },
{ min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' } { min: 2, max: 10, message: '长度在 2 到 10 个字符', trigger: 'blur' }
], ],
explain: [{ required: true, message: '请填写说明', trigger: 'blur' }], explain: [{ min: 0, max: 200, required: true, message: '请填写200字以内的说明', trigger: 'blur' }],
validity: [{ required: true, message: '请选择有效期', trigger: 'blur' }], validity: [{ required: true, message: '请选择有效期', trigger: 'blur' }],
currencyInpution: [ currencyInpution: [
{ required: true, message: '请填写返回的嘀币数', trigger: 'blur' } { required: true, message: '请填写返回的嘀币数', trigger: 'blur' }
...@@ -246,54 +246,78 @@ export default { ...@@ -246,54 +246,78 @@ export default {
rightsId: 20, rightsId: 20,
equityItemJson: JSON.stringify(equityItemJson) equityItemJson: JSON.stringify(equityItemJson)
}) })
this.submit = true
} }
if (this.ruleForm.oilCheckbox) { if (this.ruleForm.oilCheckbox) {
params.rightsList.push({ params.rightsList.push({
rightsId: 21, rightsId: 21,
equityItemJson: JSON.stringify(equityItemJson) equityItemJson: JSON.stringify(equityItemJson)
}) })
this.submit = true
} }
if (this.ruleForm.worryFreeCheckbox) { if (this.ruleForm.worryFreeCheckbox) {
params.rightsList.push({ params.rightsList.push({
rightsId: 22, rightsId: 22,
equityItemJson: JSON.stringify(equityItemJson) equityItemJson: JSON.stringify(equityItemJson)
}) })
this.submit = true
} }
if (this.ruleForm.specialOfferCheckbox) { if (this.ruleForm.specialOfferCheckbox) {
params.rightsList.push({ params.rightsList.push({
rightsId: 23, rightsId: 23,
equityItemJson: JSON.stringify(equityItemJson) equityItemJson: JSON.stringify(equityItemJson)
}) })
this.submit = true
} }
if (this.ruleForm.rescueCheckbox) { if (this.ruleForm.rescueCheckbox) {
params.rightsList.push({ params.rightsList.push({
rightsId: 24, rightsId: 24,
equityItemJson: JSON.stringify(equityItemJson) equityItemJson: JSON.stringify(equityItemJson)
}) })
this.submit = true
} }
if (this.ruleForm.creditCheckbox) { if (this.ruleForm.creditCheckbox) {
params.rightsList.push({ params.rightsList.push({
rightsId: 25, rightsId: 25,
equityItemJson: JSON.stringify(equityItemJson) equityItemJson: JSON.stringify(equityItemJson)
}) })
this.submit = true
} }
if (this.ruleForm.meituanCheckbox) { if (this.ruleForm.meituanCheckbox) {
params.rightsList.push({ params.rightsList.push({
rightsId: 26, rightsId: 26,
equityItemJson: JSON.stringify(equityItemJson) equityItemJson: JSON.stringify(equityItemJson)
}) })
this.submit = true
} }
if (this.ruleForm.name) {
if (this.submit == true) {
insertMemberCardDefineRf(params).then((res) => { insertMemberCardDefineRf(params).then((res) => {
console.log(res) // console.log(res)
if (res > 0) { if (res > 0) {
window.history.go(-1) window.history.go(-1)
ruleForm = {}
}else {
this.$message({
message: '增加失败',
type: 'error'
})
}
})
} else { } else {
this.$message({ this.$message({
message: '增添失败!', message: '需开通至少一项服务',
type: 'error' type: 'error'
}) })
} }
} else {
this.$message({
message: '权益卡名称不能为空',
type: 'error'
}) })
}
} }
...@@ -317,6 +341,8 @@ export default { ...@@ -317,6 +341,8 @@ export default {
.container { .container {
overflow-y: scroll; overflow-y: scroll;
height: 900px; height: 900px;
margin-left: 100px;
margin-top: 20px;
} }
.itemContainer { .itemContainer {
margin-left: 20px; margin-left: 20px;
......
...@@ -6,10 +6,8 @@ ...@@ -6,10 +6,8 @@
type="primary" type="primary"
@click="addCard" @click="addCard"
>新建权益卡</el-button> >新建权益卡</el-button>
</div> </div>
<div class="tablecontainer"> <div class="tablecontainer">
<d2-table <d2-table
ref="recordTable" ref="recordTable"
:searchForm="searchForm" :searchForm="searchForm"
...@@ -26,15 +24,21 @@ ...@@ -26,15 +24,21 @@
</d2-table> </d2-table>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
function date_format(d) {
var date = new Date(d);
var Y = date.getFullYear() + "-";
var M =
(date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + "-";
var D = date.getDate() + " ";
return Y + M + D;
}
// import { getListApi } from '@/api/test' // import { getListApi } from '@/api/test'
// import {memberCardDetails} from "@/api/test"; // import {memberCardDetails} from "@/api/test";
import { listMemberCardDefine } from '@/api/test' import { listMemberCardDefine } from '@/api/test'
// import selectbotton from '@/components/selectbotton' // import selectbotton from '@/components/selectbotton'
export default { export default {
// components: { // components: {
...@@ -42,8 +46,8 @@ export default { ...@@ -42,8 +46,8 @@ export default {
// }, // },
data() { data() {
return { return {
date_format,
getListApi: listMemberCardDefine, getListApi: listMemberCardDefine,
// getListApi: none, // getListApi: none,
searchForm: null, searchForm: null,
tableParams: { tableParams: {
...@@ -58,7 +62,10 @@ export default { ...@@ -58,7 +62,10 @@ export default {
}, },
{ {
label: '有效期', label: '有效期',
prop: 'validitDate' prop: 'validitDate',
formatter: (cellValue) => {
return this.date_format(cellValue.validitDate);
}
}, },
{ {
label: '权益内容', label: '权益内容',
...@@ -80,7 +87,7 @@ export default { ...@@ -80,7 +87,7 @@ export default {
prop: 'status', prop: 'status',
formatter: (cellValue) => { formatter: (cellValue) => {
return { return {
1: '正常', 1: '正常'
}[cellValue.status] }[cellValue.status]
} }
...@@ -96,16 +103,14 @@ export default { ...@@ -96,16 +103,14 @@ export default {
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
addCard() { addCard() {
// window.location.href = 'http://glsx-oss-equity2.frontend.test.glsx.com.cn/customer/newEquityCard.html' // window.location.href = 'http://glsx-oss-equity2.frontend.test.glsx.com.cn/customer/newEquityCard.html'
window.location.href = '/customer/newEquityCard.html' window.location.href = '/customer/newEquityCard.html'
} }
// handleEdit() { // handleEdit() {
// // }, // // },
// updateRightCardTable(params = {}) { // updateRightCardTable(params = {}) {
// var _this = this; // var _this = this;
...@@ -120,7 +125,6 @@ export default { ...@@ -120,7 +125,6 @@ export default {
// }); // });
// }, // },
} }
} }
</script> </script>
<style> <style>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!