|
@@ -1,26 +1,20 @@
|
|
|
<template>
|
|
|
- <div class="asset-detail" v-if="isFinish >= 2">
|
|
|
- <van-nav-bar :title="isMaintenanceShow || isRepairShow ? '设备详情' : '设备信息'" @click-left="backPage"
|
|
|
+ <div class="asset-detail">
|
|
|
+ <van-nav-bar title="维修及维保事项" @click-left="backPage"
|
|
|
@click-right="handleRightClick">
|
|
|
<template #left>
|
|
|
<van-icon name="arrow-left" size="18" color="#333333" />
|
|
|
</template>
|
|
|
- <template #right v-if="active == 1 || active == 2">
|
|
|
+ <template #right>
|
|
|
<i class="iconfont wanda-scan"></i>
|
|
|
</template>
|
|
|
</van-nav-bar>
|
|
|
- <div class="asset-information" v-if="!isMaintenanceShow && !isRepairShow">
|
|
|
- <Information :data="informationData" />
|
|
|
- </div>
|
|
|
- <van-tabs v-else v-model="active" class="other-tabs" color="#025BAA" @change="changeTab"
|
|
|
+ <van-tabs v-model="active" class="other-tabs" color="#025BAA" @change="changeTab"
|
|
|
title-active-color="#025BAA" :line-width="60">
|
|
|
- <van-tab title="设备信息">
|
|
|
- <Information :data="informationData" />
|
|
|
- </van-tab>
|
|
|
- <van-tab v-if="isMaintenanceShow" title="重要维保">
|
|
|
+ <van-tab title="重要维保">
|
|
|
<RepairMaintenance ref="maintenance" type="maintenance" :list="maintenanceData" @onSearch="getData" />
|
|
|
</van-tab>
|
|
|
- <van-tab v-if="isRepairShow" title="重要维修">
|
|
|
+ <van-tab title="重要维修">
|
|
|
<RepairMaintenance ref="repair" type="repair" :list="repairData" @onSearch="getData" />
|
|
|
</van-tab>
|
|
|
</van-tabs>
|
|
@@ -74,33 +68,22 @@
|
|
|
import Vue from "vue";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import { NavBar, Tab, Tabs, Popup, Button, Toast } from "vant";
|
|
|
-import Information from "@/components/assetDetail/Information.vue";
|
|
|
-import RepairMaintenance from "@/components/assetDetail/RepairMaintenance.vue";
|
|
|
+import RepairMaintenance from "@/components/equipmentFacilities/RepairMaintenance.vue";
|
|
|
import { queryEquipmentList } from "@/api/equipmentList.js";
|
|
|
import { getUpdateDetail1, getUpdateDetail4 } from "@/api/overview";
|
|
|
import moment from "moment";
|
|
|
Vue.use(NavBar).use(Tab).use(Tabs).use(Popup).use(Button).use(Toast);
|
|
|
export default {
|
|
|
- name: "AssetDetail",
|
|
|
+ name: "MaintenanceRecordView",
|
|
|
props: {},
|
|
|
- components: { Information, RepairMaintenance },
|
|
|
+ components: { RepairMaintenance },
|
|
|
computed: {
|
|
|
- ...mapGetters([
|
|
|
- "plazaId",
|
|
|
- "fmapID",
|
|
|
- "haveFengMap",
|
|
|
- "bunkObj",
|
|
|
- "floorsArr",
|
|
|
- "categoryId",
|
|
|
- ]),
|
|
|
+ ...mapGetters([ "plazaId", "smsxt" ]),
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
active: 0,
|
|
|
showPopup: false,
|
|
|
- isMaintenanceShow: true,
|
|
|
- isRepairShow: true,
|
|
|
- informationData: {},
|
|
|
maintenanceData: [],
|
|
|
repairData: [],
|
|
|
sfghpjList: [
|
|
@@ -144,52 +127,25 @@ export default {
|
|
|
* 点击右侧筛选
|
|
|
*/
|
|
|
handleRightClick() {
|
|
|
- if (this.active == 1 || this.active == 2) {
|
|
|
- this.showPopup = true;
|
|
|
- }
|
|
|
+ this.showPopup = true;
|
|
|
},
|
|
|
changeTab(active) {
|
|
|
console.log(this.active);
|
|
|
},
|
|
|
// 查询设备信息/维修/维保数据
|
|
|
getData() {
|
|
|
- if (this.active === 1) {
|
|
|
+ if (this.active === 0) {
|
|
|
//维保
|
|
|
this.getMaintenanceData();
|
|
|
- } else if (this.active === 2) {
|
|
|
+ } else if (this.active === 1) {
|
|
|
//维修
|
|
|
this.getRepairData();
|
|
|
}
|
|
|
},
|
|
|
- // 查询设备信息数据
|
|
|
- getInformationData() {
|
|
|
- let data = {
|
|
|
- plazaId: this.plazaId,
|
|
|
- keyword: `${this.$route.query.assetid}:assetid;`,
|
|
|
- },
|
|
|
- postParams = {};
|
|
|
- queryEquipmentList({ data, postParams }).then((res) => {
|
|
|
- if (res.data.result == "success" && res.data.data && res.data.data[0]) {
|
|
|
- this.informationData = res.data.data[0];
|
|
|
- this.getMaintenanceData(true);
|
|
|
- this.getRepairData(true);
|
|
|
- } else {
|
|
|
- Toast({
|
|
|
- message: "未查询到该设备内容!",
|
|
|
- type: "fail",
|
|
|
- duration: 2000,
|
|
|
- onClose: () => {
|
|
|
- this.$router.push({ path: "/" });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
// 查询维保数据
|
|
|
- getMaintenanceData(first) {
|
|
|
- if (this.informationData.assetnum) {
|
|
|
+ getMaintenanceData() {
|
|
|
let getParams = {
|
|
|
- assetnum: this.informationData.assetnum,
|
|
|
+ smsxt: this.smsxt,
|
|
|
plazaId: this.plazaId,
|
|
|
onlyMainAsset: true, //仅查询重要维修/维保
|
|
|
ismodel: this.isParts, //是否更换配件
|
|
@@ -286,22 +242,12 @@ export default {
|
|
|
} else {
|
|
|
this.maintenanceData = [];
|
|
|
}
|
|
|
- if (first) {
|
|
|
- this.isFinish++;
|
|
|
- }
|
|
|
- if (first && !this.maintenanceData.length) {
|
|
|
- this.isMaintenanceShow = false;
|
|
|
- }
|
|
|
});
|
|
|
- } else {
|
|
|
- console.error("缺少设备编号!");
|
|
|
- }
|
|
|
},
|
|
|
// 查询维修数据
|
|
|
- getRepairData(first) {
|
|
|
- if (this.informationData.assetnum) {
|
|
|
+ getRepairData() {
|
|
|
let getParams = {
|
|
|
- assetnum: this.informationData.assetnum,
|
|
|
+ smsxt: this.smsxt,
|
|
|
plazaId: this.plazaId,
|
|
|
onlyMainAsset: true, //仅查询重要维修/维保
|
|
|
ismodel: this.isParts, //是否更换配件
|
|
@@ -398,16 +344,7 @@ export default {
|
|
|
} else {
|
|
|
this.repairData = [];
|
|
|
}
|
|
|
- if (first) {
|
|
|
- this.isFinish++;
|
|
|
- }
|
|
|
- if (first && !this.repairData.length) {
|
|
|
- this.isRepairShow = false;
|
|
|
- }
|
|
|
});
|
|
|
- } else {
|
|
|
- console.error("缺少设备编号!");
|
|
|
- }
|
|
|
},
|
|
|
// 修改是否更换配件
|
|
|
isChangeParts(data) {
|
|
@@ -479,11 +416,10 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
watch: {
|
|
|
- "$route.query.assetid": {
|
|
|
- handler(assetid) {
|
|
|
- if (assetid) {
|
|
|
- this.getInformationData();
|
|
|
- }
|
|
|
+ "$route.path": {
|
|
|
+ handler(path) {
|
|
|
+ this.getMaintenanceData(true);
|
|
|
+ this.getRepairData(true);
|
|
|
},
|
|
|
immediate: true,
|
|
|
deep: true,
|