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.6b2edd7a.js";import{d as G,s as Ke,Z as q,r as F,o as c,c as I,U as u,L as o,a as C,u as a,T as P,a9 as H,K as S,R as V,aa as j,S as Ae,j as x,n as B}from"./@vue.76ce7aa3.js";import{a as qe}from"./vue-router.10bd5b90.js";import{a as Ie}from"./beforehand_order.09e11d0e.js";import{a as Pe}from"./system_store.93f4d9f2.js";import{b as Se,a as Re}from"./store_product.e74e7158.js";import{h as Le}from"./index.c65ce26e.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.37dc5eb1.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 Te={class:"flex-1 w-full"},Me={class:"mb-2"},Ne=G({name:"storeProductEdit"}),Ku=G({...Ne,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(Oe,{emit:Ye}){const J=Ke(),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 e=await Se({id:n.id});U(n,e)},U=(n,e)=>{n.id=e.id,n.image=e.image,n.marques=e.marques,n.store_info=e.store_info,n.price=e.price,n.purchase=e.purchase,n.after_sales=e.after_sales,n.loss=e.loss,n.unit=e.unit,n.store_name=e.store_name,n.unit_name=e.unit_name,n.gross_weight=e.gross_weight,n.net_weight=e.net_weight,n.package=e.package;const f=[];y.value.forEach(g=>{f.push(g.id)}),f.includes(0)==!1&&y.value.push({id:0})},w=F(!1),y=F([{id:0}]),Q=n=>{y.value=y.value.filter(e=>e.id!==n)},W=n=>{n.forEach(e=>{y.value.find(f=>f.id==e.id)||y.value.push(e)}),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=qe(),ue=async()=>{const n=y.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}));Ie({product_arr:n,...r}).then(e=>{setTimeout(()=>{ee.push({path:"/order/beforehand_order"})},2e3)})},R=F([]);Pe({page_no:1,page_size:100}).then(n=>{R.value=n.lists});const k=F([]),v=F(!1),K=F(),le=n=>{Re({store_name:n.store_name,product_type:0,is_warehouse:1,user_id:r.uid}).then(e=>{if(e.count==1){const f=e.lists[0];U(n,f)}e.count>1&&(k.value=e.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,e,f)=>{const g=["id","store_name","nums","marques","gross_weight","net_weight","store_info","after_sales","loss","package","mark"];if(n.keyCode===38){if(e===0)r
|