cuilei
2 天以前 b6b2c379bd92f076acd16801b1442604ea21fc5d
src/views/tms/ToolVerificationRecordList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,223 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col
            :md="6"
            :sm="8"
          >
            <a-form-item label="量具编号">
              <j-input placeholder="请输入量具编号" v-model="queryParam.toolCode" />
            </a-form-item>
          </a-col>
          <a-col
            :md="6"
            :sm="8"
          >
            <a-form-item label="唯一编码">
              <j-input placeholder="请输入唯一编码" v-model="queryParam.onlyCode" />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-space>
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
            </a-space>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
    </div>
    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="null"
        class="j-table-force-nowrap"
        @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a @click="handleDetail(record)">详情</a>
          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a @click="handleEdit(record)">编辑</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
      </a-table>
    </div>
    <tool-verification-record-modal ref="modalForm" @ok="modalFormOk"></tool-verification-record-modal>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ToolVerificationRecordModal from './modules/verification/ToolVerificationRecordModal'
  import { getAction } from '../../api/manage'
  export default {
    name: 'ToolVerificationRecordList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      ToolVerificationRecordModal
    },
    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: 'toolCode',
          },
          {
            title:'唯一编码',
            align:"center",
            dataIndex: 'onlyCode',
          },
          {
            title:'量具名称',
            align:"center",
            dataIndex: 'toolName'
          },
          {
            title:'规格',
            align:"center",
            dataIndex: 'toolModel'
          },
          {
            title:'计量号',
            align:"center",
            dataIndex: 'measureNumber'
          },
          {
            title:'检定报告日期',
            align:"center",
            dataIndex: 'verificationReportDate'
          },
          {
            title:'检定结果及意见',
            align:"center",
            dataIndex: 'result'
          },
          {
            title:'责任人',
            align:"center",
            dataIndex: 'personResponsible'
          },
          // {
          //   title:'创建人',
          //   align:"center",
          //   dataIndex: 'createBy'
          // },
          // {
          //   title:'创建时间',
          //   align:"center",
          //   dataIndex: 'createTime'
          // },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/tms/toolVerificationRecord/queryPageList",
          delete: "/tms/toolVerificationRecord/delete",
          deleteBatch: "/tms/toolVerificationRecord/deleteBatch",
          exportXlsUrl: "/tms/toolVerificationRecord/exportXls",
          importExcelUrl: "tms/toolVerificationRecord/importExcel",
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
      this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      searchReset() {
        this.queryParam = {}
        this.loadData(1);
      },
      filterOption(input, option) {
        return (
          option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
        );
      },
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'tenantId',text:'租户号'})
        fieldList.push({type:'string',value:'createdBy',text:'创建人'})
        fieldList.push({type:'date',value:'createdTime',text:'创建时间'})
        fieldList.push({type:'string',value:'updatedBy',text:'更新人'})
        fieldList.push({type:'date',value:'updatedTime',text:'更新时间'})
        fieldList.push({type:'string',value:'onlyCode',text:'唯一编码'})
        fieldList.push({type:'string',value:'measureNumber',text:'计量号'})
        fieldList.push({type:'date',value:'nextVerificationDate',text:'下次检定日期'})
        fieldList.push({type:'date',value:'verificationReportDate',text:'检定报告日期'})
        fieldList.push({type:'string',value:'personResponsible',text:'责任人'})
        fieldList.push({type:'string',value:'result',text:'检定结果及意见'})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>