You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
9.8 KiB
1 lines
9.8 KiB
import{d as K,v as O,f as G,r as f,l as J,S as Q,k as e,h as C,c as W,e as o,w as i,u as l,J as x,m as X,a as s,t as d,bn as Y,i as g,ac as w,n as N,ax as Z,K as ee,D as te,G as le,ay as ae,O as oe,E as pe,P as ne,H as ie,L as re}from"./index-f5d841af.js";/* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import se from"./index-21a2ccda.js";import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css */import{a as me,e as de,b as ue}from"./delivery-3c6c8fe3.js";/* empty css */import"./index.vue_vue_type_style_index_0_lang-7d665fb9.js";/* empty css *//* empty css */import"./attachment-740d9717.js";import"./index.vue_vue_type_script_setup_true_lang-f45dcca3.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_script_setup_true_lang-1f394a8b.js";/* empty css */import"./index.vue_vue_type_script_setup_true_lang-30796a48.js";import"./sys-4eb1a831.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./sortable.esm-be94e56d.js";const ce={class:"main-container"},_e={class:"w-[380px] text-[12px] text-[#999] mt-[5px] leading-[20px]"},xe={class:"w-[380px] text-[12px] text-[#999] mt-[5px] leading-[20px]"},he={class:"w-[600px]"},ye={class:"text-[12px] text-[#999] mt-[5px] leading-[20px]"},fe={class:"ml-[3px] text-[var(--el-color-primary)]",target:"_blank",href:"https://www.yuque.com/kdnjishuzhichi/dfcrg1/hgx758hom5p6wz0l"},ge={class:"text-[12px] text-[#999] mt-[3px] leading-[20px]"},we={class:"w-[600px]"},be={class:"text-[12px] text-[#999] mt-[5px] leading-[20px]"},Ve={class:"ml-[3px] text-[var(--el-color-primary)]",target:"_blank",href:"https://www.yuque.com/kdnjishuzhichi/dfcrg1/vpptucr1q5ahcxa7"},ve={class:"text-[12px] text-[#999] mt-[3px] leading-[20px]"},Te={class:"text-[12px] text-[#999] mt-[3px] leading-[20px]"},Ee={class:"fixed-footer-wrap"},Se={class:"fixed-footer"},ut=K({__name:"company_edit",setup(ze){const v=O(),T=G();v.meta.title;const V=f(!0),E=()=>{T.push("/shop/order/delivery/company")},k={company_id:"",company_name:"",logo:"",url:"",express_no:"",express_no_electronic_sheet:"",print_style:[],exp_type:[],electronic_sheet_switch:1},U=f(10),M=f(10),a=J({...k});a.company_id=f(v.query.company_id);const P=()=>{me(a.company_id).then(c=>{V.value=!1;let t=c.data;t&&Object.keys(a).forEach(r=>{t[r]!=null&&(a[r]=t[r])})})};a.company_id?P():V.value=!1;const S=f(),R=Q(()=>({company_name:[{required:!0,message:e("companyNamePlaceholder"),trigger:"blur"}],exp_type:[{trigger:"blur",validator:(c,t,r)=>{if(!t.length)return r(),!1;let _=[],m=[];for(let n=0;n<t.length;n++){if(t[n].text)t[n].text&&_.push(t[n].text);else{r(new Error(e("expTypeTextTips")));break}if(t[n].value)if(parseFloat(t[n].value)==0){r(new Error(e("expTypeValueNullTips")));break}else t[n].value&&m.push(t[n].value);else{r(new Error(e("expTypeValueTips")));break}}new Set(_).size!==_.length&&r(new Error(e("expTypeTextRepeatTips"))),new Set(m).size!==m.length&&r(new Error(e("expTypeValueRepeatTips"))),r()}}],print_style:[{trigger:"blur",validator:(c,t,r)=>{if(!t.length)return r(),!1;let _=[],m=[];for(let n=0;n<t.length;n++){if(t[n].template_name)t[n].template_name&&_.push(t[n].template_name);else{r(new Error(e("printStyleNameTips")));break}if(t[n].template_size)t[n].template_size&&m.push(t[n].template_size);else{r(new Error(e("printStyleSizeTips")));break}}new Set(_).size!==_.length&&r(new Error(e("printStyleNameRepeatTips"))),new Set(m).size!==m.length&&r(new Error(e("printStyleSizeRepeatTips"))),r()}}]})),D=()=>{a.print_style.push({template_name:"",template_size:""})},B=()=>{a.exp_type.push({text:"",value:""})},q=c=>{a.print_style.splice(c,1)},A=c=>{a.exp_type.splice(c,1)},b=f(!1),F=async c=>{if(b.value||!c)return;const t=a.company_id?de:ue;await c.validate(async r=>{r&&(b.value=!0,t(a).then(m=>{T.push("/shop/order/delivery/company"),b.value=!1}).catch(()=>{b.value=!1}))})};return(c,t)=>{const r=Z,_=ee,m=te,n=le,I=se,L=ae,h=oe,y=pe,z=ne,$=ie,j=re;return C(),W("div",ce,[o(_,{class:"box-card !border-none",shadow:"never"},{default:i(()=>[o(r,{content:a.company_id?l(e)("updateCompany"):l(e)("addCompany"),icon:c.ArrowLeft,onBack:t[0]||(t[0]=p=>E())},null,8,["content","icon"])]),_:1}),o(_,{class:"box-card mt-[15px] !border-none",shadow:"never"},{default:i(()=>[x((C(),X($,{model:a,"label-width":"130px",ref_key:"formRef",ref:S,rules:l(R),class:"page-form"},{default:i(()=>[o(n,{label:l(e)("companyName"),prop:"company_name"},{default:i(()=>[o(m,{modelValue:a.company_name,"onUpdate:modelValue":t[1]||(t[1]=p=>a.company_name=p),modelModifiers:{trim:!0},maxlength:"20",clearable:"",placeholder:l(e)("companyNamePlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(n,{label:l(e)("logo")},{default:i(()=>[o(I,{modelValue:a.logo,"onUpdate:modelValue":t[2]||(t[2]=p=>a.logo=p)},null,8,["modelValue"])]),_:1},8,["label"]),o(n,{label:l(e)("url")},{default:i(()=>[o(m,{modelValue:a.url,"onUpdate:modelValue":t[3]||(t[3]=p=>a.url=p),modelModifiers:{trim:!0},clearable:"",placeholder:l(e)("urlPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(n,{label:l(e)("expressNo")},{default:i(()=>[s("div",null,[o(m,{modelValue:a.express_no,"onUpdate:modelValue":t[4]||(t[4]=p=>a.express_no=p),modelModifiers:{trim:!0},clearable:"",placeholder:l(e)("expressNoPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"]),s("p",_e,d(l(e)("expressNoTips")),1)])]),_:1},8,["label"]),o(n,{label:l(e)("expressNoElectronicSheet")},{default:i(()=>[s("div",null,[o(m,{modelValue:a.express_no_electronic_sheet,"onUpdate:modelValue":t[5]||(t[5]=p=>a.express_no_electronic_sheet=p),modelModifiers:{trim:!0},clearable:"",placeholder:l(e)("expressNoPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"]),s("p",xe,d(l(e)("expressNoElectronicSheetTips")),1)])]),_:1},8,["label"]),o(n,{label:l(e)("electronicSheetSwitch")},{default:i(()=>[o(L,{modelValue:a.electronic_sheet_switch,"onUpdate:modelValue":t[6]||(t[6]=p=>a.electronic_sheet_switch=p),"active-value":1,"inactive-value":0},null,8,["modelValue"])]),_:1},8,["label"]),x(o(n,{label:l(e)("expType"),prop:"exp_type"},{default:i(()=>[s("div",he,[x(o(z,{data:a.exp_type,size:"large"},{empty:i(()=>[s("span",null,d(a.exp_type.length==0?l(e)("emptyData"):""),1)]),default:i(()=>[o(h,{prop:"name",label:l(e)("expTypeName"),"min-width":"200"},{default:i(({row:p})=>[o(m,{modelValue:p.text,"onUpdate:modelValue":u=>p.text=u,modelModifiers:{trim:!0},class:"input-width",maxlength:"20",clearable:"","show-word-limit":""},null,8,["modelValue","onUpdate:modelValue"])]),_:1},8,["label"]),o(h,{prop:"name",label:l(e)("expTypeValue"),"min-width":"120"},{default:i(({row:p})=>[o(m,{modelValue:p.value,"onUpdate:modelValue":u=>p.value=u,modelModifiers:{trim:!0},class:"!w-[150px]",maxlength:"6",clearable:"","show-word-limit":"",onKeyup:t[7]||(t[7]=u=>l(Y)(u))},null,8,["modelValue","onUpdate:modelValue"])]),_:1},8,["label"]),o(h,{label:l(e)("operation"),fixed:"right",align:"right","min-width":"60"},{default:i(({row:p,$index:u})=>[o(y,{type:"primary",link:"",onClick:H=>A(u)},{default:i(()=>[g(d(l(e)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"]),[[w,a.exp_type.length]]),x(o(y,{type:"primary",plain:"",onClick:B,class:N({"mt-[10px]":a.exp_type.length})},{default:i(()=>[g(d(l(e)("addExpType")),1)]),_:1},8,["class"]),[[w,a.exp_type.length<M.value]]),s("div",ye,[s("span",null,d(l(e)("expTypeTips")),1),s("a",fe,d(l(e)("examine")),1)]),s("p",ge,d(l(e)("expTypeTips1")),1)])]),_:1},8,["label"]),[[w,a.electronic_sheet_switch]]),x(o(n,{label:l(e)("printStyle"),prop:"print_style"},{default:i(()=>[s("div",we,[x(o(z,{data:a.print_style,size:"large"},{empty:i(()=>[s("span",null,d(a.print_style.length==0?l(e)("emptyData"):""),1)]),default:i(()=>[o(h,{prop:"name",label:l(e)("printStyleName"),"min-width":"200"},{default:i(({row:p})=>[o(m,{modelValue:p.template_name,"onUpdate:modelValue":u=>p.template_name=u,modelModifiers:{trim:!0},class:"input-width",maxlength:"20",clearable:"","show-word-limit":""},null,8,["modelValue","onUpdate:modelValue"])]),_:1},8,["label"]),o(h,{prop:"name",label:l(e)("printStyleId"),"min-width":"120"},{default:i(({row:p})=>[o(m,{modelValue:p.template_size,"onUpdate:modelValue":u=>p.template_size=u,modelModifiers:{trim:!0},class:"!w-[150px]",maxlength:"6",clearable:"","show-word-limit":""},null,8,["modelValue","onUpdate:modelValue"])]),_:1},8,["label"]),o(h,{label:l(e)("operation"),fixed:"right",align:"right","min-width":"60"},{default:i(({row:p,$index:u})=>[o(y,{type:"primary",link:"",onClick:H=>q(u)},{default:i(()=>[g(d(l(e)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"]),[[w,a.print_style.length]]),x(o(y,{type:"primary",plain:"",onClick:D,class:N({"mt-[10px]":a.print_style.length})},{default:i(()=>[g(d(l(e)("addPrintStyle")),1)]),_:1},8,["class"]),[[w,a.print_style.length<U.value]]),s("div",be,[s("span",null,d(l(e)("printStyleTips")),1),s("a",Ve,d(l(e)("examine")),1)]),s("p",ve,d(l(e)("printStyleTips1")),1),s("p",Te,d(l(e)("printStyleTips2")),1)])]),_:1},8,["label"]),[[w,a.electronic_sheet_switch]])]),_:1},8,["model","rules"])),[[j,V.value]])]),_:1}),s("div",Ee,[s("div",Se,[o(y,{type:"primary",onClick:t[8]||(t[8]=p=>F(S.value))},{default:i(()=>[g(d(l(e)("save")),1)]),_:1}),o(y,{onClick:t[9]||(t[9]=p=>E())},{default:i(()=>[g(d(l(e)("back")),1)]),_:1})])])])}}});export{ut as default};
|
|
|