刘洋 1 рік тому
батько
коміт
23592cb699

+ 82 - 27
src/views/report/device-analysis/index.vue

@@ -15,22 +15,34 @@
     </report-header>
     <div class="page-main">
       <div class="scroll-content">
-        <div class="card">
+        <div class="card card1">
           <div class="title">库存监控</div>
-          <div class="chart-wrap">
-            <my-chart :options="options1"></my-chart>
+          <div class="flex" style="height: calc(100% - 36px)">
+            <div class="chart-wrap">
+              <my-chart :options="options1"></my-chart>
+            </div>
+            <div class="table-wrap1">
+              <t-table
+                size="small"
+                row-key="index"
+                :columns="columns"
+                :data="tableData1"
+                bordered
+                v-loading="loading2"
+              >
+              </t-table>
+              <t-pagination
+                v-if="pagination1.total > 0"
+                style="margin-top: 15px"
+                v-model="pagination1.current"
+                v-model:pageSize="pagination1.pageSize"
+                :total="pagination1.total"
+                :showPageSize="false"
+              />
+            </div>
           </div>
-          <t-table
-            size="small"
-            row-key="index"
-            :columns="columns"
-            :data="tableData"
-            bordered
-            v-loading="loading2"
-          >
-          </t-table>
         </div>
-        <div class="card m-t-10px">
+        <div class="card card2 m-t-10px">
           <div class="title">资源预警监控</div>
           <div class="detail">
             总配额:{{ result3?.DEVICES }} | 总差额空闲比:{{
@@ -48,6 +60,14 @@
             v-loading="loading4"
           >
           </t-table>
+          <t-pagination
+            v-if="pagination2.total > 0"
+            style="margin-top: 15px"
+            v-model="pagination2.current"
+            v-model:pageSize="pagination2.pageSize"
+            :total="pagination2.total"
+            :showPageSize="false"
+          />
         </div>
       </div>
     </div>
@@ -55,7 +75,7 @@
 </template>
 
 <script setup name="DeviceAnalysis">
-import { ref, computed, onMounted, watch } from 'vue';
+import { ref, computed, onMounted, watch, reactive } from 'vue';
 import { useRequest } from 'vue-request';
 import { createCakePieOption } from '@/utils/chart';
 import {
@@ -116,27 +136,49 @@ onMounted(() => {
   run3();
   run4();
 });
-const tableData = computed(() => {
+const pagination1 = reactive({
+  current: 1,
+  pageSize: 3,
+  total: 0,
+});
+const tableData1 = computed(() => {
+  let data = [];
   if (!model.value) {
-    return result2.value || [];
+    data = result2.value || [];
   } else {
-    return result2.value
-      ?.filter((item) => item.MODEL == model.value)
-      .map((item, index) => {
-        item.index = index + '';
-        item.occupyRate =
-          item.TOTAL == (0 ? 0 : (item.ISOUT / item.TOTAL) * 100) + '%';
-        return item;
-      });
+    data = (result2.value || [])?.filter((item) => item.MODEL == model.value);
   }
+  data = data.map((item, index) => {
+    item.index = index + '';
+    item.occupyRate =
+      item.TOTAL == 0 ? 0 : ((item.ISOUT / item.TOTAL) * 100).toFixed(2) + '%';
+    return item;
+  });
+  pagination1.total = data.length;
+  return data.slice(
+    pagination1.pageSize * (pagination1.current - 1),
+    pagination1.pageSize * (pagination1.current - 1) + pagination1.pageSize
+  );
+});
+
+const pagination2 = reactive({
+  current: 1,
+  pageSize: 4,
+  total: 0,
 });
 const tableData2 = computed(() => {
-  return result4?.value?.map((item) => {
+  let data = (result4?.value || []).map((item) => {
     item.difference = (item.devices || 0) - item.OUTS;
     item.rate = division(item?.OUTS, item?.devices || 0) + '%';
     return item;
   });
+  pagination2.total = data.length;
+  return data.slice(
+    pagination2.pageSize * (pagination2.current - 1),
+    pagination2.pageSize * (pagination2.current - 1) + pagination2.pageSize
+  );
 });
+
 const columns = [
   { colKey: 'ISIN', title: '空闲' },
   { colKey: 'BREAK_DOWN', title: '故障' },
@@ -196,6 +238,13 @@ const options1 = computed(() => {
       background-color: #fff;
       border: 1px solid #e5e5e5;
       border-radius: 4px;
+
+      &.card1 {
+        height: calc(45% - 5px);
+      }
+      &.card2 {
+        height: calc(55% - 5px);
+      }
       .detail {
         color: #8c8c8c;
         font-size: 12px;
@@ -213,8 +262,14 @@ const options1 = computed(() => {
         }
       }
       .chart-wrap {
-        height: 180px;
-        width: 300px;
+        height: 100%;
+        width: 310px;
+      }
+      .table-wrap1 {
+        width: calc(100% - 360px);
+        margin-left: 50px;
+        height: 100%;
+        overflow: auto;
       }
     }
   }

+ 1 - 1
src/views/report/service-analysis/index.vue

@@ -376,7 +376,7 @@ watch(regionId, (regionId) => {
 
 const options1 = computed(() => {
   return createWaterBallOption({
-    data: (result1?.projectProgress || 0) / 100,
+    data: (result1.value?.projectProgress || 0) / 100,
     title: '项目执行进度',
     radius: '80%',
   });

+ 17 - 3
src/views/resource-guard/person-guard/person-allocate/deploy-detail-dialog.vue

@@ -54,7 +54,8 @@
         <h3>人员调配</h3>
         <t-form label-width="110px">
           <t-form-item label="区域协调人">
-            <t-radio v-model="curRow.ss" disabled>由大区经理兼任</t-radio>
+            <!-- <t-radio v-model="curRow.ss" disabled>由大区经理兼任</t-radio> -->
+            <t-radio :checked="isByManage" disabled>由大区经理兼任</t-radio>
           </t-form-item>
         </t-form>
         <div class="deploy-list">
@@ -95,7 +96,7 @@
   </my-drawer>
 </template>
 <script setup name="DeployDetailDialog">
-import { ref, watch } from 'vue';
+import { ref, watch, computed } from 'vue';
 import { personAllocateRoleDetailApi } from '@/api/resource-guard';
 import { customerTypeFilter } from '@/utils/filter';
 
@@ -136,7 +137,20 @@ const getDetail = async () => {
     roleConfigInfo.value = [];
   }
 };
-
+const isByManage = computed(() => {
+  let arr = roleConfigInfo.value || [];
+  console.log('arr', arr);
+  let find = arr.find(
+    (item) =>
+      !!(item.userList || []).find(
+        (v) =>
+          v.roleResult.roleType === 'REGION_COORDINATOR' &&
+          v.userId == props.curRow.regionManagerId
+      )
+  );
+  console.log('find', find);
+  return !!find;
+});
 watch(
   () => props.visible,
   (val) => {

+ 4 - 1
src/views/resource-guard/person-guard/person-files/index.vue

@@ -53,7 +53,10 @@
         <select-area v-model="params[item.prop]" :level="2"></select-area>
       </template>
       <template #supplier="{ item, params }">
-        <select-supplier v-model="params[item.prop]"></select-supplier>
+        <select-supplier
+          v-model="params[item.prop]"
+          type="HUMAN"
+        ></select-supplier>
       </template>
     </SearchForm>
     <div class="flex-1 page-wrap">

+ 1 - 1
src/views/sop/sop-manage/device-out-in/device-table/edit-column-dialog.vue

@@ -191,7 +191,7 @@ const save = async () => {
   for (let key in formData) {
     data[key] = formData[key];
   }
-  // if (props.isOutType) data.address = data.addressArr.join('');
+  if (props.isOutType) data.address = data.addressArr.join('');
   emit('update:visible', false);
   emit('success', data);
 };