East преди 3 години
родител
ревизия
c78bf6ed2c

Файловите разлики са ограничени, защото са твърде много
+ 127 - 76
src/components/bioSafety/QueryConditions.vue


+ 2 - 2
src/utils/api.js

@@ -458,7 +458,7 @@ export function getYingFu(data) {
 /** 人员管理 - 人脸门禁 - Token */
 export function getFaceToken(data) {
   return axios({
-    url: 'http://47.98.40.154:10253/token/getToken',
+    url: 'http://192.168.1.171:10253/produce/token/getToken',
     method: 'get',
     params: data
   })
@@ -466,7 +466,7 @@ export function getFaceToken(data) {
 /** 人员管理 - 人脸门禁 - 查询 */
 export function getFaceGuard(data) {
   return axios({
-    url: 'http://47.98.40.154:10253/person/get_person_record',
+    url: 'http://192.168.1.171:10253/produce/person/get_person_record',
     method: 'post',
     data: data
   })

+ 24 - 6
src/utils/chenApi.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-11-18 13:40:39
- * @LastEditTime: 2021-11-27 11:47:06
+ * @LastEditTime: 2021-11-28 15:05:32
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: \hyyfClient\src\utils\chenApi.js
@@ -9,10 +9,10 @@
 import axios from './http';
 
 /** 生物安全 */
-/* 获取门禁所有 */
+/* 获取门禁所有 - 人脸门禁 +  */
 export function getFaceGuardTotal(data) {
   return axios({
-    url: 'http://47.98.40.154:10253/produce/person/get_person_record_totalpage',
+    url: 'http://192.168.1.171:10253/produce/person/get_person_record_totalpage',
     method: 'post',
     data: data
   })
@@ -21,7 +21,7 @@ export function getFaceGuardTotal(data) {
 /* 车辆管理 - 车辆通行 */
 export function getCarPassage(data) {
   return axios({
-    url: 'http://47.98.40.154:10253/produce/car/get_car_record',
+    url: 'http://192.168.1.171:10253/produce/car/get_car_record',
     method: 'get',
     params: data
   })
@@ -30,7 +30,7 @@ export function getCarPassage(data) {
 /* 车辆管理 - 车辆洗消 */
 export function getCarWash(params) {
   return axios({
-    url: 'http://47.98.40.154:10253/produce/accident/accident_record_xixiao',
+    url: 'http://192.168.1.171:10253/produce/accident/accident_record_xixiao',
     method: 'post',
     data: params
   })
@@ -39,7 +39,16 @@ export function getCarWash(params) {
 /* 车辆管理 - 车辆洗消 - 总数 */
 export function getCarWashTotal(params) {
   return axios({
-    url: 'http://47.98.40.154:10253/produce/accident/accident_record_xixiao_totalpage',
+    url: 'http://192.168.1.171:10253/produce/accident/accident_record_xixiao_totalpage',
+    method: 'post',
+    data: params
+  })
+}
+
+/* 车辆洗消 - 视频回放 */
+export function getCarWashVideo(params) {
+  return axios({
+    url: 'http://192.168.1.171:10253/produce/video/getVideoRecord',
     method: 'post',
     data: params
   })
@@ -89,3 +98,12 @@ export function getImportantData(params) {
     data: params
   })
 }
+
+/* ERP - 经营分析 - 成本分析 */
+export function getCostData(params) {
+  return axios({
+    url: '/produce/prodCostStatistics/listCost',
+    method: 'get',
+    params: params
+  })
+}

+ 160 - 107
src/views/BioSafety/CarAdmin.vue

@@ -1,24 +1,36 @@
 <!--
  * @Author: your name
  * @Date: 2021-09-13 17:52:31
- * @LastEditTime: 2021-11-19 15:02:04
+ * @LastEditTime: 2021-11-28 15:38:04
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \hyyfClient\src\views\BioSafety\CarAdmin.vue
 -->
 <template>
   <div class="car-admin">
-    <head-btns 
-      :btnNames="btnNames" 
+    <head-btns
+      :btnNames="btnNames"
       :btnSelected="btnSelected"
-      @btnSelected="getBtnSelected">
+      @btnSelected="getBtnSelected"
+    >
     </head-btns>
 
     <!-- 筛选条件 -->
-    <query-conditions :formItems="formItems" :propFormData="propFormData" @getQueryParams="handleQuery"></query-conditions>
+    <query-conditions
+      :formItems="formItems"
+      :propFormData="propFormData"
+      :defaultEmit="true"
+      @getQueryParams="handleQuery"
+    ></query-conditions>
 
     <!-- 表格 -->
-    <new-table :title="title" :listData="listData" :tableItems="tableItems" :shows="tableShows" :height="475">
+    <new-table
+      :title="title"
+      :listData="listData"
+      :tableItems="tableItems"
+      :shows="tableShows"
+      :height="475"
+    >
       <template v-slot:right>
         <template v-if="btnSelected === 1">
           <div>
@@ -37,49 +49,82 @@
         </template>
       </template>
       <template v-slot:carNum="slotProps">
-        {{ slotProps.row.carNum? slotProps.row.carNum: '未识别' }}
+        {{ slotProps.row.carNum ? slotProps.row.carNum : "未识别" }}
       </template>
       <template v-slot:originalPicPath="slotProps">
-        <img :src="slotProps.row.originalPicPath" @click="clickImg(slotProps.row.originalPicPath)"  alt="车辆通行" width="120"/>
+        <img
+          :src="slotProps.row.originalPicPath"
+          @click="clickImg(slotProps.row.originalPicPath)"
+          alt="车辆通行"
+          width="120"
+        />
       </template>
       <template v-slot:alarmPicture="slotProps">
-        <img :src="slotProps.row.alarmPicture" @click="clickImg(slotProps.row.alarmPicture)"  alt="车辆通行" width="120"/>
+        <img
+          :src="slotProps.row.alarmPicture"
+          @click="clickImg(slotProps.row.alarmPicture)"
+          alt="车辆通行"
+          width="120"
+        />
       </template>
       <template v-slot:handler="slotProps">
-        <el-button size="mini" @click="clickEvent(slotProps.row)">查看回放</el-button>
+        <el-button size="mini" @click="clickEvent(slotProps.row)"
+          >查看回放</el-button
+        >
       </template>
-
     </new-table>
     <table-footer
       :totals="total"
       :size="size"
       @sizeChange="sizeChange"
-      @pageChange="pageChange">
+      @pageChange="pageChange"
+    >
     </table-footer>
-    <el-dialog
-      title="车辆图片"
-      :visible.sync="dialogVisible"
-      width="50%">
-      <img :src="imgUrl"  alt="车辆通行" width="100%"/>
+    <el-dialog title="车辆图片" :visible.sync="dialogVisible" width="50%">
+      <img :src="imgUrl" alt="车辆通行" width="100%" />
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+        <el-button type="primary" @click="dialogVisible = false"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+    <el-dialog title="回放视频" :visible.sync="videoVisible" width="50%">
+      <div style="width: 100%; height: 600px">
+        <!-- <iframe
+          v-if="videoVisible"
+          :src="'static/dahua/index.html?' + rtsp"
+          frameborder="0"
+          style="width: 100%; height: 100%"
+        >
+        </iframe> -->
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="videoVisible = false">取 消</el-button>
+        <el-button type="primary" @click="videoVisible = false">
+          确 定
+        </el-button>
       </span>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import HeadBtns from 'components/bioSafety/Btns'
-import QueryConditions from 'components/bioSafety/QueryConditions'
-import NewTable from 'components/newTable/NewTable'
+import HeadBtns from "components/bioSafety/Btns";
+import QueryConditions from "components/bioSafety/QueryConditions";
+import NewTable from "components/newTable/NewTable";
 import TableFooter from "../../components/TableFooter";
 
-import { formItems, propFormData } from './carAdmin/queryCondition.config'
-import { titles, tableItems, tableShows } from './carAdmin/table.config'
+import { formItems, propFormData } from "./carAdmin/queryCondition.config";
+import { titles, tableItems, tableShows } from "./carAdmin/table.config";
 
-import { getCarPassage, getCarWash, getCarWashTotal } from '../../utils/chenApi'
-import { getFaceToken } from '../../utils/api'
+import {
+  getCarPassage,
+  getCarWash,
+  getCarWashTotal,
+  getCarWashVideo,
+} from "../../utils/chenApi";
+import { getFaceToken } from "../../utils/api";
 
 export default {
   name: "CarAdmin",
@@ -87,19 +132,20 @@ export default {
     HeadBtns,
     QueryConditions,
     NewTable,
-    TableFooter
+    TableFooter,
   },
   data() {
     return {
-      btnNames: [ // 按钮情况
-        { id: 1, name: '车辆通行' },
-        { id: 2, name: '车辆洗消' },
-        { id: 3, name: '车辆烘干' }
+      btnNames: [
+        // 按钮情况
+        { id: 1, name: "车辆通行" },
+        { id: 2, name: "车辆洗消" },
+        { id: 3, name: "车辆烘干" },
       ],
       btnSelected: 2, // 选中的按钮
       formItems: [], // 传给 QueryCondition 组件的 formItems
       propFormData: {}, // 传给 QueryCondition 组件的 propFormData
-      title: '', // 传给 BioTable 组件的 title
+      title: "", // 传给 BioTable 组件的 title
       listData: [], // 传给 BioTable 组件的表格展示的值 listData
       tableItems: [], // 传给 BioTable 组件的表格的列表 tableItems
       tableShows: {},
@@ -107,73 +153,76 @@ export default {
       total: 0,
       size: 20,
       pageNum: 1,
-      selectId: '',
+      selectId: "",
       params: {},
       dialogVisible: false,
-      imgUrl: '' // 点击图片后放大的图片路径
-    }
+      imgUrl: "", // 点击图片后放大的图片路径
+      videoVisible: false, // 车辆回放
+      rtsp: "", // 车辆回放的地址
+    };
   },
   mounted() {
-    this.formItems = formItems[this.btnSelected - 1]
-    this.propFormData = propFormData[this.btnSelected - 1]
-    this.title = titles[this.btnSelected - 1]
-    this.tableItems = tableItems[this.btnSelected - 1]
-    this.tableShows = tableShows
+    this.formItems = formItems[this.btnSelected - 1];
+    this.propFormData = propFormData[this.btnSelected - 1];
+    console.log(this.propFormData);
+    this.title = titles[this.btnSelected - 1];
+    this.tableItems = tableItems[this.btnSelected - 1];
+    this.tableShows = tableShows;
     if (this.btnSelected === 1) {
-      this.carPassage()
+      this.carPassage();
     } else if (this.btnSelected === 2) {
-        this.carWash()
-      }
+      this.carWash();
+    }
   },
   methods: {
     getBtnSelected(id) {
-      this.btnSelected = id
-      this.formItems = formItems[id - 1]
-      this.propFormData = propFormData[id - 1]
-      this.title = titles[id - 1]
-      this.tableItems = tableItems[id - 1]
+      this.btnSelected = id;
+      this.formItems = formItems[id - 1];
+      this.propFormData = propFormData[id - 1];
+      this.title = titles[id - 1];
+      this.tableItems = tableItems[id - 1];
       if (this.btnSelected === 1) {
-        this.carPassage()
+        this.carPassage();
       } else if (this.btnSelected === 2) {
-        this.carWash()
+        this.carWash();
       }
     },
     // 获取查询条件
     handleQuery(params) {
-      console.log(params)
-      this.params = params
+      console.log(params);
+      this.params = params;
       if (this.btnSelected === 1) {
-        this.carPassage()
+        this.carPassage();
       } else if (this.btnSelected === 2) {
-        this.carWash()
-        this.carWashTotal()
+        this.carWash();
+        this.carWashTotal();
       }
     },
     // 修改size
     sizeChange(val) {
       this.size = val;
       if (this.btnSelected === 1) {
-        this.carPassage()
+        this.carPassage();
       } else if (this.btnSelected === 2) {
-        this.carWash()
+        this.carWash();
       }
     },
     // 修改页数
     pageChange(val) {
-      this.pageNum= val;
+      this.pageNum = val;
       if (this.btnSelected === 1) {
-        this.carPassage()
+        this.carPassage();
       } else if (this.btnSelected === 2) {
-        this.carWash()
+        this.carWash();
       }
     },
     init() {
       let params = {
         pageNum: this.pageNum,
         pageSize: this.size,
-        searchStr: this.keyword
-      }
-      console.log(params)
+        searchStr: this.keyword,
+      };
+      console.log(params);
       // 获取后端数据
     },
     // 车辆通行 查询
@@ -181,71 +230,75 @@ export default {
       let queryParams = {
         pageNum: this.pageNum,
         pageSize: this.size,
-        carNum: this.params.name || undefined
-      }
-      getCarPassage(queryParams).then(res => {
-        console.log('res:', JSON.parse(res.result))
-        const result = JSON.parse(res.result)
-        this.listData = result.data.pageData
-        this.listData.forEach(item => {
-          item.originalPicPath = `https://36.26.62.70:447/evo-apigw/${item.originalPicPath}`
-          item.devChnName = item.devChnName.split('_')[0]
-        })
-        this.total = parseInt(result.data.totalRows)
-      })
+        carNum: this.params.name || undefined,
+      };
+      getCarPassage(queryParams).then((res) => {
+        console.log("res:", JSON.parse(res.result));
+        const result = JSON.parse(res.result);
+        this.listData = result.data.pageData;
+        this.listData.forEach((item) => {
+          item.originalPicPath = `https://36.26.62.70:447/evo-apigw/${item.originalPicPath}`;
+          item.devChnName = item.devChnName.split("_")[0];
+        });
+        this.total = parseInt(result.data.totalRows);
+      });
     },
     // 点击图片放大
     clickImg(url) {
-      this.dialogVisible = true
-      this.imgUrl = url
+      this.dialogVisible = true;
+      this.imgUrl = url;
     },
     // 车辆洗消
     carWash() {
       let queryParams = {
         pageNum: this.pageNum,
         pageSize: this.size,
-        alarmStartDateString: this.params.time[0] + ' 00:00:00',
-        alarmEndDateString: this.params.time[1] + ' 23:59:59',
+        alarmStartDateString: this.params.time[0] + " 00:00:00",
+        alarmEndDateString: this.params.time[1] + " 23:59:59",
         nodeCodeList: ["1002871$1$0$0", "1002872$1$0$0", "1002873$1$0$0"],
         deviceCategory: 1,
         alarmType: 303,
-        dbType: 0
-      }
-      getCarWash(queryParams).then(async res => {
-        console.log('res:', JSON.parse(res.result))
-        const result = JSON.parse(res.result)
-        this.listData = result.data.pageData
-        const { token } = await getFaceToken()
-        this.listData.forEach(item => {
-          item.alarmPicture = `https://36.26.62.70:447/evo-pic/${item.alarmPicture}?token=${token}&oss_addr=172.16.3.223:8925`
-        })
-      })
+        dbType: 0,
+      };
+      getCarWash(queryParams).then(async (res) => {
+        console.log("res:", JSON.parse(res.result));
+        const result = JSON.parse(res.result);
+        this.listData = result.data.pageData;
+        const { token } = await getFaceToken();
+        this.listData.forEach((item) => {
+          item.alarmPicture = `https://36.26.62.70:447/evo-pic/${item.alarmPicture}?token=${token}&oss_addr=172.16.3.223:8925`;
+        });
+      });
     },
     // 车辆洗消 - 按钮
     clickEvent(row) {
-      console.log(row)
+      getCarWashVideo({
+        happendTime: row.alarmDate,
+        channelId: row.nodeCode,
+      }).then((res) => {
+        if (res.code === 0) {
+          this.rtsp = res.URL;
+          this.videoVisible = true;
+        }
+      });
     },
     // 车辆洗消 - 总条数
     carWashTotal() {
       let queryParams = {
-        "orgCodeList": [], 
-        "nodeCodeList": [
-          "1002871$1$0$0",
-          "1002872$1$0$0",
-          "1002873$1$0$0"
-        ], 
-        "deviceCategory": 1, 
-        "alarmStartDateString": this.params.time[0] + ' 00:00:00', 
-        "alarmEndDateString": this.params.time[1] + ' 23:59:59', 
-        "alarmType": 303, 
-        "dbType": 0 
-      }
-      getCarWashTotal(queryParams).then(res => {
-        this.total = JSON.parse(res.result).data.value
-      })
-    }
+        orgCodeList: [],
+        nodeCodeList: ["1002871$1$0$0", "1002872$1$0$0", "1002873$1$0$0"],
+        deviceCategory: 1,
+        alarmStartDateString: this.params.time[0] + " 00:00:00",
+        alarmEndDateString: this.params.time[1] + " 23:59:59",
+        alarmType: 303,
+        dbType: 0,
+      };
+      getCarWashTotal(queryParams).then((res) => {
+        this.total = JSON.parse(res.result).data.value;
+      });
+    },
   },
-}
+};
 </script>
 
 <style scoped>

+ 87 - 80
src/views/BioSafety/DeadPig.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-09-16 11:27:35
- * @LastEditTime: 2021-11-19 15:55:26
+ * @LastEditTime: 2021-11-28 17:20:31
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \hyyfClient\src\views\BioSafety\DeadPig.vue
@@ -9,61 +9,72 @@
 <template>
   <div class="dead-pig">
     <!-- 筛选条件 -->
-    <query-conditions :formItems="formItems" :propFormData="propFormData" @getQueryParams="handleQuery"></query-conditions>
+    <query-conditions
+      :defaultEmit="true"
+      :formItems="formItems"
+      :propFormData="propFormData"
+      @getQueryParams="handleQuery"
+    ></query-conditions>
 
     <!-- 表格 -->
-    <new-table 
-      :title="title" 
-      :listData="listData" 
-      :tableItems="tableItems" 
-      :shows="tableShows" 
-      :height="535">
+    <new-table
+      :title="title"
+      :listData="listData"
+      :tableItems="tableItems"
+      :shows="tableShows"
+      :height="535"
+    >
       <template v-slot:alarmPicture="slotProps">
-        <img :src="slotProps.row.alarmPicture" @click="clickImg(slotProps.row.alarmPicture)"  alt="车辆通行" width="380"/>
+        <img
+          :src="slotProps.row.alarmPicture"
+          @click="clickImg(slotProps.row.alarmPicture)"
+          alt="车辆通行"
+          width="380"
+        />
       </template>
     </new-table>
     <table-footer
       :totals="total"
       :size="size"
       @sizeChange="sizeChange"
-      @pageChange="pageChange">
+      @pageChange="pageChange"
+    >
     </table-footer>
-    <el-dialog
-      title="图片"
-      :visible.sync="dialogVisible"
-      width="50%">
-      <img :src="imgUrl"  alt="死猪图片" width="100%"/>
+    <el-dialog title="图片" :visible.sync="dialogVisible" width="50%">
+      <img :src="imgUrl" alt="死猪图片" width="100%" />
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+        <el-button type="primary" @click="dialogVisible = false"
+          >确 定</el-button
+        >
       </span>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import QueryConditions from 'components/bioSafety/QueryConditions'
-import NewTable from 'components/newTable/NewTable'
-import TableFooter from "../../components/TableFooter"
+import QueryConditions from "components/bioSafety/QueryConditions";
+import NewTable from "components/newTable/NewTable";
+import TableFooter from "../../components/TableFooter";
 
-import { formItems, propFormData } from './deadPig/queryCondition.config'
-import { title, tableItems, tableShows } from './deadPig/table.config'
+import { formItems, propFormData } from "./deadPig/queryCondition.config";
+import { title, tableItems, tableShows } from "./deadPig/table.config";
 
-import { getCarWash, getCarWashTotal } from '../../utils/chenApi'
-import { getFaceToken } from '../../utils/api'
+import { getCarWash, getCarWashTotal } from "../../utils/chenApi";
+import { getFaceToken } from "../../utils/api";
 
 export default {
   name: "DeadPig",
   components: {
     QueryConditions,
     NewTable,
-    TableFooter
+    TableFooter,
   },
   data() {
     return {
       formItems: [], // 传给 QueryCondition 组件的 formItems
       propFormData: {}, // 传给 QueryCondition 组件的 propFormData
-      title: '', // 传给 BioTable 组件的 title
+      title: "", // 传给 BioTable 组件的 title
       listData: [], // 传给 BioTable 组件的表格展示的值 listData
       tableItems: [], // 传给 BioTable 组件的表格的列表 tableItems
       tableShows: {},
@@ -71,48 +82,48 @@ export default {
       total: 0,
       size: 20,
       pageNum: 1,
-      selectId: '',
+      selectId: "",
       params: {},
       dialogVisible: false,
-      imgUrl: ''
-    }
+      imgUrl: "",
+    };
   },
   mounted() {
-    this.formItems = formItems
-    this.propFormData = propFormData
-    this.title = title
-    this.tableItems = tableItems
-    this.tableShows = tableShows
-    this.pigManage()
-    this.pigTotal()
+    this.formItems = formItems;
+    this.propFormData = propFormData;
+    this.title = title;
+    this.tableItems = tableItems;
+    this.tableShows = tableShows;
+    this.pigManage();
+    this.pigTotal();
   },
   methods: {
     // 获取查询条件
     handleQuery(params) {
-      console.log(params)
-      this.params = params
-      this.pigManage()
-      this.pigTotal()
+      console.log(params);
+      this.params = params;
+      this.pigManage();
+      this.pigTotal();
     },
     // 修改size
     sizeChange(val) {
       this.size = val;
       // this.init();
-      this.pigManage()
+      this.pigManage();
     },
     // 修改页数
     pageChange(val) {
-      this.pageNum= val;
+      this.pageNum = val;
       // this.init();
-      this.pigManage()
+      this.pigManage();
     },
     init() {
       let params = {
         pageNum: this.pageNum,
         pageSize: this.size,
-        searchStr: this.keyword
-      }
-      console.log(params)
+        searchStr: this.keyword,
+      };
+      console.log(params);
       // 获取后端数据
     },
     // 死猪管理
@@ -120,13 +131,13 @@ export default {
       let queryParams = {
         pageNum: this.pageNum,
         pageSize: this.size,
-        alarmStartDateString: this.params.time[0] + ' 00:00:00',
-        alarmEndDateString: this.params.time[1] + ' 23:59:59',
+        alarmStartDateString: this.params.time[0] + " 00:00:00",
+        alarmEndDateString: this.params.time[1] + " 23:59:59",
         nodeCodeList: [
-          "1002874$1$0$0", 
-          "1002875$1$0$0", 
-          "1002876$1$0$0", 
-          "1002877$1$0$0", 
+          "1002874$1$0$0",
+          "1002875$1$0$0",
+          "1002876$1$0$0",
+          "1002877$1$0$0",
           "1002878$1$0$0",
           "1002879$1$0$0",
           "1002880$1$0$0",
@@ -190,44 +201,40 @@ export default {
         ],
         deviceCategory: 1,
         alarmType: 303,
-        dbType: 0
-      }
-      getCarWash(queryParams).then(async res => {
-        console.log('res:', JSON.parse(res.result))
-        const result = JSON.parse(res.result)
-        this.listData = result.data.pageData
-        const { token } = await getFaceToken()
-        this.listData.forEach(item => {
-          item.alarmPicture = `https://36.26.62.70:447/evo-pic/${item.alarmPicture}?token=${token}&oss_addr=172.16.3.223:8925`
-        })
-      })
+        dbType: 0,
+      };
+      getCarWash(queryParams).then(async (res) => {
+        console.log("res:", JSON.parse(res.result));
+        const result = JSON.parse(res.result);
+        this.listData = result.data.pageData;
+        const { token } = await getFaceToken();
+        this.listData.forEach((item) => {
+          item.alarmPicture = `https://36.26.62.70:447/evo-pic/${item.alarmPicture}?token=${token}&oss_addr=172.16.3.223:8925`;
+        });
+      });
     },
     // 死猪管理 - 总数
     pigTotal() {
       let queryParams = {
-        "orgCodeList": [], 
-        "nodeCodeList": [
-          "1002871$1$0$0",
-          "1002872$1$0$0",
-          "1002873$1$0$0"
-        ], 
-        "deviceCategory": 1, 
-        "alarmStartDateString": this.params.time[0] + ' 00:00:00', 
-        "alarmEndDateString": this.params.time[1] + ' 23:59:59', 
-        "alarmType": 303, 
-        "dbType": 0 
-      }
-      getCarWashTotal(queryParams).then(res => {
-        this.total = JSON.parse(res.result).data.value
-      })
+        orgCodeList: [],
+        nodeCodeList: ["1002871$1$0$0", "1002872$1$0$0", "1002873$1$0$0"],
+        deviceCategory: 1,
+        alarmStartDateString: this.params.time[0] + " 00:00:00",
+        alarmEndDateString: this.params.time[1] + " 23:59:59",
+        alarmType: 303,
+        dbType: 0,
+      };
+      getCarWashTotal(queryParams).then((res) => {
+        this.total = JSON.parse(res.result).data.value;
+      });
     },
     // 点击图片放大
     clickImg(url) {
-      this.dialogVisible = true
-      this.imgUrl = url
+      this.dialogVisible = true;
+      this.imgUrl = url;
     },
   },
-}
+};
 </script>
 
 <style scoped>

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

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-09-16 11:27:35
- * @LastEditTime: 2021-11-27 11:29:43
+ * @LastEditTime: 2021-11-28 15:31:59
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \hyyfClient\src\views\BioSafety\PersonAdmin.vue
@@ -20,6 +20,7 @@
     <query-conditions
       :formItems="formItems"
       :propFormData="propFormData"
+      :defaultEmit="true"
       @getQueryParams="handleQuery"
     ></query-conditions>
 

+ 4 - 2
src/views/BioSafety/carAdmin/queryCondition.config.js

@@ -6,6 +6,8 @@
  * @Description: 筛选条件的 formItems 和 propFormData
  * @FilePath: \hyyfClient\src\views\BioSafety\personAdmin\queryCondition.config.js
  */
+import { timeDate } from '../../../utils/index'
+
 const formItems1 = [
   {
     type: 'input',
@@ -37,7 +39,7 @@ const formItems2 = [
 
 const propFormData2 = {
   region: '',
-  time: []
+  time: [timeDate(new Date().getTime() - 1000*60*60*24), timeDate(new Date().getTime())]
 }
 
 const formItems3 = [
@@ -58,7 +60,7 @@ const formItems3 = [
 
 const propFormData3 = {
   place: '',
-  time: []
+  time: [timeDate(new Date().getTime() - 1000*60*60*24), timeDate(new Date().getTime())]
 }
 
 export const formItems = [formItems1, formItems2, formItems3]

+ 3 - 1
src/views/BioSafety/deadPig/queryCondition.config.js

@@ -6,6 +6,8 @@
  * @Description: 筛选条件的 formItems 和 propFormData
  * @FilePath: \hyyfClient\src\views\BioSafety\personAdmin\queryCondition.config.js
  */
+import { timeDate } from '../../../utils/index'
+
 export const formItems = [
   {
     type: 'select',
@@ -24,5 +26,5 @@ export const formItems = [
 
 export const propFormData = {
   place: '',
-  time: []
+  time: [timeDate(new Date().getTime() - 1000*60*60*24), timeDate(new Date().getTime())]
 }

+ 5 - 3
src/views/BioSafety/personAdmin/queryCondition.config.js

@@ -1,11 +1,13 @@
 /*
  * @Author: your name
  * @Date: 2021-09-18 15:19:29
- * @LastEditTime: 2021-09-27 16:38:49
+ * @LastEditTime: 2021-11-28 17:20:05
  * @LastEditors: Please set LastEditors
  * @Description: 筛选条件的 formItems 和 propFormData
  * @FilePath: \hyyfClient\src\views\BioSafety\personAdmin\queryCondition.config.js
  */
+import { timeDate } from '../../../utils/index'
+
 const formItems1 = [
   {
     type: 'input',
@@ -46,13 +48,13 @@ const formItems2 = [
     type: 'datepicker',
     label: '时间:',
     placeholder: ['开始时间', '结束时间'],
-    field: 'time'
+    field: 'time',
   }
 ]
 
 const propFormData2 = {
   name: '',
-  time: []
+  time: [timeDate(new Date().getTime() - 1000*60*60*24), timeDate(new Date().getTime())]
 }
 
 const formItems3 = [

+ 32 - 22
src/views/PdcData/Analysis.vue

@@ -51,7 +51,7 @@
       <!-- 成本分析 -->
       <div class="cost">
         <div class="select">
-          <el-select size="small" v-model="costValue">
+          <!-- <el-select size="small" v-model="costValue">
             <el-option
               v-for="item in costOptions"
               :key="item.value"
@@ -59,14 +59,20 @@
               :value="item.value"
             >
             </el-option>
-          </el-select>
+          </el-select> -->
         </div>
         <div class="cost-content">
           <div class="cost-left">
-            <cost-pie :data="costPieData"></cost-pie>
+            <cost-pie :data="costPieData" :title="costTitles[costIndex]">
+            </cost-pie>
           </div>
           <div class="cost-right">
-            <cost-histogram :data="costHisData"></cost-histogram>
+            <cost-histogram
+              :data="costHisData"
+              :xAxisData="costTitles"
+              @changeCostIndex="changeCostIndex"
+            >
+            </cost-histogram>
           </div>
         </div>
         <h3 class="label">成本分析</h3>
@@ -249,7 +255,7 @@ import {
   getInventoryAndProduct,
   getSalesChange,
   getSalesChart,
-  getCosts,
+  // getCosts,
   // getYingShou,
   getYingFu,
 } from "utils/api";
@@ -259,6 +265,7 @@ import {
   getSafeInventory,
   getProductionCondition,
   getImportantData,
+  getCostData,
 } from "utils/chenApi";
 
 export default {
@@ -336,8 +343,8 @@ export default {
       productionPercents: [], // 百分比
       productionItems: [], // 下面块图的数据
       // 经营分析
-      costOptions: [],
-      costValue: "",
+      costTitles: ["总成本", "基础猪群", "保育猪群", "育肥猪群", "后备猪群"], // 成本分析 - 被选中的名字
+      costIndex: 0, // 成本分析 - 名字数组的 index
       costPieData: [], // 经营分析 - 成本分析环形图
       costHisData: [], // 经营分析 - 柱状图
       // 重要指标
@@ -432,13 +439,13 @@ export default {
     this.initInventoryAndProduct();
     this.initSalesChange();
     this.initSalesChart();
-    this.initCosts();
     // this.initYingShou();
     this.initYingFu();
     this.initWorkBoard(); // 工作看板
     this.initSafeInventory(); // 安全库存报警
     this.initProductionCondition(); // 生产情况
     this.initImportantData(); // 重要指标
+    this.initCostData(); // 成本分析
   },
   methods: {
     handleWorkInfoClick(item) {
@@ -575,20 +582,18 @@ export default {
       });
     },
     // 经营分析 - 成本分析
-    initCosts() {
-      getCosts({}).then((res) => {
+    initCostData() {
+      getCostData({}).then((res) => {
+        console.log(res);
         if (res.code === 10000) {
-          this.costPieData = [];
-          res.data.forEach((item) => {
-            this.costPieData.push({
-              name: item.costName,
-              value: item.costRate,
-            });
-          });
-          this.costHisData = [];
-          res.data.forEach((item) => {
-            this.costHisData.push(item.costVal);
-          });
+          this.costHisData = [
+            res.data["total"],
+            res.data["baseGroup"],
+            res.data["pigletGroup"],
+            res.data["fattenPig"],
+            res.data["replaceGilt"],
+          ];
+          this.costPieData = this.costHisData[this.costIndex];
         }
       });
     },
@@ -629,7 +634,7 @@ export default {
             { ...res.data["piglet_rate"], color: "rgb(51, 211, 137)" },
             { ...res.data["fatpig_rate"], color: "rgb(255, 125, 0)" },
             { ...res.data["break_rate"], color: "rgb(2, 167, 240)" },
-            // FIXME: 配种分娩率没有,也不能随便放 color: "rgb(112, 0, 217)"
+            { ...res.data["breed_rate"], color: "rgb(112, 0, 217)" },
           ];
           this.productionItems = [
             res.data["avg_farrow_1"].stockQuantity,
@@ -677,6 +682,11 @@ export default {
     changeImportantDates() {
       this.initImportantData();
     },
+    // 成本分析 - 数据改变
+    changeCostIndex(value) {
+      this.costIndex = value;
+      this.costPieData = this.costHisData[value];
+    },
   },
   watch: {
     getSalesDates(newValue) {

+ 1 - 1
src/views/PdcData/analysis/ChartInventoryPie.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-09-30 15:46:57
- * @LastEditTime: 2021-11-25 09:56:31
+ * @LastEditTime: 2021-11-28 16:50:48
  * @LastEditors: Please set LastEditors
  * @Description: 存栏结构图
  * @FilePath: \hyyfClient\src\views\PdcData\analysis\ChartInventoryPie.vue

+ 129 - 94
src/views/PdcData/analysis/CostHistogram.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-10-12 09:10:42
- * @LastEditTime: 2021-10-22 15:49:54
+ * @LastEditTime: 2021-11-28 17:16:27
  * @LastEditors: Please set LastEditors
  * @Description: 成本分析的柱状图
  * @FilePath: \hyyfClient\src\views\PdcData\analysis\CostHistogram.vue
@@ -16,16 +16,53 @@ export default {
   props: {
     data: {
       type: Array,
-      default: () => []
-    }
+      default: () => [],
+    },
+    xAxisData: {
+      type: Array,
+      default: () => [],
+    },
   },
   data() {
     return {
-      myChart: null
-    }
+      myChart: null,
+    };
   },
   methods: {
     init() {
+      const commonSeriesItem = {
+        name: "Forest",
+        type: "bar",
+        barGap: 0,
+        emphasis: {
+          focus: "series",
+        },
+      };
+      let seriesData = [
+        {
+          ...commonSeriesItem,
+          name: "公摊成本",
+          color: "rgb(112,182,3)",
+          data: [],
+        },
+        {
+          ...commonSeriesItem,
+          name: "兽药成本",
+          color: "rgb(232,56,92)",
+          data: [],
+        },
+        {
+          ...commonSeriesItem,
+          name: "饲料成本",
+          color: "rgb(123,0,255)",
+          data: [],
+        },
+      ];
+      this.data.forEach((item) => {
+        seriesData[0].data.push(item.gtValue);
+        seriesData[1].data.push(item.syValue);
+        seriesData[2].data.push(item.slValue);
+      });
       let options = {
         // title: {
         //   text: '存栏变动',
@@ -33,77 +70,92 @@ export default {
         //   y: 0
         // },
         tooltip: {
-          trigger: 'axis',
+          trigger: "axis",
+          // formatter: (value) => {
+          //   return value + "元";
+          // },
         },
         // legend: {
         //   data: ['头']
         // },
-        color: ['#3aa0ff', '#4dcb73', '#fad337', '#f2637b', '#975fe4'],
+        // color: ['#3aa0ff', '#4dcb73', '#fad337', '#f2637b', '#975fe4'],
         grid: {
-          left: '3%',
-          right: '4%',
-          bottom: '3%',
-          containLabel: true
+          left: "3%",
+          right: "4%",
+          bottom: "3%",
+          containLabel: true,
         },
         xAxis: [
-          {
-            type: 'value',
-            name: '元',
-            boundaryGap: [0, 0.01],
-            axisPointer: {
-              type: 'shadow'
-            },
-            axisLine: {
-              show: true,
-              lineStyle: {
-                color: '#6e7079',
-              }
-            },
-            axisTick:{
-              show: false
-            },
-          }
-        ],
-        yAxis: //[
-          {
-            type: 'category',
-            inverse: true
-            // axisLabel: {
-            //   // formatter: '{value} °C'
-            //   show: true
-            // },
-            // axisLine: {
-            //   show: true,
-            //   lineStyle: {
-            //     color: '#6e7079',
-            //   }
-            // },
-            // axisTick:{
-            //   show:false
-            // },
-            // splitLine:{
-            //   show:false
-            // }
-          },
           // {
-          //   type: 'value',
-          //   name: '湿度',
-          //   axisLabel: {
-          //     formatter: '{value} RH'
+          //   type: "value",
+          //   name: "元",
+          //   boundaryGap: [0, 0.01],
+          //   axisPointer: {
+          //     type: "shadow",
           //   },
           //   axisLine: {
-          //     show: false,
+          //     show: true,
           //     lineStyle: {
-          //       color: '#6e7079',
-          //     }
+          //       color: "#6e7079",
+          //     },
           //   },
-          //   axisTick:{
-          //     show:false
+          //   axisTick: {
+          //     show: false,
           //   },
-          //   // splitLine:{
-          //   //   show:false
-          //   // }
+          // },
+          {
+            type: "category",
+            axisTick: {
+              show: false,
+            },
+            axisPointer: {
+              type: "none",
+            },
+            data: this.xAxisData,
+          },
+        ],
+        //[
+        yAxis: {
+          // type: "category",
+          // inverse: true,
+          // axisLabel: {
+          //   // formatter: '{value} °C'
+          //   show: true
+          // },
+          // axisLine: {
+          //   show: true,
+          //   lineStyle: {
+          //     color: '#6e7079',
+          //   }
+          // },
+          // axisTick:{
+          //   show:false
+          // },
+          // splitLine:{
+          //   show:false
           // }
+          type: "value",
+          name: "元",
+        },
+        // {
+        //   type: 'value',
+        //   name: '湿度',
+        //   axisLabel: {
+        //     formatter: '{value} RH'
+        //   },
+        //   axisLine: {
+        //     show: false,
+        //     lineStyle: {
+        //       color: '#6e7079',
+        //     }
+        //   },
+        //   axisTick:{
+        //     show:false
+        //   },
+        //   // splitLine:{
+        //   //   show:false
+        //   // }
+        // }
         //],
         // dataset: [
         //   {
@@ -112,8 +164,8 @@ export default {
         //       [32541],
         //       [82467],
         //       [54363],
-        //       [64642], 
-        //       [40257], 
+        //       [64642],
+        //       [40257],
         //       [95422]
         //     ]
         //   },
@@ -127,43 +179,26 @@ export default {
         //     }
         //   }
         // ],
-        series: [
-          {
-            // name: '头',
-            type: 'bar',
-            data: this.data,
-            itemStyle: {
-              normal: {
-                color: function (colors) { // 颜色设置
-                  var colorList = ['rgb(112,182,3)', 'rgb(232,56,92)', 'rgb(123,0,255)', 'rgb(0,215,233)', 'rgb(255,255,160)', 'rgb(0,0,255)']
-                  return colorList[colors.dataIndex]
-                },
-                label: {
-                  show: true,
-                  position: 'right'
-                }
-              },
-              textStyle: {
-                show: true
-              },
-            }
-          }
-        ]
-      }
+        series: seriesData,
+      };
+      const _this = this;
       this.myChart.setOption(options);
-    }
+      this.myChart.on("click", function(param) {
+        _this.$emit("changeCostIndex", param.dataIndex);
+      });
+    },
   },
   mounted() {
-    this.myChart = this.$echarts.init(document.getElementById('costHistogram'));
+    this.myChart = this.$echarts.init(document.getElementById("costHistogram"));
     // this.init();
   },
   watch: {
     data(value) {
-      console.log('成本分析柱状图数据', value)
-      this.init()
-    }
-  }
-}
+      console.log("成本分析柱状图数据", value);
+      this.init();
+    },
+  },
+};
 </script>
 <style scoped>
 .cost-histogram {

+ 61 - 38
src/views/PdcData/analysis/CostPie.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-10-12 08:39:43
- * @LastEditTime: 2021-10-26 17:54:52
+ * @LastEditTime: 2021-11-28 17:10:20
  * @LastEditors: Please set LastEditors
  * @Description: 成本分析扇形图
  * @FilePath: \hyyfClient\src\views\PdcData\analysis\CostPie.vue
@@ -15,90 +15,113 @@
 export default {
   props: {
     data: {
-      type: Array,
-      default: () => []
-    }
+      type: Object,
+      default: () => {},
+    },
   },
   data() {
     return {
-      myChart: null
-    }
+      myChart: null,
+    };
   },
   methods: {
     init() {
+      let gtValue = parseFloat(this.data.gtValue);
+      let syValue = parseFloat(this.data.syValue);
+      let slValue = parseFloat(this.data.slValue);
+      let total = gtValue + syValue + slValue;
+      console.log("total", total);
       let options = {
         grid: {
-          x: 100
+          x: 100,
         },
         legend: {
-          top: '25%',
-          left: '75%',
-          orient: 'vertical',
+          top: "25%",
+          left: "85%",
+          orient: "vertical",
           icon: "circle",
           selectedMode: false, // 取消右侧项选中
           itemGap: 20, // 各项间隔
           textStyle: {
             fontSize: 15,
-            color: '#666'
+            color: "#666",
           },
         },
         series: [
           {
             // name: 'Access From',
-            type: 'pie',
-            radius: '70%', // 半径
-            center: ['35%', '55%'],
+            type: "pie",
+            radius: "70%", // 半径
+            center: ["45%", "55%"],
             avoidLabelOverlap: false,
             labelLine: {
-              show: true
+              show: true,
             },
             itemStyle: {
               normal: {
-                color: function (colors) { // 颜色设置
-                  var colorList = ['rgb(112,182,3)', 'rgb(232,56,92)', 'rgb(123,0,255)', 'rgb(0,215,233)', 'rgb(255,255,160)', 'rgb(0,0,255)']
-                  return colorList[colors.dataIndex]
+                color: function(colors) {
+                  // 颜色设置
+                  var colorList = [
+                    "rgb(112,182,3)",
+                    "rgb(232,56,92)",
+                    "rgb(123,0,255)",
+                    // "rgb(0,215,233)",
+                    // "rgb(255,255,160)",
+                    // "rgb(0,0,255)",
+                  ];
+                  return colorList[colors.dataIndex];
                 },
                 label: {
-                  formatter: '{b}: {c}%'
-                }
+                  // formatter: (params) => {
+                  //   let percent = ((params.value / total) * 100).toFixed(2);
+                  //   return `${params.name}: ${params.value.toFixed(
+                  //     2
+                  //   )} ${percent}%`;
+                  // },
+                  formatter: "{b}: {c} {d}%",
+                },
               },
               label: {
-                show: false
+                show: false,
               },
               emphasis: {
                 label: {
                   show: true,
-                  formatter: '{b}: {c}%',
+                  formatter: "{b}: {c}%",
                   textStyle: {
-                    fontSize: '15',
-                  }
+                    fontSize: "15",
+                  },
                 },
                 itemStyle: {
                   shadowBlur: 10,
-                  shadowOffsetX: 0,
-                  shadowColor: 'rgba(0, 0, 0, 0.5)'
-                }
+                  shadowOffsetX: 5,
+                  shadowColor: "rgba(0, 0, 0, 0.5)",
+                },
               },
             },
-            data: this.data
-          }
-        ]
+            data: [
+              { value: gtValue, name: "公摊成本" },
+              { value: syValue, name: "兽药成本" },
+              { value: slValue, name: "饲料成本" },
+            ],
+          },
+        ],
       };
 
-      this.myChart.setOption(options)
-    }
+      this.myChart.setOption(options, true);
+    },
   },
   mounted() {
-    this.myChart = this.$echarts.init(document.getElementById('costPie'));
+    this.myChart = this.$echarts.init(document.getElementById("costPie"));
     // this.init()
   },
   watch: {
     data(value) {
-      console.log('成本分析环形图数据', value)
-      this.init()
-    }
-  }
-}
+      console.log("成本分析环形图数据", value);
+      this.init();
+    },
+  },
+};
 </script>
 <style scoped>
 .cost-pie {

+ 5 - 5
src/views/PdcData/analysis/ProductionItems.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-10-11 15:40:26
- * @LastEditTime: 2021-10-21 17:52:04
+ * @LastEditTime: 2021-11-28 17:50:33
  * @LastEditors: Please set LastEditors
  * @Description: 生产情况下面的8个
  * @FilePath: \hyyfClient\src\views\PdcData\analysis\ProductionItems.vue
@@ -123,10 +123,10 @@ export default {
   props: {
     data: {
       type: Array,
-      required: true
-    }
-  }
-}
+      required: true,
+    },
+  },
+};
 </script>
 <style scoped>
 .inventory-items {

+ 1 - 1
vue.config.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-16 11:27:35
- * @LastEditTime: 2021-10-21 14:39:52
+ * @LastEditTime: 2021-11-28 14:36:26
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: \hyyfClient\vue.config.js