瀏覽代碼

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/icore-pass

luobang 2 年之前
父節點
當前提交
7fdc606005

+ 403 - 14
src/views/statisticalReport/components/salesLogisticsStatistics/saleChemicalCokeForm.vue

@@ -79,6 +79,16 @@
             超重出厂
             超重出厂
           </el-button>
           </el-button>
         </el-form-item>
         </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="openReceive()">
+            <i class="el-icon-document"></i>签收抵达</el-button
+          >
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="checkTrans()">
+            <i class="el-icon-truck"></i>轨迹
+          </el-button>
+        </el-form-item>
       </el-form>
       </el-form>
     </div>
     </div>
     <div class="table">
     <div class="table">
@@ -90,8 +100,35 @@
         :shiyHeigth="shiyHeigth"
         :shiyHeigth="shiyHeigth"
         :isKuang="isKuang"
         :isKuang="isKuang"
         @func="func"
         @func="func"
+        highlight-current-row
+        @radio-change="selectOne"
         :pageSize="pageSize"
         :pageSize="pageSize"
-      ></dilTable>
+      >
+        <el-table-column label="抵达地址" width="150" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="showPic(scope.row.arrivalPhoto)">{{scope.row.arrivalAddress}}</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column label="签收地址" width="150" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <el-button type="text"  size="small" @click="showPic(scope.row.receiptPhoto)">{{scope.row.receiptAddress}}</el-button>
+          </template>
+        </el-table-column>
+      </dilTable>
+    </div>
+    <div style="height: 100%">
+      <vxe-modal
+        width="1237"
+        height="731"
+        v-model="value7"
+        show-zoom
+        resize
+        title="轨迹查询"
+      >
+        <template #default>
+          <PathView v-bind.sync="pathOption"></PathView>
+        </template>
+      </vxe-modal>
     </div>
     </div>
     <el-dialog :visible.sync="disvisiable">
     <el-dialog :visible.sync="disvisiable">
       <div class="admin2">
       <div class="admin2">
@@ -131,13 +168,107 @@
               </div>
               </div>
             </div>
             </div>
     </el-dialog>
     </el-dialog>
+    <el-dialog
+      title="抵达签收"
+      :visible.sync="arrivalReceiving"
+      :before-close="closeUpload"
+    >
+      <el-form style="margin-left:20%">
+        <el-form-item label="车牌号码">
+          <el-input
+            v-model="capacityNumber"
+            disabled
+            style="width:300px"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="签收地址">
+          <el-input
+            v-model="location"
+            style="width:400px"
+            :disabled="orgCode != 'wuliuyunshubu'"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="抵达时间">
+          <el-date-picker
+            v-model="arrivalTime"
+            type="datetime"
+            :disabled="orgCode != 'wuliuyunshubu'"
+            placeholder="选择日期时间"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="签收时间">
+          <el-date-picker
+            v-model="receiptTime"
+            type="datetime"
+            :disabled="orgCode != 'wuliuyunshubu'"
+            placeholder="选择日期时间"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="抵达图片(车头、满货箱)" style="">
+          <el-upload
+            ref="arrival"
+            list-type="picture-card"
+            :file-list="arriavlList"
+            action="/api/v1/otms/addtmstruckArrivalResult"
+            :limit="12"
+            :on-change="fileChange1"
+            :on-remove="fileChange1"
+            :on-preview="handlePictureCardPreview"
+            :on-exceed="exceed"
+            accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP,.PDF"
+            :auto-upload="false"
+          >
+            <i class="el-icon-plus"></i>
+          </el-upload>
+        </el-form-item>
+        <el-form-item label="签收图片(空货箱、质保书、签收单)">
+          <el-upload
+            ref="receive"
+            list-type="picture-card"
+            :file-list="receiveList"
+            action="null"
+            :limit="11"
+            :on-change="fileChange2"
+            :on-remove="fileChange2"
+            :on-preview="handlePictureCardPreview"
+            :on-exceed="exceed"
+            accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP,.PDF"
+            :auto-upload="false"
+          >
+            <i class="el-icon-plus"></i>
+          </el-upload>
+        </el-form-item>
+      </el-form>
+      <el-button
+        type="primary"
+        @click="arrivalAndReceive"
+        :loading="isLoading"
+        style="margin-left:40%"
+        >确定</el-button
+      >
+    </el-dialog>
+    <el-dialog title="图片预览" :visible.sync="dialogVisible" width="80%">
+      <img width="100%" :src="dialogImageUrl" alt="" />
+    </el-dialog>
+    <el-dialog title="图片查看" :visible.sync="dialogVisible2" width="80%">
+      <img width="100%" v-for="item in picList" :src="item" :key="item" alt="" />
+    </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 import { sjTime } from "@/utils/sharedJsFile";
 import { sjTime } from "@/utils/sharedJsFile";
-import { getCookie } from "@/utils/util.js";
+import { getCookie } from '@/utils/util.js'
+import PathView from './mapTest.vue'
+import currentLocation from './currentLocation.vue'
+import { downloadFile, creatImageFile } from '@/utils/base64ToBlob.js'
 export default {
 export default {
+  components: {
+    PathView,
+    currentLocation
+  },
   data() {
   data() {
     return {
     return {
       orderNumber: null,
       orderNumber: null,
@@ -152,7 +283,8 @@ export default {
       pageSize: 100,
       pageSize: 100,
       isKuang: false,
       isKuang: false,
       option: {
       option: {
-        requestUrl: ""
+        requestUrl: "",
+        selectionType:"radio"
       },
       },
       startTime: null,
       startTime: null,
       endTime: null,
       endTime: null,
@@ -161,20 +293,47 @@ export default {
       //合计车数
       //合计车数
       totalCapacity: 0,
       totalCapacity: 0,
       tableTitle: "销售统计报表",
       tableTitle: "销售统计报表",
-      inputReceiveName: null
+      inputReceiveName: null,
+      //抵达签收
+      selection:null,
+      orgCode:null,
+      location: null,
+      capacityNumber: null,
+      arrivalReceiving: false,
+      arriavlList: [],
+      receiveList: [],
+      fileListArrival: [],
+      fileListReceive: [],
+      dialogImageUrl: '',
+      dialogVisible: false,
+      picList:[],
+      dialogVisible2:false,
+      isLoading: false,
+      arrivalTime: null,
+      receiptTime: null,
+      dialogFormVisible: false,
+      //轨迹
+      value7: false,
+      pathOption: {
+        orderNumber: '',
+        capacityNumber: '',
+        startPointName: '',
+        endPointName: '',
+        statusCode: '位置'
+      },
     };
     };
   },
   },
   created() {
   created() {
     //初始化表头
     //初始化表头
     if (getCookie("orgCode") == "chengyunshang") {
     if (getCookie("orgCode") == "chengyunshang") {
       this.option.requestUrl =
       this.option.requestUrl =
-        "/api/v1/tms/getAllSaleReport?apiId=423&startTime=null&endTime=null&orderType=2&shipperId=2&carrierSsoId=" +
+        "/api/v1/tms/getAllSaleReport?apiId=526&startTime=null&endTime=null&orderType=2&shipperId=2&carrierSsoId=" +
         getCookie("userId") +
         getCookie("userId") +
         "&i=" +
         "&i=" +
         new Date();
         new Date();
     } else {
     } else {
       this.option.requestUrl =
       this.option.requestUrl =
-        "/api/v1/tms/getAllSaleReport?apiId=423&startTime=null&endTime=null&orderType=2&shipperId=2&carrierSsoId=" +
+        "/api/v1/tms/getAllSaleReport?apiId=526&startTime=null&endTime=null&orderType=2&shipperId=2&carrierSsoId=" +
         null +
         null +
         "&i=" +
         "&i=" +
         new Date();
         new Date();
@@ -184,8 +343,238 @@ export default {
     var startTime = this.dataFormat(sjTime(start));
     var startTime = this.dataFormat(sjTime(start));
     var endTime = this.dataFormat(sjTime(new Date()));
     var endTime = this.dataFormat(sjTime(new Date()));
     this.tableTitle = startTime + " 至 " + endTime;
     this.tableTitle = startTime + " 至 " + endTime;
+    this.orgCode=getCookie('orgCode');
+    console.log(this.orgCode);
   },
   },
   methods: {
   methods: {
+    //选中
+    selectOne(selection){
+      console.log("selection",selection);
+      this.selection=selection;
+    },
+    //抵达签收
+    openReceive() {
+      if (!this.selection) {
+        this.$message.warning('请选择需要补录的实绩')
+        return
+      }
+      let row = this.selection
+      if (!row.resultOutGateTime) {
+        this.$message.warning('该车未出厂,不允许签收')
+        return
+      }
+      if (row.arrivalAddress) {
+        //优先获取抵达地址
+        this.location = row.arrivalAddress
+      } else {
+        //其次获取车辆定位
+        this.axios
+          .get(
+            '/api/v1/otms/getCurrentLocation?capcityNumber=' + row.capacityNumber
+          )
+          .then(res => {
+            if (
+              res.data.status == 'succeed' &&
+              res.data.data.result.status != 1001
+            ) {
+              this.location = res.data.data.result.adr
+            } else {
+              this.location = null
+              // this.$message.warning('获取不到车辆定位!请联系销售公司上传!')
+            }
+          })
+      }
+      this.orderNumber = row.orderNumber
+      this.capacityNumber = row.capacityNumber
+      this.arrivalTime = row.arrivalTime
+      this.receiptTime = row.receiptTime
+      this.arrivalReceiving = true
+      //抵达图片
+      this.axios
+        .post('/api/v1/otms/getArrivalPhoto?orderNumber=' + row.orderNumber)
+        .then(res => {
+          console.log('arrivalPhoto:', res)
+          if (res.data) {
+            this.arriavlList = []
+            res.data.forEach((e, index) => {
+              creatImageFile(e, 'file1-' + index).then(res => {
+                this.arriavlList.push({
+                  name: 'file' + index,
+                  raw: res,
+                  url: e
+                })
+              })
+            })
+            this.fileListArrival = this.arriavlList
+          }
+        })
+      //签收图片
+      this.axios
+        .post('/api/v1/otms/getReceivingPhotoByUrl?orderNumber=' + row.orderNumber)
+        .then(res => {
+          console.log('ReceivingPhoto:', res)
+          if (res.data) {
+            this.receiveList = []
+            res.data.forEach((e, index) => {
+              creatImageFile(e, 'file2-' + index).then(res => {
+                this.receiveList.push({
+                  name: 'file' + index,
+                  raw: res,
+                  url: e
+                })
+              })
+            })
+            this.fileListReceive = this.receiveList
+          }
+        })
+    },
+    arrivalAndReceive() {
+      if (!this.location) {
+        this.$message.warning(
+          '签收地址必须取车辆定位!若取不到请联系销售公司上传!'
+        )
+        return
+      }
+      if (this.fileListArrival.length < 3) {
+        this.$message.warning('抵达图至少三张')
+        return
+      }
+      if (this.fileListReceive.length < 2) {
+        this.$message.warning('签收图最少两张')
+        return
+      }
+      this.isLoading = true
+      //上传抵达
+      let formData = new window.FormData()
+      this.fileListArrival.forEach((item, index) => {
+        formData.append('file' + index, item.raw)
+      })
+      formData.append('orderNumber', this.orderNumber)
+      formData.append('resultArrivalAddress', this.location)
+      if (this.arrivalTime) {
+        formData.append('arrivalTime', sjTime(this.arrivalTime))
+      }
+      let options = {
+        // 设置axios的参数
+        url: '/api/v1/otms/addtmstruckArrivalResult',
+        data: formData,
+        method: 'post',
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      }
+      this.axios(options).then(res => {
+        console.log('arrivalRes:', res)
+        //上传签收
+        let formData = new window.FormData()
+        let request = ''
+        this.fileListReceive.forEach((item, index) => {
+          formData.append('file' + index, item.raw)
+        })
+        formData.append('orderNumber', this.orderNumber)
+        formData.append('resultArrivalAddress', this.location)
+        if (this.receiptTime) {
+          formData.append('receiptTime', sjTime(this.receiptTime))
+        }
+        formData.append('num', request.length)
+        let options = {
+          url: '/api/v1/otms/addTmstruckReceiptResultForWeb',
+          data: formData,
+          method: 'post',
+          headers: {
+            'Content-Type': 'multipart/form-data'
+          }
+        }
+        this.axios(options).then(res => {
+          console.log('receiveRes:', res)
+          this.$message.success('上传成功!')
+          this.selection.arrivalAddress = this.location
+          this.closeUpload()
+          // this.refresh()
+        })
+      })
+    },
+    fileChange1(file, fileList) {
+      this.fileListArrival = fileList
+    },
+    fileChange2(file, fileList) {
+      this.fileListReceive = fileList
+    },
+    fileChange3(file, fileList) {
+      this.remarkPicList = fileList
+    },
+    exceed() {
+      this.$message.warning('超出上传数量!')
+    },
+    handlePictureCardPreview(file) {
+      this.dialogImageUrl = file.url
+      this.dialogVisible = true
+    },
+    closeUpload() {
+      this.location = null
+      this.arrivalTime = null
+      this.receiptTime = null
+      this.arrivalReceiving = false
+      this.isLoading = false
+      this.$refs.arrival.clearFiles()
+      this.$refs.receive.clearFiles()
+    },
+    showPic(urls) {
+      //获取图片到本地
+      this.axios.post('/api/v1/uc/getPicture', {urls:urls}).then(res => {
+        console.log(res)
+        if (res.data) {
+          // let remarkPicList = []
+          // res.data.forEach((e, index) => {
+          //   creatImageFile(e, 'file2-' + index).then(res => {
+          //     remarkPicList.push({
+          //       name: 'file' + index,
+          //       raw: res,
+          //       url: e
+          //     })
+          //   })
+          // })
+          this.picList = res.data
+        } else {
+          this.picList = []
+        }
+        this.dialogVisible2 = true
+      })
+    },
+    //轨迹
+    checkTrans() {
+      let row = this.selection
+      if (!this.selection) {
+        this.$message.error('请点击需要查看轨迹的行!')
+        return
+      }
+      if (row.resultOutGateTime == null) {
+        this.$message.error('该车还未出厂,暂无轨迹')
+        return
+      }
+      let that = this
+      that.axios
+        .post('/api/v1/otms/fullPath?orderNumber=' + row.orderNumber)
+        .then(res => {
+          console.log(res.data)
+          if (res.data.data == '-1') {
+            this.$message.error('运输订单未关闭的自提车辆无权查看!')
+          } else if (res.data.data.startAndEndRoutes != null) {
+            that.pathOption.orderNumber = row.orderNumber
+            that.pathOption.capacityNumber = row.capacityNumber
+            that.pathOption.startPointName = '达钢集团小东门'
+            that.pathOption.endPointName = row.receiptAddress
+            that.value7 = true
+            if (row.orderStatus == '已完成') {
+              that.pathOption.statusCode = '位置'
+            } else {
+              that.pathOption.statusCode = '当前位置'
+            }
+          } else {
+            this.$message.error('车辆没有开启GPS')
+          }
+        })
+    },
      exportToExcel(tableTitle="表格标题") {
      exportToExcel(tableTitle="表格标题") {
         //创建工作簿对象
         //创建工作簿对象
         let wb = XLSX.utils.book_new();
         let wb = XLSX.utils.book_new();
@@ -231,7 +620,7 @@ export default {
     //   if (this.inputReceiveName != null) {
     //   if (this.inputReceiveName != null) {
     //     if (getCookie("orgCode") == "chengyunshang") {
     //     if (getCookie("orgCode") == "chengyunshang") {
     //       this.option.requestUrl =
     //       this.option.requestUrl =
-    //         "/api/v1/tms/getAllSaleReport?apiId=423&orderType=2&shipperId=2&carrierSsoId=" +
+    //         "/api/v1/tms/getAllSaleReport?apiId=526&orderType=2&shipperId=2&carrierSsoId=" +
     //         getCookie("userId") +
     //         getCookie("userId") +
     //         "&i=" +
     //         "&i=" +
     //         new Date() +
     //         new Date() +
@@ -243,7 +632,7 @@ export default {
     //         endTime;
     //         endTime;
     //     } else {
     //     } else {
     //       this.option.requestUrl =
     //       this.option.requestUrl =
-    //         "/api/v1/tms/getAllSaleReport?apiId=423&orderType=2&shipperId=2&carrierSsoId=" +
+    //         "/api/v1/tms/getAllSaleReport?apiId=526&orderType=2&shipperId=2&carrierSsoId=" +
     //         null +
     //         null +
     //         "&i=" +
     //         "&i=" +
     //         new Date() +
     //         new Date() +
@@ -257,13 +646,13 @@ export default {
     //   } else {
     //   } else {
     //     if (getCookie("orgCode") == "chengyunshang") {
     //     if (getCookie("orgCode") == "chengyunshang") {
     //       this.option.requestUrl =
     //       this.option.requestUrl =
-    //         "/api/v1/tms/getAllSaleReport?apiId=423&startTime=null&endTime=null&orderType=2&shipperId=2&carrierSsoId=" +
+    //         "/api/v1/tms/getAllSaleReport?apiId=526&startTime=null&endTime=null&orderType=2&shipperId=2&carrierSsoId=" +
     //         getCookie("userId") +
     //         getCookie("userId") +
     //         "&i=" +
     //         "&i=" +
     //         new Date();
     //         new Date();
     //     } else {
     //     } else {
     //       this.option.requestUrl =
     //       this.option.requestUrl =
-    //         "/api/v1/tms/getAllSaleReport?apiId=423&startTime=null&endTime=null&orderType=2&shipperId=2&carrierSsoId=" +
+    //         "/api/v1/tms/getAllSaleReport?apiId=526&startTime=null&endTime=null&orderType=2&shipperId=2&carrierSsoId=" +
     //         null +
     //         null +
     //         "&i=" +
     //         "&i=" +
     //         new Date();
     //         new Date();
@@ -357,7 +746,7 @@ export default {
         //加上时间重置表头
         //加上时间重置表头
         if (getCookie("orgCode") == "chengyunshang") {
         if (getCookie("orgCode") == "chengyunshang") {
           this.option.requestUrl =
           this.option.requestUrl =
-            "/api/v1/tms/getAllSaleReport?apiId=423&startTime=" +
+            "/api/v1/tms/getAllSaleReport?apiId=526&startTime=" +
             startTime +
             startTime +
             "&endTime=" +
             "&endTime=" +
             endTime +
             endTime +
@@ -374,7 +763,7 @@ export default {
             this.wareHouse;
             this.wareHouse;
         } else {
         } else {
           this.option.requestUrl =
           this.option.requestUrl =
-            "/api/v1/tms/getAllSaleReport?apiId=423&startTime=" +
+            "/api/v1/tms/getAllSaleReport?apiId=526&startTime=" +
             startTime +
             startTime +
             "&endTime=" +
             "&endTime=" +
             endTime +
             endTime +
@@ -399,7 +788,7 @@ export default {
         //加上时间重置表头
         //加上时间重置表头
         if (getCookie("orgCode") == "chengyunshang") {
         if (getCookie("orgCode") == "chengyunshang") {
           this.option.requestUrl =
           this.option.requestUrl =
-            "/api/v1/tms/getAllSaleReport?apiId=423&startTime=" +
+            "/api/v1/tms/getAllSaleReport?apiId=526&startTime=" +
             startTime +
             startTime +
             "&endTime=" +
             "&endTime=" +
             endTime +
             endTime +
@@ -416,7 +805,7 @@ export default {
             this.wareHouse;
             this.wareHouse;
         } else {
         } else {
           this.option.requestUrl =
           this.option.requestUrl =
-            "/api/v1/tms/getAllSaleReport?apiId=423&startTime=" +
+            "/api/v1/tms/getAllSaleReport?apiId=526&startTime=" +
             startTime +
             startTime +
             "&endTime=" +
             "&endTime=" +
             endTime +
             endTime +

+ 416 - 13
src/views/statisticalReport/components/salesLogisticsStatistics/saleCoproductForm.vue

@@ -28,6 +28,14 @@
               clearable
               clearable
             ></el-input>
             ></el-input>
           </el-form-item>
           </el-form-item>
+          <el-form-item>
+            <el-input
+              v-model="wareHouse"
+              style="width:200px"
+              placeholder="输入装货地点"
+              clearable
+            ></el-input>
+          </el-form-item>
           <el-form-item>
           <el-form-item>
             <el-input
             <el-input
               v-model="inputMaterial"
               v-model="inputMaterial"
@@ -71,6 +79,16 @@
             超重出厂
             超重出厂
           </el-button>
           </el-button>
         </el-form-item>
         </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="openReceive()">
+            <i class="el-icon-document"></i>签收抵达</el-button
+          >
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="checkTrans()">
+            <i class="el-icon-truck"></i>轨迹
+          </el-button>
+        </el-form-item>
       </el-form>
       </el-form>
     </div>
     </div>
     <div class="table">
     <div class="table">
@@ -81,8 +99,35 @@
         :shiyHeigth="shiyHeigth"
         :shiyHeigth="shiyHeigth"
         :isKuang="isKuang"
         :isKuang="isKuang"
         @func="func"
         @func="func"
+         highlight-current-row
+        @radio-change="selectOne"
         :pageSize="pageSize"
         :pageSize="pageSize"
-      ></dilTable>
+      >
+        <el-table-column label="抵达地址" width="150" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="showPic(scope.row.arrivalPhoto)">{{scope.row.arrivalAddress}}</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column label="签收地址" width="150" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <el-button type="text"  size="small" @click="showPic(scope.row.receiptPhoto)">{{scope.row.receiptAddress}}</el-button>
+          </template>
+        </el-table-column>
+      </dilTable>
+    </div>
+    <div style="height: 100%">
+      <vxe-modal
+        width="1237"
+        height="731"
+        v-model="value7"
+        show-zoom
+        resize
+        title="轨迹查询"
+      >
+        <template #default>
+          <PathView v-bind.sync="pathOption"></PathView>
+        </template>
+      </vxe-modal>
     </div>
     </div>
     <el-dialog :visible.sync="disvisiable">
     <el-dialog :visible.sync="disvisiable">
       <div class="admin2">
       <div class="admin2">
@@ -122,13 +167,106 @@
               </div>
               </div>
             </div>
             </div>
     </el-dialog>
     </el-dialog>
+    <el-dialog
+      title="抵达签收"
+      :visible.sync="arrivalReceiving"
+      :before-close="closeUpload"
+    >
+      <el-form style="margin-left:20%">
+        <el-form-item label="车牌号码">
+          <el-input
+            v-model="capacityNumber"
+            disabled
+            style="width:300px"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="签收地址">
+          <el-input
+            v-model="location"
+            style="width:400px"
+            :disabled="orgCode != 'wuliuyunshubu'"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="抵达时间">
+          <el-date-picker
+            v-model="arrivalTime"
+            type="datetime"
+            :disabled="orgCode != 'wuliuyunshubu'"
+            placeholder="选择日期时间"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="签收时间">
+          <el-date-picker
+            v-model="receiptTime"
+            type="datetime"
+            :disabled="orgCode != 'wuliuyunshubu'"
+            placeholder="选择日期时间"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="抵达图片(车头、满货箱)" style="">
+          <el-upload
+            ref="arrival"
+            list-type="picture-card"
+            :file-list="arriavlList"
+            action="/api/v1/otms/addtmstruckArrivalResult"
+            :limit="12"
+            :on-change="fileChange1"
+            :on-remove="fileChange1"
+            :on-preview="handlePictureCardPreview"
+            :on-exceed="exceed"
+            accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP,.PDF"
+            :auto-upload="false"
+          >
+            <i class="el-icon-plus"></i>
+          </el-upload>
+        </el-form-item>
+        <el-form-item label="签收图片(空货箱、质保书、签收单)">
+          <el-upload
+            ref="receive"
+            list-type="picture-card"
+            :file-list="receiveList"
+            action="null"
+            :limit="11"
+            :on-change="fileChange2"
+            :on-remove="fileChange2"
+            :on-preview="handlePictureCardPreview"
+            :on-exceed="exceed"
+            accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP,.PDF"
+            :auto-upload="false"
+          >
+            <i class="el-icon-plus"></i>
+          </el-upload>
+        </el-form-item>
+      </el-form>
+      <el-button
+        type="primary"
+        @click="arrivalAndReceive"
+        :loading="isLoading"
+        style="margin-left:40%"
+        >确定</el-button
+      >
+    </el-dialog>
+    <el-dialog title="图片预览" :visible.sync="dialogVisible" width="80%">
+      <img width="100%" :src="dialogImageUrl" alt="" />
+    </el-dialog>
+    <el-dialog title="图片查看" :visible.sync="dialogVisible2" width="80%">
+      <img width="100%" v-for="item in picList" :src="item" :key="item" alt="" />
+    </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 import { sjTime } from "@/utils/sharedJsFile";
 import { sjTime } from "@/utils/sharedJsFile";
 import { getCookie } from "@/utils/util.js";
 import { getCookie } from "@/utils/util.js";
+import PathView from './mapTest.vue'
+import currentLocation from './currentLocation.vue'
 export default {
 export default {
+  components: {
+    PathView,
+    currentLocation
+  },
   data() {
   data() {
     return {
     return {
       orderNumber: null,
       orderNumber: null,
@@ -141,7 +279,8 @@ export default {
       pageSize: 100,
       pageSize: 100,
       isKuang: false,
       isKuang: false,
       option: {
       option: {
-        requestUrl: ""
+        requestUrl: "",
+        selectionType:"radio"
       },
       },
       startTime: null,
       startTime: null,
       endTime: null,
       endTime: null,
@@ -151,20 +290,48 @@ export default {
       totalCapacity: 0,
       totalCapacity: 0,
       tableTitle: "销售统计报表",
       tableTitle: "销售统计报表",
       inputMaterial: null,
       inputMaterial: null,
-      inputReceiveName: null
+      inputReceiveName: null,
+      wareHouse:null,
+      //抵达签收
+      selection:null,
+      orgCode:null,
+      location: null,
+      capacityNumber: null,
+      arrivalReceiving: false,
+      arriavlList: [],
+      receiveList: [],
+      fileListArrival: [],
+      fileListReceive: [],
+      dialogImageUrl: '',
+      dialogVisible: false,
+      picList:[],
+      dialogVisible2:false,
+      isLoading: false,
+      arrivalTime: null,
+      receiptTime: null,
+      dialogFormVisible: false,
+      //轨迹
+      value7: false,
+      pathOption: {
+        orderNumber: '',
+        capacityNumber: '',
+        startPointName: '',
+        endPointName: '',
+        statusCode: '位置'
+      },
     };
     };
   },
   },
   created() {
   created() {
     //初始化表头
     //初始化表头
     if (getCookie("orgCode") == "chengyunshang") {
     if (getCookie("orgCode") == "chengyunshang") {
       this.option.requestUrl =
       this.option.requestUrl =
-        "/api/v1/tms/getAllSaleReport?apiId=423&startTime=null&endTime=null&orderType=2&shipperId=1&carrierSsoId=" +
+        "/api/v1/tms/getAllSaleReport?apiId=526&startTime=null&endTime=null&orderType=2&shipperId=1&carrierSsoId=" +
         getCookie("userId") +
         getCookie("userId") +
         "&i=" +
         "&i=" +
         new Date();
         new Date();
     } else {
     } else {
       this.option.requestUrl =
       this.option.requestUrl =
-        "/api/v1/tms/getAllSaleReport?apiId=423&startTime=null&endTime=null&orderType=2&shipperId=1&carrierSsoId=" +
+        "/api/v1/tms/getAllSaleReport?apiId=526&startTime=null&endTime=null&orderType=2&shipperId=1&carrierSsoId=" +
         null +
         null +
         "&i=" +
         "&i=" +
         new Date();
         new Date();
@@ -174,8 +341,238 @@ export default {
     var startTime = this.dataFormat(sjTime(start));
     var startTime = this.dataFormat(sjTime(start));
     var endTime = this.dataFormat(sjTime(new Date()));
     var endTime = this.dataFormat(sjTime(new Date()));
     this.tableTitle = startTime + " 至 " + endTime;
     this.tableTitle = startTime + " 至 " + endTime;
+    this.orgCode=getCookie('orgCode');
+    console.log(this.orgCode);
   },
   },
   methods: {
   methods: {
+    //选中
+    selectOne(selection){
+      console.log("selection",selection);
+      this.selection=selection;
+    },
+    //抵达签收
+    openReceive() {
+      if (!this.selection) {
+        this.$message.warning('请选择需要补录的实绩')
+        return
+      }
+      let row = this.selection
+      if (!row.resultOutGateTime) {
+        this.$message.warning('该车未出厂,不允许签收')
+        return
+      }
+      if (row.arrivalAddress) {
+        //优先获取抵达地址
+        this.location = row.arrivalAddress
+      } else {
+        //其次获取车辆定位
+        this.axios
+          .get(
+            '/api/v1/otms/getCurrentLocation?capcityNumber=' + row.capacityNumber
+          )
+          .then(res => {
+            if (
+              res.data.status == 'succeed' &&
+              res.data.data.result.status != 1001
+            ) {
+              this.location = res.data.data.result.adr
+            } else {
+              this.location = null
+              // this.$message.warning('获取不到车辆定位!请联系销售公司上传!')
+            }
+          })
+      }
+      this.orderNumber = row.orderNumber
+      this.capacityNumber = row.capacityNumber
+      this.arrivalTime = row.arrivalTime
+      this.receiptTime = row.receiptTime
+      this.arrivalReceiving = true
+      //抵达图片
+      this.axios
+        .post('/api/v1/otms/getArrivalPhoto?orderNumber=' + row.orderNumber)
+        .then(res => {
+          console.log('arrivalPhoto:', res)
+          if (res.data) {
+            this.arriavlList = []
+            res.data.forEach((e, index) => {
+              creatImageFile(e, 'file1-' + index).then(res => {
+                this.arriavlList.push({
+                  name: 'file' + index,
+                  raw: res,
+                  url: e
+                })
+              })
+            })
+            this.fileListArrival = this.arriavlList
+          }
+        })
+      //签收图片
+      this.axios
+        .post('/api/v1/otms/getReceivingPhotoByUrl?orderNumber=' + row.orderNumber)
+        .then(res => {
+          console.log('ReceivingPhoto:', res)
+          if (res.data) {
+            this.receiveList = []
+            res.data.forEach((e, index) => {
+              creatImageFile(e, 'file2-' + index).then(res => {
+                this.receiveList.push({
+                  name: 'file' + index,
+                  raw: res,
+                  url: e
+                })
+              })
+            })
+            this.fileListReceive = this.receiveList
+          }
+        })
+    },
+    arrivalAndReceive() {
+      if (!this.location) {
+        this.$message.warning(
+          '签收地址必须取车辆定位!若取不到请联系销售公司上传!'
+        )
+        return
+      }
+      if (this.fileListArrival.length < 3) {
+        this.$message.warning('抵达图至少三张')
+        return
+      }
+      if (this.fileListReceive.length < 2) {
+        this.$message.warning('签收图最少两张')
+        return
+      }
+      this.isLoading = true
+      //上传抵达
+      let formData = new window.FormData()
+      this.fileListArrival.forEach((item, index) => {
+        formData.append('file' + index, item.raw)
+      })
+      formData.append('orderNumber', this.orderNumber)
+      formData.append('resultArrivalAddress', this.location)
+      if (this.arrivalTime) {
+        formData.append('arrivalTime', sjTime(this.arrivalTime))
+      }
+      let options = {
+        // 设置axios的参数
+        url: '/api/v1/otms/addtmstruckArrivalResult',
+        data: formData,
+        method: 'post',
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      }
+      this.axios(options).then(res => {
+        console.log('arrivalRes:', res)
+        //上传签收
+        let formData = new window.FormData()
+        let request = ''
+        this.fileListReceive.forEach((item, index) => {
+          formData.append('file' + index, item.raw)
+        })
+        formData.append('orderNumber', this.orderNumber)
+        formData.append('resultArrivalAddress', this.location)
+        if (this.receiptTime) {
+          formData.append('receiptTime', sjTime(this.receiptTime))
+        }
+        formData.append('num', request.length)
+        let options = {
+          url: '/api/v1/otms/addTmstruckReceiptResultForWeb',
+          data: formData,
+          method: 'post',
+          headers: {
+            'Content-Type': 'multipart/form-data'
+          }
+        }
+        this.axios(options).then(res => {
+          console.log('receiveRes:', res)
+          this.$message.success('上传成功!')
+          this.selection.arrivalAddress = this.location
+          this.closeUpload()
+          // this.refresh()
+        })
+      })
+    },
+    fileChange1(file, fileList) {
+      this.fileListArrival = fileList
+    },
+    fileChange2(file, fileList) {
+      this.fileListReceive = fileList
+    },
+    fileChange3(file, fileList) {
+      this.remarkPicList = fileList
+    },
+    exceed() {
+      this.$message.warning('超出上传数量!')
+    },
+    handlePictureCardPreview(file) {
+      this.dialogImageUrl = file.url
+      this.dialogVisible = true
+    },
+    closeUpload() {
+      this.location = null
+      this.arrivalTime = null
+      this.receiptTime = null
+      this.arrivalReceiving = false
+      this.isLoading = false
+      this.$refs.arrival.clearFiles()
+      this.$refs.receive.clearFiles()
+    },
+    showPic(urls) {
+      //获取图片到本地
+      this.axios.post('/api/v1/uc/getPicture', {urls:urls}).then(res => {
+        console.log(res)
+        if (res.data) {
+          // let remarkPicList = []
+          // res.data.forEach((e, index) => {
+          //   creatImageFile(e, 'file2-' + index).then(res => {
+          //     remarkPicList.push({
+          //       name: 'file' + index,
+          //       raw: res,
+          //       url: e
+          //     })
+          //   })
+          // })
+          this.picList = res.data
+        } else {
+          this.picList = []
+        }
+        this.dialogVisible2 = true
+      })
+    },
+    //轨迹
+    checkTrans() {
+      let row = this.selection
+      if (!this.selection) {
+        this.$message.error('请点击需要查看轨迹的行!')
+        return
+      }
+      if (row.resultOutGateTime == null) {
+        this.$message.error('该车还未出厂,暂无轨迹')
+        return
+      }
+      let that = this
+      that.axios
+        .post('/api/v1/otms/fullPath?orderNumber=' + row.orderNumber)
+        .then(res => {
+          console.log(res.data)
+          if (res.data.data == '-1') {
+            this.$message.error('运输订单未关闭的自提车辆无权查看!')
+          } else if (res.data.data.startAndEndRoutes != null) {
+            that.pathOption.orderNumber = row.orderNumber
+            that.pathOption.capacityNumber = row.capacityNumber
+            that.pathOption.startPointName = '达钢集团小东门'
+            that.pathOption.endPointName = row.receiptAddress
+            that.value7 = true
+            if (row.orderStatus == '已完成') {
+              that.pathOption.statusCode = '位置'
+            } else {
+              that.pathOption.statusCode = '当前位置'
+            }
+          } else {
+            this.$message.error('车辆没有开启GPS')
+          }
+        })
+    },
     // getReceiveName() {
     // getReceiveName() {
     //   if (this.inputReceiveName != null) {
     //   if (this.inputReceiveName != null) {
     //     if (getCookie("orgCode") == "chengyunshang") {
     //     if (getCookie("orgCode") == "chengyunshang") {
@@ -298,7 +695,7 @@ export default {
         //加上时间重置表头
         //加上时间重置表头
         if (getCookie("orgCode") == "chengyunshang") {
         if (getCookie("orgCode") == "chengyunshang") {
           this.option.requestUrl =
           this.option.requestUrl =
-            "/api/v1/tms/getAllSaleReport?apiId=423&startTime=" +
+            "/api/v1/tms/getAllSaleReport?apiId=526&startTime=" +
             startTime +
             startTime +
             "&endTime=" +
             "&endTime=" +
             endTime +
             endTime +
@@ -310,10 +707,12 @@ export default {
             "&receiveName=" +
             "&receiveName=" +
             this.inputReceiveName +
             this.inputReceiveName +
             "&materialName=" +
             "&materialName=" +
-            this.inputMaterial;
+            this.inputMaterial
+            +"&wareHouse="+
+            this.wareHouse;
         } else {
         } else {
           this.option.requestUrl =
           this.option.requestUrl =
-            "/api/v1/tms/getAllSaleReport?apiId=423&startTime=" +
+            "/api/v1/tms/getAllSaleReport?apiId=526&startTime=" +
             startTime +
             startTime +
             "&endTime=" +
             "&endTime=" +
             endTime +
             endTime +
@@ -325,7 +724,9 @@ export default {
             "&receiveName=" +
             "&receiveName=" +
             this.inputReceiveName +
             this.inputReceiveName +
             "&materialName=" +
             "&materialName=" +
-            this.inputMaterial;
+            this.inputMaterial
+            +"&wareHouse="+
+            this.wareHouse;
         }
         }
       } else {
       } else {
         if (this.startTime) {
         if (this.startTime) {
@@ -336,7 +737,7 @@ export default {
         //加上时间重置表头
         //加上时间重置表头
         if (getCookie("orgCode") == "chengyunshang") {
         if (getCookie("orgCode") == "chengyunshang") {
           this.option.requestUrl =
           this.option.requestUrl =
-            "/api/v1/tms/getAllSaleReport?apiId=423&startTime=" +
+            "/api/v1/tms/getAllSaleReport?apiId=526&startTime=" +
             startTime +
             startTime +
             "&endTime=" +
             "&endTime=" +
             endTime +
             endTime +
@@ -348,10 +749,11 @@ export default {
             "&receiveName=" +
             "&receiveName=" +
             this.inputReceiveName +
             this.inputReceiveName +
             "&materialName=" +
             "&materialName=" +
-            this.inputMaterial;
+            this.inputMaterial +"&wareHouse="+
+            this.wareHouse;
         } else {
         } else {
           this.option.requestUrl =
           this.option.requestUrl =
-            "/api/v1/tms/getAllSaleReport?apiId=423&startTime=" +
+            "/api/v1/tms/getAllSaleReport?apiId=526&startTime=" +
             startTime +
             startTime +
             "&endTime=" +
             "&endTime=" +
             endTime +
             endTime +
@@ -363,7 +765,8 @@ export default {
             "&receiveName=" +
             "&receiveName=" +
             this.inputReceiveName +
             this.inputReceiveName +
             "&materialName=" +
             "&materialName=" +
-            this.inputMaterial;
+            this.inputMaterial +"&wareHouse="+
+            this.wareHouse;
         }
         }
       }
       }
     },
     },

+ 6 - 0
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

@@ -703,6 +703,7 @@
           <el-image
           <el-image
             :src="item.src"
             :src="item.src"
             fit="fill"
             fit="fill"
+            :previewSrcList="previewSrcList"
             @click.prevent.right="receiveClick(item.src, '抵达')"
             @click.prevent.right="receiveClick(item.src, '抵达')"
           >
           >
             <div slot="error" class="image-slot">
             <div slot="error" class="image-slot">
@@ -716,6 +717,7 @@
           <el-image
           <el-image
             :src="item.src"
             :src="item.src"
             fit="fill"
             fit="fill"
+            :previewSrcList="previewSrcList2"
             @click.prevent.right="receiveClick(item.src, '签收')"
             @click.prevent.right="receiveClick(item.src, '签收')"
           >
           >
             <div slot="error" class="image-slot">
             <div slot="error" class="image-slot">
@@ -1979,9 +1981,11 @@ export default {
       addressId: null,
       addressId: null,
       addressRow: {},
       addressRow: {},
       srcList: [],
       srcList: [],
+      previewSrcList2:[],
       src: '',
       src: '',
       isShow: false,
       isShow: false,
       srcList2: [],
       srcList2: [],
+      previewSrcList2:[],
       isShow2: false,
       isShow2: false,
       maxHeight: 700,
       maxHeight: 700,
       //轨迹窗口
       //轨迹窗口
@@ -3853,6 +3857,7 @@ export default {
         .post('/api/v1/otms/getArrivalPhoto?orderNumber=' + orderNo)
         .post('/api/v1/otms/getArrivalPhoto?orderNumber=' + orderNo)
         .then(res => {
         .then(res => {
           this.srcList = []
           this.srcList = []
+          this.previewSrcList = res.data
           console.log(res.data, 'sd')
           console.log(res.data, 'sd')
           res.data.forEach(e => {
           res.data.forEach(e => {
             this.srcList.push({
             this.srcList.push({
@@ -3896,6 +3901,7 @@ export default {
             this.isShow2 = true
             this.isShow2 = true
           }
           }
           this.srcList2 = []
           this.srcList2 = []
+          this.previewSrcList2 = res.data
           if (res.data && res.data.length > 0) {
           if (res.data && res.data.length > 0) {
             res.data.forEach(item => {
             res.data.forEach(item => {
               this.srcList2.push({
               this.srcList2.push({