Ver código fonte

feat: indent转单.增加sku信息.

peter 1 mês atrás
pai
commit
0a39a2c5bc

+ 52 - 1
src/pages/indent-manage/indent/components/quoteRecord.vue

@@ -23,6 +23,28 @@
               label-width="140"
             >
               <div class="flex justify-between flex-wrap">
+                <el-form-item
+                  label="SKU"
+                  style="height: 40px"
+                >
+                  <div
+                    class="el-input el-input__wrapper el-input__inner fake-sku-input"
+                    @click="openSkuSelect(props.$index)"
+                  >
+                    <span class="cursor-pointer">
+                      {{ formList[props.$index].product_sku }}
+                    </span>
+                  </div>
+                </el-form-item>
+                <el-form-item
+                  label="产品名称"
+                  prop="product_name"
+                >
+                  <el-input
+                    v-model="formList[props.$index].product_name"
+                    disabled
+                  ></el-input>
+                </el-form-item>
                 <el-form-item
                   :rules="{
                     required: true,
@@ -321,6 +343,11 @@
         <el-button @click="show2 = false">关闭</el-button>
       </div>
     </el-dialog>
+
+    <sku-select
+      v-model:visible="skuSelectVisible"
+      @select="selectSku"
+    ></sku-select>
   </div>
 </template>
 <script lang="ts" setup>
@@ -344,12 +371,19 @@ import {
 } from 'element-plus'
 import { Notebook } from '@element-plus/icons-vue'
 import { getCalcPriceRecord, generateOrder } from '@/api/indent'
+import skuSelect from './skuSelect.vue'
+
 defineComponent({
   name: 'ComponentQuoteRecord',
 })
-const { visible = false, id = '' } = defineProps<{
+const {
+  visible = false,
+  id = '',
+  indentData = {} as any,
+} = defineProps<{
   visible: boolean
   id: string | number
+  indentData: object
 }>()
 const $emit = defineEmits(['update:visible', 'success'])
 let show = ref(false)
@@ -387,6 +421,9 @@ const getCalcPriceRecordFunc = () => {
         const v = list.value[i].Accounts || ({} as any)
         // remoteOption.value.push([])
         formList.value.push({
+          item_id: indentData.item_id || '',
+          product_name: indentData.product_name || '',
+          product_sku: indentData.product_sku || '',
           Contract_Title: '',
           Expected_Delivery_Date: '',
           Brand_Name: '',
@@ -509,6 +546,20 @@ const onChangeOrderClick = (row: any) => {
 //     target.push({ value: 1, label: 1 })
 //   }
 // }
+const skuSelectVisible = ref(false)
+const openSkuSelect = (key: any) => {
+  skuSelectVisible.value = true
+}
+const selectSku = (data: any) => {
+  formList.value = formList.value.map((i: any) => {
+    return {
+      ...i,
+      product_name: data.product_name || '',
+      product_sku: data.product_sku || '',
+      item_id: data.id || '',
+    }
+  })
+}
 </script>
 <style lang="scss">
 .dialog-change-order {

+ 9 - 2
src/pages/indent-manage/indent/list.vue

@@ -408,6 +408,7 @@
     </el-dialog>
     <dialogQuoteRecord
       :id="changeOrderID"
+      :indent-data="indentData"
       v-model:visible="dialogChangeOrderVisible"
       @success="onDialogChangeOrderClose"
     ></dialogQuoteRecord>
@@ -694,7 +695,7 @@ const componentEditVisible = ref(0) // 1 新增, 2编辑. 0关闭
 const componentFreightVisible = ref(false) // 设置运费参数
 const componentEditInfoVisible = ref(0) // 编辑报价信息
 const componentCalcPriceVisible = ref(false) // 计价
-const indentData = ref({}) // 修改询价的时候使用
+const indentData = ref({}) // 修改询价和转单的时候使用, 记录的是询价的行数据.
 const quoteForEdit = ref({}) // 修改和计价时共用, 只是用作传递给子组件数据的变量
 const infoParentId = ref(0)
 const loading = ref(false)
@@ -970,10 +971,12 @@ const onBtnChangeOrderClick = (row: any, parentRow: any) => {
         },
       ).then(() => {
         changeOrderID.value = row.id
+        indentData.value = parentRow
         dialogChangeOrderVisible.value = true
       })
     } else {
       changeOrderID.value = row.id
+      indentData.value = parentRow
       dialogChangeOrderVisible.value = true
     }
   }
@@ -982,9 +985,13 @@ const onDialogChangeOrderClose = () => {
   getList()
   dialogChangeOrderVisible.value = false
   changeOrderID.value = ''
+  indentData.value = {}
 }
 watch(dialogChangeOrderVisible, () => {
-  if (!dialogChangeOrderVisible.value) changeOrderID.value = ''
+  if (!dialogChangeOrderVisible.value) {
+    indentData.value = {}
+    changeOrderID.value = ''
+  }
 })
 
 const auditUser = ref('')