|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-button size="mini" type="primary" @click="dialogFormVisible = true">添 加</el-button>
|
|
|
- <el-drawer title="添加经销商" size="70%" append-to-body :show-close="false" :visible.sync="dialogFormVisible">
|
|
|
+ <el-button size="mini" type="primary" @click="onShow">添 加</el-button>
|
|
|
+ <el-drawer title="添加经销商" size="70%" append-to-body :show-close="false" :visible.sync="dialogFormVisible" @close="onClose">
|
|
|
<div class="drawer__panel">
|
|
|
<el-row :gutter="20">
|
|
|
<el-form :model="form" :rules="rules" ref="form" label-width="90px" label-position="right" size="mini">
|
|
|
@@ -59,7 +59,7 @@
|
|
|
label="账户类型"
|
|
|
width="250">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-select size="small" @focus="accountSelect(scope.row)" v-model="scope.row.sa_accountclassid" placeholder="请选择账户类型">
|
|
|
+ <el-select size="small" @focus="accountSelect(scope.row)" v-model="scope.row.sa_accountclassid" placeholder="请选择账户类型" @change="onChange(scope.row,scope.$index)">
|
|
|
<el-option
|
|
|
v-for="item in accountList"
|
|
|
:key="item.sa_accountclassid"
|
|
|
@@ -76,6 +76,13 @@
|
|
|
<el-input type="text" size="small" placeholder="额度" v-model.number="scope.row.creditquota"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="creditquota"
|
|
|
+ label="历史信用额度" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input type="text" size="small" placeholder="历史额度" v-model.number="scope.row.historyCreditquota"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="remarks"
|
|
|
label="备注">
|
|
|
@@ -90,7 +97,7 @@
|
|
|
<el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">提 交</el-button>
|
|
|
</div>
|
|
|
</el-drawer>
|
|
|
-
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -102,7 +109,7 @@ export default {
|
|
|
dialogFormVisible2:false,
|
|
|
accountList:[],
|
|
|
form:{
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
rules:{
|
|
|
},
|
|
|
@@ -129,26 +136,34 @@ export default {
|
|
|
"sa_creditbillid":this.$route.query.id
|
|
|
}
|
|
|
},
|
|
|
- selectArr:[]
|
|
|
+ selectArr:[],
|
|
|
+ historyCreditquota:'',
|
|
|
}
|
|
|
},
|
|
|
components:{selectEnterpise},
|
|
|
methods:{
|
|
|
+ onShow(){
|
|
|
+ this.dialogFormVisible = true
|
|
|
+ this.getEnterpriseData()
|
|
|
+ },
|
|
|
// /* 获取企业档案 */
|
|
|
async getEnterpriseData() {
|
|
|
let res = await this.$api.requested(this.params)
|
|
|
this.total = res.total
|
|
|
this.list = res.data
|
|
|
- console.log(this.list);
|
|
|
+
|
|
|
+ this.selectArr = []
|
|
|
+
|
|
|
},
|
|
|
async getAccountList () {
|
|
|
this.accountParam.content.sa_creditbillid = this.$route.query.id
|
|
|
let res = await this.$api.requested(this.accountParam)
|
|
|
this.accountList = res.data
|
|
|
- console.log(this.accountList);
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
async onSubmit () {
|
|
|
+
|
|
|
let is = this.selectArr.every(item => item.sa_accountclassid && (item.creditquota || item.creditquota === 0))
|
|
|
if (is) {
|
|
|
let data = this.selectArr.map(item => {
|
|
|
@@ -173,6 +188,7 @@ export default {
|
|
|
this.$refs['form'].resetFields();
|
|
|
this.dialogFormVisible2 = false
|
|
|
this.dialogFormVisible = false
|
|
|
+ this.selsectAccount = false
|
|
|
})
|
|
|
} else {
|
|
|
this.$message({
|
|
|
@@ -180,11 +196,11 @@ export default {
|
|
|
message:'请填写完整信息'
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
accountSelect (data) {
|
|
|
- console.log('触发');
|
|
|
-
|
|
|
+ console.log('触发',data);
|
|
|
+
|
|
|
this.accountParam.content.sys_enterpriseid=data.sys_enterpriseid
|
|
|
this.getAccountList()
|
|
|
},
|
|
|
@@ -204,9 +220,40 @@ export default {
|
|
|
this.params.content.pageNumber = val
|
|
|
this.getEnterpriseData()
|
|
|
},
|
|
|
+ /*查询信用额度*/
|
|
|
+ async queryBalance(accountno,data,index){
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "accesstoken": "825a4e9348176c31a66b78289f8e8d26",
|
|
|
+ "id": 20221008145903,
|
|
|
+ "content": {
|
|
|
+ "where": {
|
|
|
+ "sys_enterpriseid": this.accountParam.content.sys_enterpriseid,
|
|
|
+ "accountno": accountno
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ data.historyCreditquota = res.data[0].creditquota
|
|
|
+ this.$set(this.selectArr,index,data)
|
|
|
+ },
|
|
|
+ /*选择账号类型*/
|
|
|
+ onChange(data,index){
|
|
|
+
|
|
|
+ this.selsectAccount = true
|
|
|
+ this.accountList.forEach(item=>{
|
|
|
+ if (item.sa_accountclassid === data.sa_accountclassid){
|
|
|
+ this.queryBalance(item.accountno,data,index)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onClose(){
|
|
|
+ this.historyCreditquota = ''
|
|
|
+ this.$refs['form'].resetFields();
|
|
|
+ this.dialogFormVisible2 = false
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.selsectAccount = false
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
- this.getEnterpriseData()
|
|
|
this.tablecols = this.tool.tabelCol(this.$route.name).addEnterpriseTable.tablecols
|
|
|
},
|
|
|
mounted () {
|
|
|
@@ -218,4 +265,4 @@ export default {
|
|
|
/deep/.el-select {
|
|
|
width: 100%!important;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|