Browse Source

财务帐簿菜单调整

wfg 1 month ago
parent
commit
9488a165e8

+ 1 - 1
src/api/system/post.js

@@ -17,7 +17,7 @@ export const getPostList = (tenantId) => {
     url: '/api/blade-system/post/select',
     method: 'get',
     params: {
-      tenantId
+      tenantId,
     }
   })
 }

+ 7 - 0
src/api/system/tenant.js

@@ -12,6 +12,13 @@ export const getList = (current, size, params) => {
   })
 }
 
+export const getSelectList = () => {
+  return request({
+    url: '/api/blade-system/tenant/select',
+    method: 'get',
+  })
+}
+
 export const getDetail = (id) => {
   return request({
     url: '/api/blade-system/tenant/detail',

+ 3 - 3
src/router/views/index.js

@@ -3564,7 +3564,7 @@ export default [{
       i18n: '/iosBasicData/fingenleg/index',
       keepAlive: true,
     },
-    component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/fingenleg/index')
+    component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/fingenleg/genleg/index.vue')
   }]
 },
 // 项目明细账
@@ -3579,7 +3579,7 @@ export default [{
       i18n: '/iosBasicData/fingenlegcalc/index',
       keepAlive: true,
     },
-    component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/fingenlegcalc/index')
+    component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/fingenleg/genlegCalc/index.vue')
   }]
 },
 // 科目明细账
@@ -3594,7 +3594,7 @@ export default [{
       i18n: '/iosBasicData/accountsDetails/index',
       keepAlive: true,
     },
-    component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/accountsDetails/index')
+    component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/fingenleg/subleg/index.vue')
   }]
 },
 // AP 统计

+ 2 - 0
src/util/date.js

@@ -330,6 +330,8 @@ export function checkFullWidthSymbols(text) {
 export function overdueJudgment(date1, date2) {
   let lockTermGlobal = localStorage.getItem("lockTermGlobal");
 
+  console.log("lockTermGlobal", lockTermGlobal);
+
   if (lockTermGlobal === "1") {
     const overDay = localStorage.getItem("lockTermDays");
     console.log("overdueJudgment", overDay, date1, date2);

+ 39 - 2
src/views/iosBasicData/SeafreightExportF/bills/assembly/EntrustmentLnformation.vue

@@ -670,7 +670,7 @@
           </el-col>
           <el-col :span="12">
             <el-row>
-              <el-col :span="12">
+              <el-col :span="10">
                 <el-form-item label="ETD" prop="etd" label-width="90px" :rules="[{ required: true, message: '', trigger: 'blur' }]">
                   <span slot="label">
                     <span style="color: #1e9fff">ETD</span>
@@ -694,7 +694,7 @@
                   </el-date-picker>
                 </el-form-item>
               </el-col>
-              <el-col :span="12">
+              <el-col :span="4">
                 <el-button
                   v-if="business == 1"
                   style="margin:4px 6px"
@@ -724,6 +724,26 @@
                   ></dic-select>
                 </el-form-item>
               </el-col>
+
+              <el-col :span="10">
+                <el-form-item label="ETA" prop="eta" label-width="60px">
+                  <span slot="label">
+                    <span style="color: #1e9fff">ETA</span>
+                  </span>
+                  <el-date-picker
+                    style="width: 100%;"
+                    v-model="assemblyForm.eta"
+                    clearable
+                    type="date"
+                    size="small"
+                    :disabled="detailData.seeDisabled"
+                    value-format="yyyy-MM-dd"
+                    placeholder="选择日期"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+
+              </el-col>
             </el-row>
 
             <div>
@@ -783,6 +803,7 @@
                 ></el-input>
               </el-form-item>
             </div>
+            <!--
             <el-form-item label="ETA" prop="eta" label-width="90px">
               <span slot="label">
                 <span style="color: #1e9fff">ETA</span>
@@ -799,6 +820,7 @@
               >
               </el-date-picker>
             </el-form-item>
+            -->
             <el-form-item label="船公司" prop="carrierCnName">
               <span slot="label">
                 <span style="color: #4c9e44;cursor: pointer;text-decoration: underline" @click="emailJump('carrier')">船公司</span>
@@ -856,6 +878,21 @@
                 ></el-input>
               </el-form-item>
             </div>
+            <el-form-item label="MR CODE" prop="mrCode">
+                <span slot="label">
+                  <span style="color: #1e9fff">MR CODE</span>
+                </span>
+              <el-input
+                type="age"
+                style="width: 100%;"
+                v-model="assemblyForm.mrCode"
+                size="small"
+                autocomplete="off"
+                :disabled="detailData.seeDisabled"
+                clearable
+                placeholder="请输入 MR CODE"
+              ></el-input>
+            </el-form-item>
             <el-form-item label="订舱代理" prop="bookingAgentCnName">
               <span slot="label">
                 <span style="color: #1e9fff">订舱代理</span>

+ 3 - 0
src/views/iosBasicData/SeafreightExportF/bills/assembly/edicode.vue

@@ -255,6 +255,7 @@
       width="70%"
       :modal="false"
       :append-to-body="true"
+      :close-on-click-modal="false"
       v-dialog-drag
       @close="handleDialogClose"
       :before-close="handleBeforeClose"
@@ -317,6 +318,7 @@
       width="70%"
       :modal="false"
       :append-to-body="true"
+      :close-on-click-modal="false"
       v-dialog-drag
       @close="handleDialogClose"
       :before-close="handleBeforeClose"
@@ -373,6 +375,7 @@
       width="70%"
       :modal="false"
       :append-to-body="true"
+      :close-on-click-modal="false"
       v-dialog-drag
       @close="handleDialogClose"
       :before-close="handleBeforeClose"

+ 71 - 0
src/views/iosBasicData/SeafreightExportF/bills/index.vue

@@ -402,6 +402,9 @@
       width="40%"
     >
       <span>该 EDI 已经发送过,本次发送将以更改的功能发送,您可以选择合适的功能!</span>
+      <br />
+      <br />
+      <div v-html="ediFilesFunctionMsg"></div>
       <div class="avue-dialog__footer">
         <el-button type="success" size="small" @click="sendEdiFilesFunction('add')">以更改功能发送</el-button>
         <el-button type="warning" size="small" @click="sendEdiFilesFunction('update')">以原始功能发送</el-button>
@@ -410,6 +413,24 @@
     </el-dialog>
 
     <el-dialog
+      title="EDI 发送确认"
+      append-to-body
+      v-dialogDrag
+      :visible.sync="ediFilesConfirm"
+      class="avue-dialog avue-dialog--top"
+      width="30%"
+    >
+      <span>请确认是否继续发送 EDI!</span>
+      <br />
+      <br />
+      <div v-html="ediFilesFunctionMsg"></div>
+      <div class="avue-dialog__footer">
+        <el-button type="success" size="small" @click="sendEdiFilesConfirm">继续发送</el-button>
+        <el-button type="primary" size="small" style="margin-left: 3em" @click="ediFilesConfirm = false">取消发送</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog
       :title="ediTypeRow.cnName"
       append-to-body
       v-dialogDrag
@@ -518,6 +539,8 @@ export default {
       ediSendingToRemote: false,
       ediSendingToRemoteRow: {},
       ediFilesFunction: false,
+      ediFilesFunctionMsg:"",
+      ediFilesConfirm: false,
       ediTypeRow: {},
       ediShowProgress: false, // EDI 发送进度条
       // 单据类型
@@ -2082,6 +2105,7 @@ export default {
     // 发送EDI
     sendEdiFilesFunction(func) {
       this.ediFilesFunction = false;
+      this.ediFilesConfirm = false;
 
       this.ediTypeRow.filesFunction = this.ediTypeRow["func_" + func];
 
@@ -2109,6 +2133,33 @@ export default {
         });
     },
 
+    sendEdiFilesConfirm() {
+      this.ediFilesFunction = false;
+      this.ediFilesConfirm = false;
+
+      this.ediShowProgress = true;
+      editypesSendingEdi(this.ediTypeRow)
+        .then(res => {
+          this.ediShowProgress = false;
+          // 判断data是否有值,没有值说明不成功给个弹窗返回
+          if (!res.data.data) {
+            let text = res.data.msg.replace("\r\n", "<br>");
+            this.$message({
+              type: "warning",
+              dangerouslyUseHTMLString: true,
+              message: text,
+              // message: `<p>${text.slice(text.indexOf('非空'), text.indexOf('特殊字符'))}</p><p>${text.slice(text.indexOf('特殊字符'), text.indexOf('长度超长'))}</p><p>${text.slice(text.indexOf('长度超长'), text.indexOf('其他'))}</p><p>${text.slice(text.indexOf('其他'))}</p>`,
+              duration: 5000
+            });
+          } else {
+            this.$message.success("发送EDI成功");
+            this.onLoad(this.page);
+          }
+        })
+        .catch(err => {
+          this.ediShowProgress = false;
+        });
+    },
     async editypesSendingEdifun(row) {
       let sendToRemote = 1
 
@@ -2142,6 +2193,8 @@ export default {
       if (this.ids.indexOf(",") < 0) {
         // 单选
         let bfEdi = await beforeSendingEdi(row);
+
+        this.ediShowProgress = false;
         if (!bfEdi.data.success) {
           return;
         }
@@ -2153,6 +2206,12 @@ export default {
           bfData = {};
         }
 
+        let __confirm = bfData.hasOwnProperty("confirm") && bfData.confirm === "true";
+        let __confirmMsg = "";
+        if (__confirm) {
+          __confirmMsg = bfData.confirmMsg.trim().replaceAll("\n", "<br />");
+        }
+
         // data: "{"add":"9","useFunction":"true","1985511929510129665":"9","update":"4"}"
         if (bfData.hasOwnProperty("useFunction") && bfData.useFunction === "true") {
           let func = bfData[row.billId + ""];
@@ -2161,6 +2220,7 @@ export default {
             row.func_add = bfData.add;
             row.func_update = bfData.update;
             row.filesFunction = func;
+            this.ediFilesFunctionMsg = __confirmMsg;
             let that = this;
             this.$nextTick(() => {
               setTimeout(() => {
@@ -2170,6 +2230,17 @@ export default {
             return;
           }
         }
+
+        if (__confirm) {
+          this.ediFilesFunctionMsg = __confirmMsg;
+          let that = this;
+          this.$nextTick(() => {
+            setTimeout(() => {
+              that.ediFilesConfirm = true;
+            }, 500);
+          });
+          return;
+        }
       }
 
       this.ediShowProgress = true;

+ 769 - 509
src/views/iosBasicData/accounts/assembly/accitemsopenblc.vue

@@ -1,537 +1,797 @@
 <template>
-    <div>
-      <!--                   @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 323.1)"-->
-      <!--                   @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 323.1)"-->
-        <avue-crud :option="option"
-                   :table-loading="loading"
-                   :data="form.accItemsOpenblcList"
-                   ref="crud"
-                   id="out-table"
-                   :header-cell-class-name="headerClassName"
-                   @selection-change="selectionChange"
+  <div>
+    <!--                   @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 323.1)"-->
+    <!--                   @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 323.1)"-->
+    <avue-crud
+      id="out-table"
+      ref="crud"
+      :option="option"
+      :table-loading="loading"
+      :data="form.accItemsOpenblcList"
+      :cell-style="{ padding: '0px' }"
+      :header-cell-class-name="headerClassName"
+      :row-style="{ height: '20px' }"
+      @selection-change="selectionChange"
+    >
+      <template slot="menuLeft">
+        <el-button type="primary" size="small" :disabled="!getCanModify" icon="el-icon-plus" @click="addButtonfun">新 增 </el-button>
+        <el-button type="danger" size="small" icon="el-icon-delete" plain :disabled="!getCanModify" @click="handleDelete">删 除 </el-button>
+        <!--        <span>{{ form }}<br />getCanModify:{{ getCanModify() }}<br />option:{{ option }}</span>-->
+      </template>
+      <template v-if="form.isCorp == 1" slot="corpShortName" slot-scope="{ row }">
+        <search-query
+          v-if="row.edit"
+          :datalist="corpData"
+          :selectValue="row.shortName"
+          :filterable="true"
+          :clearable="true"
+          :remote="true"
+          :buttonIf="false"
+          placeholder="请选择客户名称"
+          :forParameter="{ key: 'id', label: 'shortName', value: 'shortName' }"
+          @remoteMethod="corpBcorpsListfun"
+          @corpChange="corpChange($event, 'shortName', row)"
+          @corpFocus="corpBcorpsListfun"
         >
-            <template slot="menuLeft">
-                <el-button type="primary"
-                           size="small"
-                           :disabled="!getCanModify"
-                           icon="el-icon-plus" @click="addButtonfun">新 增
-                </el-button>
-                <el-button type="danger"
-                           size="small"
-                           icon="el-icon-delete"
-                           plain
-                           :disabled="!getCanModify"
-                           @click="handleDelete">删 除
-                </el-button>
-            </template>
-            <template slot="corpCnName" slot-scope="{row}">
-                <search-query v-if="row.edit"
-                              :datalist="corpData"
-                              :selectValue="row.corpCnName"
-                              :filterable="true"
-                              :clearable="true"
-                              :remote="true"
-                              :buttonIf="false"
-                              placeholder="请选择客户名称"
-                              :forParameter="{key:'id',label:'cnName',value:'cnName'}"
-                              @remoteMethod="corpBcorpsListfun"
-                              @corpChange="corpChange($event,'corpCnName',row)"
-                              @corpFocus="corpBcorpsListfun">
-                </search-query>
-                <span v-else>{{row.corpCnName}}</span>
-            </template>
-            <template slot="deptName" slot-scope="{row}">
-                <tree-select v-if="row.edit"
-                             v-model="row.deptName" filterable
-                             :data="deptData"
-                             :props="{label:'title',children:'children'}"
-                             nodeKey="title"
-                             size="small"
-                             :multiple="false"
-                             placeholder="请选择部门名称"
-                             @input="corpChange($event,'deptName',row)"
-                             @focus="deptDeptLazyTreefun" >
-                </tree-select>
-                <span v-else>{{row.deptName}}</span>
-            </template>
-            <template slot="emplName" slot-scope="{row}">
-                <search-query v-if="row.edit"
-                              :datalist="emplData"
-                              :selectValue="row.emplName"
-                              :filterable="true"
-                              :clearable="true"
-                              :remote="true"
-                              :buttonIf="false"
-                              placeholder="请选择职工名称"
-                              :forParameter="{key:'id',label:'name',value:'name'}"
-                              @remoteMethod="userPagelistfun"
-                              @corpChange="corpChange($event,'emplName',row)"
-                              @corpFocus="userPagelistfun">
-                </search-query>
-                <span v-else>{{row.emplName}}</span>
-            </template>
-            <template slot="itemName" slot-scope="{row}">
-                <search-query v-if="row.edit"
-                              :datalist="itemData"
-                              :selectValue="row.itemName"
-                              :filterable="true"
-                              :clearable="true"
-                              :remote="true"
-                              :buttonIf="false"
-                              placeholder="请选择核算项目"
-                              :forParameter="{key:'id',label:'cnName',value:'cnName'}"
-                              @remoteMethod="baccitemstypeListfun"
-                              @corpChange="corpChange($event,'itemName',row)"
-                              @corpFocus="baccitemstypeListfun">
-                </search-query>
-                <span v-else>{{row.itemName}}</span>
-            </template>
-            <template slot="price" slot-scope="{row}">
-                <el-input v-if="row.edit" style="width: 100%;" v-model="row.price"
-                          size="small" autocomplete="off" @blur="priceInputfun(row)"
-                          clearable placeholder="请输入单价" >
-                </el-input>
-                <span v-else>{{row.price}}</span>
-            </template>
-            <template slot="quantityOpenDr" slot-scope="{row}">
-                <el-input v-if="row.edit" style="width: 100%;" v-model="row.quantityOpenDr"
-                          size="small" autocomplete="off" @blur="openingInput(row)"
-                          clearable placeholder="请输入期初借方数量" >
-                </el-input>
-                <span v-else>{{row.quantityOpenDr}}</span>
-            </template>
-            <template slot="quantityOpenCr" slot-scope="{row}">
-                <el-input v-if="row.edit" style="width: 100%;" v-model="row.quantityOpenCr"
-                          size="small" autocomplete="off" @blur="openingInput(row)"
-                          clearable placeholder="请输入期初贷方数量" >
-                </el-input>
-                <span v-else>{{row.quantityOpenCr}}</span>
-            </template>
-            <template slot="quantityDr" slot-scope="{row}">
-                <el-input v-if="row.edit" style="width: 100%;" v-model="row.quantityDr"
-                          size="small" autocomplete="off" @blur="currentPeriodInput(row)"
-                          clearable placeholder="请输入本期借方数量" >
-                </el-input>
-                <span v-else>{{row.quantityDr}}</span>
-            </template>
-            <template slot="quantityCr" slot-scope="{row}">
-                <el-input v-if="row.edit" style="width: 100%;" v-model="row.quantityCr"
-                          size="small" autocomplete="off" @blur="currentPeriodInput(row)"
-                          clearable placeholder="请输入本期贷方数量" >
-                </el-input>
-                <span v-else>{{row.quantityCr}}</span>
-            </template>
-            <template slot="menu" slot-scope="{row}" v-if="getCanModify">
-                <el-button type="text"
-                           size="small"
-                           v-if="row.edit"
-                           @click="editFun(row)">保存
-                </el-button>
-                <el-button type="text"
-                           size="small"
-                           v-else
-                           @click="editFun(row)">编辑
-                </el-button>
+        </search-query>
+        <span v-else>{{ row.corpCnName }}</span>
+      </template>
+      <template v-if="form.isDept == 1" slot="deptName" slot-scope="{ row }">
+        <tree-select
+          v-if="row.edit"
+          v-model="row.deptName"
+          filterable
+          :data="deptData"
+          :props="{ label: 'title', children: 'children' }"
+          nodeKey="title"
+          size="small"
+          :multiple="false"
+          placeholder="请选择部门名称"
+          @selectChange="corpChange($event, 'deptName', row)"
+          @focus="deptDeptLazyTreefun"
+        >
+        </tree-select>
+        <span v-else>{{ row.deptName }}</span>
+      </template>
+      <template v-if="form.isEmpl == 1" slot="emplName" slot-scope="{ row }">
+        <search-query
+          v-if="row.edit"
+          :datalist="emplData"
+          :selectValue="row.emplName"
+          :filterable="true"
+          :clearable="true"
+          :remote="true"
+          :buttonIf="false"
+          placeholder="请选择职工名称"
+          :forParameter="{ key: 'id', label: 'name', value: 'name' }"
+          @remoteMethod="userPagelistfun"
+          @corpChange="corpChange($event, 'emplName', row)"
+          @corpFocus="userPagelistfun"
+        >
+        </search-query>
+        <span v-else>{{ row.emplName }}</span>
+      </template>
+      <template v-if="form.isItem == 1" slot="itemName" slot-scope="{ row }">
+        <search-query
+          v-if="row.edit"
+          :datalist="itemData"
+          :selectValue="row.itemName"
+          :filterable="true"
+          :clearable="true"
+          :remote="true"
+          :buttonIf="false"
+          placeholder="请选择核算项目"
+          :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
+          @remoteMethod="baccitemstypeListfun"
+          @corpChange="corpChange($event, 'itemName', row)"
+          @corpFocus="baccitemstypeListfun"
+        >
+        </search-query>
+        <span v-else>{{ row.itemName }}</span>
+      </template>
 
-                <el-button type="text"
-                           size="small"
-                           @click="rowDel(row)">删除
-                </el-button>
-            </template>
-        </avue-crud>
-    </div>
-</template>
+      <template slot="amountOpenDr" slot-scope="{ row }">
+        <el-input-number
+          v-if="row.edit"
+          style="width: 100%"
+          v-model="row.amountOpenDr"
+          size="small"
+          autocomplete="off"
+          clearable
+          placeholder="请输入年初借方金额"
+          :precision="2"
+          :controls="false"
+          value-on-clear="0"
+          align="right"
+          @change="amountChange(row, 'amountOpenDr')"
+        >
+        </el-input-number>
+        <span v-else>{{ fmtAmt(row.amountOpenDr) }}</span>
+      </template>
 
-<script>
-    import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
-    import {getBcorpslistByType} from "@/api/iosBasicData/bcorps";
-    import {baccitemstypeList} from "@/api/iosBasicData/baccitemstype";
-    import {getDeptTree} from "@/api/system/dept"
-    import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
-    import { getList as userPagelist } from "@/api/system/user"
-    import {accountsSubmit} from "@/api/iosBasicData/accounts";
+      <template slot="amountOpenCr" slot-scope="{ row }">
+        <el-input-number
+          v-if="row.edit"
+          style="width: 100%"
+          v-model="row.amountOpenCr"
+          size="small"
+          autocomplete="off"
+          clearable
+          placeholder="请输入年初贷方金额"
+          :precision="2"
+          :controls="false"
+          value-on-clear="0"
+          align="right"
+          @change="amountChange(row, 'amountOpenCr')"
+        >
+        </el-input-number>
+        <span v-else>{{ fmtAmt(row.amountOpenCr) }}</span>
+      </template>
 
-    export default {
-        components: {TreeSelect, SearchQuery},
-        props:{
-            form:{
-                type:Object,
-                default: {}
-            }
-        },
-        data(){
-            return {
-                corpData:[], // 客户数据
-                deptData:[], // 部门名称数据
-                emplData:[], // 员工数据
-                itemData:[], // 核算项目
-                multipleChoiceList:[], // 多选数据
-                option:{},
-                optionBack: {
-                    height:'auto',
-                    calcHeight: 30,
-                    tip: false,
-                    searchShow: true,
-                    searchMenuSpan: 6,
-                    border: true,
-                    index: true,
-                    selection: true,
-                    dialogClickModal: false,
-                    addBtn:false,
-                    viewBtn:false,
-                    delBtn:false,
-                    editBtn:false,
-                    menuWidth: 100,
-                    columnBtn: false, // 隐藏列设置
-                    refreshBtn:false, // 刷新按钮
-                    column: [
-                        {
-                            label: "客户名称",
-                            prop: "corpCnName",
-                            width:"140",
-                        },
-                        {
-                            label: "核算部门",
-                            prop: "deptName",
-                            width:"100",
-                        },
-                        {
-                            label: "核算职员",
-                            prop: "emplName",
-                            width:"100",
-                        },
-                        // {
-                        //     label: "核算项目类别 Id",
-                        //     prop: "itemClassifyId",
-                        // },
-                        // {
-                        //     label: "核算项目类别",
-                        //     prop: "itemClassify",
-                        //     width:"100",
-                        // },
-                        {
-                            label: "核算项目",
-                            prop: "itemName",
-                        },
-                        {
-                            label: "单价",
-                            prop: "price",
-                            width: "90"
-                        },
-                        {
-                            label: "期初借方",
-                            children:[
-                                {
-                                    label: "数量",
-                                    prop: "quantityOpenDr",
-                                },
-                                {
-                                    label: "外币金额",
-                                    prop: "amountOpenDrUsd",
-                                },
-                                {
-                                    label: "本币金额",
-                                    prop: "amountOpenDr",
-                                },
-                            ]
-                        },
-                        {
-                            label: "期初贷方",
-                            children:[
-                                {
-                                    label: "数量",
-                                    prop: "quantityOpenCr",
-                                },
-                                {
-                                    label: "外币金额",
-                                    prop: "amountOpenCrUsd",
-                                },
-                                {
-                                    label: "本币金额",
-                                    prop: "amountOpenCr",
-                                },
-                            ]
-                        },
-                        {
-                            label: "期初余额",
-                            children:[
-                                {
-                                    label: "数量",
-                                    prop: "quantityOpenBlc",
-                                },
-                                {
-                                    label: "外币",
-                                    prop: "amountOpenUsdBlc",
-                                },
-                                {
-                                    label: "本币",
-                                    prop: "amountOpenBlc",
-                                },
-                            ]
-                        },
-                        {
-                            label: "本期借方",
-                            children: [
-                                {
-                                    label: "数量",
-                                    prop: "quantityDr",
-                                },
-                                {
-                                    label: "外币金额",
-                                    prop: "amountDrUsd",
-                                },
-                                {
-                                    label: "本币金额",
-                                    prop: "amountDr",
-                                },
-                            ]
-                        },
-                        {
-                            label: "本期贷方",
-                            children: [
-                                {
-                                    label: "数量",
-                                    prop: "quantityCr",
-                                },
-                                {
-                                    label: "外币金额",
-                                    prop: "amountCrUsd",
-                                },
-                                {
-                                    label: "本币金额",
-                                    prop: "amountCr",
-                                },
-                            ]
-                        },
-                        {
-                            label: "本期余额",
-                            children: [
-                                {
-                                    label: "数量",
-                                    prop: "quantityBlc",
-                                },
-                                {
-                                    label: "外币",
-                                    prop: "amountUsdBlc",
-                                },
-                                {
-                                    label: "本币",
-                                    prop: "amountBlc",
-                                },
-                            ]
-                        },
-                        {
-                            label: "备注",
-                            prop: "remarks",
-                        },
-                    ]
-                },
-                loading:false,
+      <template slot="amountDr" slot-scope="{ row }">
+        <el-input-number
+          v-if="row.edit"
+          style="width: 100%"
+          v-model="row.amountDr"
+          size="small"
+          autocomplete="off"
+          clearable
+          placeholder="请输入本年借方金额"
+          :precision="2"
+          :controls="false"
+          value-on-clear="0"
+          align="right"
+          @change="amountChange(row, 'amountDr')"
+        >
+        </el-input-number>
+        <span v-else>{{ fmtAmt(row.amountDr) }}</span>
+      </template>
 
-            }
-        },
-        async created() {
-            this.option = this.optionBack; // await this.getColumnData(this.getColumnName(323.1), this.optionBack);
-        },
-        methods:{
-            getCanModify(){
-              if(this.form){
-                return this.form.isDetail && (this.form.isCorp==1 || this.form.isDept==1 || this.form.isEmpl==1 || this.form.isItem==1);
-              }else{
-                return false;
-              }
-            },
-            // 添加
-            addButtonfun(){
-                this.form.accItemsOpenblcList.push({
-                    edit:true
-                })
-            },
-            // 多选
-            selectionChange(list){
-                this.multipleChoiceList = list
-            },
-            // 编辑
-            editFun(row){
-                this.$set(row,'edit',!row.edit)
-            },
-            // 批量删除
-            handleDelete(){
-                this.$confirm("确定将选择数据删除?", {
-                    confirmButtonText: "确定",
-                    cancelButtonText: "取消",
-                    type: "warning"
-                }).then(()=>{
-                    for (let item of this.multipleChoiceList) {
-                        this.form.accItemsOpenblcList.splice(item.$index,1)
-                    }
-                    this.$message.success("操作成功!")
-                })
-            },
-            // 删除
-            rowDel(row){
-                this.$confirm("确定将选择数据删除?", {
-                    confirmButtonText: "确定",
-                    cancelButtonText: "取消",
-                    type: "warning"
-                }).then(()=>{
-                    this.form.accItemsOpenblcList.splice(row.$index,1)
-                    this.$message.success("操作成功!")
-                })
+      <template slot="amountCr" slot-scope="{ row }">
+        <el-input-number
+          v-if="row.edit"
+          style="width: 100%"
+          v-model="row.amountCr"
+          size="small"
+          autocomplete="off"
+          clearable
+          placeholder="请输入本年贷方金额"
+          :precision="2"
+          :controls="false"
+          value-on-clear="0"
+          align="right"
+          @change="amountChange(row, 'amountCr')"
+        >
+        </el-input-number>
+        <span v-else>{{ fmtAmt(row.amountCr) }}</span>
+      </template>
+
+      <template slot="amountOpenDrUsd" slot-scope="{ row }">
+        <el-input-number
+          v-if="row.edit"
+          style="width: 100%"
+          v-model="row.amountOpenDrUsd"
+          size="small"
+          autocomplete="off"
+          clearable
+          placeholder="请输入外币年初借方金额"
+          :precision="2"
+          :controls="false"
+          value-on-clear="0"
+          align="right"
+          @change="amountChange(row, 'amountOpenDrUsd')"
+        >
+        </el-input-number>
+        <span v-else>{{ fmtAmt(row.amountOpenDrUsd) }}</span>
+      </template>
+
+      <template slot="amountOpenCrUsd" slot-scope="{ row }">
+        <el-input-number
+          v-if="row.edit"
+          style="width: 100%"
+          v-model="row.amountOpenCrUsd"
+          size="small"
+          autocomplete="off"
+          clearable
+          placeholder="请输入外币年初贷方金额"
+          :precision="2"
+          :controls="false"
+          value-on-clear="0"
+          align="right"
+          @change="amountChange(row, 'amountOpenCrUsd')"
+        >
+        </el-input-number>
+        <span v-else>{{ fmtAmt(row.amountOpenCrUsd) }}</span>
+      </template>
+
+      <template slot="amountDrUsd" slot-scope="{ row }">
+        <el-input-number
+          v-if="row.edit"
+          style="width: 100%"
+          v-model="row.amountDrUsd"
+          size="small"
+          autocomplete="off"
+          clearable
+          placeholder="请输入外币本年借方金额"
+          :precision="2"
+          :controls="false"
+          value-on-clear="0"
+          align="right"
+          @change="amountChange(row, 'amountDrUsd')"
+        >
+        </el-input-number>
+        <span v-else>{{ fmtAmt(row.amountDrUsd) }}</span>
+      </template>
+
+      <template slot="amountCrUsd" slot-scope="{ row }">
+        <el-input-number
+          v-if="row.edit"
+          style="width: 100%"
+          v-model="row.amountCrUsd"
+          size="small"
+          autocomplete="off"
+          clearable
+          placeholder="请输入外币本年贷方金额"
+          :precision="2"
+          :controls="false"
+          value-on-clear="0"
+          align="right"
+          @change="amountChange(row, 'amountCrUsd')"
+        >
+        </el-input-number>
+        <span v-else>{{ fmtAmt(row.amountCrUsd) }}</span>
+      </template>
+
+      <template slot="quantityOpenDr" slot-scope="{ row }">
+        <el-input-number
+          v-if="row.edit"
+          style="width: 100%"
+          v-model="row.quantityOpenDr"
+          size="small"
+          autocomplete="off"
+          clearable
+          placeholder="请输入年初借方数量"
+          :precision="2"
+          :controls="false"
+          value-on-clear="0"
+          align="right"
+          @change="amountChange(row, 'quantityOpenDr')"
+        >
+        </el-input-number>
+        <span v-else>{{ fmtAmt(row.quantityOpenDr) }}</span>
+      </template>
+
+      <template slot="quantityOpenCr" slot-scope="{ row }">
+        <el-input-number
+          v-if="row.edit"
+          style="width: 100%"
+          v-model="row.quantityOpenCr"
+          size="small"
+          autocomplete="off"
+          clearable
+          placeholder="请输入年初贷方数量"
+          :precision="2"
+          :controls="false"
+          value-on-clear="0"
+          align="right"
+          @change="amountChange(row, 'quantityOpenCr')"
+        >
+        </el-input-number>
+        <span v-else>{{ fmtAmt(row.quantityOpenCr) }}</span>
+      </template>
 
+      <template slot="quantityDr" slot-scope="{ row }">
+        <el-input-number
+          v-if="row.edit"
+          style="width: 100%"
+          v-model="row.quantityDr"
+          size="small"
+          autocomplete="off"
+          clearable
+          placeholder="请输入本年借方数量"
+          :precision="2"
+          :controls="false"
+          value-on-clear="0"
+          align="right"
+          @change="amountChange(row, 'quantityDr')"
+        >
+        </el-input-number>
+        <span v-else>{{ fmtAmt(row.quantityDr) }}</span>
+      </template>
+
+      <template slot="quantityCr" slot-scope="{ row }">
+        <el-input-number
+          v-if="row.edit"
+          style="width: 100%"
+          v-model="row.quantityCr"
+          size="small"
+          autocomplete="off"
+          clearable
+          placeholder="请输入本年贷方数量"
+          :precision="2"
+          :controls="false"
+          value-on-clear="0"
+          align="right"
+          @change="amountChange(row, 'quantityCr')"
+        >
+        </el-input-number>
+        <span v-else>{{ fmtAmt(row.quantityCr) }}</span>
+      </template>
+
+      <template slot="menu" slot-scope="{ row }" v-if="getCanModify">
+        <el-button type="text" size="small" v-if="row.edit" @click="editFun(row)">保存 </el-button>
+        <el-button type="text" size="small" v-else @click="editFun(row)">编辑 </el-button>
+
+        <el-button type="text" size="small" @click="rowDel(row)">删除 </el-button>
+      </template>
+    </avue-crud>
+  </div>
+</template>
+
+<script>
+import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
+import { getBcorpslistByType } from "@/api/iosBasicData/bcorps";
+import { baccitemstypeList } from "@/api/iosBasicData/baccitemstype";
+import { getDeptTree } from "@/api/system/dept";
+import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
+import { getList as userPagelist } from "@/api/system/user";
+import { accountsSubmit } from "@/api/iosBasicData/accounts";
+import { selectEmpls } from "@/api/approval/processConfig";
+
+export default {
+  components: { TreeSelect, SearchQuery },
+  props: {
+    form: {
+      type: Object,
+      default: {},
+    },
+  },
+  data() {
+    return {
+      corpData: [], // 客户数据
+      deptData: [], // 部门名称数据
+      emplData: [], // 员工数据
+      itemData: [], // 核算项目
+      multipleChoiceList: [], // 多选数据
+      option: {
+        height: "60vh",
+        calcHeight: 30,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        border: true,
+        index: true,
+        selection: true,
+        dialogClickModal: false,
+        addBtn: false,
+        viewBtn: false,
+        delBtn: false,
+        editBtn: false,
+        menuWidth: 100,
+        columnBtn: false, // 隐藏列设置
+        refreshBtn: false, // 刷新按钮
+        column: [],
+      },
+      loading: false,
+    };
+  },
+  async created() {},
+  methods: {
+    buildOptionColumns() {
+      let cols = [];
+      if (this.form.isCorp == 1) {
+        cols.push({
+          label: "客户编号",
+          prop: "corpCode",
+          width: 120,
+        });
+        cols.push({
+          label: "客户名称",
+          prop: "corpShortName",
+          width: 220,
+        });
+      }
+      if (this.form.isDept == 1) {
+        cols.push({
+          label: "核算部门",
+          prop: "deptName",
+          width: 180,
+        });
+      }
+      if (this.form.isEmpl == 1) {
+        cols.push({
+          label: "核算职员",
+          prop: "emplName",
+          width: 160,
+        });
+      }
+      if (this.form.isItem == 1) {
+        cols.push(
+          {
+            label: "核算项目类别",
+            prop: "itemClassify",
+            width: 160,
+          },
+          {
+            label: "核算项目",
+            prop: "itemName",
+            width: 180,
+          }
+        );
+      }
+      cols.push({
+        label: "本币期初",
+        children: [
+          {
+            label: "年初借方",
+            prop: "amountOpenDr",
+            width: 120,
+            align: "right",
+          },
+          {
+            label: "年初贷方",
+            prop: "amountOpenCr",
+            width: 120,
+            align: "right",
+          },
+          {
+            label: "年初余额",
+            prop: "amountOpenBlc",
+            width: 120,
+            align: "right",
+          },
+          {
+            label: "本年借方",
+            prop: "amountDr",
+            width: 120,
+            align: "right",
+          },
+          {
+            label: "本年贷方",
+            prop: "amountCr",
+            width: 120,
+            align: "right",
+          },
+          {
+            label: "当前余额",
+            prop: "amountBlc",
+            width: 120,
+            align: "right",
+          },
+        ],
+      });
+      if (this.form.isForeign == 1) {
+        cols.push({
+          label: "外币期初",
+          children: [
+            {
+              label: "年初借方",
+              prop: "amountOpenDrUsd",
+              width: 120,
+              align: "right",
             },
-            // 单价改变
-            priceInputfun(row){
-                this.openingInput(row)
-                this.currentPeriodInput(row)
+            {
+              label: "年初贷方",
+              prop: "amountOpenCrUsd",
+              width: 120,
+              align: "right",
             },
-            // 期初
-            openingInput(row){
-                this.$set(row,'quantityOpenDr',row.quantityOpenDr?row.quantityOpenDr:0)
-                this.$set(row,'quantityOpenCr',row.quantityOpenCr?row.quantityOpenCr:0)
-                if (this.form.curCode == 'USD') {
-                    // 期初借方外币金额 = 单价 * 期初借方数量
-                    this.$set(row,'amountOpenDrUsd',Number(row.price) * Number(row.quantityOpenDr))
-                    // 期初贷方外币金额 = 单价 * 期初贷方数量
-                    this.$set(row,'amountOpenCrUsd',Number(row.price) * Number(row.quantityOpenCr))
-                    // 期初外币余额 = 期初贷方外币金额 - 期初借方外币金额
-                    this.$set(row,'amountOpenUsdBlc',Number(row.amountOpenCrUsd) - Number(row.amountOpenDrUsd))
-                }else {
-                    // 期初借方本币金额 = 单价 * 期初借方数量
-                    this.$set(row,'amountOpenDr',Number(row.price) * Number(row.quantityOpenDr))
-                    // 期初贷方本币金额 = 单价 * 期初贷方数量
-                    this.$set(row,'amountOpenCr',Number(row.price) * Number(row.quantityOpenCr))
-                    // 期初本币余额 = 期初贷方本币金额 - 期初借方本币金额
-                    this.$set(row,'amountOpenBlc',Number(row.amountOpenCr) - Number(row.amountOpenDr))
-                }
-                // 期初余额数量 = 期初贷方数量 - 期初借方数量
-                this.$set(row,'quantityOpenBlc',Number(row.quantityOpenCr) - Number(row.quantityOpenDr))
+            {
+              label: "年初余额",
+              prop: "amountOpenUsdBlc",
+              width: 120,
+              align: "right",
             },
-            // 本期
-            currentPeriodInput(row){
-                this.$set(row,'quantityDr',row.quantityDr?row.quantityDr:0)
-                this.$set(row,'quantityCr',row.quantityCr?row.quantityCr:0)
-                if (this.form.curCode == 'USD') {
-                    // 本期借方外币金额 = 单价 * 本期借方数量
-                    this.$set(row,'amountDrUsd',Number(row.price) * Number(row.quantityDr))
-                    // 本期贷方外币金额 = 单价 * 本期贷方数量
-                    this.$set(row,'amountCrUsd',Number(row.price) * Number(row.quantityCr))
-                    // 本期外币余额 = 本期贷方外币金额 - 本期借方外币金额
-                    this.$set(row,'amountUsdBlc',Number(row.amountCrUsd) - Number(row.amountDrUsd))
-                }else {
-                    // 本期借方本币金额 = 单价 * 本期借方数量
-                    console.log(row.price,413)
-                    console.log(row.amountDrUsd,414)
-                    this.$set(row,'amountDr',Number(row.price) * Number(row.amountDrUsd))
-                    // 本期贷方本币金额 = 单价 * 本期借方数量
-                    this.$set(row,'amountCr',Number(row.price) * Number(row.amountCrUsd))
-                    // 本期本币余额 = 本期贷方本币金额 - 本期借方本币金额
-                    this.$set(row,'amountBlc',Number(row.amountCr) - Number(row.amountDr))
-                }
-                // 本期余额数量 = 本期贷方数量 - 本期借方数量
-                this.$set(row,'quantityBlc',Number(row.quantityCr) - Number(row.quantityDr))
+            {
+              label: "本年借方",
+              prop: "amountDrUsd",
+              width: 120,
+              align: "right",
             },
-            // 下拉数据
-            corpChange(value,name,row){
-                if (name == 'corpCnName') {
-                    for (let item of this.corpData) {
-                        if (item.cnName == value) {
-                            this.$set(row,'corpId',item.id)
-                            this.$set(row,'corpCnName',item.cnName)
-                            this.$set(row,'corpEnName',item.enName)
-                        }
-                    }
-                }else if (name == 'emplName') {
-                    for (let item of this.emplData) {
-                        if (item.name == value) {
-                            this.$set(row,'emplId',item.id)
-                            this.$set(row,'emplName',item.name)
-                        }
-                    }
-                } else if (name == 'itemName') {
-                    for (let item of this.itemData) {
-                        if (item.cnName == value) {
-                            console.log(item,417)
-                            this.$set(row,'itemId',item.id)
-                            this.$set(row,'itemName',item.cnName)
-                        }
-                    }
-                }else {
-                    this.$set(row,name,value)
-                }
+            {
+              label: "本年贷方",
+              prop: "amountCrUsd",
+              width: 120,
+              align: "right",
             },
-            // 获取核算客户数据
-            corpBcorpsListfun(cnName){
-                getBcorpslistByType(1,10,{cnName}).then(res=>{
-                    this.corpData = res.data.data.records
-                })
+            {
+              label: "当前余额",
+              prop: "amountUsdBlc",
+              width: 120,
+              align: "right",
             },
-            // 获取部分数据
-            deptDeptLazyTreefun(){
-                getDeptTree().then(res=>{
-                    this.deptData = res.data.data
-                })
+          ],
+        });
+      }
+      if (this.form.isQuantity == 1) {
+        cols.push({
+          label: "数量期初",
+          children: [
+            {
+              label: "年初借方",
+              prop: "quantityOpenDr",
+              width: 120,
+              align: "right",
             },
-            // 获取员工数据
-            userPagelistfun(realName){
-                userPagelist(1,10,{realName}).then(res=>{
-                    this.emplData = res.data.data.records
-                })
+            {
+              label: "年初贷方",
+              prop: "quantityOpenCr",
+              width: 120,
+              align: "right",
             },
-            // 获取核算项目数据
-            baccitemstypeListfun(cnName){
-                baccitemstypeList(1,10,{cnName}).then(res=>{
-                    this.itemData = res.data.data.records
-                })
+            {
+              label: "年初余额",
+              prop: "quantityOpenBlc",
+              width: 120,
+              align: "right",
             },
-            //自定义列保存
-            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;
-                }
+            {
+              label: "本年借方",
+              prop: "quantityDr",
+              width: 120,
+              align: "right",
             },
-            //自定义列重置
-            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;
-                }
+            {
+              label: "本年贷方",
+              prop: "quantityCr",
+              width: 120,
+              align: "right",
             },
-            // 更改表格颜色
-            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;
+            {
+              label: "当前余额",
+              prop: "quantityBlc",
+              width: 120,
+              align: "right",
             },
-
+          ],
+        });
+      }
+      cols.push({
+        label: "备注",
+        prop: "remarks",
+      });
+      this.option.column = cols;
+    },
+    getCanModify() {
+      if (this.form) {
+        return this.form.isDetail && (this.form.isCorp == 1 || this.form.isDept == 1 || this.form.isEmpl == 1 || this.form.isItem == 1);
+      } else {
+        return false;
+      }
+    },
+    // 添加
+    addButtonfun() {
+      this.form.accItemsOpenblcList.push({
+        edit: true,
+      });
+    },
+    // 多选
+    selectionChange(list) {
+      this.multipleChoiceList = list;
+    },
+    // 编辑
+    editFun(row) {
+      this.$set(row, "edit", !row.edit);
+    },
+    // 批量删除
+    handleDelete() {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        for (let item of this.multipleChoiceList) {
+          this.form.accItemsOpenblcList.splice(item.$index, 1);
+        }
+        this.$message.success("操作成功!");
+      });
+    },
+    // 删除
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        this.form.accItemsOpenblcList.splice(row.$index, 1);
+        this.$message.success("操作成功!");
+      });
+    },
+    forceAmt(val) {
+      let amt = Number(val);
+      return isNaN(amt) ? 0.0 : Number(amt.toFixed(2));
+    },
+    fmtAmt(val) {
+      let amt = this.forceAmt(val);
+      let S = amt.toFixed(2);
+      return S == "0.00" ? "" : S;
+    },
+    amountChange(row, fieldName) {
+      if (fieldName === "amountOpenDr" || fieldName === "amountOpenCr") {
+        if (row.dc === "D") {
+          this.$set(row, "amountOpenBlc", this.forceAmt(row.amountOpenDr) - this.forceAmt(row.amountOpenCr));
+          this.$set(row, "amountBlc", this.forceAmt(row.amountOpenBlc) + this.forceAmt(row.amountDr) - this.forceAmt(row.amountCr));
+        } else {
+          this.$set(row, "amountOpenBlc", this.forceAmt(row.amountOpenCr) - this.forceAmt(row.amountOpenDr));
+          this.$set(row, "amountBlc", this.forceAmt(row.amountOpenBlc) + this.forceAmt(row.amountCr) - this.forceAmt(row.amountDr));
+        }
+      }
+      if (fieldName === "amountDr" || fieldName === "amountCr") {
+        if (row.dc === "D") {
+          this.$set(row, "amountBlc", this.forceAmt(row.amountOpenBlc) + this.forceAmt(row.amountDr) - this.forceAmt(row.amountCr));
+        } else {
+          this.$set(row, "amountBlc", this.forceAmt(row.amountOpenBlc) + this.forceAmt(row.amountCr) - this.forceAmt(row.amountDr));
+        }
+      }
+      if (fieldName === "amountOpenDrUsd" || fieldName === "amountOpenCrUsd") {
+        if (row.dc === "D") {
+          this.$set(row, "amountOpenUsdBlc", this.forceAmt(row.amountOpenDrUsd) - this.forceAmt(row.amountOpenCrUsd));
+          this.$set(row, "amountUsdBlc", this.forceAmt(row.amountOpenUsdBlc) + this.forceAmt(row.amountDrUsd) - this.forceAmt(row.amountCrUsd));
+        } else {
+          this.$set(row, "amountOpenUsdBlc", this.forceAmt(row.amountOpenCrUsd) - this.forceAmt(row.amountOpenDrUsd));
+          this.$set(row, "amountUsdBlc", this.forceAmt(row.amountOpenUsdBlc) + this.forceAmt(row.amountCrUsd) - this.forceAmt(row.amountDrUsd));
         }
-    }
+      }
+      if (fieldName === "amountDrUsd" || fieldName === "amountCrUsd") {
+        if (row.dc === "D") {
+          this.$set(row, "amountUsdBlc", this.forceAmt(row.amountOpenUsdBlc) + this.forceAmt(row.amountDrUsd) - this.forceAmt(row.amountCrUsd));
+        } else {
+          this.$set(row, "amountUsdBlc", this.forceAmt(row.amountOpenUsdBlc) + this.forceAmt(row.amountCrUsd) - this.forceAmt(row.amountDrUsd));
+        }
+      }
+      if (fieldName === "quantityOpenDr" || fieldName === "quantityOpenCr") {
+        if (row.dc === "D") {
+          this.$set(row, "quantityOpenBlc", this.forceAmt(row.quantityOpenDr) - this.forceAmt(row.quantityOpenCr));
+          this.$set(row, "quantityBlc", this.forceAmt(row.quantityOpenBlc) + this.forceAmt(row.quantityDr) - this.forceAmt(row.quantityCr));
+        } else {
+          this.$set(row, "quantityOpenBlc", this.forceAmt(row.quantityOpenCr) - this.forceAmt(row.quantityOpenDr));
+          this.$set(row, "quantityBlc", this.forceAmt(row.quantityOpenBlc) + this.forceAmt(row.quantityCr) - this.forceAmt(row.quantityDr));
+        }
+      }
+      if (fieldName === "quantityDr" || fieldName === "quantityCr") {
+        if (row.dc === "D") {
+          this.$set(row, "quantityBlc", this.forceAmt(row.quantityOpenBlc) + this.forceAmt(row.quantityDr) - this.forceAmt(row.quantityCr));
+        } else {
+          this.$set(row, "quantityBlc", this.forceAmt(row.quantityOpenBlc) + this.forceAmt(row.quantityCr) - this.forceAmt(row.quantityDr));
+        }
+      }
+    },
+    // 下拉数据
+    corpChange(value, name, row) {
+      let bf = false;
+      if (name == "shortName") {
+        for (let item of this.corpData) {
+          if (item.shortName == value) {
+            this.$set(row, "corpId", item.id);
+            this.$set(row, "corpCode", item.code);
+            this.$set(row, "corpShortName", item.shortName);
+            this.$set(row, "corpCnName", item.cnName);
+            this.$set(row, "corpEnName", item.enName);
+            bf = true;
+          }
+        }
+        if (!bf) {
+          this.$set(row, "corpId", 0);
+          this.$set(row, "corpCode", "");
+          this.$set(row, "corpShortName", "");
+          this.$set(row, "corpCnName", "");
+          this.$set(row, "corpEnName", "");
+        }
+      } else if (name == "emplName") {
+        for (let item of this.emplData) {
+          if (item.name == value) {
+            this.$set(row, "emplId", item.id);
+            this.$set(row, "emplName", item.name);
+            bf = true;
+          }
+        }
+        if (!bf) {
+          this.$set(row, "emplId", 0);
+          this.$set(row, "emplName", "");
+        }
+      } else if (name == "itemName") {
+        for (let item of this.itemData) {
+          if (item.cnName == value) {
+            this.$set(row, "itemId", item.id);
+            this.$set(row, "itemName", item.cnName);
+            bf = true;
+          }
+        }
+        if (!bf) {
+          this.$set(row, "itemId", 0);
+          this.$set(row, "itemName", "");
+        }
+      } else if (name == "deptName") {
+        if (value && value.id) {
+          this.$set(row, "deptId", value.id);
+          this.$set(row, "deptName", value.title);
+        }else{
+          this.$set(row, "deptId", 0);
+          this.$set(row, "deptName", "");
+        }
+      } else {
+        this.$set(row, name, value);
+      }
+    },
+    // 获取核算客户数据
+    corpBcorpsListfun(shortName) {
+      getBcorpslistByType(1, 10, { shortName }).then((res) => {
+        this.corpData = res.data.data.records;
+      });
+    },
+    // 获取部分数据
+    deptDeptLazyTreefun() {
+      getDeptTree().then((res) => {
+        this.deptData = res.data.data;
+      });
+    },
+    // 获取员工数据
+    userPagelistfun(emplName) {
+      selectEmpls(1, 10, { cname: emplName, whetherEmployedOrNot: 1 }).then((res) => {
+        if (Array.isArray(res.data.data.records)) {
+          res.data.data.records.forEach((item) => {
+            item.name = item.cname;
+          });
+        }
+        this.emplData = res.data.data.records;
+      });
+    },
+    // 获取核算项目数据
+    baccitemstypeListfun(cnName) {
+      baccitemstypeList(1, 10, { cnName }).then((res) => {
+        this.itemData = res.data.data.records;
+      });
+    },
+    //自定义列保存
+    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>
 ::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;
+}
+::v-deep .avue-crud .el-input-number .el-input__inner {
+  text-align: right;
 }
 </style>

+ 3 - 0
src/views/iosBasicData/accounts/assembly/accountsDialog.vue

@@ -656,4 +656,7 @@ export default {
 .right-align .el-input__inner {
   text-align: right;
 }
+::v-deep .avue-crud .el-input-number .el-input__inner {
+  text-align: right;
+}
 </style>

+ 14 - 8
src/views/iosBasicData/accounts/index.vue

@@ -26,6 +26,7 @@
             ref="crud"
             :row-style="{ height: '26px', padding: '0' }"
             :cell-style="{ padding: '0' }"
+            :page.sync="page"
             @row-update="rowUpdate"
             @row-save="rowSave"
             @row-del="rowDel"
@@ -99,15 +100,16 @@
 
     <!--从表数据-->
     <el-dialog
+      v-if="sopenblcVisible"
       title="辅助核算期初"
       append-to-body
       :visible.sync="sopenblcVisible"
       class="el-dialogDeep"
-      width="70%"
+      width="85%"
       :close-on-click-modal="false"
       :before-close="handleClose"
     >
-      <accitemsopenblc :form="form"></accitemsopenblc>
+      <accitemsopenblc ref="refaccitemsopenblc" :form="form"></accitemsopenblc>
       <span slot="footer" class="dialog-footer">
         <el-button @click="sopenblcVisible = false">取 消</el-button>
         <el-button type="primary" @click="openingCalculatefun">保 存</el-button>
@@ -149,7 +151,7 @@ export default {
       },
       loading: true,
       page: {
-        pageSize: 10000, // 10
+        pageSize: 100, // 10
         currentPage: 1,
         total: 0,
       },
@@ -772,7 +774,7 @@ export default {
       accountsSubmit(this.form).then((res) => {
         this.$message.success("操作成功!");
         this.accountsVisible = false;
-        this.onLoad(this.page, this.query);
+        this.onLoad(this.page, {}, true); // , this.query
       });
     },
     // 弹窗点击差号
@@ -877,8 +879,12 @@ export default {
     editOpeningfun(row) {
       accountsDetail(row.id).then((res) => {
         this.form = res.data.data;
+        let that = this;
+        that.sopenblcVisible = true;
+        this.$nextTick(() => {
+          that.$refs.refaccitemsopenblc.buildOptionColumns();
+        });
       });
-      this.sopenblcVisible = true;
     },
 
     // 匹配删除
@@ -957,6 +963,8 @@ export default {
     searchChange(params, done) {
       // this.query = params;
       this.page.currentPage = 1;
+      this.treeAccProperty = undefined;
+      this.treeAccCode = undefined;
       this.onLoad(this.page, this.query);
       done();
     },
@@ -981,7 +989,7 @@ export default {
     refreshChange() {
       this.onLoad(this.page, this.query);
     },
-    onLoad(page, params = {}) {
+    onLoad(page, params = {}, tag) {
       // 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);
@@ -995,8 +1003,6 @@ export default {
         // 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;

+ 0 - 0
src/views/iosBasicData/fingenleg/index.vue → src/views/iosBasicData/fingenleg/genleg/index.vue


+ 0 - 0
src/views/iosBasicData/fingenlegcalc/index.vue → src/views/iosBasicData/fingenleg/genlegCalc/index.vue


+ 0 - 0
src/views/iosBasicData/accountsDetails/index.vue → src/views/iosBasicData/fingenleg/subleg/index.vue


+ 670 - 0
src/views/iosBasicData/fingenleg/sublegCalc/index.vue

@@ -0,0 +1,670 @@
+<template>
+  <div>
+    <basic-container>
+      <avue-form :option="optionForm" v-model="query" class="form-mb">
+        <tempalte slot="button" slot-scope="{ row }">
+          <span style="display: flex;justify-content: end;">
+            <el-button icon="el-icon-arrow-down" size="small" @click="searchShow = true, showHight()" v-if="!searchShow">展
+              开</el-button>
+            <el-button icon="el-icon-arrow-up" size="small" @click="searchShow = false, showHight()" v-if="searchShow">收
+              缩</el-button>
+            <!-- <el-button type="primary" size="small" plain @click="inItial">初始入账
+            </el-button> -->
+            <el-button type="success" size="small" plain @click="outExport">导出
+            </el-button>
+          </span>
+        </tempalte>
+      </avue-form>
+      <div v-show="searchShow">
+        <avue-form :option="optionForm2" v-model="query" class="form-mb">
+          <tempalte slot="levelStart" slot-scope="{ row }">
+            <span style="display: flex;">
+              <avue-select v-model="query.levelStart" placeholder="请选择科目级次" :dic="dic"></avue-select>
+              <span style="margin: 0 4px;">至</span>
+              <avue-select v-model="query.levelEnd" placeholder="请选择科目级次" :dic="dic"></avue-select>
+            </span>
+          </tempalte>
+          <tempalte slot="type" slot-scope="{ row }">
+            <el-row>
+              <el-col :span="6"> <avue-select v-model="query.type" placeholder="请选择核算类型"
+                  :dic="typeDic"></avue-select></el-col>
+              <el-col :span="18"> <avue-select v-model="query.corpList" placeholder="请选择核算项目" :dic="corpDic"
+                  :props="corpProps" :filterable="true" :multiple="true" :tags="true"></avue-select></el-col>
+            </el-row>
+          </tempalte>
+        </avue-form>
+        <span style="display: flex;justify-content: end;">
+          <el-button type="primary" icon="el-icon-search" size="small" @click="serach">搜 索</el-button>
+          <el-button icon="el-icon-delete" size="small" @click="reset">清 空</el-button>
+        </span>
+      </div>
+    </basic-container>
+    <basic-container v-show="treeData.length > 0">
+      <el-row>
+        <el-col :span="4">
+          <avue-tree ref="tree" :class="searchShow ? 'treeStyle' : 'bigTreeStyle'" :option="treeOption" :data="treeData"
+            v-model="treeForm" @node-click="nodeClick">
+          </avue-tree>
+        </el-col>
+        <el-col :span="20" style="padding-left: 20px;">
+          <avue-crud :option="option" :data="dataList" ref="crud" id="out-table"
+            :header-cell-class-name="headerClassName">
+            <template slot="voucherNo" slot-scope="{ row }">
+              <span style="color: #1e9fff;cursor: pointer;" @click="toJump(row)">{{ row.voucherNo }}
+              </span>
+            </template>
+          </avue-crud>
+        </el-col>
+      </el-row>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import {
+  getList,
+  getAllList,
+  getTreelist,
+  initialization
+} from "@/api/iosBasicData/accountsDetails";
+import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
+import { dateFormat } from "@/util/date";
+import { getToken } from "@/util/auth";
+export default {
+  components: { SearchQuery },
+  data() {
+    return {
+      treeForm: {},
+      treeData: [],
+      treeOption: {
+        menu: false,
+        addBtn: false,
+        props: {
+          label: 'accName',
+          value: 'id'
+        }
+      },
+      query: {
+        startYear: null,
+        endYear: null,
+        monthDate: [dateFormat(new Date(), 'yyyy-MM'), dateFormat(new Date(), 'yyyy-MM')],
+        checkbox: [],
+        accIds: null,
+        accList: [],
+        levelStart: null,
+        levelEnd: null,
+        type: null,
+        corpList: [],
+        corpIds: null,
+        auxiliaryAccounting: 0,
+        foreignCurrency: 0,
+        lastLevelItem: 0,
+        blcNotZero: 0,
+        noAmountIncurred: 0,
+        doNotDisplayYear: 0,
+        oppositeAcc: 0,
+        total: 0
+      },
+      outExportQuery: {},
+      searchShow: true,
+      optionForm: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: '期间',
+            prop: 'monthDate',
+            type: 'monthrange',
+            format: 'yyyy-MM',
+            valueFormat: 'yyyy-MM',
+            span: 6,
+          },
+          {
+            label: '',
+            prop: 'button',
+            span: 18,
+          }
+        ]
+      },
+      optionForm2: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: '科目',
+            prop: 'accList',
+            type: 'select',
+            filterable: true,
+            multiple: true,
+            tags: true,
+            dicUrl: "/api/blade-los/accounts/selectList?isDetail=1",
+            props: {
+              label: 'cnName',
+              desc: 'code',
+              value: 'id',
+              res: 'data'
+            },
+            span: 6,
+          },
+          {
+            label: '科目级次',
+            prop: 'levelStart',
+            span: 6,
+          },
+          {
+            label: '分录摘要',
+            prop: 'descr',
+            span: 6,
+            row: true,
+          },
+          {
+            label: '显示辅助核算',
+            prop: 'auxiliaryAccounting',
+            type: 'switch',
+            dicData: [{
+              label: '',
+              value: 0
+            }, {
+              label: '',
+              value: 1
+            }],
+            span: 6,
+          },
+          {
+            label: '辅助核算',
+            prop: 'type',
+            display: false,
+            span: 12,
+          },
+          {
+            label: '多选',
+            prop: 'checkbox',
+            type: 'checkbox',
+            span: 24,
+            dicData: [
+              {
+                label: '只显示最明细级',
+                value: 'lastLevelItem'
+              }, {
+                label: '是否显示外币',
+                value: 'foreignCurrency'
+              }, {
+                label: '显示对方科目辅助核算',
+                value: 'oppositeAcc'
+              }, {
+                label: '余额为0不显示',
+                value: 'blcNotZero'
+              }, {
+                label: '无发生额且余额为0不显示',
+                value: 'noAmountIncurred'
+              }, {
+                label: '发生额为0不显示本期合计、本年累计',
+                value: 'doNotDisplayYear'
+              }, {
+                label: '显示合计',
+                value: 'total'
+              }
+            ],
+          },
+        ]
+      },
+      dic: [{
+        label: '1',
+        value: 1
+      }, {
+        label: '2',
+        value: 2
+      }, {
+        label: '3',
+        value: 3
+      }],
+      typeDic: [{
+        label: '客户',
+        value: 1
+      }, {
+        label: '部门',
+        value: 2
+      }, {
+        label: '职工',
+        value: 3
+      }],
+      corpProps: {
+        label: 'name',
+        value: 'id'
+      },
+      corpDic: [],
+      option: {
+        height: 'auto',
+        calcHeight: 30,
+        border: true,
+        index: true,
+        menu: false,
+        addBtn: false,
+        header: false,
+        summaryText:this.$t("land118n.total"),
+        showSummary: false,
+        sumColumnList: [{
+          name: "amountDr",
+          type: "sum",
+          decimals: 2
+        }, {
+          name: "amountCr",
+          type: "sum",
+          decimals: 2
+        }, {
+          name: "amountDrUsd",
+          type: "sum",
+          decimals: 2
+        }, {
+          name: "amountCrUsd",
+          type: "sum",
+          decimals: 2
+        }, {
+          name: "amountUsdBlc",
+          type: "sum",
+          decimals: 2
+        }],
+        column: [
+          {
+            label: "凭证号",
+            prop: "voucherNo",
+            overHidden: true,
+          },
+          {
+            label: "凭证日期",
+            prop: "voucherDate",
+            overHidden: true,
+          },
+          {
+            label: "摘要",
+            prop: "descr",
+            overHidden: true,
+          },
+          {
+            label: "币种",
+            prop: "curCode",
+            hide: true,
+            type: 'select',
+            dicData: [
+              {
+                label: 'CNY',
+                value: 'CNY'
+              }, {
+                label: 'USD',
+                value: 'USD'
+              },
+            ],
+            overHidden: true,
+          },
+          {
+            label: "借方金额",
+            prop: "amountDr",
+            width: '100',
+            overHidden: true,
+          },
+          {
+            label: "贷方金额",
+            prop: "amountCr",
+            width: '100',
+            overHidden: true,
+          },
+          {
+            label: "本期余额",
+            prop: "amountBlc",
+            overHidden: true,
+          },
+          {
+            label: "本期外币借方金额",
+            prop: "amountDrUsd",
+            overHidden: true,
+            hide: false,
+            width: 120,
+          },
+          {
+            label: "本期外币贷方金额",
+            prop: "amountCrUsd",
+            overHidden: true,
+            hide: false,
+            width: 120,
+          },
+          {
+            label: "本期外币期初余额",
+            prop: "amountUsdBlc",
+            overHidden: true,
+            hide: false,
+            width: 120,
+          },
+
+          {
+            label: "方向",
+            prop: "dc",
+            type: 'select',
+            dicData: [
+              {
+                label: '借方',
+                value: 'D'
+              }, {
+                label: '贷方',
+                value: 'C'
+              },
+            ],
+            overHidden: true,
+          },
+
+        ]
+      },
+      dataList: []
+    };
+  },
+  watch: {
+    "query.monthDate": {
+      handler(newVla, oldVal) {
+        if (newVla && newVla.length > 0) {
+          this.query.startYear = newVla[0]
+          this.query.endYear = newVla[1]
+        } else {
+          this.query.startYear = null
+          this.query.endYear = null
+        }
+      },
+      deep: false, // 深度监听
+      immediate: false  // 第一次改变就执行
+    },
+    "query.checkbox": {
+      handler(newVla, oldVal) {
+        this.resetData()
+        if (newVla.filter(e => e == 'foreignCurrency') && newVla.filter(e => e == 'foreignCurrency').length) {
+          this.findObject(this.option.column, "amountDrUsd").hide = false;
+          this.findObject(this.option.column, "amountCrUsd").hide = false;
+          this.findObject(this.option.column, "amountUsdBlc").hide = false;
+        } else {
+          this.findObject(this.option.column, "amountDrUsd").hide = true;
+          this.findObject(this.option.column, "amountCrUsd").hide = true;
+          this.findObject(this.option.column, "amountUsdBlc").hide = true;
+        }
+        if (newVla.filter(e => e == 'total') && newVla.filter(e => e == 'total').length) {
+          this.option.showSummary = true
+        } else {
+          this.option.showSummary = false
+        }
+        this.$refs.crud.refreshTable();
+      },
+      deep: false, // 深度监听
+      immediate: false  // 第一次改变就执行
+    },
+    "query.accList": {
+      handler(newVla, oldVal) {
+        this.resetData()
+        if (newVla && newVla.length) {
+          this.query.accIds = newVla.join(',')
+        } else {
+          this.query.accIds = null
+        }
+      },
+      deep: false, // 深度监听
+      immediate: false  // 第一次改变就执行
+    },
+    "query.auxiliaryAccounting": {
+      handler(newVla, oldVal) {
+        if (newVla == 1) {
+          this.findObject(this.optionForm2.column, "type").display = true;
+        } else {
+          this.findObject(this.optionForm2.column, "type").display = false;
+          this.query.type = null
+          this.query.corpList = []
+          this.corpDic = []
+        }
+      },
+      deep: false, // 深度监听
+      immediate: false  // 第一次改变就执行
+    },
+    "query.type": {
+      handler(newVla, oldVal) {
+        if (newVla) {
+          this.query.corpList = []
+          this.corpDic = []
+          getAllList({ type: newVla }).then(res => {
+            this.corpDic = res.data.data
+          })
+        } else {
+          this.query.corpList = []
+          this.corpDic = []
+        }
+      },
+      deep: false, // 深度监听
+      immediate: false  // 第一次改变就执行
+    },
+    "query.corpList": {
+      handler(newVla, oldVal) {
+        if (newVla && newVla.length) {
+          this.query.corpIds = newVla.join(',')
+        } else {
+          this.query.corpIds = null
+        }
+      },
+      deep: false, // 深度监听
+      immediate: false  // 第一次改变就执行
+    },
+    // "searchShow": {
+    //   handler(newVla, oldVal) {
+    //     if (newVla) {
+    //       this.option.height = this.option.height - 149;
+    //     } else {
+    //       this.option.height = this.option.height + 149;
+    //     }
+    //     this.$refs.crud.getTableHeight();
+    //   },
+    //   deep: false, // 深度监听
+    //   immediate: false  // 第一次改变就执行
+    // },
+  },
+  created() {
+    this.option.height = window.innerHeight - 360;
+  },
+  activated() {
+    if (this.$route.query.accId) {
+      setTimeout(() => {
+        if (!this.$store.getters.subLedgerStatus) {
+          this.$store.commit("IN_SUBLED_DETAIL");
+          this.query.accList = this.$route.query.accId ? this.$route.query.accId.split(',') : []
+          this.serach()
+        }
+      }, 200);
+    }
+  },
+  methods: {
+    toJump(row) {
+      if (this.$store.getters.voucherStatus) {
+        this.$alert("财务凭证页面已存在,请关闭财务凭证再进行操作", "温馨提示", {
+          confirmButtonText: "确定",
+          type: 'warning',
+          callback: action => {
+          }
+        });
+      } else {
+        this.$router.push({
+          path: `/iosBasicData/finvouchers/index`,
+          query: {
+            id: row.voucherId
+          },
+        });
+      }
+    },
+    showHight() {
+      // this.$refs.crud.getTableHeight();
+    },
+    nodeClick(data) {
+      this.getList(data)
+    },
+    //初始入账
+    inItial() {
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(255,255,255,0.7)'
+      });
+      this.$confirm('是否继续初始入账?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        initialization().then(res => {
+          this.$message({
+            type: 'success',
+            message: '初始入账成功!'
+          });
+          this.getTreelist()
+        })
+      }).finally(() => {
+        loading.close();
+      });
+
+    },
+    //重置特殊值
+    resetData() {
+      this.query.foreignCurrency = this.query.checkbox.find(e => e == 'foreignCurrency') ? 1 : 0
+      this.query.lastLevelItem = this.query.checkbox.find(e => e == 'lastLevelItem') ? 1 : 0
+      this.query.blcNotZero = this.query.checkbox.find(e => e == 'blcNotZero') ? 1 : 0
+      this.query.noAmountIncurred = this.query.checkbox.find(e => e == 'noAmountIncurred') ? 1 : 0
+      this.query.doNotDisplayYear = this.query.checkbox.find(e => e == 'doNotDisplayYearc') ? 1 : 0
+      this.query.oppositeAcc = this.query.checkbox.find(e => e == 'oppositeAcc') ? 1 : 0
+      this.query.total = this.query.checkbox.find(e => e == 'total') ? 1 : 0
+    },
+    //导出
+    outExport() {
+      this.$confirm('是否导出当前所有数据?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        const routeData = this.$router.resolve({
+          path: '/api/blade-los/accounts/accountsDetailsListExport',      //跳转目标窗口的地址
+          query: {
+            'Blade-Auth': getToken(),
+            ...this.outExportQuery   //括号内是要传递给新窗口的参数
+          }
+        })
+        window.open(routeData.href.slice(1, routeData.href.length));
+      })
+    },
+    serach() {
+      if (!this.query.startYear && !this.query.endYear) {
+        return this.$message.error("请选择期间!");
+      }
+      this.searchShow = false
+      this.getTreelist()
+    },
+    reset() {
+      this.query = this.$options.data().query
+      this.dataList = []
+    },
+    getTreelist() {
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(255,255,255,0.7)'
+      });
+      getTreelist(this.query).then(res => {
+        this.treeData = res.data.data
+        if (res.data.data && res.data.data.length > 0) {
+          this.$nextTick(() => {
+            this.$refs.tree.setCurrentKey(res.data.data[0].id)
+            this.getList(res.data.data[0])
+          })
+        }
+
+      }).finally(() => {
+        loading.close();
+      });
+    },
+    getList(data) {
+      let obj = {}
+      obj = {
+        ...this.query,
+        accIds: data.id,
+        accType: data.type,
+        corpId: data.corpId,
+        deptId: data.deptId,
+        emplId: data.emplId
+      }
+      this.outExportQuery = obj
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(255,255,255,0.7)'
+      });
+      // console.log("当前回显选中:" + this.$refs.tree.getCurrentKey())
+      getList(obj).then(res => {
+        this.dataList = res.data.data
+      }).finally(() => {
+        this.$refs.crud.refreshTable();
+        loading.close();
+      });
+    },
+    //自定义列保存
+    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>
+::v-deep#out-table .back-one {
+  background: #ecf5ff !important;
+  text-align: center;
+}
+
+::v-deep#out-table .back-two {
+  background: #ecf5ff !important;
+  text-align: center;
+}
+
+.treeStyle {
+  height: 56vh;
+  margin-bottom: 60px;
+  /* overflow-y: scroll; */
+}
+
+.bigTreeStyle {
+  height: 72vh;
+  margin-bottom: 60px;
+}
+</style>

+ 74 - 0
src/views/serviceConfiguration/businessbillno/index.vue

@@ -1,4 +1,15 @@
 <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>
     <avue-crud :option="option"
                :table-loading="loading"
@@ -94,6 +105,8 @@
     </el-dialog>
 
   </basic-container>
+    </el-col>
+  </el-row>
 </template>
 
 <script>
@@ -101,6 +114,7 @@
   import {mapGetters} from "vuex";
 
   import {bbusinesstypeList} from "@/api/iosBasicData/bbusinesstype";
+  import { getDeptLazyTree } from "@/api/system/dept";
 
   export default {
     data() {
@@ -116,6 +130,39 @@
           currentPage: 1,
           total: 0
         },
+        treeDeptId: "",
+        treeData: [],
+        treeOption: {
+          nodeKey: "id",
+          lazy: true,
+          treeLoad: function (node, resolve) {
+            // 只提第一级
+            // const parentId = node.level === 0 ? 0 : node.data.id;
+            const parentId = 0;
+            getDeptLazyTree(parentId).then((res) => {
+              res.data.data.forEach((item) => {
+                item.hasChildren = false;
+              });
+              resolve(
+                res.data.data.map((item) => {
+                  return {
+                    ...item,
+                    leaf: !item.hasChildren,
+                  };
+                })
+              );
+            });
+          },
+          addBtn: false,
+          menu: false,
+          size: "small",
+          props: {
+            labelText: "标题",
+            label: "title",
+            value: "value",
+            children: "children",
+          },
+        },
         selectionList: [],
         option: {},
         optionBack: {
@@ -308,6 +355,11 @@
       })
     },
     methods: {
+      nodeClick(data) {
+        this.treeDeptId = data.id;
+        this.page.currentPage = 1;
+        this.onLoad(this.page);
+      },
       businessTypeChange(column) {
         // console.log(column, 1234)
         if (column) {
@@ -321,12 +373,31 @@
       addedData(type, scope) {
         this.form = {};
         if (type == 1) {
+          if(!this.treeDeptId){
+            this.$message({
+              type: "warning",
+              message: "请先选择分公司!",
+            });
+            return;
+          }
+          this.form.branchId = this.treeDeptId;
+
           this.$refs.crud.rowAdd();
         } else if (type == 2) {
           this.$refs.crud.rowEdit(scope.row, scope.$index);
         }
       },
       rowSave(row, done, loading) {
+        if(!this.treeDeptId){
+          this.$message({
+            type: "warning",
+            message: "请先选择分公司!",
+          });
+          loading();
+          return;
+        }
+        row.branchId = this.treeDeptId;
+
         add(row).then(() => {
           this.onLoad(this.page);
           this.$message({
@@ -407,6 +478,7 @@
       },
       searchReset() {
         this.query = {};
+        this.treeDeptId = "";
         this.onLoad(this.page);
       },
       searchChange(params, done) {
@@ -433,6 +505,8 @@
       },
       onLoad(page, params = {}) {
         this.loading = true;
+        let qr = Object.assign(params, this.query);
+        qr.branchId = this.treeDeptId;
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;

+ 318 - 240
src/views/system/post.vue

@@ -1,281 +1,359 @@
 <template>
-  <basic-container>
-    <avue-crud :option="option"
-               :table-loading="loading"
-               :data="data"
-               :page.sync="page"
-               :permission="permissionList"
-               :before-open="beforeOpen"
-               v-model="form"
-               ref="crud"
-               @row-update="rowUpdate"
-               @row-save="rowSave"
-               @row-del="rowDel"
-               @search-change="searchChange"
-               @search-reset="searchReset"
-               @selection-change="selectionChange"
-               @current-change="currentChange"
-               @size-change="sizeChange"
-               @refresh-change="refreshChange"
-               @on-load="onLoad">
-      <template slot="menuLeft">
-        <el-button type="danger"
-                   size="small"
-                   icon="el-icon-delete"
-                   plain
-                   v-if="permission.post_delete"
-                   @click="handleDelete">删 除
-        </el-button>
-      </template>
-      <template slot-scope="{row}"
-                slot="category">
-        <el-tag>{{row.categoryName}}</el-tag>
-      </template>
-    </avue-crud>
-  </basic-container>
+  <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>
+        <avue-crud
+          :option="option"
+          :table-loading="loading"
+          :data="data"
+          :page.sync="page"
+          :permission="permissionList"
+          :before-open="beforeOpen"
+          v-model="form"
+          ref="crud"
+          @row-update="rowUpdate"
+          @row-save="rowSave"
+          @row-del="rowDel"
+          @search-change="searchChange"
+          @search-reset="searchReset"
+          @selection-change="selectionChange"
+          @current-change="currentChange"
+          @size-change="sizeChange"
+          @refresh-change="refreshChange"
+          @on-load="onLoad"
+        >
+          <template slot="menuLeft">
+            <el-button type="danger" size="small" icon="el-icon-delete" plain v-if="permission.post_delete" @click="handleDelete">删 除 </el-button>
+          </template>
+          <template slot-scope="{ row }" slot="category">
+            <el-tag>{{ row.categoryName }}</el-tag>
+          </template>
+        </avue-crud>
+      </basic-container>
+    </el-col>
+  </el-row>
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/system/post";
-  import {mapGetters} from "vuex";
-  import website from "@/config/website";
+import { getList, getDetail, add, update, remove } from "@/api/system/post";
+import { mapGetters } from "vuex";
+import website from "@/config/website";
+import { getDeptLazyTree, topList } from "@/api/system/dept";
 
-  export default {
-    data() {
-      return {
-        form: {},
-        query: {},
-        loading: true,
-        page: {
-          pageSize: 10,
-          currentPage: 1,
-          total: 0
+export default {
+  data() {
+    return {
+      form: {},
+      query: {},
+      loading: true,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+      },
+
+      treeDeptId: "",
+      treeData: [],
+      treeOption: {
+        nodeKey: "id",
+        lazy: true,
+        treeLoad: function (node, resolve) {
+          // 只提第一级
+          // const parentId = node.level === 0 ? 0 : node.data.id;
+          const parentId = 0;
+          getDeptLazyTree(parentId).then((res) => {
+            res.data.data.forEach((item) => {
+              item.hasChildren = false;
+            });
+            resolve(
+              res.data.data.map((item) => {
+                return {
+                  ...item,
+                  leaf: !item.hasChildren,
+                };
+              })
+            );
+          });
         },
-        selectionList: [],
-        option: {
-          height: 'auto',
-          calcHeight: 30,
-          tip: false,
-          searchShow: true,
-          searchMenuSpan: 6,
-          border: true,
-          index: true,
-          viewBtn: true,
-          selection: true,
-          dialogClickModal: false,
-          column: [
-            {
-              label: "所属企业",
-              prop: "tenantId",
-              type: "tree",
-              dicUrl: "/api/blade-system/tenant/select",
-              addDisplay: false,
-              editDisplay: false,
-              viewDisplay: website.tenantMode,
-              span: 24,
-              props: {
-                label: "tenantName",
-                value: "tenantId"
-              },
-              hide: !website.tenantMode,
-              rules: [{
+        addBtn: false,
+        menu: false,
+        size: "small",
+        props: {
+          labelText: "标题",
+          label: "title",
+          value: "value",
+          children: "children",
+        },
+      },
+
+      selectionList: [],
+      option: {
+        height: "auto",
+        calcHeight: 30,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        border: true,
+        index: true,
+        viewBtn: true,
+        selection: true,
+        dialogClickModal: false,
+        column: [
+          /*
+          {
+            label: "所属企业",
+            prop: "tenantId",
+            type: "tree",
+            dicUrl: "/api/blade-system/tenant/select",
+            addDisplay: false,
+            editDisplay: false,
+            viewDisplay: !website.tenantMode,
+            span: 24,
+            props: {
+              label: "tenantName",
+              value: "tenantId",
+            },
+            hide: !website.tenantMode,
+            rules: [
+              {
                 required: true,
                 message: "请输入所属企业",
-                trigger: "click"
-              }]
-            },
-            {
-              label: "岗位类型",
-              prop: "category",
-              type: "select",
-              dicUrl: "/api/blade-system/dict/dictionary?code=post_category",
-              props: {
-                label: "dictValue",
-                value: "dictKey"
+                trigger: "click",
               },
-              dataType: "number",
-              slot: true,
-              search: true,
-              rules: [{
-                required: true,
-                message: "请选择岗位类型",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "岗位编号",
-              prop: "postCode",
-              search: true,
-              rules: [{
+            ],
+          },
+          */
+          {
+            label: "岗位编号",
+            prop: "postCode",
+            search: true,
+            rules: [
+              {
                 required: true,
                 message: "请输入岗位编号",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "岗位名称",
-              prop: "postName",
-              search: true,
-              rules: [{
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "岗位名称",
+            prop: "postName",
+            search: true,
+            rules: [
+              {
                 required: true,
                 message: "请输入岗位名称",
-                trigger: "blur"
-              }]
-            },
+                trigger: "blur",
+              },
+            ],
+          },
             {
-              label: "岗位排序",
-              prop: "sort",
-              type: "number",
-              rules: [{
+                label: "岗位类型",
+                prop: "category",
+                type: "select",
+                dicUrl: "/api/blade-system/dict/dictionary?code=post_category",
+                props: {
+                    label: "dictValue",
+                    value: "dictKey",
+                },
+                dataType: "number",
+                slot: true,
+                search: true,
+                rules: [
+                    {
+                        required: true,
+                        message: "请选择岗位类型",
+                        trigger: "blur",
+                    },
+                ],
+            },
+          {
+            label: "岗位排序",
+            prop: "sort",
+            type: "number",
+            rules: [
+              {
                 required: true,
                 message: "请输入岗位排序",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "岗位描述",
-              prop: "remark",
-              type: "textarea",
-              span: 24,
-              minRows: 6,
-              hide: true,
-            },
-          ]
-        },
-        data: []
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "岗位描述",
+            prop: "remark",
+            type: "textarea",
+            span: 24,
+            minRows: 6,
+            hide: true,
+          },
+        ],
+      },
+      data: [],
+    };
+  },
+  computed: {
+    ...mapGetters(["permission"]),
+    permissionList() {
+      return {
+        addBtn: this.vaildData(this.permission.post_add, false),
+        viewBtn: this.vaildData(this.permission.post_view, false),
+        delBtn: this.vaildData(this.permission.post_delete, false),
+        editBtn: this.vaildData(this.permission.post_edit, false),
       };
     },
-    computed: {
-      ...mapGetters(["permission"]),
-      permissionList() {
-        return {
-          addBtn: this.vaildData(this.permission.post_add, false),
-          viewBtn: this.vaildData(this.permission.post_view, false),
-          delBtn: this.vaildData(this.permission.post_delete, false),
-          editBtn: this.vaildData(this.permission.post_edit, false)
-        };
-      },
-      ids() {
-        let ids = [];
-        this.selectionList.forEach(ele => {
-          ids.push(ele.id);
-        });
-        return ids.join(",");
-      }
+    ids() {
+      let ids = [];
+      this.selectionList.forEach((ele) => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
     },
-    methods: {
-      rowSave(row, done, loading) {
-        add(row).then(() => {
+  },
+  methods: {
+    nodeClick(data) {
+      this.treeDeptId = data.id;
+      this.page.currentPage = 1;
+      this.onLoad(this.page);
+    },
+    rowSave(row, done, loading) {
+      if(!this.treeDeptId){
+          this.$message({
+              type: "warning",
+              message: "请先选择分公司!",
+          });
+          loading();
+          return;
+      }
+      row.branchId = this.treeDeptId;
+      add(row).then(
+        () => {
           this.onLoad(this.page);
           this.$message({
             type: "success",
-            message: "操作成功!"
+            message: "操作成功!",
           });
           done();
-        }, error => {
+        },
+        (error) => {
           window.console.log(error);
           loading();
-        });
-      },
-      rowUpdate(row, index, done, loading) {
-        update(row).then(() => {
+        }
+      );
+    },
+    rowUpdate(row, index, done, loading) {
+      update(row).then(
+        () => {
           this.onLoad(this.page);
           this.$message({
             type: "success",
-            message: "操作成功!"
+            message: "操作成功!",
           });
           done();
-        }, error => {
+        },
+        (error) => {
           window.console.log(error);
           loading();
-        });
-      },
-      rowDel(row) {
-        this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
-          .then(() => {
-            return remove(row.id);
-          })
-          .then(() => {
-            this.onLoad(this.page);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-          });
-      },
-      handleDelete() {
-        if (this.selectionList.length === 0) {
-          this.$message.warning("请选择至少一条数据");
-          return;
         }
-        this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
+      );
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(row.id);
         })
-          .then(() => {
-            return remove(this.ids);
-          })
-          .then(() => {
-            this.onLoad(this.page);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-            this.$refs.crud.toggleSelection();
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
           });
-      },
-      beforeOpen(done, type) {
-        if (["edit", "view"].includes(type)) {
-          getDetail(this.form.id).then(res => {
-            this.form = res.data.data;
+        });
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
           });
-        }
-        done();
-      },
-      searchReset() {
-        this.query = {};
-        this.onLoad(this.page);
-      },
-      searchChange(params, done) {
-        this.query = params;
-        this.page.currentPage = 1;
-        this.onLoad(this.page, params);
-        done();
-      },
-      selectionChange(list) {
-        this.selectionList = list;
-      },
-      selectionClear() {
-        this.selectionList = [];
-        this.$refs.crud.toggleSelection();
-      },
-      currentChange(currentPage) {
-        this.page.currentPage = currentPage;
-      },
-      sizeChange(pageSize) {
-        this.page.pageSize = pageSize;
-      },
-      refreshChange() {
-        this.onLoad(this.page, this.query);
-      },
-      onLoad(page, params = {}) {
-        this.loading = true;
-        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
-          const data = res.data.data;
-          this.page.total = data.total;
-          this.data = data.records;
-          this.loading = false;
-          this.selectionClear();
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    beforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        getDetail(this.form.id).then((res) => {
+          this.form = res.data.data;
         });
       }
-    }
-  };
+      done();
+    },
+    searchReset() {
+      this.query = {};
+      this.treeDeptId = "";
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      let qr = Object.assign(params, this.query);
+      qr.branchId = this.treeDeptId;
+      getList(page.currentPage, page.pageSize, qr).then((res) => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.data = data.records;
+        this.loading = false;
+        this.selectionClear();
+      });
+    },
+  },
+};
 </script>
 
-<style>
-</style>
+<style></style>

File diff suppressed because it is too large
+ 304 - 250
src/views/system/user.vue


Some files were not shown because too many files changed in this diff