| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390 |
- # -*- coding: utf-8 -*-
- import io
- out = r'd:\Users\chenjun\kyj-yanglao-web-new\src\views\elderly\apply\check-in\ContractForm.vue'
- with io.open(out, 'a', encoding='utf-8') as f:
- f.write(u'''
- <script setup>
- import { ref, reactive, onMounted } from 'vue'
- import { ElMessage } from 'element-plus'
- import { getCheckInRecordId } from '@/api/elderly/apply/check-in'
- const drawerVisible = ref(false)
- const loading = ref(false)
- const isPrint = ref(false)
- const currentRow = ref({})
- const contractForm = reactive({
- contractNumber: '',
- partyAName: '颐年健康产业(集团)有限公司',
- partyACode: '',
- partyAAddr: '',
- partyAZip: '',
- partyALegal: '',
- partyAPhone: '',
- elderName: '',
- elderGender: '',
- elderGenderText: '',
- elderBirth: '',
- elderIdCard: '',
- elderPhone: '',
- elderHomeAddr: '',
- elderAddress: '',
- elderZip: '',
- elderNation: '',
- elderEducation: '',
- elderMarital: '',
- elderInsurance: '',
- eatingHabit: '',
- sleepHabit: '',
- hobby: '',
- medicalHistory: '',
- allergyHistory: '',
- nurseLevelName: '',
- partyCName: '',
- partyCIdCard: '',
- partyCRelation: '',
- partyCPhone: '',
- partyCAddress: '',
- partyCHomeAddr: '',
- partyCZip: '',
- partyCWorkUnit: '',
- partyCCommAddr: '',
- partyCGenderText: '',
- partyCBirth: '',
- contractMonths: '',
- startDate: '',
- endDate: '',
- servicePlace: '颐年集团养老服务机构',
- roomNumber: '',
- bedFee: '',
- nurseFee: '',
- mealFee: '',
- manageFee: '',
- freeElectric: '',
- freeWater: '',
- hotWaterFee: '',
- coldWaterFee: '',
- electricFee: '',
- consultFee: '',
- totalFee: '',
- deposit: '',
- payeeName: '',
- payeeBank: '',
- payeeAccount: '',
- payerName: '',
- payerBank: '',
- payerAccount: '',
- lifeSavingDeposit: '',
- lifeSavingDepositCN: '',
- deathDeposit: '',
- deathDepositCN: '',
- emergencyContact2Name: '',
- emergencyContact2Relation: '',
- emergencyContact2Phone: '',
- otherContact1Name: '',
- otherContact1Relation: '',
- otherContact1Phone: '',
- otherContact2Name: '',
- otherContact2Relation: '',
- otherContact2Phone: '',
- partyASeal: '',
- partyALegalSign: '',
- partyASignDate: '',
- partyBSign: '',
- partyBSignDate: '',
- partyCSign: '',
- partyCSignDate: '',
- consentSignB: '',
- consentSignC: '',
- consentDate: '',
- promiseSignB: '',
- promiseSignC: '',
- promiseDate: '',
- outingStartDate: '',
- outingEndDate: '',
- outingReason: '',
- outingCompanionName: '',
- outingCompanionPhone: '',
- outingCompanionRelation: '',
- outingDestination: '',
- outingSignB: '',
- outingSignC: '',
- outingOperator: '',
- outingDate: '',
- signProxyReason: '',
- signProxySignB: '',
- signProxySignC: '',
- signProxyDate: '',
- agentSignB: '',
- agentSignC: '',
- agentDate: '',
- feeSignA: '',
- feeSignC: '',
- facilitySignA: '',
- facilitySignC: '',
- facilityDate: '',
- facilityFee: '',
- facilityStartDateText: '',
- facilityEndDateText: '',
- facilityRefundRule: ''
- })
- const open = async (row = {}) => {
- currentRow.value = row
- drawerVisible.value = true
- loading.value = true
- try {
- const res = await getCheckInRecordId(row.id, row.status)
- if (res) {
- contractForm.elderName = res.elderlyContractDO?.elderName || res.elderName || ''
- contractForm.elderIdCard = res.elderlyContractDO?.idCard || res.idCard || ''
- contractForm.elderGender = res.elderlyContractDO?.gender || res.gender || ''
- if (contractForm.elderGender === 1 || contractForm.elderGender === '1' || contractForm.elderGender === '男') {
- contractForm.elderGenderText = '男'
- } else if (contractForm.elderGender === 2 || contractForm.elderGender === '2' || contractForm.elderGender === '女') {
- contractForm.elderGenderText = '女'
- } else {
- contractForm.elderGenderText = contractForm.elderGender || ''
- }
- contractForm.elderBirth = res.elderlyContractDO?.birthDate || res.birthDate || ''
- contractForm.elderPhone = res.elderlyContractDO?.phone || res.phone || ''
- contractForm.elderHomeAddr = res.elderlyContractDO?.homeAddress || res.homeAddress || ''
- contractForm.elderAddress = res.elderlyContractDO?.address || res.address || ''
- contractForm.nurseLevelName = res.nurseLevelName || res.elderlyContractDO?.nurseLevelName || ''
- contractForm.contractNumber = res.elderlyContractDO?.contractNumber || ''
- contractForm.startDate = res.checkInTime || res.elderlyContractDO?.beginTime || ''
- contractForm.endDate = res.checkInDeadlineTime || res.elderlyContractDO?.expireTime || ''
- contractForm.roomNumber = res.roomNumber || res.elderlyContractDO?.roomNumber || ''
- contractForm.medicalHistory = res.medicalHistory || ''
- contractForm.allergyHistory = res.allergyHistory || ''
- contractForm.eatingHabit = res.eatingHabit || ''
- contractForm.sleepHabit = res.sleepHabit || ''
- contractForm.hobby = res.hobby || ''
- contractForm.contractMonths = res.elderlyContractDO?.contractMonths || ''
- contractForm.elderNation = res.elderlyContractDO?.nation || ''
- contractForm.elderEducation = res.elderlyContractDO?.education || ''
- contractForm.elderMarital = res.elderlyContractDO?.maritalStatus || ''
- contractForm.elderInsurance = res.elderlyContractDO?.insurance || ''
- const monthly = res.monthlyExpenses || []
- const findAmt = (list, name) => {
- const item = list.find(i => (i.itemCategoryName || '').includes(name)
- return item ? item.actualAmount : ''
- }
- contractForm.bedFee = findAmt(monthly, '床位') || ''
- contractForm.nurseFee = findAmt(monthly, '护理') || ''
- contractForm.mealFee = findAmt(monthly, '膳食') || ''
- contractForm.manageFee = findAmt(monthly, '管理') || ''
- const relative = (res.relativesList && res.relativesList[0]) || {}
- contractForm.partyCName = relative.name || ''
- contractForm.partyCIdCard = relative.idCard || ''
- contractForm.partyCRelation = relative.relation || ''
- contractForm.partyCPhone = relative.phone || ''
- contractForm.partyCAddress = relative.address || ''
- }
- } catch (err) {
- console.error('加载合同数据失败:', err)
- } finally {
- loading.value = false
- }
- }
- const handleClose = () => {
- drawerVisible.value = false
- }
- const handleSubmit = () => {
- ElMessage.success('合同信息已保存')
- drawerVisible.value = false
- }
- const handlePrint = () => {
- isPrint.value = true
- setTimeout(() => {
- window.print()
- isPrint.value = false
- }, 300)
- }
- defineExpose({
- open
- })
- </script>
- <style lang="scss" scoped>
- .contract-container {
- width: 100%;
- padding: 0;
- background: #f5f5f5;
- }
- .a4-page {
- width: 210mm;
- min-height: 297mm;
- margin: 10mm auto;
- padding: 15mm 20mm;
- background: #fff;
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
- position: relative;
- box-sizing: border-box;
- page-break-after: always;
- }
- .a4-page:last-child {
- page-break-after: auto;
- }
- .page-header {
- position: absolute;
- top: 5mm;
- right: 10mm;
- font-size: 12px;
- color: #999;
- }
- .page-no {
- display: inline-block;
- padding: 2px 8px;
- background: #f0f0f0;
- border-radius: 4px;
- }
- .page-content {
- width: 100%;
- }
- .doc-title {
- font-size: 22px;
- font-weight: bold;
- margin-bottom: 20px;
- color: #333;
- }
- .section-title {
- font-size: 18px;
- font-weight: bold;
- margin: 20px 0 10px;
- color: #333;
- }
- .subsection-title {
- font-size: 15px;
- font-weight: bold;
- margin: 15px 0 8px;
- color: #333;
- }
- .content-text {
- font-size: 14px;
- line-height: 1.9;
- text-indent: 2em;
- color: #333;
- margin-bottom: 4px;
- }
- .fill {
- display: inline-block;
- min-width: 80px;
- border-bottom: 1px solid #333;
- padding: 0 4px;
- text-indent: 0;
- font-weight: 500;
- }
- .cover-fields {
- margin-bottom: 30px;
- }
- .cover-fields p {
- font-size: 15px;
- line-height: 2;
- }
- .label {
- display: inline-block;
- min-width: 100px;
- }
- .info-table {
- width: 100%;
- border-collapse: collapse;
- margin: 10px 0;
- font-size: 13px;
- }
- .info-table th,
- .info-table td {
- border: 1px solid #ddd;
- padding: 8px 10px;
- text-align: left;
- }
- .info-table th {
- background: #f9f9f9;
- font-weight: bold;
- width: 100px;
- text-align: center;
- }
- .sign-block {
- margin-top: 15px;
- }
- .sign-line {
- font-size: 14px;
- line-height: 1.8;
- margin: 8px 0;
- }
- .sign-page .sign-block {
- margin-top: 25px;
- }
- </style>
- <style>
- @media print {
- .el-drawer,
- .el-drawer__header,
- .el-drawer__body {
- overflow: visible !important;
- }
- .el-drawer {
- position: absolute !important;
- left: 0 !important;
- top: 0 !important;
- width: 100% !important;
- height: auto !important;
- box-shadow: none !important;
- }
- .el-drawer__header {
- display: none !important;
- }
- .contract-container {
- background: #fff !important;
- }
- .a4-page {
- display: block !important;
- margin: 0 !important;
- box-shadow: none !important;
- width: 210mm !important;
- min-height: 297mm !important;
- page-break-after: always;
- }
- .a4-page:last-child {
- page-break-after: auto;
- }
- @page {
- size: A4;
- margin: 0;
- }
- body {
- background: #fff !important;
- margin: 0 !important;
- padding: 0 !important;
- }
- }
- </style>
- ''')
- print('Script and Style sections appended successfully')
|