cuijian
2023-11-16 e0cd695c11734348e1e01304bdff0696768c1fda
src/views/eam/PredictiveWorkPlanList.vue
@@ -66,6 +66,7 @@
        @click='handleAdd'
        type='primary'
        icon='plus'
        v-has="'predictiveWorkPlan:add&edit&delete'"
      >新增
      </a-button>
      <a-button
@@ -118,21 +119,25 @@
          <a
            v-if="record.status == '2'"
            @click="handleRevise(record)"
            v-has="'predictiveWorkplan:update&take'"
          >升版</a>
          <a
            v-if="record.status == '1'"
            @click="handleTakeEffect(record)"
            v-has="'predictiveWorkplan:update&take'"
          >生效</a>
          <a-divider type="vertical"/>
          <a
            v-if="record.status == '1'"
            @click="handleEdit(record)"
            v-has="'predictiveWorkPlan:add&edit&delete'"
          >编辑</a>
          <a-divider type="vertical"/>
          <a-popconfirm
            v-if="record.status == '1'"
            title="确定删除吗?"
            @confirm="() => handleDelete(record.id)"
            v-has="'predictiveWorkPlan:add&edit&delete'"
          >
            <a>删除</a>
          </a-popconfirm>
@@ -308,7 +313,7 @@
            dataIndex: 'monitorTypeName'
          },
          {
            title: '设备编码',
            title: '统一编码',
            align: 'center',
            dataIndex: 'deviceNum'
          },
@@ -393,7 +398,8 @@
        this.selectionRows = []
        this.planId = ''
        this.equipmentId = ''
        this.isAdd = false
        this.isAdd = falses
      },
      handleDelete: function(id) {
        if (!this.url.delete) {
@@ -418,7 +424,10 @@
        this.selectionRows = selectionRows
        this.planId = this.selectedRowKeys[0]
        this.equipmentId = selectionRows[0].equipment_id
        this.isAdd = true
        this.isAdd = selectionRows[0].status=='1';
        this.isDel = selectionRows[0].status=='1';
        this.isEdit = selectionRows[0].status=='1';
      },
      onChange(e) {
@@ -432,12 +441,12 @@
        this.$refs.modalForm.disableSubmit = false
        this.$refs.modalForm.isRevise = false
      },
      handleAdd: function() {
        this.$refs.modalForm.add()
        this.$refs.modalForm.title = '新增'
        this.$refs.modalForm.disableSubmit = false
        this.$refs.modalForm.isRevise = false
      },
      // handleAdd: function() {
      //   this.$refs.modalForm.add()
      //   this.$refs.modalForm.title = '新增'
      //   this.$refs.modalForm.disableSubmit = false
      //   this.$refs.modalForm.isRevise = false
      // },
      //升版
      handleRevise: function(record) {
@@ -452,7 +461,7 @@
        const that = this
        that.confirmLoading = true
        this.$confirm({
          title: '日常保养标准版本生效!',
          title: '版本生效!',
          content: '提示:版本生效后上一版本将自动失效,请谨慎操作!',
          okText: '确认',
          cancelText: '取消',
@@ -474,10 +483,6 @@
          }
        })
      },
      searchReset() {
        this.loadData(1)
      }
    }
  }
</script>