receiveList.vue 12 KB

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