activedetails.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <view class="detail">
  3. <!-- 主体 -->
  4. <view class="deboxs">
  5. <view class="bghbox"></view>
  6. <view class="dbox fmt30">
  7. <view class="dtit">{{datainfo.activityTitle}}</view>
  8. <view class="titinf">
  9. <view class="txt"><text>活动类型</text>{{typeFormat(datainfo.activityType,hdlxlist)}}</view>
  10. <view class="txt"><text>活动日期</text>{{datainfo.activityDate}}</view>
  11. <view class="txt"><text>活动时间</text>{{datainfo.activityTime}}</view>
  12. <view class="txt"><text>活动地点</text>{{datainfo.activityAddress}}</view>
  13. <view class="txt"><text>参会人员</text>
  14. <block v-if="datainfo.zxActivityUserList&&datainfo.zxActivityUserList.length">
  15. <view v-for="(ite,idx) in datainfo.zxActivityUserList" :key="idx">{{ite.userName||ite.name}}
  16. <block v-if="idx<datainfo.zxActivityUserList.length-1">,</block>
  17. </view>
  18. </block>
  19. </view>
  20. <!-- <view class="txt"><text>备注</text>{{datainfo.remark}}</view> -->
  21. </view>
  22. </view>
  23. <view class="dbox">
  24. <view class="titbox mb14">
  25. <view class="tit flexc">
  26. <image :src="titimg"></image>
  27. <view>活动内容</view>
  28. </view>
  29. </view>
  30. <view class="txtbox" :class="zheList[0].zheflag?'nact':'act'">
  31. <rich-text :nodes="datainfo.activityDetails"></rich-text>
  32. </view>
  33. <view class="zhebox" :class="zheList[0].zheflag?'':'act'" @click="getZheFn(0)">
  34. <image :src="upsimg"></image>
  35. <view>{{zheList[0].zheflag?'展开信息':'折叠信息'}}</view>
  36. </view>
  37. <view class="bortop"></view>
  38. <view class="ftit mb14">附件信息</view>
  39. <view class="fjlists flext" v-for="(ite,idx) in filelist" :key='idx' @click="getDown(ite.url)">
  40. <view class="imgl"><image :src="fjimg" ></image></view>
  41. <view class="tit">{{ite.name}}</view>
  42. <view class="fjlook">查看</view>
  43. </view>
  44. </view>
  45. <view class="fbtns" style="flex-wrap: wrap;">
  46. <view class="btn btn3" @click="getDelFn" v-if="checkPermi(['zxActivity:activity:remove'])">删除</view>
  47. <view class="btn btn1" @click="getEditFn" v-if="checkPermi(['zxActivity:activity:edit'])">修改</view>
  48. <view class="btn btn2" @click="getScfkFn('chdf')" v-if="checkPermi(['zxActivity:activity:updateReply'])&&type=='hdtz'&&!dfinfo.isJoin">参会答复</view>
  49. </view>
  50. </view>
  51. <pop-up :type='ptype' :qjlxlist="qjlxlist" @getClose="getClose" @getupSubmit="getupSubmit"></pop-up>
  52. </view>
  53. </template>
  54. <script>
  55. import config from '@/config'
  56. const baseUrl = config.baseUrl
  57. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  58. import popUp from "@/work/components/popup/popup.vue"
  59. import noData from "@/components/nodata/nodata.vue"
  60. import {getDeptTree} from"@/api/mine/mine.js"
  61. import { selectValue,selectValuetext } from '@/utils/common.js';
  62. import {getzxActivityDetailFn,getzxActivityDelFn,getzxActivityReplyFn} from "@/api/mine/meeting.js"
  63. import {getDictionaryFn} from "@/api/mine/register.js"
  64. export default{
  65. components:{popUp,noData},
  66. data(){
  67. return{
  68. bgimg:require("@/static/images/bg.png"),
  69. fjimg:require("@/work/static/images/fjimg.png"),
  70. filelist:[],
  71. tabidx:5,
  72. titimg:require("@/work/static/images/titbg.png"),
  73. upsimg:require("@/work/static/images/ups.png"),
  74. zheList:[{val:0,zheflag:true,moreflag:true},],
  75. ptype:'',
  76. datainfo:{},
  77. tary:'',
  78. hdlxlist:[],
  79. qjlxlist:[],
  80. type:'',
  81. dfinfo:{}
  82. }
  83. },
  84. onUnload(){
  85. uni.$off('refreshdetail')
  86. },
  87. onLoad(e) {
  88. this.id=e.id;
  89. this.type=e.pt;
  90. this.getDetail()
  91. this.init()
  92. uni.$on('refreshdetail', (e) => {
  93. this.getDetail()
  94. })
  95. },
  96. methods:{
  97. checkPermi, checkRole,
  98. kaType(ite){
  99. if(ite){
  100. var newArr=ite.split(',')
  101. var actions=[];
  102. var datas=this.matterList;
  103. newArr.forEach(ite=>{
  104. Object.keys(datas).some((key) => {
  105. if (datas[key].value == ('' + ite)) {
  106. actions.push(datas[key].label);
  107. return true;
  108. }
  109. })
  110. })
  111. return actions.join(' ')
  112. }
  113. },
  114. typeFormat(ite,list){
  115. return selectValue(list, ite);
  116. },
  117. typeFormattext(ite,list){
  118. return selectValuetext(list, ite);
  119. },
  120. init(){
  121. // 活动类型
  122. getDictionaryFn('activity_type').then(res=>{
  123. if(res.code==200&&res.data.length){
  124. this.hdlxlist = res.data.map(v => {
  125. return {
  126. label: v.dictLabel,
  127. value:v.dictValue
  128. }
  129. })
  130. }
  131. })
  132. // 请假类型
  133. getDictionaryFn('leave').then(res=>{
  134. if(res.code==200&&res.data.length){
  135. this.qjlxlist = res.data.map(v => {
  136. return {
  137. text: v.dictLabel,
  138. value: v.dictValue
  139. }
  140. })
  141. }
  142. })
  143. },
  144. getupSubmit(e){
  145. var that=this;
  146. var type=this.ptype;
  147. var params=JSON.parse(JSON.stringify(e))
  148. params.activityId=this.id
  149. getzxActivityReplyFn(params).then(res=>{
  150. if(res.code==200){
  151. this.$toast("回复成功");
  152. setTimeout(function(){
  153. uni.$emit('refreshlist')
  154. that.ptype='';
  155. that.getDetail()
  156. },1200)
  157. }
  158. })
  159. },
  160. getEditFn(){
  161. this.$tab.navigateTo('/work/pages/meeting/addactive?type=edit&id='+this.id)
  162. },
  163. getClose(){
  164. this.ptype=""
  165. },
  166. getScfkFn(type){
  167. this.ptype=type
  168. },
  169. getZheFn(idx){
  170. this.zheList[idx].zheflag=!this.zheList[idx].zheflag
  171. },
  172. getDelFn(){
  173. var that=this;
  174. uni.showModal({
  175. title: '确认删除',
  176. content: "是否确认删除该活动",
  177. cancelText: '取消',
  178. confirmText: '确认',
  179. success: function(res) {
  180. if (res.confirm) {
  181. getzxActivityDelFn(that.id).then(res=>{
  182. if(res.code==200){
  183. that.$toast('删除成功')
  184. uni.$emit("refreshlist")
  185. setTimeout(function(){
  186. uni.navigateBack({
  187. delta: 1 //返回层数,2则上上页
  188. });
  189. },1200)
  190. }
  191. })
  192. } else if (res.cancel) {
  193. // console.log('用户点击取消');
  194. }
  195. }
  196. });
  197. },
  198. getDetail(){
  199. var params={
  200. activityId:this.id
  201. }
  202. if(this.type=='hdtz'){
  203. params.userId=this.userId
  204. }
  205. getzxActivityDetailFn(params).then(res=>{
  206. if(res.code==200){
  207. this.datainfo=res.data;
  208. if(res.data.zxActivityUserList){
  209. this.dfinfo=res.data.zxActivityUserList[0]
  210. }
  211. if(res.data.zxFjList&&res.data.zxFjList.length){
  212. this.filelist=JSON.parse(JSON.stringify(res.data.zxFjList))
  213. }
  214. }
  215. })
  216. },
  217. getDown(e){
  218. uni.showLoading({
  219. title: '加载中'
  220. });
  221. var url=baseUrl+e;
  222. uni.downloadFile({
  223. url: url,//文件的下载路径
  224. success(result) {
  225. uni.hideLoading()
  226. var filePath = result.tempFilePath;
  227. uni.openDocument({
  228. filePath: filePath,
  229. showMenu: true,
  230. success: function (res) {
  231. // console.log('打开文档成功');
  232. }
  233. });
  234. },
  235. fail(res) {uni.hideLoading()}
  236. })
  237. },
  238. }
  239. }
  240. </script>
  241. <style scoped lang="scss">
  242. .detail{display: flex;flex-direction: column;height: 100vh;}
  243. .deboxs{flex:1;overflow: auto;padding-bottom: 30rpx;
  244. .bghbox{height: 80rpx;background-color: $com-cd3;}
  245. .dbox{background: #FFFFFF;border-radius: 10rpx;margin: 0 24rpx 24rpx;padding: 36rpx 24rpx 24rpx;
  246. .dtit{font-weight: bold;font-size: 15px;color: #222327;margin-bottom: 48rpx;
  247. text{color: #E70000;}
  248. }
  249. .titbox{
  250. .tit{
  251. image{width: 32rpx;height: 18rpx;margin-right: 10rpx;}
  252. view{font-weight: bold;font-size: 32rpx;color: #222327;}
  253. }
  254. }
  255. .titinf{display: flex;flex-wrap: wrap;flex-direction: column;
  256. &.nact{height: 0;overflow: hidden;}
  257. &.act{height: auto;}
  258. .txt{font-weight: 500;font-size: 26rpx;margin-bottom: 20rpx;color: #222327;display: flex;align-items: flex-start;wi
  259. &.nact{height: 200rpx;overflow: hidden;}
  260. &.act{height: auto;}
  261. text{color: #AAAAAA;min-width: 104rpx;text-align-last: justify;flex: 0 0 auto;margin-right: 20rpx;
  262. &.w65{width: 130rpx;}
  263. }
  264. // view{text-indent: 2rem;}
  265. }
  266. }
  267. .txtbox{text-indent: 2rem;line-height: 36rpx;font-weight: 500;font-size: 26rpx;color: #222327;
  268. &.nact{max-height: 432rpx;overflow: hidden;}
  269. &.act{height: auto;}
  270. }
  271. // tab
  272. .dbtabs{
  273. .dbtab{font-weight: 500;font-size: 26rpx;height: 60rpx;line-height: 60rpx;color: #666666;position: relative;padding: 0 38rpx;margin-left: 8rpx;
  274. &.act{font-weight: bold;font-size: 30rpx;color: #222327;
  275. &::after{content: "";width: 48rpx;height: 4rpx;background: #3699FF;border-radius: 2rpx;position: absolute;left: 50%;margin-left: -24rpx;bottom: -4rpx;}
  276. }
  277. }
  278. }
  279. .bortop{border-top: 2rpx dashed #C1C1C1;margin-bottom: 32rpx;margin-top: 14rpx;width: 100%;}
  280. .ftit{font-weight: bold;font-size: 26rpx;color: #222327;}
  281. .zhebox{display: flex;align-items: center;flex-direction: column;padding: 24rpx 0;
  282. image{width: 28rpx;height: 30rpx;margin-bottom: 10rpx;transition: all 0.3s;}
  283. &.act{
  284. image{transform: rotate(-180deg);}
  285. }
  286. view{font-weight: 500;font-size: 24rpx;color: #AAAAAA;}
  287. }
  288. // 附件
  289. .fjlists {display: flex;align-items: flex-start;justify-content: space-between;margin-bottom: 12rpx;
  290. // image{margin-right: 18rpx;flex: 0 0 auto;}
  291. .imgl{width: 40rpx;height: 40rpx;display: flex;align-items: center;justify-content: center;margin-right: 6rpx;flex: 0 0 auto;
  292. image{width: 26rpx;height: 24rpx;}
  293. }
  294. .tit{font-size: 26rpx;color: #343434;font-weight: 500;margin-top: 4rpx;flex:1;}
  295. .fjlook{font-weight: 500;font-size: 26rpx;color: #1D64E2;flex: 0 0 auto;margin-left: 20rpx;margin-top: 4rpx;}
  296. }
  297. }
  298. }
  299. // 按钮
  300. .fbtns{display: flex;align-items: center;justify-content: space-between;padding: 54rpx 12rpx 34rpx;display: flex;flex-wrap: wrap;
  301. .btn{height: 80rpx;font-weight: bold;font-size: 30rpx;box-sizing: border-box;border-radius: 40rpx;display: flex;align-items: center;
  302. justify-content: center;margin:0 12rpx;flex:1;
  303. &.btn1{border: 2rpx solid #1D64E2;background: #ffffff;color: #1D64E2;}
  304. &.btn2{background: #1D64E2;color: #ffffff;}
  305. &.btn3{border: 2rpx solid #FF0000;background: #ffffff;color: #FF0000;}
  306. }
  307. }
  308. </style>