meetadd.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  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. <!-- 预定会议室 -->
  13. <view v-show="stepval==1">
  14. <view class="ytsbox">
  15. <view class="yttit">选择会议室</view>
  16. <view class="mb12" v-for="(ite,idx) in hyslist" :key="ite.conferenceRoomId">
  17. <view class="mlists" :class="meetid==ite.conferenceRoomId?'act':''" @click="getMeetId(ite)">
  18. <!-- 会议图片 -->
  19. <view class="banbox mb12" v-if="ite.conferenceRoomUrl&&meetid==ite.conferenceRoomId" @click.stop="getStop">
  20. <hys-banner :bannerlist="ite.conferenceRoomUrl"></hys-banner>
  21. </view>
  22. <view class="flexc" >
  23. <view class="mtit">{{ite.conferenceRoomName}}</view>
  24. <view class="mtxt bga" v-if="ite.type=='N'"><text class="cir"></text>当前空闲</view>
  25. <view class="mtxt bgb" v-if="ite.type=='Y'"><text class="cir"></text>当前占用</view>
  26. </view>
  27. </view>
  28. <!--已经预约的时间段 -->
  29. <view class="tlist" v-show="meetid==ite.conferenceRoomId">
  30. <view class="ttips flexc">
  31. <image :src="tipimg"></image>已被预约时段
  32. </view>
  33. <block v-if="ite.conferenceRoomOrderList&&ite.conferenceRoomOrderList.length">
  34. <view class="ttime flexc" v-for="(tite,tidx) in ite.conferenceRoomOrderList" :key="tite.conferenceRoomOrderId">
  35. <view class="cir"></view>
  36. {{tite.startTime}} 至 {{tite.endTime}}
  37. </view>
  38. </block>
  39. <view v-else class="ttime">当前会议室空闲,无预约记录</view>
  40. </view>
  41. </view>
  42. <view class="ybtn flexcc" @click="getNextFn">下一步</view>
  43. <view class="tips">* 为避免您的重复操作,请避开会议室已被预约时段</view>
  44. </view>
  45. </view>
  46. <view v-show="stepval==2">
  47. <view class="ytsbox">
  48. <view class="yttit">填写预订信息</view>
  49. <view class="pt5">
  50. <uni-forms-item label="预定人员" class="disable" name="visitName">
  51. <view class="intit">{{datainfo.orderUser}}</view>
  52. </uni-forms-item>
  53. <uni-forms-item label="会议名称" name="conferenceName">
  54. <uni-easyinput :inputBorder="false" type="textarea" autoHeight v-model="datainfo.conferenceName"
  55. placeholder="输入会议名称">
  56. </uni-easyinput>
  57. </uni-forms-item>
  58. <uni-forms-item label="开始时间" name="startTime">
  59. <uni-datetime-picker v-model="datainfo.startTime" @change="getChangeaFn">
  60. <view class="pickbox flexc">
  61. <view :class="datainfo.startTime?'txr flex1':'coa txr flex1'">{{datainfo.startTime || "请选择开始时间"}}</view>
  62. <image :src="hupimg" class="hupimg"></image>
  63. </view>
  64. </uni-datetime-picker>
  65. </uni-forms-item>
  66. <uni-forms-item label="结束时间" name="endTime">
  67. <uni-datetime-picker v-model="datainfo.endTime" @change="getChangebFn" :start="datainfo.startTime">
  68. <view class="pickbox flexc">
  69. <view :class="datainfo.endTime?'txr flex1':'coa txr flex1'">{{datainfo.endTime || "请选择结束时间"}}</view>
  70. <image :src="hupimg" class="hupimg"></image>
  71. </view>
  72. </uni-datetime-picker>
  73. </uni-forms-item>
  74. <uni-forms-item label="参会人数" name="conferenceNumber">
  75. <uni-easyinput :inputBorder="false" v-model="datainfo.conferenceNumber"
  76. type="number"
  77. placeholder="输入参会人数">
  78. </uni-easyinput>
  79. </uni-forms-item>
  80. <view class="textarea">
  81. <uni-easyinput :inputBorder="false" type="textarea" autoHeight v-model="datainfo.remark"
  82. placeholder="请输入会议要求…">
  83. </uni-easyinput>
  84. </view>
  85. <view class="chose" @click="getCkFn">
  86. <image :src="choseimg" v-if="datainfo.useXk=='Y'"></image>
  87. <image :src="nchoseimg" v-else></image>
  88. 需要准备席卡
  89. </view>
  90. <view class="textarea" v-if="datainfo.useXk=='Y'">
  91. <uni-easyinput :inputBorder="false" type="textarea" autoHeight v-model="datainfo.xkDetail"
  92. placeholder="请输入需要准备席卡人员">
  93. </uni-easyinput>
  94. </view>
  95. <!-- <uni-forms-item label="会议室" name="appointmentSite">
  96. <view class="flex1">
  97. <w-select
  98. :list='hyslist'
  99. v-model="chooseValue"
  100. valueName='conferenceRoomName'
  101. keyName="conferenceRoomId"
  102. :filterable='filterable'
  103. width='100%'
  104. height="36px"
  105. @change='getchangeb'
  106. >
  107. </w-select>
  108. </view>
  109. </uni-forms-item> -->
  110. </view>
  111. <view class="flexc">
  112. <view class="ybtn flexcc ybga mr20" @click="getPreFn">上一步</view>
  113. <view class="ybtn flexcc" @click="getSubmit">确认提交</view>
  114. </view>
  115. <view class="tips">* 为避免您的重复操作,请先仔细查看已预约时段。</view>
  116. </view>
  117. </view>
  118. </uni-forms>
  119. </view>
  120. </view>
  121. </view>
  122. </template>
  123. <script>
  124. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  125. import {getRoomNoList,getRoomyyAdd,getRoomyyPut,getRoomyyDetail,getRoomtimeNoList} from "@/api/mine/work.js"
  126. import {getDictionaryFn} from "@/api/mine/register.js"
  127. import wSelect from "@/work/components/w-select/w-select.vue"
  128. import hysBanner from "@/work/components/yuyue/hysbanner.vue"
  129. export default {
  130. components: {wSelect,hysBanner},
  131. data() {
  132. return {
  133. hupimg:require("@/static/images/order/hup.png"),
  134. navbg:require("@/static/images/navbg.png"),
  135. tipimg:require("@/work/static/yuy/tips.png"),
  136. choseimg:require("@/work/static/yuy/chose.png"),
  137. nchoseimg:require("@/work/static/yuy/nchose.png"),
  138. backgroundColor: "transparent",
  139. nvaHeight: 44,
  140. marTop: 0, //距离顶部的距离
  141. stubarHeight: 0, //
  142. datainfo:{
  143. "conferenceRoomId": "",//会议室ID
  144. "conferenceRoomName": "",//会议室名称
  145. "conferenceRoomAddress": "",//会议室地址
  146. "orderUser": "",//会议室预约人员名称
  147. "orderUserId": "",//会议室预约人员id(用户id)
  148. "conferenceName": "",//会议名称
  149. "conferenceNumber": "",//会议室人数
  150. "startTime": "",//会议开始时间
  151. "endTime": "",//会议结束时间
  152. 'useXk':'N',//是否需要席卡 N:不需要 Y:需要
  153. 'remark':'',//说明
  154. },
  155. rules: {
  156. startTime: {rules: [{required: true,errorMessage: '请选择开始时间',}]},
  157. endTime: {rules: [{required: true,errorMessage: '请选择结束时间' } ]},
  158. conferenceRoomName: {rules: [{required: true,errorMessage: '请选择会议室'} ]},
  159. conferenceName: {rules: [{required: true,errorMessage: '请输入会议名称'} ]},
  160. conferenceNumber: {rules: [{required: true,errorMessage: '请输入会议人数'} ]},
  161. },
  162. meetid:0,
  163. hys:'',
  164. hysidx:'',
  165. hyslist:[],
  166. ptype:'add',
  167. stepval:1,//
  168. id:'',
  169. filterable:true,
  170. chooseValue:'',
  171. name:this.$store.state.user.nickName,
  172. userId:this.$store.state.user.userId,
  173. bannerlist:[]
  174. }
  175. },
  176. onPageScroll(e) {
  177. var scrollTop = Number(e.scrollTop);
  178. if (scrollTop > 0) {
  179. this.backgroundColor = '#0491FD'
  180. } else {
  181. this.backgroundColor = 'transparent'
  182. }
  183. },
  184. onLoad: function(e) {
  185. if(e.data){
  186. var data=JSON.parse(decodeURIComponent(e.data))
  187. if(data.type){
  188. this.ptype=data.type;
  189. this.id=data.id;
  190. this.getDetail()
  191. }
  192. }else{
  193. this.datainfo.orderUser=this.name;
  194. this.datainfo.orderUserId=this.userId;
  195. }
  196. // this.init()
  197. this.getRoomNoList()
  198. uni.getSystemInfo({
  199. success: (e) => {
  200. this.stubarHeight = Number(e.statusBarHeight);
  201. this.nvaHeight = Number(e.statusBarHeight) + 44;
  202. }
  203. })
  204. },
  205. onShow() {},
  206. methods: {
  207. checkPermi,
  208. checkRole,
  209. getBack() {
  210. uni.navigateBack({
  211. delta: 1
  212. })
  213. },
  214. getStop(){
  215. },
  216. bindTimeChangea(e){
  217. var val=e.detail.value;
  218. // this.day=val
  219. },
  220. init() {
  221. // 门卫
  222. // getDictionaryFn('is_read').then(res=>{
  223. // if(res.code==200){
  224. // this.ydztlist = res.data.map(v => {
  225. // return {
  226. // label: v.dictLabel,
  227. // value: v.dictValue
  228. // }
  229. // })
  230. // }
  231. // })
  232. },
  233. statusFormat(ite,list,type) {
  234. var aite=selectValueKey(list, ite);
  235. if(type=='hys'){
  236. this.hysidx=aite.key
  237. }
  238. return aite.actions;
  239. },
  240. getChangeaFn(e){
  241. this.datainfo.startTime=e
  242. var endTime=this.datainfo.endTime;
  243. if(endTime){
  244. var startime=new Date(e).getTime()
  245. var endtime=new Date(endTime).getTime()
  246. if(startime>endtime){
  247. this.$toast('开始时间大于开始时间')
  248. this.datainfo.endTime=''
  249. }
  250. }
  251. },
  252. getChangebFn(e){
  253. var that=this;
  254. var startt=this.datainfo.startTime;
  255. if(!startt){
  256. this.$toast('请选择开始时间')
  257. setTimeout(function(){
  258. that.datainfo.endTime='';
  259. },200)
  260. return
  261. }
  262. var startime=new Date(startt).getTime()
  263. var endtime=new Date(e).getTime()
  264. if(startime>endtime){
  265. setTimeout(function(){
  266. that.datainfo.endTime='';
  267. },200)
  268. this.$toast('请选择时间大于开始时间')
  269. return
  270. }
  271. this.datainfo.endTime=e
  272. },
  273. getMeetId(ite){
  274. var id=ite.conferenceRoomId;
  275. var name=ite.conferenceRoomName;
  276. var adress=ite.conferenceRoomAddress
  277. this.meetid=id;
  278. this.datainfo.conferenceRoomId=id;
  279. this.datainfo.conferenceRoomName=name;
  280. this.datainfo.conferenceRoomAddress=adress;
  281. },
  282. getCkFn(){
  283. var useXk=this.datainfo.useXk;
  284. if(useXk=='Y'){
  285. this.datainfo.useXk='N'
  286. }else{
  287. this.datainfo.useXk='Y'
  288. }
  289. },
  290. getPreFn(){
  291. uni.pageScrollTo({
  292. scrollTop: 0,
  293. duration: 0
  294. })
  295. this.stepval=Number(this.stepval)-1
  296. },
  297. getNextFn(){
  298. if(!this.datainfo.conferenceRoomId){
  299. this.$toast("请选择会议室")
  300. return
  301. }
  302. uni.pageScrollTo({
  303. scrollTop: 0,
  304. duration: 0
  305. })
  306. this.stepval=Number(this.stepval)+1
  307. },
  308. getSubmit(){
  309. var that=this;
  310. this.$refs.form.validate().then(res => {
  311. var params = JSON.parse(JSON.stringify(this.datainfo))
  312. if(this.ptype=='add'){
  313. getRoomyyAdd(params).then(res => {
  314. if (res.code == 200) {
  315. this.$toast("新增成功")
  316. uni.$emit('refreshmeetlist')
  317. setTimeout(function(){
  318. uni.navigateBack({
  319. delta:1
  320. })
  321. },1200)
  322. } else {
  323. this.$toast(res.msg)
  324. }
  325. })
  326. }else{
  327. getRoomyyPut(params).then(res => {
  328. if (res.code == 200) {
  329. this.$toast("修改成功")
  330. uni.$emit('refreshmeetlist')
  331. setTimeout(function(){
  332. uni.navigateBack({
  333. delta:1
  334. })
  335. },1200)
  336. } else {
  337. this.$toast(res.msg)
  338. }
  339. })
  340. }
  341. })
  342. },
  343. getchangeb(e){
  344. this.datainfo.conferenceRoomId=e.conferenceRoomId;
  345. this.datainfo.conferenceRoomName=e.conferenceRoomName;
  346. this.datainfo.conferenceRoomAddress=e.conferenceRoomAddress;
  347. },
  348. getRoomNoList() {
  349. getRoomNoList().then(res => {
  350. if (res.code == 200) {
  351. var newArr=res.rows;
  352. newArr.forEach(ite=>{
  353. if(ite.conferenceRoomUrl){
  354. ite.conferenceRoomUrl=ite.conferenceRoomUrl.split(',')
  355. }
  356. })
  357. this.hyslist=newArr
  358. } else {
  359. this.$toast(res.msg)
  360. }
  361. })
  362. },
  363. getDetail(){
  364. getRoomyyDetail(this.id).then(res=>{
  365. if(res.code==200){
  366. this.datainfo=res.data;
  367. this.meetid=res.data.conferenceRoomId;
  368. // this.chooseValue=res.data.conferenceRoomId
  369. }
  370. })
  371. }
  372. },
  373. }
  374. </script>
  375. <style>
  376. /* page {
  377. background: #ffffff;
  378. } */
  379. </style>
  380. <style lang="scss" scoped>
  381. .ytbox /deep/ .uni-forms .uni-forms-item{padding: 10rpx 26rpx 10rpx;border: 2rpx solid #0391FD;margin-bottom: 24rpx;border-radius: 12rpx;min-height: 90rpx;}
  382. .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;height: 66rpx;}
  383. .ytbox /deep/ .uni-forms-item__label text{flex: 1;}
  384. .ytbox /deep/ .uni-forms-item__label .is-required{position: absolute;right: 0;color: #F10C31;margin-top: 16rpx;}
  385. .ytbox /deep/ uni-textarea{flex: 1;width: auto;text-align: right;}
  386. .ytbox .textarea /deep/ uni-textarea{flex: 1;width: auto;text-align: left;padding: 26rpx;font-size: 28rpx;min-height: 192rpx;box-sizing: border-box;border-radius: 3px;
  387. border: 2rpx solid #0391FD;margin: 0;}
  388. .ytbox /deep/ .uni-textarea-placeholder{font-size: 28rpx;color: #aaaaaa !important;}
  389. .ytbox /deep/ .uni-easyinput__placeholder-class{font-size: 28rpx;color: #aaaaaa;}
  390. .ytbox /deep/ .uni-forms-item__content{display: flex;align-items: center;flex-direction: row;}
  391. .ytbox /deep/ .uni-easyinput{flex: 1;text-align: right;}
  392. .ytbox /deep/ .uni-easyinput__content-input{font-size: 28rpx;}
  393. .ytbox /deep/ .uni-forms-item__error{margin-top:0rpx;left: auto;right: 0;}
  394. .ytbox /deep/ .uni-easyinput__content-textarea{min-height: 42rpx;}
  395. .disable{background: #EFF0F2;border: none !important;}
  396. .ytbox{width: 684rpx;margin: 0 auto;padding-top: 24rpx;position: relative;flex: 1;overflow: auto;background-color: #ffffff;padding-bottom: 4rpx;border-radius: 14rpx;}
  397. .ytforms{
  398. .yttit{font-size: 28rpx;font-weight: bold;margin-bottom: 56rpx;
  399. color: #161616;display: flex;align-items: center;padding: 0rpx 26rpx;box-sizing: border-box;position: relative;
  400. &::before{content: '';width: 6rpx;height: 34rpx;background: $com-cd3;border-radius: 4rpx;position: absolute;top: 50%;transform: translateY(-50%);left: 0rpx;}
  401. }
  402. .ytsbox{background-color: #ffffff;padding: 32rpx 28rpx 0;border-radius: 14rpx;margin-bottom: 24rpx;
  403. .intit{font-weight: 500;flex: 1;font-size: 26rpx;text-align: right;color: #666666;}
  404. .pickbox{flex: 1;text-align: right;font-weight: 500;font-size: 28rpx;color: #161616;
  405. .hupimg{width: 18rpx;height: 14rpx;margin-left: 12rpx;flex: 0 0 auto;}
  406. }
  407. .chose{display: flex;align-items: center;font-weight: 500;font-size: 28rpx;color: #161616;margin: 34rpx 0 24rpx;
  408. image{width: 26rpx;height: 24rpx;margin-right: 18rpx;flex: 0 0 auto;}
  409. }
  410. }
  411. }
  412. // 按钮
  413. .ybtn{width: 100%;height: 90rpx;background: $com-cd3;border-radius: 14rpx;margin: 76rpx auto 0;font-size: 28rpx;font-weight: 500;color: #FFFFFF;
  414. &.btn1{background-color: #9a9c9e;}
  415. &.ybga{background-color: #e6efff;color:#0391fd ;}
  416. }
  417. .tips{font-weight: bold;margin-top: 28rpx;
  418. font-size: 22rpx;line-height: 34rpx;
  419. color: #FF0000;}
  420. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  421. .navbg{width: 100%;height: 692rpx;}
  422. .zxmain{position: relative;padding: 20rpx 32rpx 40rpx;box-sizing: border-box;display: flex;
  423. min-height: calc(100vh - 44px);
  424. }
  425. // 会议室列表
  426. .mlists{border-radius: 6rpx;border: 2rpx solid #C1C1C1;min-height: 90rpx;box-sizing: border-box;
  427. padding: 24rpx 26rpx;
  428. &.act{border: 2rpx solid #0391FD;
  429. .mtit{font-weight: bold;color: #0391FD;}
  430. }
  431. .mtit{font-weight: 500;font-size: 28rpx;color: #161616;flex: 1;margin-right: 16rpx;}
  432. .mtxt{font-weight: 500;font-size: 26rpx;flex: 0 0 auto;
  433. &.bga{color: #0AC86E;
  434. .cir{background: #0AC86E;}
  435. }
  436. &.bgb{color: #FF6969;
  437. .cir{background: #FF6969;}
  438. }
  439. .cir{width: 12rpx;height: 12rpx;margin-right: 16rpx;border-radius: 50%;display: inline-block;}
  440. }
  441. }
  442. .tlist{padding-top: 30rpx;
  443. .ttips{font-weight: bold;font-size: 28rpx;color: #161616;
  444. image{width: 26rpx;height: 28rpx;margin-right: 16rpx;flex: 0 0 auto;}
  445. }
  446. // padding: 24rpx 0 36rpx 38rpx;
  447. .ttime{font-weight: 500;font-size: 26rpx;color: #161616;padding-left: 38rpx;padding-top: 24rpx;margin-bottom: 8rpx;
  448. &:last-child{margin-bottom: 0;}
  449. .cir{width: 12rpx;height: 12rpx;background: #FFB132;border-radius: 50%;flex: 0 0 auto;margin-right: 22rpx;
  450. }
  451. }
  452. }
  453. </style>