Browse Source

change: indent从编辑询价界面进入编辑报价时,显示全部已有报价信息.

peter 1 day ago
parent
commit
a6be9d189b

+ 11 - 8
src/pages/indent-manage/indent/components/info.vue

@@ -1079,12 +1079,12 @@ const {
   visible = 0,
   alreadyHasIndentCount = 0,
   parentId = 0,
-  dataForEdit = { vendor_name: '' } as any,
+  dataForEdit = [],
 } = defineProps<{
   visible: number
   alreadyHasIndentCount?: number
   parentId?: number | string
-  dataForEdit?: object
+  dataForEdit?: any[]
 }>()
 const $mediaRegExp = inject('mediaRegExp') as RegExp
 const prefix = 'order.indent_edit_info.'
@@ -1227,18 +1227,18 @@ const numberTableAddRow = function (index: number) {
   forms.value[index].price.push('')
   forms.value[index].days.push('')
 }
-// 仅编辑报价信息时需要初始化
-const initData = function () {
+// 20250630.在编辑询价界面进来也要显示所有报价信息, 即除了新建报价时(询价为空), 其实时候都需要遍历数据展示已有报价.
+const initData = function (d: any, index: number) {
   // 查询供应商候选列表, 不然下拉框无数据匹配, 下拉框界面上会显示成供应商的id
-  queryVenderList(dataForEdit.vendor_name, 0)
+  queryVenderList(d.vendor_name || '', index)
 
-  const temp = cloneDeep(dataForEdit)
+  const temp = cloneDeep(d)
 
   productImageList.value.push([])
   if (Array.isArray(temp.product_image) && temp.product_image.length) {
     nextTick(() => {
       productImageList.value.splice(
-        0,
+        index,
         1,
         temp.product_image.map((img: string) => {
           return {
@@ -1317,7 +1317,10 @@ watch(
     vendorList.value = []
 
     if (visible > 1) {
-      initData()
+      dataForEdit.forEach((i, index) => {
+        vendorList.value.push([])
+        initData(i, index)
+      })
     } else if (visible > 0) {
       addFormColumn()
     }

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

@@ -267,6 +267,8 @@
     </el-dialog>
     <editInfo
       v-model:visible="infoVisible"
+      :data-for-edit="quoteList"
+      :parent-id="form.entity_id || 0"
       @create="quotaCreated"
     ></editInfo>
     <sku-select
@@ -500,7 +502,7 @@ const customChange = (value: any) => {
 // 成功创建了报价, 把数据展示到界面
 const quotaCreated = (data: any) => {
   if (Array.isArray(data.content)) {
-    quoteList.value = quoteList.value.concat(data.content)
+    quoteList.value = data.content
   }
   ElNotification({
     type: 'warning',
@@ -524,7 +526,7 @@ const close = (done = {} as any) => {
 
 const infoVisible = ref(0)
 const addInfo = () => {
-  infoVisible.value = 1
+  infoVisible.value = quoteList.value.length ? 2 : 1
 }
 
 const $mediaRegExp = inject('mediaRegExp') as RegExp

+ 1 - 1
src/pages/indent-manage/indent/list.vue

@@ -393,7 +393,7 @@
 
     <compEditInfo
       v-model:visible="componentEditInfoVisible"
-      :data-for-edit="quoteForEdit"
+      :data-for-edit="[quoteForEdit]"
       :parent-id="infoParentId"
       @create="getList"
     ></compEditInfo>