Commit 3d40e02e by zhouzy

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

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