2 lines
17 KiB
JavaScript
2 lines
17 KiB
JavaScript
|
import{T as fe,U as _e,P as ge,Q as be,V as Ve,N as Fe,O as ye,D as Ee,C as De,v as ce,w as ve,G as Ce,b as we,H as Be,F as he,L as Ue,K as ke}from"./element-plus.8e273e86.js";import{_ as Ae}from"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.d6f3a1ea.js";import{d as Q,r as F,Z as K,o as v,c as I,U as u,L as t,a as D,u as o,T as P,a9 as H,K as S,R as b,aa as j,S as L,j as G,n as h}from"./@vue.76ce7aa3.js";import{a as qe}from"./vue-router.10bd5b90.js";import{a as Ke}from"./beforehand_order.be84c393.js";import{a as Ie}from"./system_store.aa0e1610.js";import{b as Pe,a as Se}from"./store_product.67945300.js";import{h as Le}from"./index.4eb92b1c.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.d6032bc4.js";import"./usePaging.f8c888e4.js";import"./useDictOptions.cc192734.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 Re={class:"flex-1 w-full"},Te={class:"mb-2"},xe=Q({name:"storeProductEdit"}),ku=Q({...xe,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Ne,{emit:Oe}){const R=F(),a=K({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 r=>{const e=await Pe({id:r.id,user_id:a.uid});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.status_msg=e.status_msg,r.stock=e.stock,r.gross_weight=e.gross_weight,r.net_weight=e.net_weight,r.package=e.package;const n=[];V.value.forEach(f=>{n.push(f.id)}),n.includes(0)==!1&&V.value.push({id:0})},C=F(!1),V=F([{id:0}]),J=r=>{V.value=V.value.filter(e=>e.id!==r)},W=r=>{r.forEach(e=>{V.value.find(n=>n.id==e.id)||V.value.push(e)}),C.value=!1};function X(r){r.total_price=(r.nums*r.price).toFixed(2),r.total_price>0&&(a.total_price=(parseFloat(a.total_price)+parseFloat(r.total_price)).toFixed(2))}function ee(r){a.order_type==7||a.order_type==5?a.is_buyer=0:a.is_buyer=-1}const ue=qe(),le=async r=>{const e=V.value.map(n=>({product_id:n.id,nums:n.nums,price:n.price||0,purchase:n.purchase||0,total_price:n.total_price||0,marques:n.marques,store_info:n.store_info,after_sales:n.after_sales,loss:n.loss,unit:n.unit,gross_weight:n.gross_weight,net_weight:n.net_weight,package:n.package,mark:n.mark}));await r.validate((n,f)=>{n&&Ke({product_arr:e,...a}).then(d=>{setTimeout(()=>{ue.push({path:"/order/beforehand_order"})},2e3)})})},T=F([]);Ie({page_no:1,page_size:100}).then(r=>{T.value=r.lists});const k=F([]),w=F(!1),A=F(),te=r=>{Se({store_name:r.store_name,product_type:[0,6],is_warehouse:1,order_type:a.order_type,user_id:a.uid}).then(e=>{if(e.count==1){const n=e.lists[0];U(r,n)}e.count>1&&(k.value=e.lists,w.value=!0,A.value=r)})},oe=r=>{r!=null&&(U(A.value,r),w.value=!1,k.value=[],A.value=[])},g=K({}),c=(r,e,n)=>{const f=["id","store_name","nums","marques","pac
|