瀏覽代碼

2022-01-12 按钮权限添加

王克恕 3 年之前
父節點
當前提交
dc6caeb6f1

+ 5 - 5
imcs-ui/src/views/zuihou/lineSideLibrary/lineSideMgr/Index.vue

@@ -53,11 +53,11 @@
 		    <!-- 功能按钮 -->
 		    <el-row class="filter-container">
 		    	<el-col>
-			      <el-button type="primary" icon="el-icon-download" size="medium" @click="add">{{ $t("lineSide.buttons.warehousing") }}</el-button>
-			      <el-button type="success" icon="el-icon-download" size="medium" @click="editList">{{ $t("lineSide.buttons.warehousingList") }}</el-button>
-			      <el-button type="success" icon="el-icon-upload2" size="medium" @click="editOne">{{ $t("lineSide.buttons.rewuWarehousing") }}</el-button>
-			      <el-button type="success" icon="el-icon-unlock" size="medium" @click="unlockProd">{{ $t("lineSide.buttons.unlock") }}</el-button>
-			      <el-button type="danger" icon="el-icon-lock" size="medium" @click="lockingProd">{{ $t("lineSide.buttons.locking") }}</el-button>
+			      <el-button type="primary" icon="el-icon-download" size="medium" v-has-permission="['lineSide:stockin']" @click="add">{{ $t("lineSide.buttons.warehousing") }}</el-button>
+			      <el-button type="success" icon="el-icon-download" size="medium" v-has-permission="['lineSide:batchStockin']" @click="editList">{{ $t("lineSide.buttons.warehousingList") }}</el-button>
+			      <el-button type="success" icon="el-icon-upload2" size="medium" v-has-permission="['lineSide:taskStockin']" @click="editOne">{{ $t("lineSide.buttons.rewuWarehousing") }}</el-button>
+			      <el-button type="success" icon="el-icon-unlock" size="medium" v-has-permission="['lineSide:unlockStorge']" @click="unlockProd">{{ $t("lineSide.buttons.unlock") }}</el-button>
+			      <el-button type="danger" icon="el-icon-lock" size="medium" v-has-permission="['lineSide:lockStorge']" @click="lockingProd">{{ $t("lineSide.buttons.locking") }}</el-button>
 		    	</el-col>
 		    </el-row>
 				<!-- 列表数据 -->

+ 5 - 5
imcs-ui/src/views/zuihou/lineSideLibrary/lineSideMgr/components/warehouseProduct/Index.vue

@@ -5,11 +5,11 @@
 			<!-- 功能按钮 -->
 		    <el-row class="filter-container">
 		    	<el-col>
-			      <el-button type="success" icon="el-icon-download" size="medium" @click="editOne">{{ $t("lineSide.buttons.warehouseout") }}</el-button>
-			      <el-button type="success" icon="el-icon-upload2" size="medium" @click="editOne">{{ $t("lineSide.buttons.rewuWarehouseout") }}</el-button>
-			      <el-button type="success" icon="el-icon-unlock" size="medium" @click="unlockProd">{{ $t("lineSide.buttons.unlockProd") }}</el-button>
-			      <el-button type="danger" icon="el-icon-lock" size="medium" @click="lockingProd">{{ $t("lineSide.buttons.lockingProd") }}</el-button>
-			      <el-button type="danger" icon="el-icon-printer" size="medium" @click="printNoUnCode">{{ $t("lineSide.buttons.printNo") }}</el-button>
+			      <el-button type="success" icon="el-icon-download" size="medium" v-has-permission="['lineSide:stockout']" @click="editOne">{{ $t("lineSide.buttons.warehouseout") }}</el-button>
+			      <el-button type="success" icon="el-icon-upload2" size="medium" v-has-permission="['lineSide:batchStockout']" @click="editOne">{{ $t("lineSide.buttons.rewuWarehouseout") }}</el-button>
+			      <el-button type="success" icon="el-icon-unlock" size="medium" v-has-permission="['lineSide:unlockProduct']" @click="unlockProd">{{ $t("lineSide.buttons.unlockProd") }}</el-button>
+			      <el-button type="danger" icon="el-icon-lock" size="medium" v-has-permission="['lineSide:lockProduct']" @click="lockingProd">{{ $t("lineSide.buttons.lockingProd") }}</el-button>
+			      <el-button type="danger" icon="el-icon-printer" size="medium" v-has-permission="['lineSide:printNo']" @click="printNoUnCode">{{ $t("lineSide.buttons.printNo") }}</el-button>
 		    	</el-col>
 		    </el-row>
 				<!-- 列表数据 -->

+ 5 - 5
imcs-ui/src/views/zuihou/prepareProductMgr/bomMgr/Index.vue

@@ -50,18 +50,18 @@
 
     <el-row class="filter-container">
     	<el-col>
-    		<el-button type="primary" icon="el-icon-plus" size="medium" @click="add">
+    		<el-button type="primary" icon="el-icon-plus" size="medium" v-has-permission="['bom:add']" @click="add">
 	        {{ $t("table.add") }}
 	      </el-button>
-	      <el-button type="success" icon="el-icon-edit" size="medium" @click="editOne">
+	      <el-button type="success" icon="el-icon-edit" size="medium" v-has-permission="['bom:update']" @click="editOne">
 	        {{ $t("common.edit") }}
 	      </el-button>
-	      <el-button type="danger" icon="el-icon-delete" size="medium" @click="batchDelete">
+	      <el-button type="danger" icon="el-icon-delete" size="medium" v-has-permission="['bom:delete']" @click="batchDelete">
 	        {{ $t("table.delete") }}
 	      </el-button>
 <!--	      <el-button type="primary" icon="el-icon-finished" size="medium" @click="expandsEve()">{{$t("prepare.buttons.expandsEve")}}</el-button>-->
-	      <el-button type="primary" icon="el-icon-thumb" size="medium" @click="audioStatus('1')">{{$t("prepare.buttons.audioStatus")}}</el-button>
-	      <el-button type="primary" icon="el-icon-suitcase" size="medium" @click="audioBtn()">{{$t("prepare.buttons.audioBtn")}}</el-button>
+	      <el-button type="primary" icon="el-icon-thumb" size="medium" v-has-permission="['bom:examine']" @click="audioStatus('1')">{{$t("prepare.buttons.audioStatus")}}</el-button>
+	      <el-button type="primary" icon="el-icon-suitcase" size="medium" v-has-permission="['bom:exproduct']" @click="audioBtn()">{{$t("prepare.buttons.audioBtn")}}</el-button>
     	</el-col>
     </el-row>
 

+ 4 - 4
imcs-ui/src/views/zuihou/prepareProductMgr/frockMgr/Index.vue

@@ -40,15 +40,15 @@
     <!-- 功能按钮 -->
     <el-row class="filter-container">
     	<el-col>
-    		<el-button type="primary" icon="el-icon-plus" size="medium" @click="add">{{ $t("common.add") }}</el-button>
-	      <el-button type="success" icon="el-icon-edit" size="medium" @click="editOne">
+    		<el-button type="primary" icon="el-icon-plus" size="medium" v-has-permission="['frock:add']" @click="add">{{ $t("common.add") }}</el-button>
+	      <el-button type="success" icon="el-icon-edit" size="medium" v-has-permission="['frock:update']" @click="editOne">
 	        {{ $t("common.edit") }}
 	      </el-button>
-	      <el-button type="danger" icon="el-icon-delete" size="medium" @click="batchDelete">
+	      <el-button type="danger" icon="el-icon-delete" size="medium" v-has-permission="['frock:delete']" @click="batchDelete">
 	        {{ $t("table.delete") }}
 	      </el-button>
 	      <!-- 设置可存放托盘 -->
-	      <el-button type="success" icon="el-icon-edit" size="medium" @click="trayOne" v-show="false">
+	      <el-button type="success" icon="el-icon-edit" size="medium" v-has-permission="['frock:set']" @click="trayOne" v-show="false">
 	        {{ $t("lineSide.common.trayBtn") }}
 	      </el-button>
     	</el-col>

+ 3 - 3
imcs-ui/src/views/zuihou/prepareProductMgr/plateMgr/Index.vue

@@ -40,11 +40,11 @@
     <!-- 功能按钮 -->
     <el-row class="filter-container">
     	<el-col>
-    		<el-button type="primary" icon="el-icon-plus" size="medium" @click="add">{{ $t("common.add") }}</el-button>
-	      <el-button type="success" icon="el-icon-edit" size="medium" @click="editOne">
+    		<el-button type="primary" icon="el-icon-plus" size="medium" v-has-permission="['plate:add']" @click="add">{{ $t("common.add") }}</el-button>
+	      <el-button type="success" icon="el-icon-edit" size="medium" v-has-permission="['plate:update']" @click="editOne">
 	        {{ $t("common.edit") }}
 	      </el-button>
-	      <el-button type="danger" icon="el-icon-delete" size="medium" @click="batchDelete">
+	      <el-button type="danger" icon="el-icon-delete" size="medium" v-has-permission="['plate:delete']" @click="batchDelete">
 	        {{ $t("table.delete") }}
 	      </el-button>
     	</el-col>

+ 4 - 4
imcs-ui/src/views/zuihou/prepareProductMgr/toolsMaterial/Index.vue

@@ -40,15 +40,15 @@
     <!-- 功能按钮 -->
     <el-row class="filter-container">
     	<el-col>
-    		<el-button type="primary" icon="el-icon-plus" size="medium" @click="add">{{ $t("common.add") }}</el-button>
-	      <el-button type="success" icon="el-icon-edit" size="medium" @click="editOne">
+    		<el-button type="primary" icon="el-icon-plus" size="medium" v-has-permission="['toolsMaterial:add']" @click="add">{{ $t("common.add") }}</el-button>
+	      <el-button type="success" icon="el-icon-edit" size="medium" v-has-permission="['toolsMaterial:update']" @click="editOne">
 	        {{ $t("common.edit") }}
 	      </el-button>
-	      <el-button type="danger" icon="el-icon-delete" size="medium" @click="batchDelete">
+	      <el-button type="danger" icon="el-icon-delete" size="medium" v-has-permission="['toolsMaterial:delete']" @click="batchDelete">
 	        {{ $t("table.delete") }}
 	      </el-button>
 	      <!-- 设置可存放托盘 -->
-	      <el-button type="success" icon="el-icon-edit" size="medium" @click="trayOne">
+	      <el-button type="success" icon="el-icon-edit" size="medium" v-has-permission="['toolsMaterial:set']" @click="trayOne">
 	        {{ $t("lineSide.common.trayBtn") }}
 	      </el-button>
     	</el-col>

+ 349 - 346
imcs-ui/src/views/zuihou/repairManger/maintenanceLog/Index.vue

@@ -1,346 +1,349 @@
-<template>
-  <div class="app-container">
-    <!-- 功能按钮 -->
-    <el-row class="filter-container">
-      <el-col>
-        <!--添加按钮,调用add方法-->
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="medium"
-          @click="add"
-        >
-          {{ $t("common.add") }}
-        </el-button>
-        <!--修改按钮,调用edit-->
-        <el-button
-          type="success"
-          icon="el-icon-edit"
-          size="medium"
-          @click="editOne"
-        >
-          {{ $t("common.edit") }}
-        </el-button>
-        <el-button
-          type="danger"
-          icon="el-icon-delete"
-          size="medium"
-          @click="batchDelete"
-        >
-          {{ $t("table.delete") }}
-        </el-button>
-      </el-col>
-    </el-row>
-
-    <!-- 列表数据 -->
-    <el-table
-      :key="tableKey"
-      ref="table"
-      v-loading="loading"
-      :data="tableData.records"
-      border
-      fit
-      row-key="id"
-      style="width: 100%;"
-      @selection-change="onSelectChange"
-      @cell-click="cellClick"
-    >
-      <el-table-column
-        :label="$t(&quot;common.serialNo&quot;)"
-        width="55px"
-        align="center"
-      >
-        <template slot-scope="scope">
-          <div>
-            {{ scope.$index+(queryParams.current - 1) * queryParams.size + 1 }}
-          </div>
-        </template>
-      </el-table-column>
-      <el-table-column
-        align="center"
-        type="selection"
-        width="50"
-        :reserve-selection="true"
-      />
-      <!--维保日期-->
-      <el-table-column
-        prop="maintenanceTime"
-        :label="$t(&quot;resource.table.repair.maintenanceTime&quot;)"
-        :show-overflow-tooltip="true"
-      />
-      <!--维保内容-->
-      <el-table-column
-        prop="remark"
-        :label="$t(&quot;resource.table.repair.maintenanceContent&quot;)"
-        :show-overflow-tooltip="true"
-      />
-
-      <!--维保后设备状态-->
-      <el-table-column
-        prop="status"
-        :label="$t(&quot;resource.table.repair.maintenanceStatus&quot;)"
-        align="center"
-        width="90px"
-      >
-        <template slot-scope="{ row }">
-          <el-tag :type="row.status=='1' ? 'success' : 'danger'">
-            {{ row.status=='1' ? '正常' : '暂停使用' }}
-          </el-tag>
-        </template>
-      </el-table-column>
-
-      <!--维保人-->
-      <el-table-column
-        prop="maintenanceName"
-        :label="$t(&quot;resource.table.repair.maintenanceUser&quot;)"
-        :show-overflow-tooltip="true"
-        width="120"
-      />
-
-      <!--提交日期-->
-      <el-table-column
-        prop="createTime"
-        :label="$t(&quot;resource.table.repair.maintenanceCreateTime&quot;)"
-        width="180px"
-      />
-    </el-table>
-    <pagination
-      v-show="tableData.total > 0"
-      :limit.sync="queryParams.size"
-      :page.sync="queryParams.current"
-      :total="Number(tableData.total)"
-      @pagination="fetch"
-    />
-    <maintenance-edit
-      ref="edit"
-      :dialog-visible="dialog.isVisible"
-      :title="dialog.title"
-      @close="editClose"
-      @success="editSuccess"
-    />
-  </div>
-</template>
-
-<script>
-  // 【分页】组件
-  import Pagination from "@/components/Pagination"
-  // 【新增/修改】组件
-  import maintenanceEdit from "./components/Edit"
-  // 【维保详情管理】-API
-  import repairDetailApi from "@/api/resourceProductMgr/repairDetail"
-
-  // 【弹出框】elementui组件
-  import elDragDialog from '@/directive/el-drag-dialog'
-  // 共通函数
-  import {initQueryParams} from '@/utils/commons'
-
-  export default {
-    name: "ManintenanceLog",
-    directives: {elDragDialog},
-    components: {Pagination,maintenanceEdit},
-    props: {
-      maintenanceId: {
-        type:String,
-        default:''
-      }
-    },
-    data() {
-      return {
-        audioStatus: [],
-        equipmentVisible: false, // 设备维保记录管理
-        rowData: {}, // row数据
-        dialog: {
-          isVisible: false,
-          title: ""
-        },
-        tenantEvent:{
-          isVisible: false,
-          title: ""
-        },
-        preview: {
-          isVisible: false,
-          context: ''
-        },
-        tenantViewVisible: false,
-        tableKey: 0,
-        queryParams: initQueryParams({}),
-        selection: [],
-        loading: false,
-        tableData: {
-          total: 0
-        }
-      }
-    },
-    computed: {
-      currentUser() {
-        return this.$store.state.account.user
-      }
-    },
-    // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
-    created() {
-      // 调用常量-设备维保后状态
-      this.maintenanceStatus = this.$constWKS.MAINTENANCESTATUSLIST
-      // 加载列表数据
-      this.fetch()
-    },
-    mounted() {
-
-    },
-    methods: {
-      editClose() {
-        this.dialog.isVisible = false
-        this.search()
-      },
-      editSuccess() {
-        this.search()
-      },
-      onSelectChange(selection) {
-        this.selection = selection
-      },
-      search() {
-        this.fetch({
-          ...this.queryParams
-        })
-      },
-      reset() {
-        this.queryParams = initQueryParams({})
-        this.$refs.table.clearSort()
-        this.$refs.table.clearFilter()
-        this.search()
-      },
-      add() {
-        this.$refs.edit.type = "add"
-        this.$refs.edit.setMaintenanceInfo(this.maintenanceId,"add")
-        this.dialog.title = this.$t("common.add")
-        this.dialog.isVisible = true
-      },
-      singleDelete(row) {
-        this.$refs.table.clearSelection()
-        this.$refs.table.toggleRowSelection(row, true)
-        this.batchDelete()
-      },
-      batchDelete() {
-        if (!this.selection.length) {
-          this.$message({
-            message: this.$t("tips.noDataSelected"),
-            type: "warning"
-          })
-          return
-        }
-
-        this.$confirm(this.$t("wms.tips.delete"), this.$t("common.tips"), {
-          distinguishCancelAndClose: true,
-          confirmButtonText: this.$t("common.confirm"),
-          cancelButtonText: this.$t("common.cancel"),
-          type: "warning"
-        }).then(() => {
-          const ids = []
-          this.selection.forEach(item => {
-            ids.push(item.id)
-          })
-          this.delete(ids)
-        }).catch(() => {
-        })
-      },
-      clearSelections() {
-        this.$refs.table.clearSelection()
-      },
-      delete(ids) {
-        repairDetailApi.remove({ids: ids}).then(response => {
-          const res = response.data
-          if (res.isSuccess) {
-            this.$message({
-              message: this.$t("tips.deleteSuccess"),
-              type: "success"
-            })
-            this.search()
-            // 清理已经删除的数据
-            this.$refs.table.clearSelection()
-          }
-        })
-      },
-      view(row) {
-        this.$refs.view.setTenant(row)
-        this.tenantViewVisible = true
-      },
-      // 【修改】表头上Btn-事件
-      editOne() {
-        if (!this.selection.length) {
-          this.$message({
-            message: this.$t("tips.noDataSelected"),
-            type: "warning"
-          })
-          return
-        }
-        if (this.selection.length > 1) {
-          this.$message({
-            message: this.$t("tips.mustOne"),
-            type: "warning"
-          })
-          return
-        }
-        this.edit(this.selection[0]);
-      },
-      edit(row) {
-        this.$refs.edit.setMaintenanceInfo(row,"edit")
-        this.$refs.edit.type = "edit"
-        this.dialog.title = this.$t("common.edit")
-        this.dialog.isVisible = true
-      },
-      eventRow(row){
-        this.$refs.event.setTenant(row, this.dicts)
-        this.$refs.event.type = "event"
-        this.tenantEvent.title = "更新计划"
-        this.tenantEvent.isVisible = true
-      },
-      fetch(params = {}) {
-        // 刷新页面checkbox更新
-        this.tableKey = !this.tableKey
-        this.selection = []
-        this.loading = true
-        if (this.queryParams.timeRange) {
-          this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
-          this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
-        }
-
-        this.queryParams.current = params.current ? params.current : this.queryParams.current
-        this.queryParams.size = params.size ? params.size : this.queryParams.size
-        this.queryParams.model.repairId = this.maintenanceId
-        repairDetailApi.page(this.queryParams).then(response => {
-          const res = response.data
-          if (res.isSuccess) {
-            this.tableData = res.data
-          }
-          // eslint-disable-next-line no-return-assign
-        }).finally(() => this.loading = false)
-
-      },
-      cellClick(row, column) {
-        if (column['columnKey'] === "operation") {
-          return
-        }
-        let flag = false
-        this.selection.forEach((item) => {
-          if (item.id === row.id) {
-            flag = true
-            this.$refs.table.toggleRowSelection(row)
-          }
-        })
-
-        if (!flag) {
-          this.$refs.table.toggleRowSelection(row, true)
-        }
-      }
-    }
-  }
-</script>
-<style lang="scss" scoped>
-  .rowBtn {
-    margin: 0 5px;
-    color: #1890ff;
-  }
-
-  .rowBtn:hover {
-    opacity: 0.7;
-  }
-</style>
+<template>
+  <div class="app-container">
+    <!-- 功能按钮 -->
+    <el-row class="filter-container">
+      <el-col>
+        <!--添加按钮,调用add方法-->
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="medium"
+          v-has-permission="['maintenanceLog:add']"
+          @click="add"
+        >
+          {{ $t("common.add") }}
+        </el-button>
+        <!--修改按钮,调用edit-->
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="medium"
+          v-has-permission="['maintenanceLog:update']"
+          @click="editOne"
+        >
+          {{ $t("common.edit") }}
+        </el-button>
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="medium"
+          v-has-permission="['maintenanceLog:delete']"
+          @click="batchDelete"
+        >
+          {{ $t("table.delete") }}
+        </el-button>
+      </el-col>
+    </el-row>
+
+    <!-- 列表数据 -->
+    <el-table
+      :key="tableKey"
+      ref="table"
+      v-loading="loading"
+      :data="tableData.records"
+      border
+      fit
+      row-key="id"
+      style="width: 100%;"
+      @selection-change="onSelectChange"
+      @cell-click="cellClick"
+    >
+      <el-table-column
+        :label="$t(&quot;common.serialNo&quot;)"
+        width="55px"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div>
+            {{ scope.$index+(queryParams.current - 1) * queryParams.size + 1 }}
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        align="center"
+        type="selection"
+        width="50"
+        :reserve-selection="true"
+      />
+      <!--维保日期-->
+      <el-table-column
+        prop="maintenanceTime"
+        :label="$t(&quot;resource.table.repair.maintenanceTime&quot;)"
+        :show-overflow-tooltip="true"
+      />
+      <!--维保内容-->
+      <el-table-column
+        prop="remark"
+        :label="$t(&quot;resource.table.repair.maintenanceContent&quot;)"
+        :show-overflow-tooltip="true"
+      />
+
+      <!--维保后设备状态-->
+      <el-table-column
+        prop="status"
+        :label="$t(&quot;resource.table.repair.maintenanceStatus&quot;)"
+        align="center"
+        width="90px"
+      >
+        <template slot-scope="{ row }">
+          <el-tag :type="row.status=='1' ? 'success' : 'danger'">
+            {{ row.status=='1' ? '正常' : '暂停使用' }}
+          </el-tag>
+        </template>
+      </el-table-column>
+
+      <!--维保人-->
+      <el-table-column
+        prop="maintenanceName"
+        :label="$t(&quot;resource.table.repair.maintenanceUser&quot;)"
+        :show-overflow-tooltip="true"
+        width="120"
+      />
+
+      <!--提交日期-->
+      <el-table-column
+        prop="createTime"
+        :label="$t(&quot;resource.table.repair.maintenanceCreateTime&quot;)"
+        width="180px"
+      />
+    </el-table>
+    <pagination
+      v-show="tableData.total > 0"
+      :limit.sync="queryParams.size"
+      :page.sync="queryParams.current"
+      :total="Number(tableData.total)"
+      @pagination="fetch"
+    />
+    <maintenance-edit
+      ref="edit"
+      :dialog-visible="dialog.isVisible"
+      :title="dialog.title"
+      @close="editClose"
+      @success="editSuccess"
+    />
+  </div>
+</template>
+
+<script>
+  // 【分页】组件
+  import Pagination from "@/components/Pagination"
+  // 【新增/修改】组件
+  import maintenanceEdit from "./components/Edit"
+  // 【维保详情管理】-API
+  import repairDetailApi from "@/api/resourceProductMgr/repairDetail"
+
+  // 【弹出框】elementui组件
+  import elDragDialog from '@/directive/el-drag-dialog'
+  // 共通函数
+  import {initQueryParams} from '@/utils/commons'
+
+  export default {
+    name: "ManintenanceLog",
+    directives: {elDragDialog},
+    components: {Pagination,maintenanceEdit},
+    props: {
+      maintenanceId: {
+        type:String,
+        default:''
+      }
+    },
+    data() {
+      return {
+        audioStatus: [],
+        equipmentVisible: false, // 设备维保记录管理
+        rowData: {}, // row数据
+        dialog: {
+          isVisible: false,
+          title: ""
+        },
+        tenantEvent:{
+          isVisible: false,
+          title: ""
+        },
+        preview: {
+          isVisible: false,
+          context: ''
+        },
+        tenantViewVisible: false,
+        tableKey: 0,
+        queryParams: initQueryParams({}),
+        selection: [],
+        loading: false,
+        tableData: {
+          total: 0
+        }
+      }
+    },
+    computed: {
+      currentUser() {
+        return this.$store.state.account.user
+      }
+    },
+    // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+    created() {
+      // 调用常量-设备维保后状态
+      this.maintenanceStatus = this.$constWKS.MAINTENANCESTATUSLIST
+      // 加载列表数据
+      this.fetch()
+    },
+    mounted() {
+
+    },
+    methods: {
+      editClose() {
+        this.dialog.isVisible = false
+        this.search()
+      },
+      editSuccess() {
+        this.search()
+      },
+      onSelectChange(selection) {
+        this.selection = selection
+      },
+      search() {
+        this.fetch({
+          ...this.queryParams
+        })
+      },
+      reset() {
+        this.queryParams = initQueryParams({})
+        this.$refs.table.clearSort()
+        this.$refs.table.clearFilter()
+        this.search()
+      },
+      add() {
+        this.$refs.edit.type = "add"
+        this.$refs.edit.setMaintenanceInfo(this.maintenanceId,"add")
+        this.dialog.title = this.$t("common.add")
+        this.dialog.isVisible = true
+      },
+      singleDelete(row) {
+        this.$refs.table.clearSelection()
+        this.$refs.table.toggleRowSelection(row, true)
+        this.batchDelete()
+      },
+      batchDelete() {
+        if (!this.selection.length) {
+          this.$message({
+            message: this.$t("tips.noDataSelected"),
+            type: "warning"
+          })
+          return
+        }
+
+        this.$confirm(this.$t("wms.tips.delete"), this.$t("common.tips"), {
+          distinguishCancelAndClose: true,
+          confirmButtonText: this.$t("common.confirm"),
+          cancelButtonText: this.$t("common.cancel"),
+          type: "warning"
+        }).then(() => {
+          const ids = []
+          this.selection.forEach(item => {
+            ids.push(item.id)
+          })
+          this.delete(ids)
+        }).catch(() => {
+        })
+      },
+      clearSelections() {
+        this.$refs.table.clearSelection()
+      },
+      delete(ids) {
+        repairDetailApi.remove({ids: ids}).then(response => {
+          const res = response.data
+          if (res.isSuccess) {
+            this.$message({
+              message: this.$t("tips.deleteSuccess"),
+              type: "success"
+            })
+            this.search()
+            // 清理已经删除的数据
+            this.$refs.table.clearSelection()
+          }
+        })
+      },
+      view(row) {
+        this.$refs.view.setTenant(row)
+        this.tenantViewVisible = true
+      },
+      // 【修改】表头上Btn-事件
+      editOne() {
+        if (!this.selection.length) {
+          this.$message({
+            message: this.$t("tips.noDataSelected"),
+            type: "warning"
+          })
+          return
+        }
+        if (this.selection.length > 1) {
+          this.$message({
+            message: this.$t("tips.mustOne"),
+            type: "warning"
+          })
+          return
+        }
+        this.edit(this.selection[0]);
+      },
+      edit(row) {
+        this.$refs.edit.setMaintenanceInfo(row,"edit")
+        this.$refs.edit.type = "edit"
+        this.dialog.title = this.$t("common.edit")
+        this.dialog.isVisible = true
+      },
+      eventRow(row){
+        this.$refs.event.setTenant(row, this.dicts)
+        this.$refs.event.type = "event"
+        this.tenantEvent.title = "更新计划"
+        this.tenantEvent.isVisible = true
+      },
+      fetch(params = {}) {
+        // 刷新页面checkbox更新
+        this.tableKey = !this.tableKey
+        this.selection = []
+        this.loading = true
+        if (this.queryParams.timeRange) {
+          this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
+          this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
+        }
+
+        this.queryParams.current = params.current ? params.current : this.queryParams.current
+        this.queryParams.size = params.size ? params.size : this.queryParams.size
+        this.queryParams.model.repairId = this.maintenanceId
+        repairDetailApi.page(this.queryParams).then(response => {
+          const res = response.data
+          if (res.isSuccess) {
+            this.tableData = res.data
+          }
+          // eslint-disable-next-line no-return-assign
+        }).finally(() => this.loading = false)
+
+      },
+      cellClick(row, column) {
+        if (column['columnKey'] === "operation") {
+          return
+        }
+        let flag = false
+        this.selection.forEach((item) => {
+          if (item.id === row.id) {
+            flag = true
+            this.$refs.table.toggleRowSelection(row)
+          }
+        })
+
+        if (!flag) {
+          this.$refs.table.toggleRowSelection(row, true)
+        }
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .rowBtn {
+    margin: 0 5px;
+    color: #1890ff;
+  }
+
+  .rowBtn:hover {
+    opacity: 0.7;
+  }
+</style>

+ 555 - 552
imcs-ui/src/views/zuihou/repairManger/repair/Index.vue

@@ -1,552 +1,555 @@
-<template>
-  <div class="app-container">
-    <!-- 搜索模块 -->
-    <div class="filter-container">
-      <!--设备名称-->
-      <span>
-        <span>{{ $t("resource.table.repair.productionresourceName") }}:</span>
-        <el-input
-          v-model="queryParams.model.productionresourceName"
-          :placeholder="$t(&quot;common.pleaseEnter&quot;)"
-          style="width: 150px;"
-          size="medium"
-        />
-      </span>
-      <!--设备编号-->
-      <span>
-        <span>{{ $t("resource.table.repair.code") }}:</span>
-        <el-input
-          v-model="queryParams.model.code"
-          :placeholder="$t(&quot;common.pleaseEnter&quot;)"
-          style="width: 150px;"
-          size="medium"
-        />
-      </span>
-      <span style="margin-left: 15px;">
-        <el-button
-          plain
-          type="primary"
-          icon="el-icon-search"
-          size="medium"
-          @click="search"
-        >
-          {{ $t("table.search") }}
-        </el-button>
-        <el-button
-          plain
-          type="warning"
-          icon="el-icon-refresh"
-          size="medium"
-          @click="reset"
-        >
-          {{ $t("table.reset") }}
-        </el-button>
-      </span>
-    </div>
-
-    <!-- 功能按钮 -->
-    <el-row class="filter-container">
-      <el-col>
-        <!--添加按钮,调用add方法-->
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="medium"
-          @click="add"
-        >
-          {{ $t("common.add") }}
-        </el-button>
-        <!--修改按钮,调用edit-->
-        <el-button
-          type="success"
-          icon="el-icon-edit"
-          size="medium"
-          @click="editOne"
-        >
-          {{ $t("common.edit") }}
-        </el-button>
-        <el-button
-          type="danger"
-          icon="el-icon-delete"
-          size="medium"
-          @click="batchDelete"
-        >
-          {{ $t("table.delete") }}
-        </el-button>
-      </el-col>
-    </el-row>
-
-    <!-- 列表数据 -->
-    <el-table
-      :key="tableKey"
-      ref="table"
-      v-loading="loading"
-      :data="tableData.records"
-      border
-      fit
-      row-key="id"
-      style="width: 100%;"
-      @selection-change="onSelectChange"
-      @cell-click="cellClick"
-    >
-      <el-table-column
-        :label="$t(&quot;common.serialNo&quot;)"
-        width="55px"
-        align="center"
-      >
-        <template slot-scope="scope">
-          <div>
-            {{ scope.$index+(queryParams.current - 1) * queryParams.size + 1 }}
-          </div>
-        </template>
-      </el-table-column>
-      <el-table-column
-        align="center"
-        type="selection"
-        width="50"
-        :reserve-selection="true"
-      />
-      <!--设备编号-->
-      <el-table-column
-        prop="code"
-        :label="$t(&quot;resource.table.repair.code&quot;)"
-        :show-overflow-tooltip="true"
-      />
-      <!--设备名称-->
-      <el-table-column
-        prop="productionresourceName"
-        :label="$t(&quot;resource.table.repair.productionresourceName&quot;)"
-        :show-overflow-tooltip="true"
-      />
-      <!--所在产线-->
-      <el-table-column
-        prop="lineDesc"
-        :label="$t(&quot;resource.table.repair.lineDesc&quot;)"
-        :show-overflow-tooltip="true"
-        width="120"
-      />
-      <!--维修倒计时进度-->
-      <el-table-column
-        prop="downTime"
-        :label="$t(&quot;resource.table.repair.countdown&quot;)"
-        :show-overflow-tooltip="true"
-        width="200"
-        align="center"
-      >
-        <template slot-scope="{ row }" id="">
-          <el-progress
-            :text-inside="true"
-            :stroke-width="24"
-            :percentage="row.process"
-            show-text="true"
-            :format="setItemText(row)"
-            :color="setItemColor(row)"
-          />
-        </template>
-      </el-table-column>
-      <!--维保结束时间-->
-      <el-table-column
-        prop="repairEndTime"
-        :label="$t(&quot;resource.table.repair.repairEndTime&quot;)"
-        :show-overflow-tooltip="true"
-        width="120"
-      />
-      <!--维修状态-->
-      <el-table-column
-        prop="repairStatus"
-        :label="$t(&quot;resource.table.repair.repairStatus&quot;)"
-        align="center"
-        width="90px"
-      >
-        <template slot-scope="{ row }">
-          <el-tag :type="row.repairStatus=='1' ? 'success' : 'danger'">
-            {{ row.repairStatus=='1' ? '正常' : '待维修' }}
-          </el-tag>
-        </template>
-      </el-table-column>
-      <!--状态-->
-      <el-table-column
-        prop="status"
-        :label="$t(&quot;resource.table.repair.status&quot;)"
-        align="center"
-        width="90px"
-      >
-        <template slot-scope="{ row }">
-          <el-tag :type="row.status=='1' ? 'success' : 'danger'">
-            {{ row.status=='1' ? '启用' : '冻结' }}
-          </el-tag>
-        </template>
-      </el-table-column>
-      <!--创建时间-->
-      <el-table-column
-        prop="createTime"
-        :label="$t(&quot;resource.table.repair.createTime&quot;)"
-        width="180px"
-      />
-      <!--最新修改时间-->
-      <el-table-column
-        prop="updateTime"
-        :label="$t(&quot;resource.table.repair.updateTime&quot;)"
-        width="180px"
-      />
-      <!--操作人-->
-      <el-table-column
-        prop="operationName"
-        :label="$t(&quot;resource.table.repair.createUserDesc&quot;)"
-        width="180px"
-      />
-      <!--操作-->
-      <el-table-column
-        :label="$t('table.operation')"
-        fixed="right"
-        align="center"
-        column-key="operation"
-        width="260px"
-      >
-        <template slot-scope="{ row }">
-          <a
-            class="rowBtn"
-            @click="equipment(row)"
-          >登记维保</a>
-          <a
-            class="rowBtn"
-            @click="eventRow(row)"
-          >更新计划</a>
-          <a
-            class="rowBtn"
-            @click="edit(row)"
-          >修改</a>
-          <a
-            class="rowBtn"
-            @click="singleDelete(row)"
-          >删除</a>
-        </template>
-      </el-table-column>
-    </el-table>
-    <pagination
-      v-show="tableData.total > 0"
-      :limit.sync="queryParams.size"
-      :page.sync="queryParams.current"
-      :total="Number(tableData.total)"
-      @pagination="fetch"
-    />
-    <tenant-edit
-      ref="edit"
-      :dialog-visible="dialog.isVisible"
-      :title="dialog.title"
-      @close="editClose"
-      @success="editSuccess"
-    />
-    <tenant-event
-      ref="event"
-      :dialog-visible="tenantEvent.isVisible"
-      :title="tenantEvent.title"
-      @close="eventClose"
-      @success="eventSuccess"
-    />
-    <tenant-view
-      ref="view"
-      :dialog-visible="tenantViewVisible"
-      @close="viewClose"
-    />
-    <el-dialog
-      v-el-drag-dialog
-      :close-on-click-modal="false"
-      :close-on-press-escape="true"
-      title="预览"
-      width="80%"
-      top="50px"
-      :visible.sync="preview.isVisible"
-    >
-      <el-scrollbar>
-        <div v-html="preview.context" />
-      </el-scrollbar>
-    </el-dialog>
-    <el-dialog
-      :visible.sync="equipmentVisible"
-      width="80%"
-      custom-class="dialogNoTop"
-      @close="editEquipmentClose"
-    >
-      <!--【	维保】 -->
-      <maintenanceLog
-        :row-data="rowData"
-        :maintenance-id="maintenanceId"
-        @close="editEquipmentClose"
-        @success="editEquipmentSuccess"
-      />
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-  // 【分页】组件
-  import Pagination from "@/components/Pagination"
-  // 【新增/修改】组件
-  import TenantEdit from "./components/Edit"
-  //【更新/计划】组件
-  import TenantEvent from "./components/Event"
-  // 【查看】组件
-  import TenantView from "./components/View"
-  // 【维保计划管理】-API
-  import repairApi from "@/api/resourceProductMgr/repair"
-  // 【工作位置管理】组件
-  import maintenanceLog from "@/views/zuihou/repairManger/maintenanceLog/Index"
-
-  // 【弹出框】elementui组件
-  import elDragDialog from '@/directive/el-drag-dialog'
-
-  import VueProgressBar from 'vue-progressbar'
-  // 共通函数
-  import {downloadFile, initEnums, initDicts, initQueryParams} from '@/utils/commons'
-
-  export default {
-    name: "Repair",
-    directives: {elDragDialog},
-    components: {Pagination, TenantEdit, TenantView,TenantEvent,maintenanceLog},
-    props: {},
-    data() {
-      return {
-        maintenanceId:'',
-        audioStatus: [],
-        equipmentVisible: false, // 设备维保记录管理
-        rowData: {}, // row数据
-        dialog: {
-          isVisible: false,
-          title: ""
-        },
-        tenantEvent:{
-          isVisible: false,
-          title: ""
-        },
-        preview: {
-          isVisible: false,
-          context: ''
-        },
-        tenantViewVisible: false,
-        tableKey: 0,
-        queryParams: initQueryParams({}),
-        selection: [],
-        loading: false,
-        tableData: {
-          total: 0
-        },
-        dicts: {
-          NATION: {}
-        },
-        enums: {
-          TenantTypeEnum: {},
-          TenantStatusEnum: {}
-        }
-      }
-    },
-    computed: {
-      currentUser() {
-        return this.$store.state.account.user
-      },
-      nationList() {
-        return convertEnum(this.dicts.NATION)
-      }
-    },
-    // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
-    created() {
-      // 调用常量-审核状态
-      this.audioStatus = this.$constWKS.SHOWHIDE
-      // 加载【字典】
-      initDicts(['NATION'], this.dicts);
-      // 加载列表数据
-      this.fetch()
-    },
-    mounted() {
-
-    },
-    methods: {
-      //【设备维保记录】按钮-事件
-      equipment(row){
-        this.maintenanceId = row.id
-        this.equipmentVisible = true
-      },
-      editEquipmentClose(){
-        this.equipmentVisible = false
-        this.search()
-      },
-      editEquipmentSuccess(){
-        this.search()
-      },
-      setItemText(row) {
-        return () => {
-          return row.downTime
-        }
-      },
-      setItemColor(row) {
-        return () => {
-            if(row.expireFlag == 1){
-              return '#FF0000'
-            }
-        }
-      },
-      viewClose() {
-        this.tenantViewVisible = false
-      },
-      editClose() {
-        this.dialog.isVisible = false
-        this.fetch()
-      },
-      eventClose() {
-        this.tenantEvent.isVisible = false
-        this.fetch()
-      },
-      editSuccess() {
-        this.search()
-      },
-      eventSuccess(){
-        this.search()
-      },
-      onSelectChange(selection) {
-        this.selection = selection
-      },
-      search() {
-        this.fetch({
-          ...this.queryParams
-        })
-      },
-      reset() {
-        this.queryParams = initQueryParams({})
-        this.$refs.table.clearSort()
-        this.$refs.table.clearFilter()
-        this.search()
-      },
-      add() {
-        this.$refs.edit.type = "add"
-        this.$refs.edit.setTenant(false, this.dicts)
-        this.dialog.title = this.$t("common.add")
-        this.dialog.isVisible = true
-      },
-      singleDelete(row) {
-        this.$refs.table.clearSelection()
-        this.$refs.table.toggleRowSelection(row, true)
-        this.batchDelete()
-      },
-      batchDelete() {
-        if (!this.selection.length) {
-          this.$message({
-            message: this.$t("tips.noDataSelected"),
-            type: "warning"
-          })
-          return
-        }
-
-        this.$confirm(this.$t("wms.tips.delete"), this.$t("common.tips"), {
-          distinguishCancelAndClose: true,
-          confirmButtonText: this.$t("common.confirm"),
-          cancelButtonText: this.$t("common.cancel"),
-          type: "warning"
-        }).then(() => {
-          const ids = []
-          this.selection.forEach(item => {
-            ids.push(item.id)
-          })
-          this.delete(ids)
-        }).catch(() => {
-        })
-      },
-      clearSelections() {
-        this.$refs.table.clearSelection()
-      },
-      delete(ids) {
-        repairApi.remove({ids: ids}).then(response => {
-          const res = response.data
-          if (res.isSuccess) {
-            this.$message({
-              message: this.$t("tips.deleteSuccess"),
-              type: "success"
-            })
-            this.search()
-            // 清理已经删除的数据
-            this.$refs.table.clearSelection()
-          }
-        })
-      },
-      view(row) {
-        this.$refs.view.setTenant(row)
-        this.tenantViewVisible = true
-      },
-      // 【修改】表头上Btn-事件
-      editOne() {
-        if (!this.selection.length) {
-          this.$message({
-            message: this.$t("tips.noDataSelected"),
-            type: "warning"
-          })
-          return
-        }
-        if (this.selection.length > 1) {
-          this.$message({
-            message: this.$t("tips.mustOne"),
-            type: "warning"
-          })
-          return
-        }
-        this.edit(this.selection[0]);
-      },
-      edit(row) {
-        this.$refs.edit.setTenant(row, this.dicts)
-        this.$refs.edit.type = "edit"
-        this.dialog.title = this.$t("common.edit")
-        this.dialog.isVisible = true
-      },
-      eventRow(row){
-        this.$refs.event.setTenant(row, this.dicts)
-        this.$refs.event.type = "event"
-        this.tenantEvent.title = "更新计划"
-        this.tenantEvent.isVisible = true
-      },
-      fetch(params = {}) {
-        this.tableKey = !this.tableKey
-        this.selection = []
-        this.loading = true
-        if (this.queryParams.timeRange) {
-          this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
-          this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
-        }
-
-        this.queryParams.current = params.current ? params.current : this.queryParams.current
-        this.queryParams.size = params.size ? params.size : this.queryParams.size
-        repairApi.page(this.queryParams).then(response => {
-          const res = response.data
-          if (res.isSuccess) {
-            this.tableData = res.data
-          }
-          // eslint-disable-next-line no-return-assign
-        }).finally(() => this.loading = false)
-
-      },
-      cellClick(row, column) {
-        if (column['columnKey'] === "operation") {
-          return
-        }
-        let flag = false
-        this.selection.forEach((item) => {
-          if (item.id === row.id) {
-            flag = true
-            this.$refs.table.toggleRowSelection(row)
-          }
-        })
-
-        if (!flag) {
-          this.$refs.table.toggleRowSelection(row, true)
-        }
-      }
-    }
-  }
-</script>
-<style lang="scss" scoped>
-  .rowBtn {
-    margin: 0 5px;
-    color: #1890ff;
-  }
-
-  .rowBtn:hover {
-    opacity: 0.7;
-  }
-</style>
+<template>
+  <div class="app-container">
+    <!-- 搜索模块 -->
+    <div class="filter-container">
+      <!--设备名称-->
+      <span>
+        <span>{{ $t("resource.table.repair.productionresourceName") }}:</span>
+        <el-input
+          v-model="queryParams.model.productionresourceName"
+          :placeholder="$t(&quot;common.pleaseEnter&quot;)"
+          style="width: 150px;"
+          size="medium"
+        />
+      </span>
+      <!--设备编号-->
+      <span>
+        <span>{{ $t("resource.table.repair.code") }}:</span>
+        <el-input
+          v-model="queryParams.model.code"
+          :placeholder="$t(&quot;common.pleaseEnter&quot;)"
+          style="width: 150px;"
+          size="medium"
+        />
+      </span>
+      <span style="margin-left: 15px;">
+        <el-button
+          plain
+          type="primary"
+          icon="el-icon-search"
+          size="medium"
+          @click="search"
+        >
+          {{ $t("table.search") }}
+        </el-button>
+        <el-button
+          plain
+          type="warning"
+          icon="el-icon-refresh"
+          size="medium"
+          @click="reset"
+        >
+          {{ $t("table.reset") }}
+        </el-button>
+      </span>
+    </div>
+
+    <!-- 功能按钮 -->
+    <el-row class="filter-container">
+      <el-col>
+        <!--添加按钮,调用add方法-->
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="medium"
+          v-has-permission="['repair:add']"
+          @click="add"
+        >
+          {{ $t("common.add") }}
+        </el-button>
+        <!--修改按钮,调用edit-->
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="medium"
+          v-has-permission="['repair:update']"
+          @click="editOne"
+        >
+          {{ $t("common.edit") }}
+        </el-button>
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="medium"
+          v-has-permission="['repair:delete']"
+          @click="batchDelete"
+        >
+          {{ $t("table.delete") }}
+        </el-button>
+      </el-col>
+    </el-row>
+
+    <!-- 列表数据 -->
+    <el-table
+      :key="tableKey"
+      ref="table"
+      v-loading="loading"
+      :data="tableData.records"
+      border
+      fit
+      row-key="id"
+      style="width: 100%;"
+      @selection-change="onSelectChange"
+      @cell-click="cellClick"
+    >
+      <el-table-column
+        :label="$t(&quot;common.serialNo&quot;)"
+        width="55px"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <div>
+            {{ scope.$index+(queryParams.current - 1) * queryParams.size + 1 }}
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        align="center"
+        type="selection"
+        width="50"
+        :reserve-selection="true"
+      />
+      <!--设备编号-->
+      <el-table-column
+        prop="code"
+        :label="$t(&quot;resource.table.repair.code&quot;)"
+        :show-overflow-tooltip="true"
+      />
+      <!--设备名称-->
+      <el-table-column
+        prop="productionresourceName"
+        :label="$t(&quot;resource.table.repair.productionresourceName&quot;)"
+        :show-overflow-tooltip="true"
+      />
+      <!--所在产线-->
+      <el-table-column
+        prop="lineDesc"
+        :label="$t(&quot;resource.table.repair.lineDesc&quot;)"
+        :show-overflow-tooltip="true"
+        width="120"
+      />
+      <!--维修倒计时进度-->
+      <el-table-column
+        prop="downTime"
+        :label="$t(&quot;resource.table.repair.countdown&quot;)"
+        :show-overflow-tooltip="true"
+        width="200"
+        align="center"
+      >
+        <template slot-scope="{ row }" id="">
+          <el-progress
+            :text-inside="true"
+            :stroke-width="24"
+            :percentage="row.process"
+            show-text="true"
+            :format="setItemText(row)"
+            :color="setItemColor(row)"
+          />
+        </template>
+      </el-table-column>
+      <!--维保结束时间-->
+      <el-table-column
+        prop="repairEndTime"
+        :label="$t(&quot;resource.table.repair.repairEndTime&quot;)"
+        :show-overflow-tooltip="true"
+        width="120"
+      />
+      <!--维修状态-->
+      <el-table-column
+        prop="repairStatus"
+        :label="$t(&quot;resource.table.repair.repairStatus&quot;)"
+        align="center"
+        width="90px"
+      >
+        <template slot-scope="{ row }">
+          <el-tag :type="row.repairStatus=='1' ? 'success' : 'danger'">
+            {{ row.repairStatus=='1' ? '正常' : '待维修' }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <!--状态-->
+      <el-table-column
+        prop="status"
+        :label="$t(&quot;resource.table.repair.status&quot;)"
+        align="center"
+        width="90px"
+      >
+        <template slot-scope="{ row }">
+          <el-tag :type="row.status=='1' ? 'success' : 'danger'">
+            {{ row.status=='1' ? '启用' : '冻结' }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <!--创建时间-->
+      <el-table-column
+        prop="createTime"
+        :label="$t(&quot;resource.table.repair.createTime&quot;)"
+        width="180px"
+      />
+      <!--最新修改时间-->
+      <el-table-column
+        prop="updateTime"
+        :label="$t(&quot;resource.table.repair.updateTime&quot;)"
+        width="180px"
+      />
+      <!--操作人-->
+      <el-table-column
+        prop="operationName"
+        :label="$t(&quot;resource.table.repair.createUserDesc&quot;)"
+        width="180px"
+      />
+      <!--操作-->
+      <el-table-column
+        :label="$t('table.operation')"
+        fixed="right"
+        align="center"
+        column-key="operation"
+        width="260px"
+      >
+        <template slot-scope="{ row }">
+          <a
+            class="rowBtn"
+            @click="equipment(row)"
+          >登记维保</a>
+          <a
+            class="rowBtn"
+            @click="eventRow(row)"
+          >更新计划</a>
+          <a
+            class="rowBtn"
+            @click="edit(row)"
+          >修改</a>
+          <a
+            class="rowBtn"
+            @click="singleDelete(row)"
+          >删除</a>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="tableData.total > 0"
+      :limit.sync="queryParams.size"
+      :page.sync="queryParams.current"
+      :total="Number(tableData.total)"
+      @pagination="fetch"
+    />
+    <tenant-edit
+      ref="edit"
+      :dialog-visible="dialog.isVisible"
+      :title="dialog.title"
+      @close="editClose"
+      @success="editSuccess"
+    />
+    <tenant-event
+      ref="event"
+      :dialog-visible="tenantEvent.isVisible"
+      :title="tenantEvent.title"
+      @close="eventClose"
+      @success="eventSuccess"
+    />
+    <tenant-view
+      ref="view"
+      :dialog-visible="tenantViewVisible"
+      @close="viewClose"
+    />
+    <el-dialog
+      v-el-drag-dialog
+      :close-on-click-modal="false"
+      :close-on-press-escape="true"
+      title="预览"
+      width="80%"
+      top="50px"
+      :visible.sync="preview.isVisible"
+    >
+      <el-scrollbar>
+        <div v-html="preview.context" />
+      </el-scrollbar>
+    </el-dialog>
+    <el-dialog
+      :visible.sync="equipmentVisible"
+      width="80%"
+      custom-class="dialogNoTop"
+      @close="editEquipmentClose"
+    >
+      <!--【	维保】 -->
+      <maintenanceLog
+        :row-data="rowData"
+        :maintenance-id="maintenanceId"
+        @close="editEquipmentClose"
+        @success="editEquipmentSuccess"
+      />
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  // 【分页】组件
+  import Pagination from "@/components/Pagination"
+  // 【新增/修改】组件
+  import TenantEdit from "./components/Edit"
+  //【更新/计划】组件
+  import TenantEvent from "./components/Event"
+  // 【查看】组件
+  import TenantView from "./components/View"
+  // 【维保计划管理】-API
+  import repairApi from "@/api/resourceProductMgr/repair"
+  // 【工作位置管理】组件
+  import maintenanceLog from "@/views/zuihou/repairManger/maintenanceLog/Index"
+
+  // 【弹出框】elementui组件
+  import elDragDialog from '@/directive/el-drag-dialog'
+
+  import VueProgressBar from 'vue-progressbar'
+  // 共通函数
+  import {downloadFile, initEnums, initDicts, initQueryParams} from '@/utils/commons'
+
+  export default {
+    name: "Repair",
+    directives: {elDragDialog},
+    components: {Pagination, TenantEdit, TenantView,TenantEvent,maintenanceLog},
+    props: {},
+    data() {
+      return {
+        maintenanceId:'',
+        audioStatus: [],
+        equipmentVisible: false, // 设备维保记录管理
+        rowData: {}, // row数据
+        dialog: {
+          isVisible: false,
+          title: ""
+        },
+        tenantEvent:{
+          isVisible: false,
+          title: ""
+        },
+        preview: {
+          isVisible: false,
+          context: ''
+        },
+        tenantViewVisible: false,
+        tableKey: 0,
+        queryParams: initQueryParams({}),
+        selection: [],
+        loading: false,
+        tableData: {
+          total: 0
+        },
+        dicts: {
+          NATION: {}
+        },
+        enums: {
+          TenantTypeEnum: {},
+          TenantStatusEnum: {}
+        }
+      }
+    },
+    computed: {
+      currentUser() {
+        return this.$store.state.account.user
+      },
+      nationList() {
+        return convertEnum(this.dicts.NATION)
+      }
+    },
+    // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+    created() {
+      // 调用常量-审核状态
+      this.audioStatus = this.$constWKS.SHOWHIDE
+      // 加载【字典】
+      initDicts(['NATION'], this.dicts);
+      // 加载列表数据
+      this.fetch()
+    },
+    mounted() {
+
+    },
+    methods: {
+      //【设备维保记录】按钮-事件
+      equipment(row){
+        this.maintenanceId = row.id
+        this.equipmentVisible = true
+      },
+      editEquipmentClose(){
+        this.equipmentVisible = false
+        this.search()
+      },
+      editEquipmentSuccess(){
+        this.search()
+      },
+      setItemText(row) {
+        return () => {
+          return row.downTime
+        }
+      },
+      setItemColor(row) {
+        return () => {
+            if(row.expireFlag == 1){
+              return '#FF0000'
+            }
+        }
+      },
+      viewClose() {
+        this.tenantViewVisible = false
+      },
+      editClose() {
+        this.dialog.isVisible = false
+        this.fetch()
+      },
+      eventClose() {
+        this.tenantEvent.isVisible = false
+        this.fetch()
+      },
+      editSuccess() {
+        this.search()
+      },
+      eventSuccess(){
+        this.search()
+      },
+      onSelectChange(selection) {
+        this.selection = selection
+      },
+      search() {
+        this.fetch({
+          ...this.queryParams
+        })
+      },
+      reset() {
+        this.queryParams = initQueryParams({})
+        this.$refs.table.clearSort()
+        this.$refs.table.clearFilter()
+        this.search()
+      },
+      add() {
+        this.$refs.edit.type = "add"
+        this.$refs.edit.setTenant(false, this.dicts)
+        this.dialog.title = this.$t("common.add")
+        this.dialog.isVisible = true
+      },
+      singleDelete(row) {
+        this.$refs.table.clearSelection()
+        this.$refs.table.toggleRowSelection(row, true)
+        this.batchDelete()
+      },
+      batchDelete() {
+        if (!this.selection.length) {
+          this.$message({
+            message: this.$t("tips.noDataSelected"),
+            type: "warning"
+          })
+          return
+        }
+
+        this.$confirm(this.$t("wms.tips.delete"), this.$t("common.tips"), {
+          distinguishCancelAndClose: true,
+          confirmButtonText: this.$t("common.confirm"),
+          cancelButtonText: this.$t("common.cancel"),
+          type: "warning"
+        }).then(() => {
+          const ids = []
+          this.selection.forEach(item => {
+            ids.push(item.id)
+          })
+          this.delete(ids)
+        }).catch(() => {
+        })
+      },
+      clearSelections() {
+        this.$refs.table.clearSelection()
+      },
+      delete(ids) {
+        repairApi.remove({ids: ids}).then(response => {
+          const res = response.data
+          if (res.isSuccess) {
+            this.$message({
+              message: this.$t("tips.deleteSuccess"),
+              type: "success"
+            })
+            this.search()
+            // 清理已经删除的数据
+            this.$refs.table.clearSelection()
+          }
+        })
+      },
+      view(row) {
+        this.$refs.view.setTenant(row)
+        this.tenantViewVisible = true
+      },
+      // 【修改】表头上Btn-事件
+      editOne() {
+        if (!this.selection.length) {
+          this.$message({
+            message: this.$t("tips.noDataSelected"),
+            type: "warning"
+          })
+          return
+        }
+        if (this.selection.length > 1) {
+          this.$message({
+            message: this.$t("tips.mustOne"),
+            type: "warning"
+          })
+          return
+        }
+        this.edit(this.selection[0]);
+      },
+      edit(row) {
+        this.$refs.edit.setTenant(row, this.dicts)
+        this.$refs.edit.type = "edit"
+        this.dialog.title = this.$t("common.edit")
+        this.dialog.isVisible = true
+      },
+      eventRow(row){
+        this.$refs.event.setTenant(row, this.dicts)
+        this.$refs.event.type = "event"
+        this.tenantEvent.title = "更新计划"
+        this.tenantEvent.isVisible = true
+      },
+      fetch(params = {}) {
+        this.tableKey = !this.tableKey
+        this.selection = []
+        this.loading = true
+        if (this.queryParams.timeRange) {
+          this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
+          this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
+        }
+
+        this.queryParams.current = params.current ? params.current : this.queryParams.current
+        this.queryParams.size = params.size ? params.size : this.queryParams.size
+        repairApi.page(this.queryParams).then(response => {
+          const res = response.data
+          if (res.isSuccess) {
+            this.tableData = res.data
+          }
+          // eslint-disable-next-line no-return-assign
+        }).finally(() => this.loading = false)
+
+      },
+      cellClick(row, column) {
+        if (column['columnKey'] === "operation") {
+          return
+        }
+        let flag = false
+        this.selection.forEach((item) => {
+          if (item.id === row.id) {
+            flag = true
+            this.$refs.table.toggleRowSelection(row)
+          }
+        })
+
+        if (!flag) {
+          this.$refs.table.toggleRowSelection(row, true)
+        }
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .rowBtn {
+    margin: 0 5px;
+    color: #1890ff;
+  }
+
+  .rowBtn:hover {
+    opacity: 0.7;
+  }
+</style>