supplyLog.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <div class="snapshot-re-send-supply=log-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="IndustryId">
  8. <el-select v-model="state.queryParams.IndustryId" class="w100" placeholder="请选择行业" @change="handleQuery" clearable>
  9. <el-option v-for="item in industry" :key="item.id" :label="item.name" :value="item.id" />
  10. </el-select>
  11. </el-form-item>
  12. <el-form-item label="工单编码" prop="No">
  13. <el-input v-model="state.queryParams.No" placeholder="请填写工单编码" clearable @keyup.enter="handleQuery" class="keyword-input" />
  14. </el-form-item>
  15. <el-form-item label="工单标题" prop="Title">
  16. <el-input v-model="state.queryParams.Title" placeholder="请填写工单标题" clearable @keyup.enter="handleQuery" class="keyword-input" />
  17. </el-form-item>
  18. <el-form-item>
  19. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  20. <el-button @click="drawer = true" class="default-button"> <SvgIcon name="ele-Search" class="mr5" />更多查询</el-button>
  21. </el-form-item>
  22. </el-form>
  23. </template>
  24. <template #statusTxt="{ row }">
  25. <el-text type="danger" tag="b" v-if="[1, 2, 3, 9, 101, 102, 103, 104, 105, 200].includes(row.status)">{{ row.statusTxt }}</el-text>
  26. <span v-else>{{ row.statusTxt }}</span>
  27. </template>
  28. <template #order_detail="{ row }">
  29. <order-detail :order="{ id: row.orderId }" @updateList="queryList">{{ row.title }}</order-detail>
  30. </template>
  31. <template #pager>
  32. <pagination
  33. @pagination="queryList"
  34. :total="state.total"
  35. v-model:current-page="state.queryParams.PageIndex"
  36. v-model:page-size="state.queryParams.PageSize"
  37. :disabled="state.loading"
  38. />
  39. </template>
  40. </vxe-grid>
  41. </div>
  42. <!-- 更多查询 -->
  43. <el-drawer v-model="drawer" title="更多查询" size="500px">
  44. <el-form :model="state.queryParams" ref="drawerRuleFormRef" @submit.native.prevent label-width="100px" :disabled="gridOptions.loading">
  45. <el-form-item label="来电人电话" prop="FromPhone">
  46. <el-input v-model="state.queryParams.FromPhone" placeholder="请填写来电人电话" clearable @keyup.enter="handleQuery" class="keyword-input" />
  47. </el-form-item>
  48. <el-form-item label="发放时间" prop="ffTime">
  49. <el-date-picker
  50. v-model="state.queryParams.ffTime"
  51. type="datetimerange"
  52. unlink-panels
  53. range-separator="至"
  54. start-placeholder="开始时间"
  55. end-placeholder="结束时间"
  56. :shortcuts="shortcuts"
  57. @change="handleQuery"
  58. value-format="YYYY-MM-DD[T]HH:mm:ss"
  59. :default-time="defaultTimeStartEnd"
  60. />
  61. </el-form-item>
  62. </el-form>
  63. <template #footer>
  64. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  65. <el-button @click="resetQuery(drawerRuleFormRef)" class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
  66. </template>
  67. </el-drawer>
  68. </div>
  69. </template>
  70. <script lang="tsx" setup name="snapshotReSendSupplyLog">
  71. import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  72. import { FormInstance } from 'element-plus';
  73. import { defaultTimeStartEnd, shortcuts } from '@/utils/constants';
  74. import {getRedEnvelopeApprovalDetailExport, getRedEnvelopeApprovalSupplementBaseData, getRedEnvelopeApprovalSupplementList, getRedEnvelopeApprovalSupplementListExport} from '@/api/snapshot/reSend';
  75. import Other from '@/utils/other';
  76. // 引入组件
  77. const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
  78. const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
  79. // 定义变量内容
  80. const state = reactive<any>({
  81. loading: false,
  82. queryParams: {
  83. // 查询参数
  84. PageIndex: 1,
  85. PageSize: 20,
  86. ffTime: [], // 发放时间
  87. BeginCreationTime: null,
  88. EndCreationTime: null,
  89. No: null, // 工单编码
  90. IndustryId: null, // 行业类型
  91. Title: null, // 工单标题
  92. },
  93. total: 0, // 总条数
  94. });
  95. const requestParams = ref<EmptyObjectType>({});
  96. const gridOptions = reactive<any>({
  97. loading: false,
  98. border: true,
  99. showOverflow: true,
  100. columnConfig: {
  101. resizable: true,
  102. },
  103. scrollY: {
  104. enabled: true,
  105. gt: 100,
  106. },
  107. toolbarConfig: {
  108. zoom: true,
  109. custom: true,
  110. refresh: {
  111. queryMethod: () => {
  112. handleQuery();
  113. },
  114. },
  115. tools: [{ toolRender: { name: 'exportCurrent' } }, { toolRender: { name: 'exportAll' } }],
  116. },
  117. params: {
  118. exportMethod: getRedEnvelopeApprovalSupplementListExport,
  119. exportParams: requestParams,
  120. },
  121. customConfig: {
  122. storage: true,
  123. },
  124. id: 'snapshotReAuditSupplyLog',
  125. rowConfig: { isHover: true, height: 30, isCurrent: true, useKey: true },
  126. height: 'auto',
  127. columns: [
  128. {
  129. field: 'statusTxt',
  130. title: '工单状态',
  131. width: 110,
  132. slots: {
  133. default: 'statusTxt',
  134. },
  135. },
  136. {
  137. field: 'sourceChannel',
  138. title: '来源渠道',
  139. width: 110,
  140. },
  141. {
  142. field: 'no',
  143. title: '工单编码',
  144. width: 140,
  145. },
  146. {
  147. field: 'title',
  148. title: '工单标题',
  149. slots: { default: 'order_detail' },
  150. minWidth: 200,
  151. },
  152. {
  153. field: 'industryName',
  154. title: '行业',
  155. width: 120,
  156. },
  157. {
  158. field: 'fromName',
  159. title: '来电人姓名',
  160. width: 120,
  161. },
  162. {
  163. field: 'fromPhone',
  164. title: '来电人电话',
  165. width: 140,
  166. },
  167. {
  168. field: 'county',
  169. title: '区域',
  170. width: 120,
  171. },
  172. {
  173. field: 'replenishAmount',
  174. title: '补充发放金额',
  175. width: 120,
  176. },
  177. {
  178. field: 'auditType',
  179. title: '补充奖励类型',
  180. width: 120,
  181. },
  182. {
  183. field: 'name',
  184. title: '姓名',
  185. width: 120,
  186. },
  187. {
  188. field: 'bankCardNo',
  189. title: '卡号',
  190. width: 150,
  191. },
  192. {
  193. field: 'openBank',
  194. title: '开户行',
  195. width: 150,
  196. },
  197. {
  198. field: 'creationTime',
  199. title: '补充发放时间',
  200. formatter: 'formatDate',
  201. width: 160,
  202. },
  203. {
  204. field: 'creatorName',
  205. title: '补充发放人员',
  206. width: 140,
  207. },
  208. {
  209. field: 'remark',
  210. title: '备注',
  211. minWidth: 200,
  212. },
  213. ],
  214. data: [],
  215. });
  216. /** 搜索按钮操作 节流操作 */
  217. const handleQuery = () => {
  218. state.queryParams.PageIndex = 1;
  219. queryList();
  220. };
  221. // 获取参数列表
  222. const queryList = () => {
  223. state.loading = true;
  224. gridOptions.loading = true;
  225. requestParams.value = Other.deepClone(state.queryParams);
  226. requestParams.value.BeginCreationTime = state.queryParams.ffTime === null ? null : state.queryParams.ffTime[0]; // 发放时间
  227. requestParams.value.EndCreationTime = state.queryParams.ffTime === null ? null : state.queryParams.ffTime[1];
  228. Reflect.deleteProperty(requestParams.value, 'ffTime'); // 删除无用的参数
  229. getRedEnvelopeApprovalSupplementList(requestParams.value)
  230. .then((res) => {
  231. state.loading = false;
  232. gridOptions.data = res.result.items ?? [];
  233. state.total = res.result.total ?? 0;
  234. gridOptions.loading = false;
  235. })
  236. .finally(() => {
  237. state.loading = false;
  238. gridOptions.loading = false;
  239. });
  240. };
  241. // 重置表单
  242. const drawerRuleFormRef = ref<RefType>();
  243. const ruleFormRef = ref<any>(null); // 表单ref
  244. const drawer = ref(false);
  245. const resetQuery = (formEl: FormInstance | undefined) => {
  246. if (!formEl) return;
  247. formEl.resetFields();
  248. ruleFormRef.value?.resetFields();
  249. queryList();
  250. };
  251. const industry = ref<EmptyArrayType>([]); // 行业
  252. const getBaseData = async () => {
  253. try {
  254. const { result } = await getRedEnvelopeApprovalSupplementBaseData();
  255. industry.value = result.industry ?? [];
  256. } catch (e) {
  257. console.log(e);
  258. }
  259. };
  260. // 页面加载时
  261. onMounted(() => {
  262. queryList();
  263. getBaseData();
  264. });
  265. </script>