Merge remote-tracking branch 'origin/master'
| | |
| | | </template> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">编辑</a> |
| | | |
| | | <a @click="handleEdit(record)" :disabled="record.orderStatus == '2'">编辑</a> |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> |
| | |
| | | <a-menu-item> |
| | | <a @click="handleDetail(record)">详情</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <!-- <a-menu-item v-if="record.orderStatus != '2'">--> |
| | | <!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">--> |
| | | <!-- <a>删除</a>--> |
| | | <!-- </a-popconfirm>--> |
| | | <!-- </a-menu-item>--> |
| | | <a-menu-item v-if="record.orderStatus != '2'"> |
| | | <a @click="handleSubmit(record.id)" :disabled="record.orderStatus == '3'">提交</a> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.orderStatus != '2'"> |
| | | <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
| | | <a>删除</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm title="确定提交吗?" @confirm="() => handleSubmit(record.id)"> |
| | | <a>提交</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | |
| | | import Vue from 'vue' |
| | | import { ACCESS_TOKEN } from '@/store/mutation-types' |
| | | import store from '@/store' |
| | | |
| | | import { Modal } from 'ant-design-vue'; |
| | | |
| | | export default { |
| | | name: 'CuttingInboundList', |
| | |
| | | deleteBatch: "/cms/cuttingInbound/deleteBatch", |
| | | exportXlsUrl: "/cms/cuttingInbound/exportXls", |
| | | importExcelUrl: "cms/cuttingInbound/importExcel", |
| | | submit: "/cms/cuttingInbound/submit", |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | |
| | | this.$refs.modalForm.title="详情"; |
| | | this.$refs.modalForm.disableSubmit = true; |
| | | }, |
| | | |
| | | // 自定义行点击事件 |
| | | customRow(record) { |
| | | return { |
| | |
| | | /** |
| | | * 单据提交 |
| | | */ |
| | | // handleSubmit: function() { |
| | | handleSubmit: function(id) { |
| | | if (!this.url.submit) { |
| | | this.$message.error('请设置url.submit属性!') |
| | | return |
| | | } |
| | | |
| | | let targetId = id; // 从参数获取ID |
| | | // 如果没有通过参数传递ID,则检查选中的记录 |
| | | if (!targetId) { |
| | | if (this.selectedRowKeys.length != 1) { |
| | | this.$message.warning('请选择一条记录!') |
| | | return |
| | | } else { |
| | | targetId = this.selectedRowKeys[0] |
| | | } |
| | | } |
| | | |
| | | // 将参数作为查询参数附加到URL上 |
| | | let httpurl = this.url.submit + '?orderId=' + encodeURIComponent(targetId) |
| | | let method = 'get' |
| | | var params = {} // 清空params,因为参数已经在URL中传递 |
| | | |
| | | const that = this |
| | | |
| | | this.$confirm({ |
| | | title: '确认提交!', |
| | | // content: '正在提交数据,请耐心等待...', |
| | | okText: '确认', |
| | | cancelText: '取消', |
| | | onOk() { |
| | | // 显示加载提示 |
| | | const hide = that.$message.loading('正在提交数据,请耐心等待...', 0); |
| | | |
| | | // 发送请求 |
| | | return httpAction(httpurl, params, method).then((res) => { |
| | | hide(); // 隐藏加载提示 |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.loadData() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).catch(error => { |
| | | hide(); // 隐藏加载提示 |
| | | that.$message.error('提交失败: ' + error.message) |
| | | }).finally(() => { |
| | | that.loading = false |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // /** |
| | | // * 单据提交(支持实时进度更新) |
| | | // */ |
| | | // handleSubmit: function(id) { |
| | | // if (!this.url.submit) { |
| | | // this.$message.error('请设置url.submit属性!') |
| | | // return |
| | | // } |
| | | // if (this.selectedRowKeys.length != 1) { |
| | | // this.$message.warning('请选择一条记录!') |
| | | // return |
| | | // } else { |
| | | // var id = this.selectedRowKeys[0] |
| | | // let httpurl = this.url.submit |
| | | // let method = 'post' |
| | | // var params = { id: id } |
| | | // |
| | | // const that = this |
| | | // |
| | | // this.$confirm({ |
| | | // title: '确认提交!', |
| | | // okText: '确认', |
| | | // cancelText: '取消', |
| | | // onOk() { |
| | | // httpAction(httpurl, params, method).then((res) => { |
| | | // if (res.success) { |
| | | // that.$message.success(res.message) |
| | | // that.loadData() |
| | | // } else { |
| | | // that.$message.warning(res.message) |
| | | // } |
| | | // }).finally(() => { |
| | | // that.loading = false |
| | | // |
| | | // }) |
| | | // } |
| | | // }) |
| | | // let targetId = id; // 从参数获取ID |
| | | // // 如果没有通过参数传递ID,则检查选中的记录 |
| | | // if (!targetId) { |
| | | // if (this.selectedRowKeys.length != 1) { |
| | | // this.$message.warning('请选择一条记录!') |
| | | // return |
| | | // } else { |
| | | // targetId = this.selectedRowKeys[0] |
| | | // } |
| | | // } |
| | | // |
| | | // const that = this |
| | | // |
| | | // this.$confirm({ |
| | | // title: '确认提交!', |
| | | // content: '提交过程中可能需要较长时间,请耐心等待...', |
| | | // okText: '确认', |
| | | // cancelText: '取消', |
| | | // |
| | | // onOk() { |
| | | // // 创建进度条模态框 |
| | | // let percent = 0; |
| | | // let totalTools = 0; // 刀具总数 |
| | | // let processedTools = 0; // 已处理刀具数 |
| | | // |
| | | // // 使用 this.$info 创建模态框 |
| | | // const modal = that.$info({ |
| | | // title: '正在提交数据', |
| | | // content: that.$createElement('div', [ |
| | | // that.$createElement('p', '正在处理刀具入库,请稍候...'), |
| | | // that.$createElement('a-progress', { |
| | | // props: { |
| | | // percent: percent, |
| | | // status: 'active' |
| | | // } |
| | | // }), |
| | | // // that.$createElement('p', { |
| | | // // style: { |
| | | // // marginTop: '10px' |
| | | // // } |
| | | // // }, `进度: ${processedTools}/${totalTools} 把刀具`) |
| | | // ]), |
| | | // okButtonProps: { style: { display: 'none' } }, // 隐藏确认按钮 |
| | | // cancelText: '取消', |
| | | // closable: false, // 禁止关闭模态框 |
| | | // }); |
| | | // |
| | | // // 更新进度显示函数 |
| | | // const updateProgress = () => { |
| | | // if (totalTools > 0) { |
| | | // percent = Math.round((processedTools / totalTools) * 100); |
| | | // // 确保进度不超过90%,保留最后10%给最终完成 |
| | | // percent = percent > 90 ? 90 : percent; |
| | | // } |
| | | // |
| | | // modal.update({ |
| | | // content: that.$createElement('div', [ |
| | | // that.$createElement('p', '正在处理刀具入库,请稍候...'), |
| | | // that.$createElement('a-progress', { |
| | | // props: { |
| | | // percent: percent, |
| | | // status: 'active' |
| | | // } |
| | | // }), |
| | | // // that.$createElement('p', { |
| | | // // style: { |
| | | // // marginTop: '10px' |
| | | // // } |
| | | // // }, `进度: ${processedTools}/${totalTools} 把刀具`) |
| | | // ]) |
| | | // }); |
| | | // }; |
| | | // |
| | | // // 发送请求 |
| | | // let httpurl = that.url.submit + '?orderId=' + encodeURIComponent(targetId) |
| | | // |
| | | // return httpAction(httpurl, {}, 'get').then((res) => { |
| | | // // 根据后端返回的总刀具数设置进度 |
| | | // if (res.success) { |
| | | // // 如果后端返回了总刀具数 |
| | | // if (res.result && res.result.quantity !== undefined) { |
| | | // totalTools = res.result.quantity; |
| | | // processedTools = res.result.totalSubmitted || 0; //已处理刀具数 |
| | | // } |
| | | // // 如果后端返回了明细列表,根据receive_number计算总数量 |
| | | // else if (res.result && res.result.detailList) { |
| | | // // 根据每个明细的receive_number累加计算总刀具数 |
| | | // totalTools = res.result.detailList.reduce((total, detail) => { |
| | | // return total + (detail.receiveNumber || 0); |
| | | // }, 0); |
| | | // processedTools = totalTools; // 已处理数量 |
| | | // } |
| | | // |
| | | // // 更新进度显示 |
| | | // percent = 100; // 直接显示100%完成 |
| | | // updateProgress(); |
| | | // |
| | | // // 显示完成状态 |
| | | // setTimeout(() => { |
| | | // modal.update({ |
| | | // content: that.$createElement('div', [ |
| | | // that.$createElement('p', '正在处理刀具入库,请稍候...'), |
| | | // that.$createElement('a-progress', { |
| | | // props: { |
| | | // percent: percent, |
| | | // status: 'success' |
| | | // } |
| | | // }), |
| | | // that.$createElement('p', { |
| | | // style: { |
| | | // marginTop: '10px' |
| | | // } |
| | | // }, totalTools > 0 ? |
| | | // `进度: ${processedTools}/${totalTools} 把刀具` : |
| | | // '处理完成') |
| | | // ]) |
| | | // }); |
| | | // |
| | | // // 延迟关闭模态框 |
| | | // setTimeout(() => { |
| | | // modal.destroy(); |
| | | // that.$message.success(res.message || '提交成功'); |
| | | // that.loadData(); |
| | | // }, 500); |
| | | // }, 300); |
| | | // } else { |
| | | // // 处理错误情况 |
| | | // modal.destroy(); |
| | | // that.$message.warning(res.message || '提交失败'); |
| | | // } |
| | | // }).catch(error => { |
| | | // modal.destroy(); |
| | | // that.$message.error('提交失败: ' + error.message) |
| | | // }).finally(() => { |
| | | // that.loading = false |
| | | // }) |
| | | // } |
| | | // }) |
| | | // }, |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | <!-- 库存统计表格 --> |
| | | <div style="margin-top: 20px;"> |
| | | <a-card title="库存统计"> |
| | | <a-table |
| | | :pagination="statisticsPagination" |
| | | :columns="statisticsColumns"/>in |
| | | :dataSource="statisticsData" |
| | | :loading="statisticsLoading" |
| | | bordered |
| | | size="middle"> |
| | | <span slot="inventoryStatus" slot-scope="text"> |
| | | <a-tag :color="getTagColor(text)">{{ text }}</a-tag> |
| | | </span> |
| | | /> |
| | | </a-card> |
| | | </div> |
| | | |
| | | <cutting-inventory-modal ref="modalForm" @ok="modalFormOk"></cutting-inventory-modal> |
| | |
| | | { |
| | | title:'刀具编码', |
| | | align:"center", |
| | | dataIndex: 'cuttingId' |
| | | dataIndex: 'cuttingId_dictText' |
| | | }, |
| | | { |
| | | title:'刀具条码', |
| | |
| | | // scopedSlots: { customRender: 'action' } |
| | | // } |
| | | ], |
| | | // 统计表格列定义 |
| | | statisticsColumns: [ |
| | | { |
| | | title:'刀具编码', |
| | | align:"center", |
| | | dataIndex: 'cuttingCode', |
| | | customRender: (text, record, index) => { |
| | | const obj = { |
| | | children: text, |
| | | attrs: {} |
| | | }; |
| | | // 设置合并逻辑 |
| | | if (record.rowSpan !== undefined) { |
| | | obj.attrs.rowSpan = record.rowSpan; |
| | | } else { |
| | | obj.attrs.rowSpan = 1; |
| | | } |
| | | return obj; |
| | | } |
| | | }, |
| | | { |
| | | title: '库存状态', |
| | | dataIndex: 'inventoryStatus', |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: '数量', |
| | | dataIndex: 'cuttingIdNumber', |
| | | align: "center" |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/cms/cuttingInventory/list", |
| | | delete: "/cms/cuttingInventory/delete", |
| | | deleteBatch: "/cms/cuttingInventory/deleteBatch", |
| | | exportXlsUrl: "/cms/cuttingInventory/exportXls", |
| | | importExcelUrl: "cms/cuttingInventory/importExcel", |
| | | |
| | | statistics: "/cms/cuttingInventory/statistics" // 添加统计接口地址 |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | // 统计数据 |
| | | statisticsData: [], |
| | | statisticsLoading: false, |
| | | |
| | | // 为主表格保留原有的分页配置 |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '30'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' 共' + total + '条' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | // 为统计表格添加单独的分页配置 |
| | | statisticsPagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '30'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' 共' + total + '条' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | this.getSuperFieldList(); |
| | | this.loadStatisticsData(); |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | |
| | | fieldList.push({type:'string',value:'inventoryStatus',text:'库存状态'}) |
| | | fieldList.push({type:'number',value:'currentLife',text:'当前寿命(百分比)'}) |
| | | this.superFieldList = fieldList |
| | | }, |
| | | // 加载统计信息 |
| | | loadStatisticsData() { |
| | | this.statisticsLoading = true; |
| | | // 调用后端接口获取统计数据 |
| | | this.$http({ |
| | | url: this.url.statistics, |
| | | method: "get", |
| | | params: { |
| | | ...this.getQueryParams(), |
| | | pageNo: this.statisticsPagination.current, |
| | | pageSize: this.statisticsPagination.pageSize |
| | | } |
| | | }).then((res) => { |
| | | if (res.success) { |
| | | // 更新统计表格的分页总数 |
| | | this.statisticsPagination.total = res.result.total; |
| | | // 对数据进行合并处理,使用 res.result.records 而不是 res.result |
| | | this.statisticsData = this.mergeStatisticsData(res.result.records); |
| | | } |
| | | this.statisticsLoading = false; |
| | | }).catch(() => { |
| | | this.statisticsLoading = false; |
| | | }); |
| | | }, |
| | | |
| | | // 根据状态返回标签颜色 |
| | | getTagColor(status) { |
| | | const colorMap = { |
| | | '正常': 'green', |
| | | '已出库': 'orange', |
| | | }; |
| | | return colorMap[status]; |
| | | }, |
| | | |
| | | // 重写搜索方法,在搜索完成后加载统计信息 |
| | | searchQuery() { |
| | | this.loadData(1); |
| | | // 搜索完成后加载统计信息 |
| | | this.$nextTick(() => { |
| | | this.loadStatisticsData(); |
| | | }); |
| | | }, |
| | | |
| | | // 重写重置方法 |
| | | searchReset() { |
| | | this.queryParam = {}; |
| | | this.loadData(1); |
| | | this.$nextTick(() => { |
| | | this.loadStatisticsData(); |
| | | }); |
| | | }, |
| | | |
| | | // 重写加载数据方法 |
| | | loadData(arg) { |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | var params = this.getQueryParams();//查询条件 |
| | | this.loading = true; |
| | | this.$http({ |
| | | url: this.url.list, |
| | | method: "get", |
| | | params: params |
| | | }).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records; |
| | | this.ipagination.total = res.result.total; |
| | | |
| | | // 加载统计信息 |
| | | this.loadStatisticsData(); |
| | | } |
| | | this.loading = false; |
| | | }) |
| | | }, |
| | | // 合并统计数据方法 |
| | | mergeStatisticsData(data) { |
| | | if (!data || data.length === 0) return []; |
| | | |
| | | const grouped = {}; |
| | | |
| | | // 按刀具编码分组 |
| | | data.forEach(item => { |
| | | const key = item.cuttingCode; |
| | | if (!grouped[key]) { |
| | | grouped[key] = { |
| | | cuttingCode: item.cuttingCode, |
| | | cuttingId: item.cuttingId, |
| | | statuses: [] |
| | | }; |
| | | } |
| | | // 使用 item.inventoryStatus 和 item.cuttingIdNumber |
| | | grouped[key].statuses.push({ |
| | | status: item.inventoryStatus, |
| | | count: item.cuttingIdNumber |
| | | }); |
| | | }); |
| | | |
| | | // 转换为表格需要的格式,并添加行合并信息 |
| | | const result = []; |
| | | Object.values(grouped).forEach(group => { |
| | | const statuses = group.statuses; |
| | | const totalCount = statuses.reduce((sum, s) => sum + s.count, 0); |
| | | |
| | | // 第一行显示刀具编码,设置rowSpan |
| | | result.push({ |
| | | cuttingCode: group.cuttingCode, |
| | | cuttingId: group.cuttingId, |
| | | inventoryStatus: `${statuses[0].status}:${statuses[0].count}`, |
| | | cuttingIdNumber: totalCount, |
| | | rowSpan: statuses.length // 合并的行数 |
| | | }); |
| | | |
| | | // 剩余行只显示状态信息,刀具编码列rowSpan为0 |
| | | for (let i = 1; i < statuses.length; i++) { |
| | | result.push({ |
| | | cuttingCode: group.cuttingCode, |
| | | cuttingId: group.cuttingId, |
| | | inventoryStatus: `${statuses[i].status}:${statuses[i].count}`, |
| | | cuttingIdNumber: totalCount, |
| | | rowSpan: 0 // 表示被合并 |
| | | }); |
| | | } |
| | | }); |
| | | return result; |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | </script> |
| | | <style scoped> |
| | |
| | | <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-input placeholder="请输入工单号(任务号)" v-model="queryParam.workOrderCode"></j-input> |
| | | <a-form-item label="产线"> |
| | | <j-tree-select dict="base_factory,factory_name,id" pid-field="parent_id" |
| | | v-model="queryParam.factoryId" style="width: 100%"></j-tree-select> |
| | | </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.materialNumber"></j-input> |
| | | <a-form-item label="物料编码"> |
| | | <a-input placeholder="请输入物料编码" v-model="queryParam.materialNumber"></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.materialName"></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="工单状态"> |
| | | <j-dict-select-tag dictCode="work_order_status" placeholder="请输入工单状态" |
| | | <j-dict-select-tag dictCode="work_order_status" placeholder="请选择工单状态" |
| | | v-model="queryParam.workOrderStatus"></j-dict-select-tag> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="重发布人"> |
| | | <j-select-user-by-dep placeholder="请输入重发布人" |
| | | v-model="queryParam.republisher"></j-select-user-by-dep> |
| | | <a-form-item label="工单号(任务号)"> |
| | | <a-input placeholder="请输入工单号(任务号)" v-model="queryParam.workOrderCode"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="排产日期"> |
| | | <a-range-picker |
| | | style="width: 100%" |
| | | @change="dateRangeChange" |
| | | :value="dateRange"> |
| | | </a-range-picker> |
| | | </a-form-item> |
| | | </a-col> |
| | | </template> |
| | |
| | | </a-row> |
| | | <a-row> |
| | | <a-button type="primary" @click="productionSchedule" icon="retweet" style="margin-bottom: 8px">排产</a-button> |
| | | <a-dropdown v-if="selectedRowKeys.length > 1"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="batchPublish"> |
| | | <a-icon type="check"/> |
| | | 发布 |
| | | </a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> |
| | | 批量操作 |
| | | <a-icon type="down"/> |
| | | </a-button> |
| | | </a-dropdown> |
| | | </a-row> |
| | | </a-form> |
| | | </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> |
| | |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type: 'radio'}" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type: 'checkbox'}" |
| | | 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> |
| | | @change="handleTableChange" |
| | | :customRow="clickSelect" |
| | | > |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <span v-if="record.workOrderStatus === 'NEW'"> |
| | |
| | | <a-divider type="vertical" /> |
| | | <a @click="handleCompletenessCheck(record)">齐套性检查</a> |
| | | </span> |
| | | <span v-if="record.workOrderStatus === 'PUBLISHED' && record.equipmentInspectionFlag === '0'"> |
| | | <span v-if="record.workOrderStatus === 'PUBLISHED' && record.completenessCheckFlag === '1' && record.equipmentInspectionFlag === '0'"> |
| | | <a-divider type="vertical" /> |
| | | <a @click="handleCompletenessCheck(record)">设备点检</a> |
| | | </span> |
| | | <span v-if="record.workOrderStatus === 'PUBLISHED' && record.processInspectionFlag === '0'"> |
| | | <span v-if="record.workOrderStatus === 'PUBLISHED' && record.completenessCheckFlag === '1' && record.equipmentInspectionFlag === '1' && record.processInspectionFlag === '0'"> |
| | | <a-divider type="vertical" /> |
| | | <a @click="handleCompletenessCheck(record)">工艺点检</a> |
| | | </span> |
| | |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | <a-tabs v-model="activeKey" @change="handleChangeTabs"> |
| | | <a-tab-pane tab="工单报工" :key="refKeys1[0]" :forceRender="true"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 10px;"> |
| | | </div> |
| | | <j-vxe-table |
| | | keep-source |
| | | :ref="refKeys1[0]" |
| | | <a-tab-pane tab="工单报工" :key="tabsRefKeys[0]" :forceRender="true"> |
| | | <a-table |
| | | :ref="tabsRefKeys[0]" |
| | | :loading="mesWorkReporting.loading" |
| | | :columns="mesWorkReporting.columns" |
| | | :dataSource="mesWorkReporting.dataSource" |
| | | :maxHeight="300" |
| | | :rowNumber="true" |
| | | :rowSelection="true" |
| | | :toolbar="false"> |
| | | <template slot="showDetail" slot-scope="{row}"> |
| | | <a-button type="primary" @click="handleOrderDetail(row)" size="small"> |
| | | <a-icon type="eye" />订单详情 |
| | | </a-button> |
| | | </template> |
| | | </j-vxe-table> |
| | | :pagination="false" |
| | | :scroll="{ y: 300 }" |
| | | size="middle" |
| | | bordered> |
| | | </a-table> |
| | | </a-tab-pane> |
| | | <a-tab-pane tab="上下料查询" :key="refKeys3[0]" :forceRender="true"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 10px;"> |
| | | </div> |
| | | <j-vxe-table |
| | | keep-source |
| | | :ref="refKeys3[0]" |
| | | <a-tab-pane tab="上下料查询" :key="tabsRefKeys[1]" :forceRender="true"> |
| | | <a-table |
| | | :ref="tabsRefKeys[1]" |
| | | :loading="mesMaterialLoading.loading" |
| | | :columns="mesMaterialLoading.columns" |
| | | :dataSource="mesMaterialLoading.dataSource" |
| | | :maxHeight="300" |
| | | :rowNumber="true" |
| | | :rowSelection="true" |
| | | :toolbar="false"> |
| | | <template slot="showUnloadingDetail" slot-scope="{row}"> |
| | | <a-button type="primary" @click="handleUnLoadingDetail(row)" size="small"> |
| | | <a-icon type="eye" />下料详情 |
| | | </a-button> |
| | | </template> |
| | | </j-vxe-table> |
| | | :pagination="false" |
| | | :scroll="{ y: 300 }" |
| | | size="middle" |
| | | bordered> |
| | | </a-table> |
| | | </a-tab-pane> |
| | | <a-tab-pane tab="齐套性检查记录" :key="refKeys4[0]" :forceRender="true"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 10px;"> |
| | | </div> |
| | | <j-vxe-table |
| | | keep-source |
| | | :ref="refKeys4[0]" |
| | | <a-tab-pane tab="齐套性检查记录" :key="tabsRefKeys[2]" :forceRender="true"> |
| | | <a-table |
| | | :ref="tabsRefKeys[2]" |
| | | :loading="mesKittingCompletenessCheck.loading" |
| | | :columns="mesKittingCompletenessCheck.columns" |
| | | :dataSource="mesKittingCompletenessCheck.dataSource" |
| | | :maxHeight="300" |
| | | :rowNumber="true" |
| | | :rowSelection="true" |
| | | :toolbar="false" |
| | | /> |
| | | :pagination="false" |
| | | :scroll="{ y: 300 }" |
| | | size="middle" |
| | | bordered> |
| | | </a-table> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | </a-spin> |
| | |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import MesProductionWorkOrderModal from './modules/MesProductionWorkOrderModal' |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import { JVXETypes } from '@/components/jeecg/JVxeTable' |
| | | import { filterMultiDictText } from '@/components/dict/JDictSelectUtil' |
| | | import { getAction, requestPut } from '@api/manage' |
| | | import MesProductionOrderModal from '@views/mes/modules/MesProductionOrderModal.vue' |
| | |
| | | import MesProductionWorkOrderRepublishModal from '@views/mes/modules/MesProductionWorkOrderRepublishModal.vue' |
| | | import MesProductionWorkOrderReportModal from '@views/mes/modules/MesProductionWorkOrderReportModal.vue' |
| | | import MesProductionWorkOrderCompletenessCheckModal from '@views/mes/modules/MesProductionWorkOrderCompletenessCheckModal.vue' |
| | | import JSelectFactory from '@comp/jeecgbiz/JSelectFactory.vue' |
| | | import moment from 'moment/moment' |
| | | |
| | | export default { |
| | | name: 'MesProductionWorkOrderList', |
| | | mixins: [JeecgListMixin, mixinDevice, JVxeTableModelMixin, JVXETypes], |
| | | mixins: [JeecgListMixin, mixinDevice], |
| | | components: { |
| | | JSelectFactory, |
| | | MesProductionWorkOrderModal, |
| | | MesProductionOrderModal, |
| | | MesMaterialUnloadingList, |
| | |
| | | return { |
| | | description: '排产工单管理页面', |
| | | activeKey : 'mesWorkReporting', |
| | | // 工单报工 |
| | | refKeys1: ['mesWorkReporting'], |
| | | tableKeys1: ['mesWorkReporting'], |
| | | //上料 |
| | | refKeys3: ['mesMaterialLoading'], |
| | | tableKeys3: ['mesMaterialLoading'], |
| | | //齐套性检查记录 |
| | | refKeys4: ['mesKittingCompletenessCheck'], |
| | | tableKeys4: ['mesKittingCompletenessCheck'], |
| | | confirmLoading: false, |
| | | tabsRefKeys: ['mesWorkReporting', 'mesMaterialLoading', 'mesKittingCompletenessCheck'], |
| | | /* 分页参数 */ |
| | | ipagination:{ |
| | | current: 1, |
| | | pageSize: 5, |
| | | pageSizeOptions: ['5', '10', '20'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + "-" + range[1] + " 共" + total + "条" |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | |
| | | dataSource: [], |
| | | columns: [ |
| | | { |
| | | title: '操作', |
| | | key: 'action', |
| | | type: JVXETypes.slot, |
| | | slotName: 'showDetail', |
| | | width: '120px', |
| | | align: 'center' |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: '订单号', |
| | | key: 'orderCode', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'orderCode' |
| | | }, |
| | | { |
| | | title: '工单号', |
| | | key: 'workOrderCode', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'workOrderCode' |
| | | }, |
| | | { |
| | | title: '产线名称', |
| | | key: 'factoryName', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'factoryName' |
| | | }, |
| | | { |
| | | title: '批次号', |
| | | key: 'batchNumber', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'batchNumber' |
| | | }, |
| | | { |
| | | title: '托号', |
| | | key: 'palletNumber', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'palletNumber' |
| | | }, |
| | | { |
| | | title: '数量', |
| | | key: 'quantity', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'quantity' |
| | | }, |
| | | { |
| | | title: '报工人', |
| | | key: 'reporter', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'reporter' |
| | | }, |
| | | { |
| | | title: '报工时间', |
| | | key: 'reportTime', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'reportTime' |
| | | }, |
| | | { |
| | | title: '线边仓名称', |
| | | key: 'warehouseName', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'warehouseName' |
| | | }, |
| | | { |
| | | title: '成品下线打印状态', |
| | | key: 'printStatus', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | }, |
| | | // { |
| | | // title: '成品下线打印状态', |
| | | // align: 'center', |
| | | // dataIndex: 'printStatus' |
| | | // } |
| | | ] |
| | | }, |
| | | mesMaterialLoading: { |
| | |
| | | dataSource: [], |
| | | columns: [ |
| | | { |
| | | title: '操作', |
| | | key: 'action', |
| | | type: JVXETypes.slot, |
| | | slotName: 'showUnloadingDetail', |
| | | width: '120px', |
| | | align: 'center' |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: '工单号', |
| | | key: 'workOrderCode', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'workOrderCode' |
| | | }, |
| | | { |
| | | title: '设备ID', |
| | | key: 'equipmentId', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | title: '设备', |
| | | align: 'center', |
| | | dataIndex: 'equipmentId' |
| | | }, |
| | | { |
| | | title: '工序编码', |
| | | key: 'processCode', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'processCode' |
| | | }, |
| | | { |
| | | title: '工序名称', |
| | | key: 'processName', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'processName' |
| | | }, |
| | | { |
| | | title: '物料编码', |
| | | key: 'materialNumber', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'materialNumber' |
| | | }, |
| | | { |
| | | title: '物料名称', |
| | | key: 'materialName', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'materialName' |
| | | }, |
| | | { |
| | | title: '批次号', |
| | | key: 'batchNumber', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'batchNumber' |
| | | }, |
| | | { |
| | | title: '数量', |
| | | key: 'quantity', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'quantity' |
| | | }, |
| | | { |
| | | title: '剩余数量', |
| | | key: 'remainingQuantity', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | }, |
| | | align: 'center', |
| | | dataIndex: 'remainingQuantity' |
| | | } |
| | | ] |
| | | }, |
| | | mesKittingCompletenessCheck: { |
| | |
| | | dataSource: [], |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: '工单号', |
| | | key: 'workOrderCode', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'workOrderCode' |
| | | }, |
| | | { |
| | | title: '物料编号', |
| | | key: 'materialNumber', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'materialNumber' |
| | | }, |
| | | { |
| | | title: '物料名称', |
| | | key: 'materialName', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'materialName' |
| | | }, |
| | | { |
| | | title: '需求数量', |
| | | key: 'requiredQuantity', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'requiredQuantity' |
| | | }, |
| | | { |
| | | title: '实际数量', |
| | | key: 'actualQuantity', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | align: 'center', |
| | | dataIndex: 'actualQuantity' |
| | | }, |
| | | { |
| | | title: '是否齐备', |
| | | key: 'checkFlag', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | }, |
| | | align: 'center', |
| | | dataIndex: 'checkFlag', |
| | | customRender: function(text) { |
| | | return text === '0' ? '否' : text === '1' ? '是' : '' |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | | url: { |
| | |
| | | execute: '/mes/mesProductionWorkOrder/execute', |
| | | }, |
| | | dictOptions: {}, |
| | | superFieldList: [] |
| | | superFieldList: [], |
| | | dateRange: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList() |
| | | }, |
| | | computed: { |
| | | tabsKeyMap() { |
| | | return { |
| | | mesWorkReporting: { |
| | | url: this.url.queryWorkReportingByWorkOrderId, |
| | | loading: this.mesWorkReporting.loading, |
| | | data: this.mesWorkReporting.dataSource, |
| | | setLoading: (loading) => { this.mesWorkReporting.loading = loading }, |
| | | setData: (data) => { this.mesWorkReporting.dataSource = data } |
| | | }, |
| | | mesMaterialLoading: { |
| | | url: this.url.queryLoadingByWorkOrderId, |
| | | loading: this.mesMaterialLoading.loading, |
| | | data: this.mesMaterialLoading.dataSource, |
| | | setLoading: (loading) => { this.mesMaterialLoading.loading = loading }, |
| | | setData: (data) => { this.mesMaterialLoading.dataSource = data } |
| | | }, |
| | | mesKittingCompletenessCheck: { |
| | | url: this.url.queryCompletenessCheckByWorkOrderId, |
| | | loading: this.mesKittingCompletenessCheck.loading, |
| | | data: this.mesKittingCompletenessCheck.dataSource, |
| | | setLoading: (loading) => { this.mesKittingCompletenessCheck.loading = loading }, |
| | | setData: (data) => { this.mesKittingCompletenessCheck.dataSource = data } |
| | | } |
| | | } |
| | | }, |
| | | importExcelUrl: function() { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` |
| | | } |
| | | }, |
| | | methods: { |
| | | handleChangeTabs(key) { |
| | | this.activeKey = key |
| | | this.selectTabData(key, this.selectedRowKeys[0]) |
| | | }, |
| | | clickSelect(record) { |
| | | return { |
| | | on: { |
| | | click: () => { |
| | | this.selectedRowKeys = [record.id] |
| | | this.selectTabData(this.activeKey, record.id) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | selectTabData(tabKey, workOrderId) { |
| | | const tab = this.tabsKeyMap[tabKey] |
| | | if (tab) { |
| | | tab.setLoading(true) |
| | | getAction(tab.url, { workOrderId: workOrderId }).then(res => { |
| | | if (res.success) { |
| | | tab.setData(res.result || []) |
| | | } |
| | | }).catch(error => { |
| | | console.error('Error loading tab data:', error) |
| | | tab.setData([]) |
| | | }).finally(() => { |
| | | tab.setLoading(false) |
| | | }) |
| | | } |
| | | }, |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.dateRange = [] |
| | | this.loadData(1); |
| | | }, |
| | | dateRangeChange(dates, dateStrings) { |
| | | this.dateRange = dates |
| | | this.queryParam.startDate = dateStrings[0] |
| | | this.queryParam.endDate = dateStrings[1] |
| | | }, |
| | | productionSchedule() { |
| | | this.$refs.MesProductionWorkOrderScheduleModal.scheduleOpen() |
| | | }, |
| | | batchPublish() { |
| | | if (this.selectedRowKeys.length < 1) { |
| | | this.$message.warning('请选择多条记录!') |
| | | return |
| | | } |
| | | const ids = this.selectedRowKeys.join(',') |
| | | this.handlePublish(ids) |
| | | this.selectedRowKeys = [] |
| | | }, |
| | | handlePublish(id) { |
| | | requestPut(this.url.publish, null, { ids: id }).then((res) => { |
| | | if (res.success) { |
| | |
| | | }); |
| | | }, |
| | | // 打印标签 |
| | | printLabel() { |
| | | this.generateQRCode('成品托标签'); // 先生成二维码 |
| | | printLabel(palletNumber) { |
| | | this.generateQRCode(palletNumber); // 先生成二维码 |
| | | setTimeout(() => { |
| | | printJS({ |
| | | printable: 'printLabel', |
| | |
| | | } |
| | | //成品托标签打印 |
| | | this.$nextTick(() => { |
| | | this.printLabel() |
| | | this.printLabel(data.palletNumber) |
| | | }) |
| | | } |
| | | this.submitCallback() |