8645.2cf67fce.js 9.8 KB

1
  1. "use strict";(self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[8645],{18645:function(e,t,r){r.r(t),r.d(t,{default:function(){return m}});var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.onShow}},[e._v("编 辑")]),r("el-drawer",{attrs:{title:"新建档案",direction:"rtl","append-to-body":"",visible:e.dialogFormVisible,"show-close":!1,size:"600px"},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[r("div",{staticClass:"drawer__panel"},[r("el-row",{attrs:{gutter:20}},[r("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"90px","label-position":"right",size:"mini"}},[r("el-col",{attrs:{span:20}},[r("el-form-item",{attrs:{label:"企业名称",prop:"enterprisename"}},[r("el-input",{attrs:{placeholder:"输入企业名称"},model:{value:e.form.enterprisename,callback:function(t){e.$set(e.form,"enterprisename",t)},expression:"form.enterprisename"}})],1)],1),r("el-col",{attrs:{span:4}},[r("el-popover",{attrs:{placement:"right",width:"900",trigger:"manual"},model:{value:e.businessShow,callback:function(t){e.businessShow=t},expression:"businessShow"}},[r("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"}},[r("i",{staticClass:"el-icon-search",attrs:{slot:"prefix"},on:{click:e.businessSearch},slot:"prefix"})]),r("el-table",{attrs:{data:e.businessData,"header-cell-style":{background:"#EEEEEE",color:"#333"},size:"mini"},on:{"row-click":e.businessSelect}},[r("el-table-column",{attrs:{width:"260",label:"客户名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("span",{staticStyle:{"margin-left":"10px"}},[e._v(e._s(t.row.companyName?t.row.companyName:"--"))])]}}])}),r("el-table-column",{attrs:{label:"客户地址"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("span",{staticStyle:{"margin-left":"10px"}},[e._v(e._s(t.row.address?t.row.address:"--"))])]}}])}),r("el-table-column",{attrs:{width:"200",label:"客户税号"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("span",{staticStyle:{"margin-left":"10px"}},[e._v(e._s(t.row.taxNum?t.row.taxNum:"--"))])]}}])})],1),r("el-button",{staticStyle:{width:"100%"},attrs:{slot:"reference",size:"mini",type:"primary",disabled:""===e.form.enterprisename},on:{click:e.businessSearch},slot:"reference"},[e._v("工商查询")])],1)],1),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"联系人",prop:"contact"}},[r("el-input",{attrs:{placeholder:"输入企业联系人"},model:{value:e.form.contact,callback:function(t){e.$set(e.form,"contact",t)},expression:"form.contact"}})],1)],1),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"联系电话",prop:"phonenumber"}},[r("el-input",{attrs:{placeholder:"输入联系电话"},model:{value:e.form.phonenumber,callback:function(t){e.$set(e.form,"phonenumber",t)},expression:"form.phonenumber"}})],1)],1),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"省市县",prop:"province"}},[r("el-cascader",{staticStyle:{width:"100%"},attrs:{options:e.basicData.data().areaData,clearable:""},on:{change:e.cascaderChange},model:{value:e.form.province,callback:function(t){e.$set(e.form,"province",t)},expression:"form.province"}})],1)],1),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"税号",prop:"taxno"}},[r("el-input",{attrs:{placeholder:"输入税号"},model:{value:e.form.taxno,callback:function(t){e.$set(e.form,"taxno",t)},expression:"form.taxno"}})],1)],1),r("el-col",{attrs:{span:24}},[r("el-form-item",{attrs:{label:"是否免运费",prop:"freefreightamount"}},[r("el-radio-group",{on:{change:e.radioChange},model:{value:e.radio,callback:function(t){e.radio=t},expression:"radio"}},[r("el-radio",{attrs:{label:-1}},[e._v("不免费运费")]),r("el-radio",{attrs:{label:0}},[e._v("免运费")]),r("el-radio",{attrs:{label:1}},[e._v("其他")])],1)],1)],1),1===e.radio?r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"免运费额度",prop:"freefreightamount"}},[r("el-input",{attrs:{placeholder:"请输入免运费额度"},model:{value:e.form.freefreightamount,callback:function(t){e.$set(e.form,"freefreightamount",e._n(t))},expression:"form.freefreightamount"}})],1)],1):e._e(),r("el-col",{attrs:{span:1===e.radio?12:24}},[r("el-form-item",{attrs:{label:"可退货天数",prop:"limitreturnday"}},[r("el-input",{attrs:{placeholder:"请输入订单可退货天数"},model:{value:e.form.limitreturnday,callback:function(t){e.$set(e.form,"limitreturnday",e._n(t))},expression:"form.limitreturnday"}})],1)],1),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"开票节点",prop:"invoicingpoint"}},[r("el-radio-group",{model:{value:e.form.invoicingpoint,callback:function(t){e.$set(e.form,"invoicingpoint",t)},expression:"form.invoicingpoint"}},[r("el-radio",{attrs:{label:1}},[e._v("订单审核")]),r("el-radio",{attrs:{label:2}},[e._v("发货")])],1)],1)],1),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"企业等级"}},[r("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择"},model:{value:e.form.grade,callback:function(t){e.$set(e.form,"grade",t)},expression:"form.grade"}},e._l(e.agent_level,(function(t){return r("el-option",{key:t.value,attrs:{label:t.remarks,value:t.value}},[r("span",{staticStyle:{float:"left"}},[e._v(e._s(t.value))]),r("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"12px"}},[e._v(e._s(t.remarks?t.remarks:"暂无描述"))])])})),1)],1)],1),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"是否授权所有营销类别:",prop:"saleclassauth","label-width":"160px"}},[r("el-checkbox",{attrs:{"true-label":0,"false-label":1},model:{value:e.form.saleclassauth,callback:function(t){e.$set(e.form,"saleclassauth",t)},expression:"form.saleclassauth"}})],1)],1),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"erp编号",prop:"erpagentnum"}},[r("el-input",{attrs:{placeholder:"输入erp编号"},model:{value:e.form.erpagentnum,callback:function(t){e.$set(e.form,"erpagentnum",t)},expression:"form.erpagentnum"}})],1)],1),r("el-col",{attrs:{span:24}},[r("el-form-item",{attrs:{label:"详细地址",prop:"address"}},[r("el-input",{attrs:{type:"textarea",rows:3,placeholder:"输入详细地址"},model:{value:e.form.address,callback:function(t){e.$set(e.form,"address",t)},expression:"form.address"}})],1)],1)],1)],1)],1),r("div",{staticClass:"fixed__btn__panel"},[r("el-button",{staticClass:"normal-btn-width",attrs:{size:"small"},on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("取 消")]),r("el-button",{staticClass:"normal-btn-width btn-warning",attrs:{size:"small",type:"warning"},on:{click:e.onSubmit}},[e._v("确 定")])],1)])],1)},s=[],o=r(20629),i={props:["data"],data(){return{radio:-1,dialogFormVisible:!1,businessData:[],businessParam:{id:20221208103601,content:{pageNumber:1,pageSize:5,keyword:""}},businessShow:!1,total:0,currentPage:0,form:{address:"",city:"",changeby:"",county:"",phonenumber:"",sys_enterpriseid:0,enterprisename:"",province:"",contact:"",taxno:"",limitreturnday:"",freefreightamount:"",latitude:"",longitude:"",invoicingpoint:1,saleclassauth:1},agent_level:[],rules:{enterprisename:[{required:!0,message:"输入企业名称",trigger:"blur"}],contact:[{required:!0,message:"输入企业联系人",trigger:"blur"}],phonenumber:[{required:!0,message:"输入联系电话",trigger:"blur"}],taxno:[{required:!0,message:"输入税号",trigger:"blur"}],province:[{required:!0,message:"选择省市县",trigger:"change"}],address:[{required:!0,message:"输入详细地址",trigger:"blur"}],freefreightamount:[{type:"number",message:"请输入数字",trigger:"blur"}],limitreturnday:[{type:"number",message:"请输入数字",trigger:"blur"}]}}},computed:{...(0,o.Se)({arealist:"arealist"})},methods:{onShow(){switch(this.form=Object.assign({},this.form,this.data),this.form.province&&(this.form.province=[this.form.province,this.form.city,this.form.county]),this.form.freefreightamount){case-1:this.radio=-1;break;case 0:this.radio=0;break;default:this.radio=1;break}this.dialogFormVisible=!0,this.query_sysoptions()},async query_sysoptions(){const e=await this.$store.dispatch("optiontypeselect","agentgrade");this.agent_level=e.data},cascaderChange(e){this.form.province=e},onSubmit(){this.$refs["form"].validate((async e=>{if(!e)return!1;this.form.city=this.form.province[1],this.form.county=this.form.province[2],this.form.province=this.form.province[0];const t=await this.$api.requested({id:20220920084101,content:this.form});this.tool.showMessage(t,(()=>{this.$emit("onSuccess"),this.$refs["form"].resetFields(),this.dialogFormVisible=!1}))}))},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.province=[e.regProvince,e.regCity,e.regArea],this.form.city=e.regCity,this.form.county=e.regArea,this.form.contact=e.legalPerson})).catch((()=>{this.$message({type:"info",message:"已取消更新"})}))},radioChange(e){switch(e){case-1:this.form.freefreightamount=-1;break;case 0:this.form.freefreightamount=0;break;default:this.form.freefreightamount="";break}}},mounted(){}},l=i,n=r(43736),c=(0,n.Z)(l,a,s,!1,null,null,null),m=c.exports}}]);