"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[698],{8027:function(t,e,a){a.d(e,{Z:function(){return l}});var r=function(){var t=this,e=t._self._c;return e("div",[e("el-tag",{attrs:{size:"medium",type:t.tagType}},[t._v(t._s(t.showName))])],1)},i=[],n={name:"statusTag",props:{injectData:{type:Object,default:()=>({})}},data(){return{tagType:"",showName:"",list:JSON.parse(localStorage.getItem("publicList")).enabledVoList}},mounted(){this.init()},methods:{init(){1===this.injectData.enabled?this.tagType="":this.tagType="warning",this.list&&this.list.map((t=>{t.dataCode===this.injectData.enabled&&(this.showName=t.dataName)}))}},watch:{injectData(t,e){e.enabled!==t.enabled&&this.init()}}},s=n,o=a(1001),u=(0,o.Z)(s,r,i,!1,null,null,null),l=u.exports},698:function(t,e,a){a.r(e),a.d(e,{default:function(){return Z}});var r=function(){var t=this,e=t._self._c;return e("div",{staticClass:"page-box"},[e("search-bar",{ref:"searchBarForm",attrs:{formConfigs:t.formConfig},on:{headBtnClick:t.buttonClick}}),e("base-table",{attrs:{page:t.listQuery.current,limit:t.listQuery.size,"table-props":t.tableProps,"table-data":t.tableData,"max-height":t.tableH}},[t.tableBtn.length?e("method-btn",{attrs:{slot:"handleBtn",width:120,label:"操作","method-list":t.tableBtn},on:{clickBtn:t.handleClick},slot:"handleBtn"}):t._e()],1),e("pagination",{attrs:{page:t.listQuery.current,limit:t.listQuery.size,total:t.total},on:{"update:page":function(e){return t.$set(t.listQuery,"current",e)},"update:limit":function(e){return t.$set(t.listQuery,"size",e)},pagination:function(e){return t.getList()}}}),e("base-dialog",{attrs:{dialogTitle:t.addOrEditTitle,dialogVisible:t.centervisible,"before-close":t.handleCancel},on:{cancel:t.handleCancel,confirm:t.handleConfirm}},[e("spare-parts-add",{ref:"sparePartsAdd",on:{successSubmit:t.successSubmit}})],1)],1)},i=[],n=function(){var t=this,e=t._self._c;return e("el-form",{ref:"form",attrs:{rules:t.rules,"label-width":"80px",model:t.form}},[e("el-form-item",{attrs:{label:"备件类别",prop:"type"}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"备件类别"},model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}},t._l(t.sparePartsTypeList,(function(t,a){return e("el-option",{key:a,attrs:{label:t.dataName,value:t.dataName}})})),1)],1),e("el-form-item",{attrs:{label:"备件名称",prop:"name"}},[e("el-input",{attrs:{placeholder:"备件名称"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),e("el-form-item",{attrs:{label:"备件型号",prop:"model"}},[e("el-input",{attrs:{placeholder:"无型号请填写为 /"},model:{value:t.form.model,callback:function(e){t.$set(t.form,"model",e)},expression:"form.model"}})],1),e("el-form-item",{directives:[{name:"show",rawName:"v-show",value:t.isEdit,expression:"isEdit"}],attrs:{label:"状态",prop:"enabled"}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"状态"},model:{value:t.form.enabled,callback:function(e){t.$set(t.form,"enabled",e)},expression:"form.enabled"}},t._l(t.stateList,(function(t,a){return e("el-option",{key:a,attrs:{label:t.dataName,value:t.dataCode}})})),1)],1)],1)},s=[],o=a(910),u={name:"SparePartsAdd",data(){return{form:{id:"",type:"",name:"",model:"",enabled:1},sparePartsTypeList:JSON.parse(localStorage.getItem("publicList")).sparePartsTypeList,stateList:JSON.parse(localStorage.getItem("publicList")).enabledVoList,rules:{type:[{required:!0,message:"请选择备件类别",trigger:"change"}],name:[{required:!0,message:"请输入备件名称",trigger:"blur"}],model:[{required:!0,message:"请输入备件型号",trigger:"blur"}]},isEdit:!1}},methods:{init(t){t?(this.form.id=t.id,(0,o.ME)({id:t.id}).then((e=>{0===e.code&&(this.form.type=e.data.type,this.form.name=e.data.name,this.form.model="copy"===t.type?"":e.data.model,this.form.enabled=e.data.enabled)})),"edit"===t.type?this.isEdit=!0:(this.isEdit=!1,this.form.id="")):(this.isEdit=!1,this.form.id="")},submitForm(){this.$refs["form"].validate((t=>{if(!t)return!1;this.isEdit?(0,o.Py)({...this.form}).then((t=>{0===t.code&&(this.$message({message:"操作成功",type:"success",duration:1500}),this.$emit("successSubmit"))})):(0,o.P4)({...this.form}).then((t=>{0===t.code&&(this.$message({message:"操作成功",type:"success",duration:1500}),this.$emit("successSubmit"))}))}))},formClear(){this.$refs.form.resetFields(),this.isEdit=!1}}},l=u,d=a(1001),c=(0,d.Z)(l,n,s,!1,null,null,null),p=c.exports,m=a(475),f=a(8027);const h=[{prop:"type",label:"备件类别"},{prop:"name",label:"备件名称"},{prop:"model",label:"备件型号"},{prop:"enabled",label:"状态",width:120,subcomponent:f.Z}],b=[{type:"edit",btnName:"编辑"},{type:"copy",btnName:"复制"}];var g={name:"SparePartsConfig",components:{SparePartsAdd:p},data(){return{formConfig:[{type:"select",label:"备件类别",selectOptions:JSON.parse(localStorage.getItem("publicList")).sparePartsTypeList,param:"type",labelField:"dataName",valueField:"dataName",defaultSelect:""},{type:"input",label:"备件名称",placeholder:"备件名称",param:"name"},{type:"input",label:"备件型号",placeholder:"备件型号",param:"model"},{type:"select",label:"状态",selectOptions:JSON.parse(localStorage.getItem("publicList")).enabledVoList,labelField:"dataName",valueField:"dataCode",param:"enabled",defaultSelect:"",width:120},{type:"button",btnName:"查询",name:"search",color:"primary"},{type:"button",btnName:"重置",name:"reset"},{type:"separate"},{type:"button",btnName:"新增",name:"add",color:"success",plain:!0}],tableProps:h,tableData:[],tableBtn:b,tableH:(0,m.NC)(265),total:0,listQuery:{current:1,size:20},centervisible:!1,addOrEditTitle:""}},mounted(){window.addEventListener("resize",(()=>{this.tableH=(0,m.NC)(265)})),this.getList()},methods:{getList(){(0,o.Wj)({...this.listQuery}).then((t=>{0===t.code&&(this.total=t.data.total,this.tableData=t.data.records)}))},buttonClick(t){switch(t.btnName){case"search":this.listQuery.type=t.type,this.listQuery.name=t.name,this.listQuery.model=t.model,this.listQuery.enabled=t.enabled,this.listQuery.current=1,this.getList();break;case"reset":this.$refs.searchBarForm.resetForm(),this.listQuery.type="",this.listQuery.name="",this.listQuery.model="",this.listQuery.enabled="",this.listQuery.current=1,this.getList();break;default:this.addOrEditTitle="新增",this.centervisible=!0,this.$nextTick((()=>{this.$refs.sparePartsAdd.init()}))}},handleClick(t){if("edit"===t.type){this.addOrEditTitle="编辑";const e={id:t.data.id,type:"edit"};this.$nextTick((()=>{this.$refs.sparePartsAdd.init(e)})),this.centervisible=!0}else if("copy"===t.type){this.addOrEditTitle="新增";const e={id:t.data.id,type:"copy"};this.$nextTick((()=>{this.$refs.sparePartsAdd.init(e)})),this.centervisible=!0}},handleCancel(){this.$refs.sparePartsAdd.formClear(),this.centervisible=!1,this.addOrEditTitle=""},handleConfirm(){this.$refs.sparePartsAdd.submitForm()},successSubmit(){this.handleCancel(),this.getList()}}},y=g,C=(0,d.Z)(y,r,i,!1,null,null,null),Z=C.exports},910:function(t,e,a){a.d(e,{$0:function(){return S},A0:function(){return P},D0:function(){return s},ER:function(){return T},Kl:function(){return N},ME:function(){return d},Or:function(){return g},P4:function(){return l},Py:function(){return c},QL:function(){return _},Qj:function(){return L},Sc:function(){return h},WZ:function(){return f},Wj:function(){return u},Zs:function(){return i},_:function(){return Q},_1:function(){return y},ag:function(){return k},b8:function(){return b},dN:function(){return p},fZ:function(){return m},gz:function(){return C},jF:function(){return n},kB:function(){return E},oW:function(){return w},qT:function(){return Z},sU:function(){return o},sy:function(){return x},tb:function(){return v},wy:function(){return O},xf:function(){return $}});var r=a(8859);function i(t){return(0,r.Z)({url:"/basic/account/page",method:"post",data:t})}function n(t){return(0,r.Z)({url:"/basic/account/add",method:"post",data:t})}function s(t){return(0,r.Z)({url:"/basic/account/get",method:"post",data:t})}function o(t){return(0,r.Z)({url:"/basic/account/update",method:"post",data:t})}function u(t){return(0,r.Z)({url:"/basic/sparePartsConfiguration/page",method:"post",data:t})}function l(t){return(0,r.Z)({url:"/basic/sparePartsConfiguration/add",method:"post",data:t})}function d(t){return(0,r.Z)({url:"/basic/sparePartsConfiguration/get",method:"post",data:t})}function c(t){return(0,r.Z)({url:"/basic/sparePartsConfiguration/update",method:"post",data:t})}function p(t){return(0,r.Z)({url:"/basic/sparePartsConfiguration/getNameList",method:"post",data:t})}function m(t){return(0,r.Z)({url:"/basic/sparePartsConfiguration/getModelList",method:"post",data:t})}function f(t){return(0,r.Z)({url:"/basic/consumableConfiguration/page",method:"post",data:t})}function h(t){return(0,r.Z)({url:"/basic/consumableConfiguration/add",method:"post",data:t})}function b(t){return(0,r.Z)({url:"/basic/consumableConfiguration/get",method:"post",data:t})}function g(t){return(0,r.Z)({url:"/basic/consumableConfiguration/update",method:"post",data:t})}function y(t){return(0,r.Z)({url:"/basic/consumableConfiguration/materialAndUnit",method:"post",data:t})}function C(t){return(0,r.Z)({url:"/basic/consumableConfiguration/specList",method:"post",data:t})}function Z(t){return(0,r.Z)({url:"/basic/sideLibraryConfiguration/page",method:"post",data:t})}function L(t){return(0,r.Z)({url:"/basic/sideLibraryConfiguration/add",method:"post",data:t})}function v(t){return(0,r.Z)({url:"/basic/sideLibraryConfiguration/get",method:"post",data:t})}function N(t){return(0,r.Z)({url:"/basic/sideLibraryConfiguration/update",method:"post",data:t})}function P(t){return(0,r.Z)({url:"/basic/sideLibraryConfiguration/list",method:"post",data:t})}function S(t){return(0,r.Z)({url:"/basic/equipmentConfiguration/page",method:"post",data:t})}function k(t){return(0,r.Z)({url:"/basic/equipmentConfiguration/add",method:"post",data:t})}function $(t){return(0,r.Z)({url:"/basic/equipmentConfiguration/get",method:"post",data:t})}function w(t){return(0,r.Z)({url:"/basic/equipmentConfiguration/update",method:"post",data:t})}function Q(t){return(0,r.Z)({url:"/basic/equipmentConfiguration/getUnitList",method:"post",formState:!0,data:t})}function T(t){return(0,r.Z)({url:"/basic/equipmentConfiguration/getEqCode",method:"post",data:t})}function E(t){return(0,r.Z)({url:"/report/report-sheet/page",method:"post",data:t})}function x(t){return(0,r.Z)({url:"/report/report-sheet/update",method:"post",data:t})}function O(t){return(0,r.Z)({url:"/report/report-sheet/delete",method:"post",data:t})}function _(t){return(0,r.Z)({url:"/report/report-sheet/get",method:"post",data:t})}}}]);