2024-05-30 15:51:26 +08:00
|
|
|
import{_ as F,u as q,L as te,r as i,o as T,m as z,a as W,b as p,s as x,c as a,h as d,e,f as s,w as u,g as w,v as se,z as N,F as O,i as E,y as oe,t as c,d as le,A as y,R as ae,S as ie,T as de,E as ne,B as K,C as P,P as re,Q as _e,U as ce}from"./index-D1f-ww4d.js";import{h as ue}from"./moment-Cl4UOzQZ.js";/* empty css */import{p as ve}from"./padding-KS62mXF5.js";const Q=V=>(K("data-v-27ca906a"),V=V(),P(),V),me={class:"my-order"},fe={class:"header-nav"},pe=Q(()=>e("div",{class:"nav-item"},c("待提交采购订单"),-1)),he={class:"nav-item-btn"},ge={class:"header-input"},ye={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},be=["onClick"],$e={class:"top"},ke={class:"sn"},we={class:"create-time"},Ve={class:"shop"},Ce={key:0,class:"left"},Ae={key:0,class:"shop-name"},ze={class:"right"},De={class:"money"},Le={class:"count"},Ue={class:"bottom"},Se={class:"pay"},Re={key:0},Ye={key:0},xe={key:1},Me={key:2},Be={key:1,style:{color:"#ff4a00"}},Ie={key:0,class:"cashier"},Ne={key:0,class:"load-end"},Oe={key:1,class:"load-end"},Ee=Q(()=>e("div",{style:{width:"100%",height:"7rem"}},null,-1)),Fe={key:0,class:"bottom-btn-fiexd"},qe={class:"dialog-footer"},Te={__name:"order",props:{isSystem:{type:Boolean,default:!1},source:{type:Number,default:0}},emits:["addAddress"],setup(V,{expose:U,emit:t}){q();const D=te();i([]);const o=i(1);i(null);const A=f=>{v(!0)},L=f=>f.getTime()>Date.now(),m=i({page_no:1,page_size:20,number:"",date:ue(new Date).format("YYYY-MM-DD"),is_mer:1}),_=i(!1),r=i(0),$=i(0),h=i(!1),k=i([]),v=(f=!1)=>{if(f)m.value.page_no=1;else if(h.value||_.value)return;_.value=!0,o.value==1&&(m.value.paid=null),o.value==2&&(m.value.paid=0),C.value=!1,ie(m.value).then(n=>{f?k.value=n.data.lists:k.value=[...k.value,...n.data.lists],n.data.lists.length<m.value.page_size?h.value=!0:m.value.page_no++,$.value=0,z.emit("set-c-order-detail",k.value[0]),r.value=n.data.count,_.value=!1}).catch(n=>{h.value=!0,_.value=!1})},S=()=>{de().then(f=>{ne.success("提交成功"),v(!0),z.emit("set-order-count-zero",f.data)})},g=(f,n)=>{$.value=n,z.emit("set-c-order-detail",f)};U({getOrderList:v});const M=t,Y=f=>{M("addAddress",f)},C=i(!1);return T(()=>{z.on("update-c-order-detail",f=>{k.value[$.value].paid=1}),C.value=!0,z.on("new_order",()=>{D.name=="order"&&(C.value=!0)})}),W(()=>{z.off("update-c-order-detail")}),(f,n)=>{const j=p("el-date-picker"),R=p("el-button"),G=p("el-input"),H=p("el-image"),J=p("el-dialog"),X=x("loading"),Z=x("infinite-scroll");return a(),d("div",me,[e("div",fe,[pe,e("div",he,[s(j,{modelValue:m.value.date,"onUpdate:modelValue":n[0]||(n[0]=l=>m.value.date=l),type:"date",placeholder:"请选择时间",size:"small",clearable:!1,"value-format":"YYYY-MM-DD","disabled-date":L,onChange:A},null,8,["modelValue"])])]),e("div",ge,[s(G,{modelValue:m.value.number,"onUpdate:modelValue":n[2]||(n[2]=l=>m.value.number=l),placeholder:"请输入订单编号",onKeydown:n[3]||(n[3]=se(l=>v(!0),["enter"])),onClear:n[4]||(n[4]=l=>v(!0)),clearable:""},{append:u(()=>[s(R,{type:"primary",style:{"background-color":"#1890ff",color:"#fff","border-radius":"0 0.315rem 0.315rem 0"},onClick:n[1]||(n[1]=l=>v(!0))},{default:u(()=>[w("搜索")]),_:1})]),_:1},8,["modelValue"])]),N((a(),d("div",ye,[(a(!0),d(O,null,E(k.value,(l,B)=>(a(),d("div",{class:oe(["item",{"item-active":$.value==B}]),key:B,onClick:I=>g(l,B)},[e("div",$e,[e("div",ke,"单号: "+c(l.number),1),e("div",we,c(l.create_time),1)]),e("div",Ve,[l.goods_list?(a(),d("div",Ce,[(a(!0),d(O,null,E(l.goods_list.slice(0,5),(I,ee)=>(a(),le(H,{key:ee,src:I.imgs,class:"shop-img"},null,8,["src"]))),128)),l.goods_list.length==1?(a(),d("div",Ae,c(l.goods_list[0].class_name),1)):y("",!0)])):y("",!0),e("div",ze,[e("div",De,"¥"+c(l.total),1),e("div",Le,"共"+c(l.goods_count)+"款商品",1)])]),e("div",Ue,[e("div",Se,[l.paid?(a(),d("div",Re,[w(" 已支付 "),l.pay_type==9?(a(),d("span",Ye,"(微信收款)")):y("",!0),l.pay_type==3?(a(),d("span",xe,"(余额支付)")):y("",!0),l.pay_type==1?(a(),d("span",Me,"(微信
|