waiting.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <div class="content-box">
  3. <div class="left">
  4. <!-- <el-icon :size="23" class="camera"><VideoCameraFilled /></el-icon> -->
  5. <span class="cameratxt">系统设置</span>
  6. </div>
  7. <div class="middle">
  8. <div class="filter">
  9. <div class="condition">
  10. <h3>评价设置</h3>
  11. <div>
  12. <span>工单完成后 </span>
  13. <el-input clearable v-model="ruleForm.day" class="w-50 m-2" style="width: 80px" @blur="timeUpdata" />
  14. <span>&nbsp;&nbsp;天,用户未评价系统默认为好评</span>
  15. </div>
  16. </div>
  17. <div class="condition">
  18. <h3>电话设置</h3>
  19. <div class="phone">
  20. <span>墨轩湖紧急电话 : </span>
  21. <el-input clearable v-model="ruleForm.emergencyMxh" class="w-50 m-2" style="width: 200px"
  22. @blur="timeUpdata" />
  23. </div>
  24. <div class="phone">
  25. <span>黄家湖紧急电话 : </span>
  26. <el-input clearable v-model="ruleForm.emergencyCall" class="w-50 m-2" style="width: 200px"
  27. @blur="timeUpdata" />
  28. </div>
  29. <div class="phone">
  30. <span>服务监督电话 : </span>
  31. <el-input clearable v-model="ruleForm.servicePhone" class="w-50 m-2" style="width: 200px"
  32. @blur="timeUpdata" />
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </template>
  39. <script setup>
  40. import {
  41. ref,
  42. reactive,
  43. watch,
  44. nextTick,
  45. onBeforeMount,
  46. onUnmounted,
  47. } from "vue";
  48. import { useRouter } from "vue-router";
  49. import { ElMessage, ElMessageBox } from "element-plus";
  50. import { dayjs } from "element-plus";
  51. import lodash from "lodash";
  52. import axios from "axios";
  53. import { useStore } from "vuex";
  54. const store = useStore();
  55. const api = ref("");
  56. const router = useRouter();
  57. // 表格数据
  58. const ruleForm = reactive({
  59. day: "", // 自动好评时间
  60. emergencyCall: "", // 黄家湖紧急电话
  61. emergencyMxh: "",// 墨轩湖紧急电话
  62. servicePhone: "", // 服务监督电话
  63. id: "",
  64. });
  65. // 获取系统设置数据
  66. const getlist = async (message) => {
  67. let res = await axios({
  68. method: "get",
  69. url: api.value + "/repairSystemSetting/queryRepairSystemSetting",
  70. headers: {
  71. token: sessionStorage.getItem("token"),
  72. user_head: sessionStorage.getItem("userhead"),
  73. },
  74. });
  75. console.log(res);
  76. if (res.data.code == 200) {
  77. ruleForm.day = res.data.data.day; // 自动好评时间
  78. ruleForm.emergencyCall = res.data.data.emergencyCall; // 黄家湖紧急电话
  79. ruleForm.emergencyMxh = res.data.data.emergencyMxh; // 墨轩湖紧急电话
  80. ruleForm.servicePhone = res.data.data.servicePhone; // 服务监督电话
  81. ruleForm.id = res.data.data.id; // id
  82. sessionStorage.setItem("sm_start", res.data.data.sm_start);
  83. sessionStorage.setItem("sm_end", res.data.data.sm_end);
  84. if (message) {
  85. ElMessage({
  86. type: "success",
  87. showClose: true,
  88. message: message,
  89. center: true,
  90. });
  91. }
  92. } else {
  93. ElMessage({
  94. type: "error",
  95. showClose: true,
  96. message: res.data.message,
  97. center: true,
  98. });
  99. if (res.data.code == 570) {
  100. sessionStorage.removeItem("token")
  101. router.push({
  102. path: `/login`,
  103. });
  104. }
  105. }
  106. };
  107. // 页面数据一修改就调用函数
  108. const timeUpdata = async () => {
  109. let data = {
  110. day: ruleForm.day, // 自动好评时间
  111. emergencyCall: ruleForm.emergencyCall, // 紧急电话
  112. emergencyMxh: ruleForm.emergencyMxh, // 紧急电话
  113. servicePhone: ruleForm.servicePhone, // 服务监督电话
  114. id: ruleForm.id, // id
  115. };
  116. let res = await axios({
  117. method: "post",
  118. url: api.value + "/repairSystemSetting/updateRepairSystemSettingById",
  119. headers: {
  120. token: sessionStorage.getItem("token"),
  121. user_head: sessionStorage.getItem("userhead"),
  122. },
  123. data: data,
  124. });
  125. console.log(res, "修改候补");
  126. if (res.data.code == 200) {
  127. // getlist();
  128. // store.dispatch("sm_time");
  129. ElMessage({
  130. type: "success",
  131. showClose: true,
  132. message: res.data.message,
  133. center: true,
  134. });
  135. } else {
  136. getlist();
  137. ElMessage({
  138. type: "error",
  139. showClose: true,
  140. message: res.data.message,
  141. center: true,
  142. });
  143. }
  144. };
  145. onBeforeMount(() => {
  146. api.value = store.state.user.api;
  147. getlist();
  148. });
  149. onUnmounted(() => { });
  150. </script>
  151. <style scoped lang="scss">
  152. .content-box {
  153. width: 97.5%;
  154. height: 89%;
  155. margin: 20px auto;
  156. background-color: #fff;
  157. color: #fff;
  158. display: flex;
  159. flex-direction: column;
  160. box-shadow: 0px 3px 10px rgba(213, 228, 252, 1);
  161. .left {
  162. // width: calc(100wh - 40px);
  163. display: flex;
  164. align-items: center;
  165. height: 30px;
  166. margin: 0 30px;
  167. padding: 20px 0;
  168. border-bottom: 1px solid #ccc;
  169. color: #000;
  170. font-size: 18px;
  171. font-weight: 600;
  172. }
  173. .middle {
  174. width: 96%;
  175. margin: 0 auto;
  176. color: #000;
  177. // border-bottom: 1px solid rgb(231, 231, 231);
  178. .filter {
  179. display: flex;
  180. flex-wrap: wrap;
  181. flex-direction: column;
  182. .condition {
  183. display: flex;
  184. flex-direction: column;
  185. margin: 10px 30px 10px 0;
  186. span {
  187. width: 100px;
  188. margin: 0 10px 0 0;
  189. font-size: 16px;
  190. color: #000;
  191. }
  192. .phone {
  193. margin: 10px 0;
  194. }
  195. }
  196. }
  197. }
  198. }
  199. </style>