receiveList.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  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. let url = '/pagesHome/pdf';
  143. if(this.dto.type==2) url = '/pagesHome/pdfZyb'
  144. uni.navigateTo({ url })
  145. }
  146. },
  147. reviewReport(item){
  148. let url = '/pagesHome/pdf';
  149. if(item.type==2) url = '/pagesHome/pdfZyb'
  150. uni.navigateTo({ url })
  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. flex: 1;
  211. .list{
  212. flex: 1;
  213. margin-top: 20rpx;
  214. overflow: hidden;
  215. &-item{
  216. width: 100%;
  217. background: #FFFFFF;
  218. border-radius: 24rpx;
  219. margin-top: 20rpx;
  220. padding: 99rpx 24rpx 19rpx;
  221. box-sizing: border-box;
  222. position: relative;
  223. display: block;
  224. .status{
  225. width: 164rpx;
  226. height: 80rpx;
  227. padding: 14rpx 0 0 15rpx;
  228. box-sizing: border-box;
  229. position: absolute;
  230. left: 0;
  231. top: 0;
  232. image{
  233. width: 26rpx;
  234. height: 26rpx;
  235. }
  236. text{
  237. font-family: PingFangSC, PingFang SC;
  238. font-weight: 400;
  239. font-size: 24rpx;
  240. color: #FFFFFF;
  241. line-height: 30rpx;
  242. margin-left: 12rpx;
  243. }
  244. &.dwc{
  245. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/questionnaire_dwc.png') no-repeat;
  246. background-size: 100% 100%;
  247. text{
  248. color: #193D59;
  249. }
  250. }
  251. &.ywc{
  252. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/questionnaire_ywc.png') no-repeat;
  253. background-size: 100% 100%;
  254. }
  255. }
  256. .expand{
  257. width: 32rpx;
  258. height: 32rpx;
  259. position: absolute;
  260. top: 24rpx;
  261. right: 32rpx;
  262. }
  263. .title{
  264. font-family: PingFang-SC, PingFang-SC;
  265. font-weight: bold;
  266. font-size: 32rpx;
  267. color: #002846;
  268. line-height: 32rpx;
  269. }
  270. .name{
  271. font-family: PingFangSC, PingFang SC;
  272. font-weight: 400;
  273. font-size: 24rpx;
  274. color: #667E90;
  275. line-height: 24rpx;
  276. margin-top: 32rpx;
  277. }
  278. .bottom{
  279. margin-top: 30rpx;
  280. border-top: 1rpx solid #EFEFEF;
  281. padding-top: 20rpx;
  282. &-left{
  283. font-family: PingFangSC, PingFang SC;
  284. font-weight: 400;
  285. font-size: 24rpx;
  286. color: #667E90;
  287. line-height: 24rpx;
  288. }
  289. &-right{
  290. border-radius: 32rpx;
  291. background: linear-gradient( 90deg, #33A7A7 0%, #4DB2B2 100%);
  292. padding: 19rpx 22rpx;
  293. font-family: PingFangSC, PingFang SC;
  294. font-weight: 400;
  295. font-size: 26rpx;
  296. color: #FFFFFF;
  297. line-height: 26rpx;
  298. letter-spacing: 2rpx;
  299. }
  300. }
  301. }
  302. }
  303. .empty{
  304. flex: 1;
  305. }
  306. .dialog{
  307. position: fixed;
  308. left: 0;
  309. right: 0;
  310. top: 0;
  311. bottom: 0;
  312. background: rgba(0, 0, 0, .4);
  313. z-index: 1001;
  314. justify-content: flex-end;
  315. .dbox{
  316. width: 100%;
  317. height: 738rpx;
  318. background: #FFFFFF;
  319. box-shadow: 0rpx -2rpx 6rpx 0rpx rgba(0,0,0,0.07);
  320. border-radius: 24rpx 24rpx 0rpx 0rpx;
  321. padding: 48rpx 30rpx 0;
  322. box-sizing: border-box;
  323. &-top{
  324. &-title{
  325. width: calc(100% - 60rpx);
  326. font-family: PingFang-SC, PingFang-SC;
  327. font-weight: bold;
  328. font-size: 32rpx;
  329. color: #002846;
  330. line-height: 40rpx;
  331. }
  332. &-expand{
  333. width: 32rpx;
  334. height: 32rpx;
  335. transform: rotate(180deg);
  336. }
  337. }
  338. &-name {
  339. font-family: PingFangSC, PingFang SC;
  340. font-weight: 400;
  341. font-size: 24rpx;
  342. color: #667e90;
  343. line-height: 24rpx;
  344. margin-top: 24rpx;
  345. }
  346. &-status{
  347. width: 140rpx;
  348. margin-top: 28rpx;
  349. border-radius: 16rpx;
  350. padding: 11rpx 15rpx;
  351. box-sizing: border-box;
  352. &.dwc{
  353. background: #BA9B31;
  354. }
  355. &.ywc{
  356. background: #64BBBB;
  357. }
  358. image{
  359. width: 26rpx;
  360. height: 26rpx;
  361. }
  362. text{
  363. font-family: PingFangSC, PingFang SC;
  364. font-weight: 400;
  365. font-size: 24rpx;
  366. color: #193D59;
  367. line-height: 24rpx;
  368. margin-left: 12rpx;
  369. }
  370. }
  371. &-menu{
  372. margin-top: 43rpx;
  373. overflow: hidden;
  374. flex-wrap: wrap;
  375. justify-content: space-between;
  376. &-pre{
  377. width: calc(25% - 22.5rpx);
  378. background: #F7F8FA;
  379. border-radius: 24rpx;
  380. padding: 30rpx 20rpx;
  381. margin-top: 24rpx;
  382. box-sizing: border-box;
  383. image{
  384. width: 42rpx;
  385. height: 42rpx;
  386. }
  387. text{
  388. font-family: PingFangSC, PingFang SC;
  389. font-weight: 400;
  390. font-size: 24rpx;
  391. color: #002846;
  392. line-height: 24rpx;
  393. text-align: center;
  394. margin-top: 24rpx;
  395. }
  396. }
  397. }
  398. }
  399. }
  400. }
  401. </style>