Ver código fonte

冰排使用记录、导出

unknown 3 dias atrás
pai
commit
1616f47042

+ 18 - 0
src/api/iceRaft.js

@@ -15,6 +15,24 @@ export function getIceRaftNewest(parameter) {
     params: parameter
   })
 }
+// 获取冰排使用记录列表
+export function getRecording(parameter) {
+  return request({
+    url: '/api/ice-raft-record/recording',
+    method: 'get',
+    params: parameter
+  })
+}
+
+// 导出冰排使用记录列表
+export function getExportExecl(parameter) {
+  return request({
+    url: '/api/ice-raft-record/export-execl',
+    method: 'get',
+    responseType: 'blob',
+    params: parameter
+  })
+}
 
 // 冰排入库
 export function iceraftIn(parameter) {

+ 8 - 0
src/api/incubator.js

@@ -17,6 +17,14 @@ export function getRaftCoolerBox(parameter) {
     params: parameter
   })
 }
+// 获取所有保温箱使用记录
+export function getcoolerboxall(parameter) {
+  return request({
+    url: '/api/cooler-box/getcoolerboxall',
+    method: 'get',
+    params: parameter
+  })
+}
 // 获取车辆详情
 export function getCoolerBoxDetails(parameter) {
   return request({

+ 10 - 0
src/api/waybill.js

@@ -33,6 +33,16 @@ export function putUpdateStatus(parameter) {
     data: parameter
   })
 }
+
+// 订单转门店
+export function putturnarounds(parameter) {
+  return request({
+    url: '/api/waybill/turnarounds',
+    method: 'put',
+    data: parameter
+  })
+}
+
 // 审核订单
 export function auditWaybill(parameter) {
   return request({

+ 26 - 3
src/assets/fonts/demo_index.html

@@ -55,6 +55,12 @@
           <ul class="icon_lists dib-box">
           
             <li class="dib">
+              <span class="icon iconfont">&#xe60c;</span>
+                <div class="name">产品跟踪追溯</div>
+                <div class="code-name">&amp;#xe60c;</div>
+              </li>
+          
+            <li class="dib">
               <span class="icon iconfont">&#xe79c;</span>
                 <div class="name">轨迹0</div>
                 <div class="code-name">&amp;#xe79c;</div>
@@ -198,9 +204,9 @@
 <pre><code class="language-css"
 >@font-face {
   font-family: 'iconfont';
-  src: url('iconfont.woff2?t=1731051259643') format('woff2'),
-       url('iconfont.woff?t=1731051259643') format('woff'),
-       url('iconfont.ttf?t=1731051259643') format('truetype');
+  src: url('iconfont.woff2?t=1731635379319') format('woff2'),
+       url('iconfont.woff?t=1731635379319') format('woff'),
+       url('iconfont.ttf?t=1731635379319') format('truetype');
 }
 </code></pre>
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@@ -227,6 +233,15 @@
         <ul class="icon_lists dib-box">
           
           <li class="dib">
+            <span class="icon iconfont icon-trace"></span>
+            <div class="name">
+              产品跟踪追溯
+            </div>
+            <div class="code-name">.icon-trace
+            </div>
+          </li>
+          
+          <li class="dib">
             <span class="icon iconfont icon-guiji"></span>
             <div class="name">
               轨迹0
@@ -444,6 +459,14 @@
           
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icon-trace"></use>
+                </svg>
+                <div class="name">产品跟踪追溯</div>
+                <div class="code-name">#icon-trace</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
                   <use xlink:href="#icon-guiji"></use>
                 </svg>
                 <div class="name">轨迹0</div>

+ 7 - 3
src/assets/fonts/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 4556741 */
-  src: url('@/assets/fonts/iconfont.woff2?t=1731051259643') format('woff2'),
-       url('@/assets/fonts/iconfont.woff?t=1731051259643') format('woff'),
-       url('@/assets/fonts/iconfont.ttf?t=1731051259643') format('truetype');
+  src: url('@/assets/fonts/iconfont.woff2?t=1731635379319') format('woff2'),
+       url('@/assets/fonts/iconfont.woff?t=1731635379319') format('woff'),
+       url('@/assets/fonts/iconfont.ttf?t=1731635379319') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,10 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-trace:before {
+  content: "\e60c";
+}
+
 .icon-guiji:before {
   content: "\e79c";
 }

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
src/assets/fonts/iconfont.js


+ 7 - 0
src/assets/fonts/iconfont.json

@@ -6,6 +6,13 @@
   "description": "",
   "glyphs": [
     {
+      "icon_id": "11230122",
+      "name": "产品跟踪追溯",
+      "font_class": "trace",
+      "unicode": "e60c",
+      "unicode_decimal": 58892
+    },
+    {
       "icon_id": "8398567",
       "name": "轨迹0",
       "font_class": "guiji",

BIN
src/assets/fonts/iconfont.ttf


BIN
src/assets/fonts/iconfont.woff


BIN
src/assets/fonts/iconfont.woff2


+ 13 - 0
src/assets/js/blockSort.js

@@ -13,6 +13,19 @@ export const orderStatus = () => {
     value: 4,
   }]
 }
+// 冷冻要求
+export const freezingRequirement = () => {
+  return [{
+    label: '48小时',
+    value: 48,
+  }, {
+    label: '24小时',
+    value: 24,
+  }, {
+    label: '12小时',
+    value: 12,
+  }]
+}
 
 export const WaybillStatus = () => {
   return [{

+ 94 - 34
src/components/centerControl.vue

@@ -42,19 +42,21 @@
             <div class="card_unpack_control">
               <div style="display: flex;align-items: center;">
                 <div style="width: 260px;margin-right: 10px;">
-                  <el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
+                  <el-input size="small" v-model="incubatorName" placeholder="请输入内容"
+                    @input="incubatorSearch"></el-input>
                 </div>
                 <!-- <el-date-picker size="small" v-model="value1" type="datetimerange" range-separator="至"
                   start-placeholder="开始日期" end-placeholder="结束日期">
                 </el-date-picker> -->
               </div>
               <div>
-                <el-button type="primary" size="small" @click="examine">查看实时数据</el-button>
+                <el-button type="primary" size="small" @click="examine" v-if="currentId == 1">查看实时数据</el-button>
               </div>
             </div>
-            <div class="history_warp">
-              <el-table ref="multipleTable" :data="tableData" height="calc(100% - 51px)" border style="width: 100%"
-                @selection-change="handleSelectionChange" @cell-click="selectIncubator" :key="currentId">
+            <div class="history_warp" v-loading="tableLoading">
+              <el-table ref="multipleTable" :data="tableData" :highlight-current-row="currentId == 2 ? true : false"
+                height="calc(100% - 51px)" border style="width: 100%" @selection-change="handleSelectionChange"
+                @cell-click="selectIncubator" :key="currentId">
                 <el-table-column type="selection" width="55" v-if="currentId == 1"></el-table-column>
                 <el-table-column type="index" width="50" v-else></el-table-column>
                 <el-table-column prop="name" label="名称"></el-table-column>
@@ -82,7 +84,7 @@
           </div>
         </div>
       </div>
-      <div class="card_right_information" v-if="currentId == 2">
+      <div class="card_right_information" v-if="currentId == 2" v-loading="timeLoading">
         <div class="hide_information center_in" v-if="!optionFlag && trackCircle" @click="reelect">
           <span class="iconfont icon-guiji"></span>
         </div>
@@ -103,6 +105,7 @@
 
 <script>
   import {
+    getCoolerBox,
     getCoolerBoxLocus,
     getHistoryLocus,
     getNewlocus
@@ -112,10 +115,10 @@
     name: 'centerControl',
     props: {
       // 表格label数据
-      tableData: {
-        type: Array,
-        default: () => [],
-      },
+      // tableData: {
+      //   type: Array,
+      //   default: () => [],
+      // },
     },
     components: {
       pagination,
@@ -141,7 +144,7 @@
         currentId: 1,
         incubatorData: [],
         incubatorID: null,
-        optionFlag: false,
+        optionFlag: true,
         timeData: [],
         polyline: null,
         passedPolyline: null,
@@ -151,7 +154,7 @@
         trackPlayback: null,
         playbackControl: false,
         trackCircle: false,
-        Total: 100,
+        Total: 0,
         Pagination: {
           PageIndex: 1,
           PageSize: 10,
@@ -163,6 +166,10 @@
         realTimeTrajectory: [],
         carMarker: [],
         mapLoading: false,
+        tableData: [],
+        tableLoading: false,
+        incubatorName: '',
+        timeLoading: false,
       }
     },
     computed: {
@@ -175,26 +182,49 @@
       },
     },
     watch: {
-      tableData: {
-        handler(newVal) {
-          let arr = newVal
-          arr.forEach((item) => {
-            if (item.id == this.incubatorID) {
-              item.flag = true
-            } else {
-              item.flag = false
-            }
-          })
-          this.incubatorData = arr
-        },
-        immediate: true,
-        deep: true // 开启深度监听
-      },
+      // tableData: {
+      //   handler(newVal) {
+      //     let arr = newVal
+      //     arr.forEach((item) => {
+      //       if (item.id == this.incubatorID) {
+      //         item.flag = true
+      //       } else {
+      //         item.flag = false
+      //       }
+      //     })
+      //     this.incubatorData = arr
+      //   },
+      //   immediate: true,
+      //   deep: true // 开启深度监听
+      // },
     },
     mounted() {
       // this.keyUpSearch()
     },
     methods: {
+      // 搜索保温箱
+      incubatorSearch() {
+        this.getList()
+      },
+      // 获取保温箱列表
+      getList() {
+        this.tableLoading = true
+        var params = {
+          page: this.Pagination.PageIndex,
+          pageSize: this.Pagination.PageSize,
+          showTemp: true,
+          name: this.incubatorName,
+        }
+        getCoolerBox(params).then(res => {
+          if (res.code == 200) {
+            this.tableData = res.data.list
+            this.Total = res.data.count
+          }
+          this.tableLoading = false
+        }).catch(() => {
+          this.tableLoading = false
+        })
+      },
       selectRol(event) {
         if (this.currentId != event.id) {
           if (event.id == 1) {
@@ -208,6 +238,9 @@
           if (item.id == event.id) {
             this.currentId = event.id
             item.flag = true
+            this.Pagination.PageIndex = 1
+            this.Pagination.PageSize = 10
+            this.getList()
           } else {
             item.flag = false
           }
@@ -233,31 +266,35 @@
       // 查看实时数据
       async examine() {
         const that = this
+        that.realTimeTrajectory = []
 
         function difference(arr1, arr2) {
           return arr1.filter(item => !arr2.includes(item));
         }
         const uniqueToFirstArray = difference(that.incubatorSn, that.jointSn);
         const uniqueToFirstArray1 = difference(that.jointSn, that.incubatorSn);
-        // console.log(uniqueToFirstArray, uniqueToFirstArray1, 999)
         uniqueToFirstArray1.forEach(ique => {
           that.jointSn = deleteElementById(that.jointSn, ique)
 
           function deleteElementById(arr, id) {
             return arr.filter((item) => item !== id);
           }
-          that.eventSource[ique].close()
           if (that.carMarker[ique].marker) {
             that.carMarker[ique].marker.setMap(null)
           }
+          if (that.carMarker[ique].startMarker) {
+            that.carMarker[ique].startMarker.setMap(null)
+          }
           if (that.carMarker[ique].polyline) {
             that.carMarker[ique].polyline.setMap(null)
           }
+          that.eventSource[ique].close()
           that.carMarker[ique] = null
         })
         that.jointSn = that.incubatorSn
         const userData = localStorage.getItem('userList')
         const deptId = JSON.parse(userData)
+        that.map.setFitView(null, false, [150, 60, 100, 60])
         if (that.incubatorSn.length > 0) {
           for (let i = 0; i < uniqueToFirstArray.length; i++) {
             const T_sn = uniqueToFirstArray[i]
@@ -284,7 +321,6 @@
                   that.initMarker(event.data[0], event)
                 })
               } else {
-                console.log(T_sn, that.jointSn, 23)
                 that.jointSn = deleteElementById(that.jointSn, T_sn)
 
                 function deleteElementById(arr, id) {
@@ -331,6 +367,13 @@
             this.carMarker[item.sn].polyline.setPath(trackList)
           }
         } else {
+          // 创建一个 起点Icon
+          var startIcon = new AMap.Icon({
+            size: new AMap.Size(25, 34),
+            image: '//a.amap.com/jsapi_demos/static/demo-center/icons/dir-marker.png',
+            imageSize: new AMap.Size(135, 40),
+            imageOffset: new AMap.Pixel(-9, -3)
+          });
           let icon = new AMap.Icon({
             size: new AMap.Size(40, 45),
             image: require(`@/assets/images/truck.png`),
@@ -339,6 +382,7 @@
           this.carMarker[item.sn] = {
             marker: null,
             polyline: null,
+            startMarker: null,
           }
           // 坐标点 生成方法
           this.carMarker[item.sn].marker = new AMap.Marker({
@@ -346,6 +390,13 @@
             position: [Number(latitude[0]), Number(latitude[1])], // 左边点的经纬度
             offset: new AMap.Pixel(0, -30) // 坐标点偏移量
           });
+          // 起点
+          var startArr = positions[positions.length - 1].T_site.split(',')
+          this.carMarker[item.sn].startMarker = new AMap.Marker({
+            icon: startIcon, // 坐标点图标
+            position: [Number(startArr[0]), Number(startArr[1])], // 左边点的经纬度
+            offset: new AMap.Pixel(-11, -28) // 坐标点偏移量
+          });
           // 点标记显示内容,HTML要素字符串
           var markerContent = '' +
             '<div class="incubator_card_map">' +
@@ -372,6 +423,7 @@
             lineCap: 'round',
           });
           this.carMarker[item.sn].marker.setMap(this.map)
+          this.carMarker[item.sn].startMarker.setMap(this.map)
         }
         this.map.setFitView(null, false, [150, 60, 100, 60])
       },
@@ -409,14 +461,18 @@
       },
       // 获取保温箱历史时间段
       getBoxLocus(boxID) {
+        this.timeLoading = true
         getCoolerBoxLocus({
           id: boxID,
         }).then(res => {
-          if (res.code == 200 && res.data != null) {
-            this.timeData = res.data
+          if (res.code == 200 && res.data.list != null) {
+            this.timeData = res.data.list
           } else {
             this.timeData = []
           }
+          this.timeLoading = false
+        }).catch(() => {
+          this.timeLoading = false
         })
       },
       // 获取保温箱历史轨迹
@@ -602,7 +658,9 @@
       dialogClose() {
         if (this.incubatorSn.length > 0) {
           this.incubatorSn.forEach(item => {
-            this.eventSource[item].close()
+            if(this.eventSource[item]){
+              this.eventSource[item].close()
+            }
           })
         }
         this.map = null
@@ -618,9 +676,11 @@
       },
       changeSize(val) {
         this.Pagination.PageSize = val
+        this.getList()
       },
       changeCurrent(val) {
         this.Pagination.PageIndex = val
+        this.getList()
       },
     }
   }
@@ -657,7 +717,7 @@
     justify-content: space-between;
     align-items: flex-end;
     height: 50px;
-    padding: 0px 20px;
+    padding: 0px 20px 0px 20px;
     z-index: 2025;
     border-bottom: 1px solid #ffffff;
     // background-image: linear-gradient(to top, #209cff 0%, #68e0cf 100%);

+ 27 - 0
src/components/forms.vue

@@ -11,6 +11,9 @@
               v-model="ruleForm[`${item.field}`]" auto-complete="new-password"
               :show-password="['newPassword','password'].includes(item.field) ? true : false"></el-input>
             <div class="unit_card" v-if="item.unit">{{item.unit}}</div>
+            <div v-if="item.field == 'orderNo'" style="margin-left: 10px;">
+              <el-button type="success">生成订单号</el-button>
+            </div>
           </el-form-item>
           <!-- 开关 -->
           <el-form-item class="card_independent" :label-width="item.labelWidth" :label="item.label" :prop="item.field"
@@ -20,6 +23,30 @@
                 inactive-color="#ff4949"></el-switch>
             </div>
           </el-form-item>
+          <!-- 扫码添加药品信息Drug tracing code -->
+          <el-form-item class="card_independent" :label-width="item.labelWidth" :label="item.label" :prop="item.field"
+            :rules="detail ? item.rules : {}" v-if="item.type === 'tracingCode'">
+            <el-input :placeholder="item.placeholder" :disabled="item.disabled" :id="item.field" v-model="inputs"
+              @keyup.enter.native="serialNumber(item.field)" @focus="focus(item.field)" @input="iceRaftInput">
+              <el-button slot="append" icon="el-icon-circle-plus icon_circle_btn"
+                @click="serialNumber(item.field)"></el-button>
+            </el-input>
+          </el-form-item>
+          <div style="margin-bottom: 10px;" v-if="item.field === 'divider'">
+            <el-divider>{{item.label}}</el-divider>
+            <el-table :data="tableData" stripe style="width: 100%">
+              <el-table-column align="center" prop="date" label="商品名称"></el-table-column>
+              <el-table-column align="center" prop="name" label="商品数量"></el-table-column>
+              <el-table-column align="center" prop="address" label="药品图片" width="180">
+                <el-image style="width: 50px; height: 50px"
+                  :preview-src-list="['https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg']"
+                  src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"></el-image>
+              </el-table-column>
+              <el-table-column align="center" prop="name" label="商品规格"></el-table-column>
+              <el-table-column align="center" prop="name" label="生产厂家"></el-table-column>
+              <el-table-column align="center" prop="name" label="是否双通道药品" width="140"></el-table-column>
+            </el-table>
+          </div>
           <!-- 扫描 -->
           <el-form-item class="card_independent" :label-width="item.labelWidth" :label="item.label" :prop="item.field"
             :rules="detail ? item.rules : {}" v-if="item.type === 'scan'">

+ 5 - 0
src/components/tables.vue

@@ -50,6 +50,11 @@
             </div>
           </template>
         </el-table-column>
+        <el-table-column :label="item.label" align="center" v-else-if="item.field == 'suitableForCold'">
+          <template slot-scope="scope" v-if="item.field == 'suitableForCold'">
+            <div v-if="scope.row[item.field]">{{ scope.row[item.field] }} ℃</div>
+          </template>
+        </el-table-column>
         <el-table-column :label="item.label" align="center" v-else-if="item.field == 'multistage'">
           <template v-for="(child,cgindex) in item.children">
             <el-table-column :prop="child.field" :label="child.label" :width="child.colWidth" :align="child.align">

+ 32 - 0
src/components/treeTable.vue

@@ -20,6 +20,14 @@
         <el-table-column type="index" :fixed="item.boxhead ? true : false" width="80px" :label="item.label"
           :align="item.align" v-else-if="item.field == 'index'">
         </el-table-column>
+        <el-table-column :prop="item.field" :label="item.label" :width="item.colWidth" :align="item.align"
+          v-else-if="['isIceReleaseCold','isCoolerReleaseCold'].includes(item.field)">
+          <template slot-scope="scope">
+            <div :style="{color: filterColor(scope.row,item.options,item.field)}">
+              {{initDictvalueil(scope.row,item.options,item.field)}}
+            </div>
+          </template>
+        </el-table-column>
         <el-table-column show-overflow-tooltip :prop="item.field" :label="item.label" :width="item.colWidth"
           :align="item.align" v-else>
         </el-table-column>
@@ -46,6 +54,30 @@
       return {}
     },
     methods: {
+      // 普通类型文字匹配
+      initDictvalueil(value, list, type) {
+        let name = ''
+        if (list) {
+          list.forEach(item => {
+            if (value[type] === item.value) {
+              name = item.label
+            }
+          })
+        }
+        return name
+      },
+      // tag颜色获取
+      filterColor(value, list, type) {
+        let color = ''
+        if (list) {
+          list.forEach(item => {
+            if (value[type] === item.value) {
+              color = item.bgcolor
+            }
+          })
+        }
+        return color
+      },
       // 操作按钮
       buttonData(row, type) {
         this.$emit("buttonData", row, type);

+ 103 - 97
src/config/deliveryman.js

@@ -5,120 +5,126 @@ export const deliverymanRouter = {
   component: () => import('@/views/common/Base'),
   redirect: '/home',
   children: [{
-      path: '/home',
-      name: 'home',
+    path: '/home',
+    name: 'home',
+    meta: {
+      icon: 'icon-shouye',
+      title: '首页'
+    },
+    component: () => import('@/views/page/Home'),
+  }, {
+    path: '/addressBook',
+    name: 'addressBook',
+    meta: {
+      icon: 'icon-cangku',
+      title: '患者薄管理'
+    },
+    component: () => import('@/views/system/addressBook'),
+  }, {
+    path: '/IceManagement',
+    name: 'IceManagement',
+    meta: {
+      icon: 'icon-bingpaiguanli',
+      title: '冰排管理'
+    },
+    component: () => import('@/views/IceCreamFreezer/IceManagement'),
+  }, {
+    path: '/IceTracingManagement',
+    name: 'IceTracingManagement',
+    meta: {
+      icon: 'icon-iceTracing',
+      title: '冰排追溯管理'
+    },
+    component: () => import('@/views/IceCreamFreezer/IceTracingManagement'),
+  }, {
+    path: '/IncubatorManagement',
+    name: 'IncubatorManagement',
+    meta: {
+      icon: 'icon-baowenxiangguanli',
+      title: '保温箱管理'
+    },
+    component: () => import('@/views/incubator/IncubatorManagement'),
+  }, {
+    path: '/IncubatorTraceability',
+    name: 'IncubatorTraceability',
+    meta: {
+      icon: 'icon-trace',
+      title: '保温箱追溯'
+    },
+    component: () => import('@/views/incubator/IncubatorTraceability'),
+  }, {
+    path: '/FreezerManagement',
+    name: 'FreezerManagement',
+    meta: {
+      icon: 'icon-binggui',
+      title: '冷冻柜管理'
+    },
+    component: () => import('@/views/IceCreamFreezer/FreezerManagement'),
+  }, {
+    path: '/OrderManagement',
+    name: 'OrderManagement',
+    meta: {
+      icon: 'icon-yundan',
+      title: '订单管理'
+    },
+    component: () => import('@/views/OrderManagement/index'),
+    redirect: '/OrderManagement/uncertainOrder',
+    children: [{
+      path: 'uncertainOrder',
+      name: 'uncertainOrder',
       meta: {
-        icon: 'icon-shouye',
-        title: '首页'
+        icon: 'icon-yueduye-mulu',
+        title: '未确定订单'
       },
-      component: () => import('@/views/page/Home'),
+      component: () => import('@/views/OrderManagement/uncertainOrder.vue'),
     }, {
-      path: '/addressBook',
-      name: 'addressBook',
+      path: 'reviewedOrder',
+      name: 'reviewedOrder',
       meta: {
-        icon: 'icon-cangku',
-        title: '患者薄管理'
+        icon: 'icon-daishenhe',
+        title: '待审核订单'
       },
-      component: () => import('@/views/system/addressBook'),
+      component: () => import('@/views/OrderManagement/reviewedOrder.vue'),
     }, {
-      path: '/IceTracingManagement',
-      name: 'IceTracingManagement',
+      path: 'pendingOrder',
+      name: 'pendingOrder',
       meta: {
-        icon: 'icon-iceTracing',
-        title: '冰排追溯管理'
+        icon: 'icon-daipeisong',
+        title: '待配送订单'
       },
-      component: () => import('@/views/IceCreamFreezer/IceTracingManagement'),
+      component: () => import('@/views/OrderManagement/pendingOrder.vue'),
     }, {
-      path: '/IceManagement',
-      name: 'IceManagement',
+      path: 'deliveryOrder',
+      name: 'deliveryOrder',
       meta: {
-        icon: 'icon-bingpaiguanli',
-        title: '冰排管理'
+        icon: 'icon-peisongzhong',
+        title: '配送中订单'
       },
-      component: () => import('@/views/IceCreamFreezer/IceManagement'),
+      component: () => import('@/views/OrderManagement/deliveryOrder.vue'),
     }, {
-      path: '/FreezerManagement',
-      name: 'FreezerManagement',
+      path: 'completedOrder',
+      name: 'completedOrder',
       meta: {
-        icon: 'icon-binggui',
-        title: '冷冻柜管理'
+        icon: 'icon-yiwanchengdingdan',
+        title: '已完成订单'
       },
-      component: () => import('@/views/IceCreamFreezer/FreezerManagement'),
+      component: () => import('@/views/OrderManagement/completedOrder.vue'),
     }, {
-      path: '/IncubatorManagement',
-      name: 'IncubatorManagement',
+      path: 'cancelledOrder',
+      name: 'cancelledOrder',
       meta: {
-        icon: 'icon-baowenxiangguanli',
-        title: '保温箱管理'
+        icon: 'icon-yiquxiaodingdan',
+        title: '已取消订单'
       },
-      component: () => import('@/views/system/IncubatorManagement'),
-    },
-    {
-      path: '/OrderManagement',
-      name: 'OrderManagement',
+      component: () => import('@/views/OrderManagement/cancelledOrder.vue'),
+    }, {
+      path: 'rejectionOrder',
+      name: 'rejectionOrder',
       meta: {
-        icon: 'icon-yundan',
-        title: '订单管理'
+        icon: 'icon-yiquxiaodingdan',
+        title: '已拒收订单'
       },
-      component: () => import('@/views/OrderManagement/index'),
-      redirect: '/OrderManagement/uncertainOrder',
-      children: [{
-        path: 'uncertainOrder',
-        name: 'uncertainOrder',
-        meta: {
-          icon: 'icon-yueduye-mulu',
-          title: '未确定订单'
-        },
-        component: () => import('@/views/OrderManagement/uncertainOrder.vue'),
-      }, {
-        path: 'reviewedOrder',
-        name: 'reviewedOrder',
-        meta: {
-          icon: 'icon-daishenhe',
-          title: '待审核订单'
-        },
-        component: () => import('@/views/OrderManagement/reviewedOrder.vue'),
-      }, {
-        path: 'pendingOrder',
-        name: 'pendingOrder',
-        meta: {
-          icon: 'icon-daipeisong',
-          title: '待配送订单'
-        },
-        component: () => import('@/views/OrderManagement/pendingOrder.vue'),
-      }, {
-        path: 'deliveryOrder',
-        name: 'deliveryOrder',
-        meta: {
-          icon: 'icon-peisongzhong',
-          title: '配送中订单'
-        },
-        component: () => import('@/views/OrderManagement/deliveryOrder.vue'),
-      }, {
-        path: 'completedOrder',
-        name: 'completedOrder',
-        meta: {
-          icon: 'icon-yiwanchengdingdan',
-          title: '已完成订单'
-        },
-        component: () => import('@/views/OrderManagement/completedOrder.vue'),
-      }, {
-        path: 'cancelledOrder',
-        name: 'cancelledOrder',
-        meta: {
-          icon: 'icon-yiquxiaodingdan',
-          title: '已取消订单'
-        },
-        component: () => import('@/views/OrderManagement/cancelledOrder.vue'),
-      }, {
-        path: 'rejectionOrder',
-        name: 'rejectionOrder',
-        meta: {
-          icon: 'icon-yiquxiaodingdan',
-          title: '已拒收订单'
-        },
-        component: () => import('@/views/OrderManagement/rejectionOrder.vue'),
-      }, ]
-    }
-  ]
+      component: () => import('@/views/OrderManagement/rejectionOrder.vue'),
+    }, ]
+  }]
 }

+ 21 - 14
src/config/intendant.js

@@ -37,6 +37,14 @@ export const intendantRouter = {
       },
       component: () => import('@/views/IceCreamFreezer/storeManagement'),
     }, {
+      path: '/IceManagement',
+      name: 'IceManagement',
+      meta: {
+        icon: 'icon-bingpaiguanli',
+        title: '冰排管理'
+      },
+      component: () => import('@/views/IceCreamFreezer/IceManagement'),
+    }, {
       path: '/IceTracingManagement',
       name: 'IceTracingManagement',
       meta: {
@@ -45,13 +53,21 @@ export const intendantRouter = {
       },
       component: () => import('@/views/IceCreamFreezer/IceTracingManagement'),
     }, {
-      path: '/IceManagement',
-      name: 'IceManagement',
+      path: '/IncubatorManagement',
+      name: 'IncubatorManagement',
       meta: {
-        icon: 'icon-bingpaiguanli',
-        title: '冰排管理'
+        icon: 'icon-baowenxiangguanli',
+        title: '保温箱管理'
       },
-      component: () => import('@/views/IceCreamFreezer/IceManagement'),
+      component: () => import('@/views/incubator/IncubatorManagement'),
+    }, {
+      path: '/IncubatorTraceability',
+      name: 'IncubatorTraceability',
+      meta: {
+        icon: 'icon-trace',
+        title: '保温箱追溯'
+      },
+      component: () => import('@/views/incubator/IncubatorTraceability'),
     }, {
       path: '/FreezerManagement',
       name: 'FreezerManagement',
@@ -61,15 +77,6 @@ export const intendantRouter = {
       },
       component: () => import('@/views/IceCreamFreezer/FreezerManagement'),
     }, {
-      path: '/IncubatorManagement',
-      name: 'IncubatorManagement',
-      meta: {
-        icon: 'icon-baowenxiangguanli',
-        title: '保温箱管理'
-      },
-      component: () => import('@/views/system/IncubatorManagement'),
-    },
-    {
       path: '/OrderManagement',
       name: 'OrderManagement',
       meta: {

+ 0 - 150
src/router/generator-routers.js

@@ -51,155 +51,6 @@ const companyRouter = {
       },
       component: () => import('@/views/system/CompanyManagement'),
     }
-  ]
-}
-// 根级菜单
-const rootRouter = {
-  name: 'index',
-  path: '/',
-  component: () => import('@/views/common/Base'),
-  redirect: '/home',
-  children: [{
-      path: '/home',
-      name: 'home',
-      meta: {
-        icon: 'icon-shouye',
-        title: '首页'
-      },
-      component: () => import('@/views/page/Home'),
-    }, {
-      path: '/addressBook',
-      name: 'addressBook',
-      meta: {
-        icon: 'icon-cangku',
-        title: '患者薄管理'
-      },
-      component: () => import('@/views/system/addressBook'),
-    }, {
-      path: '/storeManagement',
-      name: 'storeManagement',
-      meta: {
-        icon: 'icon-yaodian',
-        title: '门店管理'
-      },
-      component: () => import('@/views/IceCreamFreezer/storeManagement'),
-    }, {
-      path: '/IceTracingManagement',
-      name: 'IceTracingManagement',
-      meta: {
-        icon: 'icon-iceTracing',
-        title: '冰排追溯管理'
-      },
-      component: () => import('@/views/IceCreamFreezer/IceTracingManagement'),
-    }, {
-      path: '/IceManagement',
-      name: 'IceManagement',
-      meta: {
-        icon: 'icon-bingpaiguanli',
-        title: '冰排管理'
-      },
-      component: () => import('@/views/IceCreamFreezer/IceManagement'),
-    }, {
-      path: '/FreezerManagement',
-      name: 'FreezerManagement',
-      meta: {
-        icon: 'icon-binggui',
-        title: '冷冻柜管理'
-      },
-      component: () => import('@/views/IceCreamFreezer/FreezerManagement'),
-    }, {
-      path: '/IncubatorManagement',
-      name: 'IncubatorManagement',
-      meta: {
-        icon: 'icon-baowenxiangguanli',
-        title: '保温箱管理'
-      },
-      component: () => import('@/views/system/IncubatorManagement'),
-    },
-    {
-      path: '/OrderManagement',
-      name: 'OrderManagement',
-      meta: {
-        icon: 'icon-yundan',
-        title: '订单管理'
-      },
-      component: () => import('@/views/OrderManagement/index'),
-      redirect: '/OrderManagement/uncertainOrder',
-      children: [{
-        path: 'uncertainOrder',
-        name: 'uncertainOrder',
-        meta: {
-          icon: 'icon-yueduye-mulu',
-          title: '未确定订单'
-        },
-        component: () => import('@/views/OrderManagement/uncertainOrder.vue'),
-      }, {
-        path: 'reviewedOrder',
-        name: 'reviewedOrder',
-        meta: {
-          icon: 'icon-daishenhe',
-          title: '待审核订单'
-        },
-        component: () => import('@/views/OrderManagement/reviewedOrder.vue'),
-      }, {
-        path: 'pendingOrder',
-        name: 'pendingOrder',
-        meta: {
-          icon: 'icon-daipeisong',
-          title: '待配送订单'
-        },
-        component: () => import('@/views/OrderManagement/pendingOrder.vue'),
-      }, {
-        path: 'deliveryOrder',
-        name: 'deliveryOrder',
-        meta: {
-          icon: 'icon-peisongzhong',
-          title: '配送中订单'
-        },
-        component: () => import('@/views/OrderManagement/deliveryOrder.vue'),
-      }, {
-        path: 'completedOrder',
-        name: 'completedOrder',
-        meta: {
-          icon: 'icon-yiwanchengdingdan',
-          title: '已完成订单'
-        },
-        component: () => import('@/views/OrderManagement/completedOrder.vue'),
-      }, {
-        path: 'cancelledOrder',
-        name: 'cancelledOrder',
-        meta: {
-          icon: 'icon-yiquxiaodingdan',
-          title: '已取消订单'
-        },
-        component: () => import('@/views/OrderManagement/cancelledOrder.vue'),
-      }, {
-        path: 'rejectionOrder',
-        name: 'rejectionOrder',
-        meta: {
-          icon: 'icon-yiquxiaodingdan',
-          title: '已拒收订单'
-        },
-        component: () => import('@/views/OrderManagement/rejectionOrder.vue'),
-      }, ]
-    }, {
-      path: '/OrderReview',
-      name: 'OrderReview',
-      meta: {
-        icon: 'icon-dingdanshenhe',
-        title: '订单审核'
-      },
-      component: () => import('@/views/OrderManagement/OrderReview'),
-    },
-    {
-      path: '/statisticalManagement',
-      name: 'statisticalManagement',
-      meta: {
-        icon: 'icon-tongjifenxi',
-        title: '统计分析管理'
-      },
-      component: () => import('@/views/page/statisticalManagement'),
-    },
     // {
     //   path: '/WaybillManagement',
     //   name: 'WaybillManagement',
@@ -211,7 +62,6 @@ const rootRouter = {
     // }
   ]
 }
-
 /**
  * 动态生成菜单
  * @param arrType

+ 15 - 5
src/views/IceCreamFreezer/IceManagement.vue

@@ -92,18 +92,25 @@
         ruleForm: {
           code: '',
           status: null,
-          freezeClaim: '',
+          freezeClaim: [],
           label: '',
-          suitableForColdTime: '',
+          suitableForCold: null,
+          iceColdAddress: '',
         },
         confirmLoading: false,
         selectingData: {},
         iceTracing: true,
         // 是否释冷
         iceColdFlag: false,
+        userList: {},
       }
     },
     mounted() {
+      const arr = localStorage.getItem('userList')
+      this.userList = JSON.parse(arr)
+      if (this.userList.dept) {
+        this.iceColdFlag = this.userList.dept.isIceReleaseCold
+      }
       if (this.iceColdFlag) {
         this.tableList = employeeCold()
         this.formRuleList = formRulesCold()
@@ -147,7 +154,8 @@
               status: this.ruleForm.status,
               freezeClaim: Number(this.ruleForm.freezeClaim),
               label: this.ruleForm.label,
-              suitableForColdTime: Number(this.ruleForm.suitableForColdTime),
+              suitableForCold: Number(this.ruleForm.suitableForCold),
+              iceColdAddress: this.ruleForm.iceColdAddress,
             }
             addIceRaft(params).then(res => {
               if (res.code == 200) {
@@ -170,7 +178,8 @@
               status: this.ruleForm.status,
               freezeClaim: Number(this.ruleForm.freezeClaim),
               label: this.ruleForm.label,
-              suitableForColdTime: Number(this.ruleForm.suitableForColdTime),
+              suitableForCold: Number(this.ruleForm.suitableForCold),
+              iceColdAddress: this.ruleForm.iceColdAddress,
             }
             putIceRaft(params).then(res => {
               if (res.code == 200) {
@@ -203,7 +212,8 @@
               this.ruleForm.status = row.status
               this.ruleForm.freezeClaim = row.freezeClaim
               this.ruleForm.label = row.label
-              this.ruleForm.suitableForColdTime = row.suitableForColdTime
+              this.ruleForm.suitableForCold = row.suitableForCold
+              this.ruleForm.iceColdAddress = row.iceColdAddress
             })
           })
         } else if (type == 'logs') {

+ 739 - 552
src/views/IceCreamFreezer/IceTracingManagement.vue

@@ -47,630 +47,817 @@
         <el-button type="primary" :loading="confirmLoading" @click="handleAdd">确 定</el-button>
       </span>
     </el-dialog>
+    <!-- 冰排使用记录 -->
+    <div class="card_iceTracing">
+      <el-dialog fullscreen title="冰排使用记录追溯" :visible.sync="iceTracingVisible" @close="iceTracingDialog">
+        <div style="box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);border-radius: 8px;">
+          <div class="space_between_in" style="margin: 0px 10px 10px 10px;padding-top: 10px;">
+            <div>
+              <el-form ref="userRecordRuleForm" :inline="true" :model="formInline" class="demo-form-inline">
+                <el-form-item label="编号" prop="code">
+                  <el-input v-model="formInline.code" placeholder="请输入冰排编号" @input="codeInput"></el-input>
+                </el-form-item>
+                <el-form-item label="保温箱" prop="coolerBoxId">
+                  <el-select v-model="formInline.coolerBoxId" placeholder="选择保温箱" @change="changeSelect"
+                    v-loadmore="(params) => handleScroll('coolerBoxId')">
+                    <el-option v-for="(element, i) in incubatorData" :label="element.label" :value="`${element.value}`"
+                      :key="i" />
+                  </el-select>
+                </el-form-item>
+                <el-form-item label="使用日期" prop="dateService">
+                  <el-date-picker v-model="formInline.dateService" type="datetimerange" range-separator="至"
+                    start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd hh:mm:ss"
+                    @change="timeChange">
+                  </el-date-picker>
+                </el-form-item>
+                <el-form-item>
+                  <el-button size="medium" icon="el-icon-search" type="primary" @click="searchProtocol">搜索</el-button>
+                </el-form-item>
+                <el-form-item>
+                  <el-button size="medium" icon="el-icon-refresh" @click="searchReset">重置</el-button>
+                </el-form-item>
+                <el-form-item>
+                  <el-button type="success" :loading="exportFlag" @click="download">导出Excel</el-button>
+                </el-form-item>
+              </el-form>
+            </div>
+          </div>
+          <tables :historyFlag="true" :tableList="usageLogList" :tableData="usageLogData">
+          </tables>
+          <!-- 分页 -->
+          <div v-if="usageLogTotal">
+            <pagination :total="usageLogTotal" :currentPage="usageLogPagination.PageIndex" @changeSize="usageLogSize"
+              @changeCurrent="usageLogCurrent">
+            </pagination>
+          </div>
+        </div>
+      </el-dialog>
+    </div>
   </div>
 </template>
 
 <script>
-  import {
-    getIceRaftNewest,
-    iceraftIn,
-    iceraftOut,
-    getIceRaftRecord,
-    putIceRaftRecord,
-    delIceRaftRecord
-  } from '@/api/iceRaft'
-  import {
-    getIcelocker,
-  } from '@/api/refrigerator'
-  import {
-    getCoolerBox
-  } from '@/api/incubator.js'
-  import actionBar from '@/components/actionBar'
-  import tables from '@/components/tables'
-  import pagination from '@/components/pagination'
-  import forms from '@/components/forms'
-  import {
-    employee,
-    historyRecord,
-    iceRaftRules,
-    freezerRules,
-    editRules
-  } from "./iceRaft.js";
-  export default {
-    name: 'IceManagement',
-    components: {
-      actionBar,
-      tables,
-      pagination,
-      forms
-    },
-    data() {
-      return {
-        operateList: [{
-          type: 'come',
-          title: '入库',
+import {
+  getIceRaftNewest,
+  iceraftIn,
+  iceraftOut,
+  getIceRaftRecord,
+  putIceRaftRecord,
+  delIceRaftRecord,
+  getRecording,
+  getExportExecl
+} from '@/api/iceRaft'
+import {
+  getIcelocker,
+} from '@/api/refrigerator'
+import {
+  getCoolerBox
+} from '@/api/incubator.js'
+import actionBar from '@/components/actionBar'
+import tables from '@/components/tables'
+import pagination from '@/components/pagination'
+import forms from '@/components/forms'
+import {
+  employee,
+  historyRecord,
+  iceRaftRules,
+  freezerRules,
+  editRules
+} from "./iceRaft.js";
+export default {
+  name: 'IceManagement',
+  components: {
+    actionBar,
+    tables,
+    pagination,
+    forms
+  },
+  data() {
+    return {
+      operateList: [{
+        type: 'come',
+        title: '入库',
+      }, {
+        type: 'goOut',
+        title: '出库',
+      }, {
+        type: 'export',
+        colour: 'success',
+        title: '冰排使用记录',
+      }],
+      formList: [{
+        type: 'input',
+        label: '编号',
+        field: 'code',
+        placeholder: '请输入编号',
+      }, {
+        type: 'select',
+        label: '状态',
+        field: 'status',
+        placeholder: '请选择状态',
+        options: [{
+          bgcolor: '#606266',
+          label: '未入库',
+          value: '0',
         }, {
-          type: 'goOut',
-          title: '出库',
-        }],
-        formList: [{
-          type: 'input',
-          label: '编号',
-          field: 'code',
-          placeholder: '请输入编号',
+          bgcolor: '#409EFF',
+          label: '冷冻中',
+          value: '1',
         }, {
-          type: 'select',
-          label: '状态',
-          field: 'status',
-          placeholder: '请选择状态',
-          options: [{
-            bgcolor: '#606266',
-            label: '未入库',
-            value: '0',
-          }, {
-            bgcolor: '#409EFF',
-            label: '冷冻中',
-            value: '1',
-          }, {
-            bgcolor: '#67C23A',
-            label: '待使用',
-            value: '2',
-          }, {
-            bgcolor: '#E6A23C',
-            label: '使用中',
-            value: '3',
-          }, {
-            bgcolor: '#909399',
-            label: '已结束',
-            value: '4',
-          }]
+          bgcolor: '#67C23A',
+          label: '待使用',
+          value: '2',
         }, {
-          type: 'select',
-          label: '冷冻柜',
-          field: 'iceLockerId',
-          placeholder: '请选择冷冻柜',
-          options: []
+          bgcolor: '#E6A23C',
+          label: '使用中',
+          value: '3',
         }, {
-          type: 'select',
-          label: '保温箱',
-          field: 'coolerBoxId',
-          placeholder: '请选择保温箱',
-          options: []
-        }, ],
-        searchRuleForm: {
-          code: '',
-          status: '',
-          iceLockerId: null,
-          coolerBoxId: null,
-        },
-        searchValue: {},
-        tableList: employee(),
-        tableData: [],
-        Total: 0,
-        Pagination: {
-          PageIndex: 1,
-          PageSize: 10,
-        },
-        // 历史记录
-        historyList: historyRecord(),
-        historyData: [],
-        historyTotal: 0,
-        historyPagination: {
-          PageIndex: 1,
-          PageSize: 10,
-        },
-        operationType: '',
-        staffTitle: '添加',
-        staffDialogVisible: false,
-        formRuleList: {},
-        ruleForm: {
-          iceLockerId: '',
-          freezeClaim: '',
-          coolerBoxId: '',
-          code: [],
-        },
-        confirmLoading: false,
-        historyVisible: false,
+          bgcolor: '#909399',
+          label: '已结束',
+          value: '4',
+        }]
+      }, {
+        type: 'select',
+        label: '冷冻柜',
+        field: 'iceLockerId',
+        placeholder: '请选择冷冻柜',
+        options: []
+      }, {
+        type: 'select',
+        label: '保温箱',
+        field: 'coolerBoxId',
+        placeholder: '请选择保温箱',
+        options: []
+      },],
+      searchRuleForm: {
+        code: '',
+        status: '',
+        iceLockerId: null,
+        coolerBoxId: null,
+      },
+      searchValue: {},
+      tableList: [],
+      tableData: [],
+      Total: 0,
+      Pagination: {
+        PageIndex: 1,
+        PageSize: 10,
+      },
+      // 历史记录
+      historyList: [],
+      historyData: [],
+      historyTotal: 0,
+      historyPagination: {
+        PageIndex: 1,
+        PageSize: 10,
+      },
+      operationType: '',
+      staffTitle: '添加',
+      staffDialogVisible: false,
+      formRuleList: {},
+      ruleForm: {
+        iceLockerId: '',
+        freezeClaim: '',
+        coolerBoxId: '',
+        code: [],
+      },
+      confirmLoading: false,
+      historyVisible: false,
 
-        page: 1,
-        staffName: '',
-        limitNo: true,
-        limitNoil: true,
-        eventSource: null,
-        timer: null, //定时器名称
-        iceRaftId: null,
+      page: 1,
+      staffName: '',
+      limitNo: true,
+      limitNoil: true,
+      eventSource: null,
+      timer: null, //定时器名称
+      iceRaftId: null,
+
+      innerVisible: false,
+      editRuleList: {},
+      editRuleForm: {
+        code: '',
+        status: '',
+        inStorageTime: '',
+        outStorageTime: '',
+        freezeClaim: '',
+        iceLockerId: '',
+        coolerBoxId: '',
+      },
+      iceRaftCode: '',
+      coldCupboard: {
+        field: 'iceLockerId',
+        label: '冷冻柜',
+        placeholder: '请选择冷冻柜',
+        type: 'searchSelect',
+        colWidth: 24,
+        multiple: false,
+        rules: [{
+          required: true,
+          message: '请选择冷冻柜',
+          trigger: 'blur'
+        }],
+        options: [],
+      },
+      thermostat: {
+        field: 'coolerBoxId',
+        label: '保温箱',
+        placeholder: '请选择保温箱',
+        type: 'searchSelect',
+        colWidth: 24,
+        rules: [{
+          required: true,
+          message: '请选择保温箱',
+          trigger: 'blur'
+        }],
+        options: [],
+      },
+      // 冰排使用记录
+      exportFlag: false,
+      iceTracingVisible: false,
+      value1: '',
+      usageLogList: [],
+      usageLogData: [],
+      usageLogTotal: 0,
+      usageLogPagination: {
+        PageIndex: 1,
+        PageSize: 10,
+      },
+      incubatorData: [],
+      formInline: {
+        code: '',
+        coolerBoxId: null,
+        dateService: []
+      },
+      // 是否释冷
+      iceColdFlag: false,
+      userList: {},
+    }
+  },
+  beforeDestroy() {
+    clearInterval(this.timer); // 清除定时器
+    this.timer = null;
+  },
+  mounted() {
+    const arr = localStorage.getItem('userList')
+    this.userList = JSON.parse(arr)
+    if (this.userList.dept) {
+      this.iceColdFlag = this.userList.dept.isIceReleaseCold
+    }
+    if (!this.iceColdFlag) {
+      var tableList = employee()
+      this.tableList = deleteElementById(tableList, 'multistage')
+      var usageArr = deleteElementById(tableList, 'multistage')
+      var usageArr1 = deleteElementById(usageArr, 'iceRaftRecord.status')
+      this.usageLogList = deleteElementById(usageArr1, 'action')
+    } else {
+      var tableList = employee()
+      this.tableList = tableList
+      var usageArr1 = deleteElementById(tableList, 'iceRaftRecord.status')
+      this.usageLogList = deleteElementById(usageArr1, 'action')
+    }
+    if (!this.iceColdFlag) {
+      var historyList = historyRecord()
+      this.historyList = deleteElementById(historyList, 'multistage')
+    } else {
+      this.historyList = historyRecord()
+    }
 
-        innerVisible: false,
-        editRuleList: {},
-        editRuleForm: {
-          code: '',
-          status: '',
-          inStorageTime: '',
-          outStorageTime: '',
-          freezeClaim: '',
-          iceLockerId: '',
-          coolerBoxId: '',
-        },
-        iceRaftCode: '',
-        coldCupboard: {
-          field: 'iceLockerId',
-          label: '冷冻柜',
-          placeholder: '请选择冷冻柜',
-          type: 'searchSelect',
-          colWidth: 24,
-          multiple: false,
-          rules: [{
-            required: true,
-            message: '请选择冷冻柜',
-            trigger: 'blur'
-          }],
-          options: [],
-        },
-        thermostat: {
-          field: 'coolerBoxId',
-          label: '保温箱',
-          placeholder: '请选择保温箱',
-          type: 'searchSelect',
-          colWidth: 24,
-          rules: [{
-            required: true,
-            message: '请选择保温箱',
-            trigger: 'blur'
-          }],
-          options: [],
-        },
-        // 是否释冷
-        iceColdFlag: false,
+    function deleteElementById(arr, id) {
+      return arr.filter((item) => item.field !== id);
+    }
+    this.getList()
+    this.getFreezer()
+    this.getIncubator()
+  },
+  methods: {
+    // 搜索
+    searchProtocol(value) {
+      this.Pagination.PageIndex = 1
+      this.searchValue = value
+      this.getList()
+    },
+    // 获取冰排列表
+    getList() {
+      var params = {
+        page: this.Pagination.PageIndex,
+        pageSize: this.Pagination.PageSize,
+        ...this.searchValue
+      }
+      getIceRaftNewest(params).then(res => {
+        if (res.code == 200) {
+          this.tableData = res.data.list
+          this.Total = res.data.count
+          this.timer = setTimeout(() => {
+            this.getList();
+            clearInterval(this.timer); // 清除定时器
+            this.timer = null;
+          }, 60000)
+        }
+      })
+    },
+    // 弹窗表单添加
+    handleAdd() {
+      let flag = this.$refs['childRules'].validateForm();
+      if (flag) {
+        const params = {
+          ...this.ruleForm,
+        }
+        if (this.operationType == 'come') {
+          delete params.coolerBoxId
+          params.iceLockerId = Number(params.iceLockerId)
+          params.freezeClaim = Number(params.freezeClaim)
+          iceraftIn(params).then(res => {
+            if (res.code == 200) {
+              this.$message({
+                message: res.msg,
+                type: 'success'
+              });
+              this.staffDialogVisible = false
+              this.getList()
+            }
+          })
+        } else if (this.operationType == 'goOut') {
+          delete params.iceLockerId
+          delete params.freezeClaim
+          params.coolerBoxId = Number(params.coolerBoxId)
+          iceraftOut(params).then(res => {
+            if (res.code == 200) {
+              this.$message({
+                message: res.msg,
+                type: 'success'
+              });
+              this.staffDialogVisible = false
+              this.getList()
+            }
+          })
+        }
+      } else {
+        this.$message.error('表单信息不完整,请继续填写完整');
+      }
+    },
+    openModel(type) {
+      this.operationType = type
+      this.page = 1
+      if (type == 'come') {
+        this.staffDialogVisible = true
+        this.staffTitle = '入库'
+        this.formRuleList = iceRaftRules()
+        this.coldCupboard.options = []
+        this.formRuleList.unshift(this.coldCupboard)
+        this.limitNo = true
+        this.getFreezer()
+      } else if (type == 'goOut') {
+        this.staffDialogVisible = true
+        this.staffTitle = '出库'
+        this.formRuleList = freezerRules()
+        this.thermostat.options = []
+        this.formRuleList.unshift(this.thermostat)
+        this.limitNoil = true
+        this.getIncubator()
+      } else if (type == 'export') {
+        this.iceTracingVisible = true
+        this.incubatorData = []
+        this.limitNoil = true
+        this.getIncubator()
+        this.getraftRecording()
       }
+      this.$forceUpdate()
     },
-    beforeDestroy() {
-      console.log(2)
-      clearInterval(this.timer); // 清除定时器
-      this.timer = null;
+    // 选择保温箱
+    changeSelect(value) {
+      this.getraftRecording()
     },
-    mounted() {
-      this.getList()
-      this.getFreezer()
-      this.getIncubator()
+    // 时间选择搜索
+    timeChange(event) {
+      this.getraftRecording()
     },
-    methods: {
-      // 搜索
-      searchProtocol(value) {
-        this.Pagination.PageIndex = 1
-        this.searchValue = value
-        this.getList()
-      },
-      // 获取冰排列表
-      getList() {
-        var params = {
-          page: this.Pagination.PageIndex,
-          pageSize: this.Pagination.PageSize,
-          ...this.searchValue
+    // 重置
+    searchReset() {
+      this.$refs.userRecordRuleForm.resetFields();
+    },
+    // 输入冰排编号搜索
+    codeInput(value){
+      this.getraftRecording()
+    },
+    // 冰排使用记录
+    getraftRecording() {
+      var params = {
+        page: this.usageLogPagination.PageIndex,
+        pageSize: this.usageLogPagination.PageSize,
+        code: this.formInline.code,
+        coolerBoxId: Number(this.formInline.coolerBoxId),
+        startTime: this.formInline.dateService[0],
+        endTime: this.formInline.dateService[1],
+      }
+      getRecording(params).then(res => {
+        if (res.code == 200) {
+          this.usageLogTotal = res.data.count
+          this.usageLogData = res.data.list
         }
-        getIceRaftNewest(params).then(res => {
-          if (res.code == 200) {
-            this.tableData = res.data.list
-            this.Total = res.data.count
-            this.timer = setTimeout(() => {
-              this.getList();
-              clearInterval(this.timer); // 清除定时器
-              this.timer = null;
-            }, 60000)
-          }
-        })
-      },
-      // 弹窗表单添加
-      handleAdd() {
-        let flag = this.$refs['childRules'].validateForm();
-        if (flag) {
-          const params = {
-            ...this.ruleForm,
-          }
-          if (this.operationType == 'come') {
-            delete params.coolerBoxId
-            params.iceLockerId = Number(params.iceLockerId)
-            params.freezeClaim = Number(params.freezeClaim)
-            iceraftIn(params).then(res => {
-              if (res.code == 200) {
-                this.$message({
-                  message: res.msg,
-                  type: 'success'
-                });
-                this.staffDialogVisible = false
-                this.getList()
-              }
-            })
-          } else if (this.operationType == 'goOut') {
-            delete params.iceLockerId
-            delete params.freezeClaim
-            params.coolerBoxId = Number(params.coolerBoxId)
-            iceraftOut(params).then(res => {
-              if (res.code == 200) {
-                this.$message({
-                  message: res.msg,
-                  type: 'success'
-                });
-                this.staffDialogVisible = false
-                this.getList()
-              }
-            })
+      })
+    },
+    // 导出冰排使用记录
+    download() {
+      this.exportFlag = true
+      getExportExecl({
+        code: this.formInline.code,
+        coolerBoxId: Number(this.formInline.coolerBoxId),
+        startTime: this.formInline.dateService[0],
+        endTime: this.formInline.dateService[1],
+      }).then(response => {
+        if (response.fileName) {
+          this.pdfDialogVisible = false
+          let fileName = decodeURI(response.fileName);
+          if (window.navigator.msSaveOrOpenBlob) {
+            navigator.msSaveBlob(new Blob([response.data]), fileName);
+          } else {
+            let url = window.URL.createObjectURL(new Blob([response.data]));
+            let link = document.createElement('a');
+            link.style.display = 'none';
+            link.href = url;
+            link.setAttribute('download', fileName);
+            document.body.appendChild(link);
+            link.click();
           }
         } else {
-          this.$message.error('表单信息不完整,请继续填写完整');
+          this.$message.error('未获取到文件名,导出失败');
         }
-      },
-      openModel(type) {
-        this.operationType = type
-        this.staffDialogVisible = true
-        this.page = 1
-        if (type == 'come') {
-          this.staffTitle = '入库'
-          this.formRuleList = iceRaftRules()
-          this.coldCupboard.options = []
-          this.formRuleList.unshift(this.coldCupboard)
-          this.limitNo = true
+        this.exportFlag = false
+      }).catch(() => {
+        this.exportFlag = false
+      })
+    },
+    // 重置冷冻柜、保温箱
+    resetSelect() {
+      this.page = 1
+      this.limitNo = true
+      this.limitNoil = true
+      this.staffName = ''
+    },
+    // 触底事件
+    handleScroll(type) {
+      if (this.operationType == 'come') {
+        if (this.limitNo) {
           this.getFreezer()
-        } else if (type == 'goOut') {
-          this.staffTitle = '出库'
-          this.formRuleList = freezerRules()
-          this.thermostat.options = []
-          this.formRuleList.unshift(this.thermostat)
-          this.limitNoil = true
+        }
+      } else if (this.operationType == 'goOut') {
+        if (this.limitNoil) {
           this.getIncubator()
         }
-        this.$forceUpdate()
-      },
-      // 重置冷冻柜、保温箱
-      resetSelect() {
-        this.page = 1
-        this.limitNo = true
-        this.limitNoil = true
-        this.staffName = ''
-      },
-      // 触底事件
-      handleScroll(type) {
-        if (this.operationType == 'come') {
+      } else if (this.operationType == 'edit') {
+        if (this.deposit) {
           if (this.limitNo) {
             this.getFreezer()
           }
-        } else if (this.operationType == 'goOut') {
+        } else {
           if (this.limitNoil) {
             this.getIncubator()
           }
-        } else if (this.operationType == 'edit') {
-          if (this.deposit) {
-            if (this.limitNo) {
-              this.getFreezer()
-            }
-          } else {
-            if (this.limitNoil) {
-              this.getIncubator()
-            }
+        }
+      } else {
+        if (type == 'iceLockerId' && this.limitNo) {
+          this.getFreezer()
+        } else if (type == 'coolerBoxId' && this.limitNoil) {
+          this.getIncubator()
+        }
+      }
+    },
+    // 搜索
+    remoteMethod(value) {
+      this.resetSelect()
+      this.staffName = value
+      if (this.operationType == 'edit') {
+        this.editRuleList.forEach(item => {
+          if (item.type == 'searchSelect') {
+            item.options = []
           }
+        })
+        if (this.deposit) {
+          this.getFreezer()
         } else {
-          if (type == 'iceLockerId' && this.limitNo) {
-            this.getFreezer()
-          } else if (type == 'coolerBoxId' && this.limitNoil) {
-            this.getIncubator()
-          }
+          this.getIncubator()
         }
-      },
-      // 搜索
-      remoteMethod(value) {
-        this.resetSelect()
-        this.staffName = value
-        if (this.operationType == 'edit') {
-          this.editRuleList.forEach(item => {
+      } else {
+        if (this.operationType == 'come') {
+          this.formRuleList.forEach(item => {
             if (item.type == 'searchSelect') {
               item.options = []
             }
           })
-          if (this.deposit) {
-            this.getFreezer()
-          } else {
-            this.getIncubator()
-          }
-        } else {
-          if (this.operationType == 'come') {
-            this.formRuleList.forEach(item => {
-              if (item.type == 'searchSelect') {
-                item.options = []
-              }
-            })
-            this.getFreezer()
-          } else if (this.operationType == 'goOut') {
-            this.getIncubator()
-          }
-        }
-      },
-      // 获取冷冻柜列表
-      getFreezer() {
-        let arrList = []
-        let params = {
-          page: this.page,
-          pageSize: 10,
-          status: '2',
-          name: this.staffName,
+          this.getFreezer()
+        } else if (this.operationType == 'goOut') {
+          this.getIncubator()
         }
-        getIcelocker(params).then(res => {
-          if (res.code == 200) {
-            let arr = res.data.list
-            let arrList = []
-            arr.forEach(item1 => {
-              var arrData = {
-                label: null,
-                value: null,
-              }
-              arrData.label = item1.name
-              arrData.value = item1.id
-              arrList.push(arrData)
-            })
-            if (this.limitNo == true) {
-              if (this.operationType != '') {
-                if (this.operationType == 'come' || this.operationType == 'goOut') {
-                  this.formRuleList.forEach(item => {
-                    if (item.type == 'searchSelect') {
-                      item.options = item.options.concat(arrList)
-                    }
-                  })
-                } else if (this.operationType == 'edit') {
-                  this.editRuleList.forEach(item => {
-                    if (item.type == 'searchSelect') {
-                      item.options = item.options.concat(arrList)
-                    }
-                  })
-                }
-              } else {
-                this.formList.forEach(item => {
-                  if (item.field == 'iceLockerId') {
+      }
+    },
+    // 获取冷冻柜列表
+    getFreezer() {
+      let arrList = []
+      let params = {
+        page: this.page,
+        pageSize: 10,
+        status: '2',
+        name: this.staffName,
+      }
+      getIcelocker(params).then(res => {
+        if (res.code == 200) {
+          let arr = res.data.list
+          let arrList = []
+          arr.forEach(item1 => {
+            var arrData = {
+              label: null,
+              value: null,
+            }
+            arrData.label = item1.name
+            arrData.value = item1.id
+            arrList.push(arrData)
+          })
+          if (this.limitNo == true) {
+            if (this.operationType != '') {
+              if (this.operationType == 'come' || this.operationType == 'goOut') {
+                this.formRuleList.forEach(item => {
+                  if (item.type == 'searchSelect') {
+                    item.options = item.options.concat(arrList)
+                  }
+                })
+              } else if (this.operationType == 'edit') {
+                this.editRuleList.forEach(item => {
+                  if (item.type == 'searchSelect') {
                     item.options = item.options.concat(arrList)
                   }
                 })
               }
-            }
-            if (arrList.length >= 10) {
-              this.page = ++this.page;
             } else {
-              // 已经没数据了 不需要增加数据
-              this.limitNo = false;
+              this.formList.forEach(item => {
+                if (item.field == 'iceLockerId') {
+                  item.options = item.options.concat(arrList)
+                }
+              })
             }
           }
-        })
-      },
-      // 获取保温箱列表
-      getIncubator() {
-        let arrList = []
-        let params = {
-          page: this.page,
-          pageSize: 10,
-          status: '2',
-          name: this.staffName,
+          if (arrList.length >= 10) {
+            this.page = ++this.page;
+          } else {
+            // 已经没数据了 不需要增加数据
+            this.limitNo = false;
+          }
         }
-        getCoolerBox(params).then(res => {
-          if (res.code == 200) {
-            let arr = res.data.list
-            let arrList = []
-            arr.forEach(item1 => {
-              var arrData = {
-                label: null,
-                value: null,
-              }
-              arrData.label = item1.name
-              arrData.value = item1.id
-              arrList.push(arrData)
-            })
-            if (this.limitNoil == true) {
-              if (this.operationType != '') {
-                if (this.operationType == 'come' || this.operationType == 'goOut') {
-                  this.formRuleList.forEach(item => {
-                    if (item.type == 'searchSelect') {
-                      item.options = item.options.concat(arrList)
-                    }
-                  })
-                } else if (this.operationType == 'edit') {
-                  this.editRuleList.forEach(item => {
-                    if (item.type == 'searchSelect') {
-                      item.options = item.options.concat(arrList)
-                    }
-                  })
-                }
-              } else {
-                this.formList.forEach(item => {
-                  if (item.field == 'coolerBoxId') {
+      })
+    },
+    // 获取保温箱列表
+    getIncubator() {
+      let params = {
+        page: this.page,
+        pageSize: 10,
+        status: '2',
+        name: this.staffName,
+      }
+      getCoolerBox(params).then(res => {
+        if (res.code == 200) {
+          let arr = res.data.list
+          let arrList = []
+          arr.forEach(item1 => {
+            var arrData = {
+              label: null,
+              value: null,
+            }
+            arrData.label = item1.name
+            arrData.value = item1.id
+            arrList.push(arrData)
+          })
+          if (this.limitNoil == true) {
+            if (this.operationType != '') {
+              if (this.operationType == 'come' || this.operationType == 'goOut') {
+                this.formRuleList.forEach(item => {
+                  if (item.type == 'searchSelect') {
+                    item.options = item.options.concat(arrList)
+                  }
+                })
+              } else if (this.operationType == 'edit') {
+                this.editRuleList.forEach(item => {
+                  if (item.type == 'searchSelect') {
                     item.options = item.options.concat(arrList)
                   }
                 })
+              } else if (this.operationType == 'export') {
+                this.incubatorData = this.incubatorData.concat(arrList)
               }
-              // this.thermostat.options = this.thermostat.options.concat(arrList)
-            }
-            if (arrList.length >= 10) {
-              this.page = ++this.page;
             } else {
-              // 已经没数据了 不需要增加数据
-              this.limitNoil = false;
+              this.formList.forEach(item => {
+                if (item.field == 'coolerBoxId') {
+                  item.options = item.options.concat(arrList)
+                }
+              })
+              this.incubatorData = this.incubatorData.concat(arrList)
             }
+            // this.thermostat.options = this.thermostat.options.concat(arrList)
           }
-        })
-      },
-      // 冰排列表
-      buttonData(row, type) {
-        this.operationType = type
-        this.iceRaftId = row.id
-        this.iceRaftCode = row.code
-        if (type == 'logs') {
-          this.historyVisible = true
-          this.getHistory()
-        }
-      },
-      // 获取历史记录列表
-      getHistory(iceRaftId) {
-        var params = {
-          page: this.historyPagination.PageIndex,
-          pageSize: this.historyPagination.PageSize,
-          iceRaftId: this.iceRaftId,
-          // ...this.searchValue
-        }
-        getIceRaftRecord(params).then(res => {
-          if (res.code == 200) {
-            this.historyData = res.data.list
-            this.historyTotal = res.data.count
-          }
-        })
-      },
-      // 历史记录操作
-      historyButton(row, type) {
-        this.operationType = type
-        this.limitNo = true
-        if (type == 'edit') {
-          this.innerVisible = true
-          this.page = 1
-          this.editRuleList = editRules()
-          if (row.outStorageTime == '') {
-            this.deposit = true
-            this.getFreezer()
-            this.editRuleList.push(this.coldCupboard)
-            // 冷冻柜
-            this.editRuleForm.iceLockerId = String(row.iceLockerId)
+          if (arrList.length >= 10) {
+            this.page = ++this.page;
           } else {
-            this.deposit = false
-            this.getIncubator()
-            this.editRuleList.push(this.thermostat)
-            // 保温箱
-            this.editRuleForm.coolerBoxId = String(row.coolerBoxId)
+            // 已经没数据了 不需要增加数据
+            this.limitNoil = false;
           }
-          this.editRuleForm.id = row.id
-          this.editRuleForm.code = this.iceRaftCode
-          this.editRuleForm.status = row.status
-          this.editRuleForm.inStorageTime = row.inStorageTime
-          this.editRuleForm.outStorageTime = row.outStorageTime
-          this.editRuleForm.freezeClaim = row.freezeClaim
-          if (row.status == '3') {
-            this.editRuleList.forEach(item => {
-              if (item.field == 'freezeClaim') {
-                item.disabled = true
-              }
-            })
-          }
-        } else if (type == 'del') {
-          this.delHistory(row.id)
         }
-      },
-      // 编辑历史记录提交
-      submit() {
-        let flag = this.$refs['editRules'].validateForm();
-        if (flag) {
-          this.$confirm('确定修改该冰排信息吗, 是否继续?', '提示', {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          }).then(() => {
-            let param = {
-              id: '',
-              iceLockerId: '',
-              coolerBoxId: '',
-              freezeClaim: '',
-            }
-            param.id = this.editRuleForm.id
-            param.iceLockerId = Number(this.editRuleForm.iceLockerId)
-            param.coolerBoxId = Number(this.editRuleForm.coolerBoxId)
-            param.freezeClaim = Number(this.editRuleForm.freezeClaim)
-            if (this.editRuleForm.outStorageTime == '') {
-              delete param.coolerBoxId
-            } else {
-              delete param.iceLockerId
-            }
-            putIceRaftRecord(param).then(res => {
-              if (res.code == 200) {
-                this.innerVisible = false
-                this.$message({
-                  type: 'success',
-                  message: res.msg
-                });
-                this.getHistory()
-              }
-            })
-          }).catch(() => {
-            // console.log('取消修改')
-          });
+      })
+    },
+    // 冰排列表
+    buttonData(row, type) {
+      this.operationType = type
+      this.iceRaftId = row.id
+      this.iceRaftCode = row.code
+      if (type == 'logs') {
+        this.historyVisible = true
+        this.getHistory()
+      }
+    },
+    // 获取历史记录列表
+    getHistory(iceRaftId) {
+      var params = {
+        page: this.historyPagination.PageIndex,
+        pageSize: this.historyPagination.PageSize,
+        iceRaftId: this.iceRaftId,
+        // ...this.searchValue
+      }
+      getIceRaftRecord(params).then(res => {
+        if (res.code == 200) {
+          this.historyData = res.data.list
+          this.historyTotal = res.data.count
+        }
+      })
+    },
+    // 历史记录操作
+    historyButton(row, type) {
+      this.operationType = type
+      this.limitNo = true
+      if (type == 'edit') {
+        this.innerVisible = true
+        this.page = 1
+        this.editRuleList = editRules()
+        if (row.outStorageTime == '') {
+          this.deposit = true
+          this.getFreezer()
+          this.editRuleList.push(this.coldCupboard)
+          // 冷冻柜
+          this.editRuleForm.iceLockerId = String(row.iceLockerId)
         } else {
-          this.$message.error('表单信息不完整,请继续填写完整');
+          this.deposit = false
+          this.getIncubator()
+          this.editRuleList.push(this.thermostat)
+          // 保温箱
+          this.editRuleForm.coolerBoxId = String(row.coolerBoxId)
         }
-      },
-      // 删除历史记录
-      delHistory(id) {
-        this.$confirm('确定删除该冰排信息吗, 是否继续?', '提示', {
+        this.editRuleForm.id = row.id
+        this.editRuleForm.code = this.iceRaftCode
+        this.editRuleForm.status = row.status
+        this.editRuleForm.inStorageTime = row.inStorageTime
+        this.editRuleForm.outStorageTime = row.outStorageTime
+        this.editRuleForm.freezeClaim = row.freezeClaim
+        if (row.status == '3') {
+          this.editRuleList.forEach(item => {
+            if (item.field == 'freezeClaim') {
+              item.disabled = true
+            }
+          })
+        }
+      } else if (type == 'del') {
+        this.delHistory(row.id)
+      }
+    },
+    // 编辑历史记录提交
+    submit() {
+      let flag = this.$refs['editRules'].validateForm();
+      if (flag) {
+        this.$confirm('确定修改该冰排信息吗, 是否继续?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
-          delIceRaftRecord({
-            id: id
-          }).then(res => {
+          let param = {
+            id: '',
+            iceLockerId: '',
+            coolerBoxId: '',
+            freezeClaim: '',
+          }
+          param.id = this.editRuleForm.id
+          param.iceLockerId = Number(this.editRuleForm.iceLockerId)
+          param.coolerBoxId = Number(this.editRuleForm.coolerBoxId)
+          param.freezeClaim = Number(this.editRuleForm.freezeClaim)
+          if (this.editRuleForm.outStorageTime == '') {
+            delete param.coolerBoxId
+          } else {
+            delete param.iceLockerId
+          }
+          putIceRaftRecord(param).then(res => {
             if (res.code == 200) {
+              this.innerVisible = false
               this.$message({
-                message: '删除成功,请重新入库该冰排!',
-                type: 'warning'
+                type: 'success',
+                message: res.msg
               });
-              const precisePage = Math.ceil((this.historyTotal - 1) / this.historyPagination.PageSize)
-              this.historyPagination.PageIndex = this.historyPagination.PageIndex > precisePage ? precisePage :
-                this
-                .historyPagination.PageIndex
-              this.historyPagination.PageIndex = this.historyPagination.PageIndex < 1 ? 1 : this
-                .historyPagination.PageIndex
               this.getHistory()
-              this.getList()
             }
           })
         }).catch(() => {
-          // console.log('已取消删除')
+          // console.log('取消修改')
         });
-      },
-      changeSize(val) {
-        this.Pagination.PageSize = val
-        this.getList()
-      },
-      changeCurrent(val) {
-        this.Pagination.PageIndex = val
-        this.getList()
-      },
-      // 历史记录分页
-      historySize(val) {
-        this.historyPagination.PageSize = val
-        this.getHistory()
-      },
-      historyCurrent(val) {
-        this.historyPagination.PageIndex = val
-        this.getHistory()
-      },
-      // 关闭历史记录
-      closeHistory() {
-        this.historyPagination.PageIndex = 1
-        this.historyVisible = false
-        this.getList()
-      },
-      // 嵌套弹窗
-      closeNested() {
-        this.staffName = ''
-        this.editRuleList.forEach(item => {
-          if (item.type == 'searchSelect') {
-            item.options = []
+      } else {
+        this.$message.error('表单信息不完整,请继续填写完整');
+      }
+    },
+    // 删除历史记录
+    delHistory(id) {
+      this.$confirm('确定删除该冰排信息吗, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        delIceRaftRecord({
+          id: id
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message({
+              message: '删除成功,请重新入库该冰排!',
+              type: 'warning'
+            });
+            const precisePage = Math.ceil((this.historyTotal - 1) / this.historyPagination.PageSize)
+            this.historyPagination.PageIndex = this.historyPagination.PageIndex > precisePage ? precisePage :
+              this
+                .historyPagination.PageIndex
+            this.historyPagination.PageIndex = this.historyPagination.PageIndex < 1 ? 1 : this
+              .historyPagination.PageIndex
+            this.getHistory()
+            this.getList()
           }
         })
-      },
-      // 清空表单
-      closeDialog() {
-        this.resetSelect()
-        this.ruleForm.code = []
-        this.$refs.childRules.resetCheck();
-        this.coldCupboard.options = []
-        this.thermostat.options = []
-      },
+      }).catch(() => {
+        // console.log('已取消删除')
+      });
+    },
+    changeSize(val) {
+      this.Pagination.PageSize = val
+      this.getList()
+    },
+    changeCurrent(val) {
+      this.Pagination.PageIndex = val
+      this.getList()
+    },
+    // 历史记录分页
+    historySize(val) {
+      this.historyPagination.PageSize = val
+      this.getHistory()
+    },
+    historyCurrent(val) {
+      this.historyPagination.PageIndex = val
+      this.getHistory()
+    },
+    // 冰排使用记录分页
+    usageLogSize(val) {
+      this.usageLogPagination.PageSize = val
+      this.getraftRecording()
+    },
+    usageLogCurrent(val) {
+      this.usageLogPagination.PageIndex = val
+      this.getraftRecording()
+    },
+    // 关闭历史记录
+    closeHistory() {
+      this.historyPagination.PageIndex = 1
+      this.historyVisible = false
+      this.getList()
+    },
+    // 嵌套弹窗
+    closeNested() {
+      this.staffName = ''
+      this.editRuleList.forEach(item => {
+        if (item.type == 'searchSelect') {
+          item.options = []
+        }
+      })
+    },
+    // 清空表单
+    closeDialog() {
+      this.resetSelect()
+      this.ruleForm.code = []
+      this.$refs.childRules.resetCheck();
+      this.coldCupboard.options = []
+      this.thermostat.options = []
+    },
+    iceTracingDialog() {
+      this.page = 2
+      this.limitNoil = true
+      this.operationType = ''
     }
   }
+}
 </script>
 
 <style lang="scss" scoped>
-  .card_history ::v-deep .el-dialog__body {
-    padding: 0px 20px !important;
-  }
+.card_history ::v-deep .el-dialog__body {
+  padding: 0px 20px !important;
+}
+
+.card_iceTracing ::v-deep .el-dialog__body {
+  padding: 0px 10px !important;
+}
 </style>

+ 7 - 5
src/views/IceCreamFreezer/freezer.js

@@ -1,5 +1,6 @@
 import {
-  iceraftStatus
+  iceraftStatus,
+  freezingRequirement
 } from '@/assets/js/blockSort'
 export const employee = () => {
   return [{
@@ -73,7 +74,7 @@ export const employeeCold = () => {
     label: '释冷温度',
     align: 'center',
   }, {
-    field: 'suitableForColdTime',
+    field: 'iceColdAddress',
     label: '释冷地点',
     align: 'center',
   }, {
@@ -187,9 +188,10 @@ export const formRulesCold = () => {
     field: 'freezeClaim',
     label: '冷冻要求',
     placeholder: '请输入冷冻时间',
-    type: 'input',
+    type: 'select',
     colWidth: 24,
-    unit: '小时',
+    multiple:true,
+    options: freezingRequirement(),
     rules: [{
       required: true,
       message: '请输入冷冻时间',
@@ -208,7 +210,7 @@ export const formRulesCold = () => {
       trigger: 'blur'
     }]
   }, {
-    field: 'suitableForColdTime',
+    field: 'iceColdAddress',
     label: '释冷地点',
     placeholder: '请输入释冷地点',
     type: 'input',

+ 25 - 33
src/views/IceCreamFreezer/iceRaft.js

@@ -25,35 +25,23 @@ export const employee = () => {
     align: 'center',
   }, {
     field: 'multistage',
-    label: '保温箱温湿度记录',
-    children: [{
-      field: 'reCheck.nickName',
-      label: '开始时间',
-      align: 'center',
-    }, {
-      field: 'reCheck.phone',
-      label: '结束时间',
-      align: 'center',
-    }, ]
-  }, {
-    field: 'multistage',
     label: '冰排释冷',
     children: [{
       field: 'iceRaftRecord.outStorageTime',
-      label: '开始时间',
+      label: '释冷日期',
       align: 'center',
     }, {
       field: 'iceRaftRecord.endForColdTime',
-      label: '结束时间',
-      align: 'center',
-    }, {
-      field: 'suitableForColdTime',
       label: '释冷时间',
       align: 'center',
     }, {
       field: 'iceRaftRecord.suitableForCold',
       label: '释冷温度',
       align: 'center',
+    }, {
+      field: 'suitableForColdTime',
+      label: '释冷地点',
+      align: 'center',
     }]
   }, {
     field: 'location',
@@ -63,11 +51,23 @@ export const employee = () => {
     field: 'freezeClaim',
     label: '冷冻要求',
     align: 'center',
-  }, {
+  },{
     field: 'freezeDuration',
     label: '冷冻时间',
     align: 'center',
+  },{
+    field: 'freezeClaim',
+    label: '使用日期',
+    align: 'center',
   }, {
+    field: 'freezeClaim',
+    label: '使用时间',
+    align: 'center',
+  }, {
+    field: 'freezeClaim',
+    label: '使用人员',
+    align: 'center',
+  },  {
     field: 'action',
     label: '操作',
     align: 'center',
@@ -101,32 +101,24 @@ export const historyRecord = () => {
     align: 'center',
   }, {
     field: 'multistage',
-    label: '保温箱温湿度记录',
+    label: '冰排释冷',
     children: [{
       field: 'reCheck.nickName',
-      label: '开始时间',
+      label: '释冷日期',
       align: 'center',
     }, {
       field: 'reCheck.phone',
-      label: '结束时间',
-      align: 'center',
-    }, ]
-  }, {
-    field: 'multistage',
-    label: '冰排释冷',
-    children: [{
-      field: 'reCheck.nickName',
-      label: '开始时间',
+      label: '释冷时间',
       align: 'center',
     }, {
       field: 'reCheck.phone',
-      label: '结束时间',
+      label: '释冷温度',
       align: 'center',
     }, {
-      field: 'reCheck.phone',
-      label: '释冷时间',
+      field: 'location',
+      label: '释冷地点',
       align: 'center',
-    }, ]
+    }]
   }, {
     field: 'location',
     label: '所在位置',

+ 41 - 11
src/views/OrderManagement/uncertain.js

@@ -76,6 +76,33 @@ export const employee = () => {
 }
 export const formRules = () => {
   return [{
+    field: 'allocation',
+    label: '二次分配',
+    placeholder: '是否二次分配',
+    type: 'switch',
+    colWidth: 6,
+    rules: [{
+      required: true,
+      message: '是否二次分配',
+      trigger: 'blur'
+    }]
+  }, {
+    field: 'allocation',
+    label: '扫码药品条形码',
+    placeholder: '请扫码药品条形码',
+    type: 'tracingCode',
+    colWidth: 18,
+    labelWidth: '125px',
+    rules: [{
+      required: true,
+      message: '请扫码药品条形码',
+      trigger: 'blur'
+    }]
+  }, {
+    field: 'divider',
+    label: '订购商品信息',
+    colWidth: 24,
+  }, {
     field: 'tamperProofLabelImg',
     label: '防拆标签图片',
     placeholder: '请上传防拆标签图片',
@@ -203,7 +230,7 @@ function validatePassword(rule, value, callback) {
 
 export const signList = () => {
   return [{
-    field: 'storeId',
+    field: 'deptId',
     type: 'searchSelect',
     label: '门店',
     placeholder: '请选择门店',
@@ -215,13 +242,15 @@ export const signList = () => {
       trigger: 'blur,change'
     }],
     options: [],
-  }, {
-    field: 'rejectionReason',
-    label: '原因',
-    placeholder: '请输入原因',
-    type: 'textarea',
-    colWidth: 24,
-  }]
+  },
+  // {
+  //   field: 'rejectionReason',
+  //   label: '原因',
+  //   placeholder: '请输入原因',
+  //   type: 'textarea',
+  //   colWidth: 24,
+  // },
+  ]
 }
 export const auditList = () => {
   return [{
@@ -500,12 +529,13 @@ export const consignmentList = () => {
   return [{
     field: 'orderNo',
     label: '订单号',
-    placeholder: '请输入订单号',
+    placeholder: '点击按钮生成订单号',
     type: 'input',
-    colWidth: 24,
+    colWidth: 15,
+    disabled: true,
     rules: [{
       required: true,
-      message: '请输入订单号',
+      message: '点击按钮生成订单号',
       trigger: 'blur'
     }]
   }]

+ 19 - 10
src/views/OrderManagement/uncertainOrder.vue

@@ -78,7 +78,8 @@
     getWaybill,
     addWaybill,
     putWaybill,
-    putUpdateStatus
+    putUpdateStatus,
+    putturnarounds
   } from '@/api/waybill'
   import {
     getAddress
@@ -249,8 +250,8 @@
         signDialogVisible: false,
         signRuleList: signList(),
         signRuleForm: {
-          status: '',
-          rejectionReason: '',
+          deptId: '',
+          // rejectionReason: '',
         },
         signConfirmLoading: false,
       }
@@ -366,7 +367,8 @@
       async handleAdd() {
         let senderFlag = this.$refs['userRules'].validateForm();
         let recipientsFlag = this.$refs['recipients'].validateForm();
-        if (senderFlag && recipientsFlag) {
+        let childRulesFlag = this.$refs['childRules'].validateForm();
+        if (senderFlag && recipientsFlag && childRulesFlag) {
           this.confirmLoading = true
           var params = {
             consigneeAddressName: this.recipientsForm.name,
@@ -547,15 +549,22 @@
           this.signConfirmLoading = true
           let params = {
             waybillNo: this.waybillNo,
-            ...this.signRuleForm,
+            deptId: Number(this.signRuleForm.deptId),
           }
-          console.log(params, 'ad')
+          putturnarounds(params).then(res => {
+            if (res.code == 200) {
+              this.signDialogVisible = false
+              this.getList()
+            }
+            this.signConfirmLoading = false
+          }).catch(() => {
+            this.signConfirmLoading = false
+          })
         } else {
           this.$message.error('表单信息不完整,请继续填写完整');
         }
       },
       remoteSearch(value, type) {
-        console.log(value, type, 234)
         this.delivererName = value
         if (type == 'deliveryId') {
           this.personnelList.forEach(item => {
@@ -571,9 +580,9 @@
             }
           })
           this.getReviewerList()
-        } else if (type == 'storeId') {
+        } else if (type == 'deptId') {
           this.signRuleList.forEach(item => {
-            if (item.field == 'storeId') {
+            if (item.field == 'deptId') {
               item.options = []
             }
           })
@@ -659,7 +668,7 @@
               arrList.push(arrData)
             })
             this.signRuleList.forEach(item => {
-              if (item.field == 'storeId') {
+              if (item.field == 'deptId') {
                 item.options = item.options.concat(arrList)
               }
             })

+ 26 - 0
src/views/common/Base.vue

@@ -175,6 +175,32 @@
     overflow-x: hidden;
   }
 
+  /* 整个滚动条 */
+  .card_menu::-webkit-scrollbar {
+    width: 4px;
+    /* 对于垂直滚动条,设置宽度 */
+    height: 4px;
+    /* 对于水平滚动条,设置高度 */
+  }
+
+  /* 滚动条轨道 */
+  .card_menu::-webkit-scrollbar-track {
+    background: #f1f1f1;
+    /* 背景色 */
+  }
+
+  /* 滚动条滑块 */
+  .card_menu::-webkit-scrollbar-thumb {
+    background: #c1c1c1;
+    /* 滑块颜色 */
+  }
+
+  /* 滑块hover效果 */
+  .card_menu::-webkit-scrollbar-thumb:hover {
+    background: #555;
+    /* 滑块hover颜色 */
+  }
+
   .el-menu-vertical-demo {
     border-right: none !important;
   }

+ 624 - 0
src/views/incubator/IncubatorManagement.vue

@@ -0,0 +1,624 @@
+<template>
+  <!-- 保温箱管理 -->
+  <div style="overflow-y: auto;">
+    <actionBar :operateList="operateList" :formList="formList" :ruleForm="searchRuleForm" @openModel="openModel"
+      @searchProtocol="searchProtocol"></actionBar>
+    <div class="card_content">
+      <!-- 表单 -->
+      <tables :tableList="tableList" :tableData="tableData" @buttonData="buttonData"></tables>
+      <!-- 分页 -->
+      <div v-if="Total">
+        <pagination :total="Total" :currentPage="Pagination.PageIndex" @changeSize="changeSize"
+          @changeCurrent="changeCurrent">
+        </pagination>
+      </div>
+    </div>
+    <el-dialog :title="staffTitle" :visible.sync="staffDialogVisible" width="600px" :close-on-click-modal="false"
+      @close="closeDialog">
+      <forms ref="childRules" :formNewList="formRuleList" :ruleForm="ruleForm" labelWidth="110px"></forms>
+      <span slot="footer" class="dialog-footer" v-if="operationType != 'logs'">
+        <el-button plain @click="staffDialogVisible = false">取 消</el-button>
+        <el-button type="primary" :loading="confirmLoading" @click="handleAdd">确 定</el-button>
+      </span>
+    </el-dialog>
+    <div class="management_card">
+      <el-dialog :visible.sync="importDialogVisible" width="600px" :close-on-click-modal="false" @close="closeDialogil">
+        <div class="card_import">
+          <div class="card_incubat">
+            <forms ref="incubatorRules" labelPosition="left" :formNewList="stateRuleList" :ruleForm="stateRuleForm"
+              labelWidth="110px"></forms>
+          </div>
+          <div class="card_search_input">
+            <div class="title_search">名称:</div>
+            <el-input v-model="nameTitle" placeholder="请输入内容" @input="incubatorInput"></el-input>
+          </div>
+          <!-- 表单 -->
+          <tables ref="refIncubator" :tableList="incubatorList" :tableData="incubatorData"></tables>
+          <!-- 分页 -->
+          <div v-if="Total">
+            <pagination :total="Total1" :currentPage="Paginationil.PageIndex" :pager-countnum="5"
+              layout="sizes, prev, pager, next" @changeSize="changeSizeil" @changeCurrent="changeCurrentil">
+            </pagination>
+          </div>
+        </div>
+        <span slot="footer" class="dialog-footer">
+          <el-button plain @click="importDialogVisible = false">取 消</el-button>
+          <el-button type="primary" :loading="incubatorLoading" @click="incubatorAdd">导 入</el-button>
+        </span>
+      </el-dialog>
+    </div>
+
+    <el-dialog top="5vh" :visible.sync="dialogVisible" width="80%" @close="temperatureClose">
+      <template slot="title">
+        <div style="display: flex;align-items: center;">
+          <span style="margin-right: 10px;font-size: 20px;">温湿度记录</span>
+          <el-date-picker v-model="timeQuantum" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange"
+            :picker-options="pickerOptions" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
+            align="center" @change="timeChange">
+          </el-date-picker>
+        </div>
+      </template>
+      <thermography ref="thermo" :waybillNo="waybillNo" :timeData="timeQuantum"></thermography>
+    </el-dialog>
+    <centerControl ref="control"></centerControl>
+  </div>
+</template>
+
+<script>
+import {
+  getCoolerBox,
+  addCoolerBox,
+  putCoolerBox,
+  delCoolerBox,
+  getDevice,
+  addCoolerBoxImport
+} from '@/api/incubator'
+import {
+  getTemperature
+} from '@/api/waybill'
+import actionBar from '@/components/actionBar'
+import tables from '@/components/tables'
+import pagination from '@/components/pagination'
+import forms from '@/components/forms'
+import thermography from '@/components/thermography'
+import centerControl from '@/components/centerControl'
+import {
+  formRules,
+  employee,
+  incubator,
+  historyRecord,
+} from "./incubator.js";
+import {
+  startStatus,
+  iceraftStatus
+} from '@/assets/js/blockSort'
+export default {
+  name: 'IncubatorManagement',
+  components: {
+    actionBar,
+    tables,
+    pagination,
+    forms,
+    thermography,
+    centerControl
+  },
+  data() {
+    return {
+      pickerOptions: {
+        shortcuts: [{
+          text: '最近一周',
+          onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+            picker.$emit('pick', [start, end]);
+          }
+        }, {
+          text: '最近一个月',
+          onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+            picker.$emit('pick', [start, end]);
+          }
+        }, {
+          text: '最近三个月',
+          onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+            picker.$emit('pick', [start, end]);
+          }
+        }]
+      },
+      timeQuantum: [this.getTime(new Date(new Date().toLocaleDateString())), this.getTime(new Date())],
+
+      operateList: [{
+        type: 'add',
+        title: '添加保温箱',
+        icon: 'el-icon-plus',
+      }, {
+        type: 'import',
+        title: '冷链平台导入',
+        icon: 'el-icon-upload',
+      }, {
+        type: 'screen',
+        title: '中控大屏',
+        icon: 'el-icon-position',
+        colour: 'success'
+      }],
+      formList: [{
+        type: 'input',
+        label: '名称',
+        field: 'name',
+        placeholder: '名称',
+      }, {
+        type: 'input',
+        label: 'SN',
+        field: 'sn',
+        placeholder: 'SN',
+      }, {
+        type: 'select',
+        label: '状态',
+        field: 'status',
+        placeholder: '请选择状态',
+        options: iceraftStatus(),
+      }],
+      searchRuleForm: {
+        name: '',
+        sn: '',
+        status: '',
+      },
+      searchValue: {},
+      Pagination: {
+        PageIndex: 1,
+        PageSize: 10,
+      },
+      Total: 0,
+      tableData: [],
+      operationType: '',
+      tableList: [],
+      staffTitle: '添加',
+      staffDialogVisible: false,
+      formRuleList: [],
+      ruleForm: {
+        name: '',
+        sn: '',
+        status: '2',
+      },
+      confirmLoading: false,
+      selectingData: {},
+      importDialogVisible: false,
+      incubatorList: incubator(),
+      incubatorData: [],
+      Total1: 0,
+      Paginationil: {
+        PageIndex: 1,
+        PageSize: 10,
+      },
+      stateRuleData: [{
+        field: 'cold_temperatures',
+        label: '预冷温度(℃)',
+        placeholder: '请输入预冷温度(℃)',
+        type: 'input',
+        colWidth: 24,
+        rules: [{
+          required: true,
+          message: '请输入预冷温度(℃)',
+          trigger: 'blur'
+        }]
+      }, {
+        field: 'cold_spots',
+        label: '预冷地点',
+        placeholder: '请输入预冷地点',
+        type: 'input',
+        colWidth: 24,
+        rules: [{
+          required: true,
+          message: '请输入预冷地点',
+          trigger: 'blur'
+        }]
+      }, {
+        field: 'status',
+        label: '状态',
+        placeholder: '状态',
+        type: 'radio',
+        colWidth: 24,
+        rules: [{
+          required: true,
+          message: '选择状态',
+          trigger: 'change'
+        }],
+        options: startStatus()
+      }],
+      stateRuleList: [],
+      stateRuleForm: {
+        status: '2',
+      },
+      nameTitle: '',
+      incubatorLoading: false,
+
+      timer: null, //定时器名称
+      dialogVisible: false,
+      waybillNo: '',
+      iceTracingVisible: false,
+      value1: '',
+      // 历史记录
+      historyList: historyRecord(),
+      historyData: [],
+      historyTotal: 0,
+      historyPagination: {
+        PageIndex: 1,
+        PageSize: 10,
+      },
+      userList: {},
+    }
+  },
+  beforeDestroy() {
+    clearInterval(this.timer); // 清除定时器
+    this.timer = null;
+  },
+  mounted() {
+    const arr = localStorage.getItem('userList')
+    this.userList = JSON.parse(arr)
+    if (this.userList.dept.isCoolerReleaseCold) {
+      const dataList = formRules();
+      this.formRuleList = dataList;
+      this.stateRuleList = this.stateRuleData
+      this.tableList = employee()
+    } else {
+      const dataList = formRules();
+      const tablearr = employee();
+      this.formRuleList = removePointById(dataList, ['cold_spots', 'cold_temperatures'])
+      this.stateRuleList = removePointById(this.stateRuleData, ['cold_spots', 'cold_temperatures'])
+      this.tableList = removePointById(tablearr, ['cold_spots', 'cold_temperatures'])
+    }
+    function removePointById(arr1, arr2) {
+      for (let i = 0; i < arr2.length; i++) {
+        for (let j = 0; j < arr1.length; j++) {
+          if (arr2[i] == arr1[j].field) {
+            let indexs = arr1.indexOf(arr1[j]);
+            arr1.splice(indexs, 1);
+          }
+        }
+      }
+      return arr1
+    }
+    this.getList()
+  },
+  methods: {
+    download() {
+      getTemperature().then(response => {
+        if (response.fileName) {
+          this.pdfDialogVisible = false
+          //fileName = decodeURIComponent(filename);//对filename进行转码
+          let fileName = decodeURI(response.fileName);
+          if (window.navigator.msSaveOrOpenBlob) {
+            navigator.msSaveBlob(new Blob([response.data]), fileName);
+          } else {
+            let url = window.URL.createObjectURL(new Blob([response.data]));
+            let link = document.createElement('a');
+            link.style.display = 'none';
+            link.href = url;
+            link.setAttribute('download', fileName);
+            document.body.appendChild(link);
+            link.click();
+          }
+        } else {
+          this.$message.error('未获取到文件名');
+        }
+      })
+    },
+    getTime(time) {
+      var date = new Date(time)
+      var y = date.getFullYear()
+      var m = date.getMonth() + 1
+      m = m < 10 ? '0' + m : m
+      var d = date.getDate()
+      d = d < 10 ? '0' + d : d
+      var h = date.getHours()
+      h = h < 10 ? '0' + h : h
+      var minute = date.getMinutes()
+      minute = minute < 10 ? '0' + minute : minute
+      var s = date.getSeconds()
+      s = s < 10 ? '0' + s : s
+      return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + s
+    },
+    // 搜索
+    searchProtocol(value) {
+      this.searchValue = value
+      this.getList()
+    },
+    // 获取保温箱列表
+    getList() {
+      var params = {
+        page: this.Pagination.PageIndex,
+        pageSize: this.Pagination.PageSize,
+        showTemp: true,
+        ...this.searchValue
+      }
+      getCoolerBox(params).then(res => {
+        if (res.code == 200) {
+          this.tableData = res.data.list
+          this.Total = res.data.count
+          this.timer = setTimeout(() => {
+            this.getList();
+            clearInterval(this.timer); // 清除定时器
+            this.timer = null;
+          }, 60000)
+        }
+      })
+    },
+    // 选项赋值
+    optionMatching(value, field) {
+      this.formRuleList.forEach((item, index) => {
+        if (item.field == field) {
+          item.options = value
+        }
+      })
+    },
+    // 弹窗表单添加
+    handleAdd() {
+      let flag = this.$refs['childRules'].validateForm();
+      if (flag) {
+        if (this.operationType == 'add') {
+          this.confirmLoading = true
+          var params = {
+            ...this.ruleForm
+          }
+          addCoolerBox(params).then(res => {
+            if (res.code == 200) {
+              this.$message({
+                message: '操作成功',
+                type: 'success'
+              });
+              this.getList()
+              this.staffDialogVisible = false
+            }
+            this.confirmLoading = false
+          }).catch(() => {
+            this.confirmLoading = false
+          })
+        } else if (this.operationType == 'edit') {
+          this.confirmLoading = true
+          var params = {
+            id: this.selectingData.id,
+            name: this.ruleForm.name,
+            sn: this.ruleForm.sn,
+            status: this.ruleForm.status,
+            cold_spots: this.ruleForm.cold_spots,
+            cold_temperatures: this.ruleForm.cold_temperatures,
+          }
+          putCoolerBox(params).then(res => {
+            if (res.code == 200) {
+              this.$message({
+                message: '操作成功',
+                type: 'success'
+              });
+              this.getList()
+            }
+            this.staffDialogVisible = false
+            this.confirmLoading = false
+          }).catch(() => {
+            this.confirmLoading = false
+          })
+        }
+      } else {
+        this.$message.error('表单信息不完整,请继续填写完整');
+      }
+    },
+    buttonData(row, type) {
+      this.selectingData = row
+      this.operationType = type
+      if (type == 'edit') {
+        this.staffTitle = '编辑'
+        this.staffDialogVisible = true
+        setTimeout(() => {
+          this.$nextTick(() => {
+            this.ruleForm = JSON.parse(JSON.stringify(row))
+          })
+        })
+      } else if (type == 'del') {
+        this.deleteUser(row.id)
+      } else if (type == 'logs') {
+        this.staffTitle = '详情'
+        this.staffDialogVisible = true
+        this.formRuleList.forEach((item, index) => {
+          item.disabled = true
+        })
+        this.ruleForm = JSON.parse(JSON.stringify(row))
+      } else if (type == 'record') {
+        this.dialogVisible = true
+        this.waybillNo = row.sn
+        this.$nextTick(() => {
+          this.$refs.thermo.getProbe()
+        })
+      } else if (type == 'ascend') {
+        console.log(23)
+        this.iceTracingVisible = true
+      }
+    },
+    // 选择时间
+    timeChange() {
+      this.$nextTick(() => {
+        this.$refs.thermo.getTemperature()
+      })
+    },
+    openModel(type) {
+      if (type == 'add') {
+        this.staffTitle = '添加'
+        this.staffDialogVisible = true
+        this.operationType = type
+      } else if (type == 'import') {
+        this.importDialogVisible = true
+        this.getDeviceList()
+      } else if (type == 'screen') {
+        this.$refs.control.controlVisible = true
+        this.$nextTick(() => {
+          setTimeout(() => {
+            this.$refs.control.keyUpSearch()
+            this.$refs.control.getList()
+          }, 100)
+        })
+      }
+    },
+    // 获取设备列表
+    getDeviceList() {
+      var params = {
+        page: this.Paginationil.PageIndex,
+        pageSize: this.Paginationil.PageSize,
+        name: this.nameTitle,
+      }
+      getDevice(params).then(res => {
+        if (res.code == 200) {
+          this.incubatorData = res.data.list
+          this.Total1 = res.data.count
+        }
+      })
+    },
+    // 搜索保温箱
+    incubatorInput(value) {
+      this.nameTitle = value
+      this.getDeviceList()
+    },
+    // 批量导入保温箱
+    incubatorAdd() {
+      const arrID = this.$refs.refIncubator.waybillIds
+      let arr1 = []
+      arrID.forEach(item => {
+        let arr2 = {
+          sn: item.T_sn,
+          name: item.T_devName,
+        }
+        arr1.push(arr2)
+      })
+      let flag = this.$refs['incubatorRules'].validateForm();
+      if (flag) {
+        if (arr1.length > 0) {
+          this.incubatorLoading = true
+          let params = {
+            list: arr1,
+            ...this.stateRuleForm,
+          }
+          addCoolerBoxImport(params).then(res => {
+            if (res.code == 200) {
+              this.$message({
+                message: '操作成功',
+                type: 'success'
+              });
+              this.getList()
+              this.importDialogVisible = false
+            }
+            this.incubatorLoading = false
+          }).catch(() => {
+            this.incubatorLoading = false
+          })
+        } else {
+          this.$message.warning('请选择需要导入的保温箱');
+        }
+      } else {
+        this.$message.error('表单信息不完整,请继续填写完整');
+      }
+    },
+    // 删除保温箱
+    deleteUser(id) {
+      this.$confirm('此操作将永久删除该保温箱, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        delCoolerBox({
+          id: id,
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message({
+              message: '操作成功',
+              type: 'success'
+            });
+            const precisePage = Math.ceil((this.Total - 1) / this.Pagination.PageSize)
+            this.Pagination.PageIndex = this.Pagination.PageIndex > precisePage ? precisePage : this
+              .Pagination.PageIndex
+            this.Pagination.PageIndex = this.Pagination.PageIndex < 1 ? 1 : this.Pagination.PageIndex
+            this.getList()
+          }
+        })
+      }).catch(() => { });
+    },
+    changeSize(val) {
+      this.Pagination.PageSize = val
+      this.getList()
+    },
+    changeCurrent(val) {
+      this.Pagination.PageIndex = val
+      this.getList()
+    },
+    changeSizeil(val) {
+      this.Paginationil.PageSize = val
+      this.getDeviceList()
+    },
+    changeCurrentil(val) {
+      this.Paginationil.PageIndex = val
+      this.getDeviceList()
+    },
+    // 清空表单
+    closeDialog() {
+      this.formRuleList.forEach((item, index) => {
+        item.disabled = false
+      })
+      this.ruleForm = {}
+      this.$refs.childRules.resetCheck();
+    },
+    // 关闭温湿度记录
+    temperatureClose() {
+      this.timeQuantum = [this.getTime(new Date(new Date().toLocaleDateString())), this.getTime(new Date())]
+    },
+    closeDialogil() {
+      this.$refs.incubatorRules.resetCheck();
+      this.$refs.refIncubator.clearSelected();
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.card_check_title {
+  display: flex;
+  align-items: center;
+}
+
+.icon_import {
+  margin-right: 5px;
+  font-size: 20px;
+}
+
+.card_import {
+  margin-top: 15px;
+  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+  margin-bottom: 20px;
+  border-radius: 10px;
+}
+
+.management_card ::v-deep .el-dialog__body {
+  padding: 0px 20px !important;
+}
+
+.card_incubat {
+  padding-left: 15px;
+  padding-right: 15px;
+  border-bottom: 1px solid #EBEEF5;
+  padding-top: 15px;
+  margin-bottom: 15px;
+}
+
+.card_search_input {
+  display: flex;
+  align-items: center;
+  padding: 15px 20px 15px 20px;
+  border-bottom: 1px solid #EBEEF5;
+}
+
+.title_search {
+  flex: none;
+  margin-right: 5px;
+}
+</style>

+ 144 - 0
src/views/incubator/IncubatorTraceability.vue

@@ -0,0 +1,144 @@
+<template>
+  <!-- 保温箱追溯 -->
+  <div style="overflow-y: auto;">
+    <actionBar :operateList="operateList" :formList="formList" :ruleForm="searchRuleForm" @openModel="openModel"
+      @searchProtocol="searchProtocol">
+    </actionBar>
+    <div class="card_content">
+      <!-- 表单 -->
+      <tables :tableList="tableList" :tableData="tableData"></tables>
+      <!-- 分页 -->
+      <div v-if="Total">
+        <pagination :total="Total" :currentPage="Pagination.PageIndex" @changeSize="changeSize"
+          @changeCurrent="changeCurrent">
+        </pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import {
+  getcoolerboxall
+} from '@/api/incubator'
+import actionBar from '@/components/actionBar'
+import tables from '@/components/tables'
+import pagination from '@/components/pagination'
+import forms from '@/components/forms'
+import {
+  employee
+} from "./retrospect.js";
+export default {
+  name: 'IncubatorManagement',
+  components: {
+    actionBar,
+    tables,
+    pagination,
+    forms,
+  },
+  data() {
+    return {
+      operateList: [{
+        type: 'export',
+        colour: 'success',
+        title: '导出Excel',
+      }],
+      formList: [{
+        type: 'input',
+        label: '名称',
+        field: 'name',
+        placeholder: '名称',
+      }, {
+        type: 'input',
+        label: 'SN',
+        field: 'sn',
+        placeholder: 'SN',
+      }],
+      searchRuleForm: {
+        name: '',
+        sn: '',
+        status: '',
+      },
+      searchValue: {},
+      Pagination: {
+        PageIndex: 1,
+        PageSize: 10,
+      },
+      Total: 0,
+      tableData: [],
+      tableList: [],
+      // 是否预冷
+      iceColdFlag: false,
+      userList: {},
+    }
+  },
+  mounted() {
+    const arr = localStorage.getItem('userList')
+    this.userList = JSON.parse(arr)
+    if (this.userList.dept) {
+      this.iceColdFlag = this.userList.dept.isCoolerReleaseCold
+    }
+    if (!this.iceColdFlag) {
+      var tableList = employee()
+      this.tableList = removePointById(tableList, ['precoolingTime', 'cold_temperatures', 'cold_spots','precoolingOperator'])
+    } else {
+      this.tableList = employee()
+    }
+
+    function removePointById(arr1, arr2) {
+      for (let i = 0; i < arr2.length; i++) {
+        for (let j = 0; j < arr1.length; j++) {
+          if (arr2[i] == arr1[j].field) {
+            let indexs = arr1.indexOf(arr1[j]);
+            arr1.splice(indexs, 1);
+          }
+        }
+      }
+      return arr1
+    }
+    this.getList()
+  },
+  methods: {
+    // 搜索
+    searchProtocol(value) {
+      this.searchValue = value
+      this.getList()
+    },
+    // 获取保温箱列表
+    getList() {
+      var params = {
+        page: this.Pagination.PageIndex,
+        pageSize: this.Pagination.PageSize,
+        showTemp: true,
+        ...this.searchValue
+      }
+      getcoolerboxall(params).then(res => {
+        if (res.code == 200) {
+          this.tableData = res.data.list
+          this.Total = res.data.count
+          /* this.timer = setTimeout(() => {
+             this.getList();
+             clearInterval(this.timer); // 清除定时器
+             this.timer = null;
+           }, 60000) */
+        }
+      })
+    },
+    openModel(type) {
+      console.log(type,998);
+      
+      if (type == 'export') { }
+    },
+    changeSize(val) {
+      this.Pagination.PageSize = val
+      this.getList()
+    },
+    changeCurrent(val) {
+      this.Pagination.PageIndex = val
+      this.getList()
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 51 - 28
src/views/system/incubator.js → src/views/incubator/incubator.js

@@ -34,6 +34,14 @@ export const employee = () => {
     align: 'center',
     options: startStatus()
   }, {
+    field: 'cold_temperatures',
+    label: '预冷温度(℃)',
+    align: 'center',
+  }, {
+    field: 'cold_spots',
+    label: '预冷地点',
+    align: 'center',
+  }, {
     field: 'deviceData.T_t',
     label: '最新温度',
     align: 'center',
@@ -44,36 +52,29 @@ export const employee = () => {
   }, {
     field: 'action',
     label: '操作',
-    colWidth: '360px',
     align: 'center',
+    colWidth: '350px',
     labelButton: [{
-        type: 'ascend',
-        label: '冰排追溯',
-        icon: 'el-icon-tickets',
-        style: 'success',
-      },
-      {
-        type: 'record',
-        label: '记录',
-        icon: 'el-icon-s-order',
-        style: 'primary',
-      }, {
-        type: 'logs',
-        label: '详情',
-        icon: 'el-icon-tickets',
-        style: 'success',
-      }, {
-        type: 'edit',
-        label: '编辑',
-        icon: 'el-icon-edit',
-        style: 'primary',
-      }, {
-        type: 'del',
-        label: '删除',
-        icon: 'el-icon-delete',
-        style: 'danger',
-      }
-    ]
+      type: 'record',
+      label: '温湿度记录',
+      icon: 'el-icon-s-order',
+      style: 'primary',
+    }, {
+      type: 'logs',
+      label: '详情',
+      icon: 'el-icon-tickets',
+      style: 'success',
+    }, {
+      type: 'edit',
+      label: '编辑',
+      icon: 'el-icon-edit',
+      style: 'primary',
+    }, {
+      type: 'del',
+      label: '删除',
+      icon: 'el-icon-delete',
+      style: 'danger',
+    }]
   }]
 }
 
@@ -100,6 +101,28 @@ export const formRules = () => {
       message: '请输入SN',
       trigger: 'blur'
     }]
+  },{
+    field: 'cold_temperatures',
+    label: '预冷温度(℃)',
+    placeholder: '请输入预冷温度(℃)',
+    type: 'input',
+    colWidth: 24,
+    rules: [{
+      required: true,
+      message: '请输入预冷温度(℃)',
+      trigger: 'blur'
+    }]
+  },{
+    field: 'cold_spots',
+    label: '预冷地点',
+    placeholder: '请输入预冷地点',
+    type: 'input',
+    colWidth: 24,
+    rules: [{
+      required: true,
+      message: '请输入预冷地点',
+      trigger: 'blur'
+    }]
   }, {
     field: 'status',
     label: '状态',

+ 47 - 0
src/views/incubator/retrospect.js

@@ -0,0 +1,47 @@
+export const employee = () => {
+  return [{
+    field: 'index',
+    label: '序号',
+    align: 'center',
+  }, {
+    field: 'coolerBox.name',
+    label: '名称',
+    align: 'center',
+  }, {
+    field: 'coolerBox.sn',
+    label: 'SN',
+    align: 'center',
+  },{
+    field: 'precoolingTime',
+    label: '预冷放入时间',
+    align: 'center',
+  }, {
+    field: 'cold_temperatures',
+    label: '预冷温度',
+    align: 'center',
+  }, {
+    field: 'cold_spots',
+    label: '预冷地点',
+    align: 'center',
+  }, {
+    field: 'precoolingOperator',
+    label: '预冷操作人',
+    align: 'center',
+  },  {
+    field: 'sn',
+    label: '使用时间',
+    align: 'center',
+  },  {
+    field: 'sn',
+    label: '放置冰排编号',
+    align: 'center',
+  },  {
+    field: 'sn',
+    label: '放置冰排数量',
+    align: 'center',
+  },  {
+    field: 'sn',
+    label: '使用人员',
+    align: 'center',
+  }]
+}

+ 2 - 2
src/views/system/CompanyManagement.vue

@@ -80,8 +80,8 @@
           name: '',
           companyAddress: '',
           coldKey: '',
-          isIceReleaseCold: true,
-          isCoolerReleaseCold: true,
+          isIceReleaseCold: false,
+          isCoolerReleaseCold: false,
           remark: '',
         },
         confirmLoading: false,

+ 0 - 616
src/views/system/IncubatorManagement.vue

@@ -1,616 +0,0 @@
-<template>
-  <!-- 保温箱管理 -->
-  <div style="overflow-y: auto;">
-    <actionBar :operateList="operateList" :formList="formList" :ruleForm="searchRuleForm" @openModel="openModel"
-      @searchProtocol="searchProtocol"></actionBar>
-    <div class="card_content">
-      <!-- 表单 -->
-      <tables :tableList="tableList" :tableData="tableData" @buttonData="buttonData"></tables>
-      <!-- 分页 -->
-      <div v-if="Total">
-        <pagination :total="Total" :currentPage="Pagination.PageIndex" @changeSize="changeSize"
-          @changeCurrent="changeCurrent">
-        </pagination>
-      </div>
-    </div>
-    <el-dialog :title="staffTitle" :visible.sync="staffDialogVisible" width="600px" :close-on-click-modal="false"
-      @close="closeDialog">
-      <forms ref="childRules" :formNewList="formRuleList" :ruleForm="ruleForm" labelWidth="100px"></forms>
-      <span slot="footer" class="dialog-footer" v-if="operationType != 'logs'">
-        <el-button plain @click="staffDialogVisible = false">取 消</el-button>
-        <el-button type="primary" :loading="confirmLoading" @click="handleAdd">确 定</el-button>
-      </span>
-    </el-dialog>
-    <div class="management_card">
-      <el-dialog :visible.sync="importDialogVisible" width="500px" :close-on-click-modal="false" @close="closeDialogil">
-        <div class="card_import">
-          <div class="card_incubat">
-            <forms ref="incubatorRules" labelPosition="left" :formNewList="stateRuleList" :ruleForm="stateRuleForm"
-              labelWidth="80px"></forms>
-          </div>
-          <div class="card_search_input">
-            <div class="title_search">名称:</div>
-            <el-input v-model="nameTitle" placeholder="请输入内容" @input="incubatorInput"></el-input>
-          </div>
-          <!-- 表单 -->
-          <tables ref="refIncubator" :tableList="incubatorList" :tableData="incubatorData"></tables>
-          <!-- 分页 -->
-          <div v-if="Total">
-            <pagination :total="Total1" :currentPage="Paginationil.PageIndex" :pager-countnum="5"
-              layout="sizes, prev, pager, next" @changeSize="changeSizeil" @changeCurrent="changeCurrentil">
-            </pagination>
-          </div>
-        </div>
-        <span slot="footer" class="dialog-footer">
-          <el-button plain @click="importDialogVisible = false">取 消</el-button>
-          <el-button type="primary" :loading="incubatorLoading" @click="incubatorAdd">导 入</el-button>
-        </span>
-      </el-dialog>
-    </div>
-    <el-dialog top="5vh" :visible.sync="dialogVisible" width="80%" @close="temperatureClose">
-      <template slot="title">
-        <div style="display: flex;align-items: center;">
-          <span style="margin-right: 10px;font-size: 20px;">温湿度记录</span>
-          <el-date-picker v-model="timeQuantum" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange"
-            :picker-options="pickerOptions" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
-            align="center" @change="timeChange">
-          </el-date-picker>
-        </div>
-      </template>
-      <thermography ref="thermo" :waybillNo="waybillNo" :timeData="timeQuantum"></thermography>
-    </el-dialog>
-    <centerControl ref="control" :tableData="tableData"></centerControl>
-    <div class="card_iceTracing">
-      <el-dialog fullscreen title="冰排追溯" :visible.sync="iceTracingVisible">
-        <div>
-          <div class="space_between_in" style="margin-bottom: 10px;">
-            <div>
-              <el-date-picker v-model="value1" type="datetimerange" range-separator="至" start-placeholder="开始日期"
-                end-placeholder="结束日期">
-              </el-date-picker>
-            </div>
-            <div style="display: flex;align-items: center;">
-              <el-button type="primary">导出Excel</el-button>
-              <el-button type="success" @click="download">下载PDF</el-button>
-            </div>
-          </div>
-          <tables :historyFlag="true" :tableList="historyList" :tableData="historyData">
-          </tables>
-          <!-- 分页 -->
-          <div v-if="historyTotal">
-            <pagination :total="historyTotal" :currentPage="historyPagination.PageIndex" @changeSize="historySize"
-              @changeCurrent="historyCurrent">
-            </pagination>
-          </div>
-        </div>
-      </el-dialog>
-    </div>
-  </div>
-</template>
-
-<script>
-  import {
-    getSysUserBind
-  } from '@/api/user'
-  import {
-    getCoolerBox,
-    getCoolerBoxDetails,
-    addCoolerBox,
-    putCoolerBox,
-    delCoolerBox,
-    getDevice,
-    addCoolerBoxImport
-  } from '@/api/incubator'
-  import {
-    getTemperature
-  } from '@/api/waybill'
-  import actionBar from '@/components/actionBar'
-  import tables from '@/components/tables'
-  import pagination from '@/components/pagination'
-  import forms from '@/components/forms'
-  import thermography from '@/components/thermography'
-  import centerControl from '@/components/centerControl'
-  import {
-    formRules,
-    employee,
-    incubator,
-    historyRecord,
-  } from "./incubator.js";
-  import {
-    startStatus,
-    iceraftStatus
-  } from '@/assets/js/blockSort'
-  export default {
-    name: 'IncubatorManagement',
-    components: {
-      actionBar,
-      tables,
-      pagination,
-      forms,
-      thermography,
-      centerControl
-    },
-    data() {
-      return {
-        pickerOptions: {
-          shortcuts: [{
-            text: '最近一周',
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
-              picker.$emit('pick', [start, end]);
-            }
-          }, {
-            text: '最近一个月',
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-              picker.$emit('pick', [start, end]);
-            }
-          }, {
-            text: '最近三个月',
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-              picker.$emit('pick', [start, end]);
-            }
-          }]
-        },
-        timeQuantum: [this.getTime(new Date(new Date().toLocaleDateString())), this.getTime(new Date())],
-
-        operateList: [{
-          type: 'add',
-          title: '添加保温箱',
-          icon: 'el-icon-plus',
-        }, {
-          type: 'import',
-          title: '冷链平台导入',
-          icon: 'el-icon-upload',
-        }, {
-          type: 'screen',
-          title: '中控大屏',
-          icon: 'el-icon-position',
-          colour: 'success'
-        }],
-        formList: [{
-          type: 'input',
-          label: '名称',
-          field: 'name',
-          placeholder: '名称',
-        }, {
-          type: 'input',
-          label: 'SN',
-          field: 'sn',
-          placeholder: 'SN',
-        }, {
-          type: 'select',
-          label: '状态',
-          field: 'status',
-          placeholder: '请选择状态',
-          options: iceraftStatus(),
-        }],
-        searchRuleForm: {
-          name: '',
-          sn: '',
-          status: '',
-        },
-        searchValue: {},
-        Pagination: {
-          PageIndex: 1,
-          PageSize: 10,
-        },
-        Total: 0,
-        tableData: [],
-        operationType: '',
-        tableList: employee(),
-        staffTitle: '添加',
-        staffDialogVisible: false,
-        formRuleList: [],
-        ruleForm: {
-          name: '',
-          sn: '',
-          status: '2',
-        },
-        confirmLoading: false,
-        selectingData: {},
-        importDialogVisible: false,
-        incubatorList: incubator(),
-        incubatorData: [],
-        Total1: 0,
-        Paginationil: {
-          PageIndex: 1,
-          PageSize: 10,
-        },
-        stateRuleList: [{
-          field: 'status',
-          label: '状态',
-          placeholder: '状态',
-          type: 'radio',
-          colWidth: 24,
-          rules: [{
-            required: true,
-            message: '选择状态',
-            trigger: 'change'
-          }],
-          options: startStatus()
-        }],
-        stateRuleForm: {
-          status: '2',
-        },
-        nameTitle: '',
-        incubatorLoading: false,
-
-        timer: null, //定时器名称
-        dialogVisible: false,
-        waybillNo: '',
-        iceTracingVisible: false,
-        value1: '',
-        // 历史记录
-        historyList: historyRecord(),
-        historyData: [],
-        historyTotal: 0,
-        historyPagination: {
-          PageIndex: 1,
-          PageSize: 10,
-        },
-      }
-    },
-    beforeDestroy() {
-      clearInterval(this.timer); // 清除定时器
-      this.timer = null;
-    },
-    mounted() {
-      const dataList = formRules();
-      this.formRuleList = dataList;
-      this.getList()
-    },
-    methods: {
-      download() {
-        getTemperature().then(response => {
-          if (response.fileName) {
-            this.pdfDialogVisible = false
-            //fileName = decodeURIComponent(filename);//对filename进行转码
-            let fileName = decodeURI(response.fileName);
-            if (window.navigator.msSaveOrOpenBlob) {
-              navigator.msSaveBlob(new Blob([response.data]), fileName);
-            } else {
-              let url = window.URL.createObjectURL(new Blob([response.data]));
-              let link = document.createElement('a');
-              link.style.display = 'none';
-              link.href = url;
-              link.setAttribute('download', fileName);
-              document.body.appendChild(link);
-              link.click();
-            }
-          } else {
-            this.$message.error('未获取到文件名');
-          }
-        })
-      },
-      getTime(time) {
-        var date = new Date(time)
-        var y = date.getFullYear()
-        var m = date.getMonth() + 1
-        m = m < 10 ? '0' + m : m
-        var d = date.getDate()
-        d = d < 10 ? '0' + d : d
-        var h = date.getHours()
-        h = h < 10 ? '0' + h : h
-        var minute = date.getMinutes()
-        minute = minute < 10 ? '0' + minute : minute
-        var s = date.getSeconds()
-        s = s < 10 ? '0' + s : s
-        return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + s
-      },
-      // 搜索
-      searchProtocol(value) {
-        this.searchValue = value
-        this.getList()
-      },
-      // 获取运单列表
-      getList() {
-        var params = {
-          page: this.Pagination.PageIndex,
-          pageSize: this.Pagination.PageSize,
-          showTemp: true,
-          ...this.searchValue
-        }
-        getCoolerBox(params).then(res => {
-          if (res.code == 200) {
-            this.tableData = res.data.list
-            this.Total = res.data.count
-            this.timer = setTimeout(() => {
-              this.getList();
-              clearInterval(this.timer); // 清除定时器
-              this.timer = null;
-            }, 60000)
-          }
-        })
-      },
-      // 选项赋值
-      optionMatching(value, field) {
-        this.formRuleList.forEach((item, index) => {
-          if (item.field == field) {
-            item.options = value
-          }
-        })
-      },
-      // 弹窗表单添加
-      handleAdd() {
-        let flag = this.$refs['childRules'].validateForm();
-        if (flag) {
-          if (this.operationType == 'add') {
-            this.confirmLoading = true
-            var params = {
-              ...this.ruleForm
-            }
-            addCoolerBox(params).then(res => {
-              if (res.code == 200) {
-                this.$message({
-                  message: '操作成功',
-                  type: 'success'
-                });
-                this.getList()
-                this.staffDialogVisible = false
-              }
-              this.confirmLoading = false
-            }).catch(() => {
-              this.confirmLoading = false
-            })
-          } else if (this.operationType == 'edit') {
-            this.confirmLoading = true
-            var params = {
-              id: this.selectingData.id,
-              name: this.ruleForm.name,
-              sn: this.ruleForm.sn,
-              status: this.ruleForm.status,
-            }
-            putCoolerBox(params).then(res => {
-              if (res.code == 200) {
-                this.$message({
-                  message: '操作成功',
-                  type: 'success'
-                });
-                this.getList()
-              }
-              this.staffDialogVisible = false
-              this.confirmLoading = false
-            }).catch(() => {
-              this.confirmLoading = false
-            })
-          }
-        } else {
-          this.$message.error('表单信息不完整,请继续填写完整');
-        }
-      },
-      buttonData(row, type) {
-        this.selectingData = row
-        this.operationType = type
-        if (type == 'edit') {
-          this.staffTitle = '编辑'
-          this.staffDialogVisible = true
-          setTimeout(() => {
-            this.$nextTick(() => {
-              this.ruleForm = JSON.parse(JSON.stringify(row))
-            })
-          })
-        } else if (type == 'del') {
-          this.deleteUser(row.id)
-        } else if (type == 'logs') {
-          this.staffTitle = '详情'
-          this.staffDialogVisible = true
-          this.formRuleList.forEach((item, index) => {
-            item.disabled = true
-          })
-          this.ruleForm = JSON.parse(JSON.stringify(row))
-        } else if (type == 'record') {
-          this.dialogVisible = true
-          this.waybillNo = row.sn
-          this.$nextTick(() => {
-            this.$refs.thermo.getProbe()
-          })
-        } else if (type == 'ascend') {
-          console.log(23)
-          this.iceTracingVisible = true
-        }
-      },
-      // 选择时间
-      timeChange() {
-        this.$nextTick(() => {
-          this.$refs.thermo.getTemperature()
-        })
-      },
-      openModel(type) {
-        if (type == 'add') {
-          this.staffTitle = '添加'
-          this.staffDialogVisible = true
-          this.operationType = type
-        } else if (type == 'import') {
-          this.importDialogVisible = true
-          this.getDeviceList()
-        } else if (type == 'screen') {
-          this.$refs.control.controlVisible = true
-          this.$nextTick(() => {
-            setTimeout(() => {
-              this.$refs.control.keyUpSearch()
-            }, 100)
-          })
-        }
-      },
-      // 获取设备列表
-      getDeviceList() {
-        var params = {
-          page: this.Paginationil.PageIndex,
-          pageSize: this.Paginationil.PageSize,
-          name: this.nameTitle,
-        }
-        getDevice(params).then(res => {
-          if (res.code == 200) {
-            this.incubatorData = res.data.list
-            this.Total1 = res.data.count
-          }
-        })
-      },
-      // 搜索保温箱
-      incubatorInput(value) {
-        this.nameTitle = value
-        this.getDeviceList()
-      },
-      // 批量导入保温箱
-      incubatorAdd() {
-        const arrID = this.$refs.refIncubator.waybillIds
-        let arr1 = []
-        arrID.forEach(item => {
-          let arr2 = {
-            sn: item.T_sn,
-            name: item.T_devName,
-          }
-          arr1.push(arr2)
-        })
-        let flag = this.$refs['incubatorRules'].validateForm();
-        if (flag) {
-          if (arr1.length > 0) {
-            this.incubatorLoading = true
-            let params = {
-              list: arr1,
-              ...this.stateRuleForm,
-            }
-            addCoolerBoxImport(params).then(res => {
-              if (res.code == 200) {
-                this.$message({
-                  message: '操作成功',
-                  type: 'success'
-                });
-                this.getList()
-                this.importDialogVisible = false
-              }
-              this.incubatorLoading = false
-            }).catch(() => {
-              this.incubatorLoading = false
-            })
-          } else {
-            this.$message.warning('请选择需要导入的保温箱');
-          }
-        } else {
-          this.$message.error('表单信息不完整,请继续填写完整');
-        }
-      },
-      // 删除保温箱
-      deleteUser(id) {
-        this.$confirm('此操作将永久删除该保温箱, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          delCoolerBox({
-            id: id,
-          }).then(res => {
-            if (res.code == 200) {
-              this.$message({
-                message: '操作成功',
-                type: 'success'
-              });
-              const precisePage = Math.ceil((this.Total - 1) / this.Pagination.PageSize)
-              this.Pagination.PageIndex = this.Pagination.PageIndex > precisePage ? precisePage : this
-                .Pagination.PageIndex
-              this.Pagination.PageIndex = this.Pagination.PageIndex < 1 ? 1 : this.Pagination.PageIndex
-              this.getList()
-            }
-          })
-        }).catch(() => {});
-      },
-      changeSize(val) {
-        this.Pagination.PageSize = val
-        this.getList()
-      },
-      changeCurrent(val) {
-        this.Pagination.PageIndex = val
-        this.getList()
-      },
-      changeSizeil(val) {
-        this.Paginationil.PageSize = val
-        this.getDeviceList()
-      },
-      changeCurrentil(val) {
-        this.Paginationil.PageIndex = val
-        this.getDeviceList()
-      },
-      // 历史记录分页
-      historySize(val) {
-        this.historyPagination.PageSize = val
-      },
-      historyCurrent(val) {
-        this.historyPagination.PageIndex = val
-      },
-      // 清空表单
-      closeDialog() {
-        this.formRuleList.forEach((item, index) => {
-          item.disabled = false
-        })
-        this.ruleForm = {}
-        this.$refs.childRules.resetCheck();
-      },
-      // 关闭温湿度记录
-      temperatureClose() {
-        this.timeQuantum = [this.getTime(new Date(new Date().toLocaleDateString())), this.getTime(new Date())]
-      },
-      closeDialogil() {
-        this.$refs.incubatorRules.resetCheck();
-        this.$refs.refIncubator.clearSelected();
-      }
-    }
-  }
-</script>
-
-<style lang="scss" scoped>
-  .card_check_title {
-    display: flex;
-    align-items: center;
-  }
-
-  .icon_import {
-    margin-right: 5px;
-    font-size: 20px;
-  }
-
-  .card_import {
-    margin-top: 15px;
-    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
-    margin-bottom: 20px;
-    border-radius: 10px;
-  }
-
-  .management_card ::v-deep .el-dialog__body {
-    padding: 0px 20px !important;
-  }
-
-  .card_iceTracing ::v-deep .el-dialog__body {
-    padding: 10px 20px !important;
-  }
-
-  .card_iceTracing ::v-deep .el-dialog__headerbtn {
-    font-size: 25px !important;
-  }
-
-  .card_incubat {
-    padding-left: 15px;
-    border-bottom: 1px solid #EBEEF5;
-    padding-top: 15px;
-    margin-bottom: 15px;
-  }
-
-  .card_search_input {
-    display: flex;
-    align-items: center;
-    padding: 15px 20px 15px 20px;
-    border-bottom: 1px solid #EBEEF5;
-  }
-
-  .title_search {
-    flex: none;
-    margin-right: 5px;
-  }
-</style>

+ 5 - 5
src/views/system/company.js

@@ -16,11 +16,11 @@ export const employee = () => {
     align: 'center',
     options: [{
       label: '已开启',
-      value: 1,
+      value: true,
       bgcolor: '#67C23A',
     }, {
       label: '已关闭',
-      value: 2,
+      value: false,
       bgcolor: '#F56C6C',
     }]
   }, {
@@ -29,11 +29,11 @@ export const employee = () => {
     align: 'center',
     options: [{
       label: '已开启',
-      value: 1,
+      value: true,
       bgcolor: '#67C23A',
     }, {
       label: '已关闭',
-      value: 2,
+      value: false,
       bgcolor: '#F56C6C',
     }]
   }, {
@@ -77,7 +77,7 @@ export const formRules = () => {
       trigger: 'blur'
     }]
   }, {
-    field: 'address',
+    field: 'companyAddress',
     label: '地址',
     placeholder: '请输入地址',
     type: 'input',

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff