|
@@ -35,7 +35,7 @@
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-dialog v-model="dialog.show" :title="dialog.title" :destroy-on-close="false" @close="toClose">
|
|
|
+ <el-dialog v-model="dialog.show" :title="dialog.title" :destroy-on-close="false" @close="toClose" :width="width">
|
|
|
<el-row>
|
|
|
<el-col :span="24" v-if="dialog.type == '1'">
|
|
|
<custom-form v-model="form" :fields="formFields" :rules="rules" @save="toSave" @draftSave="toDraftSave">
|
|
@@ -64,6 +64,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>
|
|
@@ -78,6 +101,7 @@ const userStore = UserStore()
|
|
|
const user = computed(() => userStore.user)
|
|
|
// 接口
|
|
|
import { SupplyStore } from '@/store/api/platform/supply'
|
|
|
+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'
|
|
@@ -87,9 +111,10 @@ const store = SupplyStore()
|
|
|
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([])
|
|
@@ -108,6 +133,10 @@ const supplyList = ref([])
|
|
|
const tagsList = ref([])
|
|
|
const sectorList = ref([])
|
|
|
|
|
|
+// 推荐供给列表
|
|
|
+const demandList = ref([])
|
|
|
+const width = ref('50%')
|
|
|
+
|
|
|
const form = ref({ time: [] })
|
|
|
const dialog = ref({ type: '1', show: false, title: '发布供给' })
|
|
|
const formFields = ref([
|
|
@@ -182,6 +211,7 @@ const getDict = (data, model) => {
|
|
|
if (data) {
|
|
|
let res
|
|
|
if (model == 'status') res = statusList.value.find((f) => f.value == data)
|
|
|
+ else if (model == 'urgent') res = urgentList.value.find((f) => f.value == data)
|
|
|
return get(res, 'label')
|
|
|
}
|
|
|
}
|
|
@@ -218,8 +248,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 () => {
|
|
@@ -234,8 +267,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: '相关需求推荐' }
|
|
|
}
|
|
|
}
|
|
|
// 审核保存
|
|
@@ -245,14 +281,34 @@ 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 (industry) => {
|
|
|
+ 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
|
|
|
+}
|
|
|
+// 查看详情
|
|
|
+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 = { time: [] }
|
|
|
+ width.value = '50%'
|
|
|
dialog.value = { show: false }
|
|
|
}
|
|
|
// 分页
|
|
@@ -290,4 +346,71 @@ const sizeChange = (limits) => {
|
|
|
margin: 20px 0 0 0;
|
|
|
}
|
|
|
}
|
|
|
+.dialog {
|
|
|
+ display: flex;
|
|
|
+ margin-top: 20px;
|
|
|
+ .list {
|
|
|
+ position: relative;
|
|
|
+ margin-right: 10px;
|
|
|
+ width: 380px;
|
|
|
+ height: 233px;
|
|
|
+ box-shadow: 0 0 13px 0 rgba(5, 88, 219, 0.18);
|
|
|
+ .name {
|
|
|
+ padding: 10px 20px;
|
|
|
+ width: 380px;
|
|
|
+ height: 71px;
|
|
|
+ background-color: #dce5ff;
|
|
|
+ font-size: 16px;
|
|
|
+ line-height: 24px;
|
|
|
+ color: #0d0d0d;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .other {
|
|
|
+ height: 162px;
|
|
|
+ padding: 10px 20px 0 20px;
|
|
|
+ .other_1 {
|
|
|
+ padding: 0 10px;
|
|
|
+ height: 25px;
|
|
|
+ background-color: #e6f2fd;
|
|
|
+ border-radius: 2px;
|
|
|
+ border: solid 1px #cae0f5;
|
|
|
+ font-size: $global-font-size-14;
|
|
|
+ line-height: 25px;
|
|
|
+ color: #0085f5;
|
|
|
+ }
|
|
|
+ .other_2 {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-top: 15px;
|
|
|
+ font-size: $global-font-size-16;
|
|
|
+ span {
|
|
|
+ color: #909090;
|
|
|
+ }
|
|
|
+ .state {
|
|
|
+ position: absolute;
|
|
|
+ right: 20px;
|
|
|
+ bottom: 15px;
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: middle;
|
|
|
+ padding: 0 20px;
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ background-image: linear-gradient(90deg, #ff8a00 0, #ff5a00 100%), linear-gradient(#ff7800, #ff7800);
|
|
|
+ background-blend-mode: normal, normal;
|
|
|
+ border-radius: 14px;
|
|
|
+ border: solid 1px #e5e5e5;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .list:hover {
|
|
|
+ box-shadow: 0 0 5px 0 $global-color-107;
|
|
|
+ .name {
|
|
|
+ background-color: $global-color-107;
|
|
|
+ color: $global-color-fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|