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
26 KiB
2 lines
26 KiB
|
3 months ago
|
import{s as e,B as a,b as t,h as l,r as s,C as o,D as n,E as i,f as c,d as r,w as d,c as u,j as m,F as f,m as h,o as _,e as p,t as g,i as y,q as v,u as b,p as C,l as k,I as w,G as M,x,S as D,H as F,J as R}from"./index--qIYCxYV.js";import{c as S,u as I,s as T,d as q,e as N,f as P}from"./api.CI2LxOCM.js";import{_ as z}from"./_plugin-vue_export-helper.BCo6x5W8.js";const V=z({data:()=>({isViewMode:!1,stockQty:"",countQty:"",remark:"",photo:"",photos:[],material_info_id:"",firstCategory:"-",secondCategory:"-",categoryName:"-",materialName:"-",materialCode:"-",materialType:"-",materialSpec:"-",materialSize:"-",unit:"-",batchNumber:"-",sequenceNumber:"-",waitNum:"-",productionDate:"-",storageDate:"-",materialStatus:"-",reserveMethod:"-",warehouseName:"-",shelfName:"-",shelfLayer:"-",levelCategory:"-",propertyInfo:"-",isFixedAsset:"-",fixedAssetCode:"-",reserveYears:"-",storageRequirement:"-",maintenanceRequirement:"-",maintenanceFrequency:"-",material_infos_plan_id:"",materialId:"",maintenanceRecords:[],showModal:!1,showDetailModal:!1,currentRecord:{},showCompleteModal:!1,completeForm:{actual_date:"",notes:"",photos:[],signature:""},currentMaintenanceRecord:null,signatureCtx:null,signaturePoints:[],isDrawing:!1}),onLoad(a){this.isViewMode="1"===a.view,this.date=this.getToday(),this.materialId=a.code,console.log("materialId:",this.materialId),this.materialId&&(S(this.materialId).then((a=>{if(console.log("response:",a),a.data){const e=a.data;this.material_info_id=e.wuzibianma_material_infos_wuzibianma_relation.id;const t=e.wuzibianma_material_infos_wuzibianma_relation||{},l=t.fenlei_detail||{},s=e.wuzizhuangtai_detail||{},o=e.chubeifangshi_detail||{},n=e.dengjifenlei_detail||{},i=e.chanquanxinxi_detail||{},c=e.materialstorages||{},r=e.shelfs||{},d=e.equipment_maintain_config||{},u=e.material_info_type||"";if(u){const e=u.split("-");this.firstCategory=e[0]||"-",this.secondCategory=e.length>1?e[1]:e[0]||"-"}this.categoryName=l.name||"-",this.materialName=e.zichanmingcheng||"-",this.materialCode=e.wuzibianma||"-",this.materialType=e.wuzileixing||"-",this.materialSpec=t.guigexinghao||e.guigexinghao||"-",this.materialSize=t.wuziguige||"-",this.unit=t.jiliangdanwei||e.jiliangdanwei||"-",this.batchNumber=e.rukupici||"-",this.stockQty=e.zaikushuliang||e.inventorys_total||"0",this.sequenceNumber=e.shunxuhao||"-",this.waitNum=e.wait_num||"-",this.productionDate=e.shengchanriqi||"-",this.storageDate=e.rukuriqi||"-",this.materialStatus=s.value||"-",this.reserveMethod=o.value||"-",this.warehouseName=c.cangkumingcheng||"-",this.shelfName=r.huojiamingcheng||"-",this.shelfLayer=e.huojiaceng||"-",this.levelCategory=n.value||"-",this.propertyInfo=i.value||"-",this.isFixedAsset=e.shifouweigudingzichan||"-",this.fixedAssetCode=e.gudingzichanbianma||"-",this.reserveYears=e.chubeinianxian||"-",this.storageRequirement=e.cunfangyaoqiu||"-",this.maintenanceRequirement=e.weihuyaoqiu||"-",this.maintenanceFrequency=d.name||"-",this.material_infos_plan_id=e.material_infos_plan_id||""}else e({title:"未获取到物资信息",icon:"none"})})).catch((()=>{e({title:"获取物资信息失败",icon:"none"})})),this.getMaintenanceRecords())},methods:{showInventoryModal(){this.showModal=!0},closeInventoryModal(){this.showModal=!1},getToday(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`},choosePhoto(){this.photos.length>=3?e({title:"最多上传3张照片",icon:"none"}):a({count:3-this.photos.length,success:e=>{this.photos=[...this.photos,...e.tempFilePaths]}})},deletePhoto(e){this.photos.splice(e,1)},async submit(){if(!this.countQty)return void e({title:"请输入盘点数量",icon:"none"});if(!/^(0|[1-9][0-9]*)$/.test(this.countQty))return void e({title:"盘点数量必须为0或正整数",icon:"none"});t({title:"提交中..."});let a=[];for(let t=0;t<this.photos.length;t++)try{const e=await I(this.photos[t]);e&&e.id&&a.push(e.id)}catch(n){return l(),void e({title:"图片上传失败",icon:"none"})}const o={status:"1",inventorys_id:this.materialId,check_num:this.countQty,remark:this.re
|