问题修改

master
zhangdi 3 weeks ago
parent 1c606f25fc
commit 9b28c5569d
  1. 2
      src/views/firstOrder/components/consumableDialog.vue
  2. 19
      src/views/firstOrder/components/inDialog.vue
  3. 150
      src/views/firstOrder/components/outDialog.vue
  4. 6
      src/views/materials/expend.vue

@ -27,6 +27,7 @@ export default {
type: String, type: String,
default: '' default: ''
}, },
tableData: { type: Array, default: () => [] },
}, },
data() { data() {
return { return {
@ -175,6 +176,7 @@ export default {
}, },
mounted() { mounted() {
this.consumableVisible = this.consumableVisible this.consumableVisible = this.consumableVisible
this.allSelectedList = this.tableData
}, },
methods: { methods: {
async handleLog(row) { async handleLog(row) {

@ -25,12 +25,12 @@
:span="12" :span="12"
v-show="sizeForm.options == 1 && inDialogType != 'add'" v-show="sizeForm.options == 1 && inDialogType != 'add'"
> >
<el-form-item label="入库单号"> <el-form-item label="入库单号" >
<el-input v-model="sizeForm.orderNo" disabled></el-input> <el-input v-model="sizeForm.orderNo" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="入库时间"> <el-form-item label="入库时间">
<el-date-picker <el-date-picker
v-model="sizeForm.inDate" v-model="sizeForm.inDate"
format="yyyy-MM-dd" format="yyyy-MM-dd"
@ -44,7 +44,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="事由"> <el-form-item label="事由" required>
<el-input <el-input
v-model="sizeForm.reason" v-model="sizeForm.reason"
:disabled="inDialogType == 'details'" :disabled="inDialogType == 'details'"
@ -52,7 +52,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="物资类型"> <el-form-item label="物资类型" required>
<el-select <el-select
v-model="sizeForm.materialType" v-model="sizeForm.materialType"
placeholder="请选择" placeholder="请选择"
@ -65,7 +65,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item prop="source" label="来源"> <el-form-item prop="source" label="来源" required>
<el-select <el-select
v-model="sizeForm.source" v-model="sizeForm.source"
placeholder="请选择" placeholder="请选择"
@ -78,7 +78,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="选项"> <el-form-item label="选项" required>
<el-radio-group <el-radio-group
v-model="sizeForm.option" v-model="sizeForm.option"
@change="radioChange()" @change="radioChange()"
@ -90,7 +90,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="sizeForm.option == 1"> <el-col :span="12" v-if="sizeForm.option == 1">
<el-form-item label="采购单名称"> <el-form-item label="采购单名称">
<el-input v-model="sizeForm.quarterName" disabled></el-input> <el-input v-model="sizeForm.quarterName" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -829,9 +829,10 @@ export default {
return; return;
} }
if ( if (
row.theInboundQuantity + row.yetInboundQuantity > row.theInboundQuantity>0&&
( row.theInboundQuantity + row.yetInboundQuantity >
row.requiredQuantity && row.requiredQuantity &&
!row.remark !row.remark)
) { ) {
this.$message.warning( this.$message.warning(
row.materialName + row.materialName +

@ -4,27 +4,27 @@
:append-to-body="true" width="70%" @close="handleCloseDetail" fullscreen> :append-to-body="true" width="70%" @close="handleCloseDetail" fullscreen>
<!-- 基本信息 --> <!-- 基本信息 -->
<div class="dialog-content"> <div class="dialog-content">
<el-form :model="sizeForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic"> <el-form :model="sizeForm" ref="dynamicValidateForm" label-width="110px" class="demo-dynamic">
<div class="form-title">基本信息</div> <div class="form-title">基本信息</div>
<el-row> <el-row>
<el-col :span="12" v-show="sizeForm.options == 1 && outDialogType != 'add'"> <el-col :span="12" v-show="sizeForm.options == 1 && outDialogType != 'add'">
<el-form-item label="出库单号"> <el-form-item label="出库单号">
<el-input v-model="sizeForm.orderNo" disabled></el-input> <el-input v-model="sizeForm.orderNo" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="出库申请日期"> <el-form-item label="出库申请日期">
<el-date-picker v-model="sizeForm.outDate" type="date" placeholder="选择日期" style="width: 100%" disabled> <el-date-picker v-model="sizeForm.outDate" type="date" placeholder="选择日期" style="width: 100%" disabled>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="事由"> <el-form-item label="事由" required>
<el-input v-model="sizeForm.reason" :disabled="outDialogType == 'details'"></el-input> <el-input v-model="sizeForm.reason" :disabled="outDialogType == 'details'"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="物资类型"> <el-form-item label="物资类型" required>
<el-select v-model="sizeForm.materialType" placeholder="请选择" style="width: 100%" <el-select v-model="sizeForm.materialType" placeholder="请选择" style="width: 100%"
:disabled="outDialogType == 'details'"> :disabled="outDialogType == 'details'">
<el-option label="办公室物资" value="1"></el-option> <el-option label="办公室物资" value="1"></el-option>
@ -33,7 +33,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="选项"> <el-form-item label="选项" required>
<el-radio-group v-model="sizeForm.options" @change="radioChange()" <el-radio-group v-model="sizeForm.options" @change="radioChange()"
:disabled="outDialogType == 'details'"> :disabled="outDialogType == 'details'">
<el-radio :label="1" :disabled="sizeForm.type == 2"><span>批量选择</span></el-radio> <el-radio :label="1" :disabled="sizeForm.type == 2"><span>批量选择</span></el-radio>
@ -42,7 +42,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="sizeForm.options === 2"> <el-col :span="12" v-if="sizeForm.options === 2">
<el-form-item label="选项"> <el-form-item label="选项" required>
<el-radio-group v-model="sizeForm.optionType" :disabled="outDialogType == 'details'" <el-radio-group v-model="sizeForm.optionType" :disabled="outDialogType == 'details'"
@change="getMaterialList"> @change="getMaterialList">
<el-radio label="YH">易耗品</el-radio> <el-radio label="YH">易耗品</el-radio>
@ -51,12 +51,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="sizeForm.options == 1"> <el-col :span="12" v-if="sizeForm.options == 1">
<el-form-item label="需求单名称"> <el-form-item label="需求单名称">
<el-input v-model="sizeForm.demandEndInfo" disabled></el-input> <el-input v-model="sizeForm.demandEndInfo" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="outDialogTiltle == '详情'"> <el-col :span="12" v-if="outDialogTiltle == '详情'">
<el-form-item label="状态"> <el-form-item label="状态">
<span v-if="rowItem.status == 1">暂存</span> <span v-if="rowItem.status == 1">暂存</span>
<span v-if="rowItem.status == 2">待二级库入库</span> <span v-if="rowItem.status == 2">待二级库入库</span>
<span v-if="rowItem.status == 3">已出库</span> <span v-if="rowItem.status == 3">已出库</span>
@ -267,7 +267,7 @@
<!-- 单条新增耐用品弹窗 --> <!-- 单条新增耐用品弹窗 -->
<consumableDialog v-if="consumableVisible" :consumableVisible="consumableVisible" <consumableDialog v-if="consumableVisible" :consumableVisible="consumableVisible"
:demandDialogTitle="demandDialogTitle" @handleCloseDetail="closeDialog" @confirm="confirm"> :demandDialogTitle="demandDialogTitle" :tableData="sizeForm.inTableData" @handleCloseDetail="closeDialog" @confirm="confirm">
</consumableDialog> </consumableDialog>
<!-- 批量耐用品弹窗 --> <!-- 批量耐用品弹窗 -->
<batchSelectionDialog v-if="batchSelectionVisible" :batchSelectionVisible="batchSelectionVisible" <batchSelectionDialog v-if="batchSelectionVisible" :batchSelectionVisible="batchSelectionVisible"
@ -434,7 +434,7 @@ export default {
let data_ = res.data.result let data_ = res.data.result
this.statisticsList = [] this.statisticsList = []
console.log('批量易耗品', this.sizeForm.inTableData, data_) console.log('批量易耗品', this.sizeForm.inTableData, data_)
data_.forEach((stat,index) => { data_.forEach((stat, index) => {
const detail = this.sizeForm.inTableData.find( const detail = this.sizeForm.inTableData.find(
(item) => item.materialCode === stat.materialCode (item) => item.materialCode === stat.materialCode
); );
@ -473,14 +473,14 @@ export default {
}); });
console.log('detail', this.statisticsList) console.log('detail', this.statisticsList)
}); });
}, },
changeDepartment() { changeDepartment() {
this.getStatistics(); this.getStatistics();
}, },
batchclose() { batchclose() {
this.batchSelectionVisible = false; this.batchSelectionVisible = false;
}, },
selectionChange(row) { selectionChange(row) {
this.batchSelectionVisible = false; this.batchSelectionVisible = false;
row.forEach((item) => { row.forEach((item) => {
item.outboundQuantity = 1; item.outboundQuantity = 1;
@ -490,8 +490,8 @@ selectionChange(row) {
this.sizeForm.inTableData = row; this.sizeForm.inTableData = row;
this.getStatistics(); this.getStatistics();
}, },
confirm(allSelectedList) { confirm(allSelectedList) {
this.consumableVisible = false; this.consumableVisible = false;
allSelectedList.forEach((item) => { allSelectedList.forEach((item) => {
item.outboundQuantity = 1; item.outboundQuantity = 1;
@ -501,34 +501,34 @@ confirm(allSelectedList) {
this.sizeForm.inTableData = allSelectedList; this.sizeForm.inTableData = allSelectedList;
this.getStatistics(); this.getStatistics();
}, // }, //
async handleSearch() { async handleSearch() {
// //
this.currentPage = 1; this.currentPage = 1;
await this.loadGoodsList(); await this.loadGoodsList();
}, },
// //
handleSizeChange(val) { handleSizeChange(val) {
this.pageSize = val; this.pageSize = val;
this.currentPage = 1; this.currentPage = 1;
this.loadGoodsList(); this.loadGoodsList();
}, },
// //
handleCurrentChange(val) { handleCurrentChange(val) {
this.currentPage = val; this.currentPage = val;
this.loadGoodsList(); this.loadGoodsList();
}, },
depchange(value) { depchange(value) {
this.departmentList = this.departmentList; this.departmentList = this.departmentList;
}, },
// //
handleBatchClose() { handleBatchClose() {
this.inBatchDialogVisible = false; this.inBatchDialogVisible = false;
}, },
// //
inTableAdd() { inTableAdd() {
const requiredFields = [ const requiredFields = [
{ value: this.sizeForm.reason, message: "请填写事由" }, { value: this.sizeForm.reason, message: "请填写事由" },
{ value: this.sizeForm.materialType, message: "请选择物资类型" }, { value: this.sizeForm.materialType, message: "请选择物资类型" },
@ -544,13 +544,22 @@ inTableAdd() {
return; return;
} }
} }
if (
this.sizeForm.optionType === "NY" &&
this.outDialogType !== "details"
) {
this.consumableVisible = true;
} else {
this.sizeForm.inTableData.push({}); this.sizeForm.inTableData.push({});
}, }
addInit() {
},
addInit() {
this.sizeForm.outDate = new Date(); // this.sizeForm.outDate = new Date(); //
}, },
// //
syncInboundQuantity(row) { syncInboundQuantity(row) {
row.theOutboundQuantity = Number(row.theOutboundQuantity); row.theOutboundQuantity = Number(row.theOutboundQuantity);
if (this.sizeForm.options === 1) { if (this.sizeForm.options === 1) {
const maxAllowQuantity = const maxAllowQuantity =
@ -565,16 +574,16 @@ syncInboundQuantity(row) {
row.outboundQuantity = 1; row.outboundQuantity = 1;
} }
this.getStatistics(); this.getStatistics();
}, },
// //
handleCloseDetail() { handleCloseDetail() {
this.outDialogVisible = false; this.outDialogVisible = false;
this.$emit("handleCloseDetail"); this.$emit("handleCloseDetail");
}, },
closeDialog() { closeDialog() {
this.consumableVisible = false; this.consumableVisible = false;
}, },
// //
async getQuarterList() { async getQuarterList() {
try { try {
@ -592,7 +601,7 @@ closeDialog() {
} catch (error) { } catch (error) {
this.$message.error("获取需求单列表失败"); this.$message.error("获取需求单列表失败");
} }
}, },
// //
async onQuarterSelectChange(ids) { async onQuarterSelectChange(ids) {
if (!ids) return; if (!ids) return;
@ -616,7 +625,7 @@ closeDialog() {
} else { } else {
this.departmentList = []; this.departmentList = [];
} }
}, },
async batchSubmit() { async batchSubmit() {
if (!this.inBatchForm.batchType) { if (!this.inBatchForm.batchType) {
@ -708,7 +717,7 @@ closeDialog() {
}数据失败${error.message}` }数据失败${error.message}`
); );
} }
}, },
// //
async getDetailedItems() { async getDetailedItems() {
this.loading = true; this.loading = true;
@ -723,17 +732,28 @@ closeDialog() {
} finally { } finally {
this.loading = false; this.loading = false;
} }
}, },
getDepartmentName(departmentId) { getDepartmentName(departmentId) {
const department = this.list.find( const department = this.list.find(
(item) => item.departmentId === departmentId (item) => item.departmentId === departmentId
); );
return department ? department.department : ""; return department ? department.department : "";
}, },
// //
async getMaterialList() { async getMaterialList() {
this.loading = true; this.loading = true;
this.consumableVisible = false; this.consumableVisible = false;
this.sizeForm.inTableData = [];
this.statisticsList = [];
// this.sizeForm.optionType = "";
this.inBatchDialogVisible = false;
this.consumableVisible = false;
this.inBatchDialogVisible = false;
this.batchSelectionVisible = false;
this.batchTableData = [];
// this.inBatchForm.batchType = ""
// this.inBatchForm.department = ""
this.sizeForm.demandEndInfo = "";
try { try {
if ( if (
this.sizeForm.optionType === "NY" && this.sizeForm.optionType === "NY" &&
@ -752,9 +772,9 @@ getDepartmentName(departmentId) {
} finally { } finally {
this.loading = false; this.loading = false;
} }
}, },
// //
handleMaterialChange(row, index) { handleMaterialChange(row, index) {
let select = this.materials.filter( let select = this.materials.filter(
(item) => item.materialId === row.materialId (item) => item.materialId === row.materialId
)[0]; )[0];
@ -767,7 +787,7 @@ handleMaterialChange(row, index) {
this.sizeForm.inTableData[index].unit = select.unit; this.sizeForm.inTableData[index].unit = select.unit;
this.sizeForm.inTableData[index].num = select.num; this.sizeForm.inTableData[index].num = select.num;
this.getStatistics(); this.getStatistics();
}, },
// //
async submit(index) { async submit(index) {
if (!this.sizeForm.reason) { if (!this.sizeForm.reason) {
@ -863,7 +883,7 @@ handleMaterialChange(row, index) {
this.saveLoading = false; this.saveLoading = false;
this.$message.error(error.message || "服务器错误"); this.$message.error(error.message || "服务器错误");
} }
}, },
// //
async inInit() { async inInit() {
@ -890,10 +910,10 @@ handleMaterialChange(row, index) {
this.getStatistics(); this.getStatistics();
}); });
} }
}, },
// //
radioChange() { radioChange() {
this.sizeForm.inTableData = []; this.sizeForm.inTableData = [];
this.statisticsList = []; this.statisticsList = [];
this.sizeForm.optionType = ""; this.sizeForm.optionType = "";
@ -913,15 +933,15 @@ radioChange() {
this.inBatchForm.optionType = ""; this.inBatchForm.optionType = "";
this.inBatchForm.optionType = ""; this.inBatchForm.optionType = "";
} }
}, },
// //
handleDelete(index, row) { handleDelete(index, row) {
this.sizeForm.inTableData.splice(index, 1); this.sizeForm.inTableData.splice(index, 1);
this.$message.success("已成功删除该条记录"); this.$message.success("已成功删除该条记录");
this.getStatistics(); this.getStatistics();
},
}, },
watch: { },
watch: {
// //
// "inBatchForm.batchType": function (newVal) { // "inBatchForm.batchType": function (newVal) {
// (this.inBatchForm.department = ""), (this.inBatchForm.optionType = 1); // (this.inBatchForm.department = ""), (this.inBatchForm.optionType = 1);
@ -937,7 +957,7 @@ watch: {
// this.getMaterialList(); // this.getMaterialList();
// } // }
// }, // },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -191,6 +191,12 @@ export default {
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
}, },
{
label: "使用人",
prop: "proposerName",
headerAlign: "center",
align: "center",
},
{ {
label: "归还时间", label: "归还时间",
prop: "returnTime", prop: "returnTime",

Loading…
Cancel
Save