PalletTaskList.vue 9.01 KB
<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 :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item :label="$t('pallet.containerCode')">
              <a-input placeholder="请输入托盘号" v-model="queryParam.containercode"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item :label="$t('pallet.taskType')">
              <a-input placeholder="请输入任务类型" v-model="queryParam.pallettasktype"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item :label="$t('pallet.sendBackWmsStatus')">
              <a-input placeholder="请输入回传WMS状态" v-model="queryParam.commit"></a-input>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item :label="$t('pallet.unstackStatus')">
                <a-input placeholder="请输入拆垛状态" v-model="queryParam.unstackstatus"></a-input>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item :label="$t('pallet.stackStatus')">
                <a-input placeholder="请输入码垛状态" v-model="queryParam.stackstatus"></a-input>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item :label="$t('system.batch')">
                <a-input placeholder="请输入批次" v-model="queryParam.batch"></a-input>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item :label="$t('pallet.arrivedP1008Status')">
                <a-input placeholder="请输入到达P1008状态" v-model="queryParam.isarrive"></a-input>
              </a-form-item>
            </a-col>
          </template>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">{{ $t('button.search') }}</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">{{
                $t('button.reset')
              }}</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? $t('button.collapse') : $t('button.expand') }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
              </a>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        class="j-table-force-nowrap"
        :scroll="{ x: true }"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio' }"
        :customRow="clickThenSelect"
        @change="handleTableChange"
      >
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">{{ $t('button.edit') }}</a>
        </span>
      </a-table>
    </div>

    <a-tabs defaultActiveKey="1">
      <a-tab-pane tab="托盘任务详情" key="1">
        <PalletBillList :mainId="selectedMainId" />
      </a-tab-pane>
    </a-tabs>

    <palletTask-modal ref="modalForm" @ok="modalFormOk"></palletTask-modal>
  </a-card>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import PalletTaskModal from './modules/PalletTaskModal'
import { getAction } from '@/api/manage'
import PalletBillList from './PalletBillList'
import '@/assets/less/TableExpand.less'

export default {
  name: 'PalletTaskList',
  mixins: [JeecgListMixin],
  components: {
    PalletBillList,
    PalletTaskModal
  },
  data() {
    let ellipsis1 = (v, l = 40) => <j-ellipsis value={v} length={l} />
    return {
      description: '托盘任务表管理页面',
      // 表头
      columns: [
        {
          title: this.$t('pallet.id'),
          align: 'center',
          dataIndex: 'id'
        },
        {
          title: this.$t('pallet.containerCode'),
          align: 'center',
          dataIndex: 'containercode'
        },
        {
          title: this.$t('pallet.taskType'),
          align: 'center',
          dataIndex: 'pallettasktype'
        },
        {
          title: this.$t('pallet.unstackStatus'),
          align: 'center',
          dataIndex: 'unstackstatus'
        },
        {
          title: this.$t('pallet.stackStatus'),
          align: 'center',
          dataIndex: 'stackstatus'
        },
        {
          title: this.$t('system.batch'),
          align: 'center',
          dataIndex: 'batch'
        },
        {
          title: this.$t('pallet.arrivedP1008Status'),
          align: 'center',
          dataIndex: 'isarrive'
        },
        {
          title: this.$t('pallet.sendBackWmsStatus'),
          align: 'center',
          dataIndex: 'commit'
        },
        {
          title: this.$t('system.remark'),
          align: 'center',
          dataIndex: 'remark'
        },
        {
          title: this.$t('system.createTime'),
          align: 'center',
          dataIndex: 'createTime'
        },
        {
          title: this.$t('system.updateTime'),
          align: 'center',
          dataIndex: 'updateTime'
        },
        {
          title: this.$t('system.options'),
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 147,
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: '/task/palletTask/list',
        delete: '/task/palletTask/delete',
        deleteBatch: '/task/palletTask/deleteBatch',
        exportXlsUrl: '/task/palletTask/exportXls',
        importExcelUrl: '/task/palletTask/importExcel'
      },
      dictOptions: {},
      /* 分页参数 */
      ipagination: {
        current: 1,
        pageSize: 5,
        pageSizeOptions: ['5', '10', '50'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' 共' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      selectedMainId: '',
      superFieldList: []
    }
  },
  created() {
    this.getSuperFieldList()
  },
  computed: {
    importExcelUrl: function() {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    }
  },
  methods: {
    initDictConfig() {},
    clickThenSelect(record) {
      return {
        on: {
          click: () => {
            this.onSelectChange(record.id.toString().split(','), [record])
          }
        }
      }
    },
    onClearSelected() {
      this.selectedRowKeys = []
      this.selectionRows = []
      this.selectedMainId = ''
    },
    onSelectChange(selectedRowKeys, selectionRows) {
      this.selectedMainId = selectedRowKeys[0].toString()
      this.selectedRowKeys = selectedRowKeys
      this.selectionRows = selectionRows
    },
    loadData(arg) {
      if (!this.url.list) {
        this.$message.error('请设置url.list属性!')
        return
      }
      //加载数据 若传入参数1则加载第一页的内容
      if (arg === 1) {
        this.ipagination.current = 1
      }
      this.onClearSelected()
      var params = this.getQueryParams() //查询条件
      this.loading = true
      getAction(this.url.list, params).then(res => {
        if (res.success) {
          this.dataSource = res.result.records
          this.ipagination.total = res.result.total
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
    },
    getSuperFieldList() {
      let fieldList = []
      fieldList.push({ type: 'string', value: 'containercode', text: '托盘编码', dictCode: '' })
      fieldList.push({ type: 'string', value: 'pallettasktype', text: '任务类型', dictCode: '' })
      fieldList.push({ type: 'string', value: 'unstackstatus', text: '拆垛状态', dictCode: '' })
      fieldList.push({ type: 'string', value: 'stackstatus', text: '码垛状态', dictCode: '' })
      fieldList.push({ type: 'string', value: 'batch', text: '批次', dictCode: '' })
      fieldList.push({ type: 'Text', value: 'billjsonstring', text: '报文', dictCode: '' })
      fieldList.push({ type: 'string', value: 'isbilljsonparsed', text: '报文状态', dictCode: '' })
      fieldList.push({ type: 'string', value: 'commit', text: '回传WMS状态', dictCode: '' })
      fieldList.push({ type: 'string', value: 'remark', text: '备注', dictCode: '' })
      this.superFieldList = fieldList
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>