一级出入库管理

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

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

Loading…
Cancel
Save