Переглянути джерело

前端 反馈导入 火运船运报表 sdy

zhongtianhaoyuan 3 роки тому
батько
коміт
b8d487135b

+ 2 - 1
src/views/tranManagement/tranManagementFireFeedback.vue

@@ -80,7 +80,7 @@
       <!-- 导入 -->
       <div style="font-size: 16px; width: 100%;  text-align: right;display:flex;justify-content:end;">
         <el-link
-          href="https://taohaoliang.oss-cn-beijing.aliyuncs.com/%E6%B1%BD%E8%BF%90%E8%A3%85%E8%BD%A6%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF.xlsx"
+          href="https://taohaoliang.oss-cn-beijing.aliyuncs.com/pcfiles/%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF/%E7%81%AB%E8%BF%90%E8%A3%85%E8%BD%A6%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF.xlsx"
           style="margin-left: 8px;">
           <el-button type="primary">模板下载</el-button>
         </el-link>
@@ -430,6 +430,7 @@
                 _ispushData = true
               }
             }
+            _this.$forceUpdate();
           }
           reader.readAsArrayBuffer(f)
         }

+ 169 - 114
src/views/tranManagement/tranManagementFireReceivingFeedback.vue

@@ -121,15 +121,23 @@
         </ws-info-table>
       </div>
       <div class="small-title" style="font-size: 16px">卸车详情</div>
-      <div style="font-size: 16px; width: 100%;  text-align: right">
-        <el-upload style="margin-left: 8px;"
+      <div style="font-size: 16px; width: 100%; text-align: right;display:flex;justify-content:end;">
+        <el-link
+          href="https://taohaoliang.oss-cn-beijing.aliyuncs.com/pcfiles/%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF/%E7%81%AB%E8%BF%90%E5%8D%B8%E8%BD%A6%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF.xlsx"
+          style="margin-left: 8px"
+        >
+          <el-button type="primary">模板下载</el-button>
+        </el-link>
+        <el-upload
+          style="margin-left: 8px"
           class="upload-demo inline-block margin-right-10"
           action=""
           :on-change="handleChange"
           :show-file-list="false"
           accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
-          :auto-upload="false">
-          <el-button  type="primary">导入</el-button>
+          :auto-upload="false"
+        >
+          <el-button type="primary">导入</el-button>
         </el-upload>
       </div>
       <div class="liaison">
@@ -189,22 +197,17 @@
                     alt=""
                   />
                 </el-upload>
-                <span
-                  v-if="
-                    item.unloadPoundImg != null
-                  "
-                  >1</span
-                >
-                <span
-                  v-if="
-                    item.unloadPoundImg == null
-                  "
-                  >未上传</span
-                >
+                <span v-if="item.unloadPoundImg != null">1</span>
+                <span v-if="item.unloadPoundImg == null">未上传</span>
               </template>
             </ws-form-item>
             <!--卸车日期-->
-            <el-form-item label="卸车日期:" span="1" prop="unloadingDate" style="width:22%">
+            <el-form-item
+              label="卸车日期:"
+              span="1"
+              prop="unloadingDate"
+              style="width: 22%"
+            >
               <ws-date-picker
                 v-if="item.status == '未装车' || item.status == '已送达'"
                 :disabled="readonly"
@@ -214,7 +217,7 @@
                 placeholder="请选择日期"
                 value-format="yyyy-MM-dd"
               />
-             <ws-date-picker
+              <ws-date-picker
                 v-else
                 v-model="item.unloadingDate"
                 type="date"
@@ -224,8 +227,12 @@
               />
             </el-form-item>
             <!-- 提交 -->
-            <span class="servicedout" v-show="item.status == '已送达'">已卸车</span>
-            <span class="noserviceout" v-show="item.status == '未装车'">{{item.status}}</span>
+            <span class="servicedout" v-show="item.status == '已送达'"
+              >已卸车</span
+            >
+            <span class="noserviceout" v-show="item.status == '未装车'">{{
+              item.status
+            }}</span>
             <!-- <span
               style="text-align: right; padding: 10px"
               class="center"
@@ -246,17 +253,19 @@
                 >
             
             </span> -->
-             <el-button
-              style="text-align: right; padding: 10px;margin:4px 0 0 20px"
+            <el-button
+              style="text-align: right; padding: 10px; margin: 4px 0 0 20px"
               type="primary"
-                  @click="submit(deptBudgetList)"
+              @click="submit(deptBudgetList)"
               v-if="
                 item.status == '' ||
                 item.status == null ||
                 item.status == '未送达' ||
                 item.status == '已装车'
               "
-            > 提交 </el-button>
+            >
+              提交
+            </el-button>
             <!-- <div
               v-show="
                 item.temporaryDriverFlag == 0 && item.signStatus == '未签合同'
@@ -288,13 +297,18 @@
       </div>
       <div style="text-align: right; color: #8890b1; font-size: 16px">
         合计(吨):{{ total }}/{{ deptBudgetList.weight }}
-          <!--阶段状态-->
-         <span class="noservice" v-show="deptBudgetList.feedbackStatus=='执行中'">
+        <!--阶段状态-->
+        <span
+          class="noservice"
+          v-show="deptBudgetList.feedbackStatus == '执行中'"
+        >
           未完货
         </span>
-        <span class="service" v-show="deptBudgetList.feedbackStatus=='已完货'">{{
-          deptBudgetList.feedbackStatus
-        }}</span>
+        <span
+          class="service"
+          v-show="deptBudgetList.feedbackStatus == '已完货'"
+          >{{ deptBudgetList.feedbackStatus }}</span
+        >
       </div>
       <!-- <el-button class="add bg-bottom" type="primary" size="small" @click="add">
         <img width="22" height="22" src="../../../public/img/add.png" alt="" />
@@ -398,6 +412,7 @@ export default {
       tranCarInfoList: {
         unloadPoundImg: '',
       },
+      excelFreightspace:[],
       //  tranCarList: {
       //   driver: '',
       //   driverPhone:'',
@@ -439,91 +454,126 @@ export default {
   },
   methods: {
     handleChange(file, fileList) {
-            this.fileTemp = file.raw
-                let fileName = file.raw.name
-                let fileType = fileName.substring(fileName.lastIndexOf('.') + 1);
-                // 判断上传文件格式
-                if (this.fileTemp) {
-                    if ((fileType == 'xlsx') || (fileType == 'xls')) {
-                        this.importf(this.fileTemp)
-                    } else {
-                        this.$message({
-                            type: 'warning',
-                            message: '附件格式错误,请删除后重新上传!'
-                        })
-                    }
-                } else {
-                    this.$message({
-                        type: 'warning',
-                        message: '请上传附件!'
-                    })
+      this.fileTemp = file.raw
+      let fileName = file.raw.name
+      let fileType = fileName.substring(fileName.lastIndexOf('.') + 1)
+      // 判断上传文件格式
+      if (this.fileTemp) {
+        if (fileType == 'xlsx' || fileType == 'xls') {
+          this.importf(this.fileTemp)
+        } else {
+          this.$message({
+            type: 'warning',
+            message: '附件格式错误,请删除后重新上传!',
+          })
+        }
+      } else {
+        this.$message({
+          type: 'warning',
+          message: '请上传附件!',
+        })
+      }
+    },
+    importf(obj) {
+      this.excelFreightspace = []
+      this.dialogVisible = true
+      let _this = this
+      let inputDOM = this.$refs.inputer // 通过DOM取文件数据
+      this.file = event.currentTarget.files[0]
+      var rABS = false //是否将文件读取为二进制字符串
+      var f = this.file
+      var reader = new FileReader()
+      //if (!FileReader.prototype.readAsBinaryString) {
+      FileReader.prototype.readAsBinaryString = function (f) {
+        var binary = ''
+        var rABS = false //是否将文件读取为二进制字符串
+        var pt = this
+        var wb //读取完成的数据
+        var outdata
+        var reader = new FileReader()
+        reader.onload = function (e) {
+          var bytes = new Uint8Array(reader.result)
+          var length = bytes.byteLength
+          for (var i = 0; i < length; i++) {
+            binary += String.fromCharCode(bytes[i])
+          }
+          var XLSX = require('xlsx')
+          if (rABS) {
+            wb = XLSX.read(btoa(fixdata(binary)), {
+              //手动转化
+              type: 'base64',
+            })
+          } else {
+            wb = XLSX.read(binary, {
+              type: 'binary',
+            })
+          }
+          // outdata就是你想要的东西 excel导入的数据
+          outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]])
+          // excel 数据再处理
+          let arr = []
+          outdata.map((v) => {
+            // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
+            let jsonString = JSON.stringify(v)
+              .replace(/\//g, '')
+              .replace(/\s/gi, '')
+            // let jsonString = JSON.stringify(v)
+            console.log(jsonString)
+            v = JSON.parse(jsonString)
+            let obj = {}
+            //xxx代表列名
+            obj.boxNo = v.车厢号
+            obj.loadNetWeight = v.装车净重
+            obj.unloadNetWeight = v.卸车净重
+            obj.unloadingDate = v.卸车日期
+            obj.status = v.状态
+            obj.unloadPoundImg = v.磅单
+            console.log(obj)
+            _this.excelFreightspace.push(obj)
+          })
+          // _this.freightspace.concat(arr)
+          let _ispushData = true
+          console.log(arr, _this.freightspace)
+          for (let i = 0; i < _this.excelFreightspace.length; i++) {
+            _ispushData = true
+            for (let k = 0; k < _this.freightspace.length; k++) {
+              if (
+                _this.excelFreightspace[i].boxNo == _this.freightspace[k].boxNo
+              ) {
+                _this.freightspace[k] = _this.excelFreightspace[i]
+                if (
+                  _this.excelFreightspace[i].loadPoundImg.split(',').length > 0
+                ) {
+                  _this.freightspace[k].imgCount =
+                    _this.excelFreightspace[i].loadPoundImg.split(',').length
                 }
+                _ispushData = false
+              }
+            }
+            if (_ispushData) {
+              if (
+                _this.excelFreightspace[i].loadPoundImg.split(',').length > 0
+              ) {
+                _this.excelFreightspace[i].imgCount =
+                  _this.excelFreightspace[i].loadPoundImg.split(',').length
+              }
+              _this.freightspace.push(_this.excelFreightspace[i])
 
+              _ispushData = true
+            }
+          }
+          _this.$forceUpdate();
+          console.log(arr, _this.freightspace)
+        }
+        reader.readAsArrayBuffer(f)
+      }
+      if (rABS) {
+        reader.readAsArrayBuffer(f)
+      } else {
+        reader.readAsBinaryString(f)
+      }
+      console.log(reader)
     },
- importf(obj) {
-                this.dialogVisible = true;
-                let _this = this;
-                let inputDOM = this.$refs.inputer;   // 通过DOM取文件数据
-                this.file = event.currentTarget.files[0];
-                var rABS = false; //是否将文件读取为二进制字符串
-                var f = this.file;
-                var reader = new FileReader();
-                //if (!FileReader.prototype.readAsBinaryString) {
-                FileReader.prototype.readAsBinaryString = function (f) {
-                    var binary = "";
-                    var rABS = false; //是否将文件读取为二进制字符串
-                    var pt = this;
-                    var wb; //读取完成的数据
-                    var outdata;
-                    var reader = new FileReader();
-                    reader.onload = function (e) {
-                        var bytes = new Uint8Array(reader.result);
-                        var length = bytes.byteLength;
-                        for (var i = 0; i < length; i++) {
-                            binary += String.fromCharCode(bytes[i]);
-                        }
-                        var XLSX = require('xlsx');
-                        if (rABS) {
-                            wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
-                                type: 'base64'
-                            });
-                        } else {
-                            wb = XLSX.read(binary, {
-                                type: 'binary'
-                            });
-                        }
-                        // outdata就是你想要的东西 excel导入的数据
-                        outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
-                        // excel 数据再处理
-                        let arr = []
-                        outdata.map(v => {
-                            // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
-                            let jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig,'');
-                            console.log(jsonString);
-                            v = JSON.parse(jsonString);
-                            let obj = {}
-                            //xxx代表列名
-                            obj.boxNo = v.车厢号
-                            obj.loadNetWeight = v.装车净重
-                            obj.unloadNetWeight = v.卸车净重
-                            obj.unloadingDate = toString(v.卸车日期)
-                            obj.status= v.状态
-                            obj.unloadPoundImg = v.磅单
-                            console.log(obj)
-                            _this.freightspace.push(obj)
-                        })
-                        // _this.freightspace.concat(arr)
-                        console.log(arr,_this.freightspace)
-                    }
-                    reader.readAsArrayBuffer(f);
-                }
-                if (rABS) {
-                    reader.readAsArrayBuffer(f);
-                } else {
-                    reader.readAsBinaryString(f);
-                }
-                console.log(reader)
-            },
     marker: function (item) {
       this.deptBudgetList.warehousePositioning =
         item.lnglat.lat + ',' + item.lnglat.lng
@@ -623,7 +673,8 @@ export default {
               this.tranCarInfoList.driver = this.deptBudgetList.driver
               this.tranCarInfoList.unloadingDate =
                 this.deptBudgetList.unloadingDate
-              this.tranCarInfoList[0].sendDateStart = this.deptBudgetList.sendDateStart
+              this.tranCarInfoList[0].sendDateStart =
+                this.deptBudgetList.sendDateStart
               this.tranCarInfoList.driverPhone = this.deptBudgetList.driverPhone
               this.tranCarInfoList.tranCarNo = this.deptBudgetList.tranCarNo
               this.tranCarInfoList.carNo = this.deptBudgetList.carNo
@@ -680,7 +731,11 @@ export default {
           this.deptBudgetList.driver = response.tranCarInfoList[0].driver
           this.deptBudgetList.driverPhone =
             response.tranCarInfoList[0].driverPhone
-          this.$set(this.deptBudgetList,'sendDateStart',response.tranCarInfoList[0].sendDateStart) 
+          this.$set(
+            this.deptBudgetList,
+            'sendDateStart',
+            response.tranCarInfoList[0].sendDateStart
+          )
           this.deptBudgetList.receiveDateEnd =
             response.tranCarInfoList[0].receiveDateEnd
           this.deptBudgetList.carModel = response.tranCarInfoList[0].carModel
@@ -1143,7 +1198,7 @@ export default {
   margin-top: 11px;
   margin-left: 53px;
 }
-/deep/.el-input--suffix .el-input__inner{
+/deep/.el-input--suffix .el-input__inner {
   padding-right: 0;
 }
 //送达/未送达

+ 382 - 256
src/views/tranManagement/tranManagementReceivingloading.vue

@@ -6,7 +6,12 @@
         <h2 class="bg-left title">汽运卸车反馈</h2>
       </el-col>
       <el-col :span="4" class="bg-right">
-        <el-button class="bg-bottom" type="primary" size="small" @click="revert()">
+        <el-button
+          class="bg-bottom"
+          type="primary"
+          size="small"
+          @click="revert()"
+        >
           <img
             width="6"
             height="10"
@@ -23,16 +28,21 @@
           <div class="small-title" style="font-size: 16px">任务详情</div>
           <ws-info-table>
             <!-- 任务编号 -->
-            <ws-form-item label="任务编号" span="1" prop="processNo">{{ deptBudgetList.processNo }}</ws-form-item>
+            <ws-form-item label="任务编号" span="1" prop="processNo">{{
+              deptBudgetList.processNo
+            }}</ws-form-item>
             <!-- 货名 -->
-            <ws-form-item label="货名" span="1">{{ deptBudgetList.goodsName }}</ws-form-item>
+            <ws-form-item label="货名" span="1">{{
+              deptBudgetList.goodsName
+            }}</ws-form-item>
             <!--重量(吨)-->
             <ws-form-item
               label="重量(吨)"
               span="1"
               prop="tare"
               class="readonly"
-            >{{ deptBudgetList.weight }}</ws-form-item>
+              >{{ deptBudgetList.weight }}</ws-form-item
+            >
 
             <!--发货地址-->
             <ws-form-item label="发货地址" span="1" prop="netWeight">
@@ -41,10 +51,14 @@
               }}{{ deptBudgetList.sendDetailedAddress }}
             </ws-form-item>
             <!--发货人-->
-            <ws-form-item label="发货人" span="1" prop="agent">{{ deptBudgetList.sender }}</ws-form-item>
+            <ws-form-item label="发货人" span="1" prop="agent">{{
+              deptBudgetList.sender
+            }}</ws-form-item>
 
             <!--发货人电话-->
-            <ws-form-item label="发货人电话" span="1" prop="agent">{{ deptBudgetList.senderPhone }}</ws-form-item>
+            <ws-form-item label="发货人电话" span="1" prop="agent">{{
+              deptBudgetList.senderPhone
+            }}</ws-form-item>
             <!--收货地址-->
             <ws-form-item label="收货地址" span="1" prop="netWeight">
               {{ deptBudgetList.receivePrivate }}{{ deptBudgetList.receiveCity
@@ -52,37 +66,48 @@
               }}{{ deptBudgetList.receiveDetailedAddress }}
             </ws-form-item>
             <!--收货人-->
-            <ws-form-item label="收货人" span="1" prop="receiver">{{ deptBudgetList.receiver }}</ws-form-item>
+            <ws-form-item label="收货人" span="1" prop="receiver">{{
+              deptBudgetList.receiver
+            }}</ws-form-item>
 
             <!--收货人电话-->
-            <ws-form-item
-              label="收货人电话"
-              span="1"
-              prop="receiverPhone"
-            >{{ deptBudgetList.receiverPhone }}</ws-form-item>
+            <ws-form-item label="收货人电话" span="1" prop="receiverPhone">{{
+              deptBudgetList.receiverPhone
+            }}</ws-form-item>
             <!--发货日期-->
             <ws-form-item
               label="发货日期"
               span="1"
               prop="inOutDate"
               class="deliverydate"
-            >{{ deptBudgetList.deliveryDateStart }}</ws-form-item>
+              >{{ deptBudgetList.deliveryDateStart }}</ws-form-item
+            >
             <!--最晚发货日期-->
             <ws-form-item
               label="最晚发货日期"
               span="1"
               prop="inOutDate"
               class="deliverydate"
-            >{{ deptBudgetList.deliveryDateEnd }}</ws-form-item>
+              >{{ deptBudgetList.deliveryDateEnd }}</ws-form-item
+            >
             <!--合同编号-->
-            <ws-form-item label="合同编号" span="1" prop="contractNo">{{ deptBudgetList.contractNo }}</ws-form-item>
-            <ws-form-item label="运输方式" span="1" prop="contractNo">{{ deptBudgetList.tranType }}</ws-form-item>
+            <ws-form-item label="合同编号" span="1" prop="contractNo">{{
+              deptBudgetList.contractNo
+            }}</ws-form-item>
+            <ws-form-item label="运输方式" span="1" prop="contractNo">{{
+              deptBudgetList.tranType
+            }}</ws-form-item>
           </ws-info-table>
 
-          <div class="small-title" style="font-size: 16px;width: 50%;float: left;">卸车详情</div>
+          <div
+            class="small-title"
+            style="font-size: 16px; width: 50%; float: left"
+          >
+            卸车详情
+          </div>
           <!-- 导入 -->
-          <div style="font-size: 16px; width: 100%;text-align: right;">
-      <!-- <el-upload style="margin-left: 8px;"
+          <div style="font-size: 16px; width: 100%; text-align: right;display:flex;justify-content:end;">
+            <!-- <el-upload style="margin-left: 8px;"
           class=""
           action="https://www.zthymaoyi.com/upload/admin"
           :show-file-list="false"
@@ -95,34 +120,47 @@
           >
           <el-button  type="primary">导入</el-button>
         </el-upload> -->
-        <el-upload style="margin-left: 8px;"
-          class="upload-demo inline-block margin-right-10"
-          action=""
-          :on-change="handleChange"
-          :show-file-list="false"
-          accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
-          :auto-upload="false">
-          <el-button  type="primary">导入</el-button>
-        </el-upload>
-    </div>
+        <el-link
+          href="https://taohaoliang.oss-cn-beijing.aliyuncs.com/pcfiles/%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF/%E6%B1%BD%E8%BF%90%E5%8D%B8%E8%BD%A6%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF.xlsx"
+          style="margin-left: 8px;">
+          <el-button type="primary">模板下载</el-button>
+        </el-link>
+            <el-upload
+              style="margin-left: 8px"
+              class="upload-demo inline-block margin-right-10"
+              action=""
+              :on-change="handleChange"
+              :show-file-list="false"
+              accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
+              :auto-upload="false"
+            >
+              <el-button type="primary">导入</el-button>
+            </el-upload>
+          </div>
           <div
             class="driver position liaison"
             v-for="(item, index) in deptBudgetList.tranCarInfoList"
             :key="index"
           >
             <ws-info-table>
-              <div class="catNos" v-show="item.temporaryDriverFlag == 0">司机-{{index+1}}
-                 <span class="noservice" v-show="item.status == '未装车'">{{
+              <div class="catNos" v-show="item.temporaryDriverFlag == 0">
+                司机-{{ index + 1 }}
+                <span class="noservice" v-show="item.status == '未装车'">{{
                   item.status
                 }}</span>
                 <span class="service" v-show="item.status == '已装车'">
-                   未卸车
+                  未卸车
                 </span>
-                 <span class="serviced" v-show="item.status == '已送达'">
-                   已卸车
+                <span class="serviced" v-show="item.status == '已送达'">
+                  已卸车
                 </span>
               </div>
-              <div class="catNos catNosCor" v-show="item.temporaryDriverFlag != 0">司机-{{index+1}}(临)</div>
+              <div
+                class="catNos catNosCor"
+                v-show="item.temporaryDriverFlag != 0"
+              >
+                司机-{{ index + 1 }}(临)
+              </div>
               <!--姓名-->
               <ws-form-item
                 label="姓名:"
@@ -130,7 +168,9 @@
                 prop="driver"
                 v-show="item.temporaryDriverFlag == 0"
               >
-                <span v-show="item.temporaryDriverFlag == 0">{{ item.driver }}</span>
+                <span v-show="item.temporaryDriverFlag == 0">{{
+                  item.driver
+                }}</span>
               </ws-form-item>
               <!-- 姓名 -->
               <ws-form-item
@@ -139,31 +179,56 @@
                 prop="driver"
                 v-show="item.temporaryDriverFlag != 0"
               >
-                <span v-show="item.temporaryDriverFlag != 0">{{item.driver}}</span>
+                <span v-show="item.temporaryDriverFlag != 0">{{
+                  item.driver
+                }}</span>
               </ws-form-item>
               <!-- 电话 -->
-              <ws-form-item label="司机电话:" span="1" prop="driverPhone" style="width:200px">
-                <span v-show="item.temporaryDriverFlag != 0">{{ item.driverPhone }}</span>
-                <span v-show="item.temporaryDriverFlag == 0">{{ item.driverPhone }}</span>
+              <ws-form-item
+                label="司机电话:"
+                span="1"
+                prop="driverPhone"
+                style="width: 200px"
+              >
+                <span v-show="item.temporaryDriverFlag != 0">{{
+                  item.driverPhone
+                }}</span>
+                <span v-show="item.temporaryDriverFlag == 0">{{
+                  item.driverPhone
+                }}</span>
               </ws-form-item>
               <!--车牌号-->
               <ws-form-item label="车牌号:" span="1" prop="carNo">
-                <span v-show="item.temporaryDriverFlag != 0">{{ item.carNo }}</span>
-                <span v-show="item.temporaryDriverFlag == 0">{{ item.carNo }}</span>
+                <span v-show="item.temporaryDriverFlag != 0">{{
+                  item.carNo
+                }}</span>
+                <span v-show="item.temporaryDriverFlag == 0">{{
+                  item.carNo
+                }}</span>
               </ws-form-item>
               <!--装车净重-->
-              <ws-form-item label="装车(吨):" span="1" prop="loadNetWeight" style="width:150px">{{item.loadNetWeight}}</ws-form-item>
+              <ws-form-item
+                label="装车(吨):"
+                span="1"
+                prop="loadNetWeight"
+                style="width: 150px"
+                >{{ item.loadNetWeight }}</ws-form-item
+              >
               <!--卸车净重(吨)-->
-              <ws-form-item label="卸车净重(吨):" span="1" prop="unloadNetWeight">
+              <ws-form-item
+                label="卸车净重(吨):"
+                span="1"
+                prop="unloadNetWeight"
+              >
                 <ws-input
-                  v-if="item.status == '已送达'||item.status == '未装车'" 
+                  v-if="item.status == '已送达' || item.status == '未装车'"
                   v-model="item.unloadNetWeight"
                   placeholder="请输入卸车净重"
                   maxlength="20"
                   :disabled="readonly"
                   size="small"
                 />
-                 <ws-input
+                <ws-input
                   v-else
                   v-model="item.unloadNetWeight"
                   placeholder="请输入卸车净重"
@@ -171,93 +236,124 @@
                   size="small"
                 />
               </ws-form-item>
-               <!--卸车日期-->
-            <ws-form-item label="卸车日期:" span="1" prop="receiveDateEnd"  style="width:275px">
-            <ws-date-picker
-              v-model="item.receiveDateEnd"
-              v-if="item.status == '已送达'||item.status == '未装车'" 
-              :disabled="readonly"
-              type="date"
-              value-format="yyyy-MM-dd"
-            />
-            <ws-date-picker
-              v-model="item.receiveDateEnd"
-              v-else
-              type="date"
-              placeholder="请选择日期"
-              value-format="yyyy-MM-dd"
-            />
-          </ws-form-item>
+              <!--卸车日期-->
+              <ws-form-item
+                label="卸车日期:"
+                span="1"
+                prop="receiveDateEnd"
+                style="width: 275px"
+              >
+                <ws-date-picker
+                  v-model="item.receiveDateEnd"
+                  v-if="item.status == '已送达' || item.status == '未装车'"
+                  :disabled="readonly"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                />
+                <ws-date-picker
+                  v-model="item.receiveDateEnd"
+                  v-else
+                  type="date"
+                  placeholder="请选择日期"
+                  value-format="yyyy-MM-dd"
+                />
+              </ws-form-item>
               <!--磅单-->
               <ws-form-item label="磅单:" span="1" prop="unloadPoundImg">
-                <template >
+                <template>
                   <el-upload
                     action="https://www.zthymaoyi.com/upload/admin"
                     :show-file-list="false"
                     :on-success="
-                    (res) => {
-                      uploadSuccessHandle1(res,index)
-                    }
-                  "
+                      (res) => {
+                        uploadSuccessHandle1(res, index)
+                      }
+                    "
                     class="avatar-uploader"
                     accept=".jpg, .jpeg, .png, .gif"
                   >
                     <img
                       width="18"
                       height="20"
-                      style="
-                      vertical-align: text-top;
-                      position: relative;
-                    "
+                      style="vertical-align: text-top; position: relative"
                       src="../../../public/img/fujian.png"
                       alt
                     />
                   </el-upload>
-                  <span v-if="deptBudgetList.tranCarInfoList[index].unloadPoundImg != null " >1</span>
-                 <span
-                  v-if="
-                    deptBudgetList.tranCarInfoList[index].unloadPoundImg == null
-                  "
-                  >未上传</span>
+                  <span
+                    v-if="
+                      deptBudgetList.tranCarInfoList[index].unloadPoundImg !=
+                      null
+                    "
+                    >1</span
+                  >
+                  <span
+                    v-if="
+                      deptBudgetList.tranCarInfoList[index].unloadPoundImg ==
+                      null
+                    "
+                    >未上传</span
+                  >
                 </template>
               </ws-form-item>
-               <!--箱号-->
-            <ws-form-item label="箱号:" span="1" prop="caseNo">
-             <span>{{ item.caseNo }}</span>
-            </ws-form-item>
+              <!--箱号-->
+              <ws-form-item label="箱号:" span="1" prop="caseNo">
+                <span>{{ item.caseNo }}</span>
+              </ws-form-item>
               <!--封号-->
-            <ws-form-item label="封号:" span="1" prop="titleNo">
-             <span>{{ item.titleNo }}</span>
-            </ws-form-item>
-            <div v-show="item.temporaryDriverFlag == 0 && item.signStatus == '未签合同'" class="signStatus">
-              {{ item.signStatus }}
-            </div>
-            <div v-show="item.temporaryDriverFlag == 0 && item.signStatus == '已签合同'" class="signStatus1">
-              {{ item.signStatus }}
-            </div>
+              <ws-form-item label="封号:" span="1" prop="titleNo">
+                <span>{{ item.titleNo }}</span>
+              </ws-form-item>
+              <div
+                v-show="
+                  item.temporaryDriverFlag == 0 && item.signStatus == '未签合同'
+                "
+                class="signStatus"
+              >
+                {{ item.signStatus }}
+              </div>
+              <div
+                v-show="
+                  item.temporaryDriverFlag == 0 && item.signStatus == '已签合同'
+                "
+                class="signStatus1"
+              >
+                {{ item.signStatus }}
+              </div>
             </ws-info-table>
           </div>
         </div>
-          <div
-            style="text-align: right; color: #8890b1; font-size: 16px"
-          >合计{{ total }}/{{ deptBudgetList.weight }}
-           <!--阶段状态-->
-         <span class="noservice" v-show="deptBudgetList.receivingStatus=='执行中'">
-          未完货
-        </span>
-        <span class="service" v-show="deptBudgetList.receivingStatus=='已完货'">{{
-          deptBudgetList.receivingStatus
-        }}</span></div>
-          <div style="text-align: right; padding: 10px">
-            <el-button class="bg-bottom-up" type="primary" size="small" @click="submit()">提交</el-button>
-             <el-button
-                class="bg-bottom"
-                type="primary"
-                size="small"
-                @click="finished (deptBudgetList)"
-                >完货</el-button
-              >
-          </div>
+        <div style="text-align: right; color: #8890b1; font-size: 16px">
+          合计{{ total }}/{{ deptBudgetList.weight }}
+          <!--阶段状态-->
+          <span
+            class="noservice"
+            v-show="deptBudgetList.receivingStatus == '执行中'"
+          >
+            未完货
+          </span>
+          <span
+            class="service"
+            v-show="deptBudgetList.receivingStatus == '已完货'"
+            >{{ deptBudgetList.receivingStatus }}</span
+          >
+        </div>
+        <div style="text-align: right; padding: 10px">
+          <el-button
+            class="bg-bottom-up"
+            type="primary"
+            size="small"
+            @click="submit()"
+            >提交</el-button
+          >
+          <el-button
+            class="bg-bottom"
+            type="primary"
+            size="small"
+            @click="finished(deptBudgetList)"
+            >完货</el-button
+          >
+        </div>
       </ws-form>
     </div>
   </div>
@@ -265,19 +361,25 @@
 <script>
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
-import { seeCat, packList, feedback, getbank,stateRec } from '@/model/transport/index'
+import {
+  seeCat,
+  packList,
+  feedback,
+  getbank,
+  stateRec,
+} from '@/model/transport/index'
 // import { dayjs, fmoney, EventBus } from 'base-core-lib'
 import { dayjs, EventBus } from 'base-core-lib'
 export default {
   name: 'viewSpareMoney',
   components: {
     WsUpload,
-    Pagination
+    Pagination,
   },
   watch: {
     isShow(val) {
       this.showType = val
-    }
+    },
   },
   data() {
     return {
@@ -301,9 +403,9 @@ export default {
             required: true,
             type: 'number',
             message: '请输入活动名称',
-            trigger: 'blur'
-          }
-        ]
+            trigger: 'blur',
+          },
+        ],
       },
       size: 10,
       compId: sessionStorage.getItem('ws-pf_compId'),
@@ -311,23 +413,24 @@ export default {
       packtypeList: {},
       date: {
         year: dayjs().format('YYYY'),
-        month: dayjs().format('MM')
+        month: dayjs().format('MM'),
       },
       contractList: [],
       deptBudgetList: {
         tranCarInfoList: [
           {
-            unloadPoundImg:'',
-          }
-        ]
+            unloadPoundImg: '',
+          },
+        ],
       },
+      excelFreightspace: [],
       historyList: [],
       pickerBeginDateBefore: {
-        disabledDate: time => {
+        disabledDate: (time) => {
           return time.getTime() > Date.now()
-        }
+        },
       },
-      accessoryTFs: false
+      accessoryTFs: false,
     }
   },
   activated() {
@@ -335,7 +438,7 @@ export default {
     this.getList()
   },
   computed: {
-    total: function() {
+    total: function () {
       var maxStorage = 0
       for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
         maxStorage += Number(
@@ -343,7 +446,7 @@ export default {
         )
       }
       return maxStorage
-    }
+    },
   },
   mounted() {
     this.deptBudgetList.id = this.$route.query.id
@@ -351,95 +454,119 @@ export default {
   },
   methods: {
     handleChange(file, fileList) {
-            this.fileTemp = file.raw
-                let fileName = file.raw.name
-                let fileType = fileName.substring(fileName.lastIndexOf('.') + 1);
-                // 判断上传文件格式
-                if (this.fileTemp) {
-                    if ((fileType == 'xlsx') || (fileType == 'xls')) {
-                        this.importf(this.fileTemp)
-                    } else {
-                        this.$message({
-                            type: 'warning',
-                            message: '附件格式错误,请删除后重新上传!'
-                        })
-                    }
-                } else {
-                    this.$message({
-                        type: 'warning',
-                        message: '请上传附件!'
-                    })
-                }
-
+      this.fileTemp = file.raw
+      let fileName = file.raw.name
+      let fileType = fileName.substring(fileName.lastIndexOf('.') + 1)
+      // 判断上传文件格式
+      if (this.fileTemp) {
+        if (fileType == 'xlsx' || fileType == 'xls') {
+          this.importf(this.fileTemp)
+        } else {
+          this.$message({
+            type: 'warning',
+            message: '附件格式错误,请删除后重新上传!',
+          })
+        }
+      } else {
+        this.$message({
+          type: 'warning',
+          message: '请上传附件!',
+        })
+      }
+    },
+    importf(obj) {
+      this.excelFreightspace = []
+      this.dialogVisible = true
+      let _this = this
+      let inputDOM = this.$refs.inputer // 通过DOM取文件数据
+      this.file = event.currentTarget.files[0]
+      var rABS = false //是否将文件读取为二进制字符串
+      var f = this.file
+      var reader = new FileReader()
+      //if (!FileReader.prototype.readAsBinaryString) {
+      FileReader.prototype.readAsBinaryString = function (f) {
+        var binary = ''
+        var rABS = false //是否将文件读取为二进制字符串
+        var pt = this
+        var wb //读取完成的数据
+        var outdata
+        var reader = new FileReader()
+        reader.onload = function (e) {
+          var bytes = new Uint8Array(reader.result)
+          var length = bytes.byteLength
+          for (var i = 0; i < length; i++) {
+            binary += String.fromCharCode(bytes[i])
+          }
+          var XLSX = require('xlsx')
+          if (rABS) {
+            wb = XLSX.read(btoa(fixdata(binary)), {
+              //手动转化
+              type: 'base64',
+              cellDates: true,
+            })
+          } else {
+            wb = XLSX.read(binary, {
+              type: 'binary',
+            })
+          }
+          // outdata就是你想要的东西 excel导入的数据
+          outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]])
+          // excel 数据再处理
+          let arr = []
+          outdata.map((v) => {
+            // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
+            let jsonString = JSON.stringify(v)
+              .replace(/\//g, '')
+              .replace(/\s/gi, '')
+            console.log(jsonString)
+            v = JSON.parse(jsonString)
+            let obj = {}
+            //xxx代表列名
+            obj.caseNo = v.箱号
+            obj.loadNetWeight = v.装车
+            obj.titleNo = v.封号
+            obj.driverPhone = v.司机电话
+            obj.driver = v.司机姓名
+            obj.unloadNetWeight = v.卸车净重
+            obj.receiveDateEnd = v.卸车日期
+            obj.status = v.状态
+            obj.carNo = v.车牌号
+            obj.unloadPoundImg = v.磅单
+            console.log(obj)
+            _this.excelFreightspace.push(obj)
+          })
+          // _this.freightspace.concat(arr)
+          let _ispushData = true
+          console.log(arr, _this.deptBudgetList.tranCarInfoList)
+          // debugger
+          for (let i = 0; i < _this.excelFreightspace.length; i++) {
+            _ispushData = true
+            for (let k = 0; k < _this.deptBudgetList.tranCarInfoList.length; k++) {
+              debugger
+              if (
+                _this.excelFreightspace[i].driverPhone ==
+                _this.deptBudgetList.tranCarInfoList[k].driverPhone
+              ) {
+                _this.deptBudgetList.tranCarInfoList[k] = _this.excelFreightspace[i]
+                _ispushData = false
+              }
+            }
+            if (_ispushData) {
+              _this.deptBudgetList.tranCarInfoList.push(_this.excelFreightspace[i])
+              _ispushData = true
+            }
+          }
+          _this.$forceUpdate();
+        }
+        reader.readAsArrayBuffer(f)
+      }
+      if (rABS) {
+        reader.readAsArrayBuffer(f)
+      } else {
+        reader.readAsBinaryString(f)
+      }
+      console.log(reader)
     },
- importf(obj) {
-                this.dialogVisible = true;
-                let _this = this;
-                let inputDOM = this.$refs.inputer;   // 通过DOM取文件数据
-                this.file = event.currentTarget.files[0];
-                var rABS = false; //是否将文件读取为二进制字符串
-                var f = this.file;
-                var reader = new FileReader();
-                //if (!FileReader.prototype.readAsBinaryString) {
-                FileReader.prototype.readAsBinaryString = function (f) {
-                    var binary = "";
-                    var rABS = false; //是否将文件读取为二进制字符串
-                    var pt = this;
-                    var wb; //读取完成的数据
-                    var outdata;
-                    var reader = new FileReader();
-                    reader.onload = function (e) {
-                        var bytes = new Uint8Array(reader.result);
-                        var length = bytes.byteLength;
-                        for (var i = 0; i < length; i++) {
-                            binary += String.fromCharCode(bytes[i]);
-                        }
-                        var XLSX = require('xlsx');
-                        if (rABS) {
-                            wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
-                                type: 'base64'
-                            });
-                        } else {
-                            wb = XLSX.read(binary, {
-                                type: 'binary'
-                            });
-                        }
-                        // outdata就是你想要的东西 excel导入的数据
-                        outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
-                        // excel 数据再处理
-                        let arr = []
-                        outdata.map(v => {
-                            // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
-                            let jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig,'');
-                            console.log(jsonString);
-                            v = JSON.parse(jsonString);
-                            let obj = {}
-                            //xxx代表列名
-                            obj.caseNo= v.箱号
-                            obj.loadNetWeight= v.装车
-                            obj.titleNo= v.封号
-                            obj.driverPhone = v.司机电话
-                            obj.driver=v.司机姓名
-                            obj.loadNetWeight = v.卸车净重
-                            obj.loadingDate = toString(v.卸车日期)
-                            obj.status= v.状态
-                            obj.carNo = v.车牌号
-                            obj.unloadPoundImg = v.磅单
-                            console.log(obj)
-                            _this.freightspace.push(obj)
-                        })
-                        // _this.freightspace.concat(arr)
-                        console.log(arr,_this.freightspace)
-                    }
-                    reader.readAsArrayBuffer(f);
-                }
-                if (rABS) {
-                    reader.readAsArrayBuffer(f);
-                } else {
-                    reader.readAsBinaryString(f);
-                }
-                console.log(reader)
-            },
     //返回按钮
     revert() {
       this.$router.push({ path: 'tranManagementReceivingFeedback' })
@@ -449,7 +576,7 @@ export default {
         this.deptBudgetList.tranCarInfoList.splice(index, 1)
       }
     },
-    uploadSuccessHandle1(e,index) {
+    uploadSuccessHandle1(e, index) {
       this.deptBudgetList.tranCarInfoList[index].unloadPoundImg = e.url
     },
     selectwaterContent() {},
@@ -459,7 +586,7 @@ export default {
         if (this.freightspace[i].unloadNetWeight == null) {
           this.$message({
             message: '卸重不能为空!',
-            type: 'warning'
+            type: 'warning',
           })
           return
         }
@@ -469,22 +596,27 @@ export default {
         {
           cancelButtonText: '取消',
           confirmButtonText: '确定',
-          type: 'warning'
+          type: 'warning',
         }
       )
         .then(() => {
-          this.$refs.deptBudgetList.validate(valid => {
+          this.$refs.deptBudgetList.validate((valid) => {
             if (valid) {
               // this.tranCarInfoList = this.freightspace
-                   this.tranCarInfoList = this.deptBudgetList.tranCarInfoList
+              this.tranCarInfoList = this.deptBudgetList.tranCarInfoList
               this.tranCarInfoList.driver = this.deptBudgetList.driver
               this.tranCarInfoList.driverPhone = this.deptBudgetList.driverPhone
               this.tranCarInfoList.carNo = this.deptBudgetList.carNo
-              this.tranCarInfoList.loadNetWeight = this.deptBudgetList.loadNetWeight
+              this.tranCarInfoList.loadNetWeight =
+                this.deptBudgetList.loadNetWeight
               this.tranCarInfoList.tranType = this.tranType
               // this.tranCarInfoList.unloadPoundImg = this.deptBudgetList.tranCarInfoList.unloadPoundImg
-              console.log( this.deptBudgetList.tranCarInfoList[0].unloadPoundImg,'图片')
-              this.tranCarInfoList.unloadNetWeight = this.deptBudgetList.unloadNetWeight
+              console.log(
+                this.deptBudgetList.tranCarInfoList[0].unloadPoundImg,
+                '图片'
+              )
+              this.tranCarInfoList.unloadNetWeight =
+                this.deptBudgetList.unloadNetWeight
               for (var i = 0; i < this.tranCarInfoList.length; i++) {
                 this.tranCarInfoList[i].id = this.freightspace[i].id
                 if (this.tranCarInfoList[i].temporaryDriverFlag != 0) {
@@ -492,20 +624,20 @@ export default {
                   this.tranCarInfoList[i].tranType = this.tranType
                 }
               }
-              console.log(this.tranCarInfoList,'12121212')
+              console.log(this.tranCarInfoList, '12121212')
               var tranProcessInfo = {}
               tranProcessInfo.id = this.deptBudgetList.id
               tranProcessInfo.infoId = this.deptBudgetList.infoId
               tranProcessInfo.tranCarInfoList = this.tranCarInfoList
               feedback(tranProcessInfo)
                 .toPromise()
-                .then(response => {
+                .then((response) => {
                   this.$message.success('提交成功')
                   this.deptBudgetList = {}
                   this.freightspace = {}
                   this.selectedOptions = ''
                   this.$router.push({
-                    path: 'tranManagementReceivingFeedback'
+                    path: 'tranManagementReceivingFeedback',
                   })
                 })
             } else {
@@ -519,11 +651,8 @@ export default {
         })
     },
     //导入
-    import(){
-
-    },
-    finished(){
-       this.$confirm(`完货操作后,卸车信息不可修改,是否确定完货?`, {
+    finished() {
+      this.$confirm(`完货操作后,卸车信息不可修改,是否确定完货?`, {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning',
@@ -552,7 +681,6 @@ export default {
         .catch(() => {
           return false
         })
-
     },
     handleClose() {
       this.accessoryTFs = false
@@ -561,11 +689,11 @@ export default {
     getList() {
       seeCat({ id: this.deptBudgetList.id })
         .toPromise()
-        .then(response => {
+        .then((response) => {
           this.deptBudgetList = response
-            if(response.tranCarInfoList){
-            this.freightspace = response.tranCarInfoList
-          }
+          if (response.tranCarInfoList) {
+            this.freightspace = response.tranCarInfoList
+          }
           for (var i = 0; i < this.freightspace.length; i++) {
             if (!this.freightspace[i].loadNetWeight) {
               this.freightspace[i].loadNetWeight = 0
@@ -576,12 +704,11 @@ export default {
     carchange(val, index) {
       for (var i = 0; i < this.carList.length; i++) {
         if (this.carList[i].driverName == val) {
-          this.deptBudgetList.tranCarInfoList[index].driverPhone = this.carList[
-            i
-          ].driverPhone
+          this.deptBudgetList.tranCarInfoList[index].driverPhone =
+            this.carList[i].driverPhone
           arrange({ id: this.carList[i].id })
             .toPromise()
-            .then(response => {
+            .then((response) => {
               this.deptBudgetList.tranCarInfoList[index].carNo =
                 response.carNumber
               if (response.carLoad != null) {
@@ -601,17 +728,16 @@ export default {
             })
         }
       }
-    }
+    },
   },
   phonechange(val, index) {
     for (var i = 0; i < this.carList.length; i++) {
       if (this.carList[i].driverPhone == val) {
-        this.deptBudgetList.tranCarInfoList[index].driver = this.carList[
-          i
-        ].driver
+        this.deptBudgetList.tranCarInfoList[index].driver =
+          this.carList[i].driver
         arrange({ id: this.carList[i].id })
           .toPromise()
-          .then(response => {
+          .then((response) => {
             this.deptBudgetList.tranCarInfoList[index].carNo =
               response.carNumber
             if (response.carLoad != null) {
@@ -861,17 +987,17 @@ export default {
   line-height: 24px;
 }
 /deep/.ws-info-table.el-form-item .el-form-item__label {
-    // background-color: #eee;
-    // padding-right: 8px;
-    // padding-left: 8px;
-    font-size: 13px;
-    font-weight: bold;
-    // color: #333;
-    // overflow: hidden;
-    // height: 40px;
-    /* text-overflow: ellipsis; */
-    // white-space: nowrap;
-    // width: 120px;
-    // line-height: 40px;
+  // background-color: #eee;
+  // padding-right: 8px;
+  // padding-left: 8px;
+  font-size: 13px;
+  font-weight: bold;
+  // color: #333;
+  // overflow: hidden;
+  // height: 40px;
+  /* text-overflow: ellipsis; */
+  // white-space: nowrap;
+  // width: 120px;
+  // line-height: 40px;
 }
 </style>

+ 3 - 1
src/views/tranManagement/tranManagementShippingFeedback.vue

@@ -76,8 +76,9 @@
       <div class="small-title" style="font-size: 16px; width: 50%; float: left">装船详情</div>
       <!-- 导入 -->
       <div style="font-size: 16px; width: 50%; float: left; text-align: right;display:flex;justify-content:end;">
+
         <el-link
-          href="https://taohaoliang.oss-cn-beijing.aliyuncs.com/%E6%B1%BD%E8%BF%90%E8%A3%85%E8%BD%A6%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF.xlsx"
+          href="https://taohaoliang.oss-cn-beijing.aliyuncs.com/pcfiles/%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF/%E8%88%B9%E8%BF%90%E8%A3%85%E8%BD%A6%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF.xlsx"
           style="margin-left: 8px;">
           <el-button type="primary">模板下载</el-button>
         </el-link>
@@ -411,6 +412,7 @@
         }
       },
       importf(obj) {
+        this.excelFreightspace = []
         this.dialogVisible = true
         let _this = this
         let inputDOM = this.$refs.inputer // 通过DOM取文件数据

+ 1 - 1
src/views/tranManagement/tranManagementTransporFeedback.vue

@@ -67,7 +67,7 @@
           <el-button  type="primary">导入</el-button>
         </el-upload> -->
         <el-link
-          href="https://taohaoliang.oss-cn-beijing.aliyuncs.com/%E6%B1%BD%E8%BF%90%E8%A3%85%E8%BD%A6%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF.xlsx"
+          href="https://taohaoliang.oss-cn-beijing.aliyuncs.com/pcfiles/%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF/%E6%B1%BD%E8%BF%90%E8%A3%85%E8%BD%A6%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF.xlsx"
           style="margin-left: 8px;">
           <el-button type="primary">模板下载</el-button>
         </el-link>

+ 152 - 101
src/views/tranManagement/tranManagementUnShippingFeedback.vue

@@ -138,16 +138,31 @@
         卸船详情
       </div>
       <!-- 导入 -->
-      <!-- 导入 -->
-      <div style="font-size: 16px; width: 100%; text-align: right">
-        <el-upload style="margin-left: 8px;"
+      <div
+        style="
+          font-size: 16px;
+          width: 100%;
+          text-align: right;
+          display: flex;
+          justify-content: end;
+        "
+      >
+        <el-link
+          href="https://taohaoliang.oss-cn-beijing.aliyuncs.com/pcfiles/%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF/%E8%88%B9%E8%BF%90%E5%8D%B8%E8%BD%A6%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF.xlsx"
+          style="margin-left: 8px"
+        >
+          <el-button type="primary">模板下载</el-button>
+        </el-link>
+        <el-upload
+          style="margin-left: 8px"
           class="upload-demo inline-block margin-right-10"
           action=""
           :on-change="handleChange"
           :show-file-list="false"
           accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
-          :auto-upload="false">
-          <el-button  type="primary">导入</el-button>
+          :auto-upload="false"
+        >
+          <el-button type="primary">导入</el-button>
         </el-upload>
       </div>
       <div class="liaison">
@@ -310,10 +325,18 @@
             />
           </el-upload>
           <div class="tupian">
-            <span v-if="deptBudgetList.tranCarInfoList[0]&&deptBudgetList.tranCarInfoList[0].loadPoundImg != null"
+            <span
+              v-if="
+                deptBudgetList.tranCarInfoList[0] &&
+                deptBudgetList.tranCarInfoList[0].loadPoundImg != null
+              "
               >1</span
             >
-            <span v-if="deptBudgetList.tranCarInfoList[0]&&deptBudgetList.tranCarInfoList[0].loadPoundImg == null"
+            <span
+              v-if="
+                deptBudgetList.tranCarInfoList[0] &&
+                deptBudgetList.tranCarInfoList[0].loadPoundImg == null
+              "
               >未上传</span
             >
           </div>
@@ -422,6 +445,7 @@ export default {
       tranCarInfoList: {
         loadPoundImg: '',
       },
+      excelFreightspace:[],
       //上传
       accessoryTFs: false,
       fileList: [],
@@ -456,94 +480,115 @@ export default {
   },
   methods: {
     handleChange(file, fileList) {
-            this.fileTemp = file.raw
-                let fileName = file.raw.name
-                let fileType = fileName.substring(fileName.lastIndexOf('.') + 1);
-                // 判断上传文件格式
-                if (this.fileTemp) {
-                    if ((fileType == 'xlsx') || (fileType == 'xls')) {
-                        this.importf(this.fileTemp)
-                    } else {
-                        this.$message({
-                            type: 'warning',
-                            message: '附件格式错误,请删除后重新上传!'
-                        })
-                    }
-                } else {
-                    this.$message({
-                        type: 'warning',
-                        message: '请上传附件!'
-                    })
-                }
+      this.fileTemp = file.raw
+      let fileName = file.raw.name
+      let fileType = fileName.substring(fileName.lastIndexOf('.') + 1)
+      // 判断上传文件格式
+      if (this.fileTemp) {
+        if (fileType == 'xlsx' || fileType == 'xls') {
+          this.importf(this.fileTemp)
+        } else {
+          this.$message({
+            type: 'warning',
+            message: '附件格式错误,请删除后重新上传!',
+          })
+        }
+      } else {
+        this.$message({
+          type: 'warning',
+          message: '请上传附件!',
+        })
+      }
+    },
+    importf(obj) {
+      this.excelFreightspace = []
+      this.dialogVisible = true
+      let _this = this
+      let inputDOM = this.$refs.inputer // 通过DOM取文件数据
+      this.file = event.currentTarget.files[0]
+      var rABS = false //是否将文件读取为二进制字符串
+      var f = this.file
+      var reader = new FileReader()
+      //if (!FileReader.prototype.readAsBinaryString) {
+      FileReader.prototype.readAsBinaryString = function (f) {
+        var binary = ''
+        var rABS = false //是否将文件读取为二进制字符串
+        var pt = this
+        var wb //读取完成的数据
+        var outdata
+        var reader = new FileReader()
+        reader.onload = function (e) {
+          var bytes = new Uint8Array(reader.result)
+          var length = bytes.byteLength
+          for (var i = 0; i < length; i++) {
+            binary += String.fromCharCode(bytes[i])
+          }
+          var XLSX = require('xlsx')
+          if (rABS) {
+            wb = XLSX.read(btoa(fixdata(binary)), {
+              //手动转化
+              type: 'base64',
+            })
+          } else {
+            wb = XLSX.read(binary, {
+              type: 'binary',
+            })
+          }
+          // outdata就是你想要的东西 excel导入的数据
+          outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]])
+          // excel 数据再处理
+          let arr = []
+          outdata.map((v) => {
+            // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
+            let jsonString = JSON.stringify(v)
+              .replace(/\//g, '')
+              .replace(/\s/gi, '')
+            console.log(jsonString)
+            v = JSON.parse(jsonString)
+            let obj = {}
+            //xxx代表列名
+            obj.caseNo = v.箱号
+            obj.titleNo = v.封号
+            obj.binNumber = v.仓位号
+            obj.positionWeight = v.散船重量
+            obj.loadNetWeight = v.装船净重
+            obj.unloadNetWeight = v.卸船净重
+            obj.unloadingDate = v.卸船日期
+            obj.status = v.状态
+            obj.shipType = v.类型
+            console.log(obj)
+            _this.excelFreightspace.push(obj)
+          })
+          let _ispushData = true
+          console.log(arr, _this.freightspace)
+          for (let i = 0; i < _this.excelFreightspace.length; i++) {
+            _ispushData = true
+            for (let k = 0; k < _this.freightspace.length; k++) {
+              if (
+                _this.excelFreightspace[i].binNumber ==
+                _this.freightspace[k].binNumber
+              ) {
+                _this.freightspace[k] = _this.excelFreightspace[i]
+                _ispushData = false
+              }
+            }
+            if (_ispushData) {
+              _this.freightspace.push(_this.excelFreightspace[i])
 
+              _ispushData = true
+            }
+          }
+           _this.$forceUpdate();
+        }
+        reader.readAsArrayBuffer(f)
+      }
+      if (rABS) {
+        reader.readAsArrayBuffer(f)
+      } else {
+        reader.readAsBinaryString(f)
+      }
+      console.log(reader)
     },
- importf(obj) {
-                this.dialogVisible = true;
-                let _this = this;
-                let inputDOM = this.$refs.inputer;   // 通过DOM取文件数据
-                this.file = event.currentTarget.files[0];
-                var rABS = false; //是否将文件读取为二进制字符串
-                var f = this.file;
-                var reader = new FileReader();
-                //if (!FileReader.prototype.readAsBinaryString) {
-                FileReader.prototype.readAsBinaryString = function (f) {
-                    var binary = '';
-                    var rABS = false; //是否将文件读取为二进制字符串
-                    var pt = this;
-                    var wb; //读取完成的数据
-                    var outdata;
-                    var reader = new FileReader();
-                    reader.onload = function (e) {
-                        var bytes = new Uint8Array(reader.result);
-                        var length = bytes.byteLength;
-                        for (var i = 0; i < length; i++) {
-                            binary += String.fromCharCode(bytes[i]);
-                        }
-                        var XLSX = require('xlsx');
-                        if (rABS) {
-                            wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
-                                type: 'base64'
-                            });
-                        } else {
-                            wb = XLSX.read(binary, {
-                                type: 'binary'
-                            });
-                        }
-                        // outdata就是你想要的东西 excel导入的数据
-                        outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
-                        // excel 数据再处理
-                        let arr = []
-                        outdata.map(v => {
-                            // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
-                            let jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig,'');
-                            console.log(jsonString);
-                            v = JSON.parse(jsonString);
-                            let obj = {}
-                            //xxx代表列名
-                            obj.caseNo = v.箱号
-                            obj.titleNo= v.封号
-                            obj.binNumber = v.仓位号
-                            obj.positionWeight=v.散船重量
-                            obj.loadNetWeight = v.装船净重
-                            obj.unloadNetWeight = v.卸船净重
-                            obj.loadingDate = toString(v.装船日期)
-                            obj.status= v.状态
-                            obj.shipType = v.类型
-                            console.log(obj)
-                            _this.freightspace.push(obj)
-                        })
-                        // _this.freightspace.concat(arr)
-                        console.log(arr,_this.freightspace)
-                    }
-                    reader.readAsArrayBuffer(f);
-                }
-                if (rABS) {
-                    reader.readAsArrayBuffer(f);
-                } else {
-                    reader.readAsBinaryString(f);
-                }
-                console.log(reader)
-            },
     dataFilter(val) {
       this.deptBudgetList.personCharge = val
       if (val) {
@@ -594,9 +639,9 @@ export default {
     },
     //下拉司机姓名改变事件
     selectdriver() {},
-    handleChange(value) {
-      this.selectedOptions = value
-    },
+    // handleChange(value) {
+    //   this.selectedOptions = value
+    // },
     returnsales() {
       this.deptBudgetList = {}
       this.freightspace = {}
@@ -694,14 +739,16 @@ export default {
               this.tranCarInfoList = this.freightspace
               this.tranCarInfoList.driver = this.deptBudgetList.driver
               this.tranCarInfoList.driverPhone = this.deptBudgetList.driverPhone
-              this.tranCarInfoList[0].sendDateStart = this.deptBudgetList.sendDateStart
+              this.tranCarInfoList[0].sendDateStart =
+                this.deptBudgetList.sendDateStart
               this.tranCarInfoList.receiveDateEnd =
                 this.deptBudgetList.receiveDateEnd
               this.tranCarInfoList.shipName = this.deptBudgetList.shipName
               this.tranCarInfoList.shipNo = this.shipNo
               this.tranCarInfoList.shipType = this.deptBudgetList.shipType
-              this.tranCarInfoList.boxNumber = this.deptBudgetList.boxNumber              
-              this.tranCarInfoList.unloadingDate = this.deptBudgetList.unloadingDate
+              this.tranCarInfoList.boxNumber = this.deptBudgetList.boxNumber
+              this.tranCarInfoList.unloadingDate =
+                this.deptBudgetList.unloadingDate
               // this.tranCarInfoList.boxNo = this.arr.toString()
               for (var i = 0; i < this.tranCarInfoList.length; i++) {
                 this.tranCarInfoList[i].id = this.freightspace[i].id
@@ -744,7 +791,11 @@ export default {
           this.deptBudgetList.driver = response.tranCarInfoList[0].driver
           this.deptBudgetList.driverPhone =
             response.tranCarInfoList[0].driverPhone
-          this.$set(this.deptBudgetList,'sendDateStart',response.tranCarInfoList[0].sendDateStart) 
+          this.$set(
+            this.deptBudgetList,
+            'sendDateStart',
+            response.tranCarInfoList[0].sendDateStart
+          )
           this.deptBudgetList.receiveDateEnd =
             response.tranCarInfoList[0].receiveDateEnd
           this.deptBudgetList.shipName = response.tranCarInfoList[0].shipName
@@ -1214,7 +1265,7 @@ export default {
   margin: 0 auto;
   margin-top: -2%;
 }
-.tupian{
+.tupian {
   margin-left: 14%;
   margin-top: -7%;
 }