cz 1 vuosi sitten
vanhempi
commit
bfe473bbff

+ 3 - 3
src/components/testForm/index.vue

@@ -214,6 +214,7 @@
             @click="handleRemove(index, btnConfigCopy)"
             size="mini"
             style="border: none; background: #ecebeb"
+            :disabled="formOption.readonly"
             v-if="formOption.btnConfig !== undefined && formOption.btnConfig.isNeed"
             >删除</van-button
           >
@@ -325,10 +326,9 @@
 </template>
 
 <script setup>
-import { showLoadingToast, closeToast } from "vant";
+import { showLoadingToast, closeToast, showNotify } from "vant";
 import { formatDate } from "@/utils/auth";
-import { ref, getCurrentInstance, computed, toRefs, watch } from "vue";
-
+import { ref, getCurrentInstance, onMounted, reactive, computed, toRefs, watch } from "vue";
 const props = defineProps({
   modelValue: {
     type: Object,

+ 5 - 5
src/views/processApproval/components/Contract.vue

@@ -798,7 +798,7 @@ const calculatedAmount = () => {
     for (let i = 0; i < formData.data.contractProductList.length; i++) {
       let money = 0;
       if (formData.data.contractProductList[i].quantity && formData.data.contractProductList[i].price) {
-        money = parseFloat(Number(formData.data.contractProductList[i].quantity) * Number(formData.data.contractProductList[i].price)).toFixed(2);
+        money = Number(Math.round(Number(formData.data.contractProductList[i].quantity) * Number(formData.data.contractProductList[i].price) * 10000) / 10000);
       }
       formData.data.contractProductList[i].amount = money;
     }
@@ -812,16 +812,16 @@ const handleChangeAmount = () => {
   if (formData.data.contractProductList && formData.data.contractProductList.length > 0) {
     for (let i = 0; i < formData.data.contractProductList.length; i++) {
       if (formData.data.contractProductList[i].amount) {
-        money = parseFloat(Number(money) + Number(formData.data.contractProductList[i].amount)).toFixed(2);
-        amountProduct = parseFloat(Number(amountProduct) + Number(formData.data.contractProductList[i].amount)).toFixed(2);
+        money = Number(Math.round((Number(money) + Number(formData.data.contractProductList[i].amount)) * 10000) / 10000);
+        amountProduct = Number(Math.round((Number(amountProduct) + Number(formData.data.contractProductList[i].amount)) * 10000) / 10000);
       }
     }
   }
   if (formData.data.contractProjectList && formData.data.contractProjectList.length > 0) {
     for (let i = 0; i < formData.data.contractProjectList.length; i++) {
       if (formData.data.contractProjectList[i].amount) {
-        money = parseFloat(Number(money) + Number(formData.data.contractProjectList[i].amount)).toFixed(2);
-        amountProject = parseFloat(Number(amountProject) + Number(formData.data.contractProjectList[i].amount)).toFixed(2);
+        money = Number(Math.round((Number(money) + Number(formData.data.contractProjectList[i].amount)) * 10000) / 10000);
+        amountProduct = Number(Math.round((Number(amountProduct) + Number(formData.data.contractProjectList[i].amount)) * 10000) / 10000);
       }
     }
   }

+ 7 - 5
src/views/processApproval/components/PriceSheet.vue

@@ -683,7 +683,9 @@ const calculatedAmount = () => {
     for (let i = 0; i < formData.data.quotationProductList.length; i++) {
       let money = 0;
       if (formData.data.quotationProductList[i].quantity && formData.data.quotationProductList[i].price) {
-        money = parseFloat(Number(formData.data.quotationProductList[i].quantity) * Number(formData.data.quotationProductList[i].price)).toFixed(2);
+        money = Number(
+          Math.round(Number(formData.data.quotationProductList[i].quantity) * Number(formData.data.quotationProductList[i].price) * 10000) / 10000
+        );
       }
       formData.data.quotationProductList[i].amount = money;
     }
@@ -697,16 +699,16 @@ const handleChangeAmount = () => {
   if (formData.data.quotationProductList && formData.data.quotationProductList.length > 0) {
     for (let i = 0; i < formData.data.quotationProductList.length; i++) {
       if (formData.data.quotationProductList[i].amount) {
-        money = parseFloat(Number(money) + Number(formData.data.quotationProductList[i].amount)).toFixed(2);
-        amountProduct = parseFloat(Number(amountProduct) + Number(formData.data.quotationProductList[i].amount)).toFixed(2);
+        money = Number(Math.round((Number(money) + Number(formData.data.quotationProductList[i].amount)) * 10000) / 10000);
+        amountProduct = Number(Math.round((Number(amountProduct) + Number(formData.data.quotationProductList[i].amount)) * 10000) / 10000);
       }
     }
   }
   if (formData.data.quotationPayList && formData.data.quotationPayList.length > 0) {
     for (let i = 0; i < formData.data.quotationPayList.length; i++) {
       if (formData.data.quotationPayList[i].amount) {
-        money = parseFloat(Number(money) + Number(formData.data.quotationPayList[i].amount)).toFixed(2);
-        amountProject = parseFloat(Number(amountProject) + Number(formData.data.quotationPayList[i].amount)).toFixed(2);
+        money = Number(Math.round((Number(money) + Number(formData.data.quotationPayList[i].amount)) * 10000) / 10000);
+        amountProduct = Number(Math.round((Number(amountProduct) + Number(formData.data.quotationPayList[i].amount)) * 10000) / 10000);
       }
     }
   }

+ 56 - 6
src/views/processApproval/components/SendPurchase.vue

@@ -65,7 +65,7 @@
           readonly
           :label="$t('procureList.supplier')"
           :placeholder="$t('procureList.selectSupplier')"
-          @click="typeModal = true"
+          @click="handleSupplyClick"
           :rules="[
             {
               required: true,
@@ -88,15 +88,15 @@
           :name="$t('procureList.procurementDescription')"
           :label="$t('procureList.procurementDescription')"
           :placeholder="$t('procureList.pleaseFillInTheProcurementDescription')"
-          :rules="[
+          rows="3"
+        />
+        <!-- :rules="[
             {
               required: true,
               message: $t('procureList.procurementDescriptionCanNotBeEmpty'),
             },
           ]"
-          required
-          rows="3"
-        />
+          required -->
       </van-cell-group>
 
       <!-- 明细列表 -->
@@ -290,6 +290,18 @@ const changePrice = (index) => {
     0
   );
 };
+const changeAmount = () => {
+  for (let i = 0; i < formData.value.purchaseDetailList.length; i++) {
+    const e = formData.value.purchaseDetailList[i];
+    e.amount = (e.count * e.price).toFixed(2);
+  }
+  formData.value.amount = formData.value.purchaseDetailList.reduce(
+    (total, item) => {
+      return total + Number(item.amount);
+    },
+    0
+  );
+};
 
 const getDetails = (id) => {
   proxy.post("/subscribe/detail", { id: id }).then((res) => {
@@ -309,7 +321,12 @@ const getDetails = (id) => {
 const columns = ref([]);
 const columnsOne = ref([]);
 const submitType = ref("add");
-
+const handleSupplyClick = () => {
+  if (route.query.processType == 10 || route.query.processType == 20) {
+    return false;
+  }
+  typeModal.value = true;
+};
 const onConfirm = ({ selectedOptions }) => {
   formData.value.supplyId = selectedOptions[0].value;
   formData.value.supplyName = selectedOptions[0].text;
@@ -413,6 +430,39 @@ watch(
     deep: true,
   }
 );
+
+watch(
+  () => formData.value.supplyId,
+  (val) => {
+    const ids = formData.value.purchaseDetailList.map((x) => x.bussinessId);
+    // console.log(val, "ss");
+    if (val && ids.length > 0) {
+      proxy
+        .post("/supplierPrice/getSupplierPriceByProductIds", {
+          supplierInfoId: val,
+          productIdList: ids,
+        })
+        .then((res) => {
+          if (res.data && Object.keys(res.data).length > 0) {
+            for (let i = 0; i < formData.value.purchaseDetailList.length; i++) {
+              const e = formData.value.purchaseDetailList[i];
+              for (const key in res.data) {
+                if (e.bussinessId === key) {
+                  e.price = Number(res.data[key]);
+                }
+              }
+            }
+          } else {
+            for (let i = 0; i < formData.value.purchaseDetailList.length; i++) {
+              const e = formData.value.purchaseDetailList[i];
+              e.price = 0;
+            }
+          }
+          changeAmount();
+        });
+    }
+  }
+);
 </script>
 <style lang="scss" scoped>
 .row {

+ 4 - 0
src/views/processApproval/components/SendPurchasePayment.vue

@@ -559,6 +559,10 @@ watch(
       formDom.value.formDataListShowLabelOne();
       formDomOne.value.formDataShowLabelOne();
     }
+    if (route.query.processType == 10 || route.query.processType == 20) {
+      formOption.readonly = true;
+      formOptionOne.readonly = true;
+    }
   },
   {
     deep: true,

+ 2 - 1
src/views/processApproval/processDtl.vue

@@ -181,7 +181,7 @@ const handleSubmit = async (_type) => {
 				proxy
 					.post('/flowExample/setStartData', {
 						exampleId: route.query.id,
-						startDate: childrenData,
+						startData: childrenData,
 					})
 					.then()
 			}
@@ -197,6 +197,7 @@ const handleSubmit = async (_type) => {
 					proxy.$router.go(-1)
 				})
 		}
+		proxy.$router.go(-1)
 	}
 }
 

+ 1 - 0
src/views/procurementManagement/procureList/index.vue

@@ -79,6 +79,7 @@ const onLoad = () => {
 };
 let ids = [];
 const onCkeckbox = (row) => {
+  ids = [];
   row.map((i) => {
     ids.push(i.id);
   });

+ 2 - 0
src/views/procurementManagement/receipt/index.vue

@@ -38,6 +38,7 @@
 <script setup>
 import { ref, getCurrentInstance } from "vue";
 import commonList from "@/components/common-list.vue";
+import { showSuccessToast, showFailToast } from "vant";
 
 const proxy = getCurrentInstance().proxy;
 const onClickLeft = () => proxy.$router.push("/main/working");
@@ -146,6 +147,7 @@ const listConfig = ref([
 let ids = [];
 let selectData = ref([]);
 const handleSelectData = (row) => {
+  ids = [];
   selectData.value = row;
   row.map((i) => {
     ids.push(i.id);

+ 4 - 1
src/views/salesContract/priceSheet/index.vue

@@ -32,7 +32,7 @@ const req = ref({
 const finished = ref(false);
 const onRefresh = () => {
   req.value.pageNum = 1;
-  finished.value = false;
+  finished.value = true;
   getList("refresh");
 };
 const loading = ref(false);
@@ -64,6 +64,7 @@ const status = ref([
   },
 ]);
 const getList = (type) => {
+  console.log(type);
   loading.value = true;
   proxy
     .post("/saleQuotation/page", req.value)
@@ -88,6 +89,8 @@ const getList = (type) => {
       listData.value = type === "refresh" ? res.data.rows : listData.value.concat(res.data.rows);
       if (req.value.pageNum * 10 >= res.data.total) {
         finished.value = true;
+      }else{
+        finished.value = false;
       }
       req.value.pageNum++;
       loading.value = false;