|
|
@@ -36,14 +36,14 @@
|
|
|
<el-form-item label="接单状态" prop="status">
|
|
|
<el-switch v-model="form.status" :active-value="1" :inactive-value="0" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="收款账号" prop="paymentNum">
|
|
|
- <el-input v-model="form.paymentNum" placeholder="请输入收款账号" clearable />
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="所属律所" prop="lawFirmId">
|
|
|
<el-select v-model="form.lawFirmId" placeholder="请选择所属律所" filterable>
|
|
|
<el-option v-for="item in lawFirmOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="收款账号" prop="paymentNum">
|
|
|
+ <el-input v-model="form.paymentNum" placeholder="请选择所属律所后自动带出" disabled />
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<template #footer>
|
|
|
@@ -54,7 +54,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, reactive, computed, nextTick } from "vue";
|
|
|
+import { ref, reactive, computed, nextTick, watch } from "vue";
|
|
|
import type { FormInstance } from "element-plus";
|
|
|
|
|
|
interface DialogOptions {
|
|
|
@@ -64,7 +64,7 @@ interface DialogOptions {
|
|
|
}
|
|
|
|
|
|
const props = defineProps<{
|
|
|
- lawFirmOptions: { label: string; value: string | number }[];
|
|
|
+ lawFirmOptions: { label: string; value: string | number; paymentAccount?: string }[];
|
|
|
sceneOptions: any[];
|
|
|
professionalOptions: { label: string | number; value: string | number }[];
|
|
|
}>();
|
|
|
@@ -99,7 +99,7 @@ const rules = reactive({
|
|
|
practiceStartDate: [{ required: true, message: "请输入从业时间", trigger: "blur" }],
|
|
|
// expertiseAreaInfo: [{ required: true, message: "请输入专业领域", trigger: "blur" }],
|
|
|
firstLevelScenario: [{ required: true, message: "请选择法律场景", trigger: "change" }],
|
|
|
- paymentNum: [{ required: true, message: "请输入收款账号", trigger: "blur" }],
|
|
|
+ paymentNum: [{ required: true, message: "请先选择所属律所获取收款账号", trigger: "change" }],
|
|
|
lawFirmId: [{ required: true, message: "请选择所属律所", trigger: "change" }]
|
|
|
});
|
|
|
|
|
|
@@ -132,6 +132,32 @@ const open = (payload: DialogOptions) => {
|
|
|
nextTick(() => formRef.value?.clearValidate());
|
|
|
};
|
|
|
|
|
|
+const syncPaymentAccount = () => {
|
|
|
+ if (!form.lawFirmId) {
|
|
|
+ form.paymentNum = "";
|
|
|
+ formRef.value?.validateField("paymentNum").catch(() => {});
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const target = props.lawFirmOptions.find(option => option.value === form.lawFirmId);
|
|
|
+ form.paymentNum = (target?.paymentAccount || "").trim();
|
|
|
+ formRef.value?.validateField("paymentNum").catch(() => {});
|
|
|
+};
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => form.lawFirmId,
|
|
|
+ () => {
|
|
|
+ syncPaymentAccount();
|
|
|
+ }
|
|
|
+);
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => props.lawFirmOptions,
|
|
|
+ () => {
|
|
|
+ if (form.lawFirmId) syncPaymentAccount();
|
|
|
+ },
|
|
|
+ { deep: true }
|
|
|
+);
|
|
|
+
|
|
|
const emits = defineEmits<{
|
|
|
success: [];
|
|
|
}>();
|