“linengliang”
2024-03-12 ddd7e6f6c57c2f39305e94a74650e28bbf31f9e7
src/views/eam/FaultInfoList.vue
@@ -1,14 +1,8 @@
<template>
  <a-card
    title="设备事故登记表"
    :bordered="false"
  >
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form
        layout="inline"
        @keyup.enter.native="searchQuery"
      >
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col
            :xl='6'
@@ -74,15 +68,9 @@
    <!-- table区域-begin -->
    <div>
      <div
        class="ant-alert ant-alert-info"
        style="margin-bottom: 16px;"
      >
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a
          style="margin-left: 24px"
          @click="onClearSelected"
        >清空</a>
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
      <a-table
@@ -97,83 +85,59 @@
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange"
      >
        @change="handleTableChange">
        <template
          slot="htmlSlot"
          slot-scope="text"
        >
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template
          slot="imgSlot"
          slot-scope="text,record"
        >
          <span
            v-if="!text"
            style="font-size: 12px;font-style: italic;"
          >无图片</span>
          <img
            v-else
            :src="getImgView(text)"
            :preview="record.id"
            height="25px"
            alt=""
            style="max-width:80px;font-size: 12px;font-style: italic;"
          />
        <template slot="imgSlot" slot-scope="text,record">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template
          slot="fileSlot"
          slot-scope="text"
        >
          <span
            v-if="!text"
            style="font-size: 12px;font-style: italic;"
          >无文件</span>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)"
          >
            @click="downloadFile(text)">
            下载
          </a-button>
        </template>
        <span
          slot="action"
          slot-scope="text, record"
        >
          <a
            @click="handleEdit(record)"
            v-if="record.isConfirm!=='yes'"
            v-has="'fault:update'"
          >录入</a>
          <a-divider type="vertical" />
          <a @click="handleDetail(record)">详情</a>
          <a-divider type="vertical" />
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)" v-if="record.isConfirm=='no'" v-has="'fault:update'">录入</a>
          <a-divider type="vertical" v-if="record.isConfirm=='no'"/>
          <a-popconfirm
            title="确认结果后不可再录入,确认吗?"
            title="确认提交吗?"
            @confirm="() => handleSubmit(record)"
          >
          <a  v-if="record.isConfirm=='no'" v-has="'fault:update'">提交</a>
          </a-popconfirm>
          <a-divider type="vertical" v-if="record.isConfirm=='no'" />
          <a-popconfirm
            title="确认驳回吗?"
            @confirm="() => handleReject(record)"
          >
          <a v-if="record.isConfirm=='sub'" v-has="'fault:confirm'">驳回</a>
          </a-popconfirm>
          <a-divider type="vertical" v-if="record.isConfirm=='sub'" />
          <a-popconfirm
            title="确认结果并进入验收流程吗?"
            @confirm="() => handleConfirm(record)"
          >
            <a
              v-if="record.isConfirm!=='yes'"
              v-has="'fault:confirm'"
            >确认</a>
            <a v-if="record.isConfirm=='sub'" v-has="'fault:confirm'">确认</a>
          </a-popconfirm>
          <a-divider type="vertical" />
          <a @click="handleDetail(record)">详情</a>
        </span>
      </a-table>
    </div>
    <fault-info-modal
      ref="modalForm"
      @ok="modalFormOk"
    ></fault-info-modal>
    <fault-info-modal ref="modalForm" @ok="modalFormOk"></fault-info-modal>
  </a-card>
</template>
@@ -219,7 +183,7 @@
        {
          title: '生产单位',
          align: "center",
          dataIndex: 'departId'
            dataIndex: 'departId_dictText'
        },
        {
          title: '设备名称',
@@ -239,7 +203,7 @@
        {
          title: '工区',
          align: "center",
          dataIndex: 'area1'
            dataIndex: 'area1_dictText'
        },
        {
          title: '单元/工段',
@@ -479,6 +443,7 @@
      this.superFieldList = fieldList
    },
    handleConfirm(record) {
        record.isConfirm = 'yes';
      putAction(this.url.confirm, record).then(res => {
        if (res.result) {
          this.$message.success('确认成功');
@@ -488,6 +453,28 @@
        }
      })
    },
      handleSubmit(record) {
        record.isConfirm = "sub";
        putAction(this.url.confirm, record).then(res => {
          if (res.result) {
            this.$message.success('提交成功');
            this.loadData();
          } else {
            this.$message.error('提交出现异常')
          }
        })
      },
      handleReject(record) {
        record.isConfirm = "no";
        putAction(this.url.confirm, record).then(res => {
          if (res.result) {
            this.$message.success('驳回成功');
            this.loadData();
          } else {
            this.$message.error('驳回出现异常')
          }
        })
      },
  }
}
</script>