East 3 yıl önce
ebeveyn
işleme
620f1a58c5

+ 9 - 6
src/components/erp/ProductionDonut.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-10-11 14:54:18
- * @LastEditTime: 2021-11-29 18:21:20
+ * @LastEditTime: 2021-12-03 14:58:55
  * @LastEditors: Please set LastEditors
  * @Description: 生产情况的环形图
  * @FilePath: \hyyfClient\src\components\erp\ProductionDonut.vue
@@ -72,11 +72,11 @@ export default {
         graphic: [
           {
             type: "text",
-            left: "9%",
+            left: "35",
             top: "38%",
             style: {
               text: (parseFloat(this.stockQuantity) * 100).toFixed(2) + "%",
-              fontSize: 35,
+              fontSize: 28,
               fill: useColor,
             },
           },
@@ -91,6 +91,7 @@ export default {
             label: {
               show: false,
             },
+            hoverAnimation: false,
             emphasis: {
               label: {
                 show: false,
@@ -131,9 +132,11 @@ export default {
     this.init();
   },
   watch: {
-    stockName(newValue) {
-      console.log(newValue);
-      this.init();
+    stockName: {
+      handler(newValue) {
+        console.log(newValue);
+        this.init();
+      },
     },
   },
 };

+ 41 - 33
src/components/newTable/TableContent.vue

@@ -8,30 +8,35 @@
 -->
 <template>
   <div class="table-content">
-    <el-table :data="listData" border :height="height" @selection-change="handleSelectionChange">
+    <el-table
+      :data="listData"
+      border
+      :height="height"
+      @selection-change="handleSelectionChange"
+      :empty-text="emptyText"
+    >
+      <el-table-column v-if="shows.showSelect" type="selection" align="center">
+      </el-table-column>
 
-        <el-table-column 
-          v-if="shows.showSelect" 
-          type="selection" 
-          align="center">
-        </el-table-column>
+      <el-table-column
+        v-if="shows.showIndex"
+        type="index"
+        label="序号"
+        align="center"
+        width="70"
+      >
+      </el-table-column>
 
-        <el-table-column 
-          v-if="shows.showIndex" 
-          type="index" label="序号" 
-          align="center" width="70">
+      <template v-for="item in tableItems">
+        <el-table-column :key="item.prop" v-bind="item" align="center">
+          <template slot-scope="scope">
+            <slot :name="item.slotName" :row="scope.row">
+              {{ scope.row[item.prop] }}
+            </slot>
+          </template>
         </el-table-column>
-
-        <template v-for="item in tableItems">
-          <el-table-column :key="item.prop" v-bind="item" align="center">
-            <template slot-scope="scope">
-              <slot :name="item.slotName" :row="scope.row">
-                {{ scope.row[item.prop] }}
-              </slot>
-            </template>
-          </el-table-column>
-        </template>
-      </el-table>
+      </template>
+    </el-table>
   </div>
 </template>
 <script>
@@ -39,28 +44,31 @@ export default {
   props: {
     listData: {
       type: Array,
-      required: true
+      required: true,
     },
-    height: { // 表格高度控制
+    height: {
+      // 表格高度控制
       type: Number,
-      default: 500
+      default: 500,
     },
     tableItems: {
       type: Array,
-      required: true
+      required: true,
     },
     shows: {
       type: Object,
-      default: () => ({ showIndex: true, showSelect: true})
+      default: () => ({ showIndex: true, showSelect: true }),
+    },
+    emptyText: {
+      type: String,
+      default: "暂无数据",
     },
   },
   methods: {
     handleSelectionChange(rows) {
-      this.$emit('selectionChange', rows)
-    }
-  }
-}
+      this.$emit("selectionChange", rows);
+    },
+  },
+};
 </script>
-<style scoped>
-  
-</style>
+<style scoped></style>

+ 6 - 2
src/views/BioSafety/PersonAdmin.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-09-16 11:27:35
- * @LastEditTime: 2021-11-30 14:32:06
+ * @LastEditTime: 2021-12-03 13:38:19
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \hyyfClient\src\views\BioSafety\PersonAdmin.vue
@@ -22,7 +22,8 @@
       :propFormData="propFormData"
       :defaultEmit="true"
       @getQueryParams="handleQuery"
-    ></query-conditions>
+    >
+    </query-conditions>
 
     <!-- 表格 -->
     <new-table
@@ -55,6 +56,9 @@
       <template v-slot:recordImage="slotProps">
         <img :src="slotProps.row.recordImage" alt="人员门禁" width="100" />
       </template>
+      <template v-slot:personName="slotProps">
+        {{ slotProps.row.personName ? slotProps.row.personName : "未知 " }}
+      </template>
 
       <!-- 档案管理 -->
       <template v-slot:personBiosignatures="slotProps">

+ 1 - 1
src/views/BioSafety/personAdmin/table.config.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-18 16:06:51
- * @LastEditTime: 2021-11-30 10:03:20
+ * @LastEditTime: 2021-12-03 13:37:14
  * @LastEditors: Please set LastEditors
  * @Description: 表格的配置
  * @FilePath: \hyyfClient\src\views\BioSafety\personAdmin\table.config.js

+ 25 - 36
src/views/PdcData/Analysis.vue

@@ -40,7 +40,7 @@
     <!-- 生产情况 -->
     <board :title="title[2]">
       <!-- 环形图 -->
-      <production-donuts :data="productionPercents"></production-donuts>
+      <production-donuts :data="productionPercents"> </production-donuts>
       <!-- 8个格子 -->
       <production-items :data="productionItems"></production-items>
     </board>
@@ -197,6 +197,7 @@
         :height="height"
         :shows="safetyTableShows"
         :listData="safetyTableData"
+        :empty-text="'暂无报警'"
       >
         <template #isWarning="slotProps">
           <el-tag
@@ -292,40 +293,7 @@ export default {
         "应付排名",
         "安全库存报警",
       ],
-      workInfos: [
-        {
-          label: "预警信息",
-          number: 10,
-        },
-        {
-          label: "断奶数量",
-          number: 1150,
-        },
-        {
-          label: "配种数量",
-          number: 1540,
-        },
-        {
-          label: "转舍计划",
-          number: 108,
-        },
-        {
-          label: "分娩数量",
-          number: 180,
-        },
-        {
-          label: "日常计划",
-          number: 10,
-        },
-        {
-          label: "天才计划",
-          number: 10,
-        },
-        {
-          label: "保健计划",
-          number: 10,
-        },
-      ],
+      workInfos: [],
       tableItems: [],
       tableShows: {},
       height: 300,
@@ -469,7 +437,28 @@ export default {
     // 工作看板
     initWorkBoard() {
       getWorkTotal({}).then(async (res) => {
-        this.workInfos = res.data;
+        this.workInfos = [
+          {
+            label: "报警信息",
+            number: res.data.warning?.planTimes || 0,
+          },
+          {
+            label: "日常计划",
+            number: res.data.daily?.planTimes || 0,
+          },
+          {
+            label: "转舍记录",
+            number: res.data.transferHouse?.planTimes || 0,
+          },
+          {
+            label: "普免计划",
+            number: res.data.ordinary?.planTimes || 0,
+          },
+          {
+            label: "免疫计划",
+            number: res.data.immune?.planTimes || 0,
+          },
+        ];
         const result = await getWorkInfos({});
         this.tableData = result.data;
       });

+ 33 - 30
src/views/PdcData/analysis/WorkInfos.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-09-28 11:28:08
- * @LastEditTime: 2021-11-25 13:43:25
+ * @LastEditTime: 2021-12-03 13:34:04
  * @LastEditors: Please set LastEditors
  * @Description: 工作看板的预警信息等统计
  * @FilePath: \hyyfClient\src\views\PdcData\analysis\WorkInfos.vue
@@ -12,8 +12,11 @@
       <template v-for="item in dataList">
         <el-col :span="12" :key="item.id">
           <div class="item" @click="handleClick(item)">
-            <span class="label">{{ item.planName }}</span>
-            <span class="right">(<span class="number">{{ item.planTimes }}</span>)</span>
+            <span class="label">{{ item.label }}</span>
+            <span class="right"
+              >(<span class="number">{{ item.number }}</span
+              >)</span
+            >
           </div>
         </el-col>
       </template>
@@ -25,38 +28,38 @@ export default {
   props: {
     dataList: {
       type: Array,
-      required: true
-    }
+      required: true,
+    },
   },
   methods: {
     handleClick(item) {
-      this.$emit('workInfoClick', item)
-    }
+      this.$emit("workInfoClick", item);
+    },
   },
-}
+};
 </script>
 <style scoped>
-  .work-info {
-    padding: 20px;
-  }
+.work-info {
+  padding: 20px;
+}
 
-  .item {
-    padding: 15px 15px 7px;
-    border-bottom: 1px solid rgba(235, 238, 245, 1);
-    font-size: 13px;
-    margin: 0px 10px;
-    cursor: pointer;
-  }
-  .item:hover {
-    background-color: #eee;
-  }
-  .item>.label {
-    color: #bcbcbc;
-  }
-  .item>.right {
-    float: right;
-  }
-  .item>.right>.number {
-    color: #f04844;
-  }
+.item {
+  padding: 15px 15px 7px;
+  border-bottom: 1px solid rgba(235, 238, 245, 1);
+  font-size: 13px;
+  margin: 0px 10px;
+  cursor: pointer;
+}
+.item:hover {
+  background-color: #eee;
+}
+.item > .label {
+  color: #bcbcbc;
+}
+.item > .right {
+  float: right;
+}
+.item > .right > .number {
+  color: #f04844;
+}
 </style>