优化优化投票功能

This commit is contained in:
wuxw 2023-10-10 15:59:31 +08:00
parent 7b431686e8
commit 9d7d5c947f
7 changed files with 152 additions and 36 deletions

View File

@ -61,7 +61,7 @@
</tr>
</thead>
<tbody>
<tr v-for="ownerInvoice in ownerInvoiceInfo.ownerInvoices">
<tr v-for="ownerInvoice in searchOwnerInvoiceInfo.ownerInvoices">
<td class="text-center">{{ownerInvoice.ownerName}}</td>
<td class="text-center">{{ownerInvoice.invoiceType == '1001'?'个人':'公司'}}
</td>

View File

@ -40,7 +40,7 @@
let _json = JSON.parse(json);
$that.searchOwnerInvoiceInfo.ownerInvoices = _json.data;
vc.emit('searchOwnerInvoice', 'paginationPlus', 'init', {
total: _ownerInfo.records,
total: _json.records,
currentPage: _page
});
},

View File

@ -33,7 +33,7 @@
});
vc.on('simplifyHisFee', 'paginationPlus', 'page_event',
function(_currentPage) {
vc.component._listSimplifyFeeDetails(_currentPage, DEFAULT_ROWS);
$that._listSimplifyFeeDetails(_currentPage, DEFAULT_ROWS);
});
},
methods: {
@ -52,12 +52,12 @@
param,
function(json) {
let _feeConfigInfo = JSON.parse(json);
vc.component.simplifyHisFeeInfo.total = _feeConfigInfo.total;
vc.component.simplifyHisFeeInfo.records = _feeConfigInfo.records;
vc.component.simplifyHisFeeInfo.feeDetails = _feeConfigInfo.feeDetails;
$that.simplifyHisFeeInfo.total = _feeConfigInfo.total;
$that.simplifyHisFeeInfo.records = _feeConfigInfo.records;
$that.simplifyHisFeeInfo.feeDetails = _feeConfigInfo.feeDetails;
vc.emit('simplifyHisFee', 'paginationPlus', 'init', {
total: vc.component.simplifyHisFeeInfo.records,
dataCount: vc.component.simplifyHisFeeInfo.total,
total: $that.simplifyHisFeeInfo.records,
dataCount: $that.simplifyHisFeeInfo.total,
currentPage: _page
});
},

View File

@ -83,6 +83,6 @@
</div>
</div>
</div>
<vc:create path="fee/searchOwnerInvoice" emitChooseOwner="addOwnerInvoice" emitLoadData="addOwnerInvoice">
<vc:create path="property/searchOwner" emitChooseOwner="addOwnerInvoice" emitLoadData="addOwnerInvoice">
</vc:create>
</div>

View File

@ -17,8 +17,9 @@
},
_initEvent: function () {
vc.on('addOwnerInvoice', 'chooseOwnerInvoice', function (_owner) {
vc.copyObject(_owner,$that.addOwnerInvoiceInfo);
vc.on('addOwnerInvoice', 'chooseOwner', function (_owner) {
$that.addOwnerInvoiceInfo.ownerName = _owner.name;
$that.addOwnerInvoiceInfo.ownerId = _owner.ownerId;
$that._loadFeeDetails();
});
},
@ -115,16 +116,21 @@
if (_json.code == 0) {
//关闭model
vc.goBack();
return;
}
vc.toast(_json.msg);
},
function (errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
});
},
_openChooseOwner: function () {
vc.emit('searchOwnerInvoice', 'openSearchOwnerInvoiceModel', {});
vc.emit('searchOwner', 'openSearchOwnerModel', {});
},
}

View File

@ -20,7 +20,7 @@
<vc:i18n name="发票抬头" namespace="ownerApplyInvoice"></vc:i18n>
</label>
<div class="col-sm-3">
<input v-model="ownerApplyInvoiceInfo.ownerName" disabled type="text"
<input v-model="ownerApplyInvoiceInfo.invoiceName" disabled type="text"
:placeholder="vc.i18n('必填,请选择发票抬头','ownerApplyInvoice')" class="form-control">
</div>
<div class="col-sm-1">
@ -32,7 +32,7 @@
<vc:i18n name="纳税人识别号" namespace="ownerApplyInvoice"></vc:i18n>
</label>
<div class="col-sm-4">
<input v-model="ownerApplyInvoiceInfo.invoiceName" type="text"
<input v-model="ownerApplyInvoiceInfo.invoiceNum" type="text"
:placeholder="vc.i18n('必填,请选择纳税人识别号','ownerApplyInvoice')" class="form-control">
</div>
</div>
@ -55,22 +55,31 @@
:placeholder="vc.i18n('必填,请选择地址、电话','ownerApplyInvoice')" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label text-right">
<vc:i18n name="业主" namespace="ownerApplyInvoice"></vc:i18n>
</label>
<div class="col-sm-4">
<input v-model="ownerApplyInvoiceInfo.ownerName" disabled type="text"
:placeholder="vc.i18n('必填,请选择地址、电话','ownerApplyInvoice')" class="form-control">
</div>
</div>
</div>
</div>
</div>
</div>
<vc:create path="property/searchOwner" emitChooseOwner="ownerApplyInvoice" emitLoadData="ownerApplyInvoice">
<vc:create path="fee/searchOwnerInvoice" emitChooseOwner="ownerApplyInvoice" emitLoadData="ownerApplyInvoice">
</vc:create>
</div>
</div>
<div class="row">
<div class="row" v-if="ownerApplyInvoiceInfo.feeDetails && ownerApplyInvoiceInfo.feeDetails.length >0">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>
<vc:i18n name="已缴费费用" namespace="handover"></vc:i18n>
<vc:i18n name="已缴费费用" namespace="ownerApplyInvoice"></vc:i18n>
</h5>
<div class="ibox-tools" style="top:10px;">
@ -81,28 +90,74 @@
data-page-size="10">
<thead>
<tr>
<th data-hide="phone" class="text-center">
<vc:i18n name="费用项目" namespace="handover"></vc:i18n>
<th class="text-center"><input type="checkbox" class="i-checks all-check" @click="checkAll($event)"></th>
<th class="text-center">
<vc:i18n name="费用项" namespace="ownerApplyInvoice"></vc:i18n>
</th>
<th class="text-center">
<vc:i18n name="收费对象" namespace="ownerApplyInvoice"></vc:i18n>
</th>
<th data-hide="phone" class="text-center">
<vc:i18n name="开始时间" namespace="handover"></vc:i18n>
<vc:i18n name="应收/实收" namespace="ownerApplyInvoice"></vc:i18n>
</th>
<th data-hide="phone" class="text-center">
<vc:i18n name="结束时间" namespace="handover"></vc:i18n>
<vc:i18n name="缴费方式" namespace="ownerApplyInvoice"></vc:i18n>
</th>
<th data-hide="phone" class="text-center">
<vc:i18n name="缴费起始段" namespace="ownerApplyInvoice"></vc:i18n>
</th>
<th data-hide="phone" class="text-center">
<vc:i18n name="缴费时间" namespace="ownerApplyInvoice"></vc:i18n>
</th>
<th data-hide="phone" class="text-center">
<vc:i18n name="收银员" namespace="ownerApplyInvoice"></vc:i18n>
</th>
<th data-hide="phone" class="text-center">
<vc:i18n name="状态" namespace="ownerApplyInvoice"></vc:i18n>
</th>
<th data-hide="phone" class="text-center">
<vc:i18n name="备注" namespace="ownerApplyInvoice"></vc:i18n>
</th>
</tr>
</thead>
<tbody>
<tr v-for="fee in ownerApplyInvoiceInfo.feeDetails">
<tr v-for="feeDetail in ownerApplyInvoiceInfo.feeDetails">
<td class="text-center">
{{fee.feeName}}
<input type="checkbox" class="i-checks checkItem" v-bind:value="feeDetail.detailId" v-model="ownerApplyInvoiceInfo.detailIds">
</td>
<td class="text-center">
{{fee.startTime}}
{{feeDetail.feeName}}
</td>
<td class="text-center">
{{fee.endTime?fee.endTime:'-'}}
{{feeDetail.payerObjName}}
</td>
<td class="text-center">
{{feeDetail.receivableAmount}}/{{feeDetail.receivedAmount}}
</td>
<td class="text-center">
{{feeDetail.primeRateName}}
</td>
<td class="text-center">
{{vc.dateFormat(feeDetail.startTime)}}~</br>
<span v-if="feeDetail.startTime >= feeDetail.endTime">
{{vc.dateFormat(feeDetail.endTime)}}
</span>
<span v-else>
{{vc.dateSubOneDay(vc.dateFormat(feeDetail.endTime),vc.dateFormat(feeDetail.endTime),feeDetail.feeFlag)}}
</span>
</td>
<td class="text-center">
{{feeDetail.createTime}}
</td>
<td class="text-center">
{{feeDetail.cashierName || '-'}}
</td>
<td class="text-center">
{{feeDetail.stateName}}
</td>
<td class="text-center">
{{feeDetail.remark}}
</td>
</tr>
</tbody>

View File

@ -4,33 +4,88 @@
ownerApplyInvoiceInfo: {
ownerId: '',
ownerName: '',
invoiceType:'',
invoiceName:'',
invoiceAddress:'',
invoiceType: '',
invoiceName: '',
invoiceAddress: '',
invoiceNum: '',
detailIds: [],
feeDetails: []
}
},
watch: {
'ownerApplyInvoiceInfo.detailIds': {
deep: true,
handler: function () {
let checkObj = document.querySelectorAll('.all-check'); // 获取所有checkbox项
if ($that.ownerApplyInvoiceInfo.detailIds.length < $that.ownerApplyInvoiceInfo.feeDetails.length) {
checkObj[0].checked = false;
} else {
checkObj[0].checked = true;
}
}
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('ownerApplyInvoice', 'chooseOwner', function (_owner) {
$that.ownerApplyInvoiceInfo.ownerName = _owner.name;
$that.ownerApplyInvoiceInfo.ownerId = _owner.ownerId;
vc.on('ownerApplyInvoice', 'chooseOwnerInvoice', function (_owner) {
vc.copyObject(_owner, $that.ownerApplyInvoiceInfo);
$that._loadFeeDetails();
});
},
methods: {
_openChooseOwner: function () {
vc.emit('searchOwner', 'openSearchOwnerModel', {});
vc.emit('searchOwnerInvoice', 'openSearchOwnerInvoiceModel', {});
},
_loadFeeDetails:function(){
_loadFeeDetails: function () {
let param = {
params: {
page: 1,
row: 50,
communityId: vc.getCurrentCommunity().communityId,
ownerId: $that.ownerApplyInvoiceInfo.ownerId,
}
};
}
$that.ownerApplyInvoiceInfo.detailIds = [];
//发送get请求
vc.http.apiGet('/fee.queryFeeDetail',
param,
function (json) {
let _feeConfigInfo = JSON.parse(json);
$that.ownerApplyInvoiceInfo.feeDetails = _feeConfigInfo.feeDetails;
if (_feeConfigInfo.feeDetails && _feeConfigInfo.feeDetails.length > 0) {
setTimeout(function () {
_feeConfigInfo.feeDetails.forEach(_detail => {
$that.ownerApplyInvoiceInfo.detailIds.push(_detail.detailId);
});
}, 1000)
}
},
function () {
console.log('请求失败处理');
}
);
},
checkAll: function (e) {
let checkObj = document.querySelectorAll('.checkItem'); // 获取所有checkbox项
if (e.target.checked) { // 判定全选checkbox的勾选状态
for (let i = 0; i < checkObj.length; i++) {
if (!checkObj[i].checked) { // 将未勾选的checkbox选项push到绑定数组中
$that.ownerApplyInvoiceInfo.detailIds.push(checkObj[i].value);
}
}
} else { // 如果是去掉全选则清空checkbox选项绑定数组
$that.ownerApplyInvoiceInfo.detailIds = [];
}
},
}
});
})(window.vc);