|
@@ -0,0 +1,209 @@
|
|
|
|
+<template>
|
|
|
|
+
|
|
|
|
+ <div v-loading="loading" class="dept-box">
|
|
|
|
+ <el-scrollbar height="100%">
|
|
|
|
+ <!-- <div class="search-box">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="keyword"
|
|
|
|
+ placeholder="请输入搜索内容(支持拼音搜索)"
|
|
|
|
+ :suffix-icon="Search"
|
|
|
|
+ />
|
|
|
|
+ </div> -->
|
|
|
|
+ <div style="display: flex;justify-content: end;padding: 2% 5%;">
|
|
|
|
+ <el-button :type="rangType=='0'?'success':''" @click="changeTy('0')">供</el-button>
|
|
|
|
+ <el-button :type="rangType=='1'?'success':''" @click="changeTy('1')">求</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <view class="messageBox">
|
|
|
|
+ <view class="leftBox" v-if="rangType=='0'">
|
|
|
|
+ <!-- <view class="">
|
|
|
|
+ 供
|
|
|
|
+ </view> -->
|
|
|
|
+ <view class="item" v-for="(item,_index) in bupplyList">
|
|
|
|
+ <view class="" style="display: block;">
|
|
|
|
+ {{item.content}}
|
|
|
|
+ </view>
|
|
|
|
+ <view class="" style="margin-top: 20px; display: flex; justify-content: end;">
|
|
|
|
+ <el-button class="" type="primary" style="width: 20%;" @click="showUser(item.user.userId, true)">联系</el-button>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="leftBox" v-if="rangType=='1'">
|
|
|
|
+ <!-- <view class="">
|
|
|
|
+ 求
|
|
|
|
+ </view> -->
|
|
|
|
+ <view class="item" v-for="(item,_index) in buyList">
|
|
|
|
+ <view class="" style="display: block;">
|
|
|
|
+ {{item.content}}
|
|
|
|
+ </view>
|
|
|
|
+ <view class="" style="margin-top: 20px; display: flex; justify-content: end;">
|
|
|
|
+ <el-button class="" type="primary" style="width: 20%;" @click="showUser(item.user.userId, true)">联系</el-button>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <el-result v-if="bupplyList.length === 0 && !loading" icon="info">
|
|
|
|
+ <template #sub-title>
|
|
|
|
+ <p>此类型暂无数据!</p>
|
|
|
|
+ </template>
|
|
|
|
+ </el-result>
|
|
|
|
+ <view class="formBox" v-if="supply">
|
|
|
|
+ <el-forms ref="userForm" >
|
|
|
|
+ <el-section title="供应内容" subTitle="请输入供应内容 需注意换行格式" type="line" padding>
|
|
|
|
+ <el-input type="textarea" :rows="8" style="min-height: 140px;margin-bottom: 5%;" v-model="supplyContent" :placeholder="supplyContentapl"></el-input>
|
|
|
|
+ </el-section>
|
|
|
|
+ <el-section title="需求内容" subTitle="请输入需求内容 需注意换行格式" type="line" padding>
|
|
|
|
+ <el-input :rows="8" style="min-height: 140px;margin-bottom: 5%;" type="textarea" v-model="buyContent" :placeholder="buyContentapl"></el-input>
|
|
|
|
+ </el-section>
|
|
|
|
+ <view class="" style="margin-top: 5%;display: flex;justify-content: space-evenly;">
|
|
|
|
+ <el-button class="" type="success" style="width: 20%;" @click="save">提交</el-button>
|
|
|
|
+ <el-button class="" type="info" style="width: 20%;" @click="saveCancle">取消</el-button>
|
|
|
|
+ </view>
|
|
|
|
+ </el-forms>
|
|
|
|
+ </view>
|
|
|
|
+ </el-scrollbar>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script setup lang="ts">
|
|
|
|
+ import { ref } from 'vue'
|
|
|
|
+ import { useRoute } from 'vue-router'
|
|
|
|
+ import SupdemApi from '@renderer/api/SupdemApi'
|
|
|
|
+ import { ElMessage } from 'element-plus'
|
|
|
|
+ import showUser from '@renderer/components/user-modal'
|
|
|
|
+ const route = useRoute()
|
|
|
|
+ const keyword = ref('')
|
|
|
|
+ const loading = ref(true)
|
|
|
|
+ const bupplyList : any = ref([]);
|
|
|
|
+ const buyList : any = ref([]);
|
|
|
|
+ const supplyFlag = ref('0');
|
|
|
|
+ const deptId = route.params.id.toString()
|
|
|
|
+ const supply = ref(false);
|
|
|
|
+ const supplyContent = ref('');
|
|
|
|
+ const buyContent = ref('');
|
|
|
|
+ const supplyContentapl = ref('供 内容 举例:消息内容:包裹速取 联系人&联系公司:张三 联系方式:18888889999');
|
|
|
|
+ const buyContentapl = ref('求 内容 举例:消息内容:包裹速取 联系人&联系公司:张三 联系方式:18888889999');
|
|
|
|
+ const rangType = ref('0')
|
|
|
|
+
|
|
|
|
+ if (typeof deptId === 'string') {
|
|
|
|
+ loading.value = true
|
|
|
|
+ SupdemApi.getDtailList(deptId)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ bupplyList.value = res.data.bupplyList;
|
|
|
|
+ buyList.value = res.data.buyList;
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ loading.value = false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ const poupForm=()=>{
|
|
|
|
+ supply.value = true;
|
|
|
|
+ }
|
|
|
|
+ const changeTy=(s:string)=>{
|
|
|
|
+ rangType.value = s
|
|
|
|
+ }
|
|
|
|
+ const save = () => {
|
|
|
|
+ console.log("supplyContent", supplyContent.value)
|
|
|
|
+ SupdemApi.addSupply(deptId,supplyContent.value, buyContent.value).then((res) => {
|
|
|
|
+ // map.value = Tools.listToMap(res.data);
|
|
|
|
+ console.log("发布结果",res)
|
|
|
|
+ if(res.code == 200){
|
|
|
|
+ ElMessage.success('发布成功')
|
|
|
|
+ saveCancle()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }).finally(() => {
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ const saveCancle=()=>{
|
|
|
|
+ console.log("supply",supply)
|
|
|
|
+ supply.value = false;
|
|
|
|
+ supplyContent.value = '';
|
|
|
|
+ buyContent.value = '';
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style scoped lang="less">
|
|
|
|
+ .dept-box {
|
|
|
|
+ background-color: #ffffff;
|
|
|
|
+ height: 100%;
|
|
|
|
+ padding: 0 !important;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .users {
|
|
|
|
+ padding: 18px;
|
|
|
|
+ height: 100%;
|
|
|
|
+ width: 100%;
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
+ overflow-y: scroll;
|
|
|
|
+
|
|
|
|
+ .users-grid {
|
|
|
|
+ display: grid;
|
|
|
|
+ grid-template-columns: repeat(auto-fit, 95px);
|
|
|
|
+ grid-template-rows: repeat(auto-fit, 80px);
|
|
|
|
+ grid-row-gap: 12px;
|
|
|
|
+ grid-column-gap: 12px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .user {
|
|
|
|
+ text-align: center;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ padding: 10px;
|
|
|
|
+ border: 1px solid #cccccc;
|
|
|
|
+
|
|
|
|
+ .username {
|
|
|
|
+ width: 100%;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .search-box {
|
|
|
|
+ padding: 15px 20px;
|
|
|
|
+ }
|
|
|
|
+ .formBox {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ padding: 5%;
|
|
|
|
+ // background: #c3acac;
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 0;
|
|
|
|
+ background: white;
|
|
|
|
+ }
|
|
|
|
+ .messageBox {
|
|
|
|
+ display: block;
|
|
|
|
+ padding: 5%;
|
|
|
|
+ // display: flex;
|
|
|
|
+ // justify-content: space-around;
|
|
|
|
+ height: 100%;
|
|
|
|
+ width: 100%;
|
|
|
|
+ .leftBox {
|
|
|
|
+ // width: 45%;
|
|
|
|
+ .item {
|
|
|
|
+ border: 1px solid black;
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+ padding:2% 5%;
|
|
|
|
+ margin-top: 15px;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ display: block;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .rightBox {
|
|
|
|
+ width: 45%;
|
|
|
|
+
|
|
|
|
+ .item {
|
|
|
|
+ border: 1px solid black;
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+ padding: 5%;
|
|
|
|
+ margin-top: 15px;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ display: block;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</style>
|