receiveList.vue 12 KB

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