text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-25f5dc8e"],{"29d2":function(e,t,a){"use strict";a("f4df")},"8b34":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("page-header-wrapper",{attrs:{content:""}},[a("div",{staticClass:"equipment"},[a("div",{staticClass:"left-content"},[a("a-tree-select",{staticStyle:{width:"100%"},attrs:{"tree-data":e.departmentTree,"tree-default-expand-all":"","search-placeholder":"请选择",treeNodeFilterProp:"title"},on:{change:e.selectOwner},model:{value:e.selectedOwnerId,callback:function(t){e.selectedOwnerId=t},expression:"selectedOwnerId"}}),a("div",{staticClass:"button-style"},[a("a-dropdown",[a("a-menu",{attrs:{slot:"overlay"},on:{click:e.onTemplateDownload},slot:"overlay"},[a("a-menu-item",{key:"equipment"},[e._v(" 设备模板 ")]),a("a-menu-item",{key:"check"},[e._v(" 设备检查模板 ")]),a("a-menu-item",{key:"review"},[e._v(" 设备检测模板 ")]),a("a-menu-item",{key:"repair"},[e._v(" 设备维修模板 ")]),a("a-menu-item",{key:"keep"},[e._v(" 设备保养模板 ")])],1),a("a-button",[e._v(" 模板下载 "),a("a-icon",{attrs:{type:"down"}})],1)],1),a("a-dropdown",[a("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[a("a-menu-item",{key:"tank"},[a("a",{on:{click:function(t){return e.onImportData(null,"equipment")}}},[e._v("设备导入")])]),a("a-menu-item",{key:"check"},[a("a-upload",{attrs:{name:"file",fileList:[],customRequest:function(t){var a=t.file;e.onImportData(a,"check")}}},[e._v(" 设备检查数据导入 ")])],1),a("a-menu-item",{key:"review"},[a("a-upload",{attrs:{name:"file",fileList:[],customRequest:function(t){var a=t.file;e.onImportData(a,"review")}}},[e._v(" 设备检测数据导入 ")])],1),a("a-menu-item",{key:"repair"},[a("a-upload",{attrs:{name:"file",fileList:[],customRequest:function(t){var a=t.file;e.onImportData(a,"repair")}}},[e._v(" 设备维修数据导入 ")])],1),a("a-menu-item",{key:"keep"},[a("a-upload",{attrs:{name:"file",fileList:[],customRequest:function(t){var a=t.file;e.onImportData(a,"keep")}}},[e._v(" 设备保养数据导入 ")])],1)],1),a("a-button",[e._v(" 数据导入 "),a("a-icon",{attrs:{type:"down"}})],1)],1)],1),a("div",[e.equipmentSelect.visible?a("a-select",{staticStyle:{width:"200px","margin-left":"10px"},attrs:{"show-search":"",placeholder:"请选择设备下载类型","filter-option":e.filterOption},on:{change:e.handleTemplatedownLoad},model:{value:e.equipmentSelect.templateId,callback:function(t){e.$set(e.equipmentSelect,"templateId",t)},expression:"equipmentSelect.templateId"}},e._l(e.templateList,(function(t){return a("a-select-option",{key:t.id,attrs:{value:t.id}},[e._v(" "+e._s(t.name)+" ")])})),1):e._e()],1),a("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.showModal("add")}}},[e._v("新增")]),e.treeData.length?a("a-tree",{attrs:{"show-line":"","show-icon":!0,"tree-data":e.treeData,"selected-keys":e.selectedKeys},on:{select:e.onSelect},scopedSlots:e._u([{key:"custom",fn:function(t){return[a("span",[e._v(e._s(t.title))]),a("span",{staticClass:"icon-wrap"},[a("a-icon",{attrs:{type:"plus"},on:{click:function(a){return a.stopPropagation(),e.handleAdd(t)}}})],1),a("span",{staticClass:"icon-wrap"},[a("a-icon",{attrs:{type:"edit"},on:{click:function(a){return a.stopPropagation(),e.handleEdit(t)}}})],1),a("span",{staticClass:"icon-wrap"},[a("a-icon",{attrs:{type:"delete"},on:{click:function(a){return a.stopPropagation(),e.handleDelete(t)}}})],1)]}}],null,!1,3522345231)},[a("a-icon",{attrs:{slot:"file",type:"file-o"},slot:"file"}),a("a-icon",{attrs:{slot:"folder-open",type:"folder-open-o"},slot:"folder-open"})],1):a("a-empty",{attrs:{image:e.simpleImage}})],1),a("a-spin",{staticStyle:{width:"100%","margin-top":"10px","margin-bottom":"10px"},attrs:{spinning:e.treeloading}}),!0===e.maintanceDetailShow?a("div",{staticClass:"right-content"},[e.record.templateId&&"0"!==e.record.templateId?a("div",{staticClass:"maintance-show"},["1"===e.record.isMaintance?a("div",{staticClass:"header-button"},[a("a-dropdown",[a("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[a("a-menu-item",["1"===e.record.isChecked?a("a",{on:{click:function(t){return e.maintanceModal("check")}}},[e._v("检查")]):a("a",{staticStyle:{cursor:"no-drop"}},[e._v("检查(未配置)")])]),a("a-menu-item",["1"===e.record.isReviewed?a("a",{on:{click:function(t){return e.maintanceModal("review")}}},[e._v("检测")]):a("a",{staticStyle:{cursor:"no-drop"}},[e._v("检测(未配置)")])]),a("a-menu-item",[a("a",{on:{click:function(t){return e.maintanceModal("keep")}}},[e._v("保养")])]),a("a-menu-item",[a("a",{on:{click:function(t){return e.maintanceModal("repair")}}},[e._v("维修")])]),"1"===e.record.isDisabled?a("a-menu-item",[a("a",{on:{click:function(t){return e.maintanceModal("enable")}}},[e._v("启用")])]):e._e(),"1"!==e.form.isDisabled?a("a-menu-item",[a("a",{on:{click:function(t){return e.maintanceModal("disable")}}},[e._v("停用")])]):e._e(),a("a-menu-item",[a("a",{on:{click:function(t){return e.maintanceModal("scrap")}}},[e._v("报废")])])],1),a("a-button",[e._v(" 台账操作 "),a("a-icon",{attrs:{type:"down"}})],1)],1),a("a-button",{staticClass:"button-style",staticStyle:{"margin-left":"8px"},on:{click:function(t){return e.openImportModal(e.record.id)}}},[e._v(" 设备数据导入 "),a("a-icon",{attrs:{type:"cloud-upload"}})],1)],1):e._e(),a("div",{staticClass:"maintance"},[a("maintance-detail",{ref:"maintanceDetail",attrs:{info:e.record,"meta-data":e.equipMetaData}})],1)]):e._e(),e.record.templateId&&"0"===e.record.templateId?a("div",[a("a-card",{staticClass:"my-card-head",staticStyle:{"margin-bottom":"24px"},attrs:{bordered:!1}},[a("div",{staticClass:"table-page-search-wrapper"},[a("a-form",{attrs:{layout:"inline"}},[a("a-row",{attrs:{gutter:24}},[a("a-col",{attrs:{md:6,sm:24}},[a("a-form-item",{attrs:{label:"名称"}},[a("a-input",{attrs:{placeholder:"请输入设备名称"},model:{value:e.queryParam.name,callback:function(t){e.$set(e.queryParam,"name",t)},expression:"queryParam.name"}})],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"设备类型",prop:"templateId","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-select",{staticStyle:{width:"200px"},attrs:{"show-search":"",placeholder:"请选择设备类型","filter-option":e.filterOption},model:{value:e.queryParam.templateId,callback:function(t){e.$set(e.queryParam,"templateId",t)},expression:"queryParam.templateId"}},e._l(e.templateList,(function(t){return a("a-select-option",{key:t.id,attrs:{value:t.id}},[e._v(" "+e._s(t.name)+" ")])})),1)],1)],1),a("a-col",{staticStyle:{"text-align":"right"},attrs:{md:8,sm:24}},[a("span",{staticClass:"table-page-search-submitButtons",staticStyle:{"margin-bottom":"0px"}},[a("a-button",{staticStyle:{"margin-left":"8px"},on:{click:e.onReset}},[e._v(" 重置 ")]),a("a-button",{staticStyle:{"margin-left":"8px"},attrs:{type:"primary"},on:{click:e.onQuery}},[e._v("查询")])],1)])],1)],1)],1)]),a("a-card",{attrs:{bordered:!1}},[a("div",{staticStyle:{display:"flex","flex-direction":"row-reverse","margin-bottom":"18px"}},[a("div",[e.hasPermission(e.collection.add)?a("a-button",{staticClass:"button-style",attrs:{type:"primary"},on:{click:e.handleTableAdd}},[e._v("+ 新增 ")]):e._e(),e.hasPermission(e.collection.batchDelete)?a("a-button",{staticClass:"button-style",staticStyle:{"margin-left":"8px"},attrs:{type:"danger",disabled:!e.selectedRowKeys.length},on:{click:e.onBatchDelete}},[e._v(" 批量删除 ")]):e._e(),a("a-button",{staticClass:"button-style",staticStyle:{"margin-left":"8px"},on:{click:function(t){return e.openImportModal(e.record.id)}}},[e._v(" 设备数据导入 "),a("a-icon",{attrs:{type:"cloud-upload"}})],1)],1)]),a("s-table",{ref:"table",attrs:{size:"default",columns:e.columns,data:e.loadEquipData,rowSelection:e.hasPermission(e.collection.batchDelete)?e.rowSelection:null,showPagination:"auto",alert:!1,rowKey:function(e){return e.id}},scopedSlots:e._u([{key:"equipType",fn:function(t){return a("span",{},[e._v(e._s(e._f("equipTypeFilter")(t,e.templateList)))])}},{key:"edit",fn:function(t){return[a("div",[a("a",{staticClass:"action",on:{click:function(a){return e.onSelect([t.id],null)}}},[e._v(" 查看 ")]),a("a",{staticClass:"action",on:{click:function(a){return e.editEquipment(t.id)}}},[e._v(" 编辑 ")]),e.hasPermission(e.collection.delete)?a("a",{staticClass:"action",staticStyle:{color:"#ff4d4f"},on:{click:function(a){return e.removeEquipment([t.id])}}},[e._v(" 刪除 ")]):e._e()])]}}],null,!1,1688373950)})],1)],1):e._e()]):e._e()],1),a("a-modal",{attrs:{width:900,title:e.modal.title,afterClose:e.resetForm},model:{value:e.modal.visible,callback:function(t){e.$set(e.modal,"visible",t)},expression:"modal.visible"}},[a("template",{slot:"footer"},[a("a-button",{key:"back",on:{click:e.onFormCancel}},[e._v(" 取消")]),e.modal.disabled?e._e():a("a-button",{key:"submit",attrs:{type:"primary",loading:e.loading},on:{click:e.onFormConfirm}},[e._v(" "+e._s(e.modal.isAdd?"新增":"更新")+" ")])],1),a("a-form-model",{ref:"ruleForm",attrs:{model:e.form,rules:e.rules}},[a("div",{staticClass:"boxBoard"},[a("span",{staticClass:"boxTitle"},[e._v("设备信息")]),a("a-row",{staticClass:"rowBorder",attrs:{getter:"24"}},[a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"设备类型",prop:"templateId","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-select",{staticStyle:{width:"200px"},attrs:{"show-search":"",placeholder:"请选择设备类型","filter-option":e.filterOption},on:{change:e.handleEquipChange},model:{value:e.form.templateId,callback:function(t){e.$set(e.form,"templateId",t)},expression:"form.templateId"}},e._l(e.templateList,(function(t){return a("a-select-option",{key:t.id,attrs:{value:t.id}},[e._v(" "+e._s(t.name)+" ")])})),1)],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"设备名称",prop:"name","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-input",{attrs:{placeholder:"请输入设备名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"所属单位",prop:"ownerId","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-tree-select",{staticStyle:{width:"100%"},attrs:{disabled:!0,"dropdown-style":{maxHeight:"400px",overflow:"auto"},"tree-data":e.departmentTree,placeholder:e.modal.disabled?"":"请选择所属单位","tree-default-expand-all":"",allowClear:""},model:{value:e.form.ownerId,callback:function(t){e.$set(e.form,"ownerId",t)},expression:"form.ownerId"}})],1)],1)],1),e.form.templateId&&"0"!==e.form.templateId?a("a-row",{staticClass:"rowBorder",attrs:{getter:"24"}},[a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"设备编码",prop:"code","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-input",{attrs:{maxLength:512,placeholder:"请输入设备编码"},model:{value:e.form.code,callback:function(t){e.$set(e.form,"code",t)},expression:"form.code"}})],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"介质",prop:"medium","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-input",{attrs:{maxLength:512,placeholder:"请输入介质"},model:{value:e.form.medium,callback:function(t){e.$set(e.form,"medium",t)},expression:"form.medium"}})],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"设备位号",prop:"positionNum","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-input",{attrs:{maxLength:512,placeholder:"请输入设备位号"},model:{value:e.form.positionNum,callback:function(t){e.$set(e.form,"positionNum",t)},expression:"form.positionNum"}})],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"设备种类",prop:"kind","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-input",{attrs:{maxLength:255,placeholder:"请输入设备种类"},model:{value:e.form.kind,callback:function(t){e.$set(e.form,"kind",t)},expression:"form.kind"}})],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"安装位置",prop:"installLocation","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-input",{attrs:{maxLength:255,placeholder:"请输入安装位置"},model:{value:e.form.installLocation,callback:function(t){e.$set(e.form,"installLocation",t)},expression:"form.installLocation"}})],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"投用日期",prop:"commissioningDate","label-col":{md:8,sm:4},"wrapper-col":{md:16,sm:20}}},[a("a-date-picker",{staticStyle:{width:"100%"},attrs:{allowClear:"",valueFormat:"YYYY-MM-DD",placeholder:"请选择投用日期"},model:{value:e.form.commissioningDate,callback:function(t){e.$set(e.form,"commissioningDate",t)},expression:"form.commissioningDate"}})],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"厂家",prop:"manufacturer","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-input",{attrs:{maxLength:255,placeholder:"请输入厂家"},model:{value:e.form.manufacturer,callback:function(t){e.$set(e.form,"manufacturer",t)},expression:"form.manufacturer"}})],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"规格型号",prop:"specifications","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-input",{attrs:{maxLength:255,placeholder:"请输入规格型号"},model:{value:e.form.specifications,callback:function(t){e.$set(e.form,"specifications",t)},expression:"form.specifications"}})],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"出厂编号",prop:"serialNumber","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-input",{attrs:{maxLength:255,placeholder:"请输入出厂编号"},model:{value:e.form.serialNumber,callback:function(t){e.$set(e.form,"serialNumber",t)},expression:"form.serialNumber"}})],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"是否特种设备","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-radio-group",{model:{value:e.form.specialDevice,callback:function(t){e.$set(e.form,"specialDevice",t)},expression:"form.specialDevice"}},[a("a-radio",{attrs:{value:1,checked:""}},[e._v(" 是")]),a("a-radio",{attrs:{value:0}},[e._v(" 否")])],1)],1)],1)],1):e._e(),a("a-row",{staticClass:"rowBorder",attrs:{getter:"24"}},e._l(e.form.items,(function(t,r){return a("div",{key:t.val},["string"===t.type?a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:t.name,prop:""+t.val,"label-col":{span:8},"wrapper-col":{span:16}}},[a("a-input",{attrs:{maxLength:1024,placeholder:"请输入"+t.name},model:{value:t.textData,callback:function(a){e.$set(t,"textData",a)},expression:"item.textData"}})],1)],1):e._e(),"number"===t.type?a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:t.name,prop:""+t.val,"label-col":{span:8},"wrapper-col":{span:16}}},[a("a-input-number",{staticStyle:{width:"100%"},attrs:{step:.01,max:1e8,precision:5,placeholder:"请输入"+t.name},model:{value:t.numberData,callback:function(a){e.$set(t,"numberData",a)},expression:"item.numberData"}})],1)],1):e._e(),"date"===t.type?a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:t.name,prop:""+t.val,"label-col":{span:8},"wrapper-col":{span:16}}},[a("a-date-picker",{staticStyle:{width:"100%"},attrs:{allowClear:"",valueFormat:"YYYY-MM-DD",placeholder:"请输入"+t.name},model:{value:t.dateData,callback:function(a){e.$set(t,"dateData",a)},expression:"item.dateData"}})],1)],1):e._e(),"file"===t.type?a("a-col",{staticClass:"file-style",attrs:{md:12,sm:24}},[a("a-form-model-item",{attrs:{label:t.name,"label-col":{span:5},"wrapper-col":{span:19}}},[a("a-upload",{attrs:{"show-upload-list":!1,"before-upload":function(t){e.handleUpload(t,r)},customRequest:function(){},multiple:!1}},[a("div",{staticStyle:{display:"flex","justify-content":"center"}},[a("a-button",[a("a-icon",{attrs:{type:"upload"}}),e._v(" 上传附件 ")],1),t.fileId||t.fileName?a("a",{staticClass:"ant-upload-list-item-name ant-upload-list-item-name-icon-count-1",staticStyle:{"line-height":"32px"},attrs:{title:t.fileName,rel:"noopener noreferrer"},on:{click:function(a){return a.stopPropagation(),e.handleDownloadFile(t.fileId,t.fileName)}}},[e._v(" "+e._s(t.fileName)+" ")]):e._e(),t.fileId||t.fileName?a("a-icon",{staticStyle:{"margin-top":"9px"},attrs:{type:"delete"},on:{click:function(t){return t.stopPropagation(),e.handleDeleteFile(r)}}}):e._e()],1)])],1)],1):e._e()],1)})),0)],1),a("div",{staticClass:"boxBoard",staticStyle:{margin:"3% 0 3% 0"}}),e.form.templateId&&"0"!==e.form.templateId?a("div",{staticClass:"boxBoard"},[a("span",{staticClass:"boxTitle"},[e._v("配置信息")]),a("a-row",{staticClass:"rowBorder",attrs:{type:"flex",justify:"space-between",getter:"24"}},[a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"是否维护",prop:"isMaintance","label-col":{span:10},"wrapper-col":{span:14}}},[a("a-radio-group",{model:{value:e.form.isMaintance,callback:function(t){e.$set(e.form,"isMaintance",t)},expression:"form.isMaintance"}},[a("a-radio",{attrs:{value:"1"}},[e._v(" 是")]),a("a-radio",{attrs:{value:"0"}},[e._v(" 否")])],1)],1)],1)],1),"1"===e.form.isMaintance?a("a-row",{staticClass:"rowBorder",attrs:{type:"flex",justify:"space-between",getter:"24"}},[a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"是否检查",prop:"isChecked","label-col":{span:10},"wrapper-col":{span:14}}},[a("a-radio-group",{model:{value:e.form.isChecked,callback:function(t){e.$set(e.form,"isChecked",t)},expression:"form.isChecked"}},[a("a-radio",{attrs:{value:"1"}},[e._v("是")]),a("a-radio",{attrs:{value:"0"}},[e._v(" 否")])],1)],1)],1),"1"===e.form.isChecked?a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"检查周期",prop:"checkCycle","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-input-number",{staticStyle:{width:"100%"},attrs:{max:1e4,step:1,precision:0,placeholder:"请输入检查周期"},model:{value:e.form.checkCycle,callback:function(t){e.$set(e.form,"checkCycle",t)},expression:"form.checkCycle"}})],1)],1):e._e(),"1"===e.form.isChecked?a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"临近提醒(天)",prop:"checkReminderDays","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-input-number",{staticStyle:{width:"100%"},attrs:{max:1e4,step:1,precision:0,placeholder:"请输入临近提醒"},model:{value:e.form.checkReminderDays,callback:function(t){e.$set(e.form,"checkReminderDays",t)},expression:"form.checkReminderDays"}})],1)],1):e._e()],1):e._e(),"1"===e.form.isMaintance?a("a-row",{staticClass:"rowBorder",attrs:{type:"flex",justify:"space-between",getter:"24"}},[a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"是否检测",prop:"isReviewed","label-col":{span:10},"wrapper-col":{span:14}}},[a("a-radio-group",{model:{value:e.form.isReviewed,callback:function(t){e.$set(e.form,"isReviewed",t)},expression:"form.isReviewed"}},[a("a-radio",{attrs:{value:"1"}},[e._v("是")]),a("a-radio",{attrs:{value:"0"}},[e._v(" 否")])],1)],1)],1),"1"===e.form.isReviewed?a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"检测周期",prop:"reviewCycle","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-input-number",{staticStyle:{width:"100%"},attrs:{max:1e4,step:1,precision:0,placeholder:"请输入检测周期"},model:{value:e.form.reviewCycle,callback:function(t){e.$set(e.form,"reviewCycle",t)},expression:"form.reviewCycle"}})],1)],1):e._e(),"1"===e.form.isReviewed?a("a-col",{attrs:{md:8,sm:24}},[a("a-form-model-item",{attrs:{label:"临近提醒(天)",prop:"reviewReminderDays","label-col":{span:8},"wrapper-col":{span:16}}},[a("a-input-number",{staticStyle:{width:"100%"},attrs:{max:1e4,step:1,precision:0,placeholder:"请输入临近提醒"},model:{value:e.form.reviewReminderDays,callback:function(t){e.$set(e.form,"reviewReminderDays",t)},expression:"form.reviewReminderDays"}})],1)],1):e._e()],1):e._e()],1):e._e()])],2),a("a-modal",{attrs:{title:"设备导入",visible:e.equipmentSelect.importVisible,"confirm-loading":e.equipmentSelect.importConfirmLoading},on:{ok:e.handleImportEquip,cancel:function(){e.equipmentSelect.importVisible=!1}}},[a("div",{staticStyle:{"margin-bottom":"10px"}},[a("span",[a("span",{staticStyle:{color:"red"}},[e._v("*")]),e._v(" 设备类型: ")]),a("a-select",{staticStyle:{width:"200px","margin-left":"10px"},attrs:{"show-search":"",placeholder:"请选择设备导入类型","filter-option":e.filterOption},model:{value:e.equipmentSelect.templateId,callback:function(t){e.$set(e.equipmentSelect,"templateId",t)},expression:"equipmentSelect.templateId"}},e._l(e.templateList,(function(t){return a("a-select-option",{key:t.id,attrs:{value:t.id}},[e._v(" "+e._s(t.name)+" ")])})),1)],1),a("div",{staticClass:"equip-modal-upload"},[a("a-upload",{attrs:{"file-list":e.equipmentSelect.importFile?[e.equipmentSelect.importFile]:[],remove:function(t){e.equipmentSelect.importFile=null},"before-upload":function(t){e.equipmentSelect.importFile=t},customRequest:function(){},multiple:!1}},[a("span",[a("span",{staticStyle:{color:"red"}},[e._v("*")]),e._v(" 设备文件: ")]),e.modal.disabled?e._e():a("a-button",[a("a-icon",{attrs:{type:"upload"}}),e._v(" 选择文件 ")],1)],1)],1)]),a("check-info-edit",{ref:"checkInfoEdit"}),a("review-info-edit",{ref:"reviewInfoEdit"}),a("keep-info-edit",{ref:"keepInfoEdit"}),a("repair-info-edit",{ref:"repairInfoEdit"}),a("enable-info-edit",{ref:"enableInfoEdit"}),a("disable-info-edit",{ref:"disableInfoEdit"}),a("scrap-info-edit",{ref:"scrapInfoEdit"})],1)},n=[],i=a("6abc"),o=a("58c8"),s=a("60b5"),l=(a("b858"),a("8b33")),c=(a("6a61"),a("ea94"),a("1d43"),a("3bae"),a("16ca"),a("27ae"),a("feb3"),a("2af9")),d=a("ae51"),m=a("b452"),p=a("3cbc"),u=a("c277"),f=a("368b"),v=a("dda2"),b=a("3956"),h=a("f7f7"),w=a("6011"),y=a("76f0"),k=a("ca00"),g=a("760e"),x=[{title:"名称",dataIndex:"name"},{title:"设备类型",scopedSlots:{customRender:"equipType"}},{title:"操作",scopedSlots:{customRender:"edit"},width:"20%"}],I={name:"Equipment",components:{STable:c["f"],CheckInfoEdit:p["a"],ReviewInfoEdit:u["a"],KeepInfoEdit:f["a"],RepairInfoEdit:v["a"],EnableInfoEdit:b["a"],DisableInfoEdit:h["a"],ScrapInfoEdit:w["a"],MaintanceDetail:m["a"]},data:function(){var e=this,t=this.$store.state.department.departmentTree,a=this.$store.state.department.flatDepartmentTree,r="1";return this.columns=x,{selectedOwnerId:t[0]&&t[0].key||"",departmentTree:t,flatDepartmentTree:a,collection:g["a"].vehicle.vehicle_select_menu,facilityType:r,equipMetaData:[],loadEquipData:function(t){e.queryParam.parentId=e.record.id;var a=Object.assign({},t,e.queryParam);return Object(d["r"])(a).then((function(e){return e.body}))},record:{},selectedKeys:[],selectedRowKeys:[],selectedRows:[],treeData:[],fileList:{},templateList:[],expandedKeys:[],loading:!1,treeloading:!1,maintanceDetailShow:!1,equipmentSelect:{importVisible:!1,importFile:null,importConfirmLoading:!1,visible:!1,templateId:void 0,parentId:void 0},modal:{visible:!1,isAdd:!0,disabled:!1,title:""},autoExpandParent:!0,queryParam:{name:void 0,parentId:void 0,templateId:void 0},form:{name:void 0,code:void 0,medium:void 0,positionNum:void 0,kind:void 0,installLocation:void 0,commissioningDate:void 0,manufacturer:void 0,specifications:void 0,serialNumber:void 0,specialDevice:void 0,ownerId:void 0,items:[],templateId:void 0,parentId:void 0,isChecked:void 0,checkCycle:void 0,checkReminderDays:void 0,isReviewed:void 0,reviewCycle:void 0,reviewReminderDays:void 0},column:{templateItemId:void 0,textData:void 0,numberData:void 0,dateData:void 0,fileId:void 0,fileName:void 0,name:void 0,val:void 0,type:void 0},rules:{templateId:[{required:!0,message:"请选择设备类型"}],ownerId:[{required:!0,message:"请选择所属单位"}],name:[{required:!0,message:"请输入名称",transform:function(e){return e.trim()}}],checkCycle:[{required:!0,message:"请输入检查周期"}],checkReminderDays:[{required:!0,message:"请输入检查临近提醒"}],reviewCycle:[{required:!0,message:"请输入检测周期"}],reviewReminderDays:[{required:!0,message:"请输入检测临近提醒"}],isMaintance:[{required:!0,message:"请选择是否维护"}],isChecked:[{required:!0,message:"请选择是否检查"}],isReviewed:[{required:!0,message:"请选择是否检测"}]}}},beforeCreate:function(){this.simpleImage=l["a"].PRESENTED_IMAGE_SIMPLE},filters:{equipTypeFilter:function(e,t){if(e.templateId)for(var a=0;a<t.length;a++)if(t[a].id===e.templateId)return t[a].name;return""}},created:function(){this.getEquipmentTree(),this.getTemplateList()},computed:{rowSelection:function(){return{selectedRowKeys:this.selectedRowKeys,onChange:this.onSelectChange}}},methods:{hasPermission:function(e){return Object(g["b"])(e)},getEquipmentTree:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var a,r,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e.treeloading=!0,t.next=4,Object(d["o"])({ownerId:e.selectedOwnerId});case 4:if(a=t.sent,200===a.code){t.next=7;break}throw new Error(a.msg);case 7:e.treeData=[],r=a.body?a.body:[],n={},r.forEach((function(e){var t={title:e.name,value:e.id,key:e.id,slots:{icon:"tool"},scopedSlots:{title:"custom"},children:[]};"0"===e.templateId&&(t.slots.icon="folder-open"),n[e.id]=t})),r.forEach((function(t){t.parentId&&n[t.parentId]?n[t.parentId].children.push(n[t.id]):e.treeData.push(n[t.id])})),e.treeloading=!1,t.next=18;break;case 15:t.prev=15,t.t0=t["catch"](0),e.$message.error("获取数据失败"+t.t0.message);case 18:case"end":return t.stop()}}),t,null,[[0,15]])})))()},getTemplateList:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(d["s"])({});case 2:a=t.sent,e.templateList=[{id:"0",name:"目录"}].concat(Object(o["a"])(a.body));case 4:case"end":return t.stop()}}),t)})))()},resetForm:function(){this.form={name:void 0,code:void 0,medium:void 0,positionNum:void 0,kind:void 0,installLocation:void 0,commissioningDate:void 0,manufacturer:void 0,specifications:void 0,serialNumber:void 0,specialDevice:void 0,ownerId:void 0,items:[],templateId:void 0,parentId:void 0,isChecked:void 0,checkCycle:void 0,checkReminderDays:void 0,isReviewed:void 0,reviewCycle:void 0,reviewReminderDays:void 0},this.fileList={},this.$refs.ruleForm.resetFields()},onFormCancel:function(e){this.modal.visible=!1,this.resetForm()},showModal:function(e){this.form.ownerId=this.selectedOwnerId,this.modal.disabled="detail"===e,this.modal.isAdd="add"===e,this.modal.title="add"===e?"添加设备":"update"===e?"更新设备":"查看设备",this.modal.visible=!0},onSelectChange:function(e,t){this.selectedRowKeys=e,this.selectedRows=t},selectOwner:function(e){this.maintanceDetailShow=!1,this.getEquipmentTree()},handleUpload:function(e,t){var a=this.form.items[t].templateItemId;this.fileList[a]=e,this.form.items[t].fileName=e.name},handleDownloadFile:function(e,t){var a=this;return Object(s["a"])(regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(!e){r.next=12;break}return r.prev=1,r.next=4,y["a"]({id:e});case 4:n=r.sent,k["d"](n,"".concat(t)),r.next=12;break;case 8:r.prev=8,r.t0=r["catch"](1),i=r.t0&&r.t0.response&&r.t0.response.data?r.t0.response.data.msg:"",a.$message.error(r.t0.message||"下载失败！"+i);case 12:case"end":return r.stop()}}),r,null,[[1,8]])})))()},handleDeleteFile:function(e){this.form.items[e].fileId=void 0,this.form.items[e].fileName=void 0;var t=this.form.items[e].templateItemId;delete this.fileList[t]},uploadRequest:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var a,r,n,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:t.t0=regeneratorRuntime.keys(e.fileList);case 1:if((t.t1=t.t0()).done){t.next=22;break}return a=t.t1.value,r=new FormData,r.append("file",e.fileList[a]),t.next=7,y["c"](r);case 7:if(n=t.sent,200!==n.code){t.next=19;break}i=0;case 10:if(!(i<e.form.items.length)){t.next=17;break}if(e.form.items[i].templateItemId!==a){t.next=14;break}return e.form.items[i].fileId=n.body.id,t.abrupt("break",17);case 14:i++,t.next=10;break;case 17:t.next=20;break;case 19:e.$message.error("文件上传失败");case 20:t.next=1;break;case 22:case"end":return t.stop()}}),t)})))()},maintanceModal:function(e){switch(e){case"check":this.$refs.checkInfoEdit.showAddModal(this.record.id,this.facilityType);break;case"review":this.$refs.reviewInfoEdit.showAddModal(this.record.id,this.facilityType);break;case"keep":this.$refs.keepInfoEdit.showAddModal(this.record.id,this.facilityType);break;case"repair":this.$refs.repairInfoEdit.showAddModal(this.record.id,this.facilityType);break;case"enable":this.$refs.enableInfoEdit.showAddModal(this.record.id,this.facilityType);break;case"disable":this.$refs.disableInfoEdit.showAddModal(this.record.id,this.facilityType);break;case"scrap":this.$refs.scrapInfoEdit.showAddModal(this.record.id,this.facilityType);break;default:break}},onFormConfirm:function(e){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:a=t,t.$refs.ruleForm.validate(function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(r){var n,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!r){e.next=28;break}return a.loading=!0,e.prev=2,e.next=5,t.uploadRequest();case 5:if(n=Object(k["f"])(a.form),!a.modal.isAdd){e.next=11;break}return e.next=9,Object(d["Y"])(n);case 9:e.next=13;break;case 11:return e.next=13,Object(d["mb"])(n);case 13:a.modal.visible=!1,a.$message.success("".concat(a.modal.isAdd?"创建":"更新","成功！")),t.getEquipmentTree(),t.onQuery(),e.next=23;break;case 19:e.prev=19,e.t0=e["catch"](2),i=e.t0&&e.t0.response&&e.t0.response.data?e.t0.response.data.msg:"",a.$message.error("".concat(a.modal.isAdd?"创建":"更新","失败！")+i);case 23:return e.prev=23,a.loading=!1,e.finish(23);case 26:e.next=29;break;case 28:return e.abrupt("return",!1);case 29:case"end":return e.stop()}}),e,null,[[2,19,23,26]])})));return function(t){return e.apply(this,arguments)}}());case 2:case"end":return e.stop()}}),e)})))()},handleEquipChange:function(e){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function a(){var r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if("0"!==e){a.next=3;break}return t.form.items=[],a.abrupt("return");case 3:return t.loading=!0,t.form.items=[],t.fileList=[],a.next=8,Object(d["n"])({templateId:e});case 8:r=a.sent,r.body.forEach((function(e){var a=Object(i["a"])({},t.column);a.templateItemId=e.id,a.type=e.itemType,a.val=e.id,a.name=e.itemName,t.form.items.push(a)})),t.loading=!1;case 11:case"end":return a.stop()}}),a)})))()},onSelect:function(e,t){var a=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a.maintanceDetailShow=!1,a.record={},a.equipmentId=void 0,a.equipMetaData=[{name:"设备类型",val:"templateName"},{name:"设备名称",val:"name"},{name:"所属单位",val:"ownerId",type:"owner"},{name:"设备编码",val:"code"},{name:"介质",val:"medium"},{name:"设备位号",val:"positionNum"},{name:"设备种类",val:"kind"},{name:"安装位置",val:"installLocation"},{name:"投用日期",val:"commissioningDate"},{name:"厂家",val:"manufacturer"},{name:"规格型号",val:"specifications"},{name:"出厂编号",val:"serialNumber"},{name:"是否特种设备",val:"specialDevice",type:"radio",options:[{code:1,name:"是"},{code:0,name:"否"}]}],a.equipmentId=e[0],t.next=7,Object(d["q"])({equipmentId:e[0]});case 7:if(r=t.sent,200!==r.code){t.next=23;break}a.record=r.body,a.record=Object(i["a"])(Object(i["a"])({},a.record),{},{areaId:r.body.id,facilityType:a.facilityType}),n=0;case 12:if(!(n<a.templateList.length)){t.next=19;break}if(a.templateList[n].id!==r.body.templateId){t.next=16;break}return a.record=Object(i["a"])(Object(i["a"])({},a.record),{},{templateName:a.templateList[n].name}),t.abrupt("break",19);case 16:n++,t.next=12;break;case 19:r.body.items.forEach((function(e){var t={name:e.name,val:e.val,type:e.type};switch(e.type){case"number":a.record[e.val]=e.numberData,a.equipMetaData.push(t);break;case"string":a.record[e.val]=e.textData,a.equipMetaData.push(t);break;case"date":a.record[e.val]=e.dateData,a.equipMetaData.push(t);break;case"file":a.record["".concat(e.val,"_fileId")]=e.fileId,a.record["".concat(e.val,"_fileName")]=e.fileName,t.val="".concat(e.val,"_file"),a.equipMetaData.push(t);break}})),a.$nextTick((function(){a.maintanceDetailShow=!0})),t.next=24;break;case 23:a.$message.error("获取设备详情失败");case 24:case"end":return t.stop()}}),t)})))()},handleAdd:function(e){this.form.parentId=e.dataRef.value,this.showModal("add")},handleTableAdd:function(){this.form.parentId=this.record.id,this.showModal("add")},editEquipment:function(e){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function a(){var r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(d["q"])({equipmentId:e});case 2:r=a.sent,200===r.code?(t.form=r.body,t.showModal("update")):t.$message.error("获取设备详情失败");case 4:case"end":return a.stop()}}),a)})))()},handleEdit:function(e){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function a(){var r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(d["q"])({equipmentId:e.dataRef.key});case 2:r=a.sent,200===r.code?(t.form=r.body,t.showModal("update")):t.$message.error("获取设备详情失败");case 4:case"end":return a.stop()}}),a)})))()},onBatchDelete:function(){this.removeEquipment(Object(o["a"])(this.selectedRowKeys))},onTemplateDownload:function(e){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function a(){var r,n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:a.prev=0,a.t0=e.key,a.next="equipment"===a.t0?4:"check"===a.t0?6:"review"===a.t0?11:"repair"===a.t0?16:"keep"===a.t0?21:26;break;case 4:return t.equipmentSelect.visible=!t.equipmentSelect.visible,a.abrupt("break",27);case 6:return a.next=8,Object(d["k"])({type:t.facilityType,ownerId:t.selectedOwnerId});case 8:return r=a.sent,k["d"](r,"检查数据模板.xls"),a.abrupt("break",27);case 11:return a.next=13,Object(d["B"])({type:t.facilityType,ownerId:t.selectedOwnerId});case 13:return r=a.sent,k["d"](r,"检测数据模板.xls"),a.abrupt("break",27);case 16:return a.next=18,Object(d["z"])({type:t.facilityType,ownerId:t.selectedOwnerId});case 18:return r=a.sent,k["d"](r,"维修数据模板.xls"),a.abrupt("break",27);case 21:return a.next=23,Object(d["x"])({type:t.facilityType,ownerId:t.selectedOwnerId});case 23:return r=a.sent,k["d"](r,"保养数据模板.xls"),a.abrupt("break",27);case 26:return a.abrupt("break",27);case 27:a.next=33;break;case 29:a.prev=29,a.t1=a["catch"](0),n=a.t1&&a.t1.response&&a.t1.response.data?a.t1.response.data.msg:"",t.$message.error("下载失败！"+n);case 33:case"end":return a.stop()}}),a,null,[[0,29]])})))()},onImportData:function(e,t){var a=this;return Object(s["a"])(regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:r.prev=0,r.t0=t,r.next="equipment"===r.t0?4:"check"===r.t0?6:"review"===r.t0?10:"repair"===r.t0?14:"keep"===r.t0?18:22;break;case 4:return a.openImportModal(void 0),r.abrupt("return");case 6:return r.next=8,Object(d["M"])(e,a.facilityType);case 8:return n=r.sent,r.abrupt("break",23);case 10:return r.next=12,Object(d["Q"])(e,a.facilityType);case 12:return n=r.sent,r.abrupt("break",23);case 14:return r.next=16,Object(d["L"])(e,a.facilityType);case 16:return n=r.sent,r.abrupt("break",23);case 18:return r.next=20,Object(d["K"])(e,a.facilityType);case 20:return n=r.sent,r.abrupt("break",23);case 22:return r.abrupt("break",23);case 23:a.$notification.open({message:n.body}),a.getTree(),r.next=31;break;case 27:r.prev=27,r.t1=r["catch"](0),i=r.t1&&r.t1.response&&r.t1.response.data?r.t1.response.data.msg:"",a.$message.error("导入失败！"+i);case 31:case"end":return r.stop()}}),r,null,[[0,27]])})))()},handleDelete:function(e){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function a(){var r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:r=[],r.push(e.dataRef.key),t.setId(e.children,r),t.removeEquipment(r);case 4:case"end":return a.stop()}}),a)})))()},setId:function(e,t){for(var a in e)t.push(e[a].key),e[a].children&&this.setId(e[a].children,t)},removeEquipment:function(e){var t=this;this.$confirm({title:"是否确认删除该节点和孩子节点？",onOk:function(){Object(d["c"])(e).then((function(e){e&&200===e.code?t.$message.success("删除成功！"):t.$message.error(e.message||"删除失败！"),t.getEquipmentTree(),t.onQuery()})).catch((function(e){}))},onCancel:function(){}})},onReset:function(){this.queryParam.name=void 0,this.queryParam.templateId=void 0},onQuery:function(){this.record.templateId&&"0"===this.record.templateId&&this.$refs.table.refresh(!0)},handleTemplatedownLoad:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var a,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.equipmentSelect.templateId){t.next=3;break}return e.$message.error("请选择设备模板类型"),t.abrupt("return");case 3:return t.prev=3,e.treeloading=!0,t.next=7,Object(d["p"])({templateId:e.equipmentSelect.templateId});case 7:a=t.sent,k["d"](a,"设备模板数据.xls"),t.next=15;break;case 11:t.prev=11,t.t0=t["catch"](3),r=t.t0&&t.t0.response&&t.t0.response.data?t.t0.response.data.msg:"",e.$message.error("下载失败！"+r);case 15:return t.prev=15,e.equipmentSelect.visible=!1,e.equipmentSelect.templateId=void 0,e.treeloading=!1,t.finish(15);case 20:case"end":return t.stop()}}),t,null,[[3,11,15,20]])})))()},openImportModal:function(e){this.equipmentSelect={importVisible:!0,importFile:null,importConfirmLoading:!1,visible:!1,templateId:void 0,parentId:e}},handleImportEquip:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var a,r,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.equipmentSelect.templateId&&e.equipmentSelect.importFile){t.next=3;break}return e.$message.error("请选择设备模板类型以及上传文件"),t.abrupt("return");case 3:return t.prev=3,e.equipmentSelect.importConfirmLoading=!0,a={templateId:e.equipmentSelect.templateId,ownerId:e.selectedOwnerId,parentId:e.equipmentSelect.parentId},t.next=8,Object(d["O"])(e.equipmentSelect.importFile,a);case 8:r=t.sent,e.equipmentSelect.importVisible=!1,e.equipmentSelect.templateId=void 0,e.equipmentSelect.importFile=null,e.$notification.open({message:r.body}),e.getEquipmentTree(),e.onQuery(),t.next=21;break;case 17:t.prev=17,t.t0=t["catch"](3),n=t.t0&&t.t0.response&&t.t0.response.data?t.t0.response.data.msg:"",e.$message.error("导入失败！"+n);case 21:return t.prev=21,e.equipmentSelect.importConfirmLoading=!1,t.finish(21);case 24:case"end":return t.stop()}}),t,null,[[3,17,21,24]])})))()},filterOption:function(e,t){return t.componentOptions.children[0].text.toLowerCase().indexOf(e.toLowerCase())>=0}}},_=I,q=(a("29d2"),a("5d22")),D=Object(q["a"])(_,r,n,!1,null,"e25dd81a",null);t["default"]=D.exports},f4df:function(e,t,a){}}]);