姜永辉 пре 2 година
родитељ
комит
4eca3f5bfe

+ 1 - 1
api/pages/ivt/inboundProcessing.js

@@ -39,7 +39,7 @@ module.exports = {
       chooseOrg: { key: 'chooseOrg', url: '/package-base-select/pages/select-data/select-data', type: 'org' },
       chooseOrg: { key: 'chooseOrg', url: '/package-base-select/pages/select-data/select-data', type: 'org' },
       chooseWh: { key: 'chooseWh', url: '/package-base-select/pages/select-data/select-data', type: 'warehouse' },
       chooseWh: { key: 'chooseWh', url: '/package-base-select/pages/select-data/select-data', type: 'warehouse' },
       choosePurchaseOrder: { key: 'choosePurchaseOrder', url: '/package-purchase/pages/purchase-receipt/choose-purchase-order/choose-purchase-order' },
       choosePurchaseOrder: { key: 'choosePurchaseOrder', url: '/package-purchase/pages/purchase-receipt/choose-purchase-order/choose-purchase-order' },
-
+      openingInventory: { key: 'openingInventory', url: '/package-base-select/pages/select-data/select-data',type:'warehouse'  },
 
 
     }
     }
   }
   }

+ 6 - 0
api/pages/ivt/outbound.js

@@ -16,10 +16,16 @@ module.exports = {
 
 
   routeUrl: {
   routeUrl: {
     outbound: { 
     outbound: { 
+      returnCancel: { key: 'returnCancel', method: 'returnCancel' },
       invaidOrder: { key: 'invaidOrder', method: 'invaidOrder' },
       invaidOrder: { key: 'invaidOrder', method: 'invaidOrder' },
       editOrder: { key: 'editOrder', method: 'editOrder', primaryKey: 'outId' },
       editOrder: { key: 'editOrder', method: 'editOrder', primaryKey: 'outId' },
+      addReturn: {
+        key: 'addReturn', url: '/package-purchase/pages/purchase-return/add/add'
+      },
       add: { key: 'add', url: '/package-sales/pages/sales-outbound/add/add'  },
       add: { key: 'add', url: '/package-sales/pages/sales-outbound/add/add'  },
       edit: { key: 'edit', url: '/package-inventory/pages/outbound-processing/detail/detail' },
       edit: { key: 'edit', url: '/package-inventory/pages/outbound-processing/detail/detail' },
+      // 采购退货的详细
+      editReturn: { key: 'editReturn', url: '/package-inventory/pages/warehousing-processing/detail/detail' },
       addOther: { key: 'addOther', url: '/package-inventory/pages/other-outbound/other-outbound' },
       addOther: { key: 'addOther', url: '/package-inventory/pages/other-outbound/other-outbound' },
       chooseSupplier: { key: 'chooseSupplier', url: '/package-base-select/pages/select-data/select-data',type:'supplier'  },
       chooseSupplier: { key: 'chooseSupplier', url: '/package-base-select/pages/select-data/select-data',type:'supplier'  },
       chooseStaff: { key: 'chooseStaff', url: '/package-base-select/pages/select-data/select-data',type:'staff'  },
       chooseStaff: { key: 'chooseStaff', url: '/package-base-select/pages/select-data/select-data',type:'staff'  },

+ 2 - 0
api/pages/ivt/outboundOther.js

@@ -15,6 +15,8 @@ module.exports = {
     otheroutBoundUpdate: 'outbound_update',
     otheroutBoundUpdate: 'outbound_update',
     outBoundHandle:'outbound_handle',
     outBoundHandle:'outbound_handle',
     outboundRepeal: 'repeal/',
     outboundRepeal: 'repeal/',
+    selectOutbound:'select_outbound',
+    outBoundCancel: 'outbound_cancel',
   },
   },
 
 
   routeUrl: {
   routeUrl: {

+ 1 - 0
api/pages/ivt/outboundProcessing.js

@@ -13,6 +13,7 @@ module.exports = {
     prefix: 'mdm-server/ivt/outbound_sale_order/',
     prefix: 'mdm-server/ivt/outbound_sale_order/',
     outBoundHandle: 'outbound_handle',
     outBoundHandle: 'outbound_handle',
     outboundRepeal: 'repeal/',
     outboundRepeal: 'repeal/',
+    outBoundCancel: 'sale_order_outbound_cancel',
   },
   },
 
 
   routeUrl: {
   routeUrl: {

+ 13 - 12
package-inventory/pages/outbound-processing/detail/detail.js

@@ -70,15 +70,14 @@ Page({
     outboundSaleReturnService: app.globalData['outboundSaleReturnService'],
     outboundSaleReturnService: app.globalData['outboundSaleReturnService'],
     // 主键Id
     // 主键Id
     primaryKey: 'outId',
     primaryKey: 'outId',
-    table: Constants.tables.t_psi_outbound,
+    table: Constants.tables.outbound,
   },
   },
   /**
   /**
    * @desc : dk-from choose 回调事件
    * @desc : dk-from choose 回调事件
    * @date : 2024/2/1 15:49
    * @date : 2024/2/1 15:49
    * @author : 姜永辉
    * @author : 姜永辉
    */
    */
-  chooseData(e) {
-    console.log("t", e, this.data.formData);
+  chooseData(e) { 
     let formData = JSON.parse(this.data.formData)
     let formData = JSON.parse(this.data.formData)
     let code = e.detail.code
     let code = e.detail.code
     let data = e.detail.data.data
     let data = e.detail.data.data
@@ -112,14 +111,18 @@ Page({
    * @date : 2024/2/1 15:49
    * @date : 2024/2/1 15:49
    * @author : 姜永辉
    * @author : 姜永辉
    */
    */
-  setValuesByEdit(data) {
-    console.log("setValuesByEdit", data);
+  setValuesByEdit(data) { 
     let cardList_ = this.data.cardList
     let cardList_ = this.data.cardList
     let contentList_ = this.data.contentList
     let contentList_ = this.data.contentList
     let sumitemAmt = 0
     let sumitemAmt = 0
     let formType = this.data.formType
     let formType = this.data.formType
+    // 入库对象
+    if (data.outType == Constants.outType.other) {
+      data.outObject = (data.supId!=null)?data.supId:data.cusId
+      data.outObjectName = (data.supplierName!=null)?data.supplierName:data.cusName
+  }       
     //  出库状态-已出库
     //  出库状态-已出库
-    if (data.outStatus == Constants.outStatus.unOutBound) {
+    if (data.outStatus == Constants.outStatus.outBounded) {
       //查询采购订单表 未出库的 详细 
       //查询采购订单表 未出库的 详细 
       this.setData({
       this.setData({
         buttonList: [{
         buttonList: [{
@@ -136,10 +139,10 @@ Page({
       })
       })
     }
     }
 
 
-    sumitemAmt = Number(data.outingQty) * Number(data.outingAmt)
+    sumitemAmt =   Number(data.outingAmt)
     cardList_.forEach(card => {
     cardList_.forEach(card => {
       if (card.name === 'items') {
       if (card.name === 'items') {
-        if (formType == 1) {
+        if (data.outStatus == Constants.outStatus.outBounding) {
           card.info = "(" + mixins.$t("outboundProcessing") + ")"
           card.info = "(" + mixins.$t("outboundProcessing") + ")"
           card.color = "#E4002B"
           card.color = "#E4002B"
         } else {
         } else {
@@ -186,8 +189,7 @@ Page({
   setGoods(e) {
   setGoods(e) {
     let contentList_ = this.data.contentList
     let contentList_ = this.data.contentList
     let cardList = this.data.cardList
     let cardList = this.data.cardList
-    let formData = JSON.parse(this.data.formData)
-    console.log("formData.goodsList", formData.goodsList);
+    let formData = JSON.parse(this.data.formData) 
     let totalAmout = Number(0)
     let totalAmout = Number(0)
     // 各个明细的金额数量
     // 各个明细的金额数量
     formData.goodsList.forEach(element => {  //循环出商品总共价格   
     formData.goodsList.forEach(element => {  //循环出商品总共价格   
@@ -297,8 +299,7 @@ Page({
       params.outQty = 0     //  已出库数量   
       params.outQty = 0     //  已出库数量   
     }
     }
     params.itemList = formData.goodsList //商品明细
     params.itemList = formData.goodsList //商品明细
-
-    console.log("setParams", params);
+    params.annexPaths = formData.annexPaths || [] //附件  
     return params
     return params
   },
   },
   /**
   /**

+ 105 - 28
package-inventory/pages/outbound-processing/outbound-processing.js

@@ -8,7 +8,6 @@
  *******************************************************************************/
  *******************************************************************************/
 const Constants = require('@/utils/Constants.js');
 const Constants = require('@/utils/Constants.js');
 const mixins = require('@/mixins/index.js');
 const mixins = require('@/mixins/index.js');
-const { outType } = require('@/utils/Constants.js');
 const app = getApp()
 const app = getApp()
 Page({
 Page({
   mixins: [mixins],
   mixins: [mixins],
@@ -18,8 +17,7 @@ Page({
   data: {
   data: {
     tagList: [
     tagList: [
       { title: mixins.$t('outboundProcessing') },
       { title: mixins.$t('outboundProcessing') },
-      { title: mixins.$t('checkouted') }
-    ],
+      { title: mixins.$t('checkouted') }],
     // 查询条件
     // 查询条件
     searchContent: [{
     searchContent: [{
       code: 'makeTime',
       code: 'makeTime',
@@ -63,6 +61,11 @@ Page({
       {
       {
         code: 'supName',
         code: 'supName',
       },
       },
+      {
+        code: 'flgValid',
+        title: mixins.$t('flgValid'),
+        dataType: 'checkbox'
+      },
     ],
     ],
 
 
     // 列表区(脚部金额)
     // 列表区(脚部金额)
@@ -73,18 +76,22 @@ Page({
     // 列表区(脚部信息)
     // 列表区(脚部信息)
     footerInfo: [{
     footerInfo: [{
       prefix: mixins.$t('together'),
       prefix: mixins.$t('together'),
-      name: 'outingQty', title: mixins.$t('piece')
+      name: 'outQty', title: mixins.$t('piece')
     }],
     }],
     // 列表区(内容)
     // 列表区(内容)
     contentList: [],
     contentList: [],
-
+    // 列表的显示字段
     contentObj: {
     contentObj: {
-      '销退出库': [{
-        name: 'orderNo',
-        title: mixins.$t('orderNo')
+
+      '销售出库': [{
+        name: 'outNo',
+        title: mixins.$t('outOrderNo')
+      }, {
+        name: 'cusPhone',
+        title: mixins.$t('cusPhone')
       }, {
       }, {
         name: 'addressFull',
         name: 'addressFull',
-        title: mixins.$t('returnAddress')
+        title: mixins.$t('addressFull')
       }, {
       }, {
         name: [{
         name: [{
           name: 'orgName',
           name: 'orgName',
@@ -93,20 +100,17 @@ Page({
           name: 'staffName',
           name: 'staffName',
           title: mixins.$t('staffId')
           title: mixins.$t('staffId')
         }],
         }],
-        title: mixins.$t('returnInfo')
+        title: mixins.$t('storeInformation')
       }, {
       }, {
         name: 'outDate',
         name: 'outDate',
         title: mixins.$t('outDate')
         title: mixins.$t('outDate')
       }],
       }],
-      '销售出库': [{
+      '采退入库': [{
         name: 'outNo',
         name: 'outNo',
         title: mixins.$t('outOrderNo')
         title: mixins.$t('outOrderNo')
       }, {
       }, {
-        name: 'cusPhone',
-        title: mixins.$t('cusPhone')
-      }, {
         name: 'addressFull',
         name: 'addressFull',
-        title: mixins.$t('addressFull')
+        title: mixins.$t('returnAddress')
       }, {
       }, {
         name: [{
         name: [{
           name: 'orgName',
           name: 'orgName',
@@ -115,7 +119,7 @@ Page({
           name: 'staffName',
           name: 'staffName',
           title: mixins.$t('staffId')
           title: mixins.$t('staffId')
         }],
         }],
-        title: mixins.$t('storeInformation')
+        title: mixins.$t('returnInfo')
       }, {
       }, {
         name: 'outDate',
         name: 'outDate',
         title: mixins.$t('outDate')
         title: mixins.$t('outDate')
@@ -185,18 +189,35 @@ Page({
     outboundOtherService: app.globalData['outboundOtherService'],
     outboundOtherService: app.globalData['outboundOtherService'],
     outboundProcessingService: app.globalData['outboundProcessingService'],
     outboundProcessingService: app.globalData['outboundProcessingService'],
     outboundSaleReturnService: app.globalData['outboundSaleReturnService'],
     outboundSaleReturnService: app.globalData['outboundSaleReturnService'],
+    inboundReturnService: app.globalData['inboundReturnService'],
     active: 0,
     active: 0,
     // 主键Id
     // 主键Id
     primaryKey: 'outId',
     primaryKey: 'outId',
   },
   },
   /**
   /**
-  * 切换 已出库 未出库
+   *  @desc :切换 已出库 未出库
+   *  @date : 2024年3月8日
+   *  @author : 姜永辉
   */
   */
   onChangeTabs(e) {
   onChangeTabs(e) {
     let index = e.detail.detail.index
     let index = e.detail.detail.index
     this.setData({
     this.setData({
       active: index,
       active: index,
     })
     })
+    let buttonList = this.data.buttonList
+    buttonList = buttonList.filter(item => item.name !== 'returnCancel')
+    console.log();
+    if (index == 1 && buttonList.length == 3) {
+      buttonList.push(
+        {
+          name: 'returnCancel',
+          title: mixins.$t('returnCancel'),
+        }
+      )
+    }
+    this.setData({
+      buttonList,
+    })
     this.searchData()
     this.searchData()
   },
   },
   /**
   /**
@@ -212,7 +233,31 @@ Page({
         res.eventChannel.emit('params', {})
         res.eventChannel.emit('params', {})
       }
       }
     })
     })
-  },/**
+  },
+  /**
+   * @desc : 跳转明细
+   * @author : 周兴
+   * @date : 2024/1/22
+   */
+  toDetail(e) {
+    if (e) {
+      let item = e.detail.item;
+      if (e.detail.item) {
+        let button = {
+          formMode: Constants.formMode.edit
+        }
+        e.detail.item.button = button
+      }
+      // 如果name不传递,默认为edit
+      if (item.outType == Constants.outType.sale || item.outType == Constants.outType.other) {
+        e.detail.name = 'edit'
+      } else {
+        e.detail.name = 'editReturn'
+      }
+    }
+    this.open(e);
+  },
+  /**
   * @desc : 设置查询参数
   * @desc : 设置查询参数
   * @date : 2024年3月8日
   * @date : 2024年3月8日
   * @author : 姜永辉
   * @author : 姜永辉
@@ -221,18 +266,15 @@ Page({
     console.log(params);
     console.log(params);
     if (this.data.active == 0) {
     if (this.data.active == 0) {
       //待出库的查询参数
       //待出库的查询参数
+      params.intoStatus = Constants.intoStatus.inBounding
       params.outStatus = Constants.outStatus.outBounding
       params.outStatus = Constants.outStatus.outBounding
     }
     }
     if (this.data.active == 1) {
     if (this.data.active == 1) {
       //已出库的查询参数 
       //已出库的查询参数 
-      if (params.outTypeList == null || params.outTypeList.length == 0) {
-        params.outTypeList = [
-          Constants.outType.sale,
-          Constants.outType.other,
-          Constants.outType.purReturn]
-      }
+      params.intoStatus = Constants.intoStatus.inBounded
       params.outStatus = Constants.outStatus.outBounded
       params.outStatus = Constants.outStatus.outBounded
     }
     }
+    params.outTypes = params.outTypeList
     return params;
     return params;
   },
   },
   /** 
   /** 
@@ -241,7 +283,7 @@ Page({
    * @author : 姜永辉
    * @author : 姜永辉
    */
    */
   getData(params) {
   getData(params) {
-    return this.excute(this.data.service, this.data.service.selectByCond, params);
+    return this.excute(this.data.outboundOtherService, this.data.outboundOtherService.selectOutbound, params);
   },
   },
 
 
   /**
   /**
@@ -304,6 +346,42 @@ Page({
 
 
   },
   },
 
 
+  /**
+   * @desc : (撤销)
+   * @date : 2024/2/1 15:49
+   * @author : 姜永辉
+   */
+  returnCancel(e) {
+    let item = e
+    let id = item.outId
+    // 销售出库
+    if (item.outType == Constants.outType.sale) {
+      this.excute(this.data.outboundProcessingService, this.data.outboundProcessingService.outBoundCancel, item).then(res => {
+        if (res.data.code == Constants.SUCESS_CODE) {
+          // 重新查询
+          this.searchData()
+        }
+      })
+    }
+    // 其他出库
+    else if (item.outType == Constants.outType.other) {
+      this.excute(this.data.outboundOtherService, this.data.outboundOtherService.outBoundCancel, item).then(res => {
+        if (res.data.code == Constants.SUCESS_CODE) {
+          // 重新查询
+          this.searchData()
+        }
+      })
+      // 采购退货
+    } else {
+      this.excute(this.data.inboundReturnService, this.data.inboundReturnService.inboundReturnCancel, { intoId: id }).then(res => {
+        if (res.data.code == Constants.SUCESS_CODE) {
+          // 重新查询
+          this.searchData()
+        }
+      })
+    }
+  },
+
 
 
   /**
   /**
     * @desc : (编辑)
     * @desc : (编辑)
@@ -370,7 +448,6 @@ Page({
     */
     */
   invaidOrder(e) {
   invaidOrder(e) {
     let item = e
     let item = e
-    console.log("invaidOrder", e);
     let id = item.outId
     let id = item.outId
     // 销售出库
     // 销售出库
     if (item.outType == Constants.outType.sale) {
     if (item.outType == Constants.outType.sale) {
@@ -389,9 +466,9 @@ Page({
           this.searchData()
           this.searchData()
         }
         }
       })
       })
-      // 销售退货
+      // 采购退货
     } else {
     } else {
-      this.excute(this.data.outboundSaleReturnService, this.data.outboundSaleReturnService.outboundRepeal + id, null).then(res => {
+      this.excute(this.data.inboundReturnService, this.data.inboundReturnService.cancel, { intoId: id }).then(res => {
         if (res.data.code == Constants.SUCESS_CODE) {
         if (res.data.code == Constants.SUCESS_CODE) {
           // 重新查询
           // 重新查询
           this.searchData()
           this.searchData()

+ 2 - 2
package-inventory/pages/warehousing-processing/detail/detail.js

@@ -44,8 +44,8 @@ Page({
             code: 'whId',
             code: 'whId',
             name: 'whName',
             name: 'whName',
             title: mixins.$t('warehouseId'),
             title: mixins.$t('warehouseId'),
-            type: 'drop',
-            dropType: 'warehouse'
+            type: 'choose',
+            urlKey: 'openingInventory'
         },
         },
         {
         {
             code: 'skuSpec',
             code: 'skuSpec',

+ 3 - 5
package-inventory/pages/warehousing-processing/warehousing-processing.js

@@ -81,7 +81,7 @@ Page({
     // 列表的显示字段
     // 列表的显示字段
     contentObj: {
     contentObj: {
       '采购入库': [{
       '采购入库': [{
-        name: 'fromNo',
+        name: 'intoNo',
         title: mixins.$t('orderNo')
         title: mixins.$t('orderNo')
       }, {
       }, {
         name: 'whName',
         name: 'whName',
@@ -238,11 +238,9 @@ Page({
    * @author : 周兴
    * @author : 周兴
    * @date : 2024/1/22
    * @date : 2024/1/22
    */
    */
-  toDetail(e) {
-    console.log(e, "toDetail");
+  toDetail(e) { 
     if (e) {
     if (e) {
-      let item = e.detail.item;
-      
+      let item = e.detail.item;      
       if (e.detail.item) {
       if (e.detail.item) {
         let button = {
         let button = {
           formMode: Constants.formMode.edit
           formMode: Constants.formMode.edit