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)
}
@ -19,3 +19,18 @@ export const auditingScrapApi = (data) => {
export const getPreScrapListApi = (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-cascader
v-if="item.f_type === 'selCas'"
v-model="queryParams[item.f_model]"
:options="item.f_selList"
:props="item.optionProps"
:show-all-levels="false"

View File

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

View File

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

View File

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

View File

@ -15,7 +15,7 @@ export const config = {
pageShow: true, // 是否显示分页组件
isSelShow: true,// 表格是否需要复选框
isFormShow: true, // 是否显示表单查询组件
handleWidth: '', // 操作列宽度
handleWidth: '180px', // 操作列宽度
formLabel: [
{ f_label: '关键字', f_model: 'keywords', f_type: 'ipt' },
{ 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: 'scrapNum', 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 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>
<!-- 列表操作栏 -->
@ -63,16 +63,10 @@
type="text"
size="mini"
v-if="data.taskStatus == 124"
v-hasPermi="['scrap:auditing']"
@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"
@ -80,6 +74,13 @@
@click="handleReject(data)"
>驳回退料</el-button
>
<el-button
type="text"
size="mini"
@click="handleAuditing(data)"
v-if="data.taskStatus != 124"
>审批详情</el-button
>
</template>
</TableModel>
@ -96,28 +97,22 @@
:sendApi="getDialogListApi"
: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 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>
<AuditingDetails :auditingList="auditingList" />
</template>
<!-- 部门选择 -->
<template v-if="dialogConfig.outerTitle === '提交报废'">
<template v-if="dialogConfig.outerTitle === '选择审批部门'">
<SelDepart @closeDepartSel="closeDepartSel" />
</template>
</template>
@ -139,9 +134,11 @@
import DialogModel from '@/components/DialogModel'
import SelDepart from '../../component/selDepart.vue'
import AuditingReturn from '../auditingReturn/index.vue' // 退
import AuditingDetails from '../../component/auditingDetails.vue'
import {
getPreScrapListApi,
getDialogListApi,
submitScrapApi,
} from '@/api/scrap/forecastWaste.js'
import { config, dialogConfig, getSelList } from './config'
export default {
@ -151,6 +148,7 @@
DialogModel,
SelDepart,
AuditingReturn,
AuditingDetails,
},
data() {
return {
@ -162,6 +160,14 @@
sendParams: {}, //
temp: false,
getSelList,
imgCommonUrl: process.env.VUE_APP_BASE_API + '/system',
/* 提交报废申请参数 */
submitScrapParams: {
taskIdList: [],
deptIds: [],
},
auditingList: [],
}
},
created() {
@ -177,12 +183,13 @@
this.dialogConfig.outerVisible = true
},
handleSubmitScrap(row) {
console.log(row, '报废**')
this.dialogConfig.outerTitle = '提交报废'
this.submitScrapParams.taskIdList.push(row.taskId)
this.dialogConfig.outerTitle = '选择审批部门'
this.dialogConfig.outerWidth = '50%'
this.dialogConfig.outerVisible = true
},
handleAuditing(row) {
this.auditingList = row.scrapAuditorSetList
this.dialogConfig.outerTitle = '审批详情'
this.dialogConfig.outerWidth = '50%'
this.dialogConfig.outerVisible = true
@ -193,19 +200,29 @@
/* 关闭选择审批部门弹框 */
async closeDepartSel(val, list) {
console.log(list, '选择的部门')
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.$refs.listingTbRef.getList()
}
}
this.submitScrapParams.deptIds =
this.submitScrapParams.taskIdList = []
},
/* 批量提交报废按钮 */
handelSubmitScrap() {
if (this.tableSelList.length < 1) {
this.$message.error('请勾选列表数据!')
} else {
this.dialogConfig.outerTitle = '提交报废'
this.dialogConfig.outerTitle = '选择审批部门'
this.dialogConfig.outerWidth = '50%'
this.dialogConfig.outerVisible = true
}

View File

@ -49,7 +49,12 @@
></TableModel>
</template>
<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>
</DialogModel>
@ -77,6 +82,9 @@
rejectReason: '',
}
},
created() {
console.log(process.env.VUE_APP_BASE_UPLOAD_URL, '**')
},
methods: {
/* 按钮操作 */
handleBtn(row, id) {

View File

@ -16,21 +16,15 @@ export const config = {
],
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: '退料工程名称' },
{ 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 },
{ t_props: 'scrapNum', t_label: '报废单号' },
{ t_props: 'scrapSource', t_label: '报废来源', t_slot: 'source' },
{ t_props: 'repairNum', t_label: '预报废单号' },
{ t_props: 'unitName', t_label: '退料单位名称' },
{ t_props: 'projectName', t_label: '退料工程名称' },
{ t_props: 'itemType', t_label: '机具类型' },
{ t_props: 'createBy', t_label: '任务创建人' },
{ t_props: 'createTime', t_label: '任务创建时间' },
{ t_props: '', t_label: '审核状态', t_slot: 'type' },
],
}
@ -50,28 +44,12 @@ export const dialogConfig = {
],
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: '报废原因' },
{ t_props: '', 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: '审批意见' },
{ t_props: 'machineTypeName', t_label: '设备类型' },
{ t_props: 'specificationType', t_label: '规格型号' },
{ t_props: 'maCode', t_label: '设备编码' },
{ t_props: 'scrapNum', t_label: '设备数量' },
{ t_props: 'remark', t_label: '报废原因' },
{ t_props: 'fileUrl', t_label: '报废图片' },
],
}

View File

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