首页心怎催办逻辑

This commit is contained in:
BianLzhaoMin 2024-04-16 18:01:52 +08:00
parent f4068ec667
commit ce1e2d59ff
3 changed files with 154 additions and 250 deletions

View File

@ -10,20 +10,30 @@ export function getToDoList(query) {
}
export function getTaskTypeList(query) {
return request({
url: '/material/todo/getTaskType',
method: 'post',
params: query
})
}
return request({
url: '/material/todo/getTaskType',
method: 'post',
params: query
})
}
// 查询任务详细
export function getTodoDetail(taskId) {
return request({
url: '/material/todo/' + taskId,
method: 'get'
})
}
return request({
url: '/material/todo/' + taskId,
method: 'get'
})
}
/* 获取待办人信息 */
export const getToPersonInfoAp = (data) => {
return request.post('/system/user/urgentProcessingUser', data)
}
/* 催办信息发送 */
export const sendUrgingMessageApi = (data) => {
return request.post('/**', data)
}

View File

@ -82,3 +82,9 @@
.el-range-separator {
box-sizing: content-box;
}
/* 单元格内容为空时 用 - 代替 */
.el-table .el-table__body td .cell:empty::after {
content: '-';
}

View File

@ -1,4 +1,5 @@
<template>
<!-- 首页 -->
<div class="app-container">
<el-form
:model="queryParams"
@ -70,68 +71,7 @@
</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"-->
<!-- v-hasPermi="['system:dict:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['system:dict:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['system:dict:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['system:dict:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-refresh"-->
<!-- size="mini"-->
<!-- @click="handleRefreshCache"-->
<!-- v-hasPermi="['system:dict:remove']"-->
<!-- >刷新缓存</el-button>-->
<!-- </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
<!-- </el-row>-->
<el-table
v-loading="loading"
:data="typeList"
@selection-change="handleSelectionChange"
>
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table v-loading="loading" :data="typeList" border>
<el-table-column
label="序号"
align="center"
@ -142,13 +82,13 @@
label="任务单号"
align="center"
prop="taskCode"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="待办任务"
align="center"
prop="taskType"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column label="待办事件" align="center" prop="taskEvent">
</el-table-column>
@ -156,7 +96,7 @@
label="任务创建人"
align="center"
prop="createName"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="创建时间"
@ -165,7 +105,7 @@
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
<span>{{ parseTime(scope.row.createTime) || '-' }}</span>
</template>
</el-table-column>
<el-table-column
@ -186,18 +126,19 @@
<el-button
size="mini"
type="text"
icon="el-icon-edit"
v-if="row.taskTypeId == 23"
@click="handleUpdate(row.taskTypeId)"
icon="el-icon-edit-outline"
style="color: #e6a23c"
v-if="row.taskTypeId == 29"
@click="
handleUrging(
row.taskTypeId,
row.taskCode,
row.taskEvent,
row.taskId,
)
"
> </el-button
>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['system:dict:remove']"-->
<!-- >删除</el-button>-->
</template>
</el-table-column>
</el-table>
@ -210,47 +151,42 @@
@pagination="getList"
/>
<!-- 添加或修改参数配置对话-->
<!-- 催办弹-->
<el-dialog
:title="title"
:visible.sync="open"
width="500px"
title="催办"
:visible.sync="urgingDialogVisible"
width="60%"
append-to-body
:before-close="handleCloseUrgingDialog"
>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="字典名称" prop="dictName">
<el-input
v-model="form.dictName"
placeholder="请输入字典名称"
/>
</el-form-item>
<el-form-item label="字典类型" prop="dictType">
<el-input
v-model="form.dictType"
placeholder="请输入字典类型"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}</el-radio
<el-form label-width="120px" label-position="right">
<el-form-item label="待办人:">
<el-row>
<el-tag
class="addressee"
:closable="toPersonInfo.length > 1"
type="info"
v-for="(item, v) in toPersonInfo"
:key="v.noticeUser"
@close="handleDeleteToPerson(v)"
>{{ item.v_name }}</el-tag
>
</el-radio-group>
</el-row>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="form.remark"
type="textarea"
placeholder="请输入内容"
></el-input>
<el-form-item label="通知内容:">
<div class="message-info">{{
sendMessageParams.message
}}</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
<el-button
icon="el-icon-position"
size="medium"
type="primary"
@click="submitForm"
> </el-button
>
</div>
</el-dialog>
</div>
@ -258,37 +194,23 @@
<script>
import {
listType,
getType,
delType,
addType,
updateType,
refreshCache,
} from '@/api/system/dict/type'
import { getToDoList, getTaskTypeList } from '@/api/index'
getToDoList,
getTaskTypeList,
getToPersonInfoAp,
sendUrgingMessageApi,
} from '@/api/index'
export default {
name: 'Dict',
dicts: ['sys_normal_disable'],
name: 'myIndex',
data() {
return {
//
loading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
typeList: [],
//
title: '',
//
open: false,
//
dateRange: [],
taskTypeList: [],
@ -300,25 +222,6 @@
taskCode: '',
taskTypeId: '',
},
//
form: {},
//
rules: {
dictName: [
{
required: true,
message: '字典名称不能为空',
trigger: 'blur',
},
],
dictType: [
{
required: true,
message: '字典类型不能为空',
trigger: 'blur',
},
],
},
/* 列表查看跳转的路由地址 */
previewRouterList: [
@ -343,6 +246,18 @@
routerPath: 'repairTest/repair/repair',
},
],
/* 催办弹框 */
urgingDialogVisible: false,
/* 待办人信息 */
toPersonInfo: [],
/* 发送参数 */
sendMessageParams: {
taskId: '',
message: '',
//
bmNoticeInfoList: [],
},
}
},
created() {
@ -372,22 +287,6 @@
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: '0',
remark: undefined,
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
@ -399,81 +298,6 @@
this.resetForm('queryForm')
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加字典类型'
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.dictId)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
// this.reset();
// const dictId = row.dictId || this.ids
// getType(dictId).then(response => {
// this.form = response.data;
// this.open = true;
// this.title = "";
// });
},
/** 提交按钮 */
submitForm: function () {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addType(this.form).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids
this.$modal
.confirm(
'是否确认删除字典编号为"' + dictIds + '"的数据项?',
)
.then(function () {
return delType(dictIds)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download(
'system/dict/type/export',
{
...this.queryParams,
},
`type_${new Date().getTime()}.xlsx`,
)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess('刷新成功')
this.$store.dispatch('dict/cleanDict')
})
},
/**
* 列表查看操作===========================================================
@ -489,6 +313,70 @@
},
})
},
/* 催办按钮 */
async handleUrging(id, taskCode, taskStatus, taskId) {
/* 先获取催办人信息 */
const { data: res } = await getToPersonInfoAp({
taskStatus,
})
res.map((e) => {
if (e.phonenumber) {
this.toPersonInfo.push({
noticeUser: e.userId,
phone: e.phonenumber,
modelName: '领料催办',
companyId: e.companyId,
v_name: e.nickName,
})
}
})
this.sendMessageParams.message = `宁夏送变电工程有限公司提示:您有一条任务单号为 ${taskCode} 的待办任务未处理,请及时处理。`
this.sendMessageParams.taskId = taskId
this.urgingDialogVisible = true
},
/* 取消其中某一个待办人 */
handleDeleteToPerson(v) {
this.toPersonInfo.splice(v, 1)
},
/* 催办发送 */
async submitForm() {
this.sendMessageParams.bmNoticeInfoList = this.toPersonInfo
const { data: res } = await sendUrgingMessageApi(
this.sendMessageParams,
)
if (res.code == 200) {
this.$message.success('发送成功!')
this.toPersonInfo = []
this.urgingDialogVisible = false
} else {
this.$message.error(res.msg)
}
},
/* 弹框右上角关闭按钮 */
handleCloseUrgingDialog() {
this.toPersonInfo = []
this.urgingDialogVisible = false
},
},
}
</script>
<style scoped>
.message-info {
height: 100px;
padding: 0 10px;
border: 1px solid #ccc;
letter-spacing: 1px;
border-radius: 3px;
}
.addressee {
margin-left: 3px;
}
</style>