Ver código fonte

货代凭证总帐 2024-3-1

caojunjie 1 ano atrás
pai
commit
aad10cde5c

+ 11 - 0
src/api/iosBasicData/fingenlegcalc.js

@@ -39,4 +39,15 @@ export const fingenlegcalcSubmit = (row) => {
     data: row
   })
 }
+// 初始入账
+export const fingenlegcalcInitialization = (id) => {
+  return request({
+    url: '/api/blade-los/fingenlegcalc/initialization',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+
 

+ 31 - 0
src/util/date.js

@@ -116,6 +116,37 @@ export function defaultDate3() {
   return dateFormat(date, "yyyy");
 }
 /**
+ * 获取本年上个月
+ */
+export function CurrentMonth(date,format = 'yyyy-MM-dd hh:mm:ss') {
+  format = format || 'yyyy-MM-dd hh:mm:ss';
+  if (date !== 'Invalid Date') {
+    let o = {
+      "M+": date.getMonth(), //month
+      "d+": date.getDate(), //day
+      "h+": date.getHours(), //hour
+      "m+": date.getMinutes(), //minute
+      "s+": date.getSeconds(), //second
+      "q+": Math.floor((date.getMonth() + 3) / 3), //quarter
+      "S": date.getMilliseconds() //millisecond
+    }
+    if (Number(o["M+"]) == 0) {
+      o["M+"] = 1
+    }
+    if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
+      (date.getFullYear() + "").substr(4 - RegExp.$1.length));
+    for (let k in o) {
+      if (new RegExp("(" + k + ")").test(format)) {
+        format = format.replace(RegExp.$1,
+          RegExp.$1.length === 1 ? o[k] :
+            ("00" + o[k]).substr(("" + o[k]).length));
+      }
+    }
+    return format;
+  }
+  return '';
+}
+/**
  * 获取上月第一天和上月最后一天
  * [yyyy-MM-dd,yyyy-MM-dd]
  */

+ 217 - 12
src/views/iosBasicData/fingenleg/index.vue

@@ -41,6 +41,38 @@
                              @click="handleDelete">删 除
                   </el-button>
               </template>
+              <template slot-scope="{disabled,size}" slot="startCodeSearch">
+                  <search-query :datalist="startCodeData"
+                                :selectValue="query.startCode"
+                                :filterable="true"
+                                :clearable="true"
+                                :remote="true"
+                                :buttonIf="false"
+                                :forParameter="{key:'id',label:'code',value:'code'}"
+                                @corpFocus="startCodeDatafun"
+                                @remoteMethod="startCodeDatafun"
+                                @corpChange="corpChange($event,'startCode')">
+                  </search-query>
+              </template>
+              <template slot-scope="{disabled,size}" slot="endCodeSearch">
+                  <search-query :datalist="endCodeData"
+                                :selectValue="query.endCode"
+                                :filterable="true"
+                                :clearable="true"
+                                :remote="true"
+                                :buttonIf="false"
+                                :forParameter="{key:'id',label:'code',value:'code'}"
+                                @corpFocus="endCodeDatafun"
+                                @remoteMethod="endCodeDatafun"
+                                @corpChange="corpChange($event,'endCode')">
+                  </search-query>
+              </template>
+              <template slot-scope="{disabled,size}" slot="isYearMothSearch">
+                  <el-checkbox v-model="query.isYearMoth" :true-label="1" :false-label="0" @change="isYearMothfun" ></el-checkbox>
+              </template>
+              <template slot-scope="{disabled,size}" slot="isBalanceSearch">
+                  <el-checkbox v-model="query.isBalance" :true-label="1" :false-label="0" ></el-checkbox>
+              </template>
               <template slot-scope="{disabled,size}" slot="isForeignDetermineSearch">
                   <el-checkbox v-model="isForeignDetermine"  @change="isForeignDeterminefun" ></el-checkbox>
               </template>
@@ -57,14 +89,26 @@ import {
     fingenlegRemove,
     fingenlegInitialization
 } from "@/api/iosBasicData/fingenleg";
+import {accountsList} from "@/api/iosBasicData/accounts";
   import {mapGetters} from "vuex";
+import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
+import {CurrentMonth, dateFormat, defaultDate4} from "@/util/date";
 
   export default {
+      components: {SearchQuery},
     data() {
       return {
         form: {},
-        query: {},
+        query: {
+            isYearMoth:0,
+            isBalance:0,
+            accyear:defaultDate4(), // 默认当年
+            startDate:CurrentMonth(new Date(),'yyyy-MM'), // 开始日期
+            endDate:dateFormat(new Date(),'yyyy-MM'), // 结束日期
+        },
         isForeignDetermine:false, // 是否外币
+        startCodeData:[], // 开始科目数据
+        endCodeData:[], // 结束科目数据
         loading: true,
         page: {
           pageSize: 10,
@@ -80,38 +124,45 @@ import {
           searchShow: true,
           searchMenuSpan: 6,
           border: true,
-          index: true,
+          index: false,
           viewBtn: true,
           selection: true,
           dialogClickModal: false,
           menu:false,
-          expand:true,
+          rowKey:'id',
+          rowParentKey:'pid',
+          defaultExpandAll:true,
           column: [
             {
               label: "年",
               prop: "accyear",
-              width:'50',
+              width:'80',
+              index:1,
               overHidden:true,
             },
             {
               label: "月",
               prop: "accmonth",
                 width:'40',
+                index:2,
               overHidden:true,
             },
             {
               label: "科目代码",
               prop: "accCode",
+                index:3,
               overHidden:true,
             },
             {
               label: "科目名称",
               prop: "fullName",
+                index:4,
               overHidden:true,
             },
             {
-                label: "方向",
-                prop: "dc",
+                label: "科目方向",
+                prop: "accDc",
+                index:5,
                 type: 'select',
                 dicData:[
                     {
@@ -127,9 +178,46 @@ import {
             {
               label: "摘要",
               prop: "descr",
+                index:6,
               overHidden:true,
             },
             {
+                label: "开始科目",
+                prop: "startCode",
+                overHidden:true,
+                search:true,
+                hide:true,
+                searchslot:true,
+            },
+            {
+                label: "结束科目",
+                prop: "endCode",
+                overHidden:true,
+                search:true,
+                hide:true,
+                searchslot:true,
+            },
+            {
+                label: "开始日期",
+                prop: "startDate",
+                search:true,
+                overHidden:true,
+                hide:true,
+                type: "month",
+                format: "yyyy-MM",
+                valueFormat: "yyyy-MM",
+            },
+            {
+                label: "结束日期",
+                prop: "endDate",
+                search:true,
+                overHidden:true,
+                hide:true,
+                type: "month",
+                format: "yyyy-MM",
+                valueFormat: "yyyy-MM",
+            },
+            {
               label: "币种",
               prop: "curCode",
               hide:true,
@@ -146,6 +234,24 @@ import {
               overHidden:true,
             },
             {
+                label: "无发生额显示本月本年累计",
+                prop: "isYearMoth",
+                hide:true,
+                search:true,
+                searchslot:true,
+                searchLabelWidth:'160',
+                searchSpan:4,
+            },
+            {
+                label: "无余额无发生显示",
+                prop: "isBalance",
+                hide:true,
+                search:true,
+                searchslot:true,
+                searchLabelWidth:'120',
+                searchSpan:4,
+            },
+            {
                 label: "显示外币",
                 prop: "isForeignDetermine",
                 hide:true,
@@ -156,18 +262,39 @@ import {
             {
               label: "本期借方金额",
               prop: "amountDr",
+                index:7,
+                width:'100',
                 overHidden:true,
             },
             {
               label: "本期贷方金额",
               prop: "amountCr",
+                index:8,
+                width:'100',
                 overHidden:true,
             },
             {
               label: "本期余额",
               prop: "amountBlc",
+                index:9,
               overHidden:true,
-            }
+            },
+            {
+                label: "方向",
+                prop: "dc",
+                index:10,
+                type: 'select',
+                dicData:[
+                    {
+                        label:'借方',
+                        value:'D'
+                    },{
+                        label:'贷方',
+                        value:'C'
+                    },
+                ],
+                overHidden:true,
+            },
 
           ]
         },
@@ -196,8 +323,52 @@ import {
         this.option = await this.getColumnData(this.getColumnName(329), this.optionBack);
     },
     methods: {
+          // 下拉监听
+        corpChange(value,name){
+            this.$set(this.query,name,value)
+        },
+        // 获取科目类型数据
+        startCodeDatafun(code){
+            accountsList(1,10,{code,isDetail:1}).then(res=>{
+                this.startCodeData = res.data.data.records
+            })
+        },
+        endCodeDatafun(code){
+            accountsList(1,10,{code,isDetail:1}).then(res=>{
+                this.endCodeData = res.data.data.records
+            })
+        },
+        // 无发生额显示本月本年累计 点击
+        isYearMothfun(){
+            let obj = JSON.parse(JSON.stringify(this.query))
+            if (this.query.isYearMoth) {
+                this.findObject(this.option.column, "amountDr").label = '本年借方金额'
+                this.findObject(this.option.column, "amountDr").prop = 'amountYearDr'
+                this.findObject(this.option.column, "amountCr").label = '本年贷方金额'
+                this.findObject(this.option.column, "amountCr").prop = 'amountYearCr'
+                if (this.isForeignDetermine) {
+                    this.findObject(this.option.column, "amountDrUsd").label = '本年借方外币金额'
+                    this.findObject(this.option.column, "amountDrUsd").prop = 'amountYearDrUsd'
+                    this.findObject(this.option.column, "amountCrUsd").label = '本年贷方外币金额'
+                    this.findObject(this.option.column, "amountCrUsd").prop = 'amountYearCrUsd'
+                }
+            }else {
+                this.findObject(this.option.column, "amountYearDr").label = '本期借方金额'
+                this.findObject(this.option.column, "amountYearDr").prop = 'amountDr'
+                this.findObject(this.option.column, "amountYearCr").label = '本期贷方金额'
+                this.findObject(this.option.column, "amountYearCr").prop = 'amountCr'
+                if (this.isForeignDetermine) {
+                    this.findObject(this.option.column, "amountYearDrUsd").label = '本期借方外币金额'
+                    this.findObject(this.option.column, "amountYearDrUsd").prop = 'amountDrUsd'
+                    this.findObject(this.option.column, "amountYearCrUsd").label = '本期贷方外币金额'
+                    this.findObject(this.option.column, "amountYearCrUsd").prop = 'amountCrUsd'
+                }
+            }
+            this.query = JSON.parse(JSON.stringify(obj))
+        },
         // 是否外币点击
        isForeignDeterminefun(){
+           let obj = JSON.parse(JSON.stringify(this.query))
           if (this.isForeignDetermine) {
               this.option.column.push(
                   {
@@ -225,14 +396,29 @@ import {
                       index:14,
                       overHidden: true,
                   })
+              if (this.query.isYearMoth) {
+                  this.findObject(this.option.column, "amountDrUsd").label = '本年借方外币金额'
+                  this.findObject(this.option.column, "amountDrUsd").prop = 'amountYearDrUsd'
+                  this.findObject(this.option.column, "amountCrUsd").label = '本年贷方外币金额'
+                  this.findObject(this.option.column, "amountCrUsd").prop = 'amountYearCrUsd'
+              }
+              this.query = JSON.parse(JSON.stringify(obj))
           }else {
-              this.option = this.optionBack
+              this.option = JSON.parse(JSON.stringify(this.optionBack))
+              this.query = JSON.parse(JSON.stringify(obj))
+              if (this.query.isYearMoth) {
+                  this.findObject(this.option.column, "amountDr").label = '本年借方金额'
+                  this.findObject(this.option.column, "amountDr").prop = 'amountYearDr'
+                  this.findObject(this.option.column, "amountCr").label = '本年贷方金额'
+                  this.findObject(this.option.column, "amountCr").prop = 'amountYearCr'
+              }
           }
       },
       // 初始入账
       initializationfun(){
           fingenlegInitialization().then(res=>{
-              console.log(res,211)
+              this.page.currentPage = 1;
+              this.onLoad(this.page, this.query);
           })
       },
       rowSave(row, done, loading) {
@@ -309,7 +495,13 @@ import {
         done();
       },
       searchReset() {
-        this.query = {};
+        this.query = {
+            isYearMoth:0,
+            isBalance:0,
+            accyear:defaultDate4(), // 默认当年
+            startDate:CurrentMonth(new Date(),'yyyy-MM'), // 开始日期
+            endDate:dateFormat(new Date(),'yyyy-MM'), // 结束日期
+        };
         this.onLoad(this.page);
       },
       searchChange(params, done) {
@@ -335,11 +527,24 @@ import {
         this.onLoad(this.page, this.query);
       },
       onLoad(page, params = {}) {
+        if (this.query.startDate.split('-')[0] != this.query.endDate.split('-')[0]) {
+            return this.$message.warning('开始日期和结束日期请选择同一年')
+        }
         this.loading = true;
-        fingenlegList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+        fingenlegList(page.currentPage, page.pageSize, {
+            ...Object.assign(params, this.query),
+            startDate:Number(this.query.startDate.split('-')[1]),
+            endDate:Number(this.query.endDate.split('-')[1]),
+        }).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
-          this.data = data.records;
+          this.data = data.records.map(item=>{
+              item.children = item.finGenlegs.map((ite,inde)=>{
+                  ite.id = Number(inde) + 1
+                  return ite
+              })
+              return item
+          })
           this.loading = false;
           this.selectionClear();
         });

Diferenças do arquivo suprimidas por serem muito extensas
+ 700 - 406
src/views/iosBasicData/fingenlegcalc/index.vue


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff