Browse Source

Merge branch 'dev0.3' into stage

asd26269546 1 year ago
parent
commit
90fac7c200

+ 7 - 3
src/components/byForm/index.vue

@@ -9,11 +9,13 @@
       ref="byForm"
       :disabled="formOption.disabled || false">
       <template v-for="i in formConfig" :key="i.model">
-        
+        <div v-if="i.type == 'title'" class="form-title">
+          {{ i.title }}
+        </div>
         <el-form-item
           :label="i.label"
           :prop="i.prop"
-          v-if="i.isShow || i.isShow == undefined"
+          v-if="i.isShow || i.isShow == undefined && i.type != 'title'"
           :style="
             i.type == 'title'
               ? 'width:100%'
@@ -128,6 +130,7 @@
           <el-radio-group
             v-else-if="i.type == 'radio'"
             v-model="formData[i.prop]"
+            @change="(e) => commonsEmit(e, i)"
             :readonly="i.readonly ? i.readonly : false"
             :disabled="i.disabled ? i.disabled : false">
             <el-radio :border="i.border ? i.border : false" v-for="j in i.data" :key="j.id || j.value" :label="j.id || j.value" name="type">
@@ -307,6 +310,7 @@ const commonsEmitChange = (prop, item) => {
     formData.value[item.prop] = prop.trim();
   }
   if (item.fn) {
+    console.log(proxy.formConfig)
     item.fn(prop);
   }
   emit("update:modelValue", formData.value);
@@ -462,7 +466,7 @@ loadInit();
 .form-title {
   font-size: 14px;
   font-weight: bold;
-  margin-top: 22px;
+  margin: 15px 0;
   color: #333333;
 }
 .by-form .el-form--inline .el-form-item {

+ 2 - 0
src/components/byTable/index.vue

@@ -154,6 +154,8 @@
         v-bind="$attrs"
         v-on="tableEvents"
         row-key="id"
+        lazy
+        :load="load"
         :tree-props="{
           children: 'children',
           hasChildren: 'hasChildren',

+ 171 - 5
src/views/finance/fundManage/accountStatement/index.vue

@@ -9,10 +9,10 @@
         :selectConfig="selectConfig"
         highlight-current-row
         :action-list="[
-          // {
-          //   text: '导出Excel',
-          //   action: () => deriveExcel(),
-          // },
+          {
+            text: '内部转账',
+            action: () => openTransferMoney('add'),
+          },
           {
             text: '退税登记',
             action: () => openModalOne('add'),
@@ -59,7 +59,14 @@
         </template>
       </byTable>
     </div>
-
+    <el-dialog title="内部转账" v-if="transferMoneyModal" v-model="transferMoneyModal" width="600" v-loading="loadingDialog">
+      <byForm :formConfig="transferMoneyConfig" :formOption="formOption" v-model="formData2.data" :rules="rules" ref="transferMoneySubmit">
+      </byForm>
+      <template #footer>
+        <el-button @click="transferMoneyModal = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitForm2()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
     <el-dialog
       :title="modalType == 'add' ? '添加流水' : '编辑流水'"
       v-if="dialogVisible"
@@ -462,6 +469,104 @@ const config = computed(() => {
     },
   ];
 });
+let transferMoneyModal = ref(false);
+const openTransferMoney = () => {
+  transferMoneyModal.value = true;
+};
+const formData2 = reactive({
+  data: {},
+});
+const transferMoneyConfig = computed(() => {
+  return [
+    {
+      label: "转出信息",
+    },
+    {
+      type: "select",
+      prop: "accountManagementId",
+      label: "转出账户",
+      data: accountList.value,
+    },
+    {
+			type: 'selectInput',
+			label: '转出金额',
+      prop: "amount",
+			itemWidth: 60,
+			data: accountCurrency.value,
+			placeholder: '请输入',
+			selectPlaceholder: '币种',
+			selectProp: 'currency',
+		},
+    
+    { 
+      type: "date",
+      prop: "transactionTime",
+      label: "转出时间",
+      itemType: "datetime",
+    },
+    
+    {
+      label: "转入信息",
+    },
+    {
+      type: "select",
+      prop: "inAccountManagementId",
+      label: "转入账户",
+      data: accountList.value,
+    },
+    {
+			type: 'selectInput',
+			label: '转入金额',
+      prop: "inAmount",
+			itemWidth: 60,
+			data: accountCurrency.value,
+			placeholder: '请输入',
+			selectPlaceholder: '币种',
+			selectProp: 'inCurrency',
+		},
+    {
+      label: "其他信息",
+    },
+    {
+			type: 'selectInput',
+			label: '手续费',
+      prop: "commissionAmount",
+			itemWidth: 60,
+			data: accountCurrency.value,
+			placeholder: '请输入',
+			selectPlaceholder: '币种',
+			selectProp: 'commissionCurrency',
+		},
+    
+    {
+      type: "input",
+      prop: "remarks",
+      label: "摘要",
+      itemType: "textarea",
+    },
+  ];
+});
+const transferMoneySubmit = ref(null);
+const submitForm2 = () => {
+  transferMoneySubmit.value.handleSubmit(() => {
+    
+    loadingDialog.value = true;
+    proxy.post("/accountRunningWater/internalTransfer", formData2.data).then(
+      () => {
+        ElMessage({
+          message: modalType.value == "add" ? "转账成功" : "转账成功",
+          type: "success",
+        });
+        transferMoneyModal.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+  });
+};
 const getCurrency = () => {
   return proxy
     .post("/dictTenantData/page", {
@@ -578,6 +683,48 @@ const formConfig = computed(() => {
           label: "合同到账",
         }
       : {},
+      {
+      type: "radio",
+      prop: "isTransaction",
+      label: "是否往来",
+      data: [
+        {
+          label: "是",
+          value: "1",
+        },
+        {
+          label: "否",
+          value: "0",
+        },
+      ],
+      fn: (val) => {
+        formData.data.transactionDeptId = ''
+        formConfig.value[7].data = transactionDepartmentData.value
+      },
+    },
+    {
+      type: "select",
+      prop: "transactionDeptId",
+      label: "往来单位",
+      data: [],
+      isShow: formData.data.isTransaction == "1",
+      isLoad: {
+        //链接
+        url: "transactionDepartment/list?pageNum=1&pageSize=999",
+        method: "get",
+        //返回数据的路径默认返回data
+        resUrl: "data",
+        //参数
+        req: {},
+        //返回数据的key
+        labelKey: "name",
+        //返回数据的value
+        labelVal: "id",
+      },
+      fn: (val) => {
+        console.log(formConfig.value)
+      },
+    },
     {
       type: "title",
       title: "对方信息",
@@ -612,6 +759,20 @@ const formConfig = computed(() => {
     },
   ];
 });
+const transactionDepartmentData = ref([])
+const getTransactionDepartment = () => {
+  return proxy
+    .get("transactionDepartment/list?pageNum=1&pageSize=999", {})
+    .then((res) => {
+      transactionDepartmentData.value = res.data.map((item) => {
+        return {
+          label: item.name,
+          value: item.id,
+        };
+      });
+    });
+};
+getTransactionDepartment()
 const formConfigOne = computed(() => {
   return [
     {
@@ -706,6 +867,10 @@ const rules = ref({
     { required: true, message: "请选择合同是否到账", trigger: "change" },
   ],
   amount: [{ required: true, message: "请输入金额", trigger: "blur" }],
+  inAccountManagementId: [{ required: true, message: "请选择账户", trigger: "change" }],
+  inAmount: [{ required: true, message: "请输入金额", trigger: "blur" }],
+  isTransaction: [{ required: true, message: "请选择是否往来", trigger: "change" }],
+  transactionDeptId: [{ required: true, message: "请选择往来单位", trigger: "change" }],
   // name: [{ required: true, message: "请输入账户名称", trigger: "blur" }],
   // openingBank: [{ required: true, message: "请输入开户银行", trigger: "blur" }],
   // accountOpening: [{ required: true, message: "请输入银行账号", trigger: "blur" }],
@@ -726,6 +891,7 @@ const rulesOne = ref({
 const openModal = (val) => {
   modalType.value = val;
   formData.data = {
+    isTransaction:'1',
     transactionTime: moment().format("yyyy-MM-DD HH:mm:ss"),
   };
   loadingDialog.value = false;

+ 199 - 1
src/views/finance/fundManage/flow/index.vue

@@ -17,6 +17,10 @@
             text: '添加流水',
             action: () => openModal('add'),
           },
+          {
+            text: '内部转账',
+            action: () => openTransferMoney('add'),
+          },
         ]"
         @moreSearch="moreSearch"
         @get-list="getList">
@@ -96,7 +100,14 @@
         <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
       </template>
     </el-dialog>
-
+    <el-dialog title="内部转账" v-if="transferMoneyModal" v-model="transferMoneyModal" width="600" v-loading="loadingDialog">
+      <byForm :formConfig="transferMoneyConfig" :formOption="formOption" v-model="formData2.data" :rules="rules" ref="transferMoneySubmit">
+      </byForm>
+      <template #footer>
+        <el-button @click="transferMoneyModal = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitForm2()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
     <el-dialog title="高级检索" v-if="openSearch" v-model="openSearch" width="600" :before-close="cancelSearch">
       <byForm :formConfig="formSearchConfig" :formOption="formOption" v-model="sourceList.pagination">
         <template #money>
@@ -394,6 +405,10 @@ const getList = async (req) => {
 };
 getDict();
 getList();
+let transferMoneyModal = ref(false);
+const openTransferMoney = () => {
+  transferMoneyModal.value = true;
+};
 const modalType = ref("add");
 const dialogVisible = ref(false);
 const loadingDialog = ref(false);
@@ -405,8 +420,83 @@ const formOption = reactive({
   rules: [],
 });
 const formData = reactive({
+  data: {
+    isTransaction:'1',
+  },
+});
+const formData2 = reactive({
   data: {},
 });
+const transferMoneyConfig = computed(() => {
+  return [
+    {
+      label: "转出信息",
+    },
+    {
+      type: "select",
+      prop: "accountManagementId",
+      label: "转出账户",
+      data: accountList.value,
+    },
+    {
+			type: 'selectInput',
+			label: '转出金额',
+      prop: "amount",
+			itemWidth: 60,
+			data: accountCurrency.value,
+			placeholder: '请输入',
+			selectPlaceholder: '币种',
+			selectProp: 'currency',
+		},
+    
+    { 
+      type: "date",
+      prop: "transactionTime",
+      label: "转出时间",
+      itemType: "datetime",
+    },
+    
+    {
+      label: "转入信息",
+    },
+    {
+      type: "select",
+      prop: "inAccountManagementId",
+      label: "转入账户",
+      data: accountList.value,
+    },
+    {
+			type: 'selectInput',
+			label: '转入金额',
+      prop: "inAmount",
+			itemWidth: 60,
+			data: accountCurrency.value,
+			placeholder: '请输入',
+			selectPlaceholder: '币种',
+			selectProp: 'inCurrency',
+		},
+    {
+      label: "其他信息",
+    },
+    {
+			type: 'selectInput',
+			label: '手续费',
+      prop: "commissionAmount",
+			itemWidth: 60,
+			data: accountCurrency.value,
+			placeholder: '请输入',
+			selectPlaceholder: '币种',
+			selectProp: 'commissionCurrency',
+		},
+    
+    {
+      type: "input",
+      prop: "remarks",
+      label: "摘要",
+      itemType: "textarea",
+    },
+  ];
+});
 const formConfig = computed(() => {
   return [
     {
@@ -441,9 +531,76 @@ const formConfig = computed(() => {
           label: "合同到账",
         }
       : {},
+      // sysUserMenu/list
+    //单选框
+    {
+      type: "radio",
+      prop: "isTransaction",
+      label: "是否往来",
+      data: [
+        {
+          label: "是",
+          value: 1,
+        },
+        {
+          label: "否",
+          value: 0,
+        },
+      ],
+      fn: (val) => {
+        formData.data.transactionDeptId = ''
+        formConfig.value[7].data = transactionDepartmentData.value
+      },
+    },
+    {
+      type: "select",
+      prop: "transactionDeptId",
+      label: "往来单位",
+      data: [],
+      isShow: formData.data.isTransaction == 1,
+      
+    },
+    {
+      type: "input",
+      prop: "name",
+      label: "账户名称",
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "openingBank",
+      label: "开户银行",
+      itemType: "text",
+    },
+    {
+      type: "input",
+      prop: "accountOpening",
+      label: "银行账号",
+      itemType: "text",
+    },
     {
       label: "对方信息",
     },
+    
+    {
+      type: "select",
+      prop: "otherId",
+      label: "对方名称",
+      data: [
+        {
+          label: "客户",
+          value: "10",
+        },
+        {
+          label: "供应商",
+          value: "20",
+        },
+        {
+          label: "其他",
+          value: "30",
+        },
+      ],
+    },
     {
       type: "input",
       prop: "name",
@@ -480,21 +637,62 @@ const rules = ref({
   currency: [{ required: true, message: "请选择币种", trigger: "change" }],
   received: [{ required: true, message: "请选择合同是否到账", trigger: "change" }],
   amount: [{ required: true, message: "请输入金额", trigger: "blur" }],
+  inAccountManagementId: [{ required: true, message: "请选择账户", trigger: "change" }],
+  inAmount: [{ required: true, message: "请输入金额", trigger: "blur" }],
+  isTransaction: [{ required: true, message: "请选择是否往来", trigger: "change" }],
+  transactionDeptId: [{ required: true, message: "请选择往来单位", trigger: "change" }],
   // name: [{ required: true, message: "请输入账户名称", trigger: "blur" }],
   // openingBank: [{ required: true, message: "请输入开户银行", trigger: "blur" }],
   // accountOpening: [{ required: true, message: "请输入银行账号", trigger: "blur" }],
 });
 const openModal = (val) => {
   modalType.value = val;
+  
   formData.data = {
     transactionTime: moment().format("yyyy-MM-DD HH:mm:ss"),
   };
+  console.log(formConfig.value);
   loadingDialog.value = false;
   dialogVisible.value = true;
 };
+const transactionDepartmentData = ref([])
+const getTransactionDepartment = () => {
+  return proxy
+    .get("transactionDepartment/list?pageNum=1&pageSize=999", {})
+    .then((res) => {
+      transactionDepartmentData.value = res.data.map((item) => {
+        return {
+          label: item.name,
+          value: item.id,
+        };
+      });
+    });
+};
+getTransactionDepartment()
 const changeStatus = () => {
   formData.data.received = "";
 };
+const transferMoneySubmit = ref(null);
+const submitForm2 = () => {
+  transferMoneySubmit.value.handleSubmit(() => {
+    
+    loadingDialog.value = true;
+    proxy.post("/accountRunningWater/internalTransfer", formData2.data).then(
+      () => {
+        ElMessage({
+          message: modalType.value == "add" ? "转账成功" : "转账成功",
+          type: "success",
+        });
+        transferMoneyModal.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+  });
+};
 const submitForm = () => {
   submit.value.handleSubmit(() => {
     if (!formData.data.amount || Number(formData.data.amount) == 0) {

+ 66 - 64
src/views/salesMange/saleContract/contract/index.vue

@@ -8,7 +8,7 @@
         :loading="loading"
         :selectConfig="selectConfig"
         highlight-current-row
-        :statConfig='statConfig'
+        :statConfig="statConfig"
         :action-list="[
           {
             text: '创建合同',
@@ -400,30 +400,30 @@ const config = computed(() => {
                 },
               }
             : {},
-          row.issue && row.issue === "0" && row.status == 30
-            ? {
-                attrs: {
-                  label: "下发交接单",
-                  type: "primary",
-                  text: true,
-                },
-                el: "button",
-                click() {
-                  ElMessageBox.confirm("是否确认下发交接单?", "提示", {
-                    confirmButtonText: "确定",
-                    cancelButtonText: "取消",
-                    type: "warning",
-                  }).then(() => {
-                    proxy
-                      .post("/contract/edit", { id: row.id, issue: 1 })
-                      .then(() => {
-                        ElMessage({ message: "下发成功", type: "success" });
-                        getList();
-                      });
-                  });
-                },
-              }
-            : {},
+          // row.issue && row.issue === "0" && row.status == 30
+          //   ? {
+          //       attrs: {
+          //         label: "下发交接单",
+          //         type: "primary",
+          //         text: true,
+          //       },
+          //       el: "button",
+          //       click() {
+          //         ElMessageBox.confirm("是否确认下发交接单?", "提示", {
+          //           confirmButtonText: "确定",
+          //           cancelButtonText: "取消",
+          //           type: "warning",
+          //         }).then(() => {
+          //           proxy
+          //             .post("/contract/edit", { id: row.id, issue: 1 })
+          //             .then(() => {
+          //               ElMessage({ message: "下发成功", type: "success" });
+          //               getList();
+          //             });
+          //         });
+          //       },
+          //     }
+          //   : {},
           row.status == 30
             ? {
                 attrs: {
@@ -575,6 +575,7 @@ const getDict = () => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
+  getTotal()
   proxy.post("/contract/page", sourceList.value.pagination).then((res) => {
     sourceList.value.data = res.rows;
     sourceList.value.pagination.total = res.total;
@@ -584,68 +585,69 @@ const getList = async (req) => {
   });
 };
 const statConfig = computed(() => {
-	return [
-		{
-			label: '合计',
-			data:[],
-		},
-		
-	]
-})
+  return [
+    {
+      label: "合计",
+      data: [],
+    },
+  ];
+});
 getDict();
 if (route.query.code) {
   sourceList.value.pagination.keyword = route.query.code;
 }
-getList();
+onMounted(() => {
+  getList();
+})
 const getTotal = () => {
-  proxy.get("/contract/getHeadCustomerStatistics").then((res) => {
-    statConfig.value[0].data = [];
+  proxy.post("/contract/getHeadCustomerStatistics",sourceList.value.pagination).then((res) => {
+    
     statConfig.value[0].data.push({
-      label:'合计',
-      data:[
+      label: "合计",
+      data: [
         {
-          label:'数量',
-          num:res.data.sumQuantity,
-          color:'rgb(171 0 255)',
+          label: "数量",
+          num: res.sumQuantity,
+          color: "rgb(171 0 255)",
         },
         {
-          label:'金额',
-          num:res.data.sumArrivalAmount,
-          color:'rgb(171 0 255)',
+          label: "金额",
+          num: res.sumArrivalAmount.toFixed(2),
+          color: "rgb(171 0 255)",
         },
         {
-          label:'到账金额',
-          num:res.data.sumAmount,
-          color:'rgb(171 0 255)',
+          label: "到账金额",
+          num: res.sumAmount.toFixed(2),
+          color: "rgb(171 0 255)",
         },
-      ]
-    })
-    for (let i = 0; i < res.data.list.length; i++) {
+      ],
+    });
+    for (let i = 0; i < res.list.length; i++) {
       statConfig.value[0].data.push({
-        label:res.data.list[i].sellCorporationName,
-        data:[
+        label: res.list[i].sellCorporationName,
+        data: [
           {
-            label:'数量',
-            num:res.data.list[i].sumQuantity,
-            color:'blue',
+            label: "数量",
+            num: res.list[i].sumQuantity,
+            color: "blue",
           },
           {
-            label:'金额',
-            num:res.data.list[i].sumClaimMoney,
-            color:'blue',
+            label: "金额",
+            num: res.list[i].sumAmount.toFixed(2),
+            color: "blue",
           },
           {
-            label:'到账金额',
-            num:res.data.list[i].sumClaimMoney,
-            color:'blue',
+            label: "到账金额",
+            num: res.list[i].sumClaimMoney.toFixed(2),
+            color: "blue",
           },
-        ]
-      })
+        ],
+      });
     }
     console.log(res);
   });
 };
-getTotal();
+
 const newContract = () => {
   proxy.$router.replace({
     path: "/platform_manage/process/processApproval",

+ 110 - 43
src/views/salesMange/salesMange/profitSettlement/index.vue

@@ -10,10 +10,7 @@
       :selectConfig="selectConfig"
       highlight-current-row
       :action-list="[
-        {
-          text: '默认汇率',
-          action: () => openModal(),
-        },
+        
       ]"
       @get-list="getList"
     >
@@ -57,39 +54,108 @@
         <el-table-column label="收入(CNY)">
           <el-table-column label="合同到账" width="120">
             <template #default="{ row }">
-              <div>{{ moneyFormat(row.contractArrival, 2) }}</div>
+              <el-popover placement="top" :width="580" trigger="click">
+                <template #reference>
+                  <span class="table-btn">{{ moneyFormat(row.contractArrival, 2) }}</span>
+                </template>
+                <el-table :data="row.claimList">
+                  <el-table-column width="150" property="date" label="认领金额">
+                    <template #default="{ row }">
+                      <div>{{row.currency}} {{ moneyFormat(row.money, 2) }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column width="60" property="rate" label="汇率" />
+                  <el-table-column width="160" property="userName" label="操作人" />
+                  <el-table-column width="190" property="createTime" label="操作时间" />
+                </el-table>
+              </el-popover>
+              
             </template>
           </el-table-column>
           <el-table-column label="退税" width="120">
             <template #default="{ row }">
-              <div>{{ moneyFormat(row.taxReturnMoney, 2) }}</div>
+              <el-popover placement="top" :width="580" trigger="click">
+                <template #reference>
+                  <span class="table-btn">{{moneyFormat(row.taxReturnMoney, 2) }}</span>
+                </template>
+                <el-table :data="row.taxReturnList">
+                  <el-table-column width="150" property="date" label="交易金额">
+                    <template #default="{ row }">
+                      <div>{{row.currency}} {{ moneyFormat(row.amount, 2) }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column width="60" property="rate" label="汇率" />
+                  <el-table-column width="160" property="userName" label="操作人" />
+                  <el-table-column width="190" property="createTime" label="操作时间" />
+                </el-table>
+              </el-popover>
             </template>
           </el-table-column>
           <el-table-column label="其他收入" width="120">
             <template #default="{ row }">
-              <div>{{ moneyFormat(row.otherIncome, 2) }}</div>
+              <el-popover placement="top" :width="580" trigger="click">
+                <template #reference>
+                  <span class="table-btn">{{moneyFormat(row.otherIncome, 2) }}</span>
+                </template>
+                <el-table :data="row.accountRequestFundsDetailList">
+                  <el-table-column width="150" property="date" label="交易金额">
+                    <template #default="{ row }">
+                      <div>{{row.currency}} {{ moneyFormat(row.amount, 2) }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column width="60" property="rate" label="汇率" />
+                  <el-table-column width="160" property="userName" label="操作人" />
+                  <el-table-column width="190" property="createTime" label="操作时间" />
+                </el-table>
+              </el-popover>
             </template>
           </el-table-column>
         </el-table-column>
         <el-table-column label="采购合同金额">
           <el-table-column label="" width="120">
             <template #default="{ row }">
-              <div>
-                <!-- {{ row.currency }} {{ moneyFormat(row.purchaseAmount, 2) }} -->
-                CNY {{ moneyFormat(row.purchaseAmount, 2) }}
-              </div>
+              <el-popover placement="top" :width="580" trigger="click">
+                <template #reference>
+                  <span class="table-btn">CNY {{ moneyFormat(row.purchaseAmount, 2) }}</span>
+                </template>
+                <el-table :data="row.purchaseList">
+                  <el-table-column width="150" property="date" label="交易金额">
+                    <template #default="{ row }">
+                      <div>{{row.currency}} {{ moneyFormat(row.amount, 2) }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column width="60" property="rate" label="汇率" />
+                  <el-table-column width="160" property="purchaseName" label="业务员" />
+                  <el-table-column width="190" property="createTime" label="操作时间" />
+                </el-table>
+              </el-popover>
             </template>
           </el-table-column>
         </el-table-column>
         <el-table-column label="支出(CNY)">
           <el-table-column label="支付货款" width="120">
             <template #default="{ row }">
-              <div>{{ moneyFormat(row.payForGoods, 2) }}</div>
+              <el-popover placement="top" :width="580" trigger="click">
+                <template #reference>
+                  <span class="table-btn">{{ moneyFormat(row.payForGoods, 2) }}</span>
+                </template>
+                <el-table :data="row.payList">
+                  <el-table-column width="150" property="date" label="交易金额">
+                    <template #default="{ row }">
+                      <div>{{row.currency}} {{ moneyFormat(row.amount, 2) }}</div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column width="60" property="rate" label="汇率" />
+                  <el-table-column width="160" property="userName" label="操作人" />
+                  <el-table-column width="190" property="createTime" label="操作时间" />
+                </el-table>
+              </el-popover>
             </template>
           </el-table-column>
           <el-table-column label="其他支出" width="120">
             <template #default="{ row }">
-              <div>{{ moneyFormat(row.otherExpenses, 2) }}</div>
+              
+              <div class="table-btn">{{ moneyFormat(row.otherExpenses, 2) }}</div>
             </template>
           </el-table-column>
         </el-table-column>
@@ -544,42 +610,39 @@ const changeExchangeRate = (row) => {
   openChange.value = true;
   if (row.currencyRateJson) {
     let currencyRateJson = JSON.parse(row.currencyRateJson);
-    formChangeData.data.list = formChangeData.data.list.map((item) => {
-      for (let i = 0; i < currencyRateJson.length; i++) {
-        if (item.type === currencyRateJson[i].type) {
-          item.rate = currencyRateJson[i].rate;
+    //row.currencyList和currencyRateJson进行匹配
+    for (let i = 0; i < row.currencyList.length; i++) {
+      const element = row.currencyList[i];
+      for (let j = 0; j < currencyRateJson.length; j++) {
+        const jelement = currencyRateJson[j];
+        if(element.id == jelement.id){
+          element.rate = jelement.rate;
           break;
         }
       }
-      return {
-        ...item,
-      };
-    });
+    }
+    
+    formChangeData.data.list = row.currencyList
+    // formChangeData.data.list = formChangeData.data.list.map((item) => {
+    //   for (let i = 0; i < currencyRateJson.length; i++) {
+    //     if (item.type === currencyRateJson[i].type) {
+    //       item.rate = currencyRateJson[i].rate;
+    //       break;
+    //     }
+    //   }
+    //   return {
+    //     ...item,
+    //   }; 
+    // });
+    console.log(row.currencyList)
     loadingDialog.value = false;
   } else {
-    proxy.post("/currencyRate/list", {}).then(
-      (res) => {
-        if (res && res.length > 0 && formChangeData.data.list.length > 0) {
-          formChangeData.data.list = formChangeData.data.list.map((item) => {
-            for (let i = 0; i < res.length; i++) {
-              if (item.type === res[i].type) {
-                item.rate = res[i].rate;
-                break;
-              }
-            }
-            return {
-              ...item,
-            };
-          });
-        }
-        loadingDialog.value = false;
-      },
-      (err) => {
-        console.log(err);
-        loadingDialog.value = false;
-      }
-    );
+    formChangeData.data = {
+      id: row.contractId,
+      list: row.currencyList,
+    };
   }
+  loadingDialog.value = false
 };
 const submitChangeForm = () => {
   change.value.handleSubmit(() => {
@@ -653,4 +716,8 @@ const openDetails = (row) => {
 ::v-deep(.el-input-number .el-input__inner) {
   text-align: left;
 }
+.table-btn{
+  cursor: pointer;
+  color: #409EFF;
+}
 </style>

+ 197 - 0
src/views/system/addressConfig/index copy.vue

@@ -0,0 +1,197 @@
+<template>
+    <div class="app-container">
+    <el-table
+      :data="tableData"
+      style="width: 100%"
+      row-key="id"
+      border
+      lazy
+      :load="load"
+      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
+    >
+      <el-table-column prop="chineseName" label="中文名" />
+      <el-table-column prop="name" label="名称" />
+      <el-table-column prop="address" label="操作">
+        <template #default="scope">
+            <el-button size="small" @click="handleEdit(scope.$index, scope.row)"
+            >修改</el-button
+            >
+            <el-button
+            size="small"
+            type="danger"
+            @click="handleDelete(scope.$index, scope.row)"
+            >删除</el-button
+            >
+        </template>
+      </el-table-column>
+    </el-table>
+ 
+       <pagination
+          v-show="total > 0"
+          :total="total"
+          v-model:page="queryParams.pageNum"
+          v-model:limit="queryParams.pageSize"
+          @pagination="getList"
+       />
+    </div>
+ </template>
+ 
+ <script setup name="Config">
+ import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config";
+ 
+ const { proxy } = getCurrentInstance();
+ const { sys_yes_no } = proxy.useDict("sys_yes_no");
+ 
+ const configList = ref([]);
+ const open = ref(false);
+ const loading = ref(true);
+ const showSearch = ref(true);
+ const ids = ref([]);
+ const single = ref(true);
+ const multiple = ref(true);
+ const total = ref(0);
+ const title = ref("");
+ const dateRange = ref([]);
+ 
+ const data = reactive({
+   form: {},
+   queryParams: {
+     pageNum: 1,
+     pageSize: 10,
+     configName: undefined,
+     configKey: undefined,
+     configType: undefined
+   },
+   rules: {
+     configName: [{ required: true, message: "参数名称不能为空", trigger: "blur" }],
+     configKey: [{ required: true, message: "参数键名不能为空", trigger: "blur" }],
+     configValue: [{ required: true, message: "参数键值不能为空", trigger: "blur" }]
+   }
+ });
+ let tableData = ref([]);
+ const { queryParams, form, rules } = toRefs(data);
+ 
+ const load = (row, treeNode, resolve) => {
+   console.log(row, treeNode, resolve)
+   proxy.post('/customizeArea/list',{parentId:row.id}).then(res=>{
+    console.log(res)
+    resolve(
+        res.map(item=>{
+            return {
+             ...item,
+             hasChildren:true,
+            }
+        })
+    )
+   })
+ };
+
+ /** 查询参数列表 */
+ function getList() {
+   loading.value = true;
+   proxy.post('/customizeArea/page',{parentId:0,pageNum:1,pageSize:10,}).then(res=>{
+     console.log(res)
+     tableData.value = res.rows.map(item=>{
+       return {
+        ...item,
+        hasChildren:true,
+       }
+     })
+   })
+ }
+ /** 取消按钮 */
+ function cancel() {
+   open.value = false;
+   reset();
+ }
+ /** 表单重置 */
+ function reset() {
+   form.value = {
+     configId: undefined,
+     configName: undefined,
+     configKey: undefined,
+     configValue: undefined,
+     configType: "Y",
+     remark: undefined
+   };
+   proxy.resetForm("configRef");
+ }
+ /** 搜索按钮操作 */
+ function handleQuery() {
+   queryParams.value.pageNum = 1;
+   getList();
+ }
+ /** 重置按钮操作 */
+ function resetQuery() {
+   dateRange.value = [];
+   proxy.resetForm("queryRef");
+   handleQuery();
+ }
+ /** 多选框选中数据 */
+ function handleSelectionChange(selection) {
+   ids.value = selection.map(item => item.configId);
+   single.value = selection.length != 1;
+   multiple.value = !selection.length;
+ }
+ /** 新增按钮操作 */
+ function handleAdd() {
+   reset();
+   open.value = true;
+   title.value = "添加参数";
+ }
+ /** 修改按钮操作 */
+ function handleUpdate(row) {
+   reset();
+   const configId = row.configId || ids.value;
+   getConfig(configId).then(response => {
+     form.value = response.data;
+     open.value = true;
+     title.value = "修改参数";
+   });
+ }
+ /** 提交按钮 */
+ function submitForm() {
+   proxy.$refs["configRef"].validate(valid => {
+     if (valid) {
+       if (form.value.configId != undefined) {
+         updateConfig(form.value).then(response => {
+           proxy.$modal.msgSuccess("修改成功");
+           open.value = false;
+           getList();
+         });
+       } else {
+         addConfig(form.value).then(response => {
+           proxy.$modal.msgSuccess("新增成功");
+           open.value = false;
+           getList();
+         });
+       }
+     }
+   });
+ }
+ /** 删除按钮操作 */
+ function handleDelete(row) {
+   const configIds = row.configId || ids.value;
+   proxy.$modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?').then(function () {
+     return delConfig(configIds);
+   }).then(() => {
+     getList();
+     proxy.$modal.msgSuccess("删除成功");
+   }).catch(() => {});
+ }
+ /** 导出按钮操作 */
+ function handleExport() {
+   proxy.download("system/config/export", {
+     ...queryParams.value
+   }, `config_${new Date().getTime()}.xlsx`);
+ }
+ /** 刷新缓存按钮操作 */
+ function handleRefreshCache() {
+   refreshCache().then(() => {
+     proxy.$modal.msgSuccess("刷新缓存成功");
+   });
+ }
+ 
+ getList();
+ </script>
+ 

+ 342 - 0
src/views/system/addressConfig/index.vue

@@ -0,0 +1,342 @@
+<template>
+  <div class="addressConfig"  v-loading="loading">
+    <el-table
+      :data="tableData"
+      style="width: 100%"
+      row-key="id"
+      lazy
+      :load="load"
+      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
+    >
+      <el-table-column prop="chineseName" label="中文名" />
+      <el-table-column prop="name" label="名称" />
+      <el-table-column prop="address" label="操作">
+        <template #default="scope">
+            <el-button size="small" @click="addAddress(scope.row,'add')">
+              新增
+            </el-button>
+            <el-button size="small" @click="addAddress(scope.row,'edit')"
+            >修改</el-button>
+            <el-button
+            size="small"
+            type="danger"
+            @click="handleDelete(scope.$index, scope.row)"
+            >删除</el-button
+            >
+        </template>
+      </el-table-column>
+    </el-table>
+    <div style="display: flex;margin-top:20px;" >
+      <el-pagination 
+      style="text-align: center;margin: 0 auto;" 
+      :page-size="10" layout="prev, pager, next" 
+      :current-page="queryParams.pageNum" 
+      :total="total" 
+      @current-change="changePage" />
+    </div>
+    <el-dialog
+      :title="modalType == 'add' ? '添加地址' : '编辑地址'"
+      v-if="dialogVisible"
+      v-model="dialogVisible"
+      width="600"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="submit"
+        v-loading="loadingDialog"
+      >
+        
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="large"
+          >确 定</el-button
+        >
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup name="Config">
+import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config";
+import byForm from "@/components/byForm";
+import { ElMessage, ElMessageBox } from "element-plus"; 
+const { proxy } = getCurrentInstance();
+const { sys_yes_no } = proxy.useDict("sys_yes_no");
+
+const configList = ref([]);
+const open = ref(false);
+const loading = ref(true);
+const showSearch = ref(true);
+const ids = ref([]);
+const single = ref(true);
+const multiple = ref(true);
+const total = ref(0);
+const title = ref("");
+const dateRange = ref([]);
+
+const data = reactive({
+ form: {},
+ queryParams: {
+   pageNum: 1,
+   pageSize: 10,
+   configName: undefined,
+   configKey: undefined,
+   configType: undefined
+ },
+ rules: {
+   configName: [{ required: true, message: "参数名称不能为空", trigger: "blur" }],
+   configKey: [{ required: true, message: "参数键名不能为空", trigger: "blur" }],
+   configValue: [{ required: true, message: "参数键值不能为空", trigger: "blur" }]
+ }
+});
+let tableData = ref([]);
+const { queryParams, form, rules } = toRefs(data);
+
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const formData = reactive({
+  data: {},
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "parentName",
+      label: "父级名称",
+      disabled: true,
+      isShow:modalType.value == 'add'
+    },
+    {
+      type: "input",
+      prop: "name",
+      label: "名称",
+    },
+    {
+      type: "input",
+      prop: "chineseName",
+      label: "中文名",
+    },
+    {
+      type: "select",
+      prop: "levelCode",
+      label: "层级",
+      data:[
+        {
+          label:'国家',
+          value:1
+        },
+        {
+          label:'省份/洲',
+          value:2
+        },
+        {
+          label:'市区',
+          value:3
+        }
+      ]
+    },
+    {
+      type: "input",
+      prop: "code",
+      label: "地区代码",
+    },
+    
+  ];
+});
+
+const load = (row, treeNode, resolve) => {
+ console.log(row, treeNode, resolve)
+ proxy.post('/customizeArea/list',{parentId:row.id}).then(res=>{
+  console.log(res)
+  resolve(
+      res.map(item=>{
+          return {
+           ...item,
+           hasChildren:true,
+          }
+      })
+  )
+ })
+};
+
+const changePage = (val) => {
+ queryParams.value.pageNum = val;
+ getList();
+};
+
+/** 查询参数列表 */
+function getList() {
+ loading.value = true;
+ proxy.post('/customizeArea/page',data.queryParams).then(res=>{
+   console.log(res)
+   tableData.value = res.rows.map(item=>{
+     return {
+      ...item,
+      hasChildren:true,
+     }
+   })
+   total.value = res.total;
+   setTimeout(() => {
+     loading.value = false;
+   }, 200);
+ })
+}
+/** 取消按钮 */
+function cancel() {
+ open.value = false;
+ reset();
+}
+const dialogVisible = ref(false);
+const modalType = ref('add');
+const loadingDialog = ref(false);
+
+const addAddress = (row,type) => {
+  console.log(row)
+  
+  modalType.value = type;
+  if(type == 'edit') {
+    formData.data = {
+      ...row,
+      chinese_name:row.chineseName || row.chinese_name,
+      level_code:row.levelCode || row.level_code,
+    }
+    console.log(formData.data)
+  }else{
+    formData.data = {
+      parentName:row.name,
+      parentId:row.id,
+      name:undefined,
+      chineseName:undefined,
+      address:undefined,
+    }
+  }
+  dialogVisible.value = true;
+  
+}
+
+/** 表单重置 */
+function reset() {
+ form.value = {
+   configId: undefined,
+   configName: undefined,
+   configKey: undefined,
+   configValue: undefined,
+   configType: "Y",
+   remark: undefined
+ };
+ proxy.resetForm("configRef");
+}
+/** 搜索按钮操作 */
+function handleQuery() {
+ queryParams.value.pageNum = 1;
+ getList();
+}
+/** 重置按钮操作 */
+function resetQuery() {
+ dateRange.value = [];
+ proxy.resetForm("queryRef");
+ handleQuery();
+}
+/** 多选框选中数据 */
+function handleSelectionChange(selection) {
+ ids.value = selection.map(item => item.configId);
+ single.value = selection.length != 1;
+ multiple.value = !selection.length;
+}
+/** 新增按钮操作 */
+function handleAdd() {
+ reset();
+ open.value = true;
+ title.value = "添加参数";
+}
+/** 修改按钮操作 */
+function handleUpdate(row) {
+ reset();
+ const configId = row.configId || ids.value;
+ getConfig(configId).then(response => {
+   form.value = response.data;
+   open.value = true;
+   title.value = "修改参数";
+ });
+}
+const submit = ref(null);
+/** 提交按钮 */
+const submitForm = () => {
+  submit.value.handleSubmit(() => {
+    loadingDialog.value = true;
+    proxy.post("/customizeArea/" + modalType.value, formData.data).then(
+      () => {
+        ElMessage({
+          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        tableData.value = []
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+  });
+};
+/** 删除按钮操作 */
+function handleDelete(row) {
+  ElMessageBox.confirm(
+    "此操作将永久删除该数据, 是否继续?",
+    "提示",
+    {
+      confirmButtonText: "确定",
+      cancelButtonText: "取消",
+      type: "warning",
+    }
+  ).then(() => {
+    proxy
+      .post("/customizeArea/delete", {
+        id: row.id,
+      })
+      .then(() => {
+        ElMessage({
+          message: "删除成功",
+          type: "success",
+        });
+        tableData.value = []
+        getList();
+      });
+  });
+}
+/** 导出按钮操作 */
+function handleExport() {
+ proxy.download("system/config/export", {
+   ...queryParams.value
+ }, `config_${new Date().getTime()}.xlsx`);
+}
+/** 刷新缓存按钮操作 */
+function handleRefreshCache() {
+ refreshCache().then(() => {
+   proxy.$modal.msgSuccess("刷新缓存成功");
+ });
+}
+
+getList();
+</script>
+<style>
+  .addressConfig{
+    background: #fff;
+    padding: 20px;
+    border-radius: 5px;
+    margin: 20px;
+  }
+  .pagination-container{
+    overflow: hidden;
+  }
+</style>