Commit 784cdcda authored by 我在何方's avatar 我在何方

收款单优化

parent 70f87732
......@@ -393,10 +393,9 @@
<span v-if="amount"> {{amount}}{{getCurrencyLabel(currency)}}</span>
</div>
</div>
</el-form-item>
<el-form-item :label="$t('收款账户')" prop="accountNo" :rules="{ required: true, trigger: ['blur', 'change'], message: $t('收款账户不能为空') }">
<el-select v-if="!isView" v-model="addForm.accountId" :placeholder="$t('请选择收款账户')" style="width: 220px" @change="accountChange">
<el-select v-if="!isView" filterable clear v-model="addForm.accountId" :placeholder="$t('请选择收款账户')" style="width: 220px" @change="accountChange" v-el-select-loadmore="loadmore">
<el-option v-for="item in bankData" :key="item.id" :label="item.baAccountName + '(' + item.baAccountNum + ')'" :value="item.id" />
</el-select>
<span v-else>{{ addForm.accountNo}}{{'('+addForm.accountName+')' }}</span>
......@@ -620,7 +619,12 @@ export default {
detailIndex:1,
wiffShow:false,
wiffRemark:'',
rateList:[]
rateList:[],
codePage: {
pageNo: 1,
pageSize: 20
},
pages:1
}
},
computed: {
......@@ -698,6 +702,22 @@ export default {
this.setWriteOffAmount()
},
},
directives: {
'el-select-loadmore': {
bind (el, binding) {
const SELECTWRAP_DOM = el.querySelector(
'.el-select-dropdown .el-select-dropdown__wrap'
)
SELECTWRAP_DOM.addEventListener('scroll', function () {
const condition =
this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
}
})
}
}
},
async created() {
// 获取汇率
await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
......@@ -720,7 +740,10 @@ export default {
// });
// console.log(this.deptData)
});
await getBankAccountPage(this.params).then((res) => (this.bankData = res.data.list));
await getBankAccountPage(this.codePage).then((res) => {
this.bankData = res.data.list
this.pages = (res.data.total/this.codePage.pageSize)+1
});
if (this.$route.query.id) {
this.id = this.$route.query.id;
await getReceiptInfoByIds({ id: this.id }).then(res => {
......@@ -811,6 +834,24 @@ export default {
this.getList()
},
methods: {
// 懒加载
loadmore () {
this.codePage.pageNo++
// 大于页码不请求了
console.log(111)
if (this.codePage.pageNo > this.pages) {
return
}
this.getCodeList()
},
getCodeList() {
setTimeout(() => {
getBankAccountPage(this.codePage).then(res => {
this.bankData = this.bankData.concat(res.data.list)
this.pages = (res.data.total/this.codePage.pageSize)+1
})
}, 200)
},
rateChange(row, index) {
if(row.collectionRate){
row.receivableAmount && (row.collectionAmount = Math.round(NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment