Ver Fonte

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

zhoux há 2 anos atrás
pai
commit
851185f7ae

+ 1 - 0
api/pages/sale/order.js

@@ -25,6 +25,7 @@ module.exports = {
     order: {
       docName:{key:'order' ,title:'销售订单'},
       add: { key: 'add', url: '/package-sales/pages/order-billing/add/add'},
+      editInto: { key: 'editInto', method: 'editInto', primaryKey: 'orderId', image: 'btn-edit.png'}, //编辑
       editOrder: { key: 'editOrder', url: '/package-sales/pages/order-billing/add/add', idKey: 'orderId', formMode: 'edit' },
       invalid: { key: 'invalid', method: 'invalid', primaryKey: 'orderId',question:true , image:'btn-void.png'},
       openPurchase: { key: 'openPurchase', url: '/package-purchase/pages/purchase-order/add/add' },

+ 4 - 1
components/dkbase/dk-form-bill/dk-form-bill.js

@@ -1374,8 +1374,11 @@ Component({
         form.goodsList.forEach(item => {
           //标价合计 =  商品标价 x  商品数量
           item.priceStd = item.priceStandard//标价
+          item.outingQty = item.itemQty * -1
           item.amtStd = Number(item.priceStd * item.itemQty)
-          item.outAmt = item.priceOut * item.outQty
+          delete item['outQty']
+          delete item['outAmt']
+          item.outingAmt = item.priceOut * item.outingQty
           item.priceDiscount = item.priceStd ? Number((item.priceOut / item.priceStd) * 100).toFixed(2) : 100//售价折扣
           sumQuantity += item.outQty //数量
           sumAmount += item.priceOut * item.outQty //没有售价默认取标价

+ 43 - 20
package-base-select/pages/select-goods/select-goods.js

@@ -87,6 +87,21 @@ Page({
         ]
       })
     }
+    if (this.data.item == Constants.billType.sale ) {
+      this.setData({
+        popContent:[
+          { code: 'itemQty', type: 'step', title: mixins.$t("count"), required: true },
+          { code: 'priceSale', type: 'number', title: mixins.$t("priceSale"), required: true ,center:'right'},
+          {
+            code: 'whId', name: 'whName', title: mixins.$t("warehouseId"), type: 'choose', urlKey: 'openingInventory',
+          },
+          { code: 'nonStdCode', title: mixins.$t("goodsBatch"), type: 'str', },
+          { code: 'flgGift', title: mixins.$t("flgGift"), type: 'checkbox', },
+        ]
+      })
+    }
+
+   
     if (this.data.item == Constants.billType.saleOut ) {
       this.setData({
         popContent: [{ code: 'itemQty', type: 'step', title: mixins.$t("count"), required: true },
@@ -257,27 +272,35 @@ Page({
 * @date : 2024/2/1 15:49
 * @author : 于继渤
 */
-  openAddItemInfo(e) {
-    console.log('openAddItemInfo',e)
-    let item = e.currentTarget.dataset.item
-    item.itemQty = 1   //打开 popur 数量默认为1
-    // item.nonStdCode = "-" //不要在这赋值非标号 想赋值去查询回来处理的方法去赋值
-    if (this.data.item == Constants.billType.saleOut) { //跟进仓库批次号cpid 查询库存
-      console.log('globalData', app.globalData)
-      this.getInventory(
-        {
-          skuId:item.skuId, 
-          cpId:app.globalData.user.cpId, 
-          nonStdCode:item.nonStdCode, 
-        }
-      )
-    }
+openAddItemInfo(e) {
+  console.log('openAddItemInfo',e)
+  let item = e.currentTarget.dataset.item
+  item.itemQty = 1   //打开 popur 数量默认为1
+  // item.nonStdCode = "-" //不要在这赋值非标号 想赋值去查询回来处理的方法去赋值
+  if (this.data.item == Constants.billType.saleOut) { //跟进仓库批次号cpid 查询库存
+    console.log('globalData', app.globalData)
+    item.nonStdCode =   item.nonStdCode  ?  item.nonStdCode  : '-'
+    item.priceSale = item.priceStandard
+    console.log(app.globalData)
+    this.getInventory(
+      {
+        skuId:item.skuId, 
+        cpId:app.globalData.company.cpId, 
+        nonStdCode:item.nonStdCode, 
+      }
+    )
+  }
+  if(this.data.item == Constants.billType.sale){
+    item.nonStdCode =   item.nonStdCode  ?  item.nonStdCode  : '-'
+    item.priceSale = item.priceStandard
+    
+  }
 
-    this.setData({
-      dataItem: JSON.stringify(item),
-      showPop: true,
-    })
-  },
+  this.setData({
+    dataItem: JSON.stringify(item),
+    showPop: true,
+  })
+},
 
   /**
     * @desc : 查询库存

+ 2 - 2
package-base-select/pages/select-goods/select-goods.wxml

@@ -83,7 +83,7 @@
                   <dk-cell height="46rpx" spaceWidth="1rpx" left="0" fontSize="14" contentColor="#FF7B1A" fontWeight="700" title="" content="{{item.pricePurchase?item.pricePurchase:0}}"></dk-cell>
                 </view>
                 <view wx:else>
-                  <view style="color: #002340A6;font-size:22rpx;font-weight: 500;margin-top: 18rpx;">标价</view>
+                  <!-- <view style="color: #002340A6;font-size:22rpx;font-weight: 500;margin-top: 18rpx;">标价</view> -->
                   <dk-cell height="46rpx" spaceWidth="1rpx" left="0" fontSize="14" contentColor="#FF7B1A" fontWeight="700" title="" content="{{item.priceStandard?item.priceStandard:0}}"></dk-cell>
                 </view>
 
@@ -242,7 +242,7 @@
                 </view>
                 <view style="display: flex;" wx:if="{{billType == 'sale'}}">
                   <view class="table-content-row-font">
-                    <dk-text fontSize="14px" color="#95A8CB" fontWeight="nomal" value="非标号" copyValue="{{item.nonStdCode}}"></dk-text>
+                    <dk-text fontSize="14px" color="#95A8CB" fontWeight="nomal" value="商品批次号" copyValue="{{item.nonStdCode}}"></dk-text>
                   </view>
                   <view class="table-content-class">
                     {{item.nonStdCode?item.nonStdCode:''}}

+ 4 - 3
package-sales/pages/order-billing/add/add.js

@@ -489,9 +489,10 @@ Page({
       //设置默认业务员业务部门
       this.setTopStaffAndOrg(formData)
 
-      //设置送货日期
-
-      formData.deliveryDate =   util.formatDayTime(new Date())
+      // 设置送货日期 当前日期 加一天
+      var currentDate = new Date(); 
+      currentDate.setDate(currentDate.getDate() + 7);
+      formData.deliveryDate =   util.formatDayTime(currentDate)
       this.setData({
         formData:JSON.stringify(formData)
       })

+ 23 - 5
package-sales/pages/order-billing/order-billing.js

@@ -17,7 +17,7 @@ Page({
    * 页面的初始数据 
    */
   data: {
-    tagList: [{ title: "全部", code: '' }, { title: "待出库", code: ['出库状态-待出库'] }, { title: "已出库", code:['出库状态-出库中','出库状态-已出库']  }],
+    tagList: [{ title: "全部", code: '' }, { title: "待出库", code: ['出库状态-待出库'] }, { title: "已出库", code: ['出库状态-出库中', '出库状态-已出库'] }],
     routeObjName: 'order',
     // 查询条件
     searchContent: [
@@ -84,6 +84,10 @@ Page({
     },
     // 弹出按钮
     buttonList: [
+      {
+        name: 'editInto',
+        title: mixins.$t('edit')
+      },
       { name: 'saleOutBound', title: mixins.$t("saleOutBound"), formMode: Constants.formMode.other, other: { idKey: 'orderId' } },//出库
       {
         name: 'saleOrderReturn', title: mixins.$t("saleReturn"), formMode: Constants.formMode.other, other: {
@@ -101,7 +105,7 @@ Page({
       bill: 0,
       quantity: 0
     }],
-    primaryKey:'orderId'
+    primaryKey: 'orderId'
   },
   /**
   * @desc :   处理接口返回数据
@@ -131,7 +135,7 @@ Page({
   */
   invalid(e) {
     this.setData({
-      loading:true
+      loading: true
     })
     return this.excute(this.data.service, this.data.service.invalid + '/' + e.orderId, {}).then(res => {
       if (res.data.code == Constants.SUCESS_CODE) {
@@ -144,7 +148,7 @@ Page({
         this.searchData();
       }
       this.setData({
-        loading:false
+        loading: false
       })
     })
   },
@@ -181,7 +185,21 @@ Page({
   getData(params) {
     return this.excute(this.data.service, this.data.service.selectByCond, params);
   },
-
+  /**
+     * @desc : 编辑
+     * @author : 于继渤
+     * @date : 2024/1/23 9:16
+     */
+  editInto(e) {
+    let item = e
+    wx.navigateTo({
+      url: this.data.route.add.url,
+      success: function (res) {
+        // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
+        res.eventChannel.emit('params', { id: item.orderId, formMode: Constants.formMode.edit, item: item })
+      }
+    })
+  },
   /**
   * @desc :   计算底部合计金额等
   * @date : 2024年4月8日