供需平衡表

This commit is contained in:
bb_pan 2025-09-28 19:15:38 +08:00
parent affa833aaa
commit eb29f39b54
4 changed files with 92 additions and 76 deletions

View File

@ -646,7 +646,6 @@ export const getDetailsListApi = data => {
}) })
} }
// 领料记录添加备注 // 领料记录添加备注
export function addRemarkApi(data) { export function addRemarkApi(data) {
return request({ return request({
@ -656,7 +655,6 @@ export function addRemarkApi(data) {
}) })
} }
// 总站点退料-列表 // 总站点退料-列表
export const getBackTotalListApi = data => { export const getBackTotalListApi = data => {
return request({ return request({
@ -926,3 +924,30 @@ export function directUpdateApi(data) {
data data
}) })
} }
// 供需平衡表-列表
export function getDemandAndSupplyApi(data) {
return request({
url: '/material/material_maMachine/getDemandAndSupply',
method: 'get',
params: data
})
}
// 供需平衡表-合计
export function getDemandAndSupplyNoPageApi(data) {
return request({
url: '/material/material_maMachine/getDemandAndSupplyNoPage',
method: 'get',
params: data
})
}
// 供需平衡表-在用
export function getUseDemandAndSupplyApi(data) {
return request({
url: '/material/material_maMachine/getUseDemandAndSupply',
method: 'get',
params: data
})
}

View File

@ -81,15 +81,15 @@
<el-option label="安全工器具" :value="2" /> <el-option label="安全工器具" :value="2" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="计量单位" prop="unitName"> <el-form-item label="计量单位" prop="unitValue">
<el-select <el-select
v-model="queryParams.unitName" v-model="queryParams.unitValue"
placeholder="请选择计量单位" placeholder="请选择计量单位"
clearable clearable
filterable filterable
style="width: 240px" style="width: 240px"
> >
<el-option v-for="item in unitNameList" :key="item.value" :label="item.label" :value="item.label" /> <el-option v-for="item in unitNameList" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="关键字" prop="keyWord"> <el-form-item label="关键字" prop="keyWord">
@ -129,7 +129,7 @@
:width="column.width" :width="column.width"
align="center" align="center"
> >
<template v-slot="{ row, $index }" v-if="column.prop === 'storeNum'"> <template v-slot="{ row }" v-if="column.prop === 'storeNum'">
<!-- manageType '编码' 使用可点击的 span --> <!-- manageType '编码' 使用可点击的 span -->
<!-- <span <!-- <span
class="clickText" class="clickText"
@ -142,12 +142,12 @@
<span>{{ row.storeNum }}</span> <span>{{ row.storeNum }}</span>
</template> </template>
<template v-slot="{ row }" v-else-if="column.prop === 'usNum'"> <template v-slot="{ row, $index }" v-else-if="column.prop === 'useNum'">
<span v-if="row.usNum > 0 && $index != 0" class="clickText" @click="openUserRecords(row)"> <span v-if="row.useNum > 0 && $index != 0" class="clickText" @click="openUserRecords(row)">
{{ row.usNum }} {{ row.useNum }}
</span> </span>
<!-- 否则直接显示数字 --> <!-- 否则直接显示数字 -->
<span v-else>{{ row.usNum }}</span> <span v-else>{{ row.useNum }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -224,7 +224,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="loading" :data="useRecordList"> <el-table v-loading="isDlgLoading" :data="useRecordList">
<el-table-column <el-table-column
label="序号" label="序号"
align="center" align="center"
@ -232,13 +232,13 @@
type="index" type="index"
:index="indexContinuation(dialogUseQuery.pageNum, dialogUseQuery.pageSize)" :index="indexContinuation(dialogUseQuery.pageNum, dialogUseQuery.pageSize)"
></el-table-column> ></el-table-column>
<el-table-column label="分包单位" align="center" prop="subUnit" :show-overflow-tooltip="true" /> <el-table-column label="分包单位" align="center" prop="subUnitName" :show-overflow-tooltip="true" />
<el-table-column label="班组名称" align="center" prop="teamName" :show-overflow-tooltip="true" /> <el-table-column label="班组名称" align="center" prop="teamName" :show-overflow-tooltip="true" />
<el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true" /> <el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true" /> <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true" />
<el-table-column label="领用数量" align="center" prop="leaseNum" :show-overflow-tooltip="true" /> <el-table-column label="领用数量" align="center" prop="leaseNum" :show-overflow-tooltip="true" />
<el-table-column label="退料数量" align="center" prop="backNum" :show-overflow-tooltip="true" /> <el-table-column label="退料数量" align="center" prop="backNum" :show-overflow-tooltip="true" />
<el-table-column label="在用数量" align="center" prop="usNum" :show-overflow-tooltip="true" /> <el-table-column label="在用数量" align="center" prop="useNum" :show-overflow-tooltip="true" />
</el-table> </el-table>
<pagination <pagination
@ -260,10 +260,12 @@ import {
getTeamList, getTeamList,
getSubUnitList, getSubUnitList,
getStorageInfoListApi, getStorageInfoListApi,
getUserRecordListApi, getUseDemandAndSupplyApi,
getStoreNumAndUseListApi, getDemandAndSupplyApi,
getRetainedEquipmentListNoPageApi getDemandAndSupplyNoPageApi
} from '@/api/materialsStation' } from '@/api/materialsStation'
import { getDeviceType } from '@/api/ma/device'
export default { export default {
name: '', name: '',
dicts: [], dicts: [],
@ -271,6 +273,7 @@ export default {
return { return {
// //
loading: false, loading: false,
isDlgLoading: false,
// //
ids: [], ids: [],
// //
@ -287,11 +290,11 @@ export default {
{ label: '工程名称', prop: 'proName', showTooltip: false }, { label: '工程名称', prop: 'proName', showTooltip: false },
{ label: '物资名称', prop: 'typeName' }, { label: '物资名称', prop: 'typeName' },
{ label: '规格型号', prop: 'typeModelName' }, { label: '规格型号', prop: 'typeModelName' },
{ label: '计量单位', prop: 'unitName' }, { label: '计量单位', prop: 'unit' },
{ label: '业务需求数量', prop: 'num' }, { label: '业务需求数量', prop: 'businessNum' },
{ label: '实际供应数量', prop: 'num' }, { label: '实际供应数量', prop: 'supplyNum' },
{ label: '在库数量', prop: 'storeNum' }, { label: '在库数量', prop: 'storeNum' },
{ label: '在用数量', prop: 'usNum' } { label: '在用数量', prop: 'useNum' }
], ],
// //
tableList: [], tableList: [],
@ -305,7 +308,8 @@ export default {
subUnitName: null, subUnitName: null,
typeName: null, // typeName: null, //
typeModelName: null, // typeModelName: null, //
jiJuType: null // (1 2) jiJuType: null, // (1 2)
unitValue: null
}, },
impUnitOptions: [], // impUnitOptions: [], //
departOptions: [], // departOptions: [], //
@ -344,6 +348,11 @@ export default {
this.queryParams.proId = query.proId || '' this.queryParams.proId = query.proId || ''
this.queryParams.proCenter = query.proCenter || '' this.queryParams.proCenter = query.proCenter || ''
this.getList() this.getList()
this.getImpUnitOptions()
this.handleDepartChange()
this.getSubUnitList()
this.getDeviceType()
this.handleImpUnitChange()
}, },
methods: { methods: {
/** 获取分公司下拉 */ /** 获取分公司下拉 */
@ -512,46 +521,24 @@ export default {
// //
async getList() { async getList() {
this.loading = true this.loading = true
const params = {
proId: this.queryParams.proId || '',
proCenter: this.queryParams.proCenter || '',
keyWord: this.queryParams.keyWord,
typeName: this.queryParams.typeName,
typeModelName: this.queryParams.typeModelName,
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum
}
try { try {
const res = await getStoreNumAndUseListApi(params) const params = {
this.tableList = res.data.rows || [] ...this.queryParams
console.log('🚀 ~ getList ~ this.tableList:', this.tableList)
this.total = res.data.total || 0
let param = {
proId: this.queryParams.proId || '',
proCenter: this.queryParams.proCenter || '',
keyWord: this.queryParams.keyWord,
typeName: this.queryParams.typeName,
typeModelName: this.queryParams.typeModelName
} }
const response = await getRetainedEquipmentListNoPageApi(param) const res = await getDemandAndSupplyApi(params)
this.tableList = res.data.rows || []
this.total = res.data.total || 0
const response = await getDemandAndSupplyNoPageApi(params)
let obj = { let obj = {
// storeNum manageType usNum repairNum inputNum repairInputNum allNum ...response.data,
storeNum: response.data.storeNum || 0, // businessNum: response.data.businessNum || response.data.totalBusinessNum,
usNum: response.data.usNum || 0, // supplyNum: response.data.supplyNum,
repairNum: response.data.repairNum || 0, // storeNum: response.data.storeNum,
inputNum: response.data.inputNum || 0, // useNum: response.data.useNum
repairInputNum: response.data.repairInputNum || 0,
pendingScrapNum: response.data.pendingScrapNum || 0,
scrapNum: response.data.scrapNum || 0,
allNum: response.data.allNum || 0,
totalPrice: response.data.totalPrice || 0,
fiveReplacementRate: response.data.fiveReplacementRate || 0,
tenReplacementRate: response.data.tenReplacementRate || 0,
tenPlusReplacementRate: response.data.tenPlusReplacementRate || 0,
manageType: response.data.manageType || ''
} }
this.tableList.unshift(obj) this.tableList.unshift(obj)
console.log(this.tableList)
console.log('🚀 ~ getList ~ this.tableList:', this.tableList)
this.loading = false this.loading = false
} catch (error) { } catch (error) {
this.loading = false this.loading = false
@ -559,7 +546,7 @@ export default {
}, },
indexContinuationForTable(num, size) { indexContinuationForTable(num, size) {
let number = (num - 1) * size let number = (num - 1) * size
console.log(number) console.log('🚀 ~ indexContinuationForTable ~ number:', number)
if (number == 0) { if (number == 0) {
return '合计' return '合计'
} else { } else {
@ -571,14 +558,14 @@ export default {
// 0 // 0
objectSpanMethod({ row, column, rowIndex, columnIndex }) { objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (rowIndex === 0 && columnIndex == 0) { if (rowIndex === 0 && columnIndex == 0) {
let rowspan = 1 let rowspan = 1 //
let colspan = 6 let colspan = 5 //
return { rowspan, colspan } return { rowspan, colspan }
} }
// //
// else if // else if
// 使 // 使
else if (rowIndex === 0 && columnIndex < 6) { else if (rowIndex === 0 && columnIndex < 5) {
return { return {
rowspan: 0, rowspan: 0,
colspan: 0 colspan: 0
@ -598,11 +585,11 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download( this.download(
'material/material_maMachine/exportStoreNumAndUseList', 'material/material_maMachine/exportDemandAndSupply',
{ {
...this.queryParams ...this.queryParams
}, },
`站内库存查询_${new Date().getTime()}.xlsx` `材料站供需平衡表_${new Date().getTime()}.xlsx`
) )
}, },
// //
@ -643,9 +630,13 @@ export default {
}, },
/** 查询在用设备列表 */ /** 查询在用设备列表 */
getUserRecords() { getUserRecords() {
getUserRecordListApi(this.dialogUseQuery).then(response => { this.isDlgLoading = true
getUseDemandAndSupplyApi(this.dialogUseQuery).then(response => {
this.isDlgLoading = false
this.useRecordList = response.data.rows this.useRecordList = response.data.rows
this.dialogUserTotal = response.data.total this.dialogUserTotal = response.data.total
}).catch(() => {
this.isDlgLoading = false
}) })
}, },
/** 搜索在用按钮操作 */ /** 搜索在用按钮操作 */
@ -655,9 +646,9 @@ export default {
}, },
handleDialogUserExport() { handleDialogUserExport() {
this.download( this.download(
'material/material_maMachine/exportUserRecordList', 'material/material_maMachine/exportUseDemandAndSupply',
{ ...this.dialogUseQuery }, { ...this.dialogUseQuery },
`站内库存查询_在用设备_${new Date().getTime()}.xlsx` `材料站供需平衡表_在用设备_${new Date().getTime()}.xlsx`
) )
} }
} }

View File

@ -157,13 +157,13 @@
> >
{{ scope.row.preNum > 0 ? scope.row.preNum : '添加编码' }} {{ scope.row.preNum > 0 ? scope.row.preNum : '添加编码' }}
</span> </span>
<el-input <el-input-number
v-if="scope.row.manageType == 1" v-if="scope.row.manageType == 1"
v-model.number="scope.row.preNum" v-model.number="scope.row.preNum"
controls-position="right"
placeholder="退料数量" placeholder="退料数量"
type="number" :min="0"
min="1" :precision="scope.row.unitValue == 1 ? 3 : 0"
clearable
@input="checkNum(scope.row)" @input="checkNum(scope.row)"
style="width: 100%" style="width: 100%"
/> />

View File

@ -165,19 +165,19 @@
<el-table-column align="center" label="在用数量" prop="useNum" /> <el-table-column align="center" label="在用数量" prop="useNum" />
<el-table-column label="预领数量" prop="preNum" align="center"> <el-table-column label="预领数量" prop="preNum" align="center">
<template v-slot="scope"> <template v-slot="scope">
<el-input <el-input-number
v-model.number="scope.row.preNum" v-model.number="scope.row.preNum"
controls-position="right" controls-position="right"
type="number"
style="width: 100%" style="width: 100%"
:min="1" :min="0"
@input=" :precision="scope.row.unitValue == 1 ? 3 : 0"
@change="
v => v =>
scope.row.unitValue == 1 scope.row.unitValue == 1
? (scope.row.preNum = Number(v.replace(/[^\d.]/g, ''))) ? (scope.row.preNum = Number(String(v).replace(/[^\d.]/g, '')))
: (scope.row.preNum = Number(v.replace(/[^\d]/g, ''))) : (scope.row.preNum = Number(String(v).replace(/[^\d]/g, '')))
" "
></el-input> ></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="管理模式" prop="manageType" align="center"> <el-table-column label="管理模式" prop="manageType" align="center">