Эх сурвалжийг харах

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

asd26269546 1 жил өмнө
parent
commit
dd6d2955f5

+ 12 - 10
src/components/PDF/contractPDF.vue

@@ -195,8 +195,8 @@ const printDetails = ref({});
 const props = defineProps({
   rowData: Object,
 });
-const getPdfData = (row) => {
-  proxy.post("/contract/getContractPdfInfo", { id: row.id }).then((res) => {
+const getPdfData = (query) => {
+  proxy.post("/contract/getContractPdfInfo", query).then((res) => {
     printDetails.value = res;
   });
 };
@@ -223,10 +223,6 @@ const statisticsTwo = (label, index) => {
   return num;
 };
 
-if (props.rowData && props.rowData.id) {
-  getPdfData(props.rowData);
-}
-
 const productUnit = ref([]);
 const tradeMethods = ref([]);
 const shippingMethod = ref([]);
@@ -249,11 +245,17 @@ const getDict = () => {
 };
 getDict();
 watch(
-  () => props.rowData.id,
-  (val) => {
-    if (props.rowData && props.rowData.id) {
-      getPdfData(props.rowData);
+  props.rowData,
+  () => {
+    if (props.rowData.id) {
+      getPdfData({ id: props.rowData.id });
+    } else if (props.rowData.code) {
+      getPdfData({ code: props.rowData.code });
     }
+  },
+  {
+    immediate: true,
+    deep: true,
   }
 );
 </script>

+ 1 - 0
src/components/process/PurchasePayment.vue

@@ -245,6 +245,7 @@ const formConfig = computed(() => {
       slotName: "rate",
       label: "税率 (%)",
       itemWidth: 34,
+      isShow: formData.data.invoiceType == "1" || formData.data.invoiceType == "2",
     },
     {
       type: "slot",

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 103 - 693
src/components/process/SendFunds.vue


+ 37 - 34
src/components/process/SendPurchase.vue

@@ -132,11 +132,10 @@
               >
                 <el-input-number
                   onmousewheel="return false;"
-                  :value="formData.data.purchaseDetailList[$index].count"
-                  :precision="2"
+                  v-model="formData.data.purchaseDetailList[$index].count"
                   :controls="false"
                   :min="0"
-                  @change="(e) => handleChangeAmount(e, $index,'count')"
+                  @change="(e) => handleChangeMoney(e, $index, 'count')"
                 />
               </el-form-item>
             </template>
@@ -150,11 +149,10 @@
               >
                 <el-input-number
                   onmousewheel="return false;"
-                  :value="formData.data.purchaseDetailList[$index].price"
-                  :precision="2"
+                  v-model="formData.data.purchaseDetailList[$index].price"
                   :controls="false"
                   :min="0"
-                  @change="(e) => handleChangeAmount(e, $index,'price')"
+                  @change="(e) => handleChangeMoney(e, $index, 'price')"
                 />
               </el-form-item>
             </template>
@@ -217,10 +215,10 @@
                 :inline-message="true"
               >
                 <el-input-number
-                  v-model="row.price"
-                  :precision="2"
+                  onmousewheel="return false;"
+                  v-model="formData.data.otherFeeList[$index].price"
                   :controls="false"
-                  @change="handleChangeAmount"
+                  @change="(e) => handleChangeOtherMoney(e, $index, 'price')"
                 />
               </el-form-item>
             </template>
@@ -687,42 +685,47 @@ const handleChangeSupplier = (val) => {
       });
   }
 };
-const handleChangeProductAmount = () => {
-  let sum = 0;
-  for (let i = 0; i < formData.data.purchaseDetailList.length; i++) {
-    const e = formData.data.purchaseDetailList[i];
-    e.amount = parseFloat(e.count * e.price).toFixed(2);
-    sum += Number(e.amount);
-  }
-  formData.data.productAmount = parseFloat(sum).toFixed(2);
-};
 
-const handleChangeOtherAmount = () => {
-  let sum = 0;
-  for (let i = 0; i < formData.data.otherFeeList.length; i++) {
-    const e = formData.data.otherFeeList[i];
-    sum += Number(e.price);
+const formatNumber = (value) => {
+  if (value === null || value === undefined || value === "") {
+    return "";
   }
-  formData.data.otherAmount = parseFloat(sum).toFixed(2);
+  // 将输入值保留四位小数
+  const formattedValue = Math.round(Number(value) * 10000) / 10000;
+  return formattedValue;
 };
 
 // 计算采购总金额
-const handleChangeAmount = (e,index,key) => {
-  console.log(e,index,key)
-  formData.data.purchaseDetailList[index][key] = e
-  handleChangeProductAmount();
-  handleChangeOtherAmount();
-  let sum = 0;
+const handleChangeAmount = () => {
+  let productAmount = 0;
   for (let i = 0; i < formData.data.purchaseDetailList.length; i++) {
     const e = formData.data.purchaseDetailList[i];
-    e.amount = parseFloat(e.count * e.price).toFixed(2);
-    sum += Number(e.amount);
+    e.amount = formatNumber(parseFloat(e.count * e.price));
+    productAmount += Number(e.amount);
   }
+  formData.data.productAmount = formatNumber(productAmount);
+  // 其他收费
+  let otherAmount = 0;
   for (let i = 0; i < formData.data.otherFeeList.length; i++) {
     const e = formData.data.otherFeeList[i];
-    sum += Number(e.price);
+    otherAmount += Number(e.price);
   }
-  formData.data.amount = parseFloat(sum).toFixed(2);
+  formData.data.otherAmount = formatNumber(otherAmount);
+  formData.data.amount = formatNumber(
+    parseFloat(
+      Number(formData.data.productAmount) + Number(formData.data.otherAmount)
+    )
+  );
+};
+
+const handleChangeMoney = (val, index, key) => {
+  formData.data.purchaseDetailList[index][key] = formatNumber(val);
+  handleChangeAmount();
+};
+
+const handleChangeOtherMoney = (val, index, key) => {
+  formData.data.otherFeeList[index][key] = formatNumber(val);
+  handleChangeAmount();
 };
 
 const productUnit = ref([]);

+ 200 - 60
src/views/finance/fundManage/accountStatement/index.vue

@@ -22,7 +22,8 @@
             action: () => openModal('add'),
           },
         ]"
-        @get-list="getList">
+        @get-list="getList"
+      >
         <!-- <template #amount="{ item }">
           <div :style="'color: ' + (item.status === '10' ? '#04cb04;' : 'red;')">
             <span style="padding-right: 4px">{{ item.currency }}</span>
@@ -43,8 +44,15 @@
         <template #contractCodes="{ item }">
           <div style="width: 100%">
             <div v-if="item.contractCodes">
-              <div v-for="(contract, index) in item.contractCodes.split(',')" :key="index">
-                <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="openDetails(contract)">{{ contract }}</a>
+              <div
+                v-for="(contract, index) in item.contractCodes.split(',')"
+                :key="index"
+              >
+                <a
+                  style="color: #409eff; cursor: pointer; word-break: break-all"
+                  @click="openDetails(contract)"
+                  >{{ contract }}</a
+                >
               </div>
             </div>
           </div>
@@ -52,11 +60,28 @@
       </byTable>
     </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">
+    <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"
+      >
         <template #transactionTime>
           <div>
-            <el-date-picker v-model="formData.data.transactionTime" type="datetime" placeholder="请选择交易时间" value-format="YYYY-MM-DD HH:mm:ss" />
+            <el-date-picker
+              v-model="formData.data.transactionTime"
+              type="datetime"
+              placeholder="请选择交易时间"
+              value-format="YYYY-MM-DD HH:mm:ss"
+            />
           </div>
         </template>
         <template #money>
@@ -64,15 +89,34 @@
             <el-row :gutter="10">
               <el-col :span="6">
                 <el-form-item prop="status">
-                  <el-select v-model="formData.data.status" placeholder="请选择" style="width: 100%" @change="changeStatus()">
-                    <el-option v-for="item in status" :key="item.value" :label="item.label" :value="item.value" />
+                  <el-select
+                    v-model="formData.data.status"
+                    placeholder="请选择"
+                    style="width: 100%"
+                    @change="changeStatus()"
+                  >
+                    <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.data.currency" placeholder="请选择" style="width: 100%">
-                    <el-option v-for="item in accountCurrency" :key="item.value" :label="item.label" :value="item.value" />
+                  <el-select
+                    v-model="formData.data.currency"
+                    placeholder="请选择"
+                    style="width: 100%"
+                  >
+                    <el-option
+                      v-for="item in accountCurrency"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    />
                   </el-select>
                 </el-form-item>
               </el-col>
@@ -85,7 +129,8 @@
                     style="width: 100%"
                     :precision="2"
                     :controls="false"
-                    :min="0" />
+                    :min="0"
+                  />
                 </el-form-item>
               </el-col>
             </el-row>
@@ -95,7 +140,13 @@
           <div>
             <el-form-item prop="received">
               <el-radio-group v-model="formData.data.received">
-                <el-radio v-for="item in received" :key="item.value" :label="item.value" border>{{ item.label }}</el-radio>
+                <el-radio
+                  v-for="item in received"
+                  :key="item.value"
+                  :label="item.value"
+                  border
+                  >{{ item.label }}</el-radio
+                >
               </el-radio-group>
             </el-form-item>
           </div>
@@ -103,35 +154,82 @@
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large"
+          >确 定</el-button
+        >
       </template>
     </el-dialog>
 
-    <el-dialog :title="'退税登记'" v-if="dialogVisibleOne" v-model="dialogVisibleOne" width="600">
-      <byForm :formConfig="formConfigOne" :formOption="formOption" v-model="formData.dataOne" :rules="rulesOne" ref="submitOne" v-loading="loadingDialog">
+    <el-dialog
+      :title="'退税登记'"
+      v-if="dialogVisibleOne"
+      v-model="dialogVisibleOne"
+      width="600"
+    >
+      <byForm
+        :formConfig="formConfigOne"
+        :formOption="formOption"
+        v-model="formData.dataOne"
+        :rules="rulesOne"
+        ref="submitOne"
+        v-loading="loadingDialog"
+      >
         <template #details>
           <div style="width: 100%">
-            <el-button type="primary" @click="handleAddRow" style="margin: 10px 0"> 添加 </el-button>
+            <el-button
+              type="primary"
+              @click="handleAddRow"
+              style="margin: 10px 0"
+            >
+              添加
+            </el-button>
             <el-table :data="formData.dataOne.taxRefundDetailsList">
               <el-table-column prop="count" label="合同编号" min-width="150">
                 <template #default="{ row, $index }">
-                  <el-form-item :prop="'taxRefundDetailsList.' + $index + '.contractId'" :rules="rulesOne.contractId" :inline-message="true">
-                    <el-select v-model="row.contractId" placeholder="请选择" filterable style="width: 100%">
-                      <el-option v-for="item in contractList" :label="item.code" :value="item.id"> </el-option>
+                  <el-form-item
+                    :prop="'taxRefundDetailsList.' + $index + '.contractId'"
+                    :rules="rulesOne.contractId"
+                    :inline-message="true"
+                  >
+                    <el-select
+                      v-model="row.contractId"
+                      placeholder="请选择"
+                      filterable
+                      style="width: 100%"
+                    >
+                      <el-option
+                        v-for="item in contractList"
+                        :label="item.code"
+                        :value="item.id"
+                      >
+                      </el-option>
                     </el-select>
                   </el-form-item>
                 </template>
               </el-table-column>
               <el-table-column prop="amount" label="关联金额" min-width="150">
                 <template #default="{ row, $index }">
-                  <el-form-item :prop="'taxRefundDetailsList.' + $index + '.amount'" :rules="rulesOne.amount" :inline-message="true">
-                    <el-input-number onmousewheel="return false;" v-model="row.amount" :precision="2" :controls="false" :min="0" style="width: 100%" />
+                  <el-form-item
+                    :prop="'taxRefundDetailsList.' + $index + '.amount'"
+                    :rules="rulesOne.amount"
+                    :inline-message="true"
+                  >
+                    <el-input-number
+                      onmousewheel="return false;"
+                      v-model="row.amount"
+                      :precision="2"
+                      :controls="false"
+                      :min="0"
+                      style="width: 100%"
+                    />
                   </el-form-item>
                 </template>
               </el-table-column>
               <el-table-column prop="zip" label="操作" width="80">
                 <template #default="{ $index }">
-                  <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
+                  <el-button type="primary" link @click="handleRemove($index)"
+                    >删除</el-button
+                  >
                 </template>
               </el-table-column>
             </el-table>
@@ -139,8 +237,12 @@
         </template>
       </byForm>
       <template #footer>
-        <el-button @click="dialogVisibleOne = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitFormOne()" size="large">确 定</el-button>
+        <el-button @click="dialogVisibleOne = false" size="large"
+          >取 消</el-button
+        >
+        <el-button type="primary" @click="submitFormOne()" size="large"
+          >确 定</el-button
+        >
       </template>
     </el-dialog>
 
@@ -149,7 +251,9 @@
       <template #footer>
         <el-button @click="openPrint = false" size="large">取消</el-button>
         <el-button v-print="printObj" size="large">打印</el-button>
-        <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
+        <el-button type="primary" @click="clickDownload()" size="large"
+          >下载PDF</el-button
+        >
       </template>
     </el-dialog>
   </div>
@@ -330,11 +434,15 @@ const config = computed(() => {
             },
             el: "button",
             click() {
-              ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
-                confirmButtonText: "确定",
-                cancelButtonText: "取消",
-                type: "warning",
-              }).then(() => {
+              ElMessageBox.confirm(
+                "此操作将永久删除该数据, 是否继续?",
+                "提示",
+                {
+                  confirmButtonText: "确定",
+                  cancelButtonText: "取消",
+                  type: "warning",
+                }
+              ).then(() => {
                 proxy
                   .post("/accountRunningWater/delete", {
                     id: row.id,
@@ -375,23 +483,28 @@ const getCurrency = () => {
     });
 };
 const getAccountList = () => {
-  return proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 999 }).then((res) => {
-    if (res.rows && res.rows.length > 0) {
-      accountList.value = res.rows.map((item) => {
-        return {
-          label: item.alias,
-          value: item.id,
-        };
-      });
-      sourceList.value.pagination.accountManagementId = accountList.value[0].value;
-    }
-  });
+  return proxy
+    .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
+    .then((res) => {
+      if (res.rows && res.rows.length > 0) {
+        accountList.value = res.rows.map((item) => {
+          return {
+            label: item.alias,
+            value: item.id,
+          };
+        });
+        sourceList.value.pagination.accountManagementId =
+          accountList.value[0].value;
+      }
+    });
 };
 const getDict = () => {
   // 关联合同
-  proxy.post("/contract/page", { pageNum: 1, pageSize: 9999, status: 30 }).then((res) => {
-    contractList.value = res.rows;
-  });
+  proxy
+    .post("/contract/page", { pageNum: 1, pageSize: 9999, status: 30 })
+    .then((res) => {
+      contractList.value = res.rows;
+    });
 
   Promise.all([getCurrency(), getAccountList()]).then(() => {
     getList();
@@ -400,13 +513,15 @@ const getDict = () => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/accountRunningWater/page1", sourceList.value.pagination).then((res) => {
-    sourceList.value.data = res.rows;
-    sourceList.value.pagination.total = res.total;
-    setTimeout(() => {
-      loading.value = false;
-    }, 200);
-  });
+  proxy
+    .post("/accountRunningWater/page1", sourceList.value.pagination)
+    .then((res) => {
+      sourceList.value.data = res.rows;
+      sourceList.value.pagination.total = res.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
 };
 getDict();
 const modalType = ref("add");
@@ -520,11 +635,23 @@ const formConfigOne = computed(() => {
       label: "退税时间",
     },
     {
-      type: "selectInput",
+      type: "select",
+      prop: "currency",
+      label: "货币类型",
+      data: accountCurrency.value,
+      itemWidth: 30,
+    },
+    {
+      type: "number",
       prop: "amount",
-      selectProp: "currency",
       label: "退税金额",
-      data: accountCurrency.value,
+      itemWidth: 70,
+      precision: 2,
+      min: 0,
+      controls: false,
+      style: {
+        width: "100%",
+      },
     },
     {
       type: "title",
@@ -567,19 +694,29 @@ const formConfigOne = computed(() => {
 });
 
 const rules = ref({
-  accountManagementId: [{ required: true, message: "请选择账户", trigger: "change" }],
-  transactionTime: [{ required: true, message: "请选择交易时间", trigger: "change" }],
+  accountManagementId: [
+    { required: true, message: "请选择账户", trigger: "change" },
+  ],
+  transactionTime: [
+    { required: true, message: "请选择交易时间", trigger: "change" },
+  ],
   status: [{ required: true, message: "请选择收支类型", trigger: "change" }],
   currency: [{ required: true, message: "请选择币种", trigger: "change" }],
-  received: [{ required: true, message: "请选择合同是否到账", trigger: "change" }],
+  received: [
+    { required: true, message: "请选择合同是否到账", trigger: "change" },
+  ],
   amount: [{ required: true, message: "请输入金额", trigger: "blur" }],
   // name: [{ required: true, message: "请输入账户名称", trigger: "blur" }],
   // openingBank: [{ required: true, message: "请输入开户银行", trigger: "blur" }],
   // accountOpening: [{ required: true, message: "请输入银行账号", trigger: "blur" }],
 });
 const rulesOne = ref({
-  accountManagementId: [{ required: true, message: "请选择账户", trigger: "change" }],
-  transactionTime: [{ required: true, message: "请选择退税时间", trigger: "change" }],
+  accountManagementId: [
+    { required: true, message: "请选择账户", trigger: "change" },
+  ],
+  transactionTime: [
+    { required: true, message: "请选择退税时间", trigger: "change" },
+  ],
   currency: [{ required: true, message: "请选择币种", trigger: "change" }],
   // amount: [{ required: true, message: "请输入退税金额", trigger: "blur" }],
   contractId: [{ required: true, message: "请选择合同", trigger: "change" }],
@@ -658,7 +795,10 @@ const submitFormOne = () => {
         });
       }
     }
-    const total = submitData.taxRefundDetailsList.reduce((sum, crr) => (sum += crr.amount), 0);
+    const total = submitData.taxRefundDetailsList.reduce(
+      (sum, crr) => (sum += crr.amount),
+      0
+    );
     if (total !== Number(submitData.amount)) {
       return ElMessage({
         message: "关联合同明细的关联金额总合必须等于退税金额",

+ 0 - 2
src/views/salesMange/saleContract/contractSelect/index.vue

@@ -81,9 +81,7 @@ const sourceList = ref({
     pageNum: 1,
     pageSize: 10,
     keyword: "",
-    status: "30",
     sellCorporationId: "",
-    refundStatusNew: "0,10",
   },
 });
 const loading = ref(false);

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно