This commit is contained in:
BianLzhaoMin 2024-04-24 17:57:47 +08:00
parent 82ce5836ee
commit aaedeaa557
12 changed files with 511 additions and 358 deletions

View File

@ -11,7 +11,7 @@ export const getDialogListApi = (data) => {
} }
/* 预报废审核接口 */ /* 预报废审核接口 */
export const auditingScrapApi = (data) => { export const auditingPreScrapApi = (data) => {
return request.post('/material/scrap/forecastWasteAudit', data) return request.post('/material/scrap/forecastWasteAudit', data)
} }
@ -19,3 +19,18 @@ export const auditingScrapApi = (data) => {
export const getPreScrapListApi = (data) => { export const getPreScrapListApi = (data) => {
return request.get('/material/scrap/getScrapTaskList', { params: data }) return request.get('/material/scrap/getScrapTaskList', { params: data })
} }
/* 报废列表提交报废接口 */
export const submitScrapApi = (data) => {
return request.post('/material/scrap/submitScrapTask', data)
}
/* 报废列表 */
export const getScrapListApi = (data) => {
return request.post('/material/scrap/scrapTaskReviewList', data)
}
/* 报废审核接口 */
export const auditingScrapApi = (data) => {
return request.post('/material/scrap/scrapTaskReview', data)
}

View File

@ -38,6 +38,7 @@
</el-select> </el-select>
<el-cascader <el-cascader
v-if="item.f_type === 'selCas'" v-if="item.f_type === 'selCas'"
v-model="queryParams[item.f_model]"
:options="item.f_selList" :options="item.f_selList"
:props="item.optionProps" :props="item.optionProps"
:show-all-levels="false" :show-all-levels="false"

View File

@ -15,7 +15,7 @@
:headers="headers" :headers="headers"
:file-list="fileList" :file-list="fileList"
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
:class="{hide: this.fileList.length >= this.limit}" :class="{ hide: this.fileList.length >= this.limit }"
> >
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
</el-upload> </el-upload>
@ -23,8 +23,12 @@
<!-- 上传提示 --> <!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip"> <div class="el-upload__tip" slot="tip" v-if="showTip">
请上传 请上传
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template> <template v-if="fileSize">
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
</template>
<template v-if="fileType">
格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>
</template>
的文件 的文件
</div> </div>
@ -43,9 +47,9 @@
</template> </template>
<script> <script>
import { getToken } from "@/utils/auth"; import { getToken } from '@/utils/auth'
export default { export default {
props: { props: {
value: [String, Object, Array], value: [String, Object, Array],
// //
@ -61,161 +65,178 @@ export default {
// , ['png', 'jpg', 'jpeg'] // , ['png', 'jpg', 'jpeg']
fileType: { fileType: {
type: Array, type: Array,
default: () => ["png", "jpg", "jpeg"], default: () => ['png', 'jpg', 'jpeg'],
}, },
// //
isShowTip: { isShowTip: {
type: Boolean, type: Boolean,
default: true default: true,
} },
}, },
data() { data() {
return { return {
number: 0, number: 0,
uploadList: [], uploadList: [],
dialogImageUrl: "", dialogImageUrl: '',
dialogVisible: false, dialogVisible: false,
hideUpload: false, hideUpload: false,
uploadImgUrl: process.env.VUE_APP_BASE_API + "/file/upload", // uploadImgUrl: process.env.VUE_APP_BASE_API + '/file/upload', //
headers: { headers: {
Authorization: "Bearer " + getToken(), Authorization: 'Bearer ' + getToken(),
}, },
fileList: [] fileList: [],
}; }
}, },
watch: { watch: {
value: { value: {
handler(val) { handler(val) {
if (val) { if (val) {
// //
const list = Array.isArray(val) ? val : this.value.split(','); const list = Array.isArray(val)
? val
: this.value.split(',')
// //
this.fileList = list.map(item => { this.fileList = list.map((item) => {
if (typeof item === "string") { if (typeof item === 'string') {
item = { name: item, url: item }; item = { name: item, url: item }
} }
return item; return item
}); })
} else { } else {
this.fileList = []; this.fileList = []
return []; return []
} }
}, },
deep: true, deep: true,
immediate: true immediate: true,
} },
}, },
computed: { computed: {
// //
showTip() { showTip() {
return this.isShowTip && (this.fileType || this.fileSize); return this.isShowTip && (this.fileType || this.fileSize)
}, },
}, },
methods: { methods: {
// loading // loading
handleBeforeUpload(file) { handleBeforeUpload(file) {
let isImg = false; let isImg = false
if (this.fileType.length) { if (this.fileType.length) {
let fileExtension = ""; let fileExtension = ''
if (file.name.lastIndexOf(".") > -1) { if (file.name.lastIndexOf('.') > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1); fileExtension = file.name.slice(
file.name.lastIndexOf('.') + 1,
)
} }
isImg = this.fileType.some(type => { isImg = this.fileType.some((type) => {
if (file.type.indexOf(type) > -1) return true; if (file.type.indexOf(type) > -1) return true
if (fileExtension && fileExtension.indexOf(type) > -1) return true; if (fileExtension && fileExtension.indexOf(type) > -1)
return false; return true
}); return false
})
} else { } else {
isImg = file.type.indexOf("image") > -1; isImg = file.type.indexOf('image') > -1
} }
if (!isImg) { if (!isImg) {
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`); this.$modal.msgError(
return false; `文件格式不正确, 请上传${this.fileType.join(
'/',
)}图片格式文件!`,
)
return false
} }
if (this.fileSize) { if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize; const isLt = file.size / 1024 / 1024 < this.fileSize
if (!isLt) { if (!isLt) {
this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`); this.$modal.msgError(
return false; `上传头像图片大小不能超过 ${this.fileSize} MB!`,
)
return false
} }
} }
this.$modal.loading("正在上传图片,请稍候..."); this.$modal.loading('正在上传图片,请稍候...')
this.number++; this.number++
}, },
// //
handleExceed() { handleExceed() {
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`); this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`)
}, },
// //
handleUploadSuccess(res, file) { handleUploadSuccess(res, file) {
if (res.code === 200) { if (res.code === 200) {
this.uploadList.push({ name: res.data.url, url: res.data.url }); this.uploadList.push({
this.uploadedSuccessfully(); name: res.data.url,
url: res.data.url,
})
this.uploadedSuccessfully()
} else { } else {
this.number--; this.number--
this.$modal.closeLoading(); this.$modal.closeLoading()
this.$modal.msgError(res.msg); this.$modal.msgError(res.msg)
this.$refs.imageUpload.handleRemove(file); this.$refs.imageUpload.handleRemove(file)
this.uploadedSuccessfully(); this.uploadedSuccessfully()
} }
}, },
// //
handleDelete(file) { handleDelete(file) {
const findex = this.fileList.map(f => f.name).indexOf(file.name); const findex = this.fileList
.map((f) => f.name)
.indexOf(file.name)
if (findex > -1) { if (findex > -1) {
this.fileList.splice(findex, 1); this.fileList.splice(findex, 1)
this.$emit("input", this.listToString(this.fileList)); this.$emit('input', this.listToString(this.fileList))
} }
}, },
// //
handleUploadError() { handleUploadError() {
this.$modal.msgError("上传图片失败,请重试"); this.$modal.msgError('上传图片失败,请重试')
this.$modal.closeLoading(); this.$modal.closeLoading()
}, },
// //
uploadedSuccessfully() { uploadedSuccessfully() {
if (this.number > 0 && this.uploadList.length === this.number) { if (this.number > 0 && this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList); this.fileList = this.fileList.concat(this.uploadList)
this.uploadList = []; this.uploadList = []
this.number = 0; this.number = 0
this.$emit("input", this.listToString(this.fileList)); this.$emit('input', this.listToString(this.fileList))
this.$modal.closeLoading(); this.$modal.closeLoading()
} }
}, },
// //
handlePictureCardPreview(file) { handlePictureCardPreview(file) {
this.dialogImageUrl = file.url; this.dialogImageUrl = file.url
this.dialogVisible = true; this.dialogVisible = true
}, },
// //
listToString(list, separator) { listToString(list, separator) {
let strs = ""; let strs = ''
separator = separator || ","; separator = separator || ','
for (let i in list) { for (let i in list) {
if (list[i].url) { if (list[i].url) {
strs += list[i].url.replace(this.baseUrl, "") + separator; strs +=
list[i].url.replace(this.baseUrl, '') + separator
} }
} }
return strs != '' ? strs.substr(0, strs.length - 1) : ''; return strs != '' ? strs.substr(0, strs.length - 1) : ''
},
},
} }
}
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
// .el-upload--picture-card // .el-upload--picture-card
::v-deep.hide .el-upload--picture-card { ::v-deep.hide .el-upload--picture-card {
display: none; display: none;
} }
// //
::v-deep .el-list-enter-active, ::v-deep .el-list-enter-active,
::v-deep .el-list-leave-active { ::v-deep .el-list-leave-active {
transition: all 0s; transition: all 0s;
} }
::v-deep .el-list-enter, .el-list-leave-active { ::v-deep .el-list-enter,
.el-list-leave-active {
opacity: 0; opacity: 0;
transform: translateY(0); transform: translateY(0);
} }
</style> </style>

View File

@ -9,7 +9,8 @@
</FormModel> </FormModel>
<!-- 存放导出等相关按钮的插槽 --> <!-- 存放导出等相关按钮的插槽 -->
<template> <template>
<slot name="export"></slot> <!-- 作用域插槽 传递 pageParams 给父组件 -->
<slot name="export" :pageParams="pageParams"></slot>
</template> </template>
<!-- 列表 --> <!-- 列表 -->
<el-table <el-table
@ -53,7 +54,7 @@
align="center" align="center"
label="操作" label="操作"
v-if="config.handleColShow" v-if="config.handleColShow"
:width="handleWidth" :width="config.handleWidth"
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<slot :data="row" name="handle"></slot> <slot :data="row" name="handle"></slot>
@ -105,13 +106,6 @@
return function () {} return function () {}
}, },
}, },
/* 操作栏宽度 */
handleWidth: {
type: String,
default: () => {
return ''
},
},
/* 查看详情需显示列表等操作 传入的参数 */ /* 查看详情需显示列表等操作 传入的参数 */
sendParams: { sendParams: {
type: Object, type: Object,
@ -148,6 +142,7 @@
columCheckList: [], columCheckList: [],
} }
}, },
created() { created() {
this.getList() this.getList()
this.columCheckList = this.config.columnsList this.columCheckList = this.config.columnsList

View File

@ -112,6 +112,7 @@ const user = {
const user = res.user const user = res.user
/* 存储当前登录用户的userId */ /* 存储当前登录用户的userId */
sessionStorage.setItem('userId', user.userId) sessionStorage.setItem('userId', user.userId)
sessionStorage.setItem('deptId', user.deptId)
const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : user.avatar; const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : user.avatar;
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.roles) commit('SET_ROLES', res.roles)

View File

@ -0,0 +1,41 @@
<template>
<!-- 审批详情列表 -->
<div>
<el-table :data="auditingList" border>
<el-table-column
align="center"
label="审批部门"
prop="deptName"
></el-table-column>
<el-table-column align="center" label="审批状态">
<template slot-scope="{ row }">
<el-tag size="mini" v-if="row.status == 0">待审批</el-tag>
<el-tag type="success" size="mini" v-if="row.status == 1"
>通过</el-tag
>
<el-tag type="danger" size="mini" v-if="row.status == 2"
>已驳回</el-tag
>
</template>
</el-table-column>
<el-table-column
align="center"
label="审批意见"
prop="reasonRejection"
></el-table-column>
</el-table>
</div>
</template>
<script>
export default {
props: {
auditingList: {
type: Array,
default: () => {
return []
},
},
},
}
</script>

View File

@ -1,14 +1,19 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 预报废审核 --> <!-- 预报废审核 -->
<TableModel :config="config" :sendApi="getForecastWasteListApi"> <TableModel
<template slot="export"> ref="tbRef"
:config="config"
:sendApi="getForecastWasteListApi"
>
<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="handleExport(pageParams)"
>导出数据</el-button >导出数据</el-button
> >
</el-row> </el-row>
@ -55,9 +60,9 @@
>查看</el-button >查看</el-button
> >
<el-button <el-button
v-if="data.taskStatus === 121 || data.taskStatus === 120"
type="text" type="text"
size="mini" size="mini"
v-if="data.taskStatus === 121 || data.taskStatus === 120"
@click="handleAuditing(data)" @click="handleAuditing(data)"
>审核</el-button >审核</el-button
> >
@ -77,6 +82,11 @@
:sendApi="getDialogListApi" :sendApi="getDialogListApi"
:selectable=" :selectable="
(row) => { (row) => {
if (row != 0) {
this.tbAllChecked = true
} else {
this.tbAllChecked = false
}
return row.status == 0 return row.status == 0
} }
" "
@ -155,7 +165,7 @@
import { import {
getForecastWasteListApi, getForecastWasteListApi,
getDialogListApi, getDialogListApi,
auditingScrapApi, auditingPreScrapApi,
} from '@/api/scrap/forecastWaste.js' } from '@/api/scrap/forecastWaste.js'
export default { export default {
name: 'Inventory', name: 'Inventory',
@ -183,6 +193,7 @@
taskId: '', taskId: '',
scrapDetailList: [], scrapDetailList: [],
}, },
tbAllChecked: false, //
} }
}, },
created() { created() {
@ -217,6 +228,11 @@
}, },
/* 审核通过 */ /* 审核通过 */
async auditingPass() { async auditingPass() {
if (this.tbAllChecked) {
this.$message.error('当前已没有可审核的装备')
this.dialogConfig.outerVisible = false
return
}
if (this.selAuditingList.length < 1) { if (this.selAuditingList.length < 1) {
this.$message.error('请勾选审核设备') this.$message.error('请勾选审核设备')
return return
@ -232,7 +248,7 @@
this.auditingParams.scrapDetailList.push(deviceInfo) this.auditingParams.scrapDetailList.push(deviceInfo)
}) })
const res = await auditingScrapApi(this.auditingParams) const res = await auditingPreScrapApi(this.auditingParams)
if (res.code == 200) { if (res.code == 200) {
this.$message.success('审核通过!') this.$message.success('审核通过!')
this.dialogVisible = false this.dialogVisible = false
@ -241,6 +257,11 @@
}, },
/* 审核驳回 */ /* 审核驳回 */
async auditingReject() { async auditingReject() {
if (this.tbAllChecked) {
this.$message.error('当前已没有可审核的装备')
this.dialogConfig.outerVisible = false
return
}
if (this.selAuditingList.length < 1) { if (this.selAuditingList.length < 1) {
this.$message.error('请勾选审核设备') this.$message.error('请勾选审核设备')
return return
@ -271,7 +292,7 @@
this.auditingParams.scrapDetailList.push(deviceInfo) this.auditingParams.scrapDetailList.push(deviceInfo)
}) })
const res = await auditingScrapApi(this.auditingParams) const res = await auditingPreScrapApi(this.auditingParams)
if (res.code == 200) { if (res.code == 200) {
this.$message.success('已驳回!') this.$message.success('已驳回!')
this.dialogConfig.innerVisible = false this.dialogConfig.innerVisible = false
@ -282,6 +303,10 @@
} }
} }
}, },
/* 数据导出 */
handleExport(data) {
console.log(data, '导出的参数')
},
}, },
watch: { watch: {
dialogConfig: { dialogConfig: {

View File

@ -15,7 +15,7 @@ export const config = {
pageShow: true, // 是否显示分页组件 pageShow: true, // 是否显示分页组件
isSelShow: true,// 表格是否需要复选框 isSelShow: true,// 表格是否需要复选框
isFormShow: true, // 是否显示表单查询组件 isFormShow: true, // 是否显示表单查询组件
handleWidth: '', // 操作列宽度 handleWidth: '180px', // 操作列宽度
formLabel: [ formLabel: [
{ f_label: '关键字', f_model: 'keywords', f_type: 'ipt' }, { f_label: '关键字', f_model: 'keywords', f_type: 'ipt' },
{ f_label: '单位名称', f_model: 'backUnit', f_type: 'sel', f_selList: [] }, { f_label: '单位名称', f_model: 'backUnit', f_type: 'sel', f_selList: [] },
@ -80,7 +80,7 @@ export const dialogConfig = {
{ t_width: '', t_props: 'maCode', t_label: '设备编码' }, { t_width: '', t_props: 'maCode', t_label: '设备编码' },
{ t_width: '', t_props: 'scrapNum', t_label: '设备数量' }, { t_width: '', t_props: 'scrapNum', t_label: '设备数量' },
{ t_width: '', t_props: 'remark', t_label: '报废原因' }, { t_width: '', t_props: 'remark', t_label: '报废原因' },
{ t_width: '', t_props: 'fileUrl', t_label: '报废图片' }, { t_width: '', t_props: 'fileUrl', t_label: '报废图片', t_slot: 'imgPreview' },
], ],
} }

View File

@ -48,7 +48,7 @@
<!-- 报废来源 --> <!-- 报废来源 -->
<template slot-scope="{ data }" slot="source"> <template slot-scope="{ data }" slot="source">
<template v-if="data.scrapSource === 1">退料</template> <template v-if="data.scrapSource === 1">退料</template>
<template v-if="data.scrapSource === 2">维修审核</template> <template v-if="data.scrapSource === 2">维修</template>
<template v-if="data.scrapSource === 3">盘点</template> <template v-if="data.scrapSource === 3">盘点</template>
</template> </template>
<!-- 列表操作栏 --> <!-- 列表操作栏 -->
@ -63,16 +63,10 @@
type="text" type="text"
size="mini" size="mini"
v-if="data.taskStatus == 124" v-if="data.taskStatus == 124"
v-hasPermi="['scrap:auditing']"
@click="handleSubmitScrap(data)" @click="handleSubmitScrap(data)"
>提交报废</el-button >提交报废</el-button
> >
<el-button
type="text"
size="mini"
@click="handleAuditing(data)"
v-if="data.taskStatus != 124"
>审批详情</el-button
>
<el-button <el-button
type="text" type="text"
size="mini" size="mini"
@ -80,6 +74,13 @@
@click="handleReject(data)" @click="handleReject(data)"
>驳回退料</el-button >驳回退料</el-button
> >
<el-button
type="text"
size="mini"
@click="handleAuditing(data)"
v-if="data.taskStatus != 124"
>审批详情</el-button
>
</template> </template>
</TableModel> </TableModel>
@ -96,28 +97,22 @@
:sendApi="getDialogListApi" :sendApi="getDialogListApi"
:config="dialogConfig" :config="dialogConfig"
> >
</TableModel <template slot="imgPreview" slot-scope="{ data }">
<ImagePreview
:src="`https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg`"
:width="`60px`"
:height="`60px`"
/>
</template> </TableModel
></template> ></template>
<!-- 审批详情 --> <!-- 审批详情 -->
<template v-if="dialogConfig.outerTitle === '审批详情'"> <template v-if="dialogConfig.outerTitle === '审批详情'">
<el-table :data="audDetails"> <AuditingDetails :auditingList="auditingList" />
<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>
<!-- 部门选择 --> <!-- 部门选择 -->
<template v-if="dialogConfig.outerTitle === '提交报废'"> <template v-if="dialogConfig.outerTitle === '选择审批部门'">
<SelDepart @closeDepartSel="closeDepartSel" /> <SelDepart @closeDepartSel="closeDepartSel" />
</template> </template>
</template> </template>
@ -139,9 +134,11 @@
import DialogModel from '@/components/DialogModel' import DialogModel from '@/components/DialogModel'
import SelDepart from '../../component/selDepart.vue' import SelDepart from '../../component/selDepart.vue'
import AuditingReturn from '../auditingReturn/index.vue' // 退 import AuditingReturn from '../auditingReturn/index.vue' // 退
import AuditingDetails from '../../component/auditingDetails.vue'
import { import {
getPreScrapListApi, getPreScrapListApi,
getDialogListApi, getDialogListApi,
submitScrapApi,
} from '@/api/scrap/forecastWaste.js' } from '@/api/scrap/forecastWaste.js'
import { config, dialogConfig, getSelList } from './config' import { config, dialogConfig, getSelList } from './config'
export default { export default {
@ -151,6 +148,7 @@
DialogModel, DialogModel,
SelDepart, SelDepart,
AuditingReturn, AuditingReturn,
AuditingDetails,
}, },
data() { data() {
return { return {
@ -162,6 +160,14 @@
sendParams: {}, // sendParams: {}, //
temp: false, temp: false,
getSelList, getSelList,
imgCommonUrl: process.env.VUE_APP_BASE_API + '/system',
/* 提交报废申请参数 */
submitScrapParams: {
taskIdList: [],
deptIds: [],
},
auditingList: [],
} }
}, },
created() { created() {
@ -177,12 +183,13 @@
this.dialogConfig.outerVisible = true this.dialogConfig.outerVisible = true
}, },
handleSubmitScrap(row) { handleSubmitScrap(row) {
console.log(row, '报废**') this.submitScrapParams.taskIdList.push(row.taskId)
this.dialogConfig.outerTitle = '提交报废' this.dialogConfig.outerTitle = '选择审批部门'
this.dialogConfig.outerWidth = '50%' this.dialogConfig.outerWidth = '50%'
this.dialogConfig.outerVisible = true this.dialogConfig.outerVisible = true
}, },
handleAuditing(row) { handleAuditing(row) {
this.auditingList = row.scrapAuditorSetList
this.dialogConfig.outerTitle = '审批详情' this.dialogConfig.outerTitle = '审批详情'
this.dialogConfig.outerWidth = '50%' this.dialogConfig.outerWidth = '50%'
this.dialogConfig.outerVisible = true this.dialogConfig.outerVisible = true
@ -193,19 +200,29 @@
/* 关闭选择审批部门弹框 */ /* 关闭选择审批部门弹框 */
async closeDepartSel(val, list) { async closeDepartSel(val, list) {
console.log(list, '选择的部门')
if (list.length > 1) { if (list.length > 1) {
console.log('调审核接口') list.map((e) => {
} this.submitScrapParams.deptIds.push(e.id)
})
const res = await submitScrapApi(this.submitScrapParams)
console.log(res, '提交报废结果')
if (res.code == 200) {
this.$message.success('已提交成功')
this.dialogConfig.outerVisible = val this.dialogConfig.outerVisible = val
this.$refs.listingTbRef.getList() this.$refs.listingTbRef.getList()
}
}
this.submitScrapParams.deptIds =
this.submitScrapParams.taskIdList = []
}, },
/* 批量提交报废按钮 */ /* 批量提交报废按钮 */
handelSubmitScrap() { handelSubmitScrap() {
if (this.tableSelList.length < 1) { if (this.tableSelList.length < 1) {
this.$message.error('请勾选列表数据!') this.$message.error('请勾选列表数据!')
} else { } else {
this.dialogConfig.outerTitle = '提交报废' this.dialogConfig.outerTitle = '选择审批部门'
this.dialogConfig.outerWidth = '50%' this.dialogConfig.outerWidth = '50%'
this.dialogConfig.outerVisible = true this.dialogConfig.outerVisible = true
} }

View File

@ -49,7 +49,12 @@
></TableModel> ></TableModel>
</template> </template>
<template v-else> <template v-else>
<FileUpload /> <el-row type="flex" justify="space-around">
<el-col :span="6">请上传处置文件</el-col>
<el-col>
<ImageUpload />
</el-col>
</el-row>
</template> </template>
</template> </template>
</DialogModel> </DialogModel>
@ -77,6 +82,9 @@
rejectReason: '', rejectReason: '',
} }
}, },
created() {
console.log(process.env.VUE_APP_BASE_UPLOAD_URL, '**')
},
methods: { methods: {
/* 按钮操作 */ /* 按钮操作 */
handleBtn(row, id) { handleBtn(row, id) {

View File

@ -16,21 +16,15 @@ export const config = {
], ],
columnsList: [ columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' }, { t_width: '55px', t_props: '', t_label: '序号' },
{ t_props: '', t_label: '报废单号' }, { t_props: 'scrapNum', t_label: '报废单号' },
{ t_props: '', t_label: '报废类型' }, { t_props: 'scrapSource', t_label: '报废来源', t_slot: 'source' },
{ t_props: '', t_label: '预报废单号' }, { t_props: 'repairNum', t_label: '预报废单号' },
{ t_props: '', t_label: '退料单位名称' }, { t_props: 'unitName', t_label: '退料单位名称' },
{ t_props: '', t_label: '退料工程名称' }, { t_props: 'projectName', t_label: '退料工程名称' },
{ t_props: '', t_label: '机具类型' }, { t_props: 'itemType', t_label: '机具类型' },
{ t_props: '', t_label: '任务创建人' }, { t_props: 'createBy', t_label: '任务创建人' },
{ t_props: '', t_label: '任务创建时间' }, { t_props: 'createTime', t_label: '任务创建时间' },
{ t_props: '', t_label: '审核状态' }, { t_props: '', t_label: '审核状态', t_slot: 'type' },
],
handleBtn: [
{ btn_title: '查看', id: 1 },
{ btn_title: '审核', id: 2 },
{ btn_title: '审批详情', id: 3 },
], ],
} }
@ -50,28 +44,12 @@ export const dialogConfig = {
], ],
columnsList: [ columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' }, { t_width: '55px', t_props: '', t_label: '序号' },
{ t_props: '', t_label: '设备类型' }, { t_props: 'machineTypeName', t_label: '设备类型' },
{ t_props: '', t_label: '规格型号' }, { t_props: 'specificationType', t_label: '规格型号' },
{ t_props: '', t_label: '设备编码' }, { t_props: 'maCode', t_label: '设备编码' },
{ t_props: '', t_label: '设备数量' }, { t_props: 'scrapNum', t_label: '设备数量' },
{ t_props: '', t_label: '报废原因' }, { t_props: 'remark', t_label: '报废原因' },
{ t_props: '', t_label: '报废图片' }, { t_props: 'fileUrl', t_label: '报废图片' },
{ t_props: '', t_label: '备注' },
],
}
export const detailsConfig = {
detailsShow: false,
handleColShow: false, // 是否显示操作列
pageShow: false, // 是否显示分页组件
isSelShow: false,// 表格是否需要复选框
isFormShow: false, // 是否显示表单查询组件
columnsList: [
{ t_props: '', t_label: '审批部门' },
{ t_props: '', t_label: '审批状态' },
{ t_props: '', t_label: '审批意见' },
], ],
} }

View File

@ -3,7 +3,8 @@
<!-- 报废审核 --> <!-- 报废审核 -->
<TableModel <TableModel
:config="config" :config="config"
:sendApi="getForecastWasteListApi" :sendApi="getScrapListApi"
ref="tbRef"
:handleWidth="`160px`" :handleWidth="`160px`"
> >
<template slot="export"> <template slot="export">
@ -18,16 +19,49 @@
</el-row> </el-row>
</template> </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-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="handle" slot-scope="data"> <template slot="handle" slot-scope="{ data }">
<el-button size="mini" type="text" @click="handlePreview(data)">
查看
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
v-for="btn in config.handleBtn" v-if="auditingIsShow(data)"
:key="btn.id" v-hasPermi="['scrap:auditing']"
@click="handleBtn(data, btn.id)" @click="handleAuditing(data)"
> >
{{ btn.btn_title }} 审核
</el-button>
<el-button
size="mini"
type="text"
@click="handleAuditingDetails(data)"
>
审批详情
</el-button> </el-button>
</template> </template>
</TableModel> </TableModel>
@ -40,11 +74,12 @@
> >
<!-- 弹框外层内容 查看 审核 审核详情--> <!-- 弹框外层内容 查看 审核 审核详情-->
<template slot="outerContent"> <template slot="outerContent">
<template v-if="!detailsConfig.detailsShow"> <template v-if="dialogConfig.outerTitle != '审批详情'">
<TableModel <TableModel
:config="dialogConfig" :config="dialogConfig"
:sendParams="sendParams"
:sendApi="getDialogListApi"
ref="dialogTbRef" ref="dialogTbRef"
:sendApi="getForecastWasteListApi"
@getTableSelectionChange="getDialogTbChange" @getTableSelectionChange="getDialogTbChange"
></TableModel> ></TableModel>
<el-row <el-row
@ -68,10 +103,7 @@
<!-- 审核详情 --> <!-- 审核详情 -->
<template v-else> <template v-else>
<TableModel <AuditingDetails :auditingList="auditingList" />
:config="detailsConfig"
:sendApi="getForecastWasteListApi"
/>
</template> </template>
</template> </template>
@ -82,6 +114,7 @@
<el-col :span="20"> <el-col :span="20">
<el-input <el-input
v-model="rejectReason" v-model="rejectReason"
maxlength="100"
type="textarea" type="textarea"
:rows="6" :rows="6"
ref="rejectReasonRef" ref="rejectReasonRef"
@ -106,53 +139,69 @@
</template> </template>
<script> <script>
import { getForecastWasteListApi } 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 { config, dialogConfig, detailsConfig } from './config.js' import AuditingDetails from '../../component/auditingDetails.vue'
import { config, dialogConfig } from './config.js'
import {
getScrapListApi,
getDialogListApi,
auditingScrapApi,
} from '@/api/scrap/forecastWaste.js'
export default { export default {
components: { components: {
TableModel, TableModel,
DialogModel, DialogModel,
AuditingDetails,
}, },
data() { data() {
return { return {
config, config,
dialogConfig, dialogConfig,
detailsConfig, getScrapListApi,
getForecastWasteListApi, getDialogListApi,
/* 选中的列表数据 */ /* 选中的列表数据 */
selectionList: [], selectionList: [],
/* 驳回原因 */ /* 驳回原因 */
rejectReason: '', rejectReason: '',
sendParams: {}, //
deptId: sessionStorage.getItem('deptId'),
/* 审核参数 */
auditingParams: {
deptId: sessionStorage.getItem('deptId'),
userId: sessionStorage.getItem('userId'),
taskId: '',
status: '',
reasonRejection: '',
},
/* 审批详情的列表 */
auditingList: [],
} }
}, },
created() {},
methods: { methods: {
/* 按钮操作 */ /* 按钮操作 */
handleBtn(row, id) { handlePreview(row) {
console.log(row, id, '操作按钮') this.sendParams.taskId = row.taskId
switch (id) {
case 1:
this.dialogConfig.outerTitle = '查看' this.dialogConfig.outerTitle = '查看'
this.dialogConfig.outerWidth = '70%' this.dialogConfig.outerWidth = '70%'
this.dialogConfig.isSelShow =
this.detailsConfig.detailsShow = false
break
case 2:
this.dialogConfig.outerTitle = '审核'
this.dialogConfig.outerWidth = '70%'
this.dialogConfig.isSelShow = true
this.detailsConfig.detailsShow = false
break
case 3:
this.dialogConfig.outerTitle = '审核详情'
this.dialogConfig.outerWidth = '40%'
this.detailsConfig.detailsShow = true
break
}
this.dialogConfig.outerVisible = true this.dialogConfig.outerVisible = true
}, },
handleAuditing(row) {
this.sendParams.taskId = this.auditingParams.taskId = row.taskId
this.dialogConfig.outerTitle = '审核'
this.dialogConfig.outerWidth = '70%'
this.dialogConfig.outerVisible = true
},
handleAuditingDetails(row) {
this.auditingList = row.scrapAuditorSetList
this.dialogConfig.outerTitle = '审批详情'
this.dialogConfig.outerWidth = '40%'
this.dialogConfig.outerVisible = true
},
/* 关闭外层弹框 */ /* 关闭外层弹框 */
closeDialogOuter(val) { closeDialogOuter(val) {
this.dialogConfig.outerVisible = val this.dialogConfig.outerVisible = val
@ -166,19 +215,18 @@
this.selectionList = list this.selectionList = list
}, },
/* 审核通过 */ /* 审核通过 */
handlePass() { async handlePass() {
if (this.selectionList.length < 1) { this.auditingParams.status = '1'
this.$message.error('请勾选列表数据') const res = await auditingScrapApi(this.auditingParams)
return if (res.code == 200) {
} this.$message.success('审核通过')
this.dialogConfig.outerVisible = false this.dialogConfig.outerVisible = false
/* 刷新列表 */
this.$refs.tbRef.getList()
}
}, },
/* 审核驳回 */ /* 审核驳回 */
handleReject() { handleReject() {
if (this.selectionList.length < 1) {
this.$message.error('请勾选列表数据')
return
}
/* 先打开内测弹框 */ /* 先打开内测弹框 */
this.dialogConfig.innerTitle = '驳回原因' this.dialogConfig.innerTitle = '驳回原因'
this.dialogConfig.innerVisible = true this.dialogConfig.innerVisible = true
@ -186,31 +234,34 @@
/* 驳回原因页面取消 */ /* 驳回原因页面取消 */
handleCancelInner() { handleCancelInner() {
this.rejectReason = ''
this.dialogConfig.innerVisible = false this.dialogConfig.innerVisible = false
}, },
/* 驳回原因页面保存 */ /* 驳回原因页面保存 */
handleSubmitInner() { async handleSubmitInner() {
if (!this.rejectReason) { if (!this.rejectReason) {
this.$message.error('请输入驳回原因') this.$message.error('请输入驳回原因')
return return
} }
this.auditingParams.status = '2'
this.auditingParams.reasonRejection = this.rejectReason
const res = await auditingScrapApi(this.auditingParams)
if (res.code == 200) {
this.$message.success('已驳回')
this.dialogConfig.innerVisible = false this.dialogConfig.innerVisible = false
/* 当驳回成功 重新查询列表回显数据 */ this.dialogConfig.outerVisible = false
this.$nextTick(() => { this.rejectReason = ''
this.$refs.dialogTbRef.getList() /* 刷新列表 */
}) this.$refs.tbRef.getList()
},
},
watch: {
dialogConfig: {
handler(newVal) {
/* 监听外层弹框关闭 清空勾选的数据 */
console.log(newVal.outerVisible, '**')
if (!newVal.outerVisible) {
this.selectionList = []
} }
}, },
deep: true, /* 审核按钮的显示条件 */
auditingIsShow(row) {
let temp = row.scrapAuditorSetList.some((e) => {
return e.deptId == this.deptId && e.status == '0'
})
return temp
}, },
}, },
} }