Browse Source

Merge branch 'master' of http://36.137.93.232:3000/hf/byte-sailing-new

lxf 1 year ago
parent
commit
d5f449cdac

+ 39 - 25
src/components/WDLY/process/SendPurchaseWDLY.vue

@@ -5,7 +5,7 @@
       :rules="rules"
       ref="formDom"
       label-position="top"
-      :disabled='props.queryData.purchaseDetailList ? true : false'
+      :disabled="props.queryData.purchaseDetailList ? true : false"
     >
       <div class="_t">基础信息</div>
       <el-row :gutter="10">
@@ -81,10 +81,7 @@
         </el-col>
         <el-col :span="6">
           <el-form-item label="合同编号" prop="contractCode">
-            <el-input
-              v-model="formData.data.contractCode"
-              placeholder="请输入"
-            >
+            <el-input v-model="formData.data.contractCode" placeholder="请输入">
             </el-input>
           </el-form-item>
         </el-col>
@@ -116,7 +113,11 @@
           <el-table-column prop="productCode" label="物品编码" />
           <el-table-column prop="productName" label="物品名称" />
           <!-- <el-table-column prop="productSpec" label="规格型号" /> -->
-          <el-table-column prop="productUnit" label="单位" />
+          <el-table-column
+            prop="productUnit"
+            label="单位"
+            :formatter="(row) => dictValueLabel(row.productUnit, productUnit)"
+          />
           <el-table-column
             prop="subscribeCount"
             label="申购数量"
@@ -389,27 +390,29 @@ onMounted(() => {
   if (!route.query.processType) {
     ids.value = props.queryData.ids.split(",") || [];
     getDetails();
-    
   }
   setTimeout(() => {
-    if(!props.queryData.purchaseDetailList) return
-    formData.data = props.queryData
-    proxy.post("/subscribeDetail/detail", { ids: props.queryData.purchaseDetailList.map(item => {
-      return item.subscribeDetailId
-    }) }).then((res) => {
-      console.log(formData.data.purchaseDetailList)
-      formData.data.purchaseDetailList = props.queryData.purchaseDetailList.map((x,index) => ({
-        ...res[index],
-        subscribeCount: x.count,
-        count: x.count,
-        price: x.price,
-        amount: x.amount,
-      }));
-      console.log(formData.data.purchaseDetailList)
-    });
+    if (!props.queryData.purchaseDetailList) return;
+    formData.data = props.queryData;
+    proxy
+      .post("/subscribeDetail/detail", {
+        ids: props.queryData.purchaseDetailList.map((item) => {
+          return item.subscribeDetailId;
+        }),
+      })
+      .then((res) => {
+        console.log(formData.data.purchaseDetailList);
+        formData.data.purchaseDetailList =
+          props.queryData.purchaseDetailList.map((x, index) => ({
+            ...res[index],
+            subscribeCount: x.count,
+            count: x.count,
+            price: x.price,
+            amount: x.amount,
+          }));
+        console.log(formData.data.purchaseDetailList);
+      });
   }, 2000);
-  
-  
 });
 
 // 接收父组件的传值
@@ -420,7 +423,7 @@ const props = defineProps({
 const ids = ref([]);
 const getDetails = () => {
   proxy.post("/subscribeDetail/detail", { ids: ids.value }).then((res) => {
-    console.log(res,'123123123123123123123123')
+    console.log(res, "123123123123123123123123");
     formData.data.purchaseDetailList = res.map((x) => ({
       ...x,
       subscribeCount: x.count,
@@ -495,6 +498,17 @@ const handleChangeAmount = () => {
   }
   formData.data.amount = sum;
 };
+
+const productUnit = ref([]);
+const getDict = () => {
+  proxy.getDictOne(["unit"]).then((res) => {
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+getDict();
 // 向父组件暴露
 defineExpose({
   submitData: formData.data,

+ 15 - 1
src/components/WDLY/process/SendSubscribeWDLY.vue

@@ -25,7 +25,11 @@
             <el-table-column prop="productCode" label="物品编码" />
             <el-table-column prop="productName" label="物品名称" />
             <el-table-column prop="productSpec" label="规格型号" />
-            <el-table-column prop="productUnit" label="单位" />
+            <el-table-column
+              prop="productUnit"
+              label="单位"
+              :formatter="(row) => dictValueLabel(row.productUnit, productUnit)"
+            />
             <el-table-column prop="count" label="申购数量" min-width="150">
               <template #default="{ row, $index }">
                 <el-form-item
@@ -234,6 +238,16 @@ const pushGoods = (goods) => {
 const props = defineProps({
   queryData: String,
 });
+const productUnit = ref([]);
+const getDict = () => {
+  proxy.getDictOne(["unit"]).then((res) => {
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+getDict();
 
 // 获取用户信息并赋默认值
 const userInfo = useUserStore().user;

+ 12 - 4
src/components/WDLY/product/SelectProduct.vue

@@ -287,7 +287,7 @@ const { proxy } = getCurrentInstance();
 const props = defineProps({
   isCombination: {
     type: Boolean,
-    default:false,
+    default: false,
   },
 });
 const selectConfig = computed(() => {
@@ -352,6 +352,9 @@ const config = computed(() => {
         label: "单位",
         prop: "unit",
       },
+      render(unit) {
+        return proxy.dictValueLabel(unit, productUnit.value);
+      },
     },
     {
       attrs: {
@@ -594,7 +597,9 @@ const getList = async (req) => {
   loading.value = true;
   proxy
     .post(
-      props.isCombination ? "/productInfo/getCombinationPage" : "/productInfo/page",
+      props.isCombination
+        ? "/productInfo/getCombinationPage"
+        : "/productInfo/page",
       sourceList.value.pagination
     )
     .then((message) => {
@@ -812,8 +817,11 @@ const productUnit = ref([]);
 const productType = ref([]);
 
 const getDict = () => {
-  proxy.getDict(["unit", "product_type"]).then((res) => {
-    productUnit.value = res["unit"];
+  proxy.getDictOne(["unit", "product_type"]).then((res) => {
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
     productType.value = res["product_type"];
     // formConfig.value[1].data = productType.value.map((x) => ({
     //   label: x.dictValue,

+ 13 - 0
src/components/product/SelectGoods.vue

@@ -136,6 +136,9 @@ const config = computed(() => {
         label: "单位",
         prop: "unit",
       },
+      render(unit) {
+        return proxy.dictValueLabel(unit, productUnit.value);
+      },
     },
     {
       attrs: {
@@ -347,6 +350,16 @@ const searchItemSelct = () => {
   // 默认选中的方法
   table.value.searchItemSelct(selectConfig[0].data[0], selectConfig[0]);
 };
+const productUnit = ref([]);
+const getDict = () => {
+  proxy.getDictOne(["unit"]).then((res) => {
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+getDict();
 
 onMounted(() => {
   searchItemSelct();

+ 171 - 93
src/views/EHSD/productLibrary/companyProduct/index.vue

@@ -7,7 +7,8 @@
         :data="treeListData"
         v-model="sourceList.pagination.productClassifyId"
         @change="treeChange"
-        @changeTreeList="getTreeList">
+        @changeTreeList="getTreeList"
+      >
       </treeList>
     </div>
     <div class="content">
@@ -38,16 +39,22 @@
                 disabled: false,
               },
         ]"
-        @get-list="getList">
+        @get-list="getList"
+      >
         <template #pic="{ item }">
           <div v-if="item.fileList.length > 0">
-            <img :src="item.fileList[0].fileUrl" class="pic" @click="handleClickFile(item.fileList[0])" />
+            <img
+              :src="item.fileList[0].fileUrl"
+              class="pic"
+              @click="handleClickFile(item.fileList[0])"
+            />
           </div>
           <div v-else></div>
         </template>
         <template #size="{ item }">
           <div>
-            <span>{{ item.productLong }}cm</span>* <span>{{ item.productWide }}cm</span>*
+            <span>{{ item.productLong }}cm</span>*
+            <span>{{ item.productWide }}cm</span>*
             <span>{{ item.productHigh }}cm</span>
           </div>
         </template>
@@ -64,9 +71,21 @@
       </byTable>
     </div>
 
-    <el-dialog :title="modalType == 'add' ? '添加产品' : '编辑产品'" v-model="dialogVisible" width="600" v-loading="submitLoading" destroy-on-close>
+    <el-dialog
+      :title="modalType == 'add' ? '添加产品' : '编辑产品'"
+      v-model="dialogVisible"
+      width="600"
+      v-loading="submitLoading"
+      destroy-on-close
+    >
       <div class="public_height_dialog">
-        <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
+        <byForm
+          :formConfig="formConfig"
+          :formOption="formOption"
+          v-model="formData.data"
+          :rules="rules"
+          ref="byform"
+        >
           <template #productPic>
             <div>
               <el-upload
@@ -76,7 +95,8 @@
                 list-type="picture-card"
                 :on-remove="handleRemove"
                 :before-upload="handleBeforeUpload"
-                accept=".gif, .jpeg, .jpg, .png">
+                accept=".gif, .jpeg, .jpg, .png"
+              >
                 <el-icon><Plus /></el-icon>
               </el-upload>
             </div>
@@ -85,11 +105,22 @@
       </div>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm('byform')" size="large" :loading="submitLoading">确 定</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm('byform')"
+          size="large"
+          :loading="submitLoading"
+          >确 定</el-button
+        >
       </template>
     </el-dialog>
 
-    <el-dialog title="导入产品" v-model="openExcelDialog" width="400" v-loading="excelLoading">
+    <el-dialog
+      title="导入产品"
+      v-model="openExcelDialog"
+      width="400"
+      v-loading="excelLoading"
+    >
       <el-upload
         :action="actionUrl + '/productInfo/excelImportByEhsd'"
         :headers="headers"
@@ -97,11 +128,14 @@
         :on-progress="handleProgress"
         :show-file-list="false"
         :on-error="handleError"
-        accept=".xlsx">
+        accept=".xlsx"
+      >
         <el-button type="primary">点击导入</el-button>
       </el-upload>
       <template #footer>
-        <el-button @click="openExcelDialog = false" size="large">取 消</el-button>
+        <el-button @click="openExcelDialog = false" size="large"
+          >取 消</el-button
+        >
       </template>
     </el-dialog>
   </div>
@@ -140,14 +174,26 @@ let openExcelDialog = ref(false);
 let excelLoading = ref(false);
 let modalType = ref("add");
 let rules = ref({
-  productClassifyId: [{ required: true, message: "请选择产品分类", trigger: "change" }],
+  productClassifyId: [
+    { required: true, message: "请选择产品分类", trigger: "change" },
+  ],
   name: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
   unit: [{ required: true, message: "请选择产品单位", trigger: "change" }],
-  productLong: [{ required: true, message: "请输入长 (cm)", trigger: "blur" }],
-  productWide: [{ required: true, message: "请输入宽 (cm)", trigger: "blur" }],
-  productHigh: [{ required: true, message: "请输入高 (cm)", trigger: "blur" }],
-  innerPackMethod: [{ required: true, message: "请选择内包装方式", trigger: "change" }],
-  outerPackMethod: [{ required: true, message: "请选择外包装方式", trigger: "change" }],
+  productLong: [
+    { required: true, message: "请输入长 (cm)", trigger: "blur" },
+  ],
+  productWide: [
+    { required: true, message: "请输入宽 (cm)", trigger: "blur" },
+  ],
+  productHigh: [
+    { required: true, message: "请输入高 (cm)", trigger: "blur" },
+  ],
+  innerPackMethod: [
+    { required: true, message: "请选择内包装方式", trigger: "change" },
+  ],
+  outerPackMethod: [
+    { required: true, message: "请选择外包装方式", trigger: "change" },
+  ],
 });
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -254,11 +300,15 @@ const config = computed(() => {
                 el: "button",
                 click() {
                   // 弹窗提示是否删除
-                  ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
-                    confirmButtonText: "确定",
-                    cancelButtonText: "取消",
-                    type: "warning",
-                  }).then(() => {
+                  ElMessageBox.confirm(
+                    "此操作将永久删除该数据, 是否继续?",
+                    "提示",
+                    {
+                      confirmButtonText: "确定",
+                      cancelButtonText: "取消",
+                      type: "warning",
+                    }
+                  ).then(() => {
                     // 删除
                     proxy
                       .post("/productInfo/delete", {
@@ -464,40 +514,42 @@ const formConfig = computed(() => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/productInfo/getConditionProductList", sourceList.value.pagination).then(
-    (message) => {
-      sourceList.value.data = message.rows.map((x) => ({
-        ...x,
-        fileList: [],
-        ...JSON.parse(x.ehsdJson),
-      }));
-      sourceList.value.pagination.total = message.total;
-      setTimeout(() => {
-        loading.value = false;
-      }, 200);
-      const productIdList = message.rows.map((x) => x.id);
-      // 请求文件数据并回显
-      if (productIdList.length > 0) {
-        proxy
-          .post("/fileInfo/getList", {
-            businessIdList: productIdList,
-          })
-          .then((fileObj) => {
-            for (let i = 0; i < sourceList.value.data.length; i++) {
-              const e = sourceList.value.data[i];
-              for (const key in fileObj) {
-                if (e.id === key) {
-                  e.fileList = fileObj[key];
+  proxy
+    .post("/productInfo/getConditionProductList", sourceList.value.pagination)
+    .then(
+      (message) => {
+        sourceList.value.data = message.rows.map((x) => ({
+          ...x,
+          fileList: [],
+          ...JSON.parse(x.ehsdJson),
+        }));
+        sourceList.value.pagination.total = message.total;
+        setTimeout(() => {
+          loading.value = false;
+        }, 200);
+        const productIdList = message.rows.map((x) => x.id);
+        // 请求文件数据并回显
+        if (productIdList.length > 0) {
+          proxy
+            .post("/fileInfo/getList", {
+              businessIdList: productIdList,
+            })
+            .then((fileObj) => {
+              for (let i = 0; i < sourceList.value.data.length; i++) {
+                const e = sourceList.value.data[i];
+                for (const key in fileObj) {
+                  if (e.id === key) {
+                    e.fileList = fileObj[key];
+                  }
                 }
               }
-            }
-          });
+            });
+        }
+      },
+      (err) => {
+        loading.value = false;
       }
-    },
-    (err) => {
-      loading.value = false;
-    }
-  );
+    );
 };
 
 const treeChange = (e) => {
@@ -517,13 +569,24 @@ const openModal = () => {
     currency: "$",
     currencyOne: "¥",
   };
+  fileList.value = [];
+  fileListCopy.value = [];
 };
 
 const openExcel = () => {
   openExcelDialog.value = true;
 };
 
-const needAtt = ["productClassifyId", "name", "spec", "remark", "fileList", "id", "unit", "definition"];
+const needAtt = [
+  "productClassifyId",
+  "name",
+  "spec",
+  "remark",
+  "fileList",
+  "id",
+  "unit",
+  "definition",
+];
 let jsonObj = {};
 const submitForm = () => {
   byform.value.handleSubmit((valid) => {
@@ -563,17 +626,21 @@ const submitForm = () => {
         for (const key in jsonObj) {
           formData.data[key] = jsonObj[key];
         }
-        formData.data.innerPackMethod = formData.data.innerPackMethod.split(",");
-        formData.data.outerPackMethod = formData.data.outerPackMethod.split(",");
+        formData.data.innerPackMethod =
+          formData.data.innerPackMethod.split(",");
+        formData.data.outerPackMethod =
+          formData.data.outerPackMethod.split(",");
         submitLoading.value = false;
       }
     );
   });
 };
 const getTreeList = () => {
-  proxy.post("/productClassify/tree", { parentId: "", name: "", definition: "1" }).then((message) => {
-    treeListData.value = message;
-  });
+  proxy
+    .post("/productClassify/tree", { parentId: "", name: "", definition: "1" })
+    .then((message) => {
+      treeListData.value = message;
+    });
 };
 const getDtl = (row) => {
   modalType.value = "edit";
@@ -597,21 +664,23 @@ const getDtl = (row) => {
     }
     formData.data = res;
     dialogVisible.value = true;
-    proxy.post("/fileInfo/getList", { businessIdList: [row.id] }).then((fileObj) => {
-      if (fileObj[row.id]) {
-        fileList.value = fileObj[row.id].map((x) => ({
-          ...x,
-          url: x.fileUrl,
-        }));
-        fileListCopy.value = fileObj[row.id].map((x) => ({
-          ...x,
-          url: x.fileUrl,
-        }));
-      } else {
-        fileList.value = [];
-        fileListCopy.value = [];
-      }
-    });
+    proxy
+      .post("/fileInfo/getList", { businessIdList: [row.id] })
+      .then((fileObj) => {
+        if (fileObj[row.id]) {
+          fileList.value = fileObj[row.id].map((x) => ({
+            ...x,
+            url: x.fileUrl,
+          }));
+          fileListCopy.value = fileObj[row.id].map((x) => ({
+            ...x,
+            url: x.fileUrl,
+          }));
+        } else {
+          fileList.value = [];
+          fileListCopy.value = [];
+        }
+      });
   });
 };
 const isdisabled = ["price", "costPrice", "remark", "netWeight"];
@@ -639,7 +708,9 @@ const handleBeforeUpload = async (file) => {
   });
 };
 const handleRemove = (file) => {
-  const index = fileListCopy.value.findIndex((x) => x.uid === file.uid || x.id === file.id);
+  const index = fileListCopy.value.findIndex(
+    (x) => x.uid === file.uid || x.id === file.id
+  );
   fileListCopy.value.splice(index, 1);
 };
 const handleClickFile = (file) => {
@@ -674,24 +745,31 @@ const handleSuccess = (res) => {
   }
 };
 const getDict = () => {
-  proxy.getDictOne(["inner_packaging_method_ehsd", "outside_packaging_method_ehsd", "unit", "account_currency"]).then((res) => {
-    innerMethon.value = res["inner_packaging_method_ehsd"].map((x) => ({
-      label: x.dictValue,
-      value: x.dictKey,
-    }));
-    outsideMethon.value = res["outside_packaging_method_ehsd"].map((x) => ({
-      label: x.dictValue,
-      value: x.dictKey,
-    }));
-    productUnit.value = res["unit"].map((x) => ({
-      label: x.dictValue,
-      value: x.dictKey,
-    }));
-    accountCurrency.value = res["account_currency"].map((x) => ({
-      label: x.dictKey,
-      value: x.dictValue,
-    }));
-  });
+  proxy
+    .getDictOne([
+      "inner_packaging_method_ehsd",
+      "outside_packaging_method_ehsd",
+      "unit",
+      "account_currency",
+    ])
+    .then((res) => {
+      innerMethon.value = res["inner_packaging_method_ehsd"].map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+      outsideMethon.value = res["outside_packaging_method_ehsd"].map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+      productUnit.value = res["unit"].map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+      accountCurrency.value = res["account_currency"].map((x) => ({
+        label: x.dictKey,
+        value: x.dictValue,
+      }));
+    });
 };
 getDict();
 getTreeList();

+ 2 - 0
src/views/EHSD/productLibrary/customerProduct/index.vue

@@ -540,6 +540,8 @@ const openModal = () => {
     currency: "$",
     currencyOne: "¥",
   };
+  fileList.value = [];
+  fileListCopy.value = [];
 };
 
 const openExcel = () => {

+ 1 - 0
src/views/WDLY/outInBound/abnormal/index.vue

@@ -471,6 +471,7 @@ const getDtl = (row) => {
     type: row.type,
     linkCode: row.linkCode,
     title: row.title,
+    handleTime: proxy.parseTime(new Date()),
   };
   dialogVisible.value = true;
 };

+ 74 - 15
src/views/WDLY/outInBound/waitOutBound/index.vue

@@ -172,7 +172,7 @@ let rules = ref({
   inWarehouseId: [
     { required: true, message: "请选择调入仓库", trigger: "change" },
   ],
-  quantity: [{ required: true, message: "请输入调仓数量", trigger: "blur" }],
+  quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
@@ -254,6 +254,9 @@ const config = computed(() => {
         label: "单位",
         prop: "productUnit",
       },
+      render(unit) {
+        return proxy.dictValueLabel(unit, productUnit.value);
+      },
     },
     {
       attrs: {
@@ -309,6 +312,10 @@ const formOption = reactive({
 });
 const byform = ref(null);
 let formConfig = ref([]);
+const businessType = [
+  { label: "销售订单出库", value: "6" },
+  { label: "京东订单出库", value: "5" },
+];
 const configData = [
   [
     {
@@ -322,11 +329,11 @@ const configData = [
       required: true,
       disabled: true,
       itemWidth: 100,
-      data: [],
+      data: businessType,
     },
     {
       type: "input",
-      prop: "businessType",
+      prop: "businessCode",
       label: "单号",
       required: true,
       disabled: true,
@@ -334,7 +341,7 @@ const configData = [
     },
     {
       type: "input",
-      prop: "businessType",
+      prop: "productName",
       label: "物品名称",
       required: true,
       disabled: true,
@@ -342,7 +349,7 @@ const configData = [
     },
     {
       type: "input",
-      prop: "businessType",
+      prop: "waitQuantity",
       label: "待出库数量",
       required: true,
       disabled: true,
@@ -370,11 +377,14 @@ const configData = [
       },
     },
     {
-      type: "input",
-      prop: "code",
+      type: "number",
+      prop: "quantity",
       label: "出库数量",
       disabled: false,
       itemWidth: 33,
+      precision: 2,
+      min: 0,
+      controls: false,
     },
   ],
   [
@@ -424,6 +434,7 @@ const getList = async (req) => {
       sourceList.value.data = message.rows.map((x) => ({
         ...x,
         ...JSON.parse(x.victoriatouristJson),
+        quantity: Number(x.quantity) - Number(x.receiptQuantity),
       }));
       sourceList.value.pagination.total = message.total;
       setTimeout(() => {
@@ -470,6 +481,39 @@ const submitForm = () => {
         },
         (err) => (submitLoading.value = false)
       );
+    } else if (modalType.value === "edit") {
+      const data = {
+        id: formData.data.id,
+        businessType: formData.data.businessType,
+        warehouseId: formData.data.warehouseId,
+        quantity: formData.data.quantity,
+        waitQuantity: formData.data.waitQuantity,
+      };
+      if (!(data.quantity > 0)) {
+        return ElMessage({
+          message: "出库数量不能为0!",
+          type: "info",
+        });
+      }
+      if (data.quantity > data.waitQuantity) {
+        return ElMessage({
+          message: "出库数量不能大于待出库数量!",
+          type: "info",
+        });
+      }
+      submitLoading.value = true;
+      proxy.post("/stockWaitDetails/add", data).then(
+        (res) => {
+          ElMessage({
+            message: "操作成功",
+            type: "success",
+          });
+          dialogVisible.value = false;
+          submitLoading.value = false;
+          getList();
+        },
+        (err) => (submitLoading.value = false)
+      );
     }
   });
 };
@@ -495,20 +539,25 @@ const outBound = (row) => {
       };
       dialogVisible.value = true;
     });
-  } else {
+  } else if (row.businessType == 6) {
     modalType.value = "edit";
     formConfig.value = configData[0];
+    proxy.post("/orderInfo/detail", { id: row.businessId }).then((res) => {
+      formData.data = {
+        id: row.id,
+        warehouseId: "",
+        businessType: row.businessType + "",
+        businessCode: row.businessCode,
+        productName: row.productName,
+        waitQuantity: row.quantity,
+        quantity: undefined,
+      };
+      dialogVisible.value = true;
+    });
   }
-
-  dialogVisible.value = true;
 };
 const warehouseType = ref([]);
 
-const businessType = [
-  { label: "销售订单出库", value: "6" },
-  { label: "京东订单出库", value: "5" },
-];
-
 const handleRemove = (index) => {
   formData.data.jdOrderDetailsList.splice(index, 1);
   return ElMessage({
@@ -574,6 +623,16 @@ const warehouseListData = () => {
 };
 warehouseListData();
 getList();
+const productUnit = ref([]);
+const getDict = () => {
+  proxy.getDictOne(["unit"]).then((res) => {
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+getDict();
 onMounted(() => {
   selectConfig[0].data = businessType;
   selectConfig[1].data = outboundType.value;

+ 26 - 8
src/views/WDLY/purchaseManage/alreadyPurchase/index.vue

@@ -112,8 +112,26 @@
               <el-table-column
                 prop="deliverGoodsQuantity"
                 label="本次到货"
+                min-width="150"
                 v-if="modalType === 'edit'"
-              />
+              >
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="
+                      'arrivalDetailList.' + $index + '.deliverGoodsQuantity'
+                    "
+                    :rules="rules.deliverGoodsQuantity"
+                    :inline-message="true"
+                  >
+                    <el-input-number
+                      v-model="row.deliverGoodsQuantity"
+                      :precision="4"
+                      :controls="false"
+                      :min="0"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
             </el-table>
           </div>
         </template>
@@ -744,7 +762,7 @@ watch(
           productCode: x.code,
           bussinessId: x.productId,
           purchaseDetailId: x.purchaseDetailId,
-          deliverGoodsDetailsId: x.deliverGoodsId,
+          deliverGoodsDetailsId: x.id,
           transitQuantity: x.transitQuantity,
           deliverGoodsQuantity: x.deliverGoodsQuantity,
           productDefinition: x.definition,
@@ -757,12 +775,12 @@ watch(
 const handleClickContractCode = (row) => {
   proxy.post("/deliverGoodsDetails/detail", { id: row.id }).then((res) => {
     proxy.$router.push({
-        path: "/platform_manage/process/processApproval",
-        query: {
-            flowKey: row.processInstanceId,
-            id: row.flowId,
-            processType:20,
-        },
+      path: "/platform_manage/process/processApproval",
+      query: {
+        flowKey: row.processInstanceId,
+        id: row.flowId,
+        processType: 20,
+      },
     });
     // formData.dataOne = {
     //   supplyName: row.supplyName,

+ 14 - 1
src/views/WDLY/purchaseManage/subscribe/index.vue

@@ -225,6 +225,9 @@ const config = computed(() => {
         label: "单位",
         prop: "productUnit",
       },
+      render(unit) {
+        return proxy.dictValueLabel(unit, productUnit.value);
+      },
     },
 
     {
@@ -416,7 +419,7 @@ const openModal = () => {
     path: "/platform_manage/process/processApproval",
     query: {
       flowKey: "wdly_apply_purchase",
-      time:Date.now(),
+      time: Date.now(),
     },
   });
 };
@@ -524,6 +527,16 @@ const statusData = ref([
 ]);
 selectConfig[1].data = statusData.value;
 getList();
+const productUnit = ref([]);
+const getDict = () => {
+  proxy.getDictOne(["unit"]).then((res) => {
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+getDict();
 </script>
   
 <style lang="scss" scoped>

+ 1 - 1
src/views/dataBoard/board/customerAnalysis/index.vue

@@ -159,7 +159,7 @@
     </div>
     <div class="three bck" v-loading="loadingTwo">
       <TitleInfo :content="titleList[2]"></TitleInfo>
-      <div ref="echartDom" style="min-height: 400px"></div>
+      <div ref="echartDom" style="height: 40vh"></div>
     </div>
   </div>
 </template>

+ 314 - 0
src/views/dataBoard/board/salesAnalysis/index.vue

@@ -0,0 +1,314 @@
+<template>
+  <div class="content">
+    <div class="bck">
+      <el-form :inline="true" :model="queryForm">
+        <el-form-item label="">
+          <el-date-picker
+            v-model="queryForm.aa"
+            type="month"
+            placeholder="月份"
+            @change="onQuery"
+          />
+        </el-form-item>
+        <el-form-item label="">
+          <el-radio-group v-model="queryForm.bb" size="large" @change="onQuery">
+            <el-radio-button label="本日" />
+            <el-radio-button label="本周" />
+            <el-radio-button label="本月" />
+            <el-radio-button label="今年" />
+            <el-radio-button label="其他" />
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item>
+          <el-date-picker
+            v-model="queryForm.timeArr"
+            type="daterange"
+            unlink-panels
+            range-separator="-"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            value-format="YYYY-MM-DD"
+            @change="onQuery"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="onQuery">搜索</el-button>
+          <el-button type="defualt" @click="onReset">重置</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+    <div class="bck statistics" style="margin-top: 10px">
+      <div class="item first">
+        <div class="left_">
+          <div class="money">
+            {{ moneyFormat(0, 2) }}
+          </div>
+          <div>销售额({{ 0 }})</div>
+        </div>
+        <div class="right_">
+          <div class="icon">
+            <img src="@/assets/images/portrait/icon_sales.png" alt="" />
+          </div>
+        </div>
+      </div>
+      <div class="item two">
+        <div class="left_">
+          <div class="money">
+            {{ moneyFormat(0, 2) }}
+          </div>
+          <div>订单(单)</div>
+        </div>
+        <div class="right_">
+          <div class="icon">
+            <img src="@/assets/images/portrait/icon_profits.png" alt="" />
+          </div>
+        </div>
+      </div>
+      <div class="item three">
+        <div class="left_">
+          <div class="money">
+            {{ 0 }}
+          </div>
+          <div>下单客户数(人)</div>
+        </div>
+        <div class="right_">
+          <div class="icon">
+            <img src="@/assets/images/portrait/icon_email.png" alt="" />
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <div class="bck scatter" style="margin-top: 10px">
+      <el-row>
+        <el-col :span="8">
+          <TitleInfo :content="titleList[0]"></TitleInfo>
+          <div ref="echartDom" style="height: 40vh"></div>
+        </el-col>
+        <el-col :span="16">
+          <byTable
+            :source="sourceList.scatterData"
+            :pagination="sourceList.scatterPagination"
+            :config="scatterConfig"
+            :loading="scatterLoading"
+            highlight-current-row
+            :selectConfig="[]"
+            @get-list="getList"
+          >
+          </byTable>
+        </el-col>
+      </el-row>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import * as echarts from "echarts";
+
+import TitleInfo from "@/components/TitleInfo/index.vue";
+const titleList = [
+  "销售分布",
+  "客户分类",
+  "业务员销售趋势",
+  "商品销售额",
+  "商品销量",
+];
+const { proxy } = getCurrentInstance();
+const scatterLoading = ref(false);
+const loadingOne = ref(false);
+const loadingTwo = ref(false);
+const queryForm = reactive({
+  beginTime: "",
+  endTime: "",
+  timeArr: "",
+});
+const sourceList = ref({
+  scatterData: [],
+  scatterPagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+  },
+});
+//图表
+const echartDom = ref(null);
+let myChart = null;
+const option = reactive({
+  data: {
+    tooltip: {
+      trigger: "item",
+    },
+    legend: {
+      top: "0%",
+      left: "center",
+    },
+    series: [
+      {
+        name: "销售分布",
+        type: "pie",
+        radius: ["20%", "50%"],
+        avoidLabelOverlap: false,
+        itemStyle: {
+          borderRadius: 10,
+          borderColor: "#fff",
+          borderWidth: 2,
+        },
+        label: {
+          show: false,
+          position: "center",
+        },
+        emphasis: {
+          label: {
+            show: true,
+            fontSize: 40,
+            fontWeight: "bold",
+          },
+        },
+        labelLine: {
+          show: false,
+        },
+        data: [2000, 1000],
+      },
+    ],
+  },
+});
+const scatterConfig = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "序列",
+        prop: "receiptWarehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "国家",
+        prop: "receiptWarehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "订单量(单)",
+        prop: "receiptWarehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "交易金额(¥)",
+        prop: "amount",
+      },
+      render(amount) {
+        return proxy.moneyFormat(amount, 2);
+      },
+    },
+  ];
+});
+
+const getData = () => {
+  // loading.value = true;
+  loadingOne.value = true;
+  loadingTwo.value = true;
+  // proxy.post("/saleQuotation/sourceStatistics", queryForm).then((res) => {
+  //   allData.sourceData = res;
+  //   setTimeout(() => {
+  //     loading.value = false;
+  //   }, 200);
+  // });
+  // proxy.post("/saleQuotation/typeStatistics", queryForm).then((res) => {
+  //   allData.typeData = res;
+  //   setTimeout(() => {
+  //     loadingOne.value = false;
+  //   }, 200);
+  // });
+  proxy.post("/contract/salesStatistics", queryForm).then((res) => {
+    console.log(res, "aa");
+  });
+};
+
+const onQuery = () => {
+  queryForm.beginTime = queryForm.timeArr[0];
+  queryForm.endTime = queryForm.timeArr[1];
+  getData();
+};
+
+const onReset = () => {};
+onMounted(() => {
+  myChart = echarts.init(echartDom.value);
+  window.addEventListener("resize", () => {
+    myChart.resize();
+  });
+  myChart.setOption(option.data);
+  getData();
+});
+</script>
+
+<style lang="scss" scoped>
+.content {
+  margin: 20px;
+}
+:deep(.el-form-item) {
+  margin-bottom: 0px;
+}
+.bck {
+  background-color: #fff;
+  padding: 15px;
+}
+.statistics {
+  display: flex;
+  // justify-content: space-around;
+  .item {
+    border-radius: 10px;
+    margin-right: 20px;
+    width: 13vw;
+    height: 70px;
+    padding: 10px;
+    box-sizing: border-box;
+    display: flex;
+    justify-content: space-between;
+    .left_ {
+      display: flex;
+      flex-direction: column;
+      justify-content: space-around;
+      .money {
+        font-weight: 700;
+        color: #333333;
+        font-size: 15px;
+      }
+    }
+    .right_ {
+      .icon {
+        img {
+          width: 20px;
+          height: 20px;
+          margin-top: 6px;
+        }
+        width: 34px;
+        height: 34px;
+        margin-top: 10px;
+        border-radius: 8px;
+        background-color: #ffffff;
+        text-align: center;
+        line-height: 34px;
+      }
+    }
+  }
+  .first {
+    background: linear-gradient(#c7e3fe, #dfecff);
+  }
+  .two {
+    background: linear-gradient(#eae8fb, #ded9ff);
+  }
+  .three {
+    background: linear-gradient(#fcf1e4, #fce5ca);
+  }
+  .four {
+    background: linear-gradient(#e2fbe8, #e2fbe8);
+  }
+  .five {
+    background: linear-gradient(#ffebe9, #ffebe9);
+  }
+}
+.scatter {
+  // display: flex;
+}
+</style>

+ 9 - 1
src/views/purchaseManage/supplier/supplyPrice/index.vue

@@ -231,6 +231,9 @@ const config = computed(() => {
         label: "单位",
         prop: "productUnit",
       },
+      render(unit) {
+        return proxy.dictValueLabel(unit, productUnit.value);
+      },
     },
     {
       attrs: {
@@ -544,13 +547,18 @@ const pushGoods = (goods) => {
   });
 };
 const supplierType = ref([]);
+const productUnit = ref([]);
 const getDict = () => {
-  proxy.getDict(["supplier_type"]).then((res) => {
+  proxy.getDictOne(["supplier_type", "unit"]).then((res) => {
     supplierType.value = res["supplier_type"];
     selectConfig[0].data = supplierType.value.map((x) => ({
       label: x.dictValue,
       value: x.dictKey,
     }));
+    productUnit.value = res["unit"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
   });
 };
 getDict();

+ 622 - 0
src/views/salesMange/salesMange/performance/index.vue

@@ -0,0 +1,622 @@
+<template>
+  <div class="tenant">
+    <div class="content">
+      <div style="padding: 20px 0 0 20px">
+        <el-form :inline="true" :model="queryForm">
+          <el-form-item label="年份">
+            <el-date-picker
+              v-model="queryForm.aa"
+              type="year"
+              placeholder="请选择"
+            />
+          </el-form-item>
+          <el-form-item label="业务员">
+            <el-select
+              v-model="queryForm.countryId"
+              placeholder="请选择"
+              @change="onQuery"
+            >
+              <el-option
+                v-for="item in userList"
+                :label="item.label"
+                :value="item.value"
+                :key="item.value"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" @click="onQuery">搜索</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+      <byTable
+        :hideTable="true"
+        :hidePagination="true"
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        :selectConfig="selectConfig"
+        highlight-current-row
+        :action-list="[]"
+        @get-list="getList"
+      >
+        <template #amount="{ item }">
+          <div></div>
+        </template>
+      </byTable>
+      <div
+        style="padding: 0 20px 20px 20px; background-color: white"
+        v-if="rateStatus"
+      >
+        <el-table v-loading="loading" :data="sourceList.data">
+          <el-table-column label="合同编号">
+            <el-table-column label="" prop="contractCode" width="160" />
+          </el-table-column>
+          <el-table-column label="客户名称">
+            <el-table-column label="" prop="customerName" min-width="200" />
+          </el-table-column>
+          <el-table-column label="业务员">
+            <el-table-column label="" prop="userName" width="120" />
+          </el-table-column>
+          <el-table-column label="销售合同金额">
+            <el-table-column label="" prop="contractAmount" width="120" />
+          </el-table-column>
+          <el-table-column label="收入">
+            <el-table-column
+              label="合同到账"
+              prop="contractArrival"
+              width="120"
+            />
+            <el-table-column label="其他收入" prop="otherIncome" width="120" />
+          </el-table-column>
+          <el-table-column label="采购合同金额">
+            <el-table-column label="" prop="purchaseAmount" width="120" />
+          </el-table-column>
+          <el-table-column label="支出">
+            <el-table-column label="支付货款" prop="payForGoods" width="120" />
+            <el-table-column
+              label="其他支出"
+              prop="otherExpenses"
+              width="120"
+            />
+          </el-table-column>
+          <el-table-column label="统计">
+            <el-table-column label="收入合计" prop="totalIncome" width="120" />
+            <el-table-column
+              label="支出合计"
+              prop="totalExpenses"
+              width="120"
+            />
+            <el-table-column label="毛利" prop="grossProfit" width="120" />
+            <el-table-column
+              label="毛利率"
+              prop="grossProfitMargin"
+              width="120"
+            />
+          </el-table-column>
+          <el-table-column label="提成">
+            <el-table-column label="售后" prop="totalIncome" width="120" />
+            <el-table-column label="公共" prop="totalExpenses" width="120" />
+            <el-table-column label="总办" prop="grossProfit" width="120" />
+            <el-table-column
+              label="部门提成"
+              prop="grossProfitMargin"
+              width="120"
+            />
+            <el-table-column
+              label="个人提成"
+              prop="grossProfitMargin"
+              width="120"
+            />
+          </el-table-column>
+          <el-table-column
+            label="操作"
+            align="center"
+            width="170"
+            fixed="right"
+          >
+            <template #default="{ row }">
+              <div>
+                <el-button type="primary" @click="changeExchangeRate(row)" link
+                  >调整汇率</el-button
+                >
+                <el-button
+                  type="primary"
+                  @click="clickSettlement(row)"
+                  v-if="row.settlementStatus === 0"
+                  link
+                  >结算</el-button
+                >
+                <el-button
+                  type="primary"
+                  @click="clickCancelSettlement(row)"
+                  v-else
+                  link
+                  >取消结算</el-button
+                >
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <el-row style="padding: 20px" justify="end" type="flex">
+        <el-pagination
+          background
+          layout="total, sizes, prev, pager, next, jumper"
+          :current-page="sourceList.pagination.pageNum"
+          :page-size="sourceList.pagination.pageSize"
+          :total="sourceList.pagination.total"
+          @size-change="handleSizeChange"
+          @current-change="handlePageChange"
+        />
+      </el-row>
+    </div>
+
+    <el-dialog
+      title="默认汇率"
+      v-if="dialogVisible"
+      v-model="dialogVisible"
+      width="600"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="submit"
+      >
+        <template #currencyList>
+          <el-table
+            :data="formData.data.list"
+            style="width: 100%"
+            v-loading="loadingDialog"
+          >
+            <el-table-column label="币种">
+              <template #default="{ row }">
+                <div>{{ dictValueLabel(row.type, accountCurrency) }}</div>
+              </template>
+            </el-table-column>
+            <el-table-column label="兑 CHY 汇率">
+              <template #default="{ row, $index }">
+                <el-form-item
+                  :prop="'list.' + $index + '.rate'"
+                  :rules="rules.rate"
+                  :inline-message="true"
+                >
+                  <el-input-number
+                    v-model="row.rate"
+                    placeholder="请输入兑 CHY 汇率"
+                    style="width: 100%"
+                    :precision="6"
+                    :controls="false"
+                    :min="0"
+                  />
+                </el-form-item>
+              </template>
+            </el-table-column>
+          </el-table>
+        </template>
+      </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>
+
+    <el-dialog
+      title="调整汇率"
+      v-if="openChange"
+      v-model="openChange"
+      width="600"
+    >
+      <byForm
+        :formConfig="formChangeConfig"
+        :formOption="formOption"
+        v-model="formChangeData.data"
+        :rules="rules"
+        ref="change"
+      >
+        <template #currencyList>
+          <el-table
+            :data="formChangeData.data.list"
+            style="width: 100%"
+            v-loading="loadingDialog"
+          >
+            <el-table-column label="币种">
+              <template #default="{ row }">
+                <div>{{ dictValueLabel(row.type, accountCurrency) }}</div>
+              </template>
+            </el-table-column>
+            <el-table-column label="兑 CHY 汇率">
+              <template #default="{ row, $index }">
+                <el-form-item
+                  :prop="'list.' + $index + '.rate'"
+                  :rules="rules.rate"
+                  :inline-message="true"
+                >
+                  <el-input-number
+                    v-model="row.rate"
+                    placeholder="请输入兑 CHY 汇率"
+                    style="width: 100%"
+                    :precision="6"
+                    :controls="false"
+                    :min="0"
+                  />
+                </el-form-item>
+              </template>
+            </el-table-column>
+          </el-table>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="openChange = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitChangeForm()" size="large"
+          >确 定</el-button
+        >
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import useUserStore from "@/store/modules/user";
+import { ElMessage } from "element-plus";
+
+const { proxy } = getCurrentInstance();
+const accountCurrency = ref([]);
+const userList = ref([]);
+const queryForm = reactive({
+  countryId: "",
+  beginTime: "",
+  endTime: "",
+  timeArr: "",
+});
+const settlementStatus = ref([
+  {
+    label: "未结算",
+    value: "0",
+  },
+  {
+    label: "已结算",
+    value: "1",
+  },
+]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+    settlementStatus: "",
+    userId: "",
+  },
+});
+const loading = ref(false);
+const selectConfig = computed(() => {
+  return [
+    // {
+    //   label: "是否完结",
+    //   prop: "settlementStatus",
+    //   data: settlementStatus.value,
+    // },
+    // {
+    //   label: "业务员",
+    //   prop: "userId",
+    //   data: userList.value,
+    // },
+  ];
+});
+const config = computed(() => {
+  return [];
+});
+const getDict = () => {
+  proxy
+    .post("/dictTenantData/page", {
+      pageNum: 1,
+      pageSize: 999,
+      dictCode: "account_currency",
+      tenantId: useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        accountCurrency.value = res.rows.map((item) => {
+          return {
+            label: item.dictValue,
+            value: item.dictKey,
+          };
+        });
+        judgeRate();
+      } else {
+        ElMessage("请先添加货币");
+      }
+    });
+  proxy
+    .get("/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      userList.value = res.rows.map((item) => {
+        return {
+          label: item.nickName,
+          value: item.userId,
+        };
+      });
+    });
+};
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/commission/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+const rateStatus = ref(false);
+const judgeRate = () => {
+  proxy.post("/currencyRate/list", {}).then(
+    (res) => {
+      if (res && res.length > 0) {
+        for (let i = 0; i < accountCurrency.value.length; i++) {
+          let currencyStatus = true;
+          for (let j = 0; j < res.length; j++) {
+            if (accountCurrency.value[i].value === res[j].type) {
+              currencyStatus = false;
+              break;
+            }
+          }
+          if (currencyStatus) {
+            return ElMessage("请先完成默认汇率的配置");
+          }
+        }
+        rateStatus.value = true;
+        getList();
+      } else {
+        ElMessage("请先完成默认汇率的配置");
+      }
+    },
+    (err) => {
+      console.log(err);
+      ElMessage("请先完成默认汇率的配置");
+    }
+  );
+};
+getDict();
+const handleSizeChange = (val) => {
+  sourceList.value.pagination.pageNum = 1;
+  sourceList.value.pagination.pageSize = val;
+  getList();
+};
+const handlePageChange = (val) => {
+  sourceList.value.pagination.pageSize = val;
+  getList();
+};
+const dialogVisible = ref(false);
+const loadingDialog = ref(false);
+const submit = ref(null);
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const formData = reactive({
+  data: {
+    list: [],
+  },
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "slot",
+      prop: "currencyList",
+      slotName: "currencyList",
+      label: "",
+    },
+  ];
+});
+const rules = ref({
+  rate: [{ required: true, message: "请输入兑 CHY 汇率", trigger: "blur" }],
+});
+const openModal = () => {
+  if (accountCurrency.value && accountCurrency.value.length > 0) {
+    formData.data = {
+      list: accountCurrency.value.map((item) => {
+        return {
+          id: "",
+          type: item.value,
+          rate: 1,
+        };
+      }),
+    };
+  } else {
+    formData.data = {
+      list: [],
+    };
+  }
+  loadingDialog.value = true;
+  dialogVisible.value = true;
+  proxy.post("/currencyRate/list", {}).then(
+    (res) => {
+      if (res && res.length > 0 && formData.data.list.length > 0) {
+        formData.data.list = formData.data.list.map((item) => {
+          for (let i = 0; i < res.length; i++) {
+            if (item.type === res[i].type) {
+              item.id = res[i].id;
+              item.rate = res[i].rate;
+              break;
+            }
+          }
+          return {
+            ...item,
+          };
+        });
+      }
+      loadingDialog.value = false;
+    },
+    (err) => {
+      console.log(err);
+      loadingDialog.value = false;
+    }
+  );
+};
+const submitForm = () => {
+  submit.value.handleSubmit(() => {
+    loadingDialog.value = true;
+    proxy.post("/currencyRate/edit", formData.data.list).then(
+      () => {
+        ElMessage({
+          message: "保存成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        rateStatus.value = true;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+  });
+};
+const openChange = ref(false);
+const change = ref(null);
+const formChangeData = reactive({
+  data: {
+    list: [],
+  },
+});
+const formChangeConfig = computed(() => {
+  return [
+    {
+      type: "slot",
+      prop: "currencyList",
+      slotName: "currencyList",
+      label: "",
+    },
+  ];
+});
+const changeExchangeRate = (row) => {
+  formChangeData.data = {
+    id: row.contractId,
+    list: [],
+  };
+  if (accountCurrency.value && accountCurrency.value.length > 0) {
+    formChangeData.data.list = accountCurrency.value.map((item) => {
+      return {
+        type: item.value,
+        rate: 1,
+      };
+    });
+  }
+  loadingDialog.value = true;
+  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;
+          break;
+        }
+      }
+      return {
+        ...item,
+      };
+    });
+    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;
+      }
+    );
+  }
+};
+const submitChangeForm = () => {
+  change.value.handleSubmit(() => {
+    loadingDialog.value = true;
+    let data = {};
+    data.id = formChangeData.data.id;
+    data.currencyRateJson = JSON.stringify(formChangeData.data.list);
+    proxy.post("/saleStatement/update", data).then(
+      () => {
+        ElMessage({
+          message: "保存成功",
+          type: "success",
+        });
+        openChange.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+  });
+};
+const clickSettlement = (row) => {
+  proxy
+    .post("/saleStatement/update", { id: row.contractId, settlementStatus: 1 })
+    .then(() => {
+      ElMessage({
+        message: "保存成功",
+        type: "success",
+      });
+      getList();
+    });
+};
+const clickCancelSettlement = (row) => {
+  proxy
+    .post("/saleStatement/update", { id: row.contractId, settlementStatus: 0 })
+    .then(() => {
+      ElMessage({
+        message: "保存成功",
+        type: "success",
+      });
+      getList();
+    });
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+  .content {
+    background-color: white;
+  }
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>