|
|
|
|
@ -36,7 +36,7 @@ |
|
|
|
|
<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> |
|
|
|
|
<el-radio :label="1" :disabled="sizeForm.type == 2"><span>批量选择</span></el-radio> |
|
|
|
|
<el-radio :label="2">单项选择</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
@ -92,7 +92,7 @@ |
|
|
|
|
:key="'account-dept-' + sizeForm.options"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-select v-model="scope.row.department" placeholder="请选择部门名称" style="width: 100%;" |
|
|
|
|
v-if='inDialogType != "details"'> |
|
|
|
|
v-if='outDialogType != "details"'> |
|
|
|
|
<el-option v-for="item in list" :key="item.departmentId" :label="item.department" |
|
|
|
|
:value="item.departmentId"> |
|
|
|
|
</el-option> |
|
|
|
|
@ -100,6 +100,17 @@ |
|
|
|
|
<span v-else> {{ scope.row.departmentName }}</span> |
|
|
|
|
</template> |
|
|
|
|
</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> --> |
|
|
|
|
<el-table-column prop="applicationQuantity" label="申请数量" v-if="sizeForm.options == 1"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<!-- <el-table-column prop="outboundQuantity" label="已出库数量" v-if="sizeForm.options == 1"> |
|
|
|
|
@ -111,7 +122,7 @@ |
|
|
|
|
<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> |
|
|
|
|
v-if="sizeForm.optionType === 'YH' || inBatchForm.optionType === 'YH'"></el-input-number> |
|
|
|
|
<span v-else>{{ scope.row.theOutboundQuantity = 1 }}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
@ -219,9 +230,11 @@ |
|
|
|
|
<consumableDialog v-if="consumableVisible" :consumableVisible='consumableVisible' |
|
|
|
|
:demandDialogTitle="demandDialogTitle" @handleCloseDetail="handleCloseDetail" @confirm="confirm"> |
|
|
|
|
</consumableDialog> |
|
|
|
|
<!-- 批量耐用品弹窗 --> |
|
|
|
|
<batchSelectionDialog v-if="batchSelectionVisible" :batchSelectionVisible='batchSelectionVisible' |
|
|
|
|
:batchSelectionTitle="batchSelectionTitle" :tableData="batchTableData" |
|
|
|
|
@batchclose="batchclose" :inBatchForm="inBatchForm" @confirm-selection="handleConfirmSelection" @selectionChange="selectionChange"></batchSelectionDialog> |
|
|
|
|
:batchSelectionTitle="batchSelectionTitle" :tableData="batchTableData" @batchclose="batchclose" |
|
|
|
|
:inBatchForm="inBatchForm" @confirm-selection="handleConfirmSelection" @selectionChange="selectionChange"> |
|
|
|
|
</batchSelectionDialog> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
@ -319,7 +332,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.outDialogVisible = this.repairVisible |
|
|
|
|
if (this.outDialogType == 'add') { |
|
|
|
|
this.addInit() |
|
|
|
|
@ -333,9 +346,9 @@ export default { |
|
|
|
|
batchclose() { |
|
|
|
|
this.batchSelectionVisible = false |
|
|
|
|
}, |
|
|
|
|
selectionChange(row){ |
|
|
|
|
selectionChange(row) { |
|
|
|
|
this.batchSelectionVisible = false |
|
|
|
|
this.sizeForm.inTableData=row |
|
|
|
|
this.sizeForm.inTableData = row |
|
|
|
|
}, |
|
|
|
|
confirm(allSelectedList) { |
|
|
|
|
this.consumableVisible = false |
|
|
|
|
@ -552,79 +565,79 @@ export default { |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
// }, |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const requestParams = { |
|
|
|
|
ids: this.inBatchForm.batchType, |
|
|
|
|
departmentId: this.inBatchForm.department, |
|
|
|
|
optionType: this.inBatchForm.optionType, |
|
|
|
|
}; |
|
|
|
|
const requestParams = { |
|
|
|
|
ids: this.inBatchForm.batchType, |
|
|
|
|
departmentId: this.inBatchForm.department, |
|
|
|
|
optionType: this.inBatchForm.optionType, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
let res; |
|
|
|
|
if (this.inBatchForm.optionType === 'YH') { |
|
|
|
|
res = await getDetailedList(requestParams); |
|
|
|
|
} else if (this.inBatchForm.optionType === 'NY') { |
|
|
|
|
res = await batchList(requestParams); |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
let res; |
|
|
|
|
if (this.inBatchForm.optionType === 'YH') { |
|
|
|
|
res = await getDetailedList(requestParams); |
|
|
|
|
} else if (this.inBatchForm.optionType === 'NY') { |
|
|
|
|
res = await batchList(requestParams); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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 : ''; |
|
|
|
|
|
|
|
|
|
this.sizeForm.inTableData = res.data.result.map(item => ({ |
|
|
|
|
...item, |
|
|
|
|
IdDemandEndld: this.inBatchForm.batchType, |
|
|
|
|
department: deptName |
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
// 关闭批量选择弹窗 |
|
|
|
|
this.inBatchDialogVisible = false; |
|
|
|
|
|
|
|
|
|
// 设置需求单名称 |
|
|
|
|
const selectedQuarter = this.quarterList.find( |
|
|
|
|
item => item.ids === this.inBatchForm.batchType |
|
|
|
|
); |
|
|
|
|
if (selectedQuarter) { |
|
|
|
|
this.sizeForm.demandEndInfo = selectedQuarter.quarterName; |
|
|
|
|
} |
|
|
|
|
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 : ''; |
|
|
|
|
|
|
|
|
|
// 耐用品特殊处理(打开批量选择弹窗) |
|
|
|
|
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.sizeForm.inTableData = res.data.result.map(item => ({ |
|
|
|
|
...item, |
|
|
|
|
IdDemandEndld: this.inBatchForm.batchType, |
|
|
|
|
department: deptName |
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
// 强制更新视图 |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$forceUpdate(); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning('未获取到详细数据'); |
|
|
|
|
} |
|
|
|
|
} catch (error) { |
|
|
|
|
this.$message.error(`获取${this.inBatchForm.optionType === 'YH' ? '易耗品' : '耐用品'}数据失败:${error.message}`); |
|
|
|
|
console.error('批量提交接口调用失败:', error); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 关闭批量选择弹窗 |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//批量选择耐用品选择回调函数 |
|
|
|
|
goodsListSelectionChange(val) { |
|
|
|
|
this.goodsSelectList = val |
|
|
|
|
@ -754,7 +767,6 @@ async batchSubmit() { |
|
|
|
|
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 |
|
|
|
|
@ -763,21 +775,19 @@ async batchSubmit() { |
|
|
|
|
this.sizeForm.outDate = ldOneOutStorage.outDate |
|
|
|
|
this.sizeForm.options = Number(ldOneOutStorage.options) |
|
|
|
|
|
|
|
|
|
// reason: '',//事由 |
|
|
|
|
// inAccountsTableData: [],//总计 |
|
|
|
|
// inTableData: [], |
|
|
|
|
// ldOneOutStorageDetailVOList: [], |
|
|
|
|
// demandEndInfo: '',//需求单名称 |
|
|
|
|
// outDate: '',//出库时间 |
|
|
|
|
// options: 2,//出库类型 |
|
|
|
|
// optionType: '', // 1易耗品 2耐用品 |
|
|
|
|
// materialType: '1',//物资类型 |
|
|
|
|
// status: '',//1暂存 2提交 |
|
|
|
|
// materialld: '',//物资Id |
|
|
|
|
this.$set(this.sizeForm,'inTableData',res.data.result.ldOneOutStorageDetails) |
|
|
|
|
// reason: '',//事由 |
|
|
|
|
// inAccountsTableData: [],//总计 |
|
|
|
|
// inTableData: [], |
|
|
|
|
// ldOneOutStorageDetailVOList: [], |
|
|
|
|
// demandEndInfo: '',//需求单名称 |
|
|
|
|
// outDate: '',//出库时间 |
|
|
|
|
// options: 2,//出库类型 |
|
|
|
|
// optionType: '', // 1易耗品 2耐用品 |
|
|
|
|
// materialType: '1',//物资类型 |
|
|
|
|
// status: '',//1暂存 2提交 |
|
|
|
|
// materialld: '',//物资Id |
|
|
|
|
this.$set(this.sizeForm, 'inTableData', res.data.result.ldOneOutStorageDetails) |
|
|
|
|
console.log(this.sizeForm, '111') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
@ -822,7 +832,7 @@ async batchSubmit() { |
|
|
|
|
this.getQuarterList() |
|
|
|
|
this.inBatchDialogVisible = true |
|
|
|
|
this.inBatchForm.batchType = '', |
|
|
|
|
this.inBatchForm.department = '' |
|
|
|
|
this.inBatchForm.department = '' |
|
|
|
|
this.inBatchForm.optionType = '' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
@ -833,7 +843,7 @@ async batchSubmit() { |
|
|
|
|
// this.sizeForm.inTableData = [] |
|
|
|
|
// this.getQuarterList() |
|
|
|
|
// this.inBatchDialogVisible = true |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // this.sizeForm.inTableData = [] |
|
|
|
|
// }, |
|
|
|
|
// 删除表格行数据 |
|
|
|
|
|