Browse Source

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

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

12
src/api/data/complaintCollection.ts

@ -105,4 +105,14 @@ export async function exportData(body) {
document.body.removeChild(a)
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 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 class="text-primary mt-10 mb-10">附件</div>
@ -259,6 +255,21 @@
:autosize="{ minRows: 4 }"
/>
</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
v-if="
negative.problemSourcesCode === ProblemSources.GJXFPT ||
@ -1553,21 +1564,6 @@
</div>
</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>
</template>
@ -1666,11 +1662,29 @@ const problemIsTrue = computed(() => {
return form.value.checkStatusCode === '1' || form.value.checkStatusCode === '2' || form.value.checkStatusCode === '3';
});
getFormData();
watch(negative, () => {
getFormData();
});
// complaintId currentRow.id
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() {
const row = negative.value?.currentRow ?? {}
@ -1690,9 +1704,9 @@ async function getFormData() {
rectifyRestrictionDays: negative.value.rectifyRestrictionDays,
accountabilityTarget: negative.value.accountabilityTarget,
unrectifyReason: negative.value.unrectifyReason,
blames: negative.value.blames,
blameLeaders: negative.value.blameLeaders,
files: negative.value.files || [],
blames: JSON.parse(JSON.stringify(negative.value.blames || [])),
blameLeaders: JSON.parse(JSON.stringify(negative.value.blameLeaders || [])),
files: JSON.parse(JSON.stringify(negative.value.files || [])),
handlePolices:
!negative.value.handlePolices || negative.value.handlePolices.length === 0
? [{}]
@ -1706,6 +1720,8 @@ async function getFormData() {
handleResult12337: negative.value.handleResult12337,
handleResult12337Group: negative.value.handleResult12337Group,
verifiedIsLeader: negative.value.verifiedIsLeader,
completionStatus: String(negative.value?.completionStatus ?? row?.completionStatus ?? ''),
publicRecognition: String(negative.value?.publicRecognition ?? row?.publicRecognition ?? ''),
};
if (negative.value.blames) {
negative.value.blames.forEach((item) => {
@ -1979,7 +1995,7 @@ function getDictLabel(list: any[] = [], value: any) {
function getData() {
return form.value;
return JSON.parse(JSON.stringify(toRaw(form.value)))
}
@ -1999,11 +2015,6 @@ defineExpose({
getData,
});
</script>
<style>
.widthClass {
min-width: 50% !important;
}
</style>
<style lang="scss" scoped>
.el-form-item .el-form-item {
margin-bottom: 18px;

108
src/views/data/ComplaintCollection.vue

@ -67,25 +67,15 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="办理情况">
<el-form-item label="状态">
<el-select
v-model="query.xxx"
:disabled="true"
v-model="query.status"
>
<el-option value="-1" label="全部"/>
<el-option value="0" label="自办"/>
<el-option value="1" label="下发"/>
<el-option value="0" label="未办理"/>
<el-option value="1" label="已办理"/>
</el-select>
</el-form-item>
</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-col :span="6">
@ -394,6 +384,9 @@
<el-button @click="negativeVerifySfssDailog = false">取消</el-button>
<el-button type="primary" @click="handleSubmit" :loading="submitLoading" :disabled="submitLoading">提交
</el-button>
<el-button type="primary" @click="handleSaveInvolve" :loading="saveLoading">
临时保存
</el-button>
</div>
</template>
@ -416,7 +409,7 @@ import useCatchStore from "@/stores/modules/catch";
import {
addComplaintCollection, addComplaintCollectionBlame,
delComplaintCollection, exportData,
getComplaintCollectionPage, handlerData,
getComplaintCollectionPage, handlerData, saveInvolveJson,
updateComplaintCollection
} from "@/api/data/complaintCollection.ts";
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) => {
submitLoading.value = true
try {
//
// 1
negativeSfss.value.currentRow = JSON.parse(JSON.stringify(row))
const res = await handlerData({id: row.id})
Object.assign(negativeSfss.value, res?.data ?? res)
// 2
const res = await handlerData({ id: row.id })
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
} catch (e) {
console.error("加载办理数据失败", e)
@ -849,6 +861,54 @@ const handleSubmit = async () => {
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({
@ -862,6 +922,18 @@ const negativeSfss = ref({
handlePolices: [{}],
});
provide('negative', negativeSfss)
watch(negativeVerifySfssDailog, (open) => {
if (!open) {
negativeSfss.value = {
currentRow: {},
blames: [],
blameLeaders: [],
handlePolices: [{}],
files: [],
}
}
})
// endregion

Loading…
Cancel
Save