123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- /**
- * Created by xw on 2020/7/22.
- */
- var InformationPage = new Vue({
- el:"#informationPage",
- data: {
- clubId:0,
- clubInfo:{},
- isShowPopup:false,
- checkedIndex:0,
- saleName:'',// 分配销售人名称
- sellerList:[],
- salesParams:{
- clubId:0,
- spId:0
- }
- },
- filters: {
- FirstFormat: function(type) {
- //处理金额
- let name = ''
- switch (type) {
- case 1:
- name = '医美'
- break
- case 2:
- name = '生美'
- break
- case 3:
- name = '项目公司'
- break
- case 4:
- name = '个人'
- break
- case 5:
- name = '其他'
- break
- }
- return name
- },
- TwoFormat: function(type) {
- //处理金额
- let text = ''
- switch (type) {
- case 1:
- text = '诊所'
- break
- case 2:
- text = '门诊'
- break
- case 3:
- text = '医院'
- break
- }
- return text
- }
- },
- methods: {
- userClubRecordLinkage: function () {
- var _self = this;
- UserApi.userClubRecordLinkage({clubId: _self.clubId}, function (response) {
- if (response.code == 0) {
- _self.saleName = response.data.saleName;
- _self.clubInfo = response.data.club;
- _self.userClubChoseList()
- } else {
- console.log('获取机构信息异常')
- }
- })
- },
- userClubChoseList: function () {
- var _self = this;
- UserApi.userClubChoseList({}, function (response) {
- if (response.code == 0) {
- _self.sellerList = response.data.map((el,index)=>{
- el.isCheck = false
- return el
- })
- } else {
- console.log('获取可分配协销列表异常')
- }
- })
- },
- userClubChoseSales: function () {
- var _self = this;
- UserApi.userClubChoseSales(_self.salesParams, function (response) {
- if (response.code == 0) {
- CAIMEI.dialog('分配成功',true,function () {
- _self.isShowPopup = false;
- _self.userClubRecordLinkage();
- });
- } else {
- console.log('分配协销异常')
- }
- })
- },
- checkedCoupon:function(idx){
- // 选择商品
- var _self = this;
- _self.checkedIndex = idx;
- _self.sellerList.forEach((el, index) => {
- if (_self.checkedIndex == index) {
- el.isCheck = !el.isCheck;
- _self.salesParams.spId = el.serviceProviderId;
- console.log('分配协销ID', _self.salesParams.spId)
- } else {
- el.isCheck = false;
- }
- })
- },
- handleConfirm:function () {
- var _self = this;
- if (_self.salesParams.spId === 0){
- CAIMEI.dialog('请选择分配销售',false);
- return;
- }
- _self.userClubChoseSales();
- },
- showPopup:function(){// 显示弹窗
- var _self = this;
- _self.isShowPopup = true;
- },
- hidePopup:function(){// 隐藏弹窗
- var _self = this;
- _self.isShowPopup = false;
- }
- },
- created: function () {
- },
- mounted: function () {
- var _this = this;
- _this.clubId = _this.salesParams.clubId = getUrlParam("clubId");
- _this.userClubRecordLinkage();
- }
- });
|