Jelajahi Sumber

往来账款附件删除优化、图片加密

dudm 3 tahun lalu
induk
melakukan
5a6f16d5d0

+ 3 - 3
front-vue/src/api/common/company.js

@@ -6,7 +6,7 @@ export function listCompany(scyType,scyId) {
     scyId = null
   }
   return request({
-    url: '/sc-service-du/company/list/' + scyType +  '/' + scyId,
+    url: '/sc-service/company/list/' + scyType +  '/' + scyId,
     method: 'get',
   })
 }
@@ -14,7 +14,7 @@ export function listCompany(scyType,scyId) {
 // 获取自己企业
 export function getOwnCompany() {
   return request({
-    url: '/sc-service-du/company/getOwnCompany',
+    url: '/sc-service/company/getOwnCompany',
     method: 'get',
   })
 }
@@ -22,7 +22,7 @@ export function getOwnCompany() {
 // 根据链属企业
 export function companyRelList(query) {
   return request({
-    url: '/sc-service-du/company/companyRelList',
+    url: '/sc-service/company/companyRelList',
     method: 'get',
     params: query
   })

+ 12 - 12
front-vue/src/api/service/bill/bill.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 查询往来账款列表
 export function listBill(query) {
   return request({
-    url: '/sc-service-du/ownBill/billList',
+    url: '/sc-service/ownBill/billList',
     method: 'get',
     params: query
   })
@@ -12,7 +12,7 @@ export function listBill(query) {
 // 获取往来账款明细
 export function getBill(zbiId) {
   return request({
-    url: '/sc-service-du/ownBill/'+ zbiId,
+    url: '/sc-service/ownBill/'+ zbiId,
     method: 'get',
   })
 }
@@ -20,7 +20,7 @@ export function getBill(zbiId) {
 // 获取往来账款发票
 export function getInvoice(zbiId) {
   return request({
-    url: '/sc-service-du/ownBill/getInvoice/'+ zbiId,
+    url: '/sc-service/ownBill/getInvoice/'+ zbiId,
     method: 'get',
   })
 }
@@ -28,7 +28,7 @@ export function getInvoice(zbiId) {
 // 初始化往来账款信息
 export function addBill(data) {
   return request({
-    url: '/sc-service-du/ownBill/add',
+    url: '/sc-service/ownBill/add',
     method: 'post',
     data: data
   })
@@ -37,7 +37,7 @@ export function addBill(data) {
 // 发票识别
 export function getInvoiceText(data) {
   return request({
-    url: '/sc-service-du/ownBill/getInvoiceText',
+    url: '/sc-service/ownBill/getInvoiceText',
     method: 'post',
     data: data
   })
@@ -46,7 +46,7 @@ export function getInvoiceText(data) {
 // 发票验真
 export function invoiceVerification(data) {
   return request({
-    url: '/sc-service-du/ownBill/invoiceVerification',
+    url: '/sc-service/ownBill/invoiceVerification',
     method: 'post',
     data: data
   })
@@ -55,7 +55,7 @@ export function invoiceVerification(data) {
 // 删除发票
 export function delInvoice(ziiIds) {
   return request({
-    url: '/sc-service-du/ownBill/' + ziiIds,
+    url: '/sc-service/ownBill/' + ziiIds,
     method: 'delete'
   })
 }
@@ -63,7 +63,7 @@ export function delInvoice(ziiIds) {
 // 上传账款附件
 export function uploadBillFile(data) {
   return request({
-    url: '/sc-service-du/ownBill/uploadBillFile',
+    url: '/sc-service/ownBill/uploadBillFile',
     method: 'post',
     data: data
   })
@@ -72,7 +72,7 @@ export function uploadBillFile(data) {
 // 获取往来账款附件
 export function getFile(type, zbiId) {
   return request({
-    url: '/sc-service-du/ownBill/getFile/'+ type + '/' + zbiId,
+    url: '/sc-service/ownBill/getFile/'+ type + '/' + zbiId,
     method: 'get',
   })
 }
@@ -80,7 +80,7 @@ export function getFile(type, zbiId) {
 // 删除发票
 export function delFile(ids) {
   return request({
-    url: '/sc-service-du/ownBill/delFile/' + ids,
+    url: '/sc-service/ownBill/delFile/' + ids,
     method: 'delete'
   })
 }
@@ -88,7 +88,7 @@ export function delFile(ids) {
 // 提交往来账款信息
 export function commitBill(zbiId) {
   return request({
-    url: '/sc-service-du/ownBill/commitBill/' + zbiId,
+    url: '/sc-service/ownBill/commitBill/' + zbiId,
     method: 'post'
   })
 }
@@ -96,7 +96,7 @@ export function commitBill(zbiId) {
 // 删除往来账款
 export function deleteBill(zbiIds) {
   return request({
-    url: '/sc-service-du/ownBill/deleteBill/' + zbiIds,
+    url: '/sc-service/ownBill/deleteBill/' + zbiIds,
     method: 'delete'
   })
 }

+ 25 - 0
front-vue/src/router/index.js

@@ -275,6 +275,31 @@ export const constantRoutes = [
       },
     ]
   },
+  {
+    path: '/bill',
+    component: Layout,
+    hidden: true,
+    children: [
+      {
+        path: 'billAdd',
+        component: (resolve) => require(['@/views/service/bill/billAdd'], resolve),
+        name: 'billAdd',
+        meta: { title: '往来账款新增' }
+      },
+      {
+        path: 'billEdit/:zbiId',
+        component: (resolve) => require(['@/views/service/bill/billEdit'], resolve),
+        name: 'billEdit',
+        meta: { title: '往来账款编辑' }
+      },
+      {
+        path: 'billDetail/:zbiId',
+        component: (resolve) => require(['@/views/service/bill/billDetail'], resolve),
+        name: 'billDetail',
+        meta: { title: '往来账款详情' }
+      }
+    ]
+  },
   /* {
     path: '/company',
     component: Layout,

+ 1 - 1
front-vue/src/views/service/bill/bill.vue

@@ -102,7 +102,7 @@
     </el-row>
 
     <el-table stripe 
-      v-loading.fullscreen.lock="loading" :data="billList"  @selection-change="handleSelectionChange"  row-key="categoryId" 
+      v-loading.fullscreen.lock="loading" :data="billList" row-key="categoryId" 
               default-expand-all  :tree-props="{children: 'children', hasChildren: 'hasChildren'}" border >
        <el-table-column label="序号" type="index" width="50" align="center">
         <template slot-scope="scope">

+ 51 - 25
front-vue/src/views/service/bill/billAdd.vue

@@ -4,7 +4,8 @@
       <!-- <el-header>
         <label>新建账款</label>
       </el-header> -->
-      <el-container>
+      <el-container
+      v-loading.fullscreen.lock="fullscreenLoading">
         <el-aside
           style="
             background-color: white;
@@ -188,7 +189,7 @@
             <el-table
               stripe
               :data="fileList"
-              @selection-change="handleSelectionChange"
+              @selection-change="handleInvoiceSelectionChange"
               row-key="categoryId"
               default-expand-all
               :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
@@ -270,7 +271,8 @@
                 :file-list="fileList"
                 :auto-upload="false"
                 :http-request="httpRequest"
-                :before-remove="invoiceRemove"
+                :before-remove="beforeRemove"
+                :on-remove="invoiceRemove"
                 action=""
                 multiple
               >
@@ -442,7 +444,8 @@
               ref="contractUpload"
               list-type="picture-card"
               :on-preview="invoicePictureCardPreview"
-              :before-remove="handleRemove">
+              :before-remove="beforeRemove"
+              :on-remove="handleRemove">
               <i class="el-icon-plus"></i>
             </el-upload>
           </div>
@@ -464,7 +467,8 @@
               ref="logisticsUpload"
               list-type="picture-card"
               :on-preview="invoicePictureCardPreview"
-              :before-remove="handleRemove">
+              :before-remove="beforeRemove"
+              :on-remove="handleRemove">
               <i class="el-icon-plus"></i>
             </el-upload>
           </div>
@@ -486,7 +490,8 @@
               ref="otherUpload"
               list-type="picture-card"
               :on-preview="invoicePictureCardPreview"
-              :before-remove="handleRemove">
+              :before-remove="beforeRemove"
+              :on-remove="handleRemove">
               <i class="el-icon-plus"></i>
             </el-upload>
           </div>
@@ -504,7 +509,6 @@
         >上一步</el-button
       >
       <el-button type="primary" @click="next()" v-if="active != 4"
-      v-loading.fullscreen.lock="fullscreenLoading"
         >下一步</el-button
       >
       <el-button type="primary" @click="submit()" v-if="active == 4"
@@ -525,6 +529,7 @@ import {
 companyRelList
 } from "@/api/common/company";
 import { amtformat } from "@/utils/amtCommon"
+import { getToken } from "@/utils/auth";
 
 export default {
   name: "BillAdd",
@@ -685,8 +690,8 @@ export default {
         checkedCount > 0 && checkedCount < this.fileList.length;
     },
     // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.dciCatalogId);
+    handleInvoiceSelectionChange(selection) {
+      this.ids = selection.map((item) => item.ziiId);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
@@ -751,6 +756,7 @@ export default {
       fd.append("zbiId", this.form.zbiId); //文件类型
       console.log(fd.get("file"));
       getInvoiceText(fd).then((response) => {
+        response.url = response.url + "/" + getToken()
         this.fileList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
@@ -779,6 +785,7 @@ export default {
       fd.append("zbiId", this.form.zbiId); //文件类型
       fd.append("type", "0"); //文件类型
       uploadBillFile(fd).then((response) => {
+        response.url = response.url + "/" + getToken()
         this.contractList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
@@ -795,6 +802,7 @@ export default {
       fd.append("zbiId", this.form.zbiId); //文件类型
       fd.append("type", "1"); //文件类型
       uploadBillFile(fd).then((response) => {
+        response.url = response.url + "/" + getToken()
         this.logisticsList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
@@ -811,12 +819,22 @@ export default {
       fd.append("zbiId", this.form.zbiId); //文件类型
       fd.append("type", "2"); //文件类型
       uploadBillFile(fd).then((response) => {
+        response.url = response.url + "/" + getToken()
         this.otherList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
         this.fullscreenLoading = false
       });
     },
+    //删除图片
+    beforeRemove(file, fileList) {
+      console.log(file)
+      let a = true;
+      if (file && file.status==="success") {
+        a = this.$confirm(`确定移除 ${ file.name }?`);
+      }
+      return a;
+    },
     //删除合同附件
     handleRemove(file, fileList) {
       console.log(fileList);
@@ -856,21 +874,11 @@ export default {
     //删除附件
     delFile(row){
       var self = this
-      console.log(this.ids)
       const ids = row.id || this.ids;
-      this.$confirm("是否确认删除此数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
+      self.fullscreenLoading = true;
+      delFile(ids).then(function() {
+        self.fullscreenLoading = false;
       })
-        .then(function() {
-          self.fullscreenLoading = true;
-          return delFile(ids);
-        })
-        .then(() => {
-          this.getInvoiceList();
-          this.msgSuccess("删除成功");
-        });
     },
     //查看图片
     invoicePictureCardPreview(file) {
@@ -880,13 +888,19 @@ export default {
     },
     //删除发票
     invoiceRemove(file, fileList) {
-      console.log(fileList);
-      if (this.fileList) {
+      var self = this
+      if (file && file.status==="success") {
         this.fileList = this.fileList.filter((item) =>{
            if(item.uid !== file.uid){
              return item
            }else{
-             this.delInvoice(item)
+             self.fullscreenLoading = true;
+             delInvoice(item.ziiId).then(function() {
+                self.fullscreenLoading = false;
+                self.msgSuccess("删除成功");
+             }).catch(() => {
+                self.fullscreenLoading = false
+             });
            }
         });
       }
@@ -947,6 +961,9 @@ export default {
       } else if(this.active == 1) {
         //查询合同
         getFile("0",this.form.zbiId).then((response) => {
+          response.data.forEach(element => {
+            element.url = element.url + "/" + getToken()
+          });
           this.contractList = response.data;
           this.fullscreenLoading = false
         }).catch(() => {
@@ -956,6 +973,9 @@ export default {
       } else if(this.active == 2) {
         //查询物流
         getFile("1",this.form.zbiId).then((response) => {
+          response.data.forEach(element => {
+            element.url = element.url + "/" + getToken()
+          });
           this.logisticsList = response.data;
           this.fullscreenLoading = false
         }).catch(() => {
@@ -965,6 +985,9 @@ export default {
       } else if(this.active == 3) {
         //查询其他附件
         getFile("2",this.form.zbiId).then((response) => {
+          response.data.forEach(element => {
+            element.url = element.url + "/" + getToken()
+          });
           this.otherList = response.data;
           this.fullscreenLoading = false
         }).catch(() => {
@@ -980,6 +1003,9 @@ export default {
     getInvoiceList(){
       getInvoice(this.form.zbiId).then((response) => {
         console.log(response);
+        response.data.forEach(element => {
+          element.url = element.url + "/" + getToken()
+        });
         this.fileList = response.data;
         this.fullscreenLoading = false
       }).catch(() => {

+ 10 - 1
front-vue/src/views/service/bill/billDetail.vue

@@ -315,6 +315,7 @@ import {
 companyRelList
 } from "@/api/common/company";
 import { amtformat } from "@/utils/amtCommon"
+import { getToken } from "@/utils/auth";
 
 export default {
   name: "BillDetail",
@@ -376,6 +377,11 @@ export default {
       getBill(zbiId).then((response) => {
         console.log(response);
         this.form = response.data;
+        if(this.form.zbiPayerId == this.company.scyId){
+          this.type = "00"
+        }else{
+          this.type = "01"
+        }
         this.fullscreenLoading = false
       });
     },
@@ -411,6 +417,7 @@ export default {
       } else if(this.active == 1) {
         //查询合同
         getFile("0",this.form.zbiId).then((response) => {
+          response.url = response.url + "/" + getToken()
           this.contractList = response.data;
           this.fullscreenLoading = false
         }).catch(() => {
@@ -420,6 +427,7 @@ export default {
       } else if(this.active == 2) {
         //查询物流
         getFile("1",this.form.zbiId).then((response) => {
+          response.url = response.url + "/" + getToken()
           this.logisticsList = response.data;
           this.fullscreenLoading = false
         }).catch(() => {
@@ -429,6 +437,7 @@ export default {
       } else if(this.active == 3) {
         //查询其他附件
         getFile("2",this.form.zbiId).then((response) => {
+          response.url = response.url + "/" + getToken()
           this.otherList = response.data;
           this.fullscreenLoading = false
         }).catch(() => {
@@ -443,7 +452,7 @@ export default {
     //查询合同
     getInvoiceList(){
       getInvoice(this.form.zbiId).then((response) => {
-        console.log(response);
+        response.url = response.url + "/" + getToken()
         this.fileList = response.data;
         this.fullscreenLoading = false
       }).catch(() => {

+ 54 - 30
front-vue/src/views/service/bill/billEdit.vue

@@ -271,7 +271,8 @@
                 :file-list="fileList"
                 :auto-upload="false"
                 :http-request="httpRequest"
-                :before-remove="invoiceRemove"
+                :before-remove="beforeRemove"
+                :on-remove="invoiceRemove"
                 action=""
                 multiple
               >
@@ -368,14 +369,12 @@
                         <el-input
                           v-model="invoice.ziiNo"
                           maxlength="20"
-                          show-word-limit
                         />
                       </el-form-item>
                       <el-form-item label="发票号码:">
                         <el-input
                           v-model="invoice.ziiNumber"
                           maxlength="20"
-                          show-word-limit
                         />
                       </el-form-item>
                       <el-form-item label="开票日期:">
@@ -391,28 +390,24 @@
                         <el-input
                           v-model="invoice.ziiPurchaserNo"
                           maxlength="20"
-                          show-word-limit
                         />
                       </el-form-item>
                       <el-form-item label="销货纳税人编号:">
                         <el-input
                           v-model="invoice.ziiSellerNo"
                           maxlength="20"
-                          show-word-limit
                         />
                       </el-form-item>
                       <el-form-item label="发票金额:">
                         <el-input
                           v-model="invoice.ziiTotalAmount"
-                          maxlength="20"
-                          show-word-limit
+                          maxlength="16"
                         />
                       </el-form-item>
                       <el-form-item label="税价金额:">
                         <el-input
                           v-model="invoice.ziiAmount"
-                          maxlength="20"
-                          show-word-limit
+                          maxlength="16"
                         />
                       </el-form-item>
                     </el-form>
@@ -447,7 +442,8 @@
               ref="contractUpload"
               list-type="picture-card"
               :on-preview="invoicePictureCardPreview"
-              :before-remove="handleRemove">
+              :before-remove="beforeRemove"
+              :on-remove="handleRemove">
               <i class="el-icon-plus"></i>
             </el-upload>
           </div>
@@ -469,7 +465,8 @@
               ref="logisticsUpload"
               list-type="picture-card"
               :on-preview="invoicePictureCardPreview"
-              :before-remove="handleRemove">
+              :before-remove="beforeRemove"
+              :on-remove="handleRemove">
               <i class="el-icon-plus"></i>
             </el-upload>
           </div>
@@ -491,7 +488,8 @@
               ref="otherUpload"
               list-type="picture-card"
               :on-preview="invoicePictureCardPreview"
-              :before-remove="handleRemove">
+              :before-remove="beforeRemove"
+              :on-remove="handleRemove">
               <i class="el-icon-plus"></i>
             </el-upload>
           </div>
@@ -537,6 +535,7 @@ import {
 companyRelList
 } from "@/api/common/company";
 import { amtformat } from "@/utils/amtCommon"
+import { getToken } from "@/utils/auth";
 
 export default {
   name: "BillEdit",
@@ -672,6 +671,11 @@ export default {
       getBill(zbiId).then((response) => {
         console.log(response);
         this.form = response.data;
+        if(this.form.zbiPayerId == this.company.scyId){
+          this.type = "00"
+        }else{
+          this.type = "01"
+        }
         this.fullscreenLoading = false
       });
     },
@@ -772,6 +776,7 @@ export default {
       fd.append("file", fileObj); // 文件对象
       fd.append("zbiId", this.form.zbiId); //文件类型
       getInvoiceText(fd).then((response) => {
+        response.url = response.url + "/" + getToken()
         this.fileList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
@@ -800,6 +805,7 @@ export default {
       fd.append("zbiId", this.form.zbiId); //文件类型
       fd.append("type", "0"); //文件类型
       uploadBillFile(fd).then((response) => {
+        response.url = response.url + "/" + getToken()
         this.contractList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
@@ -816,6 +822,7 @@ export default {
       fd.append("zbiId", this.form.zbiId); //文件类型
       fd.append("type", "1"); //文件类型
       uploadBillFile(fd).then((response) => {
+        response.url = response.url + "/" + getToken()
         this.logisticsList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
@@ -832,12 +839,22 @@ export default {
       fd.append("zbiId", this.form.zbiId); //文件类型
       fd.append("type", "2"); //文件类型
       uploadBillFile(fd).then((response) => {
+        response.url = response.url + "/" + getToken()
         this.otherList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
         this.fullscreenLoading = false
       });
     },
+    //删除图片
+    beforeRemove(file, fileList) {
+      console.log(file)
+      let a = true;
+      if (file && file.status==="success") {
+        a = this.$confirm(`确定移除 ${ file.name }?`);
+      }
+      return a;
+    },
     //删除合同附件
     handleRemove(file, fileList) {
       console.log(fileList);
@@ -876,22 +893,12 @@ export default {
     },
     //删除附件
     delFile(row){
-      var self = this
-      console.log(this.ids)
+      var self = this;
       const ids = row.id || this.ids;
-      this.$confirm("是否确认删除此数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
+      self.fullscreenLoading = true;
+      delFile(ids).then(function() {
+        self.fullscreenLoading = false;
       })
-        .then(function() {
-          self.fullscreenLoading = true;
-          return delFile(ids);
-        })
-        .then(() => {
-          this.getInvoiceList();
-          this.msgSuccess("删除成功");
-        });
     },
     //查看图片
     invoicePictureCardPreview(file) {
@@ -901,13 +908,19 @@ export default {
     },
     //删除发票
     invoiceRemove(file, fileList) {
-      console.log(fileList);
-      if (this.fileList) {
+      var self = this;
+      if (file && file.status==="success") {
         this.fileList = this.fileList.filter((item) =>{
            if(item.uid !== file.uid){
              return item
            }else{
-             this.delInvoice(item)
+             self.fullscreenLoading = true;
+             delInvoice(item.ziiId).then(function() {
+                self.fullscreenLoading = false;
+                this.msgSuccess("删除成功");
+             }).catch(() => {
+                self.fullscreenLoading = false
+             });
            }
         });
       }
@@ -971,6 +984,9 @@ export default {
       } else if(this.active == 1) {
         //查询合同
         getFile("0",this.form.zbiId).then((response) => {
+          response.data.forEach(element => {
+            element.url = element.url + "/" + getToken()
+          });
           this.contractList = response.data;
           this.fullscreenLoading = false
         }).catch(() => {
@@ -980,6 +996,9 @@ export default {
       } else if(this.active == 2) {
         //查询物流
         getFile("1",this.form.zbiId).then((response) => {
+          response.data.forEach(element => {
+            element.url = element.url + "/" + getToken()
+          });
           this.logisticsList = response.data;
           this.fullscreenLoading = false
         }).catch(() => {
@@ -989,6 +1008,9 @@ export default {
       } else if(this.active == 3) {
         //查询其他附件
         getFile("2",this.form.zbiId).then((response) => {
+          response.data.forEach(element => {
+            element.url = element.url + "/" + getToken()
+          });
           this.otherList = response.data;
           this.fullscreenLoading = false
         }).catch(() => {
@@ -1003,7 +1025,9 @@ export default {
     //查询合同
     getInvoiceList(){
       getInvoice(this.form.zbiId).then((response) => {
-        console.log(response);
+        response.data.forEach(element => {
+            element.url = element.url + "/" + getToken()
+        });
         this.fileList = response.data;
         this.fullscreenLoading = false
       }).catch(() => {