Browse Source

fix: 删除多余 经办人字段

feature/tsjb-1.0
wxc 6 days ago
parent
commit
ca4f6bb8fa
  1. 76
      src/components/negative/verify-sfss.vue

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

@ -91,45 +91,6 @@
> >
</el-row> </el-row>
<el-form-item
v-if="showPetitionFields"
prop="handlePolices"
label="经办人"
:rules="[{ required: true, validator: validateHandlePolices }]"
>
<div
v-for="(item, index) in form.handlePolices"
:key="index"
class="mb-8 flex gap v-center"
style="width: 100%"
>
<police-select
:depart-id="negative?.handleSecondDepartId"
v-model="item.empNo"
@change="
(police) => {
item.name = police.name;
item.mobile = police.mobile;
}
"
/>
<el-input v-model="item.mobile" placeholder="联系方式" style="width: 240px" />
<el-button
v-if="index === 0"
plain
type="primary"
@click="form.handlePolices.push({ name: '', empNo: '', mobile: '' })"
>新增经办人</el-button
>
<el-button
v-else
plain
type="danger"
@click="form.handlePolices.splice(index, 1)"
>删除</el-button
>
</div>
</el-form-item>
<template <template
v-if=" v-if="
sourceNegative.problemSourcesCode === ProblemSources.GJXFPT || sourceNegative.problemSourcesCode === ProblemSources.GJXFPT ||
@ -193,12 +154,6 @@ import { ProblemSources } from "@/enums/dictEnums";
import useCatchStore from "@/stores/modules/catch"; import useCatchStore from "@/stores/modules/catch";
import NegativeVerify from "@/components/negative/verify.vue"; import NegativeVerify from "@/components/negative/verify.vue";
type HandlePolice = {
name: string;
empNo: string;
mobile: string;
};
const STAGE_INITIAL = "0"; const STAGE_INITIAL = "0";
const STAGE_COMPLETION = "1"; const STAGE_COMPLETION = "1";
type ProcessingStage = typeof STAGE_INITIAL | typeof STAGE_COMPLETION; type ProcessingStage = typeof STAGE_INITIAL | typeof STAGE_COMPLETION;
@ -219,7 +174,6 @@ type VerifySfssForm = {
initVerdict: string; initVerdict: string;
completionStatus: string; completionStatus: string;
publicRecognition: string; publicRecognition: string;
handlePolices: HandlePolice[];
files: any[]; files: any[];
blames: any[]; blames: any[];
blameLeaders: any[]; blameLeaders: any[];
@ -251,12 +205,6 @@ const sourceNegative = inject<any>("negative");
const formRef = ref(); const formRef = ref();
const negativeVerifyRef = ref<InstanceType<typeof NegativeVerify>>(); const negativeVerifyRef = ref<InstanceType<typeof NegativeVerify>>();
const createHandlePolice = (): HandlePolice => ({
name: "",
empNo: "",
mobile: "",
});
const currentRow = computed(() => sourceNegative?.value?.currentRow || {}); const currentRow = computed(() => sourceNegative?.value?.currentRow || {});
const createForm = (): VerifySfssForm => const createForm = (): VerifySfssForm =>
@ -277,7 +225,6 @@ const createForm = (): VerifySfssForm =>
initVerdict: "", initVerdict: "",
completionStatus: currentRow.completionStatus, completionStatus: currentRow.completionStatus,
publicRecognition: currentRow.publicRecognition, publicRecognition: currentRow.publicRecognition,
handlePolices: [createHandlePolice()],
files: [], files: [],
blames: [], blames: [],
blameLeaders: [], blameLeaders: [],
@ -350,11 +297,6 @@ function getStageBySource(row: Record<string, any>) {
: STAGE_INITIAL; : STAGE_INITIAL;
} }
function getHandlePolices() {
const handlePolices = clone(sourceNegative?.value?.handlePolices || []);
return handlePolices.length ? handlePolices : [createHandlePolice()];
}
function syncFormData() { function syncFormData() {
const row = currentRow.value || {}; const row = currentRow.value || {};
const fallbackInvolveDepartId = const fallbackInvolveDepartId =
@ -393,7 +335,6 @@ function syncFormData() {
publicRecognition: String( publicRecognition: String(
sourceNegative?.value?.publicRecognition ?? row?.publicRecognition ?? "" sourceNegative?.value?.publicRecognition ?? row?.publicRecognition ?? ""
), ),
handlePolices: getHandlePolices(),
files: clone(sourceNegative?.value?.files || []), files: clone(sourceNegative?.value?.files || []),
blames: clone(sourceNegative?.value?.blames || []), blames: clone(sourceNegative?.value?.blames || []),
blameLeaders: clone(sourceNegative?.value?.blameLeaders || []), blameLeaders: clone(sourceNegative?.value?.blameLeaders || []),
@ -431,29 +372,12 @@ function mergeVerifyForm(verifyForm: Record<string, any> = {}) {
complaintId, complaintId,
involveDepartId, involveDepartId,
involveDepartName, involveDepartName,
handlePolices: clone(baseForm.handlePolices),
files: clone(verifyForm.files || baseForm.files || []), files: clone(verifyForm.files || baseForm.files || []),
blames: clone(verifyForm.blames || baseForm.blames || []), blames: clone(verifyForm.blames || baseForm.blames || []),
blameLeaders: clone(verifyForm.blameLeaders || baseForm.blameLeaders || []), blameLeaders: clone(verifyForm.blameLeaders || baseForm.blameLeaders || []),
}; };
} }
function validateHandlePolices(
_: unknown,
value: HandlePolice[],
callback: (error?: Error) => void
) {
if (!value?.length || !value[0]?.name) {
callback(new Error("请选择经办人"));
return;
}
if (!value[0]?.mobile) {
callback(new Error("请输入经办人联系方式"));
return;
}
callback();
}
async function validate() { async function validate() {
await formRef.value?.validate(); await formRef.value?.validate();
const verifyData = await validateNegativeVerify(); const verifyData = await validateNegativeVerify();

Loading…
Cancel
Save