|
@@ -4,8 +4,8 @@
|
|
|
<el-container>
|
|
<el-container>
|
|
|
<layout-sider :resize-directions="['right']" :width="220" style="margin-right: 10px;" >
|
|
<layout-sider :resize-directions="['right']" :width="220" style="margin-right: 10px;" >
|
|
|
<div class="JKWTree-tree" style="height: 70vh;">
|
|
<div class="JKWTree-tree" style="height: 70vh;">
|
|
|
- <h3>服装半成品返工维护</h3>
|
|
|
|
|
- <el-tree :data="treeData" highlight-current @node-click="handleNodeClick"/>
|
|
|
|
|
|
|
+ <h3>服装半成品返工维护</h3>
|
|
|
|
|
+ <el-tree :data="treeData" class="treecolor" highlight-current @node-click="handleNodeClick"/>
|
|
|
</div>
|
|
</div>
|
|
|
</layout-sider>
|
|
</layout-sider>
|
|
|
<el-container>
|
|
<el-container>
|
|
@@ -16,34 +16,36 @@
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-input v-model="searchinfo" @keydown="keydown_onSearch($event)" placeholder="输入工单编号或产品名称" style="width: 180px;" />
|
|
<el-input v-model="searchinfo" @keydown="keydown_onSearch($event)" placeholder="输入工单编号或产品名称" style="width: 180px;" />
|
|
|
<el-button type="primary" class="search" icon="search" @click="onSearch"></el-button>
|
|
<el-button type="primary" class="search" icon="search" @click="onSearch"></el-button>
|
|
|
- <el-button type="primary" class="bt" icon="plus" @click="onAdd">新增返工</el-button>
|
|
|
|
|
- <el-button type="primary" class="bt" icon="delete" @click="Del">删除</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" class="bt" icon="plus" @click="onAdd">新增半成品</el-button>
|
|
|
|
|
+ <!-- <el-button type="primary" class="bt" icon="delete" @click="Del">删除</el-button> -->
|
|
|
<div style="margin-left: auto;">
|
|
<div style="margin-left: auto;">
|
|
|
- <el-button type="primary" :icon="Download" @click="exportExcel">导出到Excel</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" :icon="Download" @click="exportExcel">导出到Excel(汇总)</el-button>
|
|
|
|
|
+ <el-button type="primary" :icon="Download" @click="exportExcel2">导出到Excel(明细)</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<!-- 数据展示 -->
|
|
<!-- 数据展示 -->
|
|
|
<el-table ref="multipleTable" style="width: 100%;height: 70vh;" tooltip-effect="dark" :data="tableData" row-key="ID"
|
|
<el-table ref="multipleTable" style="width: 100%;height: 70vh;" tooltip-effect="dark" :data="tableData" row-key="ID"
|
|
|
- highlight-current-row="true" border @selection-change="handleSelectionChange"
|
|
|
|
|
- :row-style="{ height: '20px' }" :header-cell-style="{ padding: '0px' }" id="table"
|
|
|
|
|
|
|
+ highlight-current-row="true" border @selection-change="handleSelectionChange" id="table"
|
|
|
|
|
+ :row-style="{ height: '20px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
:show-overflow-tooltip="true" @row-click="Click" @row-dblclick="doubleClick">
|
|
:show-overflow-tooltip="true" @row-click="Click" @row-dblclick="doubleClick">
|
|
|
- <el-table-column align="left" label="订单编号" prop="订单编号" width="120" />
|
|
|
|
|
- <el-table-column align="left" label="生产款号" prop="生产款号" width="120" />
|
|
|
|
|
- <el-table-column align="left" label="款式" prop="款式" width="120" />
|
|
|
|
|
- <el-table-column align="left" label="面料分类" prop="面料分类" width="120" />
|
|
|
|
|
|
|
+ <el-table-column align="left" label="单据编号" prop="单据编号" width="140" />
|
|
|
<el-table-column align="left" label="面料名称" prop="面料名称" width="120" />
|
|
<el-table-column align="left" label="面料名称" prop="面料名称" width="120" />
|
|
|
|
|
+ <el-table-column align="left" label="返工数量" prop="数量" width="100" />
|
|
|
|
|
+ <el-table-column align="left" label="订单编号" prop="订单编号" width="190" />
|
|
|
|
|
+ <el-table-column align="left" label="生产款号" prop="生产款号" width="140" />
|
|
|
|
|
+ <el-table-column align="left" label="款式" prop="款式" width="120" />
|
|
|
<el-table-column align="left" label="颜色" prop="颜色" width="100" />
|
|
<el-table-column align="left" label="颜色" prop="颜色" width="100" />
|
|
|
- <el-table-column align="left" label="尺码" prop="尺码" width="100" />
|
|
|
|
|
- <el-table-column align="left" label="数量" prop="数量" width="80" />
|
|
|
|
|
- <el-table-column align="left" label="计划用料" prop="计划用料" width="100" />
|
|
|
|
|
- <el-table-column align="left" label="实际用料" prop="实际用料" width="100" />
|
|
|
|
|
<el-table-column align="left" label="问题分类" prop="问题分类" width="120" />
|
|
<el-table-column align="left" label="问题分类" prop="问题分类" width="120" />
|
|
|
- <el-table-column align="left" label="备注" prop="备注" width="120" />
|
|
|
|
|
- <el-table-column align="left" label="返工车缝小组" prop="组别" width="120" />
|
|
|
|
|
- <el-table-column align="left" label="操作人员" prop="Sys_id" width="120" />
|
|
|
|
|
<el-table-column align="left" label="创建时间" prop="Sys_rq" width="120" />
|
|
<el-table-column align="left" label="创建时间" prop="Sys_rq" width="120" />
|
|
|
-
|
|
|
|
|
|
|
+ <el-table-column fixed="right" label="操作" width="130">
|
|
|
|
|
+ <template #default="{ row, $index }">
|
|
|
|
|
+ <el-button @click="Order_detailsRow(row,$index)" type="success" size="small"
|
|
|
|
|
+ style="font-size: 16px;padding: 0px;width: 90px;">
|
|
|
|
|
+ 查看明细
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
|
|
|
</el-table>
|
|
</el-table>
|
|
|
<!-- 分页 -->
|
|
<!-- 分页 -->
|
|
@@ -65,10 +67,10 @@ style="width: 90%; height: 90%; margin-top: 3%;"
|
|
|
>
|
|
>
|
|
|
<el-form :model="formData" label-position="right" ref="elFormRef" :rules="rule" label-width="120px">
|
|
<el-form :model="formData" label-position="right" ref="elFormRef" :rules="rule" label-width="120px">
|
|
|
<!-- 日期选择框 -->
|
|
<!-- 日期选择框 -->
|
|
|
- <el-row :gutter="24" style="margin-bottom: 20px;">
|
|
|
|
|
|
|
+ <el-row :gutter="10" >
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="日期">
|
|
|
|
|
- <el-date-picker v-model="DefectiveformData['Sys_rq']" style="width: 100%;" type="date" />
|
|
|
|
|
|
|
+ <el-form-item label="日期" label-width="50px">
|
|
|
|
|
+ <el-date-picker v-model="DefectiveformData['Sys_rq']" style="width: 40%;" type="date" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -88,25 +90,45 @@ style="width: 90%; height: 90%; margin-top: 3%;"
|
|
|
:show-overflow-tooltip="true"
|
|
:show-overflow-tooltip="true"
|
|
|
>
|
|
>
|
|
|
<!-- 订单编号|款号 -->
|
|
<!-- 订单编号|款号 -->
|
|
|
- <el-table-column label="订单编号|款号" width="220">
|
|
|
|
|
|
|
+ <el-table-column label="订单编号|款号" width="300">
|
|
|
<template #default="{ row, $index }">
|
|
<template #default="{ row, $index }">
|
|
|
- <el-input v-model="row.ddbh" placeholder="Enter回车" @keyup.enter="getGxMcsubmit($event, $index)" />
|
|
|
|
|
- </template>
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="row.ddbh"
|
|
|
|
|
+ placeholder="请输入或选择订单号"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ clearable
|
|
|
|
|
+ remote
|
|
|
|
|
+ :remote-method="(query) => searchOrder(query, $index)"
|
|
|
|
|
+ @change="(value) => handleOrderSelect(value, $index)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="ddbh in row.ddbhOptions"
|
|
|
|
|
+ :key="ddbh.value"
|
|
|
|
|
+ :label="ddbh.label"
|
|
|
|
|
+ :value="ddbh.value"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
|
|
- <!-- 款式 -->
|
|
|
|
|
- <el-table-column label="款式" width="120">
|
|
|
|
|
|
|
+ <!-- 面料分类|面料名称 -->
|
|
|
|
|
+ <el-table-column label="面料分类|面料名称" width="220">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
- <el-input v-model="row.ks" />
|
|
|
|
|
|
|
+ <el-select v-model="row.material" placeholder="请选择面料" >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="material in row.materialOptions"
|
|
|
|
|
+ :key="material.value"
|
|
|
|
|
+ :label="material.label"
|
|
|
|
|
+ :value="material.value"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
<!-- 颜色 -->
|
|
<!-- 颜色 -->
|
|
|
- <el-table-column label="颜色" width="100">
|
|
|
|
|
|
|
+ <el-table-column label="颜色" width="160">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
- <el-select v-model="row.color" placeholder="请选择颜色" clearable>
|
|
|
|
|
|
|
+ <el-select v-model="row.color" placeholder="请选择颜色" >
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="color in row.colorOptions"
|
|
v-for="color in row.colorOptions"
|
|
|
:key="color.value"
|
|
:key="color.value"
|
|
@@ -117,8 +139,8 @@ style="width: 90%; height: 90%; margin-top: 3%;"
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
|
|
- <!-- 尺码 -->
|
|
|
|
|
- <el-table-column label="尺码" width="100">
|
|
|
|
|
|
|
+ <!-- 尺码 -->
|
|
|
|
|
+ <el-table-column label="尺码" width="160">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
<el-select v-model="row.size" placeholder="请选择尺码" clearable>
|
|
<el-select v-model="row.size" placeholder="请选择尺码" clearable>
|
|
|
<el-option
|
|
<el-option
|
|
@@ -131,29 +153,16 @@ style="width: 90%; height: 90%; margin-top: 3%;"
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
|
|
- <!-- 面料分类|面料名称 -->
|
|
|
|
|
- <el-table-column label="面料分类|面料名称" width="220">
|
|
|
|
|
- <template #default="{ row }">
|
|
|
|
|
- <el-select v-model="row.material" placeholder="请选择面料分类|面料名称" clearable>
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="material in row.materialOptions"
|
|
|
|
|
- :key="material.value"
|
|
|
|
|
- :label="material.label"
|
|
|
|
|
- :value="material.value"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
|
|
|
|
|
- <!-- 返工数量 -->
|
|
|
|
|
- <el-table-column label="返工数量" width="100">
|
|
|
|
|
|
|
+ <!-- 返工数量 -->
|
|
|
|
|
+ <el-table-column label="返工数量" width="100">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
<el-input v-model="row.defectiveQuantity" />
|
|
<el-input v-model="row.defectiveQuantity" />
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<!-- 返工车缝小组 -->
|
|
<!-- 返工车缝小组 -->
|
|
|
- <el-table-column label="返工车缝小组" width="120">
|
|
|
|
|
|
|
+ <el-table-column label="返工车缝小组" width="150">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
<el-select v-model="row.group" placeholder="请选择返工车缝小组" clearable>
|
|
<el-select v-model="row.group" placeholder="请选择返工车缝小组" clearable>
|
|
|
<el-option
|
|
<el-option
|
|
@@ -209,6 +218,39 @@ style="width: 90%; height: 90%; margin-top: 3%;"
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
+<!-- 明细数据 -->
|
|
|
|
|
+<el-dialog v-model="OrderdetailsdialogFormVisible" :before-close="Orderdetails_bomcloseDialog" :title="'裁剪返工汇总单据详情'"
|
|
|
|
|
+width="100%" style="height: 100%;margin: 0%;padding: 0px 10px 0px 10px;" destroy-on-close>
|
|
|
|
|
+ <el-button type="primary" @click="Orderdetails_closeDialog" style="width: 100px;height: 50px;margin-left: 10px;">关 闭</el-button>
|
|
|
|
|
+ <div class="gva-table-box">
|
|
|
|
|
+ <el-table ref="multipleTable"
|
|
|
|
|
+ :row-style="{ height: '30px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
|
|
+ :show-overflow-tooltip="true" highlight-current-row="true"
|
|
|
|
|
+ @row-click="detailsclicks" @row-dblclick="Doubleclickdetails"
|
|
|
|
|
+ @selection-change="detailSelectionChange" style="width: 100%;height: 75vh" border
|
|
|
|
|
+ :summary-method="getSummaries" tooltip-effect="dark" :data="Orderdetailsdata" row-key="ID" >
|
|
|
|
|
+ <el-table-column align="left" label="单据编号" prop="单据编号" width="120" />
|
|
|
|
|
+ <el-table-column align="left" label="订单编号" prop="订单编号" width="120" />
|
|
|
|
|
+ <el-table-column align="left" label="生产款号" prop="生产款号" width="120" />
|
|
|
|
|
+ <el-table-column align="left" label="款式" prop="款式" width="120" />
|
|
|
|
|
+ <el-table-column align="left" label="面料分类" prop="面料分类" width="120" />
|
|
|
|
|
+ <el-table-column align="left" label="面料名称" prop="面料名称" width="120" />
|
|
|
|
|
+ <el-table-column align="left" label="颜色" prop="颜色" width="100" />
|
|
|
|
|
+ <el-table-column align="left" label="数量" prop="数量" width="80" />
|
|
|
|
|
+ <el-table-column align="left" label="计划用料" prop="计划用料" width="100" />
|
|
|
|
|
+ <el-table-column align="left" label="实际用料" prop="实际用料" width="100" />
|
|
|
|
|
+ <el-table-column align="left" label="问题分类" prop="问题分类" width="120" />
|
|
|
|
|
+ <el-table-column align="left" label="备注" prop="备注" width="120" />
|
|
|
|
|
+ <el-table-column align="left" label="组别" prop="组别" width="120" />
|
|
|
|
|
+ <el-table-column align="left" label="操作人员" prop="Sys_id" width="120" />
|
|
|
|
|
+ <el-table-column align="left" label="创建时间" prop="Sys_rq" width="120" />
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ <div class="dialog-footer" style="text-align: left;margin-right: 60px;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</el-dialog>
|
|
|
|
|
+
|
|
|
</el-main>
|
|
</el-main>
|
|
|
</el-container>
|
|
</el-container>
|
|
|
</el-container>
|
|
</el-container>
|
|
@@ -222,7 +264,7 @@ import FileSaver from 'file-saver';
|
|
|
import { Search, Refresh, Download } from '@element-plus/icons-vue'
|
|
import { Search, Refresh, Download } from '@element-plus/icons-vue'
|
|
|
import { ref, reactive, nextTick, onMounted, onBeforeMount } from 'vue'
|
|
import { ref, reactive, nextTick, onMounted, onBeforeMount } from 'vue'
|
|
|
import { Layout, LayoutContent, LayoutHeader, LayoutSider } from '@arco-design/web-vue'
|
|
import { Layout, LayoutContent, LayoutHeader, LayoutSider } from '@arco-design/web-vue'
|
|
|
-import {queryOrderSize,ApiAddDefective,ApiMouthlist,ApiSubPieceAndReworkList, search} from '@/api/mes/job'
|
|
|
|
|
|
|
+import {queryOrderSize,ApiAddDefective,ApiMouthlist,ApiSubPieceAnd,ApiSubPieceAndReworkList, Apiorder} from '@/api/mes/job'
|
|
|
import { useUserStore } from '@/pinia/modules/user'
|
|
import { useUserStore } from '@/pinia/modules/user'
|
|
|
// import { el } from 'element-plus/es/locale'
|
|
// import { el } from 'element-plus/es/locale'
|
|
|
//获取登录用户信息
|
|
//获取登录用户信息
|
|
@@ -278,40 +320,64 @@ getTabdata();
|
|
|
|
|
|
|
|
|
|
|
|
|
const tableData = reactive([]);
|
|
const tableData = reactive([]);
|
|
|
|
|
+const exceltableData = reactive([]);
|
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
|
-
|
|
|
|
|
|
|
+const noderq = ref('');
|
|
|
const handleNodeClick = async (node) => {
|
|
const handleNodeClick = async (node) => {
|
|
|
-if (!node.children) {
|
|
|
|
|
|
|
+ noderq.value = node.label;
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
|
|
+ // 取消所有节点的颜色
|
|
|
|
|
+ const allNodes = document.querySelectorAll('.treecolor .el-tree-node');
|
|
|
|
|
+ allNodes.forEach(node => {
|
|
|
|
|
+ node.querySelector('.el-tree-node__label').style.color = '';
|
|
|
|
|
+ });
|
|
|
|
|
+ // 获取点击的节点 给当前点击的节点改变颜色【红色】
|
|
|
|
|
+ const clickedNodeId = node['$treeNodeId'];
|
|
|
|
|
+ const clickedNode = document.querySelector(`.treecolor .el-tree-node[data-key="${clickedNodeId}"]`);
|
|
|
|
|
+ if (clickedNode) {
|
|
|
|
|
+ clickedNode.querySelector('.el-tree-node__label').style.color = 'red';
|
|
|
|
|
+ }
|
|
|
try {
|
|
try {
|
|
|
- const response = await ApiSubPieceAndReworkList({
|
|
|
|
|
|
|
+ //获取汇总数据
|
|
|
|
|
+ const response = await ApiSubPieceAnd({
|
|
|
|
|
+ Sys_rq: node.label,
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ limit: 50,
|
|
|
|
|
+ code: '返工'
|
|
|
|
|
+ });
|
|
|
|
|
+ //获取详情数据
|
|
|
|
|
+ const excelresponse = await ApiSubPieceAndReworkList({
|
|
|
Sys_rq: node.label,
|
|
Sys_rq: node.label,
|
|
|
page: 1,
|
|
page: 1,
|
|
|
limit: 50,
|
|
limit: 50,
|
|
|
code: '返工'
|
|
code: '返工'
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
if (response.code === 0 && response.data?.data) {
|
|
if (response.code === 0 && response.data?.data) {
|
|
|
// 清空并更新表格数据
|
|
// 清空并更新表格数据
|
|
|
tableData.splice(0, tableData.length, ...response.data.data);
|
|
tableData.splice(0, tableData.length, ...response.data.data);
|
|
|
} else {
|
|
} else {
|
|
|
- ElMessage.warning(response.msg || '暂无数据');
|
|
|
|
|
tableData.splice(0, tableData.length);
|
|
tableData.splice(0, tableData.length);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (excelresponse.code === 0 && excelresponse.data?.data) {
|
|
|
|
|
+ // 清空并更新Excel表格数据
|
|
|
|
|
+ exceltableData.splice(0, exceltableData.length, ...excelresponse.data.data);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ exceltableData.splice(0, exceltableData.length);
|
|
|
|
|
+ }
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('加载数据失败:', error);
|
|
console.error('加载数据失败:', error);
|
|
|
ElMessage.error('数据加载失败');
|
|
ElMessage.error('数据加载失败');
|
|
|
} finally {
|
|
} finally {
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
|
|
+
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const searchinfo = ref('');
|
|
const searchinfo = ref('');
|
|
|
//回车搜索
|
|
//回车搜索
|
|
|
const keydown_onSearch = async (event) => {
|
|
const keydown_onSearch = async (event) => {
|
|
|
if(event.keyCode === 13){
|
|
if(event.keyCode === 13){
|
|
|
- const response = await ApiSubPieceAndReworkList({
|
|
|
|
|
|
|
+ const response = await ApiSubPieceAnd({
|
|
|
search: searchinfo.value,
|
|
search: searchinfo.value,
|
|
|
page: 1,
|
|
page: 1,
|
|
|
limit: 50,
|
|
limit: 50,
|
|
@@ -406,10 +472,42 @@ const ent1 = (event, index) => {
|
|
|
console.log(event, index);
|
|
console.log(event, index);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const searchOrder = async (query, index) => {
|
|
|
|
|
+ if (!query.trim()) {
|
|
|
|
|
+ SecondarytabeleData[index].ddbhOptions = [];
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ const response = await Apiorder({ search: query }); // 根据实际接口调整参数
|
|
|
|
|
+ if (response.code === 0) {
|
|
|
|
|
+ SecondarytabeleData[index].ddbhOptions = response.data.list.map(item => ({
|
|
|
|
|
+ value: `${item.订单编号}---${item.生产款号}`, // 格式与之前一致
|
|
|
|
|
+ label: `${item.订单编号}---${item.生产款号}`,
|
|
|
|
|
+ rawData: item, // 保存原始数据,供后续使用
|
|
|
|
|
+ }));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage.error(response.msg || '搜索失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ ElMessage.error('搜索接口异常');
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const handleOrderSelect = (value, index) => {
|
|
|
|
|
+ if (!value) return;
|
|
|
|
|
+ const row = SecondarytabeleData[index];
|
|
|
|
|
+ const selectedOption = row.ddbhOptions.find(opt => opt.value === value);
|
|
|
|
|
+ if (selectedOption) {
|
|
|
|
|
+ // 调用原来的 getGxMcsubmit 逻辑(需稍作调整)
|
|
|
|
|
+ getGxMcsubmit(selectedOption.rawData, index);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// 工单编号|款号回车事件
|
|
// 工单编号|款号回车事件
|
|
|
const getGxMcsubmit = async (event, index) => {
|
|
const getGxMcsubmit = async (event, index) => {
|
|
|
const row = SecondarytabeleData[index]; // 获取当前行数据
|
|
const row = SecondarytabeleData[index]; // 获取当前行数据
|
|
|
-const ddbh = row.ddbh; // 获取输入的工单编号
|
|
|
|
|
|
|
+const ddbh = row.ddbh.split('---')[0]; // 获取输入的工单编号
|
|
|
|
|
|
|
|
if (!ddbh) {
|
|
if (!ddbh) {
|
|
|
ElMessage.warning('请输入工单编号');
|
|
ElMessage.warning('请输入工单编号');
|
|
@@ -424,7 +522,7 @@ try {
|
|
|
const { list, fetchCategory, colorremark, FabricData, 面料统计,size } = response.data;
|
|
const { list, fetchCategory, colorremark, FabricData, 面料统计,size } = response.data;
|
|
|
|
|
|
|
|
// 更新当前行的数据
|
|
// 更新当前行的数据
|
|
|
- row.ddbh = `${list.订单编号}|${list.生产款号}`;
|
|
|
|
|
|
|
+ row.ddbh = `${list.订单编号}---${list.生产款号}`;
|
|
|
row.ks = list.款式;
|
|
row.ks = list.款式;
|
|
|
// 更新下拉框选项
|
|
// 更新下拉框选项
|
|
|
row.colorOptions = colorremark.map(item => ({ value: item, label: item })); // 颜色选项
|
|
row.colorOptions = colorremark.map(item => ({ value: item, label: item })); // 颜色选项
|
|
@@ -470,8 +568,8 @@ const params = SecondarytabeleData.map(item => {
|
|
|
);
|
|
);
|
|
|
console.log('匹配统计数据', matchedFabric);
|
|
console.log('匹配统计数据', matchedFabric);
|
|
|
return {
|
|
return {
|
|
|
- 订单编号: item['ddbh'].split('|')[0],
|
|
|
|
|
- 生产款号: item['ddbh'].split('|')[1],
|
|
|
|
|
|
|
+ 订单编号: item['ddbh'].split('---')[0],
|
|
|
|
|
+ 生产款号: item['ddbh'].split('---')[1],
|
|
|
款式: item['ks'],
|
|
款式: item['ks'],
|
|
|
颜色: item['color'],
|
|
颜色: item['color'],
|
|
|
数量: item['defectiveQuantity'],
|
|
数量: item['defectiveQuantity'],
|
|
@@ -495,6 +593,8 @@ try {
|
|
|
const ApiAddDefectiveRes = await ApiAddDefective(params);
|
|
const ApiAddDefectiveRes = await ApiAddDefective(params);
|
|
|
if (ApiAddDefectiveRes.code === 0) {
|
|
if (ApiAddDefectiveRes.code === 0) {
|
|
|
ElMessage.success('提交成功');
|
|
ElMessage.success('提交成功');
|
|
|
|
|
+ getTabdata();//刷新左侧数据
|
|
|
|
|
+ handleNodeClick(noderq.value);//刷新右侧数据
|
|
|
closeDialog(); // 关闭弹窗
|
|
closeDialog(); // 关闭弹窗
|
|
|
} else {
|
|
} else {
|
|
|
ElMessage.error(ApiAddDefectiveRes.msg || '接口返回错误');
|
|
ElMessage.error(ApiAddDefectiveRes.msg || '接口返回错误');
|
|
@@ -515,46 +615,145 @@ const removeRow = (index) => {
|
|
|
SecondarytabeleData.splice(index, 1);
|
|
SecondarytabeleData.splice(index, 1);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const OrderdetailsdialogFormVisible = ref(false);
|
|
|
|
|
+const Orderdetailsdata = reactive([]);
|
|
|
|
|
+//查看单号详情
|
|
|
|
|
+const Order_detailsRow = async (row, index) => {
|
|
|
|
|
+console.log('查看详情', row.Sys_rq, index);
|
|
|
|
|
+
|
|
|
|
|
+OrderdetailsdialogFormVisible.value = true
|
|
|
|
|
+const response = await ApiSubPieceAndReworkList({
|
|
|
|
|
+ Sys_rq: row.Sys_rq,
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ limit: 50,
|
|
|
|
|
+ code: '返工'
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (response.code === 0 && response.data?.data) {
|
|
|
|
|
+ // 清空并更新表格数据
|
|
|
|
|
+ Orderdetailsdata.splice(0, Orderdetailsdata.length, ...response.data.data);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage.warning(response.msg || '暂无数据');
|
|
|
|
|
+ Orderdetailsdata.splice(0, Orderdetailsdata.length);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//关闭
|
|
|
|
|
+const Orderdetails_closeDialog = () => {
|
|
|
|
|
+OrderdetailsdialogFormVisible.value = false;
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
//导出
|
|
//导出
|
|
|
const exportExcel = () => {
|
|
const exportExcel = () => {
|
|
|
- const el = document.getElementById('table');
|
|
|
|
|
- const filename = '导出半成品返工EXCEL.xlsx';
|
|
|
|
|
-
|
|
|
|
|
- // 获取表格数据
|
|
|
|
|
- const ws = XLSX.utils.table_to_sheet(el);
|
|
|
|
|
|
|
+const el = document.getElementById('table');
|
|
|
|
|
+const filename = '导出返工汇总EXCEL.xlsx';
|
|
|
|
|
+
|
|
|
|
|
+// 获取表格数据
|
|
|
|
|
+const ws = XLSX.utils.table_to_sheet(el);
|
|
|
|
|
+
|
|
|
|
|
+// 找出需要保留为数字的列(假设'sl'列是数字)
|
|
|
|
|
+const numCols = ['数量']; // 添加其他需要保留数字的列名
|
|
|
|
|
+
|
|
|
|
|
+// 遍历工作表数据,将指定列转换为数字
|
|
|
|
|
+for (const cell in ws) {
|
|
|
|
|
+ if (cell[0] === '!') continue; // 跳过特殊属性
|
|
|
|
|
|
|
|
- // 找出需要保留为数字的列(假设'sl'列是数字)
|
|
|
|
|
- const numCols = ['数量']; // 添加其他需要保留数字的列名
|
|
|
|
|
|
|
+ const colName = cell.replace(/[0-9]/g, ''); // 获取列字母
|
|
|
|
|
+ const header = ws[colName + '1']; // 获取表头
|
|
|
|
|
|
|
|
- // 遍历工作表数据,将指定列转换为数字
|
|
|
|
|
- for (const cell in ws) {
|
|
|
|
|
- if (cell[0] === '!') continue; // 跳过特殊属性
|
|
|
|
|
-
|
|
|
|
|
- const colName = cell.replace(/[0-9]/g, ''); // 获取列字母
|
|
|
|
|
- const header = ws[colName + '1']; // 获取表头
|
|
|
|
|
-
|
|
|
|
|
- if (header && numCols.includes(header.v)) {
|
|
|
|
|
- // 如果是数字列,尝试转换为数字
|
|
|
|
|
- const value = ws[cell].v;
|
|
|
|
|
- if (!isNaN(value) && value !== '') {
|
|
|
|
|
- ws[cell].t = 'n'; // 设置为数字类型
|
|
|
|
|
- ws[cell].v = Number(value); // 转换为数字
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (header && numCols.includes(header.v)) {
|
|
|
|
|
+ // 如果是数字列,尝试转换为数字
|
|
|
|
|
+ const value = ws[cell].v;
|
|
|
|
|
+ if (!isNaN(value) && value !== '') {
|
|
|
|
|
+ ws[cell].t = 'n'; // 设置为数字类型
|
|
|
|
|
+ ws[cell].v = Number(value); // 转换为数字
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 创建工作簿并导出
|
|
|
|
|
+const wb = XLSX.utils.book_new();
|
|
|
|
|
+XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
|
|
|
|
|
+
|
|
|
|
|
+try {
|
|
|
|
|
+ XLSX.writeFile(wb, filename);
|
|
|
|
|
+} catch (e) {
|
|
|
|
|
+ console.log(e);
|
|
|
|
|
+}
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const exportExcel2 = () => {
|
|
|
|
|
+const filename = '导出返工明细EXCEL.xlsx';
|
|
|
|
|
+console.log('导出数据', exceltableData);
|
|
|
|
|
+
|
|
|
|
|
+// 获取 el-table 的列配置
|
|
|
|
|
+const columns = [
|
|
|
|
|
+ { label: "单据编号", prop: "单据编号" },
|
|
|
|
|
+ { label: "订单编号", prop: "订单编号" },
|
|
|
|
|
+ { label: "生产款号", prop: "生产款号" },
|
|
|
|
|
+ { label: "款式", prop: "款式" },
|
|
|
|
|
+ { label: "面料分类", prop: "面料分类" },
|
|
|
|
|
+ { label: "面料名称", prop: "面料名称" },
|
|
|
|
|
+ { label: "颜色", prop: "颜色" },
|
|
|
|
|
+ { label: "数量", prop: "数量" },
|
|
|
|
|
+ { label: "计划用料", prop: "计划用料" },
|
|
|
|
|
+ { label: "实际用料", prop: "实际用料" },
|
|
|
|
|
+ { label: "问题分类", prop: "问题分类" },
|
|
|
|
|
+ { label: "备注", prop: "备注" },
|
|
|
|
|
+ { label: "组别", prop: "组别" },
|
|
|
|
|
+ { label: "操作人员", prop: "Sys_id" },
|
|
|
|
|
+ { label: "创建时间", prop: "Sys_rq" }
|
|
|
|
|
+];
|
|
|
|
|
+
|
|
|
|
|
+// 创建表头映射对象
|
|
|
|
|
+const headerMap = {};
|
|
|
|
|
+columns.forEach(col => {
|
|
|
|
|
+ headerMap[col.prop] = col.label;
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+// 重新映射数据,确保顺序和表头一致
|
|
|
|
|
+const remappedData = exceltableData.map(item => {
|
|
|
|
|
+ const newItem = {};
|
|
|
|
|
+ columns.forEach(col => {
|
|
|
|
|
+ newItem[col.label] = item[col.prop];
|
|
|
|
|
+ });
|
|
|
|
|
+ return newItem;
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+// 获取表格数据
|
|
|
|
|
+const ws = XLSX.utils.json_to_sheet(remappedData);
|
|
|
|
|
+
|
|
|
|
|
+// 找出需要保留为数字的列
|
|
|
|
|
+const numCols = ['数量']; // 添加其他需要保留数字的列名
|
|
|
|
|
+
|
|
|
|
|
+// 遍历工作表数据,将指定列转换为数字
|
|
|
|
|
+for (const cell in ws) {
|
|
|
|
|
+ if (cell[0] === '!') continue; // 跳过特殊属性
|
|
|
|
|
|
|
|
- // 创建工作簿并导出
|
|
|
|
|
- const wb = XLSX.utils.book_new();
|
|
|
|
|
- XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
|
|
|
|
|
|
|
+ const colName = cell.replace(/[0-9]/g, ''); // 获取列字母
|
|
|
|
|
+ const header = ws[colName + '1']; // 获取表头
|
|
|
|
|
|
|
|
- try {
|
|
|
|
|
- XLSX.writeFile(wb, filename);
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- console.log(e);
|
|
|
|
|
|
|
+ if (header && numCols.some(numCol => headerMap[numCol] === header.v)) {
|
|
|
|
|
+ // 如果是数字列,尝试转换为数字
|
|
|
|
|
+ const value = ws[cell].v;
|
|
|
|
|
+ if (!isNaN(value) && value !== '') {
|
|
|
|
|
+ ws[cell].t = 'n'; // 设置为数字类型
|
|
|
|
|
+ ws[cell].v = Number(value); // 转换为数字
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 创建工作簿并导出
|
|
|
|
|
+const wb = XLSX.utils.book_new();
|
|
|
|
|
+XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
|
|
|
|
|
+
|
|
|
|
|
+try {
|
|
|
|
|
+ XLSX.writeFile(wb, filename);
|
|
|
|
|
+} catch (e) {
|
|
|
|
|
+ console.log(e);
|
|
|
|
|
+}
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
<style>
|
|
@@ -610,10 +809,7 @@ const exportExcel = () => {
|
|
|
.mab{
|
|
.mab{
|
|
|
margin-bottom: 5px;
|
|
margin-bottom: 5px;
|
|
|
}
|
|
}
|
|
|
-/* tree组件背景高亮 */
|
|
|
|
|
-:deep(.el-tree-node:focus > .el-tree-node__content){
|
|
|
|
|
- background: #ff80ff !important;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|