Commit f7ad0747 authored by 吴春's avatar 吴春

1

parent 0755ced4
......@@ -487,17 +487,16 @@
</el-input>
</el-form-item> -->
<el-form-item label="选择人员" prop="customerIds">
<template v-if="customerList&&customerList.length>0">
<template v-for="(item,index) in customerList">
<template v-if="checkedCustomerList&&checkedCustomerList.length>0">
<template v-for="(item,index) in checkedCustomerList">
<template v-if="item.ischecked">
<el-tag :key="index+10000" closable @close="deleteTag(item)">{{item.customerName}}({{item.contact}})
</el-tag>
</template>
</template>
</template>
<!--v-if="xuanzeCustomer"-->
<el-popover trigger="click" placement="bottom-start">
<el-popover trigger="click" placement="top-start">
<div class="_TravelPricePopover" style="height: 300px;overflow: auto;width: 350px;">
<div class="ScenicDiv">
<el-input class="w180" v-model="grantCouponMsg.customerInfo"
......@@ -514,10 +513,10 @@
<el-checkbox @change="getSelect(fitem)" v-model="fitem.ischecked"></el-checkbox>
</td>
<td>
{{fitem.customerName}}
{{fitem.customerName}}- {{fitem.contact}}
</td>
<td>
{{fitem.contact}}
{{fitem.contactNumber}}
</td>
</tr>
</table>
......@@ -531,7 +530,7 @@
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="autoCouponDialog = false">取 消</el-button>
<el-button size="small" type="danger" @click="sureUpdatekucun()">确 定</el-button>
<el-button size="small" type="danger" @click="AdminGrantCoupon()">确 定</el-button>
</span>
</el-dialog>
</div>
......@@ -701,7 +700,7 @@
CouponPlatformEnumList: [],
companyList: [],
customerList: [],
layerCustomerList: [],
checkedCustomerList: [],//选择的人员信息
layerDepartMentList: [],
departMentList: [],
PostList: [],
......@@ -748,13 +747,7 @@
},
methods: {
//删除客户标签
deleteTag(item) {
item.ischecked=false;
},
getSelect(item) {
},
getcouponPriceList() {
this.addMsg.couponPriceList = []
this.addMsg.couponPriceLists.forEach(item => {
......@@ -815,8 +808,24 @@
//发放优惠券
AutoGrantCounItem(item) {
this.grantCouponMsg = Object.assign({}, item);
this.customerList=[];
this.checkedCustomerList=[];
console.log("grantCouponMsg", this.grantCouponMsg);
},
//发放优惠券确认
AdminGrantCoupon() {
this.apipost("coupon_post_AdminGrantCoupon", {Id:this.grantCouponMsg.id,CustomerList:this.checkedCustomerList}, res => {
if (res.data.resultCode === 1) {
this.Success(res.data.message);
this.updateKucundialog = false;
this.getList();
this.upDateKcMsg.number = '';
} else {
this.Error(res.data.message)
}
}, null);
},
//点击确定修改库存
sureUpdatekucun() {
this.apipost("coupon_post_UpdateCouponCount", this.upDateKcMsg, res => {
......@@ -841,13 +850,36 @@
}
}
);
},
//删除客户标签
deleteTag(item) {
let result = this.customerList.find(temp => temp.customerId ===item.customerId);
if(result){ result.ischecked=false;
}
let index = this.checkedCustomerList.indexOf(item);
if (index !== -1) {
this.checkedCustomerList.splice(index, 1);
}
},
getSelect(item) {
if(item.ischecked){
this.checkedCustomerList.push(item);
}else{
let index = this.checkedCustomerList.indexOf(item.customerId);
this.checkedCustomerList.splice(index, 1);
}
},
//查询客户
getCustomerBrandByKeyWord() {
this.xuanzeCustomerLoading = true;
this.customerList = [];
console.log("this.grantCouponMsg.customerType",this.grantCouponMsg.customerType);
let cmdStr="app_post_GetCustomerBrandByKeyWord";
if(this.grantCouponMsg.customerType==1){
cmdStr="Sell_Post_GetDirectCustomerListByKey";
}
this.apipost(
"app_post_GetCustomerBrandByKeyWord",
cmdStr,
this.grantCouponMsg,
res => {
this.xuanzeCustomerLoading = false;
......@@ -855,7 +887,12 @@
var tempData = res.data.data;
if (tempData && tempData.length > 0) {
tempData.forEach(item => {
item.ischecked = false;
let result = this.checkedCustomerList.find(temp => temp.customerId ===item.customerId);
if(result){ item.ischecked=true;
}
else{
item.ischecked = false;
}
})
}
this.customerList = tempData;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment