| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375 |
- <template>
- <div>
- <div class="flex-container">
- <div class="flex-header">
- <Navbar
- :title="
- $t('lang.DepreciationDistribution.distributionOfDismantlingTheOld')
- "
- is-go-back="true"
- />
- <div class="form-inline">
- <div class="form-group">
- <label for="projectItem">
- {{ $t("lang.DepreciationDistribution.modeOfDistribution") }}
- </label>
- <select v-model="type" class="form-control">
- <option value="1">
- {{
- $t("lang.DepreciationDistribution.distributionByDepartment")
- }}
- </option>
- <option value="2">
- {{ $t("lang.DepreciationDistribution.distributionByCategory") }}
- </option>
- </select>
- </div>
- <div v-if="type == 1" class="form-group">
- <label for="projectItem">
- {{ $t("lang.DepreciationDistribution.selectMonth") }}
- </label>
- <select
- v-model="selectedAccountDate"
- class="form-control"
- :value="currentAccountDate"
- @change="
- queryOrganizationDepreciationDistribution(selectedAccountDate)
- "
- >
- <option
- v-for="accountDateDto in accountDateDtos"
- :key="accountDateDto.id"
- :value="accountDateDto.periodDate"
- >
- {{ accountDateDto.periodDate
- }}{{
- currentAccountDate == accountDateDto.periodDate
- ? $t("lang.DepreciationDistribution.login")
- : ""
- }}
- </option>
- </select>
- </div>
- <div v-if="type == 2" class="form-group">
- <label for="projectItem">
- {{ $t("lang.DepreciationDistribution.selectMonth") }}
- </label>
- <select
- v-model="selectedAccountDate"
- class="form-control"
- :value="currentAccountDate"
- @change="
- queryCategoryDepreciationDistribution(selectedAccountDate)
- "
- >
- <option
- v-for="accountDateDto in accountDateDtos"
- :key="accountDateDto.id"
- :value="accountDateDto.periodDate"
- >
- {{ accountDateDto.periodDate
- }}{{
- currentAccountDate == accountDateDto.periodDate
- ? $t("lang.DepreciationDistribution.login")
- : ""
- }}
- </option>
- </select>
- </div>
- <div class="form-group">
- <button type="button" class="btn btn-info" @click="query">
- {{ $t("lang.DepreciationDistribution.query") }}
- </button>
- </div>
- </div>
- </div>
- <div class="flex-content">
- <table class="fixed-table table table-responsive table-bordered">
- <thead v-if="type == 1">
- <tr>
- <td style="width: 50px">
- {{ $t("lang.DepreciationDistribution.serialNumber") }}
- </td>
- <td style="width: 350px">
- {{ $t("lang.DepreciationDistribution.departmentNumber") }}
- </td>
- <td style="width: 150px">
- {{ $t("lang.DepreciationDistribution.departmentName") }}
- </td>
- <td style="width: 150px">
- {{ $t("lang.DepreciationDistribution.projectNumber") }}
- </td>
- <td style="width: 150px">
- {{ $t("lang.DepreciationDistribution.projectName") }}
- </td>
- <td style="width: 150px">
- {{ $t("lang.DepreciationDistribution.courseNumber") }}
- </td>
- <td style="width: 150px">
- {{ $t("lang.DepreciationDistribution.courseName") }}
- </td>
- <td style="width: 150px">
- {{ $t("lang.DepreciationDistribution.depreciation") }}
- </td>
- </tr>
- </thead>
- <tbody v-if="organizationDepreciationdatas.length > 0 && type == 1">
- <tr v-for="(item, index) in organizationDepreciationdatas" :key="item.id">
- <td>{{ index + 1 }}</td>
- <td>{{ item.orgnizaitonNo }}</td>
- <td>{{ item.organizationName }}</td>
- <td>{{ item.projectNo }}</td>
- <td>{{ item.projectName }}</td>
- <td>{{ item.subjectNo }}</td>
- <td>{{ item.subjectName }}</td>
- <td>{{ item.depreciationValue }}</td>
- </tr>
- </tbody>
- <thead v-if="type == 2">
- <tr>
- <td style="width: 50px">
- {{ $t("lang.DepreciationDistribution.serialNumber") }}
- </td>
- <td style="width: 350px">
- {{ $t("lang.DepreciationDistribution.categoryNumber") }}
- </td>
- <td style="width: 150px">
- {{ $t("lang.DepreciationDistribution.categoryName") }}
- </td>
- <td style="width: 150px">
- {{ $t("lang.DepreciationDistribution.projectNumber") }}
- </td>
- <td style="width: 150px">
- {{ $t("lang.DepreciationDistribution.projectName") }}
- </td>
- <td style="width: 150px">
- {{ $t("lang.DepreciationDistribution.courseNumber") }}
- </td>
- <td style="width: 150px">
- {{ $t("lang.DepreciationDistribution.courseName") }}
- </td>
- <td style="width: 150px">
- {{ $t("lang.DepreciationDistribution.depreciation") }}
- </td>
- </tr>
- </thead>
- <tbody v-if="categoryDepreciationdatas.length > 0 && type == 2">
- <tr v-for="(item, index) in categoryDepreciationdatas" :key="item.id">
- <td>{{ index + 1 }}</td>
- <td>{{ item.categoryNo }}</td>
- <td>{{ item.categoryName }}</td>
- <td>{{ item.projectNo }}</td>
- <td>{{ item.projectName }}</td>
- <td>{{ item.subjectNo }}</td>
- <td>{{ item.subjectName }}</td>
- <td>{{ item.depreciationValue }}</td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </template>
- <script>
- import Common from '../../common/Common.js';
- import PeriodResource from '../../api/finance/PeriodResource.js';
- export default {
- components: {
-
-
- },
- data: function () {
- return {
- accountDateDtos: [], //账套登录时间dto
- currentAccountDate: '', //当前时间
- selectedAccountDate: '', //选中的时间
- organizationDepreciationdatas: [], //折旧数据(按照部门分配)
- categoryDepreciationdatas: [], //折旧数据(按照资产分类分配)
- type: '1',
- };
- },
- mounted: function () {
- this.queryLoginAccountDate();
- $('.fixed-table').tableFixer({ left: 3, head: true });
- $('.fixed-table').colResizable({
- resizeMode: 'overflow',
- partialRefresh: true,
- });
- },
- methods: {
- query: function () {
- var _self = this;
- if (_self.type == 1) {
- _self.queryOrganizationDepreciationDistribution(
- _self.selectedAccountDate,
- );
- } else {
- _self.queryCategoryDepreciationDistribution(_self.selectedAccountDate);
- }
- },
- /**
- * 获取账套登录时间
- * @return {void}
- */
- queryLoginAccountDate: function () {
- var _self = this;
- PeriodResource.listByAccountDate().then(
- successData => {
- if(successData.errorCode == 0) {
- if(successData.datas) {
- successData.datas.forEach(function (item) {
- item.periodDate = item.beginDate.substring(0, 7);
- if (item.isAccountDate) {
- _self.currentAccountDate = item.periodDate;
- _self.selectedAccountDate = item.periodDate;
- }
- });
- _self.accountDateDtos = successData.datas;
- console.log(successData.datas);
- _self.query();
- }
- }
- },
- errorData => {
- Common.processException(errorData);
- },
- );
- },
- /**
- * 查询折旧分配情况(按部门分配)
- * @return {void}
- */
- queryOrganizationDepreciationDistribution: function (selectedAccountDate) {
- var _self = this;
- $.ajax({
- url: Common.getApiURL(
- 'AssetDepreciationResource/queryOrganizationDepreciationDistribution',
- ),
- type: 'get',
- dataType: 'json',
- data: {
- selectedAccountDate: selectedAccountDate,
- },
- beforeSend: function (request) {
- Common.addTokenToRequest(request);
- },
- success: function (data) {
- _self.organizationDepreciationdatas = data;
- _self.fixedTableHeader();
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- Common.processException(XMLHttpRequest, textStatus, errorThrown);
- },
- });
- },
- /**
- * 查询折旧分配情况(按类别分配)
- * @return {void}
- */
- queryCategoryDepreciationDistribution: function (selectedAccountDate) {
- var _self = this;
- $.ajax({
- url: Common.getApiURL(
- 'AssetInstanceResource/queryCategoryDepreciationDistribution',
- ),
- type: 'get',
- dataType: 'json',
- data: {
- selectedAccountDate: selectedAccountDate,
- },
- beforeSend: function (request) {
- Common.addTokenToRequest(request);
- },
- success: function (data) {
- _self.categoryDepreciationdatas = data;
- _self.fixedTableHeader();
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- Common.processException(XMLHttpRequest, textStatus, errorThrown);
- },
- });
- },
- /**
- * 冻结表头
- */
- fixedTableHeader: function () {
- let _self = this;
- _self.$nextTick(function () {
- $('.fixed-table').tableFixer({ left: 3, head: true });
- });
- },
- },
- };
- </script>
- <style scoped>
- .flex-container {
- display: flex;
- /* 垂直*/
- flex-direction: column;
- width: 100%;
- /*视口被均分为100单位的vh 占据整个窗口,扣掉顶部topNav的距离后,计算得到container的高度*/
- height: calc(100vh - 75px);
- }
- .flex-header {
- height: 200px;
- /*放大缩小比例为0 */
- flex: 0 0 100px;
- }
- .flex-footer {
- margin-top: 0.8em;
- height: 35px;
- /*放大缩小比例为0 */
- flex: 0 0 35px;
- }
- .flex-content {
- margin-top: 0.8em;
- flex: 1;
- overflow: scroll;
- width: 100%;
- height: 0;
- }
- </style>
- <style scoped>
- .fixed-table {
- table-layout: fixed;
- width: 800px !important;
- min-width: 800px !important;
- }
- table.fixed-table tr {
- height: 40px;
- }
- table.fixed-table th,
- table.fixed-table td {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .form-inline .form-group label {
- width: 80px;
- text-align: right;
- padding-right: 5px;
- }
- .form-inline .form-group input,
- .form-inline .form-group select {
- width: 200px;
- }
- </style>
|