一级出入库管理

master
zhangdi 3 months ago
parent 6b71c5ec1f
commit 5a1bb56f95
  1. 147
      src/views/firstOrder/components/outDialog.vue
  2. 1
      src/views/materials/expend.vue

@ -148,17 +148,7 @@
}}
</template>
</el-table-column>
<!-- <el-table-column prop="type" label="出库类型">
<template slot-scope="scope">
{{
scope.row.type === "NY"
? "出库单"
: scope.row.type === "YH"
? "发放单"
: ""
}}
</template>
</el-table-column> -->
<el-table-column prop="unit" label="单位"> </el-table-column>
<el-table-column
label="部门"
@ -201,36 +191,39 @@
v-if="sizeForm.options == 1"
>
<template slot-scope="scope">
{{ scope.row.outboundQuantity || 0 }}
<!-- <span v-if="outDialogType != 'details'">{{ scope.row.outboundQuantity || 0 }}</span>
<span v-else>{{ scope.row.outboundSumQuantity || 0 }}</span> -->
<span>{{ scope.row.outboundQuantity || 0 }}</span>
</template>
</el-table-column>
<el-table-column prop="theOutboundQuantity" label="本次出库数量">
<template slot-scope="scope">
<el-input-number
size="mini"
v-model="scope.row.theOutboundQuantity"
:min="0"
style="width: 100%"
@change="syncInboundQuantity(scope.row)"
:disabled="outDialogType == 'details'"
v-if="
sizeForm.optionType === 'YH' ||
inBatchForm.optionType === 'YH'
"
></el-input-number>
<span v-else>{{ (scope.row.theOutboundQuantity = 1) }}</span>
<div v-if="outDialogType != 'details'">
<el-input-number
size="mini"
v-model="scope.row.theOutboundQuantity"
:min="0"
style="width: 100%"
@change="syncInboundQuantity(scope.row)"
:disabled="outDialogType == 'details'"
v-if="
sizeForm.optionType === 'YH' ||
(sizeForm.options==1&&inBatchForm.optionType === 'YH')
"
></el-input-number>
<span v-else>{{scope.row.outboundQuantity}}</span>
</div>
<span v-else>{{scope.row.outboundQuantity}}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
style="text-align: center"
width="100"
v-if="outDialogType != 'details'"
>
<template slot-scope="scope">
<div
style="text-align: center"
:disabled="outDialogType == 'details'"
>
<el-button
type="text"
size="mini"
@ -238,7 +231,6 @@
>
删除
</el-button>
</div>
</template>
</el-table-column>
</el-table>
@ -279,18 +271,7 @@
}}
</template>
</el-table-column>
<!-- <el-table-column
prop="departmentName"
label="部门"
v-if="sizeForm.options == 2"
:key="'account-dept-' + sizeForm.options"
>
<template slot-scope="scope">
<span>
{{ getDepartmentName(scope.row.department) }}
</span>
</template>
</el-table-column> -->
<el-table-column prop="num" label="数量"> </el-table-column>
</el-table-column>
@ -361,7 +342,7 @@
v-model="inBatchForm.batchType"
placeholder="请选择需求单"
style="width: 100%"
@change="resetHandle"
@change="onQuarterSelectChange"
>
<el-option
v-for="item in quarterList"
@ -399,6 +380,7 @@
<el-radio-group
v-model="inBatchForm.optionType"
:disabled="outDialogType == 'details'"
>
<el-radio label="YH">易耗品</el-radio>
<el-radio label="NY">耐用品</el-radio>
@ -531,10 +513,6 @@ export default {
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, "0");
const day = String(now.getDate()).padStart(2, "0");
// const hour = String(now.getHours()).padStart(2, '0')
// const minute = String(now.getMinutes()).padStart(2, '0')
// const second = String(now.getSeconds()).padStart(2, '0')
// return `${year}-${month}-${day} ${hour}:${minute}:${second}`
return `${year}-${month}-${day}`;
},
},
@ -593,15 +571,15 @@ export default {
console.log("detail", detail, stat);
//
if (
this.sizeForm.options == 1 &&
this.inBatchForm.optionType == "NY"
(this.sizeForm.options == 1 &&
this.inBatchForm.optionType == "NY")||(this.sizeForm.options == 2 &&
this.sizeForm.optionType == "NY")
) {
const detailList = this.sizeForm.inTableData.filter(
(item) =>
item.materialCode === stat.materialCode &&
item.materialName === stat.materialName
);
console.log("detailList", detailList);
detail.theOutboundQuantity = detailList.reduce((acc, cur) => acc + cur.num, 0);
}
@ -633,7 +611,6 @@ export default {
this.consumableVisible = false;
this.sizeForm.inTableData = allSelectedList;
this.getStatistics();
console.log(this.sizeForm.inTableData, "111220");
}, //
async handleSearch() {
//
@ -808,7 +785,6 @@ export default {
if (this.inBatchForm.optionType === "NY") {
this.batchSelectionVisible = true;
this.dialogVisible = true;
console.log(1);
this.batchTableData = res.data.result;
} else {
this.getStatistics();
@ -971,41 +947,18 @@ export default {
this.sizeForm.outDate = ldOneOutStorage.outDate;
this.sizeForm.options = Number(ldOneOutStorage.options);
this.sizeForm.optionType = ldOneOutStorage.optionType;
this.batchSelectionVisible = false
console.log( res.data.result.ldOneOutStorageDetails, "this.sizeForm.options");
this.$set(
this.sizeForm,
"inTableData",
res.data.result.ldOneOutStorageDetails
);
console.log(this.sizeForm, "111");
this.getStatistics();
});
}
},
// async inInit() {
// if (this.outDialogType == 'details' || this.outDialogType == 'edit') {
// try {
// const res = await editList(this.id);
// const { ldOneOutStorage, ldOneOutStorageDetails = [] } = res.data.result || {};
// if (!ldOneOutStorage) {
// this.$message.error("");
// return;
// }
// const handledDetailList = ldOneOutStorageDetails.map(item => ({
// ...item,
// outboundQuantity: item.outboundQuantity || 0
// }))
// this.sizeForm = {
// ...this.sizeForm,
// ...ldOneOutStorage,
// outDate: ldOneOutStorage.outDate ? new Date(ldOneOutStorage.outDate) : '',
// options: Number(ldOneOutStorage.options) || 1,
// }
// this.sizeForm.inTableData = handledDetailList;
// } catch (error) {
// this.$message.error("");
// }
// }
// },
//
radioChange() {
this.sizeForm.inTableData = [];
@ -1024,16 +977,6 @@ export default {
this.inBatchForm.optionType = "";
}
},
// closeHandle() {
// this.inBatchForm.batchType = '',
// this.inBatchForm.department = ''
// this.inBatchForm.optionType = ''
// this.sizeForm.inTableData = []
// this.getQuarterList()
// this.inBatchDialogVisible = true
// // this.sizeForm.inTableData = []
// },
//
handleDelete(index, row) {
this.sizeForm.inTableData.splice(index, 1);
@ -1042,20 +985,20 @@ export default {
},
watch: {
//
"inBatchForm.batchType": function (newVal) {
(this.inBatchForm.department = ""), (this.inBatchForm.optionType = 1);
if (newVal) {
this.onQuarterSelectChange(newVal);
}
},
"sizeForm.optionType": function (newVal) {
if (newVal && this.outDialogType === "add") {
this.sizeForm.inTableData = [];
this.getMaterialList();
} else if (newVal && this.outDialogType !== "add") {
this.getMaterialList();
}
},
// "inBatchForm.batchType": function (newVal) {
// (this.inBatchForm.department = ""), (this.inBatchForm.optionType = 1);
// if (newVal) {
// this.onQuarterSelectChange(newVal);
// }
// },
// "sizeForm.optionType": function (newVal) {
// if (newVal && this.outDialogType === "add") {
// this.sizeForm.inTableData = [];
// this.getMaterialList();
// } else if (newVal && this.outDialogType !== "add") {
// this.getMaterialList();
// }
// },
},
};
</script>

@ -22,6 +22,7 @@
<span v-if="scope.row.isBorrow == '0'">已借出</span>
<span v-else-if="scope.row.isBorrow == '1'">已归还</span>
<span v-else-if="scope.row.isBorrow == '2'">已报废</span>
<span v-else>待借出</span>
</template>
<template slot-scope="scope" slot="menu">
<el-button

Loading…
Cancel
Save