meeting.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <view :style="'padding-top:'+nvaHeight+'px;'">
  3. <view class="navbox">
  4. <uni-nav-bar color="#ffffff" left-icon="left" title="会议预订" :background-color="backgroundColor"
  5. :border="false" statusBar='true' fixed="true" @clickLeft='getBack'>
  6. </uni-nav-bar>
  7. </view>
  8. <image :src="navbg" class="navbg"></image>
  9. <view class="zxmain">
  10. <view class="ytbox">
  11. <uni-forms ref="form" class="ytforms" :rules="rules" :modelValue="datainfo">
  12. <view class="ytsbox">
  13. <view class="yttit">预订信息</view>
  14. <view class="pt5">
  15. <uni-forms-item label="预定人员" class="disable" name="visitName">
  16. <view class="intit">{{datainfo.orderUser}}</view>
  17. </uni-forms-item>
  18. <uni-forms-item label="开始时间" name="startTime">
  19. <uni-datetime-picker v-model="datainfo.startTime">
  20. <view class="pickbox flexc">
  21. <view :class="datainfo.startTime?'txr flex1':'coa txr flex1'">{{datainfo.startTime || "请选择开始时间"}}</view>
  22. <image :src="hupimg" class="hupimg"></image>
  23. </view>
  24. </uni-datetime-picker>
  25. </uni-forms-item>
  26. <uni-forms-item label="结束时间" name="endTime">
  27. <uni-datetime-picker v-model="datainfo.endTime" :start="datainfo.startTime">
  28. <view class="pickbox flexc">
  29. <view :class="datainfo.endTime?'txr flex1':'coa txr flex1'">{{datainfo.endTime || "请选择结束时间"}}</view>
  30. <image :src="hupimg" class="hupimg"></image>
  31. </view>
  32. </uni-datetime-picker>
  33. </uni-forms-item>
  34. <uni-forms-item label="会议室" name="appointmentSite">
  35. <view class="flex1">
  36. <w-select
  37. :list='hyslist'
  38. v-model="chooseValue"
  39. valueName='conferenceRoomName'
  40. keyName="conferenceRoomId"
  41. :filterable='filterable'
  42. width='100%'
  43. height="36px"
  44. @change='getchangeb'
  45. >
  46. </w-select>
  47. </view>
  48. <!-- <picker class="pickbox" range-key='dictLabel' :value="hysidx"
  49. :range="hyslist" @change="bindTimeChangea">
  50. <view class="flexc flex1">
  51. <view class="flex1 f14" v-if="datainfo.conferenceRoomName&&!hys">{{statusFormat(datainfo.conferenceRoomName,hyslist,'hys')}}</view>
  52. <view class="flex1 f14" v-else :class="hys?'':'coa'">{{hys||"请选择会议室"}}</view>
  53. <image :src="hupimg" class="hupimg"></image>
  54. </view>
  55. </picker> -->
  56. </uni-forms-item>
  57. <uni-forms-item label="会议名称" name="conferenceName">
  58. <uni-easyinput :inputBorder="false" type="textarea" autoHeight v-model="datainfo.conferenceName"
  59. placeholder="输入会议名称">
  60. </uni-easyinput>
  61. </uni-forms-item>
  62. <uni-forms-item label="参会人数" name="conferenceNumber">
  63. <uni-easyinput :inputBorder="false" v-model="datainfo.conferenceNumber"
  64. type="number"
  65. placeholder="输入参会人数">
  66. </uni-easyinput>
  67. </uni-forms-item>
  68. </view>
  69. <view class="ybtn flexcc" @click="getSubmit">确认提交</view>
  70. <view class="tips">* 为避免重复操作,请先选择时间查看当前会议室是否被占用。</view>
  71. </view>
  72. </uni-forms>
  73. </view>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  79. import {getRoomNoList,getRoomyyAdd,getRoomyyPut,getRoomyyDetail} from "@/api/mine/work.js"
  80. import {getDictionaryFn} from "@/api/mine/register.js"
  81. import wSelect from "@/work/components/w-select/w-select.vue"
  82. export default {
  83. components: {wSelect},
  84. data() {
  85. return {
  86. hupimg:require("@/static/images/order/hup.png"),
  87. navbg:require("@/static/images/navbg.png"),
  88. backgroundColor: "transparent",
  89. nvaHeight: 44,
  90. marTop: 0, //距离顶部的距离
  91. stubarHeight: 0, //
  92. datainfo:{
  93. "conferenceRoomId": "",//会议室ID
  94. "conferenceRoomName": "",//会议室名称
  95. "conferenceRoomAddress": "",//会议室地址
  96. "orderUser": "",//会议室预约人员名称
  97. "orderUserId": "",//会议室预约人员id(用户id)
  98. "conferenceName": "",//会议名称
  99. "conferenceNumber": "",//会议室人数
  100. "startTime": "",//会议开始时间
  101. "endTime": "",//会议结束时间
  102. },
  103. rules: {
  104. startTime: {rules: [{required: true,errorMessage: '请选择开始时间',}]},
  105. endTime: {rules: [{required: true,errorMessage: '请选择结束时间' } ]},
  106. conferenceRoomName: {rules: [{required: true,errorMessage: '请选择会议室'} ]},
  107. conferenceName: {rules: [{required: true,errorMessage: '请输入会议名称'} ]},
  108. conferenceNumber: {rules: [{required: true,errorMessage: '请输入会议人数'} ]},
  109. },
  110. hys:'',
  111. hysidx:'',
  112. hyslist:[],
  113. ptype:'add',
  114. id:'',
  115. filterable:true,
  116. chooseValue:'',
  117. name:this.$store.state.user.nickName,
  118. userId:this.$store.state.user.userId,
  119. }
  120. },
  121. onPageScroll(e) {
  122. var scrollTop = Number(e.scrollTop);
  123. if (scrollTop > 0) {
  124. this.backgroundColor = '#0491FD'
  125. } else {
  126. this.backgroundColor = 'transparent'
  127. }
  128. },
  129. onLoad: function(e) {
  130. if(e.data){
  131. var data=JSON.parse(decodeURIComponent(e.data))
  132. if(data.type){
  133. this.ptype=data.type;
  134. this.id=data.id;
  135. this.getDetail()
  136. }
  137. }else{
  138. this.datainfo.orderUser=this.name;
  139. this.datainfo.orderUserId=this.userId;
  140. }
  141. // this.init()
  142. this.getRoomNoList()
  143. uni.getSystemInfo({
  144. success: (e) => {
  145. this.stubarHeight = Number(e.statusBarHeight);
  146. this.nvaHeight = Number(e.statusBarHeight) + 44;
  147. }
  148. })
  149. },
  150. onShow() {},
  151. methods: {
  152. checkPermi,
  153. checkRole,
  154. getBack() {
  155. uni.navigateBack({
  156. delta: 1
  157. })
  158. },
  159. bindTimeChangea(e){
  160. var val=e.detail.value;
  161. // this.day=val
  162. },
  163. init() {
  164. // 门卫
  165. // getDictionaryFn('is_read').then(res=>{
  166. // if(res.code==200){
  167. // this.ydztlist = res.data.map(v => {
  168. // return {
  169. // label: v.dictLabel,
  170. // value: v.dictValue
  171. // }
  172. // })
  173. // }
  174. // })
  175. },
  176. statusFormat(ite,list,type) {
  177. var aite=selectValueKey(list, ite);
  178. if(type=='hys'){
  179. this.hysidx=aite.key
  180. }
  181. return aite.actions;
  182. },
  183. getSubmit(){
  184. var that=this;
  185. this.$refs.form.validate().then(res => {
  186. var params = JSON.parse(JSON.stringify(this.datainfo))
  187. if(!params.conferenceRoomName){
  188. this.$toast("请选择会议室")
  189. return
  190. }
  191. var regex = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/;
  192. var s=regex.test(params.startTime);
  193. var e=regex.test(params.endTime);
  194. if(!s){
  195. that.$toast("请选择完整的开始时间")
  196. return
  197. }
  198. if(!e){
  199. that.$toast("请选择完整的结束时间")
  200. return
  201. }
  202. if(this.ptype=='add'){
  203. getRoomyyAdd(params).then(res => {
  204. if (res.code == 200) {
  205. this.$toast("新增成功")
  206. uni.$emit('refreshmeetlist')
  207. setTimeout(function(){
  208. uni.navigateBack({
  209. delta:1
  210. })
  211. },1200)
  212. } else {
  213. this.$toast(res.msg)
  214. }
  215. })
  216. }else{
  217. getRoomyyPut(params).then(res => {
  218. if (res.code == 200) {
  219. this.$toast("修改成功")
  220. uni.$emit('refreshmeetlist')
  221. setTimeout(function(){
  222. uni.navigateBack({
  223. delta:1
  224. })
  225. },1200)
  226. } else {
  227. this.$toast(res.msg)
  228. }
  229. })
  230. }
  231. })
  232. },
  233. getchangeb(e){
  234. this.datainfo.conferenceRoomId=e.conferenceRoomId;
  235. this.datainfo.conferenceRoomName=e.conferenceRoomName;
  236. this.datainfo.conferenceRoomAddress=e.conferenceRoomAddress;
  237. },
  238. getRoomNoList() {
  239. getRoomNoList().then(res => {
  240. if (res.code == 200) {
  241. this.hyslist=res.rows
  242. } else {
  243. this.$toast(res.msg)
  244. }
  245. })
  246. },
  247. getDetail(){
  248. getRoomyyDetail(this.id).then(res=>{
  249. if(res.code==200){
  250. this.datainfo=res.data;
  251. this.chooseValue=res.data.conferenceRoomId
  252. }
  253. })
  254. }
  255. },
  256. }
  257. </script>
  258. <style>
  259. /* page {
  260. background: #ffffff;
  261. } */
  262. </style>
  263. <style lang="scss" scoped>
  264. .ytbox /deep/ .uni-forms .uni-forms-item{padding: 10rpx 26rpx 10rpx;border: 2rpx solid #0391FD;margin-bottom: 24rpx;border-radius: 12rpx;}
  265. .ytbox /deep/ .uni-forms-item__label{flex: 0 0 auto;width: 144rpx !important;font-size: 28rpx;font-weight: bold;position: relative;color: #161616;text-align-last: justify;}
  266. .ytbox /deep/ .uni-forms-item__label text{flex: 1;}
  267. .ytbox /deep/ .uni-forms-item__label .is-required{position: absolute;right: 0;color: #F10C31;margin-top: 16rpx;}
  268. .ytbox /deep/ uni-textarea{flex: 1;width: auto;text-align: right;}
  269. .ytbox /deep/ .uni-textarea-placeholder{font-size: 28rpx;color: #aaaaaa !important;}
  270. .ytbox /deep/ .uni-easyinput__placeholder-class{font-size: 28rpx;color: #aaaaaa;}
  271. .ytbox /deep/ .uni-forms-item__content{display: flex;align-items: center;flex-direction: row;}
  272. .ytbox /deep/ .uni-easyinput{flex: 1;text-align: right;}
  273. .ytbox /deep/ .uni-easyinput__content-input{font-size: 28rpx;}
  274. .ytbox /deep/ .uni-forms-item__error{margin-top:0rpx;left: auto;right: 0;}
  275. .ytbox /deep/ .uni-easyinput__content-textarea{min-height: 48rpx;}
  276. .disable{background: #EFF0F2;border: none !important;}
  277. .ytbox{width: 684rpx;margin: 0 auto;padding-top: 24rpx;position: relative;flex: 1;overflow: auto;background-color: #ffffff;padding-bottom: 4rpx;border-radius: 14rpx;}
  278. .ytforms{
  279. .yttit{font-size: 28rpx;font-weight: bold;margin-bottom: 56rpx;
  280. color: #161616;display: flex;align-items: center;padding: 0rpx 26rpx;box-sizing: border-box;position: relative;
  281. &::before{content: '';width: 6rpx;height: 34rpx;background: $com-cd3;border-radius: 4rpx;position: absolute;top: 50%;transform: translateY(-50%);left: 0rpx;}
  282. }
  283. .ytsbox{background-color: #ffffff;padding: 32rpx 28rpx 0;border-radius: 14rpx;margin-bottom: 24rpx;
  284. .intit{font-weight: 500;flex: 1;font-size: 26rpx;text-align: right;color: #666666;}
  285. .pickbox{flex: 1;text-align: right;font-weight: 500;font-size: 28rpx;color: #161616;
  286. .hupimg{width: 18rpx;height: 14rpx;margin-left: 12rpx;flex: 0 0 auto;}
  287. }
  288. }
  289. }
  290. // 按钮
  291. .ybtn{width: 100%;height: 90rpx;background: $com-cd3;border-radius: 14rpx;margin: 100rpx auto 0;font-size: 28rpx;font-weight: 500;color: #FFFFFF;
  292. &.btn1{background-color: #9a9c9e;}
  293. }
  294. .tips{font-weight: bold;margin-top: 28rpx;
  295. font-size: 22rpx;line-height: 34rpx;
  296. color: #FF0000;}
  297. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  298. .navbg{width: 100%;height: 692rpx;}
  299. .zxmain{position: relative;padding: 20rpx 32rpx 40rpx;box-sizing: border-box;display: flex;
  300. min-height: calc(100vh - 44px);
  301. }
  302. </style>