Browse Source

Merge branch 'dev' of http://git.echepei.com/tire-platform/Smart_platform_ui into dev

Qukatie 1 week ago
parent
commit
7c64776fe4

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

@@ -0,0 +1,42 @@
+import request from '@/router/axios';
+
+export const getStatistics = (params) => {
+  return request({
+    url: '/api/blade-los/apStatistics/statistics',
+    method: 'get',
+    params:params
+  })
+}
+
+export const getARAccounts = () => {
+  return request({
+    url: '/api/blade-los/accounts/selectList',
+    method: 'get',
+    params:{
+      isDetail: 1,
+      isAr: 1,
+    }
+  })
+}
+
+export const getAPAccounts = () => {
+  return request({
+    url: '/api/blade-los/accounts/selectList',
+    method: 'get',
+    params:{
+      isDetail: 1,
+      isAp: 1,
+    }
+  })
+}
+
+export const getARAPAccounts = () => {
+  return request({
+    url: '/api/blade-los/accounts/selectList',
+    method: 'get',
+    params:{
+      isDetail: 1,
+      isArAp: 1,
+    }
+  })
+}

+ 10 - 2
src/api/iosBasicData/rateManagement.js

@@ -66,11 +66,19 @@ export function bcurexrateDetails(data) {
     }
   })
 }
-//ETD查看汇率
+//ETD进出口同步汇率
+export function syncExchangeRate(data) {
+  return request({
+    url: '/api/blade-los/bcurexrate/syncExchangeRate',
+    method: 'post',
+    data: data
+  })
+}
+//ETD进出口同步汇率
 export function synchronizationExchangeRate(params) {
   return request({
     url: '/api/blade-los/bills/synchronizationExchangeRate',
     method: 'get',
     params
   })
-}
+}

+ 36 - 6
src/router/views/index.js

@@ -3552,14 +3552,14 @@ export default [{
     component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/periodManagement/index')
   }]
 },
-// 总分类账
+// 科目总分类账
 {
   path: '/iosBasicData/fingenleg/index',
   component: Layout,
   hidden: true,
   children: [{
     path: '/iosBasicData/fingenleg/index',
-    name: '总分类账(F)',
+    name: '科目总分类账',
     meta: {
       i18n: '/iosBasicData/fingenleg/index',
       keepAlive: true,
@@ -3567,14 +3567,14 @@ export default [{
     component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/fingenleg/index')
   }]
 },
-// 核算项目明细账
+// 项目明细账
 {
   path: '/iosBasicData/fingenlegcalc/index',
   component: Layout,
   hidden: true,
   children: [{
     path: '/iosBasicData/fingenlegcalc/index',
-    name: '核算项目明细账(F)',
+    name: '项目明细账',
     meta: {
       i18n: '/iosBasicData/fingenlegcalc/index',
       keepAlive: true,
@@ -3582,14 +3582,14 @@ export default [{
     component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/fingenlegcalc/index')
   }]
 },
-// 明细账
+// 科目明细账
 {
   path: '/iosBasicData/accountsDetails/index',
   component: Layout,
   hidden: true,
   children: [{
     path: '/iosBasicData/accountsDetails/index',
-    name: '明细账(F)',
+    name: '科目明细账',
     meta: {
       i18n: '/iosBasicData/accountsDetails/index',
       keepAlive: true,
@@ -3597,6 +3597,36 @@ export default [{
     component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/accountsDetails/index')
   }]
 },
+// AP 统计
+  {
+    path: '/iosBasicData/apStatistics/index',
+    component: Layout,
+    hidden: true,
+    children: [{
+      path: '/iosBasicData/apStatistics/index',
+      name: 'AP 统计',
+      meta: {
+        i18n: '/iosBasicData/apStatistics/index',
+        keepAlive: true,
+      },
+      component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/apStatistics/index')
+    }]
+  },
+// AP 统计
+  {
+    path: '/iosBasicData/apStatistics/index',
+    component: Layout,
+    hidden: true,
+    children: [{
+      path: '/iosBasicData/apStatistics/index',
+      name: 'AP 统计',
+      meta: {
+        i18n: '/iosBasicData/apStatistics/index',
+        keepAlive: true,
+      },
+      component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/apStatistics/index')
+    }]
+  },
 // 销售分析
 {
   path: '/tirePartsMall/financialManagement/salesAnalysis/index',

+ 17 - 2
src/views/iosBasicData/ComputationCenter/settlementDetails.vue

@@ -515,7 +515,7 @@
                       @click="generateVoucherfun"
                       >生成凭证
                     </el-button>
-                    <span v-if="form.voucherNo" style="font-size: 12px; margin-right: 8px">已生成凭证</span>
+                    <span v-if="form.voucherNo" style="font-size: 12px; margin-left: 16px; margin-right: 8px">{{'凭证号:' + form.voucherNo + ' 单据号:' + form.voucherBillNo}}</span>
                   </el-col>
                 </el-row>
               </el-form>
@@ -2566,7 +2566,22 @@ export default {
             }
             return item;
           });
-          if (type == "选定行") {
+
+          this.form.finVouchersItemsList = Array.isArray(this.form.finVouchersItemsList) ? this.form.finVouchersItemsList : [];
+          this.form.finVouchersItemsList.forEach((item) => {
+            item.dynUID = item.id + "";
+          });
+          this.form.finVouchersItemsList
+            .filter((j) => j.isOff === 1)
+            .forEach((item) => {
+              let row = this.form.finVouchersItemsList.find((j) => j.id === item.offVouItemId);
+              if (row) {
+                if (!Array.isArray(row.offVouItems)) row.offVouItems = [];
+                row.offVouItems.push(item);
+              }
+            });
+
+          if (type === "选定行") {
             this.finstlbillslistAccBillV1fun();
           }
           this.bcorpsbankListfun(); // 查银行数据

+ 42 - 2
src/views/iosBasicData/SeafreightExportF/bills/assembly/feecenter.vue

@@ -173,7 +173,7 @@
         id="out-table"
         :header-cell-class-name="headerClassName"
         ref="crudD"
-        :row-style="{ height: '20px' }"
+        :row-style="rowStyle"
         :cell-style="{ padding: '0px' }"
         @selection-change="handleSelectionChange($event, 'D')"
         @resetColumn="resetColumnTwo('crudD', 'optionD', 'optionDBack', 309.2)"
@@ -448,7 +448,7 @@
         id="out-table"
         :header-cell-class-name="headerClassName"
         ref="crudC"
-        :row-style="{ height: '20px' }"
+        :row-style="rowStyle"
         :cell-style="{ padding: '0px' }"
         @selection-change="handleSelectionChange($event, 'C')"
         @resetColumn="resetColumnTwo('crudC', 'optionC', 'optionCBack', 309.3)"
@@ -4091,6 +4091,46 @@ export default {
       //     window.print()
       // }
     },
+    rowStyle({ row, column, rowIndex, columnIndex }) {
+      // 0 = 新建  1=审核提交  2=审核中  3= 审核通过  4=审核驳回
+      let height = "20px";
+
+      if (row.auditStatus == 3 || row.accStatus == 1) {
+        return {
+          // color: '#fff',
+          // backgroundColor: "#ced094"
+          height: height,
+          color: "green"
+        };
+      }
+      if (row.auditStatus == 1) {
+        return {
+          // color: '#fff',
+          // backgroundColor: "#fbd26a"
+          height: height,
+          color: "#e8ab11"
+        };
+      }
+      if (row.auditStatus == 2) {
+        return {
+          // color: '#fff',
+          // backgroundColor: "#fbd26a"
+          height: height,
+          color: "#03cbf9"
+        };
+      }
+      if (row.auditStatus == 4) {
+        return {
+          // color: '#fff',
+          // backgroundColor: "#fbc4c4"
+          height: height,
+          color: "red"
+        };
+      }
+      return {
+        height: height,
+      };
+    },
     // 表头样式
     tableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
       return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff";

+ 357 - 0
src/views/iosBasicData/apStatistics/index.vue

@@ -0,0 +1,357 @@
+<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 type="primary" icon="el-icon-search" size="small" @click="search">搜 索</el-button>
+            <el-button icon="el-icon-delete" size="small" @click="reset">清 空</el-button>
+            <el-button type="success" size="small" plain @click="outExport">导 出</el-button>
+          </span>
+        </tempalte>
+      </avue-form>
+    </basic-container>
+    <basic-container v-show="dataList.length > 0">
+      <avue-crud :option="option" :data="dataList" ref="crud" id="out-table" :header-cell-class-name="headerClassName">
+        <template slot="accCode" slot-scope="{ row }">
+          <span style="color: #1e9fff; cursor: pointer" @click="toJump(row)">{{ row.accCode }} </span>
+        </template>
+      </avue-crud>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import { getList } from "@/api/iosBasicData/fingenleg";
+import { dateFormat } from "@/util/date";
+import { getToken } from "@/util/auth";
+import { getAPAccounts, getStatistics } from "@/api/iosBasicData/apStatistics";
+export default {
+  data() {
+    return {
+      query: {
+        month: 24,
+        accId: "",
+      },
+      optionForm: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: "科目",
+            prop: "accId",
+            type: "select",
+            filterable: true,
+            // multiple: true,
+            tags: true,
+            // remote: false,
+            // dicUrl: `/api/blade-los/accounts/selectList?isDetail=1&isArAp=1&cnName={{key}}`,
+            dicData: this.accounsList,
+            props: {
+              label: "code",
+              desc: "fullName",
+              value: "id",
+              res: "data",
+            },
+            span: 6,
+          },
+          {
+            label: "超过月数",
+            prop: "month",
+            type: "number",
+            span: 4,
+          },
+          {
+            label: "",
+            prop: "button",
+            span: 14,
+          },
+        ],
+      },
+      accounsList: [],
+      dic: [
+        {
+          label: "1",
+          value: 1,
+        },
+        {
+          label: "2",
+          value: 2,
+        },
+        {
+          label: "3",
+          value: 3,
+        },
+      ],
+      // option: {},
+      option: {
+        height: "auto",
+        calcHeight: 30,
+        border: true,
+        index: false,
+        menu: false,
+        addBtn: false,
+        header: false,
+        column: [
+          {
+            label: "期间",
+            prop: "date",
+            overHidden: true,
+          },
+          {
+            label: "科目代码",
+            prop: "accCode",
+            overHidden: true,
+          },
+          {
+            label: "科目名称",
+            prop: "cnName",
+            overHidden: true,
+          },
+          {
+            label: "摘要",
+            prop: "descr",
+            overHidden: true,
+          },
+          {
+            label: "开始科目",
+            prop: "startCode",
+            overHidden: true,
+            hide: true,
+            searchslot: true,
+          },
+          {
+            label: "结束科目",
+            prop: "endCode",
+            overHidden: true,
+            hide: true,
+            searchslot: true,
+          },
+          {
+            label: "开始日期",
+            prop: "startDate",
+            overHidden: true,
+            hide: true,
+            type: "month",
+            format: "yyyy-MM",
+            valueFormat: "yyyy-MM",
+          },
+          {
+            label: "结束日期",
+            prop: "endDate",
+            overHidden: true,
+            hide: true,
+            type: "month",
+            format: "yyyy-MM",
+            valueFormat: "yyyy-MM",
+          },
+          {
+            label: "币种",
+            prop: "curCode",
+            hide: true,
+            type: "select",
+            dicData: [
+              {
+                label: "CNY",
+                value: "CNY",
+              },
+              {
+                label: "USD",
+                value: "USD",
+              },
+            ],
+            overHidden: true,
+          },
+          {
+            label: "显示外币",
+            prop: "isForeignDetermine",
+            hide: 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",
+            overHidden: true,
+          },
+        ],
+      },
+      dataList: [],
+    };
+  },
+  watch: {
+    /*
+    "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  // 第一次改变就执行
+    },
+    */
+  },
+  created() {
+    getAPAccounts().then((res) => {
+      this.accounsList = res.data.data;
+      this.findObject(this.optionForm.column, "accId").dicData = this.accounsList;
+    })
+  },
+  methods: {
+    toJump(row) {
+      if (this.$store.getters.subLedgerStatus) {
+        this.$alert("明细账页面已存在,请关闭明细账再进行操作", "温馨提示", {
+          confirmButtonText: "确定",
+          type: "warning",
+          callback: (action) => {},
+        });
+      } else {
+        this.$router.push({
+          path: `/iosBasicData/accountsDetails/index`,
+          query: {
+            accId: row.accId,
+          },
+        });
+      }
+    },
+    //重置特殊值
+    resetData() {},
+    //导出
+    outExport() {
+      this.$confirm("是否导出当前所有数据?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        const routeData = this.$router.resolve({
+          path: "/api/blade-los/fingenleg/selectListExport", //跳转目标窗口的地址
+          query: {
+            "Blade-Auth": getToken(),
+            ...this.query, //括号内是要传递给新窗口的参数
+          },
+        });
+        window.open(routeData.href.slice(1, routeData.href.length));
+      });
+    },
+    search() {
+      if(!this.query.accId) {
+        this.$alert("请选择一个科目代码!", "温馨提示", {
+          confirmButtonText: "确定",
+          type: "warning",
+          callback: (action) => {},
+        });
+        return
+      }
+      this.getList();
+    },
+    reset() {
+      this.query = this.$options.data().query;
+      this.dataList = [];
+    },
+    getList() {
+      const loading = this.$loading({
+        lock: true,
+        text: "加载中",
+        spinner: "el-icon-loading",
+        background: "rgba(255,255,255,0.7)",
+      });
+      getStatistics(this.query)
+        .then((res) => {
+          // this.dataList = res.data.data
+        })
+        .finally(() => {
+          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;
+}
+</style>

+ 275 - 207
src/views/iosBasicData/rateManagement/detailsPage.vue

@@ -2,16 +2,22 @@
   <div class="borderless" v-loading="allloading">
     <div class="customer-head">
       <div class="customer-back">
-        <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
-          @click="backToList">返回列表
+        <el-button type="danger" style="border: none; background: none; color: red" icon="el-icon-arrow-left" @click="backToList"
+          >返回列表
         </el-button>
       </div>
       <div class="add-customer-btn">
-        <el-button type="primary" size="small" v-if="detailData.status == 1" class="el-button--small-yh "
-          :disabled="form.status > 0" @click.stop="openEdit">编辑
+        <el-button
+          type="primary"
+          size="small"
+          v-if="detailData.status == 1"
+          class="el-button--small-yh"
+          :disabled="form.status > 0"
+          @click.stop="openEdit"
+          >编辑
         </el-button>
-        <el-button class="el-button--small-yh" type="primary" :disabled="loadingBtn || detailData.status == 1"
-          size="small" @click="editCustomer">保存数据
+        <el-button class="el-button--small-yh" type="primary" :disabled="loadingBtn || detailData.status == 1" size="small" @click="editCustomer"
+          >保存数据
         </el-button>
       </div>
     </div>
@@ -20,49 +26,81 @@
       <basic-container>
         <avue-form class="trading-form" ref="form" v-model="form" :option="option">
           <template slot="parities">
-            <el-input-number v-model="form.parities" size="small" :controls="false" style="width: 100%"
-              placeholder="请输入 默认汇率" :disabled="detailData.status == 1"></el-input-number>
+            <el-input-number
+              v-model="form.parities"
+              size="small"
+              :controls="false"
+              style="width: 100%"
+              placeholder="请输入 默认汇率"
+              :disabled="detailData.status == 1"
+            ></el-input-number>
           </template>
           <template slot="standardMoney">
-            <el-switch v-model="form.standardMoney" :active-value="1" :inactive-value="0"
-              :disabled="detailData.status == 1">
-            </el-switch>
+            <el-switch v-model="form.standardMoney" :active-value="1" :inactive-value="0" :disabled="detailData.status == 1"> </el-switch>
           </template>
           <!-- <template slot="paritiesType">
             <avue-select v-model="form.paritiesType" placeholder="请选择汇率类型" :disabled="detailData.status == 1"
               :dic="typeData" @change="paritiesChange"></avue-select>
           </template> -->
           <template slot="annual">
-            <avue-date v-model="form.annual" placeholder="请选择汇率年度" :disabled="detailData.status == 1" type="year"
-              @change="annualChange" valueFormat="yyyy"></avue-date>
+            <avue-date
+              v-model="form.annual"
+              placeholder="请选择汇率年度"
+              :disabled="detailData.status == 1"
+              type="year"
+              @change="annualChange"
+              valueFormat="yyyy"
+            ></avue-date>
           </template>
           <template v-if="form.paritiesType == '日汇率'" slot="moon">
-            <avue-select  v-model="form.moon" placeholder="请选择月份" :disabled="detailData.status == 1" :dic="MoonData"
-              @change="MoonChange"></avue-select>
+            <avue-select
+              v-model="form.moon"
+              placeholder="请选择月份"
+              :disabled="detailData.status == 1"
+              :dic="MoonData"
+              @change="MoonChange"
+            ></avue-select>
           </template>
           <template slot="button">
-            <el-button v-if="form.code != 'CNY'" size="small" type="primary" @click="createExRate"
-              :disabled="detailData.status == 1 || dataList.length != 0">产生汇率项目</el-button>
+            <el-button
+              v-if="form.code != 'CNY'"
+              size="small"
+              type="primary"
+              @click="createExRate"
+              :disabled="detailData.status == 1 || dataList.length != 0"
+              >产生汇率项目</el-button
+            >
             <div v-else></div>
           </template>
         </avue-form>
       </basic-container>
       <containerTitle v-if="form.code != 'CNY'" title="基础明细"></containerTitle>
       <basic-container v-if="form.code != 'CNY'">
-        <avue-crud ref="crud" v-model="crudForm" :option="optionList" id="out-table" :search.sync="search"
-          :header-cell-class-name="headerClassName" :data="dataList" :table-loading="loading" :cell-style="cellStyle"
-          @row-save="rowSave" @row-update="rowUpdate" @search-change="searchChange" @search-reset="resetChange"
-          @selection-change="selectionChange">
-
+        <avue-crud
+          ref="crud"
+          v-model="crudForm"
+          :option="optionList"
+          id="out-table"
+          :search.sync="search"
+          :header-cell-class-name="headerClassName"
+          :data="dataList"
+          :table-loading="loading"
+          :cell-style="cellStyle"
+          @row-save="rowSave"
+          @row-update="rowUpdate"
+          @search-change="searchChange"
+          @search-reset="resetChange"
+          @selection-change="selectionChange"
+        >
           <template slot="menuLeft">
-            <el-button type="danger" size="small" @click.stop="BatchDelete"
-              :disabled="detailData.status == 1 || dataList.length == 0">一键删除</el-button>
+            <el-button type="danger" size="small" @click.stop="BatchDelete" :disabled="detailData.status == 1 || dataList.length == 0"
+              >一键删除</el-button
+            >
           </template>
-          <template v-if="!row.$cellEdit" slot="menu" slot-scope="{row}">
-            <el-button type="text" size="small" @click="editFun(row)">编辑
-            </el-button>
-            <!-- <el-button type="text" size="small" @click="rowDel(row)">删除
-            </el-button> -->
+          <template v-if="!row.$cellEdit" slot="menu" slot-scope="{ row }">
+            <el-button type="text" size="small" @click="editFun(row)">编辑</el-button>
+            <!-- <el-button type="text" size="small" @click="rowDel(row)">删除</el-button> -->
+            <el-button type="text" size="small" @click="rowSyncExchangeRate(row)">同步汇率</el-button>
           </template>
         </avue-crud>
       </basic-container>
@@ -71,7 +109,7 @@
 </template>
 
 <script>
-import { typeSave, dataDetail, delItem, bcurexrateDetails, bcurexrateList } from "@/api/iosBasicData/rateManagement";
+import { typeSave, dataDetail, delItem, bcurexrateDetails, bcurexrateList, syncExchangeRate } from "@/api/iosBasicData/rateManagement";
 import { optionList } from "./js/optionList";
 import reportDialog from "@/components/report-dialog/main";
 export default {
@@ -81,70 +119,70 @@ export default {
       typeData: [
         {
           label: "年汇率",
-          value: "年汇率"
+          value: "年汇率",
         },
         {
           label: "月汇率",
-          value: "月汇率"
+          value: "月汇率",
         },
         {
           label: "日汇率",
-          value: "日汇率"
-        }
+          value: "日汇率",
+        },
       ],
       MoonData: [
         {
           label: "一月",
-          value: 1
+          value: 1,
         },
         {
           label: "二月",
-          value: 2
+          value: 2,
         },
         {
           label: "三月",
-          value: 3
+          value: 3,
         },
         {
           label: "四月",
-          value: 4
+          value: 4,
         },
         {
           label: "五月",
-          value: 5
+          value: 5,
         },
         {
           label: "六月",
-          value: 6
+          value: 6,
         },
         {
           label: "七月",
-          value: 7
+          value: 7,
         },
         {
           label: "八月",
-          value: 8
+          value: 8,
         },
         {
           label: "九月",
-          value: 9
+          value: 9,
         },
         {
           label: "十月",
-          value: 10
+          value: 10,
         },
         {
           label: "十一月",
-          value: 11
+          value: 11,
         },
         {
           label: "十二月",
-          value: 12
+          value: 12,
         },
       ],
       time: "",
       search: {
-        annual: '2024'
+        annual: "2024",
       },
       crudForm: {},
       loading: false,
@@ -163,11 +201,13 @@ export default {
             label: "货币代码",
             prop: "code",
             span: 6,
-            rules: [{
-              required: true,
-              message: "请输入代码",
-              trigger: "blur"
-            }]
+            rules: [
+              {
+                required: true,
+                message: "请输入代码",
+                trigger: "blur",
+              },
+            ],
           },
           {
             label: "国际三字码",
@@ -178,21 +218,25 @@ export default {
             label: "中文名称",
             prop: "cnName",
             span: 6,
-            rules: [{
-              required: true,
-              message: "请输入中文名称",
-              trigger: "blur"
-            }]
+            rules: [
+              {
+                required: true,
+                message: "请输入中文名称",
+                trigger: "blur",
+              },
+            ],
           },
           {
             label: "英文名称",
             prop: "enName",
             span: 6,
-            rules: [{
-              required: true,
-              message: "请输入英文名称",
-              trigger: "blur"
-            }]
+            rules: [
+              {
+                required: true,
+                message: "请输入英文名称",
+                trigger: "blur",
+              },
+            ],
           },
           {
             label: "货币符号",
@@ -204,14 +248,17 @@ export default {
             prop: "isLocal",
             type: "select",
             span: 6,
-            dicData: [{
-              label: '非本币',
-              value: 0
-            }, {
-              label: '本币',
-              value: 1
-            }],
-            value: 0
+            dicData: [
+              {
+                label: "非本币",
+                value: 0,
+              },
+              {
+                label: "本币",
+                value: 1,
+              },
+            ],
+            value: 0,
           },
           {
             label: "对本币汇率",
@@ -221,12 +268,12 @@ export default {
           {
             label: "国家代码",
             prop: "cntyCode",
-            span: 6
+            span: 6,
           },
           {
             label: "国家名称",
             prop: "cntyName",
-            span: 6
+            span: 6,
           },
           {
             label: "汇率类型",
@@ -236,21 +283,21 @@ export default {
             clearable: false,
             props: {
               label: "dictValue",
-              value: "dictValue"
+              value: "dictValue",
             },
             dicData: [
               {
                 dictValue: "年汇率",
-                dictKey: 0
+                dictKey: 0,
               },
               {
                 dictValue: "月汇率",
-                dictKey: 1
+                dictKey: 1,
               },
               {
                 dictValue: "日汇率",
-                dictKey: 2
-              }
+                dictKey: 2,
+              },
             ],
             span: 6,
           },
@@ -272,30 +319,32 @@ export default {
             prop: "status",
             span: 6,
             type: "select",
-            dicData: [{
-              label: '启用',
-              value: 0
-            }, {
-              label: '停用',
-              value: 1
-            }],
-            value: 0
+            dicData: [
+              {
+                label: "启用",
+                value: 0,
+              },
+              {
+                label: "停用",
+                value: 1,
+              },
+            ],
+            value: 0,
           },
           {
             label: "备注",
             prop: "remarks",
-            type: 'textarea',
+            type: "textarea",
             width: "180",
             span: 24,
             minRows: 3,
-            slot: true
+            slot: true,
           },
           {
             prop: "button",
-            span: 6
-          }
-
-        ]
+            span: 6,
+          },
+        ],
       },
       optionList: optionList,
       selectionList: [],
@@ -303,11 +352,11 @@ export default {
   },
   props: {
     detailData: {
-      type: Object
-    }
+      type: Object,
+    },
   },
   components: {
-    reportDialog
+    reportDialog,
   },
   created() {
     this.$set(this.form, "standardMoney", 0);
@@ -315,13 +364,13 @@ export default {
       this.getDetail(this.detailData.id);
     }
     if (this.detailData.status == 1) {
-      this.$set(this.option, 'disabled', true)
+      this.$set(this.option, "disabled", true);
     }
     this.optionList.height = 450;
   },
   methods: {
     selectionChange(list) {
-      this.selectionList = list
+      this.selectionList = list;
     },
     // paritiesChange(row) {
     //   let obj = {
@@ -352,16 +401,16 @@ export default {
     //   }
     // },
     annualChange(row) {
-      this.search.annual = row
-      this.search.moon = this.form.moon
-      this.search.paritiesType = this.form.paritiesType
-      this.searchChange(this.search)
+      this.search.annual = row;
+      this.search.moon = this.form.moon;
+      this.search.paritiesType = this.form.paritiesType;
+      this.searchChange(this.search);
     },
     MoonChange(row) {
-      this.search.annual = this.form.annual
-      this.search.moon = row
-      this.search.paritiesType = this.form.paritiesType
-      this.searchChange(this.search)
+      this.search.annual = this.form.annual;
+      this.search.moon = row;
+      this.search.paritiesType = this.form.paritiesType;
+      this.searchChange(this.search);
     },
     searchChange(params, done) {
       // if (params.paritiesType == "日汇率") {
@@ -378,69 +427,85 @@ export default {
         type: params.paritiesType,
         code: this.form.code,
         exrateYear: params.annual,
-        exrateMonth: params.moon
-      }
-      bcurexrateList(obj).then(res => {
+        exrateMonth: params.moon,
+      };
+      bcurexrateList(obj).then((res) => {
         this.dataList = res.data.data.records;
-        done();
-      })
-    },
-    resetChange() {
-
+        if (typeof done === "function") done();
+      });
     },
+    resetChange() {},
     // 编辑明细
     editFun(row) {
-      console.log(row, '编辑')
-      this.$refs.crud.rowCell(row, row.$index)
-
+      console.log(row, "编辑");
+      this.$refs.crud.rowCell(row, row.$index);
     },
-    // 编辑点击保存
+    // 新增保存
     rowSave(row, done, loading) {
-      done(row)
+      done(row);
     },
-    // 编辑点击保存
+    // 编辑保存
     rowUpdate(row, index, done, loading) {
+      console.log("rowUpdate", row, done);
       done(row);
     },
+    rowSyncExchangeRate(row) {
+      if (!row) {
+        return;
+      }
+
+      let msg = `确定要同步 ${row.exrateYear}年${row.type == "月汇率" ? row.exrateMonth + "月" : ""} 汇率吗?`;
+
+      this.$confirm(msg, {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        syncExchangeRate(row).then((res) => {
+          this.$message.success("操作成功");
+          this.searchChange(this.search);
+        });
+      });
+    },
     // 批量删除
     BatchDelete() {
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
-        let arrId = this.dataList.map(item => {
-          return item.id
-        })
-        bcurexrateDetails(arrId.join(',')).then(res => {
-          this.$message.success('操作成功')
-          this.searchChange(this.search)
-        })
-      })
+        let arrId = this.dataList.map((item) => {
+          return item.id;
+        });
+        bcurexrateDetails(arrId.join(",")).then((res) => {
+          this.$message.success("操作成功");
+          this.searchChange(this.search);
+        });
+      });
     },
     // 删除
     rowDel(row) {
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
-        bcurexrateDetails(row.id).then(res => {
-          this.$message.success('操作成功')
-          this.dataList.splice(row.$index, 1)
-        })
-      })
+        bcurexrateDetails(row.id).then((res) => {
+          this.$message.success("操作成功");
+          this.dataList.splice(row.$index, 1);
+        });
+      });
     },
     cellStyle() {
       return "padding:0;height:40px;";
     },
     // 详情
     getDetail(id) {
-      this.allloading = true
+      this.allloading = true;
       dataDetail(id)
-        .then(res => {
-          this.form = res.data.data
-          this.form.annual = this.form.annual + ''
+        .then((res) => {
+          this.form = res.data.data;
+          this.form.annual = this.form.annual + "";
         })
         .finally(() => {
           this.allloading = false;
@@ -458,9 +523,9 @@ export default {
             //   if (res.data.code == 200) {
             typeSave({
               ...this.form,
-              curExrateList: this.dataList
+              curExrateList: this.dataList,
             })
-              .then(res => {
+              .then((res) => {
                 this.$message.success("保存成功");
                 this.getDetail(res.data.data.id);
               })
@@ -472,9 +537,9 @@ export default {
           } else {
             typeSave({
               ...this.form,
-              curExrateList: this.dataList
+              curExrateList: this.dataList,
             })
-              .then(res => {
+              .then((res) => {
                 this.$message.success("保存成功");
                 this.getDetail(res.data.data.id);
               })
@@ -488,8 +553,8 @@ export default {
       });
     },
     openEdit() {
-      this.$set(this.detailData, 'status', 2)
-      this.$set(this.option, 'disabled', false)
+      this.$set(this.detailData, "status", 2);
+      this.$set(this.option, "disabled", false);
       // const data = {
       //   moduleName: "xxb",
       //   tableName: "primary_school",
@@ -517,7 +582,7 @@ export default {
           moduleName: "xxb",
           tableName: "primary_school",
           billId: this.form.id,
-          billNo: this.form.exrateYear + "-" + this.form.moon
+          billNo: this.form.exrateYear + "-" + this.form.moon,
         });
       }
       this.$emit("goBack");
@@ -531,9 +596,9 @@ export default {
           this.toggleForm();
           const loading = this.$loading({
             lock: true,
-            text: '加载中',
-            spinner: 'el-icon-loading',
-            background: 'rgba(255,255,255,0.7)'
+            text: "加载中",
+            spinner: "el-icon-loading",
+            background: "rgba(255,255,255,0.7)",
           });
           // 拿有id 的数据
           // let arrId = []
@@ -548,9 +613,9 @@ export default {
           if (this.form.paritiesType == "年汇率") {
             const loading = this.$loading({
               lock: true,
-              text: '加载中',
-              spinner: 'el-icon-loading',
-              background: 'rgba(255,255,255,0.7)'
+              text: "加载中",
+              spinner: "el-icon-loading",
+              background: "rgba(255,255,255,0.7)",
             });
             this.form.exrateMonth = "";
             const data = {
@@ -562,25 +627,27 @@ export default {
               code: this.form.code,
               cnName: this.form.cnName,
               enName: this.form.enName,
-              type: this.form.paritiesType
+              type: this.form.paritiesType,
             };
             this.dataList.push(data);
             typeSave({
               ...this.form,
-              curExrateList: this.dataList
-            }).then(res => {
-              this.$message.success("操作成功");
-              this.getDetail(res.data.data.id);
-            }).finally(() => {
-              this.loadingBtn = false;
-              loading.close();
-            });
+              curExrateList: this.dataList,
+            })
+              .then((res) => {
+                this.$message.success("操作成功");
+                this.getDetail(res.data.data.id);
+              })
+              .finally(() => {
+                this.loadingBtn = false;
+                loading.close();
+              });
           } else if (this.form.paritiesType == "月汇率") {
             const loading = this.$loading({
               lock: true,
-              text: '加载中',
-              spinner: 'el-icon-loading',
-              background: 'rgba(255,255,255,0.7)'
+              text: "加载中",
+              spinner: "el-icon-loading",
+              background: "rgba(255,255,255,0.7)",
             });
             this.form.exrateMonth = "";
             for (let i = 1; i <= 12; i++) {
@@ -595,26 +662,28 @@ export default {
                 code: this.form.code,
                 cnName: this.form.cnName,
                 enName: this.form.enName,
-                type: this.form.paritiesType
+                type: this.form.paritiesType,
               };
               this.dataList.push(data);
             }
             typeSave({
               ...this.form,
-              curExrateList: this.dataList
-            }).then(res => {
-              this.$message.success("操作成功");
-              this.getDetail(res.data.data.id);
-            }).finally(() => {
-              this.loadingBtn = false;
-              loading.close();
-            });
+              curExrateList: this.dataList,
+            })
+              .then((res) => {
+                this.$message.success("操作成功");
+                this.getDetail(res.data.data.id);
+              })
+              .finally(() => {
+                this.loadingBtn = false;
+                loading.close();
+              });
           } else if (this.form.paritiesType == "日汇率") {
             const loading = this.$loading({
               lock: true,
-              text: '加载中',
-              spinner: 'el-icon-loading',
-              background: 'rgba(255,255,255,0.7)'
+              text: "加载中",
+              spinner: "el-icon-loading",
+              background: "rgba(255,255,255,0.7)",
             });
             const days = this.getCountDays(this.form.annual, this.form.moon);
             for (let i = 1; i <= days; i++) {
@@ -636,14 +705,16 @@ export default {
             }
             typeSave({
               ...this.form,
-              curExrateList: this.dataList
-            }).then(res => {
-              this.$message.success("操作成功");
-              this.getDetail(res.data.data.id);
-            }).finally(() => {
-              this.loadingBtn = false;
-              loading.close();
-            });
+              curExrateList: this.dataList,
+            })
+              .then((res) => {
+                this.$message.success("操作成功");
+                this.getDetail(res.data.data.id);
+              })
+              .finally(() => {
+                this.loadingBtn = false;
+                loading.close();
+              });
           }
         }
       });
@@ -671,12 +742,12 @@ export default {
     // 更改表格颜色
     headerClassName(tab) {
       //颜色间隔
-      let back = ""
+      let back = "";
       if (tab.columnIndex >= 0 && tab.column.level === 1) {
         if (tab.columnIndex % 2 === 0) {
-          back = "back-one"
+          back = "back-one";
         } else if (tab.columnIndex % 2 === 1) {
-          back = "back-two"
+          back = "back-two";
         }
       }
       return back;
@@ -692,31 +763,30 @@ export default {
           type: row,
           code: this.form.code,
           exrateYear: this.form.annual,
-
-        }
+        };
         if (row == "日汇率") {
           this.findObject(this.option.column, "moon").display = true;
-          this.search.annual = this.form.annual
-          this.search.moon = this.form.moon
-          this.search.paritiesType = row
+          this.search.annual = this.form.annual;
+          this.search.moon = this.form.moon;
+          this.search.paritiesType = row;
           // this.searchChange(this.search)
           // console.log("日汇率", this.search)
           // this.findObject(this.option.column, "annual").display = false;
         } else if (row == "月汇率") {
           this.findObject(this.option.column, "moon").display = false;
-          this.search.annual = this.form.annual
-          this.search.moon = null
-          this.form.moon=null
-          this.search.paritiesType = row
+          this.search.annual = this.form.annual;
+          this.search.moon = null;
+          this.form.moon = null;
+          this.search.paritiesType = row;
           // this.searchChange(this.search)
           // console.log("月汇率", this.search)
           // this.findObject(this.option.column, "annual").display = false;
         } else {
           // this.findObject(this.option.column, "moon").display = false;
-          this.search.annual = this.form.annual
-          this.search.moon = null
-          this.form.moon=null
-          this.search.paritiesType = row
+          this.search.annual = this.form.annual;
+          this.search.moon = null;
+          this.form.moon = null;
+          this.search.paritiesType = row;
           // this.searchChange(this.search)
           // console.log("年汇率", this.search)
           // this.findObject(this.option.column, "annual").display = true;
@@ -724,12 +794,12 @@ export default {
 
         if (this.form.code) {
           // 查明细信息
-          obj={...obj,...this.search}
-          this.searchChange(obj)
+          obj = { ...obj, ...this.search };
+          this.searchChange(obj);
         }
       },
       deep: false, // 深度监听
-      immediate: false  // 第一次改变就执行
+      immediate: false, // 第一次改变就执行
     },
     // "form.annual": {
     //   // 执行方法
@@ -755,24 +825,22 @@ export default {
     // },
     "search.paritiesType": {
       handler(row, newValue) {
-
         if (row == "日汇率") {
           this.findObject(this.optionList.column, "moon").search = true;
           // this.findObject(this.option.column, "annual").display = false;
         } else {
           this.findObject(this.optionList.column, "moon").search = false;
-          this.search.moon = ''
+          this.search.moon = "";
           // this.findObject(this.option.column, "annual").display = false;
         }
       },
       deep: false, // 深度监听
-      immediate: false  // 第一次改变就执行
-    }
-  }
+      immediate: false, // 第一次改变就执行
+    },
+  },
 };
 </script>
 
-
 <style lang="scss" scoped>
 .trading-form ::v-deep .el-form-item {
   margin-bottom: 4px !important;

+ 2 - 1
src/views/iosBasicData/rateManagement/js/optionList.js

@@ -34,13 +34,14 @@ export const optionList = {
   editBtn: false,
   delBtn: false,
   menu: true,
-  menuWidth:60,
+  menuWidth:140,
   stripe: true,
   dialogFullscreen: true,
   addRowBtn:false,
   cellBtn:true,
   selection: false,
   rowKey: "id",
+  columnBtn: false,
   column: [{
     label: "币种代码",
     prop: "code",