index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <basicLayout
  3. style="padding-top: 0 !important"
  4. ref="basicLayout"
  5. tableName="servicAppointTable"
  6. idName="sa_endcustserviceorderid"
  7. :apiId="{ query: 20240902102903, del: '' }"
  8. :detailPath="{ path: '/serviceAppointMagDetail' }"
  9. :isExport="false"
  10. :autoQuery="false"
  11. >
  12. <template #custom>
  13. <div class="mt-10">
  14. <label class="search__label">{{ $t("状态") }}:</label>
  15. <el-select
  16. class="inline-24"
  17. v-model="whereSelect.status"
  18. :placeholder="$t('请选择状态')"
  19. @change="selectChange"
  20. size="small"
  21. clearable
  22. >
  23. <el-option :label="$t(`待确认`)" value="待确认"></el-option>
  24. <el-option :label="$t(`已确认`)" value="已确认"></el-option>
  25. <el-option :label="$t(`服务中`)" value="服务中"></el-option>
  26. <el-option :label="$t(`已结束`)" value="已结束"></el-option>
  27. <el-option :label="$t(`已拒绝`)" value="已拒绝"></el-option>
  28. </el-select>
  29. </div>
  30. <div class="mt-10">
  31. <label class="search__label">{{$t('提交日期')}}:</label>
  32. <el-date-picker
  33. v-model="date"
  34. style="margin-right: 24px !important"
  35. size="small"
  36. type="daterange"
  37. value-format="yyyy-MM-dd"
  38. :range-separator="$t('至')"
  39. :start-placeholder="$t('开始日期')"
  40. :end-placeholder="$t('结束日期')"
  41. :default-time="['00:00:00', '23:59:59']"
  42. @change="selectChange"
  43. >
  44. </el-date-picker>
  45. </div>
  46. </template>
  47. <template v-slot:tbList="scope">
  48. <div
  49. v-if="scope.data.column.columnname == 'status'"
  50. :style="
  51. styleSet(scope.data.column.data[[scope.data.column.columnname]])
  52. "
  53. >
  54. {{ $t(scope.data.column.data[[scope.data.column.columnname]]) }}
  55. </div>
  56. <div v-else-if="scope.data.column.columnname == 'province'">
  57. {{
  58. scope.data.column.data[[scope.data.column.columnname]]
  59. ? scope.data.column.data[[scope.data.column.columnname]] +
  60. "-" +
  61. scope.data.column.data.county +
  62. "-" +
  63. scope.data.column.data.city
  64. : "--"
  65. }}
  66. </div>
  67. <div v-else>
  68. {{
  69. scope.data.column.data[[scope.data.column.columnname]]
  70. ? $t(scope.data.column.data[[scope.data.column.columnname]])
  71. : "--"
  72. }}
  73. </div>
  74. </template>
  75. </basicLayout>
  76. </template>
  77. <script>
  78. export default {
  79. name: "index",
  80. data() {
  81. return {
  82. siteid: JSON.parse(sessionStorage.getItem("active_account")).siteid,
  83. date: [],
  84. whereSelect: {
  85. status: "",
  86. begindate: "",
  87. enddate: "",
  88. },
  89. };
  90. },
  91. mounted() {
  92. this.listData();
  93. },
  94. methods: {
  95. listData() {
  96. this.$refs.basicLayout.param.content.siteid = this.siteid;
  97. this.$refs.basicLayout.listData(
  98. (this.$refs.basicLayout.param.content.pageNumner = 1)
  99. );
  100. },
  101. selectChange() {
  102. this.$refs.basicLayout.param.content.where = this.whereSelect;
  103. if (this.date) {
  104. this.whereSelect.begindate = this.date[0];
  105. this.whereSelect.enddate = this.date[1];
  106. } else {
  107. this.whereSelect.begindate = "";
  108. this.whereSelect.enddate = "";
  109. }
  110. this.listData();
  111. },
  112. styleSet(val) {
  113. let style;
  114. style = {
  115. 待确认: { color: "#d90a0a" },
  116. 已确认: { color: "#79da56" },
  117. 服务中: { color: "#1376e7" },
  118. 已结束: { color: "#151515" },
  119. 已拒绝: { color: "#151515" },
  120. }[val];
  121. return style;
  122. },
  123. },
  124. };
  125. </script>
  126. <style scoped>
  127. </style>