Browse Source

最新版本1.1.10 冷冻要求权限

AaronBruin 4 months ago
parent
commit
73543c03af
44 changed files with 2873 additions and 1795 deletions
  1. 8 1
      src/api/iceRaft.js
  2. 9 0
      src/api/incubator.js
  3. 13 2
      src/api/login.js
  4. 8 0
      src/api/waybill.js
  5. 2 1
      src/assets/css/global.css
  6. 35 3
      src/assets/js/blockSort.js
  7. 7 1
      src/components/actionBar.vue
  8. 372 0
      src/components/addEditOrder.vue
  9. 421 183
      src/components/centerControl.vue
  10. 104 23
      src/components/forms.vue
  11. 35 11
      src/components/orderDetails.vue
  12. 83 5
      src/components/prescriptionPicture.vue
  13. 57 5
      src/components/tables.vue
  14. 1 1
      src/components/treeTable.vue
  15. 77 7
      src/components/waybillInformation.vue
  16. 9 9
      src/config/intendant.js
  17. 4 3
      src/main.js
  18. 1 1
      src/utils/request.js
  19. 6 4
      src/views/IceCreamFreezer/IceManagement.vue
  20. 710 679
      src/views/IceCreamFreezer/IceTracingManagement.vue
  21. 5 4
      src/views/IceCreamFreezer/freezer.js
  22. 92 29
      src/views/IceCreamFreezer/iceRaft.js
  23. 1 5
      src/views/OrderManagement/OrderReview.vue
  24. 25 22
      src/views/OrderManagement/cancelledOrder.vue
  25. 9 14
      src/views/OrderManagement/completed.js
  26. 52 25
      src/views/OrderManagement/completedOrder.vue
  27. 16 19
      src/views/OrderManagement/delivered.js
  28. 52 24
      src/views/OrderManagement/deliveryOrder.vue
  29. 10 15
      src/views/OrderManagement/ordered.js
  30. 53 24
      src/views/OrderManagement/pendingOrder.vue
  31. 26 21
      src/views/OrderManagement/rejectionOrder.vue
  32. 66 34
      src/views/OrderManagement/reviewedOrder.vue
  33. 105 129
      src/views/OrderManagement/uncertain.js
  34. 42 281
      src/views/OrderManagement/uncertainOrder.vue
  35. 3 1
      src/views/WaybillInquiry.vue
  36. 0 1
      src/views/incubator/IncubatorManagement.vue
  37. 209 114
      src/views/incubator/IncubatorTraceability.vue
  38. 7 1
      src/views/incubator/incubator.js
  39. 9 9
      src/views/incubator/retrospect.js
  40. 2 6
      src/views/newInquiry.vue
  41. 2 17
      src/views/page/statisticalManagement.vue
  42. 2 0
      src/views/system/CompanyManagement.vue
  43. 113 59
      src/views/system/company.js
  44. 10 2
      vue.config.js

+ 8 - 1
src/api/iceRaft.js

@@ -51,7 +51,14 @@ export function iceraftOut(parameter) {
     data: parameter
   })
 }
-
+// 判断是否可以出库冰排
+export function raftIsoutstorage(parameter) {
+  return request({
+    url: '/api/ice-raft/isoutstorage',
+    method: 'post',
+    data: parameter
+  })
+}
 
 // 获取历史记录列表
 export function getIceRaftRecord(parameter) {

+ 9 - 0
src/api/incubator.js

@@ -101,3 +101,12 @@ export function getNewlocus(parameter) {
     params: parameter
   })
 }
+// 导出保温箱使用记录
+export function coolerExportExecl(parameter) {
+  return request({
+    url: '/api/cooler-box/export-execl',
+    method: 'get',
+    responseType: 'blob',
+    params: parameter
+  })
+}

+ 13 - 2
src/api/login.js

@@ -1,4 +1,5 @@
 import request from '@/utils/request'
+const Url = "https://public.coldbaozhida.com"
 /**
  * @param parameter
  * @returns {*}
@@ -17,7 +18,7 @@ export function userProfile(parameter) {
   return request({
     url: '/api/user/profile',
     method: 'get',
-    data: parameter
+    params: parameter
   })
 }
 
@@ -26,7 +27,7 @@ export function refreshToken(parameter) {
   return request({
     url: '/api/refresh_token',
     method: 'get',
-    data: parameter
+    params: parameter
   })
 }
 
@@ -42,3 +43,13 @@ export function getFileToken(parameter) {
     },
   })
 }
+
+// 码上放心获取药品信息
+export function aliMsfx(parameter) {
+  return request({
+    url: '/Ali_msfx/codedetail',
+    method: 'get',
+    params: parameter,
+    baseURL: process.env.NODE_ENV === 'production' ? Url : '/APP',
+  })
+}

+ 8 - 0
src/api/waybill.js

@@ -1,5 +1,13 @@
 import request from '@/utils/request'
 
+// 生成唯一订单编号
+export function getCreatesole(parameter) {
+  return request({
+    url: '/api/waybill/createsole',
+    method: 'get',
+    params: parameter
+  })
+}
 // 获取运单列表
 export function getWaybill(parameter) {
   return request({

+ 2 - 1
src/assets/css/global.css

@@ -5,7 +5,8 @@ body,
 	height: 100%;
 	margin: 0;
 	padding: 0;
-	padding-right: 0 !important
+	padding-right: 0 !important;
+	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
 }
 
 .center_in {

+ 35 - 3
src/assets/js/blockSort.js

@@ -50,12 +50,16 @@ export const WaybillStatus = () => {
     value: 5,
   }, {
     bgcolor: '#F56C6C',
-    label: '已取消',
+    label: '已拒收',
     value: 6,
   }, {
     bgcolor: '#F56C6C',
     label: '已驳回',
     value: 7,
+  }, {
+    bgcolor: '#F56C6C',
+    label: '已取消',
+    value: 8,
   }]
 }
 export const myOrder = () => {
@@ -131,17 +135,21 @@ export const frozenState = () => {
     label: '冷冻中',
     value: '1',
   }, {
-    bgcolor: '#67C23A',
+    bgcolor: '#E6A23C',
     label: '待使用',
     value: '2',
   }, {
-    bgcolor: '#E6A23C',
+    bgcolor: '#67C23A',
     label: '使用中',
     value: '3',
   }, {
     bgcolor: '#909399',
     label: '已结束',
     value: '4',
+  }, {
+    bgcolor: '#ff9900',
+    label: '释冷中',
+    value: '5',
   }]
 }
 
@@ -175,3 +183,27 @@ export const stateList = () => {
     bgcolor: '#F56C6C',
   }]
 }
+
+export const deviceState = () => {
+  return [{
+    label: '未监控',
+    value: 0,
+    bgcolor: '#F56C6C',
+  }, {
+    label: '监控中',
+    value: 1,
+    bgcolor: '#2979ff',
+  }, {
+    label: '停止记录',
+    value: 2,
+    bgcolor: '#ff9900',
+  }, {
+    label: '中途任务',
+    value: 3,
+    bgcolor: '#67C23A',
+  }, {
+    label: '未绑定',
+    value: 4,
+    bgcolor: '#909399',
+  }]
+}

+ 7 - 1
src/components/actionBar.vue

@@ -21,7 +21,8 @@
               <template v-if="item.type === 'select'">
                 <el-select size="medium" :id="item.field" v-loadmore="(params) => handleScroll(item.field)"
                   class="forms_dom" v-model="ruleForm[`${item.field}`]" :placeholder="item.placeholder"
-                  :disabled="item.disabled" :multiple="item.multiple" style="width: 100%" @change="changeSelect">
+                  :filterable="item.filterable" :remote="item.filterable" :disabled="item.disabled" :multiple="item.multiple" style="width: 100%"
+                  @change="changeSelect" :remote-method="remoteMethod">
                   <el-option v-for="(element, i) in item.options" :label="element.label" :value="`${element.value}`"
                     :key="i" />
                 </el-select>
@@ -124,8 +125,13 @@
       handleScroll(type) {
         this.$emit('handleScroll', type)
       },
+      // 下拉选择
       changeSelect() {
         this.$emit('searchProtocol', this.ruleForm)
+      },
+      // 下拉框远程搜索
+      remoteMethod(event){
+        this.$emit('remoteMethod', event)
       }
     }
   }

+ 372 - 0
src/components/addEditOrder.vue

@@ -0,0 +1,372 @@
+<template>
+  <div>
+    <el-dialog top="5vh" :title="staffTitle" :visible.sync="staffDialogVisible" width="900px"
+      :close-on-click-modal="false" @close="closePopup">
+      <div class="waybill_item">
+        <waybillForm ref="recipients" title="患者信息" :conserveFlag="conserveFlag" thinTitle="患者簿"
+          :ruleForm="recipientsForm" @addressBook="getAddressBook('recipients')" @conserveSelect="conserveSelectil">
+        </waybillForm>
+      </div>
+      <forms ref="childRules" :formNewList="formRuleList" :ruleForm="ruleForm" :delDrug="true" labelWidth="80px">
+      </forms>
+      <el-dialog width="60%" title="地址簿" :visible.sync="innerVisible" append-to-body>
+        <div class="space_between_in" style="margin-bottom: 15px;">
+          <div style="display: flex;align-items: center;width: 100%;">
+            <h3 style="margin-left: 10px;flex: none;">搜索:</h3>
+            <el-input v-model="bookInput" style="width: 100%;" placeholder="请输入姓名、电话、地址快速查找"
+              @input="fastSearch()"></el-input>
+          </div>
+        </div>
+        <div class="card_book_list">
+          <!-- 表单 -->
+          <tables :suspension="true" :tableList="bookTableList" :tableData="bookTableData" @cellClick="cellClick">
+          </tables>
+          <!-- 分页 -->
+          <div v-if="bookTotal">
+            <pagination :total="bookTotal" :currentPage="bookPagination.PageIndex" @changeSize="bookChangeSize"
+              @changeCurrent="bookChangeCurrent">
+            </pagination>
+          </div>
+        </div>
+      </el-dialog>
+      <span slot="footer" class="dialog-footer">
+        <el-button plain @click="staffDialogVisible = false">取 消</el-button>
+        <el-button type="primary" :loading="confirmLoading" @click="handleAdd">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import {
+    addWaybill,
+    putWaybill,
+  } from '@/api/waybill'
+  import {
+    getAddress
+  } from '@/api/address'
+  import {
+    getUser
+  } from '@/api/user'
+  import tables from '@/components/tables'
+  import pagination from '@/components/pagination'
+  import waybillForm from '@/components/waybillForm'
+  import forms from '@/components/forms'
+  import {
+    formRules,
+    addressBook,
+  } from "../views/OrderManagement/uncertain.js";
+  export default {
+    name: 'addEditOrder',
+    components: {
+      tables,
+      pagination,
+      waybillForm,
+      forms,
+    },
+    props: {
+      staffTitle: {
+        type: String,
+        default: () => '添加',
+      },
+      operationType: {
+        type: String,
+        default: () => 'add',
+      },
+      orderInformation: {
+        type: Object,
+        default: () => {},
+      },
+      orderId: {
+        type: Number,
+        default: () => null,
+      },
+    },
+    data() {
+      return {
+        staffDialogVisible: false,
+        recipientsForm: {
+          name: '',
+          phone: '',
+          region: '',
+          address: '',
+        },
+        conserveFlag: true,
+        saveConsigneeAddress: true,
+        delivererName: '',
+        ruleForm: {
+          deliveryType: '现在配送',
+          askForTime: null,
+          is_secondary_distribution: false,
+          tamperProofLabel: '',
+          tamperProofLabelImg: '',
+          remark: '',
+          fileList: [],
+          drugCode: [],
+        },
+        formRuleList: [],
+        conserveFlag: true,
+        saveConsigneeAddress: true,
+        innerVisible: false,
+        bookInput: '',
+        bookTableList: [],
+        bookTableData: [],
+        bookType: '',
+        bookPagination: {
+          PageIndex: 1,
+          PageSize: 10,
+        },
+        bookTotal: 0,
+        confirmLoading: false,
+
+      }
+    },
+    watch: {
+      orderInformation: {
+        handler(newVal, oldVal) {
+          // console.log(newVal, 'val')
+          setTimeout(() => {
+            this.$nextTick(() => {
+              if (newVal.id) {
+                this.recipientsForm.name = newVal.consigneeAddressName
+                this.recipientsForm.phone = newVal.consigneeAddressPhone
+                this.recipientsForm.address = newVal.consigneeAddressDetails
+                this.ruleForm.tamperProofLabel = newVal.tamperProofLabel
+                this.ruleForm.drugCode = newVal.drugs
+                if (newVal.deliveryType) {
+                  this.ruleForm.deliveryType = newVal.deliveryType
+                }
+                if (newVal.askForTime) {
+                  this.ruleForm.askForTime = newVal.askForTime
+                }
+                this.ruleForm.is_secondary_distribution = newVal.is_secondary_distribution
+                if (newVal.tamperProofLabelImg) {
+                  var arr = newVal.tamperProofLabelImg.split(',')
+                  var arr3 = []
+                  arr.forEach((item, index) => {
+                    var arr1 = {
+                      url: '',
+                    }
+                    arr1.url = item
+                    arr3.push(arr1)
+                  })
+                  this.ruleForm.fileList = arr3
+                  this.ruleForm.tamperProofLabelImg = newVal.tamperProofLabelImg
+                }
+                if (newVal.drugs && newVal.drugs.length > 0) {
+                  this.$refs.childRules.commodityList = newVal.drugs
+                }
+                this.ruleForm.remark = newVal.remark
+              }
+            })
+          })
+        },
+        immediate: true,
+        deep: true
+      }
+    },
+    mounted() {
+      const dataList = formRules();
+      this.formRuleList = dataList;
+    },
+    methods: {
+      // 弹窗表单添加
+      async handleAdd() {
+        let recipientsFlag = this.$refs['recipients'].validateForm();
+        let childRulesFlag = this.$refs['childRules'].validateForm();
+        if (recipientsFlag && childRulesFlag) {
+          // if (this.ruleForm.drugCode.length > 0) {
+          this.confirmLoading = true
+          var params = {
+            consigneeAddressName: this.recipientsForm.name,
+            consigneeAddressPhone: this.recipientsForm.phone,
+            consigneeAddressDetails: this.recipientsForm.address,
+            saveConsigneeAddress: this.saveConsigneeAddress,
+            // deliveryId: Number(this.personnelForm.deliveryId),
+            // reCheckId: Number(this.personnelForm.reCheckId),
+            ...this.ruleForm,
+            drugs: this.ruleForm.drugCode
+          }
+          if (this.ruleForm.fileList) {
+            var fileImage = this.picture(this.ruleForm.fileList)
+            params.tamperProofLabelImg = fileImage
+          }
+          if (!params.askForTime) {
+            delete params.askForTime
+          }
+          if (this.operationType == 'add') {
+            delete params.fileList
+            delete params.drugCode
+            delete params.code
+            await addWaybill(params).then(res => {
+              if (res.code == 200) {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success'
+                });
+                // this.getList()
+                this.$emit('refreshList')
+              }
+              this.staffDialogVisible = false
+              this.confirmLoading = false
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+          } else if (this.operationType == 'edit') {
+            delete params.fileList
+            delete params.drugCode
+            delete params.code
+            params.id = this.orderId
+            await putWaybill(params).then(res => {
+              if (res.code == 200) {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success'
+                });
+                // this.getList()
+                this.$emit('refreshList')
+              }
+              this.staffDialogVisible = false
+              this.confirmLoading = false
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+          }
+          // } else {
+          //   this.$message.error('请扫码添加商品');
+          // }
+        } else {
+          this.$message.error('表单信息不完整,请继续填写完整');
+        }
+      },
+      picture(arr) {
+        var imgList = JSON.parse(JSON.stringify(arr))
+        var imgArr = []
+        imgList.forEach((item, index) => {
+          imgArr.push(item.url)
+        })
+        var imgString = imgArr.join()
+        return imgString
+      },
+      // 获取地址簿
+      getAddressBook(type) {
+        this.bookTableList = addressBook()
+        this.bookType = type
+        this.innerVisible = true
+        this.getSenderSend()
+      },
+      conserveSelectil(type) {
+        if (type) {
+          this.saveConsigneeAddress = true
+        } else {
+          this.saveConsigneeAddress = false
+        }
+      },
+      // 快速搜索
+      fastSearch() {
+        this.bookPagination.PageIndex = 1
+        if (this.bookType == 'deliverer') {
+          this.getDelivererList()
+        }
+      },
+      // 获取寄/收列表
+      getSenderSend() {
+        let address = ''
+        if (this.bookType == 'recipients') {
+          address = 'consignee'
+        } else {
+          address = this.bookType
+        }
+        getAddress({
+          page: this.bookPagination.PageIndex,
+          pageSize: this.bookPagination.PageSize,
+          name: this.bookInput,
+          addressType: address,
+        }).then(res => {
+          if (res.code == 200) {
+            this.bookTableData = res.data.list
+            this.bookTotal = res.data.count
+          }
+        })
+      },
+      getDelivererList() {
+        var params = {
+          page: 1,
+          pageSize: 999,
+          // type: 3,
+          name: this.delivererName,
+        }
+        getUser(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.nickName
+              arrData.value = item1.id
+              arrList.push(arrData)
+            })
+            this.personnelList.forEach(item => {
+              if (item.field == 'deliveryId') {
+                item.options = item.options.concat(arrList)
+              }
+            })
+          }
+        })
+      },
+      // 地址簿
+      bookChangeSize(val) {
+        this.bookPagination.PageSize = val
+        if (this.bookType == 'deliverer') {
+          this.getDelivererList()
+        } else {
+          this.getSenderSend()
+        }
+      },
+      bookChangeCurrent(val) {
+        this.bookPagination.PageIndex = val
+        if (this.bookType == 'deliverer') {
+          this.getDelivererList()
+        } else {
+          this.getSenderSend()
+        }
+      },
+      // 选择table其中某一项
+      cellClick(row) {
+        this.innerVisible = false
+        const param = {
+          ...row
+        }
+        if (this.bookType == 'recipients') {
+          this.recipientsForm = param
+          this.$nextTick(() => {
+            this.$refs.recipients.radio = ''
+            // this.$refs['recipients'].clickitem('1')
+            this.$refs['recipients'].validateForm();
+          })
+        } else if (this.bookType == 'deliverer') {
+          this.delivererForm.name = param.nickName
+          this.delivererForm.phone = param.phone
+          this.$nextTick(() => {
+            this.$refs['deliverer'].validateForm();
+          })
+        }
+      },
+      // 关闭清空表单
+      closePopup() {
+        this.ruleForm.fileList = []
+        this.$refs.childRules.commodityList = []
+        // this.$refs.sender.resetForm()
+        this.$refs.recipients.resetForm()
+        // this.$refs.deliverer.resetForm()
+        this.$refs.childRules.resetCheck()
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 421 - 183
src/components/centerControl.vue

@@ -38,7 +38,7 @@
             <el-image :class="logisticsFlag ? '' : 'overturn'" style="height: 29px;width: 40px;flex: none;"
               :src="require('@/assets/images/unfold.png')"></el-image>
           </div>
-          <div style="width: 100%;height: calc(100% - 30px);" v-if="logisticsFlag">
+          <div style="width: 100%;height: calc(100% - 30px);" v-show="logisticsFlag">
             <div class="card_unpack_control">
               <div style="display: flex;align-items: center;">
                 <div style="width: 260px;margin-right: 10px;">
@@ -50,25 +50,43 @@
                 </el-date-picker> -->
               </div>
               <div>
-                <el-button type="primary" size="small" @click="examine" v-if="currentId == 1">查看实时数据</el-button>
+                <el-button type="primary" size="small" :loading="mapLoading" @click="examine"
+                  v-if="currentId == 1">查看实时数据</el-button>
               </div>
             </div>
             <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>
+                @cell-click="selectIncubator" :row-key="(row) => { return row.id }" :key="currentId">
+                <el-table-column reserve-selection 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>
                 <el-table-column prop="sn" label="SN"></el-table-column>
-                <el-table-column prop="status" label="状态"></el-table-column>
-                <el-table-column prop="T_t" label="当前地址"></el-table-column>
-                <el-table-column prop="T_t" label="最新温度"></el-table-column>
-                <el-table-column prop="T_time" label="最新记录时间"></el-table-column>
+                <el-table-column prop="status" label="状态">
+                  <template slot-scope="scope">
+                    <div :style="{color: filterColor(scope.row,startStatus,'status')}">
+                      {{initDictvalueil(scope.row,startStatus,'status')}}
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="monitorStatus" label="监控状态">
+                  <template slot-scope="scope">
+                    <div :style="{color: filterColor(scope.row,deviceState,'monitorStatus')}">
+                      {{initDictvalueil(scope.row,deviceState,'monitorStatus')}}
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="deviceData.address" label="当前地址"></el-table-column>
+                <el-table-column prop="deviceData.T_t" label="最新温度">
+                  <template slot-scope="scope">
+                    <div>{{scope.row.deviceData.T_t || ''}}</div>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="deviceData.T_time" label="最新记录时间"></el-table-column>
               </el-table>
               <div v-if="Total">
-                <pagination :total="Total" :currentPage="Pagination.PageIndex" @changeSize="changeSize"
-                  @changeCurrent="changeCurrent">
+                <pagination :total="Total" :currentPage="Pagination.PageIndex" layout="total, prev, pager, next,jumper"
+                  @changeSize="changeSize" @changeCurrent="changeCurrent">
                 </pagination>
               </div>
             </div>
@@ -88,11 +106,12 @@
         <div class="hide_information center_in" v-if="!optionFlag && trackCircle" @click="reelect">
           <span class="iconfont icon-guiji"></span>
         </div>
-        <div class="information_card scale-up-tr" v-if="optionFlag && timeData.length > 0">
+        <div class="information_card scale-up-tr" v-infinite-scroll="scrollLoad"
+          v-if="optionFlag && timeData.length > 0">
           <div class="card_time_box" v-for="(item,index) in timeData" :key="index" @click="getTrack(item)">
             <div class="sn_card_box">{{item.sn}}</div>
-            <div class="box_time">{{item.start_time}}</div>
-            <div class="box_time">{{item.end_time}}</div>
+            <div class="box_time">{{item.coolerBoxUserTime}}</div>
+            <div class="box_time">{{item.coolerEndUseTime}}</div>
           </div>
         </div>
         <div class="information_card" v-else-if="optionFlag && timeData.length == 0">
@@ -104,12 +123,18 @@
 </template>
 
 <script>
+  import axios from 'axios'
   import {
     getCoolerBox,
     getCoolerBoxLocus,
     getHistoryLocus,
-    getNewlocus
+    getNewlocus,
+    getcoolerboxall
   } from '@/api/incubator'
+  import {
+    startStatus,
+    deviceState
+  } from '@/assets/js/blockSort'
   import pagination from '@/components/pagination'
   export default {
     name: 'centerControl',
@@ -170,6 +195,12 @@
         tableLoading: false,
         incubatorName: '',
         timeLoading: false,
+        startStatus: startStatus(),
+        deviceState: deviceState(),
+        asyncDataLoaded: false,
+        limitNoil: true,
+        timePage: 1,
+        colorIndex: 0,
       }
     },
     computed: {
@@ -181,23 +212,7 @@
         };
       },
     },
-    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 // 开启深度监听
-      // },
-    },
+    watch: {},
     mounted() {
       // this.keyUpSearch()
     },
@@ -207,30 +222,54 @@
         this.getList()
       },
       // 获取保温箱列表
-      getList() {
+      async getList() {
         this.tableLoading = true
         var params = {
           page: this.Pagination.PageIndex,
           pageSize: this.Pagination.PageSize,
           showTemp: true,
           name: this.incubatorName,
+          monitorStatus: 1, //监控中
         }
-        getCoolerBox(params).then(res => {
+        if (this.currentId == 2) {
+          delete params.monitorStatus
+        }
+        await getCoolerBox(params).then(res => {
           if (res.code == 200) {
+            res.data.list.forEach(async item => {
+              item.deviceData.address = ''
+              item.deviceData.address = await this.longitudeLatitude(item.deviceData.T_site)
+            })
             this.tableData = res.data.list
             this.Total = res.data.count
+            this.$forceUpdate()
           }
           this.tableLoading = false
         }).catch(() => {
           this.tableLoading = false
         })
       },
+      // 更新保温箱实时数据
+      refreshData(event, soleSn) {
+        this.tableData.map(async item => {
+          if (item.sn === soleSn) {
+            item.deviceData.address = await this.longitudeLatitude(event.T_site)
+            item.deviceData.T_rh = event.T_rh
+            item.deviceData.T_t = event.T_t
+            item.deviceData.T_time = event.T_time
+            item.deviceData.T_site = event.T_site
+            return
+          }
+        });
+      },
       selectRol(event) {
         if (this.currentId != event.id) {
           if (event.id == 1) {
             this.playbackControl = false
             this.keyUpSearch()
           } else {
+            this.incubatorSn = []
+            this.examine(true)
             this.historicalRoute()
           }
         }
@@ -245,7 +284,49 @@
             item.flag = false
           }
         })
-        this.$forceUpdate
+        this.$forceUpdate()
+      },
+      // 普通类型文字匹配
+      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
+      },
+      // 获取经纬度
+      longitudeLatitude(latitude) {
+        return new Promise((resolve, inject) => {
+          let addressArr = ''
+          var geocoder = new AMap.Geocoder({
+            city: "010", //城市设为北京,默认:“全国”
+            radius: 1000 //范围,默认:500
+          });
+          geocoder.getAddress(latitude, function(status, result) {
+            if (status === 'complete' && result.regeocode) {
+              var address = result.regeocode.formattedAddress;
+              resolve(address)
+            } else {
+              resolve('')
+            }
+          });
+        })
       },
       // 展开收起
       getUnpack() {
@@ -258,68 +339,86 @@
       handleSelectionChange(event) {
         let arr = []
         event.forEach(item => {
-          arr.push(item.sn)
+          let list = {
+            sn: item.sn,
+            name: item.name,
+          }
+          arr.push(list)
         })
         this.incubatorSn = arr
-        // console.log(arr, 35)
       },
       // 查看实时数据
-      async examine() {
+      async examine(event) {
         const that = this
         that.realTimeTrajectory = []
 
         function difference(arr1, arr2) {
-          return arr1.filter(item => !arr2.includes(item));
+          return arr1.filter(item => !arr2.includes(item.sn));
         }
-        const uniqueToFirstArray = difference(that.incubatorSn, that.jointSn);
-        const uniqueToFirstArray1 = difference(that.jointSn, that.incubatorSn);
-        uniqueToFirstArray1.forEach(ique => {
-          that.jointSn = deleteElementById(that.jointSn, ique)
 
-          function deleteElementById(arr, id) {
-            return arr.filter((item) => item !== id);
-          }
-          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)
+        const uniqueToFirstArray = difference(that.incubatorSn, that.jointSn);
+        // console.log(uniqueToFirstArray,324)
+        that.jointSn.forEach(item => {
+          that.eventSource[item.sn].close()
+          if (that.carMarker[item.sn]) {
+            if (that.carMarker[item.sn].marker) {
+              that.carMarker[item.sn].marker.setMap(null)
+            }
+            if (that.carMarker[item.sn].startMarker) {
+              that.carMarker[item.sn].startMarker.setMap(null)
+            }
+            if (that.carMarker[item.sn].polyline) {
+              that.carMarker[item.sn].polyline.setMap(null)
+            }
+            that.carMarker[item.sn] = 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 (event == true) {
+          return
+        }
         if (that.incubatorSn.length > 0) {
+          that.jointSn = that.incubatorSn
+          // 处理 SSE 流
           for (let i = 0; i < uniqueToFirstArray.length; i++) {
-            const T_sn = uniqueToFirstArray[i]
-            // 处理 SSE 流
             that.mapLoading = true
-            that.eventSource[T_sn] = await new EventSource(
-              `http://182.43.247.65:6280/api/waybill/newlocus?T_sn=${T_sn}&id=${deptId.dept.id}`);
-            that.eventSource[T_sn].onopen = function(e) {
-              // console.log('Connection to SSE opened.', e);
-            };
-            that.eventSource[T_sn].onmessage = function(e) {
-              // console.log('Message from SSE stream:', e.data);
-              const arr = JSON.parse(e.data)
+            const T_sn = uniqueToFirstArray[i].sn
+            const CoolerName = uniqueToFirstArray[i].name
+            await that.getDeviceAttachment(T_sn, CoolerName, deptId)
+            that.mapLoading = false
+          }
+        } else {
+          that.$message({
+            message: '请选择保温箱',
+            type: 'warning'
+          });
+        }
+      },
+      // sse连接保温箱设备
+      getDeviceAttachment(T_sn, CoolerName, deptId) {
+        return new Promise((resolve, inject) => {
+          const that = this
+          // that.eventSource[T_sn] = new EventSource(
+          //   `http://182.43.247.65:6280/api/waybill/newlocus?T_sn=${T_sn}&Id=${deptId.dept.id}&CoolerName=${CoolerName}`
+          // ); //测试
+          that.eventSource[T_sn] = new EventSource(
+            `https://colddelivery.coldbaozhida.com/cold_delivery/api/waybill/newlocus?T_sn=${T_sn}&Id=${deptId.dept.id}&CoolerName=${CoolerName}`
+          );//正式
+          that.eventSource[T_sn].onopen = function(e) {
+            // console.log('Connection to SSE opened.', e);
+          };
+          that.eventSource[T_sn].onmessage = function(e) {
+            resolve()
+            // console.log('Message from SSE stream:', e.data);
+            const arr = JSON.parse(e.data)
+            // console.log('Message from SSE stream:', arr);
+            if (arr.data) {
               if (arr.code == 200) {
-                // 判断数组对象中是否存在该对象
-                let index = that.realTimeTrajectory.findIndex((item) => item.sn === arr.sn);
-                // 如果有就替换,没有就添加
-                if (index !== -1) {
-                  that.realTimeTrajectory.splice(index, 1, arr);
-                } else {
-                  that.realTimeTrajectory.push(arr);
-                }
-                that.realTimeTrajectory.forEach(event => {
-                  that.initMarker(event.data[0], event)
-                })
+                that.initMarker(arr.data[0], arr)
+                // 更新数据
+                that.refreshData(arr.data[0], arr.sn)
               } else {
                 that.jointSn = deleteElementById(that.jointSn, T_sn)
 
@@ -329,42 +428,93 @@
                 that.$message.error(arr.msg);
                 that.eventSource[T_sn].close()
               }
-              that.mapLoading = false
-            };
-            that.eventSource[T_sn].onerror = function(e) {
-              that.mapLoading = false
-              console.error('Error from SSE stream:', uniqueToFirstArray[i], e);
-            };
-          }
-        } else {
-          that.$message({
-            message: '请选择保温箱',
-            type: 'warning'
-          });
-        }
+            } else {
+              that.eventSource[T_sn].close()
+              that.$message({
+                message: '设备:' + T_sn + '暂无数据!请开启监控设备',
+                type: 'warning'
+              });
+            }
+          };
+          that.eventSource[T_sn].onerror = function(e) {
+            that.mapLoading = false
+            // console.error('Error from SSE stream:', uniqueToFirstArray[i], e);
+          };
+        })
       },
       // 初始化坐标点的icon
-      initMarker(location, item) {
+      initMarker(location, information) {
+        let that = this
         let latitude = location.T_site.split(',')
-        let dataList = item.data
+        let dataList = information.data
         var trackList = []
-        var positions = item.data
+        var correctionTrajectory = []
+        var positions = information.data
         if (positions.length > 0) {
           positions.forEach(item => {
             if (item.T_site != '0,0' && item.T_site) {
               const data = item.T_site.split(',')
               let arrTrack = [Number(data[0]), Number(data[1])]
+              let corre = {
+                'x': Number(data[0]),
+                'y': Number(data[1]),
+                'sp': 10,
+                'ag': 130,
+                'tm': convertToTimestamp(item.T_time)
+              }
+
+              function convertToTimestamp(dateString) {
+                return new Date(dateString).getTime();
+              }
+              correctionTrajectory.push(corre)
               trackList.push(arrTrack)
             }
           })
         }
         // 生成坐标点icon
-        if (this.carMarker[item.sn]) {
-          if (this.carMarker[item.sn].marker) {
-            this.carMarker[item.sn].marker.setPosition([Number(latitude[0]), Number(latitude[1])])
+        if (that.carMarker[information.sn] && that.carMarker[information.sn] != null) {
+          if (that.carMarker[information.sn].marker) {
+            that.carMarker[information.sn].marker.setMap(null)
+            let icon = new AMap.Icon({
+              size: new AMap.Size(40, 45),
+              image: require(`@/assets/images/truck.png`),
+              imageSize: new AMap.Size(40, 45),
+            });
+            that.carMarker[information.sn].marker = new AMap.Marker({
+              icon: icon, // 坐标点图标
+              position: [Number(latitude[0]), Number(latitude[1])], // 左边点的经纬度
+              offset: new AMap.Pixel(-10, -30) // 坐标点偏移量
+            });
+            var geocoder = new AMap.Geocoder({
+              city: "010", //城市设为北京,默认:“全国”
+              radius: 1000 //范围,默认:500
+            });
+            geocoder.getAddress([Number(latitude[0]), Number(latitude[1])], function(status, result) {
+              if (status === 'complete' && result.regeocode) {
+                var address = result.regeocode.formattedAddress;
+                // 点标记显示内容,HTML要素字符串
+                var markerContent = '' +
+                  '<div class="incubator_card_map">' +
+                  '   <div class="map_title_incu">' + information.CoolerName + '</div>' +
+                  '   <div class="map_title_incu1">' + information.sn + '</div>' +
+                  '   <div class="map_title_incu1">最新温度: <span>' + location.T_t + '</span></div>' +
+                  '   <div class="map_title_incu2">记录时间: ' + location.T_time + '</div>' +
+                  '   <div class="map_title_incu2">当前地址: ' + address + '</div>' +
+                  '   <div class="map_arrows"></div>' +
+                  '</div>';
+                that.carMarker[information.sn].marker.setLabel({
+                  offset: new AMap.Pixel(-3, -68),
+                  content: markerContent,
+                  direction: 'center',
+                })
+                that.carMarker[information.sn].marker.setMap(that.map)
+              }
+            });
           }
-          if (this.carMarker[item.sn].polyline) {
-            this.carMarker[item.sn].polyline.setPath(trackList)
+          that.carMarker[information.sn].polyline = that.carMarker[information.sn].polyline
+          that.carMarker[information.sn].startMarker = that.carMarker[information.sn].startMarker
+          if (that.carMarker[information.sn].polyline) {
+            that.carMarker[information.sn].polyline.setPath(trackList)
           }
         } else {
           // 创建一个 起点Icon
@@ -379,53 +529,94 @@
             image: require(`@/assets/images/truck.png`),
             imageSize: new AMap.Size(40, 45),
           });
-          this.carMarker[item.sn] = {
+          that.carMarker[information.sn] = {
             marker: null,
             polyline: null,
             startMarker: null,
           }
           // 坐标点 生成方法
-          this.carMarker[item.sn].marker = new AMap.Marker({
+          that.carMarker[information.sn].marker = new AMap.Marker({
             icon: icon, // 坐标点图标
             position: [Number(latitude[0]), Number(latitude[1])], // 左边点的经纬度
-            offset: new AMap.Pixel(0, -30) // 坐标点偏移量
+            offset: new AMap.Pixel(-10, -30) // 坐标点偏移量
           });
           // 起点
           var startArr = positions[positions.length - 1].T_site.split(',')
-          this.carMarker[item.sn].startMarker = new AMap.Marker({
+          that.carMarker[information.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">' +
-            '   <div class="map_title_incu">保温箱1</div>' +
-            '   <div class="map_title_incu1">' + item.sn + '</div>' +
-            '   <div class="map_title_incu1">最新温度: <span>' + location.T_t + '</span></div>' +
-            '   <div class="map_title_incu2">记录时间: ' + location.T_time + '</div>' +
-            '   <div class="map_title_incu2">当前地址: ' + location.T_time + '</div>' +
-            '   <div class="map_arrows"></div>' +
-            '</div>';
-          this.carMarker[item.sn].marker.setLabel({
-            offset: new AMap.Pixel(-7, -68),
-            content: markerContent,
-            direction: 'center',
-          })
-          this.carMarker[item.sn].polyline = new AMap.Polyline({
-            map: this.map,
-            path: trackList,
-            showDir: true,
-            strokeColor: "#28F", //线颜色
-            strokeWeight: 10, //线宽
-            strokeStyle: "solid",
-            lineJoin: 'round',
-            lineCap: 'round',
+          that.carMarker[information.sn].startMarker.setMap(that.map)
+          var geocoder = new AMap.Geocoder({
+            city: "010", //城市设为北京,默认:“全国”
+            radius: 1000 //范围,默认:500
+          });
+          geocoder.getAddress([Number(latitude[0]), Number(latitude[1])], function(status, result) {
+            if (status === 'complete' && result.regeocode) {
+              var address = result.regeocode.formattedAddress;
+              // 点标记显示内容,HTML要素字符串
+              var markerContent = '' +
+                '<div class="incubator_card_map">' +
+                '   <div class="map_title_incu">' + information.CoolerName + '</div>' +
+                '   <div class="map_title_incu1">' + information.sn + '</div>' +
+                '   <div class="map_title_incu1">最新温度: <span>' + location.T_t + '</span></div>' +
+                '   <div class="map_title_incu2">记录时间: ' + location.T_time + '</div>' +
+                '   <div class="map_title_incu2">当前地址: ' + address + '</div>' +
+                '   <div class="map_arrows"></div>' +
+                '</div>';
+              that.carMarker[information.sn].marker.setLabel({
+                offset: new AMap.Pixel(-3, -68),
+                content: markerContent,
+                direction: 'center',
+              })
+              that.carMarker[information.sn].marker.setMap(that.map)
+              let colorArr = ['#0070ff', '#E6A23C', '#67C23A', '#f9ff00', '#8fff00', '#a0cfff', '#00ff16',
+                '#00fdff', '#9f00ff', '#ff0000',
+              ]
+              that.carMarker[information.sn].polyline = new AMap.Polyline({
+                map: that.map,
+                path: trackList,
+                showDir: true,
+                strokeColor: colorArr[that.colorIndex], //线颜色
+                strokeWeight: 10, //线宽
+                strokeStyle: "solid",
+                lineJoin: 'round',
+                lineCap: 'round',
+              });
+              that.colorIndex++
+              that.carMarker[information.sn].polyline.setMap(that.map)
+              that.map.setFitView(null, false, [150, 60, 100, 60])
+              // var graspRoad;
+              // if (!graspRoad) {
+              //   graspRoad = new AMap.GraspRoad()
+              // }
+              // console.log(correctionTrajectory, 25425)
+              // graspRoad.driving(correctionTrajectory, function(error, result) {
+              //   console.log(error, result, 25425)
+              //   if (!error) {
+              //     var path2 = [];
+              //     var newPath = result.data.points;
+              //     for (var i = 0; i < newPath.length; i += 1) {
+              //       path2.push([newPath[i].x, newPath[i].y])
+              //     }
+              //     var newLine = new AMap.Polyline({
+              //       path: path2,
+              //       strokeWeight: 8,
+              //       strokeOpacity: 0.8,
+              //       strokeColor: '#28F',
+              //       showDir: true
+              //     })
+              //     that.map.add(newLine)
+              //     that.map.setFitView()
+              //   }
+              // })
+            } else {
+              console.error('根据经纬度查询地址失败')
+            }
           });
-          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])
+        that.map.setFitView(null, false, [150, 60, 100, 60])
       },
       keyUpSearch() {
         var that = this
@@ -448,25 +639,53 @@
       // 选择保温箱
       selectIncubator(event) {
         this.$refs.multipleTable.toggleRowSelection(event);
-        this.incubatorID = event.id
-        if (this.currentId == 2) {
-          event.flag = true
+        if (event.monitorStatus == 4) {
           this.optionFlag = true
-          this.getBoxLocus(event.id)
+          this.timePage = 1
+          this.limitNoil = true
+          this.timeData = []
+          this.$message.error('该保温箱暂未绑定平台');
+        } else {
+          this.incubatorID = event.id
+          if (this.currentId == 2) {
+            event.flag = true
+            this.optionFlag = true
+            this.timePage = 1
+            this.limitNoil = true
+            this.timeData = []
+            this.getBoxLocus()
+          }
         }
       },
       // 重选时间段轨迹
       reelect() {
         this.optionFlag = true
       },
+      // 滚动触底
+      scrollLoad() {
+        if (this.limitNoil && this.timeData.length > 0) {
+          this.getBoxLocus()
+        }
+      },
       // 获取保温箱历史时间段
-      getBoxLocus(boxID) {
+      getBoxLocus() {
         this.timeLoading = true
-        getCoolerBoxLocus({
-          id: boxID,
+        getcoolerboxall({
+          coolerBoxId: this.incubatorID,
+          page: this.timePage,
+          pageSize: 10,
         }).then(res => {
-          if (res.code == 200 && res.data.list != null) {
-            this.timeData = res.data.list
+          if (res.code == 200) {
+            let arr = res.data.list
+            if (this.limitNoil == true && arr) {
+              this.timeData = this.timeData.concat(arr)
+            }
+            if (arr.length >= 10) {
+              this.timePage = ++this.timePage;
+            } else {
+              // 已经没数据了 不需要增加数据
+              this.limitNoil = false;
+            }
           } else {
             this.timeData = []
           }
@@ -480,47 +699,51 @@
         if (this.marker) {
           this.marker.stopMove();
         }
-        getHistoryLocus({
-          sn: event.sn,
-          start_time: event.start_time,
-          end_time: event.end_time,
-          t_id: event.t_id,
-          page: 1,
-          page_z: 999,
-        }).then(res => {
-          if (res.code == 200) {
-            var trackList = []
-            var positions = res.data
-            if (positions.length > 0) {
-              positions.forEach(item => {
-                if (item.T_site != '0,0' && item.T_site) {
-                  const data = item.T_site.split(',')
-                  trackList.push(data)
-                }
-              })
-            }
-            if (this.polyline) {
-              this.polyline.setMap(null); // 移除轨迹
-            }
-            this.polyline = null
-            if (this.passedPolyline) {
-              this.passedPolyline.setMap(null)
-            }
-            this.passedPolyline = null
-            if (this.marker) {
-              this.marker.setMap(null)
-            }
-            this.marker = null
-            if (this.endMarker) {
-              this.endMarker.setMap(null)
+        if (event.sn) {
+          getHistoryLocus({
+            sn: event.sn,
+            start_time: event.coolerBoxUserTime,
+            end_time: event.coolerEndUseTime,
+            // t_id: event.t_id,
+            page: 1,
+            page_z: 999,
+          }).then(res => {
+            if (res.code == 200) {
+              var trackList = []
+              var positions = res.data
+              if (positions && positions.length > 0) {
+                positions.forEach(item => {
+                  if (item.T_site != '0,0' && item.T_site) {
+                    const data = item.T_site.split(',')
+                    trackList.push(data)
+                  }
+                })
+              }
+              if (this.polyline) {
+                this.polyline.setMap(null); // 移除轨迹
+              }
+              this.polyline = null
+              if (this.passedPolyline) {
+                this.passedPolyline.setMap(null)
+              }
+              this.passedPolyline = null
+              if (this.marker) {
+                this.marker.setMap(null)
+              }
+              this.marker = null
+              if (this.endMarker) {
+                this.endMarker.setMap(null)
+              }
+              this.endMarker = null
+              this.trackList = trackList
+              this.optionFlag = false
+              this.trackCircle = true
+              if (trackList.length > 0) {
+                this.initMap(trackList)
+              }
             }
-            this.endMarker = null
-            this.trackList = trackList
-            this.optionFlag = false
-            this.trackCircle = true
-            this.initMap(trackList)
-          }
-        })
+          })
+        }
       },
       // 历史轨迹
       initMap(arr) {
@@ -656,10 +879,10 @@
       },
       // 弹窗关闭
       dialogClose() {
-        if (this.incubatorSn.length > 0) {
-          this.incubatorSn.forEach(item => {
-            if(this.eventSource[item]){
-              this.eventSource[item].close()
+        if (this.jointSn.length > 0) {
+          this.jointSn.forEach(item => {
+            if (this.eventSource[item.sn]) {
+              this.eventSource[item.sn].close()
             }
           })
         }
@@ -672,6 +895,13 @@
             item.flag = false
           }
         })
+        this.incubatorSn = []
+        this.jointSn = []
+        this.realTimeTrajectory = []
+        this.carMarker = []
+        this.$nextTick(() => {
+          this.$refs.multipleTable.clearSelection();
+        })
         this.logisticsFlag = true
       },
       changeSize(val) {
@@ -688,6 +918,8 @@
 
 <style lang="scss" scoped>
   ::v-deep .amap-marker-label {
+    bottom: -3px !important;
+    top: unset !important;
     border: unset !important;
     padding: 0px !important;
     background-color: unset !important;
@@ -809,6 +1041,10 @@
     overflow: hidden;
   }
 
+  ::v-deep .history_warp .current-row>td.el-table__cell {
+    background-color: #9eb1f7 !important;
+  }
+
   .overturn {
     transform: rotate(180deg);
   }
@@ -879,11 +1115,12 @@
 
   ::v-deep .incubator_card_map {
     position: relative;
-    width: 180px;
+    width: 190px;
     background-color: #fff;
     border: 1px solid #DCDFE6;
     padding: 5px;
     border-radius: 8px;
+    // overflow: hidden;
   }
 
   ::v-deep .map_title_incu {
@@ -902,6 +1139,7 @@
   }
 
   ::v-deep .map_title_incu2 {
+    white-space: normal;
     font-size: 12px;
     margin: 2px 0px;
   }

+ 104 - 23
src/components/forms.vue

@@ -11,40 +11,44 @@
               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"
             :rules="detail ? item.rules : {}" v-if="item.type === 'switch'">
             <div class="forms_switch">
-              <el-switch v-model="ruleForm[`${item.field}`]" active-color="#13ce66"
+              <el-switch v-model="ruleForm[`${item.field}`]" active-color="#13ce66" :disabled="item.disabled"
                 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"
+            <el-input clearable :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" :loading="loadedDrug"
                 @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"
+            <el-table :data="commodityList" stripe style="width: 100%" max-height="220" v-loading="loadedDrug">
+              <el-table-column align="center" prop="physic_name" label="商品名称"></el-table-column>
+              <!-- <el-table-column align="center" prop="address" label="药品图片" width="100">
+                <el-image style="width: 90px; height: 75px"
                   :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="physic_type_desc" label="商品类型"></el-table-column>
+              <el-table-column align="center" prop="pkg_spec_crit" label="商品规格"></el-table-column>
+              <el-table-column align="center" prop="ent_name" label="生产厂家"></el-table-column>
+              <el-table-column align="center" label="操作" width="80" v-if="delDrug">
+                <template slot-scope="scope">
+                  <el-button @click.native.prevent="deleteRow(scope.$index, commodityList)" type="text" size="small">
+                    移除
+                  </el-button>
+                </template>
               </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>
           <!-- 扫描 -->
@@ -117,6 +121,12 @@
             </el-date-picker>
           </el-form-item>
           <el-form-item :label="item.label" :prop="item.field" :rules="detail ? item.rules : {}"
+            v-if="item.type === 'datetime'">
+            <el-date-picker type="datetime" value-format="yyyy-MM-dd HH:mm:ss" v-model="ruleForm[`${item.field}`]"
+              :placeholder="item.placeholder" :disabled="item.disabled">
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item :label="item.label" :prop="item.field" :rules="detail ? item.rules : {}"
             v-if="item.type === 'section'">
             <el-date-picker align="center" v-model="ruleForm[`${item.field}`]" :disabled="item.disabled"
               type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期"
@@ -145,6 +155,16 @@
             <span class="descriptions_title" :style="{color: filterColor(ruleForm,item.options,item.field)}"
               v-else-if="item.type === 'nvarcharil'">{{initDictvalueil(ruleForm,item.options,item.field)}}</span>
           </el-form-item>
+          <el-form-item class="card_descriptions" :label="item.label" :prop="item.field"
+            :rules="detail ? item.rules : {}" v-if="item.type === 'picture'">
+            <div style="display: flex;align-items: center;flex-wrap: wrap;" v-if="item.urlList.length > 0">
+              <div v-for="(item,index) in item.urlList" :key="index">
+                <el-image style="width: 100px; height: 100px;border-radius: 5px;margin-right: 10px;" :src="item"
+                  :preview-src-list="[item]">
+                </el-image>
+              </div>
+            </div>
+          </el-form-item>
           <!-- 单张图片上传 -->
           <el-form-item :class="item.crosswise ? '' : 'card_fuel_gas'" :label="item.label" :prop="item.field"
             :rules="detail ? item.rules : {}" v-if="item.type === 'singleUpload'">
@@ -210,6 +230,7 @@
 <script>
   import {
     getFileToken,
+    aliMsfx
   } from '@/api/login'
   import {
     getIceRaftCode,
@@ -260,7 +281,12 @@
       // 超出隐藏
       beyondHeight: {
         type: String,
-        default: () => '530px',
+        default: () => '630px',
+      },
+      // 商品列表
+      delDrug: {
+        type: Boolean,
+        default: () => false,
       },
     },
     watch: {
@@ -288,6 +314,10 @@
         isScanningGun: false,
         inputsList: [],
         typeField: '',
+
+        // 商品列表
+        commodityList: [],
+        loadedDrug: false,
       }
     },
     methods: {
@@ -440,14 +470,53 @@
       // 添加编号
       serialNumber(field) {
         if (this.inputs) {
-          getIceRaftCode(this.inputs).then(res => {
-            if (res.code == 200) {
-              this.inputsList.push(this.inputs)
-              this.inputsList = this.uniqueArray(this.inputsList)
-              this.inputs = ''
-              this.ruleForm[`${field}`] = this.inputsList
+          if (field == 'drugCode') {
+            let index = this.commodityList.findIndex((item) => item.code === this.inputs);
+            // 如果有就替换,没有就添加
+            if (index == -1) {
+              this.loadedDrug = true
+              aliMsfx({
+                code: this.inputs,
+              }).then(res => {
+                if (res.status == 200) {
+                  this.inputs = ''
+                  let arr = JSON.parse(res.data)
+                  // console.log(arr, 24)
+                  if (arr.result.models.length > 0) {
+                    let drugList = {
+                      code: '',
+                      physic_name: '',
+                      physic_type_desc: '',
+                      pkg_spec_crit: '',
+                      ent_name: '',
+                    }
+                    drugList.code = arr.result.models[0].code
+                    drugList.physic_name = arr.result.models[0].drug_ent_base_d_t_o.physic_name
+                    drugList.physic_type_desc = arr.result.models[0].drug_ent_base_d_t_o.physic_type_desc
+                    drugList.pkg_spec_crit = arr.result.models[0].drug_ent_base_d_t_o.pkg_spec_crit
+                    drugList.ent_name = arr.result.models[0].p_user_ent_d_t_o.ent_name
+                    this.commodityList.push(drugList)
+                    this.commodityList = this.uniqueArray(this.commodityList)
+                    this.ruleForm[`${field}`] = this.commodityList
+                  } else {
+                    this.$message.warning('该商品不存在');
+                  }
+                }
+                this.loadedDrug = false
+              })
+            } else {
+              this.$message.warning('该商品已存在');
             }
-          })
+          } else {
+            getIceRaftCode(this.inputs).then(res => {
+              if (res.code == 200) {
+                this.inputsList.push(this.inputs)
+                this.inputsList = this.uniqueArray(this.inputsList)
+                this.inputs = ''
+                this.ruleForm[`${field}`] = this.inputsList
+              }
+            })
+          }
         }
       },
       // 回车添加
@@ -465,6 +534,10 @@
         arr.push(value)
         this.ruleForm.code = arr
       },
+      // 药品删除
+      deleteRow(index, rows) {
+        rows.splice(index, 1);
+      },
       // 去重
       uniqueArray(arr) {
         return [...new Set(arr)];
@@ -649,4 +722,12 @@
   .forms_switch {
     height: 40px;
   }
+
+  .custom-width {
+    width: 100px;
+  }
+
+  .el-date-editor.el-input {
+    width: 100% !important;
+  }
 </style>

+ 35 - 11
src/components/orderDetails.vue

@@ -15,25 +15,45 @@
               <div style="width: 100%;" v-else-if="item.field == 'divider'">
                 <el-divider>{{item.title}}</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 align="center" prop="physic_name" label="商品名称"></el-table-column>
+                  <!-- <el-table-column align="center" prop="address" label="药品图片" width="100">
+                      <el-image style="width: 90px; height: 75px"
+                        :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="physic_type_desc" label="商品类型"></el-table-column>
+                  <el-table-column align="center" prop="pkg_spec_crit" label="商品规格"></el-table-column>
+                  <el-table-column align="center" prop="ent_name" label="生产厂家"></el-table-column>
+                  <el-table-column align="center" prop="isAssignment" label="分配状态"
+                    v-if="[4,5,6,8].includes(waybillData.status) && !waybillData.isChild">
+                    <template slot-scope="scope">
+                      <div v-if="scope.row.isAssignment">
+                        <el-tag size="medium">已分配</el-tag>
+                      </div>
+                      <div v-else>
+                        <el-tag size="danger">未分配</el-tag>
+                      </div>
+                    </template>
                   </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>
-              <div class="grid-content bg-purple" v-else-if="['status','paymentType','paymentStatus'].includes(item.field) && !mywaybill">
+              <div class="grid-content bg-purple"
+                v-else-if="['status','paymentType','paymentStatus'].includes(item.field) && !mywaybill">
                 <div class="describe">{{item.title}}</div>
                 <div style="text-align: left;line-height: 19px;"
                   :style="{color: filterColor(waybillData,item.options,item.field)}">
                   {{waybillStatus(waybillData[`${item.field}`],item.options)}}
                 </div>
               </div>
+              <div style="display: flex;align-items: center;flex-wrap: wrap;"
+                v-else-if="waybillData.prescription && item.field == 'prescription'">
+                <div class="describe">{{item.title}}</div>
+                <div v-for="(item,index) in waybillData.prescription" :key="index">
+                  <el-image style="width: 100px; height: 100px;border-radius: 5px;margin-right: 10px;" :src="item"
+                    :preview-src-list="[item]">
+                  </el-image>
+                </div>
+              </div>
               <div class="grid-content bg-purple" v-else-if="item.field == 'status' && mywaybill">
                 <div class="describe">{{item.title}}</div>
                 <div style="text-align: left;line-height: 19px;"
@@ -139,6 +159,10 @@
           field: 'divider',
           colWidth: 24,
         }, {
+          title: '处方:',
+          field: 'prescription',
+          colWidth: 24,
+        }, {
           title: '出发时间:',
           field: 'deliveryTime',
           colWidth: 8,
@@ -234,7 +258,7 @@
           window.open(href, "_blank");
         }
       },
-      waybillStatus(value,list) {
+      waybillStatus(value, list) {
         let label = ''
         list.forEach(item => {
           if (item.value == value) {

+ 83 - 5
src/components/prescriptionPicture.vue

@@ -6,7 +6,7 @@
         @close="closeDialog">
         <div class="card_prescription">
           <div class="title_prescription">处方图片:</div>
-          <el-upload action="#" list-type="picture-card" :file-list="fileList">
+          <el-upload action="#" list-type="picture-card" :file-list="fileList" :http-request="UploadImage">
             <i slot="default" class="el-icon-plus"></i>
             <div slot="file" slot-scope="{file}">
               <img class="el-upload-list__item-thumbnail" :src="file.url" alt="">
@@ -22,10 +22,13 @@
           </el-upload>
           <div class="title_prescription">已有处方图片:</div>
           <div class="card_prescription_picture">
-            <div class="img_prescription_picture" v-for="(item,index) in fileList" :key="index">
-              <el-image class="image_picture" :src="item.url" :preview-src-list="srcList" :initial-index="urlIndex"
+            <div class="img_prescription_picture" v-for="(item,index) in srcList" :key="index">
+              <el-image class="image_picture" :src="item" :preview-src-list="srcList" :initial-index="urlIndex"
                 @click="prescriptionLook(item,index)">
               </el-image>
+              <div @click.stop="delPicture(item,index)">
+                <i class="el-icon-error del_picture"></i>
+              </div>
             </div>
           </div>
         </div>
@@ -41,6 +44,12 @@
 </template>
 
 <script>
+  import {
+    putWaybill
+  } from '@/api/waybill'
+  import {
+    getFileToken,
+  } from '@/api/login'
   import ElImageViewer from "element-ui/packages/image/src/image-viewer";
   export default {
     props: {
@@ -52,6 +61,10 @@
         type: Array,
         default: () => [],
       },
+      orderID: {
+        type: Number,
+        default: () => null,
+      },
     },
     components: {
       ElImageViewer
@@ -68,7 +81,31 @@
       }
     },
     methods: {
-      sendHandleAdd() {},
+      sendHandleAdd() {
+        this.sendConfirmLoading = true
+        let arrImg = [...this.srcList]
+        this.fileList.forEach(item => {
+          arrImg.push(item.url)
+        })
+        if (arrImg.length > 0) {
+          putWaybill({
+            id: this.orderID,
+            prescription: arrImg,
+          }).then(res => {
+            if (res.code == 200) {
+              this.$message({
+                message: '操作成功',
+                type: 'success'
+              });
+              this.sendConfirmLoading = false
+              this.prescriptionVisible = false
+              this.$emit('prescription')
+            }
+          })
+        } else {
+          this.$message.error('请先上传处方');
+        }
+      },
       // 查看图片
       handlePictureCardPreview(file) {
         this.urlList = this.fileList.filter(e => e.url !== file.url).map(e => e.url);
@@ -84,11 +121,41 @@
       prescriptionLook(file, index) {
         this.urlIndex = index
       },
+      // 删除处方
+      delPicture(event, index) {
+        this.srcList.splice(index, 1)
+      },
       closeViewer() {
         this.showViewer = false
       },
+      // 上传文件
+      UploadImage(file) {
+        const loading = this.$loading({
+          lock: true,
+          text: 'Loading',
+          spinner: 'el-icon-loading',
+          background: 'rgba(0, 0, 0, 0.7)'
+        });
+        this.file = file.file;
+        let formData = new FormData();
+        formData.append('file', this.file);
+        getFileToken(formData).then(res => {
+          if (res.code == 200) {
+            let arr1 = {
+              uid: this.file.uid,
+              url: res.data,
+            }
+            this.fileList.push(arr1)
+          }
+          loading.close();
+        }).catch(e => {
+          console.log(e, 23)
+          loading.close();
+          this.$message.error('上传失败');
+        })
+      },
       closeDialog() {
-
+        this.$emit('closeDialog')
       }
     }
   }
@@ -115,6 +182,7 @@
   }
 
   .img_prescription_picture {
+    position: relative;
     width: 148px;
     height: 148px;
     margin: 0 8px 8px 0;
@@ -126,4 +194,14 @@
     height: 100%;
     border-radius: 6px;
   }
+
+  .del_picture {
+    position: absolute;
+    top: 5px;
+    right: 5px;
+    color: #F56C6C;
+    font-size: 20px;
+    cursor: pointer;
+    z-index: 2;
+  }
 </style>

+ 57 - 5
src/components/tables.vue

@@ -55,6 +55,21 @@
             <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 == 'iceTime'">
+          <template slot-scope="scope" v-if="item.field == 'iceTime'">
+            <div>{{ geticeTime(scope.row) }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column :label="item.label" align="center" v-else-if="item.field == 'historyCode'">
+          <template slot-scope="scope" v-if="item.field == 'historyCode'">
+            <div v-if="scope.row[item.field]">{{ scope.row[item.field].join(',') }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column :label="item.label" align="center" v-else-if="item.field == 'historyCodeNum'">
+          <template slot-scope="scope" v-if="item.field == 'historyCodeNum'">
+            <div v-if="scope.row['historyCode']">{{ scope.row['historyCode'].length }}</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">
@@ -64,6 +79,9 @@
                   v-else-if="child.field == 'iceRaftRecord.suitableForCold' && scope.row.iceRaftRecord.suitableForCold">
                   {{nestedField(scope.row,child.field)}}℃
                 </div>
+                <div v-else-if="child.field == 'suitableForCold'">
+                  {{scope.row.suitableForCold ? scope.row.suitableForCold + '℃' : ''}}
+                </div>
                 <div v-else>{{nestedField(scope.row,child.field)}}</div>
               </template>
             </el-table-column>
@@ -85,7 +103,7 @@
           </template>
         </el-table-column>
         <el-table-column :prop="item.field" :label="item.label" :width="item.colWidth" :align="item.align"
-          v-else-if="['userId','paymentType','paymentStatus','assignmentStatus', 'type', 'status', 'storeId', 'personCode', 'optType', 'corrosion', 'crackle', 'deform', 'damage', 'safeAnnex', 'gasPressure', 'bodyDeform', 'fillingLeak', 'bodyTemperature', 'filledLeak', 'warnSign', 'fillLabel', 'seal','addressType'].includes(item.field)">
+          v-else-if="['userId','paymentType','paymentStatus','assignmentStatus', 'type', 'status', 'monitorStatus', 'storeId', 'personCode', 'optType', 'corrosion', 'crackle', 'deform', 'damage', 'safeAnnex', 'gasPressure', 'bodyDeform', 'fillingLeak', 'bodyTemperature', 'filledLeak', 'warnSign', 'fillLabel', 'seal','addressType'].includes(item.field)">
           <template slot-scope="scope">
             <div :style="{color: filterColor(scope.row,item.options,item.field)}">
               {{initDictvalueil(scope.row,item.options,item.field)}}
@@ -130,7 +148,7 @@
         <el-table-column :prop="item.field" :label="item.label" :width="item.colWidth" :align="item.align"
           v-else-if="item.field == 'freezeClaim'">
           <template slot-scope="scope">
-            <div v-if="scope.row[item.field]">{{scope.row[item.field]}}h</div>
+            <div v-if="scope.row[item.field]">{{getFreeze(scope.row[item.field])}}</div>
             <div v-else-if="scope.row.iceRaftRecord">
               <span v-if="scope.row.iceRaftRecord.status">≥{{scope.row.iceRaftRecord.freezeClaim}}h</span>
             </div>
@@ -252,6 +270,24 @@
       }
     },
     methods: {
+      geticeTime(event){
+        let specificDateTime = event.iceRaftRecord.ice_use_time
+        const specificDate = new Date(specificDateTime);
+        // 获取当前时间
+        const now = new Date();
+        // 计算时间差,得到毫秒数
+        const timeDifference = now - specificDate;
+        // 将时间差转换为小时、分钟和秒
+        const hours = Math.floor(timeDifference / 3600000);
+        const minutes = Math.floor((timeDifference % 3600000) / 60000);
+        const seconds = Math.floor((timeDifference % 60000) / 1000);
+        let time = ''
+        if(minutes){
+          time = hours + 'h' + minutes + 'm'
+        }
+        return time
+        // console.log(`使用时间差: ${hours}小时 ${minutes}分钟 ${seconds}秒`);
+      },
       getImage(image) {
         let arr = []
         arr.push(image)
@@ -261,13 +297,29 @@
       nestedField(event, type) {
         let propertyName = type.split(".")
         let name = ''
-        if (event[propertyName[0]] != undefined) {
-          if (event[propertyName[0]][propertyName[1]]) {
-            name = event[propertyName[0]][propertyName[1]]
+        if (propertyName.length > 1) {
+          if (event[propertyName[0]] != undefined) {
+            if (event[propertyName[0]][propertyName[1]]) {
+              name = event[propertyName[0]][propertyName[1]]
+            }
+          }
+        } else {
+          if (event[propertyName[0]] != undefined) {
+            name = event[propertyName[0]]
           }
         }
         return name
       },
+      // 冷冻要求
+      getFreeze(event) {
+        let title = event
+        let arrList = []
+        title.forEach(item => {
+          let arr = '≥' + item + 'h'
+          arrList.push(arr)
+        })
+        return arrList.toString()
+      },
       // 文字匹配
       initDictvalue(value, list, type) {
         let propertyName = type.split(".")

+ 1 - 1
src/components/treeTable.vue

@@ -21,7 +21,7 @@
           :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)">
+          v-else-if="['isIceReleaseCold','isCoolerReleaseCold','isOutStorage'].includes(item.field)">
           <template slot-scope="scope">
             <div :style="{color: filterColor(scope.row,item.options,item.field)}">
               {{initDictvalueil(scope.row,item.options,item.field)}}

+ 77 - 7
src/components/waybillInformation.vue

@@ -2,7 +2,7 @@
   <div class="card_formation">
     <div class="order_title1" v-if="list.dept">{{list.dept.name}}</div>
     <div class="order_title">运单号: <span>{{list.waybillNo}}</span></div>
-    <div class="order_title">防拆标签码: <span>{{list.tamperProofLabel}}</span></div>
+    <div class="order_title" v-if="list.tamperProofLabel">防拆标签码: <span>{{list.tamperProofLabel}}</span></div>
     <div class="order_title">状态 <span :style="{color: filterColor(list)}">{{initDictvalueil(list)}}</span>
     </div>
     <div class="order_title flex_dismantle">
@@ -18,17 +18,39 @@
       <span class="order_phone phone_color" v-if="list.delivery"
         @click="DialProblem(list.delivery.phone)">{{list.delivery.phone}}</span>
     </div>
-    <div class="order_title">
+    <!-- <div class="order_title">
       <div style="display: flex;align-items: center;">收件人:
         <span class="order_name">{{list.consigneeAddressName}}</span>
         <span class="order_phone">{{list.consigneeAddressPhone}}</span>
       </div>
       <span>{{list.consigneeAddressDetails}}</span>
+    </div> -->
+    <div class="drug_division">商品信息</div>
+    <!-- 药品信息 -->
+    <div class="product_card">
+      <div class="item_product" v-for="(item,index) in list.drugs" :key="index">
+        <div>
+          <div class="names_goods">{{item.physic_name}}</div>
+          <div class="tag_goods_card">
+            <el-tag size="mini">{{item.physic_type_desc}}</el-tag>
+          </div>
+          <div class="title_goods">包装规格:{{item.pkg_spec_crit}}</div>
+          <div class="title_goods">生产厂家:<span>{{item.ent_name}}</span></div>
+        </div>
+        <!-- <el-image class="goods_image" :src="item.medicinePicture" mode=""></el-image> -->
+      </div>
+    </div>
+    <div class="prescription_title" v-if="list.prescription">处方:</div>
+    <div style="margin-bottom: 10px;display: flex;align-items: center;flex-wrap: wrap;" v-if="list.prescription">
+      <div v-for="(item1,index1) in list.prescription" :key="index1">
+        <el-image style="width: 100px; height: 100px;border-radius: 4px;" :src="item1" :preview-src-list="[item1]">
+        </el-image>
+      </div>
     </div>
     <div class="order_headline" v-if="list.tamperProofLabelImg">请确定防拆标签完整</div>
     <div class="same_row_in" v-if="list.tamperProofLabelImg">
-      <div v-for="(item,index) in getimagetamper(list)" :key="index">
-        <el-image class="img_antidismantle" :src="item" :preview-src-list="[item]" fit="fill"></el-image>
+      <div v-for="(item2,index2) in getimagetamper(list)" :key="index2">
+        <el-image class="img_antidismantle" :src="item2" :preview-src-list="[item2]" fit="fill"></el-image>
       </div>
     </div>
     <div class="sign_img" v-if="![1,2,3,5,6].includes(list.status)">
@@ -51,18 +73,18 @@
     </div>
     <div class="card_evaluate">
       <span class="title_eval">服务评价</span>
-      <el-rate v-model="list.assessStar" disabled v-if="list.assessStar"></el-rate>
+      <el-rate v-model="list.assessStar" disabled v-if="![1,2,3,4].includes(list.status)"></el-rate>
       <el-rate v-model="value1" v-else></el-rate>
     </div>
     <div class="card_evaluate">
       <span class="title_eval">评价内容</span>
       <el-input type="textarea" :rows="2" placeholder="评价内容" disabled v-model="list.assessContent"
-        v-if="list.assessContent">
+        v-if="![1,2,3,4].includes(list.status)">
       </el-input>
       <el-input type="textarea" :rows="2" placeholder="评价内容" v-model="textarea" v-else>
       </el-input>
     </div>
-    <div class="btn_order" v-if="![1,2,3,5,6].includes(list.status)">
+    <div class="btn_order" v-if="![1,2,3,5,6,7].includes(list.status)">
       <el-button style="width: 50%;" type="danger" plain @click="getTurnDown">拒绝收货</el-button>
       <el-button style="width: 50%;" type="primary" plain @click="getReceiving">确定收货</el-button>
     </div>
@@ -371,4 +393,52 @@
     margin-right: 10px;
     flex: none;
   }
+
+  .drug_division {
+    font-size: 13px;
+    font-weight: bold;
+    border-bottom: 1px solid #DCDFE6;
+    padding-bottom: 5px;
+  }
+
+  .prescription_title {
+    font-size: 13px;
+    margin-bottom: 5px;
+  }
+
+  .product_card {
+    border-radius: 5px;
+    background-color: #fff;
+    // box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+    margin-bottom: 15px;
+  }
+
+  .item_product {
+    display: flex;
+    padding: 15px 10px 10px 10px;
+    border-bottom: 1px solid #DCDFE6;
+  }
+
+  .goods_image {
+    flex: none;
+    width: 90px;
+    height: 75px;
+    border-radius: 5px;
+  }
+
+  .names_goods {
+    font-size: 17px;
+    font-weight: bold;
+  }
+
+  .tag_goods_card {
+    display: flex;
+    padding-top: 5px;
+  }
+
+  .title_goods {
+    color: #606266;
+    font-size: 13px;
+    padding-top: 5px;
+  }
 </style>

+ 9 - 9
src/config/intendant.js

@@ -151,15 +151,15 @@ export const intendantRouter = {
       },
       component: () => import('@/views/OrderManagement/OrderReview'),
     },
-    {
-      path: '/statisticalManagement',
-      name: 'statisticalManagement',
-      meta: {
-        icon: 'icon-tongjifenxi',
-        title: '统计分析管理'
-      },
-      component: () => import('@/views/page/statisticalManagement'),
-    },
+    // {
+    //   path: '/statisticalManagement',
+    //   name: 'statisticalManagement',
+    //   meta: {
+    //     icon: 'icon-tongjifenxi',
+    //     title: '统计分析管理'
+    //   },
+    //   component: () => import('@/views/page/statisticalManagement'),
+    // },
     // {
     //   path: '/WaybillManagement',
     //   name: 'WaybillManagement',

+ 4 - 3
src/main.js

@@ -25,12 +25,13 @@ Vue.prototype.$echarts = echarts;
 
 // 初始化vue-amap
 VueAMap.initAMapApiLoader({
-  key: '7c0390cf6ae1cd6afeef85becf6fa515',
-  plugin: ['AMap.Geocoder', 'AMap.ReverseGeocode', 'AMap.Geolocation', 'AMap.TrackBack'], // 添加您需要的插件
+  key: '7693f1af3c28862be81de4258da53ce1',
+  plugin: ['AMap.Geocoder', 'AMap.GraspRoad', 'AMap.ReverseGeocode', 'AMap.Geolocation',
+  'AMap.TrackBack'], // 添加您需要的插件
 });
 
 window._AMapSecurityConfig = {
-  securityJsCode: "fb3133f64cddac06df9888ec1a4b3ad5",
+  securityJsCode: "1dd8f39efac47571f99e11fe4154e927",
 }
 
 Vue.directive('removeHidden', {

+ 1 - 1
src/utils/request.js

@@ -91,7 +91,7 @@ request.interceptors.response.use((response) => {
       return
     }
     if (res.Code == 200 || res.code == 200 || res.code == 404 || res.code == 401 || res.code == 6401 || res.code ==
-      2000) {
+      2000 || res.code == 1201) {
       return res
     } else {
       Message.error(res.msg || res.message)

+ 6 - 4
src/views/IceCreamFreezer/IceManagement.vue

@@ -145,6 +145,9 @@
       handleAdd() {
         let flag = this.$refs['childRules'].validateForm();
         if (flag) {
+          var turnNum = function(nums) {
+            return nums.map(Number);
+          }
           if (this.operationType == 'add') {
             this.confirmLoading = true
             let arr = []
@@ -152,7 +155,7 @@
             var params = {
               codeList: arr,
               status: this.ruleForm.status,
-              freezeClaim: Number(this.ruleForm.freezeClaim),
+              freezeClaim: turnNum(this.ruleForm.freezeClaim),
               label: this.ruleForm.label,
               suitableForCold: Number(this.ruleForm.suitableForCold),
               iceColdAddress: this.ruleForm.iceColdAddress,
@@ -176,7 +179,7 @@
               id: this.selectingData.id,
               code: this.ruleForm.code,
               status: this.ruleForm.status,
-              freezeClaim: Number(this.ruleForm.freezeClaim),
+              freezeClaim: turnNum(this.ruleForm.freezeClaim),
               label: this.ruleForm.label,
               suitableForCold: Number(this.ruleForm.suitableForCold),
               iceColdAddress: this.ruleForm.iceColdAddress,
@@ -210,7 +213,7 @@
             this.$nextTick(() => {
               this.ruleForm.code = row.code
               this.ruleForm.status = row.status
-              this.ruleForm.freezeClaim = row.freezeClaim
+              this.ruleForm.freezeClaim = row.freezeClaim.map(String);
               this.ruleForm.label = row.label
               this.ruleForm.suitableForCold = row.suitableForCold
               this.ruleForm.iceColdAddress = row.iceColdAddress
@@ -278,7 +281,6 @@
       // 清空表单
       closeDialog() {
         this.$refs.childRules.resetCheck();
-        console.log(this.ruleForm, 2)
       }
     },
   }

+ 710 - 679
src/views/IceCreamFreezer/IceTracingManagement.vue

@@ -97,286 +97,319 @@
 </template>
 
 <script>
-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',
+  import {
+    getIceRaftNewest,
+    iceraftIn,
+    iceraftOut,
+    getIceRaftRecord,
+    putIceRaftRecord,
+    delIceRaftRecord,
+    getRecording,
+    getExportExecl,
+    raftIsoutstorage
+  } 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,
+    usageEmployee
+  } from "./iceRaft.js";
+  export default {
+    name: 'IceManagement',
+    components: {
+      actionBar,
+      tables,
+      pagination,
+      forms
+    },
+    data() {
+      return {
+        operateList: [{
+          type: 'come',
+          title: '入库',
         }, {
-          bgcolor: '#409EFF',
-          label: '冷冻中',
-          value: '1',
+          type: 'goOut',
+          title: '出库',
         }, {
-          bgcolor: '#67C23A',
-          label: '待使用',
-          value: '2',
+          type: 'export',
+          colour: 'success',
+          title: '冰排使用记录',
+        }],
+        formList: [{
+          type: 'input',
+          label: '编号',
+          field: 'code',
+          placeholder: '请输入编号',
         }, {
-          bgcolor: '#E6A23C',
-          label: '使用中',
-          value: '3',
+          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: '#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,
+          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: [],
+        },
+        // 冰排使用记录
+        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 usageList = usageEmployee()
+        var usageArr = deleteElementById(usageList, 'multistage')
+        this.usageLogList = deleteElementById(usageArr, 'action')
+      } else {
+        var tableList = employee()
+        this.tableList = tableList
+        var usageList = usageEmployee()
+        var usageArr1 = deleteElementById(usageList, 'iceRaftRecord.status')
+        this.usageLogList = usageArr1
+      }
+      if (!this.iceColdFlag) {
+        var historyList = historyRecord()
+        this.historyList = deleteElementById(historyList, 'multistage')
+      } else {
+        this.historyList = historyRecord()
+      }
 
-    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
+      function deleteElementById(arr, id) {
+        return arr.filter((item) => item.field !== id);
+      }
       this.getList()
+      this.getFreezer()
+      this.getIncubator()
     },
-    // 获取冰排列表
-    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)
+    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
         }
-      })
-    },
-    // 弹窗表单添加
-    handleAdd() {
-      let flag = this.$refs['childRules'].validateForm();
-      if (flag) {
-        const params = {
-          ...this.ruleForm,
+        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') {
+            raftIsoutstorage({
+              code: params.code,
+            }).then(res => {
+              if (res.code == 200) {
+                if (this.userList.dept) {
+                  if (!this.userList.dept.isOutStorage) {
+                    this.getOutStorage(params, res.msg)
+                  } else {
+                    this.$message.error(res.msg);
+                  }
+                } else {
+                  this.$message.error('当前账户无公司信息');
+                }
+              } else if (res.code == 1201) {
+                this.getOutStorage(params, res.msg)
+              }
+            })
+          }
+        } else {
+          this.$message.error('表单信息不完整,请继续填写完整');
         }
-        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') {
+      },
+      // 冰排出库/装箱
+      getOutStorage(event, msg) {
+        const params = event
+        this.$confirm(msg, '是否继续出库', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
           delete params.iceLockerId
           delete params.freezeClaim
           params.coolerBoxId = Number(params.coolerBoxId)
@@ -390,474 +423,472 @@ export default {
               this.getList()
             }
           })
+        }).catch(() => {
+          console.log('取消出库')
+        });
+      },
+      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()
         }
-      } 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.$forceUpdate()
+      },
+      // 选择保温箱
+      changeSelect(value) {
         this.getraftRecording()
-      }
-      this.$forceUpdate()
-    },
-    // 选择保温箱
-    changeSelect(value) {
-      this.getraftRecording()
-    },
-    // 时间选择搜索
-    timeChange(event) {
-      this.getraftRecording()
-    },
-    // 重置
-    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
+      },
+      // 时间选择搜索
+      timeChange(event) {
+        this.getraftRecording()
+      },
+      // 重置
+      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],
         }
-      })
-    },
-    // 导出冰排使用记录
-    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);
+        getRecording(params).then(res => {
+          if (res.code == 200) {
+            this.usageLogTotal = res.data.count
+            this.usageLogData = res.data.list
+          }
+        })
+      },
+      // 导出冰排使用记录
+      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) {
+            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 {
-            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();
+            this.$message.error('未获取到文件名,导出失败');
           }
-        } else {
-          this.$message.error('未获取到文件名,导出失败');
-        }
-        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 (this.operationType == 'goOut') {
-        if (this.limitNoil) {
-          this.getIncubator()
-        }
-      } else if (this.operationType == 'edit') {
-        if (this.deposit) {
+          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 {
+        } else if (this.operationType == 'goOut') {
           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 = []
+        } else if (this.operationType == 'edit') {
+          if (this.deposit) {
+            if (this.limitNo) {
+              this.getFreezer()
+            }
+          } else {
+            if (this.limitNoil) {
+              this.getIncubator()
+            }
           }
-        })
-        if (this.deposit) {
-          this.getFreezer()
         } else {
-          this.getIncubator()
+          if (type == 'iceLockerId' && this.limitNo) {
+            this.getFreezer()
+          } else if (type == 'coolerBoxId' && this.limitNoil) {
+            this.getIncubator()
+          }
         }
-      } else {
-        if (this.operationType == 'come') {
-          this.formRuleList.forEach(item => {
+      },
+      // 搜索
+      remoteMethod(value) {
+        this.resetSelect()
+        this.staffName = value
+        if (this.operationType == 'edit') {
+          this.editRuleList.forEach(item => {
             if (item.type == 'searchSelect') {
               item.options = []
             }
           })
-          this.getFreezer()
-        } else if (this.operationType == 'goOut') {
-          this.getIncubator()
+          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,
-      }
-      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') {
+      },
+      // 获取冷冻柜列表
+      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)
+                    }
+                  })
+                }
+              } else {
+                this.formList.forEach(item => {
+                  if (item.field == 'iceLockerId') {
                     item.options = item.options.concat(arrList)
                   }
                 })
               }
+            }
+            if (arrList.length >= 10) {
+              this.page = ++this.page;
             } else {
-              this.formList.forEach(item => {
-                if (item.field == 'iceLockerId') {
-                  item.options = item.options.concat(arrList)
-                }
-              })
+              // 已经没数据了 不需要增加数据
+              this.limitNo = false;
             }
           }
-          if (arrList.length >= 10) {
-            this.page = ++this.page;
-          } else {
-            // 已经没数据了 不需要增加数据
-            this.limitNo = false;
-          }
+        })
+      },
+      // 获取保温箱列表
+      getIncubator() {
+        let params = {
+          page: this.page,
+          pageSize: 10,
+          status: '2',
+          name: this.staffName,
         }
-      })
-    },
-    // 获取保温箱列表
-    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') {
+        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)
+                }
+              } else {
+                this.formList.forEach(item => {
+                  if (item.field == 'coolerBoxId') {
                     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.formList.forEach(item => {
-                if (item.field == 'coolerBoxId') {
-                  item.options = item.options.concat(arrList)
-                }
-              })
-              this.incubatorData = this.incubatorData.concat(arrList)
+              // 已经没数据了 不需要增加数据
+              this.limitNoil = false;
             }
-            // this.thermostat.options = this.thermostat.options.concat(arrList)
-          }
-          if (arrList.length >= 10) {
-            this.page = ++this.page;
-          } else {
-            // 已经没数据了 不需要增加数据
-            this.limitNoil = false;
           }
+        })
+      },
+      // 冰排列表
+      buttonData(row, type) {
+        this.operationType = type
+        this.iceRaftId = row.id
+        this.iceRaftCode = row.code
+        if (type == 'logs') {
+          this.historyVisible = true
+          this.getHistory()
         }
-      })
-    },
-    // 冰排列表
-    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
+      },
+      // 获取历史记录列表
+      getHistory(iceRaftId) {
+        var params = {
+          page: this.historyPagination.PageIndex,
+          pageSize: this.historyPagination.PageSize,
+          iceRaftId: this.iceRaftId,
+          // ...this.searchValue
         }
-      })
-    },
-    // 历史记录操作
-    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.deposit = false
-          this.getIncubator()
-          this.editRuleList.push(this.thermostat)
-          // 保温箱
-          this.editRuleForm.coolerBoxId = String(row.coolerBoxId)
+        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.deposit = false
+            this.getIncubator()
+            this.editRuleList.push(this.thermostat)
+            // 保温箱
+            this.editRuleForm.coolerBoxId = String(row.coolerBoxId)
+          }
+          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)
         }
-        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
+      },
+      // 编辑历史记录提交
+      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('取消修改')
+          });
+        } else {
+          this.$message.error('表单信息不完整,请继续填写完整');
         }
-      } else if (type == 'del') {
-        this.delHistory(row.id)
-      }
-    },
-    // 编辑历史记录提交
-    submit() {
-      let flag = this.$refs['editRules'].validateForm();
-      if (flag) {
-        this.$confirm('确定修改该冰排信息吗, 是否继续?', '提示', {
+      },
+      // 删除历史记录
+      delHistory(id) {
+        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 => {
+          delIceRaftRecord({
+            id: id
+          }).then(res => {
             if (res.code == 200) {
-              this.innerVisible = false
               this.$message({
-                type: 'success',
-                message: res.msg
+                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()
             }
           })
         }).catch(() => {
-          // console.log('取消修改')
+          // console.log('已取消删除')
         });
-      } 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()
+      },
+      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 = []
           }
         })
-      }).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 = ''
+      },
+      // 清空表单
+      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;
-}
+  .card_iceTracing ::v-deep .el-dialog__body {
+    padding: 0px 10px !important;
+  }
 </style>

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

@@ -139,15 +139,16 @@ export const formRules = () => {
     field: 'freezeClaim',
     label: '冷冻要求',
     placeholder: '请输入冷冻时间',
-    type: 'input',
+    type: 'select',
     colWidth: 24,
-    unit: '小时',
+    multiple: true,
+    options: freezingRequirement(),
     rules: [{
       required: true,
       message: '请输入冷冻时间',
       trigger: 'blur'
     }]
-  },]
+  }, ]
 }
 export const formRulesCold = () => {
   return [{
@@ -190,7 +191,7 @@ export const formRulesCold = () => {
     placeholder: '请输入冷冻时间',
     type: 'select',
     colWidth: 24,
-    multiple:true,
+    multiple: true,
     options: freezingRequirement(),
     rules: [{
       required: true,

+ 92 - 29
src/views/IceCreamFreezer/iceRaft.js

@@ -24,50 +24,50 @@ export const employee = () => {
     label: '出库时间',
     align: 'center',
   }, {
+    field: 'location',
+    label: '所在位置',
+    align: 'center',
+  }, {
+    field: 'freezeClaim',
+    label: '冷冻要求',
+    align: 'center',
+  }, {
+    field: 'freezeDuration',
+    label: '冷冻时间',
+    align: 'center',
+  }, {
     field: 'multistage',
     label: '冰排释冷',
     children: [{
-      field: 'iceRaftRecord.outStorageTime',
+      field: 'iceRaftRecord.start_ice_cold_time',
       label: '释冷日期',
       align: 'center',
     }, {
-      field: 'iceRaftRecord.endForColdTime',
+      field: 'iceRaftRecord.start_ice_cold_time',
       label: '释冷时间',
       align: 'center',
     }, {
-      field: 'iceRaftRecord.suitableForCold',
+      field: 'suitableForCold',
       label: '释冷温度',
       align: 'center',
     }, {
-      field: 'suitableForColdTime',
+      field: 'iceRaftRecord.ice_cold_address',
       label: '释冷地点',
       align: 'center',
     }]
   }, {
-    field: 'location',
-    label: '所在位置',
-    align: 'center',
-  }, {
-    field: 'freezeClaim',
-    label: '冷冻要求',
-    align: 'center',
-  },{
-    field: 'freezeDuration',
-    label: '冷冻时间',
-    align: 'center',
-  },{
-    field: 'freezeClaim',
+    field: 'iceRaftRecord.ice_use_time',
     label: '使用日期',
     align: 'center',
   }, {
-    field: 'freezeClaim',
+    field: 'iceTime',
     label: '使用时间',
     align: 'center',
   }, {
-    field: 'freezeClaim',
+    field: 'iceRaftRecord.ice_use_users',
     label: '使用人员',
     align: 'center',
-  },  {
+  }, {
     field: 'action',
     label: '操作',
     align: 'center',
@@ -80,17 +80,16 @@ export const employee = () => {
     }]
   }]
 }
-
-export const historyRecord = () => {
+// 冰排使用记录
+export const usageEmployee = () => {
   return [{
     field: 'index',
     label: '序号',
     align: 'center',
   }, {
-    field: 'status',
-    label: '状态',
+    field: 'iceRafts.code',
+    label: '编号',
     align: 'center',
-    options: frozenState()
   }, {
     field: 'inStorageTime',
     label: '入库时间',
@@ -100,26 +99,70 @@ export const historyRecord = () => {
     label: '出库时间',
     align: 'center',
   }, {
+    field: 'location',
+    label: '所在位置',
+    align: 'center',
+  }, {
+    field: 'freezeClaim',
+    label: '冷冻要求',
+    align: 'center',
+  }, {
+    field: 'freezeDuration',
+    label: '冷冻时间',
+    align: 'center',
+  }, {
     field: 'multistage',
     label: '冰排释冷',
     children: [{
-      field: 'reCheck.nickName',
+      field: 'start_ice_cold_time',
       label: '释冷日期',
       align: 'center',
     }, {
-      field: 'reCheck.phone',
+      field: 'start_ice_cold_time',
       label: '释冷时间',
       align: 'center',
     }, {
-      field: 'reCheck.phone',
+      field: 'suitableForCold',
       label: '释冷温度',
       align: 'center',
     }, {
-      field: 'location',
+      field: 'ice_cold_address',
       label: '释冷地点',
       align: 'center',
     }]
   }, {
+    field: 'ice_use_time',
+    label: '使用日期',
+    align: 'center',
+  }, {
+    field: 'ice_use_time',
+    label: '使用时间',
+    align: 'center',
+  }, {
+    field: 'ice_use_users',
+    label: '使用人员',
+    align: 'center',
+  }]
+}
+export const historyRecord = () => {
+  return [{
+    field: 'index',
+    label: '序号',
+    align: 'center',
+  }, {
+    field: 'status',
+    label: '状态',
+    align: 'center',
+    options: frozenState()
+  }, {
+    field: 'inStorageTime',
+    label: '入库时间',
+    align: 'center',
+  }, {
+    field: 'outStorageTime',
+    label: '出库时间',
+    align: 'center',
+  }, {
     field: 'location',
     label: '所在位置',
     align: 'center',
@@ -132,6 +175,26 @@ export const historyRecord = () => {
     label: '冷冻时间',
     align: 'center',
   }, {
+    field: 'multistage',
+    label: '冰排释冷',
+    children: [{
+      field: 'iceRaftRecord.start_ice_cold_time',
+      label: '释冷日期',
+      align: 'center',
+    }, {
+      field: 'iceRaftRecord.start_ice_cold_time',
+      label: '释冷时间',
+      align: 'center',
+    }, {
+      field: 'suitableForCold',
+      label: '释冷温度',
+      align: 'center',
+    }, {
+      field: 'iceRaftRecord.ice_cold_address',
+      label: '释冷地点',
+      align: 'center',
+    }]
+  }, {
     field: 'action',
     label: '操作',
     colWidth: '160px',

+ 1 - 5
src/views/OrderManagement/OrderReview.vue

@@ -71,11 +71,6 @@
           placeholder: '请输入订单编号',
         }, {
           type: 'input',
-          label: '门店名称',
-          field: 'orderNo',
-          placeholder: '请输入门店名称',
-        }, {
-          type: 'input',
           label: '配送员姓名',
           field: 'orderNo',
           placeholder: '请输入配送员姓名',
@@ -207,6 +202,7 @@
         this.orderId = row.id
         if (type == 'logs') {
           this.$refs.order.staffDialogVisible = true
+          this.$refs.order.tableData = row.drugs
           this.waybillData = row
           this.waybillData.coolerBoxName = row.coolerBox.name
           this.waybillData.courierName = row.delivery.nickName

+ 25 - 22
src/views/OrderManagement/cancelledOrder.vue

@@ -18,7 +18,8 @@
       </div>
     </div>
     <orderDetails ref="order" :waybillData="waybillData"></orderDetails>
-    <prescriptionPicture ref="picture" :srcList="srcList" :fileList="fileList"></prescriptionPicture>
+    <prescriptionPicture ref="picture" :srcList="srcList" :fileList="fileList" :orderID="orderID"
+      @prescription="prescription" @closeDialog="closeDialog"></prescriptionPicture>
   </div>
 </template>
 
@@ -51,33 +52,29 @@
         formList: [{
           type: 'input',
           label: '订单编号',
-          field: 'orderNo',
+          field: 'waybillNo',
           placeholder: '请输入订单编号',
         }, {
           type: 'input',
-          label: '门店名称',
-          field: 'orderNo',
-          placeholder: '请输入门店名称',
-        }, {
-          type: 'input',
           label: '配送员姓名',
-          field: 'orderNo',
+          field: 'delivery_name',
           placeholder: '请输入配送员姓名',
         }, {
           type: 'input',
           label: '患者名称',
-          field: 'orderNo',
+          field: 'Consignee_address_name',
           placeholder: '请输入患者名称',
         }, {
           type: 'input',
           label: '患者手机号',
-          field: 'orderNo',
+          field: 'Consignee_address_phone',
           placeholder: '请输入患者手机号',
         }],
         searchRuleForm: {
-          orderNo: '',
-          status: null,
-          time: [],
+          waybillNo: '',
+          delivery_name: '',
+          Consignee_address_name: '',
+          Consignee_address_phone: '',
         },
         searchValue: {},
         Pagination: {
@@ -101,13 +98,8 @@
         }],
         waybillData: {},
         srcList: [],
-        fileList: [{
-          name: 'food.jpeg',
-          url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
-        }, {
-          name: 'food2.jpeg',
-          url: 'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg'
-        }],
+        fileList: [],
+        orderID: null,
       }
     },
     mounted() {
@@ -160,6 +152,7 @@
         this.operationType = type
         if (type == 'logs') {
           this.$refs.order.staffDialogVisible = true
+          this.$refs.order.tableData = row.drugs
           this.waybillData = row
           this.waybillData.coolerBoxName = row.coolerBox.name
           this.waybillData.courierName = row.delivery.nickName
@@ -167,11 +160,17 @@
           this.waybillData.reCheckName = row.reCheck.nickName
           this.waybillData.reCheckPhone = row.reCheck.phone
         } else if (type == 'send') {
-          const urls = this.fileList.map(obj => obj.url)
-          this.srcList = urls
+          if (row.prescription) {
+            this.srcList = row.prescription
+          }
           this.$refs.picture.prescriptionVisible = true
         }
       },
+      // 处方更新
+      prescription() {
+        this.Pagination.PageIndex = 1
+        this.getList()
+      },
       changeSize(val) {
         this.Pagination.PageSize = val
         this.getList()
@@ -180,6 +179,10 @@
         this.Pagination.PageIndex = val
         this.getList()
       },
+      closeDialog() {
+        this.srcList = []
+        this.fileList = []
+      }
     },
   }
 </script>

+ 9 - 14
src/views/OrderManagement/completed.js

@@ -20,15 +20,15 @@ export const employee = () => {
     align: 'center',
     colWidth: '180px',
   }, {
-    field: 'name',
-    label: '门店名称',
+    field: 'status',
+    label: '订单状态',
     align: 'center',
-    colWidth: '180px',
+    options: WaybillStatus(),
+    colWidth: '100px',
   }, {
-    field: 'status',
+    field: 'deliveryType',
     label: '配送类型',
     align: 'center',
-    options: WaybillStatus(),
     colWidth: '180px',
   }, {
     field: 'multistage',
@@ -78,12 +78,7 @@ export const employee = () => {
       colWidth: '220px',
     }, ]
   }, {
-    field: 'deliveryTime',
-    label: '医保归属地',
-    align: 'center',
-    colWidth: '180px',
-  }, {
-    field: 'receiptTime',
+    field: 'askForTime',
     label: '患者要求送达时间',
     align: 'center',
     colWidth: '180px',
@@ -103,7 +98,7 @@ export const employee = () => {
     align: 'center',
     colWidth: '180px',
   }, {
-    field: 'receiptTime',
+    field: 'secondary_time',
     label: '分配时间',
     align: 'center',
     colWidth: '220px',
@@ -127,7 +122,7 @@ export const employee = () => {
     label: '支付状态',
     align: 'center',
     options: stateList(),
-  },{
+  }, {
     field: 'paymentremark',
     label: '未结清备注',
     align: 'center',
@@ -135,7 +130,7 @@ export const employee = () => {
     field: 'assessStar',
     label: '服务评价',
     align: 'center',
-    colWidth: '220px',
+    colWidth: '180px',
   }, {
     field: 'admin_audit_remark',
     label: '审核备注',

+ 52 - 25
src/views/OrderManagement/completedOrder.vue

@@ -7,7 +7,7 @@
     </div>
     <div class="card_content">
       <!-- 表单 -->
-      <tables ref="refWaybill" controlswidth="180px" tableHeight="68vh" :suspension="true" :tableList="tableList"
+      <tables ref="refWaybill" controlswidth="210px" tableHeight="68vh" :suspension="true" :tableList="tableList"
         :tableData="tableData" @buttonData="buttonData">
       </tables>
       <!-- 分页 -->
@@ -18,7 +18,12 @@
       </div>
     </div>
     <orderDetails ref="order" :waybillData="waybillData"></orderDetails>
-    <prescriptionPicture ref="picture" :srcList="srcList" :fileList="fileList"></prescriptionPicture>
+    <prescriptionPicture ref="picture" :srcList="srcList" :fileList="fileList" :orderID="orderId"
+      @prescription="prescription" @closeDialog="closeDialog"></prescriptionPicture>
+    <!-- 修改订单 -->
+    <addEditOrder ref="orderEdit" :orderId="orderId" :staffTitle="staffTitle" :orderInformation="orderInformation"
+      :operationType="operationType" @refreshList="refreshList">
+    </addEditOrder>
   </div>
 </template>
 
@@ -31,6 +36,7 @@
   import pagination from '@/components/pagination'
   import orderDetails from '@/components/orderDetails'
   import prescriptionPicture from '@/components/prescriptionPicture'
+  import addEditOrder from '@/components/addEditOrder'
   import {
     employee,
   } from "./completed.js";
@@ -44,40 +50,37 @@
       tables,
       pagination,
       orderDetails,
-      prescriptionPicture
+      prescriptionPicture,
+      addEditOrder
     },
     data() {
       return {
         formList: [{
           type: 'input',
           label: '订单编号',
-          field: 'orderNo',
+          field: 'waybillNo',
           placeholder: '请输入订单编号',
         }, {
           type: 'input',
-          label: '门店名称',
-          field: 'orderNo',
-          placeholder: '请输入门店名称',
-        }, {
-          type: 'input',
           label: '配送员姓名',
-          field: 'orderNo',
+          field: 'delivery_name',
           placeholder: '请输入配送员姓名',
         }, {
           type: 'input',
           label: '患者名称',
-          field: 'orderNo',
+          field: 'Consignee_address_name',
           placeholder: '请输入患者名称',
         }, {
           type: 'input',
           label: '患者手机号',
-          field: 'orderNo',
+          field: 'Consignee_address_phone',
           placeholder: '请输入患者手机号',
         }],
         searchRuleForm: {
-          orderNo: '',
-          status: null,
-          time: [],
+          waybillNo: '',
+          delivery_name: '',
+          Consignee_address_name: '',
+          Consignee_address_phone: '',
         },
         searchValue: {},
         Pagination: {
@@ -94,6 +97,11 @@
           icon: 'el-icon-tickets',
           style: 'success',
         }, {
+          type: 'edit',
+          label: '修改',
+          icon: 'el-icon-edit',
+          style: 'success',
+        }, {
           type: 'send',
           label: '处方',
           icon: 'el-icon-tickets',
@@ -101,13 +109,10 @@
         }],
         waybillData: {},
         srcList: [],
-        fileList: [{
-          name: 'food.jpeg',
-          url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
-        }, {
-          name: 'food2.jpeg',
-          url: 'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg'
-        }],
+        fileList: [],
+        orderId: null,
+        staffTitle: '',
+        orderInformation: {},
       }
     },
     mounted() {
@@ -131,6 +136,10 @@
         }
         this.getList()
       },
+      // 添加修改刷新列表
+      refreshList() {
+        this.getList()
+      },
       // 获取运单列表
       getList() {
         var params = {
@@ -157,10 +166,11 @@
         this.operationType = type
       },
       buttonData(row, type) {
-        this.operationType = type
+        this.orderId = row.id
         this.operationType = type
         if (type == 'logs') {
           this.$refs.order.staffDialogVisible = true
+          this.$refs.order.tableData = row.drugs
           this.waybillData = row
           this.waybillData.coolerBoxName = row.coolerBox.name
           this.waybillData.courierName = row.delivery.nickName
@@ -168,11 +178,24 @@
           this.waybillData.reCheckName = row.reCheck.nickName
           this.waybillData.reCheckPhone = row.reCheck.phone
         } else if (type == 'send') {
-          const urls = this.fileList.map(obj => obj.url)
-          this.srcList = urls
+          if (row.prescription) {
+            this.srcList = row.prescription
+          }
           this.$refs.picture.prescriptionVisible = true
+        } else if (type == "edit") {
+          this.staffTitle = '修改'
+          this.orderInformation = {}
+          this.$refs.orderEdit.staffDialogVisible = true
+          this.$nextTick(() => {
+            this.orderInformation = row
+          })
         }
       },
+      // 处方更新
+      prescription() {
+        this.Pagination.PageIndex = 1
+        this.getList()
+      },
       changeSize(val) {
         this.Pagination.PageSize = val
         this.getList()
@@ -181,6 +204,10 @@
         this.Pagination.PageIndex = val
         this.getList()
       },
+      closeDialog() {
+        this.srcList = []
+        this.fileList = []
+      }
     },
   }
 </script>

+ 16 - 19
src/views/OrderManagement/delivered.js

@@ -1,6 +1,7 @@
 import {
   startStatus,
-  allocationState
+  allocationState,
+  WaybillStatus
 } from '@/assets/js/blockSort'
 export const employee = () => {
   return [{
@@ -18,21 +19,22 @@ export const employee = () => {
     align: 'center',
     colWidth: '180px',
   }, {
-    field: 'name',
-    label: '门店名称',
-    align: 'center',
-    colWidth: '180px',
-  }, {
     field: 'assignmentStatus',
     label: '分配状态',
     align: 'center',
     options: allocationState(),
     colWidth: '130px',
   }, {
-    field: 'type',
+    field: 'status',
+    label: '订单状态',
+    align: 'center',
+    options: WaybillStatus(),
+    colWidth: '100px',
+  }, {
+    field: 'deliveryType',
     label: '配送类型',
     align: 'center',
-    colWidth: '130px',
+    colWidth: '180px',
   }, {
     field: 'multistage',
     label: '复核人',
@@ -81,26 +83,21 @@ export const employee = () => {
       colWidth: '220px',
     }, ]
   }, {
-    field: 'deliveryTime',
-    label: '医保归属地',
-    align: 'center',
-    colWidth: '180px',
-  }, {
-    field: 'tamperProofLabel',
+    field: 'askForTime',
     label: '患者要求送达时间',
     align: 'center',
     colWidth: '180px',
   }, {
-    field: 'deliveryDuration',
-    label: '分配状态',
+    field: 'orderTime',
+    label: '下单时间',
     align: 'center',
-    colWidth: '180px',
+    colWidth: '220px',
   }, {
-    field: 'receiptTime',
+    field: 'secondary_time',
     label: '分配时间',
     align: 'center',
     colWidth: '220px',
-  },{
+  }, {
     field: 'admin_audit_remark',
     label: '审核备注',
     align: 'center',

+ 52 - 24
src/views/OrderManagement/deliveryOrder.vue

@@ -7,7 +7,7 @@
     </div>
     <div class="card_content">
       <!-- 表单 -->
-      <tables ref="refWaybill" controlswidth="270px" tableHeight="68vh" :suspension="true" :tableList="tableList"
+      <tables ref="refWaybill" controlswidth="300px" tableHeight="68vh" :suspension="true" :tableList="tableList"
         :tableData="tableData" @buttonData="buttonData">
       </tables>
       <!-- 分页 -->
@@ -18,7 +18,12 @@
       </div>
     </div>
     <orderDetails ref="order" :waybillData="waybillData"></orderDetails>
-    <prescriptionPicture ref="picture" :srcList="srcList" :fileList="fileList"></prescriptionPicture>
+    <prescriptionPicture ref="picture" :srcList="srcList" :fileList="fileList" :orderID="orderId"
+      @prescription="prescription" @closeDialog="closeDialog"></prescriptionPicture>
+    <!-- 修改订单 -->
+    <addEditOrder ref="orderEdit" :orderId="orderId" :staffTitle="staffTitle" :orderInformation="orderInformation"
+      :operationType="operationType" @refreshList="refreshList">
+    </addEditOrder>
   </div>
 </template>
 
@@ -32,6 +37,7 @@
   import pagination from '@/components/pagination'
   import orderDetails from '@/components/orderDetails'
   import prescriptionPicture from '@/components/prescriptionPicture'
+  import addEditOrder from '@/components/addEditOrder'
   import {
     employee,
   } from "./ordered.js";
@@ -45,40 +51,37 @@
       tables,
       pagination,
       orderDetails,
-      prescriptionPicture
+      prescriptionPicture,
+      addEditOrder
     },
     data() {
       return {
         formList: [{
           type: 'input',
           label: '订单编号',
-          field: 'orderNo',
+          field: 'waybillNo',
           placeholder: '请输入订单编号',
         }, {
           type: 'input',
-          label: '门店名称',
-          field: 'orderNo',
-          placeholder: '请输入门店名称',
-        }, {
-          type: 'input',
           label: '配送员姓名',
-          field: 'orderNo',
+          field: 'delivery_name',
           placeholder: '请输入配送员姓名',
         }, {
           type: 'input',
           label: '患者名称',
-          field: 'orderNo',
+          field: 'Consignee_address_name',
           placeholder: '请输入患者名称',
         }, {
           type: 'input',
           label: '患者手机号',
-          field: 'orderNo',
+          field: 'Consignee_address_phone',
           placeholder: '请输入患者手机号',
         }],
         searchRuleForm: {
-          orderNo: '',
-          status: null,
-          time: [],
+          waybillNo: '',
+          delivery_name: '',
+          Consignee_address_name: '',
+          Consignee_address_phone: '',
         },
         searchValue: {},
         Pagination: {
@@ -95,6 +98,11 @@
           icon: 'el-icon-tickets',
           style: 'success',
         }, {
+          type: 'edit',
+          label: '修改',
+          icon: 'el-icon-edit',
+          style: 'success',
+        }, {
           type: 'send',
           label: '处方',
           icon: 'el-icon-tickets',
@@ -107,13 +115,10 @@
         }],
         waybillData: {},
         srcList: [],
-        fileList: [{
-          name: 'food.jpeg',
-          url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
-        }, {
-          name: 'food2.jpeg',
-          url: 'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg'
-        }],
+        fileList: [],
+        orderId: null,
+        staffTitle: '',
+        orderInformation: {},
       }
     },
     mounted() {
@@ -163,9 +168,11 @@
         this.operationType = type
       },
       buttonData(row, type) {
+        this.orderId = row.id
         this.operationType = type
         if (type == 'logs') {
           this.$refs.order.staffDialogVisible = true
+          this.$refs.order.tableData = row.drugs
           this.waybillData = row
           this.waybillData.coolerBoxName = row.coolerBox.name
           this.waybillData.courierName = row.delivery.nickName
@@ -173,8 +180,9 @@
           this.waybillData.reCheckName = row.reCheck.nickName
           this.waybillData.reCheckPhone = row.reCheck.phone
         } else if (type == 'send') {
-          const urls = this.fileList.map(obj => obj.url)
-          this.srcList = urls
+          if (row.prescription) {
+            this.srcList = row.prescription
+          }
           this.$refs.picture.prescriptionVisible = true
         } else if (type == 'delOrder') {
           this.$confirm('此操作将永久删除该订单, 是否继续?', '提示', {
@@ -197,8 +205,24 @@
               }
             })
           }).catch(() => {})
+        } else if (type == "edit") {
+          this.staffTitle = '修改'
+          this.orderInformation = {}
+          this.$refs.orderEdit.staffDialogVisible = true
+          this.$nextTick(() => {
+            this.orderInformation = row
+          })
         }
       },
+      // 添加修改刷新列表
+      refreshList() {
+        this.getList()
+      },
+      // 处方更新
+      prescription() {
+        this.Pagination.PageIndex = 1
+        this.getList()
+      },
       changeSize(val) {
         this.Pagination.PageSize = val
         this.getList()
@@ -207,6 +231,10 @@
         this.Pagination.PageIndex = val
         this.getList()
       },
+      closeDialog() {
+        this.srcList = []
+        this.fileList = []
+      }
     },
   }
 </script>

+ 10 - 15
src/views/OrderManagement/ordered.js

@@ -18,15 +18,15 @@ export const employee = () => {
     align: 'center',
     colWidth: '180px',
   }, {
-    field: 'name',
-    label: '门店名称',
+    field: 'status',
+    label: '订单状态',
     align: 'center',
-    colWidth: '180px',
+    options: WaybillStatus(),
+    colWidth: '100px',
   }, {
-    field: 'status',
+    field: 'deliveryType',
     label: '配送类型',
     align: 'center',
-    options: WaybillStatus(),
     colWidth: '180px',
   }, {
     field: 'multistage',
@@ -76,12 +76,7 @@ export const employee = () => {
       colWidth: '220px',
     }, ]
   }, {
-    field: 'deliveryTime',
-    label: '医保归属地',
-    align: 'center',
-    colWidth: '180px',
-  }, {
-    field: 'receiptTime',
+    field: 'askForTime',
     label: '患者要求送达时间',
     align: 'center',
     colWidth: '180px',
@@ -100,16 +95,16 @@ export const employee = () => {
     label: '冰排编号',
     align: 'center',
     colWidth: '180px',
-  },{
-    field: 'assesstime',
+  }, {
+    field: 'secondary_time',
     label: '分配时间',
     align: 'center',
     colWidth: '220px',
-  },{
+  }, {
     field: 'admin_audit_remark',
     label: '审核备注',
     align: 'center',
-  },  {
+  }, {
     field: 'unpackBtn',
     label: '操作',
     colWidth: '340px',

+ 53 - 24
src/views/OrderManagement/pendingOrder.vue

@@ -7,7 +7,7 @@
     </div>
     <div class="card_content">
       <!-- 表单 -->
-      <tables ref="refWaybill" controlswidth="340px" tableHeight="68vh" :suspension="true" :tableList="tableList"
+      <tables ref="refWaybill" controlswidth="360px" tableHeight="68vh" :suspension="true" :tableList="tableList"
         :tableData="tableData" @buttonData="buttonData">
       </tables>
       <!-- 分页 -->
@@ -29,7 +29,12 @@
         <el-button type="primary" :loading="sendConfirmLoading" @click.stop="sendHandleAdd">确 定</el-button>
       </span>
     </el-dialog>
-    <prescriptionPicture ref="picture" :srcList="srcList" :fileList="fileList"></prescriptionPicture>
+    <prescriptionPicture ref="picture" :srcList="srcList" :fileList="fileList" :orderID="orderId"
+      @prescription="prescription" @closeDialog="closeDialogil"></prescriptionPicture>
+    <!-- 修改订单 -->
+    <addEditOrder ref="orderEdit" :orderId="orderId" :staffTitle="staffTitle" :orderInformation="orderInformation"
+      :operationType="operationType" @refreshList="refreshList">
+    </addEditOrder>
   </div>
 </template>
 
@@ -49,6 +54,7 @@
   import forms from '@/components/forms'
   import orderDetails from '@/components/orderDetails'
   import prescriptionPicture from '@/components/prescriptionPicture'
+  import addEditOrder from '@/components/addEditOrder'
   import {
     employee,
     sendList
@@ -67,7 +73,8 @@
       pagination,
       forms,
       orderDetails,
-      prescriptionPicture
+      prescriptionPicture,
+      addEditOrder
     },
     data() {
       return {
@@ -79,27 +86,22 @@
         formList: [{
           type: 'input',
           label: '订单编号',
-          field: 'orderNo',
+          field: 'waybillNo',
           placeholder: '请输入订单编号',
         }, {
           type: 'input',
-          label: '门店名称',
-          field: 'orderNo',
-          placeholder: '请输入门店名称',
-        }, {
-          type: 'input',
           label: '配送员姓名',
-          field: 'orderNo',
+          field: 'delivery_name',
           placeholder: '请输入配送员姓名',
         }, {
           type: 'input',
           label: '患者名称',
-          field: 'orderNo',
+          field: 'Consignee_address_name',
           placeholder: '请输入患者名称',
         }, {
           type: 'input',
           label: '患者手机号',
-          field: 'orderNo',
+          field: 'Consignee_address_phone',
           placeholder: '请输入患者手机号',
         }, {
           type: 'select',
@@ -109,9 +111,11 @@
           options: allocationState(),
         }],
         searchRuleForm: {
-          orderNo: '',
+          waybillNo: '',
+          delivery_name: '',
+          Consignee_address_name: '',
+          Consignee_address_phone: '',
           status: null,
-          time: [],
         },
         searchValue: {},
         Pagination: {
@@ -128,6 +132,11 @@
           icon: 'el-icon-tickets',
           style: 'success',
         }, {
+          type: 'edit',
+          label: '修改',
+          icon: 'el-icon-edit',
+          style: 'success',
+        }, {
           type: 'send',
           label: '处方',
           icon: 'el-icon-tickets',
@@ -162,13 +171,9 @@
         orderId: null,
         waybillData: {},
         srcList: [],
-        fileList: [{
-          name: 'food.jpeg',
-          url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
-        }, {
-          name: 'food2.jpeg',
-          url: 'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg'
-        }],
+        fileList: [],
+        staffTitle: '',
+        orderInformation: {},
       }
     },
     mounted() {
@@ -251,6 +256,7 @@
         this.orderId = row.id
         if (type == 'logs') {
           this.$refs.order.staffDialogVisible = true
+          this.$refs.order.tableData = row.drugs
           this.waybillData = row
           this.waybillData.coolerBoxName = row.coolerBox.name
           this.waybillData.courierName = row.delivery.nickName
@@ -258,8 +264,9 @@
           this.waybillData.reCheckName = row.reCheck.nickName
           this.waybillData.reCheckPhone = row.reCheck.phone
         } else if (type == 'send') {
-          const urls = this.fileList.map(obj => obj.url)
-          this.srcList = urls
+          if (row.prescription) {
+            this.srcList = row.prescription
+          }
           this.$refs.picture.prescriptionVisible = true
         } else if (type == 'sign') {
           this.sendDialogVisible = true
@@ -311,8 +318,19 @@
               }
             })
           }).catch(() => {})
+        } else if (type == "edit") {
+          this.staffTitle = '修改'
+          this.orderInformation = {}
+          this.$refs.orderEdit.staffDialogVisible = true
+          this.$nextTick(() => {
+            this.orderInformation = row
+          })
         }
       },
+      // 添加修改刷新列表
+      refreshList() {
+        this.getList()
+      },
       // 触底事件
       handleScroll() {
         if (this.limitNo) {
@@ -368,11 +386,13 @@
             tamperProofLabel: this.sendRuleForm.tamperProofLabel,
             tamperProofLabelImg: this.sendRuleForm.tamperProofLabelImg,
           }
+          if (param.iceRaftCode) {
+            delete param.iceRaftCode
+          }
           if (this.sendRuleForm.fileList) {
             var fileImage = this.picture(this.sendRuleForm.fileList)
             param.tamperProofLabelImg = fileImage
           }
-          console.log(param, 25)
           waybillDelivery(param).then(res => {
             if (res.code == 200) {
               this.$message({
@@ -498,6 +518,11 @@
           })
         }
       },
+      // 处方更新
+      prescription() {
+        this.Pagination.PageIndex = 1
+        this.getList()
+      },
       changeSize(val) {
         this.Pagination.PageSize = val
         this.getList()
@@ -510,6 +535,10 @@
       closeDialog() {
         // this.$refs.sendRules.resetCheck();
       },
+      closeDialogil() {
+        this.srcList = []
+        this.fileList = []
+      }
     },
   }
 </script>

+ 26 - 21
src/views/OrderManagement/rejectionOrder.vue

@@ -51,33 +51,29 @@
         formList: [{
           type: 'input',
           label: '订单编号',
-          field: 'orderNo',
+          field: 'waybillNo',
           placeholder: '请输入订单编号',
         }, {
           type: 'input',
-          label: '门店名称',
-          field: 'orderNo',
-          placeholder: '请输入门店名称',
-        }, {
-          type: 'input',
           label: '配送员姓名',
-          field: 'orderNo',
+          field: 'delivery_name',
           placeholder: '请输入配送员姓名',
         }, {
           type: 'input',
           label: '患者名称',
-          field: 'orderNo',
+          field: 'Consignee_address_name',
           placeholder: '请输入患者名称',
         }, {
           type: 'input',
           label: '患者手机号',
-          field: 'orderNo',
+          field: 'Consignee_address_phone',
           placeholder: '请输入患者手机号',
         }],
         searchRuleForm: {
-          orderNo: '',
-          status: null,
-          time: [],
+          waybillNo: '',
+          delivery_name: '',
+          Consignee_address_name: '',
+          Consignee_address_phone: '',
         },
         searchValue: {},
         Pagination: {
@@ -88,15 +84,20 @@
         operationType: '',
         tableData: [],
         tableList: [],
-        waybillData: {},
-        srcList: [],
-        fileList: [{
-          name: 'food.jpeg',
-          url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
+        btnData: [{
+          type: 'logs',
+          label: '详情',
+          icon: 'el-icon-tickets',
+          style: 'success',
         }, {
-          name: 'food2.jpeg',
-          url: 'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg'
+          type: 'delOrder',
+          label: '删除订单',
+          icon: 'el-icon-delete',
+          style: 'danger',
         }],
+        waybillData: {},
+        srcList: [],
+        fileList: [],
         receiptsign: {
           field: 'receiptsign',
           label: '客户签字图片',
@@ -118,8 +119,12 @@
     },
     mounted() {
       let arr = employee()
-      const updatedItems = arr.filter(item => item.field !== 'unpackBtn');
-      this.tableList = updatedItems
+      arr.forEach(item => {
+        if (item.field == 'unpackBtn') {
+          item.labelButton = this.btnData
+        }
+      })
+      this.tableList = arr
       this.tableList.push(this.receiptsign)
       this.tableList.push(this.receiptImg)
       this.tableList.push(this.reasonRejection)

+ 66 - 34
src/views/OrderManagement/reviewedOrder.vue

@@ -7,7 +7,7 @@
     </div>
     <div class="card_content">
       <!-- 表单 -->
-      <tables ref="refWaybill" controlswidth="270px" tableHeight="68vh" :suspension="true" :tableList="tableList"
+      <tables ref="refWaybill" controlswidth="300px" tableHeight="68vh" :suspension="true" :tableList="tableList"
         :tableData="tableData" @buttonData="buttonData">
       </tables>
       <!-- 分页 -->
@@ -18,10 +18,11 @@
       </div>
     </div>
     <!-- 处方 -->
-    <prescriptionPicture ref="picture" :srcList="srcList" :fileList="fileList"></prescriptionPicture>
-    <el-dialog title="订单审核" :visible.sync="auditDialogVisible" width="800px" :close-on-click-modal="false"
+    <prescriptionPicture ref="picture" :srcList="srcList" :fileList="fileList" :orderID="orderID"
+      @prescription="prescription" @closeDialog="closeDialog"></prescriptionPicture>
+    <el-dialog top="5vh" title="订单审核" :visible.sync="auditDialogVisible" width="800px" :close-on-click-modal="false"
       @close="closeDialog1">
-      <forms ref="auditRules" beyondHeight="700px" :formNewList="auditRuleList" :ruleForm="auditRuleForm"
+      <forms ref="auditRules" beyondHeight="1000px" :formNewList="auditRuleList" :ruleForm="auditRuleForm"
         labelWidth="130px">
       </forms>
       <el-divider>复核内容审批</el-divider>
@@ -46,6 +47,9 @@
         <el-button type="primary" :loading="auditConfirmLoading" @click="auditHandleAdd(3)">确 定</el-button>
       </span>
     </el-dialog>
+    <addEditOrder ref="order" :orderId="orderID" :staffTitle="staffTitle" :orderInformation="orderInformation"
+      :operationType="operationType" @refreshList="refreshList">
+    </addEditOrder>
   </div>
 </template>
 
@@ -61,6 +65,7 @@
   import orderDetails from '@/components/orderDetails'
   import prescriptionPicture from '@/components/prescriptionPicture'
   import forms from '@/components/forms'
+  import addEditOrder from '@/components/addEditOrder'
   import {
     employee,
     auditList,
@@ -77,40 +82,37 @@
       pagination,
       orderDetails,
       prescriptionPicture,
-      forms
+      forms,
+      addEditOrder
     },
     data() {
       return {
         formList: [{
           type: 'input',
           label: '订单编号',
-          field: 'orderNo',
+          field: 'waybillNo',
           placeholder: '请输入订单编号',
         }, {
           type: 'input',
-          label: '门店名称',
-          field: 'orderNo',
-          placeholder: '请输入门店名称',
-        }, {
-          type: 'input',
           label: '配送员姓名',
-          field: 'orderNo',
+          field: 'delivery_name',
           placeholder: '请输入配送员姓名',
         }, {
           type: 'input',
           label: '患者名称',
-          field: 'orderNo',
+          field: 'Consignee_address_name',
           placeholder: '请输入患者名称',
         }, {
           type: 'input',
           label: '患者手机号',
-          field: 'orderNo',
+          field: 'Consignee_address_phone',
           placeholder: '请输入患者手机号',
         }],
         searchRuleForm: {
-          orderNo: '',
-          status: null,
-          time: [],
+          waybillNo: '',
+          delivery_name: '',
+          Consignee_address_name: '',
+          Consignee_address_phone: '',
         },
         searchValue: {},
         Pagination: {
@@ -127,6 +129,11 @@
           icon: 'el-icon-tickets',
           style: 'primary',
         }, {
+          type: 'edit',
+          label: '修改',
+          icon: 'el-icon-edit',
+          style: 'success',
+        }, {
           type: 'audit',
           label: '审核',
           icon: 'el-icon-share',
@@ -138,24 +145,14 @@
           style: 'danger',
         }],
         srcList: [],
-        fileList: [{
-          name: 'food.jpeg',
-          url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
-        }, {
-          name: 'food2.jpeg',
-          url: 'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg'
-        }],
+        fileList: [],
 
         auditDialogVisible: false,
         auditRuleList: auditList(),
         auditRuleForm: {
           confirmName: '',
           confirmPhoneNumber: '',
-          reviewName: '',
-          reviewPhoneNumber: '',
           orderNo: '',
-          nameCode: '',
-          name: '',
           type: '',
           deliveryTime: '',
           status: '',
@@ -175,10 +172,12 @@
           dispensingMedicinesIssue: 1,
           isCold: 1,
         },
-        orderID: '',
+        orderID: null,
         causeVisible: false,
         causeLoading: false,
         auditRemark: '',
+        staffTitle: '',
+        orderInformation: {},
       }
     },
     mounted() {
@@ -234,18 +233,19 @@
       // 订单审核
       auditHandleAdd(event) {
         let flag = this.$refs['auditRules'].validateForm();
-        if (flag) {
+        let flag1 = this.$refs['auditRules1'].validateForm();
+        if (flag && flag1) {
           let params = {
             id: this.orderID,
             status: null,
             ...this.reviewRuleForm,
           }
           if (event == 7) {
-            this.auditConfirmLoading = true
+            this.causeLoading = true
             params.status = event
             params.audit_remark = this.auditRemark
           } else {
-            this.causeLoading = true
+            this.auditConfirmLoading = true
             params.status = event
           }
           if (params.status == 7 && !this.auditRemark) {
@@ -269,10 +269,22 @@
         this.orderID = row.id
         this.operationType = type
         if (type == 'send') {
-          const urls = this.fileList.map(obj => obj.url)
-          this.srcList = urls
+          if (row.prescription) {
+            this.srcList = row.prescription
+          }
           this.$refs.picture.prescriptionVisible = true
         } else if (type == 'audit') {
+          this.auditRuleForm = JSON.parse(JSON.stringify(row))
+          this.$nextTick(() => {
+            if (row.prescription) {
+              this.auditRuleList.forEach(item => {
+                if (item.field == 'tamperProofLabelImg') {
+                  item.urlList = row.prescription
+                }
+              })
+            }
+            this.$refs.auditRules.commodityList = row.drugs
+          })
           this.auditDialogVisible = true
         } else if (type == 'delOrder') {
           this.$confirm('此操作将永久删除该订单, 是否继续?', '提示', {
@@ -295,8 +307,24 @@
               }
             })
           }).catch(() => {})
+        } else if (type == "edit") {
+          this.staffTitle = '修改'
+          this.orderInformation = {}
+          this.$refs.order.staffDialogVisible = true
+          this.$nextTick(() => {
+            this.orderInformation = row
+          })
         }
       },
+      // 添加修改刷新列表
+      refreshList() {
+        this.getList()
+      },
+      // 处方更新
+      prescription() {
+        this.Pagination.PageIndex = 1
+        this.getList()
+      },
       changeSize(val) {
         this.Pagination.PageSize = val
         this.getList()
@@ -309,6 +337,10 @@
       closeDialog1() {
         this.$refs.auditRules.resetCheck();
       },
+      closeDialog() {
+        this.srcList = []
+        this.fileList = []
+      }
     },
   }
 </script>

+ 105 - 129
src/views/OrderManagement/uncertain.js

@@ -18,18 +18,13 @@ export const employee = () => {
     align: 'center',
     colWidth: '180px',
   }, {
-    field: 'name',
-    label: '门店名称',
-    align: 'center',
-    colWidth: '180px',
-  }, {
     field: 'status',
     label: '订单状态',
     align: 'center',
     options: WaybillStatus(),
     colWidth: '130px',
   }, {
-    field: 'type',
+    field: 'deliveryType',
     label: '配送类型',
     align: 'center',
     colWidth: '130px',
@@ -49,16 +44,11 @@ export const employee = () => {
     align: 'center',
     colWidth: '180px',
   }, {
-    field: 'tamperProofLabel',
+    field: 'askForTime',
     label: '患者要求送达时间',
     align: 'center',
     colWidth: '180px',
   }, {
-    field: 'deliveryTime',
-    label: '医保归属地',
-    align: 'center',
-    colWidth: '180px',
-  }, {
     field: 'admin_audit_remark',
     label: '审核备注',
     align: 'center',
@@ -76,7 +66,33 @@ export const employee = () => {
 }
 export const formRules = () => {
   return [{
-    field: 'allocation',
+    field: 'deliveryType',
+    label: '配送类型',
+    placeholder: '配送类型',
+    type: 'select',
+    colWidth: 12,
+    options: [{
+      label: '现在配送',
+      value: '现在配送',
+    }],
+    rules: [{
+      required: false,
+      message: '配送类型',
+      trigger: 'blur'
+    }]
+  }, {
+    field: 'askForTime',
+    label: '患者要求送达时间',
+    placeholder: '患者要求送达时间',
+    type: 'datetime',
+    colWidth: 12,
+    rules: [{
+      required: false,
+      message: '患者要求送达时间',
+      trigger: 'blur'
+    }]
+  }, {
+    field: 'is_secondary_distribution',
     label: '二次分配',
     placeholder: '是否二次分配',
     type: 'switch',
@@ -87,14 +103,14 @@ export const formRules = () => {
       trigger: 'blur'
     }]
   }, {
-    field: 'allocation',
+    field: 'drugCode',
     label: '扫码药品条形码',
     placeholder: '请扫码药品条形码',
     type: 'tracingCode',
     colWidth: 18,
     labelWidth: '125px',
     rules: [{
-      required: true,
+      required: false,
       message: '请扫码药品条形码',
       trigger: 'blur'
     }]
@@ -230,148 +246,103 @@ function validatePassword(rule, value, callback) {
 
 export const signList = () => {
   return [{
-    field: 'deptId',
-    type: 'searchSelect',
-    label: '门店',
-    placeholder: '请选择门店',
-    colWidth: 24,
-    multiple: false,
-    rules: [{
-      required: true,
-      message: '请选择门店',
-      trigger: 'blur,change'
-    }],
-    options: [],
-  },
-  // {
-  //   field: 'rejectionReason',
-  //   label: '原因',
-  //   placeholder: '请输入原因',
-  //   type: 'textarea',
-  //   colWidth: 24,
-  // },
+      field: 'deptId',
+      type: 'searchSelect',
+      label: '门店',
+      placeholder: '请选择门店',
+      colWidth: 24,
+      multiple: false,
+      rules: [{
+        required: true,
+        message: '请选择门店',
+        trigger: 'blur,change'
+      }],
+      options: [],
+    },
+    // {
+    //   field: 'rejectionReason',
+    //   label: '原因',
+    //   placeholder: '请输入原因',
+    //   type: 'textarea',
+    //   colWidth: 24,
+    // },
   ]
 }
 export const auditList = () => {
   return [{
-    field: 'confirmName',
+    field: 'confirmer',
     label: '确认人姓名',
     placeholder: '请输入确认人姓名',
     type: 'input',
     colWidth: 12,
+    disabled: true,
     rules: [{
       required: false,
       message: '请输入确认人姓名',
       trigger: 'blur'
     }]
   }, {
-    field: 'confirmPhoneNumber',
+    field: 'confirmerPhone',
     label: '确认人手机号',
     placeholder: '请输入确认人手机号',
     type: 'input',
     colWidth: 12,
+    disabled: true,
     rules: [{
       required: false,
       message: '请输入确认人手机号',
       trigger: 'blur'
     }]
   }, {
-    field: 'reviewName',
-    label: '审核人姓名',
-    placeholder: '请输入审核人姓名',
-    type: 'input',
-    colWidth: 12,
-    rules: [{
-      required: false,
-      message: '请输入审核人姓名',
-      trigger: 'blur'
-    }]
-  }, {
-    field: 'reviewPhoneNumber',
-    label: '审核人手机号',
-    placeholder: '请输入审核人手机号',
-    type: 'input',
-    colWidth: 12,
-    rules: [{
-      required: false,
-      message: '请输入审核人手机号',
-      trigger: 'blur'
-    }]
-  }, {
     field: 'orderNo',
     label: '订单编号',
     placeholder: '请输入订单编号',
     type: 'input',
     colWidth: 12,
+    disabled: true,
     rules: [{
       required: false,
       message: '请输入订单编号',
       trigger: 'blur'
     }]
   }, {
-    field: 'nameCode',
-    label: '门店编码',
-    placeholder: '请输入门店编码',
-    type: 'input',
-    colWidth: 12,
-    rules: [{
-      required: false,
-      message: '请输入门店编码',
-      trigger: 'blur'
-    }]
-  }, {
-    field: 'name',
-    label: '门店名称',
-    placeholder: '请输入门店名称',
-    type: 'input',
-    colWidth: 12,
-    rules: [{
-      required: false,
-      message: '请输入门店名称',
-      trigger: 'blur'
-    }]
-  }, {
-    field: 'type',
+    field: 'deliveryType',
     label: '配送类型',
     placeholder: '配送类型',
-    type: 'input',
+    type: 'select',
+    options: [{
+      label: '现在配送',
+      value: '现在配送',
+    }],
     colWidth: 12,
+    disabled: true,
     rules: [{
       required: false,
       message: '配送类型',
       trigger: 'blur'
     }]
   }, {
-    field: 'deliveryTime',
+    field: 'askForTime',
     label: '患者要求送达时间',
     placeholder: '患者要求送达时间',
-    type: 'input',
+    type: 'datetime',
     colWidth: 12,
+    disabled: true,
     rules: [{
       required: false,
       message: '患者要求送达时间',
       trigger: 'blur'
     }]
   }, {
-    field: 'status',
-    label: '订单状态',
-    placeholder: '订单状态',
-    type: 'input',
-    colWidth: 12,
-    rules: [{
-      required: false,
-      message: '订单状态',
-      trigger: 'blur'
-    }]
-  }, {
     field: 'remark',
-    label: '订单备注',
-    placeholder: '请输入订单备注',
+    label: '备注',
+    placeholder: '备注',
     type: 'input',
     colWidth: 12,
+    disabled: true,
     rules: [{
       required: false,
-      message: '请输入订单备注',
+      message: '备注',
       trigger: 'blur'
     }]
   }, {
@@ -380,6 +351,7 @@ export const auditList = () => {
     placeholder: '请输入患者姓名',
     type: 'input',
     colWidth: 12,
+    disabled: true,
     rules: [{
       required: false,
       message: '请输入患者姓名',
@@ -391,6 +363,7 @@ export const auditList = () => {
     placeholder: '请输入患者手机号',
     type: 'input',
     colWidth: 12,
+    disabled: true,
     rules: [{
       required: false,
       message: '请输入患者手机号',
@@ -402,37 +375,53 @@ export const auditList = () => {
     placeholder: '请输入收货地址',
     type: 'input',
     colWidth: 12,
+    disabled: true,
     rules: [{
       required: false,
       message: '请输入收货地址',
       trigger: 'blur'
     }]
   }, {
-    field: 'domicile',
-    label: '医保归属地',
-    placeholder: '医保归属地',
-    type: 'input',
-    colWidth: 12,
+    field: 'is_secondary_distribution',
+    label: '二次分配',
+    placeholder: '是否二次分配',
+    type: 'switch',
+    colWidth: 6,
+    disabled: true,
     rules: [{
-      required: false,
-      message: '医保归属地',
+      required: true,
+      message: '是否二次分配',
       trigger: 'blur'
     }]
   }, {
+    field: 'divider',
+    label: '订购商品信息',
+    colWidth: 24,
+  }, {
     field: 'tamperProofLabelImg',
     label: '处方图片',
     placeholder: '处方图片',
-    type: 'upload',
+    type: 'picture',
     colWidth: 24,
+    disabled: true,
+    urlList: [],
     crosswise: true,
     rules: [{
       required: false,
-      message: '处方图片',
+      message: '请上传处方图片',
       trigger: 'blur,change'
     }]
   }]
 }
+
 export const examineList = () => {
+  var validateValueIsNotZero = (rule, value, callback) => {
+    if (value === 1) {
+      callback(new Error(rule.message));
+    } else {
+      callback();
+    }
+  };
   return [{
     field: 'prescriptionIssue',
     label: '处方是否审核',
@@ -441,7 +430,7 @@ export const examineList = () => {
     colWidth: 24,
     rules: [{
       required: false,
-      message: '请选择是否审核',
+      message: '请审核处方',
       trigger: 'blur,change'
     }],
     options: [{
@@ -459,8 +448,9 @@ export const examineList = () => {
     colWidth: 24,
     rules: [{
       required: true,
-      message: '请选择是否审核',
-      trigger: 'blur,change'
+      message: '请审核发票/销售小票',
+      trigger: 'blur,change',
+      validator: validateValueIsNotZero
     }],
     options: [{
       label: '已审核',
@@ -477,7 +467,7 @@ export const examineList = () => {
     colWidth: 24,
     rules: [{
       required: false,
-      message: '请选择是否审核',
+      message: '请审核检验报告单',
       trigger: 'blur,change'
     }],
     options: [{
@@ -495,8 +485,9 @@ export const examineList = () => {
     colWidth: 24,
     rules: [{
       required: true,
-      message: '请选择是否审核',
-      trigger: 'blur,change'
+      message: '请审核调配药品信息',
+      trigger: 'blur,change',
+      validator: validateValueIsNotZero
     }],
     options: [{
       label: '已审核',
@@ -525,18 +516,3 @@ export const examineList = () => {
     }]
   }]
 }
-export const consignmentList = () => {
-  return [{
-    field: 'orderNo',
-    label: '订单号',
-    placeholder: '点击按钮生成订单号',
-    type: 'input',
-    colWidth: 15,
-    disabled: true,
-    rules: [{
-      required: true,
-      message: '点击按钮生成订单号',
-      trigger: 'blur'
-    }]
-  }]
-}

+ 42 - 281
src/views/OrderManagement/uncertainOrder.vue

@@ -20,46 +20,12 @@
     <!-- 订单详情 -->
     <orderDetails ref="order" :waybillData="waybillData"></orderDetails>
     <!-- 处方 -->
-    <prescriptionPicture ref="picture" :srcList="srcList" :fileList="fileList"></prescriptionPicture>
-    <!-- 添加订单 -->
-    <el-dialog top="5vh" :title="staffTitle" :visible.sync="staffDialogVisible" width="800px"
-      :close-on-click-modal="false" @close="closePopup">
-      <forms ref="userRules" :formNewList="personnelList" :ruleForm="personnelForm" labelWidth="80px"
-        @remoteMethod="remoteSearch">
-      </forms>
-      <div class="waybill_item">
-        <waybillForm ref="recipients" title="患者信息" :conserveFlag="conserveFlag" thinTitle="患者簿"
-          :ruleForm="recipientsForm" @addressBook="getAddressBook('recipients')" @conserveSelect="conserveSelectil">
-        </waybillForm>
-      </div>
-      <forms ref="childRules" :formNewList="formRuleList" :ruleForm="ruleForm" labelWidth="80px">
-      </forms>
-      <el-dialog width="60%" title="地址簿" :visible.sync="innerVisible" append-to-body>
-        <div class="space_between_in" style="margin-bottom: 15px;">
-          <div style="display: flex;align-items: center;width: 100%;">
-            <h3 style="margin-left: 10px;flex: none;">搜索:</h3>
-            <el-input v-model="bookInput" style="width: 100%;" placeholder="请输入姓名、电话、地址快速查找"
-              @input="fastSearch()"></el-input>
-          </div>
-        </div>
-        <div class="card_book_list">
-          <!-- 表单 -->
-          <tables :suspension="true" :tableList="bookTableList" :tableData="bookTableData" @cellClick="cellClick"
-            @buttonData="buttonData">
-          </tables>
-          <!-- 分页 -->
-          <div v-if="bookTotal">
-            <pagination :total="bookTotal" :currentPage="bookPagination.PageIndex" @changeSize="bookChangeSize"
-              @changeCurrent="bookChangeCurrent">
-            </pagination>
-          </div>
-        </div>
-      </el-dialog>
-      <span slot="footer" class="dialog-footer">
-        <el-button plain @click="staffDialogVisible = false">取 消</el-button>
-        <el-button type="primary" :loading="confirmLoading" @click="handleAdd">确 定</el-button>
-      </span>
-    </el-dialog>
+    <prescriptionPicture ref="picture" :srcList="srcList" :fileList="fileList" :orderID="orderId"
+      @prescription="prescription" @closeDialog="closeDialog"></prescriptionPicture>
+    <!-- 添加编辑订单 -->
+    <addEditOrder ref="orderAddEdit" :orderId="orderId" :staffTitle="staffTitle" :orderInformation="orderInformation"
+      :operationType="operationType" @refreshList="refreshList">
+    </addEditOrder>
     <el-dialog title="转门店" :visible.sync="signDialogVisible" width="500px" :close-on-click-modal="false"
       @close="closeDialog1">
       <forms ref="signRules" :formNewList="signRuleList" :ruleForm="signRuleForm" labelWidth="80px"
@@ -75,6 +41,7 @@
 
 <script>
   import {
+    getCreatesole,
     getWaybill,
     addWaybill,
     putWaybill,
@@ -97,6 +64,7 @@
   import prescriptionPicture from '@/components/prescriptionPicture'
   import waybillForm from '@/components/waybillForm'
   import forms from '@/components/forms'
+  import addEditOrder from '@/components/addEditOrder'
   import {
     employee,
     formRules,
@@ -117,6 +85,7 @@
       prescriptionPicture,
       waybillForm,
       forms,
+      addEditOrder
     },
     data() {
       return {
@@ -137,29 +106,25 @@
           placeholder: '请输入订单编号',
         }, {
           type: 'input',
-          label: '门店名称',
-          field: 'orderNo',
-          placeholder: '请输入门店名称',
-        }, {
-          type: 'input',
           label: '配送员姓名',
-          field: 'orderNo',
+          field: 'delivery_name',
           placeholder: '请输入配送员姓名',
         }, {
           type: 'input',
           label: '患者名称',
-          field: 'orderNo',
+          field: 'Consignee_address_name',
           placeholder: '请输入患者名称',
         }, {
           type: 'input',
           label: '患者手机号',
-          field: 'orderNo',
+          field: 'Consignee_address_phone',
           placeholder: '请输入患者手机号',
         }],
         searchRuleForm: {
-          orderNo: '',
-          status: null,
-          time: [],
+          waybillNo: '',
+          delivery_name: '',
+          Consignee_address_name: '',
+          Consignee_address_phone: '',
         },
         searchValue: {},
         Pagination: {
@@ -203,48 +168,8 @@
         }],
         waybillData: {},
         srcList: [],
-        fileList: [{
-          name: 'food.jpeg',
-          url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
-        }, {
-          name: 'food2.jpeg',
-          url: 'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg'
-        }],
-        staffTitle: '添加',
-        staffDialogVisible: false,
-        recipientsForm: {
-          name: '',
-          phone: '',
-          region: '',
-          address: '',
-        },
-        personnelList: consignmentList(),
-        personnelForm: {
-          orderNo: null,
-          reCheckId: null,
-          deliveryId: null,
-        },
+        fileList: [],
         delivererName: '',
-        ruleForm: {
-          tamperProofLabel: '',
-          tamperProofLabelImg: '',
-          remark: '',
-          fileList: [],
-        },
-        formRuleList: [],
-        conserveFlag: true,
-        saveConsigneeAddress: true,
-        innerVisible: false,
-        bookInput: '',
-        bookTableList: [],
-        bookTableData: [],
-        bookType: '',
-        bookPagination: {
-          PageIndex: 1,
-          PageSize: 10,
-        },
-        bookTotal: 0,
-        confirmLoading: false,
         orderId: null,
 
         signDialogVisible: false,
@@ -253,12 +178,12 @@
           deptId: '',
           // rejectionReason: '',
         },
+        staffTitle: '',
         signConfirmLoading: false,
+        orderInformation: {},
       }
     },
     mounted() {
-      const dataList = formRules();
-      this.formRuleList = dataList;
       let arr = employee()
       arr.forEach(item => {
         if (item.field == 'unpackBtn') {
@@ -301,52 +226,11 @@
           }
         })
       },
-      // 获取地址簿
-      getAddressBook(type) {
-        this.bookTableList = addressBook()
-        this.bookType = type
-        this.innerVisible = true
-        this.getSenderSend()
-      },
-      // 快速搜索
-      fastSearch() {
-        this.bookPagination.PageIndex = 1
-        if (this.bookType == 'deliverer') {
-          this.getDelivererList()
-        }
-      },
-      // 获取寄/收列表
-      getSenderSend() {
-        let address = ''
-        if (this.bookType == 'recipients') {
-          address = 'consignee'
-        } else {
-          address = this.bookType
-        }
-        getAddress({
-          page: this.bookPagination.PageIndex,
-          pageSize: this.bookPagination.PageSize,
-          name: this.bookInput,
-          addressType: address,
-        }).then(res => {
-          if (res.code == 200) {
-            this.bookTableData = res.data.list
-            this.bookTotal = res.data.count
-          }
-        })
-      },
       openModel(type) {
         this.operationType = type
         if (type == 'add') {
-          this.conserveFlag = true
-          this.staffTitle = '添加订单'
-          this.staffDialogVisible = true
-          this.$nextTick(() => {
-            // this.$refs.sender.radio = '1'
-            this.$refs.recipients.radio = '1'
-            this.getReviewerList()
-            this.getDelivererList()
-          })
+          this.orderInformation = {}
+          this.$refs.orderAddEdit.staffDialogVisible = true
         } else if (type == 'sends') {
           const arrID = this.$refs.refWaybill.waybillIds
           let arrList = []
@@ -363,63 +247,6 @@
           }
         }
       },
-      // 弹窗表单添加
-      async handleAdd() {
-        let senderFlag = this.$refs['userRules'].validateForm();
-        let recipientsFlag = this.$refs['recipients'].validateForm();
-        let childRulesFlag = this.$refs['childRules'].validateForm();
-        if (senderFlag && recipientsFlag && childRulesFlag) {
-          this.confirmLoading = true
-          var params = {
-            consigneeAddressName: this.recipientsForm.name,
-            consigneeAddressPhone: this.recipientsForm.phone,
-            consigneeAddressDetails: this.recipientsForm.address,
-            saveConsigneeAddress: this.saveConsigneeAddress,
-            orderNo: this.personnelForm.orderNo,
-            deliveryId: Number(this.personnelForm.deliveryId),
-            reCheckId: Number(this.personnelForm.reCheckId),
-            ...this.ruleForm
-          }
-          if (this.ruleForm.fileList) {
-            var fileImage = this.picture(this.ruleForm.fileList)
-            params.tamperProofLabelImg = fileImage
-          }
-          if (this.operationType == 'add') {
-            delete params.fileList
-            await addWaybill(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') {
-            delete params.fileList
-            params.id = this.orderId
-            await putWaybill(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('表单信息不完整,请继续填写完整');
-        }
-      },
       picture(arr) {
         var imgList = JSON.parse(JSON.stringify(arr))
         var imgArr = []
@@ -429,32 +256,12 @@
         var imgString = imgArr.join()
         return imgString
       },
-      // 选择table其中某一项
-      cellClick(row) {
-        this.innerVisible = false
-        const param = {
-          ...row
-        }
-        if (this.bookType == 'recipients') {
-          this.recipientsForm = param
-          this.$nextTick(() => {
-            this.$refs.recipients.radio = ''
-            // this.$refs['recipients'].clickitem('1')
-            this.$refs['recipients'].validateForm();
-          })
-        } else if (this.bookType == 'deliverer') {
-          this.delivererForm.name = param.nickName
-          this.delivererForm.phone = param.phone
-          this.$nextTick(() => {
-            this.$refs['deliverer'].validateForm();
-          })
-        }
-      },
       buttonData(row, type) {
         this.operationType = type
         this.orderId = row.id
         if (type == 'logs') {
           this.$refs.order.staffDialogVisible = true
+          this.$refs.order.tableData = row.drugs
           this.waybillData = row
           this.waybillData.coolerBoxName = row.coolerBox.name
           this.waybillData.courierName = row.delivery.nickName
@@ -462,43 +269,20 @@
           this.waybillData.reCheckName = row.reCheck.nickName
           this.waybillData.reCheckPhone = row.reCheck.phone
         } else if (type == 'send') {
-          const urls = this.fileList.map(obj => obj.url)
-          this.srcList = urls
+          if (row.prescription) {
+            this.srcList = row.prescription
+          }
           this.$refs.picture.prescriptionVisible = true
         } else if (type == 'confirm') {
           let arrOrderId = []
           arrOrderId.push(row.id)
           this.modifyOrderStatus(arrOrderId, 2)
         } else if (type == 'edit') {
-          // this.getReviewerList()
-          // this.getDelivererList()
-          this.conserveFlag = false
-          this.staffTitle = '编辑'
-          this.staffDialogVisible = true
-          setTimeout(() => {
-            this.$nextTick(() => {
-              this.recipientsForm.name = row.consigneeAddressName
-              this.recipientsForm.phone = row.consigneeAddressPhone
-              this.recipientsForm.address = row.consigneeAddressDetails
-              this.ruleForm.tamperProofLabel = row.tamperProofLabel
-              this.personnelForm.orderNo = row.orderNo
-              this.personnelForm.reCheckId = String(row.reCheckId)
-              this.personnelForm.deliveryId = String(row.deliveryId)
-              if (row.tamperProofLabelImg) {
-                var arr = row.tamperProofLabelImg.split(',')
-                var arr3 = []
-                arr.forEach((item, index) => {
-                  var arr1 = {
-                    url: '',
-                  }
-                  arr1.url = item
-                  arr3.push(arr1)
-                })
-                this.ruleForm.fileList = arr3
-                this.ruleForm.tamperProofLabelImg = row.tamperProofLabelImg
-              }
-              this.ruleForm.remark = row.remark
-            })
+          this.staffTitle = '修改'
+          this.orderInformation = {}
+          this.$refs.orderAddEdit.staffDialogVisible = true
+          this.$nextTick(() => {
+            this.orderInformation = row
           })
         } else if (type == 'sign') {
           this.signDialogVisible = true
@@ -527,6 +311,10 @@
           }).catch(() => {})
         }
       },
+      // 添加修改刷新列表
+      refreshList() {
+        this.getList()
+      },
       // 修改订单状态
       modifyOrderStatus(arrID, type) {
         putUpdateStatus({
@@ -675,29 +463,10 @@
           }
         })
       },
-      // 地址簿
-      bookChangeSize(val) {
-        this.bookPagination.PageSize = val
-        if (this.bookType == 'deliverer') {
-          this.getDelivererList()
-        } else {
-          this.getSenderSend()
-        }
-      },
-      bookChangeCurrent(val) {
-        this.bookPagination.PageIndex = val
-        if (this.bookType == 'deliverer') {
-          this.getDelivererList()
-        } else {
-          this.getSenderSend()
-        }
-      },
-      conserveSelectil(type) {
-        if (type) {
-          this.saveConsigneeAddress = true
-        } else {
-          this.saveConsigneeAddress = false
-        }
+      // 处方更新
+      prescription() {
+        this.Pagination.PageIndex = 1
+        this.getList()
       },
       changeSize(val) {
         this.Pagination.PageSize = val
@@ -711,18 +480,10 @@
       closeDialog1() {
         this.$refs.signRules.resetCheck();
       },
-      // 关闭清空表单
-      closePopup() {
-        this.ruleForm.fileList = []
-        // this.$refs.sender.resetForm()
-        this.$refs.recipients.resetForm()
-        // this.$refs.deliverer.resetForm()
-        this.$refs.childRules.resetCheck()
-        this.$refs.userRules.resetCheck()
-        this.personnelList.forEach(item => {
-          item.options = []
-        })
-      }
+      closeDialog() {
+        this.srcList = []
+        this.fileList = []
+      },
     },
   }
 </script>

+ 3 - 1
src/views/WaybillInquiry.vue

@@ -146,6 +146,8 @@
                 let yonTitle = ''
                 if (item.coolerBox.id) {
                   yonTitle = item.coolerBox.name
+                } else {
+                  yonTitle = '运单号' +  item.waybillNo
                 }
                 item.content = item.address + '【' + yonTitle + '】' + '  ' + '您的货物' + arr
               })
@@ -204,7 +206,7 @@
         }).then(res => {
           if (res.code == 200) {
             let arrlist = []
-            console.log(res, 776)
+            // console.log(res, 776)
             if (res.data.list) {
               arrlist = res.data.list
             }

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

@@ -434,7 +434,6 @@ export default {
           this.$refs.thermo.getProbe()
         })
       } else if (type == 'ascend') {
-        console.log(23)
         this.iceTracingVisible = true
       }
     },

+ 209 - 114
src/views/incubator/IncubatorTraceability.vue

@@ -2,7 +2,7 @@
   <!-- 保温箱追溯 -->
   <div style="overflow-y: auto;">
     <actionBar :operateList="operateList" :formList="formList" :ruleForm="searchRuleForm" @openModel="openModel"
-      @searchProtocol="searchProtocol">
+      @searchProtocol="searchProtocol" @handleScroll="handleScroll" @remoteMethod="remoteMethod">
     </actionBar>
     <div class="card_content">
       <!-- 表单 -->
@@ -18,127 +18,222 @@
 </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()
-    }
+  import {
+    getcoolerboxall,
+    getCoolerBox,
+    coolerExportExecl
+  } 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: 'select',
+          label: '保温箱',
+          field: 'coolerBoxId',
+          placeholder: '请选择保温箱',
+          filterable: true,
+          options: []
+        }, {
+          type: 'picker',
+          label: '使用日期',
+          field: 'dateService',
+          placeholder: '使用日期',
+        }],
+        searchRuleForm: {
+          coolerBoxId: null,
+          dateService: [],
+        },
+        searchValue: {
+          coolerBoxId: null,
+          dateService: [],
+        },
+        Pagination: {
+          PageIndex: 1,
+          PageSize: 10,
+        },
+        Total: 0,
+        tableData: [],
+        tableList: [],
+        page: 1,
+        staffName: '',
+        limitNoil: true,
+        // 是否预冷
+        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, ['coolerBoxStarTime', 'cold_temperatures', 'cooler-cold-address',
+          'cooler-cold-users'
+        ])
+      } 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);
+      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
       }
-      return arr1
-    }
-    this.getList()
-  },
-  methods: {
-    // 搜索
-    searchProtocol(value) {
-      this.searchValue = value
       this.getList()
+      this.getIncubator()
     },
-    // 获取保温箱列表
-    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) */
+    methods: {
+      // 搜索
+      searchProtocol(value) {
+        this.searchValue = value
+        this.getList()
+      },
+      // 获取保温箱使用列表
+      getList() {
+        var params = {
+          page: this.Pagination.PageIndex,
+          pageSize: this.Pagination.PageSize,
+          ...this.searchValue
         }
-      })
-    },
-    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()
-    },
+        params.startTime = params.dateService[0]
+        params.endTime = params.dateService[1]
+        delete params.dateService
+        getcoolerboxall(params).then(res => {
+          if (res.code == 200) {
+            this.tableData = res.data.list
+            this.Total = res.data.count
+          }
+        })
+      },
+      // 触底事件
+      handleScroll(type) {
+        if (this.limitNoil) {
+          this.getIncubator()
+        }
+      },
+      // 远程搜索
+      remoteMethod(event) {
+        this.staffName = event
+        this.page = 1
+        this.limitNoil = true
+        this.formList.forEach(item => {
+          if (item.field == 'coolerBoxId') {
+            item.options = []
+          }
+        })
+        this.getIncubator()
+      },
+      // 获取保温箱列表
+      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) {
+              this.formList.forEach(item => {
+                if (item.field == 'coolerBoxId') {
+                  item.options = item.options.concat(arrList)
+                }
+              })
+            }
+            if (arrList.length >= 10) {
+              this.page = ++this.page;
+            } else {
+              // 已经没数据了 不需要增加数据
+              this.limitNoil = false;
+            }
+          }
+        })
+      },
+      openModel(type) {
+        if (type == 'export') {
+          this.$confirm('确定导出Excel, 是否继续?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            var params = {
+              ...this.searchValue
+            }
+            params.startTime = params.dateService[0]
+            params.endTime = params.dateService[1]
+            delete params.dateService
+            coolerExportExecl(params).then(response => {
+              if (response.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('未获取到文件名,导出失败');
+              }
+            })
+          }).catch(() => {
+            console.log('已取消')
+          });
+        }
+      },
+      changeSize(val) {
+        this.Pagination.PageSize = val
+        this.getList()
+      },
+      changeCurrent(val) {
+        this.Pagination.PageIndex = val
+        this.getList()
+      },
+    }
   }
-}
 </script>
 
 <style lang="scss" scoped></style>

+ 7 - 1
src/views/incubator/incubator.js

@@ -1,6 +1,7 @@
 import {
   startStatus,
-  frozenState
+  frozenState,
+  deviceState
 } from '@/assets/js/blockSort'
 
 export const incubator = () => {
@@ -33,6 +34,11 @@ export const employee = () => {
     label: '状态',
     align: 'center',
     options: startStatus()
+  },  {
+    field: 'monitorStatus',
+    label: '监控状态',
+    align: 'center',
+    options: deviceState()
   }, {
     field: 'cold_temperatures',
     label: '预冷温度(℃)',

+ 9 - 9
src/views/incubator/retrospect.js

@@ -4,15 +4,15 @@ export const employee = () => {
     label: '序号',
     align: 'center',
   }, {
-    field: 'coolerBox.name',
+    field: 'name',
     label: '名称',
     align: 'center',
   }, {
-    field: 'coolerBox.sn',
+    field: 'sn',
     label: 'SN',
     align: 'center',
   },{
-    field: 'precoolingTime',
+    field: 'coolerBoxStarTime',
     label: '预冷放入时间',
     align: 'center',
   }, {
@@ -20,27 +20,27 @@ export const employee = () => {
     label: '预冷温度',
     align: 'center',
   }, {
-    field: 'cold_spots',
+    field: 'cooler-cold-address',
     label: '预冷地点',
     align: 'center',
   }, {
-    field: 'precoolingOperator',
+    field: 'cooler-cold-users',
     label: '预冷操作人',
     align: 'center',
   },  {
-    field: 'sn',
+    field: 'coolerBoxUserTime',
     label: '使用时间',
     align: 'center',
   },  {
-    field: 'sn',
+    field: 'historyCode',
     label: '放置冰排编号',
     align: 'center',
   },  {
-    field: 'sn',
+    field: 'historyCodeNum',
     label: '放置冰排数量',
     align: 'center',
   },  {
-    field: 'sn',
+    field: 'cooler-use-users',
     label: '使用人员',
     align: 'center',
   }]

+ 2 - 6
src/views/newInquiry.vue

@@ -1,12 +1,6 @@
 <template>
   <!-- 运单查询 -->
   <div class="waybillquiry_home" :style="{height:currentId == 3?'100%':''}">
-    <!-- <div class="waybillquiry_head">
-      <div class="card_waybillquiry">
-        <el-image style="height: 45px;width: 45px;flex: none;" :src="require('@/assets/logo3.png')"></el-image>
-        <div class="head_title">宝智达智配送安全追溯</div>
-      </div>
-    </div> -->
     <div class="header">
       <svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
         viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto">
@@ -240,6 +234,8 @@
                 let yonTitle = ''
                 if (item.coolerBox.id) {
                   yonTitle = item.coolerBox.name
+                } else {
+                  yonTitle = '运单号' + item.waybillNo
                 }
                 item.content = item.address + '【' + yonTitle + '】' + '  ' + '您的货物' + arr
               })

+ 2 - 17
src/views/page/statisticalManagement.vue

@@ -78,28 +78,13 @@
         searchValue: {},
         checked: '',
         checkedList: [],
-        list: [{
-          title: '案发时更是',
-          code: '321512353',
-          checked: false,
-        }, {
-          title: '案发时更是',
-          code: '436743654',
-          checked: false,
-        }, {
-          title: '案发时更是',
-          code: '437457457',
-          checked: false,
-        }],
+        list: [],
         Pagination: {
           PageIndex: 1,
           PageSize: 10,
         },
         Total: 1,
-        tableData: [{
-          id: 1,
-          code: '3155'
-        }],
+        tableData: [],
         tableList: employee(),
         isIndeterminate: true,
       }

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

@@ -82,6 +82,7 @@
           coldKey: '',
           isIceReleaseCold: false,
           isCoolerReleaseCold: false,
+          isOutStorage: false,
           remark: '',
         },
         confirmLoading: false,
@@ -151,6 +152,7 @@
               companyAddress: this.ruleForm.companyAddress,
               isIceReleaseCold: this.ruleForm.isIceReleaseCold,
               isCoolerReleaseCold: this.ruleForm.isCoolerReleaseCold,
+              isOutStorage: this.ruleForm.isOutStorage,
             }
             putCompany(params).then(res => {
               if (res.code == 200) {

+ 113 - 59
src/views/system/company.js

@@ -3,65 +3,94 @@ import {
 } from '@/assets/js/blockSort'
 export const employee = () => {
   return [{
-    field: 'name',
-    label: '名称',
-    align: 'left',
-  }, {
-    field: 'companyAddress',
-    label: '地址',
-    align: 'center',
-  }, {
-    field: 'isIceReleaseCold',
-    label: '冰排释冷',
-    align: 'center',
-    options: [{
-      label: '已开启',
-      value: true,
-      bgcolor: '#67C23A',
+      field: 'name',
+      label: '名称',
+      align: 'left',
     }, {
-      label: '已关闭',
-      value: false,
-      bgcolor: '#F56C6C',
-    }]
-  }, {
-    field: 'isCoolerReleaseCold',
-    label: '保温箱预冷',
-    align: 'center',
-    options: [{
-      label: '已开启',
-      value: true,
-      bgcolor: '#67C23A',
+      field: 'companyAddress',
+      label: '地址',
+      align: 'center',
     }, {
-      label: '已关闭',
-      value: false,
-      bgcolor: '#F56C6C',
-    }]
-  }, {
-    field: 'remark',
-    label: '备注',
-    align: 'center',
-  }, {
-    field: 'action',
-    label: '操作',
-    colWidth: '330px',
-    align: 'center',
-    labelButton: [{
-      type: 'subAdd',
-      label: '新增子级',
-      icon: 'el-icon-plus',
-      style: 'primary',
+      field: 'isIceReleaseCold',
+      label: '冰排释冷',
+      align: 'center',
+      options: [{
+        label: '已开启',
+        value: true,
+        bgcolor: '#67C23A',
+      }, {
+        label: '已关闭',
+        value: false,
+        bgcolor: '#F56C6C',
+      }]
     }, {
-      type: 'edit',
-      label: '编辑',
-      icon: 'el-icon-edit',
-      style: 'primary',
+      field: 'isCoolerReleaseCold',
+      label: '保温箱预冷',
+      align: 'center',
+      options: [{
+        label: '已开启',
+        value: true,
+        bgcolor: '#67C23A',
+      }, {
+        label: '已关闭',
+        value: false,
+        bgcolor: '#F56C6C',
+      }]
+    },
+    // {
+    //   field: 'isCoolerReleaseCold',
+    //   label: '温湿度起讫时间',
+    //   align: 'center',
+    //   options: [{
+    //     label: '已开启',
+    //     value: true,
+    //     bgcolor: '#67C23A',
+    //   }, {
+    //     label: '已关闭',
+    //     value: false,
+    //     bgcolor: '#F56C6C',
+    //   }]
+    // },
+    {
+      field: 'isOutStorage',
+      label: '冷冻要求验证',
+      align: 'center',
+      options: [{
+        label: '已开启',
+        value: true,
+        bgcolor: '#67C23A',
+      }, {
+        label: '已关闭',
+        value: false,
+        bgcolor: '#F56C6C',
+      }]
     }, {
-      type: 'del',
-      label: '删除',
-      icon: 'el-icon-delete',
-      style: 'danger',
-    }]
-  }]
+      field: 'remark',
+      label: '备注',
+      align: 'center',
+    }, {
+      field: 'action',
+      label: '操作',
+      colWidth: '330px',
+      align: 'center',
+      labelButton: [{
+        type: 'subAdd',
+        label: '新增子级',
+        icon: 'el-icon-plus',
+        style: 'primary',
+      }, {
+        type: 'edit',
+        label: '编辑',
+        icon: 'el-icon-edit',
+        style: 'primary',
+      }, {
+        type: 'del',
+        label: '删除',
+        icon: 'el-icon-delete',
+        style: 'danger',
+      }]
+    }
+  ]
 }
 
 export const formRules = () => {
@@ -103,7 +132,7 @@ export const formRules = () => {
     label: '冰排释冷',
     placeholder: '请选择冰排释冷',
     type: 'switch',
-    colWidth: 8,
+    colWidth: 6,
     rules: [{
       required: true,
       message: '请选择冰排释冷',
@@ -112,12 +141,37 @@ export const formRules = () => {
   }, {
     field: 'isCoolerReleaseCold',
     label: '保温箱预冷',
-    placeholder: '请选择保温箱预冷',
+    placeholder: '请选择是否开启保温箱预冷',
+    type: 'switch',
+    colWidth: 6,
+    rules: [{
+      required: true,
+      message: '请选择是否开启保温箱预冷',
+      trigger: 'blur'
+    }]
+  },
+  // {
+  //   field: 'isCoolerReleaseCold',
+  //   label: '温湿度起讫时间',
+  //   placeholder: '请选择是否开启温湿度起讫时间',
+  //   type: 'switch',
+  //   colWidth: 8,
+  //   rules: [{
+  //     required: true,
+  //     message: '请选择是否开启温湿度起讫时间',
+  //     trigger: 'blur'
+  //   }]
+  // },
+  {
+    field: 'isOutStorage',
+    label: '冷冻要求验证',
+    placeholder: '冷冻要求验证',
     type: 'switch',
-    colWidth: 12,
+    labelWidth:'170px',
+    colWidth: 10,
     rules: [{
       required: true,
-      message: '请选择保温箱预冷',
+      message: '冷冻要求验证',
       trigger: 'blur'
     }]
   }, {

+ 10 - 2
vue.config.js

@@ -16,14 +16,22 @@ module.exports = defineConfig({
   devServer: {
     proxy: {
       '/api': {
-        // target: 'https://colddelivery.coldbaozhida.com/cold_delivery',
-        target: 'http://182.43.247.65:6280', //测试
+        target: 'https://colddelivery.coldbaozhida.com/cold_delivery',
+        // target: 'http://182.43.247.65:6280', //测试
         // target: 'http://192.168.11.15:6280', //本地
         ws: false,
         changeOrigin: true,
         pathRewrite: {
           '^/api': ''
         }
+      },
+      '/APP': {
+        target: 'https://public.coldbaozhida.com',
+        ws: false,
+        changeOrigin: true,
+        pathRewrite: {
+          '^/APP': ''
+        }
       }
     }
   }