刘洋 1 year ago
parent
commit
a9e4441e39

+ 12 - 0
src/api/report.js

@@ -254,3 +254,15 @@ export const qualityAnalysisInfluence = (params) =>
     url: '/api/quality/analyse/influence',
     params,
   });
+//饼图下钻
+export const inventoryDrill = (params) =>
+  request({
+    url: '/api/quality/analyse/supplier/detail',
+    params,
+  });
+//影响度/归因 下钻接口
+export const degreeDrill = (params) =>
+  request({
+    url: '/api/quality/analyse/influence/detail',
+    params,
+  });

+ 2 - 2
src/views/report/dispatch-analysis/custom-type-drill-dialog.vue

@@ -72,8 +72,8 @@ const emit = defineEmits(['close']);
 
 watch(
   () => props.visible,
-  () => {
-    search();
+  (val) => {
+    val && search();
   }
 );
 const transParams = computed(() => {

+ 2 - 2
src/views/report/dispatch-analysis/dispatch-statistics-drill-dialog.vue

@@ -72,8 +72,8 @@ const emit = defineEmits(['close']);
 
 watch(
   () => props.visible,
-  () => {
-    search();
+  (val) => {
+    val && search();
   }
 );
 const transParams = computed(() => {

+ 5 - 5
src/views/report/dispatch-analysis/month-dispatch-drill-dialog.vue

@@ -49,13 +49,13 @@ import { CUSTOMER_TYPE } from '@/config/constants';
 import useFetchTable from '@/hooks/useFetchTable';
 import { monthDispatchDrill } from '@/api/report';
 import { dateFormat } from '@/utils/tool';
-import {customerTypeFilter, timestampFilter} from "@/utils/filter";
+import { customerTypeFilter, timestampFilter } from '@/utils/filter';
 const tableColumns = [
   { colKey: 'service', title: '服务单元' },
   { colKey: 'crmNo', title: '项目单号' },
-  { colKey: 'beginTime', title: '派单时间' , cell: 'begin-time'},
+  { colKey: 'beginTime', title: '派单时间', cell: 'begin-time' },
   { colKey: 'crmUserName', title: '客户经理' },
-  { colKey: 'customType', title: '客户类型' , cell: 'custom-type'},
+  { colKey: 'customType', title: '客户类型', cell: 'custom-type' },
   { colKey: 'custom', title: '客户名称' },
   { colKey: 'name', title: '项目名称' },
   { colKey: 'product', title: '实施产品' },
@@ -69,8 +69,8 @@ const emit = defineEmits(['close']);
 
 watch(
   () => props.visible,
-  () => {
-    search();
+  (val) => {
+    val && search();
   }
 );
 const transParams = computed(() => {

+ 2 - 2
src/views/report/dispatch-analysis/region-dispatch-drill-dialog.vue

@@ -77,8 +77,8 @@ const emit = defineEmits(['close']);
 
 watch(
   () => props.visible,
-  () => {
-    search();
+  (val) => {
+    val && search();
   }
 );
 const transParams = computed(() => {

+ 2 - 2
src/views/report/dispatch-analysis/supplier-dispatch-drill-dialog.vue

@@ -74,8 +74,8 @@ const emit = defineEmits(['close']);
 
 watch(
   () => props.visible,
-  () => {
-    search();
+  (val) => {
+    val && search();
   }
 );
 const transParams = computed(() => {

+ 13 - 8
src/views/report/project-analysis/sop-detail-drill-dialog.vue

@@ -38,9 +38,9 @@
       }"
       v-loading="loading"
     >
-<!--      <template #custom-type="{ col, row }">-->
-<!--        {{ customerTypeFilter(row[col.colKey]) }}-->
-<!--      </template>-->
+      <!--      <template #custom-type="{ col, row }">-->
+      <!--        {{ customerTypeFilter(row[col.colKey]) }}-->
+      <!--      </template>-->
       <template #begin-time="{ col, row }">
         {{ timestampFilter(row[col.colKey]) }}
       </template>
@@ -53,15 +53,20 @@ import { CUSTOMER_TYPE } from '@/config/constants';
 import { dateFormat } from '@/utils/tool';
 import useFetchTable from '@/hooks/useFetchTable';
 import { sopDetailDrill } from '@/api/report';
-import {customerTypeFilter, issuesReasonTypeFilter, issuesTypeFilter, timestampFilter} from "@/utils/filter";
+import {
+  customerTypeFilter,
+  issuesReasonTypeFilter,
+  issuesTypeFilter,
+  timestampFilter,
+} from '@/utils/filter';
 const tableColumns = [
   { colKey: 'serviceName', title: '服务单元' },
   { colKey: 'crmNo', title: '项目单号' },
   { colKey: 'sopNo', title: 'SOP' },
   { colKey: 'statusStr', title: 'SOP状态' },
-  { colKey: 'beginTime', title: '派单时间', cell: 'begin-time'},
+  { colKey: 'beginTime', title: '派单时间', cell: 'begin-time' },
   { colKey: 'customManagerName', title: '客户经理' },
-  { colKey: 'customManagerTypeStr', title: '客户类型' ,cell: 'custom-type'},
+  { colKey: 'customManagerTypeStr', title: '客户类型', cell: 'custom-type' },
   { colKey: 'customName', title: '客户名称' },
   { colKey: 'crmName', title: '项目名称' },
   { colKey: 'productName', title: '实施产品' },
@@ -74,8 +79,8 @@ const emit = defineEmits(['close']);
 
 watch(
   () => props.visible,
-  () => {
-    search();
+  (val) => {
+    val && search();
   }
 );
 const transParams = computed(() => {

+ 0 - 0
src/views/report/quality-analysis/degree-drill-dialog.vue


+ 37 - 1
src/views/report/quality-analysis/index.vue

@@ -29,6 +29,7 @@
               <my-chart
                 v-if="overallPieData"
                 :options="overallPieOptions"
+                @chartClick="chart0Click"
               ></my-chart>
             </div>
             <div class="chart-part">
@@ -69,6 +70,7 @@
                 v-if="result11"
                 :options="options11"
                 ref="chart11"
+                @chartClick="chart11Click"
               ></my-chart>
             </div>
           </div>
@@ -89,6 +91,7 @@
                 v-if="result12"
                 :options="options12"
                 ref="chart12"
+                @chartClick="chart12Click"
               ></my-chart>
             </div>
           </div>
@@ -109,6 +112,7 @@
                 v-if="result21"
                 :options="options21"
                 ref="chart21"
+                @chartClick="chart21Click"
               ></my-chart>
             </div>
           </div>
@@ -129,12 +133,19 @@
                 v-if="result22"
                 :options="options22"
                 ref="chart22"
+                @chartClick="chart22Click"
               ></my-chart>
             </div>
           </div>
         </div>
       </div>
-    </div> </div
+    </div>
+
+    <InventoryDrillDialog
+      v-model:visible="showInventoryDrillData"
+      :data="inventoryDrillData"
+      :footer="false"
+    ></InventoryDrillDialog> </div
 ></template>
 
 <script setup name="QualityAnalysis">
@@ -154,10 +165,32 @@ import {
 } from '@/api/report';
 import { FullscreenIcon } from 'tdesign-icons-vue-next';
 import { ISSUES_REASON_TYPE } from '@/config/constants';
+import InventoryDrillDialog from './inventory-drill-dialog.vue';
+import { cloneDeep } from 'lodash';
 const chart11 = ref();
 const chart12 = ref();
 const chart21 = ref();
 const chart22 = ref();
+const inventoryDrillData = ref({
+  serviceUnitId: '',
+  degree: '',
+  serviceName: '',
+});
+const showInventoryDrillData = ref(false);
+const chart0Click = (params) => {
+  inventoryDrillData.value.serviceUnitId = serviceId.value;
+  inventoryDrillData.value.degree = params.name;
+  inventoryDrillData.value.serviceName = serviceOptions.value.find(
+    (item) => item.id == serviceId.value
+  )?.name;
+  showInventoryDrillData.value = true;
+};
+
+const showDegreeDrillData = ref(false);
+const chart11Click = (params) => {};
+const chart12Click = (params) => {};
+const chart21Click = (params) => {};
+const chart22Click = (params) => {};
 const curTimeRange = ref([]);
 const timeParams = computed(() => {
   return {
@@ -335,6 +368,9 @@ const options12 = computed(() => {
 
   return createStackingBarOption(buildBarData(obj), barExtendOption);
 });
+// const supplierIdsMap = computed(() => {
+//   let res = cloneDeep(result12.value || {});
+// });
 const options21 = computed(() => {
   return createStackingBarOption(
     buildBarData(result21.value || {}),

+ 89 - 0
src/views/report/quality-analysis/inventory-drill-dialog.vue

@@ -0,0 +1,89 @@
+<template>
+  <my-dialog
+    :visible="visible"
+    :header="`质量问题盘点`"
+    :width="1200"
+    :closeOnOverlayClick="false"
+    @close="emit('update:visible', false)"
+  >
+    <div class="drill-search-box">
+      <div class="field">
+        <div class="label">服务单元:</div>
+        <div class="value">{{ props.data?.serviceName }}</div>
+      </div>
+      <div class="field">
+        <div class="label">影响度:</div>
+        <div class="value">{{ props.data?.degree }}</div>
+      </div>
+    </div>
+    <t-table
+      ref="tableRef"
+      size="small"
+      row-key="key"
+      :columns="tableColumns"
+      :data="tableData"
+      bordered
+      :pagination="{
+        defaultCurrent: 1,
+        defaultPageSize: 10,
+        onChange,
+        showJumper: true,
+        showPageSize: false,
+        total: pagination.total,
+        current: pagination.pageNumber,
+      }"
+      v-loading="loading"
+    >
+      <template #custom-type="{ col, row }">
+        {{ customerTypeFilter(row[col.colKey]) }}
+      </template>
+      <template #begin-time="{ col, row }">
+        {{ timestampFilter(row[col.colKey]) }}
+      </template>
+    </t-table>
+  </my-dialog>
+</template>
+<script setup name="InventoryDrillDialog">
+import { ref, computed, reactive, watch } from 'vue';
+import { CUSTOMER_TYPE } from '@/config/constants';
+import { dateFormat } from '@/utils/tool';
+import useFetchTable from '@/hooks/useFetchTable';
+import { inventoryDrill } from '@/api/report';
+import { customerTypeFilter, timestampFilter } from '@/utils/filter';
+const tableColumns = [
+  { colKey: 'service', title: '服务单元' },
+  { colKey: 'crmNo', title: '项目单号' },
+  { colKey: 'beginTime', title: '派单时间', cell: 'begin-time' },
+  { colKey: 'crmUserName', title: '客户经理' },
+  { colKey: 'customType', title: '客户类型', cell: 'custom-type' },
+  { colKey: 'custom', title: '客户名称' },
+  { colKey: 'name', title: '项目名称' },
+  { colKey: 'product', title: '实施产品' },
+];
+const props = defineProps({
+  visible: Boolean,
+  data: Object,
+});
+const emit = defineEmits(['close']);
+
+watch(
+  () => props.visible,
+  (val) => {
+    val && search();
+  }
+);
+const transParams = computed(() => {
+  return {
+    serviceUnitId: props.data?.serviceUnitId,
+    degree: props.data?.degree,
+  };
+});
+
+const { loading, pagination, tableData, search, onChange } = useFetchTable(
+  inventoryDrill,
+  {
+    params: transParams,
+  },
+  false
+);
+</script>

+ 5 - 5
src/views/report/service-analysis/supplier-detail-drill-dialog.vue

@@ -49,13 +49,13 @@ import { CUSTOMER_TYPE } from '@/config/constants';
 import { dateFormat } from '@/utils/tool';
 import useFetchTable from '@/hooks/useFetchTable';
 import { supplierOverviewDrill } from '@/api/report';
-import {customerTypeFilter, timestampFilter} from "@/utils/filter";
+import { customerTypeFilter, timestampFilter } from '@/utils/filter';
 const tableColumns = [
   { colKey: 'service', title: '服务单元' },
   { colKey: 'crmNo', title: '项目单号' },
-  { colKey: 'beginTime', title: '派单时间' , cell: 'begin-time'},
+  { colKey: 'beginTime', title: '派单时间', cell: 'begin-time' },
   { colKey: 'crmUserName', title: '客户经理' },
-  { colKey: 'customType', title: '客户类型' , cell: 'custom-type'},
+  { colKey: 'customType', title: '客户类型', cell: 'custom-type' },
   { colKey: 'custom', title: '客户名称' },
   { colKey: 'name', title: '项目名称' },
   { colKey: 'product', title: '实施产品' },
@@ -68,8 +68,8 @@ const emit = defineEmits(['close', 'update:visible']);
 
 watch(
   () => props.visible,
-  () => {
-    search();
+  (val) => {
+    val && search();
   }
 );
 const transParams = computed(() => {

+ 1 - 1
src/views/sop/sop-manage/office-sop/index.vue

@@ -46,7 +46,7 @@
         <select-service-unit
           v-model="params[item.prop]"
           :filterParams="{
-            statusList: ['PUBLISH', 'FINISH'],
+            statusList: ['PUBLISH'],
             type: 'OFFICE',
           }"
         ></select-service-unit>

+ 1 - 1
src/views/sop/sop-manage/student-sop/index.vue

@@ -46,7 +46,7 @@
         <select-service-unit
           v-model="params[item.prop]"
           :filterParams="{
-            statusList: ['PUBLISH', 'FINISH'],
+            statusList: ['PUBLISH'],
             type: 'CLOUD_MARK',
           }"
         ></select-service-unit>