receiveList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. <template>
  2. <view class="qbox adffc">
  3. <view class="list" v-if="list.length">
  4. <up-list @scrolltolower="scrolltolower" style="height: 100%;">
  5. <up-list-item class="list-item" v-for="(item, index) in list" :key="index">
  6. <view @click.prevent="showDialog(item)">
  7. <view class="status adf" :class="{'dwc':item.status===0,'ywc':item.status===1}">
  8. <image :src="imgBase+'questionnaire_icon_dwc.png'" v-if="item.status===0"></image>
  9. <image :src="imgBase+'questionnaire_icon_ywc.png'" v-else-if="item.status===1"></image>
  10. <text>{{item.status===0?'待完成':item.status===1?'':''}}</text>
  11. </view>
  12. <image class="expand" :src="imgBase+'questionnaire_icon_down.png'"></image>
  13. <view class="title">{{item.title||''}}</view>
  14. <view class="name">团队名称:{{item.teamName||''}}</view>
  15. <view class="bottom adfacjb">
  16. <view class="bottom-left">截止时间:{{item.endTime}}</view>
  17. <view class="bottom-right" v-if="item.status===0" @click.stop="showNotice(item)">立即作答</view>
  18. <!-- <view class="bottom-right" v-else-if="item.status===1" @click.stop="reviewReport(item)">查看报告</view> -->
  19. </view>
  20. </view>
  21. </up-list-item>
  22. </up-list>
  23. </view>
  24. <view class="empty" v-else>
  25. <page-empty></page-empty>
  26. </view>
  27. <view class="dialog adffc" v-if="show">
  28. <view class="dbox">
  29. <view class="dbox-top adfacjb">
  30. <view class="dbox-top-title">{{dto.title||''}}</view>
  31. <image class="dbox-top-expand" :src="imgBase+'questionnaire_icon_down.png'" @click="show=false"></image>
  32. </view>
  33. <view class="dbox-name">团队名称:{{ dto.teamName || '' }}</view>
  34. <!-- <view class="dbox-status adfac" :class="{'dwc':dto.status===0,'ywc':dto.status===1}">
  35. <image :src="imgBase+'questionnaire_icon_dwc.png'" v-if="dto.status===0"></image>
  36. <image :src="imgBase+'questionnaire_icon_ywc.png'" v-else-if="dto.status===1"></image>
  37. <text>{{dto.status===0?'待完成':dto.status===1?'已完成':''}}</text>
  38. </view> -->
  39. <view class="dbox-menu adf">
  40. <view class="dbox-menu-pre adffcac" v-for="(item,index) in menuList" :key="index" @click="handleMenuClick(index)">
  41. <template v-if="item.text === '分享问卷'">
  42. <button class="share-btn" open-type="share">
  43. <image :src="item.img"></image>
  44. <text>{{ item.text }}</text>
  45. </button>
  46. </template>
  47. <template v-else>
  48. <image :src="item.img"></image>
  49. <text>{{ item.text }}</text>
  50. </template>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <cus-notice :show="noticeShow" @close="noticeShow=false" @handleKnow="handleKnow"></cus-notice>
  56. <cus-team-info :show="teamInfoShow" :teamInfo="teamInfo" @close="teamInfoShow=false"></cus-team-info>
  57. <cus-team-user :canEdit="false" :show="teamUserShow" :list="teamUserList" @close="teamUserShow=false"></cus-team-user>
  58. </view>
  59. </template>
  60. <script>
  61. import CusNotice from '@/components/CusNotice/index2.vue'
  62. import CusTeamUser from '@/components/CusTeamUser/index.vue'
  63. import CusTeamInfo from '@/components/CusTeamInfo/index.vue'
  64. import PageEmpty from '@/components/pageEmpty/index.vue'
  65. export default {
  66. components:{ CusNotice, CusTeamUser, CusTeamInfo, PageEmpty },
  67. props:{
  68. list:{
  69. typeof:Array,
  70. default:[]
  71. }
  72. },
  73. data(){
  74. return {
  75. show:false,
  76. noticeShow:false,
  77. teamInfoShow:false,
  78. teamUserShow:false,
  79. dto:null,
  80. menuList:[
  81. {
  82. img:this.$imgBase+'questionnaire_users.png',
  83. text:'团队成员'
  84. },
  85. {
  86. img:this.$imgBase+'questionnaire_share.png',
  87. text:'分享问卷'
  88. },
  89. {
  90. img:this.$imgBase+'questionnaire_info.png',
  91. text:'团队信息'
  92. },
  93. {
  94. img:this.$imgBase+'questionnaire_report.png',
  95. text:'查看报告'
  96. }
  97. ],
  98. categoryData:[],
  99. teamScaleData:[],
  100. teamLevelData:[],
  101. teamUserList:[],
  102. teamInfo:null
  103. }
  104. },
  105. methods:{
  106. scrolltolower(){
  107. this.$emit('scrolltolower')
  108. },
  109. showDialog(item){
  110. this.dto = item;
  111. this.show = true;
  112. this.$emit('showDialogFn',item);
  113. },
  114. showNotice(item){
  115. this.dto = item;
  116. this.noticeShow = true;
  117. },
  118. async getUserCategoryData(){
  119. return new Promise((resolve,reject)=>{
  120. this.$api.get('/getListByType/UserCategory').then(({data:res})=>{
  121. if(res.code!==0) return this.$showToast(res.msg)
  122. this.categoryData = res.data.map(d=>({name:d.dictLabel,id:d.dictValue}))
  123. resolve()
  124. })
  125. })
  126. },
  127. async handleMenuClick(type){
  128. if(type===0){
  129. await this.getUserCategoryData()
  130. this.$api.get(`/core/member/listByQueTeamId/${this.dto.teamQuestionnaireId}`).then(({data:res})=>{
  131. if(res.code!==0) return this.$showToast(res.msg)
  132. this.teamUserList = res.data;
  133. this.originTeamUserList = res.data;
  134. this.teamUserList.forEach(l=>{
  135. l.categoryName = this.categoryData.find(c=>c.id==l.category)?.name;
  136. })
  137. this.teamUserShow = true
  138. })
  139. } else if(type===2){
  140. this.showTeamInfo()
  141. } else if(type===3){
  142. uni.redirectTo({
  143. url:'/pagesHome/report'
  144. })
  145. }
  146. },
  147. reviewReport(item){
  148. uni.redirectTo({
  149. url:'/pagesHome/report'
  150. })
  151. },
  152. handleKnow(){
  153. uni.navigateTo({
  154. url:'/pagesPublish/questionnaireFill?teamQuestionnaireId='+this.dto.teamQuestionnaireId+'&teamId='+this.dto.teamId+'&type='+this.dto.type+'&turnType=questionnaire'
  155. })
  156. },
  157. async getTeamScaleData(){
  158. return new Promise((resolve,reject)=>{
  159. this.$api.get('/getListByType/team_scale').then(({data:res})=>{
  160. if(res.code!==0) return this.$showToast(res.msg)
  161. this.teamScaleData = res.data.map(d=>({name:d.dictLabel,id:d.dictValue}))
  162. resolve()
  163. })
  164. })
  165. },
  166. async getTeamHierarchyData(){
  167. return new Promise((resolve,reject)=>{
  168. this.$api.get('/getListByType/team_hierarchy').then(({data:res})=>{
  169. if(res.code!==0) return this.$showToast(res.msg)
  170. this.teamLevelData = res.data.map(d=>({name:d.dictLabel,id:d.dictValue}))
  171. resolve()
  172. })
  173. })
  174. },
  175. async showTeamInfo(){
  176. await this.getTeamScaleData()
  177. await this.getTeamHierarchyData()
  178. this.$api.get(`/core/user/team/${this.dto.teamId}`).then(({data:res})=>{
  179. if(res.code!==0) return this.$showToast(res.msg)
  180. this.teamInfo = res.data;
  181. this.teamInfo.functionsName = res.data.functions.map(f=>f.functionName).join('、');
  182. this.teamInfo.organizationsName = res.data.organizations.map(f=>f.orgName).join('、');
  183. this.teamInfo.address = res.data.provinceName+res.data.cityName;
  184. this.teamInfo.scaleName = this.teamScaleData.find(d=>d.id==res.data.scale).name;
  185. this.teamInfo.hierarchyName = this.teamLevelData.find(d=>d.id==res.data.hierarchy).name;
  186. this.teamInfoShow = true;
  187. })
  188. }
  189. }
  190. }
  191. </script>
  192. <style scoped lang="scss">
  193. .share-btn {
  194. background-color: transparent;
  195. border: none;
  196. padding: 0;
  197. margin: 0;
  198. line-height: 1;
  199. display: flex;
  200. flex-direction: column;
  201. justify-content: center;
  202. align-items: center;
  203. &::after {
  204. border: none;
  205. }
  206. }
  207. .qbox{
  208. width: 100%;
  209. height: 100%;
  210. .list{
  211. flex: 1;
  212. margin-top: 20rpx;
  213. &-item{
  214. width: 100%;
  215. background: #FFFFFF;
  216. border-radius: 24rpx;
  217. margin-top: 20rpx;
  218. padding: 99rpx 24rpx 19rpx;
  219. box-sizing: border-box;
  220. position: relative;
  221. display: block;
  222. &:first-child{
  223. margin-top: 0;
  224. }
  225. .status{
  226. width: 164rpx;
  227. height: 80rpx;
  228. padding: 14rpx 0 0 15rpx;
  229. box-sizing: border-box;
  230. position: absolute;
  231. left: 0;
  232. top: 0;
  233. image{
  234. width: 26rpx;
  235. height: 26rpx;
  236. }
  237. text{
  238. font-family: PingFangSC, PingFang SC;
  239. font-weight: 400;
  240. font-size: 24rpx;
  241. color: #FFFFFF;
  242. line-height: 30rpx;
  243. margin-left: 12rpx;
  244. }
  245. &.dwc{
  246. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/questionnaire_dwc.png') no-repeat;
  247. background-size: 100% 100%;
  248. text{
  249. color: #193D59;
  250. }
  251. }
  252. &.ywc{
  253. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/questionnaire_ywc.png') no-repeat;
  254. background-size: 100% 100%;
  255. }
  256. }
  257. .expand{
  258. width: 32rpx;
  259. height: 32rpx;
  260. position: absolute;
  261. top: 24rpx;
  262. right: 32rpx;
  263. }
  264. .title{
  265. font-family: PingFang-SC, PingFang-SC;
  266. font-weight: bold;
  267. font-size: 32rpx;
  268. color: #002846;
  269. line-height: 32rpx;
  270. }
  271. .name{
  272. font-family: PingFangSC, PingFang SC;
  273. font-weight: 400;
  274. font-size: 24rpx;
  275. color: #667E90;
  276. line-height: 24rpx;
  277. margin-top: 32rpx;
  278. }
  279. .bottom{
  280. margin-top: 30rpx;
  281. border-top: 1rpx solid #EFEFEF;
  282. padding-top: 20rpx;
  283. &-left{
  284. font-family: PingFangSC, PingFang SC;
  285. font-weight: 400;
  286. font-size: 24rpx;
  287. color: #667E90;
  288. line-height: 24rpx;
  289. }
  290. &-right{
  291. border-radius: 32rpx;
  292. background: linear-gradient( 90deg, #33A7A7 0%, #4DB2B2 100%);
  293. padding: 19rpx 22rpx;
  294. font-family: PingFangSC, PingFang SC;
  295. font-weight: 400;
  296. font-size: 26rpx;
  297. color: #FFFFFF;
  298. line-height: 26rpx;
  299. letter-spacing: 2rpx;
  300. }
  301. }
  302. }
  303. }
  304. .empty{
  305. flex: 1;
  306. }
  307. .dialog{
  308. position: fixed;
  309. left: 0;
  310. right: 0;
  311. top: 0;
  312. bottom: 0;
  313. background: rgba(0, 0, 0, .4);
  314. z-index: 1001;
  315. justify-content: flex-end;
  316. .dbox{
  317. width: 100%;
  318. height: 738rpx;
  319. background: #FFFFFF;
  320. box-shadow: 0rpx -2rpx 6rpx 0rpx rgba(0,0,0,0.07);
  321. border-radius: 24rpx 24rpx 0rpx 0rpx;
  322. padding: 48rpx 30rpx 0;
  323. box-sizing: border-box;
  324. &-top{
  325. &-title{
  326. width: calc(100% - 60rpx);
  327. font-family: PingFang-SC, PingFang-SC;
  328. font-weight: bold;
  329. font-size: 32rpx;
  330. color: #002846;
  331. line-height: 40rpx;
  332. }
  333. &-expand{
  334. width: 32rpx;
  335. height: 32rpx;
  336. transform: rotate(180deg);
  337. }
  338. }
  339. &-name {
  340. font-family: PingFangSC, PingFang SC;
  341. font-weight: 400;
  342. font-size: 24rpx;
  343. color: #667e90;
  344. line-height: 24rpx;
  345. margin-top: 24rpx;
  346. }
  347. &-status{
  348. width: 140rpx;
  349. margin-top: 28rpx;
  350. border-radius: 16rpx;
  351. padding: 11rpx 15rpx;
  352. box-sizing: border-box;
  353. &.dwc{
  354. background: #BA9B31;
  355. }
  356. &.ywc{
  357. background: #64BBBB;
  358. }
  359. image{
  360. width: 26rpx;
  361. height: 26rpx;
  362. }
  363. text{
  364. font-family: PingFangSC, PingFang SC;
  365. font-weight: 400;
  366. font-size: 24rpx;
  367. color: #193D59;
  368. line-height: 24rpx;
  369. margin-left: 12rpx;
  370. }
  371. }
  372. &-menu{
  373. margin-top: 43rpx;
  374. overflow: hidden;
  375. flex-wrap: wrap;
  376. justify-content: space-between;
  377. &-pre{
  378. width: calc(25% - 22.5rpx);
  379. background: #F7F8FA;
  380. border-radius: 24rpx;
  381. padding: 30rpx 20rpx;
  382. margin-top: 24rpx;
  383. box-sizing: border-box;
  384. image{
  385. width: 42rpx;
  386. height: 42rpx;
  387. }
  388. text{
  389. font-family: PingFangSC, PingFang SC;
  390. font-weight: 400;
  391. font-size: 24rpx;
  392. color: #002846;
  393. line-height: 24rpx;
  394. text-align: center;
  395. margin-top: 24rpx;
  396. }
  397. }
  398. }
  399. }
  400. }
  401. }
  402. </style>