调解系统PC端服务

confirmMediator.vue 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <div>
  3. <el-dialog title="核实调解员" :visible="confirmVisable" v-if="confirmVisable" @close="cancel" center
  4. :distroy-on-close="true">
  5. <div>
  6. <div v-if="tableDataFlag">
  7. <div style="margin-bottom: 20px;">选择调解员</div>
  8. </div>
  9. <el-table v-if="tableDataFlag" ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
  10. @selection-change="handleSelectionChange">
  11. <el-table-column type="selection" width="55">
  12. </el-table-column>
  13. <el-table-column prop="mediatorName" label="调解员">
  14. </el-table-column>
  15. <el-table-column prop="specialty" label="专业">
  16. </el-table-column>
  17. <el-table-column prop="todoAmount" label="待办数量">
  18. </el-table-column>
  19. <el-table-column prop="completeAmount" label="已办数量">
  20. </el-table-column>
  21. </el-table>
  22. <div>
  23. <div style="margin-bottom: 20px;margin-top: 20px;">当前调解员</div>
  24. </div>
  25. <el-table ref="multipleTable" :data="tableDataNow" tooltip-effect="dark" style="width: 100%">
  26. <el-table-column prop="mediatorName" label="调解员">
  27. </el-table-column>
  28. <!-- <el-table-column prop="specialty" label="专业">
  29. </el-table-column>
  30. <el-table-column prop="todoAmount" label="待办数量">
  31. </el-table-column>
  32. <el-table-column prop="completeAmount" label="已办数量">
  33. </el-table-column> -->
  34. </el-table>
  35. <div>
  36. <div style="margin-bottom: 20px;margin-top: 20px;">申请人调解员</div>
  37. </div>
  38. <el-table ref="multipleTable" :data="applicantTable" tooltip-effect="dark" style="width: 100%">
  39. <el-table-column prop="mediatorName" label="调解员">
  40. </el-table-column>
  41. <!-- <el-table-column prop="specialty" label="专业">
  42. </el-table-column>
  43. <el-table-column prop="todoAmount" label="待办数量">
  44. </el-table-column>
  45. <el-table-column prop="completeAmount" label="已办数量">
  46. </el-table-column> -->
  47. </el-table>
  48. <div>
  49. <div style="margin-bottom: 20px;margin-top: 20px;">被申请人调解员</div>
  50. </div>
  51. <el-table ref="multipleTable" :data="respondentTable" tooltip-effect="dark" style="width: 100%">
  52. <el-table-column prop="mediatorName" label="调解员">
  53. </el-table-column>
  54. <!-- <el-table-column prop="specialty" label="专业">
  55. </el-table-column>
  56. <el-table-column prop="todoAmount" label="待办数量">
  57. </el-table-column>
  58. <el-table-column prop="completeAmount" label="已办数量">
  59. </el-table-column> -->
  60. </el-table>
  61. </div>
  62. <div slot="footer" class="dialog-footer">
  63. <el-button @click="cancel" class="endbutton1"><span>取 消</span></el-button>
  64. <el-button @click="submitMediator" class="endbutton1"><span>确 认</span></el-button>
  65. </div>
  66. </el-dialog>
  67. </div>
  68. </template>
  69. <script>
  70. import { Message } from 'element-ui'
  71. import { listMediator, updateBooking, selectReservation, verifyMediator } from '@/api/caseManagement/caseManagement.js'
  72. import moment from "moment";
  73. export default {
  74. props: ["confirmVisable", "confirmData", "queryParams"],
  75. data() {
  76. return {
  77. tableData: [],
  78. tableDataNow: [],
  79. applicantTable: [],
  80. respondentTable: [],
  81. multipleSelection: [],
  82. tableDataFlag: true,
  83. formLabelAlign: {
  84. time: []
  85. },
  86. mediatorArr: [],
  87. };
  88. },
  89. watch: {
  90. confirmVisable(val) {
  91. if (val) {
  92. this.mediatorArr = [];
  93. this.selectReservationFn({ id: this.confirmData.id })
  94. listMediator({caseAppliId:this.confirmData.id}).then(res => {
  95. this.tableData = res.data;
  96. })
  97. }
  98. },
  99. },
  100. methods: {
  101. cancel() {
  102. this.$emit("cancelConfirm");
  103. },
  104. selectReservationFn(data) {
  105. selectReservation(data).then(res => {
  106. this.applicantTable = res.data.mediatorList;
  107. this.respondentTable = res.data.resMediatorList;
  108. this.tableDataNow = [{ mediatorId: res.data.mediatorId, mediatorName: res.data.mediatorName }];
  109. if (this.tableDataNow[0].mediatorId) {
  110. this.tableDataFlag = false;
  111. } else {
  112. this.tableDataFlag = true;
  113. }
  114. })
  115. },
  116. /**核实调解员 */
  117. verifyMediatorFn(data) {
  118. verifyMediator(data).then(res => {
  119. this.$modal.msgSuccess("成功");
  120. this.$emit("cancelConfirm");
  121. this.$emit('getList', this.queryParams);
  122. })
  123. },
  124. /**提交选择结果*/
  125. async submitMediator() {
  126. if (this.multipleSelection.length == 0 && this.tableDataNow.length > 0) {
  127. this.verifyMediatorFn({
  128. id: this.confirmData.id,
  129. caseFlowId: this.confirmData.caseFlowId,
  130. mediatorId: this.tableDataNow[0].mediatorId,
  131. mediatorName: this.tableDataNow[0].mediatorName,
  132. })
  133. } else if (this.multipleSelection.length > 0 && !this.tableDataNow[0].mediatorId) {
  134. this.verifyMediatorFn({
  135. id: this.confirmData.id,
  136. caseFlowId: this.confirmData.caseFlowId,
  137. mediatorId: this.multipleSelection[0].mediatorId,
  138. mediatorName: this.multipleSelection[0].mediatorName,
  139. })
  140. } else if (this.multipleSelection.length > 1 && !this.tableDataNow[0].mediatorId) {
  141. Message.error('最多选择一名调解员');
  142. return
  143. }
  144. // if (this.confirmFlag == 1) {
  145. // let userArr = [];
  146. // this.tableData.forEach(item => {
  147. // userArr.push({
  148. // userId: item.mediatorId,
  149. // userName: item.mediatorName
  150. // })
  151. // })
  152. // this.verifyMediatorFn({
  153. // id: this.confirmData.id,
  154. // caseFlowId: this.confirmData.caseFlowId,
  155. // userList: userArr,
  156. // // herDates: this.formLabelAlign.time
  157. // })
  158. // } else {
  159. // if (this.multipleSelection.length > 1) {
  160. // Message.error('最多选择一名调解员');
  161. // return
  162. // } else if (this.multipleSelection.length < 1) {
  163. // Message.error('至少选择一名调解员');
  164. // return
  165. // }
  166. // this.multipleSelection.forEach(item => {
  167. // this.mediatorArr.push({
  168. // userId: item.mediatorId,
  169. // userName: item.mediatorName
  170. // })
  171. // })
  172. // this.verifyMediatorFn({
  173. // id: this.confirmData.id,
  174. // caseFlowId: this.confirmData.caseFlowId,
  175. // userList: this.mediatorArr,
  176. // })
  177. // }
  178. },
  179. handleSelectionChange(val) {
  180. this.multipleSelection = val;
  181. console.log(val, "PPPPPPPPPPPPPPPPPPPP");
  182. }
  183. },
  184. };
  185. </script>
  186. <style lang="scss" scoped>
  187. .steps {
  188. display: flex;
  189. flex-wrap: wrap;
  190. }
  191. ::v-deep .el-step {
  192. // width: 150px;
  193. flex-basis: 25% !important;
  194. margin-right: 20px;
  195. margin-bottom: 20px;
  196. }
  197. ::v-deep .el-dialog__body {
  198. height: 500px !important;
  199. overflow: auto !important;
  200. }
  201. ::v-deep .el-dialog {
  202. width: 800px;
  203. background: #ffffff;
  204. border-radius: 20px;
  205. }
  206. .timeTitle {
  207. width: 1000%;
  208. text-align: center;
  209. }
  210. </style>