Browse Source

停机原因统计完善
添加送经量统计模块
添加平方米克重统计

liling 3 tháng trước cách đây
mục cha
commit
3786e46e06

+ 7 - 0
src/api/calc/calcStop.js

@@ -8,6 +8,13 @@ export function listCalcStop(query) {
         params: query
     })
 }
+export function statCalcStop(query) {
+    return request({
+        url: '/calc/calcStop/calc',
+        method: 'get',
+        params: query
+    })
+}
 
 // 查询停机数据统计详细
 export function getCalcStop(id) {

+ 12 - 0
src/api/calc/sjl.js

@@ -0,0 +1,12 @@
+import request from '@/utils/request'
+
+//获取送经量数据
+export function Get09Data(data){
+    return request({
+        url: `/api/warp-run-in`,
+        method: "get",
+        params: data
+    })
+}
+
+

+ 112 - 0
src/views/calc/SJL/index.vue

@@ -0,0 +1,112 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item>
+        <el-button type="primary" icon="Search" @click="handleQuery">刷新</el-button>
+        <el-button
+          type="warning"
+          plain
+          icon="Download"
+          @click="handleExport"
+          v-hasPermi="['calc:sjl:export']"
+        >导出</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table v-loading="loading" height="750px" :data="dataList">
+      <el-table-column label="设备ID" align="center" prop="device" />
+      <el-table-column label="L1梳栉送经量" align="center" prop="l1" />
+      <el-table-column label="L2梳栉送经量" align="center" prop="l2" />
+      <el-table-column label="L3梳栉送经量" align="center" prop="l3" />
+      <el-table-column label="L4梳栉送经量" align="center" prop="l4" />
+      <el-table-column label="L5梳栉送经量" align="center" prop="l5" />  
+      <el-table-column label="牵拉密度" align="center" prop="density" /> 
+      <el-table-column label="卷曲张力系数" align="center" prop="coefficient" />    
+    </el-table>
+  </div>
+</template>
+
+<script setup name="SJL">
+import { Get09Data } from "@/api/calc/sjl";
+
+const { proxy } = getCurrentInstance();
+
+const dataList = ref([]);
+const open = ref(false);
+const loading = ref(true);
+const showSearch = ref(true);
+const ids = ref([]);
+const single = ref(true);
+const multiple = ref(true);
+const total = ref(0);
+const title = ref("");
+
+const data = reactive({
+  form: {},
+  queryParams: {
+    deviceId: null,
+    orderByColumn: 'id',
+    isAsc: 'descending'
+  },
+  rules: {
+  }
+});
+
+const { queryParams, form, rules } = toRefs(data);
+
+/** 查询日统计数据列表 */
+function getList() {
+  loading.value = true;
+  dataList.value = [];
+  Get09Data(queryParams.value).then(response => {
+    loading.value = false;
+    if(response.code!=0){
+      return;
+    }
+    dataList.value = response.data;
+    total.value = response.total;
+    
+  });
+}
+
+// 取消按钮
+function cancel() {
+  open.value = false;
+  reset();
+}
+
+// 表单重置
+function reset() {
+  form.value = {
+    id: null,
+    deviceId: null,
+  };
+  proxy.resetForm("calcDayRef");
+}
+
+/** 搜索按钮操作 */
+function handleQuery() {
+  getList();
+}
+
+/** 重置按钮操作 */
+function resetQuery() {
+  proxy.resetForm("queryRef");
+  handleQuery();
+}
+
+// 多选框选中数据
+function handleSelectionChange(selection) {
+  ids.value = selection.map(item => item.id);
+  single.value = selection.length != 1;
+  multiple.value = !selection.length;
+}
+
+/** 导出按钮操作 */
+function handleExport() {
+  proxy.download('api/export/warp-run-in', {
+    ...queryParams.value
+  }, `送经量统计_${new Date().getTime()}.xlsx`)
+}
+
+getList();
+</script>

+ 55 - 18
src/views/calc/calcStop/index.vue

@@ -19,12 +19,14 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="日期" prop="dataDate">
+      <el-form-item label="日期" prop="daterangeTime">
         <el-date-picker clearable
-          v-model="queryParams.dataDate"
-          type="date"
-          value-format="YYYY-MM-DD"
-          placeholder="请选择日期">
+          v-model="queryParams.daterangeTime"
+          type="datetimerange"
+          value-format="YYYY-MM-DD HH:mm"
+          time-format="HH:mm"
+          start-placeholder="开始时间"
+          end-placeholder="结束时间">
         </el-date-picker>
       </el-form-item>
       <el-form-item>
@@ -49,13 +51,21 @@
             <el-table v-loading="loading" :data="calcStopStat">
               <el-table-column label="停机原因" align="center" prop="stopType">
                 <template #default="scope">
-                  <span>{{  getStopTypeName(scope.row.stopType) }}</span>
+                  <span>{{  getStopTypeName(scope.row.type) }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="停机次数" align="center" prop="num"></el-table-column>
+              <el-table-column label="停机时长" align="center" prop="time" width="150px"></el-table-column>
+              <el-table-column label="次数占比" align="center" prop="percentNum">
+                <template #default="scope">
+                  <span>{{  (scope.row.percentNum*100).toFixed(1)+' %' }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="时长占比" align="center" prop="percentTimes">
+                <template #default="scope">
+                  <span>{{  (scope.row.percentTimes*100).toFixed(1)+' %' }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="停机次数" align="center" prop="stopNum"></el-table-column>
-              <el-table-column label="停机时长" align="center" prop="stopTimeLong"></el-table-column>
-              <el-table-column label="次数占比" align="center" prop="stopNumRatio"></el-table-column>
-              <el-table-column label="时长占比" align="center" prop="stopTimeLongRatio"></el-table-column>
             </el-table>
         </div>
         <div style="width: 60%;margin-left: 5%;">
@@ -171,7 +181,7 @@
 </template>
 
 <script setup name="CalcStop">
-import { listCalcStop, getCalcStop, delCalcStop, addCalcStop, updateCalcStop } from "@/api/calc/calcStop";
+import { listCalcStop, statCalcStop, getCalcStop, delCalcStop, addCalcStop, updateCalcStop } from "@/api/calc/calcStop";
 const { proxy } = getCurrentInstance();
 
 const calcStopList = ref([]);
@@ -184,17 +194,18 @@ const multiple = ref(true);
 const total = ref(0);
 const title = ref("");
 const calcStopStat = ref([]);
-
+let day = new Date();
+day=day.setDate(day.getDate()-1);
 const data = reactive({
   form: {},
   queryParams: {
     pageNum: 1,
     pageSize: 15,
     deviceId: null,
-    dataDate: null,
+    daterangeTime:[ new Date(day).Format('yyyy-MM-dd')+' 00:00',new Date(day).Format('yyyy-MM-dd')+' 23:00'],
     hour: null,
-    startTime: null,
-    endTime: null,
+    sTime: null,
+    eTime: null,
     calcStatus: null,
     stopType: '',    
   },
@@ -211,17 +222,42 @@ function getStopTypeName(v){
   return '';
 }
 const { queryParams, form, rules } = toRefs(data);
-
 /** 查询停机数据统计列表 */
 function getList() {
   loading.value = true;
+  calcStopList.value=[];
+  if(queryParams.value.daterangeTime==null){
+    queryParams.value.daterangeTime = [new Date(day).Format('yyyy-MM-dd')+' 00:00',new Date(day).Format('yyyy-MM-dd')+' 23:00'];
+  }
+  queryParams.value['params']={"sTime":queryParams.value.daterangeTime[0]+':00',"eTime":queryParams.value.daterangeTime[1]+':00'}
   listCalcStop(queryParams.value).then(response => {
+    loading.value = false;
+    if(response.code!=200){
+      return;
+    }
     calcStopList.value = response.rows;
     total.value = response.total;
+  });
+}
+
+function getStat() {
+  loading.value = true; 
+  calcStopStat.value=[];
+  if(queryParams.value.daterangeTime==null){
+    queryParams.value.daterangeTime = [new Date(day).Format('yyyy-MM-dd')+' 00:00',new Date(day).Format('yyyy-MM-dd')+' 23:00'];
+  }
+  queryParams.value['params']={"sTime":queryParams.value.daterangeTime[0]+':00',"eTime":queryParams.value.daterangeTime[1]+':00'}
+  statCalcStop(queryParams.value).then(response => {
     loading.value = false;
+    if(response.code!=0){
+      return;
+    }
+    calcStopStat.value = response.data.calc;
   });
 }
 
+
+
 // 取消按钮
 function cancel() {
   open.value = false;
@@ -233,7 +269,7 @@ function reset() {
   form.value = {
     id: null,
     deviceId: null,
-    dataDate: null,
+    dataDateRange: null,
     hour: null,
     startTime: null,
     endTime: null,
@@ -247,6 +283,7 @@ function reset() {
 function handleQuery() {
   queryParams.value.pageNum = 1;
   getList();
+  getStat();
 }
 
 /** 重置按钮操作 */
@@ -318,6 +355,6 @@ function handleExport() {
     ...queryParams.value
   }, `calcStop_${new Date().getTime()}.xlsx`)
 }
-
+getStat();
 getList();
 </script>

+ 11 - 10
src/views/calc/pingfangmi/index.vue

@@ -9,8 +9,7 @@
       <div style="height: 700px;width: 100%;background-color: rgb(237 237 237 / 23%);margin-top: 10px;display: flex;">          
           <div style="height: 700px;width: 30%;margin-left: 1%;">
             <div class="table_caption" style="height: 30px;line-height: 30px;">汇总统计</div>
-            <el-scrollbar id="scrollar0" tag="div" :horizontal="false" style="height: 680px;width:100%;margin-left: 1%;overflow-y: hidden">
-                <el-table v-loading="loading" :data="datalist">
+            <el-table v-loading="loading" height="750px" :data="datalist">
                   <el-table-column label="平方米克重" align="center" prop="gramMass"></el-table-column>
                   <el-table-column label="设备数量" align="center" prop="num"></el-table-column>
                   <el-table-column label="占比" align="center" prop="percent"></el-table-column>
@@ -20,11 +19,10 @@
                     </template>
                   </el-table-column>
                 </el-table>
-             </el-scrollbar>
           </div>
-          <el-scrollbar id="scrollar1" tag="div" :horizontal="false" style="height: 700px;width: 65%;margin-left: 1%;overflow-y: hidden">
+          <div style="height: 700px;width: 68%;margin-left: 1%;">
               <div class="table_caption" style="height: 30px;line-height: 30px;">{{detailValue}}明细数据</div>
-              <el-table class="titletable" cellspacing="0" cellpadding="0" style="width: 130%;" :data="detailDataList">
+              <el-table class="titletable" cellspacing="0" cellpadding="0" height="750px" width="800px" :data="detailDataList">
                 <el-table-column label="设备名" align="center" prop="device"></el-table-column>
                 <el-table-column label="送经量" align="center">
                   <el-table-column label="GB1" align="center" prop="formula_data_19"></el-table-column>
@@ -58,7 +56,7 @@
                 <el-table-column label="牵拉密度" align="center" prop="formula_data_24"></el-table-column>
                 <el-table-column label="卷曲张力" align="center" prop="formula_data_25"></el-table-column>
               </el-table>
-          </el-scrollbar>
+            </div>
       </div>
   </div>
 </template>
@@ -75,9 +73,11 @@
           
       },
       setup(props,{emit}){
+          const { proxy } = getCurrentInstance();
           let datalist=ref([]);
           let detailDataList=ref([]);
-          let detailValue=ref('')
+          let detailValue=ref('');
+          const loading=ref(true);
           function impquery(){
               detailDataList.value=[];
               datalist.value=[];
@@ -86,7 +86,9 @@
                       type:"info",
                       duration:0, //一直显示
               });
+              loading.value = true;
               Get07Data().then((res)=>{
+                  loading.value = false;
                   console.log(res)
                   msg.close();
                   if(res.code!=0){
@@ -125,9 +127,7 @@
           }
 
           function impdata(){
-              proxy.download('api/export/gram-mass', {
-                ...queryParams.value
-              }, `pingfangmi_${new Date().getTime()}.xlsx`)
+              proxy.download('api/export/gram-mass', {}, `平方米克重_${new Date().getTime()}.xlsx`)
           }
 
           onMounted(()=>{
@@ -141,6 +141,7 @@
               impdata,
               getDetail,
               impquery,
+              loading,
           }
       }
   }