1 |
- import{_ as O,d as I,d9 as T,m as y,r as f,o as _,A as h,x as g,b as x,h as p,u as F,a as C,c as A,F as H,y as L,cY as P,H as D,cc as v,cr as R,L as Z,M as q}from"./index.a6923b8e.js";import{c as w}from"./createRequset.548d50db.js";import{e as Y}from"./execl-upload.63878ce4.js";const V="admin/reportChange/";var G={list:w(`${V}list`),create:w(`${V}create`)};const s={orderCode:"\u9500\u552E\u4E3B\u8BA2\u5355\u7F16\u53F7",corr:"\u4FEE\u6539\u540E\u521B\u5EFA\u65F6\u95F4"},J=Object.keys(s).map(n=>s[n]),K=[{type:"index",width:"50",fixed:"left",label:"\u5E8F\u53F7"},...Object.keys(s).reduce((n,b)=>[...n,{prop:b,label:s[b]}],[])];const k=n=>(Z("data-v-207ed5c1"),n=n(),q(),n),Q={style:{width:"300px","margin-bottom":"10px",display:"flex","align-items":"center"}},W=k(()=>x("p",{style:{color:"red","margin-right":"5px"}},"*",-1)),X=k(()=>x("p",{style:{"white-space":"nowrap","margin-right":"5px"}},"\u4FEE\u6539\u90E8\u95E8:",-1)),ee={key:1,flex:"","justify-end":"","gap-2":"",style:{padding:"10px 0 0 0"}},ue=I({__name:"index",emits:["refresh"],setup(n,{expose:b,emit:S}){const r=T({visible:!1,loading:!1}),m=y(""),i=y([]);function U(t,e){if(t.length!==e.length)return v.warning("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),!1;for(const u in t)if(e[u]!==t[u])return v.warning("\u8868\u5934\u4E0E\u5BFC\u5165\u6A21\u677F\u4E0D\u5339\u914D\uFF01"),!1;return!0}function j(t){const e=[];let u=!0;const l=[];for(const o in t){const a=t[o];let c=!0,E="";const d=/^\d{4}-\d{2}-\d{2}$/,B=/^(?=.*[a-zA-Z])(?=.*\d)[a-zA-Z\d]+$/;String(a[s.orderCode]).trim()===""?(c=!1,E+=",\u9500\u552E\u4E3B\u8BA2\u5355\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A"):B.test(String(a[s.orderCode]).trim())===!1&&(c=!1,E+=",\u9500\u552E\u4E3B\u8BA2\u5355\u7F16\u53F7\u5FC5\u987B\u6709\u5B57\u6BCD\u548C\u6570\u5B57\u7EC4\u6210"),String(a[s.corr]).trim()===""?(c=!1,E+=",\u4FEE\u6539\u540E\u7684\u521B\u5EFA\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A"):d.test(String(a[s.corr]).trim())===!1&&(c=!1,E+=",\u4FEE\u6539\u540E\u7684\u521B\u5EFA\u65F6\u95F4\u683C\u5F0F\u4E0D\u6B63\u786E"),c||(u=!1),l.push(E),e.push({orderCode:a[s.orderCode],corr:a[s.corr]})}return{list:e,isValid:u,messages:l}}function M(t){return t.reduce((e,u,l)=>{const o=l===t.length-1?"</ul>":"";return e+(u?`<li><strong style="font-weight:700"> \u7B2C${Number(l)+1}\u884C</strong>${u}</li>`:"")+o},"<ul>")}const $=({results:t})=>{if(t.length===0){v.warning("\u4E0A\u4F20\u6570\u636E\u4E0D\u80FD\u4E3A\u7A7A!");return}const e=Object.keys(t[0]);if(!U(e,J))return;const{isValid:u,list:l,messages:o}=j(t);if(!u){R({type:"warning",title:"\u6570\u636E\u586B\u5199\u9519\u8BEF",dangerouslyUseHTMLString:!0,message:M(o)});return}i.value=l},z=async()=>{if(!m.value){v.warning("\u8BF7\u9009\u62E9\u4FEE\u6539\u90E8\u95E8");return}const t="2",e=m.value,u=i.value.map(({orderCode:o,corr:a})=>({orderCode:o,after:a}));r.loading=!0;const l=await G.create({change_type:t,depart_type:e,list:u});if(r.loading=!1,Number(l.code)!==1){v.warning(l.message);return}S("refresh"),r.visible=!1},N=()=>{r.visible=!1,i.value=[],m.value=""};return b({onDisplay:()=>(r.visible=!0,i.value=[])}),(t,e)=>{const u=f("el-option"),l=f("el-select"),o=f("el-table-column"),a=f("el-table"),c=f("el-button"),E=f("el-dialog");return _(),h(E,{"close-on-click-modal":!1,modelValue:F(r).visible,"onUpdate:modelValue":e[2]||(e[2]=d=>F(r).visible=d),title:"\u9500\u552E\u63D0\u6210(\u4E0B\u5355\u65F6\u95F4\u4FEE\u6539)",width:"1040px",top:"8vh",center:"",onClose:N},{default:g(()=>[x("div",Q,[W,X,p(l,{modelValue:m.value,"onUpdate:modelValue":e[0]||(e[0]=d=>m.value=d)},{default:g(()=>[p(u,{value:"1",label:"\u5BA2\u670D\u90E8@\u767E\u8FB0\u8363\u8FBE"}),p(u,{value:"2",label:"\u65B0\u5A92\u4F53"}),p(u,{value:"3",label:"\u9879\u76EE\u90E8@\u666E\u6DA6\u5FC3\u5802"}),p(u,{value:"4",label:"\u9500\u552E\u90E8"})]),_:1},8,["modelValue"])]),i.value.length===0?(_(),h(F(Y),{key:0,onOnSuccess:$})):C("v-if",!0),p(a,{data:i.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:g(()=>[(_(!0),A(H,null,L(F(K),(d,B)=>(_(),h(o,P(d,{key:B,"show-overflow-tooltip":""}),null,16))),128))]),_:1},8,["data"]),i.value.length!==0?(_(),A("div",ee,[p(c,{size:"small",onClick:e[1]||(e[1]=d=>i.value=[])},{default:g(()=>[D("\u53D6\u6D88")]),_:1}),p(c,{size:"small",type:"primary",loading:F(r).loading,onClick:z},{default:g(()=>[D("\u4FDD\u5B58")]),_:1},8,["loading"])])):C("v-if",!0)]),_:1},8,["modelValue"])}}});var te=O(ue,[["__scopeId","data-v-207ed5c1"],["__file","C:/Users/63107/Desktop/projects/report-v3/src/views/update/correctedTime/execl-files-upload/index.vue"]]),oe=Object.freeze(Object.defineProperty({__proto__:null,default:te},Symbol.toStringTag,{value:"Module"}));export{te as E,G as a,oe as i};
|