2 次代码提交 2b4a1945b2 ... 3fd059c691

作者 SHA1 备注 提交日期
  peter 3fd059c691 fix: indent计价.dtd.lcl修复. 1 月之前
  peter 6538ab2be4 fix: indnet客户名供应商名搜索候选. 1 月之前

+ 13 - 11
src/pages/indent-manage/indent/components/calcPrice/index.vue

@@ -1139,12 +1139,6 @@ let generateStep3Form = (withOldData = false) => {
             .chain(i.product_cost)
             .add(i.extend_cost)
             .add(temp.freight_cost)
-            // .add(
-            //   mathjs
-            //     .chain(temp.cn_freight_cost)
-            //     .divide(setting.value.rate_rmb_aud)
-            //     .done(),
-            // )
             .add(
               withOldData
                 ? oldData[`cal_quote_${n}_${i.number}`].tax_fee
@@ -1164,9 +1158,13 @@ let generateStep3Form = (withOldData = false) => {
         } else if (n === 3) {
           temp.local_freight_cost = 0
           temp.add_freight_cost = 0
-          temp.freight_cost = mathjs
+          // 记录中途运费, 用在step3表单项变更后的重复计算
+          temp.midway_price = mathjs
             .chain(i[`freight_cost_${n}`])
             .add(i[`city_price_${n}`])
+            .done()
+          temp.freight_cost = mathjs
+            .chain(temp.midway_price)
             .add(
               mathjs
                 .chain(temp.cn_freight_cost)
@@ -1206,9 +1204,15 @@ let generateStep3Form = (withOldData = false) => {
         } else if (n === 4) {
           temp.local_freight_cost = 0
           temp.add_freight_cost = 0
-          temp.freight_cost = mathjs
+          temp.local_freight_cost = 0
+          temp.add_freight_cost = 0
+          // 记录中途运费, 用在step3表单项变更后的重复计算
+          temp.midway_price = mathjs
             .chain(i[`freight_cost_${n}`])
             .add(i[`city_price_${n}`])
+            .done()
+          temp.freight_cost = mathjs
+            .chain(temp.midway_price)
             .add(
               mathjs
                 .chain(temp.cn_freight_cost)
@@ -1301,8 +1305,6 @@ let generateStep3Form = (withOldData = false) => {
         exportForm.value[`cycle_name_${n}_${i.number}`] = 'weeks'
 
         if (withOldData === true) {
-          console.log('witholdata true')
-          console.log(oldData, 'oldData')
           if (oldData[`cal_quote_${n}_${i.number}`]) {
             const cloneData = cloneDeep(oldData[`cal_quote_${n}_${i.number}`])
             cloneData.freight_cost = cloneData.freight
@@ -1315,7 +1317,7 @@ let generateStep3Form = (withOldData = false) => {
             oldData[`cycle_name_${n}_${i.number}`] || 'weeks'
         }
 
-        console.log(temp, 'temp')
+        // console.log(temp, 'temp')
         result.push(temp)
       }
     }

+ 3 - 1
src/pages/indent-manage/indent/components/info.vue

@@ -1330,7 +1330,7 @@ const queryVenderList = function (keyword: string, index: number) {
   getVendorList({ keywords }).then((response: any) => {
     const defaultCreateOption = {
       name: keywords,
-      id: '',
+      id: keywords,
     }
     if (Array.isArray(response.result)) {
       const tempStr = keywords.replace(/\S_-/g, '').toLowerCase()
@@ -1345,6 +1345,8 @@ const queryVenderList = function (keyword: string, index: number) {
           // 结果里面没找到输入的搜索字符串, 就把它加入到结果里面当成‘新增的’
           result = [cloneDeep(defaultCreateOption)].concat(response.result)
         }
+      } else if (keywords.length) {
+        result = [cloneDeep(defaultCreateOption)]
       }
       if (manualVendor.value.id) {
         vendorList.value.splice(index, 1, [manualVendor.value].concat(result))

+ 4 - 4
src/pages/indent-manage/indent/edit.vue

@@ -25,7 +25,7 @@
             prop="custom_name"
           >
             <el-select
-              v-model="form.custom_id"
+              v-model="form.custom_name"
               style="width: 100%"
               :placeholder="$t('text_please_select')"
               :remote-method="debounce(getCustomListFun, 500)"
@@ -39,7 +39,7 @@
                 v-for="(option, index) in customList"
                 :key="option.id || index"
                 :label="option.name"
-                :value="option.id"
+                :value="option.name"
               ></el-option>
             </el-select>
           </el-form-item>
@@ -493,9 +493,9 @@ const selectSku = (data: any) => {
   form.value.item_id = data.id || ''
 }
 const customChange = (value: any) => {
-  const temp = customList.value.filter((i: any) => i.id === value)
+  const temp = customList.value.filter((i: any) => i.name === value)
   // id为空且custom_name有值是新增
-  form.value.custom_name = temp.length ? temp[0].name : '-'
+  form.value.custom_id = temp.length ? temp[0].id : ''
 }
 // 成功创建了报价, 把数据展示到界面
 const quotaCreated = (data: any) => {