1 |
- import{_ as x}from"./page-search.vue_vue_type_script_setup_true_lang.e284bf07.js";import{u as A}from"./use-page-search.da34a19a.js";import{aI as F,br as T,b as I,p as s,k as V,o as $,c as q,j as l,f as o,A as n,aM as L,a as M,l as N,F as j}from"./index.4d3e3847.js";import{c as U,r as h,a as W}from"./column-helper.adef10ea.js";import{h as G,a as H,b as z,c as J,p as K,d as Q}from"./pageListModal.d34d93f8.js";import{u as X,c as Y,_ as Z,t as ee}from"./use-page-modal.6d6e7705.js";import{h as oe}from"./company.a05c4b39.js";import{h as te}from"./card.8fd03846.js";import{P as ue}from"./page-content.1fdb6363.js";import"./basic-form.vue_vue_type_style_index_0_scoped_d6f0d2ed_lang.3165143d.js";import{_ as ae}from"./ComCard.vue_vue_type_script_setup_true_lang.96e3560a.js";import{B as le}from"./basic-form.114da3ff.js";import{_ as re}from"./ladder-table.vue_vue_type_script_setup_true_lang.d1212187.js";import{u as ie}from"./useAsync.24db85a6.js";import"./hooks.428ba1c3.js";import"./useNav.afbe69e0.js";import"./validate.93ab4ac7.js";import"./good.45265f96.js";import"./image.7849d972.js";import"./responseHandle.db1518c7.js";import"./index.a5d44002.js";import"./xlsx.ed122d16.js";import"./remoteSelect.9c029262.js";const ne={title:"\u670D\u52A1",itemStyle:{},contact:"setService",labelWidth:"90px",formItems:[{field:"status",type:"select",label:"\u72B6\u6001",placeholder:"\u72B6\u6001",options:U(F)},{field:"company_title",type:"input",label:"\u516C\u53F8",placeholder:"\u516C\u53F8"},{field:"card_title",type:"input",label:"\u5361\u7C7B\u578B",placeholder:"\u5361\u7C7B\u578B"},{field:"good_code",type:"input",label:"\u5546\u54C1\u7F16\u7801",placeholder:"\u5546\u54C1\u7F16\u7801"}]},B=ne,se=[{type:"selection",width:55,hide:({checkList:d})=>!d.includes("\u52FE\u9009\u5217")},{prop:"id",label:"ID"},{label:"\u5546\u54C1\u7F16\u53F7",prop:"good_code",width:180,showOverflowTooltip:!0},{prop:"status",label:"\u72B6\u6001",...h(F)},{prop:"company_title",label:"\u516C\u53F8\u540D\u79F0"},{prop:"card_title",label:"\u5361\u7C7B\u578B"},{label:"\u5546\u54C1\u7C7B\u578B",prop:"type",width:95,showOverflowTooltip:!0,...h(T,"type")},{label:"\u56FE\u7247",prop:"good_cover_img",width:60,showOverflowTooltip:!0,...W("good_cover_img")},{label:"\u5546\u54C1\u540D\u79F0",prop:"good_name",minWidth:160},{label:"\u5355\u4F4D",prop:"unit",width:80,showOverflowTooltip:!0},{label:"\u8D77\u8BA2\u91CF",prop:"moq",width:80,showOverflowTooltip:!0},{label:"\u6B65\u957F",prop:"step",width:80,showOverflowTooltip:!0},{label:"\u552E\u4EF7",prop:"price",width:110,showOverflowTooltip:!0},{prop:"addtime",label:"\u521B\u5EFA\u65F6\u95F4",width:155},{label:"\u64CD\u4F5C",fixed:"right",width:160,slot:"operation"}],de={title:"\u5546\u54C1\u7BA1\u7406",columns:se,apis:{httpAdd:G,httpList:H,httpStatus:z,httpDelete:J}},pe=de,fe={title:"\u4F01\u4E1A\u5546\u54C1",colLayout:{span:24},itemStyle:{},contact:"setComGood",labelWidth:"85px",formItems:[{field:"id",type:"remote-select",label:"\u516C\u53F8\u5361\u7C7B\u578B",placeholder:"\u516C\u53F8\u5361\u7C7B\u578B",otherOptions:{api:oe,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:te,responseLabelProp:"title",responseValPro:"id",requesetProp:"",isRoot:!1,prop:"list"},span:12,rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u5361\u7C7B\u578B"}]}]},ce=fe,_={formItems:[{label:"\u516C\u53F8\u5361\u7C7B\u578B",field:"group_id",placeholder:"\u516C\u53F8\u5361\u7C7B\u578B",span:24,slot:"group_id"},{label:"\u5546\u54C1\u4FE1\u606F",field:"good_id",type:"array",placeholder:"\u5546\u54C1\u4FE1\u606F",span:24,slot:"good_id"}]},me={group_id:{trigger:"change",required:!0,message:"\u8BF7\u9009\u62E9\u516C\u53F8\u5361\u7C7B\u578B"},good_id:{trigger:"change",required:!0,message:"\u8BF7\u9009\u62E9\u5546\u54C1"}},Ce={class:"w-full flex justify-end"},Le=I({__name:"index",setup(d){const b=ie(),{pageContentRef:p,handleResetClick:w,handleSearchClick:v}=A(void 0,void 0,B),{pageModalRef:y,handleUpdateData:k,handleCreateData:D,handlePreviewData:E,handleConfrim:f,defaultInfo:O}=X({pageContentRef:p}),{formItems:c}=_,m=s(null),C=s(null),u=s(Y(c));function P(){C.value.validate(i=>{const{group_id:e,good_id:a}=u.value;if(!e||a.length==0)return;const t={group_id:e,good_id:[]};a.forEach(r=>{t.good_id.push(r.id)}),f("create",t)})}async function g(i,e){const{id:a}=i,{code:t,data:r,message:S}=await Q({id:a});b({code:t,message:S,handler:()=>{e==="preview"&&E(r),e==="update"&&(u.value=ee(c,r,{}),k(r))}})}function R(i){i.forEach(e=>{const{id:a}=e;u.value.good_id.findIndex(r=>r.id+""==a+"")==-1&&u.value.good_id.push(e)})}return(i,e)=>{const a=V("ElButton");return $(),q(j,null,[l(o(x),{"form-config":o(B),onSearchBtnClick:o(v),onResetBtnClick:o(w)},null,8,["form-config","onSearchBtnClick","onResetBtnClick"]),l(o(ue),{ref_key:"pageContentRef",ref:p,"content-config":o(pe),onCreateBtnClick:o(D),onPreviewBtnClick:e[0]||(e[0]=t=>g(t,"preview")),onUpdateBtnClick:e[1]||(e[1]=t=>g(t,"update"))},null,8,["content-config","onCreateBtnClick"]),l(o(Z),{ref_key:"pageModalRef",ref:y,"modal-config":o(ce),"default-info":o(O),onConfirmBtnClick:o(f)},{default:n(()=>[l(o(le),L({ref_key:"basicFormRef",ref:C},o(_),{"form-data":u.value,rules:o(me),disabled:!1,"label-width":"120px"}),{group_id:n(()=>[l(o(ae),{modelValue:u.value.group_id,"onUpdate:modelValue":e[2]||(e[2]=t=>u.value.group_id=t),placeholder:"\u516C\u53F8\u5361\u7C7B\u578B"},null,8,["modelValue"])]),good_id:n(()=>[l(re,{readonly:!1,ladder:u.value.good_id,onChoose:e[3]||(e[3]=()=>m.value.show("")),onDelete:e[4]||(e[4]=t=>u.value.good_id.splice(t,1))},null,8,["ladder"])]),footer:n(()=>[M("div",Ce,[l(a,{type:"primary",onClick:P},{default:n(()=>[N("\u4FDD\u5B58")]),_:1})])]),_:1},16,["form-data","rules"])]),_:1},8,["modal-config","default-info","onConfirmBtnClick"]),l(o(K),{ref_key:"modelRef",ref:m,onSaveBtnClick:R},null,512)],64)}}});export{Le as default};
|