This commit is contained in:
bb_pan 2025-12-01 15:02:38 +08:00
parent 66a8ae776e
commit ea63ddba24
7 changed files with 430 additions and 12 deletions

View File

@ -18,6 +18,15 @@ export const getApplyDetailsApi = (data = {}) => {
}) })
} }
// 共享出库-列表
export const getOrderByIdApi = (data = {}) => {
return request({
url: '/material-mall/decChange/getOrderById',
method: 'get',
params: data
})
}
export const out = (data = {}) => { export const out = (data = {}) => {
return request({ return request({
url: '/material-mall/decChange/out', url: '/material-mall/decChange/out',

View File

@ -27,6 +27,7 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd"
style="width: 100%" style="width: 100%"
/> />
</el-form-item> </el-form-item>
@ -114,6 +115,7 @@ export default {
methods: { methods: {
// 退 // 退
async getRetireApplyList() { async getRetireApplyList() {
console.log('🚀 ~ this.queryParams.dateRange:', this.queryParams.dateRange)
const params = { const params = {
...this.queryParams, ...this.queryParams,
startDate: this.queryParams.dateRange ? this.queryParams.dateRange[0] : undefined, startDate: this.queryParams.dateRange ? this.queryParams.dateRange[0] : undefined,

View File

@ -780,7 +780,8 @@ export default {
}) })
}, },
handleOut(item) { handleOut(item) {
this.$router.push({ path: '/equipment/euq-out', query: { maIds: item.maIds } }) console.log('🚀 ~ item:', item)
this.$router.push({ path: '/equipmentShared/order/sharedOutList', query: { id: item.orderId } })
}, },
// //
handleViewOrder(row) { handleViewOrder(row) {

View File

@ -0,0 +1,409 @@
<template>
<!-- 基础页面 -->
<div class="app-container">
<el-card v-show="showSearch" style="margin-bottom: 20px">
<el-form :model="queryParams" ref="queryForm" size="small" inline label-width="110px">
<el-form-item label="需求单位" prop="useUnit">
<el-input v-model="queryParams.useUnit" style="width: 200px" placeholder="需求单位" disabled />
</el-form-item>
<el-form-item label="使用项目" prop="proName">
<el-input v-model="queryParams.proName" style="width: 200px" placeholder="使用项目" disabled />
</el-form-item>
<el-form-item label="项目类型" prop="proType">
<el-select disabled style="width: 200px" placeholder="请选择项目类型" v-model="queryParams.proType">
<el-option value="0" label="线路" />
<el-option value="1" label="电缆" />
<el-option value="2" label="变电" />
</el-select>
</el-form-item>
<el-form-item label="电压等级" prop="voltageLevel">
<el-select
clearable
style="width: 200px"
disabled
placeholder="请选择电压等级"
v-model="queryParams.voltageLevel"
>
<el-option :key="item.value" :value="item.value" :label="item.label" v-for="item in voltageList" />
</el-select>
</el-form-item>
<el-form-item label="项目所在省" prop="proProvince">
<el-input v-model="queryParams.proProvince" style="width: 200px" placeholder="项目所在省" disabled />
</el-form-item>
<el-form-item label="项目所在市" prop="proCity">
<el-input v-model="queryParams.proCity" style="width: 200px" placeholder="项目所在市" disabled />
</el-form-item>
<el-form-item label="项目所在区/县" prop="proCounty">
<el-input v-model="queryParams.proCounty" style="width: 200px" placeholder="项目所在区/县" disabled />
</el-form-item>
</el-form>
</el-card>
<el-card>
<el-row :gutter="10" class="mb8" justify="end">
<el-col :span="4">
<span style="font-size: 20px; font-weight: 800">共享出库列表</span>
</el-col>
<el-col v-if="routerParams.isView" :span="20" style="display: flex; justify-content: flex-end">
<el-button type="primary" :disabled="queryParams.taskStatus == '3'" @click="handleOutAll">全部出库</el-button>
<el-button type="primary" :disabled="queryParams.taskStatus == '3'" @click="handleOutCancelAll"
>全部取消出库
</el-button>
</el-col>
</el-row>
<el-table
v-loading="isLoading"
:data="tableList"
highlight-current-row
border
stripe
:max-height="650"
style="width: 100%"
>
<el-table-column type="index" width="55" label="序号" align="center" />
<el-table-column label="分类" align="center" prop="devType" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.devType == 1">{{ '装备' }}</span>
<span v-if="scope.row.devType == 2">{{ '工具' }}</span>
</template>
</el-table-column>
<el-table-column label="类目" align="center" prop="category" :show-overflow-tooltip="true" />
<el-table-column label="名称" align="center" prop="typeName" :show-overflow-tooltip="true" width="120px" />
<el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true" />
<el-table-column label="管理模式" align="center" prop="manageType" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.manageType == 0">{{ '编码设备' }}</span>
<span v-if="scope.row.manageType == 1">{{ '数量设备' }}</span>
</template>
</el-table-column>
<el-table-column label="设备编码" align="center" prop="devCode" :show-overflow-tooltip="true" width="140px" />
<el-table-column label="当前库存" align="center" prop="storageNum" :show-overflow-tooltip="true" />
<el-table-column label="申请数量" align="center" prop="num" :show-overflow-tooltip="true" />
<el-table-column label="已出库数量" align="center" prop="realNum" :show-overflow-tooltip="true" />
<el-table-column label="使用到期日期" align="center" width="250px" :show-overflow-tooltip="true">
<template slot-scope="scope">
<!-- 处理日期为 null/undefined 的情况显示占位符有值则拼接为 "开始日期 至 结束日期" 格式 -->
{{
scope.row.useStartTime && scope.row.useEndTime
? `${scope.row.useStartTime}${scope.row.useEndTime}`
: '暂无时间段'
}}
</template>
</el-table-column>
<el-table-column
label="出库数量"
v-if="routerParams.isView"
align="center"
prop="outNum"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<el-input
:disabled="scope.row.isFinished == '1'"
v-if="scope.row.manageType === '1'"
v-model.number="scope.row.outNum"
:placeholder="`请输入出库数量(最大${scope.row.remainNum.toFixed(2)}`"
:max="scope.row.remainNum"
:min="0"
step="0.01"
@input="handleOutNumInput(scope.row)"
@change="handleOutNumChange(scope.row)"
/>
<span v-if="scope.row.manageType == 0">{{ (scope.row.num, (scope.row.outNum = scope.row.num)) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="{ row }">
<el-button
size="mini"
:disabled="row.isFinished == '1' || row.outNum == 0"
type="text"
icon="el-icon-zoom-in"
@click="handleOut(row)"
>出库
</el-button>
<el-button size="mini" :disabled="row.isFinished == '1'" type="text" @click="handleOutCancel(row)"
>取消出库
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { getOrderByIdApi, out, outAll, outCancel, outCancelAll } from '@/api/business/outbound'
import { getUseProjectListAPI, getVoltageListAPI } from '@/api/EquipmentLedger/equ-out'
import { regionData } from 'element-china-area-data'
export default {
name: 'SharedOutList',
data() {
return {
routerParams: {},
isLoading: false,
showSearch: true,
timeRange: [],
queryParams: {
type: 2, //
status: '0', //
proCode: '', // 使id
proName: '', // 使
proType: '', //
voltageLevel: '', //
proProvince: '', //
proCity: '', //
proCounty: '', // /
proLocation: '', //
useUnit: '', //
useTime: null,
pageNum: 1, //
pageSize: 10, //
taskStatus: '',
},
useProjectList: [], // 使
voltageList: [], //
provinceList: [],
cityList: [],
countyList: [],
typeList: [
{ label: '数量管理', value: '1' },
{ label: '编码管理', value: '0' },
],
total: 0, //
//
tableList: [],
openAdd: false, //
addQuery: {
//
typeName: '', //
typeModelName: '', //
devCode: '', //
pageNum: 1, //
pageSize: 10, //
},
addTotal: 0, //
addList: [], //
addTempList: [], //
ids: [], // id
single: false, //
multiple: false, //
}
},
created() {
this.routerParams = this.$route.query
// let title = ''
// if (this.routerParams.isView) {
// title = ''
// } else if (this.routerParams.isEdit) {
// title = ''
// }
this.queryParams.id = this.routerParams.id || ''
this.getUseProjectList()
this.queryParams.status == '0' ? (this.queryParams.useUnit = sessionStorage.getItem('deptName')) : ''
this.provinceList = regionData
// const obj = Object.assign({}, this.$route, { title })
// this.$tab.updatePage(obj)
this.getList()
},
methods: {
//
handleOutNumInput(row) {
const { outNum, remainNum } = row
if (isNaN(outNum)) {
this.showOverLimitTip = true
this.overLimitTip = '请输入有效的数字!'
row.outNum = null //
return
}
//
if (outNum > remainNum) {
this.showOverLimitTip = true
this.overLimitTip = `出库数量不能超过剩余可出库数量(${remainNum.toFixed(2)}`
row.outNum = remainNum //
} else if (outNum < 0) {
this.showOverLimitTip = true
this.overLimitTip = '出库数量不能为负数!'
row.outNum = 0 //
} else {
this.showOverLimitTip = false
// decimal(10,2)
row.outNum = Number(outNum.toFixed(2))
}
},
//
handleOutNumChange(row) {
if (row.outNum !== null && row.outNum !== undefined) {
row.outNum = Number(row.outNum.toFixed(2))
}
},
// 使
async getUseProjectList() {
const res = await getUseProjectListAPI()
const result = await getVoltageListAPI()
this.useProjectList = res.data
this.voltageList = result.data
},
// 使
onChangeProCode(value) {
this.queryParams.proCode = value
this.queryParams.proName = this.useProjectList.find((item) => item.proCode === value)?.proName || ''
},
//
onChangeProvince(value) {
if (!value) {
this.cityList = []
return
}
this.cityList = this.provinceList.find((item) => item.label === value)?.children || []
},
//
onChangeCity(value) {
if (!value) {
this.countyList = []
return
}
this.countyList = this.cityList.find((item) => item.label === value)?.children || []
},
//
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
//
handleReset() {
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.queryParams.parentId = '0'
this.queryParams.level = '1'
this.$refs.queryForm.resetFields()
this.getList()
},
//
//
async getList(emit = {}) {
console.log('🚀 ~ emit:', emit)
if (emit.id) {
this.queryParams.id = emit.id
// route
this.$route.query.id = this.queryParams.id
}
console.log('列表-查询', this.queryParams)
this.isLoading = true
try {
const params = { ...this.queryParams }
const res = await getOrderByIdApi(params)
this.tableList = res.data.devDetailsList.map((item) => {
// num - real_num null 0
const remainNum = Number(item.num) - (item.realNum ? Number(item.realNum) : 0)
return {
...item,
remainNum: remainNum > 0 ? remainNum : 0, //
outNum: 0, //
}
})
if (this.queryParams.id) {
this.queryParams = res.data.devInfo || {}
this.queryParams.status = '0'
this.queryParams.useUnit = sessionStorage.getItem('deptName')
}
this.total = res.data.total || 0
} catch (error) {
this.tableList = []
this.total = 0
} finally {
this.isLoading = false
}
},
//
handleOut(row) {
row.category = ''
this.$confirm('是否确定出库?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
out(row).then((res) => {
this.$message({
type: 'success',
message: '操作成功!',
})
this.getList()
})
})
},
//
handleOutCancel(row) {
row.category = ''
this.$confirm('是否确定取消出库?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
outCancel(row).then((res) => {
this.$message({
type: 'success',
message: '操作成功!',
})
this.getList()
})
})
},
handleBack() {
this.$router.push({ path: '/business/outbound/index' })
},
handleOutAll() {
this.$confirm('是否确定全部取消出库?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
outAll({ id: this.queryParams.id }).then((res) => {
this.$message({
type: 'success',
message: '操作成功!',
})
this.$router.go(-1)
})
})
},
handleOutCancelAll() {
this.$confirm('是否确定全部取消出库?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
outCancelAll({ id: this.queryParams.id }).then((res) => {
this.$message({
type: 'success',
message: '操作成功!',
})
this.$router.go(-1)
})
})
},
},
}
</script>
<style lang="scss" scoped></style>

View File

@ -2,7 +2,7 @@
<!-- 基础页面 --> <!-- 基础页面 -->
<div class="app-container"> <div class="app-container">
<el-card v-show="showSearch" style="margin-bottom: 20px"> <el-card v-show="showSearch" style="margin-bottom: 20px">
<el-form :model="queryParams" ref="queryForm" size="small" inline label-width="100px"> <el-form :model="queryParams" ref="queryForm" size="small" inline label-width="110px">
<el-form-item label="需求单位" prop="useUnit"> <el-form-item label="需求单位" prop="useUnit">
<el-input v-model="queryParams.useUnit" style="width: 200px" placeholder="请输入需求单位" :disabled="queryParams.status=='0'" <el-input v-model="queryParams.useUnit" style="width: 200px" placeholder="请输入需求单位" :disabled="queryParams.status=='0'"

View File

@ -359,9 +359,9 @@ export default {
else if (this.btnIndex === 2) unit = '台' else if (this.btnIndex === 2) unit = '台'
else if (this.btnIndex === 3) unit = '%' else if (this.btnIndex === 3) unit = '%'
return val.length return val.length
? `{val|${this.btnIndex === 1 ? (val[2] / 100000000).toFixed(4) : val[2]} ${unit}}\n{name|${ ? `{val|${
params.data.deptAbbreviation this.btnIndex === 1 ? (val[2] > 0 ? (val[2] / 100000000).toFixed(4) : 0) : val[2]
}}` } ${unit}}\n{name|${params.data.deptAbbreviation}}`
: `{name|${params.data.deptAbbreviation}}` : `{name|${params.data.deptAbbreviation}}`
}, },
rich: { rich: {
@ -424,10 +424,7 @@ export default {
// cityName: city, // cityName: city,
// }, // },
// }) // })
window.open( window.open(`${window.location.origin}/screen/cityScreen?cityName=${city}`, '_blank')
`${window.location.origin}/screen/cityScreen?cityName=${city}`,
'_blank'
)
} }
}) })
myChart.on('mouseover', (params) => { myChart.on('mouseover', (params) => {

View File

@ -359,9 +359,9 @@ export default {
else if (this.btnIndex === 2) unit = '台' else if (this.btnIndex === 2) unit = '台'
else if (this.btnIndex === 3) unit = '%' else if (this.btnIndex === 3) unit = '%'
return val.length return val.length
? `{val|${this.btnIndex === 1 ? (val[2] / 100000000).toFixed(4) : val[2]} ${unit}}\n{name|${ ? `{val|${
params.data.deptAbbreviation this.btnIndex === 1 ? (val[2] > 0 ? (val[2] / 100000000).toFixed(4) : 0) : val[2]
}}` } ${unit}}\n{name|${params.data.deptAbbreviation}}`
: `{name|${params.data.deptAbbreviation}}` : `{name|${params.data.deptAbbreviation}}`
}, },
rich: { rich: {