Browse Source

科目,财务期间

wfg 4 months ago
parent
commit
a95689672d

+ 20 - 1
src/api/iosBasicData/accounts.js

@@ -7,7 +7,17 @@ export const accountsList = (current, size, params) => {
     params: {
       ...params,
       current,
-      size,
+      size: 10000,
+    }
+  })
+}
+
+export const getAccountsLazyTree = (parentId) => {
+  return request({
+    url: '/api/blade-los/accounts/lazy-tree',
+    method: 'get',
+    params: {
+      parentId
     }
   })
 }
@@ -47,3 +57,12 @@ export const getAccountsCode = (params) => {
     params: params
   })
 }
+
+// 科目平衡检查
+export const balanceCheck = () => {
+  return request({
+    url: '/api/blade-los/accounts/balanceCheck',
+    method: 'get',
+  })
+}
+

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

@@ -45,14 +45,4 @@ export const fingenlegSubmit = (row) => {
     data: row
   })
 }
-// 初始入账
-export const fingenlegInitialization = (id) => {
-  return request({
-    url: '/api/blade-los/fingenleg/initialization',
-    method: 'get',
-    params: {
-      id
-    }
-  })
-}
 

+ 1 - 7
src/api/iosBasicData/fingenlegcalc.js

@@ -21,13 +21,7 @@ export const getTreelist= (data) => {
     data:data
   })
 }
-export const initialization = (data) => {
-  return request({
-    url: '/api/blade-los/fingenlegcalc/initialization',
-    method: 'get',
-    params:data
-  })
-}
+
 export const fingenlegcalcList = (current, size, params) => {
   return request({
     url: '/api/blade-los/fingenlegcalc/list',

+ 2 - 2
src/api/iosBasicData/periodManagement.js

@@ -16,7 +16,7 @@ export const init = (data) => {
     })
 }
 //开账
-export const open = (data) => {
+export const openPeriod = (data) => {
     return request({
         url: '/api/blade-los/finperiod/open',
         method: 'post',
@@ -109,4 +109,4 @@ export const getPeriodExchangeRate= (params) => {
         method: 'get',
         params: params
     })
-}
+}

+ 4 - 0
src/views/approveDataH/check.vue

@@ -153,6 +153,10 @@ export default {
       //
       // return
 
+      if(operate===1 && !this.form.auditMsg){
+        this.form.auditMsg = '同意!'
+      }
+
       this.checkData.operate = operate;
       if (this.idList.length !== 0) {
         //批量

+ 2 - 0
src/views/approveDataH/configuration/mainList.json

@@ -24,6 +24,7 @@
   "addBtn": false,
   "headerAlign": "center",
   "columnBtn-BAK": false,
+  "showSummary": true,
   "column": [
     {
       "label": "业务类型",
@@ -53,6 +54,7 @@
       "overHidden": true,
       "search": true,
       "searchIndex": 2,
+      "filterable": true,
       "index": 17,
       "width": 100,
       "type": "select",

+ 56 - 16
src/views/approveDataH/index.vue

@@ -1,6 +1,6 @@
 <template>
   <basic-container>
-<!--    @on-load="onLoad"-->
+    <!--    @on-load="onLoad"-->
     <avue-crud
       :option="option"
       :data="dataList"
@@ -11,6 +11,7 @@
       :search.sync="search"
       :table-loading="loading"
       :cell-style="cellStyle"
+      :summary-method="summaryMethod"
       @search-change="searchChange"
       @search-reset="searchReset"
       @selection-change="selectionChange"
@@ -172,11 +173,11 @@
       :close-on-press-escape="false"
       v-dialog-drag
     >
-      <div style="padding: 16px;">
-        <span>共选择批量审核单据 {{idList.length}} 张!</span>
+      <div style="padding: 16px">
+        <span>共选择批量审核单据 {{ idList.length }} 张!</span>
       </div>
       <check
-        :batch = "true"
+        :batch="true"
         :checkData="checkData"
         :checkDetail="true"
         :idList="idList"
@@ -189,15 +190,15 @@
     <!--报表+审批-->
     <reportContainerlos style="width: 100%; height: 100vh" ref="reportContainer">
       <template slot-scope="scope">
-      <check
-        :checkData="checkData"
-        :checkDetail="true"
-        :idList="idList"
-        @operationType="operationType"
-        @choceCheckFun="choceCheckFun"
-        @gotoRecord="gotoRecord"
-      >
-      </check>
+        <check
+          :checkData="checkData"
+          :checkDetail="true"
+          :idList="idList"
+          @operationType="operationType"
+          @choceCheckFun="choceCheckFun"
+          @gotoRecord="gotoRecord"
+        >
+        </check>
       </template>
     </reportContainerlos>
     <!--<el-dialog-->
@@ -377,6 +378,10 @@ export default {
     //   this.corpsList = res.data.data
     // })
   },
+  destroyed() {
+  },
+  deactivated() {
+  },
   mounted() {
     // option.height = window.innerHeight - 200 ;
   },
@@ -386,9 +391,46 @@ export default {
     }
   },
   methods: {
+    // 自定义合计
+    summaryMethod(param) {
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 1) {
+          sums[index] = "合计";
+          return;
+        }
+        if (index === 2) {
+          sums[index] = Array.isArray(data) ? data.length + " 条" : "";
+          return;
+        }
+        /*
+        const values = data.map((item) => item.changeMode === 'd' ? 0.00 : Number(item[column.property]));
+        // 显示列的统计 金额
+        let arr = ["amountDr", "amountCr", "amountDrUsd", "amountCrUsd"];
+        // 判断是否有这个数据
+        if (arr.indexOf(column.property) != -1) {
+          if (!values.every((value) => isNaN(value))) {
+            sums[index] = values.reduce((prev, curr) => {
+              const value = Number(curr);
+              if (!isNaN(value)) {
+                return prev + curr;
+              } else {
+                return prev;
+              }
+            }, 0);
+            sums[index] = sums[index].toFixed(2); // 把合计的参数保留两位小数
+            // sums[index] += " 元";
+          } else {
+            sums[index] = " ";
+          }
+        }
+        */
+      });
+      return sums;
+    },
     // 点击审核弹出打印表格
     printWindowfun(row, type) {
-      console.log("printWindowfun", row, type);
       // 当时选择的数据
       this.reportsData = row;
       this.checkData = row;
@@ -585,7 +627,6 @@ export default {
     },
     //跳转页面
     jumpPage(row) {
-      console.log("row", row);
       if (row.url) {
         if (row.pageStatus && eval("(" + row.pageStatus + ")")) {
           this.$alert("" + row.pageLabel + "页面已存在,请关闭" + row.pageLabel + "页面再进行操作", "温馨提示", {
@@ -655,7 +696,6 @@ export default {
         if(i1>=0) this.dataList.splice(i1, 1)
         this.$nextTick(()=>{
           selList.forEach(item => {
-            console.log(item.id, this.dataList.indexOf(item));
             this.$refs.crud.toggleRowSelection(item, true);
           })
         })

+ 4 - 4
src/views/iosBasicData/SeafreightExportF/bills/updateBatchField.vue

@@ -111,12 +111,12 @@
         <el-col :span="23">
           <el-form-item label="业务来源" class="form-item">
             <el-row :gutter="20" class="form-row">
-              <el-col :span="8">
+              <el-col :span="5">
                 <search-query
                   :datalist="srcTypeData"
                   :selectValue="formData.srcType"
                   :filterable="true"
-                  :clearable="true"
+                  :clearable="false"
                   :remote="true"
                   :allowCreate="false"
                   :buttonIf="false"
@@ -154,10 +154,10 @@
             <search-query
               :datalist="cyData"
               :selectValue="formData.cyCnName"
-              :filterable="false"
+              :filterable="true"
               :clearable="true"
               :remote="true"
-              :allowCreate="true"
+              :allowCreate="false"
               :buttonIf="false"
               :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
               placeholder="请选择场站"

+ 928 - 799
src/views/iosBasicData/accounts/index.vue

@@ -1,855 +1,984 @@
 <template>
   <div>
-      <basic-container v-show="isShow">
-          <avue-crud :option="option"
-                     :table-loading="loading"
-                     :data="data"
-                     :page.sync="page"
-                     :search.sync="query"
-                     :permission="permissionList"
-                     :before-open="beforeOpen"
-                     v-model="form"
-                     id="out-table"
-                     :header-cell-class-name="headerClassName"
-                     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"
-                     @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 323)"
-                     @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 323)"
-                     @on-load="onLoad"
-                     @tree-load="treeLoad" >
-              <template slot="menuLeft">
-                  <el-button type="primary"
-                             size="small"
-                             icon="el-icon-plus"
-                             @click="addAccountsfun">新 增
-                  </el-button>
-                  <el-button type="danger"
-                             size="small"
-                             icon="el-icon-delete"
-                             plain
-                             @click="handleDelete">删 除
-                  </el-button>
-                  <div style="margin-top: 10px">
-                      <el-tabs type="card" v-model="query.property" @tab-click="handleClick">
-                          <el-tab-pane :label="item.dictValue" :name="item.dictKey"
-                                       v-for="item in propertyData" :key="item.dictKey">
-                              <span slot="label">{{item.dictValue}}</span>
-                          </el-tab-pane>
-                      </el-tabs>
-                  </div>
-              </template>
-              <template slot="menu" slot-scope="{ row, index }">
-                  <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" :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>
-              </template>
-              <template slot="isItem" slot-scope="{ row }">
-                  <span class="pointerClick" v-if="row.isItem == 1" @click="editOpeningfun(row)" >是</span>
-                  <span v-else >否</span>
-              </template>
-              <template slot="quantityOpenDr" slot-scope="{ row }">
-                  <el-input-number style="width: 100%;" v-model="row.quantityOpenDr"
-                            v-if="row.edit" min="0" :controls="false"
-                            size="mini" autocomplete="off" clearable
-                            placeholder="请输入期初借方数量" >
-                  </el-input-number>
-                  <span v-else >{{row.quantityOpenDr}}</span>
-              </template>
-
-
-
+    <el-row>
+      <el-col :span="5">
+        <div class="box">
+          <el-scrollbar>
+            <basic-container>
+              <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" />
+            </basic-container>
+          </el-scrollbar>
+        </div>
+      </el-col>
+      <el-col :span="19">
+        <basic-container v-show="isShow">
+          <!--      :page.sync="page"-->
+          <avue-crud
+            :option="option"
+            :table-loading="loading"
+            :data="data"
+            :search.sync="query"
+            :permission="permissionList"
+            :before-open="beforeOpen"
+            v-model="form"
+            id="out-table"
+            :header-cell-class-name="headerClassName"
+            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"
+            @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 323)"
+            @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 323)"
+            @on-load="onLoad"
+            @tree-load="treeLoad"
+          >
+            <template slot="menuLeft">
+              <el-button type="primary" size="small" icon="el-icon-plus" @click="addAccountsfun">新 增 </el-button>
+              <el-button type="danger" size="small" icon="el-icon-delete" plain @click="handleDelete">删 除 </el-button>
+              <el-button type="primary" size="small" icon="el-icon-check" plain @click="handleBalanceCheck">平衡检查 </el-button>
+              <el-button type="primary" size="small" icon="el-icon-paperclip" plain @click="handleAccountsPost">科目入账 </el-button>
+              <div style="margin-top: 10px">
+                <el-tabs type="card" v-model="query.property" @tab-click="handleClick">
+                  <el-tab-pane :label="item.dictValue" :name="item.dictKey" v-for="item in propertyData" :key="item.dictKey">
+                    <span slot="label">{{ item.dictValue }}</span>
+                  </el-tab-pane>
+                </el-tabs>
+              </div>
+            </template>
+            <template slot="menu" slot-scope="{ row, index }">
+              <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" :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>
+            </template>
+            <template slot="isItem" slot-scope="{ row }">
+              <span class="pointerClick" v-if="row.isItem == 1" @click="editOpeningfun(row)">是</span>
+              <span v-else>否</span>
+            </template>
+            <template slot="quantityOpenDr" slot-scope="{ row }">
+              <el-input-number
+                style="width: 100%"
+                v-model="row.quantityOpenDr"
+                v-if="row.edit"
+                min="0"
+                :controls="false"
+                size="mini"
+                autocomplete="off"
+                clearable
+                placeholder="请输入期初借方数量"
+              >
+              </el-input-number>
+              <span v-else>{{ row.quantityOpenDr }}</span>
+            </template>
           </avue-crud>
-      </basic-container>
+        </basic-container>
+      </el-col>
+    </el-row>
 
-      <!--辅助核算-->
-      <el-dialog
-          title="账户管理"
-          append-to-body
-          :visible.sync="accountsVisible"
-          class="el-dialogDeep"
-          width="60%"
-          :close-on-click-modal="false"
-          :before-close="handleClose">
-          <accounts-dialog ref="accountsDialog" :form="form"></accounts-dialog>
-          <span slot="footer" class="dialog-footer">
-                <el-button @click="accountsVisible = false">取 消</el-button>
-                <el-button type="primary" @click="bigSavefun">确 定</el-button>
-            </span>
-      </el-dialog>
+    <!--辅助核算-->
+    <el-dialog
+      title="账户管理"
+      append-to-body
+      :visible.sync="accountsVisible"
+      class="el-dialogDeep"
+      width="60%"
+      :close-on-click-modal="false"
+      :before-close="handleClose"
+    >
+      <accounts-dialog ref="accountsDialog" :form="form"></accounts-dialog>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="accountsVisible = false">取 消</el-button>
+        <el-button type="primary" @click="bigSavefun">确 定</el-button>
+      </span>
+    </el-dialog>
 
-      <!--从表数据-->
-      <el-dialog
-          title="辅助核算期初"
-          append-to-body
-          :visible.sync="sopenblcVisible"
-          class="el-dialogDeep"
-          width="70%"
-          :close-on-click-modal="false"
-          :before-close="handleClose">
-          <accitemsopenblc :form="form" ></accitemsopenblc>
-          <span slot="footer" class="dialog-footer">
-                <el-button @click="sopenblcVisible = false">取 消</el-button>
-                <el-button type="primary" @click="openingCalculatefun">保 存</el-button>
-          </span>
-      </el-dialog>
+    <!--从表数据-->
+    <el-dialog
+      title="辅助核算期初"
+      append-to-body
+      :visible.sync="sopenblcVisible"
+      class="el-dialogDeep"
+      width="70%"
+      :close-on-click-modal="false"
+      :before-close="handleClose"
+    >
+      <accitemsopenblc :form="form"></accitemsopenblc>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="sopenblcVisible = false">取 消</el-button>
+        <el-button type="primary" @click="openingCalculatefun">保 存</el-button>
+      </span>
+    </el-dialog>
 
-      <!--<accountsDetails v-if="!isShow" @goBack="goBack"></accountsDetails>-->
+    <!--<accountsDetails v-if="!isShow" @goBack="goBack"></accountsDetails>-->
   </div>
 </template>
 
 <script>
 import {
-    accountsList,
-    accountsDetail,
-    accountsSubmit,
-    accountsRemove,
-    getAccountsCode
+  accountsList,
+  accountsDetail,
+  accountsSubmit,
+  accountsRemove,
+  getAccountsCode,
+  getAccountsLazyTree,
+  balanceCheck,
 } from "@/api/iosBasicData/accounts";
-  import {mapGetters} from "vuex";
-  import accountsDialog from "@/views/iosBasicData/accounts/assembly/accountsDialog.vue";
-  import accountsDetails from "@/views/iosBasicData/accounts/accountsDetails.vue";
-  import {getWorkDicts} from "@/api/system/dictbiz";
-  import accitemsopenblc from "@/views/iosBasicData/accounts/assembly/accitemsopenblc.vue";
+import { mapGetters } from "vuex";
+import accountsDialog from "@/views/iosBasicData/accounts/assembly/accountsDialog.vue";
+import accountsDetails from "@/views/iosBasicData/accounts/accountsDetails.vue";
+import { getWorkDicts } from "@/api/system/dictbiz";
+import accitemsopenblc from "@/views/iosBasicData/accounts/assembly/accitemsopenblc.vue";
+import { getDeptLazyTree } from "@/api/system/dept";
 
-  export default {
-    data() {
-      return {
-        accountsVisible:false, // 添加编辑弹窗
-        sopenblcVisible:false, // 从表数据
-        isShow:true,
-        form: {},
-        query: {
-            property:'0',
-        },
-        loading: true,
-        page: {
-          pageSize: 10,
-          currentPage: 1,
-          total: 0
+export default {
+  data() {
+    return {
+      accountsVisible: false, // 添加编辑弹窗
+      sopenblcVisible: false, // 从表数据
+      isShow: true,
+      form: {},
+      query: {
+        property: "0",
+      },
+      loading: true,
+      page: {
+        pageSize: 10000, // 10
+        currentPage: 1,
+        total: 0,
+      },
+
+      treeAccProperty: undefined,
+      treeAccCode: undefined,
+      treeData: [],
+      treeOption: {
+        nodeKey: "id",
+        lazy: true,
+        iconClassField: 'icon',
+        treeLoad: function (node, resolve) {
+          const parentId = node.level === 0 ? 0 : node.data.id;
+          getAccountsLazyTree(parentId).then((res) => {
+            resolve(
+              res.data.data.map((item) => {
+                let n = {
+                  ...item,
+                  leaf: !item.hasChildren,
+                  icon: 'el-icon-document',
+                };
+                return n;
+              })
+            );
+          });
         },
-        selectionList: [],
-        option:{},
-        optionBack: {
-          height:'auto',
-          calcHeight: 30,
-          tip: false,
-          searchShow: true,
-          searchMenuSpan: 6,
-          border: true,
-          index: true,
-          viewBtn: true,
-          selection: true,
-          dialogClickModal: false,
-          menuWidth:"200",
-          lazy: true,
-          tree: true,
-          rowKey:'code',
-          rowParentKey:'children',
-          simplePage: true,
-          searchIcon:true,
-          searchIndex:3,
-          column: [
-            {
-              label: "科目代码",
-              prop: "code",
-              search: true,
-              width: 100,
-              overHidden: true,
-            },
-            {
-              label: "中文名称",
-              prop: "cnName",
-              search: true,
-              width: 200,
-              overHidden: true,
-            },
-            {
-              label: "方向",
-              prop: "dc",
-              overHidden: true,
-              type:'select',
-              search: true,
-                width: 50,
-              dicData:[
-                  {
-                      label:'借方',
-                      value:'D',
-                  },
-                  {
-                      label:'贷方',
-                      value:'C',
-                  }
-              ]
-            },
-            {
-              label: "外币",
-              prop: "isForeign",
-              overHidden: true,
-              search: true,
-              type:'select',
-                width: 50,
-              dicData:[
-                  {
-                      label:'否',
-                      value:0,
-                  },
-                  {
-                      label:'是',
-                      value:1,
-                  }
-              ]
-            },
-            {
-              label: "币种",
-              prop: "curCode",
-              overHidden: true,
-              search: true,
-                width: 50,
-            },
-            // {
-            //   label: "数量",
-            //   prop: "isQuantity",
-            //   overHidden: true,
-            //   search: true,
-            //   type:'select',
-            //     width: "50",
-            //   dicData:[
-            //       {
-            //           label:'否',
-            //           value:0,
-            //       },
-            //       {
-            //           label:'是',
-            //           value:1,
-            //       }
-            //   ]
-            // },
-            {
-              label: "客户",
-              prop: "isCorp",
-              overHidden: true,
-              search: true,
-              type:'select',
-                width: 50,
-              dicData:[
-                  {
-                      label:'否',
-                      value:0,
-                  },
-                  {
-                      label:'是',
-                      value:1,
-                  }
-              ]
-            },
-            {
-              label: "部门",
-              prop: "isDept",
-              overHidden: true,
-              search: true,
-              type:'select',
-                width: 50,
-              dicData:[
-                  {
-                      label:'否',
-                      value:0,
-                  },
-                  {
-                      label:'是',
-                      value:1,
-                  }
-              ]
-            },
-            {
-              label: "职员",
-              prop: "isEmpl",
-              overHidden: true,
-              search: true,
-              type:'select',
-                width: 50,
-              dicData:[
-                  {
-                      label:'否',
-                      value:0,
-                  },
-                  {
-                      label:'是',
-                      value:1,
-                  }
-              ]
-            },
-            // {
-            //   label: "项目",
-            //   prop: "isItem",
-            //   overHidden: true,
-            //   search: true,
-            //   type:'select',
-            //     width: "50",
-            //   dicData:[
-            //       {
-            //           label:'否',
-            //           value:0,
-            //       },
-            //       {
-            //           label:'是',
-            //           value:1,
-            //       }
-            //   ]
-            // },
-            {
-                label: "是否生成过凭证",
-                prop: "count",
-                overHidden: true,
-                search: true,
-                type:'select',
-                width: 120,
-                dicData:[
-                    {
-                        label:'否',
-                        value:'0',
-                    },
-                    {
-                        label:'是',
-                        value:'1',
-                    }
-                ]
-            },
-            {
-              label: "允许手工凭证使用",
-              prop: "isManual",
-              overHidden: true,
-              search: true,
-              type:'select',
-              width: 120,
-              dicData:[
-                {
-                  label:'否',
-                  value:'0',
-                },
-                {
-                  label:'是',
-                  value:'1',
-                }
-              ]
-            },
-            {
-              label: "应收/应付科目",
-              prop: "isDc",
-              overHidden: true,
-              search: true,
-              type:'select',
-              width: 120,
-              dicData:[
-                {
-                  label:'否',
-                  value:'0',
-                },
-                {
-                  label:'是',
-                  value:'1',
-                }
-              ]
-            },
-            {
-              label: "预收/预付科目",
-              prop: "isArAp",
-              overHidden: true,
-              search: true,
-              type:'select',
-              width: 120,
-              dicData:[
-                {
-                  label:'否',
-                  value:'0',
-                },
-                {
-                  label:'是',
-                  value:'1',
-                }
-              ]
-            },
-            {
-                label: "上级科目",
-                prop: "parentCode",
-                overHidden: true,
-              width: 120,
-            },
-              // {
-              //     label: "children",
-              //     prop: "children",
-              //     hasChildren:true,
-              // },
-            {
-                label: "期初数量借方",
-                prop: "quantityOpenDr",
-                width: 120,
-                overHidden: true,
-            },
-            {
-              label: "期初本币借方金额",
-              prop: "amountOpenDr",
-              width: 120,
-              overHidden: true,
-            },
-            {
-              label: "期初外币借方金额",
-              prop: "amountOpenDrUsd",
-              width: 120,
-              overHidden: true,
-            },
-            {
-                label: "期初数量贷方",
-                prop: "quantityOpenCr",
-                overHidden: true,
-                width: 120,
-            },
-            {
-              label: "期初本币贷方金额",
-              prop: "amountOpenCr",
-              overHidden: true,
-              width: 120,
-            },
-            {
-              label: "期初外币贷方金额",
-              prop: "amountOpenCrUsd",
-              overHidden: true,
-              width: 120,
-            },
-            {
-                label: "期初数量余额",
-                prop: "quantityOpenUsdBlc",
-                overHidden: true,
-                width: 120,
-            },
-            {
-                label: "期初本币余额",
-                prop: "amountOpenBlc",
-                overHidden: true,
-                width: 120,
-            },
-            {
-                label: "期初外币余额",
-                prop: "amountOpenUsdBlc",
-                overHidden: true,
-                width: 120,
-            },
-            {
-                label: "本期数量借方",
-                prop: "quantityDr",
-                width: 120,
-                overHidden: true,
-            },
-            {
-                label: "本期本币借方金额",
-                prop: "amountDr",
-                width: 120,
-                overHidden: true,
-            },
-            {
-                label: "本期外币借方金额",
-                prop: "amountDrUsd",
-                width: 120,
-                overHidden: true,
-            },
-            {
-                label: "本期数量贷方",
-                prop: "quantityCr",
-                width: 120,
-                overHidden: true,
-            },
-            {
-                label: "本期本币贷方金额",
-                prop: "amountCr",
-                width: 120,
-                overHidden: true,
-            },
-            {
-                label: "本期外币贷方金额",
-                prop: "amountCrUsd",
-                width: 120,
-                overHidden: true,
-            },
-            {
-                label: "本期数量余额",
-                prop: "quantityUsdBlc",
-                width: 120,
-                overHidden: true,
-            },
-            {
-                label: "本期本币余额",
-                prop: "amountBlc",
-                width: 120,
-                overHidden: true,
-            },
-            {
-                label: "本期外币余额",
-                prop: "amountUsdBlc",
-                width: 120,
-                overHidden: true,
-            },
-            {
-                label: "备注",
-                prop: "remarks",
-                overHidden: true,
-              width: 200,
-            },
-          ]
+        addBtn: false,
+        menu: false,
+        size: "small",
+        props: {
+          labelText: "标题",
+          label: "title",
+          value: "value",
+          children: "children",
         },
-        data: [],
-        propertyData:[], // 科目类别
+      },
+
+      selectionList: [],
+      option: {},
+      optionBack: {
+        height: "auto",
+        calcHeight: 30,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        border: true,
+        index: true,
+        viewBtn: true,
+        selection: true,
+        dialogClickModal: false,
+        menuWidth: "200",
+        lazy: true,
+        tree: true,
+        rowKey: "code",
+        rowParentKey: "children",
+        simplePage: true,
+        searchIcon: true,
+        searchIndex: 3,
+        column: [
+          {
+            label: "科目代码",
+            prop: "code",
+            search: true,
+            width: 100,
+            overHidden: true,
+          },
+          {
+            label: "中文名称",
+            prop: "cnName",
+            search: true,
+            width: 200,
+            overHidden: true,
+          },
+          {
+            label: "方向",
+            prop: "dc",
+            overHidden: true,
+            type: "select",
+            search: true,
+            width: 50,
+            dicData: [
+              {
+                label: "借方",
+                value: "D",
+              },
+              {
+                label: "贷方",
+                value: "C",
+              },
+            ],
+          },
+          {
+            label: "外币",
+            prop: "isForeign",
+            overHidden: true,
+            search: true,
+            type: "select",
+            width: 50,
+            dicData: [
+              {
+                label: "否",
+                value: 0,
+              },
+              {
+                label: "是",
+                value: 1,
+              },
+            ],
+          },
+          {
+            label: "币种",
+            prop: "curCode",
+            overHidden: true,
+            search: true,
+            width: 50,
+          },
+          // {
+          //   label: "数量",
+          //   prop: "isQuantity",
+          //   overHidden: true,
+          //   search: true,
+          //   type:'select',
+          //     width: "50",
+          //   dicData:[
+          //       {
+          //           label:'否',
+          //           value:0,
+          //       },
+          //       {
+          //           label:'是',
+          //           value:1,
+          //       }
+          //   ]
+          // },
+          {
+            label: "客户",
+            prop: "isCorp",
+            overHidden: true,
+            search: true,
+            type: "select",
+            width: 50,
+            dicData: [
+              {
+                label: "否",
+                value: 0,
+              },
+              {
+                label: "是",
+                value: 1,
+              },
+            ],
+          },
+          {
+            label: "部门",
+            prop: "isDept",
+            overHidden: true,
+            search: true,
+            type: "select",
+            width: 50,
+            dicData: [
+              {
+                label: "否",
+                value: 0,
+              },
+              {
+                label: "是",
+                value: 1,
+              },
+            ],
+          },
+          {
+            label: "职员",
+            prop: "isEmpl",
+            overHidden: true,
+            search: true,
+            type: "select",
+            width: 50,
+            dicData: [
+              {
+                label: "否",
+                value: 0,
+              },
+              {
+                label: "是",
+                value: 1,
+              },
+            ],
+          },
+          // {
+          //   label: "项目",
+          //   prop: "isItem",
+          //   overHidden: true,
+          //   search: true,
+          //   type:'select',
+          //     width: "50",
+          //   dicData:[
+          //       {
+          //           label:'否',
+          //           value:0,
+          //       },
+          //       {
+          //           label:'是',
+          //           value:1,
+          //       }
+          //   ]
+          // },
+          {
+            label: "是否生成过凭证",
+            prop: "count",
+            overHidden: true,
+            search: false,
+            type: "select",
+            width: 120,
+            dicData: [
+              {
+                label: "否",
+                value: "0",
+              },
+              {
+                label: "是",
+                value: "1",
+              },
+            ],
+          },
+          {
+            label: "允许手工凭证使用",
+            prop: "isManual",
+            overHidden: true,
+            search: false,
+            type: "select",
+            width: 120,
+            dicData: [
+              {
+                label: "否",
+                value: "0",
+              },
+              {
+                label: "是",
+                value: "1",
+              },
+            ],
+          },
+          {
+            label: "应收/应付科目",
+            prop: "isDc",
+            overHidden: true,
+            search: false,
+            type: "select",
+            width: 120,
+            dicData: [
+              {
+                label: "否",
+                value: "0",
+              },
+              {
+                label: "是",
+                value: "1",
+              },
+            ],
+          },
+          {
+            label: "预收/预付科目",
+            prop: "isArAp",
+            overHidden: true,
+            search: false,
+            type: "select",
+            width: 120,
+            dicData: [
+              {
+                label: "否",
+                value: "0",
+              },
+              {
+                label: "是",
+                value: "1",
+              },
+            ],
+          },
+          {
+            label: "上级科目",
+            prop: "parentCode",
+            overHidden: true,
+            width: 120,
+          },
+          // {
+          //     label: "children",
+          //     prop: "children",
+          //     hasChildren:true,
+          // },
+          {
+            label: "期初数量借方",
+            prop: "quantityOpenDr",
+            width: 120,
+            overHidden: true,
+          },
+          {
+            label: "期初本币借方金额",
+            prop: "amountOpenDr",
+            width: 120,
+            overHidden: true,
+          },
+          {
+            label: "期初外币借方金额",
+            prop: "amountOpenDrUsd",
+            width: 120,
+            overHidden: true,
+          },
+          {
+            label: "期初数量贷方",
+            prop: "quantityOpenCr",
+            overHidden: true,
+            width: 120,
+          },
+          {
+            label: "期初本币贷方金额",
+            prop: "amountOpenCr",
+            overHidden: true,
+            width: 120,
+          },
+          {
+            label: "期初外币贷方金额",
+            prop: "amountOpenCrUsd",
+            overHidden: true,
+            width: 120,
+          },
+          {
+            label: "期初数量余额",
+            prop: "quantityOpenUsdBlc",
+            overHidden: true,
+            width: 120,
+          },
+          {
+            label: "期初本币余额",
+            prop: "amountOpenBlc",
+            overHidden: true,
+            width: 120,
+          },
+          {
+            label: "期初外币余额",
+            prop: "amountOpenUsdBlc",
+            overHidden: true,
+            width: 120,
+          },
+          {
+            label: "本期数量借方",
+            prop: "quantityDr",
+            width: 120,
+            overHidden: true,
+          },
+          {
+            label: "本期本币借方金额",
+            prop: "amountDr",
+            width: 120,
+            overHidden: true,
+          },
+          {
+            label: "本期外币借方金额",
+            prop: "amountDrUsd",
+            width: 120,
+            overHidden: true,
+          },
+          {
+            label: "本期数量贷方",
+            prop: "quantityCr",
+            width: 120,
+            overHidden: true,
+          },
+          {
+            label: "本期本币贷方金额",
+            prop: "amountCr",
+            width: 120,
+            overHidden: true,
+          },
+          {
+            label: "本期外币贷方金额",
+            prop: "amountCrUsd",
+            width: 120,
+            overHidden: true,
+          },
+          {
+            label: "本期数量余额",
+            prop: "quantityUsdBlc",
+            width: 120,
+            overHidden: true,
+          },
+          {
+            label: "本期本币余额",
+            prop: "amountBlc",
+            width: 120,
+            overHidden: true,
+          },
+          {
+            label: "本期外币余额",
+            prop: "amountUsdBlc",
+            width: 120,
+            overHidden: true,
+          },
+          {
+            label: "备注",
+            prop: "remarks",
+            overHidden: true,
+            width: 200,
+          },
+        ],
+      },
+      data: [],
+      propertyData: [], // 科目类别
+    };
+  },
+  components: { accitemsopenblc, accountsDialog, accountsDetails },
+  computed: {
+    ...mapGetters(["permission"]),
+    permissionList() {
+      return {
+        addBtn: this.vaildData(this.permission.accounts_add, false),
+        viewBtn: this.vaildData(this.permission.accounts_view, false),
+        delBtn: this.vaildData(this.permission.accounts_delete, false),
+        editBtn: this.vaildData(this.permission.accounts_edit, false),
       };
     },
-    components:{accitemsopenblc, accountsDialog,accountsDetails},
-    computed: {
-      ...mapGetters(["permission"]),
-      permissionList() {
-        return {
-          addBtn: this.vaildData(this.permission.accounts_add, false),
-          viewBtn: this.vaildData(this.permission.accounts_view, false),
-          delBtn: this.vaildData(this.permission.accounts_delete, false),
-          editBtn: this.vaildData(this.permission.accounts_edit, false)
-        };
-      },
-      ids() {
-        let ids = [];
-        this.selectionList.forEach(ele => {
-          ids.push(ele.id);
+    ids() {
+      let ids = [];
+      this.selectionList.forEach((ele) => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
+    },
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(323), this.optionBack);
+    this.propertyWorkDictsfun();
+  },
+  methods: {
+    balanceCheck,
+    nodeClick(data) {
+      this.treeAccCode = data.code;
+      this.treeAccProperty = data.property;
+      this.page.currentPage = 1;
+      this.onLoad(this.page);
+    },
+    // 辅助核算期初确认
+    openingCalculatefun() {
+      this.accountsSubmitfun();
+      this.sopenblcVisible = false;
+    },
+    // 核算项目数据
+    propertyWorkDictsfun(cnName) {
+      getWorkDicts("itemClassify_los").then((res) => {
+        this.propertyData = res.data.data;
+      });
+    },
+    // 添加
+    addAccountsfun() {
+      if (this.selectionList.length > 1) {
+        return this.$message.warning("只能选择一条数据");
+      }
+      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);
         });
-        return ids.join(",");
       }
+      if (this.selectionList.length == 0) {
+        getAccountsCode({ code: 0 }).then((res) => {
+          this.$set(this.form, "code", res.data.data);
+        });
+      }
+      // 复制上默认值
+      this.form.isItem = "0";
+      this.form.curCode = "CNY";
+      // 打开弹窗
+      this.accountsVisible = true;
+      // this.isShow = false
     },
-    async created() {
-        this.option = await this.getColumnData(this.getColumnName(323), this.optionBack);
-        this.propertyWorkDictsfun()
+    // 编辑
+    editDetailsfun(id) {
+      // 详情接口
+      accountsDetail(id).then((res) => {
+        this.form = res.data.data;
+        this.$set(this.form, "property", this.form.property + "");
+      });
+      this.accountsVisible = true;
     },
-    methods: {
-        // 辅助核算期初确认
-        openingCalculatefun(){
-            this.accountsSubmitfun()
-            this.sopenblcVisible = false
-        },
-        // 核算项目数据
-        propertyWorkDictsfun(cnName){
-            getWorkDicts('itemClassify_los').then((res) => {
-                this.propertyData = res.data.data
-            });
-        },
-        // 添加
-      addAccountsfun(){
-          if (this.selectionList.length > 1) {
-              return this.$message.warning('只能选择一条数据')
-          }
-          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)
-              })
-          }
-          if (this.selectionList.length == 0) {
-              getAccountsCode({code:0}).then(res=>{
-                  this.$set(this.form,'code',res.data.data)
-              })
-          }
-          // 复制上默认值
-          this.form.isItem = '0'
-          this.form.curCode = 'CNY'
-          // 打开弹窗
-          this.accountsVisible = true
-          // this.isShow = false
-      },
-        // 编辑
-        editDetailsfun(id){
-            // 详情接口
-            accountsDetail(id).then(res => {
-                this.form = res.data.data;
-                this.$set(this.form,'property',this.form.property + '')
-            });
-            this.accountsVisible = true
-        },
-        // 大保存
-        bigSavefun(){
-            let msgs=[]
-            if (!this.form.code) {
-                msgs.push('科目编码')
-            }
-            if (!this.form.cnName) {
-                msgs.push('科目名称')
-            }
-            if (!this.form.dc) {
-                msgs.push('方向')
-            }
-            if(msgs.length>0) {
-                this.$alert(`请填写下列信息:${msgs.join(" ,")}!`, '提示', {
-                    confirmButtonText: '确定',
-                });
-                return
-            }
-            this.accountsSubmitfun()
-        },
-        // 保存
-        accountsSubmitfun(){
-            accountsSubmit(this.form).then(res=>{
-                this.$message.success("操作成功!")
-                this.accountsVisible = false
-                this.onLoad(this.page, this.query)
-            })
-        },
-      // 弹窗点击差号
-      handleClose(done) {
-          done();
-          // this.$confirm('确认关闭?')
-          //     .then(_ => {
-          //         done();
-          //     })
-          //     .catch(_ => {});
-      },
-        // 添加
-      rowSave(row, done, loading) {
-        accountsSubmit(row).then(() => {
+    // 大保存
+    bigSavefun() {
+      let msgs = [];
+      if (!this.form.code) {
+        msgs.push("科目编码");
+      }
+      if (!this.form.cnName) {
+        msgs.push("科目名称");
+      }
+      if (!this.form.dc) {
+        msgs.push("方向");
+      }
+      if (msgs.length > 0) {
+        this.$alert(`请填写下列信息:${msgs.join(" ,")}!`, "提示", {
+          confirmButtonText: "确定",
+        });
+        return;
+      }
+      this.accountsSubmitfun();
+    },
+    // 保存
+    accountsSubmitfun() {
+      accountsSubmit(this.form).then((res) => {
+        this.$message.success("操作成功!");
+        this.accountsVisible = false;
+        this.onLoad(this.page, this.query);
+      });
+    },
+    // 弹窗点击差号
+    handleClose(done) {
+      done();
+      // this.$confirm('确认关闭?')
+      //     .then(_ => {
+      //         done();
+      //     })
+      //     .catch(_ => {});
+    },
+    // 添加
+    rowSave(row, done, loading) {
+      accountsSubmit(row).then(
+        () => {
           this.onLoad(this.page);
           this.$message({
             type: "success",
-            message: "操作成功!"
+            message: "操作成功!",
           });
           done();
-        }, error => {
+        },
+        (error) => {
           loading();
           window.console.log(error);
-        });
-      },
-        // 编辑操作
-      rowUpdate(row, index, done, loading) {
-        accountsSubmit(row).then(() => {
+        }
+      );
+    },
+    // 编辑操作
+    rowUpdate(row, index, done, loading) {
+      accountsSubmit(row).then(
+        () => {
           this.onLoad(this.page);
           this.$message({
             type: "success",
-            message: "操作成功!"
+            message: "操作成功!",
           });
           done();
-        }, error => {
-          loading();
-        });
-      },
-        // 删除
-      rowDel(row) {
-        this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
-          .then(() => {
-            return accountsRemove(row.id);
-          })
-          .then(() => {
-            this.onLoad(this.page);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-          });
-      },
-        // 编辑
-        editfun(row){
-            accountsDetail(row.id).then(res => {
-                this.form = res.data.data;
-                this.$set(this.form,'property',this.form.property + '')
-            });
-            this.accountsVisible = true
-            this.$nextTick(()=>{
-                this.$refs.accountsDialog.propertyWorkDictsfun()
-            })
-        },
-        // 添加子项
-        addChildfun(row){
-            this.form = {
-                parentId:row.id,
-                parentCode:row.code,
-                parentCnName:row.cnName,
-            }
-            getAccountsCode({code:row.code}).then(res=>{
-                this.$set(this.form,'code',res.data.data)
-            })
-            // 复制上默认值
-            this.form.isItem = '0'
-            this.form.curCode = 'CNY'
-
-            this.accountsVisible = true
         },
-        // 核算期初
-        editOpeningfun(row){
-            accountsDetail(row.id).then(res => {
-                this.form = res.data.data;
-            });
-            this.sopenblcVisible = true
-        },
-
-        // 匹配删除
-      handleDelete() {
-        if (this.selectionList.length === 0) {
-          this.$message.warning("请选择至少一条数据");
-          return;
+        (error) => {
+          loading();
         }
-        this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
+      );
+    },
+    // 删除
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return accountsRemove(row.id);
         })
-          .then(() => {
-            return accountsRemove(this.ids);
-          })
-          .then(() => {
-            this.onLoad(this.page);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-            this.$refs.crud.toggleSelection();
-          });
-      },
-        // 打开弹窗调用详情接口
-      beforeOpen(done, type) {
-        if (["edit", "view"].includes(type)) {
-          accountsDetail(this.form.id).then(res => {
-            this.form = res.data.data;
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
           });
+        });
+    },
+    // 编辑
+    editfun(row) {
+      accountsDetail(row.id).then((res) => {
+        this.form = res.data.data;
+        this.$set(this.form, "property", this.form.property + "");
+      });
+      this.accountsVisible = true;
+      this.$nextTick(() => {
+        this.$refs.accountsDialog.propertyWorkDictsfun();
+      });
+    },
+    // 添加子项
+    addChildfun(row) {
+      this.form = {
+        parentId: row.id,
+        parentCode: row.code,
+        parentCnName: row.cnName,
+      };
+      getAccountsCode({ code: row.code }).then((res) => {
+        this.$set(this.form, "code", res.data.data);
+      });
+      // 复制上默认值
+      let copyFlds = "dc,property,isArAp,isBank,isManual,isDiary";
+      copyFlds.split(",").forEach((item) => {
+        if (row[item]) {
+          this.form[item] = row[item];
         }
-        done();
-      },
-      searchReset() {
-        this.query = {};
-        this.onLoad(this.page);
-      },
-        // 搜索按钮点击
-      searchChange(params, done) {
-        // this.query = params;
-        this.page.currentPage = 1;
-        this.onLoad(this.page, this.query);
-        done();
-      },
-        // table 切换
-        handleClick(){
-            this.page.currentPage = 1;
-            this.onLoad(this.page, this.query);
-        },
-      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;
-        accountsList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
-          const data = res.data.data;
-          this.page.total = data.total;
+      });
+      this.form.property = this.form.property + "";
+      this.form.isItem = "0";
+      this.form.curCode = "CNY";
 
-          // 前端去掉凭证明细中已使用的判断
-          data.records.forEach(item => {
-            item.count = "0"
-          })
+      this.accountsVisible = true;
+    },
+    // 核算期初
+    editOpeningfun(row) {
+      accountsDetail(row.id).then((res) => {
+        this.form = res.data.data;
+      });
+      this.sopenblcVisible = true;
+    },
 
-          this.data = data.records;
-          this.loading = false;
-          this.selectionClear();
+    // 匹配删除
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return accountsRemove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          this.$refs.crud.toggleSelection();
         });
-      },
-      // 懒加载查询子节点数据
-      treeLoad(row, treeNode, resolve){
-          console.log(row,688)
-          console.log(row,treeNode,resolve,673)
-      },
-      // 详情的返回列表
-      goBack() {
-          // 初始化数据
-          if (JSON.stringify(this.$route.query) != "{}") {
-              this.$router.$avueRouter.closeTag();
-              this.$router.push({
-                  path: "/iosBasicData/accounts/index"
-              });
-          }
-          this.isShow = true;
-          this.onLoad(this.page, this.search);
-      },
-      //自定义列保存
-      async saveColumnTwo(ref, option, optionBack, code) {
-          /**
-           * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
-           * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
-           * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
-           */
-          const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
-          if (inSave) {
-              this.$message.success("保存成功");
-              //关闭窗口
-              this.$refs[ref].$refs.dialogColumn.columnBox = false;
-          }
-      },
-      //自定义列重置
-      async resetColumnTwo(ref, option, optionBack, code) {
-          this[option] = this[optionBack];
-          const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
-          if (inSave) {
-              this.$message.success("重置成功");
-              this.$refs[ref].$refs.dialogColumn.columnBox = false;
-          }
-      },
-      // 更改表格颜色
-      headerClassName(tab){
-          //颜色间隔
-          let back = ""
-          if (tab.columnIndex >= 0 && tab.column.level === 1) {
-              if (tab.columnIndex % 2 === 0) {
-                  back = "back-one"
-              } else if (tab.columnIndex % 2 === 1) {
-                  back = "back-two"
+    },
+    // 平衡检查
+    async handleBalanceCheck (){
+      this.loading = true;
+      try{
+        await balanceCheck().then((res) => {
+          if(res.data.msg==="success"){
+            this.$messsage.success("账户全部符合平衡检查!");
+          }else{
+            this.$alert(
+              "下列问题导致账户不平衡:<br >" + res.data.data.replaceAll("\n", "<br />"),
+              "账户平衡检查",
+              {
+                customClass: 'custom-alert',
+                dangerouslyUseHTMLString: true,
               }
+            );
           }
-          return back;
-      },
+        });
+      }finally {
+        this.loading = false;
+      }
+    },
+    // 科目入账
+    async handleAccountsPost(){
+
+    },
+    // 打开弹窗调用详情接口
+    beforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        accountsDetail(this.form.id).then((res) => {
+          this.form = res.data.data;
+        });
+      }
+      done();
+    },
+    searchReset() {
+      this.query = {
+        property: this.propertyData[0].dictKey,
+      };
+      this.onLoad(this.page);
+    },
+    // 搜索按钮点击
+    searchChange(params, done) {
+      // this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, this.query);
+      done();
+    },
+    // table 切换
+    handleClick() {
+      this.page.currentPage = 1;
+      this.onLoad(this.page, this.query);
+    },
+    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 = {}) {
+      // console.log(this.treeAccProperty, this.treeAccCode, this.query.property, "v", this.treeAccProperty || this.treeAccProperty==0 ? this.treeAccProperty : this.query.property );
+      this.loading = true;
+      console.log(this.query);
+      let qry = JSON.parse(JSON.stringify(Object.assign(params, this.query)));
 
-    }
-  };
+      qry.property = this.treeAccProperty || this.treeAccProperty == 0 ? this.treeAccProperty : this.query.property;
+      qry.code = this.treeAccCode ? this.treeAccCode : this.query.code;
+
+      if (this.treeAccProperty || this.treeAccProperty == 0) {
+        this.query.property = this.treeAccProperty + "";
+        // console.log("set this.query.property", this.query.property);
+      }
+
+      this.treeAccProperty = undefined;
+      this.treeAccCode = undefined;
+      accountsList(page.currentPage, page.pageSize, qry).then((res) => {
+        const data = res.data.data;
+        this.page.total = data.total;
+
+        // 前端去掉凭证明细中已使用的判断
+        data.records.forEach((item) => {
+          item.count = "0";
+        });
+
+        this.data = data.records;
+        this.loading = false;
+        this.selectionClear();
+      });
+    },
+    // 懒加载查询子节点数据
+    treeLoad(row, treeNode, resolve) {
+      console.log(row, 688);
+      console.log(row, treeNode, resolve, 673);
+    },
+    // 详情的返回列表
+    goBack() {
+      // 初始化数据
+      if (JSON.stringify(this.$route.query) != "{}") {
+        this.$router.$avueRouter.closeTag();
+        this.$router.push({
+          path: "/iosBasicData/accounts/index",
+        });
+      }
+      this.isShow = true;
+      this.onLoad(this.page, this.search);
+    },
+    //自定义列保存
+    async saveColumnTwo(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //自定义列重置
+    async resetColumnTwo(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+    // 更改表格颜色
+    headerClassName(tab) {
+      //颜色间隔
+      let back = "";
+      if (tab.columnIndex >= 0 && tab.column.level === 1) {
+        if (tab.columnIndex % 2 === 0) {
+          back = "back-one";
+        } else if (tab.columnIndex % 2 === 1) {
+          back = "back-two";
+        }
+      }
+      return back;
+    },
+  },
+};
 </script>
 
 <style scoped>
+.box {
+  height: 800px;
+}
+
+.el-scrollbar {
+  height: 100%;
+}
+
+.box .el-scrollbar__wrap {
+  overflow: scroll;
+}
+
 ::v-deep#out-table .back-one {
-    background: #ecf5ff !important;
-    text-align: center;
+  background: #ecf5ff !important;
+  text-align: center;
 }
 ::v-deep#out-table .back-two {
-    background: #ecf5ff !important;
-    text-align: center;
+  background: #ecf5ff !important;
+  text-align: center;
 }
 .pointerClick {
-    cursor:pointer;
-    color: #1e9fff;
+  cursor: pointer;
+  color: #1e9fff;
 }
 ::v-deep .el-col-md-8 {
-    width: 24.33333%;
+  width: 24.33333%;
+}
+
+</style>
+<style>
+.custom-alert {
+  width: auto !important; /* 设置宽度 */
 }
 </style>

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

@@ -44,7 +44,6 @@
 <script>
 import {
   getList,
-  fingenlegInitialization
 } from "@/api/iosBasicData/fingenleg";
 import { dateFormat } from "@/util/date";
 import { getToken } from "@/util/auth";
@@ -355,30 +354,6 @@ export default {
         });
       }
     },
-    //初始入账
-    inItial() {
-      this.$confirm('是否继续初始入账?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        const loading = this.$loading({
-          lock: true,
-          text: '加载中',
-          spinner: 'el-icon-loading',
-          background: 'rgba(255,255,255,0.7)'
-        });
-        fingenlegInitialization().then(res => {
-          this.$message({
-            type: 'success',
-            message: '初始入账成功!'
-          });
-          this.getTreelist()
-        }).finally(() => {
-          loading.close();
-        });
-      })
-    },
     //重置特殊值
     resetData() {
       this.query.auxiliaryAccounting = this.query.checkbox.find(e => e == 'auxiliaryAccounting') ? 1 : 0

+ 0 - 10
src/views/iosBasicData/fingenlegcalc/index.vue

@@ -60,7 +60,6 @@ import {
   getList,
   getAllList,
   getTreelist,
-  initialization
 } from "@/api/iosBasicData/fingenlegcalc";
 import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
 import { dateFormat } from "@/util/date";
@@ -468,15 +467,6 @@ export default {
           spinner: 'el-icon-loading',
           background: 'rgba(255,255,255,0.7)'
         });
-        initialization().then(res => {
-          this.$message({
-            type: 'success',
-            message: '初始入账成功!'
-          });
-          this.getTreelist()
-        }).finally(() => {
-          loading.close();
-        });
       })
 
     },

+ 54 - 22
src/views/iosBasicData/finvouchers/index.vue

@@ -8,7 +8,7 @@
           @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
           @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange"
           @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 321)"
-          @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 321)" @on-load="onLoad">
+          @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 321)">
           <template slot="menuLeft">
             <div style="margin-top: 0px; width: 260px">
               <el-tabs type="card" v-model="query.voucherStatus" @tab-click="handleClick">
@@ -20,11 +20,11 @@
           <template slot="menuRight">
             <el-button type="primary" size="small" icon="el-icon-plus" @click="addbtnfun()">新建财务凭证
             </el-button>
-            <el-button type="danger" size="small" icon="el-icon-delete" plain @click="handleDelete">删 除
+            <el-button v-if="query.voucherStatus==='0'" type="danger" size="small" icon="el-icon-delete" plain @click="handleDelete">删 除
             </el-button>
-            <el-button type="success" size="small" plain @click.stop="voucherAccountingfun">凭证记账
+            <el-button v-if="query.voucherStatus==='0'" type="success" size="small" plain @click.stop="voucherAccountingfun">凭证记账
             </el-button>
-            <el-button type="danger" size="small" style="margin-right: 40px" plain @click="revokeFinVouchersfun">撤销记账
+            <el-button v-if="query.voucherStatus==='1'" type="danger" size="small" style="margin-right: 40px" plain @click="revokeFinVouchersfun">撤销记账
             </el-button>
           </template>
           <template slot="menu" slot-scope="{row}">
@@ -70,9 +70,10 @@ export default {
       },
       loading: true,
       page: {
-        pageSize: 10,
+        pageSize: 1000,
         currentPage: 1,
-        total: 0
+        total: 0,
+        pageSizes: [10, 50, 100, 200, 300, 400, 500, 1000]
       },
       voucherTypeData: [],
       selectionList: [],
@@ -94,18 +95,31 @@ export default {
         searchIndex: 4,
         column: [
           {
+            label: "期间",
+            prop: "searchPeriod",
+            overHidden: true,
+            width: 100,
+            hide: true,
+            type: "month",
+            search: true,
+            searchOrder: 1,
+            searchSpan: 4,
+            format: "yyyy-MM",
+            valueFormat: "yyyy-MM",
+          },
+          {
             label: "单据编号",
             prop: "billNo",
             search: true,
-            searchOrder: 5,
+            searchOrder: 6,
             overHidden: true,
             width: 120,
           },
           {
-            label: "类型",
+            label: "凭证字",
             prop: "voucherType",
             overHidden: true,
-            width: 80,
+            width: 90,
 
             type: "select",
             props: {
@@ -114,14 +128,14 @@ export default {
             },
             dicData: [],
             search: true,
-            searchOrder: 1,
+            searchOrder: 2,
             sortable: true
           },
           {
             label: "凭证号",
             prop: "voucherNo",
             search: true,
-            searchOrder: 2,
+            searchOrder: 3,
             overHidden: true,
             width: 100,
             sortable: true
@@ -132,11 +146,12 @@ export default {
             overHidden: true,
             width: 100,
           },
+          /*
           {
             label: "凭证开始日期",
             prop: "voucherDateStart",
             search: true,
-            searchOrder: 3,
+            searchOrder: 4,
             overHidden: true,
             searchLabelWidth: "100",
             hide: true,
@@ -149,7 +164,7 @@ export default {
             label: "凭证结束日期",
             prop: "voucherDateEnd",
             search: true,
-            searchOrder: 4,
+            searchOrder: 5,
             overHidden: true,
             searchLabelWidth: "100",
             hide: true,
@@ -158,6 +173,7 @@ export default {
             valueFormat: "yyyy-MM-dd HH:mm:ss",
             width: 100,
           },
+          */
           /*
           {
             label: "年",
@@ -173,12 +189,12 @@ export default {
           },
           */
           {
-            label: "摘要",
+            label: "凭证摘要",
             prop: "descr",
             overHidden: true,
             width: 200,
             search: true,
-            searchOrder: 6,
+            searchOrder: 7,
           },
           {
             label: "借方金额(CNY)",
@@ -199,7 +215,7 @@ export default {
             width: 120,
             hide: true,
             search: true,
-            searchOrder: 7,
+            searchOrder: 8,
           },
           {
             label: "借方金额(USD)",
@@ -220,13 +236,13 @@ export default {
             width: 120,
             hide: true,
             search: true,
-            searchOrder: 8,
+            searchOrder: 9,
           },
           {
             label: "外币",
             prop: "isForeign",
             search: true,
-            searchOrder: 9,
+            searchOrder: 10,
             type: 'select',
             dicData: [],
             dicUrl: "/api/blade-system/dict-biz/dictionary?code=ifInvoice",
@@ -257,7 +273,7 @@ export default {
             label: "凭证来源",
             prop: "voucherSource",
             search: true,
-            searchOrder: 10,
+            searchOrder: 11,
             type: 'select',
             dicData: [],
             // dicUrl: "/api/blade-system/dict-biz/dictionary?code=voucher_source_los",
@@ -356,8 +372,15 @@ export default {
     }
   },
   async created() {
-    this.option = await this.getColumnData(this.getColumnName(321), this.optionBack);
-    this.voucherStatusWorkDictsfun()
+    let opt = await this.getColumnData(this.getColumnName(321), this.optionBack);
+    let col = this.findObject(opt.column, "searchPeriod");
+    if(col) col.searchValue = new Date().toISOString().substring(0, 10) + " 00:00:00";
+    console.log(col, new Date().toISOString().substring(0, 7));
+    this.option = opt;
+    await this.voucherStatusWorkDictsfun()
+    this.$nextTick(()=>{
+      this.onLoad(this.page, this.query)
+    })
   },
   activated() {
     if (this.$route.query.id) {
@@ -608,7 +631,16 @@ export default {
     },
     onLoad(page, params = {}) {
       this.loading = true;
-      finvouchersList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+      if(!this.query.searchPeriod){
+        this.query.searchPeriod = new Date().toISOString().substring(0, 7);
+      }
+      let sp = this.query.searchPeriod;
+      this.query.accountYear = parseInt(sp.substring(0, 4))
+      this.query.accountMonth = parseInt(sp.substring(5, 7))
+
+      let query = Object.assign(params, this.query)
+
+      finvouchersList(page.currentPage, page.pageSize, query).then(res => {
         const data = res.data.data;
         this.page.total = data.total;
         this.data = data.records.map(item => {

+ 816 - 725
src/views/iosBasicData/periodManagement/index.vue

@@ -1,746 +1,837 @@
 <template>
-    <div>
-        <basic-container v-show="!detailsOpen">
-            <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
-                <el-tab-pane label="会计期间" name="first">
-                    <avue-crud :option="option" :search.sync="search" v-model="form" :table-loading="loading"
-                        :data="dataList" ref="crud" :key="key" @on-load="onLoad" @search-change="searchChange"
-                        @refresh-change="refreshChange" @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 366)"
-                        @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 366)" :page.sync="page">
-                        <template slot-scope="{type,size,row,index}" slot="menu">
-                            <el-button size="small" :type="type" :disabled="row.lockingStatus != 0"
-                                @click="lock(row, 1)">锁定</el-button>
-                            <el-button size="small" :type="type" :disabled="row.lockingStatus != 1 || row.isClosed != 0"
-                                @click="lock(row, 2)">撤销锁定</el-button>
-                            <el-button size="small" :type="type" :disabled="row.lockingStatus != 1 || row.isClosed != 0"
-                                @click="inClose(row, 1)">结转</el-button>
-                            <el-button size="small" :type="type" :disabled="row.isClosed != 1"
-                                @click="inClose(row, 2)">反结转</el-button>
-                        </template>
-                        <template slot-scope="{type,size,row,$index}" slot="menuLeft">
-                            <el-button type="success" size="small" @click="openDialog = true; title = '开账'" v-if="showBut">开
-                                账</el-button>
-                            <el-button type="success" size="small" @click="openDialog = true; title = '账套初始化'"
-                                v-if="!showBut">账套初始化</el-button>
-                        </template>
-                    </avue-crud>
-                </el-tab-pane>
-                <el-tab-pane label="月末结转" name="second">
-                    <avue-crud :option="option2" :search.sync="search2" v-model="form2" :table-loading="loading"
-                        :data="dataList2" ref="crud2" :key="key" @on-load="onLoad2" @search-change="searchChange2"
-                        @refresh-change="refreshChange2"
-                        @resetColumn="resetColumnTwo('crud2', 'option2', 'optionList2', 367)"
-                        @saveColumn="saveColumnTwo('crud2', 'option2', 'optionList2', 367)">
-                        <template slot-scope="{type,size,row,index}" slot="menu">
-                            <el-button size="small" :type="type" @click="editOpen(row)">模板修改</el-button>
-                            <el-button size="small" :type="type" @click="generate(row)">生成凭证</el-button>
-                        </template>
-                        <!-- <template slot-scope="{type,size,row,$index}" slot="menuLeft">
+  <div>
+    <basic-container v-show="!detailsOpen">
+      <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+        <el-tab-pane label="会计期间" name="first">
+          <avue-crud
+            :option="option"
+            :search.sync="search"
+            v-model="form"
+            :table-loading="loading"
+            :data="dataList"
+            ref="crud"
+            :key="key"
+            @on-load="onLoad"
+            @search-change="searchChange"
+            @refresh-change="refreshChange"
+            @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 366)"
+            @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 366)"
+            :page.sync="page"
+          >
+            <template slot-scope="{ type, size, row, index }" slot="menu">
+              <el-button size="small" :type="type" :disabled="row.lockingStatus != 0" @click="lock(row, 1)">锁定</el-button>
+              <el-button size="small" :type="type" :disabled="row.lockingStatus != 1 || row.isClosed != 0" @click="lock(row, 2)">撤销锁定</el-button>
+              <el-button size="small" :type="type" :disabled="row.lockingStatus != 1 || row.isClosed != 0" @click="inClose(row, 1)">结转</el-button>
+              <el-button size="small" :type="type" :disabled="row.isClosed != 1" @click="inClose(row, 2)">反结转</el-button>
+            </template>
+            <template slot-scope="{ type, size, row, $index }" slot="menuLeft">
+              <el-button
+                type="success"
+                size="small"
+                @click="
+                  openDialog = true;
+                  title = '开账';
+                "
+                v-if="showBut"
+                >开 账</el-button
+              >
+              <el-button
+                type="success"
+                size="small"
+                @click="
+                  openDialog = true;
+                  title = '账套初始化';
+                "
+                v-if="!showBut"
+                >账套初始化</el-button
+              >
+            </template>
+          </avue-crud>
+        </el-tab-pane>
+        <el-tab-pane label="月末结转" name="second">
+          <avue-crud
+            :option="option2"
+            :search.sync="search2"
+            v-model="form2"
+            :table-loading="loading"
+            :data="dataList2"
+            ref="crud2"
+            :key="key"
+            @on-load="onLoad2"
+            @search-change="searchChange2"
+            @refresh-change="refreshChange2"
+            @resetColumn="resetColumnTwo('crud2', 'option2', 'optionList2', 367)"
+            @saveColumn="saveColumnTwo('crud2', 'option2', 'optionList2', 367)"
+          >
+            <template slot-scope="{ type, size, row, index }" slot="menu">
+              <el-button size="small" :type="type" @click="editOpen(row)">模板修改</el-button>
+              <el-button size="small" :type="type" @click="generate(row)">生成凭证</el-button>
+            </template>
+            <!-- <template slot-scope="{type,size,row,$index}" slot="menuLeft">
                             <el-button icon="el-icon-plus" type="primary" size="small"
                                 @click="detailsOpen = true">新建申请</el-button>
                         </template> -->
-                    </avue-crud>
-                </el-tab-pane>
-            </el-tabs>
-        </basic-container>
-        <detailsPage v-if="detailsOpen" @goBack="goBack" :onLoad="form" :detailData="detailData">
-        </detailsPage>
-        <el-dialog v-dialogdrag append-to-body :title="title" :visible.sync="openDialog" width="30%"
-            :before-close="handleClose">
-            <span v-if="title == '汇兑损益汇率'" style="display: flex;align-items: center;">
-                <avue-crud :data="itemData" :option="itemOption"></avue-crud>
-            </span>
-            <span v-if="title == '期间损益汇率'" style="display: flex;align-items: center;">
-                <avue-crud :data="itemData" :option="itemOption"></avue-crud>
-            </span>
-            <span v-else-if="title == '开账'" style="display: flex;align-items: center;">
-                开账日期:<avue-date size="small" type="datetime" v-model="openDate" format="yyyy-MM-dd HH:mm:ss"
-                    value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择开张日期"></avue-date>
-            </span>
-            <span v-else-if="title == '账套初始化'" style="display: flex;align-items: center;">
-                开账日期:<avue-date size="small" type="datetime" v-model="openDate" format="yyyy-MM-dd HH:mm:ss"
-                    value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择开张日期"></avue-date>
-            </span>
-            <el-dialog v-dialogdrag append-to-body title="凭证明细" :visible.sync="itemOpenDialog" width="50%"
-                :before-close="handleClose2">
-                <span style="display: flex;align-items: center;">
-                    <avue-crud :data="itemForm2.finVouchersItemsList" :option="itemOption2"></avue-crud>
-                </span>
-                <span slot="footer" class="dialog-footer">
-                    <el-button size="mini" @click="itemOpenDialog = false">取 消</el-button>
-                    <el-button size="mini" type="primary" @click="onPeriod()">确 定</el-button>
-                </span>
-            </el-dialog>
-            <span slot="footer" class="dialog-footer">
-                <el-button size="mini" @click="openDialog = false">取 消</el-button>
-                <el-button v-if="title == '开账'" size="mini" type="primary" @click="onBill">确 定</el-button>
-                <el-button v-else-if="title == '账套初始化'" size="mini" type="primary" @click="resetBill">确 定</el-button>
-                <el-button v-else-if="title == '汇兑损益汇率'" size="mini" type="primary" @click="inPeriod">确 定</el-button>
-                <el-button v-else-if="title == '期间损益汇率'" size="mini" type="primary" @click="inPeriod">确 定</el-button>
-            </span>
-        </el-dialog>
-        <el-dialog v-dialogdrag append-to-body title="业务审核未通过明细" :visible.sync="openDialog2" width="50%"
-            :before-close="handleClose3">
-            <span style="display: flex;align-items: center;">
-                <avue-crud :data="dialogData" :option="dialogOption"></avue-crud>
-            </span>
-            <span slot="footer" class="dialog-footer">
-                <el-button size="mini" @click="openDialog2 = false">取 消</el-button>
-                <el-button size="mini" type="primary" @click="exportExcel(1)">导 出</el-button>
-            </span>
-        </el-dialog>
-        <el-dialog v-dialogdrag append-to-body title="凭证未记账数据" :visible.sync="openDialog3" width="50%"
-            :before-close="handleClose4">
-            <span style="display: flex;align-items: center;">
-                <avue-crud :data="dialogData2" :option="dialogOption2"></avue-crud>
-            </span>
-            <span slot="footer" class="dialog-footer">
-                <el-button size="mini" @click="openDialog3 = false">取 消</el-button>
-                <el-button size="mini" type="primary" @click="exportExcel(2)">导 出</el-button>
-            </span>
-        </el-dialog>
-    </div>
+          </avue-crud>
+        </el-tab-pane>
+      </el-tabs>
+    </basic-container>
+    <detailsPage v-if="detailsOpen" @goBack="goBack" :onLoad="form" :detailData="detailData"> </detailsPage>
+
+    <el-dialog v-dialogdrag append-to-body :title="title" :visible.sync="openDialog" width="30%" :before-close="handleClose">
+      <span v-if="title == '汇兑损益汇率'" style="display: flex; align-items: center">
+        <avue-crud :data="itemData" :option="itemOption"></avue-crud>
+      </span>
+      <span v-if="title == '期间损益汇率'" style="display: flex; align-items: center">
+        <avue-crud :data="itemData" :option="itemOption"></avue-crud>
+      </span>
+      <span v-else-if="title == '开账'" style="display: flex; align-items: center">
+        开账期间:<avue-date
+          size="small"
+          type="month"
+          v-model="openDate"
+          format="yyyy-MM"
+          value-format="yyyy-MM"
+          placeholder="请选择开账日期"
+        ></avue-date>
+      </span>
+      <span v-else-if="title == '账套初始化'" style="display: flex; align-items: center">
+        初始化期间:<avue-date
+          size="small"
+          type="month"
+          v-model="openDate"
+          format="yyyy-MM"
+          value-format="yyyy-MM"
+          placeholder="请选择初始化期间"
+        ></avue-date>
+      </span>
+      <el-dialog v-dialogdrag append-to-body title="凭证明细" :visible.sync="itemOpenDialog" width="50%" :before-close="handleClose2">
+        <span style="display: flex; align-items: center">
+          <avue-crud :data="itemForm2.finVouchersItemsList" :option="itemOption2"></avue-crud>
+        </span>
+        <span slot="footer" class="dialog-footer">
+          <el-button size="mini" @click="itemOpenDialog = false">取 消</el-button>
+          <el-button size="mini" type="primary" @click="onPeriod()">确 定</el-button>
+        </span>
+      </el-dialog>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="openDialog = false">取 消</el-button>
+        <el-button v-if="title == '开账'" size="mini" type="primary" @click="openPeriod">确 定</el-button>
+        <el-button v-else-if="title == '账套初始化'" size="mini" type="primary" @click="resetBill">确 定</el-button>
+        <el-button v-else-if="title == '汇兑损益汇率'" size="mini" type="primary" @click="inPeriod">确 定</el-button>
+        <el-button v-else-if="title == '期间损益汇率'" size="mini" type="primary" @click="inPeriod">确 定</el-button>
+      </span>
+    </el-dialog>
+
+    <el-dialog v-dialogdrag append-to-body title="业务审核未通过明细" :visible.sync="openDialog2" width="50%" :before-close="handleClose3">
+      <span style="display: flex; align-items: center">
+        <avue-crud :data="dialogData" :option="dialogOption"></avue-crud>
+      </span>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="openDialog2 = false">取 消</el-button>
+        <el-button size="mini" type="primary" @click="exportExcel(1)">导 出</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog v-dialogdrag append-to-body title="凭证未记账数据" :visible.sync="openDialog3" width="50%" :before-close="handleClose4">
+      <span style="display: flex; align-items: center">
+        <avue-crud :data="dialogData2" :option="dialogOption2"></avue-crud>
+      </span>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="openDialog3 = false">取 消</el-button>
+        <el-button size="mini" type="primary" @click="exportExcel(2)">导 出</el-button>
+      </span>
+    </el-dialog>
+  </div>
 </template>
-  
+
 <script>
-import { getList, currentPeriod, open, init, locking, revokeLocking, close, unclose, generateVouchers, submitPeriod, getPeriodExchangeRate } from "@/api/iosBasicData/periodManagement";
-import detailsPage from "./detailsPage"
+import {
+  getList,
+  currentPeriod,
+  init,
+  locking,
+  revokeLocking,
+  close,
+  unclose,
+  generateVouchers,
+  submitPeriod,
+  getPeriodExchangeRate,
+  openPeriod,
+} from "@/api/iosBasicData/periodManagement";
+import detailsPage from "./detailsPage";
 import { defaultDate4 } from "@/util/date";
 import { getToken } from "@/util/auth";
 export default {
-    name: "index",
-    components: {
-        detailsPage
-    },
-    data() {
-        return {
-            itemId: null,
-            dialogOption: {
-                viewBtn: false,
-                editBtn: false,
-                delBtn: false,
-                addBtn: false,
-                index: false,
-                border: true,
-                menu: false,
-                header: false,
-                align: "center",
-                size: "small",
-                column: [
-                    {
-                        label: '业务模块',
-                        prop: 'businessType',
-                        overHidden: true,
-                    },
-                    {
-                        label: '单据号',
-                        prop: 'billNo',
-                        overHidden: true,
-                    },
-                    {
-                        label: '业务日期',
-                        prop: 'businessDate',
-                        overHidden: true,
-                    },
-                    {
-                        label: '提单号',
-                        prop: 'mblno',
-                        overHidden: true,
-                    },
-                    {
-                        label: '操作员',
-                        prop: 'operator',
-                        overHidden: true,
-                    },
-                    {
-                        label: '业务员',
-                        prop: 'salesperson',
-                        overHidden: true,
-                    }
-                ]
-            },
-            openDialog2: false,
-            dialogData: [],
-            dialogOption2: {
-                viewBtn: false,
-                editBtn: false,
-                delBtn: false,
-                addBtn: false,
-                index: false,
-                border: true,
-                menu: false,
-                header: false,
-                align: "center",
-                size: "small",
-                column: [
-                    {
-                        label: '年',
-                        prop: 'year',
-                        overHidden: true,
-                    },
-                    {
-                        label: '月',
-                        prop: 'month',
-                        overHidden: true,
-                    },
-                    {
-                        label: '凭证号',
-                        prop: 'voucherNumber',
-                        overHidden: true,
-                    },
-                    {
-                        label: '凭证日期',
-                        prop: 'voucherDate',
-                        overHidden: true,
-                    },
-                    {
-                        label: '制单人',
-                        prop: 'operator',
-                        overHidden: true,
-                    }
-                ]
-            },
-            openDialog3: false,
-            dialogData2: [],
-            itemForm: {},
-            itemData: [],
-            itemOption: {
-                viewBtn: false,
-                editBtn: false,
-                delBtn: false,
-                addBtn: false,
-                index: false,
-                border: true,
-                menu: false,
-                header: false,
-                align: "center",
-                size: "small",
-                column: [
-                    {
-                        label: '币种代码',
-                        prop: 'curCode'
-                    }, {
-                        label: '币种名称',
-                        prop: 'curName'
-                    }, {
-                        label: '汇率日期',
-                        prop: 'curDate'
-                    }, {
-                        label: '汇率',
-                        prop: 'exrate',
-                        type: 'number',
-                        precision: 4,
-                        step: 4,
-                        cell: true
-                    }
-                ]
-            },
-            itemForm2: {},
-            itemOption2: {
-                viewBtn: false,
-                editBtn: false,
-                delBtn: false,
-                addBtn: false,
-                index: false,
-                border: true,
-                menu: false,
-                header: false,
-                align: "center",
-                size: "small",
-                column: [
-                    {
-                        label: '摘要',
-                        prop: 'descr',
-                        overHidden: true,
-                    },
-                    {
-                        label: '代码名称',
-                        prop: 'accountCode',
-                        overHidden: true,
-                    },
-                    {
-                        label: '本币金额',
-                        overHidden: true,
-                        children: [{
-                            label: '借方',
-                            prop: 'amountDr',
-                            overHidden: true,
-                        }, {
-                            label: '货方',
-                            prop: 'amountCr',
-                            overHidden: true,
-                        }]
-                    },
-                    {
-                        label: '外币金额',
-                        overHidden: true,
-                        children: [{
-                            label: '币种',
-                            prop: 'curCode',
-                            overHidden: true,
-                        }, {
-                            label: '汇率',
-                            prop: 'exrate',
-                            overHidden: true,
-                        }, {
-                            label: '借方',
-                            prop: 'amountDrUsd',
-                            overHidden: true,
-                        }, {
-                            label: '货方',
-                            prop: 'amountCrUsd',
-                            overHidden: true,
-                        }]
-                    }
-                ]
-            },
-            showBut: false,
-            title: '开账',
-            openDate: null,
-            openDialog: false,
-            itemOpenDialog: false,
-            activeName: 'first',
-            detailsOpen: false,
-            loading: false,
-            search: {
-                periodYear: defaultDate4()
-            },
-            form: {},
-            dataList: [],
-            detailData: {},
-            page: {
-                pageSize: 20,
-                currentPage: 1,
-                total: 0,
-                pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
-            },
-            key: 0,
-            option: {},
-            optionList: {
-                viewBtn: false,
-                editBtn: false,
-                delBtn: false,
-                addBtn: false,
-                index: true,
-                span: 8,
-                border: true,
-                height: "auto",
-                searchMenuPosition: "right",
-                align: "center",
-                size: "small",
-                menuWidth: 200,
-                searchSpan: 8,
-                searchIcon: true,
-                searchIndex: 2,
-                dialogWidth: "70%",
-                column: [
-                    {
-                        label: '会计年度',
-                        prop: "periodYear",
-                        search: true,
-                        overHidden: true,
-                        hide: true,
-                        type: "year",
-                        valueFormat: "yyyy"
-                    },
-                    {
-                        label: '期间',
-                        prop: "periodDate",
-                        overHidden: true,
-                    },
-                    {
-                        label: '开始时间',
-                        prop: "beginDate",
-                        search: true,
-                        overHidden: true,
-                        type: "date",
-                        format: "yyyy-MM-dd",
-                        valueFormat: "yyyy-MM-dd 00:00:00"
-                    },
-                    {
-                        label: '结束时间',
-                        prop: "endDate",
-                        type: "date",
-                        overHidden: true,
-                        search: true,
-                        format: "yyyy-MM-dd",
-                        valueFormat: "yyyy-MM-dd 23:59:59"
-                    },
-                    {
-                        label: '结转状态',
-                        prop: "isClosed",
-                        type: 'select',
-                        overHidden: true,
-                        search: true,
-                        dicData: [
-                        {
-                                label: '未结转',
-                                value: 0,
-                            }, {
-                                label: '已结转',
-                                value: 1,
-                            }
-                        ]
-                    },
-                    {
-                        label: '结转时间',
-                        prop: "closeDate",
-                        searchProp: "closeDateList",
-                        overHidden: true,
-                        search: true,
-                        type: "date",
-                        searchRange: true,
-                        searchDefaultTime: ["00:00:00", "23:59:59"],
-                        format: "yyyy-MM-dd",
-                        valueFormat: "yyyy-MM-dd HH:mm:ss"
-                    }
-                ]
-            },
-            search2: {},
-            form2: {},
-            dataList2: [],
-            detailData2: {},
-            option2: {},
-            optionList2: {
-                viewBtn: false,
-                editBtn: false,
-                delBtn: false,
-                addBtn: false,
-                index: true,
-                span: 8,
-                border: true,
-                height: "auto",
-                searchMenuPosition: "right",
-                align: "center",
-                size: "small",
-                menuWidth: 200,
-                dialogWidth: "70%",
-                column: [
-                    {
-                        label: '结转凭证',
-                        prop: "descr",
-                        overHidden: true,
-                    },
-                    {
-                        label: '开始时间',
-                        prop: "date",
-                        overHidden: true,
-                    },
-                    {
-                        label: '状态',
-                        prop: "status",
-                        type: 'select',
-                        overHidden: true,
-                        dicData: [
-                            {
-                                label: '未生成',
-                                value: 0,
-                            }, {
-                                label: '已生成',
-                                value: 1,
-                            }
-                        ]
-                    }
-                ]
-            },
-        }
-    },
-    async created() {
-        this.option = await this.getColumnData(this.getColumnName(366), this.optionList);
-        this.option2 = await this.getColumnData(this.getColumnName(367), this.optionList2);
-    },
-    methods: {
-        exportExcel(type) {
-            const routeData = this.$router.resolve({
-                path: '/api/blade-los/finperiod/export',      //跳转目标窗口的地址
-                query: {
-                    'Blade-Auth': getToken(),
-                    'id': this.itemId,
-                }
-            })
-            window.open(routeData.href.slice(1, routeData.href.length));
-            if (type == 1) {
-                this.handleClose3()
-            } else {
-                this.handleClose4()
-            }
+  name: "index",
+  components: {
+    detailsPage,
+  },
+  data() {
+    return {
+      itemId: null,
+      dialogOption: {
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        addBtn: false,
+        index: false,
+        border: true,
+        menu: false,
+        header: false,
+        align: "center",
+        size: "small",
+        column: [
+          {
+            label: "业务模块",
+            prop: "businessType",
+            overHidden: true,
+          },
+          {
+            label: "单据号",
+            prop: "billNo",
+            overHidden: true,
+          },
+          {
+            label: "业务日期",
+            prop: "businessDate",
+            overHidden: true,
+          },
+          {
+            label: "提单号",
+            prop: "mblno",
+            overHidden: true,
+          },
+          {
+            label: "操作员",
+            prop: "operator",
+            overHidden: true,
+          },
+          {
+            label: "业务员",
+            prop: "salesperson",
+            overHidden: true,
+          },
+        ],
+      },
+      openDialog2: false,
+      dialogData: [],
+      dialogOption2: {
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        addBtn: false,
+        index: false,
+        border: true,
+        menu: false,
+        header: false,
+        align: "center",
+        size: "small",
+        column: [
+          {
+            label: "年",
+            prop: "year",
+            overHidden: true,
+          },
+          {
+            label: "月",
+            prop: "month",
+            overHidden: true,
+          },
+          {
+            label: "凭证号",
+            prop: "voucherNumber",
+            overHidden: true,
+          },
+          {
+            label: "凭证日期",
+            prop: "voucherDate",
+            overHidden: true,
+          },
+          {
+            label: "制单人",
+            prop: "operator",
+            overHidden: true,
+          },
+        ],
+      },
+      openDialog3: false,
+      dialogData2: [],
+      itemForm: {},
+      itemData: [],
+      itemOption: {
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        addBtn: false,
+        index: false,
+        border: true,
+        menu: false,
+        header: false,
+        align: "center",
+        size: "small",
+        column: [
+          {
+            label: "币种代码",
+            prop: "curCode",
+          },
+          {
+            label: "币种名称",
+            prop: "curName",
+          },
+          {
+            label: "汇率日期",
+            prop: "curDate",
+          },
+          {
+            label: "汇率",
+            prop: "exrate",
+            type: "number",
+            precision: 4,
+            step: 4,
+            cell: true,
+          },
+        ],
+      },
+      itemForm2: {},
+      itemOption2: {
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        addBtn: false,
+        index: false,
+        border: true,
+        menu: false,
+        header: false,
+        align: "center",
+        size: "small",
+        column: [
+          {
+            label: "摘要",
+            prop: "descr",
+            overHidden: true,
+          },
+          {
+            label: "代码名称",
+            prop: "accountCode",
+            overHidden: true,
+          },
+          {
+            label: "本币金额",
+            overHidden: true,
+            children: [
+              {
+                label: "借方",
+                prop: "amountDr",
+                overHidden: true,
+              },
+              {
+                label: "货方",
+                prop: "amountCr",
+                overHidden: true,
+              },
+            ],
+          },
+          {
+            label: "外币金额",
+            overHidden: true,
+            children: [
+              {
+                label: "币种",
+                prop: "curCode",
+                overHidden: true,
+              },
+              {
+                label: "汇率",
+                prop: "exrate",
+                overHidden: true,
+              },
+              {
+                label: "借方",
+                prop: "amountDrUsd",
+                overHidden: true,
+              },
+              {
+                label: "货方",
+                prop: "amountCrUsd",
+                overHidden: true,
+              },
+            ],
+          },
+        ],
+      },
+      showBut: false,
+      title: "开账",
+      openDate: null,
+      openDialog: false,
+      itemOpenDialog: false,
+      activeName: "first",
+      detailsOpen: false,
+      loading: false,
+      search: {
+        periodYear: defaultDate4(),
+      },
+      form: {},
+      dataList: [],
+      detailData: {},
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500],
+      },
+      key: 0,
+      option: {},
+      optionList: {
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        addBtn: false,
+        index: true,
+        span: 8,
+        border: true,
+        height: "auto",
+        // searchMenuPosition: "right",
+        align: "center",
+        size: "small",
+        menuWidth: 200,
+        searchSpan: 6,
+        searchIcon: true,
+        searchIndex: 3,
+        dialogWidth: "70%",
+        column: [
+          {
+            label: "会计年度",
+            prop: "periodYear",
+            search: true,
+            overHidden: true,
+            hide: true,
+            type: "year",
+            valueFormat: "yyyy",
+            width: 100,
+          },
+          {
+            label: "期间",
+            prop: "periodDate",
+            overHidden: true,
+            width: 100,
+          },
+          {
+            label: "开始时间",
+            prop: "beginDate",
+            search: false,
+            overHidden: true,
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd 00:00:00",
+            width: 180,
+          },
+          {
+            label: "结束时间",
+            prop: "endDate",
+            type: "date",
+            overHidden: true,
+            search: false,
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd 23:59:59",
+            width: 180,
+          },
+          {
+            label: "结转状态",
+            prop: "isClosed",
+            type: "select",
+            width: 100,
+            overHidden: true,
+            search: true,
+            dicData: [
+              {
+                label: "未结转",
+                value: 0,
+              },
+              {
+                label: "已结转",
+                value: 1,
+              },
+            ],
+          },
+          {
+            label: "结转时间",
+            prop: "closeDate",
+            searchProp: "closeDateList",
+            overHidden: true,
+            search: false,
+            type: "date",
+            width: 180,
+            searchRange: true,
+            searchDefaultTime: ["00:00:00", "23:59:59"],
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd HH:mm:ss",
+          },
+        ],
+      },
+      search2: {},
+      form2: {},
+      dataList2: [],
+      detailData2: {},
+      option2: {},
+      optionList2: {
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        addBtn: false,
+        index: true,
+        span: 8,
+        border: true,
+        height: "auto",
+        searchMenuPosition: "right",
+        align: "center",
+        size: "small",
+        menuWidth: 200,
+        dialogWidth: "70%",
+        column: [
+          {
+            label: "结转凭证",
+            prop: "descr",
+            overHidden: true,
+          },
+          {
+            label: "开始时间",
+            prop: "date",
+            overHidden: true,
+          },
+          {
+            label: "状态",
+            prop: "status",
+            type: "select",
+            overHidden: true,
+            dicData: [
+              {
+                label: "未生成",
+                value: 0,
+              },
+              {
+                label: "已生成",
+                value: 1,
+              },
+            ],
+          },
+        ],
+      },
+    };
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(366), this.optionList);
+    this.option2 = await this.getColumnData(this.getColumnName(367), this.optionList2);
+  },
+  methods: {
+    exportExcel(type) {
+      const routeData = this.$router.resolve({
+        path: "/api/blade-los/finperiod/export", //跳转目标窗口的地址
+        query: {
+          "Blade-Auth": getToken(),
+          id: this.itemId,
         },
-        lock(row, type) {
-            if (type == '1') {
-                this.$confirm('是否锁定?', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    this.loading = true
-                    locking({ id: row.id }).then(res => {
-                        if (res.data.msg == '审核未通过') {
-                            this.loading = false
-                            this.openDialog2 = true
-                            this.itemId = row.id
-                            this.dialogData = res.data.data
-                        } else if (res.data.msg == '凭证未记账') {
-                            this.loading = false
-                            this.openDialog3 = true
-                            this.itemId = row.id
-                            this.dialogData2 = res.data.data
-                        } else {
-                            this.loading = false
-                            this.$message.success("锁定成功");
-                            this.handleClick(this.activeName)
-
-                        }
-
-                    }).finally(() => {
-                        this.loading = false
-                    })
-                })
-            } else {
-                this.$confirm('是否撤销锁定?', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    this.loading = true
-                    revokeLocking({ id: row.id }).then(res => {
-                        this.loading = false
-                        this.$message.success("撤销锁定");
-                        this.handleClick(this.activeName)
-                    }).finally(() => {
-                        this.loading = false
-                    })
-                })
-            }
-        },
-        inClose(row, type) {
-            if (type == '1') {
-                this.$confirm('是否结转?', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    this.loading = true
-                    close({ id: row.id }).then(res => {
-                        this.loading = false
-                        this.$message.success("结转成功");
-                        this.handleClick(this.activeName)
-                    }).finally(() => {
-                        this.loading = false
-                    })
-                })
-            } else {
-                this.$confirm('是否反结转?', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    this.loading = true
-                    unclose({ id: row.id }).then(res => {
-                        this.loading = false
-                        this.$message.success("反结转成功");
-                        this.handleClick(this.activeName)
-                    }).finally(() => {
-                        this.loading = false
-                    })
-                })
-            }
-        },
-        onBill() {
-            this.$confirm('确认开账?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(() => {
-                this.loading = true
-                open({ beginDate: this.openDate }).then(res => {
-
-                    this.$message.success("开账成功");
-                    this.handleClick(this.activeName)
-                    this.handleClose()
-                }).finally(() => {
-                    this.loading = false
-                })
+      });
+      window.open(routeData.href.slice(1, routeData.href.length));
+      if (type == 1) {
+        this.handleClose3();
+      } else {
+        this.handleClose4();
+      }
+    },
+    lock(row, type) {
+      if (type == "1") {
+        this.$confirm("是否锁定?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }).then(() => {
+          this.loading = true;
+          locking({ id: row.id })
+            .then((res) => {
+              if (res.data.msg == "审核未通过") {
+                this.loading = false;
+                this.openDialog2 = true;
+                this.itemId = row.id;
+                this.dialogData = res.data.data;
+              } else if (res.data.msg == "凭证未记账") {
+                this.loading = false;
+                this.openDialog3 = true;
+                this.itemId = row.id;
+                this.dialogData2 = res.data.data;
+              } else {
+                this.loading = false;
+                this.$message.success("锁定成功");
+                this.handleClick(this.activeName);
+              }
             })
-        },
-        handleClose() {
-            this.itemForm = {}
-            this.openDate = null
-            this.openDialog = false
-        },
-        handleClose2() {
-            this.itemData2 = []
-            this.itemOpenDialog = false
-        },
-        handleClose3() {
-            this.itemId = null
-            this.dialogData = []
-            this.openDialog2 = false
-        },
-        handleClose4() {
-            this.itemId = null
-            this.dialogData2 = []
-            this.openDialog3 = false
-        },
-        resetBill() {
-            this.$confirm('确认账套初始化?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(() => {
-                this.loading = true
-                init({ beginDate: this.openDate }).then(res => {
-                    this.loading = false
-                    this.$message.success("初始化成功");
-                    this.handleClick(this.activeName)
-                    this.handleClose()
-                }).finally(() => {
-                    this.loading = false
-                })
+            .finally(() => {
+              this.loading = false;
+            });
+        });
+      } else {
+        this.$confirm("是否撤销锁定?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }).then(() => {
+          this.loading = true;
+          revokeLocking({ id: row.id })
+            .then((res) => {
+              this.loading = false;
+              this.$message.success("撤销锁定");
+              this.handleClick(this.activeName);
             })
-        },
-        handleClick(val) {
-            if (val == 'first') {
-                this.onLoad(this.page, this.search)
-            } else {
-                this.onLoad2(this.search2)
-            }
-        },
-        goBack(type) {
-            this.form = {}
-            this.detailsOpen = false
-            this.onLoad(this.page, this.search)
-        },
-        editOpen(row, status) {
-            this.form = row
-            this.detailData = {
-                id: row.id,
-                type: row.bsType,
-                status: status
-            };
-            this.detailsOpen = true;
-        },
-        generate(row) {
-            this.openDialog = true;
-            this.itemForm = row;
-            this.title = row.bsType == 'FM-CURRENCY-PL-TRANSFER' ? '汇兑损益汇率' : '期间损益汇率';
-            getPeriodExchangeRate().then(res => {
-                res.data.data.forEach(e => {
-                    e.$cellEdit = true
-                })
-                this.itemData = res.data.data
+            .finally(() => {
+              this.loading = false;
+            });
+        });
+      }
+    },
+    inClose(row, type) {
+      if (type == "1") {
+        this.$confirm("是否结转?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }).then(() => {
+          this.loading = true;
+          close({ id: row.id })
+            .then((res) => {
+              this.loading = false;
+              this.$message.success("结转成功");
+              this.handleClick(this.activeName);
             })
-        },
-        inPeriod() {
-            let obj = {}
-            obj = { ...this.itemForm, exchangeRateList: this.itemData }
-
-            generateVouchers(obj).then(res => {
-                console.log(res)
-                this.itemForm2 = res.data.data
-                this.handleClose()
-                this.itemOpenDialog = true
+            .finally(() => {
+              this.loading = false;
+            });
+        });
+      } else {
+        this.$confirm("是否反结转?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }).then(() => {
+          this.loading = true;
+          unclose({ id: row.id })
+            .then((res) => {
+              this.loading = false;
+              this.$message.success("反结转成功");
+              this.handleClick(this.activeName);
             })
+            .finally(() => {
+              this.loading = false;
+            });
+        });
+      }
+    },
+    openPeriod() {
+      if (!this.openDate) {
+        return this.$message.warning("请选择开账月份!");
+      }
+      this.$confirm("确认开账?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        this.loading = true;
+        openPeriod({ beginDate: this.openDate + "-01 00:00:00" })
+          .then((res) => {
+            this.$message.success("开账成功");
+            this.handleClick(this.activeName);
+            this.handleClose();
+          })
+          .finally(() => {
+            this.loading = false;
+          });
+      });
+    },
+    handleClose() {
+      this.itemForm = {};
+      this.openDate = null;
+      this.openDialog = false;
+    },
+    handleClose2() {
+      this.itemData2 = [];
+      this.itemOpenDialog = false;
+    },
+    handleClose3() {
+      this.itemId = null;
+      this.dialogData = [];
+      this.openDialog2 = false;
+    },
+    handleClose4() {
+      this.itemId = null;
+      this.dialogData2 = [];
+      this.openDialog3 = false;
+    },
+    resetBill() {
+      if (!this.openDate) {
+        return this.$message.warning("请选择初始化月份!");
+      }
 
-        },
-        onPeriod() {
-            if (this.itemForm2.finVouchersItemsList.length == 0) {
-                return this.$message.error("明细不能为空");
-            }
-            this.$confirm('确定保存凭证?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(() => {
-                this.loading = true
-                submitPeriod(this.itemForm2).then(res => {
-                    this.$message.success("保存成功");
-                    this.handleClose2()
-                }).finally(() => {
-                    this.loading = false
-                })
-            })
+      this.$confirm("确认账套初始化?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        this.loading = true;
+        init({ beginDate: this.openDate + "-01 00:00:00" })
+          .then((res) => {
+            this.loading = false;
+            this.$message.success("初始化成功");
+            this.handleClick(this.activeName);
+            this.handleClose();
+          })
+          .finally(() => {
+            this.loading = false;
+          });
+      });
+    },
+    handleClick(val) {
+      if (val == "first") {
+        this.onLoad(this.page, this.search);
+      } else {
+        this.onLoad2(this.search2);
+      }
+    },
+    goBack(type) {
+      this.form = {};
+      this.detailsOpen = false;
+      this.onLoad(this.page, this.search);
+    },
+    editOpen(row, status) {
+      this.form = row;
+      this.detailData = {
+        id: row.id,
+        type: row.bsType,
+        status: status,
+      };
+      this.detailsOpen = true;
+    },
+    generate(row) {
+      this.openDialog = true;
+      this.itemForm = row;
+      this.title = row.bsType == "FM-CURRENCY-PL-TRANSFER" ? "汇兑损益汇率" : "期间损益汇率";
+      getPeriodExchangeRate().then((res) => {
+        res.data.data.forEach((e) => {
+          e.$cellEdit = true;
+        });
+        this.itemData = res.data.data;
+      });
+    },
+    inPeriod() {
+      let obj = {};
+      obj = { ...this.itemForm, exchangeRateList: this.itemData };
 
-        },
-        //刷新
-        refreshChange() {
-            this.onLoad(this.page, this.search)
-        },
-        searchChange(params, done) {
-            this.page.currentPage = 1
-            done();
-            this.onLoad(this.page, params)
-        },
-        onLoad(page, params = {}) {
-            console.log(params)
-            params = {
-                ...Object.assign(params, this.search),
-                current: page.currentPage,
-                size: page.pageSize,
-            }
-            this.loading = true
-            getList(params).then(res => {
-                this.dataList = res.data.data.records
-                this.page.total = res.data.data.total;
-                this.showBut = res.data.data.records.length == 0 ? true : false;
-                this.loading = false
-            }).finally(() => {
-                this.loading = false
-            })
-        },
-        //刷新
-        refreshChange2() {
-            this.onLoad2(this.search)
-        },
-        searchChange2(params, done) {
-            this.page.currentPage = 1
-            done();
-            this.onLoad(params)
-        },
-        onLoad2(page, params = {}) {
-            params = {
-                ...params
-            }
-            this.loading = true
-            currentPeriod(params).then(res => {
-                this.dataList2 = res.data.data
-                this.loading = false
-            }).finally(() => {
-                this.loading = false
-            })
-        },
-        //自定义列保存
-        async saveColumnTwo(ref, option, optionBack, code) {
-            /**
-             * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
-             * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
-             * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
-             */
-            const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
-            if (inSave) {
-                this.$message.success("保存成功");
-                //关闭窗口
-                this.$refs[ref].$refs.dialogColumn.columnBox = false;
-            }
-        },
-        //自定义列重置
-        async resetColumnTwo(ref, option, optionBack, code) {
-            this[option] = this[optionBack];
-            const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
-            if (inSave) {
-                this.$message.success("重置成功");
-                this.$refs[ref].$refs.dialogColumn.columnBox = false;
-            }
-        }
-    }
-}
+      generateVouchers(obj).then((res) => {
+        console.log(res);
+        this.itemForm2 = res.data.data;
+        this.handleClose();
+        this.itemOpenDialog = true;
+      });
+    },
+    onPeriod() {
+      if (this.itemForm2.finVouchersItemsList.length == 0) {
+        return this.$message.error("明细不能为空");
+      }
+      this.$confirm("确定保存凭证?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        this.loading = true;
+        submitPeriod(this.itemForm2)
+          .then((res) => {
+            this.$message.success("保存成功");
+            this.handleClose2();
+          })
+          .finally(() => {
+            this.loading = false;
+          });
+      });
+    },
+    //刷新
+    refreshChange() {
+      this.onLoad(this.page, this.search);
+    },
+    searchChange(params, done) {
+      this.page.currentPage = 1;
+      done();
+      this.onLoad(this.page, params);
+    },
+    onLoad(page, params = {}) {
+      console.log(params);
+      params = {
+        ...Object.assign(params, this.search),
+        current: page.currentPage,
+        size: page.pageSize,
+      };
+      this.loading = true;
+      getList(params)
+        .then((res) => {
+          this.dataList = res.data.data.records;
+          this.page.total = res.data.data.total;
+          this.showBut = res.data.data.records.length == 0 ? true : false;
+          this.loading = false;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    //刷新
+    refreshChange2() {
+      this.onLoad2(this.search);
+    },
+    searchChange2(params, done) {
+      this.page.currentPage = 1;
+      done();
+      this.onLoad(params);
+    },
+    onLoad2(page, params = {}) {
+      params = {
+        ...params,
+      };
+      this.loading = true;
+      currentPeriod(params)
+        .then((res) => {
+          this.dataList2 = res.data.data;
+          this.loading = false;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    //自定义列保存
+    async saveColumnTwo(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //自定义列重置
+    async resetColumnTwo(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+  },
+};
 </script>
-  
+
 <style scoped>
 .bottomBox {
-    padding: 3px 6px;
-    border-radius: 12px;
-    color: #fff;
-    font-size: 10px;
+  padding: 3px 6px;
+  border-radius: 12px;
+  color: #fff;
+  font-size: 10px;
 }
 </style>
-