moreShopAdmin/build/admin/assets/add.969c7078.js

2 lines
18 KiB
JavaScript
Raw Normal View History

2024-12-06 16:10:40 +08:00
import{S as fe,T as _e,G as ge,H as Ve,U as be,J as Fe,K as ye,D as Ee,v as ce,C as De,w as Ce,M as we,b as he,N as ve,F as Be,I as Ue,L as ke}from"./element-plus.91c68cc0.js";import{_ as Ke}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.22c1e1a7.js";import{d as J,s as Ae,Z as q,r as y,o as D,c as I,U as u,L as t,a as C,u as a,T as P,a9 as H,K as S,R as V,aa as j,S as qe,j as x,n as B}from"./@vue.76ce7aa3.js";import{a as Ie}from"./vue-router.10bd5b90.js";import{a as Pe}from"./beforehand_order.8e87e56d.js";import{a as Se}from"./system_store.5476f6ce.js";import{b as Re,a as Le}from"./store_product.af6d513c.js";import{f as G,h as Te}from"./index.e778e9f4.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.9ffef7f8.js";import"./@element-plus.73235148.js";import"./dayjs.0112e2c7.js";import"./@babel.80d29b7b.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.vue_vue_type_script_setup_true_lang.863ae816.js";import"./usePaging.f8c888e4.js";import"./useDictOptions.4c6dc0e2.js";import"./lodash.4e6d2a38.js";import"./axios.cffda5ac.js";import"./jspdf.6c61b9d3.js";import"./fflate.0418c72f.js";import"./pinia.f3529286.js";import"./css-color-function.bb8c34b2.js";import"./color.fbd63fe8.js";import"./clone.31a3aa2c.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.b502f541.js";import"./vue-clipboard3.e775fc74.js";import"./clipboard.6417898a.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8d65305c.js";const Me={class:"flex-1 w-full"},Ne={class:"mb-2"},Oe=J({name:"storeProductEdit"}),Au=J({...Oe,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Ye,{emit:ze}){const Z=Ae(),n=q({warehouse_id:"",is_buyer:-1,supplier_id:"",code:"",total_price:0,order_type:1,store_id:"",arrival_time:"",purpose:"",tables:0,days:0,chef:"",chef_phone:"",splitting_officer:"",merchandiser:"\u4F55\u6708\u82F1",distribution_personnel:"\u4F59\u53CB",transporter:"",system_store_name:"",regional_manager:"\u5F20\u6CE2",mark:"",uid:""}),Q=async r=>{const e=await Re({id:r.id});U(r,e)},U=(r,e)=>{r.id=e.id,r.image=e.image,r.marques=e.marques,r.store_info=e.store_info,r.price=e.price,r.purchase=e.purchase,r.after_sales=e.after_sales,r.loss=e.loss,r.unit=e.unit,r.store_name=e.store_name,r.unit_name=e.unit_name,r.gross_weight=e.gross_weight,r.net_weight=e.net_weight,r.package=e.package;const m=[];F.value.forEach(g=>{m.push(g.id)}),m.includes(0)==!1&&F.value.push({id:0})},w=y(!1),F=y([{id:0}]),W=r=>{F.value=F.value.filter(e=>e.id!==r)},X=r=>{r.forEach(e=>{F.value.find(m=>m.id==e.id)||F.value.push(e)}),w.value=!1};function $(r){r.total_price=(r.nums*r.price).toFixed(2),r.total_price>0&&(n.total_price=(parseFloat(n.total_price)+parseFloat(r.total_price)).toFixed(2))}function ee(r){n.order_type==7||n.order_type==5?n.is_buyer=1:n.is_buyer=-1}const ue=Ie(),le=async()=>{const r=F.value.map(e=>({product_id:e.id,nums:e.nums,price:e.price||0,purchase:e.purchase||0,total_price:e.total_price||0,marques:e.marques,store_info:e.store_info,after_sales:e.after_sales,loss:e.loss,unit:e.unit,gross_weight:e.gross_weight,net_weight:e.net_weight,package:e.package,mark:e.mark}));Pe({product_arr:r,...n}).then(e=>{setTimeout(()=>{ue.push({path:"/order/beforehand_order"})},2e3)})},R=y([]);Se({page_no:1,page_size:100}).then(r=>{R.value=r.lists});const k=y([]),h=y(!1),K=y(),te=r=>{if(n.uid==""){G.alertError("\u8BF7\u5148\u9009\u62E9\u7528\u6237");return}Le({store_name:r.store_name,product_type:0,is_warehouse:1,user_id:n.uid}).then(e=>{if(e.count==1){const m=e.lists[0];U(r,m)}e.count>1&&(k.value=e.lists,h.value=!0,K.value=r)})},oe=r=>{r!=null&&(U(K.value,r),h.value=!1,k.value=[],K.value=[])},f=q({}),b=(r,e,m)=>{const g=["id","store_name","nums","marques","gross_weight","net_weight","store_info","after_sales","los