|
@@ -22,6 +22,7 @@
|
|
|
<el-row>
|
|
|
<el-divider content-position="left" >应收账款</el-divider>
|
|
|
<el-form-item style="margin-left: 100px">
|
|
|
+ <el-button size="mini" type="success" @click="addPay">新增应收账款</el-button>
|
|
|
<el-button size="mini" type="primary" @click="openTicket">选择</el-button>
|
|
|
<el-button size="mini" @click="deleteTicekt">清空全部</el-button>
|
|
|
<el-form-item label="合计金额:">
|
|
@@ -260,6 +261,12 @@
|
|
|
<el-button size="mini" type="primary" @click="closeTicket">确认</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 新增往来账款 -->
|
|
|
+ <el-dialog title="新增往来账款" :visible.sync="openAddBill" width="1120px" append-to-body>
|
|
|
+ <add-bill :companyId="form.zfiCoreId" companyType="01" @addClick="emitAddClick"></add-bill>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!--预览-->
|
|
|
<el-dialog :visible.sync="openFile" width="1000px" append-to-body>
|
|
|
<img :src="wordUrl" v-if="show" width='450px' height='500px'/>
|
|
@@ -271,9 +278,10 @@
|
|
|
import {getFile,getCreditDetail,getAccountsCollection,updateCredit} from "@/api/service/credit/credit";
|
|
|
import {accAdd} from "@/utils/calculation";
|
|
|
import {getToken} from "@/utils/auth";
|
|
|
+import AddBill from "@/views/service/bill/addBill";
|
|
|
export default {
|
|
|
name: "addCredit",
|
|
|
- components: {},
|
|
|
+ components: {AddBill},
|
|
|
data() {
|
|
|
return {
|
|
|
// 总条数
|
|
@@ -350,6 +358,7 @@ export default {
|
|
|
},
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
+ openAddBill: false,
|
|
|
//授信
|
|
|
creditLineList:[],
|
|
|
//接收方
|
|
@@ -389,7 +398,8 @@ export default {
|
|
|
openFile:false,
|
|
|
wordUrl: "",
|
|
|
show:false,
|
|
|
- heid:false
|
|
|
+ heid:false,
|
|
|
+ chooseTicket:[]
|
|
|
};
|
|
|
},
|
|
|
watch:{
|
|
@@ -404,6 +414,8 @@ export default {
|
|
|
this.form.receiveName = response.data.receiveName;
|
|
|
//开立方
|
|
|
this.form.openName = response.data.openName;
|
|
|
+ //开立方
|
|
|
+ this.form.zfiCoreId = response.data.zfiCoreId;
|
|
|
//创建人
|
|
|
this.form.createName = response.data.createName;
|
|
|
//签发金额大写
|
|
@@ -427,10 +439,11 @@ export default {
|
|
|
},
|
|
|
//应收账款查询列表
|
|
|
getAccountsCollection() {
|
|
|
- getAccountsCollection(this.queryParamsPay).then((response) => {
|
|
|
+ return getAccountsCollection(this.queryParamsPay).then((response) => {
|
|
|
this.payList = response.data.records;
|
|
|
this.selectChecked();
|
|
|
this.total = response.data.total;
|
|
|
+ return Promise.resolve(response)
|
|
|
});
|
|
|
},
|
|
|
//获取附件信息
|
|
@@ -508,6 +521,7 @@ export default {
|
|
|
// 确认选择
|
|
|
closeTicket() {
|
|
|
if(this.chooseTicket){
|
|
|
+ var flag = true;
|
|
|
//如果长度大于1,则需要进行对比应收企业和预计还款日期是否一致
|
|
|
if(this.chooseTicket.length > 1){
|
|
|
//获取选中第一个的应付企业
|
|
@@ -516,28 +530,32 @@ export default {
|
|
|
var zbiPayDate = this.chooseTicket[0].zbiPayDate;
|
|
|
for(var i = 0 ;i < this.chooseTicket.length;i++){
|
|
|
if(payName != this.chooseTicket[i].payName){
|
|
|
- this.$message({
|
|
|
- message: '请选择应付企业相同的应付账款',
|
|
|
- type: 'warning'
|
|
|
- });
|
|
|
- return;
|
|
|
+ flag = false
|
|
|
+ this.$message({
|
|
|
+ message: '请选择应付企业相同的应付账款',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return false;
|
|
|
}
|
|
|
if(zbiPayDate != this.chooseTicket[i].zbiPayDate){
|
|
|
- this.$message({
|
|
|
- message: '请选择预计还款日期相同的应付账款',
|
|
|
- type: 'warning'
|
|
|
- });
|
|
|
- return;
|
|
|
+ flag = false
|
|
|
+ this.$message({
|
|
|
+ message: '请选择预计还款日期相同的应付账款',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //合计
|
|
|
- this.getReTotal(this.chooseTicket);
|
|
|
- this.ticketList = this.chooseTicket;
|
|
|
- //附件
|
|
|
- this.getFile(this.ticketList);
|
|
|
- //开立方赋值
|
|
|
- this.$set(this.form, "openName",this.chooseTicket[0].payName);
|
|
|
+ if(flag){
|
|
|
+ //合计
|
|
|
+ this.getReTotal(this.chooseTicket);
|
|
|
+ this.ticketList = this.chooseTicket;
|
|
|
+ //更新附件信息
|
|
|
+ this.getFile(this.ticketList);
|
|
|
+ //开立方赋值
|
|
|
+ this.$set(this.form, "openName",this.chooseTicket[0].payName);
|
|
|
+ }
|
|
|
this.open = false;
|
|
|
}else{
|
|
|
this.$message({
|
|
@@ -813,6 +831,34 @@ export default {
|
|
|
this.input=e.target.value
|
|
|
this.form.zfiAmount=this.input
|
|
|
},
|
|
|
+ //新增应付
|
|
|
+ addPay(){
|
|
|
+ if(this.form.zfiCoreId){
|
|
|
+ this.openAddBill = true
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: "开立方不能为空",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //新增账款回调
|
|
|
+ emitAddClick(val){
|
|
|
+ var self = this
|
|
|
+ this.getAccountsCollection().then((response) => {
|
|
|
+ //新增付款返回id直接选中
|
|
|
+ if (val) {
|
|
|
+ self.payList.forEach(element => {
|
|
|
+ if(element.zbiId == val){
|
|
|
+ // 将当前点击项选中
|
|
|
+ self.chooseTicket.push(element)
|
|
|
+ self.closeTicket()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ self.openAddBill = false
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|