|
@@ -1,9 +1,9 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-form :model="queryParams" ref="couponForm" :inline="true" v-show="showCouponSearch">
|
|
|
- <el-form-item label="批次" prop="name">
|
|
|
+ <el-form-item label="批次" prop="make_card_name">
|
|
|
<el-input
|
|
|
- v-model="queryParams.name"
|
|
|
+ v-model="queryParams.makeCardName"
|
|
|
placeholder="请输入批次"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
@@ -11,7 +11,7 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
- <!-- <el-button type="primary" icon="el-icon-search" @click="handleCouponQuery">搜索</el-button> -->
|
|
|
+ <el-button type="primary" icon="el-icon-search" @click="handleCouponQuery">搜索</el-button>
|
|
|
<!-- <el-button icon="el-icon-refresh" @click="resetCouponQuery">重置</el-button> -->
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -113,7 +113,7 @@
|
|
|
<el-table-column label="代理商" align="center" prop="agentName">
|
|
|
<template slot-scope="scope">
|
|
|
<el-select
|
|
|
- v-model="scope.row.agentId" filterable clearable placeholder="请选择代理" @change="changeLocationValue">
|
|
|
+ v-model="scope.row.agentId" filterable clearable placeholder="请选择代理">
|
|
|
<el-option
|
|
|
v-for="item in agentList"
|
|
|
:key="item.id"
|
|
@@ -144,7 +144,7 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template>已发卡代理商</template>
|
|
|
- <el-table v-loading="loading" :data="makeCardList" stripe border highlight-current-row style="width: 100%" >
|
|
|
+ <el-table v-loading="cardLoading" :data="makeCardList" stripe border highlight-current-row style="width: 100%" >
|
|
|
<el-table-column label="名称" align="center" prop="makeCardName" />
|
|
|
<el-table-column label="代理商" align="center" prop="agentName"/>
|
|
|
|
|
@@ -155,15 +155,23 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="发卡数量" align="center" prop="num"/>
|
|
|
- <el-table-column label="发卡时间" align="center" prop="createtime"/>
|
|
|
+ <el-table-column label="发卡时间" align="center" prop="createTime"/>
|
|
|
</el-table>
|
|
|
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="cardParams.pageNum"
|
|
|
+ :limit.sync="cardParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getList,addCard1,getInfo,sendCard } from "@/api/module/makeCard";
|
|
|
+import { getList,addCard1,getInfo,sendCard, addMakeCard, getMakeCardList } from "@/api/module/makeCard";
|
|
|
|
|
|
export default {
|
|
|
name: "makeCard",
|
|
@@ -187,6 +195,7 @@ export default {
|
|
|
agentList: [],
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
+ cardLoading: true,
|
|
|
// 选中数组
|
|
|
ids: [],
|
|
|
// 非单个禁用
|
|
@@ -215,6 +224,11 @@ export default {
|
|
|
reciveNum: undefined,
|
|
|
makeCardName: undefined
|
|
|
},
|
|
|
+ cardParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ makeId: undefined
|
|
|
+ },
|
|
|
// 表单参数
|
|
|
form: {
|
|
|
},
|
|
@@ -247,16 +261,26 @@ export default {
|
|
|
const index = this.sendCardList.indexOf(row);
|
|
|
this.sendCardList.splice(index, 1);
|
|
|
},
|
|
|
-
|
|
|
+ handleCouponQuery() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
/** 查询列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- getList(this.couponParams).then(response => {
|
|
|
+ getList(this.queryParams).then(response => {
|
|
|
this.makeList = response.rows;
|
|
|
this.totalMakeCard = response.total;
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
+ getCardList() {
|
|
|
+ this.cardLoading = true;
|
|
|
+ getMakeCardList(this.cardParams).then(response => {
|
|
|
+ this.makeCardList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.cardLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
@@ -307,14 +331,19 @@ export default {
|
|
|
flag = true;
|
|
|
}
|
|
|
});
|
|
|
- if(sum > this.maxCardNum) {
|
|
|
- this.$message.error('发卡数量超过总数量' + this.maxCardNum + '张!');
|
|
|
- return;
|
|
|
- }
|
|
|
if(flag) {
|
|
|
this.$message.error('参数不能为空!');
|
|
|
return;
|
|
|
}
|
|
|
+ if(sum > this.maxCardNum) {
|
|
|
+ this.$message.error('发卡数量超过总数量' + this.maxCardNum + '张!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ addMakeCard(this.sendCardList).then(response => {
|
|
|
+ this.msgSuccess("新增成功");
|
|
|
+ this.getCardList();
|
|
|
+ });
|
|
|
},
|
|
|
gotoInfo(row){
|
|
|
this.reset();
|
|
@@ -322,33 +351,31 @@ export default {
|
|
|
this.title = "制卡";
|
|
|
this.maxCardNum = row.cardNum - row.num
|
|
|
this.sendCardList = [],
|
|
|
- this.sendCardList.push(this.form1);
|
|
|
+ this.form1.makeId = row.id
|
|
|
+ this.cardParams.makeId = row.id
|
|
|
+ this.sendCardList.push(JSON.parse(JSON.stringify(this.form1)));
|
|
|
getInfo(row.id).then(response => {
|
|
|
this.cardType1 = response.data.cardType;
|
|
|
this.cardName1 = response.data.makeCardName;
|
|
|
});
|
|
|
+ this.getCardList();
|
|
|
},
|
|
|
|
|
|
addf(row){
|
|
|
- // form1.sendFormCardList =null;
|
|
|
+ // form1.sendFormCardList =null;
|
|
|
// form1.agentName = this.agentLable;
|
|
|
- this.form1 = {
|
|
|
- agentId: '',
|
|
|
- num: '',
|
|
|
- agentName: ''
|
|
|
- };
|
|
|
console.log(JSON.stringify(this.sendCardList));
|
|
|
- this.sendCardList.push(this.form1);
|
|
|
+ this.sendCardList.push(JSON.parse(JSON.stringify(this.form1)));
|
|
|
},
|
|
|
- changeLocationValue(val){
|
|
|
- //locations是v-for里面的也是datas里面的值
|
|
|
- let obj = {};
|
|
|
- obj = this.agentList.find((item)=>{
|
|
|
- return item.id === val;
|
|
|
- });
|
|
|
- this.agentLable = obj.agentName;
|
|
|
+ // changeLocationValue(val){
|
|
|
+ // //locations是v-for里面的也是datas里面的值
|
|
|
+ // let obj = {};
|
|
|
+ // obj = this.agentList.find((item)=>{
|
|
|
+ // return item.id === val;
|
|
|
+ // });
|
|
|
+ // this.agentLable = obj.agentName;
|
|
|
|
|
|
- },
|
|
|
+ // },
|
|
|
}
|
|
|
};
|
|
|
</script>
|