|
@@ -38,6 +38,7 @@
|
|
|
<Sign
|
|
<Sign
|
|
|
v-if="isReviewer || currentAgreement.partyASign" :model-value="currentAgreement.partyASign ?? ''"
|
|
v-if="isReviewer || currentAgreement.partyASign" :model-value="currentAgreement.partyASign ?? ''"
|
|
|
:disabled="!isReviewer"
|
|
:disabled="!isReviewer"
|
|
|
|
|
+ :uploadCo="signUploadCo"
|
|
|
@update:model-value="(v) => { currentAgreement.partyASign = v; validate() }"
|
|
@update:model-value="(v) => { currentAgreement.partyASign = v; validate() }"
|
|
|
/>
|
|
/>
|
|
|
<span v-else>待审核人员签名</span>
|
|
<span v-else>待审核人员签名</span>
|
|
@@ -50,9 +51,10 @@
|
|
|
|
|
|
|
|
<a-typography-paragraph strong>乙方:{{ currentAgreement.partyB }}(签名)</a-typography-paragraph>
|
|
<a-typography-paragraph strong>乙方:{{ currentAgreement.partyB }}(签名)</a-typography-paragraph>
|
|
|
<a-form-item label="乙方签名" name="partyBSign">
|
|
<a-form-item label="乙方签名" name="partyBSign">
|
|
|
- <Sign
|
|
|
|
|
|
|
+ <Sign
|
|
|
:model-value="currentAgreement.partyBSign ?? ''"
|
|
:model-value="currentAgreement.partyBSign ?? ''"
|
|
|
:readonly="isReviewer"
|
|
:readonly="isReviewer"
|
|
|
|
|
+ :uploadCo="signUploadCo"
|
|
|
@update:model-value="(v) => { currentAgreement.partyBSign = v; validate() }"
|
|
@update:model-value="(v) => { currentAgreement.partyBSign = v; validate() }"
|
|
|
/>
|
|
/>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -87,8 +89,9 @@ import AgreementBodyMunicipal from './AgreementBodyMunicipal.vue';
|
|
|
import AgreementBody from './AgreementBody.vue';
|
|
import AgreementBody from './AgreementBody.vue';
|
|
|
import { Sign } from '@imengyu/vue-dynamic-form-rich';
|
|
import { Sign } from '@imengyu/vue-dynamic-form-rich';
|
|
|
import { computed, ref } from 'vue';
|
|
import { computed, ref } from 'vue';
|
|
|
-import type { Rules } from 'async-validator';
|
|
|
|
|
import type { FormInstance } from 'ant-design-vue';
|
|
import type { FormInstance } from 'ant-design-vue';
|
|
|
|
|
+import { useImageSimpleUploadCo } from '@/common/upload/ImageUploadCo.ts';
|
|
|
|
|
+import type { Rules } from 'async-validator';
|
|
|
|
|
|
|
|
const props = withDefaults(defineProps<{
|
|
const props = withDefaults(defineProps<{
|
|
|
currentAgreement: AgreementDetail;
|
|
currentAgreement: AgreementDetail;
|
|
@@ -112,6 +115,8 @@ const formRef = ref<FormInstance | null>(null);
|
|
|
const CN_PHONE = /^1[3-9]\d{9}$/;
|
|
const CN_PHONE = /^1[3-9]\d{9}$/;
|
|
|
const CN_PHONE_RE = /^(1\d{10}|0\d{2,3}-\d{7,8})$/;
|
|
const CN_PHONE_RE = /^(1\d{10}|0\d{2,3}-\d{7,8})$/;
|
|
|
|
|
|
|
|
|
|
+const signUploadCo = useImageSimpleUploadCo();
|
|
|
|
|
+
|
|
|
const formRules = computed<Rules>(() => {
|
|
const formRules = computed<Rules>(() => {
|
|
|
const rules: Rules = {
|
|
const rules: Rules = {
|
|
|
partyA: [
|
|
partyA: [
|
|
@@ -123,12 +128,10 @@ const formRules = computed<Rules>(() => {
|
|
|
partyAMobile: [
|
|
partyAMobile: [
|
|
|
{
|
|
{
|
|
|
required: props.isReviewer,
|
|
required: props.isReviewer,
|
|
|
- validator(_rule, value, callback) {
|
|
|
|
|
|
|
+ asyncValidator: async (_rule, value) => {
|
|
|
const s = value != null ? String(value).trim() : '';
|
|
const s = value != null ? String(value).trim() : '';
|
|
|
if (props.isReviewer && !CN_PHONE_RE.test(s))
|
|
if (props.isReviewer && !CN_PHONE_RE.test(s))
|
|
|
- callback(new Error('请输入正确的手机号或座机号'));
|
|
|
|
|
- else
|
|
|
|
|
- callback();
|
|
|
|
|
|
|
+ throw new Error('请输入正确的手机号或座机号');
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
@@ -143,23 +146,19 @@ const formRules = computed<Rules>(() => {
|
|
|
partyASign: [
|
|
partyASign: [
|
|
|
{
|
|
{
|
|
|
required: props.isReviewer,
|
|
required: props.isReviewer,
|
|
|
- validator(_rule, value, callback) {
|
|
|
|
|
|
|
+ asyncValidator: async (_rule, value) => {
|
|
|
const s = typeof value === 'string' ? value.trim() : '';
|
|
const s = typeof value === 'string' ? value.trim() : '';
|
|
|
if (!s && props.isReviewer)
|
|
if (!s && props.isReviewer)
|
|
|
- callback(new Error('请完成甲方签名'));
|
|
|
|
|
- else
|
|
|
|
|
- callback();
|
|
|
|
|
|
|
+ throw new Error('请完成甲方签名');
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
partyBSign: [
|
|
partyBSign: [
|
|
|
{
|
|
{
|
|
|
- validator(_rule, value, callback) {
|
|
|
|
|
|
|
+ asyncValidator: async (_rule, value) => {
|
|
|
const s = typeof value === 'string' ? value.trim() : '';
|
|
const s = typeof value === 'string' ? value.trim() : '';
|
|
|
if (!s)
|
|
if (!s)
|
|
|
- callback(new Error('请完成乙方签名'));
|
|
|
|
|
- else
|
|
|
|
|
- callback();
|
|
|
|
|
|
|
+ throw new Error('请完成乙方签名');
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
@@ -171,24 +170,20 @@ const formRules = computed<Rules>(() => {
|
|
|
mobile: [
|
|
mobile: [
|
|
|
{ required: true, message: '请填写乙方联系电话' },
|
|
{ required: true, message: '请填写乙方联系电话' },
|
|
|
{
|
|
{
|
|
|
- validator(_rule, value, callback) {
|
|
|
|
|
|
|
+ asyncValidator : async (_rule, value) => {
|
|
|
const s = value != null ? String(value).trim() : '';
|
|
const s = value != null ? String(value).trim() : '';
|
|
|
if (!props.isReviewer && !CN_PHONE_RE.test(s))
|
|
if (!props.isReviewer && !CN_PHONE_RE.test(s))
|
|
|
- callback(new Error('请输入正确的手机号或座机号'));
|
|
|
|
|
- else
|
|
|
|
|
- callback();
|
|
|
|
|
|
|
+ throw new Error('请输入正确的手机号或座机号');
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
contactMobile: [
|
|
contactMobile: [
|
|
|
{
|
|
{
|
|
|
required: false,
|
|
required: false,
|
|
|
- validator(_rule, value, callback) {
|
|
|
|
|
|
|
+ asyncValidator: async (_rule, value) => {
|
|
|
const s = value != null ? String(value).trim() : '';
|
|
const s = value != null ? String(value).trim() : '';
|
|
|
if (s && !CN_PHONE.test(s))
|
|
if (s && !CN_PHONE.test(s))
|
|
|
- callback(new Error('请输入正确的手机号'));
|
|
|
|
|
- else
|
|
|
|
|
- callback();
|
|
|
|
|
|
|
+ throw new Error('请输入正确的手机号');
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|