orderNoCallLog.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <div class="dataShare-orderNoCallLog-container layout-padding">
  3. <div class="layout-padding-auto layout-padding-view pd20">
  4. <ProTable
  5. ref="proTableRef"
  6. :columns="columns"
  7. :data="state.tableData"
  8. @updateTable="queryList"
  9. :loading="state.loading"
  10. :total="state.total"
  11. v-model:page-index="state.queryParams.PageIndex"
  12. v-model:page-size="state.queryParams.PageSize"
  13. >
  14. <template #table-search>
  15. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
  16. <el-form-item label="省本地编码" prop="CaseSerial">
  17. <el-input v-model="state.queryParams.CaseSerial" placeholder="省本地编码" clearable @keyup.enter="handleQuery" class="keyword-input" />
  18. </el-form-item>
  19. <el-form-item label="时间段" prop="crTime">
  20. <el-date-picker
  21. v-model="state.queryParams.crTime"
  22. type="datetimerange"
  23. unlink-panels
  24. range-separator="至"
  25. start-placeholder="开始时间"
  26. end-placeholder="结束时间"
  27. :shortcuts="shortcuts"
  28. @change="handleQuery"
  29. value-format="YYYY-MM-DD[T]HH:mm:ss"
  30. :default-time="defaultTimeStartEnd"
  31. :clearable="false"
  32. />
  33. </el-form-item>
  34. <el-form-item label-width="0">
  35. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  36. <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
  37. <SvgIcon name="ele-Refresh" class="mr5" />重置
  38. </el-button>
  39. </el-form-item>
  40. </el-form>
  41. </template>
  42. <template #tableHeader="scope">
  43. <!-- <el-button type="primary" @click="onEdit(false)" :disabled="!scope.isSelected" :loading="state.loading" title="修改来源渠道">
  44. 修改来源渠道
  45. </el-button>-->
  46. <el-button type="primary" @click="onEdit(true)" :disabled="!scope.isSelected" :loading="state.loading" title="修改并推送">
  47. 修改并推送<span v-if="proTableRef?.selectedList?.length">({{ proTableRef?.selectedList?.length }})</span>
  48. </el-button>
  49. </template>
  50. <template #title="{ row }">
  51. <order-detail :order="{ id: row.orderId }" @updateList="queryList">{{ row.title }}</order-detail>
  52. </template>
  53. </ProTable>
  54. </div>
  55. </div>
  56. </template>
  57. <script setup lang="tsx" name="dataShareOrderNoCallLog">
  58. import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  59. import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
  60. import { defaultDateTime, defaultTimeStartEnd, shortcuts } from '@/utils/constants';
  61. import { formatDate } from '@/utils/formatTime';
  62. import { editNoCallSource, getNoCallListNew } from '@/api/dataShare';
  63. import Other from '@/utils/other';
  64. const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
  65. const proTableRef = ref<RefType>(); // 表格ref
  66. // 表格配置项
  67. const columns = ref<any[]>([
  68. { type: 'selection', width: 40, align: 'center' },
  69. { prop: 'requestData.CASE_TITLE', label: '工单标题', align: 'center', minWidth: 200 },
  70. { prop: 'provinceNo', label: '省本地编码', align: 'center', minWidth: 220 },
  71. {
  72. prop: 'caseSource',
  73. label: '来源渠道',
  74. align: 'center',
  75. },
  76. {
  77. prop: 'startTime',
  78. label: '受理时间',
  79. align: 'center',
  80. width: 160,
  81. render: (scope) => {
  82. return <span>{formatDate(scope.row.startTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  83. },
  84. },
  85. {
  86. prop: 'creationTime',
  87. label: '入库时间',
  88. align: 'center',
  89. width: 160,
  90. render: (scope) => {
  91. return <span>{formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  92. },
  93. },
  94. {
  95. prop: 'firstTime',
  96. label: '第一次上传省上的时间',
  97. align: 'center',
  98. width: 170,
  99. render: (scope) => {
  100. return <span>{formatDate(scope.row.firstTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  101. },
  102. },
  103. {
  104. prop: 'lastTime',
  105. label: '最近一次推送时间',
  106. align: 'center',
  107. width: 160,
  108. render: (scope) => {
  109. return <span>{formatDate(scope.row.lastTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  110. },
  111. },
  112. ]);
  113. // 定义变量内容
  114. const ruleFormRef = ref<RefType>(); // 表单ref
  115. const state = reactive<any>({
  116. queryParams: {
  117. PageIndex: 1,
  118. PageSize: 20,
  119. crTime: defaultDateTime,
  120. StartTime: null,
  121. EndTime: null,
  122. CaseSerial: null,
  123. },
  124. tableData: [], //表单
  125. loading: false, // 加载
  126. total: 0, // 总数
  127. });
  128. /** 搜索按钮操作 */
  129. const handleQuery = () => {
  130. // state.queryParams.PageIndex = 1;
  131. queryList();
  132. };
  133. /** 获取列表 */
  134. const queryList = () => {
  135. state.loading = true;
  136. let request = Other.deepClone(state.queryParams);
  137. request.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
  138. request.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
  139. Reflect.deleteProperty(request, 'crTime');
  140. getNoCallListNew(request)
  141. .then((res: any) => {
  142. state.tableData = res.result?.items ?? [];
  143. state.total = res.result?.total ?? 0;
  144. state.loading = false;
  145. })
  146. .catch(() => {
  147. state.loading = false;
  148. });
  149. };
  150. /** 重置按钮操作 */
  151. const resetQuery = (formEl: FormInstance | undefined) => {
  152. if (!formEl) return;
  153. formEl.resetFields();
  154. queryList();
  155. };
  156. // 修改
  157. const onEdit = (isPush: boolean) => {
  158. const title = isPush ? '修改并推送' : '修改来源渠道';
  159. const ids = proTableRef.value.selectedList.map((item: any) => item.provinceNo);
  160. ElMessageBox.confirm(`您确定要${title}选择的【${proTableRef.value.selectedList.length}】个工单,是否继续?`, '提示', {
  161. confirmButtonText: '确认',
  162. cancelButtonText: '取消',
  163. type: 'warning',
  164. draggable: true,
  165. cancelButtonClass: 'default-button',
  166. autofocus: false,
  167. })
  168. .then(() => {
  169. editNoCallSource({ ids, isPush }).then(() => {
  170. ElMessage.success('操作成功');
  171. queryList();
  172. });
  173. })
  174. .catch(() => {});
  175. };
  176. // 查看修改记录
  177. const onRecord = (row: any) => {
  178. console.log(row);
  179. };
  180. onMounted(() => {
  181. queryList();
  182. });
  183. </script>