index.539b72bd.js 4.8 KB

1
  1. import{_ as O,d as I,d9 as T,m as h,r as E,o as _,A as D,x as g,b as x,h as f,u as F,a as B,c as y,F as H,y as L,cY as P,H as w,cc as v,cr as R,L as Z,M as q}from"./index.a6923b8e.js";import{e as Y}from"./execl-upload.63878ce4.js";import{c as A}from"./createRequset.548d50db.js";const V="admin/reportChange/";var G={list:A(`${V}list`),create:A(`${V}create`)};const a={orderCode:"\u56DE\u6B3E\u5173\u8054\u7F16\u53F7",corr:"\u4FEE\u6539\u540E\u7684\u7CFB\u6570(%)"},J=Object.keys(a).map(r=>a[r]),K=[{type:"index",width:"50",fixed:"left",label:"\u5E8F\u53F7"},...Object.keys(a).reduce((r,b)=>[...r,{prop:b,label:a[b]}],[])];const k=r=>(Z("data-v-c9ff4826"),r=r(),q(),r),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(r,{expose:b,emit:S}){const i=T({visible:!1,loading:!1}),m=h(""),c=h([]);function N(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 U(t){const e=[];let u=!0;const l=[];for(const o in t){const s=t[o];let n=!0,d="";const p=/^(?=.*[a-zA-Z])(?=.*\d)[a-zA-Z\d]+$/;String(s[a.orderCode]).trim()===""?(n=!1,d+=",\u56DE\u6B3E\u5173\u8054\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A"):p.test(String(s[a.orderCode]).trim())===!1&&(n=!1,d+=",\u56DE\u6B3E\u5173\u8054\u7F16\u53F7\u5FC5\u987B\u6709\u5B57\u6BCD\u548C\u6570\u5B57\u7EC4\u6210");const C=/^\d+(\/\d+)?$/;String(s[a.corr]).trim()===""?(n=!1,d+=",\u4FEE\u6539\u540E\u7684\u63D0\u6210\u7CFB\u6570\u4E0D\u80FD\u4E3A\u7A7A"):C.test(String(s[a.corr]).trim())===!1?(n=!1,d+=",\u4FEE\u6539\u540E\u7684\u63D0\u6210\u7CFB\u6570\u5FC5\u987B\u4E3A\u6570\u5B57"):Number(s[a.corr])>100&&(n=!1,d+=",\u4FEE\u6539\u540E\u7684\u63D0\u6210\u7CFB\u6570\u4E0D\u80FD\u8D85\u8FC7100%"),n||(u=!1),l.push(d),e.push({orderCode:s[a.orderCode],corr:s[a.corr]})}return{list:e,isValid:u,messages:l}}function j(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 M=({results:t})=>{if(t.length===0){v.warning("\u4E0A\u4F20\u6570\u636E\u4E0D\u80FD\u4E3A\u7A7A!");return}const e=Object.keys(t[0]);if(!N(e,J))return;const{isValid:u,list:l,messages:o}=U(t);if(!u){R({type:"warning",title:"\u6570\u636E\u586B\u5199\u9519\u8BEF",dangerouslyUseHTMLString:!0,message:j(o)});return}c.value=l},$=async()=>{if(!m.value){v.warning("\u8BF7\u9009\u62E9\u4FEE\u6539\u90E8\u95E8");return}const t="1",e=m.value,u=c.value.map(({orderCode:o,corr:s})=>({orderCode:o,after:(Number(s)/100).toFixed(2)}));i.loading=!0;const l=await G.create({change_type:t,depart_type:e,list:u});if(i.loading=!1,Number(l.code)!==1){v.warning(l.message);return}S("refresh"),i.visible=!1},z=()=>{i.visible=!1,c.value=[],m.value=""};return b({onDisplay:()=>(i.visible=!0,c.value=[])}),(t,e)=>{const u=E("el-option"),l=E("el-select"),o=E("el-table-column"),s=E("el-table"),n=E("el-button"),d=E("el-dialog");return _(),D(d,{"close-on-click-modal":!1,modelValue:F(i).visible,"onUpdate:modelValue":e[2]||(e[2]=p=>F(i).visible=p),title:"\u9500\u552E\u63D0\u6210(\u63D0\u6210\u7CFB\u6570\u4FEE\u6539\uFF09",width:"1040px",top:"8vh",center:"",onClose:z},{default:g(()=>[x("div",Q,[W,X,f(l,{modelValue:m.value,"onUpdate:modelValue":e[0]||(e[0]=p=>m.value=p)},{default:g(()=>[f(u,{value:"1",label:"\u5BA2\u670D\u90E8@\u767E\u8FB0\u8363\u8FBE"}),f(u,{value:"2",label:"\u65B0\u5A92\u4F53"}),f(u,{value:"3",label:"\u9879\u76EE\u90E8@\u666E\u6DA6\u5FC3\u5802"}),f(u,{value:"4",label:"\u9500\u552E\u90E8"})]),_:1},8,["modelValue"])]),c.value.length===0?(_(),D(F(Y),{key:0,onOnSuccess:M})):B("v-if",!0),f(s,{data:c.value,stripe:"",border:"","max-height":"500px",size:"small",style:{width:"100%"}},{default:g(()=>[(_(!0),y(H,null,L(F(K),(p,C)=>(_(),D(o,P(p,{key:C,"show-overflow-tooltip":""}),null,16))),128))]),_:1},8,["data"]),c.value.length!==0?(_(),y("div",ee,[f(n,{size:"small",onClick:e[1]||(e[1]=p=>c.value=[])},{default:g(()=>[w("\u53D6\u6D88")]),_:1}),f(n,{size:"small",type:"primary",loading:F(i).loading,onClick:$},{default:g(()=>[w("\u4FDD\u5B58")]),_:1},8,["loading"])])):B("v-if",!0)]),_:1},8,["modelValue"])}}});var te=O(ue,[["__scopeId","data-v-c9ff4826"],["__file","C:/Users/63107/Desktop/projects/report-v3/src/views/update/commissionCoefficient/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};