demand-modify-modal.a4960a8d.js 5.0 KB

123
  1. import{_ as Y,d as R,cl as D,m as n,cs as S,n as T,p as j,r as o,o as d,A as m,x as t,h as l,u as L,ct as Q,c as $,F as z,y as H,a as f,cu as I,b as O,H as v,S as V,ce as P}from"./index.56449854.js";import{c as _}from"./createRequset.56e9fc42.js";import{i as G}from"./isBeyondTime.ab735625.js";const y="admin/exec/";var h={list:_(`${y}listLog`,{defaultData:{exec_id:19,type:1},url:""}),exce_list:_(`${y}execList`,{defaultData:{type:1},url:""}),create_exec:_(`${y}addExec`,{defaultData:{type:1},url:""}),delete_exec:_(`${y}deleteLog`)};const J={class:"w-full flex justify-between"},K=R({__name:"demand-modify-modal",props:{isBusiness:{type:null,required:!1}},emits:["refresh"],setup(X,{expose:A,emit:w}){const i=D(!1),x=D(!1);n(""),S(),n(null);const b=n(null),E=n([]),B=()=>({exec_id:"19",date:[],companyNo:"",depart_id:"0",plat_type:"",exec_type:"1"}),k={date:[{required:!0,message:"\u8BF7\u9009\u62E9\u6570\u636E\u65F6\u95F4",trigger:"change"}],exec_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u4E1A\u52A1\u8868",trigger:"change"}],depart_id:[{required:!0,message:"\u8BF7\u9009\u62E9\u6240\u5728\u90E8\u95E8",trigger:"change"}],plat_type:[{required:!0,message:"\u8BF7\u9009\u62E9\u5E73\u53F0\u7C7B\u578B",trigger:"change"}],companyNo:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E1A\u52A1\u516C\u53F8",trigger:"change"}],exec_type:[{required:!0,message:"\u8BF7\u9009\u62E9\u6267\u884C\u7C7B\u578B",trigger:"change"}]},C=n(null),u=n({...B()});async function M(){var r;try{await((r=C.value)==null?void 0:r.validate());const{date:e,...c}=u.value;if(x.value=!0,G({message:"\u65F6\u95F4\u533A\u95F4\u4E0D\u80FD\u8D85\u8FC7 90 \u5929",start:e[0],end:e[1],len:90}))return;const s=V(e[1]).subtract(-1,"days"),F=V(s).subtract(1,"days").format("YYYY-MM-DD"),p=await h.create_exec({start:e[0]+" 00:00:00",end:F+" 23:59:59",...c});x.value=!1,p.code===1?(i.value=!1,w("refresh")):P.warning(p.message)}catch{}}function q(){u.value=B(),i.value=!1}return T(async()=>{const r=await h.exce_list({});r.code===1&&(E.value=r.data.list)}),A({onDisplay:r=>{i.value=!0,j(()=>r&&b.value.initialData(r))}}),(r,e)=>{const c=o("el-option"),g=o("el-select"),s=o("el-form-item"),F=o("el-date-picker"),p=o("el-alert"),N=o("el-button"),U=o("el-dialog");return d(),m(U,{modelValue:i.value,"onUpdate:modelValue":e[4]||(e[4]=a=>i.value=a),title:"\u4FEE\u6539\u62A5\u8868\u9700\u6C42",center:"",onClose:q},{default:t(()=>[l(L(Q),{"label-width":"90px",rules:k,model:u.value,ref_key:"formRef",ref:C},{default:t(()=>[l(s,{label:"\u4E1A\u52A1\u8868:",prop:"exec_id"},{default:t(()=>[l(g,{modelValue:u.value.exec_id,"onUpdate:modelValue":e[0]||(e[0]=a=>u.value.exec_id=a),style:{width:"100%"},placeholder:"\u4E1A\u52A1\u8868",disabled:""},{default:t(()=>[(d(!0),$(z,null,H(E.value,a=>(d(),m(c,{key:a.id,label:a.exec_name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(s,{label:"\u6570\u636E\u65F6\u95F4:",prop:"date"},{default:t(()=>[l(F,{modelValue:u.value.date,"onUpdate:modelValue":e[1]||(e[1]=a=>u.value.date=a),type:"daterange","value-format":"YYYY-MM-DD","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65F6\u95F4","end-placeholder":"\u7ED3\u675F\u65F6\u95F4"},null,8,["modelValue"])]),_:1}),l(s,{label:"\u6267\u884C\u7C7B\u578B",prop:"exec_type"},{default:t(()=>[l(g,{modelValue:u.value.exec_type,"onUpdate:modelValue":e[2]||(e[2]=a=>u.value.exec_type=a),placeholder:"\u6267\u884C\u7C7B\u578B",style:{width:"100%"}},{default:t(()=>[l(c,{value:"1",label:"\u7ACB\u5373\u6267\u884C"}),l(c,{value:"2",label:"\u5EF6\u8FDF\u6267\u884C"})]),_:1},8,["modelValue"])]),_:1}),f(` <el-form-item label="\u6240\u5728\u90E8\u95E8" prop="depart_id">\r
  2. <depart-query ref="departQueryRef" v-model="formData.depart_id" />\r
  3. </el-form-item> `),r.isBusiness?(d(),m(s,{key:0,label:"\u4E1A\u52A1\u516C\u53F8",prop:"companyNo"},{default:t(()=>[l(I,{ref_key:"businessQueryRef",ref:b,"not-initial":!0,disabled:"",modelValue:u.value.companyNo,"onUpdate:modelValue":e[3]||(e[3]=a=>u.value.companyNo=a)},null,8,["modelValue"])]),_:1})):f("v-if",!0),l(s,null,{default:t(()=>[O("div",J,[String(u.value.exec_type)==="1"?(d(),m(p,{key:0,type:"warning",style:{width:"260px","margin-right":"10px",padding:"0px"},size:"small",closable:!1},{default:t(()=>[v(" \u7ACB\u5373\u6267\u884C:\u6587\u4EF6\u4F1A\u5728\u7533\u8BF7\u540E\u51E0\u5206\u949F\u5185\u751F\u6210; ")]),_:1})):f("v-if",!0),String(u.value.exec_type)==="2"?(d(),m(p,{key:1,type:"warning",style:{width:"260px","margin-right":"10px",padding:"0px"},size:"small",closable:!1},{default:t(()=>[v(" \u5EF6\u8FDF\u6267\u884C:\u6587\u4EF6\u4F1A\u5728\u7533\u8BF7\u5F53\u592920:00\u5F00\u59CB\u6267\u884C; ")]),_:1})):f("v-if",!0),l(N,{class:"float-right",type:"primary",onClick:M},{default:t(()=>[v("\u4FDD\u5B58")]),_:1})])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}});var W=Y(K,[["__file","C:/Users/89793/Desktop/projects/report-v3/src/views/subscribe/dailyInventoryData/components/demand-modify-modal.vue"]]),ae=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"}));export{W as D,h as a,ae as d};