BaseForm.4b5981.js 4.7 KB

1
  1. import{_ as R,d as z,m as C,a2 as F,j as S,Q as T,aH as U,az as A,r as h,ao as K,B as M,h as e,o as d,A as _,x as l,f as u,aN as n,bC as r,bD as Y,a as c,c as j,br as H,bm as B,D as O,H as b,G as D,bu as G,bE as q,bF as V,e as Q,bv as $}from"./index.js";import{b as J}from"./index.0d3e4f3d.js";import{r as L,c as W}from"./shared.4f9e44f6.js";import X from"./index.ff51ce.js";import{P as Z}from"./index.0949abb2.js";import{b as ee}from"./index.4109350c.js";import"./use-page-search.dfa27a70.js";import"./status.b7512d56.js";import"./columnRenderHelper.8411add2.js";import"./columns.74c15f1e.js";import"./tootip.c6ca5db9.js";import"./basic-descriptions.e6b0a528.js";const ue={key:1,class:"flex items-start"},ae={class:"w-full flex justify-end"},le=z({__name:"BaseForm",setup(te){const i=C(null),g=o=>{const a=new Date;return o.getTime()>a.setHours(0,0,0,0)},w=F(()=>({...L,fz_date:[{required:t.value.check_type=="2",message:"\u8BF7\u9009\u62E9\u8C03\u6574\u5355\u5165\u8D26\u6708\u4EFD",trigger:"change"}]})),N=S(),y=C(null),p=T({editVisible:!1,visible:!1,companies:[],index:-1,data:{}}),k=F(()=>{var m,v,f;const o=(((m=i.value)==null?void 0:m.residue_stock)-Number(t.value.check_num)||0)*-1,a=o*((v=i.value)==null?void 0:v.subunit_price)||0;return Number(a)===0&&t.value.check_type=="2"&&(t.value.check_type=""),{ykNum:o,yKPrice:o*((f=i.value)==null?void 0:f.subunit_price)||0}}),t=C(W()),E=U({success(){A.success("\u521B\u5EFA\u6210\u529F!"),N.push("/invoiceInOut/inventoryCheck")}});async function x(){var o;try{await((o=y.value)==null?void 0:o.validate()),E.run(ee(t.value))}catch{}}function P(o){i.value=o[0],t.value.product_id=o[0].id,t.value.check_num=String(o[0].residue_stock)}function I(){i.value=null,t.value.check_num="0",t.value.product_id=""}return async function(){const a=await J({size:1e4});a.code==0&&(p.companies=[...a.data.list])}(),(o,a)=>{const m=h("ElDatePicker"),v=h("ElRow"),f=K("loading");return M((d(),_(e($),{ref_key:"formRef",ref:y,rules:w.value,model:t.value,"label-width":"78px"},{default:l(()=>[u(v,null,{default:l(()=>[u(e(n),{span:24},{default:l(()=>[u(e(r),{label:"\u5546\u54C1\u4FE1\u606F",prop:"product_id"},{default:l(()=>[i.value?c("v-if",!0):(d(),_(e(Y),{key:0,placeholder:"\u5546\u54C1\u4FE1\u606F",onClick:a[0]||(a[0]=s=>p.visible=!0)})),i.value?(d(),j("div",ue,[i.value?(d(),_(Z,{key:0,data:i.value},null,8,["data"])):c("v-if",!0),c(' <BasicDescriptions :data="detail" :columns="goodColumns" /> '),u(e(H),{content:"\u91CD\u65B0\u9009\u62E9",placement:"top"},{default:l(()=>[u(e(B),{link:"",type:"info",icon:e(O)("close-circle-line"),onClick:I},null,8,["icon"])]),_:1})])):c("v-if",!0)]),_:1})]),_:1}),u(e(n),{span:6},{default:l(()=>[u(e(r),{label:"\u8D26\u9762\u6570\u91CF"},{default:l(()=>{var s;return[b(D(((s=i.value)==null?void 0:s.residue_stock)||""),1)]}),_:1})]),_:1}),u(e(n),{span:6},{default:l(()=>[u(e(r),{label:"\u76D8\u70B9\u6570\u91CF",prop:"check_num"},{default:l(()=>[u(e(G),{modelValue:t.value.check_num,"onUpdate:modelValue":a[1]||(a[1]=s=>t.value.check_num=s),placeholder:"\u76D8\u70B9\u6570\u91CF"},null,8,["modelValue"])]),_:1})]),_:1}),u(e(n),{span:6},{default:l(()=>[u(e(r),{label:"\u76C8\u4E8F\u6570\u91CF",prop:"ykNum"},{default:l(()=>[b(D(k.value.ykNum),1)]),_:1})]),_:1}),u(e(n),{span:6},{default:l(()=>[u(e(r),{label:"\u76C8\u4E8F\u91D1\u989D",prop:"ykPrice"},{default:l(()=>[c(" =(\u8D26\u9762\u6570\u91CF-\u76D8\u70B9\u6570\u91CF) * \u7A0E\u524D\u5355\u4EF7 "),b(" "+D(k.value.yKPrice),1)]),_:1})]),_:1}),u(e(n),{span:12},{default:l(()=>[u(e(r),{label:"\u7ED3\u679C\u7C7B\u578B",prop:"check_type"},{default:l(()=>[u(e(q),{modelValue:t.value.check_type,"onUpdate:modelValue":a[2]||(a[2]=s=>t.value.check_type=s),placeholder:"\u7ED3\u679C\u7C7B\u578B"},{default:l(()=>[u(e(V),{disabled:k.value.yKPrice==0,label:"\u8C03\u6574\u5355",value:"2"},null,8,["disabled"]),u(e(V),{label:"\u524D\u671F\u6570\u636E\u5BFC\u5165",value:"1"})]),_:1},8,["modelValue"])]),_:1})]),_:1}),t.value.check_type=="2"?(d(),_(e(n),{key:0,span:12},{default:l(()=>[u(e(r),{label:" \u8C03\u6574\u5355\u5165\u8D26\u6708\u4EFD","label-width":"140px",prop:"fz_date"},{default:l(()=>[u(m,{type:"month",placeholder:"\u5165\u8D26\u6708\u4EFD",modelValue:t.value.fz_date,"onUpdate:modelValue":a[3]||(a[3]=s=>t.value.fz_date=s),disabledDate:g,"value-format":"YYYY-MM"},null,8,["modelValue"])]),_:1})]),_:1})):c("v-if",!0)]),_:1}),Q("div",ae,[u(e(B),{type:"primary",onClick:x},{default:l(()=>a[5]||(a[5]=[b("\u4FDD\u5B58")])),_:1})]),u(X,{visible:p.visible,"onUpdate:visible":a[4]||(a[4]=s=>p.visible=s),onSubmit:P},null,8,["visible"])]),_:1},8,["rules","model"])),[[f,e(E).loading]])}}});var be=R(le,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/inventoryCheck/components/BaseForm.vue"]]);export{be as default};