瀏覽代碼

前端代码合并提交

Administrator 1 年之前
父節點
當前提交
03b93fbd2b
共有 4 個文件被更改,包括 78 次插入4 次删除
  1. 2 0
      src/router/index.js
  2. 5 0
      src/views/Home.vue
  3. 34 2
      src/views/platform/waybill/history.vue
  4. 37 2
      src/views/platform/waybill/waybill.vue

+ 2 - 0
src/router/index.js

@@ -61,6 +61,7 @@ const Carupload = () => { return import(`@/views/platform/car/carupload`) }
 const Carsuccess = () => { return import(`@/views/platform/car/carsuccess`) }
 
 const Waybill = () => { return import(`@/views/platform/waybill/waybill`) }
+const WaybillFile = () => { return import(`@/views/platform/waybill/WaybillFile`) }
 const Over = () => { return import(`@/views/platform/waybill/over`) }
 const History = () => { return import(`@/views/platform/waybill/history`) }
 
@@ -134,6 +135,7 @@ const router = new Router({
         { name: `Carsuccess`, path: `/carsuccess`, component: Carsuccess },
 
         { name: `Waybill`, path: `/waybill`, component: Waybill },
+        { name: `WaybillFile`, path: `/WaybillFile`, component: WaybillFile },
         { name: `Over`, path: `/over`, component: Over },
         { name: `History`, path: `/history`, component: History },
 

+ 5 - 0
src/views/Home.vue

@@ -323,6 +323,11 @@ export default {
               id: 3,
               path: `history`,
               authName: `历史运单发票匹配`
+            },
+            {
+              id: 4,
+              path: `WaybillFile`,
+              authName: `运单文件上传`
             }
           ]
         },

+ 34 - 2
src/views/platform/waybill/history.vue

@@ -15,7 +15,7 @@
                 :on-change="handleSuccess"
                 :auto-upload="false">
                 <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
-                <el-button style="margin-left: 10px;" size="small" type="success" @click="batchUpload" v-loading.fullscreen.lock="fullscreenLoading">开票</el-button>
+                <el-button style="margin-left: 10px;" size="small" type="success" @click="showConfirm">开票</el-button>
               </el-upload>
             </div>
           </el-col>
@@ -103,7 +103,26 @@
         :total="total">
         </el-pagination>
       </div>
-
+       <el-dialog
+        title="  ."
+        :visible.sync="dialogVisible"
+        width="30%"
+       >
+       <el-form
+          label-position="right"
+          label-width="150px"
+         >
+         <el-form-item label="运单文件批次号" prop="fileBatchNum">
+            <el-input  placeholder="运单文件批次号" v-model="fileBatchNum"></el-input>
+          </el-form-item>
+          
+       </el-form>
+        
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="dialogVisible = false">取 消</el-button>
+          <el-button type="primary" @click="batchUpload" v-loading.fullscreen.lock="fullscreenLoading">确 定</el-button>
+        </span>
+      </el-dialog>
     <!-- 查看 -->
       <el-dialog
         @close="handleEditDialogClose"
@@ -235,6 +254,8 @@ export default{
     return {
       loading: false,
       fullscreenLoading: false,
+      dialogVisible: false,
+      fileBatchNum: '',
       userName: ``,
       customerName: ``,
       companyName: ``,
@@ -297,6 +318,11 @@ export default{
         this.total = response.data.data.total
       }
     },
+    showConfirm(){
+      debugger
+      this.dialogVisible = true
+      this.fileBatchNum = ''
+    },
     // 下载模板
     DownloadTemplate() {
       // var url = 'http://invoice.back.jkcredit.com/carFreeCarrierBill/downTemp';
@@ -305,6 +331,10 @@ export default{
     },
     // 批量上传模板信息
     async batchUpload() {
+      if(this.fileBatchNum == '' || this.fileBatchNum == null){
+        this.$message.error(`请输入本次运单所对应的批次号`);
+        return
+      }
       const isLt50M = this.formUserList.file.size / 1024 / 1024 < 50
       let extName = this.formUserList.file.name.substring(this.formUserList.file.name.lastIndexOf(`.`)).toLowerCase()
       let AllUpExt = `.xlsx`
@@ -317,6 +347,7 @@ export default{
         this.$message.error(`上传文件大小不能超过50MB!`)
         return false
       }
+       this.dialogVisible = false
       const loading = this.$loading({
         lock: true,
         text: `系统正在努力接收中,过程大概需要几分钟的时间,请您耐心等待...`,
@@ -326,6 +357,7 @@ export default{
       const formData = new FormData()
       formData.append(`customerName`, this.formUserList.customerName)
       formData.append(`file`, this.formUserList.file)
+      formData.append(`batchNum`, this.fileBatchNum)
       const response = await this.$http.post(`noCar/batchImprotHistoryBillWay`, formData)
       var {data: { code, msg, data }} = response
       if (code == 0 && msg == `success`) {

+ 37 - 2
src/views/platform/waybill/waybill.vue

@@ -15,7 +15,7 @@
                 :on-change="handleSuccess"
                 :auto-upload="false">
                 <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
-                <el-button style="margin-left: 10px;" size="small" type="success" @click="batchUpload" v-loading.fullscreen.lock="fullscreenLoading">提交</el-button>
+                <el-button style="margin-left: 10px;" size="small" type="success" @click="showConfirm">提交</el-button>
               </el-upload>
 
             </div>
@@ -106,7 +106,26 @@
         :total="total">
         </el-pagination>
       </div>
-
+      <el-dialog
+        title="  ."
+        :visible.sync="dialogVisible"
+        width="30%"
+       >
+       <el-form
+          label-position="right"
+          label-width="150px"
+         >
+         <el-form-item label="运单文件批次号" prop="fileBatchNum">
+            <el-input  placeholder="运单文件批次号" v-model="fileBatchNum"></el-input>
+          </el-form-item>
+          
+       </el-form>
+        
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="dialogVisible = false">取 消</el-button>
+          <el-button type="primary" @click="batchUpload" v-loading.fullscreen.lock="fullscreenLoading">确 定</el-button>
+        </span>
+      </el-dialog>
     <!-- 查看 -->
       <el-dialog
         @close="handleEditDialogClose"
@@ -235,6 +254,8 @@ export default{
   data() {
     return {
       loading: false,
+      dialogVisible: false,
+      fileBatchNum: '',
       fullscreenLoading: false,
       customerName: ``,
       companyName: ``,
@@ -302,9 +323,21 @@ export default{
       var url = hostUrl + `noCar/templateDownload?fileName=1`// eslint-disable-line
       window.location.href = url
     },
+    showConfirm(){
+      this.dialogVisible = true;
+      this.fileBatchNum = '';
+    },
     // 批量上传模板信息
     async batchUpload() {
+      if(this.fileBatchNum == '' || this.fileBatchNum == null){
+        this.$message.error(`请输入本次运单所对应的批次号`);
+        return
+      }
       const isLt50M = this.formUserList.file.size / 1024 / 1024 < 50
+      if(this.formUserList.file == ''){
+        this.$message.error(`未上传文件`)
+        this.dialogVisible = false
+      }
       let extName = this.formUserList.file.name.substring(this.formUserList.file.name.lastIndexOf(`.`)).toLowerCase()
       let AllUpExt = `.xlsx`
       if (extName != AllUpExt) {
@@ -316,6 +349,7 @@ export default{
         this.$message.error(`上传文件大小不能超过50MB!`)
         return false
       }
+      this.dialogVisible = false
       const loading = this.$loading({
         lock: true,
         text: `系统正在努力接收中,过程大概需要几分钟的时间,请您耐心等待...`,
@@ -325,6 +359,7 @@ export default{
       const formData = new FormData()
       formData.append(`customerName`, this.formUserList.customerName)
       formData.append(`file`, this.formUserList.file)
+      formData.append(`batchNum`, this.fileBatchNum)
       const response = await this.$http.post(`noCar/batchImprotBillWay`, formData)
       var {data: { code, msg, data }} = response
       if (code == 0 && msg == `success`) {