新需求开发 功能优化

This commit is contained in:
BianLzhaoMin 2025-03-05 18:35:45 +08:00
parent c94d536c4f
commit 327dc1c266
7 changed files with 1041 additions and 650 deletions

View File

@ -2,118 +2,126 @@ import request from '@/utils/request'
// 查询角色列表
export function listRole(query) {
return request({
url: '/system/role/list',
method: 'get',
params: query
})
return request({
url: '/system/role/list',
method: 'get',
params: query
})
}
// 查询角色详细
export function getRole(roleId) {
return request({
url: '/system/role/' + roleId,
method: 'get'
})
return request({
url: '/system/role/' + roleId,
method: 'get'
})
}
// 新增角色
export function addRole(data) {
return request({
url: '/system/role',
method: 'post',
data: data
})
return request({
url: '/system/role',
method: 'post',
data: data
})
}
// 修改角色
export function updateRole(data) {
return request({
url: '/system/role/edit',
method: 'post',
data: data
})
return request({
url: '/system/role/edit',
method: 'post',
data: data
})
}
// 角色数据权限
export function dataScope(data) {
return request({
url: '/system/role/dataScope/edit',
method: 'post',
data: data
})
return request({
url: '/system/role/dataScope/edit',
method: 'post',
data: data
})
}
// 角色状态修改
export function changeRoleStatus(roleId, status) {
const data = {
roleId,
status
}
return request({
url: '/system/role/changeStatus',
method: 'post',
data: data
})
const data = {
roleId,
status
}
return request({
url: '/system/role/changeStatus',
method: 'post',
data: data
})
}
// 删除角色
export function delRole(roleId) {
return request({
url: '/system/role/delete/' + roleId,
method: 'post'
})
return request({
url: '/system/role/delete/' + roleId,
method: 'post'
})
}
// 查询角色已授权用户列表
export function allocatedUserList(query) {
return request({
url: '/system/role/authUser/allocatedList',
method: 'get',
params: query
})
return request({
url: '/system/role/authUser/allocatedList',
method: 'get',
params: query
})
}
// 查询角色已授权用户列表
export function allocatedUserListAllApi(query) {
return request({
url: 'system/user/list',
method: 'get',
params: query
})
}
// 查询角色未授权用户列表
export function unallocatedUserList(query) {
return request({
url: '/system/role/authUser/unallocatedList',
method: 'get',
params: query
})
return request({
url: '/system/role/authUser/unallocatedList',
method: 'get',
params: query
})
}
// 取消用户授权角色
export function authUserCancel(data) {
return request({
url: '/system/role/authUser/cancel',
method: 'post',
data: data
})
return request({
url: '/system/role/authUser/cancel',
method: 'post',
data: data
})
}
// 批量取消用户授权角色
export function authUserCancelAll(data) {
return request({
url: '/system/role/authUser/cancelAll',
method: 'post',
params: data
})
return request({
url: '/system/role/authUser/cancelAll',
method: 'post',
params: data
})
}
// 授权用户选择
export function authUserSelectAll(data) {
return request({
url: '/system/role/authUser/selectAll',
method: 'post',
params: data
})
return request({
url: '/system/role/authUser/selectAll',
method: 'post',
params: data
})
}
// 根据角色ID查询部门树结构
export function deptTreeSelect(roleId) {
return request({
url: '/system/role/deptTree/' + roleId,
method: 'get'
})
return request({
url: '/system/role/deptTree/' + roleId,
method: 'get'
})
}

View File

@ -1,371 +1,424 @@
<template>
<div class="business-details-container">
<el-row>
<el-col :span="18">
<div class="left-container">
<div class="pages-title">直转申请详情</div>
<TitleTip :title="`基本信息`" />
<div class="business-details-container">
<el-row>
<el-col :span="18">
<div class="left-container">
<div class="pages-title">直转申请详情</div>
<TitleTip :title="`基本信息`" />
<el-form :model="maForm" ref="maForm" size="small" label-width="100px" disabled style="margin-top: 20px">
<el-row :gutter="20" class="cont-center" style="margin-bottom: 20px">
<el-col :span="10" :offset="0">
<el-card shadow="always" :body-style="{ padding: '20px' }" style="min-width: 400px">
<!-- card body -->
<el-form-item label="转出单位" prop="backUnitId">
<el-input
v-model="maForm.backUnitName"
placeholder="请输入转出单位"
clearable
maxlength="50"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="转出工程" prop="backProId">
<el-input
v-model="maForm.backProName"
placeholder="请输入转出工程"
clearable
maxlength="50"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="转出人" prop="backMan">
<el-input
v-model="maForm.backMan"
placeholder="请输入转出人"
clearable
maxlength="50"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="联系电话" prop="backPhone">
<el-input
v-model="maForm.backPhone"
placeholder="请输入联系电话"
clearable
maxlength="11"
style="width: 240px"
/>
</el-form-item>
</el-card>
</el-col>
<el-col :span="3" :offset="0">
<div class="cont-center">
<el-image
style="width: 100px; height: 100px"
:src="require('@/assets/img/transform.png')"
fit="fit"
></el-image>
<el-form
:model="maForm"
ref="maForm"
size="small"
label-width="100px"
disabled
style="margin-top: 20px"
>
<el-row :gutter="20" class="cont-center" style="margin-bottom: 20px">
<el-col :span="10" :offset="0">
<el-card shadow="always" :body-style="{ padding: '20px' }" style="min-width: 400px">
<!-- card body -->
<el-form-item label="转出单位" prop="backUnitId">
<el-input
v-model="maForm.backUnitName"
placeholder="请输入转出单位"
clearable
maxlength="50"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="转出工程" prop="backProId">
<el-input
v-model="maForm.backProName"
placeholder="请输入转出工程"
clearable
maxlength="50"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="转出人" prop="backMan">
<el-input
v-model="maForm.backMan"
placeholder="请输入转出人"
clearable
maxlength="50"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="联系电话" prop="backPhone">
<el-input
v-model="maForm.backPhone"
placeholder="请输入联系电话"
clearable
maxlength="11"
style="width: 240px"
/>
</el-form-item>
</el-card>
</el-col>
<el-col :span="3" :offset="0">
<div class="cont-center">
<el-image
style="width: 100px; height: 100px"
:src="require('@/assets/img/transform.png')"
fit="fit"
></el-image>
</div>
</el-col>
<el-col :span="10" :offset="0">
<el-card shadow="always" :body-style="{ padding: '20px' }" style="min-width: 400px">
<!-- card body -->
<el-form-item label="转入单位" prop="leaseUnitId">
<el-input
v-model="maForm.leaseUnitName"
placeholder="请输入转入单位"
clearable
maxlength="50"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="转入工程" prop="leaseProId">
<el-input
v-model="maForm.leaseProName"
placeholder="请输入转入工程"
clearable
maxlength="50"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="转入人" prop="leaseMan">
<el-input
v-model="maForm.leaseMan"
placeholder="请输入转入人"
clearable
maxlength="50"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="联系电话" prop="leasePhone">
<el-input
v-model="maForm.leasePhone"
placeholder="请输入联系电话"
clearable
maxlength="11"
style="width: 240px"
/>
</el-form-item>
</el-card>
</el-col>
</el-row>
</el-form>
<TitleTip :title="`明细信息`" />
<el-table ref="equipmentList" :data="equipmentList">
<el-table-column align="center" label="序号" type="index" width="55" />
<el-table-column
v-for="(column, index) in tableColumns"
:key="column.prop"
:label="column.label"
:prop="column.prop"
align="center"
show-overflow-tooltip
></el-table-column>
</el-table>
<TitleTip :title="`附件信息`" />
<div class="file-box">
<div v-for="(file, index) in fileList" :key="index">
<div v-if="file.type === 'pdf'" style="margin: 10px">
<a :href="file.url" target="_blank">
<el-image
:src="require('@/assets/file.png')"
fit="file"
style="width: 100px; height: 100px"
/>
</a>
</div>
<div v-else-if="file.type === 'image'" style="margin: 10px">
<el-image
:src="file.url"
fit="file"
:preview-src-list="previewList"
@click="handleImg(file)"
style="width: 100px; height: 100px"
/>
</div>
</div>
</div>
</div>
</el-col>
<el-col :span="10" :offset="0">
<el-card shadow="always" :body-style="{ padding: '20px' }" style="min-width: 400px">
<!-- card body -->
<el-form-item label="转入单位" prop="leaseUnitId">
<el-input
v-model="maForm.leaseUnitName"
placeholder="请输入转入单位"
clearable
maxlength="50"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="转入工程" prop="leaseProId">
<el-input
v-model="maForm.leaseProName"
placeholder="请输入转入工程"
clearable
maxlength="50"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="转入人" prop="leaseMan">
<el-input
v-model="maForm.leaseMan"
placeholder="请输入转入人"
clearable
maxlength="50"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="联系电话" prop="leasePhone">
<el-input
v-model="maForm.leasePhone"
placeholder="请输入联系电话"
clearable
maxlength="11"
style="width: 240px"
/>
</el-form-item>
</el-card>
</el-col>
</el-row>
</el-form>
<TitleTip :title="`明细信息`" />
</el-col>
<el-col :span="6">
<div class="right-container">
<div class="right-title">
<div></div>
<div></div>
<div>流程记录</div>
</div>
<el-table ref="equipmentList" :data="equipmentList">
<el-table-column align="center" label="序号" type="index" width="55" />
<el-table-column
v-for="(column, index) in tableColumns"
:key="column.prop"
:label="column.label"
:prop="column.prop"
align="center"
show-overflow-tooltip
></el-table-column>
</el-table>
<TitleTip :title="`附件信息`" />
<div class="process-record">
<el-steps :space="120" direction="vertical">
<el-step v-for="(step, index) in auditingList" :key="index" :title="step.nodeName">
<!-- <template slot="description">
<div class="custom-description">
{{ step.nodeName }}
<div class="file-box">
<div v-for="(file, index) in fileList" :key="index">
<div v-if="file.type === 'pdf'" style="margin: 10px">
<a :href="file.url" target="_blank">
<el-image :src="require('@/assets/file.png')" fit="file" style="width: 100px; height: 100px" />
</a>
</div>
<div v-else-if="file.type === 'image'" style="margin: 10px">
<el-image
:src="file.url"
fit="file"
:preview-src-list="previewList"
@click="handleImg(file)"
style="width: 100px; height: 100px"
/>
</div>
</div>
</div>
</div>
</el-col>
<el-col :span="6">
<div class="right-container">
<div class="right-title">
<div></div>
<div></div>
<div>流程记录</div>
</div>
<el-tag
size="mini"
type="primary"
v-if="step.isAccept == 0 || step.isAccept == null"
>
待审批
</el-tag>
<el-tag size="mini" type="success" v-if="step.isAccept == 1">已通过</el-tag>
<el-tag size="mini" type="danger" v-if="step.isAccept == 2">已驳回</el-tag>
<div>{{ step.creator }}</div>
<div>{{ step.createTime }}</div>
<div>{{ step.remark }}</div>
</div>
</template> -->
<div class="process-record">
<el-steps :space="120" direction="vertical">
<el-step v-for="(step, index) in auditingList" :key="index" :title="step.nodeName">
<template slot="description">
<div class="custom-description">
{{ step.nodeName }}
<template slot="description">
<div class="custom-description">
审核结果:
<el-tag size="mini" type="primary" v-if="step.isAccept === 0">待审批</el-tag>
<el-tag size="mini" type="success" v-if="step.isAccept === 1">已通过</el-tag>
<el-tag size="mini" type="danger" v-if="step.isAccept === 2">已驳回</el-tag>
</div>
<el-tag size="mini" type="primary" v-if="step.isAccept == 0 || step.isAccept == null">待审批</el-tag>
<el-tag size="mini" type="success" v-if="step.isAccept == 1">已通过</el-tag>
<el-tag size="mini" type="danger" v-if="step.isAccept == 2">已驳回</el-tag>
<div>{{ step.creator }}</div>
<div>{{ step.createTime }}</div>
<div>{{ step.remark }}</div>
</div>
</template>
</el-step>
</el-steps>
</div>
<div class="node-info" v-if="step.createTime">
审核时间:
{{ step.createTime }}
</div>
<div class="auditing-container">
<el-input
type="textarea"
v-model="remark"
placeholder="请输入审核意见"
:autosize="{ minRows: 2, maxRows: 6 }"
/>
<div class="node-info" v-if="step.remark">
审核意见:
{{ step.remark }}
</div>
</template>
</el-step>
</el-steps>
</div>
<el-row class="btn-container">
<el-button type="success" size="mini" @click="onSubmitPass">通过</el-button>
<el-button type="danger" size="mini" @click="onSubmitReject">驳回</el-button>
</el-row>
</div>
</div>
</el-col>
</el-row>
</div>
<div class="auditing-container">
<el-input
type="textarea"
v-model="remark"
placeholder="请输入审核意见"
:autosize="{ minRows: 2, maxRows: 6 }"
/>
<el-row class="btn-container">
<el-button type="success" size="mini" @click="onSubmitPass">通过</el-button>
<el-button type="danger" size="mini" @click="onSubmitReject">驳回</el-button>
</el-row>
</div>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
import TitleTip from './components/title-tip.vue'
import { getLeaseTaskDetail, receiveDetail, getInfoById, getAuditInfo, auditDir } from '@/api/business/index'
import { getAuditingDetailsApi } from '@/api/receive-apply/index.js'
export default {
components: {
TitleTip
},
name: 'directRotationApply',
data() {
return {
id: '',
flowId: '',
isEdit: false, //
isDetail: false, //
isAccept: '',
remark: '',
maForm: {},
auditingList: [], //
equipmentList: [], //
//
tableColumns: [
{ label: '直转数量', prop: 'directNum' },
{ label: '类型名称', prop: 'typeName' },
{ label: '规格型号', prop: 'typeModelName' },
{ label: '计量单位', prop: 'unitName' },
{ label: '领料数量', prop: 'useNum' },
{ label: '领料人', prop: 'leasePerson' },
{ label: '领料日期', prop: 'startTime' }
],
fileList: [
{ name: '文件1', url: 'https://s5.aconvert.com/convert/p3r68-cdx67/vqm2g-dwr99.pdf', type: 'pdf' },
{ name: '文件2', url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', type: 'image' }
],
previewList: []
}
},
created() {
//
// if (this.$route.query) {
// const { id, taskId } = this.$route.query
// this.getLeaseTaskDetailFun(id, taskId)
// }
if (this.$route.query.type == 'edit') {
this.isEdit = true
this.isDetail = false
this.id = this.$route.query.id
this.flowId = this.$route.query.flowId
const obj = Object.assign({}, this.$route, { title: '直转申请审核' })
this.$tab.updatePage(obj)
} else if (this.$route.query.type == 'detail') {
this.isEdit = false
this.isDetail = true
this.id = this.$route.query.id
this.flowId = this.$route.query.flowId
const obj = Object.assign({}, this.$route, { title: '直转申请详情' })
this.$tab.updatePage(obj)
}
components: {
TitleTip
},
name: 'directRotationApply',
data() {
return {
id: '',
flowId: '',
isEdit: false, //
isDetail: false, //
isAccept: '',
remark: '',
maForm: {},
auditingList: [], //
equipmentList: [], //
//
tableColumns: [
{ label: '直转数量', prop: 'directNum' },
{ label: '类型名称', prop: 'typeName' },
{ label: '规格型号', prop: 'typeModelName' },
{ label: '计量单位', prop: 'unitName' },
{ label: '领料数量', prop: 'useNum' },
{ label: '领料人', prop: 'leasePerson' },
{ label: '领料日期', prop: 'startTime' }
],
fileList: [
{ name: '文件1', url: 'https://s5.aconvert.com/convert/p3r68-cdx67/vqm2g-dwr99.pdf', type: 'pdf' },
{
name: '文件2',
url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
type: 'image'
}
],
previewList: []
}
},
created() {
//
// if (this.$route.query) {
// const { id, taskId } = this.$route.query
// this.getLeaseTaskDetailFun(id, taskId)
// }
if (this.$route.query.type == 'edit') {
this.isEdit = true
this.isDetail = false
this.id = this.$route.query.id
this.flowId = this.$route.query.flowId
const obj = Object.assign({}, this.$route, { title: '直转申请审核' })
this.$tab.updatePage(obj)
} else if (this.$route.query.type == 'detail') {
this.isEdit = false
this.isDetail = true
this.id = this.$route.query.id
this.flowId = this.$route.query.flowId
const obj = Object.assign({}, this.$route, { title: '直转申请详情' })
this.$tab.updatePage(obj)
}
this.getTaskInfo()
this.getAuditInfo()
// this.getLeaseTaskDetailFun()
},
methods: {
//
onSubmitPass() {
//
this.$confirm('是否确认通过审核?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.isAccept = 1
this.submitAuditing()
})
.catch(() => {
this.$message.info('已取消')
})
this.getTaskInfo()
// this.getAuditInfo()
if (this.$route.query) {
const { nodeId, flowId } = this.$route.query
// this.auditingParams.taskId = taskId
// this.currentNodeId = nodeId
this.getLeaseTaskDetailFun(flowId)
}
},
//
onSubmitReject() {
//
this.$confirm('是否确认驳回审核?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.isAccept = 2
this.submitAuditing()
})
.catch(() => {
this.$message.info('已取消')
})
},
//
async submitAuditing() {
const params = {
flowId: this.flowId,
nodeId: this.auditingList[this.auditingList.length - 1].nodeId,
isAccept: this.isAccept,
remark: this.remark
}
try {
const res = await auditDir(params)
console.log('🚀 ~ submitAuditing ~ res:', res)
this.$message.success('审核成功')
this.$tab.closePage()
} catch (error) {
console.log('🚀 ~ submitAuditing ~ error:', error)
}
},
//
async getTaskInfo() {
const loading = this.$loading()
try {
const res = await receiveDetail({ id: this.id })
console.log('🚀 ~ getTaskInfo ~ res:', res)
this.maForm = res.data
this.equipmentList = res.data.directApplyDetails
this.fileList = res.data.dirUrls
if (this.fileList.length > 0) {
this.fileList.forEach(item => {
// url .pdf type= pdf
if (item.url.includes('.pdf')) {
item.type = 'pdf'
} else {
item.type = 'image'
methods: {
//
onSubmitPass() {
//
this.$confirm('是否确认通过审核?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.isAccept = 1
this.submitAuditing()
})
.catch(() => {
this.$message.info('已取消')
})
},
//
onSubmitReject() {
//
this.$confirm('是否确认驳回审核?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.isAccept = 2
this.submitAuditing()
})
.catch(() => {
this.$message.info('已取消')
})
},
//
async submitAuditing() {
const params = {
flowId: this.flowId,
nodeId: this.auditingList[this.auditingList.length - 1].nodeId,
isAccept: this.isAccept,
remark: this.remark
}
})
}
console.log('🚀 ~ getTaskInfo ~ fileList:', this.fileList)
console.log('🚀 ~ getTaskInfo ~ this.equipmentList:', this.equipmentList)
loading.close()
} catch (error) {
console.log('🚀 ~ error:', error)
loading.close()
}
},
//
async getAuditInfo() {
try {
const params = {
id: this.id,
flowId: this.flowId
}
try {
const res = await auditDir(params)
console.log('🚀 ~ submitAuditing ~ res:', res)
this.$message.success('审核成功')
this.$tab.closePage()
} catch (error) {
console.log('🚀 ~ submitAuditing ~ error:', error)
}
},
//
async getTaskInfo() {
const loading = this.$loading()
try {
const res = await receiveDetail({ id: this.id })
console.log('🚀 ~ getTaskInfo ~ res:', res)
this.maForm = res.data
this.equipmentList = res.data.directApplyDetails
this.fileList = res.data.dirUrls
if (this.fileList.length > 0) {
this.fileList.forEach(item => {
// url .pdf type= pdf
if (item.url.includes('.pdf')) {
item.type = 'pdf'
} else {
item.type = 'image'
}
})
}
console.log('🚀 ~ getTaskInfo ~ fileList:', this.fileList)
console.log('🚀 ~ getTaskInfo ~ this.equipmentList:', this.equipmentList)
loading.close()
} catch (error) {
console.log('🚀 ~ error:', error)
loading.close()
}
},
//
async getAuditInfo() {
try {
const params = {
id: this.id,
flowId: this.flowId
}
const res = await getAuditInfo(params)
console.log('🚀 ~ getAuditInfo ~ res:', res)
this.auditingList = res.data
console.log('🚀 ~ getAuditInfo ~ this.auditingList:', this.auditingList)
} catch (error) {
console.log('🚀 ~ getAuditInfo ~ error:', error)
}
},
handleImg(img) {
console.log('🚀 ~ handleImg ~ img:', img)
this.previewList = this.fileList.filter(file => file.type === 'image').map(file => file.url)
const res = await getAuditInfo(params)
console.log('🚀 ~ getAuditInfo ~ res:', res)
this.auditingList = res.data
console.log('🚀 ~ getAuditInfo ~ this.auditingList:', this.auditingList)
} catch (error) {
console.log('🚀 ~ getAuditInfo ~ error:', error)
}
},
handleImg(img) {
console.log('🚀 ~ handleImg ~ img:', img)
this.previewList = this.fileList.filter(file => file.type === 'image').map(file => file.url)
},
//
async getLeaseTaskDetailFun(taskId) {
const result = await getAuditingDetailsApi({ taskId })
console.log('result', result)
this.auditingList = result.rows
}
}
}
}
</script>
<style scoped lang="scss">
.business-details-container {
padding: 20px;
padding: 20px;
}
.pages-title {
padding: 10px 0 30px 0;
font-size: 20px;
font-weight: bold;
letter-spacing: 2px;
text-align: center;
color: #19a4a0;
padding: 10px 0 30px 0;
font-size: 20px;
font-weight: bold;
letter-spacing: 2px;
text-align: center;
color: #19a4a0;
}
.file-box {
padding: 10px;
display: flex;
flex-wrap: wrap;
box-sizing: border-box;
/* div {
padding: 10px;
display: flex;
flex-wrap: wrap;
box-sizing: border-box;
/* div {
width: calc((100% - 110px) / 12);
height: 60px;
margin-right: 10px;
@ -381,70 +434,70 @@ export default {
}
.right-container {
padding: 0 20px;
padding: 0 20px;
}
.right-title {
display: flex;
align-items: center;
font-size: 14px;
& div:first-child {
width: 16px;
height: 16px;
border-radius: 50%;
background-color: #19a4a0;
z-index: 9;
}
& div:nth-child(2) {
width: 16px;
height: 16px;
border-radius: 50%;
background-color: #b2e1e0;
transform: translateX(-50%);
}
display: flex;
align-items: center;
font-size: 14px;
& div:first-child {
width: 16px;
height: 16px;
border-radius: 50%;
background-color: #19a4a0;
z-index: 9;
}
& div:nth-child(2) {
width: 16px;
height: 16px;
border-radius: 50%;
background-color: #b2e1e0;
transform: translateX(-50%);
}
}
.process-record {
margin-top: 20px;
// height: 60vh;
margin-top: 20px;
// height: 60vh;
}
.btn-container {
margin-top: 10px;
display: flex;
justify-content: space-around;
margin-top: 10px;
display: flex;
justify-content: space-around;
}
::v-deep .el-step__icon.is-text {
background-color: #19a4a0;
color: #19a4a0;
border: none;
width: 16px;
height: 16px;
background-color: #19a4a0;
color: #19a4a0;
border: none;
width: 16px;
height: 16px;
}
::v-deep .el-step.is-vertical .el-step__line {
width: 2px;
top: 26px;
bottom: 8px;
left: 7px;
width: 2px;
top: 26px;
bottom: 8px;
left: 7px;
}
::v-deep .el-step__title.is-finish {
font-weight: bold;
color: #303133;
font-size: 16px;
font-weight: bold;
color: #303133;
font-size: 16px;
}
::v-deep .el-step__title.is-wait {
font-weight: bold;
color: #303133;
font-size: 16px;
font-weight: bold;
color: #303133;
font-size: 16px;
}
//
.cont-center {
display: flex;
justify-content: center;
align-items: center;
display: flex;
justify-content: center;
align-items: center;
}
</style>

View File

@ -1,41 +1,46 @@
<template>
<!-- 基础页面 -->
<div class="app-container">
<el-form v-show="showSearch" :model="queryParams" ref="queryForm" size="small" inline>
<el-form-item label="申请日期" prop="timeRange">
<el-date-picker
v-model="queryParams.timeRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
clearable
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="审核状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择审核状态" clearable>
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<!-- 基础页面 -->
<div class="app-container">
<el-form v-show="showSearch" :model="queryParams" ref="queryForm" size="small" inline>
<el-form-item label="申请日期" prop="timeRange">
<el-date-picker
v-model="queryParams.timeRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
clearable
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="审核状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择审核状态" clearable>
<el-option
v-for="item in statusOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<!-- 表单按钮 -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<!-- 表单按钮 -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<!-- <el-row :gutter="10" class="mb8">
<!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">直转申请</el-button>
</el-col>
@ -45,52 +50,59 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> -->
<el-table :data="tableList" fit highlight-current-row style="width: 100%">
<!-- 多选 -->
<el-table-column type="selection" width="55" align="center" @selection-change="selectionChange" />
<el-table-column
type="index"
width="55"
label="序号"
align="center"
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
/>
<el-table-column
v-for="(column, index) in tableColumns"
show-overflow-tooltip
:key="column.prop"
:label="column.label"
:prop="column.prop"
align="center"
>
<!-- 插槽 -->
<template v-slot="scope" v-if="column.prop == 'flowStatus'">
<el-tag v-if="scope.row.flowStatus == '0'" type="warning" size="mini" style="margin-right: 5px">
待审核
</el-tag>
<el-tag v-else-if="scope.row.flowStatus == '1'" size="mini" style="margin-right: 5px">审核中</el-tag>
<el-tag v-else-if="scope.row.flowStatus == '2'" type="success" size="mini" style="margin-right: 5px">
已审核
</el-tag>
<el-tag v-else-if="scope.row.flowStatus == '3'" type="error" size="mini" style="margin-right: 5px">
已驳回
</el-tag>
</template>
</el-table-column>
<!-- 操作 -->
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<!-- <el-button type="text" size="mini" icon="el-icon-search" @click="handleEdit(scope.row, 1)">查看</el-button> -->
<el-button
v-if="scope.row.flowStatus == '0' || scope.row.flowStatus == '1'"
type="text"
size="mini"
icon="el-icon-edit"
@click="handleEdit(scope.row, 2)"
>
审核
</el-button>
<!-- <el-button
<el-table :data="tableList" fit highlight-current-row style="width: 100%">
<!-- 多选 -->
<el-table-column type="selection" width="55" align="center" @selection-change="selectionChange" />
<el-table-column
type="index"
width="55"
label="序号"
align="center"
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
/>
<el-table-column
v-for="(column, index) in tableColumns"
show-overflow-tooltip
:key="column.prop"
:label="column.label"
:prop="column.prop"
align="center"
>
<!-- 插槽 -->
<template v-slot="scope" v-if="column.prop == 'flowStatus'">
<el-tag v-if="scope.row.flowStatus == '0'" type="warning" size="mini" style="margin-right: 5px">
待审核
</el-tag>
<el-tag v-else-if="scope.row.flowStatus == '1'" size="mini" style="margin-right: 5px">
审核中
</el-tag>
<el-tag
v-else-if="scope.row.flowStatus == '2'"
type="success"
size="mini"
style="margin-right: 5px"
>
已审核
</el-tag>
<el-tag v-else-if="scope.row.flowStatus == '3'" type="error" size="mini" style="margin-right: 5px">
已驳回
</el-tag>
</template>
</el-table-column>
<!-- 操作 -->
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<!-- <el-button type="text" size="mini" icon="el-icon-search" @click="handleEdit(scope.row, 1)">查看</el-button> -->
<el-button
v-if="scope.row.flowStatus == '0' || scope.row.flowStatus == '1'"
type="text"
size="mini"
icon="el-icon-edit"
@click="handleEdit(scope.row, 2)"
>
审核
</el-button>
<!-- <el-button
v-if="scope.row.status == '0'"
type="text"
size="mini"
@ -100,127 +112,128 @@
>
删除
</el-button> -->
</template>
</el-table-column>
</el-table>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { getReceiveList, receiveDelete, getDerateList } from '@/api/business/index'
export default {
data() {
return {
showSearch: true,
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: '', //
status: '', //
timeRange: [] //
},
//
statusOptions: [
{ label: '待审核', value: '1' },
{ label: '审核中', value: '2' },
{ label: '已完成', value: '3' }
],
total: 0, //
//
tableColumns: [
{ label: '申请时间', prop: 'createTime' },
{ label: '申请人', prop: 'leaseMan' },
{ label: '转出单位', prop: 'backUnitName' },
{ label: '转出工程', prop: 'backProName' },
{ label: '转入单位', prop: 'leaseUnitName' },
{ label: '转入工程', prop: 'leaseProName' },
// { label: '', prop: 'typeName' },
{ label: '状态', prop: 'flowStatus' }
],
//
tableList: []
}
},
created() {
this.getList()
},
methods: {
//
handleQuery() {
this.getList()
},
//
handleReset() {
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.$refs.queryForm.resetFields()
this.getList()
},
//
async getList() {
console.log('列表-查询', this.queryParams)
try {
const params = {
...this.queryParams,
startTime: this.queryParams.timeRange[0] || '',
endTime: this.queryParams.timeRange[1] || ''
data() {
return {
showSearch: true,
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: '', //
status: '', //
timeRange: [] //
},
//
statusOptions: [
{ label: '待审核', value: '1' },
{ label: '审核中', value: '2' },
{ label: '已完成', value: '3' }
],
total: 0, //
//
tableColumns: [
{ label: '申请时间', prop: 'createTime' },
{ label: '申请人', prop: 'leaseMan' },
{ label: '转出单位', prop: 'backUnitName' },
{ label: '转出工程', prop: 'backProName' },
{ label: '转入单位', prop: 'leaseUnitName' },
{ label: '转入工程', prop: 'leaseProName' },
// { label: '', prop: 'typeName' },
{ label: '状态', prop: 'flowStatus' }
],
//
tableList: []
}
const res = await getDerateList(params)
console.log('🚀 ~ 获取列表 ~ res:', res)
this.tableList = res.rows
this.total = res.total || 0
} catch (error) {
console.log('🚀 ~ 获取列表 ~ error:', error)
this.tableList = []
this.total = 0
}
},
//
selectionChange(val) {
console.log('selectionChange', val)
},
//
handleEdit(row, type) {
console.log('编辑', row)
//
this.$router.push({
name: 'direct-rotation-apply',
query: {
id: row.id,
flowId: row.flowId,
taskId: row.taskId,
type: type === 1 ? 'detail' : 'edit'
}
})
},
//
handleDelete(row) {
console.log('删除', row)
this.$confirm('是否删除该数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const res = await receiveDelete(row.id)
console.log('🚀 ~ 删除 ~ res:', res)
created() {
this.getList()
this.$message({
type: 'success',
message: '删除成功!'
})
})
},
methods: {
//
handleQuery() {
this.getList()
},
//
handleReset() {
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.$refs.queryForm.resetFields()
this.getList()
},
//
async getList() {
console.log('列表-查询', this.queryParams)
try {
const params = {
...this.queryParams,
startTime: this.queryParams.timeRange[0] || '',
endTime: this.queryParams.timeRange[1] || ''
}
const res = await getDerateList(params)
console.log('🚀 ~ 获取列表 ~ res:', res)
this.tableList = res.rows
this.total = res.total || 0
} catch (error) {
console.log('🚀 ~ 获取列表 ~ error:', error)
this.tableList = []
this.total = 0
}
},
//
selectionChange(val) {
console.log('selectionChange', val)
},
//
handleEdit(row, type) {
console.log('编辑', row)
//
this.$router.push({
name: 'direct-rotation-apply',
query: {
id: row.id,
flowId: row.flowId,
taskId: row.taskId,
type: type === 1 ? 'detail' : 'edit',
nodeId: row.nodeId
}
})
},
//
handleDelete(row) {
console.log('删除', row)
this.$confirm('是否删除该数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const res = await receiveDelete(row.id)
console.log('🚀 ~ 删除 ~ res:', res)
this.getList()
this.$message({
type: 'success',
message: '删除成功!'
})
})
}
}
}
}
</script>

View File

@ -167,10 +167,10 @@ export default {
const { recordId, id, typeId, isAccept } = currentAuditing[0]
if (isAccept !== 0) {
this.$modal.msgError('当前已审核,不可重复审核')
return
}
// if (isAccept !== 0) {
// this.$modal.msgError('')
// return
// }
Object.assign(this.auditingParams, {
typeId,
recordId,

View File

@ -124,13 +124,19 @@
</el-form-item>
<el-form-item label="审核角色 / 用户" prop="nodeSignConfig">
<el-radio-group v-model="form.nodeSignConfig">
<el-radio-group v-model="form.nodeSignConfig" @input="onChangeNodeSignConfig">
<el-radio :label="0">角色</el-radio>
<el-radio :label="1">用户</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="角色" prop="configValuesList" v-if="form.nodeSignConfig === 0">
<el-select v-model="form.configValuesList" style="width: 100%" filterable multiple>
<el-select
v-model="form.configValuesList"
style="width: 100%"
filterable
multiple
@change="onRolesChange"
>
<el-option
:key="item.roleId"
:value="item.roleId + ''"
@ -165,7 +171,7 @@
import { listData, getData, delData, addData, updateData } from '@/api/system/dict/data'
import { optionselect as getDictOptionselect, getType } from '@/api/system/dict/type'
import { listRole } from '@/api/system/role'
import { listRole, allocatedUserList } from '@/api/system/role'
import { listUser } from '@/api/system/user'
import {
@ -208,7 +214,8 @@ export default {
nodeSignType: 1, //
nodeSignConfig: 1, //
configValues: '', //
configValuesList: []
configValuesList: [],
roleIds: ''
},
//
rules: {
@ -220,7 +227,8 @@ export default {
},
processName: '',
roleList: [],
userList: []
userList: [],
userIds: []
}
},
created() {
@ -256,7 +264,9 @@ export default {
nodeName: '',
nodeSort: '',
nodeSignType: 0,
nodeSignConfig: 0
nodeSignConfig: 0,
configValuesList: [],
roleIds: ''
}
this.resetForm('form')
},
@ -284,16 +294,22 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
const { nodeName, nodeSort, nodeSignType, nodeSignConfig, configValues, id } = row
const { nodeName, nodeSort, nodeSignType, nodeSignConfig, configValues, id, roleIds } = row
Object.assign(this.form, {
nodeName,
nodeSort,
nodeSignType,
nodeSignConfig,
configValues,
id
id,
roleIds
})
this.form.configValuesList = this.form.configValues.split(',')
if (nodeSignConfig == 0 && this.form.roleIds) {
this.form.configValuesList = this.form.roleIds.split(',')
} else {
this.form.configValuesList = this.form.configValues.split(',')
}
this.title = '修改'
this.open = true
@ -311,7 +327,14 @@ export default {
// return
// }
//
this.form.configValues = this.form.configValuesList.join(',')
// this.form.configValues = this.form.configValuesList.join(',')
if (this.userIds.length > 0) {
this.form.configValues = this.userIds.join(',')
this.form.roleIds = this.form.configValuesList.join(',')
} else {
this.form.configValues = this.form.configValuesList.join(',')
}
const addOrEditForm = JSON.parse(JSON.stringify(this.form))
@ -324,6 +347,7 @@ export default {
const res = await SUBMIT_FUN(addOrEditForm)
if (res.code === 200) {
this.$modal.msgSuccess(`${this.title}成功`)
this.userIds = []
this.getList()
this.open = false
}
@ -342,6 +366,34 @@ export default {
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
//
onChangeNodeSignConfig(val) {
console.log(val, '角色用户切换')
if (val == 0) {
this.form.configValuesList = []
}
},
// change
async onRolesChange(val) {
console.log('val', val)
const newRoles = val.map(e => e * 1)
if (val.length === 0) {
this.userIds = []
} else {
val.forEach(e => {
allocatedUserList({ pageNum: 1, pageSize: 999, roleId: e }).then(res => {
res.rows.forEach(j => {
this.userIds.push(j.userId)
})
})
})
}
// const res = await allocatedUserList(val)
// console.log('res', res)
}
}
}

View File

@ -0,0 +1,265 @@
<template>
<!-- 工程在用检修预警 -->
<div class="app-container">
<el-form v-show="showSearch" :model="queryParams" ref="queryForm" size="small" inline>
<el-form-item label="时间范围" prop="timeRange">
<el-date-picker
v-model="queryParams.timeRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
clearable
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="taskStatus">
<el-select v-model="queryParams.taskStatus" placeholder="请选择状态" clearable>
<el-option
v-for="item in statusOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<!-- 表单按钮 -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">通知</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">
导出数据
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table :data="tableList" fit highlight-current-row style="width: 100%">
<!-- 多选 -->
<el-table-column type="selection" width="55" align="center" @selection-change="selectionChange" />
<el-table-column
type="index"
width="55"
label="序号"
align="center"
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
/>
<el-table-column
v-for="column in tableColumns"
show-overflow-tooltip
:key="column.prop"
:label="column.label"
:prop="column.prop"
align="center"
/>
</el-table>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import printJS from 'print-js'
import { getLeaseTaskList, deleteLeaseTask, getLeaseTask, getCodePDF } from '@/api/business/index'
export default {
data() {
return {
showSearch: true,
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: '', //
taskStatus: '', //
timeRange: [] //
},
total: 0, //
//
tableColumns: [
{ label: '下次检修时间', prop: 'createTime' },
{ label: '机具类型', prop: 'createBy' },
{ label: '规格型号', prop: 'leaseUnit' },
{ label: '设备编码', prop: 'leaseProject' },
{ label: '单位名称', prop: 'maTypeNames' },
{ label: '工程名称', prop: 'agreementCode' },
{ label: '协议号', prop: 'code' },
{ label: '超期时长', prop: 'leasePerson' }
],
//
tableList: [],
dialogTitle: '', //
dialogVisible: false, //
dialogForm: {
proName: '', //
code: '' //
},
dialogColumns: [
{ label: '名称', prop: 'maTypeName', width: '150px' },
{ label: '规格', prop: 'typeName', width: '150px' },
{ label: '单位', prop: 'unitName', width: '60px' },
{ label: '数量', prop: 'preNum', width: '60px' },
{ label: '备注', prop: 'remark', width: '' }
],
dialogList: []
}
},
created() {
this.getList()
},
methods: {
//
handleQuery() {
this.getList()
},
//
handleReset() {
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.$refs.queryForm.resetFields()
this.getList()
},
//
async getList() {
console.log('列表-查询', this.queryParams)
try {
const params = {
...this.queryParams,
startTime: this.queryParams.timeRange[0] || '',
endTime: this.queryParams.timeRange[1] || ''
}
const res = await getLeaseTaskList(params)
console.log('🚀 ~ 获取列表 ~ res:', res)
this.tableList = res.data.rows
this.total = res.data.total || 0
} catch (error) {
console.log('🚀 ~ 获取列表 ~ error:', error)
this.tableList = []
this.total = 0
}
},
//
selectionChange(val) {
console.log('selectionChange', val)
},
handleAdd() {
console.log('领料申请')
this.$router.push({ path: '/business/businessHandling/index' })
},
//
handleEdit(row, type) {
console.log('编辑', row)
let params = {}
if (type === 1) {
params = { type: 'detail', id: row.id }
} else {
params = { type: 'edit', id: row.id }
}
this.$router.push({ path: '/business/businessHandling/index', query: params })
},
//
handleDelete(row) {
console.log('删除', row)
this.$confirm('是否删除该数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const res = await deleteLeaseTask(row.id)
console.log('🚀 ~ 删除 ~ res:', res)
this.getList()
this.$message({
type: 'success',
message: '删除成功!'
})
})
},
//
handleExport() {
try {
let fileName = `数据_${new Date().getTime()}.xLsx`
let url = ''
const params = { ...this.queryParams }
console.log('🚀 ~ 导出 ~ params:', params)
// this.derive(url, params, fileName)
} catch (error) {
console.log('导出数据失败', error)
}
},
//
print() {
printJS({
printable: 'print-content',
type: 'html', //
// targetStyles: ['*'], //
scanStyles: false, //
// css: [
// 'https://unpkg.com/element-ui/lib/theme-chalk/index.css' // Element UI
// ],
maxWidth: '1400'
//
})
},
//
async getDialogContent(row) {
console.log('🚀 ~ getDialogContent ~ row:', row.taskId)
const loading = this.$loading({
lock: true,
text: '加载中...'
})
try {
//
const res = await getLeaseTask(row.id)
console.log('🚀 ~ getDialogContent ~ res:', res)
// PDF
const PDFres = await getCodePDF(row.taskId)
console.log('🚀 ~ getDialogContent ~ res:', PDFres)
this.dialogVisible = true
this.dialogForm = {
...res.data.leaseApplyInfo,
pdfUrl: PDFres.data.url
}
this.dialogList = res.data.leaseApplyDetailsList
loading.close()
} catch (error) {
console.log('🚀 ~ 获取弹框内容 ~ error:', error)
loading.close()
}
},
// 2021-09-01 20210901
handleTimeFormat(time) {
if (time) {
return time.replace(/-/g, '年').replace(/-/g, '月') + '日'
}
return ''
}
}
}
</script>
<style lang="scss" scoped></style>

View File

@ -40,10 +40,10 @@ module.exports = {
// target: `http://192.168.0.244:18580`,//测试
// target: `http://192.168.2.223:18080`,//山
// target: `http://192.168.2.23:18080`,//洪
target: `http://192.168.0.234:18080`, //阮
// target: `http://192.168.0.234:18080`, //阮
// target: `http://192.168.137.1:18080`,//
// target: `http://192.168.0.15:18080`,// 韩傲宇
// target: `http://192.168.2.209:18080`, // 赵福海
target: `http://192.168.0.60:18080`, // 赵福海
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''