Browse Source

产业集群申请联系

lrf 7 months ago
parent
commit
7d94961396

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

@@ -31,9 +31,7 @@ export const ContactApplyStore = defineStore('contactApply', () => {
     return res
     return res
   }
   }
   const examine = async (payload) => {
   const examine = async (payload) => {
-    const id = get(payload, 'id')
-    const status = get(payload, 'status')
-    const res = await axios.$post(`${url}/examine`, { id, status })
+    const res = await axios.$post(`${url}/examine`, payload)
     return res
     return res
   }
   }
   return {
   return {

+ 23 - 2
src/views/exam/parts/contact.vue

@@ -22,9 +22,10 @@
             <custom-desc v-model="form" :fields="statusFields"></custom-desc>
             <custom-desc v-model="form" :fields="statusFields"></custom-desc>
           </el-col>
           </el-col>
         </el-row>
         </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-row style="text-align: center; padding-top: 20px" justify="center">
           <el-col :span="6" style="">
           <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>
           <el-col :span="6" style="text-align: center">
           <el-col :span="6" style="text-align: center">
             <el-button type="danger" @click="exam('-1')">{{ $t('common.refuse') }}</el-button>
             <el-button type="danger" @click="exam('-1')">{{ $t('common.refuse') }}</el-button>
@@ -65,6 +66,15 @@ const toReset = async () => {
   searchForm.value = {}
   searchForm.value = {}
   await search()
   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) => {
 const toExam = (data) => {
   form.value = cloneDeep(data)
   form.value = cloneDeep(data)
   dialog.value = { type: '2', show: true, title: t('pages.contactApply.examTitle') }
   dialog.value = { type: '2', show: true, title: t('pages.contactApply.examTitle') }
@@ -72,7 +82,17 @@ const toExam = (data) => {
 const toClose = () => {
 const toClose = () => {
   form.value = {}
   form.value = {}
   dialog.value = { show: false }
   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
 // #endregion
 
 
 // #region 表单
 // #region 表单
@@ -84,7 +104,8 @@ const statusFields = ref([
   { label: t('pages.contactApply.source_name'), model: 'source_name' }
   { label: t('pages.contactApply.source_name'), model: 'source_name' }
 ])
 ])
 const exam = async (status) => {
 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)
   const res = await store.examine(data)
   if ($checkRes(res, true)) {
   if ($checkRes(res, true)) {
     search({ skip, limit })
     search({ skip, limit })

+ 6 - 1
src/views/exam/parts/setting.vue

@@ -17,6 +17,9 @@
         <template #incubator>
         <template #incubator>
           <el-option v-for="i in deptList" :key="i.id" :label="i.name" :value="i.id"></el-option>
           <el-option v-for="i in deptList" :key="i.id" :label="i.name" :value="i.id"></el-option>
         </template>
         </template>
+        <template #sector>
+          <el-option v-for="i in deptList" :key="i.id" :label="i.name" :value="i.id"></el-option>
+        </template>
       </custom-form>
       </custom-form>
     </el-card>
     </el-card>
   </div>
   </div>
@@ -38,13 +41,15 @@ const dataId = ref()
  * 项目数据:投资部
  * 项目数据:投资部
  * 成果数据:创合部
  * 成果数据:创合部
  * 孵化基地:创合部
  * 孵化基地:创合部
+ * 产业集群:产业部
  */
  */
 const fields = ref([
 const fields = ref([
   { label: '需求数据', selectplaceholder: '请选择负责审核的部门', model: 'demand', type: 'select' },
   { label: '需求数据', selectplaceholder: '请选择负责审核的部门', model: 'demand', type: 'select' },
   { label: '供给数据', selectplaceholder: '请选择负责审核的部门', model: 'supply', type: 'select' },
   { label: '供给数据', selectplaceholder: '请选择负责审核的部门', model: 'supply', type: 'select' },
   { label: '项目数据', selectplaceholder: '请选择负责审核的部门', model: 'project', type: 'select' },
   { label: '项目数据', selectplaceholder: '请选择负责审核的部门', model: 'project', type: 'select' },
   { label: '成果数据', selectplaceholder: '请选择负责审核的部门', model: 'achievement', type: 'select' },
   { label: '成果数据', selectplaceholder: '请选择负责审核的部门', model: 'achievement', type: 'select' },
-  { label: '孵化基地', selectplaceholder: '请选择负责审核的部门', model: 'incubator', type: 'select' }
+  { label: '孵化基地', selectplaceholder: '请选择负责审核的部门', model: 'incubator', type: 'select' },
+  { label: '产业集群', selectplaceholder: '请选择负责审核的部门', model: 'sector', type: 'select' }
 ])
 ])
 
 
 const toSave = async () => {
 const toSave = async () => {