zs 9 mesiacov pred
rodič
commit
ae6a3a48fc

+ 1 - 3
src/views/center/demand.vue

@@ -298,9 +298,8 @@ const toExam = async (row) => {
     .catch(() => {})
 }
 // 供给列表查询
-const searchSupply = async (industry) => {
+const searchSupply = async () => {
   const info = { skip: 0, limit: 5, is_use: '0', status: '1' }
-  if (industry) info.industry = industry
   const res = await supplyStore.query(info)
   if (res.errcode == '0') supplyList.value = res.data
 }
@@ -350,7 +349,6 @@ const sizeChange = (limits) => {
 }
 .dialog {
   display: flex;
-  justify-content: center;
   flex-wrap: wrap;
   margin-top: 20px;
   .list {

+ 60 - 8
src/views/center/project.vue

@@ -72,6 +72,29 @@
             </template>
           </custom-form>
         </el-col>
+        <el-col :span="24" v-if="dialog.type == '2'" class="dialog">
+          <div class="list" v-for="(item, index) in demandList" :key="index" @click="toView(item)">
+            <h2 class="name textMore">
+              <span>{{ item.name || '暂无' }}</span>
+            </h2>
+            <div class="other">
+              <span class="other_1">{{ getDict(item.urgent, 'urgent') || '暂无' }}</span>
+              <div class="other_2">
+                <span>应用行业:</span>
+                {{ item.field || '暂无' }}
+              </div>
+              <div class="other_2">
+                <span>资金预算:</span>
+                {{ item.money || '面议' }}
+              </div>
+              <div class="other_2 textOne">
+                <el-icon color="#0085f5"><Location /></el-icon>
+                {{ getArea(item.area) }}
+                <span class="state">{{ getDict(item.status, 'status') || '未解决' }}</span>
+              </div>
+            </div>
+          </div>
+        </el-col>
       </el-row>
     </el-dialog>
   </div>
@@ -86,6 +109,7 @@ const userStore = UserStore()
 const user = computed(() => userStore.user)
 // 接口
 import { ProjectStore } from '@/store/api/platform/project'
+import { DemandStore } from '@/store/api/platform/demand'
 import { DictDataStore } from '@/store/api/system/dictData'
 import { TagsStore } from '@/store/api/system/tags'
 import { SectorStore } from '@/store/api/platform/sector'
@@ -95,9 +119,10 @@ const store = ProjectStore()
 const dictDataStore = DictDataStore()
 const tagsStore = TagsStore()
 const sectorStore = SectorStore()
+const demandStore = DemandStore()
 // 加载中
 const loading = ref(false)
-
+const router = useRouter()
 const searchForm = ref({})
 // 列表
 const list = ref([])
@@ -117,6 +142,10 @@ const cooperateList = ref([])
 const tagsList = ref([])
 const sectorList = ref([])
 
+// 推荐需求列表
+const demandList = ref([])
+const width = ref('50%')
+
 const form = ref({ file: [] })
 const dialog = ref({ type: '1', show: false, title: '发布项目' })
 const formFields = ref([
@@ -234,8 +263,11 @@ const toSave = async () => {
   if (get(data, 'id')) res = await store.update({ ...data, ...other })
   else res = await store.create({ ...data, ...other })
   if ($checkRes(res, true)) {
-    search({ skip, limit })
-    toClose()
+    await search({ skip, limit })
+    await toClose()
+    await searchDemand()
+    width.value = '90%'
+    dialog.value = { type: '2', show: true, title: '相关需求推荐' }
   }
 }
 const toDraftSave = async () => {
@@ -245,8 +277,11 @@ const toDraftSave = async () => {
   if (get(data, 'id')) res = await store.update({ ...data, ...other })
   else res = await store.create({ ...data, ...other })
   if ($checkRes(res, true)) {
-    search({ skip, limit })
-    toClose()
+    await search({ skip, limit })
+    await toClose()
+    await searchDemand()
+    width.value = '90%'
+    dialog.value = { type: '2', show: true, title: '相关需求推荐' }
   }
 }
 // 审核保存
@@ -256,12 +291,30 @@ const toExam = async (row) => {
       const data = cloneDeep(row)
       let res = await store.update({ id: data.id, status: '0', user: user.value.id })
       if ($checkRes(res, true)) {
-        search({ skip, limit })
-        toClose()
+        await search({ skip, limit })
+        await toClose()
+        await searchDemand()
+        width.value = '90%'
+        dialog.value = { type: '2', show: true, title: '相关需求推荐' }
       }
     })
     .catch(() => {})
 }
+// 需求列表查询
+const searchDemand = async () => {
+  const info = { skip: 0, limit: 5, is_use: '0', status: '1' }
+  const res = await demandStore.query(info)
+  if (res.errcode == '0') demandList.value = res.data
+}
+// 查看详情
+const toView = (item) => {
+  router.push({ path: '/demand/detail', query: { id: item.id || item._id } })
+}
+// 地区
+const getArea = (data) => {
+  if (data) return data.join('-')
+  else return '暂无地区'
+}
 const toClose = () => {
   form.value = { file: [] }
   dialog.value = { show: false }
@@ -303,7 +356,6 @@ const sizeChange = (limits) => {
 }
 .dialog {
   display: flex;
-  justify-content: center;
   flex-wrap: wrap;
   margin-top: 20px;
   .list {

+ 2 - 4
src/views/center/supply.vue

@@ -133,7 +133,7 @@ const supplyList = ref([])
 const tagsList = ref([])
 const sectorList = ref([])
 
-// 推荐供给列表
+// 推荐需求列表
 const demandList = ref([])
 const width = ref('50%')
 
@@ -291,9 +291,8 @@ const toExam = async (row) => {
     .catch(() => {})
 }
 // 需求列表查询
-const searchDemand = async (industry) => {
+const searchDemand = async () => {
   const info = { skip: 0, limit: 5, is_use: '0', status: '1' }
-  if (industry) info.industry = industry
   const res = await demandStore.query(info)
   if (res.errcode == '0') demandList.value = res.data
 }
@@ -348,7 +347,6 @@ const sizeChange = (limits) => {
 }
 .dialog {
   display: flex;
-  justify-content: center;
   flex-wrap: wrap;
   margin-top: 20px;
   .list {