Browse Source

涉访涉诉--办理临时保存功能

master
buaixuexideshitongxue 2 weeks ago
parent
commit
ebd944392a
  1. 10
      src/api/data/complaintCollection.ts
  2. 75
      src/components/negative/verify-sfss.vue
  3. 106
      src/views/data/ComplaintCollection.vue

10
src/api/data/complaintCollection.ts

@ -106,3 +106,13 @@ export async function exportData(body) {
document.body.removeChild(a) document.body.removeChild(a)
window.URL.revokeObjectURL(url) window.URL.revokeObjectURL(url)
} }
/**
* / JSON
*/
export function saveInvolveJson(body) {
return request.post({
url: `/data/complaintCollection/saveInvolveJson`,
body
});
}

75
src/components/negative/verify-sfss.vue

@ -83,10 +83,6 @@
</div> </div>
</div> </div>
<!-- <div v-if="currentRow.reportFile?.length">-->
<!-- <div class="text-primary mt-10 mb-10">督察报告附件</div>-->
<!-- <file-list :files="currentRow.reportFile"/>-->
<!-- </div>-->
<div v-if="currentRow.thingFiles?.length"> <div v-if="currentRow.thingFiles?.length">
<div class="text-primary mt-10 mb-10">附件</div> <div class="text-primary mt-10 mb-10">附件</div>
@ -259,6 +255,21 @@
:autosize="{ minRows: 4 }" :autosize="{ minRows: 4 }"
/> />
</el-form-item> </el-form-item>
<el-form-item
prop="files"
label-position="top"
>
<template #label>
<h5 class="inline-block mb-0" style="text-align: left">佐证材料</h5>
</template>
<div style="width: 100%" class="mb-10 mt-10">
<file-upload-group
v-model:files="form.files"
:problemSourcesCode="negative.problemSourcesCode"
/>
</div>
<file-list v-model:files="form.files" :removeEnable="true"/>
</el-form-item>
<template <template
v-if=" v-if="
negative.problemSourcesCode === ProblemSources.GJXFPT || negative.problemSourcesCode === ProblemSources.GJXFPT ||
@ -1553,21 +1564,6 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item
prop="files"
label-position="top"
>
<template #label>
<h5 class="inline-block mb-0" style="text-align: left">佐证材料</h5>
</template>
<div style="width: 100%" class="mb-10 mt-10">
<file-upload-group
v-model:files="form.files"
:problemSourcesCode="negative.problemSourcesCode"
/>
</div>
<file-list v-model:files="form.files" :removeEnable="true" />
</el-form-item>
</el-form> </el-form>
</template> </template>
@ -1666,11 +1662,29 @@ const problemIsTrue = computed(() => {
return form.value.checkStatusCode === '1' || form.value.checkStatusCode === '2' || form.value.checkStatusCode === '3'; return form.value.checkStatusCode === '1' || form.value.checkStatusCode === '2' || form.value.checkStatusCode === '3';
}); });
getFormData();
watch(negative, () => { // complaintId currentRow.id
getFormData(); watch(
}); () => negative?.value?.currentRow?.id,
(id) => {
if (id) getFormData()
},
{immediate: true}
)
// <script setup>
watch(
problemIsTrue,
(now, prev) => {
//
if (prev === true && now === false) {
//
form.value.blames = []
form.value.blameLeaders = []
}
},
{ immediate: true }
)
async function getFormData() { async function getFormData() {
const row = negative.value?.currentRow ?? {} const row = negative.value?.currentRow ?? {}
@ -1690,9 +1704,9 @@ async function getFormData() {
rectifyRestrictionDays: negative.value.rectifyRestrictionDays, rectifyRestrictionDays: negative.value.rectifyRestrictionDays,
accountabilityTarget: negative.value.accountabilityTarget, accountabilityTarget: negative.value.accountabilityTarget,
unrectifyReason: negative.value.unrectifyReason, unrectifyReason: negative.value.unrectifyReason,
blames: negative.value.blames, blames: JSON.parse(JSON.stringify(negative.value.blames || [])),
blameLeaders: negative.value.blameLeaders, blameLeaders: JSON.parse(JSON.stringify(negative.value.blameLeaders || [])),
files: negative.value.files || [], files: JSON.parse(JSON.stringify(negative.value.files || [])),
handlePolices: handlePolices:
!negative.value.handlePolices || negative.value.handlePolices.length === 0 !negative.value.handlePolices || negative.value.handlePolices.length === 0
? [{}] ? [{}]
@ -1706,6 +1720,8 @@ async function getFormData() {
handleResult12337: negative.value.handleResult12337, handleResult12337: negative.value.handleResult12337,
handleResult12337Group: negative.value.handleResult12337Group, handleResult12337Group: negative.value.handleResult12337Group,
verifiedIsLeader: negative.value.verifiedIsLeader, verifiedIsLeader: negative.value.verifiedIsLeader,
completionStatus: String(negative.value?.completionStatus ?? row?.completionStatus ?? ''),
publicRecognition: String(negative.value?.publicRecognition ?? row?.publicRecognition ?? ''),
}; };
if (negative.value.blames) { if (negative.value.blames) {
negative.value.blames.forEach((item) => { negative.value.blames.forEach((item) => {
@ -1979,7 +1995,7 @@ function getDictLabel(list: any[] = [], value: any) {
function getData() { function getData() {
return form.value; return JSON.parse(JSON.stringify(toRaw(form.value)))
} }
@ -1999,11 +2015,6 @@ defineExpose({
getData, getData,
}); });
</script> </script>
<style>
.widthClass {
min-width: 50% !important;
}
</style>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-form-item .el-form-item { .el-form-item .el-form-item {
margin-bottom: 18px; margin-bottom: 18px;

106
src/views/data/ComplaintCollection.vue

@ -67,25 +67,15 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="办理情况"> <el-form-item label="状态">
<el-select <el-select
v-model="query.xxx" v-model="query.status"
:disabled="true"
> >
<el-option value="-1" label="全部"/> <el-option value="0" label="未办理"/>
<el-option value="0" label="自办"/> <el-option value="1" label="已办理"/>
<el-option value="1" label="下发"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="办结时间">
<date-time-range-picker-ext
v-model="query.xxxxTime"
:disabled="true"
/>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
@ -394,6 +384,9 @@
<el-button @click="negativeVerifySfssDailog = false">取消</el-button> <el-button @click="negativeVerifySfssDailog = false">取消</el-button>
<el-button type="primary" @click="handleSubmit" :loading="submitLoading" :disabled="submitLoading">提交 <el-button type="primary" @click="handleSubmit" :loading="submitLoading" :disabled="submitLoading">提交
</el-button> </el-button>
<el-button type="primary" @click="handleSaveInvolve" :loading="saveLoading">
临时保存
</el-button>
</div> </div>
</template> </template>
@ -416,7 +409,7 @@ import useCatchStore from "@/stores/modules/catch";
import { import {
addComplaintCollection, addComplaintCollectionBlame, addComplaintCollection, addComplaintCollectionBlame,
delComplaintCollection, exportData, delComplaintCollection, exportData,
getComplaintCollectionPage, handlerData, getComplaintCollectionPage, handlerData, saveInvolveJson,
updateComplaintCollection updateComplaintCollection
} from "@/api/data/complaintCollection.ts"; } from "@/api/data/complaintCollection.ts";
import Complaint_detail from "@/components/data/complaint_detail.vue"; import Complaint_detail from "@/components/data/complaint_detail.vue";
@ -816,10 +809,29 @@ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const handleAction = async (row) => { const handleAction = async (row) => {
submitLoading.value = true submitLoading.value = true
try { try {
// // 1
negativeSfss.value.currentRow = JSON.parse(JSON.stringify(row)) negativeSfss.value.currentRow = JSON.parse(JSON.stringify(row))
// 2
const res = await handlerData({ id: row.id }) const res = await handlerData({ id: row.id })
Object.assign(negativeSfss.value, res?.data ?? res) const data = res?.data ?? res ?? {}
// 3 involveJson
let involveObj = {}
if (data.involveJson) {
try {
involveObj = JSON.parse(data.involveJson)
} catch (e) {
console.error("involveJson 解析失败", e)
}
}
// 4 negative🔥
Object.assign(negativeSfss.value, {
...data,
...involveObj, // blames / blameLeaders / handlePolices
})
negativeVerifySfssDailog.value = true negativeVerifySfssDailog.value = true
} catch (e) { } catch (e) {
console.error("加载办理数据失败", e) console.error("加载办理数据失败", e)
@ -849,6 +861,54 @@ const handleSubmit = async () => {
submitLoading.value = false submitLoading.value = false
} }
} }
//
const saveLoading = ref(false)
const handleSaveInvolve = async () => {
if (saveLoading.value) return
saveLoading.value = true
try {
// el-input / el-select / model
await nextTick()
//
const formData = negativeVerifySfssRef.value.getData()
// + Proxy/
const plain = JSON.parse(JSON.stringify(toRaw(formData)))
const payload = {
blames: plain.blames || [],
blameLeaders: plain.blameLeaders || [],
files: plain.files || [],
}
await saveInvolveJson({
complaintId: plain.complaintId,
//
checkStatusCode: plain.checkStatusCode,
checkStatusName: plain.checkStatusName,
checkStatusDesc: plain.checkStatusDesc,
accountabilityTarget: plain.accountabilityTarget,
involveDepartId: plain.involveDepartId,
involveDepartName: plain.involveDepartName,
completionStatus: plain.completionStatus,
publicRecognition: plain.publicRecognition,
caseNumber: plain.caseNumber,
// JSON
involveJson: JSON.stringify(payload),
})
feedback.msgSuccess("操作成功")
negativeVerifySfssDailog.value = false
getList()
} catch (e) {
console.error(e)
feedback.notifyError("操作失败")
} finally {
saveLoading.value = false
}
}
const negativeSfss = ref({ const negativeSfss = ref({
@ -862,6 +922,18 @@ const negativeSfss = ref({
handlePolices: [{}], handlePolices: [{}],
}); });
provide('negative', negativeSfss) provide('negative', negativeSfss)
watch(negativeVerifySfssDailog, (open) => {
if (!open) {
negativeSfss.value = {
currentRow: {},
blames: [],
blameLeaders: [],
handlePolices: [{}],
files: [],
}
}
})
// endregion // endregion

Loading…
Cancel
Save