demand-modify-modal.52004a58.js 5.4 KB

123
  1. import{_ as R,d as j,cl as A,m as d,cs as L,n as z,p as Q,r as o,o as i,A as m,x as t,h as l,u as $,ct as H,c as O,F as I,y as P,a as _,cu as G,b as J,H as v,S as V,ce as K}from"./index.56449854.js";import{c as y}from"./createRequset.56e9fc42.js";import{i as x}from"./isBeyondTime.ab735625.js";const g="admin/exec/";var h={list:y(`${g}listLog`,{defaultData:{exec_id:3,type:1},url:""}),exce_list:y(`${g}execList`,{defaultData:{type:1},url:""}),create_exec:y(`${g}addExec`,{defaultData:{type:1},url:""}),delete_exec:y(`${g}deleteLog`)};const W={class:"w-full flex justify-between"},X=j({__name:"demand-modify-modal",props:{canExportYear:{type:Boolean,required:!0},isBusiness:{type:null,required:!1}},emits:["refresh"],setup(w,{expose:k,emit:M}){const q=w,c=A(!1),b=A(!1);d(""),L(),d(null);const E=d(null),C=d([]),B=()=>({exec_id:"3",date:[],companyNo:"",depart_id:"0",plat_type:"",exec_type:"1"}),T={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"}]},D=d(null),u=d({...B()});async function Y(){var r;try{await((r=D.value)==null?void 0:r.validate());const{date:e,...n}=u.value;if(b.value=!0,q.canExportYear){if(x({message:"\u65F6\u95F4\u533A\u95F4\u4E0D\u80FD\u8D85\u8FC7366\u5929",start:e[0],end:e[1],len:366}))return}else if(String(n.exec_type)==="1"){if(x({message:"\u7ACB\u5373\u6267\u884C\u65F6\uFF0C\u65F6\u95F4\u533A\u95F4\u4E0D\u80FD\u8D85\u8FC731\u5929\uFF01",start:e[0],end:e[1],len:31}))return}else if(x({message:"\u5EF6\u8FDF\u6267\u884C\u65F6\uFF0C\u65F6\u95F4\u533A\u95F4\u4E0D\u80FD\u8D85\u8FC762\u5929\uFF01",start:e[0],end:e[1],len:62}))return;const f=V(e[1]).subtract(-1,"days"),s=V(f).subtract(1,"days").format("YYYY-MM-DD"),F=await h.create_exec({start:e[0]+" 00:00:00",end:s+" 23:59:59",...n});b.value=!1,F.code===1?(c.value=!1,M("refresh")):K.warning(F.message)}catch{}}function N(){u.value=B(),c.value=!1}return z(async()=>{const r=await h.exce_list({size:100});r.code===1&&(C.value=r.data.list)}),k({onDisplay:r=>{c.value=!0,Q(()=>r&&E.value.initialData(r))}}),(r,e)=>{const n=o("el-option"),f=o("el-select"),s=o("el-form-item"),F=o("el-date-picker"),p=o("el-alert"),S=o("el-button"),U=o("el-dialog");return i(),m(U,{modelValue:c.value,"onUpdate:modelValue":e[4]||(e[4]=a=>c.value=a),title:"\u4FEE\u6539\u62A5\u8868\u9700\u6C42",center:"",onClose:N},{default:t(()=>[l($(H),{"label-width":"90px",rules:T,model:u.value,ref_key:"formRef",ref:D},{default:t(()=>[l(s,{label:"\u4E1A\u52A1\u8868:",prop:"exec_id"},{default:t(()=>[l(f,{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(()=>[(i(!0),O(I,null,P(C.value,a=>(i(),m(n,{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(f,{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(n,{value:"1",label:"\u7ACB\u5373\u6267\u884C"}),l(n,{value:"2",label:"\u5EF6\u8FDF\u6267\u884C"})]),_:1},8,["modelValue"])]),_:1}),_(` <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?(i(),m(s,{key:0,label:"\u4E1A\u52A1\u516C\u53F8",prop:"companyNo"},{default:t(()=>[l(G,{ref_key:"businessQueryRef",ref:E,"not-initial":!0,disabled:"",modelValue:u.value.companyNo,"onUpdate:modelValue":e[3]||(e[3]=a=>u.value.companyNo=a)},null,8,["modelValue"])]),_:1})):_("v-if",!0),l(s,null,{default:t(()=>[J("div",W,[String(u.value.exec_type)==="1"?(i(),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})):_("v-if",!0),String(u.value.exec_type)==="2"?(i(),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})):_("v-if",!0),l(S,{class:"float-right",type:"primary",onClick:Y},{default:t(()=>[v("\u4FDD\u5B58")]),_:1})])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}});var Z=R(X,[["__file","C:/Users/89793/Desktop/projects/report-v3/src/views/subscribe/procureDetail/components/demand-modify-modal.vue"]]),te=Object.freeze(Object.defineProperty({__proto__:null,default:Z},Symbol.toStringTag,{value:"Module"}));export{Z as D,h as a,te as d};