瀏覽代碼

更改资金流水的功能

cz 1 年之前
父節點
當前提交
9b392d5373

+ 1 - 0
package.json

@@ -34,6 +34,7 @@
     "axios": "0.27.2",
     "crypto-js": "^4.1.1",
     "echarts": "^5.4.0",
+    "echarts-gl": "^2.0.9",
     "element-plus": "2.2.27",
     "file-saver": "^2.0.5",
     "fuse.js": "6.6.2",

+ 73 - 50
src/components/process/EHSD/Contract.vue

@@ -966,6 +966,8 @@ import SelectContract from "@/components/contractCom/selectContract.vue";
 import SelectSample from "@/components/contractCom/selectSample.vue";
 import useUserStore from "@/store/modules/user";
 import { nextTick, watch } from "vue";
+import { v4 as uuidv4 } from "uuid";
+
 const userInfo = useUserStore();
 
 const route = useRoute();
@@ -1507,12 +1509,13 @@ const handlePerson = (item) => {
 
 const selectProduct = (goods) => {
   if (goods && goods.id) {
-    let data = formData.data.contractProductList.filter(
-      (item) => item.productId === goods.id
-    );
-    if (data && data.length > 0) {
-      return ElMessage("该产品已添加");
-    }
+    // let data = formData.data.contractProductList.filter(
+    //   (item) => item.productId === goods.id
+    // );
+    // if (data && data.length > 0) {
+    //   return ElMessage("该产品已添加");
+    // }
+    let rowId = uuidv4();
     let fileUrl = "";
     if (goods.fileList && goods.fileList.length > 0) {
       fileUrl = goods.fileList[0].fileUrl;
@@ -1546,6 +1549,7 @@ const selectProduct = (goods) => {
     ) {
       formData.data.contractProductList.push({
         fileUrl: fileUrl,
+        rowId,
         productId: goods.id,
         productCnName: goods.name,
         productName: goods.nameEnglish,
@@ -1561,6 +1565,7 @@ const selectProduct = (goods) => {
       formData.data.contractProductList = [
         {
           fileUrl: fileUrl,
+          rowId,
           productId: goods.id,
           productCnName: goods.name,
           productName: goods.nameEnglish,
@@ -1581,18 +1586,12 @@ const selectProduct = (goods) => {
     //左侧待出货列表
     formData.data.contractWaitShipmentList.push({
       productCode: goods.code,
+      rowId,
       productId: goods.id,
       productName: goods.nameEnglish,
       quantity: null,
       waitQuantity: "",
     });
-    // formData.data.contractShipmentList.push({
-    //   productCode: goods.code,
-    //   productId: goods.id,
-    //   productName: goods.nameEnglish,
-    //   shipmentTime: "",
-    //   quantity: null,
-    // });
     ElMessage({
       message: "添加成功!",
       type: "success",
@@ -1608,11 +1607,11 @@ const onPicture = (path) => {
 const handleRemove = async (index, row) => {
   formData.data.contractShipmentList =
     formData.data.contractShipmentList.filter(
-      (item) => item.productId !== row.productId
+      (item) => item.rowId !== row.rowId
     );
   formData.data.contractWaitShipmentList =
     formData.data.contractWaitShipmentList.filter(
-      (item) => item.productId !== row.productId
+      (item) => item.rowId !== row.rowId
     );
   await formData.data.contractProductList.splice(index, 1);
   totalAmount();
@@ -1747,18 +1746,21 @@ const handleSubmit = async () => {
       formData.data.contractShipmentList.length > 0
     ) {
       for (let i = 0; i < formData.data.contractProductList.length; i++) {
-        let data = formData.data.contractShipmentList.filter(
-          (item) =>
-            item.productId === formData.data.contractProductList[i].productId
-        );
-        if (data && data.length > 0) {
-          let quantity = 0;
-          for (let j = 0; j < data.length; j++) {
-            quantity = parseFloat(Number(quantity) + Number(data[j].quantity));
-          }
-          if (quantity > formData.data.contractProductList[i].quantity) {
-            ElMessage("出货数量不能大于商品数量");
-            return false;
+        if (formData.data.contractProductList[i].rowId) {
+          let data = formData.data.contractShipmentList.filter(
+            (item) => item.rowId === formData.data.contractProductList[i].rowId
+          );
+          if (data && data.length > 0) {
+            let quantity = 0;
+            for (let j = 0; j < data.length; j++) {
+              quantity = parseFloat(
+                Number(quantity) + Number(data[j].quantity)
+              );
+            }
+            if (quantity > formData.data.contractProductList[i].quantity) {
+              ElMessage("出货数量不能大于商品数量");
+              return false;
+            }
           }
         }
       }
@@ -1925,6 +1927,7 @@ onMounted(() => {
       ) {
         for (let i = 0; i < formData.data.contractProductList.length; i++) {
           const e = formData.data.contractProductList[i];
+          e.rowId = uuidv4();
           if (e.ehsdJson) {
             let obj = JSON.parse(e.ehsdJson);
             e.packMethod = obj.packMethod;
@@ -1950,6 +1953,19 @@ onMounted(() => {
             }
           });
       }
+      if (route.query.processType == 30) {
+        formData.data.contractWaitShipmentList =
+          formData.data.contractProductList.map((x) => ({
+            productCode: x.productCode,
+            rowId: x.rowId,
+            productId: x.productId,
+            productName: x.productName,
+            quantity: 0,
+            waitQuantity: "",
+          }));
+        changeWaitQuantity();
+        formData.data.contractShipmentList = [];
+      }
       if (formData.data.countryId) {
         getCityData(formData.data.countryId, "20");
       }
@@ -2136,6 +2152,7 @@ const selectContract = (businessId) => {
         ) {
           for (let i = 0; i < formData.data.contractProductList.length; i++) {
             const e = formData.data.contractProductList[i];
+            e.rowId = uuidv4();
             delete e.id;
             delete e.contractId;
             if (e.ehsdJson) {
@@ -2147,6 +2164,7 @@ const selectContract = (businessId) => {
           formData.data.contractWaitShipmentList =
             formData.data.contractProductList.map((x) => ({
               productCode: x.productCode,
+              rowId: x.rowId,
               productId: x.productId,
               productName: x.productName,
               quantity: 0,
@@ -2188,17 +2206,18 @@ const selectContract = (businessId) => {
               return x;
             });
         }
-        if (
-          formData.data.contractShipmentList &&
-          formData.data.contractShipmentList.length > 0
-        ) {
-          formData.data.contractShipmentList =
-            formData.data.contractShipmentList.map((x) => {
-              delete x.id;
-              delete x.contractId;
-              return x;
-            });
-        }
+        formData.data.contractShipmentList = [];
+        // if (
+        //   formData.data.contractShipmentList &&
+        //   formData.data.contractShipmentList.length > 0
+        // ) {
+        //   formData.data.contractShipmentList =
+        //     formData.data.contractShipmentList.map((x) => {
+        //       delete x.id;
+        //       delete x.contractId;
+        //       return x;
+        //     });
+        // }
         if (formData.data.countryId) {
           getCityData(formData.data.countryId, "20");
         }
@@ -2266,6 +2285,7 @@ const selectContract = (businessId) => {
         ) {
           for (let i = 0; i < formData.data.contractProductList.length; i++) {
             const e = formData.data.contractProductList[i];
+            e.rowId = uuidv4();
             if (e.ehsdJson) {
               let obj = JSON.parse(e.ehsdJson);
               e.packMethod = obj.packMethod;
@@ -2276,6 +2296,7 @@ const selectContract = (businessId) => {
           formData.data.contractWaitShipmentList =
             formData.data.contractProductList.map((x) => ({
               productCode: x.productCode,
+              rowId: x.rowId,
               productId: x.productId,
               productName: x.productName,
               quantity: 0,
@@ -2318,17 +2339,18 @@ const selectContract = (businessId) => {
               return x;
             });
         }
-        if (
-          formData.data.contractShipmentList &&
-          formData.data.contractShipmentList.length > 0
-        ) {
-          formData.data.contractShipmentList =
-            formData.data.contractShipmentList.map((x) => {
-              delete x.id;
-              delete x.sampleId;
-              return x;
-            });
-        }
+        formData.data.contractShipmentList = [];
+        // if (
+        //   formData.data.contractShipmentList &&
+        //   formData.data.contractShipmentList.length > 0
+        // ) {
+        //   formData.data.contractShipmentList =
+        //     formData.data.contractShipmentList.map((x) => {
+        //       delete x.id;
+        //       delete x.sampleId;
+        //       return x;
+        //     });
+        // }
 
         if (formData.data.countryId) {
           getCityData(formData.data.countryId, "20");
@@ -2368,6 +2390,7 @@ const handleAddShipment = () => {
       for (let i = 0; i < selectShipmentData.value.length; i++) {
         const e = selectShipmentData.value[i];
         formData.data.contractShipmentList.push({
+          rowId: e.rowId,
           productId: e.productId,
           productCode: e.productCode,
           productName: e.productName,
@@ -2401,7 +2424,7 @@ const changeWaitQuantity = () => {
     for (let i = 0; i < formData.data.contractWaitShipmentList.length; i++) {
       const e = formData.data.contractWaitShipmentList[i];
       let arr = formData.data.contractShipmentList.filter(
-        (x) => x.productId === e.productId
+        (x) => x.rowId === e.rowId
       );
       let quantity = 0;
       for (let j = 0; j < arr.length; j++) {

+ 59 - 40
src/components/process/EHSD/ContractChange.vue

@@ -934,6 +934,8 @@ import { ElMessage } from "element-plus";
 import selectCity from "@/components/selectCity/index.vue";
 import { useRoute } from "vue-router";
 import useUserStore from "@/store/modules/user";
+import { v4 as uuidv4 } from "uuid";
+
 const userInfo = useUserStore();
 const showAllData = ref(true);
 const route = useRoute();
@@ -1461,12 +1463,13 @@ const handlePerson = (item) => {
 
 const selectProduct = (goods) => {
   if (goods && goods.id) {
-    let data = formData.data.contractProductList.filter(
-      (item) => item.productId === goods.id
-    );
-    if (data && data.length > 0) {
-      return ElMessage("该产品已添加");
-    }
+    // let data = formData.data.contractProductList.filter(
+    //   (item) => item.productId === goods.id
+    // );
+    // if (data && data.length > 0) {
+    //   return ElMessage("该产品已添加");
+    // }
+    let rowId = uuidv4();
     let fileUrl = "";
     if (goods.fileList && goods.fileList.length > 0) {
       fileUrl = goods.fileList[0].fileUrl;
@@ -1500,6 +1503,7 @@ const selectProduct = (goods) => {
     ) {
       formData.data.contractProductList.push({
         fileUrl: fileUrl,
+        rowId,
         productId: goods.id,
         productCnName: goods.name,
         productName: goods.nameEnglish,
@@ -1515,6 +1519,7 @@ const selectProduct = (goods) => {
       formData.data.contractProductList = [
         {
           fileUrl: fileUrl,
+          rowId,
           productId: goods.id,
           productCnName: goods.name,
           productName: goods.nameEnglish,
@@ -1535,18 +1540,12 @@ const selectProduct = (goods) => {
     //左侧待出货列表
     formData.data.contractWaitShipmentList.push({
       productCode: goods.code,
+      rowId,
       productId: goods.id,
       productName: goods.nameEnglish,
       quantity: null,
       waitQuantity: "",
     });
-    // formData.data.contractShipmentList.push({
-    //   productCode: goods.code,
-    //   productId: goods.id,
-    //   productName: goods.nameEnglish,
-    //   shipmentTime: "",
-    //   quantity: null,
-    // });
     ElMessage({
       message: "添加成功!",
       type: "success",
@@ -1562,11 +1561,11 @@ const onPicture = (path) => {
 const handleRemove = async (index, row) => {
   formData.data.contractShipmentList =
     formData.data.contractShipmentList.filter(
-      (item) => item.productId !== row.productId
+      (item) => item.rowId !== row.rowId
     );
   formData.data.contractWaitShipmentList =
     formData.data.contractWaitShipmentList.filter(
-      (item) => item.productId !== row.productId
+      (item) => item.rowId !== row.rowId
     );
   await formData.data.contractProductList.splice(index, 1);
   totalAmount();
@@ -1700,22 +1699,22 @@ const handleSubmit = async () => {
       formData.data.contractShipmentList &&
       formData.data.contractShipmentList.length > 0
     ) {
-      for (let i = 0; i < formData.data.contractProductList.length; i++) {
-        let data = formData.data.contractShipmentList.filter(
-          (item) =>
-            item.productId === formData.data.contractProductList[i].productId
-        );
-        if (data && data.length > 0) {
-          let quantity = 0;
-          for (let j = 0; j < data.length; j++) {
-            quantity = parseFloat(Number(quantity) + Number(data[j].quantity));
-          }
-          if (quantity > formData.data.contractProductList[i].quantity) {
-            ElMessage("出货数量不能大于商品数量");
-            return false;
-          }
-        }
-      }
+      // for (let i = 0; i < formData.data.contractProductList.length; i++) {
+      //   let data = formData.data.contractShipmentList.filter(
+      //     (item) =>
+      //       item.productId === formData.data.contractProductList[i].productId
+      //   );
+      //   if (data && data.length > 0) {
+      //     let quantity = 0;
+      //     for (let j = 0; j < data.length; j++) {
+      //       quantity = parseFloat(Number(quantity) + Number(data[j].quantity));
+      //     }
+      //     if (quantity > formData.data.contractProductList[i].quantity) {
+      //       ElMessage("出货数量不能大于商品数量");
+      //       return false;
+      //     }
+      //   }
+      // }
     } else {
       ElMessage("请添加出货计划");
       return false;
@@ -1922,11 +1921,26 @@ onMounted(() => {
       ) {
         for (let i = 0; i < formData.data.contractProductList.length; i++) {
           const e = formData.data.contractProductList[i];
+          e.rowId = uuidv4();
           if (e.ehsdJson) {
             let obj = JSON.parse(e.ehsdJson);
             e.packMethod = obj.packMethod;
             e.tradeMethods = obj.tradeMethods;
           }
+          if (route.query.processType == 30) {
+            formData.data.contractWaitShipmentList.push({
+              productCode: e.productCode,
+              rowId: e.rowId,
+              productId: e.productId,
+              productName: e.productName,
+              quantity: null,
+              waitQuantity: e.quantity,
+            });
+          }
+        }
+        if (route.query.processType == 30) {
+          formData.data.contractShipmentList = [];
+          changeWaitQuantity();
         }
         let ids = formData.data.contractProductList.map((x) => x.productId);
         proxy
@@ -2011,6 +2025,16 @@ onMounted(() => {
         formData.data.contractProductList &&
         formData.data.contractProductList.length > 0
       ) {
+        for (let i = 0; i < formData.data.contractProductList.length; i++) {
+          const e = formData.data.contractProductList[i];
+          e.rowId = uuidv4();
+          if (e.ehsdJson) {
+            let obj = JSON.parse(e.ehsdJson);
+            e.packMethod = obj.packMethod;
+            e.tradeMethods = obj.tradeMethods;
+          }
+        }
+        formData.data.contractShipmentList = [];
         if (
           (formData.data.contractWaitShipmentList &&
             formData.data.contractWaitShipmentList.length == 0) ||
@@ -2021,6 +2045,7 @@ onMounted(() => {
             const e = formData.data.contractProductList[i];
             formData.data.contractWaitShipmentList.push({
               productCode: e.productCode,
+              rowId: e.rowId,
               productId: e.productId,
               productName: e.productName,
               quantity: null,
@@ -2029,14 +2054,7 @@ onMounted(() => {
           }
           changeWaitQuantity();
         }
-        for (let i = 0; i < formData.data.contractProductList.length; i++) {
-          const e = formData.data.contractProductList[i];
-          if (e.ehsdJson) {
-            let obj = JSON.parse(e.ehsdJson);
-            e.packMethod = obj.packMethod;
-            e.tradeMethods = obj.tradeMethods;
-          }
-        }
+
         // 变更之前老产品数据
         formData.data.oldContractProductList = proxy.deepClone(
           formData.data.contractProductList
@@ -2122,6 +2140,7 @@ const handleAddShipment = () => {
       for (let i = 0; i < selectShipmentData.value.length; i++) {
         const e = selectShipmentData.value[i];
         formData.data.contractShipmentList.push({
+          rowId: e.rowId,
           productId: e.productId,
           productCode: e.productCode,
           productName: e.productName,
@@ -2155,7 +2174,7 @@ const changeWaitQuantity = () => {
     for (let i = 0; i < formData.data.contractWaitShipmentList.length; i++) {
       const e = formData.data.contractWaitShipmentList[i];
       let arr = formData.data.contractShipmentList.filter(
-        (x) => x.productId === e.productId
+        (x) => x.rowId === e.rowId
       );
       let quantity = 0;
       for (let j = 0; j < arr.length; j++) {

+ 4 - 0
src/main.js

@@ -80,6 +80,10 @@ import i18n from "@/lang/index";
 
 // 打印
 import print from "vue3-print-nb"
+// import * as echarts from "echarts";
+
+// import 'echarts-gl'
+// import './world.js'
 
 const app = createApp(App)
 console.log(i18n.global.t('login.welcomeToLogin'))

+ 85 - 30
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -305,6 +305,17 @@ const tradeMethods = ref([]);
 const corporationList = ref([]);
 const customerList = ref([]);
 const userList = ref([]);
+const isSettled = ref([
+  {
+    label: "已结清",
+    value: "1",
+  },
+  {
+    label: "未结清",
+    value: "0",
+  },
+]);
+
 const shippingMethod = ref([]);
 const customerTag = ref([]);
 const openDetailsDialog = ref(false);
@@ -374,6 +385,11 @@ const selectConfig = computed(() => {
       prop: "userId",
       data: userList.value,
     },
+    {
+      label: "是否已结清",
+      prop: "isSettled",
+      data: isSettled.value,
+    },
   ];
 });
 const headerData = ref({});
@@ -474,6 +490,16 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "是否已结清",
+        prop: "isSettled",
+        width: 100,
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, isSettled.value);
+      },
+    },
+    {
+      attrs: {
         label: "预付比例",
         slot: "advanceRatio",
         width: 100,
@@ -499,36 +525,36 @@ const config = computed(() => {
         return proxy.moneyFormat(rate, 4);
       },
     },
-    {
-      attrs: {
-        label: "合同金额(CNY)",
-        prop: "amountCNY",
-        width: 160,
-        align: "right",
-      },
-      render(amountCNY) {
-        return proxy.moneyFormat(amountCNY, 2);
-      },
-    },
-    {
-      attrs: {
-        label: "到账金额(CNY)",
-        prop: "sumClaimMoney",
-        width: 160,
-        align: "right",
-      },
-      render(sumClaimMoney) {
-        return proxy.moneyFormat(sumClaimMoney, 2);
-      },
-    },
-    {
-      attrs: {
-        label: "到账比例",
-        slot: "scale",
-        width: 100,
-        align: "right",
-      },
-    },
+    // {
+    //   attrs: {
+    //     label: "合同金额(CNY)",
+    //     prop: "amountCNY",
+    //     width: 160,
+    //     align: "right",
+    //   },
+    //   render(amountCNY) {
+    //     return proxy.moneyFormat(amountCNY, 2);
+    //   },
+    // },
+    // {
+    //   attrs: {
+    //     label: "到账金额(CNY)",
+    //     prop: "sumClaimMoney",
+    //     width: 160,
+    //     align: "right",
+    //   },
+    //   render(sumClaimMoney) {
+    //     return proxy.moneyFormat(sumClaimMoney, 2);
+    //   },
+    // },
+    // {
+    //   attrs: {
+    //     label: "到账比例",
+    //     slot: "scale",
+    //     width: 100,
+    //     align: "right",
+    //   },
+    // },
 
     {
       attrs: {
@@ -616,6 +642,35 @@ const config = computed(() => {
               });
             },
           },
+          row.status == 30
+            ? {
+                attrs: {
+                  label: "结清",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  ElMessageBox.confirm("是否确认结清?", "提示", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning",
+                  }).then(() => {
+                    proxy
+                      .post("/contract/settle", {
+                        id: row.id,
+                      })
+                      .then(() => {
+                        ElMessage({
+                          message: "操作成功",
+                          type: "success",
+                        });
+                        getList();
+                      });
+                  });
+                },
+              }
+            : {},
           {
             attrs: {
               label: "售后",

+ 295 - 3
src/views/finance/fundManage/flow/index.vue

@@ -193,6 +193,34 @@
             </el-row>
           </div>
         </template>
+        <template #amountCny>
+          <div style="width: 100%">
+            <el-row :gutter="10">
+              <el-col :span="12">
+                <el-form-item prop="amountCny">
+                  <el-input-number
+                    onmousewheel="return false;"
+                    v-model="formData.data.amountCny"
+                    placeholder="请输入转人民币金额"
+                    style="width: 100%"
+                    :precision="2"
+                    :controls="false"
+                    :min="0"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <span v-if="formData.data.amount && formData.data.amountCny"
+                  >汇率是:{{
+                    parseFloat(
+                      formData.data.amountCny / formData.data.amount
+                    ).toFixed(2)
+                  }}</span
+                >
+              </el-col>
+            </el-row>
+          </div>
+        </template>
         <template #received>
           <div>
             <el-form-item prop="received">
@@ -258,6 +286,7 @@
             </el-row>
           </div>
         </template>
+
         <template #time>
           <div style="width: 100%">
             <el-row :gutter="10">
@@ -317,6 +346,126 @@
       </template>
     </el-dialog>
 
+    <el-dialog
+      :title="'汇算'"
+      v-if="settleDialog"
+      v-model="settleDialog"
+      width="600"
+      v-loading="loadingDialog"
+    >
+      <byForm
+        :formConfig="settleFormConfig"
+        :formOption="settleFormOption"
+        v-model="formData.settleData"
+        :rules="settleRules"
+        ref="settleForm"
+      >
+        <template #transactionTime>
+          <div>
+            <el-date-picker
+              v-model="formData.settleData.transactionTime"
+              type="datetime"
+              placeholder="请选择交易时间"
+              value-format="YYYY-MM-DD HH:mm:ss"
+              disabled
+            />
+          </div>
+        </template>
+        <template #money>
+          <div style="width: 100%">
+            <el-row :gutter="10">
+              <el-col :span="6">
+                <el-form-item prop="status">
+                  <el-select
+                    v-model="formData.settleData.status"
+                    placeholder="请选择"
+                    style="width: 100%"
+                    @change="changeStatus()"
+                    disabled
+                  >
+                    <el-option
+                      v-for="item in status"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item prop="currency">
+                  <el-select
+                    v-model="formData.settleData.currency"
+                    placeholder="请选择"
+                    style="width: 100%"
+                    disabled
+                  >
+                    <el-option
+                      v-for="item in accountCurrency"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item prop="amount">
+                  <el-input-number
+                    onmousewheel="return false;"
+                    v-model="formData.settleData.amount"
+                    placeholder="请输入金额"
+                    style="width: 100%"
+                    :precision="2"
+                    :controls="false"
+                    :min="0"
+                    disabled
+                  />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+        <template #amountCny>
+          <div style="width: 100%">
+            <el-row :gutter="10">
+              <el-col :span="12">
+                <el-form-item prop="amountCny">
+                  <el-input-number
+                    onmousewheel="return false;"
+                    v-model="formData.settleData.amountCny"
+                    placeholder="请输入转人民币金额"
+                    style="width: 100%"
+                    :precision="2"
+                    :controls="false"
+                    :min="0"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <span
+                  v-if="
+                    formData.settleData.amount && formData.settleData.amountCny
+                  "
+                  >汇率是:{{
+                    parseFloat(
+                      formData.settleData.amountCny / formData.settleData.amount
+                    ).toFixed(2)
+                  }}</span
+                >
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="settleDialog = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitSettleForm()" size="large"
+          >确 定</el-button
+        >
+      </template>
+    </el-dialog>
+
     <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="860">
       <ContractPDF :rowData="rowData"></ContractPDF>
       <template #footer>
@@ -342,9 +491,20 @@ import ContractPDF from "@/components/PDF/contractPDF.vue";
 const { proxy } = getCurrentInstance();
 const accountCurrency = ref([]);
 const accountList = ref([]);
+const isSettleAccounts = ref([
+  {
+    label: "是",
+    value: "1",
+  },
+  {
+    label: "否",
+    value: "0",
+  },
+]);
+
 const headerData = ref({
-  expenditure:[],
-  income:[]
+  expenditure: [],
+  income: [],
 });
 const status = ref([
   {
@@ -385,6 +545,7 @@ const sourceList = ref({
   },
 });
 const loading = ref(false);
+
 const selectConfig = computed(() => {
   return [
     {
@@ -402,6 +563,11 @@ const selectConfig = computed(() => {
       prop: "currency",
       data: accountCurrency.value,
     },
+    {
+      label: "是否已汇算",
+      prop: "isSettleAccounts",
+      data: isSettleAccounts.value,
+    },
   ];
 });
 const config = computed(() => {
@@ -443,6 +609,20 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "汇算金额",
+        prop: "amountCny",
+        width: 120,
+      },
+      render(amountCny) {
+        if (amountCny) {
+          return proxy.moneyFormat(amountCny, 2);
+        } else {
+          return "";
+        }
+      },
+    },
+    {
+      attrs: {
         label: "对方账户",
         prop: "name",
         width: 200,
@@ -471,11 +651,25 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: "120",
+        width: "160",
         align: "center",
+        fixed: "right",
       },
       renderHTML(row) {
         return [
+          row.amountCny
+            ? {}
+            : {
+                attrs: {
+                  label: "汇算",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  settleAccounts(row);
+                },
+              },
           {
             attrs: {
               label: "修改",
@@ -487,6 +681,7 @@ const config = computed(() => {
               update(row);
             },
           },
+
           {
             attrs: {
               label: "删除",
@@ -585,8 +780,10 @@ const formOption = reactive({
   itemWidth: 100,
   rules: [],
 });
+
 const formData = reactive({
   data: {},
+  settleData: {},
 });
 const formConfig = computed(() => {
   return [
@@ -614,6 +811,12 @@ const formConfig = computed(() => {
       slotName: "money",
       label: "交易金额",
     },
+    {
+      type: "slot",
+      prop: "amountCny",
+      slotName: "amountCny",
+      label: "转人民币金额",
+    },
     formData.data.status == "10"
       ? {
           type: "slot",
@@ -671,6 +874,7 @@ const rules = ref({
   // openingBank: [{ required: true, message: "请输入开户银行", trigger: "blur" }],
   // accountOpening: [{ required: true, message: "请输入银行账号", trigger: "blur" }],
 });
+
 const openModal = (val) => {
   modalType.value = val;
   formData.data = {
@@ -704,6 +908,7 @@ const submitForm = () => {
     );
   });
 };
+
 const update = (row) => {
   modalType.value = "edit";
   loadingDialog.value = true;
@@ -992,6 +1197,93 @@ const submitFormTwo = () => {
     );
   });
 };
+const settleForm = ref(null);
+const settleDialog = ref(false);
+const settleRules = ref({
+  amountCny: [
+    { required: true, message: "请输入转人民币金额", trigger: "blur" },
+  ],
+});
+const settleFormOption = reactive({
+  inline: true,
+  disabled: false,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const settleFormConfig = computed(() => {
+  return [
+    {
+      label: "账户信息",
+    },
+    {
+      type: "select",
+      prop: "accountManagementId",
+      label: "选择账户",
+      data: accountList.value,
+      disabled: true,
+    },
+    {
+      label: "交易信息",
+    },
+    {
+      type: "slot",
+      prop: "transactionTime",
+      slotName: "transactionTime",
+      label: "交易时间",
+    },
+    {
+      type: "slot",
+      prop: "money",
+      slotName: "money",
+      label: "交易金额",
+    },
+    {
+      type: "slot",
+      prop: "amountCny",
+      slotName: "amountCny",
+      label: "转人民币金额",
+    },
+  ];
+});
+const settleAccounts = (row) => {
+  loadingDialog.value = true;
+  proxy.post("/accountRunningWater/detail", { id: row.id }).then((res) => {
+    formData.settleData = res;
+    loadingDialog.value = false;
+  });
+  settleDialog.value = true;
+};
+const submitSettleForm = () => {
+  settleForm.value.handleSubmit(() => {
+    if (
+      !formData.settleData.amountCny ||
+      Number(formData.settleData.amountCny) == 0
+    ) {
+      return ElMessage("转人民币金额不能为0");
+    }
+    loadingDialog.value = true;
+    proxy
+      .post("/accountRunningWater/settleAccounts", {
+        id: formData.settleData.id,
+        amountCny: formData.settleData.amountCny,
+      })
+      .then(
+        () => {
+          ElMessage({
+            message: "操作成功",
+            type: "success",
+          });
+          settleDialog.value = false;
+          getList();
+        },
+        (err) => {
+          console.log(err);
+          loadingDialog.value = false;
+        }
+      );
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 31 - 12
src/views/salesMange/saleContract/claim/index.vue

@@ -60,7 +60,16 @@
                 label="合同编码"
                 width="140"
               />
-              <el-table-column prop="currency" label="币种" width="80" />
+              <el-table-column label="合同金额" width="140">
+                <template #default="{ row, $index }">
+                  {{ row.currency }}{{ moneyFormat(row.contractTotal, 2) }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="sumContractNotClaimMoney"
+                label="未结清金额"
+                width="100"
+              />
               <el-table-column prop="money" label="关联金额" min-width="150">
                 <template #default="{ row, $index }">
                   <el-form-item
@@ -100,15 +109,19 @@
                   </el-form-item>
                 </template>
               </el-table-column>
-              <el-table-column prop="moneyCny" label="换算 CNY" min-width="150">
+              <el-table-column
+                prop="contractMoney"
+                label="换算金额"
+                min-width="150"
+              >
                 <template #default="{ row, $index }">
                   <el-form-item
-                    :prop="'claimContractList.' + $index + '.moneyCny'"
-                    :rules="rules.moneyCny"
+                    :prop="'claimContractList.' + $index + '.contractMoney'"
+                    :rules="rules.contractMoney"
                     :inline-message="true"
                   >
                     <el-input-number
-                      v-model="row.moneyCny"
+                      v-model="row.contractMoney"
                       :precision="2"
                       :controls="false"
                       :min="0"
@@ -263,6 +276,9 @@ let rules = ref({
   money: [{ required: true, message: "请输入关联金额", trigger: "blur" }],
   claimType: [{ required: true, message: "请选择到账类型", trigger: "change" }],
   moneyCny: [{ required: true, message: "请输入换算 CNY", trigger: "blur" }],
+  contractMoney: [
+    { required: true, message: "请输入换算金额", trigger: "blur" },
+  ],
 });
 const claim = ref([
   {
@@ -522,12 +538,12 @@ const submitForm = () => {
           type: "info",
         });
       }
-      if (!(e.moneyCny > 0)) {
-        return ElMessage({
-          message: "换算CNY不能为0!",
-          type: "info",
-        });
-      }
+      // if (!(e.moneyCny > 0)) {
+      //   return ElMessage({
+      //     message: "换算CNY不能为0!",
+      //     type: "info",
+      //   });
+      // }
     }
     const total = list.reduce((total, x) => (total += Number(x.money)), 0);
     if (total > Number(formData.data.waitAmount)) {
@@ -643,10 +659,13 @@ const handleSelectContrct = (row) => {
     contractId: row.id,
     contractCode: row.code,
     money: 0,
-    currency: rowCurrency.value,
+    currency: row.currency,
     rate: rowRate.value,
     claimType: "",
     moneyCny: null,
+    contractTotal: row.amount,
+    sumContractNotClaimMoney: row.sumContractNotClaimMoney,
+    contractMoney: null,
   });
   return ElMessage({
     message: "选择成功",

+ 24 - 10
src/views/salesMange/saleContract/contractSelect/index.vue

@@ -20,7 +20,13 @@
         <template #refundMoney="{ item }">
           <div>
             <span style="padding-right: 4px">{{ item.currency }}</span>
-            <span>{{ moneyFormat(item.sumClaimMoney, 2) }}</span>
+            <span>{{ moneyFormat(item.sumContractClaimMoney, 2) }}</span>
+          </div>
+        </template>
+        <template #sumContractNotClaimMoney="{ item }">
+          <div>
+            <span style="padding-right: 4px">{{ item.currency }}</span>
+            <span>{{ moneyFormat(item.sumContractNotClaimMoney, 2) }}</span>
           </div>
         </template>
         <template #advanceRatio="{ item }">
@@ -144,13 +150,13 @@ const config = computed(() => {
         "min-width": 220,
       },
     },
-    {
-      attrs: {
-        label: "版本号",
-        prop: "version",
-        width: 120,
-      },
-    },
+    // {
+    //   attrs: {
+    //     label: "版本号",
+    //     prop: "version",
+    //     width: 120,
+    //   },
+    // },
     {
       attrs: {
         label: "合同金额",
@@ -158,10 +164,18 @@ const config = computed(() => {
         width: 140,
       },
     },
+
+    // {
+    //   attrs: {
+    //     label: "已到账金额",
+    //     slot: "refundMoney",
+    //     width: 140,
+    //   },
+    // },
     {
       attrs: {
-        label: "已到账金额",
-        slot: "refundMoney",
+        label: "未结清金额",
+        slot: "sumContractNotClaimMoney",
         width: 140,
       },
     },