|
|
@@ -9,7 +9,7 @@
|
|
|
<!-- <el-button type="danger" @click="deldetail_delclick" style="width: 80px;height: 50px;" v-if="del_details=== true" :disabled="details_Selection === '' " class="bt" >删除</el-button> -->
|
|
|
</el-row>
|
|
|
<layout>
|
|
|
- <layout-sider :resize-directions="['right']" :width="200" style="margin-right: 10px;">
|
|
|
+ <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
|
|
|
<div class="JKWTree-tree" style="height: 70vh;">
|
|
|
<h3>面料库存</h3>
|
|
|
<el-tree :data="treeData" class="treecolor" highlight-current="true" @node-click="handleNodeClick" />
|
|
|
@@ -27,14 +27,15 @@
|
|
|
@selection-change="detailSelectionChange" style="width: 100%;height: 65vh" border
|
|
|
:summary-method="getSummaries" tooltip-effect="dark" :data="recordtableData" row-key="ID" >
|
|
|
<!-- <el-table-column align="center" type="selection" width="40"//> -->
|
|
|
- <el-table-column align="left" label="退还单" prop="出库单" width="170"/>
|
|
|
- <!-- <el-table-column align="left" label="订单编号" prop="订单编号" width="150"/> -->
|
|
|
- <!-- <el-table-column align="left" label="款号" prop="款号" width="150"/> -->
|
|
|
- <!-- <el-table-column align="left" label="物料名称" prop="物料名称" width="150"/> -->
|
|
|
- <el-table-column align="left" label="单号类型" prop="单号类型" width="150"/>
|
|
|
- <el-table-column align="left" label="退还总数" prop="总数" width="110"/>
|
|
|
- <el-table-column align="left" label="退还人员" prop="操作机台" width="110"/>
|
|
|
- <el-table-column align="left" label="退还日期" prop="日期" width="160"/>
|
|
|
+ <el-table-column align="left" label="退还单" prop="退还单" width="140"/>
|
|
|
+ <el-table-column align="left" label="订单编号" prop="订单编号" width="180"/>
|
|
|
+ <el-table-column align="left" label="款号" prop="款号" width="180"/>
|
|
|
+ <el-table-column align="left" label="款式" prop="款式" width="180"/>
|
|
|
+ <el-table-column align="left" label="物料名称" prop="物料名称" width="180"/>
|
|
|
+ <el-table-column align="left" label="单号类型" prop="单号类型" width="90"/>
|
|
|
+ <el-table-column align="left" label="退还总数" prop="总数" width="110"/>
|
|
|
+ <el-table-column align="left" label="退还人员" prop="操作机台" width="110"/>
|
|
|
+ <el-table-column align="left" label="退还日期" prop="日期" width="160"/>
|
|
|
|
|
|
<el-table-column fixed="right" label="操作" width="130">
|
|
|
<template #default="{ row, $index }">
|
|
|
@@ -47,6 +48,18 @@
|
|
|
|
|
|
</el-table>
|
|
|
</el-tab-pane>
|
|
|
+ <!-- 分页 -->
|
|
|
+ <div class="gva-pagination">
|
|
|
+ <el-pagination
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="page"
|
|
|
+ :page-sizes="[10, 30, 50, 100]"
|
|
|
+ :page-size="pageSize"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
</el-tabs>
|
|
|
<div class="dialog-footer" style="text-align: left;margin-right: 60px;">
|
|
|
</div>
|
|
|
@@ -134,9 +147,9 @@
|
|
|
|
|
|
<!-- 右部分 -->
|
|
|
<div style="position: relative;width: 1300px;height: 310px;">
|
|
|
- <el-descriptions class="margin-top" :column="1" :size="size" border>
|
|
|
+ <!-- <el-descriptions class="margin-top" :column="1" :size="size" border>
|
|
|
<el-descriptions-item label="关联订单">{{ mianliaotabData.关联订单 }}</el-descriptions-item>
|
|
|
- </el-descriptions>
|
|
|
+ </el-descriptions> -->
|
|
|
<el-descriptions class="margin-top" :column="4" :size="size" border>
|
|
|
<el-descriptions-item label="批次号">{{ mianliaotabData.批次号 }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="关联号">{{ mianliaotabData.关联号 }}</el-descriptions-item>
|
|
|
@@ -180,6 +193,17 @@
|
|
|
<el-radio v-model="radio1" label="退次品" border>退次品</el-radio>
|
|
|
</el-descriptions-item>
|
|
|
</el-descriptions>
|
|
|
+ <el-descriptions class="margin-top" :column="2" :size="size" border>
|
|
|
+ <el-descriptions-item label="选择部门" >
|
|
|
+ <el-radio-group v-model="mianliaotabData.部门" >
|
|
|
+ <el-radio label="业务部" border >业务部</el-radio>
|
|
|
+ <el-radio label="技术部" border >技术部</el-radio>
|
|
|
+ <el-radio label="内销" border >内销</el-radio>
|
|
|
+ <el-radio label="裁床" border >裁床</el-radio>
|
|
|
+ <el-radio label="其他" border >其他</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
<!-- <el-button type="primary" @click="dj_Dialog" style="width: 120px; height: 50px; position: absolute; bottom: 0px; right: 10px;">
|
|
|
添加面料
|
|
|
</el-button> -->
|
|
|
@@ -226,7 +250,8 @@
|
|
|
<el-table-column align="left" label="库存数量" prop="库存数量" width="90"/> -->
|
|
|
<!-- <el-table-column align="left" label="领用数量" prop="领用数量" width="90"/> -->
|
|
|
<el-table-column align="left" label="单位" prop="单位" width="60"/>
|
|
|
- <el-table-column align="left" label="关联订单" prop="关联订单" width="300"/>
|
|
|
+ <el-table-column align="left" label="部门" prop="部门" width="100"/>
|
|
|
+ <!-- <el-table-column align="left" label="关联订单" prop="关联订单" width="300"/> -->
|
|
|
<el-table-column fixed="right" label="操作" width="120">
|
|
|
<template #default="{ row, $index }">
|
|
|
<el-button @click="deleteRow($index)" type="text" size="small">
|
|
|
@@ -322,6 +347,7 @@
|
|
|
const seconds = String(today.getSeconds()).padStart(2, '0');
|
|
|
const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
const currentDates = `${year}-${month}-${day}`;
|
|
|
+ const currentMonth = `${year}-${month}`;
|
|
|
//自动聚焦光标input
|
|
|
// const getMachineMacdata = async () => {
|
|
|
// setTimeout(() => {
|
|
|
@@ -333,6 +359,26 @@
|
|
|
// }
|
|
|
// getMachineMacdata();
|
|
|
|
|
|
+
|
|
|
+// =========== 分页 ===========
|
|
|
+ // 分页相关的响应式变量
|
|
|
+ const page = ref(1)
|
|
|
+ const total = ref(0)
|
|
|
+ const pageSize = ref(50)
|
|
|
+ // 分页
|
|
|
+ const handleCurrentChange = (val) => {
|
|
|
+ page.value = val;
|
|
|
+ records_onSubmit();
|
|
|
+ };
|
|
|
+
|
|
|
+ // 修改页面容量 点击多少条/页
|
|
|
+ const handleSizeChange = (val) => {
|
|
|
+ page.value = 1;//默认显示
|
|
|
+ pageSize.value = val;
|
|
|
+ records_onSubmit();
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
//全局调用参数
|
|
|
const danhao = ref('')
|
|
|
const riqi = ref('')
|
|
|
@@ -398,9 +444,9 @@ const handleNodeClick = async (node, check) => {
|
|
|
if (clickedNode) {
|
|
|
clickedNode.querySelector('.el-tree-node__label').style.color = 'red';
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//订单信息数据查询【接口】
|
|
|
- const ReceiptList_res = await ReceiptList({mouth:nodedata.value,search:'',page:1,limit:50});
|
|
|
+ const ReceiptList_res = await ReceiptList({mouth:nodedata.value,search:'',page: page.value, limit: pageSize.value,code:'退还'});
|
|
|
if (ReceiptList_res && ReceiptList_res.data && Array.isArray(ReceiptList_res.data.table)) {
|
|
|
const filteredData = ReceiptList_res.data.table.filter(item => item.单号类型 === '退还');
|
|
|
// 更新数据
|
|
|
@@ -413,7 +459,7 @@ const handleNodeClick = async (node, check) => {
|
|
|
|
|
|
//查询按钮
|
|
|
const search_onSubmit = async () => {
|
|
|
- const UnapprovalListtable = await ReceiptList({ mouth: '', search: records_searchInfo.value, page: 1, limit: 50 });
|
|
|
+ const UnapprovalListtable = await ReceiptList({ mouth: '', search: records_searchInfo.value, page: page.value, limit: pageSize.value,code:'退还' });
|
|
|
if (UnapprovalListtable && UnapprovalListtable.data && Array.isArray(UnapprovalListtable.data.table)) {
|
|
|
const filteredData = UnapprovalListtable.data.table.filter(item => item.单号类型 === '退还');
|
|
|
// 更新数据
|
|
|
@@ -428,22 +474,25 @@ const search_onSubmit = async () => {
|
|
|
restableData.splice(0, restableData.length);//清空表格
|
|
|
//订单信息数据查询【接口】
|
|
|
const orderSearchdata = await OutOrderSearch({search:add_searchInfo.value});
|
|
|
- if(orderSearchdata.data.length === 1){
|
|
|
- _orderid.value = orderSearchdata.data[0]['订单编号']
|
|
|
- add_searchInfo.value = orderSearchdata.data[0]['订单编号']
|
|
|
- ddhformData.ddh = orderSearchdata.data[0]['订单编号']
|
|
|
- ddhformData.kh = orderSearchdata.data[0]['客户编号']
|
|
|
- ddhformData.sckh = orderSearchdata.data[0]['生产款号']
|
|
|
- ddhformData.ks = orderSearchdata.data[0]['款式']
|
|
|
- add_lysearchInfo.value = add_searchInfo.value
|
|
|
+ // if(orderSearchdata.data.length === 1){
|
|
|
+ // _orderid.value = orderSearchdata.data[0]['订单编号']
|
|
|
+ // add_searchInfo.value = orderSearchdata.data[0]['订单编号']
|
|
|
+ // ddhformData.ddh = orderSearchdata.data[0]['订单编号']
|
|
|
+ // ddhformData.kh = orderSearchdata.data[0]['客户编号']
|
|
|
+ // ddhformData.sckh = orderSearchdata.data[0]['生产款号']
|
|
|
+ // ddhformData.ks = orderSearchdata.data[0]['款式']
|
|
|
+ // add_lysearchInfo.value = add_searchInfo.value
|
|
|
|
|
|
- const gitReceiptNumberdata = await gitReceiptNumber({number:'TH'});
|
|
|
- danhao.value = gitReceiptNumberdata.data.number
|
|
|
- chukuren.value = userStore.userInfo.nickName
|
|
|
- riqi.value = currentDates
|
|
|
- }else{
|
|
|
- restableData.splice(0,orderSearchdata.length,...orderSearchdata.data);
|
|
|
- }
|
|
|
+ // const gitReceiptNumberdata = await gitReceiptNumber({number:'TH'});
|
|
|
+ // danhao.value = gitReceiptNumberdata.data.number
|
|
|
+ // chukuren.value = userStore.userInfo.nickName
|
|
|
+ // riqi.value = currentDates
|
|
|
+ // }else{
|
|
|
+ // restableData.splice(0,orderSearchdata.length,...orderSearchdata.data);
|
|
|
+ // }
|
|
|
+ if(orderSearchdata.code === 0){
|
|
|
+ restableData.splice(0,orderSearchdata.length,...orderSearchdata.data);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//input回车事件
|
|
|
@@ -451,24 +500,27 @@ const search_onSubmit = async () => {
|
|
|
//清空表格
|
|
|
restableData.splice(0, restableData.length);
|
|
|
const orderSearchdata = await OutOrderSearch({search:add_searchInfo.value});
|
|
|
- if(orderSearchdata.data.length === 1){
|
|
|
- res_bomdialogFormVisible.value = true
|
|
|
- _orderid.value = orderSearchdata.data[0]['订单编号']
|
|
|
- add_searchInfo.value = orderSearchdata.data[0]['订单编号']
|
|
|
- ddhformData.ddh = orderSearchdata.data[0]['订单编号']
|
|
|
- ddhformData.kh = orderSearchdata.data[0]['客户编号']
|
|
|
- ddhformData.sckh = orderSearchdata.data[0]['生产款号']
|
|
|
- ddhformData.ks = orderSearchdata.data[0]['款式']
|
|
|
- add_lysearchInfo.value = add_searchInfo.value
|
|
|
+ // if(orderSearchdata.data.length === 1){
|
|
|
+ // res_bomdialogFormVisible.value = true
|
|
|
+ // _orderid.value = orderSearchdata.data[0]['订单编号']
|
|
|
+ // add_searchInfo.value = orderSearchdata.data[0]['订单编号']
|
|
|
+ // ddhformData.ddh = orderSearchdata.data[0]['订单编号']
|
|
|
+ // ddhformData.kh = orderSearchdata.data[0]['客户编号']
|
|
|
+ // ddhformData.sckh = orderSearchdata.data[0]['生产款号']
|
|
|
+ // ddhformData.ks = orderSearchdata.data[0]['款式']
|
|
|
+ // add_lysearchInfo.value = add_searchInfo.value
|
|
|
|
|
|
- const gitReceiptNumberdata = await gitReceiptNumber({number:'TH'});
|
|
|
- console.log(gitReceiptNumberdata)
|
|
|
- danhao.value = gitReceiptNumberdata.data.number
|
|
|
- chukuren.value = userStore.userInfo.nickName
|
|
|
- riqi.value = currentDates
|
|
|
- }else{
|
|
|
- restableData.splice(0,orderSearchdata.length,...orderSearchdata.data);
|
|
|
- }
|
|
|
+ // const gitReceiptNumberdata = await gitReceiptNumber({number:'TH'});
|
|
|
+ // console.log(gitReceiptNumberdata)
|
|
|
+ // danhao.value = gitReceiptNumberdata.data.number
|
|
|
+ // chukuren.value = userStore.userInfo.nickName
|
|
|
+ // riqi.value = currentDates
|
|
|
+ // }else{
|
|
|
+ // restableData.splice(0,orderSearchdata.length,...orderSearchdata.data);
|
|
|
+ // }
|
|
|
+ if(orderSearchdata.code === 0){
|
|
|
+ restableData.splice(0,orderSearchdata.length,...orderSearchdata.data);
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
|
|
|
@@ -485,9 +537,11 @@ const search_onSubmit = async () => {
|
|
|
入仓总数量: '',
|
|
|
库存数量: '',
|
|
|
领用数量: '',
|
|
|
- 关联订单: '',
|
|
|
+ // 关联订单: '',
|
|
|
颜色: '',
|
|
|
- 单位: ''
|
|
|
+ 单位: '',
|
|
|
+ 部门: '',
|
|
|
+ 实际门幅: '',
|
|
|
});
|
|
|
|
|
|
//表格行点击
|
|
|
@@ -537,39 +591,40 @@ const search_onSubmit = async () => {
|
|
|
计划门幅: Detailres.data.BOM_计划门幅,
|
|
|
定额用料: Detailres.data.定额用料,
|
|
|
定额门幅: Detailres.data.BOM_定额门幅,
|
|
|
- 退还数量: Detailres.data.退还数量,
|
|
|
+ 退还数量: '',
|
|
|
入仓总数量: Detailres.data.退还数量 ? Detailres.data.退还数量 : 0,
|
|
|
库存数量: Detailres.data.库存数量 ? Detailres.data.库存数量 : 0,
|
|
|
领用数量: Detailres.data.领用数量,
|
|
|
关联订单: Detailres.data.关联订单,
|
|
|
颜色: Detailres.data.BOM_颜色,
|
|
|
单位: Detailres.data.单位,
|
|
|
+ 部门: Detailres.data.departname,
|
|
|
实际门幅: Detailres.data.实际门幅,
|
|
|
};
|
|
|
|
|
|
- // 获取 mianliaotabData 的物料名称和颜色
|
|
|
- const { 物料名称, 颜色 } = mianliaotabData.value;
|
|
|
+ // // 获取 mianliaotabData 的物料名称和颜色
|
|
|
+ // const { 物料名称, 颜色 } = mianliaotabData.value;
|
|
|
|
|
|
- // 计算 danjutableData 中相同物料名称和颜色的退还数量总和
|
|
|
- const totalOutbound = danjutableData.value
|
|
|
- .filter(
|
|
|
- (item) =>
|
|
|
- item.物料名称 === 物料名称 &&
|
|
|
- item.颜色 === 颜色
|
|
|
- )
|
|
|
- .reduce((sum, item) => {
|
|
|
- // 根据退还类型决定是加还是减
|
|
|
- if (item.退还类型 === '退面料') {
|
|
|
- return sum + Number(item.退还数量); // 退面料,增加退还数量
|
|
|
- }
|
|
|
- // else if (item.退还类型 === '退厂商') {
|
|
|
- // return sum - Number(item.退还数量); // 退厂商,减少退还数量
|
|
|
- // }
|
|
|
- return sum; // 其他退还类型不处理
|
|
|
- }, 0);
|
|
|
+ // // 计算 danjutableData 中相同物料名称和颜色的退还数量总和
|
|
|
+ // const totalOutbound = danjutableData.value
|
|
|
+ // .filter(
|
|
|
+ // (item) =>
|
|
|
+ // item.物料名称 === 物料名称 &&
|
|
|
+ // item.颜色 === 颜色
|
|
|
+ // )
|
|
|
+ // .reduce((sum, item) => {
|
|
|
+ // // 根据退还类型决定是加还是减
|
|
|
+ // if (item.退还类型 === '退面料') {
|
|
|
+ // return sum + Number(item.退还数量); // 退面料,增加退还数量
|
|
|
+ // }
|
|
|
+ // // else if (item.退还类型 === '退厂商') {
|
|
|
+ // // return sum - Number(item.退还数量); // 退厂商,减少退还数量
|
|
|
+ // // }
|
|
|
+ // return sum; // 其他退还类型不处理
|
|
|
+ // }, 0);
|
|
|
|
|
|
- // 更新 mianliaotabData 的库存数量
|
|
|
- mianliaotabData.value.库存数量 += totalOutbound;
|
|
|
+ // // 更新 mianliaotabData 的库存数量
|
|
|
+ // mianliaotabData.value.库存数量 += totalOutbound;
|
|
|
} else {
|
|
|
console.error('获取详情数据失败:', Detailres.msg);
|
|
|
}
|
|
|
@@ -625,7 +680,7 @@ const dj_Dialog = () => {
|
|
|
mianliaotabData.value.退还数量 = '';
|
|
|
if(radio1.value === '退面料'){
|
|
|
// 更新 mianliaotabData 的库存数量
|
|
|
- mianliaotabData.value.库存数量 = mianliaotabData.value.库存数量 + Number(退还数量);
|
|
|
+ mianliaotabData.value.库存数量 = +mianliaotabData.value.库存数量 + Number(退还数量);
|
|
|
}
|
|
|
// else if(radio1.value === '退厂商'){
|
|
|
// // 更新 mianliaotabData 的库存数量
|
|
|
@@ -778,6 +833,7 @@ const dj_Dialog = () => {
|
|
|
批次号: item['批次号'],
|
|
|
关联编号: item['关联号'],
|
|
|
单位: item['单位'],
|
|
|
+ departname: item['部门'],
|
|
|
实际门幅: item['实际门幅'],
|
|
|
type: item['退还类型'],
|
|
|
}));
|
|
|
@@ -789,6 +845,8 @@ const dj_Dialog = () => {
|
|
|
if (add_TuihuoReport.code === 0) {
|
|
|
res_bomdialogFormVisible.value = false;
|
|
|
ElMessage({ type: 'success', message: '退还成功' });
|
|
|
+ add_searchInfo.value = '';
|
|
|
+ restableData.splice(0, restableData.length);
|
|
|
danjutableData.value.splice(0, danjutableData.value.length); // 清空表格数据
|
|
|
records_onSubmit();
|
|
|
} else {
|
|
|
@@ -836,7 +894,7 @@ const dj_Dialog = () => {
|
|
|
// 清空数组
|
|
|
recordtableData.splice(0, recordtableData.length);
|
|
|
// 获取退还单数据
|
|
|
- const ReceiptList_res = await ReceiptList({ mouth: '', search: '', page: 1, limit: 50 });
|
|
|
+ const ReceiptList_res = await ReceiptList({ mouth: nodedata.value ? nodedata.value : currentMonth, search: '', page: page.value, limit: pageSize.value,code:'退还' });
|
|
|
if (ReceiptList_res && ReceiptList_res.data && Array.isArray(ReceiptList_res.data.table)) {
|
|
|
const filteredData = ReceiptList_res.data.table.filter(item => item.单号类型 === '退还');
|
|
|
// 更新数据
|
|
|
@@ -939,23 +997,7 @@ const dj_Dialog = () => {
|
|
|
// console.log('用户取消删除操作');
|
|
|
// }
|
|
|
// };
|
|
|
- // =========== 分页 ===========
|
|
|
- // 分页相关的响应式变量
|
|
|
- const page = ref(1)
|
|
|
- const total = ref(0)
|
|
|
- const pageSize = ref(10)
|
|
|
- // 分页
|
|
|
- const handleCurrentChange = (val) => {
|
|
|
- page.value = val;
|
|
|
- _getStaffList();
|
|
|
- };
|
|
|
|
|
|
- // 修改页面容量 点击多少条/页
|
|
|
- const handleSizeChange = (val) => {
|
|
|
- page.value = 10;//默认显示
|
|
|
- pageSize.value = val;
|
|
|
- _getStaffList();
|
|
|
- };
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
/* 根据出库状态文字颜色 */
|