瀏覽代碼

管理端 增加 运单协议查询功能,只保存一天

mashengyi 1 年之前
父節點
當前提交
e9b8c404f0
共有 3 個文件被更改,包括 315 次插入3 次删除
  1. 2 0
      src/router/index.js
  2. 7 3
      src/views/Home.vue
  3. 306 0
      src/views/noCar/waybillFile.vue

+ 2 - 0
src/router/index.js

@@ -28,6 +28,7 @@ const User = () => { return import(`@/views/sys/user`) }
 // 无车部分
 const nocarRec = () => { return import(`@/views/noCar/nocarRec.vue`) }
 const billway = () => { return import(`@/views/noCar/billway.vue`) }
+const noCarWaybillFile = () => { return import(`@/views/noCar/WaybillFile.vue`) }
 const nocarInvoice = () => { return import(`@/views/noCar/invoice.vue`) }
 const billwayException = () => { return import(`@/views/noCar/billwayException.vue`) }
 const noCarCalculateInfo = () => { return import(`@/views/noCar/calculateInfo.vue`) }
@@ -107,6 +108,7 @@ const router = new Router({
         // 无车部分
         { name: `nocarRec`, path: `/nocarRec`, component: nocarRec },
         { name: `billway`, path: `/billway`, component: billway },
+        { name: `noCarWaybillFile`, path: `/noCarWaybillFile`, component: noCarWaybillFile },
         { name: `nocarInvoice`, path: `/nocarInvoice`, component: nocarInvoice },
         { name: `billwayException`, path: `/billwayException`, component: billwayException },
         { name: `noCarCalculateInfo`, path: `/noCarCalculateInfo`, component: noCarCalculateInfo },

+ 7 - 3
src/views/Home.vue

@@ -196,7 +196,7 @@ export default {
           authName: `无车管理`,
           children: [
             {
-              id: 8,
+              id: 1,
               path: `nocarRec`,
               authName: `车辆备案`
             }, {
@@ -209,14 +209,18 @@ export default {
               authName: `异常运单`
             }, {
               id: 4,
+              path: `noCarWaybillFile`,
+              authName: `运单文件列表`
+            }, {
+              id: 5,
               path: `nocarInvoice`,
               authName: `发票查询`
             }, {
-              id: 5,
+              id: 6,
               path: `hcInvoice`,
               authName: `红冲发票查询`
             }, {
-              id: 5,
+              id: 7,
               path: `mothaccount`,
               authName: `月账单查询`
             }

+ 306 - 0
src/views/noCar/waybillFile.vue

@@ -0,0 +1,306 @@
+<template>
+  <div class="waybill">
+    <!-- 头部细节部分 -->
+      <div class="title">
+        <el-row>
+          <el-col :span="24">
+            <div class="top">
+              <el-input  placeholder="批次号" class="input-demo" v-model="batchNum"></el-input>
+               <el-input  placeholder="运单号" class="input-demo" v-model="wayBillNum"></el-input>
+              <el-button type="success" style="margin-left: 1%;" @click="firstLoadData">查询</el-button>
+              <!-- <el-button type="info" style="margin-left: 1%;">重置</el-button> -->
+            </div>
+          </el-col>
+        </el-row>
+
+      </div>
+    <!-- 头部细节部分结束 -->
+    <!-- 表格部分 -->
+      <template>
+        <el-table
+         class="table"
+          v-loading="loading"
+          ref="multipleTable"
+          :data="usertable"
+          :height="heightt"
+          border
+          tooltip-effect="dark">
+          <el-table-column
+            prop="batchNum"
+            label="批次号"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="wayBillNum"
+            label="运单号"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="fileName"
+            label="文件名称"
+            show-overflow-tooltip>
+             <template slot-scope="scope">
+               <el-link style="cursor:pointer;color: blue;" @click="downloadFile(scope.row.wayBillNum)">{{scope.row.fileName}}</el-link>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="创建时间"
+            show-overflow-tooltip>
+            <template slot-scope="scope" show-overflow-tooltip>
+              <span>{{scope.row.updateTime | fmtDate}}</span>
+            </template>
+          </el-table-column>
+        </el-table>
+      </template>
+
+    <!-- 分页 -->
+      <div class="block">
+        <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="current"
+        :page-sizes="[6, 8, 10]"
+        :page-size="pagesize"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="total">
+        </el-pagination>
+      </div>
+
+  </div>
+</template>
+
+<script>
+import FileSaver from 'file-saver'
+import XLSX from 'xlsx'
+export default{
+  data() {
+    return {
+      loading: false,
+      fullscreenLoading: false,
+      customerName: ``,
+      companyName: ``,
+      file: '',
+      batchNum: '',
+      wayBillNum: ``,
+      hightt: `0px`,
+      status: ``,
+      addList: false,
+      success: ``,
+      current: 1,
+      pagesize: 8,
+      total: 0,
+      currenttwo: 1,
+      pagesizetwo: 8,
+      totaltwo: 0
+    }
+  },
+  created() {
+    this.heightt = tableHeight // eslint-disable-line
+    this.customerName = sessionStorage.getItem(`userName`)
+    this.loadData()
+  },
+  methods: {
+    firstLoadData() {
+      this.current = 1
+      this.pagesize = 8
+      this.loadData()
+    },
+    // 列表展示
+    async loadData() {
+      const formData = new FormData()
+      formData.append(`current`, this.current)
+      formData.append(`size`, this.pagesize)
+      formData.append(`batchNum`, this.batchNum)
+      formData.append('wayBillNum', this.wayBillNum)
+      const response = await this.$http.post(`noCar/findBatchFileList`, formData)
+      if (response.data.code == 0) {
+        this.loading = false
+        this.usertable = response.data.data.records
+        this.total = response.data.data.total
+      }else{
+         this.$message.error(response.data.msg)
+      }
+    },
+    // 批量上传模板信息
+    async batchUpload() {
+      const isLt50M = this.file.size / 1024 / 1024 < 500
+      let extName = this.file.name.substring(this.file.name.lastIndexOf(`.`)).toLowerCase()
+      let AllUpExt = `.zip`
+      if (extName != AllUpExt) {
+        this.$message.error(`格式错误!当前只支持zip压缩文件`)
+        return false
+      }
+
+      if (!isLt50M) {
+        this.$message.error(`上传文件大小不能超过500MB!`)
+        return false
+      }
+      const loading = this.$loading({
+        lock: true,
+        text: `系统正在努力接收中,过程大概需要几分钟的时间,请您耐心等待...`,
+        spinner: `el-icon-loading`,
+        background: `rgba(0, 0, 0, 0.7)`
+      })
+      const formData = new FormData()
+      formData.append(`customerName`, this.customerName)
+      formData.append(`file`, this.file)
+      const response = await this.$http.post(`noCar/batchImprotBillWayFile`, formData)
+      var {data: { code, msg, data }} = response
+      if (code == 0 && msg == `success`) {
+        this.loadData()
+        loading.close()
+        this.$message.success(`上传成功`)
+      } else if (code == 1 && msg == null && data == null) {
+        loading.close()
+        this.$message.error(`数据存在错误`)
+      } else {
+        loading.close()
+        this.$message.error(msg)
+      }
+    },
+    // 查看批次数据
+    async checkLook(id) {
+      this.addList = true
+      this.batchNumberQ = id
+      this.loadDataCar()
+    },
+    handleEditDialogClose() {
+      this.addList = false
+    },
+    downloadFile(num){
+      window.location.href = window.hostUrl+'noCar/downloadWayBillFile?wayBillNum='+num
+    },
+    twoLoadData() {
+      this.currenttwo = 1
+      this.pagesizetwo = 8
+      this.loadDataCar()
+    },
+    async exportExcel() {
+      const loading = this.$loading({
+        lock: true,
+        text: `系统正在努力接收中,过程大概需要几分钟的时间,请您耐心等待...`,
+        spinner: `el-icon-loading`,
+        background: `rgba(0, 0, 0, 0.7)`
+      })
+      let curr = this.currenttwo
+      let pagesize1 = this.pagesizetwo
+      this.currenttwo = 1
+      this.pagesizetwo = this.totaltwo
+      await this.loadDataCar()
+      // 设置当前日期
+      let time = new Date()
+      let year = time.getFullYear()
+      let month = time.getMonth() + 1
+      let day = time.getDate()
+      let name = `实时运单上传列表_` + year + `` + month + `` + day
+      /* generate workbook object from table */
+      //  .table要导出的是哪一个表格
+      var wb = XLSX.utils.table_to_book(document.querySelector(`.ttt`), { raw: true })
+      /* get binary string as output */
+      var wbout = XLSX.write(wb, {
+        bookType: `xlsx`,
+        bookSST: true,
+        type: `array`
+      })
+      try {
+        //  name+'.xlsx'表示导出的excel表格名字
+        FileSaver.saveAs(
+          new Blob([wbout], { type: `application/octet-stream` }),
+          name + `.xlsx`
+        )
+      } catch (e) {
+      }
+      this.currenttwo = curr
+      this.pagesizetwo = pagesize1
+      this.loadDataCar()
+      loading.close()
+      return wbout
+    },
+    handleRemove(file, fileList) {
+    },
+
+    handlePreview(file) {
+    },
+    handleSuccess(a) {
+      this.file = a.raw
+    },
+    // 分页方法
+    handleSizeChange(val) {
+      this.pagesize = val
+      this.loadData()
+    },
+    handleCurrentChange(val) {
+      this.current = val
+      this.loadData()
+    }
+  }
+}
+</script>
+
+<style>
+.waybill {
+  border: 1px solid #d9d9d9;
+  border-radius: 10px;
+}
+.waybill .upload-demo {
+  display: inline-block;
+}
+.waybill .title {
+  font-size: 5px;
+  margin-bottom: 20px;
+}
+.waybill .top {
+  padding-top: 20px;
+  padding-left: 20px;
+}
+.waybill .text {
+  display: inline-block;
+  color: #000;
+  font-size: 16px ;
+  margin-left: 1%;
+}
+.waybill .tou {
+  font-size: 20px;
+  height: 30px;
+  line-height: 30px;
+  padding-top: 15px;
+}
+.waybill .line {
+  margin-top: 15px;
+  margin-bottom: 15px;
+  width: 100%;
+  height: 2px;
+  background-color: #d9d9d9;
+}
+.waybill .theinput {
+  display: inline-block;
+  width: 20%;
+}
+.waybill .styleType {
+  margin-top: 20px;
+  margin-bottom: 20px;
+}
+.waybill .input-demo {
+  display: inline-block;
+  width: 20%;
+  margin-left: 1%;
+}
+.waybill .block {
+  font-size: 5px;
+  text-align: center;
+  margin-top: 15px;
+  margin-bottom: 20px;
+}
+.waybill .blocks {
+  font-size: 5px;
+  text-align: center;
+  margin-top: 20px;
+  padding-bottom: 20px;
+}
+.waybill .el-dialog {
+  width: 90%;
+}
+.waybill .el-dialog__header, .el-dialog__body {
+  padding: 0 20px;
+}
+</style>