一级出库管理

master
zhangdi 2 months ago
parent c16329ea5a
commit d4ba256077
  1. 72
      src/views/firstOrder/components/approvalProcessDialog.vue
  2. 33
      src/views/firstOrder/components/inDialog.vue
  3. 28
      src/views/firstOrder/inbound.vue

@ -1,12 +1,20 @@
<template>
<div>
<el-dialog :close-on-click-modal="false" :title="inDialogTiltle" :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"
<el-dialog
:close-on-click-modal="false"
:title="inDialogTiltle"
: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"
:title="item.userName"
:description="`状态:${item.statusText}\n${item.formattedTime}`"
:status="item.stepStatus"
></el-step>
</el-steps>
</el-dialog>
@ -33,51 +41,70 @@ export default {
computed: {
//
processedApproveList() {
return this.approveList.map(item => {
// 1.
let formattedTime = ''
return this.approveList.map((item) => {
let formattedTime = "";
if (item.optTime) {
const date = new Date(item.optTime);
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())}`;
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())}`;
}
let statusText = '待审核'
if (item.status !== '' && item.status !== undefined) {
let statusText = "待审核";
let stepStatus = "wait"; //
if (item.status !== "" && item.status !== undefined) {
const statusMap = {
0: '审批中',
1: '已完成',
2: '已驳回',
0: "审批中",
1: "已完成",
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 {
...item,
formattedTime,
statusText,
stepStatus, // 👈
};
});
},
activeStep() {
return this.processedApproveList.findIndex((item, index, array) => {
return index === array.length - 1 && item.statusText !== '审批中';
}) || 0;
}
return (
this.processedApproveList.findIndex((item, index, array) => {
return index === array.length - 1 && item.statusText !== "审批中";
}) || 0
);
},
},
methods: {
handleCloseDetail() {
this.inDialogVisible = false;
this.$emit("closeDialog");
}
},
},
data() {
return {
inDialogVisible: false,
inDialogTiltle: "审批流程"
inDialogTiltle: "审批流程",
};
},
mounted() {
this.inDialogVisible = this.showDialog;
}
},
};
</script>
@ -98,7 +125,6 @@ export default {
}
}
// :deep(.el-dialog__body) {
// height: 300px;
// }

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

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

Loading…
Cancel
Save