Files
qhmes/deploy-qhmes/frontend/js/MesXslCustomerModal-Dz_x_H5b.js
2026-05-15 11:34:12 +08:00

2 lines
5.9 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var y=Object.defineProperty;var I=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var _=(o,r,t)=>r in o?y(o,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[r]=t,b=(o,r)=>{for(var t in r||(r={}))M.call(r,t)&&_(o,t,r[t]);if(I)for(var t of I(r))B.call(r,t)&&_(o,t,r[t]);return o};var g=(o,r,t)=>new Promise((d,n)=>{var m=l=>{try{u(t.next(l))}catch(p){n(p)}},i=l=>{try{u(t.throw(l))}catch(p){n(p)}},u=l=>l.done?d(l.value):Promise.resolve(l.value).then(m,i);u((t=t.apply(o,r)).next())});import{d as D,aC as N,as as T,aF as k,k as J,u as a,aG as O,e as q,f as P}from"./vue-vendor-C7Zq48Yl.js";import{B as j}from"./index-Du0A3ksf.js";import"./index-Di-j2gt4.js";import{c as X,s as E,q as L}from"./MesXslCustomer.api-CkDsRb9F.js";import{ak as U,d as V}from"./index-BI6CMai0.js";import{u as z}from"./useForm-BZtHZyx2.js";import{B as A}from"./BasicForm-BJnSRkIE.js";const se=[{title:"ID",align:"center",dataIndex:"id",width:280,ellipsis:!0,defaultHidden:!0},{title:"客户编码",align:"center",dataIndex:"customerCode",width:140},{title:"客户名称",align:"center",dataIndex:"customerName",width:180},{title:"客户简称",align:"center",dataIndex:"customerShortName",width:120},{title:"客户区域",align:"center",dataIndex:"customerRegion_dictText",width:100},{title:"ERP编码",align:"center",dataIndex:"erpCode",width:140},{title:"状态",align:"center",dataIndex:"status_dictText",width:100},{title:"客户描述",align:"center",dataIndex:"customerDesc",width:200,ellipsis:!0},{title:"创建人",align:"center",dataIndex:"createBy",width:100},{title:"创建时间",align:"center",dataIndex:"createTime",width:165,customRender:({text:o})=>o?String(o).length>19?String(o).substring(0,19):o:""},{title:"租户ID",align:"center",dataIndex:"tenantId",width:90,defaultHidden:!0}],re=[{label:"客户编码",field:"customerCode",component:"JInput",colProps:{span:6}},{label:"客户名称",field:"customerName",component:"JInput",colProps:{span:6}},{label:"客户简称",field:"customerShortName",component:"JInput",colProps:{span:6}},{label:"客户区域",field:"customerRegion",component:"JDictSelectTag",componentProps:{dictCode:"xslmes_customer_region"},colProps:{span:6}},{label:"状态",field:"status",component:"JDictSelectTag",componentProps:{dictCode:"xslmes_customer_status"},colProps:{span:6}}],G=[{label:"",field:"id",component:"Input",show:!1},{label:"客户编码",field:"customerCode",required:!0,component:"Input",componentProps:{placeholder:"同租户内唯一,不可与已有客户重复"},dynamicRules:({model:o})=>[{required:!0,message:"请输入客户编码"},{validator:(r,t)=>g(null,null,function*(){var n,m;const d=t==null?"":String(t).trim();if(!d)return Promise.resolve();try{return yield X({customerCode:d,dataId:o==null?void 0:o.id}),Promise.resolve()}catch(i){const u=((m=(n=i==null?void 0:i.response)==null?void 0:n.data)==null?void 0:m.message)||(i==null?void 0:i.message)||"该客户编码已存在";return Promise.reject(u)}}),trigger:"blur"}]},{label:"客户名称",field:"customerName",required:!0,component:"Input",componentProps:{placeholder:"请输入客户名称"}},{label:"客户简称",field:"customerShortName",component:"Input",componentProps:{placeholder:"请输入客户简称"}},{label:"客户区域",field:"customerRegion",component:"JDictSelectTag",componentProps:{dictCode:"xslmes_customer_region",placeholder:"请选择客户区域"}},{label:"ERP编码",field:"erpCode",component:"Input",componentProps:{placeholder:"请输入ERP编码"}},{label:"状态",field:"status",component:"JDictSelectTag",componentProps:{dictCode:"xslmes_customer_status",placeholder:"请选择状态"}},{label:"客户描述",field:"customerDesc",component:"InputTextArea",componentProps:{rows:3,placeholder:"请输入客户描述"}},{label:"租户ID",field:"tenantId",component:"InputNumber",componentProps:{placeholder:"租户ID可空"}}],ne={customerCode:{title:"客户编码",order:0,view:"text"},customerName:{title:"客户名称",order:1,view:"text"},customerShortName:{title:"客户简称",order:2,view:"text"},customerRegion:{title:"客户区域",order:3,view:"list",dictCode:"xslmes_customer_region"},status:{title:"状态",order:4,view:"list",dictCode:"xslmes_customer_status"}},H=D({__name:"MesXslCustomerModal",emits:["register","success"],setup(o,{emit:r}){function t(e){const s=b({},e);return s.status!==void 0&&s.status!==null&&s.status!==""&&(s.status=String(s.status)),s.customerRegion!==void 0&&s.customerRegion!==null&&s.customerRegion!==""&&(s.customerRegion=String(s.customerRegion)),s}const d=r,n=P(!0),m=P(!1),[i,{setProps:u,resetFields:l,setFieldsValue:p,validate:C,scrollToField:x}]=z({labelWidth:120,schemas:G,showActionButtonGroup:!1,baseColProps:{span:24}}),[S,{setModalProps:h,closeModal:v}]=U(e=>g(null,null,function*(){var s;if(yield l(),h({confirmLoading:!1,showCancelBtn:!!(e!=null&&e.showFooter),showOkBtn:!!(e!=null&&e.showFooter)}),n.value=!!(e!=null&&e.isUpdate),m.value=!(e!=null&&e.showFooter),a(n)){let f=e==null?void 0:e.record;if(f!=null&&f.id)try{const c=yield L({id:String(f.id)}),w=(c==null?void 0:c.id)!=null?c:(s=c==null?void 0:c.result)!=null?s:c;w&&w.id&&(f=w)}catch(c){}yield p(t(f||{}))}else yield p({status:"0"});u({disabled:!(e!=null&&e.showFooter)})})),R=q(()=>a(n)?a(m)?"详情":"编辑":"新增");function F(){return g(this,null,function*(){try{const e=yield C();h({confirmLoading:!0}),yield E(e,a(n)),v(),d("success")}catch(e){if(e!=null&&e.errorFields){const s=e.errorFields[0];s&&x(s.name,{behavior:"smooth",block:"center"})}return Promise.reject(e)}finally{h({confirmLoading:!1})}})}return(e,s)=>(T(),N(a(j),O(e.$attrs,{onRegister:a(S),destroyOnClose:"",title:R.value,width:800,onOk:F}),{default:k(()=>[J(a(A),{onRegister:a(i),name:"MesXslCustomerForm"},null,8,["onRegister"])]),_:1},16,["onRegister","title"]))}}),$=V(H,[["__scopeId","data-v-5eea57b0"]]),ie=Object.freeze(Object.defineProperty({__proto__:null,default:$},Symbol.toStringTag,{value:"Module"}));export{$ as M,re as a,ie as b,se as c,ne as s};