소스 검색

往来账款问题优化

dudm 3 년 전
부모
커밋
b144872ee3

+ 3 - 3
front-vue/src/router/index.js

@@ -314,19 +314,19 @@ export const constantRoutes = [
         path: 'billAdd',
         component: (resolve) => require(['@/views/service/bill/billAdd'], resolve),
         name: 'billAdd',
-        meta: { title: '往来账款新增' }
+        meta: { title: '往来账款新增',noCache: true }
       },
       {
         path: 'billEdit/:zbiId',
         component: (resolve) => require(['@/views/service/bill/billEdit'], resolve),
         name: 'billEdit',
-        meta: { title: '往来账款编辑' }
+        meta: { title: '往来账款编辑',noCache: true }
       },
       {
         path: 'billDetail/:zbiId',
         component: (resolve) => require(['@/views/service/bill/billDetail'], resolve),
         name: 'billDetail',
-        meta: { title: '往来账款详情' }
+        meta: { title: '往来账款详情',noCache: true }
       }
     ]
   },

+ 8 - 4
front-vue/src/views/service/bill/bill.vue

@@ -33,7 +33,7 @@
         />
       </el-form-item>
   
-      <el-form-item label="账款类型" prop="zbiType">
+      <el-form-item label="账款类型" prop="zbiType" v-if="company.scyType!='00'">
         <el-select v-model="queryParams.zbiType"
             placeholder="请选择账款类型"
             clearable
@@ -112,7 +112,7 @@
       </el-table-column>
       <el-table-column label="账款编号" align="center" prop="zbiNumber" v-if="uncheckList.zbiNumber" :show-overflow-tooltip="true"/>
       <el-table-column label="账款名称" align="center" prop="zbiName" v-if="uncheckList.zbiName" :show-overflow-tooltip="true"/>
-      <el-table-column label="账款类型" align="center" prop="zbiType" v-if="uncheckList.zbiType" :show-overflow-tooltip="true" :formatter="typeFormat"/>
+      <el-table-column label="账款类型" align="center" prop="zbiType" v-if="uncheckList.zbiType&&company.scyType!='00'" :show-overflow-tooltip="true" :formatter="typeFormat"/>
       <el-table-column label="关联融信" align="center" prop="zfiNumber" v-if="uncheckList.zfiNumber" :show-overflow-tooltip="true"/>
       <el-table-column label="应付方" align="center" prop="payerName" v-if="uncheckList.payerName" :show-overflow-tooltip="true"/>
       <el-table-column label="应收方" align="center" prop="payeeName" v-if="uncheckList.payeeName" :show-overflow-tooltip="true"/>
@@ -171,6 +171,7 @@
 
 <script>
 import { listBill, deleteBill } from "@/api/service/bill/bill";
+import { getOwnCompany } from "@/api/common/company";
 import {columnQuery,columnfilter} from "@/api/common/columnSetting";
 import ColumnSetting from '../../../components/Table/columnSetting.vue';
 import Cookies from 'js-cookie'
@@ -204,6 +205,7 @@ export default {
         payerName: null,
         zbiStatus:null
       },
+      company:{},
       //筛选按钮的数据列表,与table表头的数据一致 --显示隐藏列用
       tableList: [
             {
@@ -254,6 +256,9 @@ export default {
     };
   },
   created() {
+      getOwnCompany().then((response) => {
+        this.company = response.data;
+      });
       this.getList();
       this.getDicts("zc_bill_type").then(response => {
         this.typeOptions = response.data;
@@ -263,7 +268,7 @@ export default {
       });
   },
   activated () {
-    // this.getList();
+    this.getList();
     this.getDicts("zc_bill_type").then(response => {
       this.typeOptions = response.data;
     });
@@ -302,7 +307,6 @@ export default {
     getList() {
       this.loading = true;
       listBill(this.queryParams).then(response => {
-        console.log(response)
         this.billList = response.data.records;
         this.total = response.data.total
         this.loading = false;

+ 11 - 21
front-vue/src/views/service/bill/billAdd.vue

@@ -532,7 +532,7 @@ import { amtformat } from "@/utils/amtCommon"
 import { getToken } from "@/utils/auth";
 
 export default {
-  name: "BillAdd",
+  name: "billAdd",
   components: {},
   data() {
     return {
@@ -647,8 +647,8 @@ export default {
     //进度
     this.active = 0;
     getOwnCompany().then((response) => {
-      console.log(response);
       this.company = response.data;
+    }).then((response) => {
       this.changePayer("00")
     });
     this.getCompanyRel()
@@ -660,7 +660,6 @@ export default {
   methods: {
     //切换账款类型
     changePayer(val){
-        console.log(val);
         if(val == '00'){
           this.$set(this.form,"zbiPayerId",this.company.scyId)
           this.$set(this.form,"zbiPayeeId",null)
@@ -673,7 +672,6 @@ export default {
     getCompanyRel(val){
       this.queryParams.companyName = val
       companyRelList(this.queryParams).then((response) => {
-        console.log(response);
         this.companyRelList = response.data;
       });
     },
@@ -718,7 +716,7 @@ export default {
             }
           });
         });
-        this.invoice = response[0] ? response[0] : {};
+        this.invoice = this.fileList[0] ? this.fileList[0] : {};
         this.fullscreenLoading = false
       }).catch(() => {
         this.fullscreenLoading = false
@@ -750,13 +748,11 @@ export default {
     httpRequest(param) {
       this.fullscreenLoading = true
       let fileObj = param.file; // 相当于input里取得的files
-      console.log(param);
       let fd = new FormData(); // FormData 对象
       fd.append("file", fileObj); // 文件对象
       fd.append("zbiId", this.form.zbiId); //文件类型
-      console.log(fd.get("file"));
       getInvoiceText(fd).then((response) => {
-        response.url = response.url + "/" + getToken()
+        response.data.url = response.data.url + "/" + getToken()
         this.fileList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
@@ -779,13 +775,12 @@ export default {
     httpRequestContract(param) {
       this.fullscreenLoading = true
       let fileObj = param.file; // 相当于input里取得的files
-      console.log(param);
       let fd = new FormData(); // FormData 对象
       fd.append("file", fileObj); // 文件对象
       fd.append("zbiId", this.form.zbiId); //文件类型
       fd.append("type", "0"); //文件类型
       uploadBillFile(fd).then((response) => {
-        response.url = response.url + "/" + getToken()
+        response.data.url = response.data.url + "/" + getToken()
         this.contractList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
@@ -796,13 +791,12 @@ export default {
     httpRequestLogistics(param) {
       this.fullscreenLoading = true
       let fileObj = param.file; // 相当于input里取得的files
-      console.log(param);
       let fd = new FormData(); // FormData 对象
       fd.append("file", fileObj); // 文件对象
       fd.append("zbiId", this.form.zbiId); //文件类型
       fd.append("type", "1"); //文件类型
       uploadBillFile(fd).then((response) => {
-        response.url = response.url + "/" + getToken()
+        response.data.url = response.data.url + "/" + getToken()
         this.logisticsList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
@@ -813,13 +807,12 @@ export default {
     httpRequestOther(param) {
       this.fullscreenLoading = true
       let fileObj = param.file; // 相当于input里取得的files
-      console.log(param);
       let fd = new FormData(); // FormData 对象
       fd.append("file", fileObj); // 文件对象
       fd.append("zbiId", this.form.zbiId); //文件类型
       fd.append("type", "2"); //文件类型
       uploadBillFile(fd).then((response) => {
-        response.url = response.url + "/" + getToken()
+        response.data.url = response.data.url + "/" + getToken()
         this.otherList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
@@ -828,7 +821,6 @@ export default {
     },
     //删除图片
     beforeRemove(file, fileList) {
-      console.log(file)
       let a = true;
       if (file && file.status==="success") {
         a = this.$confirm(`确定移除 ${ file.name }?`);
@@ -837,7 +829,6 @@ export default {
     },
     //删除合同附件
     handleRemove(file, fileList) {
-      console.log(fileList);
       if(this.active == 2){
         if (this.contractList) {
           this.contractList = this.contractList.filter((item) =>{
@@ -848,7 +839,6 @@ export default {
             }
           });
         }
-        console.log(this.contractList);
       } else if(this.active == 3) {
         if (this.logisticsList) {
           this.logisticsList = this.logisticsList.filter((item) =>{
@@ -882,7 +872,6 @@ export default {
     },
     //查看图片
     invoicePictureCardPreview(file) {
-      console.log(file)
       this.invoiceImageUrl = file.url;
       this.invoiceVisible = true;
     },
@@ -904,12 +893,10 @@ export default {
            }
         });
       }
-      console.log(this.fileList);
     },
     //删除发票
     delInvoice(row){
       var self = this
-      console.log(this.ids)
       const ziiIds = row.ziiId || this.ids;
       this.$confirm("是否确认删除此数据项?", "警告", {
         confirmButtonText: "确定",
@@ -1002,7 +989,6 @@ export default {
     //查询合同
     getInvoiceList(){
       getInvoice(this.form.zbiId).then((response) => {
-        console.log(response);
         response.data.forEach(element => {
           element.url = element.url + "/" + getToken()
         });
@@ -1018,10 +1004,14 @@ export default {
     },
     // 结束
     submit() {
+      this.fullscreenLoading = true
       commitBill(this.form.zbiId).then((response) => {
+        this.fullscreenLoading = false
         this.msgSuccess("保存成功");
         this.$store.dispatch("tagsView/delView", this.$route);
         this.$router.go(-1);
+      }).catch(() => {
+        this.fullscreenLoading = false
       });
     },
     //校验结果字典

+ 2 - 6
front-vue/src/views/service/bill/billDetail.vue

@@ -166,7 +166,7 @@
           <div v-if="active == 1">
             <el-divider content-position="left">发票列表</el-divider>
             <el-form ref="invoice" label-width="auto" :inline="true">
-              <el-form-item label="合计:">{{ allAmount() }}</el-form-item>
+              <el-form-item label="合计:">{{ handleInput(allAmount()) }}</el-form-item>
               <el-form-item label="大写:">{{ smallToBig(allAmount()) }}</el-form-item>
             </el-form>
 
@@ -318,7 +318,7 @@ import { amtformat } from "@/utils/amtCommon"
 import { getToken } from "@/utils/auth";
 
 export default {
-  name: "BillDetail",
+  name: "billDetail",
   components: {},
   data() {
     return {
@@ -361,7 +361,6 @@ export default {
     const zbiId = this.$route.params && this.$route.params.zbiId;
     this.fullscreenLoading = true
     getOwnCompany().then((response) => {
-      console.log(response);
       this.company = response.data;
     });
     this.getCompanyRel()
@@ -375,7 +374,6 @@ export default {
     //查询往来账款详情
     getDetail(zbiId){
       getBill(zbiId).then((response) => {
-        console.log(response);
         this.form = response.data;
         if(this.form.zbiPayerId == this.company.scyId){
           this.type = "00"
@@ -389,13 +387,11 @@ export default {
     getCompanyRel(val){
       this.queryParams.companyName = val
       companyRelList(this.queryParams).then((response) => {
-        console.log(response);
         this.companyRelList = response.data;
       });
     },
     //查看图片
     invoicePictureCardPreview(file) {
-      console.log(file)
       this.invoiceImageUrl = file.url;
       this.invoiceVisible = true;
     },

+ 13 - 23
front-vue/src/views/service/bill/billEdit.vue

@@ -1,7 +1,8 @@
 <template>
   <div class="app-container">
     <el-container>
-      <el-container>
+      <el-container
+      v-loading.fullscreen.lock="fullscreenLoading">
         <el-aside
           style="
             background-color: white;
@@ -175,7 +176,7 @@
           <div v-if="active == 1">
             <el-divider content-position="left">发票列表</el-divider>
             <el-form ref="invoice" label-width="auto" :inline="true">
-              <el-form-item label="合计:">{{ allAmount() }}</el-form-item>
+              <el-form-item label="合计:">{{ handleInput(allAmount()) }}</el-form-item>
               <el-form-item label="大写:">{{ smallToBig(allAmount()) }}</el-form-item>
               <el-form-item style="float: right"
                 ><el-button type="primary" @click="delInvoice"
@@ -509,7 +510,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"
@@ -540,7 +540,7 @@ import { amtformat } from "@/utils/amtCommon"
 import { getToken } from "@/utils/auth";
 
 export default {
-  name: "BillEdit",
+  name: "billEdit",
   components: {},
   data() {
     return {
@@ -657,7 +657,6 @@ export default {
     const zbiId = this.$route.params && this.$route.params.zbiId;
     this.fullscreenLoading = true
     getOwnCompany().then((response) => {
-      console.log(response);
       this.company = response.data;
     });
     this.getCompanyRel()
@@ -671,7 +670,6 @@ export default {
     //查询往来账款详情
     getDetail(zbiId){
       getBill(zbiId).then((response) => {
-        console.log(response);
         this.form = response.data;
         if(this.form.zbiPayerId == this.company.scyId){
           this.type = "00"
@@ -683,7 +681,6 @@ export default {
     },
     //切换账款类型
     changePayer(val){
-        console.log(val);
         if(val == '00'){
           this.form.zbiPayerId = this.company.scyId
           this.form.zbiPayeeId = null
@@ -696,7 +693,6 @@ export default {
     getCompanyRel(val){
       this.queryParams.companyName = val
       companyRelList(this.queryParams).then((response) => {
-        console.log(response);
         this.companyRelList = response.data;
       });
     },
@@ -741,7 +737,7 @@ export default {
             }
           });
         });
-        this.invoice = response[0] ? response[0] : {};
+        this.invoice = this.fileList[0] ? this.fileList[0] : {};
         this.fullscreenLoading = false
       }).catch(() => {
         this.fullscreenLoading = false
@@ -773,12 +769,11 @@ export default {
     httpRequest(param) {
       this.fullscreenLoading = true
       let fileObj = param.file; // 相当于input里取得的files
-      console.log(param);
       let fd = new FormData(); // FormData 对象
       fd.append("file", fileObj); // 文件对象
       fd.append("zbiId", this.form.zbiId); //文件类型
       getInvoiceText(fd).then((response) => {
-        response.url = response.url + "/" + getToken()
+        response.data.url = response.data.url + "/" + getToken()
         this.fileList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
@@ -801,13 +796,12 @@ export default {
     httpRequestContract(param) {
       this.fullscreenLoading = true
       let fileObj = param.file; // 相当于input里取得的files
-      console.log(param);
       let fd = new FormData(); // FormData 对象
       fd.append("file", fileObj); // 文件对象
       fd.append("zbiId", this.form.zbiId); //文件类型
       fd.append("type", "0"); //文件类型
       uploadBillFile(fd).then((response) => {
-        response.url = response.url + "/" + getToken()
+        response.data.url = response.data.url + "/" + getToken()
         this.contractList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
@@ -818,13 +812,12 @@ export default {
     httpRequestLogistics(param) {
       this.fullscreenLoading = true
       let fileObj = param.file; // 相当于input里取得的files
-      console.log(param);
       let fd = new FormData(); // FormData 对象
       fd.append("file", fileObj); // 文件对象
       fd.append("zbiId", this.form.zbiId); //文件类型
       fd.append("type", "1"); //文件类型
       uploadBillFile(fd).then((response) => {
-        response.url = response.url + "/" + getToken()
+        response.data.url = response.data.url + "/" + getToken()
         this.logisticsList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
@@ -835,13 +828,12 @@ export default {
     httpRequestOther(param) {
       this.fullscreenLoading = true
       let fileObj = param.file; // 相当于input里取得的files
-      console.log(param);
       let fd = new FormData(); // FormData 对象
       fd.append("file", fileObj); // 文件对象
       fd.append("zbiId", this.form.zbiId); //文件类型
       fd.append("type", "2"); //文件类型
       uploadBillFile(fd).then((response) => {
-        response.url = response.url + "/" + getToken()
+        response.data.url = response.data.url + "/" + getToken()
         this.otherList.push(response.data);
         this.fullscreenLoading = false
       }).catch(() => {
@@ -850,7 +842,6 @@ export default {
     },
     //删除图片
     beforeRemove(file, fileList) {
-      console.log(file)
       let a = true;
       if (file && file.status==="success") {
         a = this.$confirm(`确定移除 ${ file.name }?`);
@@ -859,7 +850,6 @@ export default {
     },
     //删除合同附件
     handleRemove(file, fileList) {
-      console.log(fileList);
       if(this.active == 2){
         if (this.contractList) {
           this.contractList = this.contractList.filter((item) =>{
@@ -870,7 +860,6 @@ export default {
             }
           });
         }
-        // console.log(this.contractList);
       } else if(this.active == 3) {
         if (this.logisticsList) {
           this.logisticsList = this.logisticsList.filter((item) =>{
@@ -904,7 +893,6 @@ export default {
     },
     //查看图片
     invoicePictureCardPreview(file) {
-      console.log(file)
       this.invoiceImageUrl = file.url;
       this.invoiceVisible = true;
     },
@@ -926,12 +914,10 @@ export default {
            }
         });
       }
-      console.log(this.fileList);
     },
     //删除发票
     delInvoice(row){
       var self = this
-      console.log(this.ids)
       const ziiIds = row.ziiId || this.ids;
       this.$confirm("是否确认删除此数据项?", "警告", {
         confirmButtonText: "确定",
@@ -1042,10 +1028,14 @@ export default {
     },
     // 结束
     submit() {
+      this.fullscreenLoading = true
       commitBill(this.form.zbiId).then((response) => {
+        this.fullscreenLoading = false
         this.msgSuccess("保存成功");
         this.$store.dispatch("tagsView/delView", this.$route);
         this.$router.go(-1);
+      }).catch(() => {
+        this.fullscreenLoading = false
       });
     },
     //校验结果字典