index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <div class="snapshot-re-send-grid-container layout-padding">
  3. <div class="layout-padding-auto layout-padding-view pd20">
  4. <vxe-grid v-bind="gridOptions" ref="gridRef">
  5. <template #form>
  6. <el-form :model="state.queryParams" ref="ruleFormRef" inline @submit.native.prevent :disabled="gridOptions.loading">
  7. <el-form-item label="发送状态" prop="Status">
  8. <el-radio-group v-model="state.queryParams.Status" @change="handleQuery">
  9. <el-radio :value="0">发送成功</el-radio>
  10. <el-radio :value="1">发送失败</el-radio>
  11. <el-radio :value="3">婉拒</el-radio>
  12. <el-radio :value="2">未发送</el-radio>
  13. </el-radio-group>
  14. </el-form-item>
  15. <el-form-item label="工单编码" prop="No">
  16. <el-input v-model="state.queryParams.No" placeholder="请填写工单编码" clearable @keyup.enter="handleQuery" class="keyword-input" />
  17. </el-form-item>
  18. <el-form-item label="手机号" prop="PhoneNumber">
  19. <el-input
  20. v-model="state.queryParams.PhoneNumber"
  21. placeholder="请填写手机号"
  22. clearable
  23. @keyup.enter="handleQuery"
  24. class="keyword-input"
  25. />
  26. </el-form-item>
  27. <el-form-item>
  28. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  29. <el-button @click="drawer = true" class="default-button"> <SvgIcon name="ele-Search" class="mr5" />更多查询</el-button>
  30. </el-form-item>
  31. </el-form>
  32. </template>
  33. <template #order_detail="{ row }">
  34. <order-detail :order="{ id: row.orderId }" @updateList="queryList">{{ row.no }}</order-detail>
  35. </template>
  36. <template #pager>
  37. <pagination
  38. @pagination="queryList"
  39. :total="state.total"
  40. v-model:current-page="state.queryParams.PageIndex"
  41. v-model:page-size="state.queryParams.PageSize"
  42. :disabled="state.loading"
  43. />
  44. </template>
  45. </vxe-grid>
  46. </div>
  47. <!-- 更多查询 -->
  48. <el-drawer v-model="drawer" title="更多查询" size="500px">
  49. <el-form :model="state.queryParams" ref="drawerRuleFormRef" @submit.native.prevent label-width="100px">
  50. <el-form-item label="增加时间" prop="zjTime">
  51. <el-date-picker
  52. v-model="state.queryParams.zjTime"
  53. type="datetimerange"
  54. unlink-panels
  55. range-separator="至"
  56. start-placeholder="开始时间"
  57. end-placeholder="结束时间"
  58. :shortcuts="shortcuts"
  59. @change="handleQuery"
  60. value-format="YYYY-MM-DD[T]HH:mm:ss"
  61. :default-time="defaultTimeStartEnd"
  62. />
  63. </el-form-item>
  64. </el-form>
  65. <template #footer>
  66. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  67. <el-button @click="resetQuery(drawerRuleFormRef)" class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
  68. </template>
  69. </el-drawer>
  70. </div>
  71. </template>
  72. <script lang="tsx" setup name="snapshotReSendGrid">
  73. import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  74. import { FormInstance } from 'element-plus';
  75. import { defaultTimeStartEnd, shortcuts } from '@/utils/constants';
  76. import Other from '@/utils/other';
  77. import { getGridRedEnvelopeApprovalList } from '@/api/snapshot/reSend';
  78. // 引入组件
  79. const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
  80. const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
  81. // 定义变量内容
  82. const state = reactive<any>({
  83. loading: false,
  84. queryParams: {
  85. // 查询参数
  86. PageIndex: 1,
  87. PageSize: 20,
  88. No: null, // 工单编码
  89. PhoneNumber: null, // 手机号
  90. IndustryName: null, // 行业类型
  91. zjTime: [],
  92. BeginCreationTime: null,
  93. EndCreationTime: null,
  94. Status: 0,
  95. },
  96. total: 0, // 总条数
  97. });
  98. const gridOptions = reactive<any>({
  99. loading: false,
  100. border: true,
  101. showOverflow: true,
  102. columnConfig: {
  103. resizable: true,
  104. },
  105. scrollY: {
  106. enabled: true,
  107. gt: 100,
  108. },
  109. toolbarConfig: {
  110. zoom: true,
  111. custom: true,
  112. refresh: {
  113. queryMethod: () => {
  114. handleQuery();
  115. },
  116. },
  117. },
  118. customConfig: {
  119. storage: true,
  120. },
  121. id: 'snapshotReSendGrid',
  122. rowConfig: { isHover: true, height: 30, isCurrent: true, useKey: true },
  123. height: 'auto',
  124. columns: [
  125. {
  126. field: 'no',
  127. title: '工单编码',
  128. slots: { default: 'order_detail' },
  129. },
  130. {
  131. field: 'creationTime',
  132. title: '增加时间',
  133. formatter: 'formatDate',
  134. },
  135. {
  136. field: 'phoneNumber',
  137. title: '手机号',
  138. },
  139. {
  140. field: 'name',
  141. title: '姓名',
  142. },
  143. {
  144. field: 'amount',
  145. title: '金额',
  146. },
  147. {
  148. field: 'receiveTime',
  149. title: '发放时间',
  150. formatter: 'formatDate',
  151. },
  152. {
  153. field: 'distributionStateTxt',
  154. title: '状态',
  155. },
  156. {
  157. field: 'u',
  158. title: '领取状态',
  159. },
  160. {
  161. field: 'remark',
  162. title: '备注',
  163. minWidth: 200,
  164. },
  165. ],
  166. data: [],
  167. });
  168. /** 搜索按钮操作 节流操作 */
  169. const handleQuery = () => {
  170. state.queryParams.PageIndex = 1;
  171. queryList();
  172. };
  173. // 获取参数列表
  174. const requestParams = ref<EmptyObjectType>({});
  175. const queryList = () => {
  176. state.loading = true;
  177. gridOptions.loading = true;
  178. requestParams.value = Other.deepClone(state.queryParams);
  179. requestParams.value.BeginCreationTime = state.queryParams.zjTime === null ? null : state.queryParams.zjTime[0]; // 增加时间
  180. requestParams.value.EndCreationTime = state.queryParams.zjTime === null ? null : state.queryParams.zjTime[1];
  181. Reflect.deleteProperty(requestParams.value, 'zjTime'); // 删除无用的参数
  182. getGridRedEnvelopeApprovalList(requestParams.value)
  183. .then((res) => {
  184. state.loading = false;
  185. gridOptions.data = res.result.items ?? [];
  186. state.total = res.result.total ?? 0;
  187. gridOptions.loading = false;
  188. })
  189. .finally(() => {
  190. state.loading = false;
  191. gridOptions.loading = false;
  192. });
  193. };
  194. // 重置表单
  195. const drawerRuleFormRef = ref<RefType>();
  196. const ruleFormRef = ref<any>(null); // 表单ref
  197. const drawer = ref(false);
  198. const resetQuery = (formEl: FormInstance | undefined) => {
  199. if (!formEl) return;
  200. formEl.resetFields();
  201. ruleFormRef.value?.resetFields();
  202. queryList();
  203. };
  204. // 页面加载时
  205. onMounted(() => {
  206. queryList();
  207. });
  208. </script>