addqueueFTransfer.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. //转移
  2. <template>
  3. <div class="addqueueFCancel">
  4. <div class="top">
  5. <dil-form :formId="247" v-model="form" @change="onChange"></dil-form>
  6. </div>
  7. <div class="tab">
  8. <dilTable
  9. v-bind.sync="option"
  10. @radio-change="currentRadioChange"
  11. ></dilTable>
  12. </div>
  13. <div class="reason">
  14. <dil-form :formId="248" v-model="form1" @change="onChange1"></dil-form>
  15. </div>
  16. <div class="input_textarea">
  17. <span>转移原因:</span>
  18. <el-input
  19. type="textarea"
  20. :rows="2"
  21. placeholder="请输入内容"
  22. v-model="resultTransferReason">
  23. </el-input>
  24. </div>
  25. <div class="btn">
  26. <el-button @click="cancel">取消</el-button>
  27. <el-button type="primary" @click="onclick">确认</el-button>
  28. </div>
  29. </div>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. form: {},
  36. form1: {},
  37. option: {
  38. // 表格请求数据的地址
  39. requestUrl: "/api/v1/qms/getAllQueueMes?apiId=184",
  40. // 控制显示当选列
  41. selectionType: "radio",
  42. },
  43. // 转移后的门岗id
  44. gatepostId: 0,
  45. // 排队实绩id
  46. resultId:0,
  47. //转移原因
  48. resultTransferReason:''
  49. };
  50. },
  51. methods: {
  52. cancel(){
  53. this.$router.push({
  54. path: "/queueFTransfer",
  55. });
  56. },
  57. onChange(val) {
  58. this.option.requestUrl =
  59. "/api/v1/qms/getAllQueueMes?apiId=184&gatepostId=" + val.gatepostId+"&i="+new Date();
  60. },
  61. onChange1(val) {
  62. this.gatepostId = val.gatepostId;
  63. },
  64. currentRadioChange(row) {
  65. this.resultId = row.resultId
  66. },
  67. onclick() {
  68. var mapValue = {
  69. resultId:this.resultId,
  70. gatepostId:this.gatepostId,
  71. resultTransferReason: this.resultTransferReason,
  72. };
  73. console.log(mapValue)
  74. if(mapValue.resultId !== 0 && mapValue.gatepostId !== 0 && mapValue.resultTransferReason !== ""){
  75. this.axios.post("/api/v1/qms/changeQueue",mapValue).then((res)=>{
  76. if(res.data.code == "200"){
  77. this.cancel();
  78. this.$message({
  79. message: '转移成功!',
  80. type: 'success'
  81. });
  82. }
  83. })
  84. }else{
  85. if(mapValue.resultId == 0){
  86. this.$message({
  87. message: '请选择需要转移的车辆!',
  88. type: 'warning'
  89. });
  90. }else{
  91. if(mapValue.gatepostId == 0){
  92. this.$message({
  93. message: '请选择需要转移到的门岗!',
  94. type: 'warning'
  95. });
  96. }else{
  97. if(mapValue.resultTransferReason == ""){
  98. this.$message({
  99. message: '请填写转移的原因!',
  100. type: 'warning'
  101. });
  102. }
  103. }
  104. }
  105. }
  106. },
  107. },
  108. };
  109. </script>
  110. <style lang="scss" scoped>
  111. .addqueueFCancel {
  112. .top {
  113. width: 100%;
  114. height: 80px;
  115. padding-left: 50px;
  116. padding-top: 20px;
  117. }
  118. .tab {
  119. width: 100%;
  120. max-height: 300px;
  121. }
  122. .reason {
  123. width: 100%;
  124. display: flex;
  125. align-items: center;
  126. justify-content: center;
  127. margin-top: 30px;
  128. .el-form{
  129. width: 400px;
  130. }
  131. }
  132. .input_textarea{
  133. display: flex;
  134. align-items: center;
  135. justify-content: center;
  136. .el-textarea{
  137. width: 320px;
  138. }
  139. }
  140. .btn {
  141. width: 100%;
  142. height: 80px;
  143. display: flex;
  144. align-items: center;
  145. justify-content: center;
  146. }
  147. }
  148. </style>