qushaowei
2024-07-25 52190152691bc217844d4f87b700274c297b104e
src/views/eam/ABC/modules/EquipmentSelectModel.vue
@@ -39,6 +39,22 @@
                />
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="6"
            >
              <a-form-item label="中心">
                <!-- <a-input
                  placeholder="中心"
                  v-model="queryParam.useId"
                /> -->
                <j-dict-select-tag
                  placeholder='请选择所属中心'
                  dictCode="mom_base_area,name,id,del_flag!='1' and type='1'"
                  v-model="queryParam.workCenterId"
                />
              </a-form-item>
            </a-col>
            <a-col :md="3">
              <span
                style="float: left;overflow: hidden;"
@@ -72,10 +88,23 @@
        :loading="loading"
        @change="handleTableChange"
      >
       <template slot="equipmentPhoto" 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="equipmentPhoto"
          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>
      </a-table>
    </a-card>
  </a-modal>
@@ -101,7 +130,7 @@
          key: 'rowIndex',
          width: 50,
          align: 'center',
          customRender: function(t, r, index) {
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          }
        },
@@ -109,49 +138,49 @@
          title: '统一编码',
          align: 'center',
          dataIndex: 'num',
          width:200
          width: 200
        },
        {
          title: '设备名称',
          align: 'center',
          dataIndex: 'name',
          width:200
          width: 200
        },
        {
          title: '设备型号',
          align: 'center',
          dataIndex: 'model',
          width:200
          width: 200
        },
        {
          title: '设备规格',
          align: 'center',
          dataIndex: 'specification',
          width:200
          width: 200
        },
        {
          title: 'ABC标识',
          align: "center",
          dataIndex: 'equipmentImportanceId',
          width:100
          width: 100
        },
        {
          title: '关键设备标识',
          align: "center",
          dataIndex: 'specificEquipment_dictText',
          width:100
          width: 100
        },
        {
          title: '设备状态',
          align: 'center',
          dataIndex: 'equipmentStatus_dictText',
          width:100
          width: 100
        },
        {
          title: '技术状态',
          align: 'center',
          dataIndex: 'technologyStatus_dictText',
          width:100
          width: 100
        },
      ],
      selectedRowKeys: [],
@@ -159,6 +188,7 @@
      scrollTrigger: {},
      dataSource: [],
      selectionRows: [],
      selectionRowsNotClear: [],
      title: '选择设备',
      ipagination: {
        current: 1,
@@ -188,14 +218,29 @@
        type: 'checkbox',
        onChange: (selectedRowKeys, selectedRows) => {
          this.selectedRowKeys = selectedRowKeys
          this.onSelectChange(selectedRows)
          this.selectionRows = selectedRows
          // debugger
          // this.selectionRowsNotClear.push(selectedRows)
          // this.onSelectChange(selectedRows)
        },
        onSelect: (record, selected, selectedRows) => {
          if (selected) {
            this.selectionRowsNotClear.push(record);
          }
          if (!selected) {
            let delIndex = this.selectionRowsNotClear.findIndex(val => {
              return val.id === record.id
            })
            this.selectionRowsNotClear.splice(delIndex, 1);
          }
        },
        getCheckboxProps: record => ({
          props: {
            disabled: record.distable
          }
        }),
        selectedRowKeys: this.selectedRowKeys
        selectedRowKeys: this.selectedRowKeys,
        selectedRows: this.selectionRows
      }
    }
  },
@@ -230,6 +275,9 @@
    },
    showModals(oldSelectRows) {
      this.selectionRows = []
      this.selectedRowKeys = []
      this.selectionRowsNotClear = []
      this.oldSelectRows = oldSelectRows
      this.visible = true
      this.loadData(1)
@@ -273,7 +321,8 @@
      this.loadData()
    },
    handleSubmit() {
      this.$emit('selectionRows', this.selectionRows)
      debugger
      this.$emit('selectionRows', this.selectionRowsNotClear)
      this.searchReset(0)
      this.close()
    },