Browse Source

优化完善

master
wxc 5 months ago
parent
commit
616e816ae2
  1. 27
      src/components/negative/action-history.vue
  2. 47
      src/views/system/Police.vue

27
src/components/negative/action-history.vue

@ -2,8 +2,7 @@
<div class="flow" style="height: 100%">
<header class="flex between v-center flow-header" ref="flowHeaderRef">
<span>
<span class="second mr-8">总耗时</span>
<span style="color: var(--primary-color)">{{}}</span>
<span class="second mr-8">流程操作</span>
</span>
</header>
<el-scrollbar max-height="calc(100% - 33px)">
@ -13,7 +12,8 @@
<span class="second mr-8">{{ item.crtTime }}</span>
<span class="mr-8">{{ item.departName }}</span>
<span class="mr-8">{{ item.crtName }}</span>
<span class="text-primary">{{ item.actionName }}</span>
<span class="text-primary mr-8 text-bold">{{ item.actionName }}</span>
<span style="color: #9e9e9e; cursor: pointer" @click="handleShowDetai(item)">详情</span>
</div>
<div
class="flow-time"
@ -35,6 +35,17 @@
</div>
</el-scrollbar>
</div>
<el-dialog :title="activeHistory.crtTime + ' ' + (activeHistory.departName || '') + ' ' + activeHistory.crtName + ' ' + activeHistory.actionName" v-model="show">
<div style="min-height: 100px">
<div v-if="activeHistory.json">
<div >{{ activeHistory.json.data?.departName }}</div>
<div >{{ activeHistory.json.data?.completionComment }}</div>
<div>{{ activeHistory.json.data?.requirement }}</div>
<div>{{ activeHistory.json.data?.comments }}</div>
</div>
</div>
</el-dialog>
</template>
<script setup>
import { formatTimeText } from "@/utils/util";
@ -42,6 +53,7 @@ import moment from 'moment'
const actionHistory = inject('actionHistory')
const negative = inject('negative')
const show = ref(false)
function getConsumingTime(crtTime, index) {
if (index === 0) {
@ -49,6 +61,15 @@ function getConsumingTime(crtTime, index) {
}
return moment(crtTime).diff(moment(actionHistory.value[index - 1].crtTime), "seconds")
}
const activeHistory = ref({})
function handleShowDetai(item) {
activeHistory.value = item
if (item.dataJson) {
activeHistory.value.json = JSON.parse(item.dataJson)
}
show.value = true
}
</script>
<style lang="scss" scoped>
.flow {

47
src/views/system/Police.vue

@ -268,7 +268,7 @@
>
<div v-perms="['police:auth']">
<el-tooltip
<!-- <el-tooltip
effect="dark"
content="该警员身份证为空或无用户数据"
placement="top"
@ -282,12 +282,11 @@
>权限设置</el-button
>
</div>
</el-tooltip>
</el-tooltip> -->
<el-button
type="primary"
:type="(!row.idCode || !row.userId) ? '' : 'primary'"
link
@click="handleEditAuth(row)"
v-else
>权限设置</el-button
>
</div>
@ -523,7 +522,7 @@
show-checkbox
>
<template #prefix>
<el-checkbox v-model="selectAll" @change="handleSelectAllChange">全选</el-checkbox>
<el-checkbox @change="handleSelectAllChange" @click.stop>全选</el-checkbox>
</template>
</el-tree-select>
</el-form-item>
@ -771,6 +770,7 @@ import {
updatePoliceAuths,
} from "@/api/system/police";
import { listRole } from "@/api/system/role";
import { addUser } from "@/api/system/user";
import { PersonType } from "@/enums/dictEnums";
import useCatchStore from "@/stores/modules/catch";
import feedback from "@/utils/feedback";
@ -849,6 +849,26 @@ const authShow = ref(false);
const authForm = ref({});
let activeIdCode = "";
function handleEditAuth(row) {
if (!row.idCode ) {
feedback.msgWarning('该警员身份证为空,请先补充身份证');
return
}
if (!row.userId) {
feedback.confirm("该警员没有用户数据,是否先创建用户数据?", "创建用户").then(() => {
addUser({
userName: row.idCode,
nickName: row.name,
userType: 'normal',
status: 1,
password: "123456",
roleIds: []
}).then(() => {
feedback.msgSuccess('用户创建成功,默认密码为:123456');
getList()
})
});
return
}
getPoliceAuths(row.idCode).then((data) => {
activeIdCode = row.idCode;
authShow.value = true;
@ -863,6 +883,23 @@ function authSubmit() {
getList();
});
}
const selectAll = ref(false);
function handleSelectAllChange(value) {
if (value) {
let arr = []
dictProblemSources.forEach(node => {
if (node.children && node.children.length > 0) {
arr = arr.concat(node.children.map(o => o.id))
} else {
arr.push(node.id)
}
})
authForm.value.sources = arr;
} else {
authForm.value.sources = [];
}
}
const mode = ref("add");
const form = ref({

Loading…
Cancel
Save