|
|
|
|
@ -7,7 +7,7 @@ |
|
|
|
|
<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> |
|
|
|
|
@ -71,7 +71,7 @@ |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="unit" label="单位"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="departmentName" label="部门" v-if="sizeForm.options == 2"> |
|
|
|
|
<el-table-column prop="departmentName" label="部门" v-if="sizeForm.options === 2"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-select v-model="scope.row.department" placeholder="请选择部门名称" style="width: 100%;" |
|
|
|
|
v-if='inDialogType != "details"'> |
|
|
|
|
@ -85,12 +85,15 @@ |
|
|
|
|
<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"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.outboundQuantity || 0 }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="theInboundQuantity" label="本次入库数量"> |
|
|
|
|
<el-table-column prop="theOutboundQuantity" label="本次出库数量"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input-number size="mini" v-model="scope.row.theInboundQuantity" :min="1" style="width: 100%;" |
|
|
|
|
<el-input-number size="mini" v-model="scope.row.theOutboundQuantity" :min="1" style="width: 100%;" |
|
|
|
|
@change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'"></el-input-number> |
|
|
|
|
<!-- <span v-else>{{ scope.row.theInboundQuantity || 0 }}</span> --> |
|
|
|
|
<!-- <span v-else>{{ scope.row.theOutboundQuantity || 0 }}</span> --> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<!-- <el-table-column prop="status" label="出库情况"> |
|
|
|
|
@ -121,21 +124,20 @@ |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<!-- <el-table-column prop="str6" label="数量" v-if="sizeForm.options == 1"> |
|
|
|
|
</el-table-column> --> |
|
|
|
|
<el-table-column prop="theInboundQuantity" label="本次出库数量"> |
|
|
|
|
<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-column prop="date" label="出库后库存" v-if="sizeForm.options == 1"> |
|
|
|
|
<!-- <el-table-column prop="date" label="出库后库存" v-if="sizeForm.options == 1"> |
|
|
|
|
<el-table-column prop="str10" label="数量"> |
|
|
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
|
</el-table-column> --> |
|
|
|
|
</el-table> |
|
|
|
|
</el-form> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
@ -176,6 +178,47 @@ |
|
|
|
|
<el-button type="primary" @click="batchSubmit()">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
<!-- 选择弹窗 --> |
|
|
|
|
<el-dialog :close-on-click-modal="false" title="选择耐用品" :visible.sync="goodsVisible" :append-to-body="true" |
|
|
|
|
width="70%"> |
|
|
|
|
<el-table :data="goodsList" border style="width: 100%" @selection-change="goodsListSelectionChange"> |
|
|
|
|
<el-table-column type="selection" width="55"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<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="unit" label="单位"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="departmentName" label="部门"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="applicationQuantity" label="申请数量"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="outboundQuantity" label="已出库数量"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.outboundQuantity || 0 }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="theOutboundQuantity" label="本次出库数量"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input-number size="mini" v-model="scope.row.theOutboundQuantity" :min="1" style="width: 100%;" |
|
|
|
|
@change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'"></el-input-number> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button @click="goodsVisible = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="goodsSubmit()">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
@ -205,18 +248,19 @@ export default { |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
goodsVisible: false, |
|
|
|
|
quarterList: [], |
|
|
|
|
departmentList: [], |
|
|
|
|
outDialogVisible: false, |
|
|
|
|
sizeForm: { |
|
|
|
|
orderNo: '',//入库单号 |
|
|
|
|
orderNo: '',//出库单号 |
|
|
|
|
reason: '',//事由 |
|
|
|
|
// inAccountsTableData: [],//总计 |
|
|
|
|
inTableData: [], |
|
|
|
|
ldOneOutStorageDetailVOList: [], |
|
|
|
|
demandEndInfo: '',//需求单名称 |
|
|
|
|
outDate: '',//出库日期 |
|
|
|
|
options: '',//出库类型 |
|
|
|
|
options: 2,//出库类型 |
|
|
|
|
materialType: '1',//物资类型 |
|
|
|
|
status: '',//1暂存 2提交 |
|
|
|
|
// materialld: '',//物资Id |
|
|
|
|
@ -227,6 +271,8 @@ export default { |
|
|
|
|
}, |
|
|
|
|
uniqueListDialogVisible: false, // 新增:控制弹窗显示 |
|
|
|
|
uniqueList: [], |
|
|
|
|
goodsList: [], |
|
|
|
|
goodsSelectList: [], |
|
|
|
|
inTableData: [], |
|
|
|
|
inBatchDialogVisible: false,//选择采购单的数据 |
|
|
|
|
batchType: '',//需求单选择类型 |
|
|
|
|
@ -258,9 +304,9 @@ export default { |
|
|
|
|
this.getMaterialList() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
//本次入库数量 |
|
|
|
|
//本次出库数量 |
|
|
|
|
syncInboundQuantity(row) { |
|
|
|
|
row.theInboundQuantity = Number(row.theInboundQuantity); |
|
|
|
|
row.theOutboundQuantity = Number(row.theOutboundQuantity); |
|
|
|
|
}, |
|
|
|
|
//关闭新增弹窗 |
|
|
|
|
handleCloseDetail() { |
|
|
|
|
@ -325,34 +371,53 @@ export default { |
|
|
|
|
this.$message.error('请选择部门'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
const res = await getDetailedList({ |
|
|
|
|
ids: this.inBatchForm.batchType, |
|
|
|
|
departmentId: this.inBatchForm.department |
|
|
|
|
}) |
|
|
|
|
if (res.data && res.data.result) { |
|
|
|
|
this.sizeForm.inTableData = res.data.result.duplicateList |
|
|
|
|
const selectedDept = this.departmentList.find( |
|
|
|
|
dept => dept.departmentId === this.inBatchForm.department |
|
|
|
|
); |
|
|
|
|
const deptName = selectedDept ? selectedDept.department : ''; |
|
|
|
|
this.sizeForm.inTableData = res.data.result.duplicateList.map(item => ({ |
|
|
|
|
...item, |
|
|
|
|
IdDemandEndld: this.inBatchForm.batchType, |
|
|
|
|
// department: this.inBatchForm.department, |
|
|
|
|
department: deptName |
|
|
|
|
})); |
|
|
|
|
this.inBatchDialogVisible = false; |
|
|
|
|
const selectedQuarter = this.quarterList.find( |
|
|
|
|
item => item.ids === this.inBatchForm.batchType |
|
|
|
|
) |
|
|
|
|
if (selectedQuarter) { |
|
|
|
|
this.sizeForm.demandEndInfo = selectedQuarter.quarterName; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning('未获取到详细数据'); |
|
|
|
|
const res = await getDetailedList({ |
|
|
|
|
ids: this.inBatchForm.batchType, |
|
|
|
|
departmentId: this.inBatchForm.department |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
if (res.data && res.data.result) { |
|
|
|
|
this.sizeForm.inTableData = res.data.result.duplicateList |
|
|
|
|
const selectedDept = this.departmentList.find( |
|
|
|
|
dept => dept.departmentId === this.inBatchForm.department |
|
|
|
|
); |
|
|
|
|
const deptName = selectedDept ? selectedDept.department : ''; |
|
|
|
|
this.sizeForm.inTableData = res.data.result.duplicateList.map(item => ({ |
|
|
|
|
...item, |
|
|
|
|
IdDemandEndld: this.inBatchForm.batchType, |
|
|
|
|
// department: this.inBatchForm.department, |
|
|
|
|
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.result.uniqueList != null && res.data.result.uniqueList.length > 0) { |
|
|
|
|
this.goodsVisible = true |
|
|
|
|
this.goodsList = res.data.result.uniqueList |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning('未获取到详细数据'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
//选择回调函数 |
|
|
|
|
goodsListSelectionChange(val) { |
|
|
|
|
this.goodsSelectList = val |
|
|
|
|
}, |
|
|
|
|
//批量选择弹窗点击确认按钮 |
|
|
|
|
goodsSubmit() { |
|
|
|
|
if (this.goodsSelectList.length > 0) { |
|
|
|
|
this.sizeForm.inTableData.push(...this.goodsSelectList); |
|
|
|
|
this.$forceUpdate(); |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning('请先勾选需要添加的数据'); |
|
|
|
|
} |
|
|
|
|
this.goodsVisible = false |
|
|
|
|
}, |
|
|
|
|
//获取单条选择的部门名称列表 |
|
|
|
|
async getDetailedItems() { |
|
|
|
|
this.loading = true |
|
|
|
|
@ -427,19 +492,23 @@ export default { |
|
|
|
|
this.sizeForm.ldOneOutStorageDetailVOList.departmentName = this.sizeForm.inTableData.department |
|
|
|
|
|
|
|
|
|
this.sizeForm.inTableData = [] |
|
|
|
|
const res = await submitData(this.sizeForm) |
|
|
|
|
console.log(res, '暂存提交数据') |
|
|
|
|
if (res.data.success) { |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "提交成功" |
|
|
|
|
}); |
|
|
|
|
// 提交成功后通知父组件更新页面 |
|
|
|
|
this.$emit('submitSuccess'); |
|
|
|
|
this.handleCloseDetail(); |
|
|
|
|
} else { |
|
|
|
|
this.$message.error(res.data.message || "提交失败"); |
|
|
|
|
try { |
|
|
|
|
const res = await submitData(this.sizeForm) |
|
|
|
|
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 || "服务器错误"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
//编辑和详情 |
|
|
|
|
async inInit() { |
|
|
|
|
@ -454,7 +523,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
const handledDetailList = ldOneOutStorageDetails.map(item => ({ |
|
|
|
|
...item, |
|
|
|
|
// theInboundQuantity: item.theInboundQuantity || 0 |
|
|
|
|
outboundQuantity: item.outboundQuantity || 0 |
|
|
|
|
})) |
|
|
|
|
this.sizeForm = { |
|
|
|
|
...this.sizeForm, |
|
|
|
|
@ -471,97 +540,22 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
addInit() { |
|
|
|
|
// // 生成入库单号 |
|
|
|
|
// const randomNum = Math.floor(Math.random() * 100000000) + 1; |
|
|
|
|
// this.sizeForm.code = String(randomNum).padStart(8, '0');//入库单号 |
|
|
|
|
this.sizeForm.outDate = new Date()//入库时间 |
|
|
|
|
this.sizeForm.outDate = new Date()//出库时间 |
|
|
|
|
}, |
|
|
|
|
// 添加入库数据 |
|
|
|
|
// 添加出库数据 |
|
|
|
|
inTableAdd() { |
|
|
|
|
this.sizeForm.inTableData.push({}) |
|
|
|
|
}, |
|
|
|
|
// // 点击入库 |
|
|
|
|
// // putIn(row) { |
|
|
|
|
// // row.status = 0 |
|
|
|
|
// // // 更改总表的数据 |
|
|
|
|
// // this.sizeForm.inAccountsTableData.push({ |
|
|
|
|
// // str1: "000001", |
|
|
|
|
// // str2: "物品1", |
|
|
|
|
// // str3: "规格1", |
|
|
|
|
// // str4: "类别1", |
|
|
|
|
// // str5: "单位1", |
|
|
|
|
// // str6: "12", |
|
|
|
|
// // str7: "3", |
|
|
|
|
// // str8: row.str7, |
|
|
|
|
// // str9: "3", |
|
|
|
|
// // str10: row.str7 + 12, |
|
|
|
|
// // str11: "3", |
|
|
|
|
// // str12: "审批人1", |
|
|
|
|
// // str13: "2025-04-05", |
|
|
|
|
|
|
|
|
|
// // }) |
|
|
|
|
// // }, |
|
|
|
|
// 采购单选择确定 |
|
|
|
|
|
|
|
|
|
// // 采购单选择弹框关闭 |
|
|
|
|
// handleBatchClose() { |
|
|
|
|
// this.inBatchDialogVisible = false |
|
|
|
|
// }, |
|
|
|
|
// // 采购单选择确定 |
|
|
|
|
// batchSumbit() { |
|
|
|
|
// this.sizeForm.bumen = '部门一' |
|
|
|
|
// this.sizeForm.xuqiudanmingcheng = '2025年一季度需求单' |
|
|
|
|
// this.sizeForm.inTableData.push({ |
|
|
|
|
// // str1: '000001', |
|
|
|
|
// // str2: '物品1', |
|
|
|
|
// // str3: '规格1', |
|
|
|
|
// // str4: '类别1', |
|
|
|
|
// // str5: '单位1', |
|
|
|
|
// // str6: '11', |
|
|
|
|
// // str7: '22', |
|
|
|
|
// // str8: '3', |
|
|
|
|
// // str9: '部门一', |
|
|
|
|
// // name: '审批人', |
|
|
|
|
// // status: '1',// |
|
|
|
|
// // yichuku: 98, |
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
// this.inBatchDialogVisible = false |
|
|
|
|
// }, |
|
|
|
|
// 选项选择 |
|
|
|
|
async radioChange() { |
|
|
|
|
this.sizeForm.inTableData = [] |
|
|
|
|
if (this.sizeForm.options == 1) { |
|
|
|
|
await this.getQuarterList() // 等待数据加载完成 |
|
|
|
|
if (this.sizeForm.options === 1) { |
|
|
|
|
await this.getQuarterList() |
|
|
|
|
this.inBatchDialogVisible = true |
|
|
|
|
this.$forceUpdate() |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// |
|
|
|
|
// changeName(index) { |
|
|
|
|
// console.log(9999, index) |
|
|
|
|
// this.sizeForm.inTableData.forEach((item, i) => { |
|
|
|
|
// if (i == index) { |
|
|
|
|
// item.str1 = '000001' |
|
|
|
|
// item.str2 = '物品1' |
|
|
|
|
// item.str3 = '规格1' |
|
|
|
|
// item.str4 = '类别1' |
|
|
|
|
// item.str5 = '单位1' |
|
|
|
|
// item.str6 = '11' |
|
|
|
|
// item.str7 = 22 |
|
|
|
|
// item.str8 = '3' |
|
|
|
|
// item.str9 = '部门一' |
|
|
|
|
// item.name = '审批人' |
|
|
|
|
// item.status = '1' |
|
|
|
|
// this.$set(item, 'str7', 22) |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
// console.log(888888, this.sizeForm.inTableData) |
|
|
|
|
// }, |
|
|
|
|
numberChange() { |
|
|
|
|
this.$forceUpdate();//解决点击计数器失效问题 |
|
|
|
|
console.log(77777, this.sizeForm.inTableData) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
// 监听需求单选择变化 |
|
|
|
|
|