This commit is contained in:
BianLzhaoMin 2024-04-24 08:46:24 +08:00
parent 60562a1fbb
commit afc93e38bd
12 changed files with 1008 additions and 19 deletions

View File

@ -138,13 +138,7 @@
data() {
return {
total: 0,
tableList: [
{ demo: '123' },
{ demo: '123' },
{ demo: '123' },
{ demo: '123' },
{ demo: '123' },
],
tableList: [],
/* 分页参数 */
pageParams: {
pageNum: 1,

View File

@ -0,0 +1,31 @@
export const config = {
handleColShow: true, // 是否显示操作列
pageShow: true, // 是否显示分页组件
isSelShow: true,// 表格是否需要复选框
isFormShow: true, // 是否显示表单查询组件
handleWidth: '', // 操作列宽度
formLabel: [
{ f_label: '关键字', f_model: 'keywords', f_type: 'ipt' },
{ f_label: '单位名称', f_model: 'backUnit', 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: 'laiyuan', f_type: 'ipt', },
{ f_label: '审批状态', f_model: 'taskStatus', f_type: 'sel', f_selList: [] },
{ f_label: '报废类型', f_model: 'taskStatus', f_type: 'sel', f_selList: [] },
{ f_label: '创建时间', f_model: 'time', f_type: 'date' },
],
columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' },
{ t_props: '', t_label: '预报废单号' },
{ t_props: '', t_label: '机具类型' },
{ t_props: '', t_label: '任务创建人' },
{ t_props: '', t_label: '任务创建时间' },
{ t_props: '', t_label: '审核状态' },
],
handleBtn: [
{ btn_title: '查看', id: 1 },
{ btn_title: '新增报废', id: 2 },
{ btn_title: '驳回退料', id: 3 },
{ btn_title: '审批详情', id: 4 },
],
}

View File

@ -1,20 +1,50 @@
<template>
<div class="app-container">
盘点报废
<!-- 盘点报废 -->
<!-- <FormModel />
<TableModel /> -->
<TableModel :config="config" :handleWidth="`240px`">
<template slot="export">
<el-row :gutter="10" class="mb8">
<el-button
type="success"
plain
icon="el-icon-download"
size="mini"
>导出数据</el-button
>
</el-row>
</template>
<!-- 列表操作栏 -->
<template slot="handle" slot-scope="data">
<el-button
size="mini"
type="text"
v-for="btn in config.handleBtn"
:key="btn.id"
@click="handleBtn(data, btn.id)"
>
{{ btn.btn_title }}
</el-button>
</template>
</TableModel>
</div>
</template>
<script>
import FormModel from '../component/formModel.vue'
import TableModel from '../component/tableModel.vue'
import TableModel from '@/components/TableModel'
import { config } from './config'
export default {
name: 'Inventory',
components: {
FormModel,
TableModel,
},
data() {
return {
config,
}
},
methods: {
handleBtn() {},
},
}
</script>

View File

@ -0,0 +1,123 @@
import {
getUnitInfoSelectApi,
listPartTypeApi,
} from '@/api/repairTest/repair'
import { getProjectList } from '@/api/claimAndRefund/receive'
let unitList = []
let proList = []
let typeList = []
export const config = {
handleColShow: true, // 是否显示操作列
pageShow: true, // 是否显示分页组件
isSelShow: true,// 表格是否需要复选框
isFormShow: true, // 是否显示表单查询组件
handleWidth: '', // 操作列宽度
formLabel: [
{ f_label: '关键字', f_model: 'keywords', f_type: 'ipt' },
{ f_label: '单位名称', f_model: 'backUnit', 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: 'scrapSource', f_type: 'sel', f_selList: [
{ label: '退料', value: 1 },
{ label: '维修', value: 2 },
{ label: '盘点', value: 3 },
]
},
{
f_label: '审批状态', f_model: 'taskStatus', f_type: 'sel', f_selList: [
{ label: '待审核', value: 120 },
{ label: '审核中', value: 121 },
{ label: '已驳回', value: 123 },
{ label: '已通过', value: 122 },
]
},
{ f_label: '创建时间', f_model: 'time', f_type: 'date' },
],
columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'scrapNum', t_label: '预报废单号', },
{ t_width: '', t_props: '', t_label: '报废来源', t_slot: 'source', },
{ t_width: '', t_props: 'repairNum', t_label: '单号', t_slot: 'code', },
{ t_width: '', t_props: 'unitName', t_label: '退料单位名称', },
{ t_width: '', t_props: 'projectName', t_label: '退料工程名称', },
{ t_width: '', t_props: 'itemType', t_label: '设备类型', },
{ t_width: '', t_props: 'createBy', t_label: '任务创建人', },
{ t_width: '', t_props: 'createTime', t_label: '任务创建时间', },
{ t_width: '', t_props: 'taskStatus', t_label: '审核状态', t_slot: 'type', },
{ t_width: '', t_props: '', t_label: '不通过原因', },
],
handleBtn: [
{ btn_title: '查看', id: 1 },
{ btn_title: '审核', id: 2 },
],
}
export const dialogConfig = {
outerWidth: '70%',
outerTitle: '',
outerVisible: false,
innerWidth: '50%',
innerTitle: '',
innerVisible: false,
handleColShow: false, // 是否显示操作列
pageShow: false, // 是否显示分页组件
isSelShow: false,// 表格是否需要复选框
isFormShow: true, // 是否显示表单查询组件
formLabel: [
{ f_label: '类型名称', f_model: 'keywords', f_type: 'sel' },
],
columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'machineTypeName', t_label: '设备类型' },
{ t_width: '', t_props: 'specificationType', t_label: '规格型号' },
{ t_width: '', t_props: 'maCode', t_label: '设备编码' },
{ t_width: '', t_props: 'scrapNum', t_label: '设备数量' },
{ t_width: '', t_props: 'status', t_label: '审批状态', t_slot: 't_type' },
{ t_width: '', t_props: '', t_label: '报废原因' },
{ t_width: '', t_props: '', t_label: '报废图片' },
{ t_width: '', t_props: 'remark', t_label: '备注' },
],
}
export const getSelList = () => {
new Promise(async (resolve) => {
const { data: unitRes } = await getUnitInfoSelectApi()
unitList = unitRes.map((e) => {
e.value = e.unitId
e.label = e.unitName
return e
})
const { data: proRes } = await getProjectList()
proList = proRes.map((e) => {
e.value = e.projectId
e.label = e.projectName
return e
})
const { data: typeRes } = await listPartTypeApi()
typeList = typeRes
resolve()
}).then(() => {
config.formLabel.map((item) => {
if (item.f_model === 'backUnit') {
item.f_selList = unitList
return item
}
if (item.f_model === 'backPro') {
item.f_selList = proList
return item
}
if (item.f_model === 'type') {
item.f_selList = typeList
return item
}
})
}).catch(() => {
})
}

View File

@ -0,0 +1,298 @@
<template>
<div class="app-container">
<!-- 预报废审核 -->
<TableModel :config="config" :sendApi="getForecastWasteListApi">
<template slot="export">
<el-row :gutter="10" class="mb8">
<el-button
type="success"
plain
icon="el-icon-download"
size="mini"
>导出数据</el-button
>
</el-row>
</template>
<!-- 报废来源 -->
<template slot-scope="{ data }" slot="source">
<template v-if="data.scrapSource === 1">退料</template>
<template v-if="data.scrapSource === 2">维修</template>
<template v-if="data.scrapSource === 3">盘点</template>
</template>
<!-- 单号 1退料单号 2维修单号 3盘点单号 -->
<template slot-scope="{ data }" slot="code">
<template v-if="data.scrapSource === 1">{{
data.repairCode
}}</template>
<template v-if="data.scrapSource === 2">{{
data.scrapNum
}}</template>
</template>
<!--审核状态 -->
<template slot-scope="{ data }" slot="type">
<el-tag v-if="data.taskStatus === 120" size="mini"
>待审核</el-tag
>
<el-tag
type="warning"
v-if="data.taskStatus === 121"
size="mini"
>审核中</el-tag
>
<el-tag type="danger" v-if="data.taskStatus === 123" size="mini"
>已驳回</el-tag
>
<el-tag
type="success"
v-if="data.taskStatus === 122"
size="mini"
>已通过</el-tag
>
</template>
<!-- 列表操作栏 -->
<template slot="handle" slot-scope="{ data }">
<el-button type="text" size="mini" @click="handlePreview(data)"
>查看</el-button
>
<el-button
v-if="data.taskStatus === 121 || data.taskStatus === 120"
type="text"
size="mini"
@click="handleAuditing(data)"
>审核</el-button
>
</template>
</TableModel>
<!-- 弹框内容 -->
<DialogModel
:dialogConfig="dialogConfig"
@closeDialogOuter="closeDialogOuter"
@closeDialogInner="closeDialogInner"
>
<template slot="outerContent">
<TableModel
:config="dialogConfig"
:sendParams="sendParams"
:sendApi="getDialogListApi"
:selectable="
(row) => {
return row.status == 0
}
"
ref="dialogTbRef"
@getTableSelectionChange="getDialogTbSelList"
>
<!--审核状态 -->
<template slot-scope="{ data }" slot="t_type">
<el-tag v-if="data.status == 0" size="mini"
>待审核</el-tag
>
<el-tag
type="success"
v-if="data.status == 1"
size="mini"
>通过</el-tag
>
<el-tag
type="warning"
v-if="data.status == 2"
size="mini"
>驳回</el-tag
>
</template>
</TableModel>
<el-row
class="dialog-common-btn"
v-if="dialogConfig.outerTitle == '审核'"
>
<el-button size="mini" type="primary" @click="auditingPass"
> </el-button
>
<el-button
size="mini"
type="warning"
@click="auditingReject"
> </el-button
>
</el-row>
</template>
<!-- 弹框内层内容 -->
<template slot="innerContent">
<el-row>
<el-col :span="4">请输入驳回原因</el-col>
<el-col :span="20">
<el-input
v-model="rejectReason"
type="textarea"
:rows="6"
ref="rejectReasonRef"
/>
</el-col>
</el-row>
<el-row class="dialog-common-btn">
<el-button size="mini" plain @click="handleCancelInner"
> </el-button
>
<el-button
size="mini"
type="warning"
@click="handleSubmitInner"
> </el-button
>
</el-row>
</template>
</DialogModel>
</div>
</template>
<script>
import TableModel from '@/components/TableModel'
import DialogModel from '@/components/DialogModel'
import { config, dialogConfig, getSelList } from './config'
import {
getForecastWasteListApi,
getDialogListApi,
auditingScrapApi,
} from '@/api/scrap/forecastWaste.js'
export default {
name: 'Inventory',
components: {
TableModel,
DialogModel,
},
data() {
return {
config,
dialogConfig,
getDialogListApi,
getForecastWasteListApi,
getSelList,
/* 驳回原因 */
rejectReason: '',
/* 选中的审核数据 */
selAuditingList: [],
/* 请求参数 */
sendParams: {},
/* 当前登录的用户id */
userId: sessionStorage.getItem('userId'),
/* 审核参数 */
auditingParams: {
taskId: '',
scrapDetailList: [],
},
}
},
created() {
this.getSelList()
},
methods: {
/* 查看 */
async handlePreview(row) {
this.sendParams.taskId = this.auditingParams.taskId = row.taskId
this.dialogConfig.outerTitle = '查看'
this.dialogConfig.isSelShow = false
this.dialogConfig.outerVisible = true
},
/* 审核 */
handleAuditing(row) {
this.sendParams.taskId = this.auditingParams.taskId = row.taskId
this.dialogConfig.outerTitle = '审核'
this.dialogConfig.isSelShow = true
this.dialogConfig.outerVisible = true
},
/* 外层弹框关闭 */
closeDialogOuter() {
this.dialogConfig.outerVisible = false
},
/* 内层弹框关闭 */
closeDialogInner() {
this.dialogConfig.innerVisible = false
},
/* 弹框内列表复选框勾选后数据 */
getDialogTbSelList(list) {
this.selAuditingList = list
},
/* 审核通过 */
async auditingPass() {
if (this.selAuditingList.length < 1) {
this.$message.error('请勾选审核设备')
return
}
this.selAuditingList.map((e) => {
/* 获取当前需要审核的设备数据 */
let deviceInfo = {
id: e.id, // ID
auditBy: this.userId, // ID
status: '1', // 1 2
}
this.auditingParams.scrapDetailList.push(deviceInfo)
})
const res = await auditingScrapApi(this.auditingParams)
if (res.code == 200) {
this.$message.success('审核通过!')
this.dialogVisible = false
this.dialogConfig.outerVisible = false
}
},
/* 审核驳回 */
async auditingReject() {
if (this.selAuditingList.length < 1) {
this.$message.error('请勾选审核设备')
return
}
this.dialogConfig.innerTitle = '驳回原因'
this.dialogConfig.innerVisible = true
},
/* 驳回原因弹框内取消按钮 */
handleCancelInner() {
/* 关闭内弹框 */
this.dialogConfig.innerVisible = false
},
/* 驳回弹框内保存按钮 */
async handleSubmitInner() {
if (!this.rejectReason) {
this.$message.error('驳回原因不能为空!')
this.$refs.rejectReasonRef.focus()
return
} else {
this.selAuditingList.map((e) => {
/* 获取当前需要审核的设备数据 */
let deviceInfo = {
id: e.id, // ID
auditBy: this.userId, // ID
status: '2', // 1 2
auditRemark: this.rejectReason, //
}
this.auditingParams.scrapDetailList.push(deviceInfo)
})
const res = await auditingScrapApi(this.auditingParams)
if (res.code == 200) {
this.$message.success('已驳回!')
this.dialogConfig.innerVisible = false
/* 当驳回成功 重新查询列表回显数据 */
this.$nextTick(() => {
this.$refs.dialogTbRef.getList()
})
}
}
},
},
watch: {
dialogConfig: {
handler(newVal) {
/* 监听外层弹框关闭 清空勾选的数据 */
if (!newVal.outerVisible) {
this.selectionList = []
}
},
deep: true,
},
},
}
</script>

View File

@ -0,0 +1,56 @@
export const config = {
handleColShow: true, // 是否显示操作列
pageShow: true, // 是否显示分页组件
isSelShow: true,// 表格是否需要复选框
isFormShow: true, // 是否显示表单查询组件
handleWidth: '', // 操作列宽度
formLabel: [
{ f_label: '关键字', f_model: 'keywords', f_type: 'ipt' },
{ f_label: '类型名称', f_model: 'backUnit', f_type: 'sel', f_selList: [] },
{ f_label: '规格型号', f_model: 'backPro', f_type: 'sel', f_selList: [] },
],
columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'demo', t_label: '类型名称' },
{ t_width: '', t_props: '', t_label: '规格型号' },
{ t_width: '', t_props: '', t_label: '数量' },
{ t_width: '', t_props: '', t_label: '合格数量' },
{ t_width: '', t_props: '', t_label: '维修数量' },
{ t_width: '', t_props: '', t_label: '预报废数量' },
{ t_width: '', t_props: '', t_label: '状态' },
],
handleBtn: [
{ btn_title: '查看', id: 1 },
{ btn_title: '审核', id: 2 },
],
}
export const dialogConfig = {
outerWidth: '70%',
outerTitle: '',
outerVisible: false,
innerWidth: '50%',
innerTitle: '',
innerVisible: false,
handleColShow: false, // 是否显示操作列
pageShow: false, // 是否显示分页组件
isSelShow: false,// 表格是否需要复选框
isFormShow: true, // 是否显示表单查询组件
formLabel: [
{ f_label: '关键字', f_model: 'keywords', f_type: 'ipt' },
{ f_label: '类型名称', f_model: 'backUnit', f_type: 'sel', f_selList: [] },
{ f_label: '规格型号', f_model: 'backPro', f_type: 'sel', f_selList: [] },
],
columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'demo', t_label: '设备类型' },
{ t_width: '', t_props: '', t_label: '规格型号' },
{ t_width: '', t_props: '', t_label: '设备编码' },
{ t_width: '', t_props: '', t_label: '退料状态' },
],
}

View File

@ -0,0 +1,98 @@
<template>
<!-- 退料驳回 -->
<div>
<TableModel
:config="config"
@getTableSelectionChange="getTableSelectionChange"
>
<template slot="export">
<el-row :gutter="10" class="mb8">
<el-button type="warning" plain size="mini"
>完成退料</el-button
>
</el-row>
</template>
<template slot-scope="{ data }" slot="handle">
<el-button
v-for="btn in handleBtn"
:key="btn.id"
type="text"
size="mini"
@click="handleBtnEvent(data, btn.id)"
>{{ btn.btn_title }}</el-button
>
</template>
</TableModel>
<DialogModel
:dialogConfig="dialogConfig"
@closeDialogOuter="closeDialogOuter"
@closeDialogInner="closeDialogInner"
>
<template slot="outerContent">
<TableModel :config="dialogConfig" />
</template>
</DialogModel>
</div>
</template>
<script>
import TableModel from '@/components/TableModel'
import DialogModel from '@/components/DialogModel'
import SelDepart from '../../component/selDepart.vue'
import { config, dialogConfig } from './config'
export default {
name: 'auditingReturn',
components: {
TableModel,
DialogModel,
SelDepart,
},
data() {
return {
config,
dialogConfig,
title: '',
dialogVisible: false,
dialogWidth: '',
handleBtn: [
{ btn_title: '查看', id: 1 },
{ btn_title: '编辑退料', id: 2 },
{ btn_title: '撤回', id: 3 },
],
}
},
methods: {
/* 按钮操作 */
handleBtnEvent(data, id) {
switch (id) {
case 1:
this.dialogConfig.outerTitle = '查看'
this.dialogConfig.outerWidth = '70%'
break
case 2:
this.dialogConfig.outerTitle = '编辑退料'
this.dialogConfig.outerWidth = '70%'
break
case 3:
this.dialogConfig.outerTitle = '撤回'
break
}
this.dialogConfig.outerVisible = true
},
getTableSelectionChange() {},
closeDialog(val) {
this.dialogConfig.outerVisible = val
},
/* 外层弹框关闭 */
closeDialogOuter() {
this.dialogConfig.outerVisible = false
},
/* 内层弹框关闭 */
closeDialogInner() {
this.dialogConfig.innerVisible = false
},
},
}
</script>

View File

@ -103,8 +103,8 @@
v-if="data.status == 2"
size="mini"
>驳回</el-tag
> </template
>s
>
</template>
</TableModel>
</template>
<template slot="handleBtn" v-if="handleBtn">

View File

@ -148,8 +148,5 @@ export const getSelList = () => {
}).catch(() => {
})
}

View File

@ -0,0 +1,123 @@
import {
getUnitInfoSelectApi,
listPartTypeApi,
} from '@/api/repairTest/repair'
import { getProjectList } from '@/api/claimAndRefund/receive'
let unitList = []
let proList = []
let typeList = []
export const config = {
handleColShow: true, // 是否显示操作列
pageShow: true, // 是否显示分页组件
isSelShow: true,// 表格是否需要复选框
isFormShow: true, // 是否显示表单查询组件
handleWidth: '', // 操作列宽度
formLabel: [
{ f_label: '关键字', f_model: 'keywords', f_type: 'ipt' },
{ f_label: '单位名称', f_model: 'backUnit', 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: 'scrapNum', f_type: 'ipt', f_selList: [] },
{
f_label: '审批状态', f_model: 'taskStatus', f_type: 'sel', f_selList: [
{ label: '待审核', value: 120 },
{ label: '审核中', value: 121 },
{ label: '已驳回', value: 123 },
{ label: '已通过', value: 122 },
]
},
{ f_label: '创建时间', f_model: 'time', f_type: 'date' },
{
f_label: '报废来源', f_model: 'scrapSource', f_type: 'sel', f_selList: [
{ label: '退料', value: 1 },
{ label: '维修', value: 2 },
{ label: '盘点', value: 3 },
]
},
],
columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'scrapNum', t_label: '报废单号' },
{ t_width: '', t_props: '', t_label: '报废来源', t_slot: 'source' },
{ t_width: '', t_props: 'repairNum', t_label: '预报废单号' },
{ t_width: '', t_props: 'unitName', t_label: '退料单位名称' },
{ t_width: '', t_props: 'projectName', t_label: '退料工程名称' },
{ t_width: '', t_props: 'itemType', t_label: '机具类型' },
{ t_width: '', t_props: 'createBy', t_label: '任务创建人' },
{ t_width: '', t_props: 'createTime', t_label: '任务创建时间' },
{ t_width: '', t_props: 'taskStatus', t_label: '审核状态', t_slot: 'type' },
],
handleBtn: [
{ btn_title: '查看', id: 1 },
{ btn_title: '审核', id: 2 },
],
}
export const dialogConfig = {
outerWidth: '70%',
outerTitle: '',
outerVisible: false,
innerWidth: '50%',
innerTitle: '',
innerVisible: false,
handleColShow: false, // 是否显示操作列
pageShow: false, // 是否显示分页组件
isSelShow: false,// 表格是否需要复选框
isFormShow: true, // 是否显示表单查询组件
formLabel: [
{ f_label: '类型名称', f_model: 'backUnit', f_type: 'sel', f_selList: [] },
],
columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'machineTypeName', t_label: '设备类型' },
{ t_width: '', t_props: 'specificationType', t_label: '规格型号' },
{ t_width: '', t_props: 'maCode', t_label: '设备编码' },
{ t_width: '', t_props: 'scrapNum', t_label: '设备数量' },
{ t_width: '', t_props: 'remark', t_label: '报废原因' },
{ t_width: '', t_props: 'fileUrl', t_label: '报废图片' },
],
}
export const getSelList = () => {
new Promise(async (resolve) => {
const { data: unitRes } = await getUnitInfoSelectApi()
unitList = unitRes.map((e) => {
e.value = e.unitId
e.label = e.unitName
return e
})
const { data: proRes } = await getProjectList()
proList = proRes.map((e) => {
e.value = e.projectId
e.label = e.projectName
return e
})
const { data: typeRes } = await listPartTypeApi()
typeList = typeRes
resolve()
}).then(() => {
config.formLabel.map((item) => {
if (item.f_model === 'backUnit') {
item.f_selList = unitList
return item
}
if (item.f_model === 'backPro') {
item.f_selList = proList
return item
}
if (item.f_model === 'type') {
item.f_selList = typeList
return item
}
})
}).catch(() => {
})
}

View File

@ -0,0 +1,239 @@
<template>
<div class="app-container">
<!-- 预报废列表 -->
<template v-if="!temp">
<TableModel
:config="config"
:sendApi="getPreScrapListApi"
@getTableSelectionChange="getTableSelectionChange"
>
<template slot="export">
<el-row :gutter="10" class="mb8">
<el-button
type="success"
plain
icon="el-icon-download"
size="mini"
@click="handelSubmitScrap"
>提交报废</el-button
>
</el-row>
</template>
<!-- 状态 -->
<template slot-scope="{ data }" slot="type">
<el-tag size="mini" v-if="data.taskStatus == 124"
>待提交</el-tag
>
<el-tag
size="mini"
type="warning"
v-if="data.taskStatus == 58"
>审核中</el-tag
>
<el-tag
size="mini"
type="danger"
v-if="data.taskStatus == 61"
>已驳回</el-tag
>
<el-tag
size="mini"
type="success"
v-if="data.taskStatus == 59"
>已通过</el-tag
>
</template>
<!-- 报废来源 -->
<template slot-scope="{ data }" slot="source">
<template v-if="data.scrapSource === 1">退料</template>
<template v-if="data.scrapSource === 2">维修审核</template>
<template v-if="data.scrapSource === 3">盘点</template>
</template>
<!-- 列表操作栏 -->
<template slot="handle" slot-scope="{ data }">
<el-button
type="text"
size="mini"
@click="handlePreview(data)"
>查看</el-button
>
<el-button
type="text"
size="mini"
v-if="data.taskStatus == 124"
@click="handleSubmitScrap(data)"
>提交报废</el-button
>
<el-button
type="text"
size="mini"
@click="handleAuditing(data)"
v-if="data.taskStatus != 124"
>审批详情</el-button
>
<el-button
type="text"
size="mini"
v-if="data.taskStatus == 61"
@click="handleReject(data)"
>驳回退料</el-button
>
</template>
</TableModel>
<DialogModel
:dialogConfig="dialogConfig"
@closeDialogOuter="closeDialogOuter"
@closeDialogInner="closeDialogInner"
>
<template slot="outerContent">
<!-- 查看内容 -->
<template v-if="dialogConfig.outerTitle === '查看'">
<TableModel
:sendParams="sendParams"
:sendApi="getDialogListApi"
:config="dialogConfig"
>
</TableModel
></template>
<!-- 审批详情 -->
<template v-if="dialogConfig.outerTitle === '审批详情'">
<el-table :data="audDetails">
<el-table-column
prop="title"
align="center"
label="审批部门"
/>
<el-table-column
prop="result"
align="center"
label="审批状态"
/>
<el-table-column align="center" label="审批意见" />
</el-table>
</template>
<!-- 部门选择 -->
<template v-if="dialogConfig.outerTitle === '提交报废'">
<SelDepart @closeDepartSel="closeDepartSel" />
</template>
</template>
</DialogModel>
</template>
<template v-if="temp">
<el-row type="flex" justify="space-between" class="back-text">
<span>驳回退料</span>
<el-button type="text" @click="handleBack">返回</el-button>
</el-row>
<AuditingReturn />
</template>
</div>
</template>
<script>
import TableModel from '@/components/TableModel'
import DialogModel from '@/components/DialogModel'
import SelDepart from '../../component/selDepart.vue'
import AuditingReturn from '../auditingReturn.vue' // 退
import {
getPreScrapListApi,
getDialogListApi,
} from '@/api/scrap/forecastWaste.js'
import { config, dialogConfig, getSelList } from './config'
export default {
name: 'scrapListing',
components: {
TableModel,
DialogModel,
SelDepart,
AuditingReturn,
},
data() {
return {
config,
dialogConfig,
getPreScrapListApi,
getDialogListApi,
tableSelList: [],
sendParams: {},
temp: false,
getSelList,
}
},
created() {
this.getSelList()
},
methods: {
/* 列表按钮操作 */
handlePreview(row) {
this.sendParams.taskId = row.taskId
this.dialogConfig.outerTitle = '查看'
this.dialogConfig.outerWidth = '70%'
this.dialogConfig.outerVisible = true
},
handleSubmitScrap(row) {
this.dialogConfig.outerTitle = '提交报废'
this.dialogConfig.outerWidth = '50%'
this.dialogConfig.outerVisible = true
},
handleAuditing(row) {
this.dialogConfig.outerTitle = '审批详情'
this.dialogConfig.outerWidth = '50%'
this.dialogConfig.outerVisible = true
},
handleReject(row) {
this.temp = !this.temp
},
/* 关闭选择审批部门弹框 */
closeDepartSel(val, list) {
console.log(list, '选择的部门')
this.dialogConfig.outerVisible = val
},
/* 批量提交报废按钮 */
handelSubmitScrap() {
if (this.tableSelList.length < 1) {
this.$message.error('请勾选列表数据!')
} else {
this.dialogConfig.outerTitle = '提交报废'
this.dialogConfig.outerWidth = '50%'
this.dialogConfig.outerVisible = true
}
},
/* 表格复选框选中的数据 */
getTableSelectionChange(val) {
this.tableSelList = val
},
handleBack() {
this.temp = !this.temp
this.dialogVisible = false
},
/* 外层弹框关闭 */
closeDialogOuter() {
this.dialogConfig.outerVisible = false
},
/* 内层弹框关闭 */
closeDialogInner() {
this.dialogConfig.innerVisible = false
},
},
}
</script>
<style scoped lang="scss">
::v-deep .el-page-header__left {
display: none;
}
.back-text {
margin-bottom: 8px;
padding: 0 5px;
box-shadow: 1px 1px #ccc;
span {
font-weight: bold;
}
}
</style>

View File

@ -231,7 +231,7 @@
this.$message.error('请勾选列表数据!')
} else {
this.dialogWidth = '50%'
this.selDepart = true
this.title = '提交报废'
this.dialogVisible = true
}
},