Explorar el Código

feat: 受托收货单新增创建退货单功能,支持从受托收货单生成退货单

yusheng hace 9 meses
padre
commit
54ed245b67

+ 27 - 11
src/views/saleManage/saleOrder/entrustedReceive/index.vue

@@ -105,6 +105,7 @@
                 </el-link>
               </template>
             </el-popconfirm>
+
             <el-link
               type="primary"
               :underline="false"
@@ -114,6 +115,15 @@
             >
               创建发货单
             </el-link>
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="creatReturnGoods('entrustedReceive', row)"
+              v-if="[2].includes(row.reviewStatus)"
+            >
+              创建退货单
+            </el-link>
           </template>
         </ele-pro-table>
       </div>
@@ -143,6 +153,11 @@
       content="是否确定删除?"
       @done="commitBtn"
     />
+
+    <addReturnGoodsDialog
+      ref="addReturnGoodsRef"
+      @done="reload"
+    ></addReturnGoodsDialog>
     <process-submit-dialog
       :isNotNeedProcess="false"
       :processSubmitDialogFlag.sync="processSubmitDialogFlag"
@@ -164,16 +179,18 @@
   import {
     deleteSaleEntrustedReceiveAPI,
     getSaleEntrustedReceivePageAPI,
-    submit,getPSaleEntrustedReceiveDetailAPI
+    submit,
+    getPSaleEntrustedReceiveDetailAPI
   } from '@/api/saleManage/entrustedReceive';
   // import AddOrEditDialog from '@/views/saleManage/saleOrder/customerReturnOrder/addOrEditDialog.vue';
   import addInvoiceDialog from '@/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue';
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { getWarehouseListByIds } from '@/api/purchasingManage/returnGoods';
+  import addReturnGoodsDialog from '@/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog';
 
   export default {
-    mixins: [dictMixins,tabMixins],
+    mixins: [dictMixins, tabMixins],
     components: {
       processSubmitDialog,
       addInvoiceDialog,
@@ -182,7 +199,8 @@
       popModal,
       orderDetailDialog,
       addOrEditDialog,
-      detailDialog
+      detailDialog,
+      addReturnGoodsDialog
     },
     data() {
       return {
@@ -300,7 +318,7 @@
             fixed: 'right'
           }
         ],
-        cacheKeyUrl:'eos-00bf7292-saleManage-entrustedReceive',
+        cacheKeyUrl: 'eos-00bf7292-saleManage-entrustedReceive'
       };
     },
     computed: {},
@@ -314,7 +332,10 @@
           ...where
         });
       },
-
+      //创建退货单
+      creatReturnGoods(type, row) {
+        this.$refs.addReturnGoodsRef.open('add', {}, row.id, true);
+      },
       //创建收货单
       creatSendGoods(type, row) {
         this.$refs.invoiceDialogRef.entrustedReceiveInit(row);
@@ -323,8 +344,7 @@
       /* 刷新表格 */
       reload(where) {
         this.$refs.table.reload({ page: 1, where });
-        this.$emit('getToDoReminder')
-
+        this.$emit('getToDoReminder');
       },
 
       //新增编辑
@@ -362,14 +382,12 @@
         this.remove(dataId);
       },
       async sendSubmit(res) {
-
         const data = await getPSaleEntrustedReceiveDetailAPI(res.id);
         let storemanIds = '';
         let ids = data.productList.map((item) => item.warehouseId);
         let warehouseList = await getWarehouseListByIds(ids || []);
         storemanIds = warehouseList.map((item) => item.ownerId);
 
-
         this.processSubmitDialogFlag = true;
         this.$nextTick(() => {
           let params = {
@@ -382,12 +400,10 @@
               businessName: res.productNames,
               businessType: '受托收货'
             }
-        
           };
 
           this.$refs.processSubmitDialogRef.init(params);
         });
-     
       },
       //查看详情
       openorderDetail(row, type) {

+ 5 - 2
src/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog.vue

@@ -752,7 +752,7 @@
       },
 
       //打开新增编辑弹框
-      async open(type, row, sendId) {
+      async open(type, row, sendId,isEntrustedReceive) {
         this.title = type === 'add' ? '新增' : '修改';
         this.row = row;
         this.visible = true;
@@ -763,8 +763,11 @@
         if (row && row?.id) {
           await this.getReturnSaleOrderrecordDetail(row?.id);
         }
-        if (sendId) {
+        if (sendId&&!isEntrustedReceive) {
           await this.getSendSaleOrderDetail(sendId);
+        }else{
+          this.form.returnSourceType = 2;
+          await this.getInfo({id:sendId})
         }
         this.isUpdate = type != 'add';
       },