| 1 |
- "use strict";(self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[2090],{52090:function(e,t,a){a.r(t),a.d(t,{default:function(){return p}});var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"inline-16"},[a("el-button",{directives:[{name:"show",rawName:"v-show",value:2!==e.form.datastatus,expression:"form.datastatus !== 2"}],attrs:{size:"mini",disabled:2===e.dataToForm.datastatus,type:e.btnType?e.btnType:"text"},on:{click:e.show}},[e._v("编 辑")]),a("el-dialog",{attrs:{title:"新 建",visible:e.dialogFormVisible,width:"600px"},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[a("div",{staticStyle:{"font-size":"15px"},attrs:{slot:"title"},slot:"title"},[e._v(" 新增客户 ")]),a("el-row",{attrs:{gutter:20}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"120px","label-position":"right",size:"mini"}},[a("el-col",{attrs:{span:20}},[a("el-form-item",{attrs:{label:"客户名称",prop:"enterprisename"}},[a("el-input",{attrs:{placeholder:"请输入客户名称"},model:{value:e.form.enterprisename,callback:function(t){e.$set(e.form,"enterprisename",t)},expression:"form.enterprisename"}})],1)],1),a("el-col",{attrs:{span:20}},[a("el-form-item",{attrs:{label:"客户类型"}},[a("el-select",{staticStyle:{width:"345px"},attrs:{placeholder:"请选择客户类型"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},e._l(e.options.type,(function(e){return a("el-option",{key:e.value,attrs:{label:e.value,value:e.value}})})),1)],1)],1),a("el-col",{attrs:{span:20}},[a("el-form-item",{attrs:{label:"客户来源"}},[a("el-input",{attrs:{placeholder:"请输入客户来源"},model:{value:e.form.source,callback:function(t){e.$set(e.form,"source",t)},expression:"form.source"}})],1)],1),a("el-col",{attrs:{span:20}},[a("el-form-item",{attrs:{label:"上级客户"}},[a("el-select",{staticStyle:{width:"345px"},attrs:{placeholder:"请选择上级客户"},model:{value:e.form.parentid,callback:function(t){e.$set(e.form,"parentid",t)},expression:"form.parentid"}},e._l(e.options.parentCustomers,(function(e){return a("el-option",{key:e.sa_customersid,attrs:{label:e.enterprisename,value:e.sa_customersid}})})),1)],1)],1),a("el-col",{attrs:{span:15}},[a("el-form-item",{attrs:{label:"省市县"}},[a("el-cascader",{staticStyle:{width:"345px"},attrs:{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),a("el-col",{attrs:{span:20}},[a("el-form-item",{attrs:{label:"企业地址"}},[a("el-input",{attrs:{placeholder:"请输入企业简称"},model:{value:e.form.address,callback:function(t){e.$set(e.form,"address",t)},expression:"form.address"}})],1)],1),a("el-col",{attrs:{span:20}},[a("el-form-item",{attrs:{label:"企业简称"}},[a("el-input",{attrs:{placeholder:"请输入企业简称"},model:{value:e.form.abbreviation,callback:function(t){e.$set(e.form,"abbreviation",t)},expression:"form.abbreviation"}})],1)],1),a("el-col",{attrs:{span:20}},[a("el-form-item",{attrs:{label:"企业税号"}},[a("el-input",{attrs:{placeholder:"请输入企业税号"},model:{value:e.form.taxno,callback:function(t){e.$set(e.form,"taxno",t)},expression:"form.taxno"}})],1)],1),a("el-col",{attrs:{span:20}},[a("el-form-item",{attrs:{label:"客户等级"}},[a("el-select",{staticStyle:{width:"345px"},attrs:{placeholder:"请选择客户等级"},model:{value:e.form.grade,callback:function(t){e.$set(e.form,"grade",t)},expression:"form.grade"}},e._l(e.options.gradeData,(function(e){return a("el-option",{key:e.rowindex,attrs:{label:e.value,value:e.rowindex}})})),1)],1)],1),a("el-col",{attrs:{span:20}},[a("el-form-item",{attrs:{label:"所属行业"}},[a("el-select",{staticStyle:{width:"345px"},attrs:{placeholder:"请选择所属行业"},model:{value:e.form.industry,callback:function(t){e.$set(e.form,"industry",t)},expression:"form.industry"}},e._l(e.options.industryData,(function(e){return a("el-option",{key:e.value,attrs:{label:e.value,value:e.value}})})),1)],1)],1),a("el-col",{attrs:{span:20}},[a("el-form-item",{attrs:{label:"联系方式"}},[a("el-input",{attrs:{placeholder:"请输入联系方式"},model:{value:e.form.phonenumber,callback:function(t){e.$set(e.form,"phonenumber",t)},expression:"form.phonenumber"}})],1)],1)],1)],1),a("div",{staticClass:"dialog-footer"},[a("el-button",{staticClass:"normal-btn-width",attrs:{size:"small"},on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("取 消")]),a("el-button",{staticClass:"normal-btn-width btn-warning",attrs:{size:"small",type:"warning"},on:{click:e.onSubmit}},[e._v("确 定")])],1)],1)],1)},o=[],r=a(20629),i={name:"edit",props:["data","btnType"],data(){return{dialogFormVisible:!1,form:{value:[],sa_customersid:0,sys_enterpriseid:0,enterprisename:"",type:"",source:"",parentid:"",abbreviation:"",taxno:"",grade:"",industry:"",phonenumber:"",province:"",city:"",county:"",address:""},value:"",options:{type:[],parentCustomers:[],gradeData:[],industryData:[]},rules:{enterprisename:[{required:!0,message:"输入客户",trigger:"blur"}]}}},computed:{...(0,r.Se)({arealist:"arealist",dataToForm:"dataToForm"})},methods:{show(){this.dialogFormVisible=!0,this.typeList(),this.parentCustomer(),this.gradeList(),this.industryList(),this.$store.dispatch("queryArealist"),console.log("输出"),console.log(this.data);let e=["province","city","county"];e.forEach((e=>{""!==this.data[e]&&this.form.value.push(this.data[e])})),this.form=Object.assign({},this.form,this.data),console.log("------------------"),console.log(this.form),0===this.form.parentid&&(this.form.parentid="未选择")},onSubmit(){"未选择"===this.form.parentid&&(this.form.parentid=0),console.log(this.form),this.$refs["form"].validate((async e=>{if(!e)return!1;const t=await this.$api.requested({id:20221012163902,content:this.form});this.tool.showMessage(t,(()=>{this.$emit("onSuccess"),this.$refs["form"].resetFields(),this.dialogFormVisible=!1}))}))},async typeList(){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:"customertypemx",parameter:{siteid:e}}});this.options.type=t.data},async parentCustomer(){const e=await this.$api.requested({id:20221014101002,content:{pageNumber:1,pageSize:20,where:{condition:""}}});console.log(e),this.options.parentCustomers=e.data},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 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}}});this.options.gradeData=t.data},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}}},l=i,n=a(43736),c=(0,n.Z)(l,s,o,!1,null,"995a9b88",null),p=c.exports}}]);
|