于继渤 преди 1 година
родител
ревизия
f6f5036823

+ 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-->

+ 46 - 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,8 @@ Page({
     },
     //按钮
     buttonSaveList: [
-      { code: 'collection', title: mixins.$t("collection"),plain:true },
-      { code: 'save', title: mixins.$t("save")}
+      { code: 'collection', title: mixins.$t("collection"), plain: true },
+      { code: 'save', title: mixins.$t("save") }
     ],
     contentSaveList: [
       { code: 'flag', title: mixins.$t("saleOutBoundFlag"), type: 'checkbox' },
@@ -160,7 +162,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 +246,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 +283,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 +313,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 +365,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 +379,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 +398,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 +427,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 +629,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 :   编辑