|
@@ -22,9 +22,10 @@
|
|
|
<custom-desc v-model="form" :fields="statusFields"></custom-desc>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <custom-form v-if="form.source === 'sector'" v-model="contactsForm" :fields="contactsFields" :rules="contactsRules" style="margin: 10px 0" :useSave="false"></custom-form>
|
|
|
<el-row style="text-align: center; padding-top: 20px" justify="center">
|
|
|
<el-col :span="6" style="">
|
|
|
- <el-button type="success" @click="exam('1')">{{ $t('common.agree') }}</el-button>
|
|
|
+ <el-button type="success" @click="exam('1')" :disabled="getAgreeDisabled">{{ $t('common.agree') }}</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="6" style="text-align: center">
|
|
|
<el-button type="danger" @click="exam('-1')">{{ $t('common.refuse') }}</el-button>
|
|
@@ -65,6 +66,15 @@ const toReset = async () => {
|
|
|
searchForm.value = {}
|
|
|
await search()
|
|
|
}
|
|
|
+const contactsForm = ref({})
|
|
|
+const contactsRules = ref({
|
|
|
+ person: [{ required: true, message: '请填写联系人', trigger: 'blur' }],
|
|
|
+ phone: [{ required: true, message: '请填写联系电话', trigger: 'blur' }]
|
|
|
+})
|
|
|
+const contactsFields = ref([
|
|
|
+ { label: '联系人', model: 'person' },
|
|
|
+ { label: '联系电话', model: 'phone' }
|
|
|
+])
|
|
|
const toExam = (data) => {
|
|
|
form.value = cloneDeep(data)
|
|
|
dialog.value = { type: '2', show: true, title: t('pages.contactApply.examTitle') }
|
|
@@ -72,7 +82,17 @@ const toExam = (data) => {
|
|
|
const toClose = () => {
|
|
|
form.value = {}
|
|
|
dialog.value = { show: false }
|
|
|
+ contactsForm.value = {}
|
|
|
}
|
|
|
+const getAgreeDisabled = computed(() => {
|
|
|
+ const source = get(form.value, 'source')
|
|
|
+ // 非产业集群,不需要限制
|
|
|
+ if (source !== 'sector') return false
|
|
|
+ const contacts = contactsForm.value
|
|
|
+ const person = get(contacts, 'person')
|
|
|
+ const phone = get(contacts, 'phone')
|
|
|
+ return !(person && phone)
|
|
|
+})
|
|
|
// #endregion
|
|
|
|
|
|
// #region 表单
|
|
@@ -84,7 +104,8 @@ const statusFields = ref([
|
|
|
{ label: t('pages.contactApply.source_name'), model: 'source_name' }
|
|
|
])
|
|
|
const exam = async (status) => {
|
|
|
- const data = { id: get(form, 'value.id'), status }
|
|
|
+ const contacts = cloneDeep(contactsForm.value)
|
|
|
+ const data = { id: get(form, 'value.id'), status, contacts }
|
|
|
const res = await store.examine(data)
|
|
|
if ($checkRes(res, true)) {
|
|
|
search({ skip, limit })
|