فهرست منبع

增加文件及校验

xuefy 4 سال پیش
والد
کامیت
ca25a384e4

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

@@ -101,4 +101,13 @@ export function getSupplierAvailableBalance(query) {
     method: 'get',
     params: query
   })
+}
+
+//查询收付款下的文件
+export function getFile(query) {
+  return request({
+    url: '/sc-service/ownCredit/getFile',
+    method: 'post',
+    data: query
+  })
 }

+ 109 - 59
front-vue/src/views/service/credit/addCredit.vue

@@ -86,17 +86,50 @@
                 </el-col>
             </el-row>
         </el-form>
-        <!-- 附件类型表格 -->
-        
-        <el-table :data="tableData" border style="width: 100%"  :span-method="objectSpanMethod">
-            <el-table-column prop="number" label="序号" width="180" >
-            </el-table-column>
-            <el-table-column prop="attachment" label="附件类型" width="180">
-            </el-table-column>
-            <el-table-column prop="enclosure" label="附件">
-            </el-table-column>
-            <el-table-column prop="address" label="协议预览" >
-            </el-table-column>
+        <!-- 发票附件 -->
+        <el-divider content-position="left">发票附件</el-divider>
+        <el-table :data="invoiceFileList" border style="width: 100%">
+                <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
+        <!-- 合同附件 -->
+        <el-divider content-position="left">合同附件</el-divider>
+        <el-table :data="contractFileList" border style="width: 100%">
+               <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+               <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
+        <!-- 其他附件 -->
+        <el-divider content-position="left">其他附件</el-divider>
+        <el-table :data="otherFileList" border style="width: 100%">
+                <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
         </el-table>
 
 
@@ -149,6 +182,7 @@ import {
     getAccountsPay,
     getAvailableBalance,
     addCredit,
+    getFile
 } from "@/api/service/credit/credit";
 import { getRandom } from "@/api/common/getRandom";
 import { accAdd } from "@/utils/calculation";
@@ -157,28 +191,6 @@ export default {
     components: {},
     data() {
         return {
-             tableData: [{
-          number: '1',
-          attachment : '发票',
-          enclosure: '动态数据',
-        }, {
-          number: '2',
-          attachment: '发票',
-          enclosure: '动态数据',
-                    protocol :'',
-
-        }, {
-          number: '3',
-          attachment: '发票',
-          enclosure: '动态数据',
-            protocol :'',
-
-        }, {
-          number: '4',
-          attachment: '发票',
-          enclosure: '动态数据',
-          protocol :'',
-        }], 
             // 总条数
             total: 0,
             // 查询参数
@@ -277,7 +289,13 @@ export default {
             //产品编号
             zfpId: "",
             //利率
-            zfpcrRate:""
+            zfpcrRate:"",
+            //合同附件
+            contractFileList:[],
+            //发票附件
+            invoiceFileList:[],
+            //其他文件
+            otherFileList:[]
         };
     },
     created() {
@@ -343,13 +361,6 @@ export default {
             this.$store.dispatch("tagsView/delView", this.$route);
             this.$router.go(-1);
         },
-        /* 多选框跨页 */
-        rowkeyCustomer(row) {
-            return row.cciId;
-        },
-
-        //表格变动触发事件
-        handle() {},
         //应付账款查询列表
         getAccountsPay() {
             getAccountsPay(this.queryParamsPay).then((response) => {
@@ -392,6 +403,8 @@ export default {
             });
             //合计
             this.getReTotal(this.ticketList);
+            //附件
+            this.getFile(this.ticketList);
         },
         /* 多选框跨页 */
         rowkey(row) {
@@ -430,6 +443,8 @@ export default {
                 //合计
                 this.getReTotal(this.chooseTicket);
                 this.ticketList = this.chooseTicket;
+                //更新附件信息
+                this.getFile(this.ticketList);
                 this.open = false;
             } else {
                 this.$message({
@@ -438,6 +453,21 @@ export default {
                 });
             }
         },
+        //获取附件信息
+        getFile(datas){
+            var queryParamsFile = {};
+            queryParamsFile.ticketList = datas;
+            getFile(queryParamsFile).then((response) => {
+                if(response.data){
+                    //获取发票文件
+                     this.invoiceFileList = response.data.invoiceFileList;
+                    //获取合同文件
+                     this.contractFileList = response.data.contractFileList;
+                    //获取其他文件
+                    this.otherFileList = response.data.otherFileList;
+                }
+            });
+        },
 
         //重新合计
         getReTotal(chooseTicket) {
@@ -476,6 +506,9 @@ export default {
             if (this.$refs.tablePay) {
                 this.$refs.tablePay.clearSelection();
             }
+            //更新附件
+            this.getFile(this.ticketList);
+
         },
         /* 删除按钮 */
         handleDelete(index, rows) {
@@ -647,43 +680,45 @@ export default {
                 if (valid) {
                     const loading = this.$loading({
                         lock: true,
-                        text: "Loading",
-                        spinner: "el-icon-loading",
-                        background: "rgba(0, 0, 0, 0.7)",
+                        text: 'Loading',
+                        background: 'rgba(0, 0, 0,0)'
                     });
-                    //应付账款
-                    this.form.ticketList = this.ticketList;
                     //选择了应付款,如果申请金额小于合计金额增加提示
                     debugger;
                     if(this.ticketList.length > 0){
-                        if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.checkTotalAmt))){
+                        if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))){
+                                var _this = this;
                                  this.$confirm('签发金额小于应付金额合计,是否确认提交', "警告", {
                                     confirmButtonText: "确定",
                                     cancelButtonText: "取消",
                                     type: "warning"
                                     }).then(function() {
                                        //产品是否可拆分
-                                        this.form.zfpSplit = this.zfpSplit;
+                                        _this.form.zfpSplit = _this.zfpSplit;
                                         //放款方式
-                                        this.form.zfpcrLoanType = this.zfpcrLoanType;
+                                        _this.form.zfpcrLoanType = _this.zfpcrLoanType;
                                         //融信类型
-                                        this.form.type = "1";
+                                        _this.form.type = "1";
                                         //利率
-                                        this.form.zfiRate = this.zfpcrRate;
+                                        _this.form.zfiRate = _this.zfpcrRate;
                                         //产品
-                                        this.form.zfpId = this.zfpId;
-                                        addCredit(this.form).then((response) => {
+                                        _this.form.zfpId = _this.zfpId;
+                                        //应付账款
+                                        _this.form.ticketList = _this.ticketList;
+                                        addCredit(_this.form).then((response) => {
                                                 loading.close();
-                                                this.msgSuccess("新增成功");
-                                                this.$store.dispatch(
+                                                _this.msgSuccess("新增成功");
+                                                _this.$store.dispatch(
                                                     "tagsView/delView",
-                                                    this.$route
+                                                    _this.$route
                                                 );
-                                                this.$router.go(-1);
-                                            }).catch((response) => {
+                                                _this.$router.go(-1);
+                                            }).catch((e) => {
                                                 loading.close();
                                             });
-                                    })
+                                    }).catch((e) => {
+                                                loading.close();
+                                      });
                         }else{
                                //产品是否可拆分
                                 this.form.zfpSplit = this.zfpSplit;
@@ -695,6 +730,8 @@ export default {
                                 this.form.zfiRate = this.zfpcrRate;
                                 //产品
                                 this.form.zfpId = this.zfpId;
+                                //应付账款
+                                this.form.ticketList = this.ticketList;
                                 addCredit(this.form).then((response) => {
                                         loading.close();
                                         this.msgSuccess("新增成功");
@@ -718,6 +755,8 @@ export default {
                         this.form.zfiRate = this.zfpcrRate;
                         //产品
                         this.form.zfpId = this.zfpId;
+                        //应付账款
+                        this.form.ticketList = this.ticketList;
                         addCredit(this.form).then((response) => {
                                 loading.close();
                                 this.msgSuccess("新增成功");
@@ -734,6 +773,17 @@ export default {
                 }
             });
         },
+        //金额去掉千分位
+        moneyDelete(num){
+                if(num &&num != undefined && num != null){
+                    let _num = num;
+                    _num = _num.toString();
+                    _num = _num.replace(/,/gi,'');
+                    return _num;
+                }else{
+                    return num;
+                }
+        }
     },
 };
 </script>

+ 133 - 23
front-vue/src/views/service/credit/applyCreditEdit.vue

@@ -128,6 +128,51 @@
                 </el-col>  
             </el-row>      
         </el-form>
+        <!-- 发票附件 -->
+        <el-divider content-position="left">发票附件</el-divider>
+        <el-table :data="invoiceFileList" border style="width: 100%">
+                <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
+        <!-- 合同附件 -->
+        <el-divider content-position="left">合同附件</el-divider>
+        <el-table :data="contractFileList" border style="width: 100%">
+               <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+               <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
+        <!-- 其他附件 -->
+        <el-divider content-position="left">其他附件</el-divider>
+        <el-table :data="otherFileList" border style="width: 100%">
+                <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
         <div class="footer" style="float: right;
             margin-bottom:2px;">
             <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -200,7 +245,7 @@
   </div>
 </template>
 <script>
-import {listSupplierCreditLine,getCreditDetail,getAccountsCollection,updateCredit} from "@/api/service/credit/credit";
+import {getFile,getCreditDetail,getAccountsCollection,updateCredit} from "@/api/service/credit/credit";
 import {accAdd} from "@/utils/calculation";
 export default {
     name: "addCredit",
@@ -310,7 +355,13 @@ export default {
             //产品编号
             zfpId:"",
             //利率
-            zfpcrRate:''
+            zfpcrRate:'',
+            //合同附件
+            contractFileList:[],
+            //发票附件
+            invoiceFileList:[],
+            //其他文件
+            otherFileList:[]
         };
     },
     watch:{
@@ -333,6 +384,8 @@ export default {
              if(response.data.payList){
                  this.ticketList = response.data.payList.records;
                  this.getReTotal(this.ticketList);
+                 //附件
+                 this.getFile(this.ticketList);
              }
              
         })
@@ -352,6 +405,21 @@ export default {
                 this.total = response.data.total;
             });
         },
+        //获取附件信息
+        getFile(datas){
+            var queryParamsFile = {};
+            queryParamsFile.ticketList = datas;
+            getFile(queryParamsFile).then((response) => {
+                if(response.data){
+                    //获取发票文件
+                     this.invoiceFileList = response.data.invoiceFileList;
+                    //获取合同文件
+                     this.contractFileList = response.data.contractFileList;
+                    //获取其他文件
+                    this.otherFileList = response.data.otherFileList;
+                }
+            });
+        },
         resetQuerys() {
             this.resetForm("formQuery");
             this.handleQuerys();
@@ -382,6 +450,8 @@ export default {
             });
              //合计
             this.getReTotal(this.ticketList);
+            //附件
+            this.getFile(this.ticketList);
         },
         /* 多选框跨页 */
         rowkey(row) {
@@ -420,6 +490,8 @@ export default {
                 //合计
                 this.getReTotal(this.chooseTicket);
                 this.ticketList = this.chooseTicket;
+                //附件
+                this.getFile(this.ticketList);
                 //开立方赋值
                  this.$set(this.form, "openName",this.chooseTicket[0].payName);
                 this.open = false;
@@ -459,6 +531,7 @@ export default {
         if(this.$refs.tablePay){
             this.$refs.tablePay.clearSelection();
         }
+        this.getFile(this.ticketList);
     },
     /* 删除按钮 */
     handleDelete(index, rows) {
@@ -571,7 +644,7 @@ export default {
                 });
                 return;
         }
-        if(parseFloat(this.form.zfiAmount) > parseFloat(this.checkTotalAmt)){
+        if(parseFloat(this.form.zfiAmount) > parseFloat(this.moneyDelete(this.checkTotalAmt))){
              this.$message({
                     message: '签发金额不可大于合计金额',
                     type: 'warning'
@@ -580,29 +653,66 @@ export default {
         }
         this.$refs["form"].validate(valid => {
             if (valid) {
-            const loading = this.$loading({
-                lock: true,
-                text: "Loading",
-                spinner: "el-icon-loading",
-                background: "rgba(0, 0, 0, 0.7)",
-            })
-            //应收账款
-            this.form.ticketList = this.ticketList;
-            //融信类型
-            this.form.type = "0";
-            //合计金额
-            this.form.checkTotalAmt = this.checkTotalAmt;
-            updateCredit(this.form).then(response => {
-                loading.close();
-                this.msgSuccess("修改成功");
-                this.$store.dispatch("tagsView/delView", this.$route);
-                this.$router.go(-1);
-            }).catch((response)=>{
-            loading.close();
-            });
+             const loading = this.$loading({
+                        lock: true,
+                        text: 'Loading',
+                        background: 'rgba(0, 0, 0,0)'
+                    });   
+            //如果签发金额小于合计金额
+            if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))){
+                        var _this = this;
+                        this.$confirm('签发金额小于应付金额合计,是否确认提交', "警告", {
+                            confirmButtonText: "确定",
+                            cancelButtonText: "取消",
+                            type: "warning"
+                        }).then(function() {
+                           //应收账款
+                            _this.form.ticketList = _this.ticketList;
+                            //融信类型
+                            _this.form.type = "0";
+                            //合计金额
+                            _this.form.checkTotalAmt = _this.moneyDelete(_this.checkTotalAmt);
+                            updateCredit(_this.form).then(response => {
+                                loading.close();
+                                _this.msgSuccess("修改成功");
+                                _this.$store.dispatch("tagsView/delView", _this.$route);
+                                _this.$router.go(-1);
+                            }).catch((response)=>{
+                                loading.close();
+                            });
+                        }).catch((e) => {
+                                loading.close();
+                            });
+                }else{
+                    //应收账款
+                    this.form.ticketList = this.ticketList;
+                    //融信类型
+                    this.form.type = "0";
+                    //合计金额
+                    this.form.checkTotalAmt = this.moneyDelete(this.checkTotalAmt);
+                    updateCredit(this.form).then(response => {
+                        loading.close();
+                        this.msgSuccess("修改成功");
+                        this.$store.dispatch("tagsView/delView", this.$route);
+                        this.$router.go(-1);
+                    }).catch((response)=>{
+                    loading.close();
+                    });
+                }
             }
         });
     },
+    //金额去掉千分位
+    moneyDelete(num){
+            if(num &&num != undefined && num != null){
+                let _num = num;
+                _num = _num.toString();
+                 _num = _num.replace(/,/gi,'');
+                 return _num;
+            }else{
+                return num;
+            }
+    }
        
     }
 };

+ 37 - 0
front-vue/src/views/service/credit/credit.vue

@@ -107,6 +107,16 @@
               @keyup.enter.native="handleQuery"
               />
             </el-form-item>
+            <el-form-item label="状态" prop="zfiStatus">
+              <el-select v-model="queryParams.zfiStatus" placeholder="请选择状态" clearable size="small">
+                <el-option
+                  v-for="dict in stateOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                />
+              </el-select>
+          </el-form-item>
     </el-form>
   </el-card>
   <el-row :gutter="10" class="mb8">
@@ -150,6 +160,7 @@
       <el-table-column label="签发有效期" align="center" prop="zfiEffectiveDate" :show-overflow-tooltip="true" v-if="uncheckList.zfiEffectiveDate"/>
       <el-table-column label="承诺还款日" align="center" prop="zfiExpireDate" :show-overflow-tooltip="true" v-if="uncheckList.zfiExpireDate"/>
       <el-table-column label="签收日期" align="center" prop="zfiSignDate" :show-overflow-tooltip="true" v-if="uncheckList.zfiSignDate"/>
+      <el-table-column label="状态" :formatter="stateFormat" align="center" prop="zfiStatus" :show-overflow-tooltip="true" v-if="uncheckList.zfiStatus"/>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
         <template slot-scope="scope">
           <el-button
@@ -166,6 +177,14 @@
             @click="handleUpdate(scope.row)"
             v-hasPermi="['credit:credit:update']"
           >修改</el-button>
+           <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-view"
+            @click="handleApprove(scope.row)"
+            v-if="scope.row.zfiCreateType != '01' && scope.row.zfiStatus == '00'"
+            v-hasPermi="['credit:credit:approve']"
+          >确权审核</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -212,6 +231,8 @@ export default {
       open: false,
       //融信类型
       typeOptions: [],
+      //状态
+      stateOptions:[],
        //开始金额
       startAmt:undefined,
       //结束金额
@@ -277,6 +298,10 @@ export default {
             {
               label: 'zfiSignDate',
               value: '签收日期'
+            },
+            {
+              label: 'zfiStatus',
+              value: '状态'
             }
             ],
       checkList: [],//筛选列选中的数据列表--显示隐藏列用
@@ -289,12 +314,18 @@ export default {
     this.getDicts("zfi_create_type").then(response => {
       this.typeOptions = response.data;
     });
+    this.getDicts("zc_finance_state").then(response => {
+      this.stateOptions = response.data;
+    });
     this.getList();
   },
   activated () {
     this.getDicts("zfi_create_type").then(response => {
       this.typeOptions = response.data;
     });
+    this.getDicts("zc_finance_state").then(response => {
+      this.stateOptions = response.data;
+    });
     this.getList();
   },  
   mounted() {
@@ -345,6 +376,8 @@ export default {
         zfiSignDate:[],
         zfiExpireDate:[],
         zfiCollectionAccount:null,
+        zfiAmount:''
+
       };
       this.queryParams.startAmt = '';
       this.queryParams.endAmt = '';
@@ -403,6 +436,10 @@ export default {
     typeFormat(row, column) {
       return this.selectDictLabel(this.typeOptions, row.zfiCreateType);
     },
+    //格式化状态
+    stateFormat(row, column) {
+      return this.selectDictLabel(this.stateOptions, row.zfiStatus);
+    },
     //融资开立
     finanOpening(){
         this.reset();

+ 131 - 22
front-vue/src/views/service/credit/creditApply.vue

@@ -113,6 +113,51 @@
                 </el-col>  
             </el-row>      
         </el-form>
+        <!-- 发票附件 -->
+        <el-divider content-position="left">发票附件</el-divider>
+        <el-table :data="invoiceFileList" border style="width: 100%">
+                <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
+        <!-- 合同附件 -->
+        <el-divider content-position="left">合同附件</el-divider>
+        <el-table :data="contractFileList" border style="width: 100%">
+               <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+               <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
+        <!-- 其他附件 -->
+        <el-divider content-position="left">其他附件</el-divider>
+        <el-table :data="otherFileList" border style="width: 100%">
+                <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
         <div class="footer" style="float: right;
             margin-bottom:2px;">
             <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -185,7 +230,7 @@
   </div>
 </template>
 <script>
-import {getAccountsCollection,addCredit} from "@/api/service/credit/credit";
+import {getAccountsCollection,addCredit,getFile} from "@/api/service/credit/credit";
 import {accAdd} from "@/utils/calculation";
 export default {
     name: "creditApply",
@@ -243,6 +288,12 @@ export default {
             checkTotalBigAmt:"零元整",
             //签发金额大写
             issuedAmount:"零元整",
+            //合同附件
+            contractFileList:[],
+            //发票附件
+            invoiceFileList:[],
+            //其他文件
+            otherFileList:[]
           
         };
     },
@@ -280,6 +331,21 @@ export default {
             this.open = true;
             this.payTitle = "应收账款";
         },
+         //获取附件信息
+        getFile(datas){
+            var queryParamsFile = {};
+            queryParamsFile.ticketList = datas;
+            getFile(queryParamsFile).then((response) => {
+                if(response.data){
+                    //获取发票文件
+                     this.invoiceFileList = response.data.invoiceFileList;
+                    //获取合同文件
+                     this.contractFileList = response.data.contractFileList;
+                    //获取其他文件
+                    this.otherFileList = response.data.otherFileList;
+                }
+            });
+        },
         //获取签发金额大写
         getBigSmall(){
             this.issuedAmount = this.smallToBig(this.form.zfiAmount);
@@ -296,6 +362,8 @@ export default {
             });
              //合计
             this.getReTotal(this.ticketList);
+            //附件
+            this.getFile(this.ticketList);
         },
         /* 多选框跨页 */
         rowkey(row) {
@@ -334,6 +402,8 @@ export default {
                 //合计
                 this.getReTotal(this.chooseTicket);
                 this.ticketList = this.chooseTicket;
+                //附件
+                this.getFile(this.ticketList);
                 //开立方赋值
                  this.$set(this.form, "openName",this.chooseTicket[0].payName);
                 this.open = false;
@@ -377,6 +447,8 @@ export default {
         this.issuedAmount = this.smallToBig(this.checkTotalAmt);
         //开立方清空
         this.$set(this.form, "openName","");
+        //附件
+        this.getFile(this.ticketList);
         if(this.$refs.tablePay){
             this.$refs.tablePay.clearSelection();
         }
@@ -492,7 +564,7 @@ export default {
                 });
                 return;
         }
-        if(parseFloat(this.form.zfiAmount) > parseFloat(this.checkTotalAmt)){
+        if(parseFloat(this.form.zfiAmount) > parseFloat(this.moneyDelete(this.checkTotalAmt))){
              this.$message({
                     message: '签发金额不可大于合计金额',
                     type: 'warning'
@@ -501,29 +573,66 @@ export default {
         }
         this.$refs["form"].validate(valid => {
             if (valid) {
-            const loading = this.$loading({
-                lock: true,
-                text: "Loading",
-                spinner: "el-icon-loading",
-                background: "rgba(0, 0, 0, 0.7)",
-            })
-            //应收账款
-            this.form.ticketList = this.ticketList;
-            //融信类型
-            this.form.type = "0";
-            //合计金额
-            this.form.checkTotalAmt = this.checkTotalAmt;
-            addCredit(this.form).then(response => {
-                loading.close();
-                this.msgSuccess("新增成功");
-                this.$store.dispatch("tagsView/delView", this.$route);
-                this.$router.go(-1);
-            }).catch((response)=>{
-            loading.close();
-            });
+               const loading = this.$loading({
+                        lock: true,
+                        text: 'Loading',
+                        background: 'rgba(0, 0, 0,0)'
+                    });   
+            //如果签发金额小于合计金额
+            if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))){
+                        var _this = this;
+                        this.$confirm('签发金额小于应付金额合计,是否确认提交', "警告", {
+                            confirmButtonText: "确定",
+                            cancelButtonText: "取消",
+                            type: "warning"
+                        }).then(function() {
+                            //应收账款
+                            _this.form.ticketList = _this.ticketList;
+                            //融信类型
+                            _this.form.type = "0";
+                            //合计金额
+                            _this.form.checkTotalAmt = _this.moneyDelete(_this.checkTotalAmt);
+                            addCredit(_this.form).then(response => {
+                                loading.close();
+                                _this.msgSuccess("新增成功");
+                                _this.$store.dispatch("tagsView/delView", _this.$route);
+                                _this.$router.go(-1);
+                            }).catch((response)=>{
+                                  loading.close();
+                            });
+                        }).catch((e) => {
+                                    loading.close();
+                            });
+             }else{
+                    //应收账款
+                    this.form.ticketList = this.ticketList;
+                    //融信类型
+                    this.form.type = "0";
+                    //合计金额
+                    this.form.checkTotalAmt = this.moneyDelete(this.checkTotalAmt);
+                    addCredit(this.form).then(response => {
+                        loading.close();
+                        this.msgSuccess("新增成功");
+                        this.$store.dispatch("tagsView/delView", this.$route);
+                        this.$router.go(-1);
+                    }).catch((response)=>{
+                    loading.close();
+                    });
+             }
             }
         });
     },
+    //金额去掉千分位
+    moneyDelete(num){
+            if(num &&num != undefined && num != null){
+                let _num = num;
+                _num = _num.toString();
+                 _num = _num.replace(/,/gi,'');
+                 return _num;
+            }else{
+                return num;
+            }
+    }
        
     }
 };

+ 72 - 4
front-vue/src/views/service/credit/creditDetail.vue

@@ -48,11 +48,11 @@
                         </el-date-picker>
                     </el-form-item>
                 </el-col> 
-                <el-col :span="8">
+                <!-- <el-col :span="8">
                     <el-form-item label="收款账号" prop="zfiCollectionAccount" v-if="isShow">
                          <el-input v-model="form.zfiCollectionAccount" style="width: 200px"/>
                     </el-form-item>
-                </el-col>
+                </el-col> -->
             </el-row>  
             <el-divider content-position="left" >{{tableTitle}}</el-divider>
             <el-form-item  style="margin-left: 100px">
@@ -87,6 +87,51 @@
                 </el-col>  
             </el-row>      
         </el-form>
+          <!-- 发票附件 -->
+        <el-divider content-position="left">发票附件</el-divider>
+        <el-table :data="invoiceFileList" border style="width: 100%">
+                <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
+        <!-- 合同附件 -->
+        <el-divider content-position="left">合同附件</el-divider>
+        <el-table :data="contractFileList" border style="width: 100%">
+               <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+               <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
+        <!-- 其他附件 -->
+        <el-divider content-position="left">其他附件</el-divider>
+        <el-table :data="otherFileList" border style="width: 100%">
+                <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
         <div class="footer" style="float: right;
             margin-bottom:2px;">
             <el-button @click="cancel">取 消</el-button>
@@ -94,7 +139,7 @@
   </div>
 </template>
 <script>
-import {getCreditDetail} from "@/api/service/credit/credit";
+import {getCreditDetail,getFile} from "@/api/service/credit/credit";
 import {accAdd} from "@/utils/calculation";
 export default {
     name: "addCredit",
@@ -125,7 +170,13 @@ export default {
             //控制收款账号是否显示
             isShow:false,
             //获取类型
-            createType:''
+            createType:'',
+            //合同附件
+            contractFileList:[],
+            //发票附件
+            invoiceFileList:[],
+            //其他文件
+            otherFileList:[]
         };
     },
     created() {
@@ -164,6 +215,8 @@ export default {
              if(response.data.payList){
                  this.payList = response.data.payList.records;
                  this.getReTotal(this.payList);
+                 //附件
+                 this.getFile(this.payList);
              }
              
         })
@@ -189,6 +242,21 @@ export default {
                 this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
                 this.checkTotalAmt = this.amtFormat(this.checkTotalAmt);
     },
+    //获取附件信息
+    getFile(datas){
+            var queryParamsFile = {};
+            queryParamsFile.ticketList = datas;
+            getFile(queryParamsFile).then((response) => {
+                if(response.data){
+                    //获取发票文件
+                     this.invoiceFileList = response.data.invoiceFileList;
+                    //获取合同文件
+                     this.contractFileList = response.data.contractFileList;
+                    //获取其他文件
+                    this.otherFileList = response.data.otherFileList;
+                }
+            });
+        },
     //格式化金额 
     amtFormat(cellValue) {
       if(cellValue == null || cellValue== undefined || cellValue == ''){

+ 146 - 28
front-vue/src/views/service/credit/creditUpdate.vue

@@ -135,6 +135,51 @@
                 </el-col>  
             </el-row>      
         </el-form>
+        <!-- 发票附件 -->
+        <el-divider content-position="left">发票附件</el-divider>
+        <el-table :data="invoiceFileList" border style="width: 100%">
+                <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
+        <!-- 合同附件 -->
+        <el-divider content-position="left">合同附件</el-divider>
+        <el-table :data="contractFileList" border style="width: 100%">
+               <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+               <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
+        <!-- 其他附件 -->
+        <el-divider content-position="left">其他附件</el-divider>
+        <el-table :data="otherFileList" border style="width: 100%">
+                <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
         <div class="footer" style="float: right;
             margin-bottom:2px;">
             <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -207,7 +252,7 @@
   </div>
 </template>
 <script>
-import {getCreditDetail,getReceiverList,listCreditLine,getAvailableBalance,getAccountsPay,updateCredit} from "@/api/service/credit/credit";
+import {getCreditDetail,getReceiverList,listCreditLine,getAvailableBalance,getAccountsPay,updateCredit,getFile} from "@/api/service/credit/credit";
 import {accAdd} from "@/utils/calculation";
 export default {
     name: "addCredit",
@@ -313,6 +358,12 @@ export default {
                 zfpcrId:null,
                 type:'1'
             },
+          //合同附件
+          contractFileList:[],
+          //发票附件
+          invoiceFileList:[],
+          //其他文件
+          otherFileList:[]   
         };
     },
     watch:{
@@ -334,6 +385,8 @@ export default {
              if(response.data.payList){
                  this.ticketList = response.data.payList.records;
                  this.getReTotal(this.ticketList);
+                 //附件
+                 this.getFile(this.ticketList);
              }
              
         })
@@ -358,6 +411,21 @@ export default {
                 this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
                 this.checkTotalAmt = this.amtFormat(this.checkTotalAmt);
         },
+        //获取附件信息
+        getFile(datas){
+            var queryParamsFile = {};
+            queryParamsFile.ticketList = datas;
+            getFile(queryParamsFile).then((response) => {
+                if(response.data){
+                    //获取发票文件
+                     this.invoiceFileList = response.data.invoiceFileList;
+                    //获取合同文件
+                     this.contractFileList = response.data.contractFileList;
+                    //获取其他文件
+                    this.otherFileList = response.data.otherFileList;
+                }
+            });
+        },
         resetQuerys() {
             this.resetForm("formQuery");
             this.handleQuerys();
@@ -408,6 +476,8 @@ export default {
             });
              //合计
             this.getReTotal(this.ticketList);
+            //附件
+             this.getFile(this.ticketList);
         },
         /* 删除按钮 */
         handleDelete(index, rows) {
@@ -454,6 +524,8 @@ export default {
                 //合计
                 this.getReTotal(this.chooseTicket);
                 this.ticketList = this.chooseTicket;
+                //更新附件信息
+                this.getFile(this.ticketList);
                 this.open = false;
         }else{
             this.$message({
@@ -488,6 +560,8 @@ export default {
         if(this.$refs.tablePay){
             this.$refs.tablePay.clearSelection();
         }
+        //更新附件
+        this.getFile(this.ticketList);
     },
     /* 删除按钮 */
     handleDelete(index, rows) {
@@ -642,35 +716,79 @@ export default {
     submitForm(){
         this.$refs["form"].validate(valid => {
             if (valid) {
-            const loading = this.$loading({
-                lock: true,
-                text: "Loading",
-                spinner: "el-icon-loading",
-                background: "rgba(0, 0, 0, 0.7)",
-            })
-            //应付账款
-            this.form.ticketList = this.ticketList;
-            //产品是否可拆分
-            this.form.zfpSplit = this.zfpSplit;
-            //放款方式
-            this.form.zfpcrLoanType = this.zfpcrLoanType;
-            //产品
-            this.form.zfpId = this.zfpId;
-            //利率
-            this.form.zfiRate = this.zfiRate;
-            //融信类型
-            this.form.type = "1";
-            updateCredit(this.form).then(response => {
-                loading.close();
-                this.msgSuccess("修改成功");
-                this.$store.dispatch("tagsView/delView", this.$route);
-                this.$router.go(-1);
-            }).catch((response)=>{
-            loading.close();
-            });
+                const loading = this.$loading({
+                    lock: true,
+                    text: 'Loading',
+                    background: 'rgba(0, 0, 0,0)'
+                }); 
+            //如果签发金额小于合计金额
+            if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))){
+                        var _this = this;
+                        this.$confirm('签发金额小于应付金额合计,是否确认提交', "警告", {
+                            confirmButtonText: "确定",
+                            cancelButtonText: "取消",
+                            type: "warning"
+                        }).then(function() {
+                           //应付账款
+                            _this.form.ticketList = _this.ticketList;
+                            //产品是否可拆分
+                            _this.form.zfpSplit = _this.zfpSplit;
+                            //放款方式
+                            _this.form.zfpcrLoanType = _this.zfpcrLoanType;
+                            //产品
+                            _this.form.zfpId = _this.zfpId;
+                            //利率
+                            _this.form.zfiRate = _this.zfiRate;
+                            //融信类型
+                            _this.form.type = "1";
+                            updateCredit(_this.form).then(response => {
+                                loading.close();
+                                _this.msgSuccess("修改成功");
+                                _this.$store.dispatch("tagsView/delView", _this.$route);
+                                _this.$router.go(-1);
+                            }).catch((response)=>{
+                                loading.close();
+                            });
+                        }).catch((e) => {
+                                loading.close();
+                            });
+
+            }else{
+                    //应付账款
+                    this.form.ticketList = this.ticketList;
+                    //产品是否可拆分
+                    this.form.zfpSplit = this.zfpSplit;
+                    //放款方式
+                    this.form.zfpcrLoanType = this.zfpcrLoanType;
+                    //产品
+                    this.form.zfpId = this.zfpId;
+                    //利率
+                    this.form.zfiRate = this.zfiRate;
+                    //融信类型
+                    this.form.type = "1";
+                    updateCredit(this.form).then(response => {
+                        loading.close();
+                        this.msgSuccess("修改成功");
+                        this.$store.dispatch("tagsView/delView", this.$route);
+                        this.$router.go(-1);
+                    }).catch((response)=>{
+                        loading.close();
+                    });
+            }
             }
         });
-    },   
+    }, 
+     //金额去掉千分位
+    moneyDelete(num){
+            if(num &&num != undefined && num != null){
+                let _num = num;
+                _num = _num.toString();
+                _num = _num.replace(/,/gi,'');
+                return _num;
+            }else{
+                return num;
+            }
+    }  
     
   }
 };

+ 156 - 37
front-vue/src/views/service/credit/financeOpen.vue

@@ -97,11 +97,11 @@
                          <el-input v-model="form.zfiAmount" style="width: 200px" @input="getBigSmall" />
                     </el-form-item>
                 </el-col>
-                 <el-col :span="8">
+                <!--  <el-col :span="8">
                         <el-form-item label="收款账号" prop="zfiCollectionAccount" v-if="zfpcrLoanType != '0'">
                             <el-input v-model="form.zfiCollectionAccount" style="width: 200px" />
                         </el-form-item>
-                </el-col>  
+                </el-col> -->  
             </el-row>
             <el-row>
                 <el-col :span="8">
@@ -111,6 +111,51 @@
                 </el-col>  
             </el-row>      
         </el-form>
+          <!-- 发票附件 -->
+        <el-divider content-position="left">发票附件</el-divider>
+        <el-table :data="invoiceFileList" border style="width: 100%">
+                <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
+        <!-- 合同附件 -->
+        <el-divider content-position="left">合同附件</el-divider>
+        <el-table :data="contractFileList" border style="width: 100%">
+               <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+               <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
+        <!-- 其他附件 -->
+        <el-divider content-position="left">其他附件</el-divider>
+        <el-table :data="otherFileList" border style="width: 100%">
+                <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
         <div class="footer" style="float: right;
             margin-bottom:2px;">
             <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -183,7 +228,7 @@
   </div>
 </template>
 <script>
-import {listSupplierCreditLine,getAccountsCollection,getSupplierAvailableBalance,addCredit} from "@/api/service/credit/credit";
+import {listSupplierCreditLine,getAccountsCollection,getSupplierAvailableBalance,addCredit,getFile} from "@/api/service/credit/credit";
 import {getRandom} from "@/api/common/getRandom";
 import {accAdd} from "@/utils/calculation";
 export default {
@@ -291,7 +336,13 @@ export default {
             //产品编号
             zfpId:"",
             //利率
-            zfpcrRate:''
+            zfpcrRate:'',
+            //合同附件
+            contractFileList:[],
+            //发票附件
+            invoiceFileList:[],
+            //其他文件
+            otherFileList:[]
         };
     },
     created() {
@@ -373,6 +424,23 @@ export default {
             });
              //合计
             this.getReTotal(this.ticketList);
+            //附件
+            this.getFile(this.ticketList);
+        },
+        //获取附件信息
+        getFile(datas){
+            var queryParamsFile = {};
+            queryParamsFile.ticketList = datas;
+            getFile(queryParamsFile).then((response) => {
+                if(response.data){
+                    //获取发票文件
+                     this.invoiceFileList = response.data.invoiceFileList;
+                    //获取合同文件
+                     this.contractFileList = response.data.contractFileList;
+                    //获取其他文件
+                    this.otherFileList = response.data.otherFileList;
+                }
+            });
         },
         /* 多选框跨页 */
         rowkey(row) {
@@ -411,6 +479,8 @@ export default {
                 //合计
                 this.getReTotal(this.chooseTicket);
                 this.ticketList = this.chooseTicket;
+                //更新附件信息
+                this.getFile(this.ticketList);
                 //开立方赋值
                  this.$set(this.form, "openName",this.chooseTicket[0].payName);
                 this.open = false;
@@ -457,6 +527,8 @@ export default {
         if(this.$refs.tablePay){
             this.$refs.tablePay.clearSelection();
         }
+        //更新附件
+        this.getFile(this.ticketList);
     },
     /* 删除按钮 */
     handleDelete(index, rows) {
@@ -616,7 +688,7 @@ export default {
                 return;
         }
         //放款方式==指定供应商时收款账号必输
-        if("1"== this.zfpcrLoanType){
+       /*  if("1"== this.zfpcrLoanType){
             if(!this.form.zfiCollectionAccount){
                 this.$message({
                     message: '请输入收款账号',
@@ -624,7 +696,7 @@ export default {
                 });
                 return;
             }
-        }
+        } */
 
         if(parseFloat(this.form.zfiAmount) > parseFloat(this.availableAmt)){
              this.$message({
@@ -633,7 +705,7 @@ export default {
                 });
                 return;
         }
-        if(parseFloat(this.form.zfiAmount) > parseFloat(this.checkTotalAmt)){
+        if(parseFloat(this.form.zfiAmount) > parseFloat(this.moneyDelete(this.checkTotalAmt))){
              this.$message({
                     message: '签发金额不可大于合计金额',
                     type: 'warning'
@@ -642,39 +714,86 @@ export default {
         }
         this.$refs["form"].validate(valid => {
             if (valid) {
-            const loading = this.$loading({
-                lock: true,
-                text: "Loading",
-                spinner: "el-icon-loading",
-                background: "rgba(0, 0, 0, 0.7)",
-            })
-            //应收账款
-            this.form.ticketList = this.ticketList;
-            //产品是否可拆分
-            this.form.zfpSplit = this.zfpSplit;
-            //放款方式
-            this.form.zfpcrLoanType = this.zfpcrLoanType;
-            //融信类型
-            this.form.type = "2";
-            //利率
-            this.form.zfiRate = this.zfpcrRate;
-            //产品
-            this.form.zfpId = this.zfpId;
-            //可用额度
-            this.form.availableAmt = this.availableAmt;
-            //合计金额
-            this.form.checkTotalAmt = this.checkTotalAmt;
-            addCredit(this.form).then(response => {
-                loading.close();
-                this.msgSuccess("新增成功");
-                this.$store.dispatch("tagsView/delView", this.$route);
-                this.$router.go(-1);
-            }).catch((response)=>{
-            loading.close();
-            });
+                 const loading = this.$loading({
+                        lock: true,
+                        text: 'Loading',
+                        background: 'rgba(0, 0, 0,0)'
+                    })
+            //签发金额小于合计金额
+            if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))){
+                        var _this = this;
+                        this.$confirm('签发金额小于应付金额合计,是否确认提交', "警告", {
+                            confirmButtonText: "确定",
+                            cancelButtonText: "取消",
+                            type: "warning"
+                        }).then(function() {
+                            //应收账款
+                            _this.form.ticketList = _this.ticketList;
+                            //产品是否可拆分
+                            _this.form.zfpSplit = _this.zfpSplit;
+                            //放款方式
+                            _this.form.zfpcrLoanType = _this.zfpcrLoanType;
+                            //融信类型
+                            _this.form.type = "2";
+                            //利率
+                            _this.form.zfiRate = _this.zfpcrRate;
+                            //产品
+                            _this.form.zfpId = _this.zfpId;
+                            //可用额度
+                            _this.form.availableAmt = _this.availableAmt;
+                            //合计金额
+                            _this.form.checkTotalAmt = _this.moneyDelete(_this.checkTotalAmt);
+                            addCredit(_this.form).then(response => {
+                                loading.close();
+                                _this.msgSuccess("新增成功");
+                                _this.$store.dispatch("tagsView/delView", _this.$route);
+                                _this.$router.go(-1);
+                            }).catch((response)=>{
+                                 loading.close();
+                            });
+                        }).catch((e) => {
+                                loading.close();
+                            });
+            }else{
+                //应收账款
+                this.form.ticketList = this.ticketList;
+                //产品是否可拆分
+                this.form.zfpSplit = this.zfpSplit;
+                //放款方式
+                this.form.zfpcrLoanType = this.zfpcrLoanType;
+                //融信类型
+                this.form.type = "2";
+                //利率
+                this.form.zfiRate = this.zfpcrRate;
+                //产品
+                this.form.zfpId = this.zfpId;
+                //可用额度
+                this.form.availableAmt = this.availableAmt;
+                //合计金额
+                this.form.checkTotalAmt = this.moneyDelete(this.checkTotalAmt);
+                addCredit(this.form).then(response => {
+                    loading.close();
+                    this.msgSuccess("新增成功");
+                    this.$store.dispatch("tagsView/delView", this.$route);
+                    this.$router.go(-1);
+                }).catch((response)=>{
+                    loading.close();
+                });
+            }
             }
         });
     },
+    //金额去掉千分位
+    moneyDelete(num){
+            if(num &&num != undefined && num != null){
+                let _num = num;
+                _num = _num.toString();
+                 _num = _num.replace(/,/gi,'');
+                 return _num;
+            }else{
+                return num;
+            }
+    }
        
     }
 };

+ 165 - 41
front-vue/src/views/service/credit/financeOpenUpdate.vue

@@ -114,11 +114,11 @@
                          <el-input v-model="form.zfiAmount" style="width: 200px" @input="getBigSmall" />
                     </el-form-item>
                 </el-col>
-                 <el-col :span="8">
+                <!--  <el-col :span="8">
                         <el-form-item label="收款账号" prop="zfiCollectionAccount" v-if="zfpcrLoanType != '0'">
                             <el-input v-model="form.zfiCollectionAccount" style="width: 200px" />
                         </el-form-item>
-                </el-col>  
+                </el-col> -->  
             </el-row>
             <el-row>
                 <el-col :span="8">
@@ -128,6 +128,51 @@
                 </el-col>  
             </el-row>      
         </el-form>
+        <!-- 发票附件 -->
+        <el-divider content-position="left">发票附件</el-divider>
+        <el-table :data="invoiceFileList" border style="width: 100%">
+                <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
+        <!-- 合同附件 -->
+        <el-divider content-position="left">合同附件</el-divider>
+        <el-table :data="contractFileList" border style="width: 100%">
+               <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+               <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
+        <!-- 其他附件 -->
+        <el-divider content-position="left">其他附件</el-divider>
+        <el-table :data="otherFileList" border style="width: 100%">
+                <el-table-column label="文件名称" align="center" prop="pfiFileName" show-overflow-tooltip />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
+                    <template slot-scope="scope">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-view"
+                            @click="handleDetail(scope.row)"
+                        >下载</el-button>
+                    </template>
+                </el-table-column>
+        </el-table>
         <div class="footer" style="float: right;
             margin-bottom:2px;">
             <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -200,7 +245,7 @@
   </div>
 </template>
 <script>
-import {listSupplierCreditLine,getCreditDetail,getAccountsCollection,getSupplierAvailableBalance,updateCredit} from "@/api/service/credit/credit";
+import {listSupplierCreditLine,getCreditDetail,getAccountsCollection,getSupplierAvailableBalance,updateCredit,getFile} from "@/api/service/credit/credit";
 import {accAdd} from "@/utils/calculation";
 export default {
     name: "addCredit",
@@ -310,7 +355,13 @@ export default {
             //产品编号
             zfpId:"",
             //利率
-            zfpcrRate:''
+            zfpcrRate:'',
+            //合同附件
+            contractFileList:[],
+            //发票附件
+            invoiceFileList:[],
+            //其他文件
+            otherFileList:[]
         };
     },
     watch:{
@@ -325,6 +376,8 @@ export default {
              if(response.data.payList){
                  this.ticketList = response.data.payList.records;
                  this.getReTotal(this.ticketList);
+                //附件
+                 this.getFile(this.ticketList);
              }
              
         })
@@ -404,6 +457,23 @@ export default {
             });
              //合计
             this.getReTotal(this.ticketList);
+             //附件
+            this.getFile(this.ticketList);
+        },
+        //获取附件信息
+        getFile(datas){
+            var queryParamsFile = {};
+            queryParamsFile.ticketList = datas;
+            getFile(queryParamsFile).then((response) => {
+                if(response.data){
+                    //获取发票文件
+                     this.invoiceFileList = response.data.invoiceFileList;
+                    //获取合同文件
+                     this.contractFileList = response.data.contractFileList;
+                    //获取其他文件
+                    this.otherFileList = response.data.otherFileList;
+                }
+            });
         },
         /* 多选框跨页 */
         rowkey(row) {
@@ -442,6 +512,8 @@ export default {
                 //合计
                 this.getReTotal(this.chooseTicket);
                 this.ticketList = this.chooseTicket;
+                //附件
+                this.getFile(this.ticketList);
                 //开立方赋值
                  this.$set(this.form, "openName",this.chooseTicket[0].payName);
                 this.open = false;
@@ -461,9 +533,9 @@ export default {
                         this.checkTotalAmt  = accAdd(this.checkTotalAmt,chooseTicket[i].zbiAmount,2);
                 }
                 //签发金额
-                this.$set(this.form, "zfiAmount",this.checkTotalAmt);
+               // this.$set(this.form, "zfiAmount",this.checkTotalAmt);
                 //签发金额大写
-                this.issuedAmount = this.smallToBig(this.checkTotalAmt);
+                //this.issuedAmount = this.smallToBig(this.checkTotalAmt);
                 this.checkTotalBigAmt = this.smallToBig(this.checkTotalAmt);
                 this.checkTotalAmt = this.amtFormat(this.checkTotalAmt);
     },
@@ -485,6 +557,7 @@ export default {
         if(this.$refs.tablePay){
             this.$refs.tablePay.clearSelection();
         }
+        this.getFile(this.ticketList);
     },
     /* 删除按钮 */
     handleDelete(index, rows) {
@@ -644,7 +717,7 @@ export default {
                 return;
         }
         //放款方式==指定供应商时收款账号必输
-        if("1"== this.zfpcrLoanType){
+       /*  if("1"== this.zfpcrLoanType){
             if(!this.form.zfiCollectionAccount){
                 this.$message({
                     message: '请输入收款账号',
@@ -652,7 +725,7 @@ export default {
                 });
                 return;
             }
-        }
+        } */
         if(parseFloat(this.form.zfiAmount) > parseFloat(this.availableAmt)){
              this.$message({
                     message: '签发金额不可大于可用金额',
@@ -660,7 +733,7 @@ export default {
                 });
                 return;
         }
-        if(parseFloat(this.form.zfiAmount) > parseFloat(this.checkTotalAmt)){
+        if(parseFloat(this.form.zfiAmount) > parseFloat(this.moneyDelete(this.checkTotalAmt))){
              this.$message({
                     message: '签发金额不可大于合计金额',
                     type: 'warning'
@@ -669,41 +742,92 @@ export default {
         }
         this.$refs["form"].validate(valid => {
             if (valid) {
-            const loading = this.$loading({
-                lock: true,
-                text: "Loading",
-                spinner: "el-icon-loading",
-                background: "rgba(0, 0, 0, 0.7)",
-            })
-            //应收账款
-            this.form.ticketList = this.ticketList;
-            //产品是否可拆分
-            this.form.zfpSplit = this.zfpSplit;
-            //放款方式
-            this.form.zfpcrLoanType = this.zfpcrLoanType;
-            //融信类型
-            this.form.type = "2";
-            //利率
-            this.form.zfsqRate = this.zfsqRate;
-            //产品
-            this.form.zfpId = this.zfpId;
-            //可用额度
-            this.form.availableAmt = this.availableAmt;
-            //合计金额
-            this.form.checkTotalAmt = this.checkTotalAmt;
-            //利率
-            this.form.zfiRate = this.zfpcrRate;
-            updateCredit(this.form).then(response => {
-                loading.close();
-                this.msgSuccess("修改成功");
-                this.$store.dispatch("tagsView/delView", this.$route);
-                this.$router.go(-1);
-            }).catch((response)=>{
-            loading.close();
-            });
+                 const loading = this.$loading({
+                        lock: true,
+                        text: 'Loading',
+                        background: 'rgba(0, 0, 0,0)'
+                    }); 
+            //签发金额小于合计金额
+            if((parseFloat(this.form.zfiAmount)) < (parseFloat(this.moneyDelete(this.checkTotalAmt)))){
+                        var _this = this;
+                        this.$confirm('签发金额小于应付金额合计,是否确认提交', "警告", {
+                            confirmButtonText: "确定",
+                            cancelButtonText: "取消",
+                            type: "warning"
+                        }).then(function() {
+                             //应收账款
+                            _this.form.ticketList = _this.ticketList;
+                            //产品是否可拆分
+                            _this.form.zfpSplit = _this.zfpSplit;
+                            //放款方式
+                            _this.form.zfpcrLoanType = _this.zfpcrLoanType;
+                            //融信类型
+                            _this.form.type = "2";
+                            //利率
+                            _this.form.zfsqRate = _this.zfsqRate;
+                            //产品
+                            _this.form.zfpId = _this.zfpId;
+                            //可用额度
+                            _this.form.availableAmt = _this.availableAmt;
+                            //合计金额
+                            _this.form.checkTotalAmt = _this.moneyDelete(_this.checkTotalAmt);
+                            //利率
+                            _this.form.zfiRate = _this.zfpcrRate;
+                            updateCredit(_this.form).then(response => {
+                                loading.close();
+                                _this.msgSuccess("修改成功");
+                                _this.$store.dispatch("tagsView/delView", _this.$route);
+                                _this.$router.go(-1);
+                            }).catch((response)=>{
+                                loading.close();
+                            });
+                        }).catch((e) => {
+                                loading.close();
+                            });
+
+            }else{
+                 //应收账款
+                this.form.ticketList = this.ticketList;
+                //产品是否可拆分
+                this.form.zfpSplit = this.zfpSplit;
+                //放款方式
+                this.form.zfpcrLoanType = this.zfpcrLoanType;
+                //融信类型
+                this.form.type = "2";
+                //利率
+                this.form.zfsqRate = this.zfsqRate;
+                //产品
+                this.form.zfpId = this.zfpId;
+                //可用额度
+                this.form.availableAmt = this.availableAmt;
+                //合计金额
+                this.form.checkTotalAmt = this.moneyDelete(this.checkTotalAmt);
+                //利率
+                this.form.zfiRate = this.zfpcrRate;
+                updateCredit(this.form).then(response => {
+                    loading.close();
+                    this.msgSuccess("修改成功");
+                    this.$store.dispatch("tagsView/delView", this.$route);
+                    this.$router.go(-1);
+                }).catch((response)=>{
+                    loading.close();
+                });
+            }
+           
             }
         });
     },
+    //金额去掉千分位
+    moneyDelete(num){
+            if(num &&num != undefined && num != null){
+                let _num = num;
+                _num = _num.toString();
+                 _num = _num.replace(/,/gi,'');
+                 return _num;
+            }else{
+                return num;
+            }
+    }
        
     }
 };