4395.371f3c11.js 18 KB

1
  1. "use strict";(self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[4395],{54395:function(e,t,s){s.r(t),s.d(t,{default:function(){return m}});var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.editBtn}},[e._v("编 辑")]),s("el-drawer",{attrs:{direction:"rtl","append-to-body":"",title:"编辑公海客户","show-close":!1,visible:e.dialogFormVisible,size:"600px"},on:{"update:visible":function(t){e.dialogFormVisible=t},close:e.onClose}},[s("div",{staticClass:"drawer__panel"},[s("el-row",{attrs:{gutter:20}},[s("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"90px","label-position":"right",size:"mini"}},[s("el-col",{attrs:{span:20}},[s("el-form-item",{attrs:{label:"客户名称:",prop:"enterprisename"}},[s("el-input",{attrs:{placeholder:"客户名称",disabled:0!==e.form.isagent},model:{value:e.form.enterprisename,callback:function(t){e.$set(e.form,"enterprisename",t)},expression:"form.enterprisename"}})],1)],1),s("el-col",{attrs:{span:4}},[s("el-popover",{attrs:{placement:"right",width:"900",trigger:"manual"},model:{value:e.businessShow,callback:function(t){e.businessShow=t},expression:"businessShow"}},[s("el-input",{staticStyle:{width:"300px","margin-bottom":"10px"},attrs:{placeholder:"请输入内容",clearable:"",size:"mini"},on:{clear:e.businessSearch},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.businessSearch.apply(null,arguments)}},model:{value:e.form.enterprisename,callback:function(t){e.$set(e.form,"enterprisename",t)},expression:"form.enterprisename"}},[s("i",{staticClass:"el-icon-search",attrs:{slot:"prefix"},on:{click:e.businessSearch},slot:"prefix"})]),s("el-table",{attrs:{data:e.businessData,"header-cell-style":{background:"#EEEEEE",color:"#333"},size:"mini"},on:{"row-click":e.businessSelect}},[s("el-table-column",{attrs:{width:"260",label:"客户名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[s("span",{staticStyle:{"margin-left":"10px"}},[e._v(e._s(t.row.companyName?t.row.companyName:"--"))])]}}])}),s("el-table-column",{attrs:{label:"客户地址"},scopedSlots:e._u([{key:"default",fn:function(t){return[s("span",{staticStyle:{"margin-left":"10px"}},[e._v(e._s(t.row.address?t.row.address:"--"))])]}}])}),s("el-table-column",{attrs:{width:"200",label:"客户税号"},scopedSlots:e._u([{key:"default",fn:function(t){return[s("span",{staticStyle:{"margin-left":"10px"}},[e._v(e._s(t.row.taxNum?t.row.taxNum:"--"))])]}}])})],1),s("el-button",{staticStyle:{width:"100%"},attrs:{slot:"reference",size:"mini",type:"primary",disabled:""===e.form.enterprisename||0!==e.form.isagent},on:{click:e.businessSearch},slot:"reference"},[e._v("工商查询")])],1)],1),s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{label:"企业简称:",prop:"abbreviation"}},[s("el-input",{attrs:{placeholder:"企业简称"},model:{value:e.form.abbreviation,callback:function(t){e.$set(e.form,"abbreviation",t)},expression:"form.abbreviation"}})],1)],1),s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{label:"客户类型:",prop:"type"}},[s("el-select",{attrs:{placeholder:"请选择客户类型",size:"small"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},e._l(e.customerType(),(function(t){return s("el-option",{key:t.value,attrs:{label:t.value,value:t.value}},[s("span",{staticStyle:{float:"left"}},[e._v(e._s(t.value))]),s("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"12px"}},[e._v(e._s(t.remarks?t.remarks:"暂无描述"))])])})),1)],1)],1),s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{label:"客户等级:"}},[s("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择客户等级",disabled:0!==e.form.isagent},model:{value:e.form.grade,callback:function(t){e.$set(e.form,"grade",t)},expression:"form.grade"}},e._l(e.options.customerGrade,(function(t){return s("el-option",{key:t.rowindex,attrs:{label:t.value,value:t.value}},[s("span",{staticStyle:{float:"left"}},[e._v(e._s(t.value))]),s("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"12px"}},[e._v(e._s(t.remarks?t.remarks:"暂无描述"))])])})),1)],1)],1),s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{label:"客户分类:"}},[s("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择客户分类"},model:{value:e.form.customergrade,callback:function(t){e.$set(e.form,"customergrade",t)},expression:"form.customergrade"}},e._l(e.options.customerClassification,(function(t){return s("el-option",{key:t.rowindex,attrs:{label:t.value,value:t.value}},[s("span",{staticStyle:{float:"left"}},[e._v(e._s(t.value))]),s("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"12px"}},[e._v(e._s(t.remarks?t.remarks:"暂无描述"))])])})),1)],1)],1),s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{label:"客户行业:"}},[s("el-select",{ref:"sle",staticStyle:{width:"100%"},attrs:{multiple:"",placeholder:"请选择所属行业",size:"mini"},model:{value:e.form.industry,callback:function(t){e.$set(e.form,"industry",t)},expression:"form.industry"}},e._l(e.options.industryData,(function(t){return s("el-option",{key:t.value,attrs:{label:t.value,value:t.value}},[s("span",{staticStyle:{float:"left"}},[e._v(e._s(t.value))]),s("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"12px"}},[e._v(e._s(t.remarks?t.remarks:"暂无描述"))])])})),1)],1)],1),s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{label:"税号:",prop:"taxno"}},[s("el-input",{attrs:{placeholder:"税号"},model:{value:e.form.taxno,callback:function(t){e.$set(e.form,"taxno",t)},expression:"form.taxno"}})],1)],1),s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{label:"法人:",prop:"contact"}},[s("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入法人信息"},model:{value:e.form.contact,callback:function(t){e.$set(e.form,"contact",t)},expression:"form.contact"}})],1)],1),s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{label:"电话:",prop:"contact"}},[s("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入电话"},model:{value:e.form.telephone,callback:function(t){e.$set(e.form,"telephone",t)},expression:"form.telephone"}})],1)],1),s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{label:"省市县:",prop:"province"}},[s("el-cascader",{staticStyle:{width:"100%"},attrs:{disabled:0!==e.form.isagent,options:e.basicData.data().areaData,clearable:""},on:{change:e.cascaderChange},model:{value:e.form.value,callback:function(t){e.$set(e.form,"value",t)},expression:"form.value"}})],1)],1),s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{label:"详细地址:",prop:"address"}},[s("el-input",{attrs:{placeholder:"详细地址",disabled:0!==e.form.isagent},model:{value:e.form.address,callback:function(t){e.$set(e.form,"address",t)},expression:"form.address"}})],1)],1),s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{label:"上级企业:"}},[s("el-popover",{attrs:{placement:"bottom",width:"700",trigger:"click"},on:{show:e.customerList},model:{value:e.customerShow,callback:function(t){e.customerShow=t},expression:"customerShow"}},[s("el-input",{staticStyle:{width:"300px","margin-bottom":"10px"},attrs:{placeholder:"请输入内容",clearable:"",size:"mini"},on:{clear:function(t){return e.customerList(e.customerParam.content.pageNumber=1)}},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.customerList(e.customerParam.content.pageNumber=1)}},model:{value:e.customerParam.content.where.condition,callback:function(t){e.$set(e.customerParam.content.where,"condition",t)},expression:"customerParam.content.where.condition"}},[s("i",{staticClass:"el-icon-search",attrs:{slot:"prefix"},on:{click:function(t){return e.customerList(e.customerParam.content.pageNumber=1)}},slot:"prefix"})]),s("el-table",{attrs:{data:e.customer.customerData,height:"396px","header-cell-style":{background:"#EEEEEE",color:"#333"},size:"mini"},on:{"row-click":e.customerData}},[s("el-table-column",{attrs:{label:"客户编号",width:"180"},scopedSlots:e._u([{key:"default",fn:function(t){return[s("span",{staticStyle:{"margin-left":"10px"}},[e._v(e._s(t.row.sa_customersid?t.row.sa_customersid:"--"))])]}}])}),s("el-table-column",{attrs:{label:"客户名称",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[s("span",{staticStyle:{"margin-left":"10px"}},[e._v(e._s(t.row.enterprisename?t.row.enterprisename:"--"))])]}}])}),s("el-table-column",{attrs:{label:"地址"},scopedSlots:e._u([{key:"default",fn:function(t){return[s("span",{staticStyle:{"margin-left":"10px"}},[e._v(e._s(t.row.address?t.row.address:"--"))])]}}])})],1),s("div",{staticClass:"container normal-panel",staticStyle:{"text-align":"right"}},[s("el-pagination",{attrs:{background:"",small:"","page-sizes":[10,20,50,100],layout:"total,sizes, prev, pager, next, jumper","current-page":e.customer.currentPage,total:e.customer.total},on:{"size-change":e.handleSizeChangeCustomer,"current-change":e.handleCurrentChangeCustomer}})],1),s("el-input",{attrs:{slot:"reference",readonly:!0,autocomplete:"off",placeholder:"请选择客户"},on:{input:e.selectCustomer},slot:"reference",model:{value:e.form.superiorenterprisename,callback:function(t){e.$set(e.form,"superiorenterprisename",t)},expression:"form.superiorenterprisename"}})],1)],1)],1),s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{label:"客户来源:"}},[s("el-input",{attrs:{placeholder:"客户来源"},model:{value:e.form.source,callback:function(t){e.$set(e.form,"source",t)},expression:"form.source"}})],1)],1),s("el-col",{attrs:{span:24}},[s("el-form-item",{attrs:{label:"公海池:",prop:"sa_customerpoolid"}},[s("el-select",{attrs:{placeholder:"请选择公海池",size:"small"},model:{value:e.form.sa_customerpoolid,callback:function(t){e.$set(e.form,"sa_customerpoolid",t)},expression:"form.sa_customerpoolid"}},e._l(e.publicList(),(function(e){return s("el-option",{key:e.sa_customerpoolid,attrs:{label:e.poolname,value:e.sa_customerpoolid}})})),1)],1)],1)],1)],1)],1),s("div",{staticClass:"fixed__btn__panel"},[s("el-button",{staticClass:"normal-btn-width inline-16",attrs:{size:"small"},on:{click:e.onClose}},[e._v("取 消")]),s("duplicateCheck",{attrs:{data:e.form}}),s("el-button",{staticClass:"normal-btn-width",attrs:{size:"small",type:"warning"},on:{click:e.onSave}},[e._v("保 存")])],1)])],1)},r=[],o=s(60651),i={name:"add",inject:["customerLead","customerType","arealist","publicList"],components:{duplicateCheck:o.Z},data(){return{dialogFormVisible:!1,isordercheck:!0,isusedcheck:!1,checkResults:"",customerShow:!1,businessData:[],businessParam:{id:20221208103601,content:{pageNumber:1,pageSize:5,keyword:""}},businessShow:!1,total:0,currentPage:0,value:"",options:{industryData:[],customerGrade:[],customerClassification:[]},form:{value:[],sa_customersid:0,parentid:0,sys_enterpriseid:0,enterprisename:"",type:"",customergrade:"",sa_customerpoolid:"",source:"",province:"",city:"",county:"",address:"",abbreviation:"",taxno:"",grade:"",industry:[],contact:"",phonenumber:"",ispublic:1,telephone:"",sa_agentsid:""},rules:{enterprisename:[{required:!0,message:"输入客户名称",trigger:"blur"}],type:[{required:!0,message:"还未选择客户类型",trigger:"change"}],source:[{required:!0,message:"请填写客户来源",trigger:"blur"}]},customerParam:{id:20220920083901,content:{pageNumber:1,pageSize:10,where:{condition:"",type:2,sa_projectid:""}}},customer:{customerData:[],total:0,currentPage:0}}},props:["data","btnType"],methods:{onClose(){this.businessShow=!1,this.dialogFormVisible=!1},editBtn(){this.dialogFormVisible=!0,console.log(this.form),this.form=Object.assign({},this.form,this.data),console.log(this.form),this.form.value=[this.form.province,this.form.city,this.form.county],0===this.form.grade&&(this.form.grade="")},async businessSearch(){this.businessParam.content.keyword=this.form.enterprisename;const e=await this.$api.requested(this.businessParam);console.log(e,"工商查询结果"),this.businessData=e.data,this.total=e.total,this.currentPage=e.pageNumber,this.businessShow=!0},businessSelect(e){console.log("选择的工商信息",e),this.$confirm("是否以查询的工商信息更新客户信息?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.businessShow=!1,this.form.enterprisename=e.companyName,this.form.address=e.address,this.form.taxno=e.taxNum,this.form.value=[e.regProvince,e.regCity,e.regArea],this.form.province=e.regProvince,this.form.city=e.regCity,this.form.county=e.regArea,this.form.contact=e.legalPerson,console.log(this.form)})).catch((()=>{this.$message({type:"info",message:"已取消更新"})}))},duplicateCheck(){this.$refs.form.validate((async e=>{if(!e)return!1;const t=await this.$api.requested({id:20221208172002,content:{sa_customersid:this.form.sa_customersid,enterprisename:this.form.enterprisename,taxno:this.form.taxno,address:this.form.address}});console.log(t,"查重结果"),0!==t.data.length&&console.log("重复"),this.checkResults=t.data.length,this.onSave()}))},onSave(){""===this.checkResults?this.duplicateCheck():0!==this.checkResults?this.$confirm("该客户疑似重复,是否确认保存客户?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.onSubmit()})).catch((()=>{this.$message({type:"info",message:"已取消保存"})})):this.onSubmit()},onSubmit(){this.$refs["form"].validate((async e=>{if(!e)return!1;const t=await this.$api.requested({id:"20221010164302",version:1,content:this.form});this.tool.showMessage(t,(()=>{0===this.checkResults?(this.$emit("onSuccess"),this.$refs["form"].resetFields(),this.dialogFormVisible=!1,this.checkResults=""):this.setTag(this.form.sa_customersid)}))}))},async setTag(e){await this.$api.requested({id:20220929090901,content:{ownertable:"sa_customers",ownerid:e,datatag:["疑似重复"]}});this.$emit("onSuccess"),this.$refs["form"].resetFields(),this.dialogFormVisible=!1,this.checkResults=""},cascaderChange(e){if(1===e.length)return this.form=Object.assign({},this.form,{province:e[0],city:"",county:""});this.form=Object.assign({},this.form,{province:e[0],city:e[1],county:e[2]})},async customerList(){const e=await this.$api.requested(this.customerParam);this.customer.customerData=e.data,this.customer.total=e.total,this.customer.currentPage=e.pageNumber},selectCustomer(){this.customerParam.content.where.condition=this.form.enterprisename,this.customerList()},customerData(e){this.form.parentid=e.sa_customersid,this.form.superiorenterprisename=e.enterprisename,this.customerShow=!1},handleSizeChangeCustomer(e){this.customerParam.content.pageSize=e,this.customerList()},handleCurrentChangeCustomer(e){this.customerParam.content.pageNumber=e,this.customerList()},async industryList(){const e=JSON.parse(sessionStorage.getItem("active_account")).siteid,t=await this.$api.requested({classname:"sysmanage.develop.optiontype.optiontype",method:"optiontypeselect",content:{pageNumber:1,pageSize:20,typename:"industry",parameter:{siteid:e}}});this.options.industryData=t.data},async gradeList(){const e=JSON.parse(sessionStorage.getItem("active_account")).siteid,t=await this.$api.requested({classname:"sysmanage.develop.optiontype.optiontype",method:"optiontypeselect",content:{pageNumber:1,pageSize:20,typename:"customergrade",parameter:{siteid:e}}});console.log("客户等级",t.data),this.options.customerClassification=t.data,console.log("处理后客户等级",this.options.customerClassification)},queryCustomerGrade(){this.$store.dispatch("optiontypeselect","agentgrade").then((e=>{this.options.customerGrade=e.data}))}},mounted(){this.industryList(),this.gradeList(),this.queryCustomerGrade()}},n=i,l=s(43736),c=(0,l.Z)(n,a,r,!1,null,"8dc58034",null),m=c.exports},60651:function(e,t,s){s.d(t,{Z:function(){return c}});var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("el-button",{staticClass:"inline-16 normal-btn-width",attrs:{size:"small",type:"primary"},on:{click:e.listData}},[e._v("查 重")]),s("el-dialog",{attrs:{title:"重复的客户",visible:e.dialogTableVisible,"append-to-body":""},on:{"update:visible":function(t){e.dialogTableVisible=t}}},[s("el-table",{attrs:{data:e.duplicateData,"header-cell-style":{background:"#EEEEEE",color:"#333"},size:"mini"}},[s("el-table-column",{attrs:{property:"enterprisename",label:"客户名称",width:"150"}}),s("el-table-column",{attrs:{property:"address",label:"客户地址"}}),s("el-table-column",{attrs:{property:"taxno",label:"企业税号",width:"150"}})],1),s("div",{staticClass:"container normal-panel",staticStyle:{"text-align":"right"}},[s("el-pagination",{attrs:{background:"","current-page":e.currentPage,"page-sizes":[10,20],layout:"total,sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1),s("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{staticClass:"normal-btn-width",attrs:{type:"primary",size:"mini"},on:{click:function(t){e.dialogTableVisible=!1}}},[e._v("确 定")])],1)],1)],1)},r=[],o={name:"duplicateCheck",props:["data"],data(){return{dialogTableVisible:!1,duplicateData:[],total:0,currentPage:0,param:{id:20221208172002,content:{sa_customersid:"",enterprisename:"",taxno:"",address:""}}}},methods:{async listData(){console.log(this.data,"数据"),this.param.content.sa_customersid=this.data.sa_customersid||0,this.param.content.enterprisename=this.data.enterprisename,this.param.content.taxno=this.data.taxno,this.param.content.address=this.data.address;const e=await this.$api.requested(this.param);e.data.length>0?(this.dialogTableVisible=!0,this.duplicateData=e.data,this.total=e.total,this.currentPage=e.pageNumber):this.$message({message:"无重复数据",type:"success"}),this.$emit("checkSuccess",e.data.length)},handleSizeChange(e){this.param.content.pageSize=e,this.listData()},handleCurrentChange(e){this.param.content.pageNumber=e,this.listData()}}},i=o,n=s(43736),l=(0,n.Z)(i,a,r,!1,null,"45e04fd7",null),c=l.exports}}]);