1 |
- import{_ as j,d as R,w as k,Z as w,ag as $,a0 as N,r as d,o as f,G as B,C as a,l as u,c as S,F as g,D as U,u as p,a as K,b as P,M as z,aR as G,aY as E,ae as L}from"./index.42bf163d.js";import{i as O}from"./status.4c13d767.js";import{u as Z}from"./configs.36d07a57.js";import{c as T}from"./status.d6b2a53d.js";const J={class:"flex justify-end"},Q=R({__name:"upload-invoice",props:{isElectronic:{type:Boolean,required:!0},isSupport:{type:Boolean,required:!0},isSpecialTicket:{type:Boolean,required:!0},isPlain:{type:Boolean,required:!0},invType:{type:String,required:!0}},emits:["changeStatus"],setup(Y,{emit:A}){const b=Y,q={10:"electronic",20:"special_electronic","01":"special","04":"normal"},x=k(null),h=w({...Z}),i=k(""),v=$(()=>l.input_type==="1"),c=k(""),l=w({input_type:"1",remark:"",invCode:"",invNum:"",open_date:null,subtotal_fee:0,checkCode:""});function M(){x.value.validate(m=>{if(!m)return;const{input_type:t,subtotal_fee:s,checkCode:_,...n}=l;let o=null;const r=q[i.value];if(i.value&&String(b.invType)!==String(r))return E.error("\u626B\u63CF\u8BC6\u522B\u7684\u53D1\u7968\u7C7B\u578B\u4E0E\u5F00\u7968\u7C7B\u578B\u4E0D\u4E00\u81F4");o={status:"3",subtotal_fee:s.toFixed(2),..._?{checkCode:_}:{},...n},A("changeStatus",o)})}function H(m){const{keyCode:t}=m;if(t!==13)return;if(c.value.indexOf("\uFF0C")>=0)return E.error("\u4E0D\u80FD\u5305\u542B\u4E2D\u6587\u9017\u53F7"),c.value="";const s=c.value.split(",");if(s.length!==9){E.error("\u626B\u7801\u67AA\u8BC6\u522B\u6570\u636E\u683C\u5F0F\u4E0D\u6B63\u786E,\u8BF7\u91CD\u65B0\u626B\u63CF\u3002");return}const[_,n,...o]=s,[r,C,V,y,D]=o;i.value=n;const e=y.slice(0,4),F=y.slice(4,6),I=y.slice(6);l.invCode=r,l.checkCode=D,l.invNum=C,l.subtotal_fee=Number(V),l.open_date=L(`${e}-${F}-${I}`).format("YYYY-MM-DD HH:mm:ss"),c.value=""}return N(()=>{h.checkCode[0].required=b.invType==="normal"||b.invType==="electronic"}),N(()=>{const{input_type:m}=l;if(m==="2"){const t=T.find(({value:s})=>s===b.invType);t&&(i.value=t.scanValue)}}),(m,t)=>{const s=d("el-option"),_=d("el-select"),n=d("el-form-item"),o=d("el-col"),r=d("el-input"),C=d("el-row"),V=d("el-date-picker"),y=d("el-input-number"),D=d("el-button");return f(),B(p(G),{ref_key:"formRef",ref:x,model:l,rules:h,"label-width":"90px",class:"demo-ruleForm",size:"small","status-icon":""},{default:a(()=>[u(C,null,{default:a(()=>[u(o,{span:12},{default:a(()=>[u(n,{label:"\u8F93\u5165\u7C7B\u578B",prop:"input_type"},{default:a(()=>[u(_,{modelValue:l.input_type,"onUpdate:modelValue":t[0]||(t[0]=e=>l.input_type=e),style:{width:"100%"},placeholder:"\u83DC\u5355\u7C7B\u578B"},{default:a(()=>[(f(!0),S(g,null,U(p(O),(e,F)=>(f(),B(s,{key:"type"+e.value+F,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.input_type==="1"?(f(),B(o,{key:0,span:24,style:{padding:"12px 12px 12px 16px"}},{default:a(()=>[u(r,{clearable:"",modelValue:c.value,"onUpdate:modelValue":t[1]||(t[1]=e=>c.value=e),rows:3,type:"textarea",placeholder:"\u626B\u7801\u67AA\u8F93\u5165\u5904",onKeydown:H},null,8,["modelValue"])]),_:1})):K("v-if",!0)]),_:1}),u(C,null,{default:a(()=>[u(o,{span:8},{default:a(()=>[u(n,{label:"\u53D1\u7968\u7C7B\u578B"},{default:a(()=>[u(_,{style:{width:"100%"},modelValue:i.value,"onUpdate:modelValue":t[2]||(t[2]=e=>i.value=e),disabled:""},{default:a(()=>[(f(!0),S(g,null,U(p(T),e=>(f(),B(s,{key:e.scanValue,value:e.scanValue,label:e.label},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),u(o,{span:8},{default:a(()=>[u(n,{label:"\u53D1\u7968\u53F7\u7801",prop:"invNum"},{default:a(()=>[u(r,{modelValue:l.invNum,"onUpdate:modelValue":t[3]||(t[3]=e=>l.invNum=e),placeholder:"\u53D1\u7968\u53F7\u7801",disabled:p(v)},null,8,["modelValue","disabled"])]),_:1})]),_:1}),u(o,{span:8},{default:a(()=>[u(n,{label:"\u53D1\u7968\u4EE3\u7801",prop:"invCode"},{default:a(()=>[u(r,{modelValue:l.invCode,"onUpdate:modelValue":t[4]||(t[4]=e=>l.invCode=e),placeholder:"\u53D1\u7968\u4EE3\u7801",disabled:p(v)},null,8,["modelValue","disabled"])]),_:1})]),_:1}),u(o,{span:8},{default:a(()=>[u(n,{label:"\u5F00\u7968\u65E5\u671F",prop:"open_date"},{default:a(()=>[u(V,{"value-format":"YYYY-MM-DD HH:mm:ss",modelValue:l.open_date,"onUpdate:modelValue":t[5]||(t[5]=e=>l.open_date=e),disabled:p(v)},null,8,["modelValue","disabled"])]),_:1})]),_:1}),u(o,{span:8},{default:a(()=>[u(n,{label:"\u7A0E\u524D\u91D1\u989D",prop:"subtotal_fee"},{default:a(()=>[u(y,{modelValue:l.subtotal_fee,"onUpdate:modelValue":t[6]||(t[6]=e=>l.subtotal_fee=e),precision:2,style:{width:"100%"},min:0,max:999999,disabled:p(v)},null,8,["modelValue","disabled"])]),_:1})]),_:1}),u(o,{span:8},{default:a(()=>[u(n,{label:"\u6821\u9A8C\u7801",prop:"checkCode"},{default:a(()=>[u(r,{placeholde:"\u8BF7\u8F93\u5165\u6821\u9A8C\u7801",modelValue:l.checkCode,"onUpdate:modelValue":t[7]||(t[7]=e=>l.checkCode=e),disabled:p(v)},null,8,["modelValue","disabled"])]),_:1})]),_:1})]),_:1}),P("div",J,[u(D,{type:"primary",onClick:M},{default:a(()=>[z("\u4FDD\u5B58")]),_:1})])]),_:1},8,["model","rules"])}}});var le=j(Q,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/InvoiceSales/invoiceApply/components/approval-process/src/upload-invoice.vue"]]);export{le as default};
|