<template>
|
<a-card :bordered="false" title="上下料查询">
|
<!-- 查询区域 -->
|
<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="工单号">
|
<j-search-select-tag placeholder="请输入工工单号" v-model="queryParam.workOrderId"
|
dict="mes_production_work_order,work_order_code,id"></j-search-select-tag>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="设备ID">
|
<j-input placeholder="请输入设备ID" v-model="queryParam.equipmentId"></j-input>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="物料编码">
|
<j-input dictCode="work_order_status" placeholder="请输入物料编码"
|
v-model="queryParam.materialNumber"></j-input>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="物料名称">
|
<j-input dictCode="work_order_status" placeholder="请输入物料名称"
|
v-model="queryParam.materialName"></j-input>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="批次号">
|
<j-input placeholder="请输入批次号" v-model="queryParam.batchNumber"></j-input>
|
</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 -->
|
|
<!-- table区域-begin -->
|
<a-spin :spinning="confirmLoading">
|
<div>
|
<a-table
|
ref="table"
|
size="middle"
|
:scroll="{x:true}"
|
bordered
|
rowKey="id"
|
:columns="columns"
|
:dataSource="dataSource"
|
:pagination="ipagination"
|
:loading="loading"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type: 'radio'}"
|
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>
|
|
<span slot="action" slot-scope="text, record">
|
<a @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>
|
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
<a>删除</a>
|
</a-popconfirm>
|
</a-menu-item>
|
</a-menu>
|
</a-dropdown>
|
</span>
|
</a-table>
|
</div>
|
<a-tabs v-model="activeKey" @change="handleChangeTabs">
|
<a-tab-pane tab="下料" :key="refKeys[0]" :forceRender="true">
|
<div style="display: flex; align-items: center; margin-bottom: 10px;">
|
</div>
|
<j-vxe-table
|
keep-source
|
:ref="refKeys[0]"
|
:loading="mesMaterialUnloading.loading"
|
:columns="mesMaterialUnloading.columns"
|
:dataSource="mesMaterialUnloading.dataSource"
|
:maxHeight="300"
|
:rowNumber="true"
|
:rowSelection="true"
|
:toolbar="false"
|
/>
|
</a-tab-pane>
|
</a-tabs>
|
</a-spin>
|
<mes-material-loading-modal ref="modalForm" @ok="modalFormOk"></mes-material-loading-modal>
|
</a-card>
|
</template>
|
|
<script>
|
|
import '@/assets/less/TableExpand.less'
|
import { mixinDevice } from '@/utils/mixin'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import MesMaterialLoadingModal from './modules/MesMaterialLoadingModal'
|
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
|
import { JVXETypes } from '@/components/jeecg/JVxeTable'
|
import { getAction } from '@api/manage'
|
|
export default {
|
name: 'MesMaterialLoadingList',
|
mixins: [JeecgListMixin, mixinDevice,JVxeTableModelMixin,JVXETypes],
|
components: {
|
MesMaterialLoadingModal
|
},
|
data() {
|
return {
|
description: '上料管理页面',
|
refKeys: ['mesMaterialUnloading'],
|
tableKeys: ['mesMaterialUnloading'],
|
activeKey: 'mesMaterialUnloading',
|
// 表头
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
width: 60,
|
align: 'center',
|
customRender: function(t, r, index) {
|
return parseInt(index) + 1
|
}
|
},
|
{
|
title: '工单号',
|
align: 'center',
|
dataIndex: 'workOrderId_dictText'
|
},
|
{
|
title: '设备ID',
|
align: 'center',
|
dataIndex: 'equipmentId'
|
},
|
{
|
title: '工序编码',
|
align: 'center',
|
dataIndex: 'processCode'
|
},
|
{
|
title: '工序名称',
|
align: 'center',
|
dataIndex: 'processName'
|
},
|
{
|
title: '物料编码',
|
align: 'center',
|
dataIndex: 'materialNumber'
|
},
|
{
|
title: '物料名称',
|
align: 'center',
|
dataIndex: 'materialName'
|
},
|
{
|
title: '批次号',
|
align: 'center',
|
dataIndex: 'batchNumber'
|
},
|
{
|
title: '数量',
|
align: 'center',
|
dataIndex: 'quantity'
|
},
|
{
|
title: '剩余数量',
|
align: 'center',
|
dataIndex: 'remainingQuantity'
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
align: 'center',
|
fixed: 'right',
|
width: 147,
|
scopedSlots: { customRender: 'action' }
|
}
|
],
|
mesMaterialUnloading: {
|
loading: false,
|
dataSource: [],
|
columns: [
|
// {
|
// title: '上料',
|
// key: 'loadingId',
|
// type: JVXETypes.input,
|
// width: '200px',
|
// placeholder: '请输入${title}',
|
// defaultValue: ''
|
// },
|
{
|
title: '物料编码',
|
key: 'materialNumber',
|
type: JVXETypes.input,
|
width: '200px',
|
placeholder: '请输入${title}',
|
defaultValue: ''
|
},
|
{
|
title: '物料名称',
|
key: 'materialName',
|
type: JVXETypes.input,
|
width: '200px',
|
placeholder: '请输入${title}',
|
defaultValue: ''
|
},
|
{
|
title: '批次号',
|
key: 'batchNumber',
|
type: JVXETypes.input,
|
width: '200px',
|
placeholder: '请输入${title}',
|
defaultValue: ''
|
},
|
{
|
title: '数量',
|
key: 'quantity',
|
type: JVXETypes.input,
|
width: '200px',
|
placeholder: '请输入${title}',
|
defaultValue: ''
|
}
|
]
|
},
|
url: {
|
list: '/mes/mesMaterialLoading/list',
|
delete: '/mes/mesMaterialLoading/delete',
|
deleteBatch: '/mes/mesMaterialLoading/deleteBatch',
|
exportXlsUrl: '/mes/mesMaterialLoading/exportXls',
|
importExcelUrl: 'mes/mesMaterialLoading/importExcel',
|
queryUnloadingByLoadingId:'/mes/mesMaterialLoading/queryUnloadingByLoadingId'
|
},
|
dictOptions: {},
|
superFieldList: []
|
}
|
},
|
created() {
|
this.getSuperFieldList()
|
},
|
computed: {
|
importExcelUrl: function() {
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
}
|
},
|
methods: {
|
initDictConfig() {
|
},
|
async onSelectChange(selectedRowKeys) {
|
this.mesMaterialUnloading.loading = true
|
// 单选模式下,selectedRowKeys 是数组,但长度最多为1
|
console.log('点击了---->',selectedRowKeys[0])
|
this.selectedRowKeys = selectedRowKeys
|
this.mesMaterialUnloading.dataSource=[]
|
// 获取选中行的完整数据
|
if (selectedRowKeys.length > 0) {
|
const selectedId = selectedRowKeys[0] // 选中行的id
|
const mesMaterialUnloading = await getAction(this.url.queryUnloadingByLoadingId, { 'loadingId': selectedId })
|
this.mesMaterialUnloading.dataSource = mesMaterialUnloading.result
|
this.mesMaterialUnloading.loading = false
|
}
|
},
|
getSuperFieldList() {
|
let fieldList = []
|
fieldList.push({ type: 'int', value: 'delFlag', text: '删除标记', dictCode: '' })
|
fieldList.push({ type: 'string', value: 'workOrderId', text: '工单ID', dictCode: '' })
|
fieldList.push({ type: 'string', value: 'equipmentId', text: '设备ID', dictCode: '' })
|
fieldList.push({ type: 'string', value: 'processCode', text: '工序编码', dictCode: '' })
|
fieldList.push({ type: 'string', value: 'processName', text: '工序名称', dictCode: '' })
|
fieldList.push({ type: 'string', value: 'materialNumber', text: '物料编码', dictCode: '' })
|
fieldList.push({ type: 'string', value: 'materialName', text: '物料名称', dictCode: '' })
|
fieldList.push({ type: 'string', value: 'batchNumber', text: '批次号', dictCode: '' })
|
fieldList.push({ type: 'double', value: 'quantity', text: '数量', dictCode: '' })
|
fieldList.push({ type: 'double', value: 'remainingQuantity', text: '剩余数量', dictCode: '' })
|
this.superFieldList = fieldList
|
}
|
}
|
}
|
</script>
|
<style scoped>
|
@import '~@assets/less/common.less';
|
</style>
|