1 |
- import{_ as R,d as z,E as p,a7 as N,bm as Y,af as O,a9 as q,x as r,o as f,N as V,K as t,y as a,c as M,M as S,u as i,L as H,a as P,b as W,aK as G,W as J,aS as g,ah as Q}from"./index.743f0c80.js";import{i as X}from"./status.4c13d767.js";import{x as K}from"./status.868e86c0.js";import{j as Z}from"./index.8212cab4.js";const ee={class:"flex justify-end"},ue=J("\u4FDD\u5B58"),le=z({__name:"back-modal",emits:["refresh"],setup(ae,{expose:T,emit:j}){const I={10:"electronic",20:"special_electronic","01":"special","04":"normal"},b=p(""),x=p(""),B=p(!1),A=p(null),U=N({inv_code:[{required:!0,message:"\u53D1\u7968\u4EE3\u7801\u683C\u5F0F\u4E0D\u6B63\u786E",trigger:"blur",validator(n,e){return e?Y(e):new Error("\u53D1\u7968\u4EE3\u7801\u4E0D\u80FD\u4E3A\u7A7A")}}],inv_number:[{required:!0,message:"\u53D1\u7968\u53F7\u7801\u683C\u5F0F\u4E0D\u6B63\u786E",trigger:"blur",validator(n,e){return e?Y(e):new Error("\u53D1\u7968\u53F7\u7801\u4E0D\u80FD\u4E3A\u7A7A")}}],open_date:[{required:!0,message:"\u8BF7\u9009\u62E9\u5F00\u7968\u65E5\u671F",trigger:"change"}],inv_total:[{required:!0,message:"\u8BF7\u8F93\u5165\u7A0E\u540E\u91D1\u989D",trigger:"blur"}],inv_subtotal:[{required:!0,message:"\u8BF7\u8F93\u5165\u7A0E\u524D\u91D1\u989D",trigger:"blur"}],check_code:[{required:!1,message:"\u8BF7\u8F93\u5165\u6821\u9A8C\u7801",trigger:"change"}]}),m=p(""),F=O(()=>l.input_type==="1"),k=p(!1),_=p(""),l=N({input_type:"1",remark:"",inv_code:"",inv_number:"",open_date:null,inv_subtotal:0,check_code:""});function $(){A.value.validate(async n=>{if(!n)return;const{input_type:e,inv_subtotal:s,check_code:v,...o}=l;let c=null;const d=I[m.value];if(m.value&&String(b.value)!==String(d))return g.error("\u626B\u63CF\u8BC6\u522B\u7684\u53D1\u7968\u7C7B\u578B\u4E0E\u5F00\u7968\u7C7B\u578B\u4E0D\u4E00\u81F4");c={invNo:x.value,inv_subtotal:s.toFixed(2),...v?{check_code:v}:{},...o},k.value=!0;const{code:D,message:E}=await Z(c);switch(k.value=!1,D){case 0:B.value=!1,j("refresh");break;default:g.warning(E);break}})}function L(n){const{keyCode:e}=n;if(e!==13)return;if(_.value.indexOf("\uFF0C")>=0)return g.error("\u4E0D\u80FD\u5305\u542B\u4E2D\u6587\u9017\u53F7"),_.value="";const s=_.value.split(",");if(s.length!==9){g.error("\u626B\u7801\u67AA\u8BC6\u522B\u6570\u636E\u683C\u5F0F\u4E0D\u6B63\u786E,\u8BF7\u91CD\u65B0\u626B\u63CF\u3002");return}const[v,o,...c]=s,[d,D,E,y,C]=c;m.value=o;const h=y.slice(0,4),u=y.slice(4,6),w=y.slice(6);l.inv_code=d,l.check_code=C,l.inv_number=D,l.inv_subtotal=Number(E),l.open_date=Q(`${h}-${u}-${w}`).format("YYYY-MM-DD HH:mm:ss"),_.value=""}return q(()=>{U.check_code[0].required=b.value==="normal"||b.value==="electronic"}),q(()=>{const{input_type:n}=l;if(n==="2"){const e=K.find(({value:s})=>s===b.value);e&&(m.value=e.scanValue)}}),T({onDisplay:(n,e)=>{B.value=!0,b.value=n,x.value=e}}),(n,e)=>{const s=r("el-option"),v=r("el-select"),o=r("el-form-item"),c=r("el-col"),d=r("el-input"),D=r("el-row"),E=r("el-date-picker"),y=r("el-input-number"),C=r("el-button"),h=r("el-dialog");return f(),V(h,{modelValue:B.value,"onUpdate:modelValue":e[8]||(e[8]=u=>B.value=u)},{default:t(()=>[a(i(G),{ref_key:"formRef",ref:A,model:l,rules:U,"label-width":"90px",class:"demo-ruleForm",size:"small","status-icon":""},{default:t(()=>[a(D,null,{default:t(()=>[a(c,{span:12},{default:t(()=>[a(o,{label:"\u8F93\u5165\u7C7B\u578B",prop:"input_type"},{default:t(()=>[a(v,{modelValue:l.input_type,"onUpdate:modelValue":e[0]||(e[0]=u=>l.input_type=u),style:{width:"100%"},placeholder:"\u83DC\u5355\u7C7B\u578B"},{default:t(()=>[(f(!0),M(H,null,S(i(X),(u,w)=>(f(),V(s,{key:"type"+u.value+w,label:u.label,value:u.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.input_type==="1"?(f(),V(c,{key:0,span:24,style:{padding:"12px 12px 12px 16px"}},{default:t(()=>[a(d,{clearable:"",modelValue:_.value,"onUpdate:modelValue":e[1]||(e[1]=u=>_.value=u),rows:3,type:"textarea",placeholder:"\u626B\u7801\u67AA\u8F93\u5165\u5904",onKeydown:L},null,8,["modelValue"])]),_:1})):P("v-if",!0)]),_:1}),a(o,{label:"\u53D1\u7968\u7C7B\u578B"},{default:t(()=>[a(v,{style:{width:"100%"},modelValue:m.value,"onUpdate:modelValue":e[2]||(e[2]=u=>m.value=u),disabled:""},{default:t(()=>[(f(!0),M(H,null,S(i(K),u=>(f(),V(s,{key:u.scanValue,value:u.scanValue,label:u.label},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(o,{label:"\u53D1\u7968\u53F7\u7801",prop:"inv_number"},{default:t(()=>[a(d,{modelValue:l.inv_number,"onUpdate:modelValue":e[3]||(e[3]=u=>l.inv_number=u),placeholder:"\u53D1\u7968\u53F7\u7801",disabled:i(F)},null,8,["modelValue","disabled"])]),_:1}),a(o,{label:"\u53D1\u7968\u4EE3\u7801",prop:"inv_code"},{default:t(()=>[a(d,{modelValue:l.inv_code,"onUpdate:modelValue":e[4]||(e[4]=u=>l.inv_code=u),placeholder:"\u53D1\u7968\u4EE3\u7801",disabled:i(F)},null,8,["modelValue","disabled"])]),_:1}),a(o,{label:"\u5F00\u7968\u65E5\u671F",prop:"open_date"},{default:t(()=>[a(E,{style:{width:"100%"},"value-format":"YYYY-MM-DD HH:mm:ss",modelValue:l.open_date,"onUpdate:modelValue":e[5]||(e[5]=u=>l.open_date=u),disabled:i(F)},null,8,["modelValue","disabled"])]),_:1}),a(o,{label:"\u7A0E\u524D\u91D1\u989D",prop:"inv_subtotal"},{default:t(()=>[a(y,{modelValue:l.inv_subtotal,"onUpdate:modelValue":e[6]||(e[6]=u=>l.inv_subtotal=u),precision:2,style:{width:"100%"},min:0,max:999999,disabled:i(F)},null,8,["modelValue","disabled"])]),_:1}),a(o,{label:"\u6821\u9A8C\u7801",prop:"check_code"},{default:t(()=>[a(d,{placeholde:"\u8BF7\u8F93\u5165\u6821\u9A8C\u7801",modelValue:l.check_code,"onUpdate:modelValue":e[7]||(e[7]=u=>l.check_code=u),disabled:i(F)},null,8,["modelValue","disabled"])]),_:1}),W("div",ee,[a(C,{type:"primary",loading:k.value,onClick:$},{default:t(()=>[ue]),_:1},8,["loading"])])]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])}}});var se=R(le,[["__file","D:/work/accout-vue3-ui/src/views/InvoiceSales/invoiceApply/components/back-modal.vue"]]);export{se as default};
|