From 255ea18d2a0f7b991e28db72ee2cda49f6d7ea90 Mon Sep 17 00:00:00 2001 From: houshuai <17802598606@163.com> Date: 星期四, 10 七月 2025 14:58:48 +0800 Subject: [PATCH] 生产管控模块 基本搭建4.1 --- src/views/mes/MesMaterialLoadingListView.vue | 412 ++++++++++++++++++++++++++++++++++------------------------ 1 files changed, 242 insertions(+), 170 deletions(-) diff --git a/src/views/mes/MesMaterialLoadingListView.vue b/src/views/mes/MesMaterialLoadingListView.vue index 25dd3fe..8bedb56 100644 --- a/src/views/mes/MesMaterialLoadingListView.vue +++ b/src/views/mes/MesMaterialLoadingListView.vue @@ -1,12 +1,13 @@ <template> - <a-card :bordered="false" title="涓婃枡"> + <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> + <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"> @@ -16,12 +17,14 @@ </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> + <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> + <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"> @@ -40,58 +43,45 @@ </div> <!-- 鏌ヨ鍖哄煙-END --> - <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> - <div class="table-operator"> - <a-dropdown v-if="selectedRowKeys.length > 0"> - <a-menu slot="overlay"> - <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item> - </a-menu> - <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> - </a-dropdown> - </div> - <!-- 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-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"> - <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}" - 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" /> @@ -109,136 +99,218 @@ </a-menu> </a-dropdown> </span> - - </a-table> - </div> - + </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 '@/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], - components: { - MesMaterialLoadingModal - }, - 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: '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' } +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 } - ], - url: { - list: "/mes/mesMaterialLoading/list", - delete: "/mes/mesMaterialLoading/delete", - deleteBatch: "/mes/mesMaterialLoading/deleteBatch", - exportXlsUrl: "/mes/mesMaterialLoading/exportXls", - importExcelUrl: "mes/mesMaterialLoading/importExcel", - }, - dictOptions:{}, - superFieldList:[], + { + 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 + // 鍗曢�夋ā寮忎笅锛宻electedRowKeys 鏄暟缁勶紝浣嗛暱搴︽渶澶氫负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 } }, - created() { - this.getSuperFieldList(); - }, - computed: { - importExcelUrl: function(){ - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; - }, - }, - methods: { - initDictConfig(){ - }, - 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 - } + 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'; +@import '~@assets/less/common.less'; </style> \ No newline at end of file -- Gitblit v1.9.3