demand-modify-modal.89ea7a87.js 5.2 KB

1
  1. import{_ as Q,d as T,cl as D,m as n,d0 as j,n as L,w as $,p as z,r as d,o as i,A as m,x as l,h as t,u as H,co as O,c as I,F as P,y as G,d1 as J,a as f,d2 as K,b as W,H as F,S as w,cc as X}from"./index.a6923b8e.js";import{c as _}from"./createRequset.548d50db.js";import{i as Z}from"./isBeyondTime.a205b508.js";const y="admin/exec/";var A={list:_(`${y}listLog`,{defaultData:{exec_id:2},url:""}),exce_list:_(`${y}execList`),create_exec:_(`${y}addExec`),delete_exec:_(`${y}deleteLog`)};const ee={class:"w-full flex justify-between"},ue=T({__name:"demand-modify-modal",props:{isBusiness:{type:null,required:!1}},emits:["refresh"],setup(te,{expose:h,emit:k}){const p=D(!1),b=D(!1),M=n(""),x=j(),N=n(null),E=n(null),B=n([]),C=()=>({exec_id:2,date:[],companyNo:"",depart_id:"",plat_type:"",exec_type:"1"}),R={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"}]},V=n(null),u=n({...C()});async function S(){var s;try{await((s=V.value)==null?void 0:s.validate());const{date:e,...r}=u.value;if(b.value=!0,Z({message:"\u65F6\u95F4\u533A\u95F4\u4E0D\u80FD\u8D85\u8FC7 90 \u5929",start:e[0],end:e[1],len:90}))return;const o=w(e[1]).subtract(-1,"days"),g=w(o).subtract(1,"days").format("YYYY-MM-DD"),c=await A.create_exec({start:e[0]+" 00:00:00",end:g+" 23:59:59",...r});b.value=!1,c.code===1?(p.value=!1,k("refresh")):X.warning(c.message)}catch{}}function U(){u.value=C(),p.value=!1}return L(async()=>{const s=await A.exce_list({});s.code===1&&(B.value=s.data.list)}),$(()=>x.level,s=>{const{itemid:e="",depart_name:r}=x.info||{};Number(s)===2&&(M.value=r,u.value.depart_id=e)},{immediate:!0}),h({onDisplay:s=>{p.value=!0,z(()=>s&&E.value.initialData(s))}}),(s,e)=>{const r=d("el-option"),v=d("el-select"),o=d("el-form-item"),g=d("el-date-picker"),c=d("el-alert"),q=d("el-button"),Y=d("el-dialog");return i(),m(Y,{modelValue:p.value,"onUpdate:modelValue":e[5]||(e[5]=a=>p.value=a),title:"\u4FEE\u6539\u62A5\u8868\u9700\u6C42",center:"",onClose:U},{default:l(()=>[t(H(O),{"label-width":"90px",rules:R,model:u.value,ref_key:"formRef",ref:V},{default:l(()=>[t(o,{label:"\u4E1A\u52A1\u8868:",prop:"exec_id"},{default:l(()=>[t(v,{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:l(()=>[(i(!0),I(P,null,G(B.value,a=>(i(),m(r,{key:a.id,label:a.exec_name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(o,{label:"\u6570\u636E\u65F6\u95F4:",prop:"date"},{default:l(()=>[t(g,{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}),t(o,{label:"\u6267\u884C\u7C7B\u578B",prop:"exec_type"},{default:l(()=>[t(v,{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:l(()=>[t(r,{value:"1",label:"\u7ACB\u5373\u6267\u884C"}),t(r,{value:"2",label:"\u5EF6\u8FDF\u6267\u884C"})]),_:1},8,["modelValue"])]),_:1}),t(o,{label:"\u6240\u5728\u90E8\u95E8",prop:"depart_id"},{default:l(()=>[t(J,{ref_key:"departQueryRef",ref:N,modelValue:u.value.depart_id,"onUpdate:modelValue":e[3]||(e[3]=a=>u.value.depart_id=a)},null,8,["modelValue"]),f(' <el-input v-model="deraptNameRef" v-else disabled /> ')]),_:1}),s.isBusiness?(i(),m(o,{key:0,label:"\u4E1A\u52A1\u516C\u53F8",prop:"companyNo"},{default:l(()=>[t(K,{ref_key:"businessQueryRef",ref:E,"not-initial":!0,disabled:"",modelValue:u.value.companyNo,"onUpdate:modelValue":e[4]||(e[4]=a=>u.value.companyNo=a)},null,8,["modelValue"])]),_:1})):f("v-if",!0),t(o,null,{default:l(()=>[W("div",ee,[String(u.value.exec_type)==="1"?(i(),m(c,{key:0,type:"warning",style:{width:"260px","margin-right":"10px",padding:"0px"},size:"small",closable:!1},{default:l(()=>[F(" \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"?(i(),m(c,{key:1,type:"warning",style:{width:"260px","margin-right":"10px",padding:"0px"},size:"small",closable:!1},{default:l(()=>[F(" \u5EF6\u8FDF\u6267\u884C:\u6587\u4EF6\u4F1A\u5728\u7533\u8BF7\u5F53\u592920:00\u5F00\u59CB\u6267\u884C; ")]),_:1})):f("v-if",!0),t(q,{class:"float-right",type:"primary",onClick:S},{default:l(()=>[F("\u4FDD\u5B58")]),_:1})])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}});var ae=Q(ue,[["__file","C:/Users/63107/Desktop/projects/report-v3/src/views/subscribe/salesReturnSubscribe/components/demand-modify-modal.vue"]]),re=Object.freeze(Object.defineProperty({__proto__:null,default:ae},Symbol.toStringTag,{value:"Module"}));export{ae as D,A as a,re as d};