clientModuleDetails-legacy.56e2c43e.js 19 KB

1
  1. System.register(["./index-legacy.a130dba2.js","./composables-legacy.0c6ce36a.js","./hideDialog-legacy.c22ba144.js","./customFieldDialog-legacy.d3fe02ed.js","./vuedraggable.umd-legacy.a4f60da7.js","./LJWWDMSelect-legacy.8df26109.js","./sortable.esm-legacy.19def5ad.js","./LJWWData-legacy.844c3ebc.js"],(function(e,t){"use strict";var l,a,i,n,r,o,s,d,u,c,m,f,p,g=document.createElement("style");return g.textContent=".grade-list[data-v-f0e54a4c]{margin-top:20px}.grade-item-name[data-v-f0e54a4c]{width:55%;height:32px;padding:0 10px;line-height:32px;background:#eeeff1;color:#86909c;font-size:14px}.grade-item-labels[data-v-f0e54a4c]{border:1px solid #EEEEEE;border-radius:6px;padding:20px 30px;margin:0 0 34px 8%}.grade-item-labels .classification-item[data-v-f0e54a4c]{display:flex;margin-bottom:10px}.client-grade-item[data-v-f0e54a4c]{font-size:14px;display:flex;align-items:center;margin-bottom:20px}.client-grade-item .grade-item-name[data-v-f0e54a4c]{width:55%;height:32px;padding:0 10px;line-height:32px;background:#eeeff1;margin-left:10px;color:#86909c;font-size:14px}.clue-module-details[data-v-f0e54a4c]{padding:15px;background:#fff}.detail-title-con[data-v-f0e54a4c]{display:flex}.detail-title-con .detail-title-btn[data-v-f0e54a4c]{margin:0 0 0 auto}.title[data-v-f0e54a4c]{display:flex;align-items:center;height:65px;width:calc(100% + 35px);overflow:hidden;justify-content:space-between;background-color:#fafcff;margin:-15px -15px 15px;border-bottom:1px solid #E6E6E6}.detail-form-con .detail-part[data-v-f0e54a4c]{margin-top:15px;padding:20px;border:1px solid #eee;border-radius:10px}.detail-form-con .detail-part .part-title[data-v-f0e54a4c]{font-size:16px;display:flex;align-items:center;margin-bottom:20px}.detail-form-con .detail-part .part-title .title-line[data-v-f0e54a4c]{width:4px;height:18px;padding:0;background-color:#1651ee;border-radius:4px;margin-top:2px;margin-right:5px}.detail-form-con .detail-part .part-title .title-line[data-v-f0e54a4c]:after{width:0}.detail-form-con .detail-part .part-title .hide-key[data-v-f0e54a4c]{float:right;color:#1651ee;font-size:14px;cursor:pointer;margin-left:auto}.detail-form-con .el-input[data-v-f0e54a4c],.detail-form-con .el-select[data-v-f0e54a4c]{width:300px}.el-col-10[data-v-f0e54a4c]{position:relative}.association-icon[data-v-f0e54a4c]{position:absolute;top:12%;right:80px}\n",document.head.appendChild(g),{setters:[function(e){l=e.n,a=e.r,i=e.f,n=e.$,r=e.o,o=e.e},function(e){s=e.u,d=e.a},function(e){u=e.h,c=e.f},function(e){m=e.c},function(e){f=e.d},function(e){p=e.L},function(){},function(){}],execute:function(){var t={__name:"clientModuleDetails",setup:function(e){var t=a(),l=a(),g=s(),v=d(),_=a(!0),b=a(),h=i({templates_id:"",company_id:n.getters.company,name:"",status:1,is_limit:0,field_list:[],dept_list:[],member_list:[],is_intention_level:1,label_list:[],customer_level_list:[]}),y=a(),x=a([]),C=a(!1),k=i({name:""}),S=a(),w=i({name:[{required:!0,message:"请输入客户等级名称",trigger:"blur"}]}),F=a(null),A=a(null),T=a(null),q=a(!1),I=i({name:""}),R=i({name:[{required:!0,message:"请输入标签分类名称",trigger:"blur"}]}),E=a(),B=a([]),j=a(!1),M=i({name:""}),z=i({name:[{required:!0,message:"请输入标签名称",trigger:"blur"}]}),D=a(),J=function(e,t,l){h.dept_list.length||h.member_list.length?l():l(new Error("请选择使用权限"))},O=i({name:[{required:!0,message:"请输入模板名称",trigger:"blur"}],dept_list:[{required:!0,validator:J,trigger:"change"}]}),V=a([]),P=a([]),G=a([]),N=a([]),L=a([]);function H(){HTTP.get("templates_config",{key:"clue_customer_temp"}).then((function(e){V.value=JSON.parse(e.data.results[0].field_json),v.query.id?W(v.query.id):X({})}))}function W(e){HTTP.getById("customer_templates",e).then((function(e){if(N.value=[],h.templates_id=e.data.id,h.company_id=e.data.company,h.name=e.data.name,h.status=e.data.status,h.is_limit=e.data.is_limit,h.is_intention_level=e.data.is_intention_level,e.data.customer_level_list.sort((function(e,t){return e.weight-t.weight})),h.customer_level_list=e.data.customer_level_list,e.data.label_list.map((function(e){e.label_data.sort((function(e,t){return e.weight-t.weight}))})),h.label_list=e.data.label_list,e.data.dept_list&&(h.dept_list=e.data.dept_list.split(","),h.dept_list.map((function(e){N.value.push("dept-".concat(e))}))),e.data.member_list&&(h.member_list=e.data.member_list.split(","),h.member_list.map((function(e){N.value.push("user-".concat(e))}))),e.data.field_json){var t={};JSON.parse(e.data.field_json).map((function(e){t[e.key]=e})),X(t)}}))}function X(e){V.value.map((function(t){t.sort=e[t.key]?e[t.key].sort:t.sort,e[t.key]&&e[t.key].is_hide?(v.query.id&&(t.is_required=e[t.key].is_required),G.value.push(t)):(v.query.id&&(t.is_required=e[t.key].is_required),P.value.push(t))})),Object.keys(e).map((function(t){1===e[t].is_custom&&P.value.push(e[t])})),P.value=P.value.sort((function(e,t){return e.sort-t.sort})),G.value=G.value.sort((function(e,t){return e.sort-t.sort}))}function Y(){C.value=!1,k.name="",F.value=null}function Q(){A.value=null,q.value=!1,I.name=""}function U(){j.value=!1,T.value=null,M.name="",A.value=null,T.value=null}return r((function(){console.log("route",v.query),_.value=v.query&&"detail"!==v.query.type,H()})),{__sfc:!0,hideRef:t,customFieldRef:l,router:g,route:v,canEditor:_,formRef:b,form:h,value1:y,clientBradeList:x,dialogVisible:C,ruleForm:k,ruleFormRef:S,rulesClient:w,clientIndex:F,tagIndex:A,sortIndex:T,dialogVisibleSort:q,ruleFormSort:I,rulesClientSort:R,ruleFormSortRef:E,sortList:B,dialogVisibleTag:j,ruleFormTag:M,rulesClientTag:z,ruleFormTagRef:D,validatePass:J,rules:O,templateItems:V,showItems:P,hideItems:G,deptMember:N,restaurants:L,querySearch:function(e,t){var l={company:n.getters.company,offset:0,limit:100,del_flag:0,name__contains:e};HTTP.get("customer_templates_label_cate",l).then((function(e){0==e.code&&(L.value=[],e.data.results.map((function(e){e.value=e.name,L.value.push(e)})),t(L.value))}))},handleSelect:function(e){},getTemplateConfig:H,initData:W,dealShowItems:X,handleDept:function(e){h.dept_list=e?e.split(","):[],b.value.validateField("dept_list")},handleMember:function(e){h.member_list=e?e.split(","):[],b.value.validateField("dept_list")},goBack:function(){g.back()},showHideFields:function(){t.value.init()},hideFormItem:function(e){console.log("e",e),e.is_hide=1,P.value=P.value.filter((function(e){return!e.is_hide})),G.value.push(e)},deleteFormItem:function(e){P.value=P.value.filter((function(t){return t.name!==e.name}))},requiredFormItem:function(e,t){e.is_required=t},ondragend:function(){console.log("e",h.field_list)},ondragendTag:function(){},showFormItem:function(e){e.map((function(e){var t=V.value.filter((function(t){return t.key===e}));t[0].is_hide=0;var l=P.value.findIndex((function(e){return"备注"===e.name}));l>0?P.value.splice(l,0,t[0]):P.value.push(t[0])})),G.value=G.value.filter((function(t){return!e.includes(t.key)}))},showCustom:function(){l.value.init()},saveCustomField:function(e){console.log("e",e);var t=JSON.parse(JSON.stringify(V.value[0]));t.name=e.name,t.is_custom=1,t.key="",t.type=e.type,t.dropdown_value=e.dropdown_value?e.dropdown_value.split("、"):[],t.rule={length_limit:e.length_limit},t.is_required=e.is_required;var l=P.value.findIndex((function(e){return"备注"===e.name}));l>0?P.value.splice(l,0,t):P.value.push(t)},saveForm:function(){b.value.validate((function(e){if(!e)return console.log("error submit!!"),!1;var t=JSON.parse(JSON.stringify(h));t.templates_id||delete t.templates_id,t.field_list=[],P.value.map((function(e,l){e.sort=l+1,e.is_hide=0,t.field_list.push(e)})),G.value.map((function(e,l){e.sort=l+P.value.length+1,e.is_hide=1,t.field_list.push(e)})),t.label_list.map((function(e){e.label_data.map((function(e,t){e.weight=t+1}))})),t.customer_level_list.map((function(e,t){e.weight=t+1})),console.log(t),HTTP.post("create_customer_templates",t).then((function(e){console.log("res",e),0===e.code?(o.exports.Message({type:"success",message:"保存成功"}),g.back()):o.exports.Message({type:"error",message:e.msg})}))}))},addClientGarde:function(){C.value=!0},addClientBtn:function(){S.value.validate((function(e){if(!e)return!1;null!=F.value?h.customer_level_list.filter((function(e){return 0==e.del_flag}))[F.value].name=k.name:h.customer_level_list.push({name:k.name,del_flag:0}),Y()}))},editClientGarde:function(e,t){F.value=t,C.value=!0,this.ruleForm.name=e.name},deleteClientGarde:function(e,t){e.id?h.customer_level_list.filter((function(e){return 0==e.del_flag}))[t].del_flag=1:h.customer_level_list.splice(t,1)},handleClose:Y,editClientSort:function(e,t){A.value=t,q.value=!0,this.ruleFormSort.name=e.name},deleteClientSort:function(e,t){e.id?h.label_list.filter((function(e){return 0==e.del_flag}))[t].del_flag=1:h.label_list.splice(t,1)},addSort:function(e){q.value=!0},handleCloseSort:Q,addSortBtn:function(){E.value.validate((function(e){if(!e)return!1;null!=A.value?h.label_list.filter((function(e){return 0==e.del_flag}))[A.value].name=I.name:h.label_list.push({name:I.name,label_data:[],del_flag:0}),Q()}))},addClientTag:function(e){T.value=e,j.value=!0},handleCloseTag:U,editClientTag:function(e,t,l){j.value=!0,M.name=e.name,T.value=l,A.value=t},deleteClientTag:function(e,t,l){e.id?h.label_list.filter((function(e){return 0==e.del_flag}))[l].label_data.filter((function(e){return 0==e.del_flag}))[t].del_flag=1:h.label_list.filter((function(e){return 0==e.del_flag}))[l].label_data.splice(t,1)},addTagtBtn:function(){D.value.validate((function(e){if(!e)return!1;null!=A.value?h.label_list.filter((function(e){return 0==e.del_flag}))[T.value].label_data.filter((function(e){return 0==e.del_flag}))[A.value].name=M.name:h.label_list.filter((function(e){return 0==e.del_flag}))[T.value].label_data.push({name:M.name,del_flag:0}),U()}))},hideDialog:u,customField:m,formItem:c,draggable:f,LJWWDMSelect:p}}},g=function(){var e=this,t=e._self._c,l=e._self._setupProxy;return t("div",{staticClass:"clue-module-details"},[t("div",{staticClass:"title"},[t("div",{staticStyle:{"margin-left":"30px"}},[e._v(e._s("edit"==l.route.query.type?"编辑客户模板":"新增客户模板"))]),t("div",{staticStyle:{display:"flex","justify-content":"center","margin-right":"20px"}},[t("el-button",{on:{click:l.goBack}},[e._v("取消")]),l.canEditor?t("el-button",{attrs:{type:"primary"},on:{click:l.saveForm}},[e._v("保存")]):e._e()],1)]),t("div",{staticClass:"detail-form-con"},[t("el-form",{ref:"formRef",staticClass:"form-spec",attrs:{disabled:!l.canEditor,model:l.form,rules:l.rules,"label-width":"200px"}},[t("div",{staticClass:"detail-part"},[t("div",{staticClass:"part-title"},[t("div",{staticClass:"title-line"}),e._v(" 模板信息 ")]),t("el-form-item",{attrs:{label:"模板名称",prop:"name"}},[t("el-input",{model:{value:l.form.name,callback:function(t){e.$set(l.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"使用权限",prop:"dept_list"}},[t("div",{staticStyle:{width:"300px"}},[t(l.LJWWDMSelect,{attrs:{defaultCheckedKeys:l.deptMember},on:{dept:l.handleDept,member:l.handleMember}})],1)])],1),t("div",{staticClass:"detail-part"},[t("div",{staticClass:"part-title"},[t("div",{staticClass:"title-line"}),e._v(" 基本信息 "),t("span",{directives:[{name:"permission",rawName:"v-permission",value:34210,expression:"34210"}],staticClass:"hide-key",on:{click:l.showHideFields}},[e._v("已隐藏字段")])]),t("el-row",[t(l.draggable,{attrs:{list:l.showItems},on:{end:l.ondragend}},[t("transition-group",e._l(l.showItems,(function(a,i){return t("el-col",{key:i,attrs:{span:10}},[0==a.is_custom?t("div",{staticClass:"association-icon"},[t("img",{staticStyle:{width:"14px",height:"14px"},attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAYxJREFUOE/lkr9rVEEQx7/f5S7cQXpJE4i3sxwXzs50aSRVEFJaHhgRg1ZaiRYplJAUgYAkTRIUrCzlSrGyMp0Pz3u7dyLij8bO5uB8O8ke7+T+hywMLN/Zz8zynaH3fs0Yc6Kq88aYp41G4wgzp9/vLxljbIzxc7PZ/DVNMYTwDcDXMjrj8Xix1Wr9VtWUOyB5H4AB8I/ktrX2eYJT8o+qdkl+AbAzGo2k3W4P8zzvGGNOATwi2Y0xdkg+IblmrX3PPM/vknxBsgLgSERSB4QQ3qjqgnNudfq9EMIAwFsRecgkeu9PSbZF5Pr0kfe+m+7OuZsz2keSn0TkzgQMIRyr6jXn3MplB0MIZ6qaOeduT83ZB7AhIhaAloZ9APBTRG6Vzh+SvFcuwoMJOBgMbqjqOwC7RVG8rFQqaQR7qtq5KPY6y7JGrVYLAB4DWAawPgHLDkncBjAHIAI4sNamrdFer7dQrVa/A3gF4GqK/2CCsyy7Uq/Xl1XVXwz5x+yyD4fDraIonpH8G2PcPAeN6OzFJBjQ1gAAAABJRU5ErkJggg==",alt:""}})]):e._e(),t("el-form-item",{attrs:{label:a.name,required:!!a.is_required}},[t(l.formItem,{attrs:{type:a.type,data:a,status:"client"},on:{hideFormItem:l.hideFormItem,deleteFormItem:l.deleteFormItem,requiredFormItem:l.requiredFormItem}})],1)],1)})),1)],1),t("el-col",[t("el-form-item",{attrs:{label:"新建字段"}},[t("el-button",{directives:[{name:"permission",rawName:"v-permission",value:34209,expression:"34209"}],attrs:{type:"primary",plain:""},on:{click:l.showCustom}},[e._v(" + 自定义字段 ")])],1)],1)],1),t("div",{staticClass:"part-title"},[t("div",{staticClass:"title-line"}),e._v(" 意向度 ")]),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:6,offset:2}},[t("div",{staticStyle:{display:"flex"}},[t("el-switch",{attrs:{"active-value":1,"inactive-value":0,"inactive-text":"是否开启意向度"},model:{value:l.form.is_intention_level,callback:function(t){e.$set(l.form,"is_intention_level",t)},expression:"form.is_intention_level"}}),t("el-rate",{staticStyle:{"margin-left":"10px"},attrs:{disabled:"","text-color":"#ff9900","score-template":"{value}"}})],1)])],1),t("div",{staticClass:"part-title"},[t("div",{staticClass:"title-line"}),e._v(" 客户标签 ")]),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:6,offset:2}},[t("el-button",{attrs:{type:"primary",plain:""},on:{click:l.addSort}},[e._v(" + 新增标签分类 ")])],1)],1),t("div",{staticClass:"grade-list"},e._l(l.form.label_list.filter((function(e){return 0==e.del_flag})),(function(a,i){return t("div",{key:i,staticClass:"classification-list"},[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:6,offset:2}},[t("div",{staticStyle:{"margin-bottom":"20px",display:"flex","align-items":"center"}},[t("div",{staticClass:"grade-item-name"},[e._v(e._s(a.name?a.name:"标签分类名称"))]),t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"text"},on:{click:function(e){return l.editClientSort(a,i)}}},[e._v("编辑")]),t("el-button",{staticStyle:{color:"red"},attrs:{type:"text"},on:{click:function(e){return l.deleteClientSort(a,i)}}},[e._v("删除")])],1)])],1),t("div",{staticClass:"grade-item-labels"},[t("el-row",{attrs:{gutter:20}},[t(l.draggable,{attrs:{list:a.label_data},on:{end:l.ondragendTag}},[t("transition-group",e._l(a.label_data.filter((function(e){return 0==e.del_flag})),(function(a,n){return t("el-col",{key:n,attrs:{span:5}},[t("div",{staticClass:"classification-item"},[t("div",{staticClass:"grade-item-name"},[e._v(e._s(a.name?a.name:"标签分类名称"))]),t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"text"},on:{click:function(e){return l.editClientTag(a,n,i)}}},[e._v("编辑")]),t("el-button",{staticStyle:{color:"red"},attrs:{type:"text"},on:{click:function(e){return l.deleteClientTag(a,n,i)}}},[e._v("删除")])],1)])})),1)],1),t("el-col",{attrs:{span:5}},[t("el-button",{attrs:{type:"primary",plain:""},on:{click:function(e){return l.addClientTag(i)}}},[e._v(" + 新增标签 ")])],1)],1)],1)],1)})),0),t("div",{staticClass:"part-title"},[t("div",{staticClass:"title-line"}),e._v(" 客户等级 ")]),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:6,offset:2}},[t("el-button",{attrs:{type:"primary",plain:""},on:{click:l.addClientGarde}},[e._v(" + 新增客户等级 ")])],1)],1),t("div",{staticClass:"grade-list"},[t("el-row",{attrs:{gutter:20}},e._l(l.form.customer_level_list.filter((function(e){return 0==e.del_flag})),(function(a,i){return t("el-col",{key:i,attrs:{span:8,offset:2}},[t("div",{staticClass:"client-grade-item"},[t("div",{},[e._v("客户等级"+e._s(i+1))]),t("div",{staticClass:"grade-item-name"},[e._v(e._s(a.name?a.name:"请输入客户等级名称"))]),t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"text"},on:{click:function(e){return l.editClientGarde(a,i)}}},[e._v("编辑")]),t("el-button",{staticStyle:{color:"red"},attrs:{type:"text"},on:{click:function(e){return l.deleteClientGarde(a,i)}}},[e._v("删除")])],1)])})),1)],1)],1)])],1),t("el-dialog",{attrs:{title:"客户等级",visible:l.dialogVisible,"append-to-body":!0,"modal-append-to-body":!1,width:"30%","before-close":l.handleClose},on:{"update:visible":function(e){l.dialogVisible=e}}},[t("el-form",{ref:"ruleFormRef",staticClass:"demo-ruleForm",attrs:{model:l.ruleForm,rules:l.rulesClient,"label-width":"100px"}},[t("el-form-item",{attrs:{label:"等级名称",prop:"name"}},[t("el-input",{model:{value:l.ruleForm.name,callback:function(t){e.$set(l.ruleForm,"name",t)},expression:"ruleForm.name"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:l.handleClose}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:l.addClientBtn}},[e._v("确 定")])],1)],1),t("el-dialog",{attrs:{title:"客户标签分类",visible:l.dialogVisibleSort,"append-to-body":!0,"modal-append-to-body":!1,width:"30%","before-close":l.handleCloseSort},on:{"update:visible":function(e){l.dialogVisibleSort=e}}},[t("el-form",{ref:"ruleFormSortRef",staticClass:"demo-ruleForm",attrs:{model:l.ruleFormSort,rules:l.rulesClientSort,"label-width":"110px"}},[t("el-form-item",{attrs:{label:"标签分类名称",prop:"name"}},[t("el-autocomplete",{staticClass:"inline-input",staticStyle:{width:"100%"},attrs:{"fetch-suggestions":l.querySearch},on:{select:l.handleSelect},model:{value:l.ruleFormSort.name,callback:function(t){e.$set(l.ruleFormSort,"name",t)},expression:"ruleFormSort.name"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:l.handleCloseSort}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:l.addSortBtn}},[e._v("确 定")])],1)],1),t("el-dialog",{attrs:{title:"客户标签",visible:l.dialogVisibleTag,"append-to-body":!0,"modal-append-to-body":!1,width:"30%","before-close":l.handleCloseTag},on:{"update:visible":function(e){l.dialogVisibleTag=e}}},[t("el-form",{ref:"ruleFormTagRef",staticClass:"demo-ruleForm",attrs:{model:l.ruleFormTag,rules:l.rulesClientTag,"label-width":"110px"}},[t("el-form-item",{attrs:{label:"标签名称",prop:"name"}},[t("el-input",{model:{value:l.ruleFormTag.name,callback:function(t){e.$set(l.ruleFormTag,"name",t)},expression:"ruleFormTag.name"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:l.handleCloseTag}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:l.addTagtBtn}},[e._v("确 定")])],1)],1),t(l.hideDialog,{ref:"hideRef",attrs:{hideItems:l.hideItems},on:{showFormItem:l.showFormItem}}),t(l.customField,{ref:"customFieldRef",on:{saveCustomField:l.saveCustomField}})],1)},v=[];g._withStripped=!0;var _=l(t,g,v,!1,null,"f0e54a4c",null,null);_.options.__file="E:/十二科技/项目/九号同事/salary-management-web/src/views/markets/configurations/clientModule/clientModuleDetails.vue",e("default",_.exports)}}}));