Browse Source

241220

main
wxc 11 months ago
parent
commit
cac7625da7
  1. 8
      src/api/work/negative.ts
  2. 166
      src/components/negative/dialog.vue
  3. 18
      src/components/negative/verify.vue
  4. 6
      src/permission.ts
  5. 2
      src/views/sensitivePerception/RiskPersonnel.vue
  6. 14
      src/views/work/Query.vue

8
src/api/work/negative.ts

@ -73,3 +73,11 @@ export function transferTodo(id) {
url: `/negative/${id}/transferTodo`
});
}
export function spotCheckNegative(id, body) {
return request.post({
url: `/negative/${id}/spotCheck`,
body
});
}

166
src/components/negative/dialog.vue

@ -6,6 +6,7 @@
class="dialog-header-nopadding"
style="--el-dialog-padding-primary: 10px; margin-bottom: 2vh"
:lock-scroll="false"
ref="dialogRef"
>
<template #header="{ close }">
<header class="flex between v-center dialog-header">
@ -91,7 +92,7 @@
getDictLable(
dict.timeLimit,
negative.timeLimit
) || '/'
) || "/"
}}</span>
</div>
<div class="col col-24" style="--label-width: 60px">
@ -100,7 +101,7 @@
getDictLable(
dict.hostLevel,
negative.hostLevel
) || '/'
) || "/"
}}</span>
</div>
<div class="col col-24" style="--label-width: 60px">
@ -109,7 +110,7 @@
getDictLable(
dict.approvalFlow,
negative.approvalFlow
) || '/'
) || "/"
}}</span>
</div>
</div>
@ -135,6 +136,22 @@
}}</span>
</div>
</div>
<template v-if="approves.length">
<negative-approve-description />
</template>
<template
v-if="
(components.indexOf('negative-verify') > -1 &&
!disabled) ||
verifyEditFlag
"
>
<negative-verify
ref="componentRef"
@submit="handleSubmitExecute"
/>
</template>
<template
v-if="
components.indexOf(
@ -144,6 +161,28 @@
>
<negative-verify-description />
</template>
<div
class="mb-4 mt-8 flex end"
v-if="spotCheckEditFlag"
>
<el-button
size="small"
v-if="verifyEditFlag"
@click="verifyEditFlag = false"
>取消</el-button
>
<el-button
type="primary"
plain
size="small"
@click="handleUpdateVerify"
>{{
verifyEditFlag
? "保存核查情况"
: "修改核查情况"
}}</el-button
>
</div>
<template v-if="!disabled">
<template
v-if="
@ -153,20 +192,6 @@
>
<negative-distribute ref="componentRef" />
</template>
<template
v-if="
components.indexOf('negative-verify') >
-1 || verifyEditFlag
"
>
<negative-verify
ref="componentRef"
@submit="handleSubmitExecute"
/>
</template>
</template>
<template v-if="approves.length">
<negative-approve-description />
</template>
<negative-countersign-description />
<template
@ -179,6 +204,50 @@
@submit="handleSubmitExecute"
/>
</template>
<el-form
class="mt-20"
:model="formData"
ref="formRef"
v-if="spotCheckEditFlag"
>
<el-form-item
label="抽检结果"
prop="spotCheckResult"
:rules="{
required: true,
message: '请选择抽检结果',
trigger: ['blur'],
}"
>
<el-radio-group
v-model="formData.spotCheckResult"
>
<el-radio value="1" size="large" border
>合格</el-radio
>
<el-radio value="0" size="large" border
>不合格</el-radio
>
</el-radio-group>
</el-form-item>
<el-form-item
label="抽检情况"
prop="spotCheckDesc"
:rules="{
required: true,
message: '请选择抽检情况',
trigger: ['blur'],
}"
>
<el-input
type="textarea"
:autosize="{ minRows: 5 }"
placeholder="请输入"
v-model="formData.spotCheckDesc"
/>
</el-form-item>
</el-form>
</el-scrollbar>
</el-col>
</el-row>
@ -187,6 +256,13 @@
<div style="min-height: 40px">
<!-- <el-button type="primary" plain size="large">打印</el-button> -->
</div>
<el-button
type="primary"
size="large"
@click="handleSubmitSpotCheck"
v-if="spotCheckEditFlag"
>保存抽检结果</el-button
>
<div v-if="!disabled">
<el-button
size="large"
@ -260,7 +336,11 @@ import {
FlowNodeEnum,
ProcessingStatus,
} from "@/enums/flowEnums";
import { getNegativeDetails, negativeExecute } from "@/api/work/negative";
import {
getNegativeDetails,
negativeExecute,
spotCheckNegative,
} from "@/api/work/negative";
import { addFav, delFav } from "@/api/work/fav";
import feedback from "@/utils/feedback";
import { getComponents } from "@/utils/flow";
@ -315,6 +395,7 @@ watch(
() => {
getDetails();
verifyEditFlag.value = false;
formData.value = {};
}
);
@ -423,6 +504,55 @@ function handleFav() {
}
isFav.value = !isFav.value;
}
const spotCheckEditFlag = ref(false);
function spotCheck() {
spotCheckEditFlag.value = true;
}
const dialogRef = ref();
watch(
() => dialogRef.value?.visible,
(val) => {
if (!val) {
spotCheckEditFlag.value = false;
}
}
);
const formData = ref({});
const formRef = ref();
async function handleSubmitSpotCheck() {
try {
await formRef.value.validate();
} catch (e) {
feedback.msgWarning(e.message || "请检查输入项");
throw e;
}
await spotCheckNegative(props.id, formData.value);
feedback.msgSuccess("抽查成功!");
emit("change");
emit("close");
formData.value = {};
}
async function handleUpdateVerify() {
if (verifyEditFlag.value) {
try {
const data = await componentRef.value.validate();
formData.value.verifyData = data;
} catch (e) {
feedback.msgWarning(e.message || "请检查输入项");
throw e;
}
}
verifyEditFlag.value = !verifyEditFlag.value;
}
defineExpose({
spotCheck,
});
</script>
<style lang="scss" scoped>
.dialog-header {

18
src/components/negative/verify.vue

@ -126,6 +126,7 @@
</el-form-item>
</el-col>
</el-row>
<el-form-item
label="问题核查情况"
prop="checkStatusDesc"
@ -142,6 +143,23 @@
:autosize="{ minRows: 4 }"
/>
</el-form-item>
<el-form-item
label="未整改原因"
prop="unrectifyReason"
:rules="{
required: true,
message: '请输入未整改原因',
trigger: ['blur'],
}"
v-if="form.isRectifyCode === '0' || form.isRectifyCode === '2'"
>
<el-input
type="textarea"
placeholder="请输入未整改原因"
v-model="form.unrectifyReason"
:autosize="{ minRows: 4 }"
/>
</el-form-item>
<el-form-item
label="问题整改情况"
prop="rectifyDesc"

6
src/permission.ts

@ -14,7 +14,7 @@ import 'nprogress/nprogress.css'
// NProgress配置
NProgress.configure({ showSpinner: false })
// 免登录白名单
const whiteList: string[] = [PageEnum.LOGIN, '/support']
const whiteList: string[] = [PageEnum.LOGIN, '/support', '/401']
router.beforeEach(async (to, from, next) => {
// 开始 Progress Bar
NProgress.start()
@ -31,6 +31,10 @@ router.beforeEach(async (to, from, next) => {
if (!Object.keys(userStore.user).length) {
await userStore.getUserInfo()
const routes = userStore.routes
if (routes.length === 0) {
next('/401')
return
}
const routeName = findFirstValidRoute(routes)
INDEX_ROUTE.redirect = { name: routeName }
router.addRoute(INDEX_ROUTE)

2
src/views/sensitivePerception/RiskPersonnel.vue

@ -779,7 +779,7 @@ function getScoreType(score) {
return "red";
}
if (score >= 60) {
return "red";
return "orange";
}
if (score >= 40) {
return "yellow";

14
src/views/work/Query.vue

@ -184,7 +184,7 @@
<el-option label="未超时" :value="false" />
<el-option label="已超时" :value="true" />
</el-select>
<div class="flex gap-4">
<div class="flex gap-4" style="height: 32px">
<el-select
v-model="query.responderKey"
style="width: 90px"
@ -451,6 +451,7 @@
row.processingStatus ===
ProcessingStatus.COMPLETED
"
@click="handleSpotCheck(row)"
>抽查</el-button
>
</template>
@ -477,6 +478,7 @@
v-model="show"
:id="activeNegativeId"
@close="show = false"
ref="negativeDialogRef"
/>
<el-dialog v-model="editShow" title="问题编辑" width="900px">
@ -754,6 +756,7 @@
>
</footer>
</el-dialog>
</template>
<script setup>
import moment from "moment";
@ -924,6 +927,15 @@ async function handleTransferTodo(row) {
feedback.msgSuccess("已成功转为待办,请到我的待办查看");
getList();
}
const negativeDialogRef = ref()
function handleSpotCheck(row) {
activeNegativeId.value = row.id;
show.value = true;
negativeDialogRef.value.spotCheck()
}
</script>
<style lang="scss" scoped>
</style>
Loading…
Cancel
Save