demand-modify-modal.7b328a3f.js 4.8 KB

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