Commit f7ad0747 authored by 吴春's avatar 吴春

1

parent 0755ced4
...@@ -487,17 +487,16 @@ ...@@ -487,17 +487,16 @@
</el-input> </el-input>
</el-form-item> --> </el-form-item> -->
<el-form-item label="选择人员" prop="customerIds"> <el-form-item label="选择人员" prop="customerIds">
<template v-if="customerList&&customerList.length>0"> <template v-if="checkedCustomerList&&checkedCustomerList.length>0">
<template v-for="(item,index) in customerList"> <template v-for="(item,index) in checkedCustomerList">
<template v-if="item.ischecked"> <template v-if="item.ischecked">
<el-tag :key="index+10000" closable @close="deleteTag(item)">{{item.customerName}}({{item.contact}}) <el-tag :key="index+10000" closable @close="deleteTag(item)">{{item.customerName}}({{item.contact}})
</el-tag> </el-tag>
</template> </template>
</template> </template>
</template> </template>
<!--v-if="xuanzeCustomer"--> <!--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="_TravelPricePopover" style="height: 300px;overflow: auto;width: 350px;">
<div class="ScenicDiv"> <div class="ScenicDiv">
<el-input class="w180" v-model="grantCouponMsg.customerInfo" <el-input class="w180" v-model="grantCouponMsg.customerInfo"
...@@ -514,10 +513,10 @@ ...@@ -514,10 +513,10 @@
<el-checkbox @change="getSelect(fitem)" v-model="fitem.ischecked"></el-checkbox> <el-checkbox @change="getSelect(fitem)" v-model="fitem.ischecked"></el-checkbox>
</td> </td>
<td> <td>
{{fitem.customerName}} {{fitem.customerName}}- {{fitem.contact}}
</td> </td>
<td> <td>
{{fitem.contact}} {{fitem.contactNumber}}
</td> </td>
</tr> </tr>
</table> </table>
...@@ -531,7 +530,7 @@ ...@@ -531,7 +530,7 @@
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="autoCouponDialog = false">取 消</el-button> <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> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -701,7 +700,7 @@ ...@@ -701,7 +700,7 @@
CouponPlatformEnumList: [], CouponPlatformEnumList: [],
companyList: [], companyList: [],
customerList: [], customerList: [],
layerCustomerList: [], checkedCustomerList: [],//选择的人员信息
layerDepartMentList: [], layerDepartMentList: [],
departMentList: [], departMentList: [],
PostList: [], PostList: [],
...@@ -748,13 +747,7 @@ ...@@ -748,13 +747,7 @@
}, },
methods: { methods: {
//删除客户标签
deleteTag(item) {
item.ischecked=false;
},
getSelect(item) {
},
getcouponPriceList() { getcouponPriceList() {
this.addMsg.couponPriceList = [] this.addMsg.couponPriceList = []
this.addMsg.couponPriceLists.forEach(item => { this.addMsg.couponPriceLists.forEach(item => {
...@@ -815,8 +808,24 @@ ...@@ -815,8 +808,24 @@
//发放优惠券 //发放优惠券
AutoGrantCounItem(item) { AutoGrantCounItem(item) {
this.grantCouponMsg = Object.assign({}, item); this.grantCouponMsg = Object.assign({}, item);
this.customerList=[];
this.checkedCustomerList=[];
console.log("grantCouponMsg", this.grantCouponMsg); 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() { sureUpdatekucun() {
this.apipost("coupon_post_UpdateCouponCount", this.upDateKcMsg, res => { this.apipost("coupon_post_UpdateCouponCount", this.upDateKcMsg, res => {
...@@ -841,13 +850,36 @@ ...@@ -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() { getCustomerBrandByKeyWord() {
this.xuanzeCustomerLoading = true; this.xuanzeCustomerLoading = true;
this.customerList = []; 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( this.apipost(
"app_post_GetCustomerBrandByKeyWord", cmdStr,
this.grantCouponMsg, this.grantCouponMsg,
res => { res => {
this.xuanzeCustomerLoading = false; this.xuanzeCustomerLoading = false;
...@@ -855,7 +887,12 @@ ...@@ -855,7 +887,12 @@
var tempData = res.data.data; var tempData = res.data.data;
if (tempData && tempData.length > 0) { if (tempData && tempData.length > 0) {
tempData.forEach(item => { 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; 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