Browse Source

发货单-添加选择虚拟产品按钮

jingbb 3 months ago
parent
commit
71fd959b52
1 changed files with 20 additions and 2 deletions
  1. 20 2
      src/views/saleCode/deliveryNotice/components/deliveryNoticeForm.vue

+ 20 - 2
src/views/saleCode/deliveryNotice/components/deliveryNoticeForm.vue

@@ -145,7 +145,8 @@
 		<!-- 子表单区域 -->
     <a-tabs v-model:activeKey="activeKey" animated  style=" padding: 24px;padding-top: 0px;">
       <a-tab-pane tab="发货通知单 - 发货明细(delivery details)" key="deliveryDetailFormProduct" :forceRender="true">
-        <a-button type="primary" @click="selectSaleOrderList"> 选择销售订单(selete saleOrder)</a-button>
+        <a-button type="primary" @click="selectSaleOrderList" style="margin-right: 1%;margin-bottom: 1%;"> 选择销售订单(selete saleOrder)</a-button>
+        <a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" @click="selectVirtualProducts"> 选择虚拟产品(select virtual products)</a-button>
         <j-vxe-table
           :keep-source="true"
           resizable
@@ -190,6 +191,7 @@
     </a-tabs>
     <BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesListRef"></BaseShipArchiveAccessoriesModal>
     <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
+    <SelectPrpductModal ref="SelectPrpductModalRef" @selectProduct="addProduct"></SelectPrpductModal>
     <SelectSaleOrderModal ref="SelectSaleOrderModalRef" @selectSaleOrder="addFormSaleOrder"></SelectSaleOrderModal>
  </a-spin>
 </template>
@@ -241,6 +243,7 @@
       const loading = ref(false);
       const formRef = ref();
       const SelectSaleOrderModalRef = ref();
+      const SelectPrpductModalRef =ref()
       var SelectProjectModalRef = ref()
       const deliveryNoticeFormShipTableRef = ref();
       const deliveryNoticeFormShipTable = reactive<Record<string, any>>({
@@ -545,6 +548,18 @@
           }
         }
       }
+      function selectVirtualProducts(){
+        SelectPrpductModalRef.value.getTableVirtual()
+      }
+      function addProduct(data){
+        data.map(item=>{
+          item.productClass = item.classId_dictText
+          item.productCode = item.code
+          item.productId = item.id
+        })
+        var arrProduct = deliveryDetailFormProductTable.dataSource.concat(data)
+        deliveryDetailFormProductTable.dataSource=arrProduct  
+      }
       return {
         deliveryNoticeFormShipTableRef,
         deliveryNoticeFormShipTable,
@@ -579,7 +594,10 @@
         selectSaleOrderList,
         SelectSaleOrderModalRef,
         addFormSaleOrder,
-        changeValues
+        changeValues,
+        selectVirtualProducts,
+        SelectPrpductModalRef,
+        addProduct
       }
     }
   });