于继渤 2 лет назад
Родитель
Сommit
bd116a7fff

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

@@ -13,7 +13,8 @@ module.exports = {
     prefix: 'mdm-server/ivt/outbound_sale_order/',
     outboundInsert: 'outbound_insert',
     outboundUpdate: 'outbound_update',
-    handleOutbound: 'handle_outbound'
+    handleOutbound: 'handle_outbound',
+    getOutboundForUpdate:'get_outbound_for_update'
   },
 
   routeUrl: {

+ 78 - 6
components/dkbase/dk-form-bill/dk-form-bill.js

@@ -371,11 +371,13 @@ Component({
       if (form[itemName]) {
         form[itemName][this.data.dataIndex] = data.detail.form;
       }
-      // console.log('data', data,form);
       //计算金额
-      if (this.data.type == Constants.billType.sale || this.data.type == Constants.billType.saleOut) {
+      if (this.data.type == Constants.billType.sale) {
         this.setGoodsAmount()
       }
+      if( this.data.type == Constants.billType.saleOut){
+        this.setGoodsOutAmount()
+      }
       this.setData({
         form: form,
         value: JSON.stringify(form)
@@ -1039,10 +1041,12 @@ Component({
         })
         form[this.data.itemName] = goodsList
         // 设置商品总单的金额信息 
-        if (this.data.type == Constants.billType.sale || this.data.type == Constants.billType.saleOut) {
+        if (this.data.type == Constants.billType.sale) {
           this.setGoodsAmount(e.data);
         }
-
+        if( this.data.type == Constants.billType.saleOut){ //销售出库
+          this.setGoodsOutList(e.data)
+        }
         if (this.data.type == Constants.billType.purReturn) { //采购退货
           this.setReturnGoodsAmount(e.data);
         }
@@ -1111,10 +1115,12 @@ Component({
         value: JSON.stringify(form)
       })
       //计算
-      if (this.data.type == Constants.billType.sale || this.data.type == Constants.billType.saleOut) {
+      if (this.data.type == Constants.billType.sale) {
         this.setGoodsAmount(goodsList);
       }
-
+      if( this.data.type == Constants.billType.saleOut){
+        this.setGoodsOutAmount()
+      }
       // 外露setGoods方法
       this.triggerEvent("delItem", { data: goodsList })
     },
@@ -1212,6 +1218,72 @@ Component({
         form: form
       })
     },
+  /**
+     * @desc : 设置商品明细金额相关信息 销售出库
+     * @author : 于继渤
+     * @date : 2024/1/19
+     */
+    setGoodsOutAmount(){
+      let cardList = this.data.cardList
+      let form = this.data.form
+      let index = cardList.findIndex(it => it.name == 'items');
+      if (form.goodsList && form.goodsList.length > 0) {
+        let sumStandard = Number(0)
+        let sumAmount = Number(0)
+        let sumQuantity = Number(0)
+        form.goodsList.forEach(item => {
+          //标价合计 =  商品标价 x  商品数量
+          item.priceStd = item.priceStandard//标价
+          item.amtStd = Number(item.priceStd * item.itemQty) 
+          item.outAmt = item.priceOut * item.outQty
+          item.priceDiscount = Number((item.priceOut / item.priceStd) * 100).toFixed(2)//售价折扣
+          sumQuantity += item.outQty //数量
+          sumAmount += item.priceOut * item.outQty //没有售价默认取标价
+          sumStandard += (item.priceStd ? item.priceStd : item.priceStandard) * item.outQty
+        })
+        //标价合计
+        cardList[index].sumStandard = sumStandard
+        //销售折扣 (合计金额/标价合计)
+        cardList[index].saleDiscount = Number((sumAmount / sumStandard) * 100).toFixed(2)
+        //合计金额
+        cardList[index].sumAmount = sumAmount
+        //TODO   需要获取当前客户可用预存
+        form.saleDiscount = cardList[index].saleDiscount
+        form.sumAmount = sumAmount
+        form.sumQuantity = sumQuantity
+        form.outAmt = sumAmount
+        form.outQty = sumQuantity
+      } 
+
+      this.setData({
+        cardList: cardList,
+        form: form
+      })
+    },
+
+  /**
+     * @desc :  销售出库设置选品参数
+     * @author : 于继渤
+     * @date : 2024/1/19
+     */
+    setGoodsOutList(data){
+      let form = this.data.form
+      if (form.goodsList && form.goodsList.length > 0) {
+        form.goodsList.forEach(item => {
+          item.priceOut = item.priceStandard
+          item.outQty = item.itemQty 
+          item.outAmt = item.priceOut * item.itemQty
+          delete item['priceLimited']
+          delete item['pricePurchase']
+          delete item['priceWholesale']
+        })
+      }
+      this.setData({
+        form: form
+      })
+      this.setGoodsOutAmount()
+    },
+
     /**
   * @desc : 设置商品明细金额相关信息 TODO 
   * @author : 周兴

+ 1 - 0
i18n/zh-CN.js

@@ -68,6 +68,7 @@ const ivt = {
   intType: '入库类型',
   outDate: '出库日期',
   outType: '出库类型',
+  priceOut: '出库价格',
   makeTime: '制单日期',
   intoReason: '入库原因',
   inProcessing: '入库办理',

+ 1 - 1
package-basic-data/pages/customer-list/add/add.js

@@ -30,7 +30,7 @@ Page({
         { code: 'contactPhone', type: 'str', title: mixins.$t('cpPhone'), required: false },
       ],
       center: [
-        { code: 'channelId', name: 'channelName', type: 'choose', required: true, title: mixins.$t('saleChannel') },
+        { code: 'channelId', name: 'channelName', type: 'drop', dropType: 'saleChannel',required: true, title: mixins.$t('saleChannel') },
         { code: 'staffId', name: 'staffName', type: 'choose', required: true, title: mixins.$t('saleStaff'), urlKey: 'chooseStaff' },
         { code: 'orgId', name: 'orgName', type: 'choose', required: true, title: mixins.$t('saleOrg'), urlKey: 'chooseOrg' },
         { code: 'initialDebt', type: 'number', required: false, title: mixins.$t('initialDebtOwed') },

+ 28 - 40
package-sales/pages/order-return/add/add.js

@@ -217,10 +217,15 @@ Page({
    * @author : 于继渤
    */
   saveData() {
-    if (this.data.formMode == Constants.formMode.other) { //关联源单新建退货
+    if (this.data.formMode == Constants.formMode.other || this.data.formMode == Constants.formMode.add) { //关联源单新建退货
       return this.excute(this.data.service, this.data.service.outboundInsert, this.data.params);
     }
-
+    if (this.data.formMode == Constants.formMode.detail) { //办理
+      return this.excute(this.data.service, this.data.service.saleReturnHandleOutbound, this.data.params);
+    }
+    if (this.data.formMode == Constants.formMode.other && this.data.formType == Constants.formMode.edit) { //编辑
+      return this.excute(this.data.service, this.data.service.otherOutboundUpdate, this.data.params);
+    }
   },
 
   /**
@@ -228,13 +233,21 @@ Page({
     * @date : 2024/2/1 15:49
     * @author : 于继渤
     */
-  getItemDetal(id) {
-    return this.excute(this.data.service, this.data.service.getOutReturnForUpdate + '/' + id, {}).then(res => {
+  getItemDetal(id, service, API) {
+    if (!API) {
+      API = 'getOutReturnForUpdate'
+      service = 'service'
+    }
+    return this.excute(this.data[service], this.data[service][API] + '/' + id, {}).then(res => {
       if (res.data.code == 200) {
         let formData = JSON.parse(this.data.formData)
         formData = res.data.data.data
         //销售订单列表转出库
-        formData.fromNo = formData.formNo
+        if (!API) {
+          formData.fromNo = formData.formNo
+        } else {
+          formData.fromNo = formData.orderNo
+        }
         //处理地址
         formData.address = this.setAddress(formData)
         formData.goodsList = res.data.data.dataItem
@@ -248,10 +261,10 @@ Page({
           cardList: cardList,
           formData: JSON.stringify(formData)
         })
-
       }
     });
   },
+
   /**
      * @desc : 给表单赋值
      * @date : 2024/2/1 15:49
@@ -277,21 +290,14 @@ Page({
     })
     //查询商品明细
     this.getItemDetal(data.orderId)
-
-
   },
 
-
-
-  // 设置参数
-
-
   /**
     * @desc : 设置表单 为只读状态
     * @date : 2024/2/1 15:49
     * @author : 于继渤
     */
-   setFormMain() {
+  setFormMain() {
     let contentObj = this.data.contentObj
     let cardList = this.data.cardList
     let buttonSaveList = this.data.buttonSaveList
@@ -311,14 +317,12 @@ Page({
       title: mixins.$t("sourceOrder"),//'关联源单'
       readonly: true,
     }],
-
       contentObj.other = [
         { code: 'contractNo', type: 'str', readonly: true, required: false, title: mixins.$t('contractNumber') },
         { code: 'deliveryDate', type: 'str', readonly: true, required: false, title: mixins.$t('delivery_Time') },
         { code: 'remarks', type: 'str', readonly: true, required: false, title: mixins.$t('remarks') },
         { code: 'file', type: 'uploader', title: mixins.$t("uploader") }
       ]
-
     cardList = [
       { name: 'main', title: mixins.$t("customerInformation") },
       { name: 'relation' },
@@ -338,7 +342,6 @@ Page({
       popContent = [
         { code: 'outingQty', type: 'step', title: mixins.$t("count"), required: true, readonly: true },
         { code: 'priceOut', type: 'number', title: mixins.$t("priceSale"), required: true, readonly: true },
-
         { code: 'whName', title: mixins.$t("warehouseId"), type: 'str', readonly: true, readonly: true },
         { code: 'nonStdCode', title: mixins.$t("goodsBatch"), type: 'str', readonly: true },
       ]
@@ -350,10 +353,7 @@ Page({
       contentSaveList: contentSaveList,
       buttonSaveList: buttonSaveList,
     })
-
   },
-
-
   /**
     * @desc : 处理地址
     * @date : 2024/2/1 15:49
@@ -398,8 +398,8 @@ Page({
     cardList[2].sumStandard = formData.sumStandard
     cardList[2].sumQuantity = formData.sumQuantity
     cardList[2].saleDiscount = formData.saleDiscount
-     //详情 办理
-     if ( this.data.formMode == Constants.formMode.detail) {
+    //详情 办理
+    if (this.data.formMode == Constants.formMode.detail) {
       contentSaveList[1].content = formData.sumAmount
     } else {
       contentSaveList[2].content = formData.sumAmount
@@ -409,23 +409,8 @@ Page({
       contentSaveList: contentSaveList,
       formData: JSON.stringify(formData)
     })
-
   },
-  /**
-   * @desc : 设置商品
-   * @date : 2024/2/1 15:49
-   * @author : 于继渤
-   */
-  setGoods(e) {
-    console.log('设置商品', e)
-    //设置需收款
-    // let formData = JSON.parse(this.data.formData)
-    // let index = 0
 
-    // this.setData({
-    //   formData: JSON.stringify(formData)
-    // })
-  },
   /**
     * @desc : 设置顶部默认值
     * @date : 2024/3/28 15:49
@@ -462,7 +447,7 @@ Page({
       },
       success: function (res) {
         res.eventChannel.emit('params', {
-          formMode:Constants.formMode.other, id: this_.data.id
+          formMode: Constants.formMode.other, id: this_.data.id, formType: Constants.formMode.edit
         });
       }
     })
@@ -475,7 +460,6 @@ Page({
    */
   loadInit() {
     let formData = JSON.parse(this.data.formData)
-
     if (this.data.formMode == Constants.formMode.detail) { //详情
       //详情办理
       wx.setNavigationBarTitle({
@@ -492,7 +476,11 @@ Page({
       eventChannel.on('params', function (data) {
         console.log('新建', data)
       })
-    } else if (this.data.formMode == Constants.formMode.other) { //编辑
+    } else if (this.data.formMode == Constants.formMode.other && this.data.formType !== Constants.formMode.edit) {
+      //转退货
+      //查询信息
+      this.getItemDetal(this.data.item.orderId, 'orderService', 'getOrderForReturn')
+    } else if (this.data.formMode == Constants.formMode.other && this.data.formType == Constants.formMode.edit) { //编辑
       wx.setNavigationBarTitle({
         title: '编辑销售退货'
       })

+ 1 - 1
package-sales/pages/order-return/order-return.js

@@ -143,7 +143,7 @@ Page({
       url: this.data.route.edit.url,
       success: function (res) {
         // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
-        res.eventChannel.emit('params', { id: outId, formMode: Constants.formMode.detail,fromType: Constants.formMode.detail})
+        res.eventChannel.emit('params', { id: outId, formMode: Constants.formMode.detail,formType: Constants.formMode.detail})
       }
     })
   }

+ 67 - 44
package-sales/pages/sales-outbound/add/add.js

@@ -1,6 +1,7 @@
 const Constants = require('@/utils/Constants.js');
 import Dialog from '@/dist/dialog/dialog.js';
 const mixins = require('@/mixins/index.js')
+const utils = require('@/utils/util')
 const app = getApp()
 Page({
   mixins: [mixins],
@@ -59,8 +60,8 @@ Page({
       { code: 'receivable', content: 0, type: 'number' }
     ],
     popContent: [
-      { code: 'outingQty', type: 'step', title: mixins.$t("count"), required: true },
-      { code: 'priceOut', type: 'number', title: mixins.$t("priceSale"), required: true },
+      { code: 'outQty', type: 'step', title: mixins.$t("count"), required: true },
+      { code: 'priceOut', type: 'number', title: mixins.$t("priceOut"), required: false, readonly: true },
       {
         code: 'whId', name: 'whName', choosePopupType: 'inventorySku', title: mixins.$t("warehouseId"), type: 'choose', urlKey: 'selectInventorySku',
       },
@@ -84,7 +85,7 @@ Page({
       },
       success: function (res) {
         res.eventChannel.emit('params', {
-          formMode:'edit',id:this_.data.id
+          formMode: 'detailEdit', id: this_.data.id
         });
       }
     })
@@ -134,16 +135,29 @@ Page({
     * @author : 于继渤
     */
   setParams(params) {
-    params.goodsList.forEach(res=>{
-        console.log(res)
+    //设置转出库参数
+    if (this.data.formMode == 'other') {
+
+    }
+    params.fromId = params.orderId
+    params.outingAmt = params.outAmt
+    params.outingQty = params.outQty
+    params.outAmt = null
+    params.outQty = null
+    params.goodsList.forEach(res => {
+      res.outingAmt = res.outAmt
+      res.outingQty = res.outQty
+      res.outAmt = null
+      res.outQty = null
     })
+
     params.itemList = params.goodsList //明细
     params.makeStaff = app.globalData.user.staffId
     // params.deleteItemList = params.deleteList ? params.deleteList : []
     let btnFormData = this.data.btnFormData ? JSON.parse(this.data.btnFormData) : ''
     params.flgAutoHandle = btnFormData ? btnFormData.flag : false //自动出库标识 
     params.addressName = params.address.addressName
-    params.objectId = params.cusId
+    params.outDate = utils.formatDayTime(new Date())
     delete params['goodsList']
     delete params['orderItemResponseList']
     console.log('params', params)
@@ -156,14 +170,15 @@ Page({
    * @author : 于继渤
    */
   saveData() {
-    if (this.data.formMode == Constants.formMode.edit  && this.data.formType !== Constants.formMode.detail) { //编辑
+    if (this.data.formMode == Constants.formMode.detailEdit) { //编辑
+      //limitEdit 编辑标识 true 大
+      this.data.params.limitEdit = true
       return this.excute(this.data.saleOutBoundService, this.data.saleOutBoundService.outboundUpdate, this.data.params);
-    } else if(this.data.formMode == Constants.formMode.add && this.data.formType !== Constants.formMode.detail){ //新建
+    } else if (this.data.formMode == Constants.formMode.add || this.data.formMode == Constants.formMode.other) { //新建
       return this.excute(this.data.saleOutBoundService, this.data.saleOutBoundService.outboundInsert, this.data.params);
-    }else if(this.data.formMode == Constants.formMode.edit && this.data.formType == Constants.formMode.detail){ //办理
+    } else if (this.data.formMode == Constants.formMode.detail) { //办理
       return this.excute(this.data.saleOutBoundService, this.data.saleOutBoundService.handleOutbound, this.data.params);
     }
-
   },
 
   /**
@@ -171,8 +186,12 @@ Page({
     * @date : 2024/2/1 15:49
     * @author : 于继渤
     */
-  getItemDetal(orderId) {
-    return this.excute(this.data.orderService, this.data.orderService.getOrderForOut + '/' + orderId, {}).then(res => {
+  getItemDetal(id, Service, API) {  //get_outbound_for_update
+    if (!Service) {
+      Service = 'orderService'
+      API = 'getOrderForOut'
+    }
+    return this.excute(this.data[Service], this.data[Service][API] + '/' + id, {}).then(res => {
       if (res.data.code == 200) {
         let formData = JSON.parse(this.data.formData)
         formData = res.data.data.data
@@ -180,6 +199,14 @@ Page({
         formData.fromNo = formData.orderNo
         //处理地址
         formData.address = this.setAddress(formData)
+        //处理明细
+        if (res.data.data.dataItem && res.data.data.dataItem.length > 0) {
+          res.data.data.dataItem.forEach(item => {
+            item.outQty = item.orderQty ? item.orderQty : item.outingQty //出库数量
+            item.outQtyMax = item.canOutingQty //可出库最大值
+            item.outQtyMin = 1  //可出库最小值
+          })
+        }
         formData.goodsList = res.data.data.dataItem
         //处理默认值  业务员业务部门
         formData = this.setStaffOrg(formData)
@@ -226,7 +253,21 @@ Page({
       this.getItemDetal(data.orderId)
     }
   },
-
+  /**
+   * @desc : 设置商品
+   * @date : 2024/2/1 15:49
+   * @author : 于继渤
+   */
+  setGoods(e) {
+    //设置需收款
+    let contentSaveList = this.data.contentSaveList
+    let formData = JSON.parse(this.data.formData)
+    //组件显示 需收款
+    contentSaveList[2]['content'] = Number(formData.sumAmount)
+    this.setData({
+      contentSaveList: contentSaveList
+    })
+  },
   /**
    * @desc   : 选择回调
    * @author : 于继渤
@@ -320,16 +361,18 @@ Page({
     formData.goodsList.forEach(item => {
       //标价合计 =  商品标价 x  商品数量
       sumStandard += item.amtStd
-      item.outingAmt = item.outingQty * item.priceOut
-      sumAmount += item.outingQty * item.priceOut //没有售价默认取标价
-      sumQuantity += item.outingQty //数量
+      item.outAmt = item.outQty * item.priceOut
+      sumAmount += item.outQty * item.priceOut
+      sumQuantity += item.outQty //数量
     })
     formData.sumStandard = sumStandard
     formData.saleDiscount = Number((sumAmount / sumStandard) * 100).toFixed(2)
     formData.sumAmount = sumAmount
+    formData.outAmt = sumAmount
     formData.canUseCollect = 0
     formData.useCollect = 0
     formData.sumQuantity = sumQuantity
+    formData.outQty = sumQuantity
     let cardList = this.data.cardList
     let contentSaveList = this.data.contentSaveList
     cardList[2].sumAmount = formData.sumAmount
@@ -337,7 +380,7 @@ Page({
     cardList[2].sumQuantity = formData.sumQuantity
     cardList[2].saleDiscount = formData.saleDiscount
     //详情 办理
-    if (this.data.formMode == Constants.formMode.edit && this.data.formType == Constants.formMode.detail) {
+    if (this.data.formMode == Constants.formMode.detail) {
       contentSaveList[1].content = formData.sumAmount
     } else {
       contentSaveList[2].content = formData.sumAmount
@@ -350,25 +393,7 @@ Page({
     })
 
   },
-  /**
-   * @desc : 设置商品
-   * @date : 2024/2/1 15:49
-   * @author : 于继渤
-   */
-  setGoods(e) {
-    //设置需收款
-    let formData = JSON.parse(this.data.formData)
-    let index = 0
-    formData.goodsList.forEach(res => {
-      //处理出库字段
-      res.priceOut = res.priceSale
-      res.outingQty = res.itemQty
-      res.itemIndex = index++
-    })
-    this.setData({
-      formData: JSON.stringify(formData)
-    })
-  },
+
   /**
     * @desc : 设置顶部默认值
     * @date : 2024/3/28 15:49
@@ -430,7 +455,7 @@ Page({
       { name: 'other', title: mixins.$t("otherInfo") }
     ]
     //详情(办理)
-    if (this.data.formMode == Constants.formMode.edit && this.data.formType == Constants.formMode.detail) {
+    if (this.data.formMode == Constants.formMode.detail) {
       //按钮
       buttonSaveList = [
         { code: 'save', title: mixins.$t("outProcessing"), width: '120rpx', color: '#1B365D' }
@@ -440,7 +465,7 @@ Page({
         { code: 'receivable', content: 0, type: 'number' }
       ]
       popContent = [
-        { code: 'outingQty', type: 'step', title: mixins.$t("count"), required: true, readonly: true },
+        { code: 'outQty', type: 'step', title: mixins.$t("count"), required: true, readonly: true },
         { code: 'priceOut', type: 'number', title: mixins.$t("priceSale"), required: true, readonly: true },
 
         { code: 'whName', title: mixins.$t("warehouseId"), type: 'str', readonly: true, readonly: true },
@@ -471,22 +496,20 @@ Page({
     } else if (this.data.formMode == Constants.formMode.add) {  //新建
       //处理默认值  业务员业务部门
       formData = this.setStaffOrg(formData)
-      const eventChannel = this.getOpenerEventChannel()
-      eventChannel.on('params', function (data) {
-        console.log('新建', data)
-      })
-    } else if (this.data.formMode == Constants.formMode.edit && this.data.formType == Constants.formMode.detail) { //详情
+    } else if (this.data.formMode == Constants.formMode.detail) { //详情
       //详情办理
       wx.setNavigationBarTitle({
         title: '销售出库详情'
       })
       //设置只读
       this.setFormMain()
-    } else if (this.data.formMode == Constants.formMode.edit && !this.data.formType) {
+      this.getItemDetal(this.data.id, 'saleOutBoundService', 'getOutboundForUpdate')
+    } else if (this.data.formMode == Constants.formMode.detailEdit) {
       //编辑
       wx.setNavigationBarTitle({
         title: '编辑销售出库'
       })
+      this.getItemDetal(this.data.id, 'saleOutBoundService', 'getOutboundForUpdate')
     }
     this.setData({
       formData: JSON.stringify(formData)

+ 2 - 2
package-sales/pages/sales-outbound/add/add.wxml

@@ -3,7 +3,7 @@
 <loading wx:if="{{loading}}"></loading>
 
 
-<dk-form-bill type="saleOut" id="dk-form-bill" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleTagCol="shortName" titleCol="skuCode"  subCol="skuCode" descCol="skuModel" priceCol="priceOut" quantityCol="outingQty" sumAmountCol="sumAmount" discountStandardCol="saleDiscount" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" bind:setGoods="setGoods"   table="{{table}}"
+<dk-form-bill type="saleOut" id="dk-form-bill" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleTagCol="shortName" titleCol="skuCode"  subCol="skuCode" descCol="skuModel" priceCol="priceOut" quantityCol="outQty" sumAmountCol="sumAmount" discountStandardCol="saleDiscount" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" bind:setGoods="setGoods"   table="{{table}}"
 bind:editItems="editItems"  bind:openChoosedItemInfo="openChoosedItemInfo" deleteName="deleteItemList"
 bind:customersChoose="customersChoose"   popType="sale" priceTitle="标价:" staff="staff" org="org">
 </dk-form-bill>
@@ -11,7 +11,7 @@ bind:customersChoose="customersChoose"   popType="sale" priceTitle="标价:" s
 <view style="height: 200rpx;"></view>
 
 <!-- 底部加号 -->
-<view style="position: fixed;bottom: 230rpx;right: 30rpx;" wx:if="{{formMode == 'edit' && formType =='detail'}}">
+<view style="position: fixed;bottom: 230rpx;right: 30rpx;" wx:if="{{formMode =='detail'}}">
   <view bind:tap="toEdit" class="btn-add-class">
     <van-icon name="edit" color="#FFFFFF" size="60rpx" />
   </view>

+ 11 - 0
package-sales/pages/sales-outbound/sales-outbound.js

@@ -8,6 +8,7 @@
  *		于继渤		 2024-3-25	    1.00		   	    
  *******************************************************************************/
 const mixins = require('@/mixins/index.js')
+const Constants = require('@/utils/Constants.js');
 Page({
   mixins: [mixins],
   /**
@@ -81,6 +82,16 @@ Page({
     this.setData({
       tableData: tableData
     })
+  },
+  toDetail(e){
+    let outId = e.detail.item.outId
+    wx.navigateTo({
+      url: this.data.route.edit.url,
+      success: function (res) {
+        // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
+        res.eventChannel.emit('params', { id: outId, formMode: Constants.formMode.detail})
+      }
+    })
   }
 
 })

+ 3 - 1
utils/Constants.js

@@ -108,7 +108,9 @@ module.exports = {
     // 明细
     detail: 'detail',
     // 其他
-    other: 'other'
+    other: 'other',
+    //详情编辑
+    detailEdit:'detailEdit'
   },
 
   // 查询条件日期数据源