Bladeren bron

联系方式申请审核改为全依靠前端填写内容

lrf 8 maanden geleden
bovenliggende
commit
d7ba778c25
2 gewijzigde bestanden met toevoegingen van 14 en 6 verwijderingen
  1. 6 1
      src/store/api/user/contactApply.js
  2. 8 5
      src/views/exam/parts/contact.vue

+ 6 - 1
src/store/api/user/contactApply.js

@@ -34,12 +34,17 @@ export const ContactApplyStore = defineStore('contactApply', () => {
     const res = await axios.$post(`${url}/examine`, payload)
     return res
   }
+  const getContacts = async (payload) => {
+    const res = await axios.$get(`${url}/contacts/${payload}`)
+    return res
+  }
   return {
     query,
     fetch,
     create,
     update,
     del,
-    examine
+    examine,
+    getContacts
   }
 })

+ 8 - 5
src/views/exam/parts/contact.vue

@@ -23,7 +23,7 @@
           <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>
+      <custom-form 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')" :disabled="getAgreeDisabled">{{ $t('common.agree') }}</el-button>
@@ -75,9 +75,14 @@ const contactsFields = ref([
   { label: '联系人', model: 'person' },
   { label: '联系电话', model: 'phone' }
 ])
-const toExam = (data) => {
+const toExam = async (data) => {
   form.value = cloneDeep(data)
-  dialog.value = { type: '2', show: true, title: t('pages.contactApply.examTitle') }
+  const id = get(data, 'id')
+  const result = await store.getContacts(id)
+  if ($checkRes(result, null, result.errmsg)) {
+    contactsForm.value = get(result, 'data', {})
+    dialog.value = { type: '2', show: true, title: t('pages.contactApply.examTitle') }
+  }
 }
 const toClose = () => {
   form.value = {}
@@ -86,8 +91,6 @@ const toClose = () => {
 }
 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')