javashop/webroot/public/admin/assets/template_edit-95686175.js
wangchen147 86198c273f 1.1.0
Niucloud JAVA版框架1.1.0更新内容
    新增
    * 增加小程序展示线上版本号
    * 发布小程序添加自定义版本号
    * 添加后台取消小程序绑定微信公众平台授权
    * 管理端核销功能
    * 用户端导入微信地址功能

    优化
    * 装修页面时可自定义底部导航
    * 小程序添加版权信息展示
    * 应用菜单结构优化:取消独立营销菜单,统一在应用菜单下按分类
    * 分页列表增加缓存,记录当前页信息,操作完成后,返回当前页
    * 开启标签栏时对标签页面进行缓存
    * 统一框架装修自定义使用底部导航数据结构

    修复
    * 删除表单报错
    * admin首页点击未安装、已安装应用,页面跳转空白
    * 修复插件云安装错误时同时显示安装失败和安装完成

商城1.0.5更新内容
    新增
    * 用户端添加订单开具发票功能
    * 管理后台添加补开发票功能

    优化
    * 商品列表增加相关活动的关联展示
    * 限时折扣、积分商城增加批量操作
    * 积分商品,若有规格未参与积分活动,则无法购买
    * 复制商品,提示语优化

    修复
    * 满减送活动赠品设置多件,只展示1件
    * 满减送赠品未扣除库存问题
    * 商品列表批量设置分类后商品分类查询不到商品的问题
    * 商品标签状态已经关闭添加商品时依旧可以选择
    * 商家地址库联系方式搜索无效
    * 商品分类拖动排序无效
    * 参与满减活动再使用优惠券,订单0元申请退款时,退款金额出现负数
    * 积分商城规格值设置不参与积分兑换提交订单未拦截
    * 虚拟商品核销码设置的永久有效,核销时提示商品已过期
    * 订单满减送退款售后点击详情报错
    * 按会员标签发放优惠券异常一直未发放
    * 微信支付申请退款售后点击转账跳转404
    * 订单列表输入会员编号、账号点击搜索筛选不出来内容
    * 多商品组商品来源选择分组,只有一个商品分类时多商品组商品展示不正确
    * 商品组件排序方式选择为价格时报错
    * 图文导航选择积分商品报错
2025-12-24 12:30:43 +08:00

2 lines
13 KiB
JavaScript

import{d as _e,r as E,k as me,u as fe,q as ce,du as ve,m as B,s as t,I,h as U,c as O,a as b,e as l,w as n,f as r,b4 as he,Z as j,v as G,i as h,t as v,bY as C,C as ge,_ as Y,aH as ye,F as be,$ as J,b5 as Ve,a9 as ke,L as Ee,M as Se,aE as we,aF as Ce,ak as xe,E as Ue,al as De,b8 as Be,N as Ae,U as Ne,V as Pe,a3 as Te}from"./index-a2dd70e3.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css */import{A as Me,B as Re,C as ze}from"./delivery-6efba8e9.js";import{_ as Fe}from"./_plugin-vue_export-helper-c27b6911.js";const Ke={class:"main-container"},Ie={class:"area-input"},Oe=["onClick"],je={key:1},qe={class:"mt-[10px]"},Le={class:"area-input"},Ze={class:"form-tip"},We={class:"mt-[10px]"},He={class:"area-input"},Ge={class:"mt-[10px]"},Ye={class:"fixed-footer-wrap"},Je={class:"fixed-footer"},Qe={class:"dialog-footer"},Xe=_e({__name:"template_edit",setup($e){const x=E(!1),A=me(),q=fe(),V=E(!1),Q={template_id:"",template_name:"",fee_type:"num",area:[],no_delivery:0,is_free_shipping:0,fee_data:[],free_shipping_data:[],no_delivery_data:[]},X=A.meta.title,u=ce({...Q}),L=E(),N=E([]);A.query.id&&(V.value=!0,Me(A.query.id).then(({data:p})=>{p&&(Object.keys(u).forEach(e=>{p[e]!=null&&(u[e]=p[e])}),m.value=p.fee_data,y.value=p.no_delivery_data,f.value=p.free_shipping_data),V.value=!1}).catch(()=>{V.value=!1})),ve(2).then(p=>{N.value=p.data}).catch();const $=B(()=>({template_name:[{required:!0,message:t("templateNamePlaceholder"),trigger:"blur"}],fee_data:[{validator:ee}],free_shipping_data:[{validator:ae}],no_delivery_data:[{validator:le}]})),ee=(p,e,o)=>{for(let _=0;_<m.value.length;_++){const s=m.value[_];if(!s.area_ids.length){o(new Error(t("areaPlaceholder")));break}if(I.empty(s.snum)||s.snum<0){o(new Error(D.value.first+t("notUnderZero")));break}if(I.empty(s.xnum)||s.snum<0){o(new Error(D.value.continue+t("notUnderZero")));break}}o()},ae=(p,e,o)=>{if(u.is_free_shipping){for(let _=0;_<f.value.length;_++){const s=f.value[_];if(!s.area_ids.length){o(new Error(t("freeShippingPlaceholder")));break}if(I.empty(s.free_shipping_num)||s.free_shipping_num<0){o(new Error(Z.value+t("notUnderZero")));break}}o()}else o()},le=(p,e,o)=>{if(u.no_delivery){for(let _=0;_<y.value.length;_++)if(!y.value[_].area_ids.length){o(new Error(t("noDeliveryPlaceholder")));break}o()}else o()},D=B(()=>({num:{first:t("firstNum"),continue:t("continueNum")},weight:{first:t("firstWeight"),continue:t("continueWeight")},volume:{first:t("firstVolume"),continue:t("continueVolume")}})[u.fee_type]),Z=B(()=>({num:t("freeShippingNum"),weight:t("freeShippingWeight"),volume:t("freeShippingVolume")})[u.fee_type]),m=E([{area_ids:[0],fee_area_names:"全国",snum:1,sprice:0,xnum:1,xprice:0}]),f=E([]),y=E([]),P=p=>{switch(p){case"fee":m.value.push({area_ids:[],fee_area_names:"",snum:1,sprice:0,xnum:1,xprice:0});break;case"free_shipping":f.value.push({area_ids:[],free_shipping_area_names:"",free_shipping_num:0,free_shipping_price:0});break;case"no_delivery":y.value.push({area_ids:[],no_delivery_area_names:""});break}},T=(p,e)=>{switch(p){case"fee":m.value.splice(e,1);break;case"free_shipping":f.value.splice(e,1);break;case"no_delivery":y.value.splice(e,1);break}};let M=[];const R=E([]);let S={type:"",index:0};const z=(p,e)=>{S={type:p,index:e};let o=[];switch(p){case"fee":o=m.value;break;case"free_shipping":o=f.value;break;case"no_delivery":o=y.value;break}M=o[e].area_ids,R.value=[],o.forEach((_,s)=>{e!=s&&R.value.push(..._.area_ids)}),x.value=!0},te=B(()=>(N.value.forEach(p=>{p&&Array.isArray(p.child)&&p.child.forEach(e=>{var o;e.disabled=((o=R.value)==null?void 0:o.includes(e.id))||!1})}),N.value)),F=E(),re=()=>{const p=F.value.getCheckedNodes(!1,!1),e=[],o=[];switch(p.forEach(_=>{_.level==2&&(e.push(_.id),o.push(_.name))}),S.type){case"fee":m.value[S.index].area_ids=e,m.value[S.index].fee_area_names=o.toString();break;case"free_shipping":f.value[S.index].area_ids=e,f.value[S.index].free_shipping_area_names=o.toString();break;case"no_delivery":y.value[S.index].area_ids=e,y.value[S.index].no_delivery_area_names=o.toString();break}x.value=!1},ie=()=>{F.value.setCheckedKeys(M,!1)},ne=async p=>{if(V.value||!p)return;const e=u.template_id?Re:ze;await p.validate(async o=>{if(o){if(u.is_free_shipping&&f.value.length==0){J.error(t("freeShippingPlaceholder"));return}if(u.no_delivery&&y.value.length==0){J.error("noDeliveryPlaceholder");return}V.value=!0;const _={template_id:u.template_id,template_name:u.template_name,fee_type:u.fee_type,no_delivery:u.no_delivery,is_free_shipping:u.is_free_shipping},s={};m.value.forEach(d=>{d.area_ids.forEach(c=>{s["city_"+c]={city_id:c,fee_area_ids:d.area_ids.toString(),fee_area_names:d.fee_area_names,snum:d.snum,sprice:d.sprice,xnum:d.xnum,xprice:d.xprice}})}),f.value.forEach(d=>{d.area_ids.forEach(c=>{s["city_"+c]?Object.assign(s["city_"+c],{free_shipping_area_ids:d.area_ids.toString(),free_shipping_area_names:d.free_shipping_area_names,free_shipping_num:d.free_shipping_num,free_shipping_price:d.free_shipping_price}):s["city_"+c]={city_id:c,free_shipping_area_ids:d.area_ids.toString(),free_shipping_area_names:d.free_shipping_area_names,free_shipping_num:d.free_shipping_num,free_shipping_price:d.free_shipping_price}})}),y.value.forEach(d=>{d.area_ids.forEach(c=>{s["city_"+c]?Object.assign(s["city_"+c],{no_delivery_area_ids:d.area_ids.toString(),no_delivery_area_names:d.no_delivery_area_names}):s["city_"+c]={city_id:c,no_delivery_area_ids:d.area_ids.toString(),no_delivery_area_names:d.no_delivery_area_names}})}),_.area=Object.values(s),e(_).then(()=>{V.value=!1,q.push({path:"/shop/order/shipping/template"})}).catch(()=>{V.value=!1})}})},W=()=>{q.push({path:"/shop/order/shipping/template"})};return(p,e)=>{const o=Ve,_=ke,s=Ee,d=Se,c=we,oe=Ce,g=xe,k=Ue,K=De,H=Be,se=Ae,de=Ne,pe=Pe,ue=Te;return U(),O(be,null,[b("div",Ke,[l(_,{class:"card !border-none",shadow:"never"},{default:n(()=>[l(o,{content:r(X),icon:r(he),onBack:W},null,8,["content","icon"])]),_:1}),l(_,{class:"box-card mt-[15px] !border-none",shadow:"never"},{default:n(()=>[j((U(),G(se,{model:u,"label-width":"120px",ref_key:"formRef",ref:L,rules:r($),class:"page-form"},{default:n(()=>[l(d,{label:r(t)("templateName"),prop:"template_name"},{default:n(()=>[l(s,{modelValue:u.template_name,"onUpdate:modelValue":e[0]||(e[0]=a=>u.template_name=a),modelModifiers:{trim:!0},clearable:"",placeholder:r(t)("templateNamePlaceholder"),class:"input-width",maxlength:"60"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(d,{label:r(t)("feeTypeName"),prop:"fee_type"},{default:n(()=>[l(oe,{modelValue:u.fee_type,"onUpdate:modelValue":e[1]||(e[1]=a=>u.fee_type=a)},{default:n(()=>[l(c,{label:"num",size:"large"},{default:n(()=>[h(v(r(t)("num")),1)]),_:1}),l(c,{label:"weight",size:"large"},{default:n(()=>[h(v(r(t)("weight")),1)]),_:1}),l(c,{label:"volume",size:"large"},{default:n(()=>[h(v(r(t)("volume")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),l(d,{label:r(t)("feeSetting"),prop:"fee_data"},{default:n(()=>[l(K,{data:m.value,style:{width:"100%"},size:"default"},{default:n(()=>[l(g,{label:r(t)("deliveryArea")},{default:n(({row:a,$index:i})=>[b("div",Ie,[i?(U(),O("span",{key:0,onClick:w=>z("fee",i),class:"cursor-pointer"},v(a.fee_area_names?a.fee_area_names:r(t)("areaPlaceholder")),9,Oe)):(U(),O("span",je,v(a.fee_area_names?a.fee_area_names:r(t)("areaPlaceholder")),1))])]),_:1},8,["label"]),l(g,{label:r(D).first},{default:n(({$index:a})=>[l(s,{modelValue:m.value[a].snum,"onUpdate:modelValue":i=>m.value[a].snum=i,modelModifiers:{trim:!0},maxlength:"8",onKeyup:e[2]||(e[2]=i=>r(C)(i)),onBlur:i=>m.value[a].snum=i.target.value},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"]),l(g,{label:r(t)("fee")},{default:n(({$index:a})=>[l(s,{modelValue:m.value[a].sprice,"onUpdate:modelValue":i=>m.value[a].sprice=i,modelModifiers:{trim:!0},maxlength:"8",onKeyup:e[3]||(e[3]=i=>r(C)(i)),onBlur:i=>m.value[a].sprice=i.target.value},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"]),l(g,{label:r(D).continue},{default:n(({$index:a})=>[l(s,{modelValue:m.value[a].xnum,"onUpdate:modelValue":i=>m.value[a].xnum=i,modelModifiers:{trim:!0},maxlength:"8",onKeyup:e[4]||(e[4]=i=>r(C)(i)),onBlur:i=>m.value[a].xnum=i.target.value},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"]),l(g,{label:r(t)("continueFee")},{default:n(({$index:a})=>[l(s,{modelValue:m.value[a].xprice,"onUpdate:modelValue":i=>m.value[a].xprice=i,modelModifiers:{trim:!0},onKeyup:e[5]||(e[5]=i=>r(C)(i)),maxlength:"8",onBlur:i=>m.value[a].xprice=i.target.value},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"]),l(g,{label:r(t)("operation"),align:"right",width:"150"},{default:n(({$index:a})=>[a?(U(),G(k,{key:0,type:"primary",onClick:i=>T("fee",a),link:""},{default:n(()=>[h(v(r(t)("delete")),1)]),_:2},1032,["onClick"])):ge("",!0)]),_:1},8,["label"])]),_:1},8,["data"]),b("div",qe,[l(k,{type:"primary",onClick:e[6]||(e[6]=a=>P("fee"))},{default:n(()=>[h(v(r(t)("addDeliveryArea")),1)]),_:1})])]),_:1},8,["label"]),l(d,{label:r(t)("freeShipping"),prop:"is_free_shipping"},{default:n(()=>[l(H,{modelValue:u.is_free_shipping,"onUpdate:modelValue":e[7]||(e[7]=a=>u.is_free_shipping=a),size:"small","inactive-value":0,"active-value":1},null,8,["modelValue"])]),_:1},8,["label"]),j(l(d,{prop:"free_shipping_data"},{default:n(()=>[l(K,{data:f.value,style:{width:"100%"},size:"default"},{default:n(()=>[l(g,{label:r(t)("freeShippingArea")},{default:n(({row:a,$index:i})=>[b("div",Le,[l(s,{modelValue:a.free_shipping_area_names,"onUpdate:modelValue":w=>a.free_shipping_area_names=w,modelModifiers:{trim:!0},placeholder:r(t)("areaPlaceholder"),readonly:"",onClick:w=>z("free_shipping",i)},null,8,["modelValue","onUpdate:modelValue","placeholder","onClick"])])]),_:1},8,["label"]),l(g,{label:r(Z)},{default:n(({$index:a})=>[l(s,{modelValue:f.value[a].free_shipping_num,"onUpdate:modelValue":i=>f.value[a].free_shipping_num=i,modelModifiers:{trim:!0},onKeyup:e[8]||(e[8]=i=>r(C)(i)),maxlength:"8",onBlur:i=>f.value[a].free_shipping_num=i.target.value},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"]),l(g,{label:r(t)("freeShippingPrice")},{default:n(({$index:a})=>[l(s,{modelValue:f.value[a].free_shipping_price,"onUpdate:modelValue":i=>f.value[a].free_shipping_price=i,modelModifiers:{trim:!0},onKeyup:e[9]||(e[9]=i=>r(C)(i)),maxlength:"8",onBlur:i=>f.value[a].free_shipping_price=i.target.value},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"]),l(g,{label:r(t)("operation"),align:"right",width:"150"},{default:n(({$index:a})=>[l(k,{type:"primary",onClick:i=>T("free_shipping",a),link:""},{default:n(()=>[h(v(r(t)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"]),b("div",Ze,v(r(t)("freeShippingAreaTips")),1),b("div",We,[l(k,{type:"primary",onClick:e[10]||(e[10]=a=>P("free_shipping"))},{default:n(()=>[h(v(r(t)("addFreeShippingArea")),1)]),_:1})])]),_:1},512),[[Y,u.is_free_shipping]]),l(d,{label:r(t)("noDelivery"),prop:"no_delivery"},{default:n(()=>[l(H,{modelValue:u.no_delivery,"onUpdate:modelValue":e[11]||(e[11]=a=>u.no_delivery=a),size:"small","inactive-value":0,"active-value":1},null,8,["modelValue"])]),_:1},8,["label"]),j(l(d,{prop:"no_delivery_data"},{default:n(()=>[l(K,{data:y.value,style:{width:"100%"},size:"default"},{default:n(()=>[l(g,{label:r(t)("noDelivery")},{default:n(({row:a,$index:i})=>[b("div",He,[l(s,{modelValue:a.no_delivery_area_names,"onUpdate:modelValue":w=>a.no_delivery_area_names=w,modelModifiers:{trim:!0},readonly:"",onClick:w=>z("no_delivery",i),placeholder:r(t)("areaPlaceholder")},null,8,["modelValue","onUpdate:modelValue","onClick","placeholder"])])]),_:1},8,["label"]),l(g,{label:r(t)("operation"),align:"right",width:"150"},{default:n(({$index:a})=>[l(k,{type:"primary",onClick:i=>T("no_delivery",a),link:""},{default:n(()=>[h(v(r(t)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"]),b("div",Ge,[l(k,{type:"primary",onClick:e[12]||(e[12]=a=>P("no_delivery"))},{default:n(()=>[h(v(r(t)("addNoDelivery")),1)]),_:1})])]),_:1},512),[[Y,u.no_delivery]])]),_:1},8,["model","rules"])),[[ue,V.value]])]),_:1}),b("div",Ye,[b("div",Je,[l(k,{type:"primary",onClick:e[13]||(e[13]=a=>ne(L.value)),disabled:V.value},{default:n(()=>[h(v(r(t)("save")),1)]),_:1},8,["disabled"]),l(k,{onClick:e[14]||(e[14]=a=>W())},{default:n(()=>[h(v(r(t)("cancel")),1)]),_:1})])])]),l(pe,{modelValue:x.value,"onUpdate:modelValue":e[16]||(e[16]=a=>x.value=a),title:r(t)("selectArea"),width:"80%",class:"diy-dialog-wrap","destroy-on-close":!0,onOpened:ie},{footer:n(()=>[b("span",Qe,[l(k,{onClick:e[15]||(e[15]=a=>x.value=!1)},{default:n(()=>[h(v(r(t)("cancel")),1)]),_:1}),l(k,{type:"primary",loading:V.value,onClick:re},{default:n(()=>[h(v(r(t)("confirm")),1)]),_:1},8,["loading"])])]),default:n(()=>[l(de,{height:"50vh"},{default:n(()=>[l(r(ye),{data:r(te),props:{children:"child",label:"name"},"default-expand-all":"","show-checkbox":"",ref_key:"areaTreeRef",ref:F,"default-checked-keys":r(M),"node-key":"id"},null,8,["data","default-checked-keys"])]),_:1})]),_:1},8,["modelValue","title"])],64)}}});const ka=Fe(Xe,[["__scopeId","data-v-8844891f"]]);export{ka as default};