From 8dcbe3d898f6c60ef3226095d994ca8953bf5f6d Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 03 十二月 2024 18:18:37 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/funingyunwei

---
 admin/.env                                                                                              |    2 
 admin/src/views/contract/components/addPaymentBill.vue                                                  |   19 ++
 admin/src/views/contract/components/contractEdit.vue                                                    |  137 +++++++++++++++----
 admin/src/views/login.vue                                                                               |    3 
 admin/src/views/contract/components/terminateLease.vue                                                  |   80 ++++++++---
 admin/src/views/contract/components/addCollectionBill.vue                                               |   17 +-
 server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java                                 |    2 
 admin/src/views/contract/contractList.vue                                                               |   15 ++
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java |    2 
 admin/src/views/contract/components/contractDetail.vue                                                  |   21 ++
 admin/src/views/finance/company.vue                                                                     |    2 
 admin/.env.test                                                                                         |    2 
 server/system_service/src/main/java/com/doumee/core/utils/DateCompare.java                              |   49 +++++-
 admin/src/views/contract/components/config.js                                                           |    4 
 admin/src/views/finance/components/companyEdit.vue                                                      |    4 
 admin/src/components/common/MemberSearch/src/index.vue                                                  |   13 +
 admin/src/views/finance/components/bullEditFu.vue                                                       |    4 
 17 files changed, 281 insertions(+), 95 deletions(-)

diff --git a/admin/.env b/admin/.env
index 2ec7c8a..af248a9 100644
--- a/admin/.env
+++ b/admin/.env
@@ -4,7 +4,7 @@
 VUE_APP_ROUTER_MODE = 'hash'
 
 # 椤圭洰涓婁笅鏂囪矾寰�
-VUE_APP_CONTEXT_PATH = '/fn_admin'
+VUE_APP_CONTEXT_PATH = '/'
 
 # 鎺ュ彛鍓嶇紑
 VUE_APP_API_PREFIX = '/gateway_interface'
diff --git a/admin/.env.test b/admin/.env.test
index ac3450e..0097b88 100644
--- a/admin/.env.test
+++ b/admin/.env.test
@@ -3,6 +3,6 @@
 
 # VUE_APP_API_URL  = 'http://192.168.5.13/gateway_interface'
 
-VUE_APP_API_URL  = 'http://192.168.0.162:10010/'
+VUE_APP_API_URL  = 'http://192.168.0.163:10010/'
 
 # VUE_APP_API_URL  = 'http://192.168.0.108:10030/'
diff --git a/admin/src/components/common/MemberSearch/src/index.vue b/admin/src/components/common/MemberSearch/src/index.vue
index 899b602..6d2a3a0 100644
--- a/admin/src/components/common/MemberSearch/src/index.vue
+++ b/admin/src/components/common/MemberSearch/src/index.vue
@@ -4,8 +4,9 @@
       <div class="df_ac mb20">
         <el-input v-model="modalSearchValue" placeholder="璇疯緭鍏ュ鎴峰悕绉�" class="w400" @keyup.enter.native="queryList">
         </el-input>
-        <el-button class="ml10" type="primary" @click="queryList()">鏌ヨ</el-button>
+        <el-button class="ml10 mr10" type="primary" @click="queryList()">鏌ヨ</el-button>
         <el-button class="ml10" @click="clear()">閲嶇疆</el-button>
+        <el-button class="ml10" type="primary" @click="$refs.operaYwCustomerWindow.open('鏂板缓瀹㈡埛')">鏂板缓瀹㈡埛</el-button>
       </div>
       <el-table ref="table" v-loading="listLoading" :data="list" element-loading-text="Loading" border fit
         :header-row-class-name="'table-header'" class="doumee-element-table doumee-element-tableb"
@@ -53,8 +54,12 @@
           </template>
         </el-table-column>
       </el-table>
-      <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" />
+      <div style="text-align: right; margin-top: 15px;">
+        <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" />
+      </div>
     </div>
+    <!-- 鏂板缓/淇敼 -->
+    <OperaYwCustomerWindow ref="operaYwCustomerWindow" @success="clear" />
   </GlobalWindow>
 </template>
 
@@ -62,10 +67,12 @@
 import { fetchList } from '@/api/customer'
 import GlobalWindow from '@/components/common/GlobalWindow'
 import Pagination from '@/components/common/Pagination'
+import OperaYwCustomerWindow from '@/views/client/components/OperaYwCustomerWindow'
 export default {
   components: {
     Pagination,
-    GlobalWindow
+    GlobalWindow,
+    OperaYwCustomerWindow
   },
   props: {
     isShowChooseBtn: {
diff --git a/admin/src/views/contract/components/addCollectionBill.vue b/admin/src/views/contract/components/addCollectionBill.vue
index 23a35cb..4a1bb80 100644
--- a/admin/src/views/contract/components/addCollectionBill.vue
+++ b/admin/src/views/contract/components/addCollectionBill.vue
@@ -10,7 +10,7 @@
             <div class="main_content">
                 <el-form :model="form" label-position="top" ref="form" :rules="rules">
                     <div class="head">
-                        <div class="m_title">鍩虹淇℃伅-{{time.startDate}}~{{time.endDate}}</div>
+                        <div class="m_title">鍩虹淇℃伅</div>
                         <div class="tabs">
                             <div class="tab" :class="{ active: form.feeType === 0 }" @click="timeTabClick(0)">鍛ㄦ湡璐圭敤</div>
                             <div class="tab" :class="{ active: form.feeType === 1 }" @click="timeTabClick(1)">涓�娆℃�ц垂鐢�</div>
@@ -85,11 +85,9 @@
     extends: BaseOpera,
     data () {
       const validateArr = (rule, value, callback) => {
-        if (value.length === 0 || !value) {
-          callback(new Error('璇烽�夋嫨'));
-        } else {
-          callback();
-        }
+        if (!value) return callback(new Error('璇烽�夋嫨'));
+        if (!value.length === 0) return callback(new Error('璇烽�夋嫨'));
+        callback();
       };
       return {
         form: {
@@ -126,7 +124,7 @@
             { required: true, message: '璇烽�夋嫨', trigger: 'blur' }
           ],
           date: [
-            { validator: validateArr, trigger: 'blur' }
+            { required: true, validator: validateArr, trigger: 'blur' }
           ],
           receivableFee: [
             { required: true, message: '璇疯緭鍏�', trigger: 'blur' }
@@ -143,14 +141,15 @@
     },
     methods: {
       open (title, target, time) {
+        var that = this
         this.title = title
         this.time.startDate = time.startDate
         this.time.endDate = time.endDate
         this.pickerOptions = {
           disabledDate(time) {
             // 濡傛灉娌℃湁鍚庨潰鐨� -8.64e7 灏辨槸涓嶅彲浠ラ�夋嫨浠婂ぉ鐨�
-            const beginDate = new Date(time.startDate).getTime() - 8.64e7
-            const endDate = new Date(time.endDate).getTime() - 8.64e7
+            const beginDate = new Date(that.time.startDate).getTime() - 8.64e7
+            const endDate = new Date(that.time.endDate).getTime()
             return beginDate > time.getTime() || endDate < time.getTime()
           }
         }
diff --git a/admin/src/views/contract/components/addPaymentBill.vue b/admin/src/views/contract/components/addPaymentBill.vue
index bb673a1..de9790e 100644
--- a/admin/src/views/contract/components/addPaymentBill.vue
+++ b/admin/src/views/contract/components/addPaymentBill.vue
@@ -34,6 +34,7 @@
                                 range-separator="鑷�"
                                 v-model="form.date"
                                 @change="changeDate"
+                                :picker-options="pickerOptions"
                                 start-placeholder="寮�濮嬫棩鏈�"
                                 end-placeholder="缁撴潫鏃ユ湡"
                                 value-format="yyyy-MM-dd"
@@ -97,12 +98,18 @@
           startDate: '',
           endDate: '',
           price: 0,
+          feeType: 0,
           receivableFeeCopy: '',
           receivableFee: '',
           planPayDate: '',
           billType: 1,
           billTypeCopy: 1,
           date: []
+        },
+        pickerOptions: {},
+        time: {
+          startDate: '',
+          endDate: ''
         },
         rules: {
           contractCode: [
@@ -131,8 +138,18 @@
       }
     },
     methods: {
-      open (title, target) {
+      open (title, target, time) {
+        var that = this
         this.title = title
+        this.time.startDate = time.startDate
+        this.time.endDate = time.endDate
+        this.pickerOptions = {
+          disabledDate(time) {
+            const beginDate = new Date(that.time.startDate).getTime() - 8.64e7
+            const endDate = new Date(that.time.endDate).getTime()
+            return beginDate > time.getTime() || endDate < time.getTime()
+          }
+        }
         this.getCompanyList()
         this.visible = true
         // 鏂板缓
diff --git a/admin/src/views/contract/components/config.js b/admin/src/views/contract/components/config.js
index cc65589..c094419 100644
--- a/admin/src/views/contract/components/config.js
+++ b/admin/src/views/contract/components/config.js
@@ -12,8 +12,6 @@
   memberName: [{ required: true, message: '璇烽�夋嫨' }],
   zlDeposit: [{ required: true, message: '璇疯緭鍏�' }],
   zlPayType: [{ required: true, message: '璇烽�夋嫨' }],
-  zlDate: [{ required: true, message: '璇烽�夋嫨' }],
   wyDeposit: [{ required: true, message: '璇疯緭鍏�' }],
-  wyPayType: [{ required: true, message: '璇烽�夋嫨' }],
-  wyDate: [{ required: true, message: '璇烽�夋嫨' }]
+  wyPayType: [{ required: true, message: '璇烽�夋嫨' }]
 }
diff --git a/admin/src/views/contract/components/contractDetail.vue b/admin/src/views/contract/components/contractDetail.vue
index d7beef3..f13cf9a 100644
--- a/admin/src/views/contract/components/contractDetail.vue
+++ b/admin/src/views/contract/components/contractDetail.vue
@@ -2,6 +2,7 @@
   <GlobalWindow
     :title="title"
     :visible.sync="visible"
+    :withFooter="false"
     :confirm-working="isWorking"
     @close="close"
     @confirm="confirm">
@@ -9,9 +10,10 @@
       <div class="left">
         <span class="mr10">鍗曚綅鍚嶇О锛歿{info.renterName}}</span>
         <el-tag type="success" v-if="info.status === 0">寰呮墽琛�</el-tag>
-        <el-tag type="success" v-if="info.status === 1">鎵ц涓�</el-tag>
-        <el-tag type="success" v-if="info.status === 2">宸插埌鏈�</el-tag>
-        <el-tag type="success" v-if="info.status === 3">宸查��绉�</el-tag>
+        <el-tag type="success" v-if="info.status === 1">姝e父鎵ц涓�</el-tag>
+        <el-tag type="info" v-if="info.status === 2">宸插埌鏈�</el-tag>
+        <el-tag type="info" v-if="info.status === 3">閫�绉熺粨绠椾腑</el-tag>
+        <el-tag type="info" v-if="info.status === 4">宸查��绉�</el-tag>
       </div>
       <el-button plain type="danger" v-if="[0, 1, 2].includes(info.status)" @click="refund">閫�绉�</el-button>
     </div>
@@ -178,6 +180,7 @@
           label="璐﹀崟閲戦">
         </el-table-column>
         <el-table-column
+          :key="Date.now()"
           prop="receivableFee"
           label="搴旀敹閲戦">
         </el-table-column>
@@ -188,6 +191,11 @@
         <el-table-column
           prop="needReceivableFee"
           label="闇�鏀堕噾棰�">
+          <template slot-scope="{row}">
+            <el-tag type="success" v-if="row.needReceivableFee > 0">鏀�</el-tag>
+            <el-tag type="warning" v-else>浠�</el-tag>
+            <span style="margin-left: 10px;">{{Math.abs(row.needReceivableFee)}}</span>
+          </template>
         </el-table-column>
         <el-table-column
           label="璐﹀崟鏉ユ簮">
@@ -243,14 +251,20 @@
         border
         style="width: 100%">
         <el-table-column
+          :key="Date.now()"
+          width="200"
           prop="param1"
           label="鎿嶄綔浜�">
         </el-table-column>
         <el-table-column
+          :key="Date.now()"
+          width="200"
           prop="createDate"
           label="鎿嶄綔鏃堕棿">
         </el-table-column>
         <el-table-column
+          :key="Date.now()"
+          width="150"
           label="鎿嶄綔">
           <template slot-scope="{row}">
             <span v-if="row.objType === 0">宸ュ崟鍒涘缓</span>
@@ -262,6 +276,7 @@
           </template>
         </el-table-column>
         <el-table-column
+          :key="Date.now()"
           prop="content"
           label="鎿嶄綔鍐呭">
         </el-table-column>
diff --git a/admin/src/views/contract/components/contractEdit.vue b/admin/src/views/contract/components/contractEdit.vue
index d98469e..fd529c4 100644
--- a/admin/src/views/contract/components/contractEdit.vue
+++ b/admin/src/views/contract/components/contractEdit.vue
@@ -1,9 +1,17 @@
 <template>
-  <GlobalWindow width="100%" :title="title" :visible.sync="visible" :confirm-working="isWorking" @close="close"
-    @confirm="confirm">
-    <div class="tabs">
-      <div class="tab" :class="{ active: activeTabs === 0 }" @click="tabsClick(0)">1銆佸熀鏈俊鎭�</div>
-      <div class="tab" :class="{ active: activeTabs === 1 }" @click="tabsClick(1)">2銆佽垂鐢ㄦ潯娆�</div>
+<!--  :text="activeTabs === 0 ? '涓嬩竴姝�' : '鎻愪氦'"-->
+<!--  :backText="activeTabs === 0 ? '杩斿洖' : '涓婁竴姝�'"-->
+  <GlobalWindow
+    width="100%"
+    :title="title"
+    :withFooter="false"
+    :visible.sync="visible"
+    :confirm-working="isWorking"
+    @confirm="confirm"
+    @close="close">
+    <div class="tabs fixed">
+      <div class="tab" :class="{ active: activeTabs === 0 }">1銆佸熀鏈俊鎭�</div>
+      <div class="tab" :class="{ active: activeTabs === 1 }">2銆佽垂鐢ㄦ潯娆�</div>
     </div>
     <div v-show="activeTabs === 0">
       <div class="main">
@@ -25,13 +33,13 @@
                 </el-select>
               </el-form-item>
               <el-form-item label="鍚堝悓绛捐鏃ユ湡" prop="signDate">
-                <el-date-picker type="date" v-model="form.signDate" value-format="yyyy-MM-dd" placeholder="璇烽�夋嫨" />
+                <el-date-picker type="date" v-model="form.signDate" value-format="yyyy-MM-dd" :clearable="false" placeholder="璇烽�夋嫨" />
               </el-form-item>
               <el-form-item label="鍚堝悓寮�濮嬫棩鏈�" prop="startDate">
-                <el-date-picker type="date" v-model="form.startDate" value-format="yyyy-MM-dd" placeholder="璇烽�夋嫨" />
+                <el-date-picker type="date" v-model="form.startDate" @change="getHouseData" :clearable="false" value-format="yyyy-MM-dd" placeholder="璇烽�夋嫨" />
               </el-form-item>
               <el-form-item label="鍚堝悓缁撴潫鏃ユ湡" prop="endDate">
-                <el-date-picker type="date" v-model="form.endDate" value-format="yyyy-MM-dd" placeholder="璇烽�夋嫨" />
+                <el-date-picker type="date" v-model="form.endDate" @change="getHouseData" :clearable="false" value-format="yyyy-MM-dd" placeholder="璇烽�夋嫨" />
               </el-form-item>
               <el-form-item label="褰掑睘椤圭洰" prop="projectId">
                 <el-select v-model="form.projectId" placeholder="璇烽�夋嫨">
@@ -131,8 +139,8 @@
                     <el-date-picker type="daterange" v-model="item.time" @change="getDate1($event, index)" value-format="yyyy-MM-dd" placeholder="璇烽�夋嫨" />
                   </el-form-item>
                   <el-form-item label="鍚堝悓鍗曚环" prop="price">
-                    <el-input placeholder="璇疯緭鍏�" v-model="item.price">
-                      <el-select v-model="item.circleType" slot="append" placeholder="璇烽�夋嫨">
+                    <el-input placeholder="璇疯緭鍏�" v-model="item.price" class="input-with-select">
+                      <el-select v-model="item.circleType" style="width: 150px;" slot="append" placeholder="璇烽�夋嫨">
                         <el-option v-for="(item, index) in unitOps" :key="index" :value="item.value" :label="item.name"></el-option>
                       </el-select>
                     </el-input>
@@ -173,11 +181,15 @@
             </template>
           </el-table-column>
           <el-table-column prop="planPayDate" label="浠樻鏃�" align="center" show-overflow-tooltip />
-          <el-table-column prop="receivableFee" label="搴旀敹" align="center" show-overflow-tooltip />
+          <el-table-column label="搴旀敹" align="center" show-overflow-tooltip>
+            <template slot-scope="{row}">
+              {{row.receivableFee}}鍏�
+            </template>
+          </el-table-column>
         </el-table>
         <div class="total">
           <span>鎬昏</span>
-          <div>璐圭敤搴旀敹鎬昏锛歿{zlPrice}}锛屾娂閲戝簲鏀舵�昏锛歿{form.zlDeposit}}</div>
+          <div>璐圭敤搴旀敹鎬昏锛歿{zlPrice}}鍏冿紝鎶奸噾搴旀敹鎬昏锛歿{form.zlDeposit}}鍏�</div>
         </div>
       </div>
       <!--   鐗╀笟鏉℃   -->
@@ -211,7 +223,7 @@
                   </el-form-item>
                   <el-form-item label="鍚堝悓鍗曚环" prop="price">
                     <el-input placeholder="璇疯緭鍏�" v-model="item.price">
-                      <el-select v-model="item.circleType" slot="append" placeholder="璇烽�夋嫨">
+                      <el-select v-model="item.circleType" style="width: 150px;" slot="append" placeholder="璇烽�夋嫨">
                         <el-option v-for="(item, index) in unitOps" :key="index" :value="item.value" :label="item.name"></el-option>
                       </el-select>
                     </el-input>
@@ -252,13 +264,24 @@
             </template>
           </el-table-column>
           <el-table-column prop="planPayDate" label="浠樻鏃�" align="center" show-overflow-tooltip />
-          <el-table-column prop="receivableFee" label="搴旀敹" align="center" show-overflow-tooltip />
+          <el-table-column prop="receivableFee" label="搴旀敹" align="center" show-overflow-tooltip>
+            <template slot-scope="{row}">
+              {{row.receivableFee}}鍏�
+            </template>
+          </el-table-column>
         </el-table>
         <div class="total">
           <span>鎬昏</span>
-          <div>璐圭敤搴旀敹鎬昏锛歿{wyPrice}}锛屾娂閲戝簲鏀舵�昏锛歿{form.wyDeposit}}</div>
+          <div>璐圭敤搴旀敹鎬昏锛歿{wyPrice}}鍏冿紝鎶奸噾搴旀敹鎬昏锛歿{form.wyDeposit}}鍏�</div>
         </div>
       </div>
+    </div>
+    <div class="window__footer" style="position: sticky; bottom: 0; left: 0; z-index: 9; background: #ffffff;">
+      <slot name="footer">
+        <el-button @click="confirm" :loading="confirmWorking" type="primary">{{activeTabs === 0 ? '涓嬩竴姝�' : '鎻愪氦'}}</el-button>
+        <slot name="btns" />
+        <el-button @click="close">{{activeTabs === 0 ? '杩斿洖' : '涓婁竴姝�'}}</el-button>
+      </slot>
     </div>
     <!-- 閫夋嫨绉熷 -->
     <MemberSearch ref="MemberSearchRef" @select="getTenant" />
@@ -387,17 +410,47 @@
       this.getUser()
       this.getProject()
       this.getCompany()
-      this.getHouseTree()
       this.visible = true
       this.$nextTick(() => {
+        this.$refs.form.resetFields()
         for (const key in this.form) {
           if (['roomIds', 'fileList', 'wyDate', 'zlDate'].includes(key)) {
             this.form[key] = []
           } else {
-            this.form[key] = target[key]
+            this.form[key] = ''
           }
         }
+        this.form.zlDetailList = [
+          {
+            startDate: '',
+            endDate: '',
+            time: [],
+            price: '',
+            advanceDays: ''
+          }
+        ]
+        this.form.wyDetailList = [
+          {
+            startDate: '',
+            endDate: '',
+            time: [],
+            price: '',
+            advanceDays: ''
+          }
+        ]
+        this.wyList = []
+        this.zlList = []
+        this.form.userId = this.userInfo.id
+        this.form.signDate = this.getDayTime()
+        this.form.startDate = this.getDayTime()
+        this.form.endDate = this.getDayTime(1)
+        this.getHouseTree()
       })
+    },
+    getHouseData () {
+      if (this.form.startDate && this.form.endDate) {
+        this.getHouseTree()
+      }
     },
     changeType (e) {
       if (e === 0 || e === 2) {
@@ -406,11 +459,24 @@
         this.cactiveTabs = 1
       }
     },
+    getDayTime (num) {
+      const today = new Date();
+      const year = today.getFullYear();
+      const month = today.getMonth() + 1; // 鏈堜唤鏄粠 0 寮�濮嬬殑锛屽洜姝ら渶瑕佸姞 1
+      const day = today.getDate();
+      if (!num) {
+        return `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;
+      } else {
+        return `${year + 1}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;
+      }
+    },
     confirm () {
-      this.$refs.form.validate((valid) => {
-        if (!valid) {
-          return
-        }
+      if (this.activeTabs === 0) {
+        this.$refs.form.validate((valid) => {
+          if (!valid) return
+          this.activeTabs = 1
+        })
+      } else if (this.activeTabs === 1) {
         if (this.form.type === 0) {
           this.$refs.paramCostRef.validate((valid1) => {
             if (!valid1) {
@@ -438,7 +504,7 @@
             this.submit()
           })
         }
-      })
+      }
     },
     submit () {
       // 璋冪敤鏂板缓鎺ュ彛
@@ -471,7 +537,10 @@
       this.form.roomIds = arr.filter(item => item !== undefined);
     },
     getHouseTree () {
-      tree({})
+      tree({
+        startDate: this.form.startDate,
+        endDate: this.form.endDate
+      })
         .then(res => {
           res.forEach(item => {
             item.disabled = true
@@ -490,30 +559,30 @@
       }
     },
     generateZL () {
-      getBillList({ ...this.form })
+      getBillList({ ...this.form, billType: 0 })
         .then(res => {
           let zlPrice = 0
           let arr = []
           res.forEach(item => {
             if (item.costType === 0) {
               zlPrice += item.receivableFee
-              arr.push(item)
             }
+            arr.push(item)
           })
           this.zlPrice = zlPrice
           this.zlList = arr
         })
     },
     generateWY () {
-      getBillList({ ...this.form })
+      getBillList({ ...this.form, billType: 1 })
         .then(res => {
           let zlPrice = 0
           let arr = []
           res.forEach(item => {
             if (item.costType === 1) {
               zlPrice += item.receivableFee
-              arr.push(item)
             }
+            arr.push(item)
           })
           this.wyPrice = zlPrice
           this.wyList = arr
@@ -582,6 +651,7 @@
       companyList({ type: 2 })
         .then(res => {
           this.comparyList = res
+          this.form.companyId = res[0].id
         })
     },
     tabsClick (val) {
@@ -631,7 +701,11 @@
       this.form.fileList.push({ ...item, fileurl: item.imgaddr, name: item.originname, userName: this.userInfo.realname, createTime: this.getDay() })
     },
     close () {
-      this.$emit('close')
+      if (this.activeTabs === 0) {
+        this.$emit('close')
+      } else {
+        this.activeTabs = 0
+      }
     }
   }
 }
@@ -639,7 +713,12 @@
 
 <style lang="scss" scoped>
 @import '@/assets/style/variables.scss';
-
+.fixed {
+  background: #ffffff;
+  position: sticky;
+  top: 0;
+  left: 0;
+}
 .tabs {
   border-bottom: 1px solid #DFE2E8;
   display: flex;
diff --git a/admin/src/views/contract/components/terminateLease.vue b/admin/src/views/contract/components/terminateLease.vue
index 31fda94..6bb8929 100644
--- a/admin/src/views/contract/components/terminateLease.vue
+++ b/admin/src/views/contract/components/terminateLease.vue
@@ -24,7 +24,6 @@
                             </el-select>
                         </el-form-item>
                         <el-form-item label="閫�绉熸棩鏈�" prop="btDate" style="width: 33%;">
-<!--                            @change="changeBtDate"-->
                             <el-date-picker
                                 v-model="form.btDate"
                                 type="date"
@@ -197,12 +196,16 @@
   import AddPaymentBill from './addPaymentBill'
   import { getUserList } from '@/api/system/user'
   import { backRent, getCanBackBill } from '@/api/contract'
+  import { mapState } from 'vuex'
   export default {
     name: "terminateLease",
     components: {
       GlobalWindow,
       AddCollectionBill,
       AddPaymentBill
+    },
+    computed: {
+      ...mapState(['userInfo'])
     },
     extends: BaseOpera,
     data() {
@@ -245,30 +248,33 @@
       }
     },
     watch: {
-      info: {
-        deep: true,
-        immediate: true,
-        handler(news, olds) {
-          const arr = [...this.info.terminateList, ...this.info.depositList]
-          let total1 = 0
-          let total2 = 0
-          arr.forEach(item => {
-            if (item.billType === 0) {
-              total1 += Number(item.price)
-            } else if (item.billType === 1) {
-              total2 += Number(item.price)
-            }
-          })
-          this.receivable = total1
-          this.meet = total2
-        }
-      }
+      // info: {
+      //   deep: true,
+      //   immediate: true,
+      //   handler(news, olds) {
+      //     const arr = [...this.info.terminateList, ...this.info.depositList]
+      //     let total1 = 0
+      //     let total2 = 0
+      //     arr.forEach(item => {
+      //       if (item.billType === 0) {
+      //         total1 += Number(item.price)
+      //       } else if (item.billType === 1) {
+      //         total2 += Number(item.price)
+      //       }
+      //     })
+      //     this.receivable = total1
+      //     this.meet = total2
+      //   }
+      // }
     },
     methods: {
       open (title, info) {
         this.title = title
         this.info = info
         this.form.id = info.id
+        this.form.btSignDate = this.getDay()
+        console.log(this.userInfo)
+        this.form.btUserId = this.userInfo.id
         this.$nextTick(() => {
           this.$refs.form.resetFields()
         })
@@ -294,8 +300,30 @@
             return item
           }
         })
+        this.countData()
         this.getUser()
         this.visible = true
+      },
+      countData () {
+        const arr = [...this.info.terminateList, ...this.info.depositList]
+        let total1 = 0
+        let total2 = 0
+        arr.forEach(item => {
+          if (item.billType === 0) {
+            total1 += Number(item.price)
+          } else if (item.billType === 1) {
+            total2 += Number(item.price)
+          }
+        })
+        this.receivable = total1
+        this.meet = total2
+      },
+      getDay () {
+        const today = new Date();
+        const year = today.getFullYear();
+        const month = today.getMonth() + 1; // 鏈堜唤鏄粠 0 寮�濮嬬殑锛屽洜姝ら渶瑕佸姞 1
+        const day = today.getDate();
+        return `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;
       },
       addZD () {
         if (!this.form.btDate) return this.$message.warning('璇烽�夋嫨閫�绉熸棩鏈�')
@@ -317,6 +345,7 @@
           renterName: this.info.renterName,
           renterId: this.info.renterId,
           billType: 1,
+          feeType: 0,
           billTypeCopy: 1
         }, { startDate: this.info.startDate, endDate: this.form.btDate })
       },
@@ -337,16 +366,18 @@
               return item
             }
           })
+          this.countData()
         }).finally(() => {
           this.loading = false
         })
       },
       getObjS (obj) {
         this.info.terminateList.push(obj)
-        this.info.terminateList.forEach(item => {
-          item.receivableFee = Number(item.receivableFee) + 1
-          item.receivableFee = Number(item.receivableFee) - 1
-        })
+        // this.info.terminateList.forEach(item => {
+        //   item.receivableFee = Number(item.receivableFee) + 1
+        //   item.receivableFee = Number(item.receivableFee) - 1
+        // })
+        this.countData()
       },
       confirm () {
         this.$refs.form.validate((valid) => {
@@ -388,6 +419,7 @@
         if (Number(num) > row.receivableFeeCopy) {
           row.receivableFee = ''
           row.price = 0
+          this.countData()
           this.$message.warning('涓嶈兘澶т簬鍘熷搴旀敹浠橀噾棰�')
         } else {
           if (num) {
@@ -413,9 +445,9 @@
           } else {
             row.price = 0
             row.billType = row.billTypeCopy
-            console.log('billTypeCopy', row.billTypeCopy)
           }
           row.price = Math.abs(row.price);
+          this.countData()
         }
       }
     }
diff --git a/admin/src/views/contract/contractList.vue b/admin/src/views/contract/contractList.vue
index d4709f6..13a9176 100644
--- a/admin/src/views/contract/contractList.vue
+++ b/admin/src/views/contract/contractList.vue
@@ -12,7 +12,20 @@
       <el-table-column prop="renterName" label="瀹㈡埛鍚嶇О" min-width="100" show-overflow-tooltip />
       <el-table-column prop="startDate" label="寮�濮嬫棩鏈�" min-width="100" show-overflow-tooltip />
       <el-table-column prop="endDate" label="缁撴潫鏃ユ湡" min-width="100" show-overflow-tooltip />
-<!--      <el-table-column label="绉熻祦鍗曚环" min-width="100" show-overflow-tooltip></el-table-column>-->
+        <el-table-column prop="zlFirstPrice" label="绉熻祦鍗曚环" min-width="100" show-overflow-tooltip>
+            <template slot-scope="{row}">
+                <div style="display: flex; align-items: center;">
+                    <span>{{row.zlFirstPrice}}</span>
+                    <span v-if="row.zlFirstCircle === 0">鍏�/m虏路澶�</span>
+                    <span v-if="row.zlFirstCircle === 1">鍏�/m虏路鏈�</span>
+                    <span v-if="row.zlFirstCircle === 2">鍏�/澶�</span>
+                    <span v-if="row.zlFirstCircle === 3">鍏�/鏈�</span>
+                    <span v-if="row.zlFirstCircle === 4">鍏�/骞�</span>
+                    <span v-if="row.zlFirstCircle === 5">鍏�/m虏路骞�</span>
+                    <span v-if="row.zlFirstCircle === 6">鍏�/鍦�</span>
+                </div>
+            </template>
+        </el-table-column>
       <el-table-column prop="totalArea" label="绉熻祦闈㈢Н" min-width="100" show-overflow-tooltip />
       <el-table-column prop="signDate" label="绛捐鏃�" min-width="100" show-overflow-tooltip />
       <el-table-column prop="code" label="鍚堝悓缂栧彿" min-width="100" show-overflow-tooltip />
diff --git a/admin/src/views/finance/company.vue b/admin/src/views/finance/company.vue
index 36e48b1..5f2b7ee 100644
--- a/admin/src/views/finance/company.vue
+++ b/admin/src/views/finance/company.vue
@@ -7,7 +7,7 @@
     </div>
     <el-table v-loading="loading" :data="list" stripe>
       <el-table-column prop="name" label="鍏徃鍚嶇О" min-width="100" show-overflow-tooltip />
-      <el-table-column prop="shortName" label="鍏徃绠�浠�" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="shortName" label="鍏徃绠�绉�" min-width="100" show-overflow-tooltip />
       <el-table-column prop="code" label="绾崇◣璇嗗埆鍙�" min-width="100" show-overflow-tooltip />
       <el-table-column prop="address" label="鍏徃鍦板潃" min-width="100" show-overflow-tooltip />
       <el-table-column prop="accountNum" label="鏀舵敮璐︽埛鏁伴噺" min-width="100" show-overflow-tooltip />
diff --git a/admin/src/views/finance/components/bullEditFu.vue b/admin/src/views/finance/components/bullEditFu.vue
index 82f2833..723cd41 100644
--- a/admin/src/views/finance/components/bullEditFu.vue
+++ b/admin/src/views/finance/components/bullEditFu.vue
@@ -13,8 +13,8 @@
                                 <el-option v-for="(item, index) in contract" :key="index" :value="item.id" :label="item.code"></el-option>
                             </el-select>
                         </el-form-item>
-                        <el-form-item label="浠樻鏂�" prop="renterName">
-                            <el-input v-model="form.renterName" disabled placeholder="璇疯緭鍏ュ簲鏀堕噾棰�" v-trim />
+                        <el-form-item label="鏀舵鏂�" prop="renterName">
+                            <el-input v-model="form.renterName" disabled placeholder="鏀舵鏂�" v-trim />
                         </el-form-item>
                         <el-form-item label="鎴挎簮" prop="ywContractRoomList">
                             <el-select v-model="form.ywContractRoomList" multiple placeholder="璇烽�夋嫨">
diff --git a/admin/src/views/finance/components/companyEdit.vue b/admin/src/views/finance/components/companyEdit.vue
index 0ab2eeb..2b5005b 100644
--- a/admin/src/views/finance/components/companyEdit.vue
+++ b/admin/src/views/finance/components/companyEdit.vue
@@ -5,7 +5,7 @@
       <el-form-item label="鍏徃鍚嶇О" prop="name">
         <el-input v-model="param.name" placeholder="璇疯緭鍏�" v-trim />
       </el-form-item>
-      <el-form-item label="鍏徃绠�浠�" prop="shortName">
+      <el-form-item label="鍏徃绠�绉�" prop="shortName">
         <el-input v-model="param.shortName" placeholder="璇疯緭鍏�" v-trim />
       </el-form-item>
       <el-form-item label="绾崇◣璇嗗埆鍙�">
@@ -90,4 +90,4 @@
 }
 </script>
 
-<style lang="scss" scoped></style>
\ No newline at end of file
+<style lang="scss" scoped></style>
diff --git a/admin/src/views/login.vue b/admin/src/views/login.vue
index ddcbbeb..a728dbc 100644
--- a/admin/src/views/login.vue
+++ b/admin/src/views/login.vue
@@ -127,7 +127,6 @@
           uuid: this.captcha.uuid
         })
           .then((res) => {
-            // window.location.href = process.env.VUE_APP_CONTEXT_PATH
             if (this.isRemPsd) {
               localStorage.setItem('username', this.username.trim())
               localStorage.setItem('password', this.password.trim())
@@ -138,7 +137,7 @@
               localStorage.removeItem('isRemPsd')
             }
             Cookies.set('dm_user_token', res)
-            this.$router.push('index')
+            window.location.href = process.env.VUE_APP_CONTEXT_PATH
           })
           .catch(e => {
             this.refreshCaptcha()
diff --git a/server/system_service/src/main/java/com/doumee/core/utils/DateCompare.java b/server/system_service/src/main/java/com/doumee/core/utils/DateCompare.java
index be6c0ff..e6be864 100644
--- a/server/system_service/src/main/java/com/doumee/core/utils/DateCompare.java
+++ b/server/system_service/src/main/java/com/doumee/core/utils/DateCompare.java
@@ -45,10 +45,11 @@
      */
     public static DateCompare dayCompare(Date fromDate,Date toDate,Date freeStart,Date freeEnd){
         //寮�濮嬫椂闂村線鍚庡欢浼革紝闄ゅ幓鏈夋晥鏃舵湡
-        fromDate = DateUtil.addDaysToDate(fromDate,getIntersectingDays(fromDate,toDate,freeStart,freeEnd));
-        if(toDate.getTime()<= fromDate.getTime()){
+        fromDate = DateUtil.addDaysToDate(fromDate,getIntersectingDays(fromDate,DateUtil.addDaysToDate(toDate,1),freeStart,DateUtil.addDaysToDate(freeEnd,1)));
+        if(toDate.getTime()<  fromDate.getTime()){
             return DateCompare.builder().day(0).month(0).year(0).yearFloat(new BigDecimal(0)).monthFloat(new BigDecimal(0)).build();
         }
+        toDate = DateUtil.addDaysToDate(toDate,1);//鍖呭惈鎴鏃ユ湡
         Calendar  from  =  Calendar.getInstance();
         from.setTime(fromDate);
         Calendar  to  =  Calendar.getInstance();
@@ -62,31 +63,45 @@
 
         int year = toYear  -  fromYear;
         int month = toYear *  12  + toMonth  -  (fromYear  *  12  +  fromMonth);
-        int day = (int) ((to.getTimeInMillis()  -  from.getTimeInMillis())  /  (24  *  3600  *  1000));
+        int day = DateUtil.daysBetweenDates( toDate,fromDate);
         BigDecimal yearFloat = new BigDecimal(year) ;
         BigDecimal monthFloat = new BigDecimal(month) ;
 
-        int yearDays = day - DateUtil.daysBetweenDates(DateUtil.addYearToDate(fromDate,year),fromDate) ;
+        int yearDays = day - (DateUtil.daysBetweenDates(DateUtil.addYearToDate(fromDate,year),fromDate)+1);
         if(yearDays!=0){
+            if(yearDays <0){
+                year = year-1;
+                yearFloat = new BigDecimal(year) ;
+                yearDays =DateUtil.daysBetweenDates(toDate,DateUtil.addYearToDate(fromDate,year));
+            }
             yearFloat = yearFloat.add(new BigDecimal(1.0*yearDays).divide(new BigDecimal(365.0), 15,RoundingMode.HALF_UP));
         }
-        int monthDays = day - DateUtil.daysBetweenDates(DateUtil.addMonthToDate(fromDate,month),fromDate) ;
+        int monthDays = day - (DateUtil.daysBetweenDates(DateUtil.addMonthToDate(fromDate,month),fromDate)+1) ;
         if(monthDays!=0){
+            if(monthDays <0){
+                month = month-1;
+                monthFloat = new BigDecimal(month) ;
+                monthDays =DateUtil.daysBetweenDates(toDate,DateUtil.addMonthToDate(fromDate,month));
+            }
             monthFloat = monthFloat.add(new BigDecimal(1.0*monthDays*12).divide(new BigDecimal(365.0), 15,RoundingMode.HALF_UP));
         }
         return DateCompare.builder().day(day).month(month).year(year).yearFloat(yearFloat).monthFloat(monthFloat).yearDays(yearDays).monthDays(monthDays).build();
     }
 
     public static void main(String[] args) {
-        DateCompare dateCompare =   DateCompare.dayCompare(DateUtil.getDateFromString("2024-12-01 00:00:00"),DateUtil.getDateByString("2024-12-31 00:00:00")
-                ,DateUtil.getDateFromString("2024-12-01 00:00:00"),DateUtil.getDateFromString("2024-12-02 00:00:00"));
+        DateCompare dateCompare =   DateCompare.monthYearCompare(DateUtil.getDateFromString("2024-12-02 00:00:00"),DateUtil.getDateByString("2025-01-02 00:00:00") );
+        System.out.println(dateCompare.day);
+        System.out.println(dateCompare.monthDays);
+        System.out.println(dateCompare.month);
         System.out.println(dateCompare.monthFloat);
+        System.out.println("=========year=============");
+        System.out.println(dateCompare.yearDays);
+        System.out.println(dateCompare.year);
         System.out.println(dateCompare.yearFloat);
-        System.out.println(dateCompare.yearFloat.multiply(new BigDecimal(365.0)));
-        System.out.println(new BigDecimal(29.0).divide(new BigDecimal(365.0),12,  RoundingMode.HALF_UP).multiply(new BigDecimal(365.0)));
     }
     public static DateCompare monthYearCompare(Date fromDate,Date toDate ){
         //寮�濮嬫椂闂村線鍚庡欢浼革紝闄ゅ幓鏈夋晥鏃舵湡
+        toDate =DateUtil.addDaysToDate(toDate, 1);
         Calendar  from  =  Calendar.getInstance();
         from.setTime(fromDate);
         Calendar  to  =  Calendar.getInstance();
@@ -104,12 +119,22 @@
         BigDecimal yearFloat = new BigDecimal(year) ;
         BigDecimal monthFloat = new BigDecimal(month) ;
 
-        int yearDays = day - DateUtil.daysBetweenDates(DateUtil.addYearToDate(fromDate,year),fromDate) ;
+        int yearDays = day - (DateUtil.daysBetweenDates(DateUtil.addYearToDate(fromDate,year),fromDate)+1);
         if(yearDays!=0){
+            if(yearDays <0){
+                year = year-1;
+                yearFloat = new BigDecimal(year) ;
+                yearDays =DateUtil.daysBetweenDates(toDate,DateUtil.addYearToDate(fromDate,year));
+            }
             yearFloat = yearFloat.add(new BigDecimal(1.0*yearDays).divide(new BigDecimal(365.0), 15,RoundingMode.HALF_UP));
         }
-        int monthDays = day - DateUtil.daysBetweenDates(DateUtil.addMonthToDate(fromDate,month),fromDate) ;
+        int monthDays = day - (DateUtil.daysBetweenDates(DateUtil.addMonthToDate(fromDate,month),fromDate)+1) ;
         if(monthDays!=0){
+            if(monthDays <0){
+                month = month-1;
+                monthFloat = new BigDecimal(month) ;
+                monthDays =DateUtil.daysBetweenDates(toDate,DateUtil.addMonthToDate(fromDate,month));
+            }
             monthFloat = monthFloat.add(new BigDecimal(1.0*monthDays*12).divide(new BigDecimal(365.0), 15,RoundingMode.HALF_UP));
         }
         return DateCompare.builder().day(day).month(month).year(year).yearFloat(yearFloat).monthFloat(monthFloat).yearDays(yearDays).monthDays(monthDays).build();
@@ -119,7 +144,7 @@
         Date earlierStart = DateUtil.daysBetweenDates(start1,start2)>0? start1 : start2;
         Date laterEnd =  DateUtil.daysBetweenDates(end2,end1)>0 ? end1 : end2;
 
-        int days =DateUtil.daysBetweenDates(laterEnd,earlierStart );
+        int days =DateUtil.daysBetweenDates(laterEnd,earlierStart);
         return days>0?days:0 ;
     }
 
diff --git a/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java b/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
index 51d30ab..63a30b8 100644
--- a/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
+++ b/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
@@ -2851,6 +2851,7 @@
 //            System.out.println(DateUtil.afterMinutesDate(-5));
 
 
+          System.out.println(DateUtil.getPlusTime2( new Date() ));
           System.out.println(DateUtil.getPlusTime2(addMonthToDate(new Date(),3)));
 
 //            Date startTime = DateUtil.StringToDate("2024-05-01 08:00:00" ,"yyyy-MM-dd HH:mm:ss");
@@ -3065,6 +3066,7 @@
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(date);
         calendar.add(Calendar.MONTH, num);//
+
         return calendar.getTime();
     }
 
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java
index 002e6bd..90cf756 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java
@@ -797,7 +797,7 @@
     }
     private BigDecimal getTotalFeeByStartEnd(YwContract model, YwContractDetail d, YwContractBill bill,Date freeStart,Date freeEnd) {
         BigDecimal totalFee = new BigDecimal(0);
-        DateCompare dateCompare =   DateCompare.dayCompare(bill.getStartDate(),DateUtil.addDaysToDate(bill.getEndDate(),1),freeStart,DateUtil.addDaysToDate(freeEnd,1));
+        DateCompare dateCompare =   DateCompare.dayCompare(bill.getStartDate(),bill.getEndDate(),freeStart, freeEnd);
         if(Constants.equalsInteger(d.getCircleType(),Constants.ZERO)){
             //0=鍏冩瘡骞崇背澶�
             int days = dateCompare.getDay() ;

--
Gitblit v1.9.3