ShipmentContainerAdviceList.vue 10.1 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="单据编码">
              <a-input placeholder="请输入单据编码" v-model="queryParam.shipmentCode"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="机台号">
              <a-input placeholder="请输入机台号" v-model="queryParam.machineCode"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="库位编码">
              <a-input placeholder="请输入库位编码" v-model="queryParam.locationCode"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="容器编码">
              <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="物料编码">
              <a-input placeholder="请输入物料编码" v-model="queryParam.materialCode"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="序列号">
              <a-input placeholder="请输入序列号" v-model="queryParam.sn"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="状态">
              <j-dict-select-tag
                placeholder="请选择状态"
                v-model="queryParam.status"
                dictCode="shipment_container_status"
              />
            </a-form-item>
          </a-col>
          <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">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
      <!-- <a-button type="primary" icon="download" @click="handleExportXls('出库预配盘')">导出</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"
        class="j-table-force-nowrap"
        @change="handleTableChange"
      >
        <span slot="zoneCode" slot-scope="zoneCode">
          <a-tag :key="zoneCode" color="blue">
            {{ solutionZoneCode(zoneCode) }}
          </a-tag>
        </span>

        <span slot="status_dictText" slot-scope="status_dictText">
          <a-tag :key="status_dictText" :color="getStatusColor(status_dictText)">
            {{ status_dictText }}
          </a-tag>
        </span>

        <!-- <span slot="action" slot-scope="text, record">
          <a v-if="record.status == 0" @click="handleEdit(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="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item v-if="record.status == 0">
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span> -->
      </a-table>
    </div>

    <shipment-container-advice-modal ref="modalForm" @ok="modalFormOk"></shipment-container-advice-modal>
  </a-card>
</template>

<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ShipmentContainerAdviceModal from './modules/ShipmentContainerAdviceModal'
import { getZoneList } from '@/api/api'

export default {
  name: 'ShipmentContainerAdviceList',
  mixins: [JeecgListMixin, mixinDevice],
  components: {
    ShipmentContainerAdviceModal
  },
  data() {
    return {
      description: '出库预配盘管理页面',
      zoneList: [],
      // 表头
      columns: [
        {
          title: '预配盘ID',
          align: 'center',
          dataIndex: 'id'
        },
        {
          title: '单据编码',
          align: 'center',
          dataIndex: 'shipmentCode'
        },
        {
          title: '单据详情ID',
          align: 'center',
          dataIndex: 'shipmentDetailId'
        },
        {
          title: '库区',
          align: 'center',
          dataIndex: 'zoneCode',
          key: 'zoneCode',
          scopedSlots: { customRender: 'zoneCode' }
        },
        {
          title: '机台号',
          align: 'center',
          dataIndex: 'machineCode'
        },
        {
          title: '计划类型',
          align: 'center',
          dataIndex: 'planType'
        },
        {
          title: '库位编码',
          align: 'center',
          dataIndex: 'locationCode'
        },
        {
          title: '容器编码',
          align: 'center',
          dataIndex: 'containerCode'
        },
        {
          title: '物料编码',
          align: 'center',
          dataIndex: 'materialCode'
        },
        {
          title: '物料单位',
          align: 'center',
          dataIndex: 'materialUnit'
        },
        {
          title: '序列号',
          align: 'center',
          dataIndex: 'sn'
        },
        {
          title: '状态',
          align: 'center',
          dataIndex: 'status_dictText',
          scopedSlots: {customRender: 'status_dictText'}
        },
        {
          title: '数量',
          align: 'center',
          dataIndex: 'qty'
        },
        {
          title: '创建人',
          align: 'center',
          dataIndex: 'createBy'
        },
        {
          title: '创建日期',
          align: 'center',
          dataIndex: 'createTime'
        },
        {
          title: '更新人',
          align: 'center',
          dataIndex: 'updateBy'
        },
        {
          title: '更新日期',
          align: 'center',
          dataIndex: 'updateTime'
        }
        // {
        //   title: '操作',
        //   dataIndex: 'action',
        //   align:"center",
        //   fixed:"right",
        //   width:147,
        //   scopedSlots: { customRender: 'action' }
        // }
      ],
      url: {
        list: '/shipment/shipmentContainerAdvice/list',
        delete: '/shipment/shipmentContainerAdvice/delete',
        deleteBatch: '/shipment/shipmentContainerAdvice/deleteBatch',
        exportXlsUrl: '/shipment/shipmentContainerAdvice/exportXls',
        importExcelUrl: 'shipment/shipmentContainerAdvice/importExcel'
      },
      dictOptions: {},
      superFieldList: []
    }
  },
  created() {
    this.getSuperFieldList()
    this.loadFrom();
  },
  computed: {
    importExcelUrl: function() {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    }
  },
  methods: {
    solutionZoneCode(value) {
      var actions = []
      Object.keys(this.zoneList).some(key => {
        if (this.zoneList[key].code == '' + value) {
          actions.push(this.zoneList[key].name)
          return true
        }
      })
      return actions.join('')
    },
    loadFrom() {
      getZoneList().then((res) => {
        if (res.success) {
          this.zoneList = res.result
        }
      });
    },
    initDictConfig() {},
    getSuperFieldList() {
      let fieldList = []
      fieldList.push({ type: 'string', value: 'containerCode', text: '容器编码', dictCode: '' })
      fieldList.push({ type: 'string', value: 'locationCode', text: '库位编码', dictCode: '' })
      fieldList.push({ type: 'int', value: 'inventoryDetailId', text: '库存明细id', dictCode: '' })
      fieldList.push({ type: 'int', value: 'shipmentContainerId', text: '出库配盘ID', dictCode: '' })
      fieldList.push({ type: 'string', value: 'shipmentCode', text: '单据编码', dictCode: '' })
      fieldList.push({ type: 'int', value: 'shipmentId', text: '单据ID', dictCode: '' })
      fieldList.push({ type: 'int', value: 'shipmentDetailId', text: '出库明细id', dictCode: '' })
      fieldList.push({ type: 'string', value: 'companyCode', text: '货主', dictCode: '' })
      fieldList.push({ type: 'string', value: 'materialCode', text: '物料编码', dictCode: '' })
      fieldList.push({ type: 'string', value: 'materialName', text: '物料名称', dictCode: '' })
      fieldList.push({ type: 'string', value: 'materialSpec', text: '物料规格', dictCode: '' })
      fieldList.push({ type: 'string', value: 'materialUnit', text: '物料单位', dictCode: '' })
      fieldList.push({ type: 'string', value: 'batch', text: '批次', dictCode: '' })
      fieldList.push({ type: 'int', value: 'status', text: '状态', dictCode: '' })
      fieldList.push({ type: 'BigDecimal', value: 'qty', text: '数量', dictCode: '' })
      fieldList.push({ type: 'string', value: 'createBy', text: '创建人', dictCode: '' })
      fieldList.push({ type: 'datetime', value: 'createTime', text: '创建日期' })
      fieldList.push({ type: 'string', value: 'updateBy', text: '更新人', dictCode: '' })
      fieldList.push({ type: 'datetime', value: 'updateTime', text: '更新日期' })
      this.superFieldList = fieldList
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>