liuyanpeng пре 1 година
родитељ
комит
32e4582791

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "name": "client-eam-v3",
   "description": "Leanwo Prodog Client",
-  "version": "3.0.87",
+  "version": "3.0.90",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "scripts": {
     "ins": "npm install --registry=http://wuzhixin.vip:4873",

+ 141 - 0
src/api/assetPeriodDepreciate/index.js

@@ -182,6 +182,147 @@ export const updateReservedRateApi = params => {
       dataType: 'json',
       data: JSON.stringify(params),
 
+      beforeSend: function (request) {
+        Common.addTokenToRequest(request);
+      },
+      success: function (data) {
+        resolve(data);
+      },
+      error: function (XMLHttpRequest, textStatus, errorThrown) {
+        reject(XMLHttpRequest);
+      },
+    });
+  });
+};
+
+// 获取初始化年月
+export const queryAssetConfig = () => {
+  const requestUrl = 'assetConfigResource/queryAssetConfig';
+
+  return new Promise((resolve, reject) => {
+    $.ajax({
+      url: Common.getApiURL(requestUrl),
+      type: 'get',
+      dataType: 'json',
+
+      beforeSend: function (request) {
+        Common.addTokenToRequest(request);
+      },
+      success: function (data) {
+        resolve(data);
+      },
+      error: function (XMLHttpRequest, textStatus, errorThrown) {
+        reject(XMLHttpRequest);
+      },
+    });
+  });
+};
+
+// 根据年份查询记账凭证数据
+export const queryByYearApi = year => {
+  const requestUrl = `AssetPeriodDepreciateResource/queryAccountByYear?year=${year}`;
+
+  return new Promise((resolve, reject) => {
+    $.ajax({
+      url: Common.getApiURL(requestUrl),
+      type: 'get',
+      dataType: 'json',
+
+      beforeSend: function (request) {
+        Common.addTokenToRequest(request);
+      },
+      success: function (data) {
+        resolve(data);
+      },
+      error: function (XMLHttpRequest, textStatus, errorThrown) {
+        reject(XMLHttpRequest);
+      },
+    });
+  });
+};
+
+// 根据计提凭证id查询计提凭证数据
+export const queryLineApi = id => {
+  const requestUrl = `AssetPeriodDepreciateResource/queryAccountLineById?accountVoucherId=${id}`;
+
+  return new Promise((resolve, reject) => {
+    $.ajax({
+      url: Common.getApiURL(requestUrl),
+      type: 'get',
+      dataType: 'json',
+
+      beforeSend: function (request) {
+        Common.addTokenToRequest(request);
+      },
+      success: function (data) {
+        resolve(data);
+      },
+      error: function (XMLHttpRequest, textStatus, errorThrown) {
+        reject(XMLHttpRequest);
+      },
+    });
+  });
+};
+
+// 根据年月生成计提折旧信息 
+export const generateVouchApi = yearMonth => {
+  const requestUrl = `AssetPeriodDepreciateResource/generateAccountVoucherByYearMonth?yearMonth=${yearMonth}`;
+
+  return new Promise((resolve, reject) => {
+    $.ajax({
+      url: Common.getApiURL(requestUrl),
+      type: 'post',
+      contentType: 'application/json',
+
+      beforeSend: function (request) {
+        Common.addTokenToRequest(request);
+      },
+      success: function (data) {
+        resolve(data);
+      },
+      error: function (XMLHttpRequest, textStatus, errorThrown) {
+        reject(XMLHttpRequest);
+      },
+    });
+  });
+};
+
+// 设置计提折旧登账时间和字号 
+export const updateAccountApi = params => {
+  const requestUrl = 'AssetPeriodDepreciateResource/updateAccountVoucher';
+
+  return new Promise((resolve, reject) => {
+    $.ajax({
+      url: Common.getApiURL(requestUrl),
+      type: 'post',
+      contentType: 'application/json',
+      dataType: 'json',
+      data: JSON.stringify(params),
+
+      beforeSend: function (request) {
+        Common.addTokenToRequest(request);
+      },
+      success: function (data) {
+        resolve(data);
+      },
+      error: function (XMLHttpRequest, textStatus, errorThrown) {
+        reject(XMLHttpRequest);
+      },
+    });
+  });
+};
+
+
+// 获取初始化年月
+export const queryAssetPeriodApi = (start, end) => {
+  const requestUrl = `AssetPeriodDepreciateResource/queryAssetPeriodByYearMonth?startYearMonth=${start}&endYearMonth=${end}`;
+
+  return new Promise((resolve, reject) => {
+    $.ajax({
+      url: Common.getApiURL(requestUrl),
+      type: 'get',
+      dataType: 'json',
+
       beforeSend: function (request) {
         Common.addTokenToRequest(request);
       },

+ 84 - 0
src/components/assetManagerDepreciation/DepreciationIndex.vue

@@ -0,0 +1,84 @@
+<template>
+  <div class="container_menu">
+    <ul class="nav nav-tabs m-row">
+      <li
+        v-for="(item, index) in menus" :key="index" role="presentation" :class="{ active: currentTabIndex === index }"
+        @click="menuChanged(index)"
+      >
+        <a>{{ item }}</a>
+        <span
+          :class="{
+            jt: true,
+            active: currentTabIndex === index,
+          }"
+        />
+      </li>
+    </ul>
+  </div>
+  <div class="container_content">
+    <SetDepreciationPeriodVue v-if="currentTabIndex === 0" />
+    <InquiryStatistics v-if="currentTabIndex === 1" />
+  </div>
+</template>
+
+<script setup>
+import { ref } from 'vue';
+import SetDepreciationPeriodVue from './SetDepreciationPeriod.vue';
+import InquiryStatistics from './InquiryStatistics.vue';
+
+const menus = ['设置年限', '查询统计'];
+
+const currentTabIndex = ref(0);
+
+const menuChanged = index => {
+  currentTabIndex.value = index;
+
+};
+</script>
+
+<style scoped>
+:deep(.flex-container-modal) {
+  height: calc(100vh - 100px) !important;
+}
+
+.nav-tabs>li {
+  width: 74px;
+  cursor: pointer;
+}
+
+.m-row {
+  margin-bottom: 0;
+}
+
+.nav>li>a {
+  padding: 6px 4px;
+  text-align: center;
+}
+
+.nav-tabs>li>a {
+  color: black;
+}
+
+.nav-tabs>li.active>a {
+  color: #fff;
+  border: 1px solid #ddd;
+  background-color: #2681cf;
+  border-radius: 4px;
+  border-bottom: none;
+}
+
+.jt {
+  position: absolute;
+  top: 33px;
+  left: 27px;
+  border: 8px solid transparent;
+}
+
+.jt.active {
+  border-top-color: #277fd0;
+}
+
+.container_content {
+  padding-top: 8px;
+}
+</style>

+ 73 - 0
src/components/assetManagerDepreciation/InquiryStatistics.vue

@@ -0,0 +1,73 @@
+<template>
+  <a-space style="margin-bottom: 8px;">
+    <a-range-picker v-model:value="timeHorizon" picker="month" size="small" @change="timeChanged" />
+    <a-button size="small" :icon="h(SearchOutlined)" @click="queryByTime">查询</a-button>
+  </a-space>
+  <a-table
+    :columns="statisticColumns" :data-source="statisticDatas" :loading="isLoading" :pagination="false" :scroll="{ y: 720 }"
+    size="small" bordered
+  >
+    <!-- <template #bodyCell="{ column }">
+      <template v-if="column.dataIndex === 'operation'">
+        <a-button type="link">查看明细</a-button>
+      </template>
+    </template> -->
+  </a-table>
+</template>
+
+<script setup>
+import dayjs from 'dayjs';
+import { ref, h, onMounted } from 'vue';
+import { message } from 'ant-design-vue';
+import Common from '../../common/Common.js';
+import { SearchOutlined } from '@ant-design/icons-vue';
+import { statisticColumn, getMonths } from '../assetPeriodDepreciate/util.js';
+import { queryAssetPeriodApi } from '../../api/assetPeriodDepreciate/index.js';
+
+
+const timeHorizon = ref([dayjs(getMonths().current, 'YYYY-MM'), dayjs(getMonths().last, 'YYYY-MM')]);
+const startDate = ref(getMonths().last);
+const endDate = ref(getMonths().current);
+const statisticDatas = ref([]);
+const statisticColumns = ref(statisticColumn);
+const isLoading = ref(false);
+
+onMounted(() => {
+  queryByTime();
+});
+
+// 获取查询时间范围
+const timeChanged = (_, dateStr) => {
+  startDate.value = dateStr[0];
+  endDate.value = dateStr[1];
+};
+
+// 查询统计
+const queryByTime = () => {
+  if (!startDate.value) {
+    message.warning('请选择开始年月');
+    return;
+  }
+  if (!endDate.value) {
+    message.warning('请选择结束年月');
+    return;
+  }
+  isLoading.value = true;
+  queryAssetPeriodApi(startDate.value, endDate.value).then(
+    success => {
+      if (success.errorCode === 0) {
+        success.datas ? statisticDatas.value = success.datas : statisticDatas.value = [];
+      } else {
+        message.warning(success.errorMessage);
+      }
+      isLoading.value = false;
+    },
+    error => {
+      Common.processException(error);
+      isLoading.value = false;
+    },
+  );
+};
+</script>
+
+<style scoped></style>

+ 47 - 0
src/components/assetManagerDepreciation/SetDepreciationPeriod.vue

@@ -0,0 +1,47 @@
+<template>
+  <InfoWindow :info-window-no="'20241031_091723'" :multiple="true" :is-search-widget="true" />
+</template>
+
+<script setup>
+import { ref, onMounted } from 'vue';
+import { message } from 'ant-design-vue';
+import Common from '../../common/Common.js';
+import { queryAssetConfig } from '../../api/assetPeriodDepreciate/index.js';
+
+const initDate = ref('');
+
+onMounted(() => {
+  queryConfig();
+});
+
+const queryConfig = () => {
+  queryAssetConfig().then(
+    success => {
+      if (success.errorCode === 0) {
+        console.log(success);
+        initDate.value = success.data.depreciationStartDate;
+      } else {
+        message.warning(success.errorMessage);
+      }
+    },
+    error => {
+      Common.processException(error);
+    },
+  );
+};
+
+</script>
+
+<style scoped>
+:deep(.ant-page-header-back) {
+  display: none !important
+}
+
+:deep(.container_content) {
+  margin-top: 0 !important;
+}
+
+:deep(.flex-container) {
+  height: calc(100vh-110px) !important;
+}
+</style>

+ 23 - 25
src/components/assetPeriodDepreciate/DepreciationIndex.vue

@@ -2,8 +2,8 @@
   <div class="container_menu">
     <ul class="nav nav-tabs m-row">
       <li
-        v-for="(item, index) in menus" :key="index" role="presentation"
-        :class="{ active: currentTabIndex === index }" @click="menuChanged(index)"
+        v-for="(item, index) in menus" :key="index" role="presentation" :class="{ active: currentTabIndex === index }"
+        @click="menuChanged(index)"
       >
         <a>{{ item }}</a>
         <span
@@ -19,21 +19,19 @@
     <DepreciationInformation v-if="currentTabIndex === 0" />
     <SetDepreciationPeriodVue v-if="currentTabIndex === 1" />
     <WithDrawDepreciation v-if="currentTabIndex === 2" />
+    <InquiryStatistics v-if="currentTabIndex === 3" />
   </div>
 </template>
 
 <script setup>
-import { useRouter } from 'vue-router';
-import { ref, onMounted } from 'vue';
+import { ref } from 'vue';
 import DepreciationInformation from './DepreciationInformation.vue';
 import SetDepreciationPeriodVue from './SetDepreciationPeriod.vue';
 import WithDrawDepreciation from './WithdrawDepreciation.vue';
+import InquiryStatistics from './InquiryStatistics.vue';
 
 const menus = ['基本信息', '设置年限', '提取折旧', '查询统计'];
 
-const router = useRouter();
-
-const infoWindowNo = ref(null);
 const currentTabIndex = ref(0);
 
 const menuChanged = index => {
@@ -44,47 +42,47 @@ const menuChanged = index => {
 
 <style scoped>
 :deep(.flex-container-modal) {
-    height: calc(100vh - 100px) !important;
+  height: calc(100vh - 100px) !important;
 }
 
 .nav-tabs>li {
-    width: 74px;
-    cursor: pointer;
+  width: 74px;
+  cursor: pointer;
 }
 
 .m-row {
-    margin-bottom: 0;
+  margin-bottom: 0;
 }
 
 .nav>li>a {
-    padding: 6px 4px;
-    text-align: center;
+  padding: 6px 4px;
+  text-align: center;
 }
 
 .nav-tabs>li>a {
-    color: black;
+  color: black;
 }
 
 .nav-tabs>li.active>a {
-    color: #fff;
-    border: 1px solid #ddd;
-    background-color: #2681cf;
-    border-radius: 4px;
-    border-bottom: none;
+  color: #fff;
+  border: 1px solid #ddd;
+  background-color: #2681cf;
+  border-radius: 4px;
+  border-bottom: none;
 }
 
 .jt {
-    position: absolute;
-    top: 33px;
-    left: 27px;
-    border: 8px solid transparent;
+  position: absolute;
+  top: 33px;
+  left: 27px;
+  border: 8px solid transparent;
 }
 
 .jt.active {
-    border-top-color: #277fd0;
+  border-top-color: #277fd0;
 }
 
 .container_content {
-    padding-top: 8px;
+  padding-top: 8px;
 }
 </style>

+ 73 - 0
src/components/assetPeriodDepreciate/InquiryStatistics.vue

@@ -0,0 +1,73 @@
+<template>
+  <a-space style="margin-bottom: 8px;">
+    <a-range-picker v-model:value="timeHorizon" picker="month" size="small" @change="timeChanged" />
+    <a-button size="small" :icon="h(SearchOutlined)" @click="queryByTime">查询</a-button>
+  </a-space>
+  <a-table
+    :columns="statisticColumns" :data-source="statisticDatas" :loading="isLoading" :pagination="false"
+    :scroll="{ y: 720 }" size="small" bordered
+  >
+    <!-- <template #bodyCell="{ column }">
+      <template v-if="column.dataIndex === 'operation'">
+        <a-button type="link">查看明细</a-button>
+      </template>
+</template> -->
+  </a-table>
+</template>
+
+<script setup>
+import dayjs from 'dayjs';
+import { ref, h, onMounted } from 'vue';
+import { message } from 'ant-design-vue';
+import Common from '../../common/Common.js';
+import { statisticColumn, getMonths } from './util.js';
+import { SearchOutlined } from '@ant-design/icons-vue';
+import { queryAssetPeriodApi } from '../../api/assetPeriodDepreciate/index.js';
+
+
+const timeHorizon = ref([dayjs(getMonths().current, 'YYYY-MM'), dayjs(getMonths().last, 'YYYY-MM')]);
+const startDate = ref(getMonths().last);
+const endDate = ref(getMonths().current);
+const statisticDatas = ref([]);
+const statisticColumns = ref(statisticColumn);
+const isLoading = ref(false);
+
+onMounted(() => {
+  queryByTime();
+});
+
+// 获取查询时间范围
+const timeChanged = (_, dateStr) => {
+  startDate.value = dateStr[0];
+  endDate.value = dateStr[1];
+};
+
+// 查询统计
+const queryByTime = () => {
+  if (!startDate.value) {
+    message.warning('请选择开始年月');
+    return;
+  }
+  if (!endDate.value) {
+    message.warning('请选择结束年月');
+    return;
+  }
+  isLoading.value = true;
+  queryAssetPeriodApi(startDate.value, endDate.value).then(
+    success => {
+      if (success.errorCode === 0) {
+        success.datas ? statisticDatas.value = success.datas : statisticDatas.value = [];
+      } else {
+        message.warning(success.errorMessage);
+      }
+      isLoading.value = false;
+    },
+    error => {
+      Common.processException(error);
+      isLoading.value = false;
+    },
+  );
+};
+</script>
+
+<style scoped></style>

+ 36 - 5
src/components/assetPeriodDepreciate/SetDepreciationPeriod.vue

@@ -1,20 +1,51 @@
 <template>
-  <InfoWindow :info-window-no="'040602'" :multiple="true">
+  <InfoWindow :info-window-no="'20241031_091723'" :multiple="true">
     <template #customContent>
-      <div>初始化年月:</div>
+      <div>初始化年月:{{ initDate }}</div>
     </template>
   </InfoWindow>
 </template>
 
 <script setup>
+import { ref, onMounted } from 'vue';
+import { message } from 'ant-design-vue';
+import Common from '../../common/Common.js';
+import { queryAssetConfig } from '../../api/assetPeriodDepreciate/index.js';
+
+const initDate = ref('');
+
+onMounted(() => {
+  queryConfig();
+});
+
+const queryConfig = () => {
+  queryAssetConfig().then(
+    success => {
+      if (success.errorCode === 0) {
+        console.log(success);
+        initDate.value = success.data.depreciationStartDate;
+      } else {
+        message.warning(success.errorMessage);
+      }
+    },
+    error => {
+      Common.processException(error);
+    },
+  );
+};
 
 </script>
 
 <style scoped>
-:deep(.container_content){
-    margin-top: 0 !important;
+:deep(.ant-page-header-back) {
+  display: none !important
 }
+
+:deep(.container_content) {
+  margin-top: 0 !important;
+}
+
 :deep(.flex-container) {
-    height: calc(100vh-110px) !important;
+  height: calc(100vh-110px) !important;
 }
 </style>

+ 153 - 72
src/components/assetPeriodDepreciate/WithdrawDepreciation.vue

@@ -1,27 +1,49 @@
 <template>
-  <a-space>
+  <a-space style="margin-bottom: 8px;">
     <label>年份:</label>
-    <a-select v-model:value="year" size="small" :options="years" style="width: 100px;" />
-    <a-button size="small" :icon="h(SearchOutlined)">查询</a-button>
+    <a-date-picker v-model:value="yearValue" picker="year" size="small" @change="yearChanged" />
+    <a-button size="small" :icon="h(SearchOutlined)" @click="queryByYear">查询</a-button>
     <a-button size="small" :icon="h(PayCircleOutlined)" @click="extractModal = true">提取折旧(摊销)</a-button>
   </a-space>
-  <a-modal v-model:open="extractModal" title="提取折旧(摊销)" width="16%" @ok="saveExtract">
+
+  <a-table
+    :columns="accountColumns" :data-source="accountDatas" :pagination="false" :scroll="{ y: 720 }" bordered
+    size="small" :loading="isLoading"
+  >
+    <template #bodyCell="{ column, record }">
+      <template v-if="column.dataIndex === 'registerAccountDate'">
+        <span v-if="!record.registerAccountDate">未入账</span>
+        <span v-else>已登账,入账日期:{{ record.registerAccountDate }}</span>
+      </template>
+      <template v-if="column.dataIndex === 'operation'">
+        <a-button v-if="!record.registerAccountDate" type="link" @click="entryAccount(record)">登账</a-button>
+        <span v-else>已登账</span>
+      </template>
+    </template>
+  </a-table>
+
+  <a-modal v-model:open="extractModal" title="提取折旧(摊销)" width="300px" @ok="saveExtract">
     选择折旧年月 <a-date-picker v-model:value="depreciationYear" picker="month" :allow-clear="false" />
   </a-modal>
-  <a-modal v-model:open="voucherModal" title="折旧原始凭证" width="38%">
+  <a-modal v-model:open="voucherModal" title="折旧原始凭证" width="680px" @ok="updateAccount">
     <h4 class="title">
       计提折旧(摊销)凭证
     </h4>
-    <a-flex justify="space-between" align="center" style="margin-bottom: 6px;">
-      <a-space>
-        <div class="ellipsis" title="上海市城市建设档案馆">
-          核算单位 : 上海市城市建设档案馆
+    <a-flex justify="space-between" align="center" style="margin-bottom: 6px;" wrap="wrap">
+      <a-flex align="center" wrap="wrap">
+        <div class="ellipsis" :title="voucherDatas ? voucherDatas.clientName : ''">
+          核算单位 : {{ voucherDatas ? voucherDatas.clientName : '' }}
+        </div>
+        <div>
+          <span>登账日期 : </span>
+          <a-date-picker
+            v-model:value="registerAccountDate" size="small" value-format="YYYY-MM-DD"
+            @change="accountDateChange"
+          />
         </div>
-        <span>登账日期: </span>
-        <a-date-picker v-model:value="postingDate" size="small" format="YYYY-MM-DD" />
-      </a-space>
+      </a-flex>
       <div style="text-align: right;">
-        第 <a-input size="small" style="width: 60%;" /> 号
+        第 <a-input v-model:value="accountVoucherNo" size="small" style="width: 60%;" /> 号
       </div>
     </a-flex>
     <div class="table-container">
@@ -31,100 +53,159 @@
       />
     </div>
     <a-flex justify="space-between" align="center" style="margin-top: 12px;">
-      <span>操作日期 : 2018-06-12</span>
-      <span>计提人 : 陈刚</span>
-      <span>上海联物</span>
+      <span>操作日期 : {{ voucherDatas ? voucherDatas.operationDate : '' }}</span>
+      <span>计提人 : {{ voucherDatas ? voucherDatas.operationName : '' }}</span>
+      <!-- <span>上海联物</span> -->
     </a-flex>
   </a-modal>
 </template>
 
 <script setup>
 import dayjs from 'dayjs';
-import { ref, h } from 'vue';
-import { getCurrentDate } from './util.js';
+import { ref, h, onMounted } from 'vue';
+import { message } from 'ant-design-vue';
+import Common from '../../common/Common.js';
+import { accountColumn, getCurrentDate, getTime } from './util.js';
 import { SearchOutlined, PayCircleOutlined } from '@ant-design/icons-vue';
-const year = ref(undefined);
-const years = ref([{ label: '2017', value: '2017' }]);
+import { queryByYearApi, generateVouchApi, queryLineApi, updateAccountApi } from '../../api/assetPeriodDepreciate/index.js';
 
+const yearStr = ref(new Date().getFullYear());
+const yearValue = ref(dayjs(getCurrentDate(), 'YYYY'));
+
+const dataSource = ref([]);
+const isLoading = ref(false);
+const accountDatas = ref([]);
+const voucherDatas = ref(null);
 const extractModal = ref(false);
 const voucherModal = ref(false);
-const postingDate = ref(undefined);
+const accountVoucherNo = ref('');
+const accountId = ref(null);
+const registerAccountDate = ref(undefined);
+const accountColumns = ref(accountColumn);
 const depreciationYear = ref(dayjs(getCurrentDate(), 'YYYY-MM'));
 
+onMounted(() => {
+  queryByYear();
+});
+
+// 获取提取年份
+const yearChanged = (_, dateString) => {
+  yearStr.value = dateString;
+};
+
+// 获取登账时间(时分秒)
+const accountDateChange = dateStr => {
+  const time = getTime();
+  registerAccountDate.value = `${dateStr} ${time}`;
+};
+
+// 打开提取折旧登账
+const entryAccount = record => {
+  voucherModal.value = true;
+  accountId.value = record.id;
+  queryLine(record.id);
+};
+
+// 根据年份查询记账凭证数据
+const queryByYear = () => {
+  isLoading.value = true;
+  queryByYearApi(yearStr.value).then(
+    success => {
+      if (success.errorCode === 0) {
+        accountDatas.value = success.datas;
+      } else {
+        message.warning(success.errorMessage);
+      }
+      isLoading.value = false;
+    },
+    error => {
+      Common.processException(error);
+      isLoading.value = false;
+    },
+  );
+};
+
+// 根据年月生成计提折旧信息
 const saveExtract = () => {
   const date = dayjs(depreciationYear.value).format('YYYY-MM');
-  voucherModal.value = true;
+  generateVouchApi(date).then(
+    success => {
+      if (success.errorCode === 0) {
+        queryByYear();
+        extractModal.value = false;
+        message.success('提取成功');
+      } else {
+        message.warning(success.errorMessage);
+      }
+    },
+    error => {
+      Common.processException(error);
+    },
+  );
+};
+
+// 根据计提凭证id查询计提凭证数据
+const queryLine = id => {
+  queryLineApi(id).then(
+    success => {
+      if (success.errorCode === 0) {
+        voucherDatas.value = success.data;
+        dataSource.value = success.data.accountVoucherLineDtos;
+      } else {
+        message.warning(success.errorMessage);
+      }
+    },
+    error => {
+      Common.processException(error);
+    },
+  );
+};
+
+// 设置计提折旧登账时间和字号
+const updateAccount = id => {
+  const params = {
+    id: accountId.value,
+    registerAccountDate: registerAccountDate.value,
+    accountVoucherNo: accountVoucherNo.value,
+  };
+  updateAccountApi(params).then(
+    success => {
+      if (success.errorCode === 0) {
+        message.success('保存成功');
+        voucherModal.value = false;
+      } else {
+        message.warning(success.errorMessage);
+      }
+    },
+    error => {
+      Common.processException(error);
+    },
+  );
 };
 
 const columns = ref([
   {
     title: '摘要',
-    dataIndex: 'title',
+    dataIndex: 'name',
     width: 200,
   },
   {
     title: '会计科目',
-    dataIndex: 'project',
+    dataIndex: 'accountSubjectName',
     width: 200,
 
   },
   {
     title: '借方金额',
-    dataIndex: 'money1',
+    dataIndex: 'debitAmount',
     width: 80,
   },
   {
     title: '贷方金额',
-    dataIndex: 'money2',
+    dataIndex: 'creditAmount',
     width: 80,
-
   },
 ].map(item => ({ ...item, align: 'center' })));
-const dataSource = ref([
-  {
-    key: '2',
-    title: '计提2017年11月份折旧额',
-    project: '非流动资产基金-固定资产',
-    money1: 70000,
-    money2: 70000,
-  },
-  {
-    key: '2',
-    title: '计提2017年11月份折旧额',
-    project: '非流动资产基金-固定资产',
-    money1: 70000,
-    money2: 70000,
-  },
-  {
-    key: '2',
-    title: '计提2017年11月份折旧额',
-    project: '非流动资产基金-固定资产',
-    money1: 70000,
-    money2: 70000,
-  },
-  {
-    key: '2',
-    title: '计提2017年11月份折旧额',
-    project: '非流动资产基金-固定资产',
-    money1: 70000,
-    money2: 70000,
-  },
-  {
-    key: '2',
-    title: '计提2017年11月份折旧额',
-    project: '非流动资产基金-固定资产',
-    money1: 70000,
-    money2: 70000,
-  },
-  {
-    key: '2',
-    title: '计提2017年11月份折旧额',
-    project: '非流动资产基金-固定资产',
-    money1: 70000,
-    money2: 70000,
-  },
-
-]);
 </script>
 
 <style scoped>

+ 155 - 1
src/components/assetPeriodDepreciate/util.js

@@ -38,7 +38,133 @@ export const infoColumns = [
     dataIndex: 'reservedRate',
     width: 100,
   },
-].map(item => ({ ...item, align: 'center', resizable: true, maxWidth: 200, minWidth: 75 }));
+].map(item => ({ ...item, align: 'center', ellipsis: true, resizable: true, maxWidth: 200, minWidth: 75 }));
+
+export const accountColumn = [
+  {
+    title: '年份',
+    key: 'periodYear',
+    dataIndex: 'periodYear',
+    width: 60,
+  },
+  {
+    title: '月份',
+    key: 'periodMonth',
+    dataIndex: 'periodMonth',
+    width: 60,
+  },
+  {
+    title: '折旧额',
+    key: 'depreciationValue',
+    dataIndex: 'depreciationValue',
+    width: 100,
+  },
+  {
+    title: '摊销额',
+    key: 'amortizationValue',
+    dataIndex: 'amortizationValue',
+    width: 100,
+  },
+  {
+    title: '操作人',
+    key: 'operationName',
+    dataIndex: 'operationName',
+    width: 100,
+  },
+  {
+    title: '操作时间',
+    key: 'operationDate',
+    dataIndex: 'operationDate',
+    width: 100,
+  },
+  {
+    title: '登账状态',
+    key: 'registerAccountDate',
+    dataIndex: 'registerAccountDate',
+    width: 120,
+  },
+  {
+    title: '业务操作',
+    key: 'operation',
+    dataIndex: 'operation',
+    width: 80,
+  },
+].map(item => ({ ...item, align: 'center', ellipsis: true, resizable: true, maxWidth: 200, minWidth: 75 }));
+
+export const statisticColumn = [
+  {
+    title: '明细科目名称',
+    key: 'assetClassificationName',
+    dataIndex: 'assetClassificationName',
+    width: 80,
+  },
+  {
+    title: '期初原值',
+    key: 'startOrginalValue',
+    dataIndex: 'startOrginalValue',
+    width: 80,
+  },
+  {
+    title: '期初累计折旧(摊销)额',
+    key: 'startAccumulatedDepreciationValue',
+    dataIndex: 'startAccumulatedDepreciationValue',
+    width: 100,
+  },
+  {
+    title: '期初净值',
+    key: 'startNetValue',
+    dataIndex: 'startNetValue',
+    width: 100,
+  },
+  {
+    title: '原值增加',
+    key: 'orginalValueAdd',
+    dataIndex: 'orginalValueAdd',
+    width: 100,
+  },
+  {
+    title: '本期折旧(摊销)',
+    key: 'depreciationValue',
+    dataIndex: 'depreciationValue',
+    width: 100,
+  },
+  {
+    title: '本年折旧(摊销)',
+    key: 'yearDepreciationValue',
+    dataIndex: 'yearDepreciationValue',
+    width: 120,
+  },
+  {
+    title: '本期减少数',
+    key: 'orginalValueReduce',
+    dataIndex: 'orginalValueReduce',
+    width: 100,
+  },
+  {
+    title: '期末原值',
+    key: 'endOrginalValueReduce',
+    dataIndex: 'endOrginalValueReduce',
+    width: 100,
+  },
+  {
+    title: '期末累计折旧(摊销)额',
+    key: 'endAccumulatedDepreciationValue',
+    dataIndex: 'endAccumulatedDepreciationValue',
+    width: 100,
+  },
+  {
+    title: '期末净值',
+    key: 'endNetValue',
+    dataIndex: 'endNetValue',
+    width: 100,
+  },
+  // {
+  //   title: '业务操作',
+  //   key: 'operation',
+  //   dataIndex: 'operation',
+  //   width: 70,
+  // },
+].map(item => ({ ...item, align: 'center', ellipsis: true, resizable: true, maxWidth: 200, minWidth: 75 }));
 
 
 // 防抖函数
@@ -59,4 +185,32 @@ export const getCurrentDate = () => {
   const month = String(today.getMonth() + 1).padStart(2, '0');
   const day = String(today.getDate()).padStart(2, '0');
   return `${year}-${month}-${day}`;
+};
+
+// 获取当前时分秒
+export const getTime = () => {
+  const now = new Date();
+  const hours = String(now.getHours()).padStart(2, '0');
+  const minutes = String(now.getMinutes()).padStart(2, '0');
+  const seconds = String(now.getSeconds()).padStart(2, '0');
+  return `${hours}:${minutes}:${seconds}`;
+};
+
+// 获取当前年月及前三个月年月
+export const getMonths = () => {
+  const now = new Date();
+  const currentYear = now.getFullYear();
+  const currentMonth = now.getMonth() + 1;
+  const months = [];
+
+  for (let i = 0; i < 4; i++) {
+    const month = currentMonth - i;
+    const year = month <= 0 ? currentYear - 1 : currentYear;
+    const adjustedMonth = month <= 0 ? 12 + month : month;
+    months.unshift(`${year}-${adjustedMonth.toString().padStart(2, '0')}`);
+  }
+  const date = {
+    current: months[months.length - 1], last: months[0],
+  };
+  return date;
 };

+ 9 - 7
src/index.js

@@ -5,29 +5,29 @@ import langEnUs from './locales/en-US.json';
 
 
 import HelloWorld from './components/HelloWorld.vue';
-import AssetBasicSet from  './components/AssetBasicSetting.vue';
-import DepreciationDetailList from  './components/depreciation/DepreciationDetailList.vue';
+import AssetBasicSet from './components/AssetBasicSetting.vue';
+import DepreciationDetailList from './components/depreciation/DepreciationDetailList.vue';
 import DepreciationDistribution from './components/depreciation/DepreciationDistribution.vue';
 import AssetWorkLoadInput from './components/depreciation/AssetWorkLoadInput.vue';
-import SettleAccountAtTheEndOfMonth from  './components/depreciation/SettleAccountAtTheEndOfMonth.vue';
+import SettleAccountAtTheEndOfMonth from './components/depreciation/SettleAccountAtTheEndOfMonth.vue';
 import InventoryCheckLoss from './components/inventory/InventoryCheckLoss.vue';
 import ConsolidatedAssetInventory from './components/inventory/ConsolidatedAssetInventory.vue';;
 import AutoGenerateAsset from './components/customer/AutoGenerateAsset.vue';
 import AssetCheck from './components/customer/AssetCheck.vue';
 import CustomPrintAssetInstance from './components/customer/CustomPrintAssetInstance.vue';
-import CopyProperty from  './components/customer/CopyProperty.vue';
+import CopyProperty from './components/customer/CopyProperty.vue';
 import DataSync from './components/customer/DataSync.vue';
 import DataSyncEdit from './components/customer/DataSyncEdit.vue';
 import AssetDetailList from './components/customer/AssetDetailList.vue';
 import AssetByRfid from './components/customer/AssetByRfid.vue';
 import AssetInventorySearch from './components/customer/AssetInventorySearch.vue';
 import AssetInventoryLostConfirm from './components/customer/AssetInventoryLostConfirm.vue';
-import PrintAsset from  './components/print/PrintAsset.vue';
-import AssetBatchOperationQuery from'./components/archive/AssetBatchOperationQuery.vue';
+import PrintAsset from './components/print/PrintAsset.vue';
+import AssetBatchOperationQuery from './components/archive/AssetBatchOperationQuery.vue';
 import AssetBatchOperationOrganization from './components/archive/AssetBatchOperationOrganization.vue';
 import AssetBatchOperationScrap from './components/archive/AssetBatchOperationScrap.vue';
 import AssetInstancePrint from './components/customer/AssetInstancePrint.vue';
-import AssetInstanceSearchDetail from'./components/customer/AssetInstanceSearchDetailV2.vue';
+import AssetInstanceSearchDetail from './components/customer/AssetInstanceSearchDetailV2.vue';
 import GenerateDocumentTool from './components/customer/GenerateDocumentTool.vue';
 import ExportPictureLibrary from './components/customer/ExportPictureLibrary.vue';
 import AssetBatchOperationModifyUseStatus from './components/archive/AssetBatchOperationModifyUseStatus.vue';
@@ -46,6 +46,7 @@ import AssetRfidRecord from './components/rfidRecord/AssetRfidRecord.vue';
 import BatchUploadImages from './components/sonicAlbumUpload/index.vue';
 import AssetInstanceFullCalendar from './customer/AssetInstanceFullCalendar.vue';
 import DepreciationIndex from './components/assetPeriodDepreciate/DepreciationIndex.vue';
+import AssetManagerDepreciation from './components/assetManagerDepreciation/DepreciationIndex.vue';
 import InventoryGlobalView from './components/inventory1/InventoryGlobalView.vue';
 import AssetsDisposal from './components/assetsDisposal/AssetsDisposal.vue';
 import ExecuteAssetDisposal from './components/executeAssetDisposal/AssetsDisposal.vue';
@@ -96,6 +97,7 @@ export {
   AssetLabelPrinting,
   AssetInstanceFullCalendar,
   DepreciationIndex,
+  AssetManagerDepreciation,
   InventoryGlobalView,
   AssetsDisposal,
   ExecuteAssetDisposal,

+ 14 - 14
src/router/index.js

@@ -42,8 +42,9 @@ const AssetInstanceFullCalendar = () => import('../customer/AssetInstanceFullCal
 const InventoryGlobalView = () => import('../components/inventory1/InventoryGlobalView.vue');
 
 const DepreciationIndex = () => import('../components/assetPeriodDepreciate/DepreciationIndex.vue');
-const AssetsDisposal = () =>import('../components/assetsDisposal/AssetsDisposal.vue');
-const ExecuteAssetDisposal = () =>import('../components/executeAssetDisposal/AssetsDisposal.vue');
+const AssetManagerDepreciation = () => import('../components/assetManagerDepreciation/DepreciationIndex.vue');
+const AssetsDisposal = () => import('../components/assetsDisposal/AssetsDisposal.vue');
+const ExecuteAssetDisposal = () => import('../components/executeAssetDisposal/AssetsDisposal.vue');
 const routes = [
 
   { path: '/eam/hello-world', component: HelloWorld },
@@ -196,14 +197,14 @@ const routes = [
   },
 
   //资产打印
-  { path: '/eam/printAsset/:uuid', component:PrintAsset },
+  { path: '/eam/printAsset/:uuid', component: PrintAsset },
 
   //批量转移
-  { path: '/eam/assetBatchOperationQuery/:changeType', component:AssetBatchOperationQuery },
+  { path: '/eam/assetBatchOperationQuery/:changeType', component: AssetBatchOperationQuery },
 
   //批量待转移
   {
-    path: '/eam/assetBatchOperation/organizationChange', component:AssetBatchOperationOrganization,
+    path: '/eam/assetBatchOperation/organizationChange', component: AssetBatchOperationOrganization,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -313,17 +314,16 @@ const routes = [
   {
     path: '/eam/batchUploadImages', component: BatchUploadImages,
   },
-  { 
-    path: '/eam/AssetInstanceFullCalendar', component: AssetInstanceFullCalendar, 
-  },
-  { 
-    path: '/eam/inventoryGlobalView', component: InventoryGlobalView, 
+  {
+    path: '/eam/AssetInstanceFullCalendar', component: AssetInstanceFullCalendar,
   },
-  { 
-    path: '/eam/assetPeriodDepreciate', component: DepreciationIndex,  // 资产折旧
+  {
+    path: '/eam/inventoryGlobalView', component: InventoryGlobalView,
   },
-  {path:'/eam/disposalApplication',component:AssetsDisposal}, // 处置申请单
-  {path:'/eam/executeAssetDisposal',component:ExecuteAssetDisposal}, // 执行处置
+  { path: '/eam/assetPeriodDepreciate', component: DepreciationIndex },  // 资产折旧
+  { path: '/eam/assetManagerDepreciation', component: AssetManagerDepreciation },  // 资产折旧-单位资产管理员
+  { path: '/eam/disposalApplication', component: AssetsDisposal }, // 处置申请单
+  { path: '/eam/executeAssetDisposal', component: ExecuteAssetDisposal }, // 执行处置
 ];