receiveList.vue 12 KB

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