Эх сурвалжийг харах

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss_wx_app

zhoux 2 жил өмнө
parent
commit
3cb7eb1782

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

@@ -11,10 +11,13 @@ module.exports = {
   outboundService: {
   outboundService: {
     // 前缀
     // 前缀
     prefix: 'mdm-server/ivt/outbound/',
     prefix: 'mdm-server/ivt/outbound/',
+    outboundRepeal: 'repeal/',
   },
   },
 
 
   routeUrl: {
   routeUrl: {
     outbound: { 
     outbound: { 
+      invaidOrder: { key: 'invaidOrder', method: 'invaidOrder' },
+      editOrder: { key: 'editOrder', method: 'editOrder', primaryKey: 'outId' },
       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' },
       addOther: { key: 'addOther', url: '/package-inventory/pages/other-outbound/other-outbound' },
       addOther: { key: 'addOther', url: '/package-inventory/pages/other-outbound/other-outbound' },

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

@@ -14,6 +14,7 @@ module.exports = {
     otheroutBoundInsert: 'outbound_insert', 
     otheroutBoundInsert: 'outbound_insert', 
     otheroutBoundUpdate: 'outbound_update',
     otheroutBoundUpdate: 'outbound_update',
     outBoundHandle:'outbound_handle',
     outBoundHandle:'outbound_handle',
+    outboundRepeal: 'repeal/',
   },
   },
 
 
   routeUrl: {
   routeUrl: {

+ 3 - 2
api/pages/ivt/outboundProcessing.js

@@ -10,8 +10,9 @@
 module.exports = {
 module.exports = {
   outboundProcessingService: {
   outboundProcessingService: {
     // 前缀
     // 前缀
-    prefix: 'mdm-server/ivt/outbound_sale/',
-    outBoundHandle: 'outbound_handle'
+    prefix: 'mdm-server/ivt/outbound_sale_order/',
+    outBoundHandle: 'outbound_handle',
+    outboundRepeal: 'repeal/',
   },
   },
 
 
   routeUrl: {
   routeUrl: {

+ 2 - 1
api/pages/ivt/outboundPurchaseReturn.js

@@ -11,7 +11,8 @@ module.exports = {
   outboundPurchaseReturnService: {
   outboundPurchaseReturnService: {
     // 前缀
     // 前缀
     prefix: 'mdm-server/ivt/outbound_purchse_return/',
     prefix: 'mdm-server/ivt/outbound_purchse_return/',
-    outBoundHandle: 'outbound_handle'
+    outBoundHandle: 'outbound_handle',
+    
   },
   },
 
 
   routeUrl: {
   routeUrl: {

+ 2 - 1
api/pages/ivt/outboundSaleReturn.js

@@ -11,7 +11,8 @@ module.exports = {
   outboundSaleReturnService: {
   outboundSaleReturnService: {
     // 前缀
     // 前缀
     prefix: 'mdm-server/ivt/outbound_sale_return/',
     prefix: 'mdm-server/ivt/outbound_sale_return/',
-    outBoundHandle: 'outbound_handle'
+    outBoundHandle: 'outbound_handle',
+    outboundRepeal: 'repeal/',
   },
   },
 
 
   routeUrl: {
   routeUrl: {

+ 30 - 5
package-inventory/pages/other-outbound/other-outbound.js

@@ -142,14 +142,37 @@ Page({
         },
         },
         // 路由
         // 路由
         routeObjName: 'outboundOther',
         routeObjName: 'outboundOther',
-        table: Constants.tables.t_psi_outbound,
+        table: Constants.tables.outbound,
     },
     },
 
 
     /**
     /**
-  * @desc : 给表单赋值
-  * @date : 2024/2/1 15:49
-  * @author : 姜永辉
-  */
+      * @desc : 页面加载数据方法
+      * @date : 2024/2/1 15:49
+      * @author : 姜永辉
+      */
+    loadInit() {
+        if (this.data.formMode == Constants.formMode.edit) {
+            wx.setNavigationBarTitle({
+                title: mixins.$t('editOtherOutWh'),
+            })
+        } else {
+            wx.setNavigationBarTitle({
+                title: mixins.$t('addOtherOutWh'),
+            })
+            // 新增
+            if (this.data.formData == '{}') {
+                this.setData({
+                    formData: JSON.stringify({ outDate: new Date().toDateStr() })
+                })
+            }
+        }
+    },
+
+    /**
+    * @desc : 给表单赋值
+    * @date : 2024/2/1 15:49
+    * @author : 姜永辉
+    */
     setValuesByEdit(data) {
     setValuesByEdit(data) {
         console.log("setValuesByEdit", data);
         console.log("setValuesByEdit", data);
         let cardList_ = this.data.cardList
         let cardList_ = this.data.cardList
@@ -232,6 +255,8 @@ Page({
         if (code == "staffId") { //员工
         if (code == "staffId") { //员工
             formData.staffId = data.id
             formData.staffId = data.id
             formData.staffName = data.name
             formData.staffName = data.name
+            formData.orgId = data.orgId
+            formData.orgName = data.orgName
         }
         }
         if (code == "orgId") { //部门
         if (code == "orgId") { //部门
             formData.orgId = data.id
             formData.orgId = data.id

+ 118 - 8
package-inventory/pages/outbound-processing/outbound-processing.js

@@ -7,7 +7,9 @@
  *		jyh 		  2024-03-12	            1.00		   	    
  *		jyh 		  2024-03-12	            1.00		   	    
  *******************************************************************************/
  *******************************************************************************/
 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()
 Page({
 Page({
   mixins: [mixins],
   mixins: [mixins],
   /**
   /**
@@ -51,10 +53,6 @@ Page({
       {
       {
         code: 'addressFull',
         code: 'addressFull',
       },
       },
-      {
-        code: 'outDate',
-        dataType: 'date'
-      },
 
 
       {
       {
         code: 'staffName',
         code: 'staffName',
@@ -63,7 +61,7 @@ Page({
         code: 'orgName',
         code: 'orgName',
       },
       },
       {
       {
-        code: 'supplierName',
+        code: 'supName',
       },
       },
     ],
     ],
 
 
@@ -149,12 +147,17 @@ Page({
     // 弹出按钮
     // 弹出按钮
     buttonList: [
     buttonList: [
       {
       {
-        name: 'customerRefundList',
+        name: 'invaidOrder',
         title: mixins.$t('invaidOrder'),
         title: mixins.$t('invaidOrder'),
+
       }, {
       }, {
-        name: 'customerRefundList',
+        name: 'ticketPirnt',
         title: mixins.$t('ticketPirnt'),
         title: mixins.$t('ticketPirnt'),
       }
       }
+      , {
+        name: 'editOrder',
+        title: mixins.$t('edit'),
+      }
     ],
     ],
 
 
     // 底部保存按钮
     // 底部保存按钮
@@ -179,6 +182,9 @@ Page({
 
 
     // 路由
     // 路由
     routeObjName: 'outbound',
     routeObjName: 'outbound',
+    outboundOtherService: app.globalData['outboundOtherService'],
+    outboundProcessingService: app.globalData['outboundProcessingService'],
+    outboundSaleReturnService: app.globalData['outboundSaleReturnService'],
     active: 0,
     active: 0,
     // 主键Id
     // 主键Id
     primaryKey: 'outId',
     primaryKey: 'outId',
@@ -212,12 +218,19 @@ Page({
   * @author : 姜永辉
   * @author : 姜永辉
   */
   */
   setSearchParams(params) {
   setSearchParams(params) {
+    console.log(params);
     if (this.data.active == 0) {
     if (this.data.active == 0) {
       //待出库的查询参数
       //待出库的查询参数
       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.outStatus = Constants.outStatus.outBounded
       params.outStatus = Constants.outStatus.outBounded
     }
     }
     return params;
     return params;
@@ -291,4 +304,101 @@ Page({
 
 
   },
   },
 
 
+
+  /**
+    * @desc : (编辑)
+    * @date : 2024/2/1 15:49
+    * @author : 姜永辉
+    */
+  editOrder(e) {
+    let item = e
+    let id = item.outId
+    // 销售出库
+    if (item.outType == Constants.outType.sale) {
+      wx.navigateTo({
+        url: this.data.route.add.url,
+        events: {
+          // 回调后,在这里给页面赋值
+          bandData: function (e) { }
+        },
+        success: function (res) {
+          res.eventChannel.emit('params', {
+            id: id,
+            formMode: Constants.formMode.edit
+          })
+        }
+      })
+    }
+    // 其他出库
+    else if (item.outType == Constants.outType.other) {
+      wx.navigateTo({
+        url: this.data.route.addOther.url,
+        events: {
+          // 回调后,在这里给页面赋值
+          bandData: function (e) { }
+        },
+        success: function (res) {
+          res.eventChannel.emit('params', {
+            id: id,
+            formMode: Constants.formMode.edit
+          })
+        }
+      })
+      // 销售退货
+    } else {
+      wx.navigateTo({
+        url: this.data.route.addReturn.url,
+        events: {
+          // 回调后,在这里给页面赋值
+          bandData: function (e) { }
+        },
+        success: function (res) {
+          res.eventChannel.emit('params', {
+            id: id,
+            formMode: Constants.formMode.edit
+          })
+        }
+      })
+    }
+
+  },
+
+  /**
+    * @desc : 作废
+    * @date : 2024/2/1 15:49
+    * @author : 姜永辉
+    */
+  invaidOrder(e) {
+    let item = e
+    console.log("invaidOrder", e);
+    let id = item.outId
+    // 销售出库
+    if (item.outType == Constants.outType.sale) {
+      this.excute(this.data.outboundProcessingService, this.data.outboundProcessingService.outboundRepeal + id, null).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.outboundRepeal + id, null).then(res => {
+        if (res.data.code == Constants.SUCESS_CODE) {
+          // 重新查询
+          this.searchData()
+        }
+      })
+      // 销售退货
+    } else {
+      this.excute(this.data.outboundSaleReturnService, this.data.outboundSaleReturnService.outboundRepeal + id, null).then(res => {
+        if (res.data.code == Constants.SUCESS_CODE) {
+          // 重新查询
+          this.searchData()
+        }
+      })
+    }
+
+  },
+
 })
 })

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

@@ -53,8 +53,6 @@ Page({
       {
       {
         code: 'addressFull',
         code: 'addressFull',
       },
       },
-
-
       {
       {
         code: 'supName',
         code: 'supName',
       },
       },
@@ -226,6 +224,12 @@ Page({
       params.intoStatus = Constants.intoStatus.inBounding
       params.intoStatus = Constants.intoStatus.inBounding
     }
     }
     if (this.data.active == 1) {
     if (this.data.active == 1) {
+      if (params.intoTypeList == null || params.intoTypeList.length == 0) {
+        params.intoTypeList = [
+          Constants.intoType.pur,
+          Constants.intoType.other,
+          Constants.intoType.saleReturn]
+      }
       //已入库的查询参数 
       //已入库的查询参数 
       params.intoStatus = Constants.intoStatus.inBounded
       params.intoStatus = Constants.intoStatus.inBounded
     }
     }
@@ -385,7 +389,7 @@ Page({
       })
       })
       // 采购退货
       // 采购退货
     } else {
     } else {
-      this.excute(this.data.inboundReturnService, this.data.inboundReturnService.inboundReturnCancel, { intoId: id }).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()