Przeglądaj źródła

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

姜永辉 1 rok temu
rodzic
commit
1f0d328457

+ 4 - 0
api/pages/ivt/saleOutBoundReturn.js

@@ -31,6 +31,10 @@ module.exports = {
       selectCustomers: { key: 'selectCustomers', url: '/package-base-select/pages/select-customers/select-customers' },
       openingInventory: { key: 'openingInventory', url: '/package-base-select/pages/select-data/select-data',type:'warehouse'  },
       selectInventorySku:{ key: 'selectInventorySku', url: '/package-base-select/pages/select-data/select-data',type:'inventorySku'  },
+      invalid: { key: 'invalid', method: 'invalid', primaryKey: 'outId' , image:'btn-void.png'},
+      salesOutReturnBound:{ key: 'salesOutReturnBound', method: 'toDetail', primaryKey: 'outId' , image:'btn-outbound-processing.png'},
+      printedBill:{ key: 'printedBill', method:'printedBill', formMode: 'index', idKey: 'cusId',image:'btn-printing.png' },
+      editInto: { key: 'editInto', method: 'editInto', primaryKey: 'outId', image: 'btn-edit.png'}, //编辑
     }
   }
 };

+ 3 - 0
components/dkbase/dk-popup/dk-popup.js

@@ -384,6 +384,9 @@ Component({
 
       let key = e.currentTarget.dataset.key
       let item = e.currentTarget.dataset.item
+      if (item.readonly) {
+        return;
+      }
       let checkFlag = e.currentTarget.dataset.value
       let form = this.data.form
       console.log('改变选择框内容', item)

+ 1 - 1
components/dkbase/dk-popup/dk-popup.wxml

@@ -52,7 +52,7 @@
       <!--选择框-->
       <van-field wx:if="{{item.type=='checkbox'}}" input-width="200rpx" input-class="dk-cell-value-class" label-class="nomal-label" input-align="right" label="{{item.title?item.title:$t[item.code]}}" autosize border="{{ false }}" readonly="{{true}}" errorMessage="{{item.errMsg}}">
         <view slot="end" style="text-align: right;padding-left: 10rpx;" data-item="{{item}}" data-index="{{index}}" data-value="{{form[item.code]}}" data-key="{{item.code}}" catchtap="changeCheckBox">
-          <van-checkbox shape="round" value="{{form[item.code]}}" />
+          <van-checkbox shape="round" value="{{form[item.code]}}" disabled="{{!!readonly || !!item.readonly}}" />
         </view>
       </van-field>
       <!--数量step-->

+ 23 - 19
mixins/index.js

@@ -894,24 +894,28 @@ module.exports = {
    * @date : 2024/1/22
    */
   loadTempData() {
-    var pages = getCurrentPages();
-    var currentPage = pages[pages.length - 1];
-    if (app.globalData[currentPage.route]) {
-
-      // Dialog.confirm({
-      //   message: '是否加载缓存数据',
-      // }).then(() => {
-      //   // 执行保存方法
-      //   this.setData({
-      //     formData: app.globalData[currentPage.route]
-      //   })
-      //   // 删除缓存
-      //   delete app.globalData[currentPage.route]
-      // }).catch(() => {
-      //   // 删除缓存
-      //   delete app.globalData[currentPage.route]
-      // })
-    }
+    setTimeout(()=>{
+      var pages = getCurrentPages();
+      var currentPage = pages[pages.length - 1];
+      let formData = this.data.formData
+      let formValue = app.globalData[currentPage.route];
+      console.log('ttt',formData , formValue ,formData == formValue);
+      if (formValue && formData && formData != formValue) {
+        Dialog.confirm({
+          message: '是否加载缓存数据',
+        }).then(() => {
+          // 执行保存方法
+          this.setData({
+            formData: formValue
+          })
+          // 删除缓存
+          delete app.globalData[currentPage.route]
+        }).catch(() => {
+          // 删除缓存
+          delete app.globalData[currentPage.route]
+        })
+      }
+    },300)
   },
   /**
    * @desc : 保存用户功能频率
@@ -986,7 +990,6 @@ module.exports = {
             menuUuid: data.menuUuid,
           })
         }
-        console.log('bbbb', _this.data.formMode);
         //菜单编码
         if (data.functionCode) {
           _this.setData({
@@ -1060,6 +1063,7 @@ module.exports = {
     var pages = getCurrentPages();
     var currentPage = pages[pages.length - 1];
     let route = currentPage.route;
+    console.log('formData',formData);
     if (formData && formData != '{}') {
       // 记录缓存
       app.globalData[route] = formData;

+ 6 - 0
package-base-select/pages/select-collection_confirm/select-collection_confirm.js

@@ -539,6 +539,12 @@ mixins: [mixins],
         wx.navigateBack({
           delta: 1
         })
+      }else if(this.data.formType == 8 ){ //订单收款
+        let pages = getCurrentPages();
+        let prevPage = pages[pages.length - 2]; //上1页
+        prevPage.setData({
+          formData: true
+        })
       }
     },
     /**

+ 19 - 0
package-base-select/pages/select-goods/select-goods.js

@@ -17,6 +17,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    
     firstFlag: true,
     orderBy: [{
       "text": "可售量升序",
@@ -77,6 +78,17 @@ Page({
     contentList: []
   },
   selectedProduct(e) {
+    if(e.currentTarget.dataset.active == 0&&this.data.controlFlags&& this.data.controlFlags.choosewhFlag){
+      this.setData({
+        searchContent: [
+          { code: 'whId', title: mixins.$t('whName'), dropType: 'warehouse',searchType:'dropSingle' }, 
+        ],
+      })
+    }else{
+      this.setData({
+        searchContent: [],
+      })
+    }
     this.setData({
       active: e.currentTarget.dataset.active
     })
@@ -228,6 +240,13 @@ Page({
       //controlFlags.paramsByWhId 查询商品列表 是否开启顶部选择库区的 库区id 作为参数查询  
       //controlFlags.choosewhReadonly 顶部的选择库区是否可点击选择  直接用布尔值在xml控制了
       //controlFlags.chooseWhByUserDefault 顶部的选择库区是否选择用户默认的库区
+      if(controlFlags.choosewhFlag){
+        this.setData({
+          searchContent: [
+            { code: 'whId', title: mixins.$t('whName'), dropType: 'warehouse',searchType:'dropSingle' }, 
+          ],
+        })
+      }
     }
 
   },

+ 9 - 32
package-base-select/pages/select-goods/select-goods.wxml

@@ -14,43 +14,20 @@
 <wxs src='/utils/numberFormat.wxs' module="numberFormat"></wxs>
 <wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
 <loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
-<van-dialog id="van-dialog" />
-
-
+<van-dialog id="van-dialog" /> 
 <van-sticky offset-top="{{ 0 }}">
   <van-nav-bar title="选择商品" left-text="" border="{{false}}" left-arrow="{{true}}" bind:click-left="onClickLeft" />
-  <view style="display: flex;">
-    <view style="width: 85%;">
-      <van-search border="{{false}}" bind:search="doSearch" custom-class="search-class" bind:change="onSearchText" model:value="{{ searchText }}" placeholder="输入商品名/商品编码/唯一编码" use-right-icon-slot="{{true}}" placeholder-style="color:#95A8CB">
-      </van-search>
-    </view>
-
-    <view class="scan-class" style="width: 15%;display: flex;align-items: center;">
-      <image class="scan-image" fit="fill" src="{{imageUrl+'scan_image.png'}}"></image>
-    </view>
-  </view>
-
-  <view wx:if="{{active == 0 && controlFlags.choosewhFlag}}" style="display: flex;margin-left: 24rpx;margin-right: 24rpx;margin-top: 10rpx;">
-  <van-dropdown-menu active-color="#1B365D" style=" width: calc(100% ) !important; ">
-    <!-- 库区 -->
-    <van-dropdown-item id="statusItemWareHouse" disabled="{{controlFlags.choosewhReadonly}}" title="{{ form.whName ? form.whName:'仓库' }}" bind:open="dropdowncommit">
-    </van-dropdown-item>
-    <!-- 可售量排序 -->
-    <van-dropdown-item title="{{ orderBy.text?orderBy.text:'可售量升序' }}" value="{{value}}" options="{{ orderBy }}" bind:change="onSwitchChange">
-    </van-dropdown-item>
-  </van-dropdown-menu>
-</view>
-
+  
+<!-- 查询条件 -->
+<dk-dropdown-menu model:value="{{searchForm}}" menuList="{{searchContent}}"   bind:search="searchData" searchTextPlaceholder="{{wxmlUtil.setSearchPlaceholder($t,['skuName','skuCode','onlyCode'])}}">
+  </dk-dropdown-menu>
+ 
   <view style="display: flex;margin-left: 24rpx;margin-right: 24rpx;margin-top: 10rpx;">
     <view bind:tap="selectedProduct" data-active="{{0}}" class="{{ active == 0 ?'selected-product selected-product-color-01' : 'selected-product selected-product-color-02'}}">
       商品列表
-    </view>
-
-    <view bind:tap="selectedProduct" data-active="{{1}}" class="{{ active == 0 ? 'selected-product selected-product-color-02' : 'selected-product selected-product-color-01'}}" style="position: relative;" >
-
-        <view>已选商品</view>
-     
-  
+    </view> 
+    <view bind:tap="selectedProduct" data-active="{{1}}" class="{{ active == 0 ? 'selected-product selected-product-color-02' : 'selected-product selected-product-color-01'}}" style="position: relative;" > 
+        <view>已选商品</view> 
       <view wx:if="{{choosedGoodsList.length > 0}}" style="position: absolute;top:16rpx;right: 40rpx;">
         <view class="icon">{{choosedGoodsList.length}}</view>
       </view>

+ 1 - 1
package-base-select/pages/select-goods/select-goods.wxss

@@ -3,7 +3,7 @@ page {
   /* height: 100%; */
 } 
  .addtop{
-  padding-top: 49px;
+  padding-top: 9px;
  }
  .addsidebar{
   padding-top: 49px;

+ 1 - 10
package-purchase/pages/purchase-return/add/add.js

@@ -188,16 +188,7 @@ Page({
     }
   },
 
-  /**
-* @desc :处理保存后续
-* @date : 2024/2/1 15:49
-* @author : 于继渤
-*/
-  handleData() {
-    wx.navigateBack({
-      data: 1
-    })
-  },
+
   //展开
   collapseFlagChange(e) {
     this.setData({

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

@@ -243,10 +243,6 @@ Page({
         events: {
           // 回调后
           bindData: function (data) {
-            // 保存成功后 回调
-            wx.navigateBack({
-              data: 2
-            })
           }
         },
         success: function (res) {

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

@@ -15,7 +15,9 @@ Page({
     orderService: app.globalData['orderService'],
     commonService: app.globalData['commonService'],
     saleOutBoundReturnService: app.globalData['saleOutBoundReturnService'],
-    btnFormData: JSON.stringify({ flag: true }),
+    btnFormData: JSON.stringify({ flag: app.globalData.setting[Constants.settingCode.IVT001] == "true" ? true : false }),
+    // 系统参数
+    flgHandleSetting: app.globalData.setting[Constants.settingCode.IVT001] == "true" ? true : false,
     cardList: [
       { name: 'main', title: mixins.$t("customerInformation") },
       { name: 'relation' },
@@ -36,8 +38,8 @@ Page({
         code: 'fromNo',
         name: 'fromNo',
         type: 'choose',
-        titpsKey:'cusId',
-        titpsMessage:'请选择客户',
+        titpsKey: 'cusId',
+        titpsMessage: '请选择客户',
         controlChooseFlag: true,
         title: mixins.$t("sourceOrder"),//'关联源单'
         urlKey: 'selectSourceSaleOrder'
@@ -55,8 +57,7 @@ Page({
     },
     //按钮
     buttonSaveList: [
-      { code: 'collection', title: mixins.$t("collection"),plain:true },
-      { code: 'save', title: mixins.$t("save")}
+      { code: 'save', title: mixins.$t("save") }
     ],
     contentSaveList: [
       { code: 'flag', title: mixins.$t("saleOutBoundFlag"), type: 'checkbox' },
@@ -160,7 +161,7 @@ Page({
     * @date : 2024/2/1 15:49
     * @author : 于继渤
     */
-   getInventory(params) {
+  getInventory(params) {
     return new Promise((resolve, reject) => {
       this.excute(this.data.commonService, this.data.commonService.getInventoryByList, params).then(res => {
         if (res.data.code == 200) {
@@ -244,12 +245,12 @@ Page({
     }
     //选择源单
     if (code == 'fromNo') {
-      console.log('item.itemList',item.itemList)
+      console.log('item.itemList', item.itemList)
       if (item.itemList && item.itemList.length > 0) {
-        item.itemList.forEach(res=>{
+        item.itemList.forEach(res => {
           res.outingAmt = res.outAmt * -1
           res.outingQty = res.outQty * -1
-          res['outingQty_min'] =  res.outQty * -1
+          res['outingQty_min'] = res.outQty * -1
           res['outingQty_max'] = Number(-1)
         })
 
@@ -281,11 +282,11 @@ Page({
       this.handleWarehousing()
     }
   },
-   /**
-   * @desc : 撤回
-   * @date : 2024/2/1 15:49
-   * @author : 于
-   */
+  /**
+  * @desc : 撤回
+  * @date : 2024/2/1 15:49
+  * @author : 于
+  */
   handleWarehousing(e) {
     let item = {}
     item.outId = this.data.id
@@ -311,10 +312,10 @@ Page({
       res['sOrderId'] = res.sorderId
       res.itemIndex = itemIndex++
       res.canNegativeFlag = true
-      if(this.data.formMode != 'detail'){
+      if (this.data.formMode != 'detail') {
         delete res['itemId']
       }
-    
+
     })
 
 
@@ -363,13 +364,13 @@ Page({
     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)
-        if (res.data.data.data.outStatus == mixins.$t("outBoundedOutStatus")) {
-          let buttonSaveList  = this.data.buttonSaveList
+        if (res.data.data.data.outStatus == mixins.$t("outBoundedOutStatus") && this.data.formMode != 'other') {
+          let buttonSaveList = this.data.buttonSaveList
           buttonSaveList = [
             { name: 'merge', title: mixins.$t("handleWithdrawal"), }
           ]
           this.setData({
-            buttonSaveList:buttonSaveList
+            buttonSaveList: buttonSaveList
           })
         }
         formData = res.data.data.data
@@ -377,18 +378,18 @@ Page({
         if (!API) {
           formData.fromNo = formData.formNo
         } else {
-          formData.fromNo = formData.orderNo
+          formData.fromNo = formData.fromNo ? formData.fromNo : formData.orderNo
         }
         //处理地址
         formData.address = this.setAddress(formData)
 
-        res.data.data.dataItem.forEach(item=>{
-          item.outingQty_max =  -1
-          item.priceStd =  item.priceOut
-          item.outingQty_min = item.canOutingQty  ? item.canOutingQty : item.invQty*-1 //可出库最大值
+        res.data.data.dataItem.forEach(item => {
+          item.outingQty_max = -1
+          item.priceStd = item.priceOut
+          item.outingQty_min = item.canOutingQty ? item.canOutingQty : item.invQty * -1 //可出库最大值
         })
 
-      
+
         formData.goodsList = res.data.data.dataItem
         //处理默认值  业务员业务部门
         formData = this.setStaffOrg(formData)
@@ -396,8 +397,8 @@ Page({
         let cardList = this.data.cardList
         cardList[2].chooseGoodsFlag = false
         this.calculateAmount(formData)
-        console.log('结果',res)
-    
+        console.log('结果', res)
+
         this.setData({
           cardList: cardList,
           formData: JSON.stringify(formData)
@@ -425,7 +426,7 @@ Page({
     cardList[1].sumStandard = data.sumStandard
     cardList[1].sumQuantity = data.sumQuantity
     cardList[1].saleDiscount = data.saleDiscount
-    console.log(data,'11')
+    console.log(data, '11')
 
     this.setData({
       cardList: cardList,
@@ -627,6 +628,22 @@ Page({
       wx.setNavigationBarTitle({
         title: '编辑销售退货'
       })
+
+      if (this.data.formMode == Constants.formMode.other) {
+        this.setData({
+          popContent: [
+            { code: 'outingQty', type: 'step', title: mixins.$t("count"), required: true },
+            { code: 'priceOut', type: 'number', title: mixins.$t("priceSale"), required: true },
+            {
+              code: 'whId', name: 'whName', choosePopupType: 'inventorySku', title: mixins.$t("warehouseId"), type: 'choose', urlKey: 'selectInventorySku',
+            },
+            { code: 'nonStdCode', title: mixins.$t("goodsBatch"), type: 'str', },
+            { code: 'flgGift', title: mixins.$t("flgGift"), type: 'checkbox', readonly: true },
+          ]
+        })
+
+      }
+      console.log('this.data.id', this.data.id)
       //查询信息
       this.getItemDetal(this.data.id)
     }

+ 79 - 43
package-sales/pages/order-return/order-return.js

@@ -60,7 +60,7 @@ Page({
 
     // 列表区(脚部金额)
     footerAmount: {
-      name: 'outAmt',
+      name: 'sumOutAmt',
       title: '退货金额'
     },
     // 列表区(脚部信息)
@@ -68,7 +68,7 @@ Page({
       name: 'categoryQuantity',
       title: '共计'
     }, {
-      name: 'outQty',
+      name: 'sumOutQty',
       title: '件'
     }],
     // 列表区(内容)
@@ -76,7 +76,7 @@ Page({
       { name: 'outNo', title: '订单编号' },
       { name: 'cusPhone', title: '客户电话' },
       { name: 'addressFull', title: '客户地址' },
-      { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId')  }], title: mixins.$t('storeInformation') }
+      { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId') }], title: mixins.$t('storeInformation') }
     ],
     buttonSaveList: [{ code: 'add', title: mixins.$t("add") }],
     contentSaveList: [{ code: 'need', title: mixins.$t("totalAmount"), type: 'str' }, { code: 'amount', content: 0, type: 'number' }],
@@ -113,14 +113,17 @@ Page({
     },
 
     // 弹出按钮
-    buttonList: [{
-      name: 'warehousingProcessing',
-      title: '入库办理'
-    }, , {
-      name: 'salesReturnReversal',
-      title: '销售退货冲正'
-    }
-
+    buttonList: [
+      {
+        name: 'editInto',
+        title: mixins.$t('edit')
+      },
+      { name: 'salesOutReturnBound', title: mixins.$t("outProcessing") },
+      {
+        name: 'printedBill',
+        title: mixins.$t('printedBill') //打印票据
+      },
+      { name: 'invalid', title: mixins.$t("invaidOrder") } //作废
     ],
 
     // 路由
@@ -128,18 +131,50 @@ Page({
     active: 0
   },
 
-    /**
- * @desc : 设置查询参数
- * @date : 2024/2/1 15:49
- * @author : 于继渤
- */
-setSearchParams(params) {
-  //销售状态
-  params.outTypeList = [Constants.outType.intoReturn]
-  params.cusId = this.data.id ? this.data.id : null
-  return params
-},
-  
+  /**
+* @desc : 设置查询参数
+* @date : 2024/2/1 15:49
+* @author : 于继渤
+*/
+  setSearchParams(params) {
+    //销售状态
+    params.outTypeList = [Constants.outType.intoReturn]
+    params.cusId = this.data.id ? this.data.id : null
+    return 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.outId, formMode: Constants.formMode.other,formType: Constants.formMode.edit, item: item })
+      }
+    })
+  },
+
+
+  /**
+* @desc :   作废
+* @date : 2024年3月8日
+* @author : 于继渤
+*/
+  invalid(e) {
+    return this.excute(this.data.service, this.data.service.repeal + '/' + e.outId, {}).then(res => {
+      if (res.data.code == 200) {
+        wx.showToast({
+          title: mixins.$t('invalidSuccessfully'),
+          image: '/static/image/success.png',
+          duration: 1000
+        })
+      }
+    })
+  },
   /**
      * @desc : 加载数据
      * @author : 于继渤
@@ -154,7 +189,7 @@ setSearchParams(params) {
    * @author : 于继渤
    */
   handleSearchData(tableData) {
-     //计算底部金额
+    //计算底部金额
     this.calculateTotalAmount()
   },
   /**
@@ -162,30 +197,31 @@ setSearchParams(params) {
 * @date : 2024年4月8日
 * @author : 于继渤
 */
-calculateTotalAmount() {
-  let tableData = this.data.tableData
-  let contentSaveList = this.data.contentSaveList
-  let outAmt = Number(0)
-  let outQty = Number(0)
-  tableData.forEach(res => {
-    outAmt += res.outAmt
-    outQty += res.outQty
-  })
-  contentSaveList[1].content = outAmt
-  contentSaveList[1].bill = tableData.length
-  contentSaveList[1].quantity = outQty
-  this.setData({
-    contentSaveList: contentSaveList
-  })
+  calculateTotalAmount() {
+    let tableData = this.data.tableData
+    let contentSaveList = this.data.contentSaveList
+    let outAmt = Number(0)
+    let outQty = Number(0)
+    tableData.forEach(res => {
+      outAmt += res.outAmt
+      outQty += res.outQty
+    })
+    contentSaveList[1].content = outAmt
+    contentSaveList[1].bill = tableData.length
+    contentSaveList[1].quantity = outQty
+    this.setData({
+      contentSaveList: contentSaveList
+    })
 
-},
-  toDetail(e){
-    let outId = e.detail.item.outId
+  },
+  toDetail(e) {
+    
+    let outId = e.outId ? e.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,formType: Constants.formMode.detail})
+        res.eventChannel.emit('params', { id: outId, formMode: Constants.formMode.detail, formType: Constants.formMode.detail })
       }
     })
   }

+ 2 - 1
package-sales/pages/sales-outbound/add/add.js

@@ -74,8 +74,9 @@ Page({
     ],
     popupTopObj: [{ leftTitle: '库存量', leftCode: 'usableQty', rightTitle: '可售量', rightCode: 'invQty' }],
     titpsFlag: true,
+    btnFormData: JSON.stringify({ flag: app.globalData.setting[Constants.settingCode.IVT001] == "true" ? true : false }),
     // 系统参数
-    flgHandleSetting: app.globalData.setting[Constants.settingCode.IVT001] == "true" ? true : false
+    flgHandleSetting: app.globalData.setting[Constants.settingCode.IVT001] == "true" ? true : false,
   },
   /**
      * @desc :   编辑