一级出库管理

master
zhangdi 2 months ago
parent c16329ea5a
commit d4ba256077
  1. 74
      src/views/firstOrder/components/approvalProcessDialog.vue
  2. 39
      src/views/firstOrder/components/inDialog.vue
  3. 30
      src/views/firstOrder/inbound.vue

@ -1,13 +1,21 @@
<template> <template>
<div> <div>
<el-dialog :close-on-click-modal="false" :title="inDialogTiltle" :visible.sync="inDialogVisible" <el-dialog
:append-to-body="true" width="20%" @close="handleCloseDetail"> :close-on-click-modal="false"
<el-steps class="teps-con" direction="vertical" :active="1"> :title="inDialogTiltle"
<el-step v-for="(item, index) in processedApproveList" :visible.sync="inDialogVisible"
:append-to-body="true"
width="20%"
@close="handleCloseDetail"
>
<el-steps class="teps-con" direction="vertical" :active="-1">
<el-step
v-for="(item, index) in processedApproveList"
:key="item.id" :key="item.id"
:title="item.userName" :title="item.userName"
:description="`状态:${item.statusText}\n${item.formattedTime}`" :description="`状态:${item.statusText}\n${item.formattedTime}`"
></el-step> :status="item.stepStatus"
></el-step>
</el-steps> </el-steps>
</el-dialog> </el-dialog>
</div> </div>
@ -33,51 +41,70 @@ export default {
computed: { computed: {
// //
processedApproveList() { processedApproveList() {
return this.approveList.map(item => { return this.approveList.map((item) => {
// 1. let formattedTime = "";
let formattedTime = ''
if (item.optTime) { if (item.optTime) {
const date = new Date(item.optTime); const date = new Date(item.optTime);
const pad = (num) => num.toString().padStart(2, '0'); const pad = (num) => num.toString().padStart(2, "0");
formattedTime = `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`; formattedTime = `${date.getFullYear()}-${pad(
date.getMonth() + 1
)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(
date.getMinutes()
)}:${pad(date.getSeconds())}`;
} }
let statusText = '待审核'
if (item.status !== '' && item.status !== undefined) { let statusText = "待审核";
let stepStatus = "wait"; //
if (item.status !== "" && item.status !== undefined) {
const statusMap = { const statusMap = {
0: '审批中', 0: "审批中",
1: '已完成', 1: "已完成",
2: '已驳回', 2: "已驳回",
}; };
statusText = statusMap[item.status] || ''; statusText = statusMap[item.status] || "未知";
// el-step status
if (item.status === '0') {
stepStatus = "process";
} else if (item.status === '1') {
stepStatus = "finish";
} else if (item.status === '2') {
stepStatus = "error";
}
} }
return { return {
...item, ...item,
formattedTime, formattedTime,
statusText, statusText,
stepStatus, // 👈
}; };
}); });
}, },
activeStep() { activeStep() {
return this.processedApproveList.findIndex((item, index, array) => { return (
return index === array.length - 1 && item.statusText !== '审批中'; this.processedApproveList.findIndex((item, index, array) => {
}) || 0; return index === array.length - 1 && item.statusText !== "审批中";
} }) || 0
);
},
}, },
methods: { methods: {
handleCloseDetail() { handleCloseDetail() {
this.inDialogVisible = false; this.inDialogVisible = false;
this.$emit("closeDialog"); this.$emit("closeDialog");
} },
}, },
data() { data() {
return { return {
inDialogVisible: false, inDialogVisible: false,
inDialogTiltle: "审批流程" inDialogTiltle: "审批流程",
}; };
}, },
mounted() { mounted() {
this.inDialogVisible = this.showDialog; this.inDialogVisible = this.showDialog;
} },
}; };
</script> </script>
@ -98,7 +125,6 @@ export default {
} }
} }
// :deep(.el-dialog__body) { // :deep(.el-dialog__body) {
// height: 300px; // height: 300px;
// } // }

@ -488,9 +488,7 @@
<el-table-column prop="date" label="入库后库存"> <el-table-column prop="date" label="入库后库存">
<el-table-column label="数量"> <el-table-column label="数量">
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{ scope.row.totalQuantity }}
scope.row.totalQuantity
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="unitPrice" label="单价"> <el-table-column prop="unitPrice" label="单价">
@ -609,9 +607,7 @@ export default {
status: "", // status: "", //
quarterName: "", quarterName: "",
purchaseEndInfo: "", // purchaseEndInfo: "", //
userInfoVO: { userInfoVO: {},
},
ldOnePutStorageDetailVOList: [], // ldOnePutStorageDetailVOList: [], //
}, },
inTableData: [], inTableData: [],
@ -623,7 +619,7 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters(["userInfo"]), ...mapGetters(["userInfo"]),
inDate() { inDate() {
const now = new Date(); const now = new Date();
const year = now.getFullYear(); const year = now.getFullYear();
@ -644,7 +640,7 @@ export default {
} }
this.getBatchOptions(); this.getBatchOptions();
this.getMaterialList(); this.getMaterialList();
this.sizeForm.userInfoVO = this.userInfo; this.sizeForm.userInfoVO = this.userInfo;
}, },
methods: { methods: {
// //
@ -653,7 +649,8 @@ export default {
this.statisticsList = res.data.result; this.statisticsList = res.data.result;
this.statisticsList = this.statisticsList.map((stat) => { this.statisticsList = this.statisticsList.map((stat) => {
const detail = this.sizeForm.inTableData.find( const detail = this.sizeForm.inTableData.find(
(item) => item.materialCode === stat.materialCode && item.type === stat.type (item) =>
item.materialCode === stat.materialCode && item.type === stat.type
); );
return { return {
...stat, ...stat,
@ -670,7 +667,8 @@ export default {
this.statisticsList = res.data.result; this.statisticsList = res.data.result;
this.statisticsList = this.statisticsList.map((stat) => { this.statisticsList = this.statisticsList.map((stat) => {
const detail = this.sizeForm.singleData.find( const detail = this.sizeForm.singleData.find(
(item) => item.materialId === stat.materialId&& item.type === stat.type (item) =>
item.materialId === stat.materialId && item.type === stat.type
); );
return { return {
...stat, ...stat,
@ -683,19 +681,19 @@ export default {
}, },
// //
syncInboundQuantity(row) { syncInboundQuantity(row) {
row.theInboundQuantity = Number(row.theInboundQuantity); // row.theInboundQuantity = Number(row.theInboundQuantity);
if(this.sizeForm.option == 1){ if (this.sizeForm.option == 1) {
this.getStatistics(); this.getStatistics();
}else{ } else {
this.getStatisticsSingle(); this.getStatisticsSingle();
} }
}, },
// //
syncUnitPrice(row) { syncUnitPrice(row) {
row.unitPrice = Number(row.unitPrice); row.unitPrice = Number(row.unitPrice);
if(this.sizeForm.option == 1){ if (this.sizeForm.option == 1) {
this.getStatistics(); this.getStatistics();
}else{ } else {
this.getStatisticsSingle(); this.getStatisticsSingle();
} }
}, },
@ -818,7 +816,7 @@ export default {
this.sizeForm.inTableData = res.data.result; this.sizeForm.inTableData = res.data.result;
this.sizeForm.inTableData.forEach((item) => { this.sizeForm.inTableData.forEach((item) => {
item.theInboundQuantity = 0; item.theInboundQuantity = 0;
if(item.type == 'YH'){ if (item.type == "YH") {
item.unitPrice = 0; item.unitPrice = 0;
} }
}); });
@ -980,7 +978,6 @@ export default {
this.sizeForm.option = ""; this.sizeForm.option = "";
} }
try { try {
const res = await submitData(this.sizeForm); const res = await submitData(this.sizeForm);
if (res.data.success) { if (res.data.success) {
this.$message({ this.$message({
@ -1030,9 +1027,9 @@ export default {
} }
} }
if(this.sizeForm.option == 1){ if (this.sizeForm.option == 1) {
this.getStatistics(); this.getStatistics();
}else{ } else {
this.getStatisticsSingle(); this.getStatisticsSingle();
} }
}, },
@ -1059,7 +1056,7 @@ export default {
padding-right: 10px; padding-right: 10px;
} }
::v-deep.el-table th.el-table__cell { ::v-deep.el-table th.el-table__cell {
background: #F5F7FA; background: #f5f7fa;
font-weight: 500; font-weight: 500;
} }
</style> </style>

@ -17,7 +17,7 @@
@on-load="onLoad" @on-load="onLoad"
> >
<template slot-scope="scope" slot="menuLeft"> <template slot-scope="scope" slot="menuLeft">
<el-button size="small" type="primary" @click="handleDesign()" <el-button size="small" type="primary" @click="handleDesign()"
>新增入库单 >新增入库单
</el-button> </el-button>
</template> </template>
@ -91,7 +91,7 @@ export default {
}, },
data() { data() {
return { return {
approveList:[], approveList: [],
form: { inDate: [], inOperatorName: "", inOperator: "" }, form: { inDate: [], inOperatorName: "", inOperator: "" },
selectionList: [], selectionList: [],
query: {}, query: {},
@ -144,13 +144,13 @@ export default {
return "无"; // return "无"; //
} }
return value; // return value; //
} },
}, },
{ {
label: "入库单号", label: "入库单号",
prop: "orderNo", prop: "orderNo",
width: 160, width: 160,
align: "center" align: "center",
}, },
{ {
label: "入库日期", label: "入库日期",
@ -160,10 +160,10 @@ export default {
searchRange: true, searchRange: true,
startPlaceholder: "开始时间", startPlaceholder: "开始时间",
endPlaceholder: "结束时间", endPlaceholder: "结束时间",
format: 'yyyy-MM-dd HH:mm:ss', format: "yyyy-MM-dd HH:mm:ss",
valueFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: "yyyy-MM-dd HH:mm:ss",
width: 160, width: 160,
align: "center" align: "center",
// searchParam: 'startTime', // searchParam: 'startTime',
// searchEndParam: 'endTime' // searchEndParam: 'endTime'
}, },
@ -171,8 +171,8 @@ export default {
label: "入库人", label: "入库人",
prop: "inOperatorName", prop: "inOperatorName",
search: true, search: true,
searchParam: 'inOperator', searchParam: "inOperator",
align: "center" align: "center",
}, },
{ {
label: "来源", label: "来源",
@ -184,11 +184,11 @@ export default {
dicData: [ dicData: [
{ {
label: "采购申请", label: "采购申请",
value: 'cg', value: "cg",
}, },
{ {
label: "其他来源", label: "其他来源",
value: 'qt', value: "qt",
}, },
], ],
}, },
@ -259,8 +259,7 @@ export default {
async approvalProcessFn(row) { async approvalProcessFn(row) {
this.approvalProcessShow = true; this.approvalProcessShow = true;
const res = await editList(row.id); const res = await editList(row.id);
this.approveList = res.data.result.approveList this.approveList = res.data.result.approveList;
console.log(this.approveList,'1111122')
}, },
handleDesign() { handleDesign() {
this.inDialogType = "add"; this.inDialogType = "add";
@ -283,7 +282,6 @@ export default {
}, },
// //
purchaseFn(row) { purchaseFn(row) {
console.log(122)
this.purchaseOpen = true; this.purchaseOpen = true;
this.purchaseTitle = row.purchaseEndInfo + "采购单详情"; this.purchaseTitle = row.purchaseEndInfo + "采购单详情";
this.id = row.id; this.id = row.id;
@ -370,6 +368,4 @@ export default {
}; };
</script> </script>
<style> <style></style>
</style>

Loading…
Cancel
Save