2 lines
18 KiB
JavaScript
2 lines
18 KiB
JavaScript
|
import{S as me,T as fe,G as _e,H as ge,U as Ve,J as be,K as ye,D as Fe,C as Ee,v as De,w as Ce,M as ce,b as we,N as ve,F as he,I as Be,L as Ue}from"./element-plus.91c68cc0.js";import{_ as ke}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.2d737363.js";import{d as J,r as F,Z as q,o as C,c as I,U as e,L as o,a as c,u as a,T as P,a9 as j,K as S,R as V,aa as x,S as Ke,j as G,n as B}from"./@vue.76ce7aa3.js";import{a as Ae}from"./vue-router.10bd5b90.js";import{a as qe}from"./beforehand_order.5b8db63c.js";import{a as Ie}from"./system_store.b390d8ef.js";import{b as Pe,a as Se}from"./store_product.85eb7751.js";import{h as Le}from"./index.538201cd.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.c320f3c6.js";import"./lodash.905d29aa.js";import"./axios.74873e41.js";import"./jspdf.9e946b0e.js";import"./fflate.0418c72f.js";import"./pinia.f3529286.js";import"./css-color-function.5dec0992.js";import"./color.f3e3a53f.js";import"./clone.8eedf8fa.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 Re={class:"flex-1 w-full"},Te={class:"mb-2"},Me=J({name:"storeProductEdit"}),ku=J({...Me,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Ne,{emit:Oe}){const L=F(),r=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:"",nickname:"",phone:"",address:""}),Z=async n=>{const u=await Pe({id:n.id,is_show:1,user_id:r.uid});U(n,u)},U=(n,u)=>{n.id=u.id,n.image=u.image,n.marques=u.marques,n.store_info=u.store_info,n.price=u.price,n.purchase=u.purchase,n.after_sales=u.after_sales,n.loss=u.loss,n.unit=u.unit,n.store_name=u.store_name,n.unit_name=u.unit_name,n.gross_weight=u.gross_weight,n.net_weight=u.net_weight,n.package=u.package;const s=[];y.value.forEach(g=>{s.push(g.id)}),s.includes(0)==!1&&y.value.push({id:0})},w=F(!1),y=F([{id:0}]),Q=n=>{y.value=y.value.filter(u=>u.id!==n)},W=n=>{n.forEach(u=>{y.value.find(s=>s.id==u.id)||y.value.push(u)}),w.value=!1};function X(n){n.total_price=(n.nums*n.price).toFixed(2),n.total_price>0&&(r.total_price=(parseFloat(r.total_price)+parseFloat(n.total_price)).toFixed(2))}function $(n){r.order_type==7||r.order_type==5?r.is_buyer=1:r.is_buyer=-1}const ee=Ae(),ue=async n=>{const u=y.value.map(s=>({product_id:s.id,nums:s.nums,price:s.price||0,purchase:s.purchase||0,total_price:s.total_price||0,marques:s.marques,store_info:s.store_info,after_sales:s.after_sales,loss:s.loss,unit:s.unit,gross_weight:s.gross_weight,net_weight:s.net_weight,package:s.package,mark:s.mark}));await n.validate((s,g)=>{s&&qe({product_arr:u,...r}).then(p=>{setTimeout(()=>{ee.push({path:"/order/beforehand_order"})},2e3)})})},R=F([]);Ie({page_no:1,page_size:100}).then(n=>{R.value=n.lists});const k=F([]),v=F(!1),K=F(),le=n=>{Se({store_name:n.store_name,product_type:0,is_warehouse:1,user_id:r.uid,is_show:1}).then(u=>{if(u.count==1){const s=u.lists[0];U(n,s)}u.count>1&&(k.value=u.lists,v.value=!0,K.value=n)})},oe=n=>{n!=null&&(U(K.value,n),v.value=!1,k.value=[],K.value=[])},_=q({}),b=(n,u,s)=>{const g=["id","store_name","nums","marques","gross_weight","net_weight","store_info","after_sales"
|