Browse Source

长期待摊费用接口联调

ljb 10 months ago
parent
commit
57f28c26df

+ 13 - 5
src/api/yfCostManage/basicDataSetting/dtCostAllocationList.js

@@ -2,7 +2,7 @@ import request from '@/router/axios';
 
 export const getList = (current, size, params) => {
   return request({
-    url: '/api/kd-scientific/asset/fangwujianzhuwu/page',
+    url: '/api/kd-scientific/xm/cqdtfy/page',
     method: 'get',
     params: {
       ...params,
@@ -14,7 +14,15 @@ export const getList = (current, size, params) => {
 
 export const add = data => {
   return request({
-    url: '/kd-scientific/asset/fangwujianzhuwu/save',
+    url: '/api/kd-scientific/xm/cqdtfy/submit',
+    method: 'post',
+    data
+  })
+}
+
+export const update = data => {
+  return request({
+    url: '/api/kd-scientific/xm/cqdtfy/submit',
     method: 'post',
     data
   })
@@ -22,7 +30,7 @@ export const add = data => {
 
 export const remove = (ids) => {
   return request({
-    url: '/api/kd-scientific/asset/fangwujianzhuwu/remove',
+    url: '/api/kd-scientific/xm/cqdtfy/remove',
     method: 'post',
     params: {
       ids
@@ -30,9 +38,9 @@ export const remove = (ids) => {
   })
 }
 
-export const fetchDeviceData = params => {
+export const fetchLastMonthData = params => {
   return request({
-    url: '/api/kd-scientific/asset/fangwujianzhuwu/fetchData',
+    url: '/api/kd-scientific/xm/cqdtfy/fetchLastMonthData',
     method: 'get',
     params
   })

+ 1 - 1
src/api/yfCostManage/basicDataSetting/houseDetailList.js

@@ -14,7 +14,7 @@ export const getList = (current, size, params) => {
 
 export const add = data => {
   return request({
-    url: '/kd-scientific/asset/fangwujianzhuwu/save',
+    url: '/api/kd-scientific/asset/fangwujianzhuwu/save',
     method: 'post',
     data
   })

+ 5 - 5
src/option/yfCostManage/basicDataSetting/dtCostAllocationList.js

@@ -58,7 +58,7 @@ export default {
     },
     {
       label: '长期待摊费用编号',
-      prop: 'cqdtfybh',
+      prop: 'ctdtfybm',
       type: 'input',
       span: 24,
       width: 100,
@@ -67,7 +67,7 @@ export default {
     },
     {
       label: '长期待摊费用名称',
-      prop: 'cqdtfymc',
+      prop: 'ctdtfymc',
       type: 'input',
       span: 24,
       minWidth: 140,
@@ -101,13 +101,14 @@ export default {
     },
     {
       label: '摊销开始时间',
-      prop: 'kssj',
+      prop: 'txksrq',
       type: 'date',
       valueFormat: 'yyyy-MM-dd',
       span: 24,
       width: 95,
       align: 'center',
       showOverflowTooltip: true,
+      search: true,
       rules: [{
         required: true,
         message: '请选择摊销开始时间',
@@ -122,7 +123,6 @@ export default {
       precision: 0,
       span: 24,
       width: 70,
-      search: true,
       align: 'center',
       showOverflowTooltip: true,
       rules: [{
@@ -133,7 +133,7 @@ export default {
     },
     {
       label: '已使用月数',
-      prop: 'ysysm',
+      prop: 'ysyys',
       type: 'number',
       min: 0,
       precision: 0,

+ 42 - 26
src/views/yf-cost-manage/basic-data-setting/dt-cost-allocation-list.vue

@@ -48,39 +48,44 @@
         </div>
       </template>
 
-      <template slot="sysmSearch">
-        <div style="display: flex; align-items: center;">
-          <span>使用寿命:</span>
-          <avue-input-number v-model="params.sysmMin" :min="0" style="width: 90px !important;"></avue-input-number>
-          <span style="width: 20px; text-align: center;">至</span>
-          <avue-input-number v-model="params.sysmMax" :min="0" style="width: 90px !important;"></avue-input-number>
-        </div>
+      <template slot="txksrqSearch">
+        <span>摊销开始时间:</span>
+        <el-date-picker
+          v-model="params.txksrq"
+          type="daterange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          value-format="yyyy-MM-dd"
+          style="width: 220px !important;"
+        >
+        </el-date-picker>
       </template>
 
       <template slot="zcyzSearch">
         <div style="display: flex; align-items: center;">
           <span>资产原值:</span>
-          <avue-input-number v-model="params.zcyzMin" :min="0" style="width: 90px !important;"></avue-input-number>
+          <avue-input-number v-model="params.zcyzStart" :min="0" style="width: 90px !important;"></avue-input-number>
           <span style="width: 20px; text-align: center;">至</span>
-          <avue-input-number v-model="params.zcyzMax" :min="0" style="width: 90px !important;"></avue-input-number>
+          <avue-input-number v-model="params.zcyzEnd" :min="0" style="width: 90px !important;"></avue-input-number>
         </div>
       </template>
 
-      <template slot="ysysmSearch">
+      <template slot="ysyysSearch">
         <div style="display: flex; align-items: center;">
           <span>已使用月数:</span>
-          <avue-input-number v-model="params.ysysmMin" :min="0" style="width: 90px !important;"></avue-input-number>
+          <avue-input-number v-model="params.ysyysStart" :min="0" style="width: 90px !important;"></avue-input-number>
           <span style="width: 20px; text-align: center;">至</span>
-          <avue-input-number v-model="params.ysysmMax" :min="0" style="width: 90px !important;"></avue-input-number>
+          <avue-input-number v-model="params.ysyysEnd" :min="0" style="width: 90px !important;"></avue-input-number>
         </div>
       </template>
 
       <template slot="ytxeSearch">
         <div style="display: flex; align-items: center;">
           <span>月摊销额(每节点/套):</span>
-          <avue-input-number v-model="params.yzjeMin" :min="0" style="width: 90px !important;"></avue-input-number>
+          <avue-input-number v-model="params.ytxeStart" :min="0" style="width: 90px !important;"></avue-input-number>
           <span style="width: 20px; text-align: center;">至</span>
-          <avue-input-number v-model="params.yzjeMax" :min="0" style="width: 90px !important;"></avue-input-number>
+          <avue-input-number v-model="params.ytxeEnd" :min="0" style="width: 90px !important;"></avue-input-number>
         </div>
       </template>
 
@@ -104,7 +109,7 @@
 </template>
 
 <script>
-import { fetchDeviceData } from "@/api/yfCostManage/basicDataSetting/houseDetailList"
+import { fetchLastMonthData } from "@/api/yfCostManage/basicDataSetting/dtCostAllocationList"
 import YearMonthSelect from "@/components/year-month-select";
 import UploadExcelDialog from "@/components/upload-excel-dialog";
 import projectSelect from "@/components/project-select";
@@ -136,7 +141,18 @@ export default window.$crudCommon({
     }
   },
   methods: {
-    loadData() {},
+    getSearchParams() {
+      const newParams = { ...this.params };
+      if (newParams.txksrq && newParams.txksrq.length) {
+        newParams.txksrqStart = newParams.txksrq[0];
+        newParams.txksrqEnd = newParams.txksrq[1];
+      }
+      delete newParams.txksrq;
+      return newParams;
+    },
+    getFormData() {
+      return { ...this.form, yearAndMonth: this.params.yearAndMonth }
+    },
     validCustom() {
       if (this.form.cqdtfybh && !isAlphanumericCombination(this.form.cgbh)) {
         this.$message.warning("长期待摊费用编号必须是英文字母加数字组合!");
@@ -153,14 +169,14 @@ export default window.$crudCommon({
     },
     handleImport() {
       let excelParams = { yearAndMonth: this.params.yearAndMonth };
-      this.$refs.uploadExcelDialog.open('/api/kd-scientific/asset/fangwujianzhuwu/import', excelParams);
+      this.$refs.uploadExcelDialog.open('/api/kd-scientific/xm/cqdtfy/import', excelParams);
     },
     uploadAfter() {
       this.page.currentPage = 1;
       this.getList(this.page);
     },
     handleExport() {
-      exportBloByPost(`/api/kd-scientific/asset/fangwujianzhuwu/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
+      exportBloByPost(`/api/kd-scientific/xm/cqdtfy/export-xmCqdtfy?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
         downloadXls(res.data, `${this.params.yearAndMonth}长期待摊费用分配表.xlsx`);
       });
     },
@@ -176,15 +192,15 @@ export default window.$crudCommon({
       })
     },
     handleReadyLastData() {
-      // fetchDeviceData({ yearAndMonth: this.params.yearAndMonth}).then(res => {
-      //   let data = res.data;
-      //   if (data.success) {
+      fetchLastMonthData({ yearAndMonth: this.params.yearAndMonth}).then(res => {
+        let data = res.data;
+        if (data.success) {
 
-      //     this.$message.success('读取成功!');
-      //     this.page.currentPage = 1;
-      //     this.getList(this.page);
-      //   }
-      // });
+          this.$message.success('读取成功!');
+          this.page.currentPage = 1;
+          this.getList(this.page);
+        }
+      });
     },
   },
 }, {