问题修改

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

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

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

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

Loading…
Cancel
Save