index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="140px" class="nghfs">
  4. <p class="lqw" style="font-weight: 700;font-size: 15px;"> <img src="../../../assets/images/icon_yq_htgl_btzs.png" alt="" style="width:10px;height: 10px;margin-right: 10px;"> 搜索条件</p>
  5. <el-row>
  6. <!-- <el-col :span="24"> -->
  7. <el-col :span="8">
  8. <el-form-item label="会议室名称" prop="conferenceRoomName">
  9. <el-input
  10. v-model="queryParams.conferenceRoomName"
  11. placeholder="请输入会议室名称"
  12. clearable
  13. @keyup.enter.native="handleQuery"
  14. />
  15. </el-form-item>
  16. </el-col>
  17. <el-col :span="8">
  18. <el-form-item label="会议室地址" prop="conferenceRoomAddress">
  19. <el-input
  20. v-model="queryParams.conferenceRoomAddress"
  21. placeholder="请输入会议室地址"
  22. clearable
  23. @keyup.enter.native="handleQuery"
  24. />
  25. </el-form-item>
  26. </el-col>
  27. <el-col :span="8">
  28. <el-form-item label="会议开始时间" prop="startTime">
  29. <el-date-picker clearable
  30. v-model="queryParams.startTime"
  31. type="datetime"
  32. value-format="yyyy-MM-dd HH:mm:ss"
  33. placeholder="请选择会议开始时间">
  34. </el-date-picker>
  35. </el-form-item>
  36. </el-col>
  37. <el-col :span="8">
  38. <el-form-item label="会议结束时间" prop="endTime">
  39. <el-date-picker clearable
  40. v-model="queryParams.endTime"
  41. type="datetime"
  42. value-format="yyyy-MM-dd HH:mm:ss"
  43. placeholder="请选择会议结束时间">
  44. </el-date-picker>
  45. </el-form-item>
  46. </el-col>
  47. <el-col :span="4" style="margin-top: 3px;">
  48. <el-button type="primary" style="background-color: #5974E0; border-color: #5974E0;" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  49. <el-button style="background-color: #fff; border-color: #3464EB; color: #3464EB;" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  50. </el-col>
  51. </el-row>
  52. </el-form>
  53. <div class="ntgs" >
  54. <div style="display: flex;align-items: center; margin-bottom: 10px;">
  55. <p class="lqw" style="font-weight: 700;font-size: 15px; margin: 0; margin-bottom: 0;"> <img src="../../../assets/images/icon_yq_htgl_btzs.png" alt="" style="width:10px;height: 10px;margin-right: 10px;"> 会议室预约</p>
  56. <el-row :gutter="10" class="mb8" style=" margin-bottom: 0;">
  57. <el-col :span="1.5">
  58. <el-button
  59. type="primary"
  60. plain
  61. icon="el-icon-plus"
  62. size="mini"
  63. @click="handleAdd"
  64. v-hasPermi="['system:order:add']"
  65. >新增</el-button>
  66. </el-col>
  67. <el-col :span="1.5">
  68. <el-button
  69. type="success"
  70. plain
  71. icon="el-icon-edit"
  72. size="mini"
  73. :disabled="single"
  74. @click="handleUpdate"
  75. v-hasPermi="['system:order:edit']"
  76. >修改</el-button>
  77. </el-col>
  78. <el-col :span="1.5">
  79. <el-button
  80. type="danger"
  81. plain
  82. icon="el-icon-delete"
  83. size="mini"
  84. :disabled="multiple"
  85. @click="handleDelete"
  86. v-hasPermi="['system:order:remove']"
  87. >删除</el-button>
  88. </el-col>
  89. <el-col :span="1.5">
  90. <el-button
  91. type="warning"
  92. plain
  93. icon="el-icon-download"
  94. size="mini"
  95. @click="handleExport"
  96. v-hasPermi="['system:order:export']"
  97. >导出</el-button>
  98. </el-col>
  99. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  100. </el-row>
  101. </div>
  102. <el-table stripe v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
  103. <el-table-column type="selection" width="55" align="center" />
  104. <el-table-column label="预约人员名称" align="center" prop="orderUser" width="160"/>
  105. <el-table-column label="会议室名称" align="center" prop="conferenceRoomName" />
  106. <el-table-column label="会议室地址" align="center" prop="conferenceRoomAddress" />
  107. <el-table-column label="会议名称" align="center" prop="conferenceName" />
  108. <el-table-column label="会议人数" align="center" prop="conferenceNumber" />
  109. <el-table-column label="会议开始时间" align="center" prop="startTime" width="180">
  110. <template slot-scope="scope">
  111. <span>{{ scope.row.startTime}}</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="会议结束时间" align="center" prop="endTime" width="180">
  115. <template slot-scope="scope">
  116. <span>{{scope.row.endTime }}</span>
  117. </template>
  118. </el-table-column>
  119. <!-- <el-table-column label="创建部门" align="center" prop="createDept" /> -->
  120. <!-- <el-table-column label="备注" align="center" prop="remark" /> -->
  121. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  122. <template slot-scope="scope">
  123. <el-button
  124. size="mini"
  125. type="text"
  126. @click="handleUpdate(scope.row)"
  127. style="color:#28C529"
  128. v-hasPermi="['system:order:edit']"
  129. >修改</el-button>
  130. <el-button
  131. size="mini"
  132. type="text"
  133. style="color:#F7052B"
  134. @click="handleDelete(scope.row)"
  135. v-hasPermi="['system:order:remove']"
  136. >删除</el-button>
  137. </template>
  138. </el-table-column>
  139. </el-table>
  140. <pagination
  141. v-show="total>0"
  142. :total="total"
  143. :page.sync="queryParams.pageNum"
  144. :limit.sync="queryParams.pageSize"
  145. @pagination="getList"
  146. />
  147. </div>
  148. <!-- 添加或修改会议室预约对话框 -->
  149. <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
  150. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  151. <el-row>
  152. <el-col :span="24" style="margin-bottom: 20px;" class="ingq" v-if="isnshe">
  153. <el-form-item label="会议室名称" prop="conferenceRoomName">
  154. <div style="display: flex; flex-wrap: wrap;" >
  155. <div style="width: 33%;display: flex; align-items: center;cursor:pointer; " v-for="(item,index) in orderListg" :key="index" @click="iskbw(item)">
  156. <img src="../../../assets/images/icon_mjqx_xz_normal.png" alt="" style="width: 14px;height: 14px;" v-if="issid != item.conferenceRoomId">
  157. <img src="../../../assets/images/icon_mjqx_xz_selected.png" alt="" style="width: 14px;height: 14px;" v-if="issid == item.conferenceRoomId">
  158. <el-tooltip class="item" effect="dark" :content="item.conferenceRoomName" placement="top">
  159. <p style="margin: 0; margin-left: 10px; overflow: hidden;text-overflow:ellipsis;display: -webkit-box;
  160. -webkit-line-clamp: 1;-webkit-box-orient: vertical;font-weight: 500;font-size: 14px;color: #161616;">
  161. {{item.conferenceRoomName}}
  162. </p>
  163. </el-tooltip>
  164. </div>
  165. </div>
  166. <div style="background: #F0F8FE;border-radius: 10px; padding: 10px; margin-top: 20px;">
  167. <p style="font-weight: bold;font-size: 14px;color: #161616;"> <img src="../../../assets/images/icon_htgl_hyyy_3y.png" alt="" style="width: 16px;height: 16px; margin-right: 10px;">已预约时间段,以下时间段不可预约。</p>
  168. <div style="display: flex; flex-wrap: wrap;" v-if="lisget != null && lisget.length != 0 " >
  169. <div style="width: 50%; display: flex;align-items: center;" v-for="(item,index) in lisget" :key="index">
  170. <p style="width: 6px;height: 6px;background: #FFB132;border-radius: 3px;margin-right: 10px;"></p>
  171. <p style="font-weight: bold;font-size: 14px;color: #161616;">{{item.startTime}} </p>
  172. <span style="font-weight: bold;font-size: 14px;color: #666666; margin: 0 5px;">至 </span>
  173. <p style="font-weight: bold;font-size: 14px;color: #161616;">{{item.endTime}}</p>
  174. </div>
  175. </div>
  176. <div v-if="lisget == null || lisget.length == 0">
  177. 暂无数据,可以预约任意时间段。
  178. </div>
  179. </div>
  180. </el-form-item>
  181. </el-col>
  182. <el-col :span="12">
  183. <el-form-item label="会议名称" prop="conferenceName">
  184. <el-input v-model="form.conferenceName" placeholder="请输入内容" />
  185. </el-form-item>
  186. </el-col>
  187. <el-col :span="12">
  188. <el-form-item label="会议人数" prop="conferenceNumber">
  189. <el-input v-model="form.conferenceNumber" placeholder="请输入会议人数" />
  190. </el-form-item>
  191. </el-col>
  192. <el-col :span="12">
  193. <el-form-item label="会议开始时间" prop="startTime">
  194. <el-date-picker clearable
  195. @change="nghwest"
  196. v-model="form.startTime"
  197. type="datetime"
  198. style="width:100%;"
  199. value-format="yyyy-MM-dd HH:mm:ss"
  200. placeholder="请选择会议开始时间">
  201. </el-date-picker>
  202. </el-form-item>
  203. </el-col>
  204. <el-col :span="12">
  205. <el-form-item label="会议结束时间" prop="endTime">
  206. <el-date-picker clearable
  207. @change="nghwe"
  208. v-model="form.endTime"
  209. type="datetime"
  210. value-format="yyyy-MM-dd HH:mm:ss"
  211. style="width:100%;"
  212. placeholder="请选择会议结束时间">
  213. </el-date-picker>
  214. </el-form-item>
  215. </el-col>
  216. <el-col :span="12">
  217. <el-form-item label="是否需要席卡" prop="useXk">
  218. <el-select style="width: 100%;" v-model="form.useXk" placeholder="是否需要席卡">
  219. <el-option
  220. v-for="dict in dict.type.sys_yes_no"
  221. :key="dict.value"
  222. :label="dict.label"
  223. :value="dict.value"
  224. />
  225. </el-select>
  226. </el-form-item>
  227. </el-col>
  228. <el-col :span="12">
  229. <el-form-item label="会议说明" prop="remark">
  230. <el-input v-model="form.remark" placeholder="请输入会议说明" />
  231. </el-form-item>
  232. </el-col>
  233. <el-col :span="24">
  234. <el-form-item label="席卡详情" prop="xkDetail">
  235. <el-input v-model="form.xkDetail" placeholder="请输入席卡详情" />
  236. </el-form-item>
  237. </el-col>
  238. </el-row>
  239. </el-form>
  240. <div slot="footer" class="dialog-footer">
  241. <el-button type="primary" @click="submitForm">确 定</el-button>
  242. <el-button @click="cancel">取 消</el-button>
  243. </div>
  244. </el-dialog>
  245. </div>
  246. </template>
  247. <script>
  248. import { listOrder, listOrderf, getOrder, delOrder, addOrder, updateOrder } from "@/api/system/order";
  249. export default {
  250. name: "Order",
  251. dicts: ['sys_yes_no', 'sys_user_sex','usertype'],
  252. data() {
  253. return {
  254. // 遮罩层
  255. loading: true,
  256. // 选中数组
  257. ids: [],
  258. // 非单个禁用
  259. single: true,
  260. // 非多个禁用
  261. multiple: true,
  262. // 显示搜索条件
  263. showSearch: true,
  264. // 总条数
  265. total: 0,
  266. // 会议室预约表格数据
  267. orderList: [],
  268. orderListg:[],
  269. // 弹出层标题
  270. title: "",
  271. // 是否显示弹出层
  272. open: false,
  273. // 查询参数
  274. queryParams: {
  275. pageNum: 1,
  276. pageSize: 7,
  277. orderUser: null,
  278. orderUserId: null,
  279. conferenceRoomId: null,
  280. conferenceRoomName: null,
  281. conferenceRoomAddress: null,
  282. conferenceName: null,
  283. conferenceNumber: null,
  284. startTime: null,
  285. endTime: null,
  286. createDept: null,
  287. },
  288. // 表单参数
  289. form: {},
  290. // 表单校验
  291. rules: {
  292. conferenceName: [
  293. { required: true, message: "不能为空", trigger: "blur" }
  294. ],
  295. conferenceNumber: [
  296. { required: true, message: "不能为空", trigger: "blur" }
  297. ],
  298. startTime: [
  299. { required: true, message: "不能为空", trigger: "blur" }
  300. ],
  301. endTime: [
  302. { required: true, message: "不能为空", trigger: "blur" }
  303. ],
  304. },
  305. issid:0,
  306. lisget:[],
  307. conferenceRoomName:null,
  308. conferenceRoomAddress:null,
  309. isnshe:false
  310. };
  311. },
  312. created() {
  313. this.getList();
  314. // console.log(this.$store.state.user.name)
  315. this.getlisno()
  316. },
  317. methods: {
  318. xuanze(val){
  319. },
  320. /** 查询会议室预约列表 */
  321. getList() {
  322. this.loading = true;
  323. this.queryParams.orderUserId = this.$store.state.user.id
  324. listOrder(this.queryParams).then(response => {
  325. this.orderList = response.rows;
  326. this.total = response.total;
  327. this.loading = false;
  328. });
  329. },
  330. getlisno(){
  331. this.loading = true;
  332. this.isnshe = false
  333. listOrderf().then(response => {
  334. this.orderListg = response.rows;
  335. if(this.orderListg.length != 0 && this.orderListg != null ){
  336. this.issid = this.orderListg[0].conferenceRoomId
  337. if(this.orderListg[0].conferenceRoomOrderList == null){
  338. this.orderListg[0].conferenceRoomOrderList = []
  339. this.lisget = []
  340. }else{
  341. this.lisget = this.orderListg[0].conferenceRoomOrderList
  342. }
  343. this.conferenceRoomName = this.orderListg[0].conferenceRoomName
  344. this.conferenceRoomAddress = this.orderListg[0].conferenceRoomAddress
  345. }
  346. this.isnshe = true
  347. this.total = response.total;
  348. this.loading = false;
  349. });
  350. },
  351. nghwest(val){
  352. },
  353. nghwe(val){
  354. if(this.form.startTime == null || this.form.startTime == ''){
  355. this.$message.error("请选择开始时间");
  356. this.form.endTime = null
  357. return
  358. }else{
  359. const time3 = Date.parse(val)
  360. const time4 = Date.parse(this.form.startTime)
  361. if(time3 < time4){
  362. this.$message.error("请选择大于开始时间");
  363. this.form.endTime = null
  364. return
  365. }
  366. console.log(3,time3,time4)
  367. }
  368. },
  369. // 取消按钮
  370. cancel() {
  371. this.open = false;
  372. this.reset();
  373. },
  374. // 表单重置
  375. reset() {
  376. this.form = {
  377. conferenceRoomOrderId: null,
  378. orderUser: null,
  379. orderUserId: null,
  380. conferenceRoomId: null,
  381. conferenceRoomName: null,
  382. conferenceRoomAddress: null,
  383. conferenceName: null,
  384. conferenceNumber: null,
  385. startTime: null,
  386. endTime: null,
  387. createDept: null,
  388. createBy: null,
  389. createTime: null,
  390. updateBy: null,
  391. updateTime: null,
  392. remark: null,
  393. useXk:'Y',
  394. xkDetail:null
  395. };
  396. this.resetForm("form");
  397. },
  398. /** 搜索按钮操作 */
  399. handleQuery() {
  400. this.queryParams.pageNum = 1;
  401. this.getList();
  402. },
  403. /** 重置按钮操作 */
  404. resetQuery() {
  405. this.resetForm("queryForm");
  406. this.handleQuery();
  407. },
  408. iskbw(val){
  409. this.issid = val.conferenceRoomId
  410. if(val.conferenceRoomOrderList == null){
  411. val.conferenceRoomOrderList = []
  412. }
  413. this.lisget = val.conferenceRoomOrderList
  414. this.conferenceRoomName = val.conferenceRoomName
  415. this.conferenceRoomAddress = val.conferenceRoomAddress
  416. },
  417. // 多选框选中数据
  418. handleSelectionChange(selection) {
  419. this.ids = selection.map(item => item.conferenceRoomOrderId)
  420. this.single = selection.length!==1
  421. this.multiple = !selection.length
  422. },
  423. /** 新增按钮操作 */
  424. handleAdd() {
  425. this.reset();
  426. this.open = true;
  427. this.title = "添加会议室预约";
  428. },
  429. /** 修改按钮操作 */
  430. handleUpdate(row) {
  431. this.reset();
  432. const conferenceRoomOrderId = row.conferenceRoomOrderId || this.ids
  433. getOrder(conferenceRoomOrderId).then(response => {
  434. this.form = response.data;
  435. this.issid = this.form.conferenceRoomId
  436. this.conferenceRoomName = this.form.conferenceRoomName
  437. this.conferenceRoomAddress = this.form.conferenceRoomAddress
  438. if(this.orderListg.length != 0){
  439. this.orderListg.filter( rou=>{
  440. if(this.issid == this.form.conferenceRoomId){
  441. if(rou.conferenceRoomOrderList == null){
  442. rou.conferenceRoomOrderList = []
  443. }
  444. this.lisget = rou.conferenceRoomOrderList
  445. }
  446. })
  447. }
  448. this.open = true;
  449. this.title = "修改会议室预约";
  450. });
  451. },
  452. /** 提交按钮 */
  453. submitForm() {
  454. this.$refs["form"].validate(valid => {
  455. if (valid) {
  456. this.form.orderUserId = this.$store.state.user.id
  457. this.form.orderUser = this.$store.state.user.name
  458. this.form.conferenceRoomId = this.issid
  459. this.form.conferenceRoomName = this.conferenceRoomName
  460. this.form.conferenceRoomAddress = this.conferenceRoomAddress
  461. if (this.form.conferenceRoomOrderId != null) {
  462. updateOrder(this.form).then(response => {
  463. this.$modal.msgSuccess("修改成功");
  464. this.open = false;
  465. this.getList();
  466. });
  467. } else {
  468. addOrder(this.form).then(response => {
  469. this.$modal.msgSuccess("新增成功");
  470. this.open = false;
  471. this.getList();
  472. });
  473. }
  474. }
  475. });
  476. },
  477. /** 删除按钮操作 */
  478. handleDelete(row) {
  479. const conferenceRoomOrderIds = row.conferenceRoomOrderId || this.ids;
  480. this.$modal.confirm('是否确认删除会议室预约编号为"' + conferenceRoomOrderIds + '"的数据项?').then(function() {
  481. return delOrder(conferenceRoomOrderIds);
  482. }).then(() => {
  483. this.getList();
  484. this.$modal.msgSuccess("删除成功");
  485. }).catch(() => {});
  486. },
  487. /** 导出按钮操作 */
  488. handleExport() {
  489. this.download('system/order/export', {
  490. ...this.queryParams
  491. }, `order_${new Date().getTime()}.xlsx`)
  492. },
  493. ishsue(row){
  494. this.form.conferenceRoomAddress = row.conferenceRoomAddress
  495. this.form.conferenceRoomId = row.conferenceRoomId
  496. }
  497. }
  498. };
  499. </script>
  500. <style lang="scss">
  501. .nhgrls{
  502. .el-dialog__body{
  503. padding: 0;
  504. }
  505. }
  506. .hyr{
  507. span{
  508. text-decoration:underline;
  509. }
  510. }
  511. </style>
  512. <style scoped lang="scss">
  513. .ingq{
  514. p{
  515. margin: 0;
  516. }
  517. }
  518. .iuer{
  519. display: flex;
  520. justify-content: space-between;
  521. align-items: center;
  522. .ite{
  523. display: flex;
  524. justify-content: space-between;
  525. align-items: center;
  526. p{
  527. margin: 0;
  528. font-size: 15px;
  529. font-family: PingFang SC;
  530. font-weight: 500;
  531. color: #AAAAAA;
  532. padding: 4px 12px;
  533. background: #F7F8FA;
  534. border-radius: 4px;
  535. margin-right: 20px;
  536. }
  537. .actt{
  538. background: #E6EBFF;
  539. border: 1px solid #5974E0;
  540. border-radius: 4px;
  541. color: #5974E0;
  542. }
  543. }
  544. }
  545. .lqw{
  546. padding: 0 10px;
  547. margin: 0;
  548. margin-bottom: 20px;
  549. }
  550. .nhgel{
  551. height: 170px;
  552. background-color: #313b61;
  553. width: 100%;
  554. position: absolute;
  555. top:0;
  556. left:0;
  557. z-index: 0;
  558. }
  559. .app-container{
  560. background-color: #f3f4f6;
  561. padding-top: 10px;
  562. }
  563. .ntgs{
  564. position: relative;
  565. background-color: #fff;
  566. padding: 5px;
  567. // border-radius: 5px;
  568. padding-top: 10px;
  569. padding: 10px 20px;
  570. padding-left: 10px;
  571. .pagination-container{
  572. height: 50px;
  573. }
  574. }
  575. .nghfs{
  576. position: relative;
  577. background-color: #fff;
  578. padding-top: 18px !important;
  579. padding: 5px;
  580. // border-radius: 5px;
  581. // margin-bottom: 20px;
  582. }
  583. .ksf{
  584. img{
  585. width:100%;
  586. height: 100%;
  587. }
  588. }
  589. </style>