소스 검색

前端代码合并提交

Administrator 10 달 전
부모
커밋
24c13e2da0

+ 129 - 3
src/views/customer/Customer.vue

@@ -246,9 +246,20 @@
             </template>
           </el-table-column>
            <el-table-column
+            prop="promiseFileStatus"
+            label="承诺协议上传状态"
+            width="140"
+            show-overflow-tooltip>
+             <template slot-scope="scope">
+              <span v-if="scope.row.promiseFileStatus == 1" style="color: red">承诺协议未上传</span>
+              <span v-else-if="scope.row.promiseFileStatus == 2" style="color: red">承诺协议上传失败</span>
+               <span v-if="scope.row.promiseFileStatus == 3" style="color: green">承诺协议协议上传成功</span>
+            </template>
+          </el-table-column>
+           <el-table-column
             prop="contractStatus"
             label="协议查询接口状态"
-            width="120"
+            width="140"
             show-overflow-tooltip>
              <template slot-scope="scope">
               <span v-if="scope.row.contractStatus == 1" style="color: red">协议上传失败</span>
@@ -282,6 +293,7 @@
             <template slot-scope="scope" show-overflow-tooltip>
                <el-link style="margin-left: 10px; cursor:pointer; color: blue;" @click="recInfo(scope.row)">备案信息</el-link>
                <el-link style="margin-left: 10px; cursor:pointer; color: blue;" @click="concatInfo(scope.row)">协议信息</el-link>
+               <el-link style="margin-left: 10px; cursor:pointer; color: blue;" @click="promiseInfo(scope.row)">承诺协议</el-link>
                <el-link v-if="scope.row.recStatus == 1" style="margin-left: 10px; cursor:pointer; color: blue;" @click="stopUse(scope.row)">停用</el-link>
                <el-link v-if="scope.row.recStatus == 4" style="margin-left: 10px; cursor:pointer; color: blue;" @click="startUse(scope.row)">启用</el-link>
 
@@ -357,6 +369,43 @@
           <el-button @click="contractAdd" type="primary">协议上传</el-button>
         </div>
       </el-dialog>
+       <el-dialog
+        @close="custRecClose"
+        :visible.sync="promiseVis"
+        style="font-size: 0px;">
+        <div class="tou">客户-承诺信息</div>
+        <div class="line"></div>
+        <el-form
+          label-position="right"
+          label-width="80px"
+          :model="formUserList">
+
+            <el-row :span="24">
+              <el-col :span="12" v-show= false>
+                <el-form-item  label-width=120px label="承诺文件名">
+                <el-input v-model="customerRec.promiseFileName" auto-complete="off" :disabled=disable ></el-input>
+              </el-form-item>
+              </el-col>
+              <el-col :span="12" v-show= true>
+                <el-form-item  label-width=120px label="承诺文件" prop="promiseFileName">
+                <el-upload
+                    class="avatar-uploader"
+                    style="width: 100%"
+                    action="#"
+                    :show-file-list="false"
+                    :http-request="httpRequestPre">
+                      <el-input label-width=120px v-model="customerRec.promiseFileName" auto-complete="off"  style="width: 100%"></el-input>
+                      <!-- <el-button type="primary" @click="getFile(index)">选取文件</el-button> -->
+                  </el-upload>
+                  <el-input label-width=120px v-model="customerRec.promiseBase64Str" v-show="false" auto-complete="off"></el-input>
+              </el-form-item>
+              </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="promiseAdd" type="primary">承诺协议上传</el-button>
+        </div>
+      </el-dialog>
       <el-dialog
         @close="custRecClose"
         :visible.sync="recVis"
@@ -393,6 +442,13 @@
           </el-row>
           <el-row :span="24">
               <el-col :span="12">
+                <el-form-item  label-width=120px label="公司邮箱">
+                <el-input v-model="customerRec.invoiceMail" auto-complete="off" :disabled=disable ></el-input>
+              </el-form-item>
+              </el-col>
+          </el-row>
+          <el-row :span="24">
+              <el-col :span="12">
                 <el-form-item  label-width=120px label="公司税号">
                 <el-input v-model="customerRec.companyReferencenum" auto-complete="off" :disabled=disable ></el-input>
               </el-form-item>
@@ -508,6 +564,13 @@
                 </el-form-item>
               </el-col>
           </el-row>
+                    <el-row :span="24">
+              <el-col :span="12">
+                <el-form-item  label-width=120px label="公司邮箱">
+                <el-input v-model="customerRec.invoiceMail" auto-complete="off" :disabled=disable ></el-input>
+              </el-form-item>
+              </el-col>
+          </el-row>
           <el-row :span="24">
               <el-col :span="12">
                 <el-form-item  label-width=120px label="公司税号" prop="companyReferencenum">
@@ -792,6 +855,7 @@ import XLSX from 'xlsx';
             changeStatus: false,
             recVis: false,
             concatVis: false,
+            promiseVis: false,
             accIsclose: false,
             carRecclose: false,
             recVisList: false,
@@ -850,8 +914,43 @@ import XLSX from 'xlsx';
                  this.customerRec.base64Str = resBase64.split(',')[1];
                 })
                 this.$message.success('文件上传成功');
-          }
-      },
+             }
+          },
+           getBase64Pre(file) {
+                this.customerRec.promiseFileName = file.name;
+                this.$forceUpdate()
+                return new Promise((resolve, reject) => {
+                  let reader = new FileReader();
+                  let fileResult = '';
+                  reader.readAsDataURL(file);
+                  reader.onload = function() {
+                    fileResult = reader.result;
+                  };
+                  reader.onerror = function(error) {
+                    reject(error);
+                  };
+                  reader.onloadend = function() {
+                    resolve(fileResult);
+                  };
+                });
+          },
+          httpRequestPre(data) {
+              const isPFX = data.file.type == 'application/pdf';
+              const isLt2M = data.file.size / 1024 / 1024 < 10;
+
+              if (!isPFX) {
+                this.$message.error('上传文件只能是pdf格式!');
+              }else if (!isLt2M) {
+                this.$message.error('上传文件大小不能超过 10MB!');
+              } else {
+                // 转base64
+                this.getBase64Pre(data.file).then((resBase64) => {
+                this.fileBase64 = resBase64.split(',')[1]//直接拿到base64信息
+                 this.customerRec.promiseBase64Str = resBase64.split(',')[1];
+                })
+                this.$message.success('文件上传成功');
+             }
+          },
           addCustomer(formName){
                 this.$refs[formName].validate(async (valid) => {
                 if(valid) {
@@ -936,6 +1035,15 @@ import XLSX from 'xlsx';
               this.disable = !((this.customerRec.interType == 1) && (this.customerRec.recStatus == 2));
             }
           },
+          async promiseInfo(recoder){
+              //this.recVis = true;
+              this.promiseVis = true;
+            const response = await this.$http.post(`lowerService/customeRecQuery`, {'customerName': recoder.customerName, 'companyName': recoder.companyName});
+            if (response.data.code == 0) {
+              this.customerRec = response.data.data;
+              this.disable = !((this.customerRec.interType == 1) && (this.customerRec.recStatus == 2));
+            }
+          },
           stopUse(recoder){
                   this.$confirm('此操作将备案状态改为停用状态, 是否继续?', '提示', {
                         confirmButtonText: '确定',
@@ -1016,6 +1124,7 @@ import XLSX from 'xlsx';
           custRecClose() {
             this.recVis = false;
             this.concatVis = false;
+            this.promiseVis = false;
             this.addCustomerRecShow1 =false;
             this.customerRec = {};
           },
@@ -1113,6 +1222,23 @@ import XLSX from 'xlsx';
                     });
                   }
           },
+           async promiseAdd(){
+             const response = await this.$http.post(`customer/promiseAdd`, this.customerRec);
+                  if(response.data.code == 0) {
+                    this.loadData();
+                    this.recInfoList(this.customerRec)
+                    this.changeStatus = false;
+                    this.$message({
+                      type: 'success',
+                      message: '承诺协议上传成功'
+                    });
+                  }else {
+                    this.$message({
+                      type: 'error',
+                      message: '承诺协议上传失败:'+response.data.msg
+                    });
+                  }
+          },
             async contractStatusFail() {
              const response = await this.$http.post(`customer/contractStatusFail`, this.customerRec);
                   if(response.data.code == 0) {

+ 3 - 3
src/views/noCar/billway.vue

@@ -137,7 +137,7 @@
             label="运单状态"
             show-overflow-tooltip>
             <template slot-scope="scope">
-
+              <span v-if="scope.row.billwayStatus == 0" style="color: red">原始运单未上传</span>
                <span v-if="scope.row.billwayStatus == 1" style="color: green">未结束</span>
                 <span v-else-if="scope.row.billwayStatus == -2" style="color: red">上传失败</span>
                  <span v-else-if="scope.row.billwayStatus == -3" style="color: red">结束指令上传失败</span>
@@ -151,8 +151,8 @@
             show-overflow-tooltip>
             <template slot-scope="scope">
 
-               <span v-if="scope.row.billwayStatus == -2 || scope.row.billwayStatus == -3" style="color: red">失败</span>
-                <span v-else-if="scope.row.billwayStatus != -2 && scope.row.billwayStatus != -3" style="color: green">成功</span>
+               <span v-if="scope.row.billwayStatus == -2 || scope.row.billwayStatus == -3 || scope.row.billwayStatus == 0" style="color: red">失败</span>
+                <span v-else-if="scope.row.billwayStatus != -2 && scope.row.billwayStatus != -3 && scope.row.billwayStatus != 0" style="color: green">成功</span>
 
               </template>
           </el-table-column>

+ 1 - 0
src/views/noCar/billwayException.vue

@@ -125,6 +125,7 @@
             label="运单状态"
             show-overflow-tooltip>
              <template slot-scope="scope">
+               <span v-if="scope.row.billwayStatus == 0" style="color: red">原始运单未上传</span>
                <span v-if="scope.row.billwayStatus == 1" style="color: green">未结束</span>
                 <span v-else-if="scope.row.billwayStatus == -2" style="color: red">上传失败</span>
                  <span v-else-if="scope.row.billwayStatus == -3" style="color: red">结束指令上传失败</span>

+ 80 - 9
src/views/platform/apply/apply.vue

@@ -4,6 +4,14 @@
       <div class="title">
         <el-row>
           <el-col :span="24">
+            <div class="demo-input-suffix" style="margin-left: 38px;">
+                  <el-upload  :action="url" :http-request="importExcel" list-type="text" :show-file-list="false" >
+                            <el-button  type="primary">导入参数</el-button>
+
+                <el-button style="margin-left: 10px;" @click="DownloadTemplate">查询模板下载</el-button>
+                </el-upload>
+
+              </div>
             <div class="top" style="margin-left:15px">
               <el-select v-model="companyName" filterable  placeholder="请选择公司名称">
                 <el-option
@@ -14,14 +22,7 @@
                 </el-option>
               </el-select>
               <el-input  placeholder="请输入车牌号码" class="input-demo" v-model="carNum"></el-input>
-
-              <el-button type="success" style="margin-left: 1%;" @click="queryLook">查询</el-button>
-              <el-button type="success" style="margin-left: 1%;" @click="applyForTicket">全部开票</el-button>
-            </div>
-          </el-col>
-          <el-col :span="24">
-            <div class="top" >
-              <el-date-picker
+               <el-date-picker
                 v-model="startTime"
                 type="datetime"
                 placeholder="选择开始日期时间"
@@ -34,6 +35,8 @@
                 placeholder="选择结束日期时间"
                 style="margin-left: 1%;">
                </el-date-picker>
+              <el-button type="success" style="margin-left: 1%;" @click="queryLook">查询</el-button>
+              <el-button type="success" style="margin-left: 1%;" @click="applyForTicket">全部开票</el-button>
             </div>
           </el-col>
         </el-row>
@@ -81,6 +84,7 @@
 </template>
 
 <script>
+import XLSX from 'xlsx'
 export default{
   data() {
     return {
@@ -139,6 +143,73 @@ export default{
       dd.setDate(value.getDate() + 90)
       this.endTime = dd
     },
+    importExcel(content) {
+      const file = content.file
+      // let file = file.files[0] // 使用传统的input方法需要加上这一步
+      const filename = file.name
+      if (!filename || typeof filename != `string`) {
+        this.$message(`格式错误!请重新选择`)
+        return
+      }
+      let a = filename.split(``).reverse().join(``)
+      let types = a.substring(0, a.search(/\./)).split(``).reverse().join(``)
+
+      const fileType = [`xlsx`].some((item) => { return item === types })
+      if (!fileType) {
+        this.$message(fileType + `格式错误!请重新选择xlsx格式`)
+        return
+      }
+      this.file2Xce(file).then((tabJson) => {
+        var carNums = ``
+        if (tabJson && tabJson.length > 0) {
+          this.xlsxJson = tabJson
+          this.fileList = this.xlsxJson[0].sheet
+          let n = `匹配的字段`
+          var i = 0
+          var j = 0
+          this.fileList.forEach((item, index, arr) => {
+            if (item[`车牌号`] != null && item[`车牌号`] != `` && typeof item[`车牌号`] != `undefined`) {
+              carNums += item[`车牌号`].trim() + `,`
+              i++
+            } else {
+              carNums += `#,`
+            }
+          })
+        }
+        if (carNums != `` && i > 0) {
+          this.carNum = carNums.substring(0, carNums.length - 1)
+        }
+      })
+    },
+        // 下载模板
+    DownloadTemplate() {
+      var url = hostUrl + `noCar/templateDownload?fileName=10` // eslint-disable-line
+      window.location.href = url
+    },
+     file2Xce(file) {
+      return new Promise(function(resolve, reject) {
+        const reader = new FileReader()
+        reader.onload = function(e) {
+          const data = e.target.result
+          this.wb = XLSX.read(data, {
+            type: `binary`
+          })
+          const result = []
+          var are = (this.wb.Sheets.Sheet1)[`!ref`]
+          var areRe = are.replace(`A1`, `A2`);
+          (this.wb.Sheets.Sheet1)[`!ref`] = areRe
+          this.wb.SheetNames.forEach((sheetName) => {
+            result.push({
+              sheetName: sheetName,
+              sheet: XLSX.utils.sheet_to_json(this.wb.Sheets[sheetName])
+            })
+          })
+          resolve(result)
+        }
+        // reader.readAsBinaryString(file.raw)
+        reader.readAsBinaryString(file) // 传统input方法
+      })
+    },
     // 申请开票
     async applyForTicket() {
       if (this.multipleSelection.length > 0) {
@@ -193,7 +264,7 @@ export default{
 }
 .apply .input-demo {
   display: inline-block;
-  width: 20%;
+  width: 12%;
   margin-left: 1%;
 }
 

+ 79 - 1
src/views/platform/carbinding/carbindinglist.vue

@@ -4,7 +4,16 @@
       <div class="title">
         <el-row>
           <el-col :span="24">
+             <div class="demo-input-suffix" style="margin-left: 20px;">
+                  <el-upload  :action="url" :http-request="importExcel" list-type="text" :show-file-list="false" >
+                            <el-button  type="primary">导入参数</el-button>
+
+                <el-button style="margin-left: 10px;" @click="DownloadTemplate">查询模板下载</el-button>
+                </el-upload>
+
+              </div>
             <div class="top">
+              
               <el-select v-model="formList.companyName" filterable  placeholder="请输入公司名称">
                 <el-option
                   v-for="item in companyList"
@@ -14,7 +23,8 @@
                 </el-option>
               </el-select>
               <el-input  placeholder="请输入车牌号码" class="input-demo" v-model="carNum"></el-input>
-              <el-button type="success" style="margin-left: 1%;" @click="firstLoadData">查询</el-button>
+               
+              <el-button type="success" style="margin-left: 1%;" @click="firstLoadData">查询</el-button>     
             </div>
           </el-col>
         </el-row>
@@ -76,6 +86,7 @@
 </template>
 
 <script>
+import XLSX from 'xlsx'
 export default{
   data() {
     return {
@@ -146,6 +157,73 @@ export default{
       }
       this.formList.companyName = this.companyList[0][`companyName`]
     },
+    importExcel(content) {
+      const file = content.file
+      // let file = file.files[0] // 使用传统的input方法需要加上这一步
+      const filename = file.name
+      if (!filename || typeof filename != `string`) {
+        this.$message(`格式错误!请重新选择`)
+        return
+      }
+      let a = filename.split(``).reverse().join(``)
+      let types = a.substring(0, a.search(/\./)).split(``).reverse().join(``)
+
+      const fileType = [`xlsx`].some((item) => { return item === types })
+      if (!fileType) {
+        this.$message(fileType + `格式错误!请重新选择xlsx格式`)
+        return
+      }
+      this.file2Xce(file).then((tabJson) => {
+        var carNums = ``
+        if (tabJson && tabJson.length > 0) {
+          this.xlsxJson = tabJson
+          this.fileList = this.xlsxJson[0].sheet
+          let n = `匹配的字段`
+          var i = 0
+          var j = 0
+          this.fileList.forEach((item, index, arr) => {
+            if (item[`车牌号`] != null && item[`车牌号`] != `` && typeof item[`车牌号`] != `undefined`) {
+              carNums += item[`车牌号`].trim() + `,`
+              i++
+            } else {
+              carNums += `#,`
+            }
+          })
+        }
+        if (carNums != `` && i > 0) {
+          this.carNum = carNums.substring(0, carNums.length - 1)
+        }
+      })
+    },
+        // 下载模板
+    DownloadTemplate() {
+      var url = hostUrl + `noCar/templateDownload?fileName=9` // eslint-disable-line
+      window.location.href = url
+    },
+    file2Xce(file) {
+      return new Promise(function(resolve, reject) {
+        const reader = new FileReader()
+        reader.onload = function(e) {
+          const data = e.target.result
+          this.wb = XLSX.read(data, {
+            type: `binary`
+          })
+          const result = []
+          var are = (this.wb.Sheets.Sheet1)[`!ref`]
+          var areRe = are.replace(`A1`, `A2`);
+          (this.wb.Sheets.Sheet1)[`!ref`] = areRe
+          this.wb.SheetNames.forEach((sheetName) => {
+            result.push({
+              sheetName: sheetName,
+              sheet: XLSX.utils.sheet_to_json(this.wb.Sheets[sheetName])
+            })
+          })
+          resolve(result)
+        }
+        // reader.readAsBinaryString(file.raw)
+        reader.readAsBinaryString(file) // 传统input方法
+      })
+    },
     // 分页方法
     handleSizeChange(val) {
       this.pagesize = val

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

@@ -216,8 +216,8 @@
             show-overflow-tooltip>
             <template slot-scope="scope">
 
-               <span v-if="scope.row.billwayStatus == -2 || scope.row.billwayStatus == -3" style="color: red">失败</span>
-                <span v-else-if="scope.row.billwayStatus != -2 && scope.row.billwayStatus != -3" style="color: green">成功</span>
+               <span v-if="scope.row.billwayStatus == -2 || scope.row.billwayStatus == -3 || scope.row.billwayStatus == 0" style="color: red">失败</span>
+                <span v-else-if="scope.row.billwayStatus != -2 && scope.row.billwayStatus != -3 && scope.row.billwayStatus != 0" style="color: green">成功</span>
 
               </template>
           </el-table-column>

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

@@ -146,8 +146,8 @@
             show-overflow-tooltip>
             <template slot-scope="scope">
 
-               <span v-if="scope.row.billwayStatus == -2 || scope.row.billwayStatus == -3" style="color: red">失败</span>
-                <span v-else-if="scope.row.billwayStatus != -2 && scope.row.billwayStatus != -3" style="color: green">成功</span>
+               <span v-if="scope.row.billwayStatus == -2 || scope.row.billwayStatus == -3 || scope.row.billwayStatus == 0" style="color: red">失败</span>
+                <span v-else-if="scope.row.billwayStatus != -2 && scope.row.billwayStatus != -3 && scope.row.billwayStatus != 0" style="color: green">成功</span>
 
               </template>
           </el-table-column>

+ 4 - 4
src/views/platform/waybill/waybill.vue

@@ -118,9 +118,9 @@
          <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>
@@ -218,8 +218,8 @@
             show-overflow-tooltip>
             <template slot-scope="scope">
 
-               <span v-if="scope.row.billwayStatus == -2 || scope.row.billwayStatus == -3" style="color: red">失败</span>
-                <span v-else-if="scope.row.billwayStatus != -2 && scope.row.billwayStatus != -3" style="color: green">成功</span>
+               <span v-if="scope.row.billwayStatus == -2 || scope.row.billwayStatus == -3 || scope.row.billwayStatus == 0" style="color: red">失败</span>
+                <span v-else-if="scope.row.billwayStatus != -2 && scope.row.billwayStatus != -3 && scope.row.billwayStatus != 0" style="color: green">成功</span>
 
               </template>
           </el-table-column>

+ 3 - 3
src/views/platform/waybillmanagement/waybillList.vue

@@ -140,7 +140,7 @@
             label="运单状态"
             show-overflow-tooltip>
             <template slot-scope="scope">
-
+              <span v-if="scope.row.billwayStatus == 0" style="color: red">原始运单未上传</span>
                <span v-if="scope.row.billwayStatus == 1" style="color: green">未结束</span>
                 <span v-else-if="scope.row.billwayStatus == -2" style="color: red">失败</span>
                  <span v-else-if="scope.row.billwayStatus == -3" style="color: red">指令上传失败</span>
@@ -154,8 +154,8 @@
             show-overflow-tooltip>
             <template slot-scope="scope">
 
-               <span v-if="scope.row.billwayStatus == -2 || scope.row.billwayStatus == -3" style="color: red">失败</span>
-                <span v-else-if="scope.row.billwayStatus != -2 && scope.row.billwayStatus != -3" style="color: green">成功</span>
+               <span v-if="scope.row.billwayStatus == -2 || scope.row.billwayStatus == -3 || scope.row.billwayStatus == 0" style="color: red">失败</span>
+                <span v-else-if="scope.row.billwayStatus != -2 && scope.row.billwayStatus != -3 && scope.row.billwayStatus != 0" style="color: green">成功</span>
 
               </template>
           </el-table-column>