调解系统PC端服务

selectMediator.vue 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <div>
  3. <el-dialog title="预约调解员" :visible="mediatorVisable" v-if="mediatorVisable" @close="cancel" center :distroy-on-close="true">
  4. <div>
  5. <div>
  6. <div style="margin-bottom: 20px;">预约调解员</div>
  7. </div>
  8. <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
  9. @selection-change="handleSelectionChange">
  10. <el-table-column type="selection" width="55">
  11. </el-table-column>
  12. <el-table-column prop="mediatorName" label="调解员">
  13. </el-table-column>
  14. <el-table-column prop="specialty" label="专业">
  15. </el-table-column>
  16. <el-table-column prop="todoAmount" label="待办数量">
  17. </el-table-column>
  18. <el-table-column prop="completeAmount" label="已办数量">
  19. </el-table-column>
  20. </el-table>
  21. </div>
  22. <div slot="footer" class="dialog-footer">
  23. <el-button @click="cancel" class="endbutton1" round><span>取 消</span></el-button>
  24. <el-button @click="submitMediator" class="endbutton1" type="primary" round><span>确 认</span></el-button>
  25. </div>
  26. </el-dialog>
  27. </div>
  28. </template>
  29. <script>
  30. import { Message } from 'element-ui'
  31. import { listMediator,updateBooking } from '@/api/caseManagement/caseManagement.js'
  32. import { createRoomId } from '@/api/metting/metting.js'
  33. import moment from "moment";
  34. export default {
  35. props: ["mediatorVisable", "mediatorData","queryParams"],
  36. data() {
  37. return {
  38. tableData: [],
  39. multipleSelection: [],
  40. formLabelAlign: {
  41. time:[]
  42. },
  43. mediatorArr:[]
  44. };
  45. },
  46. watch: {
  47. mediatorVisable(val) {
  48. if (val) {
  49. listMediator({caseAppliId: this.mediatorData.id}).then(res=>{
  50. this.tableData = res.data;
  51. this.tableData.forEach((item)=> {
  52. if (item.echoFlag) {
  53. this.$nextTick(()=>{
  54. this.$refs.multipleTable.toggleRowSelection(item, true);
  55. })
  56. }
  57. })
  58. })
  59. }
  60. }
  61. },
  62. methods: {
  63. cancel() {
  64. this.$emit("cancelMediator");
  65. },
  66. /**提交选择结果*/
  67. async submitMediator() {
  68. if (this.multipleSelection.length > 3) {
  69. Message.error('最多选择三名调解员');
  70. return
  71. }else if(this.multipleSelection.length < 1){
  72. Message.error('请选择调解员');
  73. return
  74. }
  75. this.mediatorArr = [];
  76. this.multipleSelection.forEach(item=>{
  77. this.mediatorArr.push({
  78. mediatorId:item.mediatorId,
  79. mediatorName:item.mediatorName
  80. })
  81. })
  82. await this.updateBookingFn({
  83. id:this.mediatorData.id,
  84. caseFlowId:this.mediatorData.caseFlowId,
  85. mediatorList:this.mediatorArr,
  86. })
  87. },
  88. async updateBookingFn(data){
  89. await updateBooking(data).then(res=>{
  90. this.$modal.msgSuccess("成功");
  91. this.$emit("cancelMediator");
  92. this.$emit('getList', this.queryParams);
  93. })
  94. },
  95. handleSelectionChange(val) {
  96. this.multipleSelection = val;
  97. }
  98. },
  99. };
  100. </script>
  101. <style lang="scss" scoped>
  102. .steps {
  103. display: flex;
  104. flex-wrap: wrap;
  105. }
  106. ::v-deep .el-step {
  107. // width: 150px;
  108. flex-basis: 25% !important;
  109. margin-right: 20px;
  110. margin-bottom: 20px;
  111. }
  112. ::v-deep .el-dialog__body {
  113. height: 500px !important;
  114. overflow: auto !important;
  115. }
  116. ::v-deep .el-dialog {
  117. width: 800px;
  118. background: #ffffff;
  119. border-radius: 20px;
  120. }
  121. .timeTitle {
  122. width: 1000%;
  123. text-align: center;
  124. }
  125. </style>