浏览代码

货代凭证 2024-2-29

caojunjie 1 年之前
父节点
当前提交
8b3898ca35

+ 42 - 0
src/api/iosBasicData/fingenleg.js

@@ -0,0 +1,42 @@
+import request from '@/router/axios';
+
+export const fingenlegList = (current, size, params) => {
+  return request({
+    url: '/api/blade-los/fingenleg/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const fingenlegDetail = (id) => {
+  return request({
+    url: '/api/blade-los/fingenleg/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+
+export const fingenlegRemove = (ids) => {
+  return request({
+    url: '/api/blade-los/fingenleg/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const fingenlegSubmit = (row) => {
+  return request({
+    url: '/api/blade-los/fingenleg/submit',
+    method: 'post',
+    data: row
+  })
+}
+

+ 9 - 0
src/api/iosBasicData/finstlbills.js

@@ -191,3 +191,12 @@ export const finstlbillsitemsRemove = (ids) => {
     }
   })
 }
+// 生成凭证
+export const finstlbillsGenerateVoucher = (data) => {
+  return request({
+    url: '/api/blade-los/finstlbills/generateVoucher',
+    method: 'post',
+    data: data
+  })
+}
+

+ 25 - 1
src/views/iosBasicData/ComputationCenter/settlementDetails.vue

@@ -13,6 +13,10 @@
                 <el-button size="small" style="margin-right: 8px" v-if="roleName.indexOf('admin') != -1"
                            :loading="saveLoading" :disabled="!form.id" @click="DesignreportDialog = true" >报表设计
                 </el-button>
+                <el-button  size="small" type="primary" style="margin-right: 8px" :disabled="!form.id || form.isCleared != 1" v-if="!form.voucherNo"
+                            :loading="saveLoading" @click="generateVoucherfun">生成凭证
+                </el-button>
+                <span v-else style="font-size: 12px;margin-right: 8px;" >已生成凭证</span>
                 <el-button  size="small" type="warning" plain  style="margin-right: 8px" :disabled="!form.id || editPower" v-if="form.isCleared == 1"
                             :loading="saveLoading" @click="finstlbillsRevokeSettlementfun">撤销结算
                 </el-button>
@@ -365,7 +369,7 @@ import {
     finstlbillsConfirmSettlement,
     finstlbillsRevokeSettlement,
     finstlbillsGetByDetail,
-    finstlbillslistAccBillByCorp
+    finstlbillslistAccBillByCorp, finstlbillsGenerateVoucher
 
 } from '@/api/iosBasicData/finstlbills'
 import expand from "@/components/basic-container/expand.vue";
@@ -1074,6 +1078,26 @@ export default {
                 this.saveLoading = false
             })
         },
+        // 生成凭证
+        generateVoucherfun(){
+            this.$confirm("确定要生成凭证?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(()=>{
+                this.pageLoading = true
+                this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.join(','):'' // 业务类型
+                this.form.businessDateStart = this.form.businessDateStart?this.form.businessDateStart.slice(0,10) + ' 00:00:00':null // 财务开始日期
+                this.form.businessDateEnd = this.form.businessDateEnd?this.form.businessDateEnd.slice(0,10) + ' 00:00:00':null // 财务开始日期
+                this.form.billDate = this.form.billDate?this.form.billDate.slice(0,10) + ' 00:00:00':null
+                this.form.auditDateTo = this.form.auditDateTo?this.form.auditDateTo.slice(0,10) + ' 00:00:00':null
+                finstlbillsGenerateVoucher(this.form).then(res=>{
+                    this.pageLoading = false
+                    this.$message.success('操作成功');
+                    this.finstlbillsDetailfun(this.form.id)
+                })
+            })
+        },
         // 结算撤销
         finstlbillsRevokeSettlementfun(){
             this.$confirm("确定进行撤销对账操作?", {

+ 1 - 1
src/views/iosBasicData/VoucherTemplates/index.vue

@@ -350,7 +350,7 @@
             },
             // 获取科目类型数据
             accountsListfun(code){
-                accountsList(1,10,{code}).then(res=>{
+                accountsList(1,10,{code,isDetail:1}).then(res=>{
                     this.subjectData = res.data.data.records
                 })
             },

+ 28 - 4
src/views/iosBasicData/accounts/index.vue

@@ -5,6 +5,7 @@
                      :table-loading="loading"
                      :data="data"
                      :page.sync="page"
+                     :search.sync="query"
                      :permission="permissionList"
                      :before-open="beforeOpen"
                      v-model="form"
@@ -46,10 +47,10 @@
                   </div>
               </template>
               <template slot="menu" slot-scope="{ row, index }">
-                  <el-button size="small" icon="el-icon-edit" type="text" @click="editfun(row,index)">编辑</el-button>
+                  <el-button size="small" icon="el-icon-edit" type="text" :disabled="row.count == 1" @click="editfun(row,index)">编辑</el-button>
                   <!--<el-button v-if="row.isItem == 1" size="small" type="text" @click="editOpeningfun(row,index)">核算期初</el-button>-->
-                  <el-button size="small" type="text" @click="addChildfun(row,index)">添加子项</el-button>
-                  <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)">删 除</el-button>
+                  <el-button size="small" type="text" :disabled="row.count == 1" @click="addChildfun(row,index)">添加子项</el-button>
+                  <el-button size="small" icon="el-icon-delete" type="text" :disabled="row.count == 1" @click="rowDel(row, index)">删 除</el-button>
               </template>
               <template slot="code" slot-scope="{ row }">
                   <span style="color: #1e9fff" @click="editDetailsfun(row.id)">{{row.code}}</span>
@@ -156,7 +157,7 @@ import {
           rowParentKey:'children',
           simplePage: true,
           searchIcon:true,
-          searchIndex:2,
+          searchIndex:3,
           column: [
             {
               label: "科目代码",
@@ -306,6 +307,23 @@ import {
               ]
             },
             {
+                label: "是否生成过凭证",
+                prop: "count",
+                overHidden: true,
+                search: true,
+                type:'select',
+                dicData:[
+                    {
+                        label:'否',
+                        value:'0',
+                    },
+                    {
+                        label:'是',
+                        value:'1',
+                    }
+                ]
+            },
+            {
                 label: "上级科目",
                 prop: "parentCode",
                 overHidden: true,
@@ -476,6 +494,9 @@ import {
           }
           this.form = {}
           if (this.selectionList.length == 1) {
+              if (this.selectionList[0].count == 1) {
+                  return this.$message.warning('当前科目已经生成凭证')
+              }
               getAccountsCode({code:this.selectionList[0].code}).then(res=>{
                   this.$set(this.form,'code',res.data.data)
               })
@@ -762,4 +783,7 @@ import {
     cursor:pointer;
     color: #1e9fff;
 }
+/deep/ .el-col-md-8 {
+    width: 24.33333%;
+}
 </style>

+ 262 - 0
src/views/iosBasicData/fingenleg/index.vue

@@ -0,0 +1,262 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               :table-loading="loading"
+               :data="data"
+               :page.sync="page"
+               :permission="permissionList"
+               :before-open="beforeOpen"
+               v-model="form"
+               ref="crud"
+               @row-update="rowUpdate"
+               @row-save="rowSave"
+               @row-del="rowDel"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @on-load="onLoad">
+      <template slot="menuLeft">
+        <el-button type="danger"
+                   size="small"
+                   icon="el-icon-delete"
+                   plain
+                   v-if="permission.fingenleg_delete"
+                   @click="handleDelete">删 除
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import {fingenlegList, fingenlegDetail, fingenlegSubmit, fingenlegRemove} from "@/api/iosBasicData/fingenleg";
+  import {mapGetters} from "vuex";
+
+  export default {
+    data() {
+      return {
+        form: {},
+        query: {},
+        loading: true,
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        selectionList: [],
+        option: {
+          height:'auto',
+          calcHeight: 30,
+          tip: false,
+          searchShow: true,
+          searchMenuSpan: 6,
+          border: true,
+          index: true,
+          viewBtn: true,
+          selection: true,
+          dialogClickModal: false,
+          column: [
+            {
+              label: "年",
+              prop: "accyear",
+                width:'50',
+              overHidden:true,
+            },
+            {
+              label: "月",
+              prop: "accmonth",
+              overHidden:true,
+            },
+            {
+              label: "科目代码",
+              prop: "accCode",
+              overHidden:true,
+            },
+            {
+              label: "全称",
+              prop: "fullName",
+              overHidden:true,
+            },
+            {
+                label: "方向",
+                prop: "dc",
+                type: 'select',
+                dicData:[
+                    {
+                        label:'借方',
+                        value:'D'
+                    },{
+                        label:'贷方',
+                        value:'C'
+                    },
+                ],
+                overHidden:true,
+            },
+            {
+              label: "摘要",
+              prop: "descr",
+                overHidden:true,
+            },
+            {
+              label: "币种",
+              prop: "curCode",
+              overHidden:true,
+            },
+            {
+              label: "本期借方金额",
+              prop: "amountDr",
+                overHidden:true,
+            },
+            {
+              label: "本期贷方金额",
+              prop: "amountCr",
+                overHidden:true,
+            },
+            {
+              label: "本期余额",
+              prop: "amountBlc",
+                overHidden:true,
+            }
+
+          ]
+        },
+        data: []
+      };
+    },
+    computed: {
+      ...mapGetters(["permission"]),
+      permissionList() {
+        return {
+          addBtn: this.vaildData(this.permission.fingenleg_add, false),
+          viewBtn: this.vaildData(this.permission.fingenleg_view, false),
+          delBtn: this.vaildData(this.permission.fingenleg_delete, false),
+          editBtn: this.vaildData(this.permission.fingenleg_edit, false)
+        };
+      },
+      ids() {
+        let ids = [];
+        this.selectionList.forEach(ele => {
+          ids.push(ele.id);
+        });
+        return ids.join(",");
+      }
+    },
+    methods: {
+      rowSave(row, done, loading) {
+        fingenlegSubmit(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          window.console.log(error);
+        });
+      },
+      rowUpdate(row, index, done, loading) {
+        fingenlegSubmit(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          console.log(error);
+        });
+      },
+      rowDel(row) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return fingenlegRemove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          });
+      },
+      handleDelete() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return fingenlegRemove(this.ids);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crud.toggleSelection();
+          });
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          fingenlegDetail(this.form.id).then(res => {
+            this.form = res.data.data;
+          });
+        }
+        done();
+      },
+      searchReset() {
+        this.query = {};
+        this.onLoad(this.page);
+      },
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done();
+      },
+      selectionChange(list) {
+        this.selectionList = list;
+      },
+      selectionClear() {
+        this.selectionList = [];
+        this.$refs.crud.toggleSelection();
+      },
+      currentChange(currentPage){
+        this.page.currentPage = currentPage;
+      },
+      sizeChange(pageSize){
+        this.page.pageSize = pageSize;
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.query);
+      },
+      onLoad(page, params = {}) {
+        this.loading = true;
+        fingenlegList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+          this.selectionClear();
+        });
+      }
+    }
+  };
+</script>
+
+<style>
+</style>

+ 1 - 1
src/views/iosBasicData/finvouchers/assembly/fromtableDetails.vue

@@ -259,7 +259,7 @@
             },
             // 获取科目类型数据
             accountsListfun(code){
-                accountsList(1,10,{code}).then(res=>{
+                accountsList(1,10,{code,isDetail:1}).then(res=>{
                     this.accountData = res.data.data.records
                 })
             },

+ 20 - 10
src/views/iosBasicData/finvouchers/finvouchersitems.vue

@@ -26,7 +26,7 @@
                                               :clearable="true"
                                               :buttonIf="false"
                                               :forParameter="{key:'dictKey',label:'dictValue',value:'dictKey'}"
-                                              placeholder="请输入凭证类型"
+                                              placeholder="请选择凭证类型"
                                               @corpChange="corpChange($event,'voucherType')">
                                 </search-query>
                             </el-form-item>
@@ -52,11 +52,14 @@
                         </el-col>
                         <el-col :span="6">
                             <el-form-item label="凭证来源" prop="voucherSource">
-                                <el-input style="width: 100%;" v-model="form.voucherSource"
-                                          size="small" autocomplete="off"
-                                          :disabled="true"
-                                          clearable placeholder="请输入凭证来源" >
-                                </el-input>
+                                <search-query :datalist="voucherSourceData"
+                                              :selectValue="form.voucherSource"
+                                              :clearable="true"
+                                              :buttonIf="false"
+                                              :forParameter="{key:'dictKey',label:'dictValue',value:'dictKey'}"
+                                              placeholder="请选择凭证类型"
+                                              @corpChange="corpChange($event,'voucherSource')">
+                                </search-query>
                             </el-form-item>
                         </el-col>
                         <el-col :span="6">
@@ -348,6 +351,7 @@
                     finVouchersItemsList:[],
                 },
                 voucherTypeData:[], // 凭证字数据
+                voucherSourceData:[], // 业务类型
                 auxiliaryVisible:false, // 辅助核算弹窗
                 handleSelectionData:[], // 分录多选的数据
                 subjectRow:{}, // 科目弹窗的显示数据
@@ -509,9 +513,12 @@
                 // 获取状态
                 accountsDetail(row.accountId).then(res=>{
                     this.subjectAccount = res.data.data
+                    this.subjectRow = row
+                    // 如果三个都没有勾选 直接不自动打开弹窗
+                    if (res.data.data.isCorp || res.data.data.isDept || res.data.data.isEmpl) {
+                        this.auxiliaryVisible = true
+                    }
                 })
-                this.subjectRow = row
-                this.auxiliaryVisible = true
             },
             // 辅助核算弹窗确认按钮
             auxiliaryDeterminefun(){
@@ -555,8 +562,8 @@
                             this.$set(this.subjectRow,'itemId',item.id)
                         }
                     }
-                }else if (name == 'voucherType') {
-                    this.$set(this.form,'voucherType',value)
+                }else if (name == 'voucherType' || name == 'voucherSource') {
+                    this.$set(this.form,name,value)
                 }
             },
             // 接口数据调用
@@ -602,6 +609,9 @@
                 getWorkDicts('voucher_word_los').then(res=>{
                     this.voucherTypeData = res.data.data
                 })
+                getWorkDicts('voucher_source_los').then(res=>{
+                    this.voucherSourceData = res.data.data
+                })
             },
             //返回列表
             backToList() {

+ 18 - 1
src/views/iosBasicData/finvouchers/index.vue

@@ -92,15 +92,26 @@
           selection: true,
           dialogClickModal: false,
           menuWidth:'100',
+          searchIcon: true,
+          searchIndex: 3,
           column: [
             {
               label: "账单编号",
               prop: "billNo",
+              search: true,
               overHidden:true,
             },
             {
               label: "凭证来源",
               prop: "voucherSource",
+              search: true,
+              type:'select',
+              dicData:[],
+              dicUrl: "/api/blade-system/dict-biz/dictionary?code=voucher_source_los",
+              props: {
+                  label: "dictValue",
+                  value: "dictKey"
+              },
               overHidden:true,
             },
             {
@@ -111,6 +122,7 @@
             {
               label: "凭证号",
               prop: "voucherNo",
+              search: true,
               overHidden:true,
             },
             {
@@ -277,6 +289,9 @@
               this.findObject(this.option.column, "isForeign").dicData = res.data.data;
               this.findObject(this.option.column, "isQuantity").dicData = res.data.data;
           })
+          getWorkDicts("voucher_source_los").then(res => {
+              this.findObject(this.option.column, "voucherSource").dicData = res.data.data;
+          })
       },
 
       // 凭证记账
@@ -481,5 +496,7 @@
     white-space: nowrap;
     text-overflow: ellipsis;
 }
-
+/deep/ .el-col-md-8 {
+    width: 24.33333%;
+}
 </style>