Переглянути джерело

往来账款查询、流程、发票流程功能修改优化

dudm 4 роки тому
батько
коміт
2efc2e3e47

+ 9 - 0
front-vue/src/api/service/bill/bill.js

@@ -17,6 +17,15 @@ export function getBill(zbiId) {
   })
 }
 
+// 往来账款发票金额计算
+export function getAmount(data) {
+  return request({
+    url: '/sc-service/ownBill/getAmount/',
+    method: 'post',
+    data: data
+  })
+}
+
 // 获取往来账款发票
 export function getInvoice(zbiId) {
   return request({

+ 75 - 45
front-vue/src/views/service/bill/billAdd.vue

@@ -50,6 +50,7 @@
                     >应付账款</el-radio-button
                   >
                   <el-radio-button label="01"
+                  v-if="company.scyType != '01'"
                     >应收账款</el-radio-button
                   >
                 </el-radio-group>
@@ -115,16 +116,24 @@
                     </el-option>
                 </el-select>
               </el-form-item>
-              <el-form-item label="金额" prop="zbiAmount">
+              <el-form-item label="金额">
                 <el-input
+                  :disabled="true"
                   v-model="form.zbiAmount"
-                  placeholder="请输入金额"
                   maxlength="20"
                   style="width: 300px"
                 >
                   <template slot="append">元</template>
                 </el-input>
               </el-form-item>
+              <el-form-item label="金额大写">
+                <el-input
+                  :disabled="true"
+                  :value="smallToBig(form.zbiAmount)"
+                  style="width: 300px"
+                >
+                </el-input>
+              </el-form-item>
               <el-form-item label="合同编号" prop="zbiContractNo">
                 <el-input
                   v-model="form.zbiContractNo"
@@ -270,7 +279,7 @@
                 drag
                 ref="upload"
                 :file-list="fileList"
-                :auto-upload="false"
+                :auto-upload="true"
                 :http-request="httpRequest"
                 :before-remove="beforeRemove"
                 :on-remove="invoiceRemove"
@@ -288,7 +297,7 @@
                   严禁上传包含色情、暴力、反动等相关违法信息的文件。
                 </div>
               </el-upload>
-              <el-button type="primary" @click="submitUpload()">点击上传</el-button>
+              <!-- <el-button type="primary" @click="submitUpload()">点击上传</el-button> -->
               <el-button type="primary" @click="toCheck()"
                 >完成去验真</el-button
               >
@@ -317,7 +326,7 @@
                   <el-main style="height: 550px; border: groove">
                     <el-checkbox-group
                       v-model="checkedInvoice"
-                      @change="handleCheckedInvoiceChange"
+                      @change="handleInvoiceSelectionChange"
                     >
                       <el-checkbox
                         v-for="(item, index) in fileList"
@@ -337,24 +346,31 @@
                           class="el-icon-error"
                           style="color: red"
                           v-if="item.ziiCheckStt == '2' || item.ziiCheckStt == '3'"
-                        ></i
+                        >{{checkSttFormat(item)}}</i
                       ></el-checkbox>
                     </el-checkbox-group>
                   </el-main>
+                  <div style="text-align:center;margin-top:20px">
+                    <el-button
+                      type="primary"
+                      @click="delInvoice"
+                      >删除</el-button
+                    >
                     <el-button
                       type="primary"
                       @click="toCheckAgian()"
-                      style="float: right"
                       >重新验真</el-button
                     >
+                  </div>
                 </el-aside>
                 <el-container>
-                  <el-header height="270px">
+                  <el-header height="300px">
                     <el-image
                       style="width: 650px; height: 267px"
                       :src="invoice.url"
                       fit="scale-down"
                     ></el-image>
+                    <p v-if="invoice.zbiName" style="text-align:center;color:red">发票重复,已存在名称为“{{invoice.zbiName}}”的往来账款中!</p>
                   </el-header>
                   <el-main>
                     <el-form
@@ -367,14 +383,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="开票日期:">
@@ -389,28 +403,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
                         />
                       </el-form-item>
                       <el-form-item label="税价金额:">
                         <el-input
                           v-model="invoice.ziiAmount"
                           maxlength="20"
-                          show-word-limit
                         />
                       </el-form-item>
                     </el-form>
@@ -431,15 +441,15 @@
           <div v-if="active == 2">
             <el-divider content-position="left">合同附件</el-divider>
             <el-form ref="contract" label-width="auto" :inline="true">
-              <el-form-item style="float: right"
+              <!-- <el-form-item style="float: right"
                 ><el-button type="primary" @click="submitUploadContract()"
                   >上传</el-button
                 ></el-form-item
-              >
+              > -->
             </el-form>
             <el-upload
               :file-list="contractList"
-              :auto-upload="false"
+              :auto-upload="true"
               :http-request="httpRequestContract"
               action=""
               ref="contractUpload"
@@ -454,15 +464,15 @@
           <div v-if="active == 3">
             <el-divider content-position="left">物流附件</el-divider>
             <el-form ref="logistics" label-width="auto" :inline="true">
-              <el-form-item style="float: right"
+              <!-- <el-form-item style="float: right"
                 ><el-button type="primary" @click="submitUploadLogistics()"
                   >上传</el-button
                 ></el-form-item
-              >
+              > -->
             </el-form>
             <el-upload
               :file-list="logisticsList"
-              :auto-upload="false"
+              :auto-upload="true"
               :http-request="httpRequestLogistics"
               action=""
               ref="logisticsUpload"
@@ -477,15 +487,15 @@
           <div v-if="active == 4">
             <el-divider content-position="left">其他附件</el-divider>
             <el-form ref="other" label-width="auto" :inline="true">
-              <el-form-item style="float: right"
+              <!-- <el-form-item style="float: right"
                 ><el-button type="primary" @click="submitUploadOther()"
                   >上传</el-button
                 ></el-form-item
-              >
+              > -->
             </el-form>
             <el-upload
               :file-list="otherList"
-              :auto-upload="false"
+              :auto-upload="true"
               :http-request="httpRequestOther"
               action=""
               ref="otherUpload"
@@ -524,7 +534,8 @@ import { addBill, getInvoiceText, invoiceVerification, delInvoice, getInvoice,
   uploadBillFile,
   getFile,
   delFile,
-  commitBill } from "@/api/service/bill/bill";
+  commitBill,
+  getAmount } from "@/api/service/bill/bill";
 import {
   getOwnCompany,
 companyRelList
@@ -550,6 +561,7 @@ export default {
       queryParams: {},
       // 表单参数
       form: {
+        zbiAmount:0.00
       },
       // 表单校验
       rules: {
@@ -655,6 +667,10 @@ export default {
         this.changePayer("01")
         this.disabled = true
         this.type = "01"
+      }else if(this.company.scyType == '01'){
+        this.changePayer("00")
+        this.disabled = true
+        this.type = "00"
       }else{
         this.changePayer("00")
         this.type = "00"
@@ -723,6 +739,7 @@ export default {
           this.fileList.forEach((file) => {
             if (element.ziiId == file.ziiId) {
               file.ziiCheckStt = element.ziiCheckStt;
+              file.zbiName = element.zbiName;
             }
           });
         });
@@ -742,6 +759,7 @@ export default {
           this.fileList.forEach(file => {
             if(element.ziiId == file.ziiId){
               file.ziiCheckStt = element.ziiCheckStt
+              file.zbiName = element.zbiName;
             }
           });
         });
@@ -908,19 +926,21 @@ export default {
     delInvoice(row){
       var self = this
       const ziiIds = row.ziiId || this.ids;
-      this.$confirm("是否确认删除此数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(function() {
-          self.fullscreenLoading = true
-          return delInvoice(ziiIds);
+      if(ziiIds && ziiIds.length != 0){
+        this.$confirm("是否确认删除此数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
         })
-        .then(() => {
-          this.getInvoiceList();
-          this.msgSuccess("删除成功");
-        });
+          .then(function() {
+            self.fullscreenLoading = true
+            return delInvoice(ziiIds);
+          })
+          .then(() => {
+            this.getInvoiceList();
+            this.msgSuccess("删除成功");
+          });
+      }
     },
     //确认发票
     submitCheck(){
@@ -956,17 +976,25 @@ 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
+        var self = this
+        let fd = new FormData(); // FormData 对象
+        fd.append("zbiId", self.form.zbiId); // 文件对象
+        //计算账款金额
+        getAmount(fd).then((response) => {
+          //查询合同
+          getFile("0",self.form.zbiId).then((response) => {
+            response.data.forEach(element => {
+              element.url = element.url + "/" + getToken()
+            });
+            self.contractList = response.data;
+            self.fullscreenLoading = false
+            self.active++;
+          }).catch(() => {
+            self.fullscreenLoading = false
+          })
         }).catch(() => {
-          this.fullscreenLoading = false
+          self.fullscreenLoading = false
         })
-        this.active++;
       } else if(this.active == 2) {
         //查询物流
         getFile("1",this.form.zbiId).then((response) => {
@@ -1003,6 +1031,8 @@ export default {
           element.url = element.url + "/" + getToken()
         });
         this.fileList = response.data;
+        this.invoice = this.fileList[0] ? this.fileList[0] : {};
+        this.ids = []
         this.fullscreenLoading = false
       }).catch(() => {
         this.fullscreenLoading = false

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

@@ -64,16 +64,11 @@
                 />
               </el-form-item>
               <el-form-item label="应付方" prop="zbiPayerId">
-                <el-select style="width: 300px" v-model="form.zbiPayerId" :disabled="true" filterable remote
-                  v-if="type == '00'">
-                    <el-option :label="company.scyName" :value="company.scyId">
-                    </el-option>
-                </el-select>
-                <el-select style="width: 300px" v-model="form.zbiPayerId" filterable clearable remote 
-                  v-if="type == '01'">
-                    <el-option v-for="(item,index) in companyRelList" :key="index" :label="item.launchScyId == company.scyId ? item.receiveScyName : item.launchScyName" :value="item.launchScyId == company.scyId ? item.receiveScyId : item.launchScyId">
-                    </el-option>
-                </el-select>
+                <el-input
+                  v-model="form.payerName"
+                  maxlength="20"
+                  style="width: 300px"
+                />
               </el-form-item>
               <el-form-item label="贸易日期" prop="zbiDate">
                 <el-date-picker
@@ -103,16 +98,11 @@
                 </el-date-picker>
               </el-form-item>
               <el-form-item label="应收方" prop="zbiPayeeId">
-                <el-select style="width: 300px" v-model="form.zbiPayeeId" :disabled="true" filterable remote
-                  v-if="type == '01'">
-                    <el-option :label="company.scyName" :value="company.scyId">
-                    </el-option>
-                </el-select>
-                <el-select style="width: 300px" v-model="form.zbiPayeeId" filterable clearable remote 
-                  v-if="type == '00'">
-                    <el-option v-for="(item,index) in companyRelList" :key="index" :label="item.launchScyId == company.scyId ? item.receiveScyName : item.launchScyName" :value="item.launchScyId == company.scyId ? item.receiveScyId : item.launchScyId">
-                    </el-option>
-                </el-select>
+                <el-input
+                  v-model="form.payeeName"
+                  maxlength="20"
+                  style="width: 300px"
+                />
               </el-form-item>
               <el-form-item label="金额" prop="zbiAmount">
                 <el-input

+ 98 - 53
front-vue/src/views/service/bill/billEdit.vue

@@ -66,13 +66,20 @@
                 />
               </el-form-item>
               <el-form-item label="应付方" prop="zbiPayerId">
+                <el-input
+                  v-model="form.payerName"
+                  maxlength="20"
+                  style="width: 300px"
+                  :disabled="true"
+                  v-if="company.scyId != form.zbiPayerId && company.scyId != form.zbiPayeeId"
+                />
                 <el-select style="width: 300px" v-model="form.zbiPayerId" :disabled="true" filterable remote
-                  v-if="type == '00'">
+                  v-if="type == '00' && company.scyId == form.zbiPayerId || type == '00' && company.scyId == form.zbiPayeeId">
                     <el-option :label="company.scyName" :value="company.scyId">
                     </el-option>
                 </el-select>
-                <el-select style="width: 300px" v-model="form.zbiPayerId" filterable clearable remote 
-                  v-if="type == '01'">
+                <el-select style="width: 300px" v-model="form.zbiPayerId" filterable clearable remote
+                  v-if="type == '01' && company.scyId == form.zbiPayerId || type == '01' && company.scyId == form.zbiPayeeId">
                     <el-option v-for="(item,index) in companyRelList" :key="index" :label="item.launchScyId == company.scyId ? item.receiveScyName : item.launchScyName" :value="item.launchScyId == company.scyId ? item.receiveScyId : item.launchScyId">
                     </el-option>
                 </el-select>
@@ -107,27 +114,42 @@
                 </el-date-picker>
               </el-form-item>
               <el-form-item label="应收方" prop="zbiPayeeId">
+                <el-input
+                  v-model="form.payeeName"
+                  maxlength="20"
+                  style="width: 300px"
+                  :disabled="true"
+                  v-if="company.scyId != form.zbiPayerId && company.scyId != form.zbiPayeeId"
+                />
                 <el-select style="width: 300px" v-model="form.zbiPayeeId" :disabled="true" filterable remote
-                  v-if="type == '01'">
+                  v-if="type == '01' && company.scyId == form.zbiPayerId || type == '01' && company.scyId == form.zbiPayeeId">
                     <el-option :label="company.scyName" :value="company.scyId">
                     </el-option>
                 </el-select>
-                <el-select style="width: 300px" v-model="form.zbiPayeeId" filterable clearable remote 
-                  v-if="type == '00'">
+                <el-select style="width: 300px" v-model="form.zbiPayeeId" filterable clearable remote
+                  v-if="type == '00' && company.scyId == form.zbiPayerId || type == '00' && company.scyId == form.zbiPayeeId">
                     <el-option v-for="(item,index) in companyRelList" :key="index" :label="item.launchScyId == company.scyId ? item.receiveScyName : item.launchScyName" :value="item.launchScyId == company.scyId ? item.receiveScyId : item.launchScyId">
                     </el-option>
                 </el-select>
               </el-form-item>
-              <el-form-item label="金额" prop="zbiAmount">
+              <el-form-item label="金额">
                 <el-input
+                  :disabled="true"
                   v-model="form.zbiAmount"
-                  placeholder="请输入金额"
                   maxlength="20"
                   style="width: 300px"
                 >
                   <template slot="append">元</template>
                 </el-input>
               </el-form-item>
+              <el-form-item label="金额大写">
+                <el-input
+                  :disabled="true"
+                  :value="smallToBig(form.zbiAmount)"
+                  style="width: 300px"
+                >
+                </el-input>
+              </el-form-item>
               <el-form-item label="合同编号" prop="zbiContractNo">
                 <el-input
                   v-model="form.zbiContractNo"
@@ -272,7 +294,7 @@
                 drag
                 ref="upload"
                 :file-list="fileList"
-                :auto-upload="false"
+                :auto-upload="true"
                 :http-request="httpRequest"
                 :before-remove="beforeRemove"
                 :on-remove="invoiceRemove"
@@ -290,9 +312,9 @@
                   严禁上传包含色情、暴力、反动等相关违法信息的文件。
                 </div>
               </el-upload>
-              <el-button type="primary" @click="submitUpload()"
+              <!-- <el-button type="primary" @click="submitUpload()"
                 >点击上传</el-button
-              >
+              > -->
               <el-button type="primary" @click="toCheck()"
                 >完成去验真</el-button
               >
@@ -321,7 +343,7 @@
                   <el-main style="height: 550px; border: groove">
                     <el-checkbox-group
                       v-model="checkedInvoice"
-                      @change="handleCheckedInvoiceChange"
+                      @change="handleInvoiceSelectionChange"
                     >
                       <el-checkbox
                         v-for="(item, index) in fileList"
@@ -341,25 +363,33 @@
                           class="el-icon-error"
                           style="color: red"
                           v-if="item.ziiCheckStt == '2' || item.ziiCheckStt == '3'"
-                        ></i
-                      ></el-checkbox>
+                        >{{checkSttFormat(item)}}</i
+                      >
+                      </el-checkbox>
                     </el-checkbox-group>
                   </el-main>
-                  <el-button
-                    type="primary"
-                    @click="toCheckAgian()"
-                    style="float: right"
-                    >重新验真</el-button
-                  >
+                  <div style="text-align:center;margin-top:20px">
+                    <el-button
+                      type="primary"
+                      @click="delInvoice"
+                      >删除</el-button
+                    >
+                    <el-button
+                      type="primary"
+                      @click="toCheckAgian()"
+                      >重新验真</el-button
+                    >
+                  </div>
                 </el-aside>
                 <el-container>
-                  <el-header height="270px">
+                  <el-header height="300px">
                     <el-image
                       style="width: 650px; height: 267px"
                       :src="invoice.url"
                       fit="scale-down"
                       @click="invoicePictureCardPreview(invoice)"
                     ></el-image>
+                    <p v-if="invoice.zbiName" style="text-align:center;color:red">发票重复,已存在名称为“{{invoice.zbiName}}”的往来账款中!</p>
                   </el-header>
                   <el-main>
                     <el-form
@@ -431,15 +461,15 @@
           <div v-if="active == 2">
             <el-divider content-position="left">合同附件</el-divider>
             <el-form ref="contract" label-width="auto" :inline="true">
-              <el-form-item style="float: right"
+              <!-- <el-form-item style="float: right"
                 ><el-button type="primary" @click="submitUploadContract()"
                   >上传</el-button
                 ></el-form-item
-              >
+              > -->
             </el-form>
             <el-upload
               :file-list="contractList"
-              :auto-upload="false"
+              :auto-upload="true"
               :http-request="httpRequestContract"
               action=""
               ref="contractUpload"
@@ -454,15 +484,15 @@
           <div v-if="active == 3">
             <el-divider content-position="left">物流附件</el-divider>
             <el-form ref="logistics" label-width="auto" :inline="true">
-              <el-form-item style="float: right"
+              <!-- <el-form-item style="float: right"
                 ><el-button type="primary" @click="submitUploadLogistics()"
                   >上传</el-button
                 ></el-form-item
-              >
+              > -->
             </el-form>
             <el-upload
               :file-list="logisticsList"
-              :auto-upload="false"
+              :auto-upload="true"
               :http-request="httpRequestLogistics"
               action=""
               ref="logisticsUpload"
@@ -477,15 +507,15 @@
           <div v-if="active == 4">
             <el-divider content-position="left">其他附件</el-divider>
             <el-form ref="other" label-width="auto" :inline="true">
-              <el-form-item style="float: right"
+              <!-- <el-form-item style="float: right"
                 ><el-button type="primary" @click="submitUploadOther()"
                   >上传</el-button
                 ></el-form-item
-              >
+              > -->
             </el-form>
             <el-upload
               :file-list="otherList"
-              :auto-upload="false"
+              :auto-upload="true"
               :http-request="httpRequestOther"
               action=""
               ref="otherUpload"
@@ -530,7 +560,8 @@ import {
   uploadBillFile,
   getFile,
   delFile,
-  commitBill
+  commitBill,
+  getAmount
 } from "@/api/service/bill/bill";
 import {
   getOwnCompany,
@@ -734,6 +765,7 @@ export default {
           this.fileList.forEach((file) => {
             if (element.ziiId == file.ziiId) {
               file.ziiCheckStt = element.ziiCheckStt;
+              file.zbiName = element.zbiName;
             }
           });
         });
@@ -753,6 +785,7 @@ export default {
           this.fileList.forEach((file) => {
             if (element.ziiId == file.ziiId) {
               file.ziiCheckStt = element.ziiCheckStt;
+              file.zbiName = element.zbiName;
             }
           });
         });
@@ -919,19 +952,21 @@ export default {
     delInvoice(row){
       var self = this
       const ziiIds = row.ziiId || this.ids;
-      this.$confirm("是否确认删除此数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(function() {
-          self.fullscreenLoading = true;
-          return delInvoice(ziiIds);
+      if(ziiIds && ziiIds.length != 0){
+        this.$confirm("是否确认删除此数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
         })
-        .then(() => {
-          this.getInvoiceList();
-          this.msgSuccess("删除成功");
-        });
+          .then(function() {
+            self.fullscreenLoading = true
+            return delInvoice(ziiIds);
+          })
+          .then(() => {
+            this.getInvoiceList();
+            this.msgSuccess("删除成功");
+          });
+      }
     },
     //确认发票
     submitCheck() {
@@ -970,17 +1005,25 @@ 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
+        var self = this
+        let fd = new FormData(); // FormData 对象
+        fd.append("zbiId", self.form.zbiId); // 文件对象
+        //计算账款金额
+        getAmount(fd).then((response) => {
+          //查询合同
+          getFile("0",self.form.zbiId).then((response) => {
+            response.data.forEach(element => {
+              element.url = element.url + "/" + getToken()
+            });
+            self.contractList = response.data;
+            self.fullscreenLoading = false
+            self.active++;
+          }).catch(() => {
+            self.fullscreenLoading = false
+          })
         }).catch(() => {
-          this.fullscreenLoading = false
+          self.fullscreenLoading = false
         })
-        this.active++;
       } else if(this.active == 2) {
         //查询物流
         getFile("1",this.form.zbiId).then((response) => {
@@ -1010,13 +1053,15 @@ export default {
         this.active++;
       }
     },
-    //查询合同
+    //查询发票
     getInvoiceList(){
       getInvoice(this.form.zbiId).then((response) => {
         response.data.forEach(element => {
             element.url = element.url + "/" + getToken()
         });
         this.fileList = response.data;
+        this.invoice = this.fileList[0] ? this.fileList[0] : {};
+        this.ids = []
         this.fullscreenLoading = false
       }).catch(() => {
         this.fullscreenLoading = false