src/views/cms/CuttingReceiveDetailList.vue
@@ -1,48 +1,48 @@
<template>
   <a-card :bordered="false">
      <!-- table区域-begin -->
      <div>
         <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>
         </div>
  <a-card :bordered="false">
    <!-- table区域-begin -->
    <div>
      <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>
      </div>
         <a-table
            ref="table"
            size="middle"
            :scroll="{x:true}"
            bordered
            rowKey="id"
            :columns="columns"
            :dataSource="dataSource"
            :pagination="ipagination"
            :loading="loading"
            class="j-table-force-nowrap"
            @change="handleTableChange">
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleTableChange">
            <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>
            <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>
        <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>
        <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">
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical" />
@@ -61,11 +61,11 @@
          </a-dropdown>
        </span>
         </a-table>
      </div>
      </a-table>
    </div>
      <cutting-receive-detail-modal ref="modalForm" @ok="modalFormOk"></cutting-receive-detail-modal>
   </a-card>
    <cutting-receive-detail-modal ref="modalForm" @ok="modalFormOk"></cutting-receive-detail-modal>
  </a-card>
</template>
<script>
@@ -75,93 +75,93 @@
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
   name: 'CuttingReceiveDetailList',
   mixins: [JeecgListMixin, mixinDevice],
   components: {},
   data() {
      return {
         description: '领用单明细管理页面',
         // 表头
         columns: [
            {
               title: '#',
               dataIndex: '',
               key: 'rowIndex',
               width: 60,
               align: 'center',
               customRender: function(t, r, index) {
                  return parseInt(index) + 1
               }
            },
            {
               title: '刀具编码',
               align: 'center',
               dataIndex: 'cuttingCode'
            },
            {
               title: '刀具名称',
               align: 'center',
               dataIndex: 'cuttingName'
            },
            {
               title: '刀具条码',
               align: 'center',
               dataIndex: 'cuttingBarcode'
            },
            {
               title: '工件材质',
               align: 'center',
               dataIndex: 'workpieceMaterial'
            },
            {
               title: '使用寿命',
               align: 'center',
               dataIndex: 'usedLife'
            }
         ],
         url: {
            list: '/cms/cuttingReceive/detailList',
            delete: '/cms/cuttingReceiveDetail/delete',
            deleteBatch: '/cms/cuttingReceiveDetail/deleteBatch',
            exportXlsUrl: '/cms/cuttingReceiveDetail/exportXls',
            importExcelUrl: 'cms/cuttingReceiveDetail/importExcel'
  name: 'CuttingReceiveDetailList',
  mixins: [JeecgListMixin, mixinDevice],
  components: {},
  data() {
    return {
      description: '领用单明细管理页面',
      // 表头
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '刀具编码',
          align: 'center',
          dataIndex: 'cuttingCode'
        },
        {
          title: '刀具名称',
          align: 'center',
          dataIndex: 'cuttingName'
        },
        {
          title: '刀具条码',
          align: 'center',
          dataIndex: 'cuttingBarcode'
        },
        {
          title: '工件材质',
          align: 'center',
          dataIndex: 'workpieceMaterial'
        },
        {
          title: '使用寿命',
          align: 'center',
          dataIndex: 'usedLife'
        }
      ],
      url: {
        list: '/cms/cuttingReceive/detailList',
        delete: '/cms/cuttingReceiveDetail/delete',
        deleteBatch: '/cms/cuttingReceiveDetail/deleteBatch',
        exportXlsUrl: '/cms/cuttingReceiveDetail/exportXls',
        importExcelUrl: 'cms/cuttingReceiveDetail/importExcel'
         },
         dictOptions: {},
         superFieldList: [],
         disableMixinCreated: true
      }
   },
   created() {
      this.getSuperFieldList()
   },
   computed: {
      importExcelUrl: function() {
         return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
      }
   },
   methods: {
      initDictConfig() {
      },
      getSuperFieldList() {
         let fieldList = []
         fieldList.push({ type: 'string', value: 'orderId', text: '领用单ID' })
         fieldList.push({ type: 'string', value: 'cuttingId', text: '刀具ID' })
         fieldList.push({ type: 'string', value: 'cuttingCode', text: '刀具编码' })  // 添加这一行
         fieldList.push({ type: 'string', value: 'cuttingName', text: '刀具名称' })  // 添加这一行
         fieldList.push({ type: 'string', value: 'cuttingBarcode', text: '刀具条码' })  // 添加这一行
         fieldList.push({ type: 'string', value: 'inventoryId', text: '库存ID' })
         fieldList.push({ type: 'string', value: 'workpieceMaterial', text: '工件材质' })
         fieldList.push({ type: 'int', value: 'usedLife', text: '使用寿命' })
         this.superFieldList = fieldList
      }
   },
   mounted() {
      this.$bus.$on('getToolingStorageData', (data) => {
         this.queryParam.orderId = data.id
         this.searchQuery()
      })
   }
      dictOptions: {},
      superFieldList: [],
      disableMixinCreated: true
    }
  },
  created() {
    this.getSuperFieldList()
  },
  computed: {
    importExcelUrl: function() {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    }
  },
  methods: {
    initDictConfig() {
    },
    getSuperFieldList() {
      let fieldList = []
      fieldList.push({ type: 'string', value: 'orderId', text: '领用单ID' })
      fieldList.push({ type: 'string', value: 'cuttingId', text: '刀具ID' })
      fieldList.push({ type: 'string', value: 'cuttingCode', text: '刀具编码' })  // 添加这一行
      fieldList.push({ type: 'string', value: 'cuttingName', text: '刀具名称' })  // 添加这一行
      fieldList.push({ type: 'string', value: 'cuttingBarcode', text: '刀具条码' })  // 添加这一行
      fieldList.push({ type: 'string', value: 'inventoryId', text: '库存ID' })
      fieldList.push({ type: 'string', value: 'workpieceMaterial', text: '工件材质' })
      fieldList.push({ type: 'int', value: 'usedLife', text: '使用寿命' })
      this.superFieldList = fieldList
    }
  },
  mounted() {
    this.$bus.$on('getToolingStorageData', (data) => {
      this.queryParam.orderId = data.id
      this.searchQuery()
    })
  }
}
</script>
<style scoped>