空管耐用品库存管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

762 lines
29 KiB

6 months ago
<template>
<div>
<el-dialog :close-on-click-modal="false" :title="outDialogTiltle" :visible.sync="outDialogVisible"
:append-to-body="true" width="70%" @close="handleCloseDetail" fullscreen>
<!-- 基本信息 -->
4 months ago
<div class="dialog-content">
<el-form :model="sizeForm" ref="dynamicValidateForm" label-width="100px" 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-input v-model="sizeForm.orderNo" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<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-input v-model="sizeForm.reason" :disabled="outDialogType == 'details'"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物资类型">
<el-select v-model="sizeForm.materialType" placeholder="请选择" style="width: 100%;"
:disabled="outDialogType == 'details'">
<el-option label="办公室物资" value="1"></el-option>
<el-option label="其他物资" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="选项">
<el-radio-group v-model="sizeForm.options" @change="radioChange()"
:disabled="outDialogType == 'details'">
<el-radio :label="1" :disabled="sizeForm.type == 2"><span>批量选择</span></el-radio>
4 months ago
<el-radio :label="2">单项选择</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" v-if="sizeForm.options === 2">
<el-form-item label="选项">
<el-radio-group v-model="sizeForm.optionType" :disabled="outDialogType == 'details'"
@change="getMaterialList">
<el-radio label="YH">易耗品</el-radio>
<el-radio label="NY">耐用品</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" v-if="sizeForm.options == 1">
<el-form-item label="需求单名称">
<el-input v-model="sizeForm.demandEndInfo" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<div class="form-title">{{ outDate }} 出库信息</div>
<el-button type="primary" size="mini" style="margin-bottom: 18px;" @click="inTableAdd()"
4 months ago
v-if="sizeForm.options == 2 && outDialogType != 'details'">新增</el-button>
4 months ago
<el-table :data="sizeForm.inTableData" border style="width: 100%">
<el-table-column prop="materialCode" label="物资编码">
6 months ago
</el-table-column>
<el-table-column prop="materialName" label="物资名称">
4 months ago
<template slot-scope="scope">
<el-select v-model="scope.row.materialitem" placeholder="请选择物资名称" style="width: 100%;"
@change="handleMaterialChange(scope.row.materialitem, scope.$index)"
4 months ago
v-if='outDialogType != "details" && sizeForm.options == 2 && sizeForm.optionType == "YH"'
4 months ago
value-key="id">
<el-option v-for="item in materials" :key="item.materialId" :label="item.materialName" :value="item">
</el-option>
</el-select>
<span v-else> {{ scope.row.materialName }}</span>
</template>
6 months ago
</el-table-column>
<el-table-column prop="model" label="规格">
6 months ago
</el-table-column>
<el-table-column prop="type" label="类别">
<template slot-scope="scope">
{{ scope.row.type === "NY" ? "耐用品" : (scope.row.type === "YH" ? "易耗品" : "") }}
</template>
6 months ago
</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>
4 months ago
<el-table-column prop="unit" label="单位">
</el-table-column>
4 months ago
<el-table-column label="部门" prop="departmentName" v-if="sizeForm.options === 2 || sizeForm.optionType"
4 months ago
:key="'account-dept-' + sizeForm.options">
<template slot-scope="scope">
4 months ago
<el-select v-model="scope.row.department" placeholder="请选择部门名称" style="width: 100%;"
v-if='outDialogType != "details"'>
4 months ago
<el-option v-for="item in list" :key="item.departmentId" :label="item.department"
:value="item.departmentId">
</el-option>
</el-select>
4 months ago
<span v-else> {{ scope.row.departmentName || '' }}</span>
</template>
6 months ago
</el-table-column>
<!-- <el-table-column prop="departmentName" label="部门" :key="'account-dept-' + sizeForm.options">
<template slot-scope="scope">
<el-select v-model="scope.row.department" placeholder="请选择部门名称" style="width: 100%;"
v-if='outDialogType != "details" && sizeForm.options === 2 && sizeForm.optionType'>
<el-option v-for="item in list" :key="item.departmentId" :label="item.department"
:value="item.departmentId">
</el-option>
</el-select>
<span v-else>{{ scope.row.departmentName }}</span>
</template>
</el-table-column> -->
4 months ago
<el-table-column prop="applicationQuantity" label="申请数量" v-if="sizeForm.options == 1">
4 months ago
<template slot-scope="scope">
{{ scope.row.applicationQuantity || 0 }}
</template>
6 months ago
</el-table-column>
4 months ago
<el-table-column prop="outboundQuantity" label="已出库数量" v-if="sizeForm.options == 1">
4 months ago
<template slot-scope="scope">
{{ scope.row.outboundQuantity || 0 }}
</template>
4 months ago
</el-table-column>
4 months ago
<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%;"
4 months ago
@change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'"
v-if="sizeForm.optionType === 'YH' || inBatchForm.optionType === 'YH'"></el-input-number>
4 months ago
<span v-else>{{ scope.row.theOutboundQuantity = 1 }}</span>
4 months ago
</template>
</el-table-column>
4 months ago
<el-table-column label="操作" style="text-align: center;" v-if="outDialogType != 'details'">
4 months ago
<template slot-scope="scope">
4 months ago
<div style="text-align: center;" :disabled="outDialogType == 'details'">
4 months ago
<el-button type="text" size="mini" @click="handleDelete(scope.$index, scope.row)">
删除
</el-button>
</div>
</template>
</el-table-column>
</el-table>
<div class="form-title" v-if="outDialogType !== 'details'">出库账目表格</div>
<el-table :data="sizeForm.inTableData" border style="width: 100%" v-if="outDialogType !== 'details'">
<el-table-column prop="date" label="当前库存" width="100">
<el-table-column prop="materialCode" label="物资编码">
</el-table-column>
<el-table-column prop="materialName" label="物资名称">
</el-table-column>
<el-table-column prop="model" label="规格">
</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="type" label="出库类型">
<template slot-scope="scope">
{{ scope.row.type === "NY" ? "出库单" : (scope.row.type === "YH" ? "发放单" : "") }}
</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="theOutboundQuantity" label="本次出库数量">
</el-table-column>
</el-table-column>
<el-table-column prop="date" label="出库信息" v-if="sizeForm.options == 1">
<el-table-column prop="outboundQuantity" label="数量">
<template slot-scope="scope">
{{ scope.row.outboundQuantity || 0 }}
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-form>
</div>
4 months ago
<span slot="footer" class="dialog-footer" v-if="outDialogType != 'details'">
6 months ago
<el-button @click="handleCloseDetail()"> </el-button>
<el-button type="primary" @click="submit(1)">暂存</el-button>
<el-button type="primary" @click="submit(2)">提交</el-button>
6 months ago
</span>
</el-dialog>
4 months ago
<!-- 批量出库 选择数据源弹窗 -->
6 months ago
<el-dialog :close-on-click-modal="false" title="选择数据来源" :visible.sync="inBatchDialogVisible" :append-to-body="true"
width="40%" @close="handleBatchClose" @open="getQuarterList">
6 months ago
<el-form :model="inBatchForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
<el-row>
<el-col :span="24">
<el-form-item label="需求单">
<template slot-scope="scope">
4 months ago
<el-select v-model="inBatchForm.batchType" placeholder="请选择需求单" style="width: 100%;"
@change="resetHandle">
<el-option v-for="item in quarterList" :key="item.ids" :label="item.quarterName" :value="item.ids"
:clearable="true">
</el-option>
</el-select>
</template>
</el-form-item>
6 months ago
</el-col>
<el-col :span="24">
<el-form-item label="部门">
4 months ago
<el-select v-model="inBatchForm.department" placeholder="请选择" style="width: 100%;" :clearable="true"
@change="depchange">
<el-option v-for="item in departmentList" :key="item.departmentId" :label="item.department"
:value="item.departmentId">
</el-option>
</el-select>
</el-form-item>
6 months ago
</el-col>
<el-col :span="24">
<el-form-item label="选项">
4 months ago
<el-radio-group v-model="inBatchForm.optionType" :disabled="outDialogType == 'details'">
<el-radio label="YH">易耗品</el-radio>
<el-radio label="NY">耐用品</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
6 months ago
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleBatchClose()"> </el-button>
<el-button type="primary" @click="batchSubmit()"> </el-button>
6 months ago
</span>
</el-dialog>
4 months ago
<!-- 单条新增耐用品弹窗 -->
<consumableDialog v-if="consumableVisible" :consumableVisible='consumableVisible'
:demandDialogTitle="demandDialogTitle" @handleCloseDetail="handleCloseDetail" @confirm="confirm">
</consumableDialog>
<!-- 批量耐用品弹窗 -->
4 months ago
<batchSelectionDialog v-if="batchSelectionVisible" :batchSelectionVisible='batchSelectionVisible'
:batchSelectionTitle="batchSelectionTitle" :tableData="batchTableData" @batchclose="batchclose"
:inBatchForm="inBatchForm" @confirm-selection="handleConfirmSelection" @selectionChange="selectionChange">
</batchSelectionDialog>
6 months ago
</div>
4 months ago
6 months ago
</template>
<script>
4 months ago
import { getQuarterList, getDepartmentList, getDetailedList, getDetailedItems, submitData, getMaterialList, editList, batchList } from "@/api/firstOrder/outbound";
4 months ago
import consumableDialog from './consumableDialog.vue'
4 months ago
import batchSelectionDialog from './batchSelectionDialog.vue'
6 months ago
export default {
4 months ago
components: {
consumableDialog,
4 months ago
batchSelectionDialog
4 months ago
},
6 months ago
props: {
repairVisible: {
type: Boolean,
default: false
},
outDialogTiltle: {
type: String,
default: ''
},
outDialogType: {
type: String,
default: ''
},
type: {
6 months ago
type: String,
default: ''
},
id: {
type: Number,
default: 0
6 months ago
}
},
data() {
return {
4 months ago
dialogVisible: false,
4 months ago
demandDialogTitle: '耐用品出库',
4 months ago
batchSelectionTitle: '耐用品出库',
batchSelectionVisible: false,
batchSelection: true, // 保持组件渲染
batchTableData: [],
4 months ago
consumableVisible: false, //单条耐耗品弹窗显示
4 months ago
batchSelection: false,
quarterList: [],
departmentList: [],
6 months ago
outDialogVisible: false,
sizeForm: {
4 months ago
orderNo: '',//出库单号
reason: '',//事由
// inAccountsTableData: [],//总计
6 months ago
inTableData: [],
ldOneOutStorageDetailVOList: [],
demandEndInfo: '',//需求单名称
outDate: '',//出库时间
4 months ago
options: 2,//出库类型
4 months ago
optionType: '', // 1易耗品 2耐用品
materialType: '1',//物资类型
status: '',//1暂存 2提交
// materialld: '',//物资Id
userInfoVO: {
userId: "用户ID",
4 months ago
name: "用户名称",
mainErDepartment: "1",
mainErDepartmentName: "主管部门名称",
},
6 months ago
},
4 months ago
// inTableData: [],
6 months ago
inBatchDialogVisible: false,//选择采购单的数据
batchType: '',//需求单选择类型
4 months ago
inBatchForm: { //批量选择
batchType: '', //需求单类型
department: '', //部门
optionType: '', //YH/NY
6 months ago
},
quarterYearMap: {},
4 months ago
quarterQuarterMap: {},
}
},
computed: {
outDate() {
const now = new Date()
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0')
4 months ago
// 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}`
6 months ago
}
},
mounted() {
6 months ago
this.outDialogVisible = this.repairVisible
if (this.outDialogType == 'add') {
this.addInit()
} else {
this.inInit()
}
this.getDetailedItems()
4 months ago
// this.getMaterialList()
6 months ago
},
methods: {
4 months ago
batchclose() {
this.batchSelectionVisible = false
},
selectionChange(row) {
4 months ago
this.batchSelectionVisible = false
this.sizeForm.inTableData = row
4 months ago
},
confirm(allSelectedList) {
this.consumableVisible = false
this.sizeForm.inTableData = allSelectedList
console.log(this.sizeForm.inTableData, '111220')
4 months ago
}, // 处理搜索
4 months ago
async handleSearch() {
// 重置当前页
this.currentPage = 1;
await this.loadGoodsList();
},
// 分页大小改变
handleSizeChange(val) {
this.pageSize = val;
this.currentPage = 1;
this.loadGoodsList();
},
// 当前页改变
handleCurrentChange(val) {
this.currentPage = val;
this.loadGoodsList();
},
depchange(value) {
this.departmentList = this.departmentList
},
//关闭
handleBatchClose() {
this.inBatchDialogVisible = false
},
// 添加出库数据
inTableAdd() {
const requiredFields = [
{ value: this.sizeForm.reason, message: '请填写事由' },
{ value: this.sizeForm.materialType, message: '请选择物资类型' },
{ value: this.sizeForm.optionType, message: '请选择类别(易耗品/耐用品)' }
];
// 检查所有必填项
for (const field of requiredFields) {
if (!field.value) {
this.$message.warning(field.message);
return;
}
}
this.sizeForm.inTableData.push({})
},
addInit() {
this.sizeForm.outDate = new Date()//出库时间
4 months ago
},
4 months ago
//本次出库数量
syncInboundQuantity(row) {
4 months ago
row.theOutboundQuantity = Number(row.theOutboundQuantity)
if (this.sizeForm.options === 1) {
const maxAllowQuantity = (row.applicationQuantity || 0) - (row.outboundQuantity || 0);
if (row.theOutboundQuantity > maxAllowQuantity) {
this.$message.error(`本次出库数量不能大于${maxAllowQuantity}`);
row.theOutboundQuantity = maxAllowQuantity;
}
}
4 months ago
if (this.sizeForm.optionType === 'NY') {
row.theOutboundQuantity = 1
}
},
//关闭新增弹窗
6 months ago
handleCloseDetail() {
this.outDialogVisible = false
4 months ago
this.consumableVisible = false
6 months ago
this.$emit('handleCloseDetail')
},
4 months ago
// 获取批量需求单列表
async getQuarterList() {
try {
const res = await getQuarterList()
if (res.data && res.data.result) {
this.quarterList = res.data.result
this.quarterList.forEach(item => {
if (item.year && item.quarter && item.ids) {
this.quarterYearMap[item.ids] = item.year
this.quarterQuarterMap[item.ids] = item.quarter
this.sizeForm.inTableData.ldDemandEndId = item.ids
}
})
}
} catch (error) {
this.$message.error('获取需求单列表失败')
6 months ago
}
},
4 months ago
// 批量需求单选择变化,获取部门列表
async onQuarterSelectChange(ids) {
if (!ids) return
const year = this.quarterYearMap[ids]
const quarter = this.quarterQuarterMap[ids]
if (year && quarter) {
try {
const res = await getDepartmentList({
year: year,
quarter: quarter
})
if (res.data && res.data.result) {
this.departmentList = res.data.result
4 months ago
console.log(this.departmentList, 'departmentList')
} else {
this.departmentList = []
}
} catch (error) {
this.$message.error('获取部门列表失败')
this.departmentList = []
}
} else {
this.departmentList = []
}
6 months ago
},
4 months ago
async batchSubmit() {
if (!this.inBatchForm.batchType) {
this.$message.error('请选择需求单');
return;
}
if (!this.inBatchForm.department) {
this.$message.error('请选择部门');
return;
}
if (!this.inBatchForm.optionType) {
this.$message.error('请选择类别');
return;
}
4 months ago
const requestParams = {
ids: this.inBatchForm.batchType,
departmentId: this.inBatchForm.department,
optionType: this.inBatchForm.optionType,
};
4 months ago
try {
let res;
if (this.inBatchForm.optionType === 'YH') {
res = await getDetailedList(requestParams);
} else if (this.inBatchForm.optionType === 'NY') {
res = await batchList(requestParams);
}
4 months ago
if (res.data && res.data.result) {
this.sizeForm.inTableData = res.data.result;
const selectedDept = this.departmentList.find(
dept => dept.departmentId === this.inBatchForm.department
);
const deptName = selectedDept ? selectedDept.department : '';
4 months ago
this.sizeForm.inTableData = res.data.result.map(item => ({
...item,
IdDemandEndld: this.inBatchForm.batchType,
department: deptName
}));
4 months ago
// 关闭批量选择弹窗
this.inBatchDialogVisible = false;
// 设置需求单名称
const selectedQuarter = this.quarterList.find(
item => item.ids === this.inBatchForm.batchType
);
if (selectedQuarter) {
this.sizeForm.demandEndInfo = selectedQuarter.quarterName;
}
// 耐用品特殊处理(打开批量选择弹窗)
if (this.inBatchForm.optionType === 'NY') {
console.log(this.inBatchForm.optionType, 'this.inBatchForm.optionType')
this.batchSelectionVisible = true;
this.dialogVisible = true;
console.log(1)
this.batchTableData = res.data.result;
}
// 强制更新视图
this.$nextTick(() => {
this.$forceUpdate();
});
} else {
this.$message.warning('未获取到详细数据');
}
} catch (error) {
this.$message.error(`获取${this.inBatchForm.optionType === 'YH' ? '易耗品' : '耐用品'}数据失败:${error.message}`);
console.error('批量提交接口调用失败:', error);
}
},
//获取单条选择的部门名称列表
async getDetailedItems() {
this.loading = true
try {
const res = await getDetailedItems();
this.list = res.data.result
} catch (error) {
this.$message.error("获取数据来源失败,请重试");
} finally {
this.loading = false;
}
},
getDepartmentName(departmentId) {
const department = this.list.find(item => item.departmentId === departmentId);
return department ? department.department : '';
},
//获取单条选择的物资名称列表
async getMaterialList() {
this.loading = true
4 months ago
this.consumableVisible = false;
try {
4 months ago
if (this.sizeForm.optionType === "NY" && this.outDialogType !== 'details') {
4 months ago
this.consumableVisible = true
} else {
const res = await getMaterialList({ optionType: this.sizeForm.optionType })
this.materials = res.data.result
}
} catch (error) {
this.$message.error("获取数据来源失败,请重试");
} finally {
this.loading = false;
}
},
// 处理物资选择变化
handleMaterialChange(row, index) {
this.sizeForm.inTableData[index].materialId = row.materialId
this.sizeForm.inTableData[index].model = row.model
this.sizeForm.inTableData[index].materialCode = row.materialCode
this.sizeForm.inTableData[index].materialName = row.materialName
this.sizeForm.inTableData[index].type = row.type
this.sizeForm.inTableData[index].unit = row.unit
6 months ago
},
// 提交
async submit(index) {
if (!this.sizeForm.reason) {
this.$message.error("事由不能为空");
return;
}
if (!this.sizeForm.materialType) {
this.$message.error("请选择物资类型");
return;
}
if (this.sizeForm.options === 1) {
if (!this.sizeForm.demandEndInfo) {
this.$message.error("请选择需求单名称");
return;
}
if (!this.sizeForm.inTableData || this.sizeForm.inTableData.length === 0) {
this.$message.error("请添加批量选择数据");
return;
}
if (this.sizeForm.options === 2) {
for (const row of this.sizeForm.inTableData) {
if (!row.departmentName) {
this.$message.error("请选择部门");
return;
}
}
}
}
// status == 1 暂存 ,2提交
this.sizeForm.status = index
this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData
4 months ago
let arr = this.departmentList.find(item => item.departmentId === this.inBatchForm.department || {})
this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData.map(row => {
4 months ago
console.log(row, 'row')
4 months ago
const deptId = row.department
const dept = this.list.find(item => item.departmentId === deptId);
4 months ago
const oneFormId = row.id
4 months ago
return {
...row,
department: this.sizeForm.options == '1' ? arr.departmentId : deptId,
departmentName: this.sizeForm.options == '1' ? arr.department : dept.department,
4 months ago
oneFormId: oneFormId
4 months ago
}
})
console.log(this.sizeForm, '111')
this.sizeForm.inTableData = []
4 months ago
try {
const res = await submitData(this.sizeForm)
4 months ago
console.log(this.sizeForm, '222')
4 months ago
if (res.data.success) {
this.$message({
type: "success",
message: "提交成功"
});
this.$emit('submitSuccess');
this.handleCloseDetail();
} else {
this.$message.error(res.data.message || "提交失败");
}
} catch (error) {
this.$message.error(error.message || "服务器错误");
}
4 months ago
6 months ago
},
4 months ago
//编辑和详情
async inInit() {
if (this.outDialogType == 'details' || this.outDialogType == 'edit') {
4 months ago
editList(this.id).then(res => {
console.log(res.data.result, '详情数据')
const { ldOneOutStorage, ldOneOutStorageDetails } = res.data.result || {};
// this.sizeForm = res.data.result.ldOneOutStorage
this.sizeForm.inTableData = res.data.result.ldOneOutStorageDetails
this.sizeForm.orderNo = ldOneOutStorage.orderNo
this.sizeForm.reason = ldOneOutStorage.reason
this.sizeForm.demandEndInfo = ldOneOutStorage.demandEndInfo
this.sizeForm.outDate = ldOneOutStorage.outDate
this.sizeForm.options = Number(ldOneOutStorage.options)
4 months ago
this.sizeForm.optionType = ldOneOutStorage.optionType
this.$set(this.sizeForm, 'inTableData', res.data.result.ldOneOutStorageDetails)
4 months ago
console.log(this.sizeForm, '111')
})
}
},
4 months ago
// 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;
4 months ago
4 months ago
// } catch (error) {
// this.$message.error("获取详情数据失败");
// }
// }
// },
6 months ago
// 选项选择
4 months ago
radioChange() {
6 months ago
this.sizeForm.inTableData = []
4 months ago
this.sizeForm.optionType = '';
4 months ago
this.inBatchDialogVisible = false;
this.consumableVisible = false;
this.batchSelectionVisible = false;
this.batchTableData = [];
4 months ago
if (this.sizeForm.options === 1) {
4 months ago
this.getQuarterList()
6 months ago
this.inBatchDialogVisible = true
4 months ago
this.inBatchForm.batchType = '',
this.inBatchForm.department = ''
4 months ago
this.inBatchForm.optionType = ''
}
4 months ago
},
4 months ago
// closeHandle() {
// this.inBatchForm.batchType = '',
// this.inBatchForm.department = ''
// this.inBatchForm.optionType = ''
// this.sizeForm.inTableData = []
// this.getQuarterList()
// this.inBatchDialogVisible = true
4 months ago
// // this.sizeForm.inTableData = []
// },
4 months ago
// 删除表格行数据
handleDelete(index, row) {
this.sizeForm.inTableData.splice(index, 1)
this.$message.success('已成功删除该条记录')
},
},
watch: {
// 监听需求单选择变化
'inBatchForm.batchType': function (newVal) {
4 months ago
this.inBatchForm.department = '',
this.inBatchForm.optionType = 1
if (newVal) {
this.onQuarterSelectChange(newVal)
}
4 months ago
},
'sizeForm.optionType': function (newVal) {
4 months ago
if (newVal && this.outDialogType === 'add') {
this.sizeForm.inTableData = []
this.getMaterialList()
} else if (newVal && this.outDialogType !== 'add') {
this.getMaterialList()
}
},
6 months ago
}
}
</script>
<style lang="scss" scoped>
.form-title {
margin: 20px 0;
}
4 months ago
::v-deep.el-dialog__footer {
position: fixed !important;
bottom: 0 !important;
right: 0 !important;
}
::v-deep.dialog-content {
max-height: calc(100vh - 200px);
overflow-y: auto;
padding-right: 10px;
}
6 months ago
</style>