qushaowei
2023-09-05 def88c97c86087175bfd9b9fe82e78d2cd3ef6f0
src/views/spare/modules/sparePart/SparePart2List.vue
@@ -61,20 +61,30 @@
      <a-button
        @click="handleAdd"
        type="primary"
        v-has="'sparePartList:add'"
        icon="plus"
        :hidden="disabled"
      >新增</a-button>
      <a-button
        type="primary"
        icon="download"
        @click="handleExportXls('???')"
        @click="handleExportXls('备件信息')"
      >导出</a-button>
      <a-upload
        name="file"
        :showUploadList="false"
        :multiple="false"
        :headers="tokenHeader"
        :action="importExcelUrl"
        @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-button style="margin-left: 8px">
          批量操作
          <a-icon type="down" />
        </a-button>
        <a-menu slot="overlay">
        <a-menu slot="overlay" >
          <a-menu-item @click="batchDel">
            <a-icon type="delete" />删除
          </a-menu-item>
@@ -103,6 +113,7 @@
      >
        <a
          href="javascript:;"
          v-has="'sparePartList:edit'"
          @click="handleEdit(record)"
        >编辑</a>
        <a-divider type="vertical" />
@@ -111,11 +122,11 @@
            更多
            <a-icon type="down" />
          </a>
          <a-menu slot="overlay">
          <a-menu slot="overlay" v-has="'sparePartList:delete'">
            <!-- <a-menu-item>
              <a @click="handleEdit(record)">编辑</a>
            </a-menu-item> -->
            <a-menu-item>
            <a-menu-item  >
              <a-popconfirm
                title="确定删除吗?"
                @confirm="() => handleDelete(record.id)"
@@ -238,15 +249,15 @@
          dataIndex: 'constructorId_dictText',
        },
        {
          title: '主单位',
          title: '单位',
          align: "center",
          dataIndex: 'mainUnitId_dictText',
        },
        {
       /*  {
          title: '辅单位',
          align: "center",
          dataIndex: 'auxiliaryUnitId_dictText',
        },
        }, */
        // {
        //   title: '主数量',
        //   align: "center",
@@ -303,7 +314,7 @@
        delete: "/spare/sparePart/delete",
        deleteBatch: "/spare/sparePart/deleteBatch",
        exportXlsUrl: '/spare/sparePart/exportXls',
        // importExcelUrl: 'base/site/importExcel',
        importExcelUrl: '/spare/sparePart/importExcel',
      },
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: "",
@@ -331,6 +342,9 @@
        selectedRowKeys: this.selectedRowKeys,
      };
    },
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
  methods: {