hurx 4 päivää sitten
vanhempi
sitoutus
acbff9445e

+ 8 - 2
src/views/customer/customerFile/customerInfo/overview/erpSaleInfo.vue

@@ -251,7 +251,7 @@ const loadCurrencyList = async () => {
       pageSize: 1000
     });
     currencyList.value = res.rows || [];
-    if (res.rows && res.rows.length > 0) {
+    if (res.rows && res.rows.length > 0 && !salesForm.dealCurrencyId) {
       salesForm.dealCurrencyId = res.rows[0].id;
     }
   } catch (error) {
@@ -269,7 +269,7 @@ const loadTaxrateList = async () => {
       pageSize: 1000
     });
     taxrateList.value = res.rows || [];
-    if (res.rows && res.rows.length > 0) {
+    if (res.rows && res.rows.length > 0 && !salesForm.rateId) {
       salesForm.rateId = res.rows[0].id;
     }
   } catch (error) {}
@@ -353,6 +353,12 @@ const loadCustomerData = async (id: any) => {
       if (!salesForm.unitPrice) salesForm.unitPrice = 'True';
       if (!salesForm.creditLimit) salesForm.creditLimit = '1';
       if (!salesForm.creditTimeLimit) salesForm.creditTimeLimit = '1';
+      if (!salesForm.dealCurrencyId && currencyList.value.length > 0) {
+        salesForm.dealCurrencyId = currencyList.value[0].id;
+      }
+      if (!salesForm.rateId && taxrateList.value.length > 0) {
+        salesForm.rateId = taxrateList.value[0].id;
+      }
 
       // 如果有部门ID,且部门不在列表中,从API获取
       if (salesForm.belongingDepartmentId) {