提交 2c47334f authored 作者: 宋雄's avatar 宋雄

解决bug

上级 d818f5c3
NODE_ENV=development
# VUE_APP_API_BASE_URL='http://192.168.0.119:9999'
# VUE_APP_API_BASE_URL='http://192.168.0.113:9999'
# VUE_APP_API_BASE_URL='http://192.168.0.101:9999'
VUE_APP_API_BASE_URL='http://220.203.25.212:9999'
VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas
......
......@@ -69,7 +69,7 @@ const deleteLog = (params)=>deleteAction("/sys/log/delete",params);
const deleteLogList = (params)=>deleteAction("/sys/log/deleteBatch",params);
//收费类型列表
const getChargeListApi = (params)=>getAction("/property-community/system/chargeType/chargeTypelist",params);
const getChargeListApi = (params)=>getAction("/property-company/system/chargeType/chargeTypelist",params);
const addReceiptTemplate = (params)=>postAction("/property-community/system/receiptTemplate/add",params);
// 楼栋列表、单元列表、房间列表
const getBuildingListApi = (params)=>getAction("/property-community/building/communityBuilding/buildingList",params);
......@@ -108,9 +108,14 @@ const auditCommunityComplaintApi = (params)=>postAction("/property-community/pro
const auditMoveComplaintApi = (params)=>getAction("/property-community/property/communityComplaint/moveComplaint",params);
// 对账管理
const auditPropertyApi = (params)=>postAction("/property-central/property/propertySettled/audit",params);
const freezeOrPropertyApi = (params)=>getAction(`/property-central/property/propertySettled/freezeOrThaw/${params.id}/${params.status}`,{});
const getPropertyChargruleListApi = (params)=>getAction("/property-central/property/propertyChargrule/propertyChargruleList",params);
const addCommunityAccountPageApi = (params)=>postAction("/property-community/property/communityReconciliation/add",params);
const getDetailReconciliationApi = (params)=>getAction("/property-community/property/communityReconciliation/queryById",params);
const getAccountListByIdApi = (params)=>getAction("/property-community/property/communityReconciliation/getAccountListById",params);
const communityAuditAccountPageApi = (params)=>postAction("/property-community/property/communityReconciliation/communityAudit",params);
const getCommunityRecordListApi = (params)=>getAction("/property-central/property/auditRecord/getRecordList",params);
const communitySubCompanyApi = (params)=>postAction("/property-community/property/communityReconciliation/communitySubCompany",params);
//数据字典
const addDict = (params)=>postAction("/sys/dict/add",params);
......@@ -244,7 +249,12 @@ export {
auditCommunityComplaintApi,
auditMoveComplaintApi,
getPropertyChargruleListApi,
auditPropertyApi,
addCommunityAccountPageApi,
getDetailReconciliationApi,
getAccountListByIdApi,
communityAuditAccountPageApi,
getCommunityRecordListApi,
communitySubCompanyApi,
freezeOrPropertyApi,
setOwnerLabelApi,
editOwnerLabelApi,
......
......@@ -77,6 +77,29 @@ export const OWNER_LEBEL = [
{label: '残', value: 'labelDestituteCan'}
]
// 付费周期
export const CHARGING_CYCLE = [
{label: '每月', value: '1'},
{label: '每季度', value: '2'},
{label: '每年', value: '3'},
{label: '一次性付清', value: '4'},
{label: '预付', value: '5'}
]
// 小区对账审核状态
export const RECONCILIATION_STATUS = [
{label: '小区待审核', value: 'communityWaitAudit'},
{label: '小区审核通过', value: 'communityAuditPass'},
{label: '小区审核驳回', value: 'communityRefuse'}
]
// 物业对账审核状态
export const COMPANY_AUDIT_STATUS = [
{label: '物业待审核', value: 'companyWaitAudit'},
{label: '物业审核通过', value: 'companyAuditPass'},
{label: '物业审核驳回', value: 'companyRefuse'}
]
/**
* 翻译字段值对应的文本
* @param children
......
......@@ -78,7 +78,7 @@
</div>
<!-- table区域-end -->
<notice-modal ref="modalForm" @ok="modalFormOk"></notice-modal>
<notice-modal ref="modalForm" @ok="searchQuery"></notice-modal>
</a-card>
</template>
......
......@@ -20,11 +20,6 @@
<a-input v-model="model.roomAllName" placeholder="请输入"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="业主" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ownerName">
<a-input v-model="model.ownerName" placeholder="请输入"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="与业主关系" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="relationShip">
<!-- <a-input v-model="model.relationShip" placeholder="请输入"></a-input> -->
......@@ -220,7 +215,6 @@ export default {
roomId: '',
roomName: '',
floorSpace: '',
ownerName: '',
ownerPhone: '',
residentName: '',
residentPhone: '',
......
......@@ -5,8 +5,8 @@
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="业主姓名">
<j-input placeholder="请输入业主姓名" v-model="queryParam.ownerName"></j-input>
<a-form-item label="住户姓名">
<j-input placeholder="请输入住户姓名" v-model="queryParam.residentName"></j-input>
</a-form-item>
</a-col>
......@@ -62,9 +62,6 @@
onChange: onSelectChange,
getCheckboxProps: onCheckboxProps
}" class="j-table-force-nowrap" @change="handleTableChange">
<span slot="ownerId" slot-scope="text, record">
<span>{{record.ownerName}}{{record.ownerPhone}}</span>
</span>
<span slot="residentPhone" slot-scope="text, record">
<span>{{record.residentName}}{{record.residentPhone}}</span>
</span>
......@@ -87,7 +84,7 @@
</div>
</div>
<notice-modal ref="modalForm" @ok="modalFormOk"></notice-modal>
<notice-modal ref="modalForm" @ok="searchQuery"></notice-modal>
</a-card>
</template>
......@@ -111,14 +108,6 @@ const columns = [
key: 'chargeItem',
align: 'center',
},
{
title: '业主',
dataIndex: 'ownerId',
key: 'ownerId',
scopedSlots: { customRender: 'ownerId' },
align: 'center',
ellipsis: true
},
{
title: '与业主关系',
dataIndex: 'relationShip',
......
......@@ -42,13 +42,13 @@
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item label="业主" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ownerName">
<a-input v-model="model.ownerName" placeholder="请输入" disabled></a-input>
<a-form-model-item label="住户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="residentName">
<a-input v-model="model.residentName" placeholder="请输入" disabled></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="住户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="residentName">
<a-input v-model="model.residentName" placeholder="请输入" disabled></a-input>
<a-form-model-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="residentPhone">
<a-input v-model="model.residentPhone" placeholder="请输入" disabled></a-input>
</a-form-model-item>
</a-col>
......@@ -143,8 +143,6 @@
roomId: '',
roomName: '',
floorSpace: '',
ownerName: '',
ownerPhone: '',
residentName: '',
residentPhone: '',
relationShip: '',
......@@ -254,7 +252,7 @@
}
},
async onqueryLastDegreesById() {
let res = await queryLastDegreesByIdApi({ownerId: this.model.ownerId,chargeTypeId: this.model.chargeTypeId})
let res = await queryLastDegreesByIdApi({roomId: this.model.roomId,chargeTypeId: this.model.chargeTypeId})
this.model.lastDegrees = res.result
if(this.model.currentDegrees) {
this.onDegreesChange(this.model.currentDegrees)
......@@ -263,12 +261,12 @@
async onqueryByRoomId() {
let res = await queryByRoomIdApi({roomId: this.model.roomId})
if(res.code === 200) {
this.model.ownerName = res.result.ownerName
this.model.ownerPhone = res.result.ownerPhone
this.model.residentName = res.result.residentName
this.model.residentPhone = res.result.residentPhone
this.model.relationShip = res.result.relationShip
this.model.ownerId = res.result.id
let ownerRow = res.result.find(item=>item.relationShip === 'self')
if(!ownerRow) ownerRow = {...res.result[0]}
this.model.residentName = ownerRow.residentName
this.model.residentPhone = ownerRow.residentPhone
this.model.relationShip = ownerRow.relationShip
this.model.ownerId = ownerRow.id
if(this.model.designFormulas === 3 && this.model.chargeTypeId) {
this.onqueryLastDegreesById()
}
......
......@@ -3,13 +3,20 @@
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="收费标准" :labelCol="{ xs: { span: 24 }, sm: { span: 2 } }" :wrapperCol="wrapperCol" prop="chargingStandardId">
<a-select style="width:50%" v-model="model.chargingStandardId" placeholder="请选择收费标准" @change="onStandardChange">
<a-col :span="12">
<a-form-model-item label="收费标准" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargingStandardId">
<a-select v-model="model.chargingStandardId" placeholder="请选择收费标准" @change="onStandardChange">
<a-select-option v-for="item in ruleList" :key="item.id" :value="item.id">{{item.chargeTypeCodeName}}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="收费周期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargeCycle">
<a-select v-model="model.chargeCycle" placeholder="请选择收费周期" disabled>
<a-select-option v-for="item in chargingCycle" :key="item.value" :value="item.value">{{item.label}}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="收费类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargeTypeName">
<a-input v-model="model.chargeTypeName" placeholder="请输入" disabled></a-input>
......@@ -42,13 +49,13 @@
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item label="业主" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ownerName">
<a-input v-model="model.ownerName" placeholder="请输入" disabled></a-input>
<a-form-model-item label="住户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="residentName">
<a-input v-model="model.residentName" placeholder="请输入" disabled></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="住户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="residentName">
<a-input v-model="model.residentName" placeholder="请输入" disabled></a-input>
<a-form-model-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="residentPhone">
<a-input v-model="model.residentPhone" placeholder="请输入" disabled></a-input>
</a-form-model-item>
</a-col>
......@@ -107,6 +114,7 @@
import { httpAction, getAction } from '@/api/manage'
import { formatDate } from '@/utils/util'
import { getBuildingListApi, getUnitListApi, getRoomListApi, companyPropertyChargerulesApi, queryByRoomIdApi, queryLastDegreesByIdApi} from '@/api/api'
import { CHARGING_CYCLE } from '@/assets/static.js'
export default {
name: 'PropertyChargruleForm',
......@@ -123,6 +131,7 @@
data () {
return {
ruleList: [],
chargingCycle: CHARGING_CYCLE,
treeData: [],
amount: 0,
model:{
......@@ -143,8 +152,6 @@
roomId: '',
roomName: '',
floorSpace: '',
ownerName: '',
ownerPhone: '',
residentName: '',
residentPhone: '',
relationShip: '',
......@@ -219,12 +226,18 @@
this.model.designFormulas = row.designFormulas
this.amount = row.amount
this.model.unitPrice = this.model.designFormulas === 1 ? '' : row.amount
if(this.model.designFormulas === 1) {
if(this.model.designFormulas === 1) { // 固定金额
this.model.totalAmount = this.amount.toFixed(2)
}
if(this.model.designFormulas === 2 && this.model.roomId) { // 获取上期度数
if(this.model.designFormulas === 2 && this.model.roomId) { // 建面 * 单价
if(this.model.chargeCycle === '2') { // 每季度
this.model.totalAmount = (this.model.unitPrice * this.model.floorSpace * 3).toFixed(2)
} else if(this.model.chargeCycle === '3') { // 每年
this.model.totalAmount = (this.model.unitPrice * this.model.floorSpace * 12).toFixed(2)
} else {
this.model.totalAmount = (this.model.unitPrice * this.model.floorSpace).toFixed(2)
}
}
if(this.model.designFormulas === 3 && this.model.roomId) { // 获取上期度数
this.onqueryLastDegreesById()
}
......@@ -250,8 +263,14 @@
this.model.buildingName = data.parent.parent.label
this.onqueryByRoomId()
if(this.model.designFormulas === 2) {
if(this.model.chargeCycle === '2') { // 每季度
this.model.totalAmount = (this.model.unitPrice * this.model.floorSpace * 3).toFixed(2)
} else if(this.model.chargeCycle === '3') { // 每年
this.model.totalAmount = (this.model.unitPrice * this.model.floorSpace * 12).toFixed(2)
} else {
this.model.totalAmount = (this.model.unitPrice * this.model.floorSpace).toFixed(2)
}
}
},
async onqueryLastDegreesById() {
let res = await queryLastDegreesByIdApi({ownerId: this.model.ownerId,chargeTypeId: this.model.chargeTypeId})
......@@ -263,12 +282,12 @@
async onqueryByRoomId() {
let res = await queryByRoomIdApi({roomId: this.model.roomId})
if(res.code === 200) {
this.model.ownerName = res.result.ownerName
this.model.ownerPhone = res.result.ownerPhone
this.model.residentName = res.result.residentName
this.model.residentPhone = res.result.residentPhone
this.model.relationShip = res.result.relationShip
this.model.ownerId = res.result.id
let ownerRow = res.result.find(item=>item.relationShip === 'self')
if(!ownerRow) ownerRow = {...res.result[0]}
this.model.residentName = ownerRow.residentName
this.model.residentPhone = ownerRow.residentPhone
this.model.relationShip = ownerRow.relationShip
this.model.ownerId = ownerRow.id
if(this.model.designFormulas === 3 && this.model.chargeTypeId) {
this.onqueryLastDegreesById()
}
......
......@@ -20,11 +20,11 @@
<a-input v-model="model.roomAllName" placeholder="请输入"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="业主" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ownerName">
<a-input v-model="model.ownerName" placeholder="请输入"></a-input>
<!-- <a-col :span="12">
<a-form-model-item label="业主" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="residentName">
<a-input v-model="model.residentName" placeholder="请输入"></a-input>
</a-form-model-item>
</a-col>
</a-col> -->
<a-col :span="12">
<a-form-model-item label="与业主关系" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="relationShip">
<!-- <a-input v-model="model.relationShip" placeholder="请输入"></a-input> -->
......@@ -220,8 +220,6 @@ export default {
roomId: '',
roomName: '',
floorSpace: '',
ownerName: '',
ownerPhone: '',
residentName: '',
residentPhone: '',
relationShip: '',
......
......@@ -5,8 +5,8 @@
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="业主姓名">
<j-input placeholder="请输入业主姓名" v-model="queryParam.ownerName"></j-input>
<a-form-item label="住户姓名">
<j-input placeholder="请输入住户姓名" v-model="queryParam.residentName"></j-input>
</a-form-item>
</a-col>
......@@ -62,9 +62,6 @@
onChange: onSelectChange,
getCheckboxProps: onCheckboxProps
}" class="j-table-force-nowrap" @change="handleTableChange">
<span slot="ownerId" slot-scope="text, record">
<span>{{record.ownerName}}{{record.ownerPhone}}</span>
</span>
<span slot="residentPhone" slot-scope="text, record">
<span>{{record.residentName}}{{record.residentPhone}}</span>
</span>
......@@ -87,7 +84,7 @@
</div>
</div>
<notice-modal ref="modalForm" @ok="modalFormOk"></notice-modal>
<notice-modal ref="modalForm" @ok="searchQuery"></notice-modal>
</a-card>
</template>
......@@ -113,14 +110,6 @@ const columns = [
width: 220,
align: 'center',
},
{
title: '业主',
dataIndex: 'ownerId',
key: 'ownerId',
width: 160,
scopedSlots: { customRender: 'ownerId' },
align: 'center',
},
{
title: '与业主关系',
dataIndex: 'relationShip',
......@@ -199,7 +188,7 @@ const columns = [
align: 'center',
width: 150,
fixed: 'right',
},
}
]
export default {
......
......@@ -14,8 +14,8 @@
</a-form-model-item>
</a-col> -->
<a-col :span="12">
<a-form-model-item label="业主" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ownerName">
<a-input v-model="model.ownerName" placeholder="请输入业主"></a-input>
<a-form-model-item label="住户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="residentName">
<a-input v-model="model.residentName" placeholder="请输入住户"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
......@@ -35,7 +35,10 @@
</a-col>
<a-col :span="12">
<a-form-model-item label="缴费周期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargeCycle">
<a-input v-model="model.chargeCycle" placeholder="请输入缴费周期"></a-input>
<!-- <a-input v-model="model.chargeCycle" placeholder="请输入缴费周期"></a-input> -->
<a-select v-model="model.chargeCycle" placeholder="请选择缴费周期">
<a-select-option v-for="item in chargingCycle" :key="item.value" :value="item.value">{{item.label}}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
......@@ -64,9 +67,9 @@
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import { httpAction } from '@/api/manage'
import {ajaxGetDictItems,getDictItemsFromCache} from '@/api/api'
import { CHARGING_CYCLE } from '@/assets/static.js'
export default {
name: 'PropertyChargruleForm',
......@@ -82,6 +85,7 @@
},
data () {
return {
chargingCycle: CHARGING_CYCLE,
dictOptions: [],
model:{
employeeName: '',
......
......@@ -71,8 +71,8 @@
<span slot="roomName" slot-scope="text, record">
<span>{{record.buildingName}}{{record.unitName}}{{record.roomName}}</span>
</span>
<span slot="ownerName" slot-scope="text, record">
<span>{{record.ownerName}}{{record.ownerPhone}}</span>
<span slot="residentName" slot-scope="text, record">
<span>{{record.residentName}}{{record.residentPhone}}</span>
</span>
<span slot="receiptStatus" slot-scope="text, record">
<span :style="{'color': record.receiptStatus === '1' ? 'green' : 'red'}">{{record.receiptStatus === '1' ? '是' : '否'}}</span>
......@@ -80,7 +80,10 @@
<span slot="action" slot-scope="text, record">
<!-- <a @click="handleEdit(record)">编辑</a> -->
<a @click="handleDetail(record)">查看</a>
<a @click="onIssueReceipt(record)" style="margin-left: 10px;">开收据</a>
<template v-if="record.receiptStatus !== '1'">
<a-divider type="vertical" />
<a @click="onIssueReceipt(record)">开收据</a>
</template>
</span>
</a-table>
......@@ -107,10 +110,10 @@
align: 'center'
},
{
title: '业主',
dataIndex: 'ownerName',
scopedSlots: { customRender: 'ownerName' },
key: 'ownerName',
title: '住户',
dataIndex: 'residentName',
scopedSlots: { customRender: 'residentName' },
key: 'residentName',
align: 'center'
},
{
......@@ -188,8 +191,7 @@
},
methods: {
onIssueReceipt(row) {
console.log(this.$refs.templateModal)
this.$refs.templateModal.onLoadTemplate()
this.$refs.templateModal.onLoadTemplate(row)
},
handleOk() {},
handleCancel() {},
......
<template>
<div>
<j-modal
title="收据模板"
width="70%"
......@@ -28,17 +29,65 @@
<span :style="{'color': record.receiptStatus === '1' ? 'green' : 'red'}">{{record.receiptStatus === '1' ? '是' : '否'}}</span>
</span>
<span slot="action" slot-scope="text, record">
<!-- <a @click="handleEdit(record)">编辑</a> -->
<a @click="handleDetail(record)">预览</a>
<a @click="onIssueReceipt(record)" style="margin-left: 10px;">下载</a>
<a @click="handlePreviewPdf(record)">预览</a>
<a-divider type="vertical" />
<a @click="handleSaveToPdf(record)">下载</a>
</span>
</a-table>
</div>
</j-modal>
<vue-html2pdf
:show-layout="false"
:float-layout="true"
:enable-download="true"
:preview-modal="false"
:html-to-pdf-options="pdfOptions"
:paginate-elements-by-height="1400"
filename="tempFileName"
:pdf-quality="2"
:manual-pagination="false"
pdf-format="a4"
pdf-orientation="landscape"
pdf-content-width="98%"
@progress="onProgress"
ref="html2PdfDownLoad"
>
<section slot="pdf-content">
<!-- PDF Content Here -->
<span id="report" v-html="content"></span>
</section>
</vue-html2pdf>
<vue-html2pdf
:show-layout="false"
:float-layout="true"
:enable-download="false"
:preview-modal="true"
:html-to-pdf-options="pdfOptions"
:paginate-elements-by-height="1400"
filename="tempFileName"
:pdf-quality="2"
:manual-pagination="false"
pdf-format="a4"
pdf-orientation="landscape"
pdf-content-width="98%"
@progress="onProgress"
ref="html2PdfPreview"
>
<section slot="pdf-content">
<!-- PDF Content Here -->
<span id="report" v-html="content"></span>
</section>
</vue-html2pdf>
</div>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import VueHtml2pdf from "vue-html2pdf";
// const content = '<h3 style="text-align: center;"><span data-w-e-type="mention" data-w-e-is-void="" data-w-e-is-inline="" data-value="收据名称" data-info="%7B%22id%22%3A%22a%22%7D">@收据名称</span></h3><p style="text-align: center;">单号:<span data-w-e-type="mention" data-w-e-is-void="" data-w-e-is-inline="" data-value="单号" data-info="%7B%22id%22%3A%22b%22%7D">@单号</span></p><p style="text-align: left;">业主:<span data-w-e-type="mention" data-w-e-is-void="" data-w-e-is-inline="" data-value="业主名称" data-info="%7B%22id%22%3A%22c%22%7D">@业主名称</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;缴费时间:<span data-w-e-type="mention" data-w-e-is-void="" data-w-e-is-inline="" data-value="缴费时间" data-info="%7B%22id%22%3A%22d%22%7D">@缴费时间</span></p><hr/><p style="line-height: 2.5;">今收到 <u> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </u> 金额(大写)<u> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</u><span data-w-e-type="mention" data-w-e-is-void="" data-w-e-is-inline="" data-value="大写金额" data-info="%7B%22id%22%3A%22e%22%7D">@大写金额</span><u> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</u></p><p style="line-height: 2.5;">收款单位(盖章) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;¥:<u> &nbsp; &nbsp;</u><span data-w-e-type="mention" data-w-e-is-void="" data-w-e-is-inline="" data-value="小写金额" data-info="%7B%22id%22%3A%22f%22%7D">@小写金额</span><u> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</u></p><hr/><p>开票人:<span data-w-e-type="mention" data-w-e-is-void data-w-e-is-inline data-value="审核人" data-info="%7B%22id%22%3A%22g%22%7D">@审核人</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 收款人:<span data-w-e-type="mention" data-w-e-is-void data-w-e-is-inline data-value="审核人" data-info="%7B%22id%22%3A%22g%22%7D">@审核人</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;客户:<span data-w-e-type="mention" data-w-e-is-void data-w-e-is-inline data-value="业主名称" data-info="%7B%22id%22%3A%22c%22%7D">@业主名称</span></p>'
let receiptObj = {}
const columns = [
{
......@@ -84,6 +133,9 @@
export default {
name: 'PropertySettledModal',
mixins: [JeecgListMixin],
components: {
VueHtml2pdf
},
data () {
return {
columns: columns,
......@@ -91,19 +143,21 @@
list: "/property-company/system/receiptTemplate/list"
},
visible: false,
content: '',
// previewModal: false,
pdfOptions: {
margin: [20, 10, 20, 10],
filename: ''
}
}
},
methods: {
onLoadTemplate() {
onLoadTemplate(receipt) {
receiptObj = {...receipt}
this.visible=true
this.loadData()
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
......@@ -111,12 +165,53 @@
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
},
onProgress(e) {
console.log(e)
},
dealBigMoney(number) {
if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(number)) return "数据非法";
let unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
let n = number + "00";
let p = n.indexOf('.');
if (p >= 0){
n = n.substring(0, p) + n.substr(p+1, 2);
unit = unit.substr(unit.length - n.length);
}
for (var i=0; i < n.length; i++) {
str += '零壹贰叁肆伍陆柒捌玖'.charAt(n.charAt(i)) + unit.charAt(i);
}
return str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
},
handleSaveToPdf(row) {
this.pdfOptions.filename = '收费模板'
let content = row.templateStyle
let capitalizationAmont = this.dealBigMoney(receiptObj.totalAmount)
content = content.replace(/@收据名称/g, row.templateName)
content = content.replace(/@单号/g, receiptObj.paymentNum)
content = content.replace(/@业主名称/g, receiptObj.residentName)
content = content.replace(/@缴费时间/g, receiptObj.paymentTime)
content = content.replace(/@大写金额/g, capitalizationAmont)
content = content.replace(/@小写金额/g, receiptObj.totalAmount)
content = content.replace(/@审核人/g, receiptObj.updateBy)
this.$refs.html2PdfDownLoad.generatePdf();
},
handlePreviewPdf(row) {
let content = row.templateStyle
let capitalizationAmont = this.dealBigMoney(receiptObj.totalAmount)
content = content.replace(/@收据名称/g, row.templateName)
content = content.replace(/@单号/g, receiptObj.paymentNum)
content = content.replace(/@业主名称/g, receiptObj.residentName)
content = content.replace(/@缴费时间/g, receiptObj.paymentTime)
content = content.replace(/@大写金额/g, capitalizationAmont)
content = content.replace(/@小写金额/g, receiptObj.totalAmount)
content = content.replace(/@审核人/g, receiptObj.updateBy)
// content = content.replace(/<p style="line-height: 2.5;">/g, '<p style="line-height: 2.5;border-bottom:1px solid #333;">')
this.content = content
this.$refs.html2PdfPreview.generatePdf()
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论