1 |
- import{_ as $}from"./page-search.vue_vue_type_script_setup_true_lang.e284bf07.js";import{u as L}from"./use-page-search.da34a19a.js";import{c as v,a as M,r as k}from"./column-helper.adef10ea.js";import{b as x,p as g,a$ as q,o as P,h as N,f as e,B as T,aI as V,br as F,k as j,c as W,j as n,A as m,aM as G,a as H,l as z,F as J}from"./index.4d3e3847.js";import{a as K,h as Q,b as X,c as Y,d as Z,e as ee}from"./good.45265f96.js";import{u as oe,c as te,_ as ae,t as le}from"./use-page-modal.6d6e7705.js";import{h as ue}from"./company.a05c4b39.js";import{h as ne}from"./card.8fd03846.js";import{P as re}from"./page-content.1fdb6363.js";import{p as ie,_ as se}from"./ladder-modal.vue_vue_type_script_setup_true_lang.f5f65220.js";import{B as pe}from"./basic-form.114da3ff.js";import{u as de}from"./useAsync.24db85a6.js";import{_ as me}from"./ladder-table.vue_vue_type_script_setup_true_lang.82f08aad.js";import{R as fe}from"./basic-form.vue_vue_type_style_index_0_scoped_d6f0d2ed_lang.3165143d.js";import{d as ce}from"./remoteSelect.9c029262.js";import"./hooks.428ba1c3.js";import"./useNav.afbe69e0.js";import"./validate.93ab4ac7.js";import"./index.a5d44002.js";import"./responseHandle.db1518c7.js";import"./xlsx.ed122d16.js";import"./image.7849d972.js";const Ce=x({__name:"Unit",props:{placeholder:null,modelValue:null,unit:null},emits:["update:modelValue","change"],setup(s,{expose:h,emit:p}){const f=s,c=g(null),i=q(f,"modelValue");function _(C){c.value.initalData(C)}return h({initalData:_}),(C,l)=>(P(),N(e(fe),{modelValue:e(i),"onUpdate:modelValue":l[0]||(l[0]=r=>T(i)?i.value=r:null),api:e(ce),placeholder:s.placeholder,ref_key:"remoteSelectRef",ref:c,"response-label-prop":"unit_title","response-val-prop":"unit_id","request-prop":"keyword",isRoot:!0,onItemChange:l[1]||(l[1]=r=>p("change",r)),onInital:l[2]||(l[2]=r=>i.value=r)},null,8,["modelValue","api","placeholder"]))}}),ge={formItems:[{field:"status",type:"select",placeholder:"\u72B6\u6001",options:v(V)},{field:"good_code",type:"input",placeholder:"\u5546\u54C1\u7F16\u7801"},{field:"good_name",type:"input",placeholder:"\u5546\u54C1\u540D\u79F0"},{field:"type",type:"select",placeholder:"\u5546\u54C1\u7C7B\u578B",options:v(F)}]},R=ge,he=[{type:"selection",width:55,hide:({checkList:s})=>!s.includes("\u52FE\u9009\u5217")},{prop:"good_code",label:"\u5546\u54C1\u7F16\u7801",width:"180px"},{prop:"good_cover_img",label:"\u56FE\u7247",width:"60px",...M("good_cover_img")},{prop:"good_name",label:"\u5546\u54C1\u540D\u79F0",minWidth:"200px"},{prop:"type",label:"\u5546\u54C1\u7C7B\u578B",...k(F,"type")},{prop:"status",label:"\u72B6\u6001",...k(V)},{prop:"addtime",label:"\u521B\u5EFA\u65F6\u95F4",sortable:!0},{label:"\u64CD\u4F5C",fixed:"right",width:160,slot:"operation"}],_e={title:"\u5546\u54C1\u7BA1\u7406",columns:he,apis:{httpAdd:K,httpList:Q,httpUpdate:X,httpStatus:Y,httpDelete:Z}},Be=_e,Fe={title:"\u4F01\u4E1A\u5546\u54C1",colLayout:{span:24},itemStyle:{},contact:"setComGood",labelWidth:"85px",formItems:[{field:"id",type:"remote-select",label:"\u4E1A\u52A1\u4F01\u4E1A",placeholder:"\u4E1A\u52A1\u4F01\u4E1A",otherOptions:{api:ue,requesetProp:"title",responseLabelProp:"title",responseValPro:"id",prop:"list"},span:12,rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u4E1A\u52A1\u4F01\u4E1A"}]},{field:"name2",type:"remote-select",label:"\u5361\u7C7B\u578B",placeholder:"\u5361\u7C7B\u578B",otherOptions:{api:ne,responseLabelProp:"title",responseValPro:"id",requesetProp:"",isRoot:!1,prop:"list"},span:12,rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u5361\u7C7B\u578B"}]}]},ye=Fe,A={labelWidth:"100px",formItems:[{label:"\u5546\u54C1\u540D\u79F0",field:"good_name",type:"input",placeholder:"\u5546\u54C1\u540D\u79F0",span:24},{label:"\u5C01\u9762\u56FE",field:"good_cover_img",type:"img_upload",placeholder:"\u5C01\u9762\u56FE",span:8},{label:"\u5546\u54C1\u7C7B\u578B",field:"type",type:"select",options:F,placeholder:"\u5546\u54C1\u7C7B\u578B",span:8},{label:"\u5355\u4F4D",field:"unit_id",placeholder:"\u5355\u4F4D",span:8,slot:"unit_id"},{label:"\u8D77\u8BA2\u91CF",field:"moq",type:"number",placeholder:"\u8D77\u8BA2\u91CF",otherOptions:{precision:0,step:1,"controls-position":"right",min:0,max:99999999},span:8},{label:"\u6B65\u957F",field:"step",type:"number",placeholder:"\u6B65\u957F",span:8,otherOptions:{precision:0,step:1,"controls-position":"right",min:0,max:99999999}},{label:"\u552E\u4EF7",field:"price",type:"number",placeholder:"\u552E\u4EF7",span:8,otherOptions:{precision:2,step:1,"controls-position":"right",min:0,max:99999999}},{label:"\u8F6E\u64AD\u56FE",type:"img_upload_list",field:"good_banner_img",placeholder:"\u8F6E\u64AD\u56FE",span:24},{label:"\u8BE6\u60C5\u56FE",field:"good_img",type:"img_upload_list",placeholder:"\u8BE6\u60C5\u56FE",span:24},{label:"\u5546\u54C1\u53C2\u6570",type:"array",field:"good_param",placeholder:"\u5546\u54C1\u53C2\u6570",slot:"good_param",span:24},{label:"\u5907\u6CE8",field:"good_remark",type:"textarea",placeholder:"\u5907\u6CE8",span:24}]},be={class:"w-full flex justify-end"},Ge=x({__name:"index",setup(s){const h=de(),p=g(null),{pageContentRef:f,handleResetClick:c,handleSearchClick:i}=L(void 0,void 0,R),{pageModalRef:_,handleUpdateData:C,handleCreateData:l,handlePreviewData:r,handleConfrim:y,defaultInfo:S}=oe({pageContentRef:f}),{formItems:b}=A,E=g(null),a=g(te(b));async function w(u,o){a.value.good_param[o]=u}function O(){E.value.validate(u=>{if(!u)return;const o=e(a);y("create",o)})}async function I(u){a.value.good_param.push(e(u))}async function D(u,o){const{id:B}=u,{code:t,data:d,message:U}=await ee({id:B});h({code:t,message:U,handler:()=>{o==="preview"&&r(d),o==="update"&&(a.value=le(b,d,{}),C(d))}})}return(u,o)=>{const B=j("ElButton");return P(),W(J,null,[n(e($),{"form-config":e(R),onSearchBtnClick:e(i),onResetBtnClick:e(c)},null,8,["form-config","onSearchBtnClick","onResetBtnClick"]),n(e(re),{ref_key:"pageContentRef",ref:f,"content-config":e(Be),onCreateBtnClick:e(l),onPreviewBtnClick:o[0]||(o[0]=t=>D(t,"preview")),onUpdateBtnClick:o[1]||(o[1]=t=>D(t,"update"))},null,8,["content-config","onCreateBtnClick"]),n(e(ae),{ref_key:"pageModalRef",ref:_,"modal-config":e(ye),"default-info":e(S),onConfirmBtnClick:e(y)},{default:m(()=>[n(e(pe),G({ref_key:"basicFormRef",ref:E},e(A),{"form-data":a.value,rules:e(ie),disabled:!1,"label-width":"120px"}),{unit_id:m(()=>[n(e(Ce),{modelValue:a.value.unit_id,"onUpdate:modelValue":o[2]||(o[2]=t=>a.value.unit_id=t),placeholder:"\u5355\u4F4D"},null,8,["modelValue"])]),good_param:m(()=>[n(me,{readonly:!1,ladder:a.value.good_param,onChoose:o[3]||(o[3]=()=>p.value.onDisplay()),onUpdate:o[4]||(o[4]=({data:t,index:d})=>p.value.onDisplay(t,d)),onDelete:o[5]||(o[5]=t=>a.value.good_param.splice(t,1))},null,8,["ladder"])]),footer:m(()=>[H("div",be,[n(B,{type:"primary",onClick:O},{default:m(()=>[z("\u4FDD\u5B58")]),_:1})])]),_:1},16,["form-data","rules"])]),_:1},8,["modal-config","default-info","onConfirmBtnClick"]),n(se,{ref_key:"ladderModalRef",ref:p,onUpdate:w,onPush:I},null,512)],64)}}});export{Ge as default};
|