zenglf
2023-09-18 92ff846fb659c62037a32b1d8c15eae9df9d9b54
src/views/eam/modules/equipmentSeal/EquipmentSealDetailList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,277 @@
<template>
  <a-card
    :bordered="false"
    :class="'cust-erp-sub-tab'"
  >
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :scroll="{ x: 'calc(1400px + 50%)', y: 900 }"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      >
        <template
          slot="htmlSlot"
          slot-scope="text"
        >
          <div v-html="text"></div>
        </template>
        <template
          slot="equipmentPhoto"
          slot-scope="text,record"
        >
          <Tooltip
            placement="top"
            title="预览图片"
          >
            <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;"
            />
          </Tooltip>
        </template>
        <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)"
          >
            ä¸‹è½½
          </a-button>
        </template>
        <span
          slot="action"
          slot-scope="text, record"
        >
          <a @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical" />
          <a-popconfirm
            title="确定删除吗?"
            @confirm="() => handleDelete(record.id)"
          >
            <a>删除</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
    <equipmentSealDetail-modal
      ref="modalForm"
      @ok="modalFormOk"
      :mainId="mainId"
    ></equipmentSealDetail-modal>
  </a-card>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import EquipmentSealDetailModal from './EquipmentSealDetailModal'
export default {
  name: "EquipmentSealDetailList",
  mixins: [JeecgListMixin],
  components: { EquipmentSealDetailModal },
  props: {
    mainId: {
      type: String,
      default: '',
      required: false
    }
  },
  watch: {
    mainId: {
      immediate: true,
      handler(val) {
        if (!this.mainId) {
          this.clearList()
        } else {
          this.queryParam['equipmentChangeId'] = val
          this.loadData(1);
        }
      }
    }
  },
  data() {
    return {
      description: '设备封存管理页面',
      disableMixinCreated: true,
      // è¡¨å¤´
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: "center",
          customRender: function (t, r, index) {
            return parseInt(index) + 1;
          }
        },
        {
          title: '设备编码',
          align: "center",
          dataIndex: 'equipmentNum'
        },
        {
          title: '资产编码',
          align: "center",
          dataIndex: 'assetNumber'
        },
        {
          title: '设备名称',
          align: "center",
          dataIndex: 'equipmentName'
        },
        {
          title: '设备型号',
          align: "center",
          dataIndex: 'model'
        },
        {
          title: '设备规格',
          align: "center",
          dataIndex: 'specification'
        },
        {
          title: '特种设备',
          align: "center",
          dataIndex: 'specificEquipment_dictText',
        },
        {
          title: '设备状态',
          align: "center",
          dataIndex: 'equipmentStatus_dictText',
        },
        {
          title: '技术状态',
          align: "center",
          dataIndex: 'technologyStatus_dictText',
        },
        {
          title: '设备位置',
          align: "center",
          dataIndex: 'location'
        },
        {
          title: '重要度',
          align: "center",
          dataIndex: 'equipmentImportanceId_dictText',
        },
        {
          title: '设备图片',
          align: "center",
          dataIndex: 'equipmentPhoto',
          scopedSlots: { customRender: "equipmentPhoto" }
        },
        {
          title: '封存原因',
          align: "center",
          dataIndex: 'sealReason'
        },
        {
          title: '封存日期',
          align: "center",
          dataIndex: 'sealDate'
        },
        {
          title: '预计启封日期',
          align: "center",
          dataIndex: 'planUnsealDate',
          // customRender:function (text) {
          //   return !text?"":(text.length>10?text.substr(0,10):text)
          // }
        },
        // {
        //   title:'是否强制启封',
        //   align:"center",
        //   dataIndex: 'isForceUnseal',
        //   customRender: (text) => (!text ? "" : (text == "Y" ? "是" : "否"))
        // },
        // {
        //   title:'强制启封日期',
        //   align:"center",
        //   dataIndex: 'forceUnsealDate',
        //   // customRender:function (text) {
        //   //   return !text?"":(text.length>10?text.substr(0,10):text)
        //   // }
        // },
        // {
        //   title:'强制启封后保养',
        //   align:"center",
        //   dataIndex: 'maintenanceAfterUnseal',
        //   customRender: (text) => (!text ? "" : (text == "Y" ? "是" : "否"))
        // },
        // {
        //   title:'保养标准',
        //   align:"center",
        //   dataIndex: 'maintenanceStandardId_dictText',
        // },
        // {
        //   title: '操作',
        //   dataIndex: 'action',
        //   align:"center",
        //   fixed:"right",
        //   width:147,
        //   scopedSlots: { customRender: 'action' },
        // }
      ],
      url: {
        list: "/eam/equipmentSeal/listEquipmentSealDetailByMainId",
        delete: "/eam/equipmentSeal/deleteEquipmentSealDetail",
        deleteBatch: "/eam/equipmentSeal/deleteBatchEquipmentSealDetail",
        exportXlsUrl: "/eam/equipmentSeal/exportEquipmentSealDetail",
        importUrl: "/eam/equipmentSeal/importEquipmentSealDetail",
      },
      dictOptions: {
        auditStatus: [],
      }
    }
  },
  created() {
  },
  computed: {
    importExcelUrl() {
      return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
    }
  },
  methods: {
    clearList() {
      this.dataSource = []
      this.selectedRowKeys = []
      this.ipagination.current = 1
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>