Commit 3d40e02e by zhouzy

详情的接口请求问题和详情table,以及关掉弹窗的优化

1 parent 9dc9f366
...@@ -41,7 +41,7 @@ function listRequisitionMemberCard(params) { ...@@ -41,7 +41,7 @@ function listRequisitionMemberCard(params) {
return GlAxios.get(`${path}/listRequisitionMemberCard`, { params }) return GlAxios.get(`${path}/listRequisitionMemberCard`, { params })
} }
function getMemberCardDetail(params) { function getMemberCardDetail(params) {
return GlAxios.get(`${path}/getMemberCardDetail`, params, { headers: { 'Content-Type': 'application/json; charset=utf-8' }, requestType: 'jsonString' }) return GlAxios.get(`${path}/getMemberCardDetail`,{ params })
} }
export { export {
......
...@@ -385,6 +385,7 @@ ...@@ -385,6 +385,7 @@
ref="detailTable" ref="detailTable"
:tableParams="collectiondetailTable" :tableParams="collectiondetailTable"
:getListApi="getMemberCardDetail" :getListApi="getMemberCardDetail"
:searchForm="collectPoupdetailTable"
> >
</d2-table> </d2-table>
<span <span
...@@ -700,10 +701,13 @@ export default { ...@@ -700,10 +701,13 @@ export default {
], ],
cardsNumber: [{ required: true, message: "请填写张数 ", trigger: "blur" }], cardsNumber: [{ required: true, message: "请填写张数 ", trigger: "blur" }],
}, },
//将id转化成cardId
// 详情界面弹窗 // 领用详情界面弹窗
collectPoupdetailTable: {
cardId: ""
},
// 用户详情 // 用户详情
cardId: "2473",
userInformationForm: { userInformationForm: {
detailsVisible: false, detailsVisible: false,
mobile: "", mobile: "",
...@@ -731,16 +735,16 @@ export default { ...@@ -731,16 +735,16 @@ export default {
}, },
{ {
label: "状态", label: "状态",
prop: "status", prop: "rightStatus",
formatter: (cellValue) => { formatter: (cellValue) => {
return { return {
1: "正常", 0: "正常"
}[cellValue.status]; }[cellValue.status];
}, }
}, },
{ {
label: "有效期", label: "有效期",
prop: "validitVaule", prop: "validitDate",
}, },
{ {
label: "剩余次数", label: "剩余次数",
...@@ -760,7 +764,7 @@ export default { ...@@ -760,7 +764,7 @@ export default {
cardName: "", cardName: "",
attributionChannel: "", attributionChannel: "",
generationDate: "", generationDate: "",
batch: "", batchId: "",
generateNumber: "", generateNumber: "",
activation: "", activation: "",
}, },
...@@ -842,33 +846,35 @@ export default { ...@@ -842,33 +846,35 @@ export default {
this.userInformationForm = row; this.userInformationForm = row;
this.rightsCardInformationForm = row; this.rightsCardInformationForm = row;
this.detailsVisible = true; this.detailsVisible = true;
this.collectPoupdetailTable.cardId = row.id
this.$refs.detailTable.refreshTable()
}, },
// 改变批次日期数据格式 // 改变批次日期数据格式
changeBatchDataFormat() { changeBatchDataFormat() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.batchListSearch.createdDateEnd = this.batchDate this.batchListSearch.createdDateEnd = this.batchDate
? this.batchDate[1] + " 23:59:59" ? this.batchDate[1] + '23:59:59'
: ""; : ''
this.batchListSearch.createdDateStart = this.batchDate this.batchListSearch.createdDateStart = this.batchDate
? this.batchDate[0] + " 00:00:01" ? this.batchDate[0] + '00:00:01'
: ""; : '';
this.batchListSearch.batchId = parseInt(this.selectBatchId); this.batchListSearch.batchId = parseInt(this.selectBatchId)
console.log(this.batchListSearch); console.log(this.batchListSearch)
resolve(); resolve()
}); })
}, },
//改变领用日期数据格式 //改变领用日期数据格式
changeCollectionDataFormat() { changeCollectionDataFormat() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log(this.colletionDate); console.log(this.colletionDate)
this.collectionListSearch.endTime = this.colletionDate this.collectionListSearch.endTime = this.colletionDate
? this.colletionDate[1] + " 23:59:59" ? this.colletionDate[1] + '23:59:59'
: "" || undefined; : '' || undefined
this.collectionListSearch.beginTime = this.colletionDate this.collectionListSearch.beginTime = this.colletionDate
? this.colletionDate[0] + " 00:00:01" ? this.colletionDate[0] + '00:00:01'
: "" || undefined; : '' || undefined
resolve(); resolve()
}); })
}, },
// 领用详情搜索 // 领用详情搜索
// beforecollectionListSearch() { // beforecollectionListSearch() {
...@@ -880,23 +886,19 @@ export default { ...@@ -880,23 +886,19 @@ export default {
// 批次管理弹窗搜索 // 批次管理弹窗搜索
beforebatchPopupListSearch() { beforebatchPopupListSearch() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.batchPopupListSearch.batchId = +this.cardsInformationForm.batchId; this.batchPopupListSearch.batchId = +this.cardsInformationForm.batchId
this.batchPopupListSearch.cardNo = this.BatchDetailInformationForm.cardName; this.batchPopupListSearch.cardNo = this.BatchDetailInformationForm.cardName
this.batchPopupListSearch.mobile = this.BatchDetailInformationForm.account; this.batchPopupListSearch.mobile = this.BatchDetailInformationForm.account
resolve(); resolve()
}); })
}, },
handleClick(tab, event) { }, handleClick(tab, event) { },
handleChange(value) { }, handleChange(value) { },
// 关闭批量生成界面 // 关闭批量生成界面
handleClose(done) { handleClose(done) {
this.$confirm("确认关闭?")
.then((_) => {
this.generateRightCardsForm = {} this.generateRightCardsForm = {}
this.$refs.ruleForm.clearValidate() this.$refs.ruleForm.clearValidate()
done(); done()
})
.catch((_) => { });
}, },
//取消批量制造 //取消批量制造
cancelGenerate() { cancelGenerate() {
...@@ -912,38 +914,36 @@ export default { ...@@ -912,38 +914,36 @@ export default {
defineCode: this.generateRightCardsForm.Code, defineCode: this.generateRightCardsForm.Code,
// merchantId: this.merchantId, // merchantId: this.merchantId,
// merchantName: this.merchantName + '', // merchantName: this.merchantName + '',
remark: this.generateRightCardsForm.remarks + "", remark: this.generateRightCardsForm.remarks + ''
}; }
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
generateMemberBatch(params).then((res) => { generateMemberBatch(params).then((res) => {
if (res > 0) { if (res > 0) {
this.$message({ this.$message({
message: "增添成功!", message: '增添成功',
type: "success", type: 'success'
}); })
this.generateRightCardsForm = {} this.generateRightCardsForm = {}
this.dialogVisible = false; this.dialogVisible = false
// location. reload() // location. reload()
this.$refs.batchDetailTable.refreshTable() this.$refs.batchDetailTable.refreshTable()
} else { } else {
this.$message({ this.$message({
message: "增添失败!", message: '增添失败!',
type: "error", type: 'error'
}); })
} }
}) })
} else { } else {
this.$message({ this.$message({
message: "请填写必选项!", message: '请填写必选项!',
type: "error", type: 'error'
}); })
return false; return false
} }
}); })
// generateMemberBatch(params).then((res) => { // generateMemberBatch(params).then((res) => {
// console.log(res); // console.log(res);
// if (res > 0) { // if (res > 0) {
...@@ -965,21 +965,19 @@ export default { ...@@ -965,21 +965,19 @@ export default {
}, },
// 批次详情弹窗 // 批次详情弹窗
batchdetails(row) { batchdetails(row) {
this.cardsInformationForm = row; console.log(row)
this.batchdetailsVisible = true; this.cardsInformationForm = row
this.batchdetailsVisible = true
this.$refs.batchdetailPopupTable.refreshTable()
}, },
// dataExport(){ // dataExport(){
// } // }
// 关闭详情界面 // 关闭详情界面
detailClose(done) { detailClose(done) {
this.$confirm("确认关闭?") done()
.then(() => { }
done(); }
}) }
.catch(() => { });
},
},
};
</script> </script>
<style> <style>
* { * {
......
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
</template> </template>
<script> <script>
import { insertMemberCardDefineRf } from "@/api/test"; import { insertMemberCardDefineRf } from '@/api/test'
export default { export default {
data() { data() {
return { return {
...@@ -132,22 +132,22 @@ export default { ...@@ -132,22 +132,22 @@ export default {
// }, // },
submit: false, submit: false,
ruleForm: { ruleForm: {
name: "", name: '',
explain: "", explain: '',
validity: 1, validity: 1,
date1: "", date1: '',
date2: "", date2: '',
delivery: false, delivery: false,
type: [], type: [],
resource: "", resource: '',
currencyCheckbox: false, currencyCheckbox: false,
currencyInpution: "", currencyInpution: '',
oilCheckbox: false, oilCheckbox: false,
oilInpution: "", oilInpution: '',
timeInpution: "", timeInpution: '',
worryFreeCheckbox: false, worryFreeCheckbox: false,
pushCollision: false, pushCollision: false,
rebateRatio: "", rebateRatio: '',
specialOfferCheckbox: false, specialOfferCheckbox: false,
exchangeStandard: false, exchangeStandard: false,
rescueCheckbox: false, rescueCheckbox: false,
...@@ -155,131 +155,127 @@ export default { ...@@ -155,131 +155,127 @@ export default {
rescueWorryFree: null, rescueWorryFree: null,
creditInstallment: null, creditInstallment: null,
meiTuan: null, meiTuan: null,
meituanCheckbox: false, meituanCheckbox: false
}, },
rules: { rules: {
name: [ name: [
{ {
required: true, required: true,
message: "请输入长度在2-10以内的权益卡名称", message: '请输入长度在2-10以内的权益卡名称',
trigger: "blur", trigger: 'blur'
}, },
{ min: 2, max: 10, message: "长度在 2 到 10 个字符", trigger: "blur" }, { min: 2, max: 10, message: '长度在 2 到 10 个字符', trigger: 'blur' }
], ],
explain: [ explain: [
{ {
min: 0, min: 0,
max: 200, max: 200,
required: true, required: true,
message: "请填写200字以内的说明", message: '请填写200字以内的说明',
trigger: "blur", 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" },
// ], // ],
// oilInpution: [{ required: true, message: "请填写推荐半径", trigger: "blur" }], // oilInpution: [{ required: true, message: "请填写推荐半径", trigger: "blur" }],
// timeInpution: [{ required: true, message: "请填写最大天数", trigger: "blur" }], // timeInpution: [{ required: true, message: "请填写最大天数", trigger: "blur" }],
// rebateRatio: [{ required: true, message: "请填写返利比例", trigger: "blur" }], // rebateRatio: [{ required: true, message: "请填写返利比例", trigger: "blur" }],
}, }
}; }
}, },
methods: { methods: {
cancel(){ cancel() {
window.history.go(-1); window.history.go(-1)
}, },
jump(formName) { jump(formName) {
var equityItemJson = { var equityItemJson = {
returnDicoins: this.ruleForm.currencyInpution , returnDicoins: this.ruleForm.currencyInpution,
oilWorry: { oilWorry: {
oilRadius: +this.ruleForm.oilInpution, oilRadius: +this.ruleForm.oilInpution,
oioilInterval: +this.ruleForm.timeInpution, oioilInterval: +this.ruleForm.timeInpution
}, },
collisionPush: this.ruleForm.pushCollision , collisionPush: this.ruleForm.pushCollision,
dicoinRatio: this.ruleForm.rebateRatio , dicoinRatio: this.ruleForm.rebateRatio,
rescueWorryFree: this.ruleForm.rescueWorryFree , rescueWorryFree: this.ruleForm.rescueWorryFree,
creditInstallment: this.ruleForm.creditInstallment , creditInstallment: this.ruleForm.creditInstallment,
meiTuan: this.ruleForm.meiTuan , meiTuan: this.ruleForm.meiTuan
}; }
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,
rightsList: [], rightsList: []
}; }
if (this.ruleForm.currencyCheckbox) { if (this.ruleForm.currencyCheckbox) {
params.rightsList.push({ params.rightsList.push({
rightsId: 20, rightsId: 20,
equityItemJson: JSON.stringify(equityItemJson), equityItemJson: JSON.stringify(equityItemJson)
}); })
this.submit = true; 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; 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; 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; 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; 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; 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; this.submit = true
} }
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
insertMemberCardDefineRf(params).then((res) => { insertMemberCardDefineRf(params).then((res) => {
// console.log(res)
if (res > 0) { if (res > 0) {
window.history.go(-1); window.history.go(-1)
ruleForm = {}; this.ruleForm = {}
alert("增加权益卡成功"); alert('增加权益卡成功')
} else { } else {
this.$message({ this.$message({
message: "请至少选择一项服务", message: '请至少选择一项服务',
type: "error", type: 'error'
}); })
} }
}); })
} else { } else {
alert("必选项未填,增加权益卡失败"); alert('必选项未填,增加权益卡失败')
return false; return false
} }
}); })
// if (this.ruleForm.name) { // if (this.ruleForm.name) {
// if (this.submit == true) { // if (this.submit == true) {
// insertMemberCardDefineRf(params).then((res) => { // insertMemberCardDefineRf(params).then((res) => {
...@@ -306,7 +302,7 @@ export default { ...@@ -306,7 +302,7 @@ export default {
// type: "error", // type: "error",
// }); // });
// } // }
}, }
// inableInpution(checkStatus, inputStatus) { // inableInpution(checkStatus, inputStatus) {
// this[inputStatus] = !this[checkStatus] // this[inputStatus] = !this[checkStatus]
...@@ -316,8 +312,8 @@ export default { ...@@ -316,8 +312,8 @@ export default {
// // this. stopdrivingInpution=true // // this. stopdrivingInpution=true
// // } // // }
// } // }
}, }
}; }
</script> </script>
<style> <style>
* { * {
......
...@@ -28,21 +28,16 @@ ...@@ -28,21 +28,16 @@
<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 =
(date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + "-"; (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
var D = date.getDate() + " "; var D = date.getDate() + ''
return Y + M + D; return Y + M + D
} }
import { listMemberCardDefine } from '@/api/test' import { listMemberCardDefine } from '@/api/test'
// import {memberCardDetails} from "@/api/test"; // import {memberCardDetails} from "@/api/test";
import { Define } from '@/api/test'
export default { export default {
// components: {
// selectbotton
// },
data() { data() {
return { return {
date_format, date_format,
...@@ -63,7 +58,7 @@ export default { ...@@ -63,7 +58,7 @@ export default {
label: '有效期', label: '有效期',
prop: 'validitDate', prop: 'validitDate',
formatter: (cellValue) => { formatter: (cellValue) => {
return this.date_format(cellValue.validitDate); return this.date_format(cellValue.validitDate)
} }
}, },
{ {
...@@ -104,9 +99,7 @@ export default { ...@@ -104,9 +99,7 @@ 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 = '/customer/newEquityCard.html' window.location.href = '/customer/newEquityCard.html'
} }
// handleEdit() { // handleEdit() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!