Kaynağa Gözat

去掉电子合同中一次性设施费

chenjun 1 ay önce
ebeveyn
işleme
abdd4ea88e

+ 12 - 6
src/views/elderly/contracts/ContractManageForm.vue

@@ -463,6 +463,12 @@ const toggleTextMode = () => {
 }
 
 const openAttachmentSelector = (attach: any) => {
+  if (attach.no == 3) {
+    const key = `attach_${attach.no}`
+    attachments[key] = { title: attach.title }
+    return
+  }
+
   selectorVisible.value = {
     show: true,
     current: `attach_${attach.no}`,
@@ -474,17 +480,17 @@ const openAttachmentSelector = (attach: any) => {
 const handleAttachmentDelete = (attach: any) => {
   const key = `attach_${attach.no}`
   // 固定内容附件(3=入住须知)删除后恢复默认展示
-  if (attach.no === 3) {
-    attachments[key] = { title: attach.title }
-  } else {
-    attachments[key] = null
-  }
+  // if (attach.no === 3) {
+  //   attachments[key] = { title: attach.title }
+  // } else {
+  attachments[key] = null
+  // }
   message.success(`已删除:${attach.title}`)
 }
 
 const handleAttachmentSelect = async (row: any) => {
   const key = selectorVisible.value.current
-  console.log('KEY值:', key, row, attachments)
+  //console.log('KEY值:', key, row, attachments)
   if (key) {
     const getDetail = attachmentDetailMap[key]
     let fullData = row

+ 3 - 6
src/views/elderly/contracts/components/ContractBody.vue

@@ -216,11 +216,8 @@ const calcMonthsBetween = (startStr: string, endStr: string): number | null => {
   const start = parseChineseDate(startStr)
   const end = parseChineseDate(endStr)
   if (!start || !end || end < start) return null
-  let months = (end.getFullYear() - start.getFullYear()) * 12 + (end.getMonth() - start.getMonth())
-  if (end.getDate() < start.getDate()) {
-    months--
-  }
-  return Math.max(0, months)
+  // 直接按"年月差"计算整月数,末尾差几天不影响(如 2026-08-15 → 2028-08-14 = 24 个月)
+  return (end.getFullYear() - start.getFullYear()) * 12 + (end.getMonth() - start.getMonth())
 }
 
 const isIdCardType = (papersType: any): boolean => {
@@ -1221,7 +1218,7 @@ watch(
           1.经协商,确定本合同期限为
           <FieldItem
             v-model="contractForm.contractMonths"
-            :is-text-mode="isTextMode"
+            :is-text-mode="true"
             width="60px"
             placeholder="12"
           />