You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
7.5 KiB
2 lines
7.5 KiB
|
3 weeks ago
|
import{D as a,s as t,r as e,n as l,c as s,w as i,S as n,o as r,d as o,e as f,t as d,u as c,f as u,i as m,F as _,j as g,p,m as h,q as v}from"./index-aGYdYpDa.js";import{d as y}from"./api.qV-fdkUH.js";import{_ as I}from"./_plugin-vue_export-helper.BCo6x5W8.js";const L=I({data:()=>({planId:null,planInfo:{},materialList:[],materialPage:1,materialPageSize:10,materialTotal:0,materialLoading:!1,materialHasMore:!0}),onLoad(t){if(t.planInfo)try{this.planInfo=JSON.parse(decodeURIComponent(t.planInfo)),this.planId=this.planInfo.id}catch(e){console.error("解析计划信息失败:",e)}t.planId&&(this.planId=t.planId),a({title:this.planInfo.name||"盘点计划详情"}),this.getMaterialList(!0)},methods:{async getMaterialList(a=!1){var l,s;if(!this.materialLoading&&this.planId)try{this.materialLoading=!0,a&&(this.materialPage=1,this.materialHasMore=!0);const i={page:this.materialPage,page_size:this.materialPageSize,"filter[0][key]":"material_infos_plan_id","filter[0][op]":"eq","filter[0][value]":this.planId},n=await y(i);if(console.log("物资列表响应:",n),n.data&&40001===n.data.errcode)return t({title:(null==(l=n.data)?void 0:l.errmsg)||"获取物资列表失败",icon:"none"}),void e({url:"/pages/login/login"});if(n.data&&n.data.list){const t=n.data.list,e=t.data||[];this.materialList=a?e:[...this.materialList,...e],this.materialTotal=t.total||0,this.materialHasMore=e.length===this.materialPageSize,this.materialHasMore&&this.materialPage++}else t({title:(null==(s=n.data)?void 0:s.message)||"获取物资列表失败",icon:"none"})}catch(i){console.error("获取物资列表失败:",i),t({title:"获取物资列表失败",icon:"none"})}finally{this.materialLoading=!1}},refreshMaterials(){this.getMaterialList(!0)},loadMoreMaterials(){this.materialHasMore&&!this.materialLoading&&this.getMaterialList(!1)},getStatusText:a=>({0:"未开始",1:"进行中",2:"已完成"}[a]||"未知状态"),getTypeText:a=>({1:"年度",2:"季度"}[a]||"未知类型"),getInventoryStatusText:a=>({0:"待盘点",1:"已盘点"}[a]||"待盘点"),formatDate(a){if(!a)return"";const t=new Date(a);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`},startInventory(a){console.log("开始盘点物资:",a),a.inventorys_id?l({url:`/pages/inventory/inventory?code=${a.inventorys_id}`}):t({title:"暂无盘点信息",icon:"none"})}}},[["render",function(a,t,e,l,y,I){const L=p,M=h,x=n;return r(),s(x,{class:"plan-detail-container","scroll-y":"",onScrolltolower:I.loadMoreMaterials,"lower-threshold":"100",onRefresherrefresh:I.refreshMaterials,"refresher-enabled":"true","refresher-triggered":y.materialLoading},{default:i((()=>[o(M,{class:"plan-info-card"},{default:i((()=>[o(M,{class:"plan-info-header"},{default:i((()=>[o(L,{class:"plan-info-title"},{default:i((()=>[f("盘点计划详情")])),_:1})])),_:1}),o(M,{class:"plan-info-content"},{default:i((()=>[o(M,{class:"info-row"},{default:i((()=>[o(M,{class:"info-item"},{default:i((()=>[o(L,{class:"info-label"},{default:i((()=>[f("计划名称")])),_:1}),o(L,{class:"info-value"},{default:i((()=>[f(d(y.planInfo.name||"暂无"),1)])),_:1})])),_:1}),o(M,{class:"info-item"},{default:i((()=>[o(L,{class:"info-label"},{default:i((()=>[f("计划编号")])),_:1}),o(L,{class:"info-value"},{default:i((()=>[f(d(y.planInfo.no||"暂无"),1)])),_:1})])),_:1})])),_:1}),o(M,{class:"info-row"},{default:i((()=>[o(M,{class:"info-item"},{default:i((()=>[o(L,{class:"info-label"},{default:i((()=>[f("盘点类型")])),_:1}),o(L,{class:"info-value type-text"},{default:i((()=>[f(d(I.getTypeText(y.planInfo.type)),1)])),_:1})])),_:1}),o(M,{class:"info-item"},{default:i((()=>[o(L,{class:"info-label"},{default:i((()=>[f("物资数量")])),_:1}),o(L,{class:"info-value count-text"},{default:i((()=>[f(d(y.planInfo.chart_total||0)+" 项",1)])),_:1})])),_:1})])),_:1}),o(M,{class:"info-row"},{default:i((()=>[o(M,{class:"info-item"},{default:i((()=>[o(L,{class:"info-label"},{default:i((()=>[f("开始时间")])),_:1}),o(L,{class:"info-value"},{default:i((()=>[f(d(I.formatDate(y.planInfo.start_date)),1)])),_:1})])),_
|