|
@@ -14,6 +14,11 @@
|
|
<el-button :type="rangType=='1'?'success':''" @click="changeTy('1')">求</el-button>
|
|
<el-button :type="rangType=='1'?'success':''" @click="changeTy('1')">求</el-button>
|
|
<el-button type="primary" v-if="supplyFlag == 1" @click="poupForm">发布需求</el-button>
|
|
<el-button type="primary" v-if="supplyFlag == 1" @click="poupForm">发布需求</el-button>
|
|
</div>
|
|
</div>
|
|
|
|
+ <view class="subListcd">
|
|
|
|
+ <view class="subcd" v-for="(item,index) in ctList" :class="cksub== index?'cksub':''" @click="changeCk(index,item.id)">
|
|
|
|
+ {{item.categoryName}}
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
<view class="messageBox">
|
|
<view class="messageBox">
|
|
<view class="leftBox" v-if="rangType=='0'">
|
|
<view class="leftBox" v-if="rangType=='0'">
|
|
<!-- <view class="">
|
|
<!-- <view class="">
|
|
@@ -77,6 +82,7 @@
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
const keyword = ref('')
|
|
const keyword = ref('')
|
|
|
|
+ const cksub = ref(0)
|
|
const loading = ref(true)
|
|
const loading = ref(true)
|
|
const bupplyList : any = ref([]);
|
|
const bupplyList : any = ref([]);
|
|
const buyList : any = ref([]);
|
|
const buyList : any = ref([]);
|
|
@@ -85,31 +91,54 @@
|
|
const supply = ref(false);
|
|
const supply = ref(false);
|
|
const supplyContent = ref('');
|
|
const supplyContent = ref('');
|
|
const buyContent = ref('');
|
|
const buyContent = ref('');
|
|
- const supplyContentapl = ref('供 内容 举例:消息内容:包裹速取 联系人&联系公司:张三 联系方式:18888889999');
|
|
|
|
- const buyContentapl = ref('求 内容 举例:消息内容:包裹速取 联系人&联系公司:张三 联系方式:18888889999');
|
|
|
|
|
|
+ const supplyContentapl = ref('供');
|
|
|
|
+ const buyContentapl = ref('求');
|
|
const rangType = ref('0')
|
|
const rangType = ref('0')
|
|
-
|
|
|
|
|
|
+ const ctList : any = ref([]);
|
|
|
|
+ const cdid = ref('');
|
|
if (typeof deptId === 'string') {
|
|
if (typeof deptId === 'string') {
|
|
loading.value = true
|
|
loading.value = true
|
|
- SupdemApi.getSupplyBuyList(deptId)
|
|
|
|
|
|
+ SupdemApi.subcateList(deptId)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- bupplyList.value = res.data.bupplyList;
|
|
|
|
- buyList.value = res.data.buyList;
|
|
|
|
- supplyFlag.value = res.data.supplyFlag
|
|
|
|
|
|
+ console.log("subcateList",res)
|
|
|
|
+ ctList.value = res.data
|
|
|
|
+ cdid.value = res.data[0].id
|
|
|
|
+ getSupply(res.data[0].id)
|
|
|
|
+ // bupplyList.value = res.data.bupplyList;
|
|
|
|
+ // buyList.value = res.data.buyList;
|
|
|
|
+ // supplyFlag.value = res.data.supplyFlag
|
|
})
|
|
})
|
|
.finally(() => {
|
|
.finally(() => {
|
|
loading.value = false
|
|
loading.value = false
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ const getSupply = (deptId:string)=>{
|
|
|
|
+ SupdemApi.getSupplyBuyList(deptId)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ bupplyList.value = res.data.bupplyList;
|
|
|
|
+ buyList.value = res.data.buyList;
|
|
|
|
+ supplyFlag.value = res.data.supplyFlag
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ loading.value = false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
const poupForm=()=>{
|
|
const poupForm=()=>{
|
|
supply.value = true;
|
|
supply.value = true;
|
|
|
|
+
|
|
}
|
|
}
|
|
const changeTy=(s:string)=>{
|
|
const changeTy=(s:string)=>{
|
|
rangType.value = s
|
|
rangType.value = s
|
|
}
|
|
}
|
|
|
|
+ const changeCk=(i:number,id:string)=>{
|
|
|
|
+ cksub.value = i;
|
|
|
|
+ cdid.value = id;
|
|
|
|
+ getSupply(id)
|
|
|
|
+ }
|
|
const save = () => {
|
|
const save = () => {
|
|
console.log("supplyContent", supplyContent.value)
|
|
console.log("supplyContent", supplyContent.value)
|
|
- SupdemApi.addSupply(deptId,supplyContent.value, buyContent.value).then((res) => {
|
|
|
|
|
|
+ SupdemApi.addSupply(cdid.value,supplyContent.value, buyContent.value).then((res) => {
|
|
// map.value = Tools.listToMap(res.data);
|
|
// map.value = Tools.listToMap(res.data);
|
|
console.log("发布结果",res)
|
|
console.log("发布结果",res)
|
|
if(res.code == 200){
|
|
if(res.code == 200){
|
|
@@ -139,7 +168,32 @@
|
|
padding: 0 !important;
|
|
padding: 0 !important;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ .subListcd{
|
|
|
|
+ flex: 1;
|
|
|
|
+ display: flex;
|
|
|
|
+ // justify-content: space-between;
|
|
|
|
+ padding: 0 2%;
|
|
|
|
+ align-items: center;
|
|
|
|
+ // border: 1px solid #b7b7b7;
|
|
|
|
+ margin-right: 2%;
|
|
|
|
+ margin-top: 5px;
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
+ .subcd{
|
|
|
|
+ height: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ min-width: 50px;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+ height: 40px;
|
|
|
|
+ line-height: 40px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .cksub{
|
|
|
|
+ color: #388fff;
|
|
|
|
+ }
|
|
.users {
|
|
.users {
|
|
padding: 18px;
|
|
padding: 18px;
|
|
height: 100%;
|
|
height: 100%;
|
|
@@ -184,7 +238,7 @@
|
|
}
|
|
}
|
|
.messageBox {
|
|
.messageBox {
|
|
display: block;
|
|
display: block;
|
|
- padding: 5%;
|
|
|
|
|
|
+ padding: 0 5%;
|
|
// display: flex;
|
|
// display: flex;
|
|
// justify-content: space-around;
|
|
// justify-content: space-around;
|
|
height: 100%;
|
|
height: 100%;
|