增加报废列表等导出功能,封装重复组件,优化页面

This commit is contained in:
BianLzhaoMin 2024-05-16 17:44:30 +08:00
parent 7120ffad8b
commit d48d3e82c3
10 changed files with 226 additions and 158 deletions

View File

@ -27,7 +27,7 @@ export const submitScrapApi = (data) => {
/* 报废列表 */ /* 报废列表 */
export const getScrapListApi = (data) => { export const getScrapListApi = (data) => {
return request.post('/material/scrap/scrapTaskReviewList', data) return request.get('/material/scrap/scrapTaskReviewList', { params: data })
} }
/* 报废审核接口 */ /* 报废审核接口 */
@ -37,10 +37,11 @@ export const auditingScrapApi = (data) => {
/* 处置列表接口 */ /* 处置列表接口 */
export const getDispositionListApi = (data) => { export const getDispositionListApi = (data) => {
return request.post('/material/scrap/obtainDisposalList', data) return request.get('/material/scrap/obtainDisposalList', { params: data })
} }
/* 处置发送接口 */ /* 处置发送接口 */
export const submitDispositionApi = (data) => { export const submitDispositionApi = (data) => {
return request.post('/material/scrap/obtainDisposal', data) return request.post('/material/scrap/obtainDisposal', data)
} }

View File

@ -20,6 +20,10 @@
ref="tableRef" ref="tableRef"
select-on-indeterminate select-on-indeterminate
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
v-loading="loading"
element-loading-text="数据正在加载,请稍后"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.6)"
> >
<el-table-column <el-table-column
type="selection" type="selection"
@ -141,6 +145,7 @@
}, },
/* 操作列显示隐藏数据源 */ /* 操作列显示隐藏数据源 */
columCheckList: [], columCheckList: [],
loading:false
} }
}, },
@ -182,11 +187,13 @@
this.pageParams, this.pageParams,
this.sendParams, this.sendParams,
) )
this.loading = true
const res = await this.sendApi(this.pageParams) const res = await this.sendApi(this.pageParams)
this.loading = false
if (res.code == 200) { if (res.code == 200) {
this.tableList = res.rows this.tableList = res.rows || res.data.rows
this.total = res.total this.total = res.total || res.data.total
} }
}, },

View File

@ -0,0 +1,20 @@
<template>
<div>
<template v-if="data.scrapSource === 1">退料</template>
<template v-if="data.scrapSource === 2">维修</template>
<template v-if="data.scrapSource === 3">盘点</template>
</div>
</template>
<script>
export default {
props:{
data:{
type:Object,
default:()=>{
return {}
}
}
}
}
</script>

View File

@ -21,9 +21,7 @@
</template> </template>
<!-- 报废来源 --> <!-- 报废来源 -->
<template slot-scope="{ data }" slot="source"> <template slot-scope="{ data }" slot="source">
<template v-if="data.scrapSource === 1">退料</template> <ScrapSource :data="data" />
<template v-if="data.scrapSource === 2">维修</template>
<template v-if="data.scrapSource === 3">盘点</template>
</template> </template>
<!-- 单号 1退料单号 2维修单号 3盘点单号 --> <!-- 单号 1退料单号 2维修单号 3盘点单号 -->
<template slot-scope="{ data }" slot="code"> <template slot-scope="{ data }" slot="code">
@ -163,6 +161,7 @@
<script> <script>
import TableModel from '@/components/TableModel' import TableModel from '@/components/TableModel'
import DialogModel from '@/components/DialogModel' import DialogModel from '@/components/DialogModel'
import ScrapSource from '../../component/scrapSource.vue'
import { config, dialogConfig, getSelList, getTypeListSel } from './config' import { config, dialogConfig, getSelList, getTypeListSel } from './config'
import { import {
getForecastWasteListApi, getForecastWasteListApi,
@ -174,6 +173,7 @@
components: { components: {
TableModel, TableModel,
DialogModel, DialogModel,
ScrapSource,
}, },
data() { data() {
return { return {
@ -233,9 +233,10 @@
}, },
getTableSelectionList(list) { getTableSelectionList(list) {
this.dataCondition = [] this.dataCondition = []
if (list.length > 0) list.forEach(ele => { if (list.length > 0)
list.forEach((ele) => {
this.dataCondition.push(ele.taskId) this.dataCondition.push(ele.taskId)
}); })
}, },
/* 审核通过 */ /* 审核通过 */
async auditingPass() { async auditingPass() {
@ -311,12 +312,17 @@
}, },
/* 数据导出 */ /* 数据导出 */
handleExport(data) { handleExport(data) {
console.log('🚀 ~ 导出 ~ this.dataCondition:', data, this.dataCondition) console.log(
if (this.dataCondition.length > 0) data.dataCondition = this.dataCondition '🚀 ~ 导出 ~ this.dataCondition:',
data,
this.dataCondition,
)
if (this.dataCondition.length > 0)
data.dataCondition = this.dataCondition
this.download( this.download(
'material/scrap/exportForecastWaste', 'material/scrap/exportForecastWaste',
{ {
...data ...data,
}, },
`预报废审核列表_${new Date().getTime()}.xlsx`, `预报废审核列表_${new Date().getTime()}.xlsx`,
) )

View File

@ -13,7 +13,7 @@
} }
" "
> >
<template slot="export"> <template slot="export" slot-scope="{ pageParams }">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-button <el-button
type="primary" type="primary"
@ -29,7 +29,7 @@
plain plain
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handelExportData" @click="handelExportData(pageParams)"
>导出数据</el-button >导出数据</el-button
> >
</el-row> </el-row>
@ -61,9 +61,7 @@
</template> </template>
<!-- 报废来源 --> <!-- 报废来源 -->
<template slot-scope="{ data }" slot="source"> <template slot-scope="{ data }" slot="source">
<template v-if="data.scrapSource === 1">退料</template> <ScrapSource :data="data" />
<template v-if="data.scrapSource === 2">维修</template>
<template v-if="data.scrapSource === 3">盘点</template>
</template> </template>
<!-- 列表操作栏 --> <!-- 列表操作栏 -->
<template slot="handle" slot-scope="{ data }"> <template slot="handle" slot-scope="{ data }">
@ -147,6 +145,7 @@
import TableModel from '@/components/TableModel' import TableModel from '@/components/TableModel'
import DialogModel from '@/components/DialogModel' import DialogModel from '@/components/DialogModel'
import SelDepart from '../../component/selDepart.vue' import SelDepart from '../../component/selDepart.vue'
import ScrapSource from '../../component/scrapSource.vue'
import AuditingReturn from '../auditingReturn/index.vue' // 退 import AuditingReturn from '../auditingReturn/index.vue' // 退
import AuditingDetails from '../../component/auditingDetails.vue' import AuditingDetails from '../../component/auditingDetails.vue'
import { import {
@ -161,6 +160,7 @@ export default {
TableModel, TableModel,
DialogModel, DialogModel,
SelDepart, SelDepart,
ScrapSource,
AuditingReturn, AuditingReturn,
AuditingDetails, AuditingDetails,
}, },
@ -232,8 +232,8 @@ export default {
this.dialogConfig.outerVisible = val this.dialogConfig.outerVisible = val
this.$refs.listingTbRef.getList() this.$refs.listingTbRef.getList()
} }
this.submitScrapParams.deptIds = this.submitScrapParams.taskIdList = this.submitScrapParams.deptIds =
[] this.submitScrapParams.taskIdList = []
}, },
/* 批量提交报废按钮 */ /* 批量提交报废按钮 */
handelSubmitScrap() { handelSubmitScrap() {
@ -266,9 +266,17 @@ export default {
this.dialogConfig.innerVisible = false this.dialogConfig.innerVisible = false
}, },
/* 导出数据 */ /* 导出数据 */
handelExportData() { handelExportData(data) {
console.log('数据导出') console.log(this.tableSelList, ' this.tableSelList')
} this.download(
'material/scrap/export',
{
...data,
},
`报废列表_${new Date().getTime()}.xlsx`,
)
console.log('数据导出', data)
},
}, },
} }
</script> </script>

View File

@ -20,7 +20,7 @@ export const config = {
{ f_label: '单位名称', f_model: 'backUnit', f_type: 'sel', f_selList: [] }, { f_label: '单位名称', f_model: 'backUnit', f_type: 'sel', f_selList: [] },
{ f_label: '工程名称', f_model: 'backPro', f_type: 'sel', f_selList: [] }, { f_label: '工程名称', f_model: 'backPro', f_type: 'sel', f_selList: [] },
{ f_label: '工机具类型', f_model: 'type', f_type: 'selCas', f_selList: [], optionProps: { value: 'id', } }, { f_label: '工机具类型', f_model: 'type', f_type: 'selCas', f_selList: [], optionProps: { value: 'id', } },
{ f_label: '报废单号', f_model: 'scrapNum', f_type: 'ipt', }, { f_label: '报废单号', f_model: 'backCode', f_type: 'ipt', },
{ {
f_label: '处置状态', f_model: 'disposition', f_type: 'sel', f_selList: [ f_label: '处置状态', f_model: 'disposition', f_type: 'sel', f_selList: [
{ label: '未处置', value: 0 }, { label: '未处置', value: 0 },

View File

@ -12,7 +12,7 @@
@getTableSelectionChange="getSelectionList" @getTableSelectionChange="getSelectionList"
ref="tbRef" ref="tbRef"
> >
<template slot="export"> <template slot="export" slot-scope="{ pageParams }">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-button <el-button
plain plain
@ -25,6 +25,7 @@
plain plain
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handelExportData(pageParams)"
>导出数据</el-button >导出数据</el-button
> >
</el-row> </el-row>
@ -32,9 +33,7 @@
<!-- 报废来源 --> <!-- 报废来源 -->
<template slot-scope="{ data }" slot="source"> <template slot-scope="{ data }" slot="source">
<template v-if="data.scrapSource === 1">退料</template> <ScrapSource :data="data" />
<template v-if="data.scrapSource === 2">维修</template>
<template v-if="data.scrapSource === 3">盘点</template>
</template> </template>
<!-- 状态 --> <!-- 状态 -->
@ -92,9 +91,9 @@
> >
<template slot="imgPreview"> <template slot="imgPreview">
<ImagePreview <ImagePreview
:src="`https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg`" :src="``"
:width="`60px`" :width="`30px`"
:height="`60px`" :height="`30px`"
/> />
</template> </TableModel </template> </TableModel
></template> ></template>
@ -154,11 +153,13 @@
} from '@/api/scrap/forecastWaste.js' } from '@/api/scrap/forecastWaste.js'
import TableModel from '@/components/TableModel' import TableModel from '@/components/TableModel'
import DialogModel from '@/components/DialogModel' import DialogModel from '@/components/DialogModel'
import ScrapSource from '../../component/scrapSource.vue'
import { config, dialogConfig, getSelList } from './config.js' import { config, dialogConfig, getSelList } from './config.js'
export default { export default {
components: { components: {
TableModel, TableModel,
DialogModel, DialogModel,
ScrapSource
}, },
data() { data() {
return { return {
@ -303,6 +304,18 @@
console.log(selList, '选择的数据') console.log(selList, '选择的数据')
this.tbSelectList = selList this.tbSelectList = selList
}, },
/* 导出数据 */
handelExportData(data) {
console.log(this.tableSelList, ' this.tableSelList')
this.download(
'material/scrap/exportObtainDisposalList',
{
...data,
},
`报废处置列表_${new Date().getTime()}.xlsx`,
)
console.log('数据导出', data)
},
}, },
} }
</script> </script>

View File

@ -19,7 +19,7 @@ export const config = {
{ f_label: '单位名称', f_model: 'backUnit', f_type: 'sel', f_selList: [] }, { f_label: '单位名称', f_model: 'backUnit', f_type: 'sel', f_selList: [] },
{ f_label: '工程名称', f_model: 'backPro', f_type: 'sel', f_selList: [] }, { f_label: '工程名称', f_model: 'backPro', f_type: 'sel', f_selList: [] },
{ f_label: '工机具类型', f_model: 'type', f_type: 'selCas', f_selList: [], optionProps: { value: 'id', } }, { f_label: '工机具类型', f_model: 'type', f_type: 'selCas', f_selList: [], optionProps: { value: 'id', } },
{ f_label: '报废单号', f_model: 'scrapNum', f_type: 'ipt', }, { f_label: '报废单号', f_model: 'backCode', f_type: 'ipt', },
{ {
f_label: '审批状态', f_model: 'taskStatus', f_type: 'sel', f_selList: [ f_label: '审批状态', f_model: 'taskStatus', f_type: 'sel', f_selList: [
{ label: '待提交', value: 124 }, { label: '待提交', value: 124 },
@ -29,7 +29,7 @@ export const config = {
] ]
}, },
{ {
f_label: '报废来源', f_model: 'taskStatus', f_type: 'sel', f_selList: [ f_label: '报废来源', f_model: 'scrapSource', f_type: 'sel', f_selList: [
{ label: '退料', value: 1 }, { label: '退料', value: 1 },
{ label: '维修', value: 2 }, { label: '维修', value: 2 },
{ label: '盘点', value: 3 }, { label: '盘点', value: 3 },

View File

@ -2,13 +2,14 @@
<div class="app-container"> <div class="app-container">
<!-- 报废审核 --> <!-- 报废审核 -->
<TableModel :config="config" :sendApi="getScrapListApi" ref="tbRef"> <TableModel :config="config" :sendApi="getScrapListApi" ref="tbRef">
<template slot="export"> <template slot="export" slot-scope="{ pageParams }">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-button <el-button
type="success" type="success"
plain plain
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handelExportData(pageParams)"
>导出数据</el-button >导出数据</el-button
> >
</el-row> </el-row>
@ -16,9 +17,7 @@
<!-- 报废来源 --> <!-- 报废来源 -->
<template slot-scope="{ data }" slot="source"> <template slot-scope="{ data }" slot="source">
<template v-if="data.scrapSource === 1">退料</template> <ScrapSource :data="data" />
<template v-if="data.scrapSource === 2">维修</template>
<template v-if="data.scrapSource === 3">盘点</template>
</template> </template>
<!-- 状态 --> <!-- 状态 -->
@ -148,6 +147,7 @@
<script> <script>
import TableModel from '@/components/TableModel' import TableModel from '@/components/TableModel'
import DialogModel from '@/components/DialogModel' import DialogModel from '@/components/DialogModel'
import ScrapSource from '../../component/scrapSource.vue'
import AuditingDetails from '../../component/auditingDetails.vue' import AuditingDetails from '../../component/auditingDetails.vue'
import { config, dialogConfig, getSelList } from './config.js' import { config, dialogConfig, getSelList } from './config.js'
import { import {
@ -159,6 +159,7 @@
components: { components: {
TableModel, TableModel,
DialogModel, DialogModel,
ScrapSource,
AuditingDetails, AuditingDetails,
}, },
data() { data() {
@ -185,7 +186,7 @@
/* 审批详情的列表 */ /* 审批详情的列表 */
auditingList: [], auditingList: [],
getSelList getSelList,
} }
}, },
created() { created() {
@ -274,6 +275,18 @@
}) })
return temp return temp
}, },
/* 导出数据 */
handelExportData(data) {
console.log(this.tableSelList, ' this.tableSelList')
this.download(
'material/scrap/exportScrapTaskReviewList',
{
...data,
},
`报废审核列表_${new Date().getTime()}.xlsx`,
)
console.log('数据导出', data)
},
}, },
watch: { watch: {
$route: { $route: {

View File

@ -42,7 +42,7 @@ module.exports = {
// target: `https://test-cc.zhgkxt.com`,//线上环境-南网 // target: `https://test-cc.zhgkxt.com`,//线上环境-南网
// target: `https://z.csgmall.com.cn`, // target: `https://z.csgmall.com.cn`,
target: `http://10.40.92.8:38080`, //超 target: `http://10.40.92.8:28080`, //超
// target: `http://10.40.92.81:8080`, //韩/ // target: `http://10.40.92.81:8080`, //韩/
// target: `http://10.40.92.74:8080`,//旭/ // target: `http://10.40.92.74:8080`,//旭/
// target: `http://10.40.92.138:28080`, //帅 // target: `http://10.40.92.138:28080`, //帅