|
@@ -1,19 +1,23 @@
|
|
<template>
|
|
<template>
|
|
- <view class="notice">
|
|
|
|
- <view class="tz_item" v-for="(item, index) in list" :key="index" @click="detail(item)">
|
|
|
|
- <view class="ctop">
|
|
|
|
- <text class="icon tb"></text>
|
|
|
|
- <text class="tag">通知公告</text>
|
|
|
|
- <view class="clear"></view>
|
|
|
|
- </view>
|
|
|
|
- <view class="content">
|
|
|
|
- <view class="title omit">{{ item.title }}</view>
|
|
|
|
|
|
+ <view>
|
|
|
|
+ <view class="tab">
|
|
|
|
+ <u-tabs :list="tab" :current="0"></u-tabs>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="list">
|
|
|
|
+ <view class="item" v-for="(item, index) in list" :key="index">
|
|
|
|
+ <view class="title">{{ item.companyName }}</view>
|
|
|
|
+ <view class="op">
|
|
|
|
+ <text>{{ item.createTime }}</text>
|
|
|
|
+ <text class="del" @click="del(item)">解除</text>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- <view class="time">{{ item.createTime }}</view>
|
|
|
|
- <view class="clear"></view>
|
|
|
|
|
|
+ <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
|
|
|
|
+ <u-empty v-if="!loadMore && list.length == 0" text="尚未关联公司"></u-empty>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="footer">
|
|
|
|
+ <view class="db"><button class="btn" @click="show = true">关联企业</button></view>
|
|
</view>
|
|
</view>
|
|
- <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
|
|
|
|
- <u-empty v-if="!loadMore && list.length == 0"></u-empty>
|
|
|
|
|
|
+ <u-action-sheet round="20" :actions="actions" @select="selectClick" cancelText="取消" :show="show" @close="show = false"></u-action-sheet>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -21,6 +25,9 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ tab: [{ name: '全部' }],
|
|
|
|
+ show: false,
|
|
|
|
+ actions: [{ name: '扫码关联' }, { name: '手动关联' }],
|
|
list: [],
|
|
list: [],
|
|
param: { pageNum: 1, pageSize: 10, orderByColumn: 'createTime', isAsc: 'desc' },
|
|
param: { pageNum: 1, pageSize: 10, orderByColumn: 'createTime', isAsc: 'desc' },
|
|
loadMore: true
|
|
loadMore: true
|
|
@@ -28,11 +35,14 @@ export default {
|
|
},
|
|
},
|
|
onLoad(e) {
|
|
onLoad(e) {
|
|
this.getData();
|
|
this.getData();
|
|
|
|
+ uni.$on('company', (res) => {
|
|
|
|
+ this.refresh();
|
|
|
|
+ });
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
getData() {
|
|
getData() {
|
|
this.http.request({
|
|
this.http.request({
|
|
- url: '/app/user/company/list',
|
|
|
|
|
|
+ url: '/app/relate/list',
|
|
data: this.param,
|
|
data: this.param,
|
|
loading: 'false',
|
|
loading: 'false',
|
|
success: (res) => {
|
|
success: (res) => {
|
|
@@ -44,9 +54,49 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- detail(item) {
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages/notice/detail?id=' + item.id
|
|
|
|
|
|
+ selectClick(e) {
|
|
|
|
+ if (e.name == '手动关联') {
|
|
|
|
+ uni.navigateTo({ url: '/pages/company/search' });
|
|
|
|
+ } else {
|
|
|
|
+ uni.scanCode({
|
|
|
|
+ success: (res) => {
|
|
|
|
+ this.http.request({
|
|
|
|
+ url: '/app/relate/add',
|
|
|
|
+ data: { companyId: res.result },
|
|
|
|
+ method: 'POST',
|
|
|
|
+ success: (res) => {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '关联成功',
|
|
|
|
+ showCancel: false,
|
|
|
|
+ success: (res) => {
|
|
|
|
+ this.refresh();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ fail: (res) => {}
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ del(item) {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '确定解除该企业关联?',
|
|
|
|
+ success: (res) => {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ this.http.request({
|
|
|
|
+ url: '/app/relate/remove',
|
|
|
|
+ data: { companyId: item.companyId },
|
|
|
|
+ method: 'POST',
|
|
|
|
+ success: (res) => {
|
|
|
|
+ uni.showToast({ title: '解除成功' });
|
|
|
|
+ this.list.splice(this.list.indexOf(item), 1);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
});
|
|
});
|
|
},
|
|
},
|
|
//刷新数据
|
|
//刷新数据
|
|
@@ -75,63 +125,37 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
-page {
|
|
|
|
- background-color: white;
|
|
|
|
-}
|
|
|
|
-.notice {
|
|
|
|
- background-color: white;
|
|
|
|
- .tz_item {
|
|
|
|
- padding: 7px 15px 15px 15px;
|
|
|
|
- color: $font-c;
|
|
|
|
|
|
+.list {
|
|
|
|
+ padding: 10px 10px 90px 10px;
|
|
|
|
+ .item {
|
|
|
|
+ background-color: white;
|
|
|
|
+ padding: 15px;
|
|
|
|
+ border-radius: 5px;
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
- border-bottom: 1px solid #f0f2f7;
|
|
|
|
- cursor: pointer;
|
|
|
|
- .ctop {
|
|
|
|
- position: relative;
|
|
|
|
- .bage {
|
|
|
|
- position: absolute;
|
|
|
|
- width: 8px;
|
|
|
|
- height: 8px;
|
|
|
|
- left: 23px;
|
|
|
|
- top: 0px;
|
|
|
|
- border: 1px solid white;
|
|
|
|
- border-radius: 50%;
|
|
|
|
- background-color: red;
|
|
|
|
- }
|
|
|
|
- .tb {
|
|
|
|
- width: 30px;
|
|
|
|
- height: 30px;
|
|
|
|
- line-height: 28px;
|
|
|
|
- text-align: center;
|
|
|
|
- border-radius: 50%;
|
|
|
|
- font-size: 20px;
|
|
|
|
- margin-right: 5px;
|
|
|
|
- float: left;
|
|
|
|
- background-color: #4581fb;
|
|
|
|
- color: white;
|
|
|
|
- }
|
|
|
|
- .tag {
|
|
|
|
- float: left;
|
|
|
|
- font-size: 14px;
|
|
|
|
- font-weight: bold;
|
|
|
|
- margin-top: 4px;
|
|
|
|
- margin-left: 5px;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .content {
|
|
|
|
- float: left;
|
|
|
|
- width: 75%;
|
|
|
|
- margin-top: 10px;
|
|
|
|
- color: #717171;
|
|
|
|
- .title {
|
|
|
|
- font-size: 14px;
|
|
|
|
- }
|
|
|
|
|
|
+ .title {
|
|
|
|
+ padding-bottom: 10px;
|
|
}
|
|
}
|
|
- .time {
|
|
|
|
|
|
+ .op {
|
|
|
|
+ border-top: 1px solid $line;
|
|
|
|
+ padding-top: 10px;
|
|
|
|
+ color: #676767;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
- padding: 10px 0px 0px 0px;
|
|
|
|
- float: right;
|
|
|
|
|
|
+ .del {
|
|
|
|
+ float: right;
|
|
|
|
+ color: #f44336;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+.footer {
|
|
|
|
+ position: fixed;
|
|
|
|
+ width: 100%;
|
|
|
|
+ bottom: 0px;
|
|
|
|
+ padding-bottom: 13px;
|
|
|
|
+ background-color: white;
|
|
|
|
+ border-top: 1px solid $line;
|
|
|
|
+ .db {
|
|
|
|
+ padding: 15px 35px 10px 35px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|