于继渤 il y a 2 ans
Parent
commit
1eb2c2423a

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

@@ -26,6 +26,9 @@ module.exports = {
       openingInventory: { key: 'openingInventory', url: '/package-base-select/pages/select-warehouse/select-warehouse'  },
       openingInventory: { key: 'openingInventory', url: '/package-base-select/pages/select-warehouse/select-warehouse'  },
       chooseStorageObject: { key: 'chooseStorageObject', url: '/package-base-select/pages/select-storage-object/select-storage-object'  },
       chooseStorageObject: { key: 'chooseStorageObject', url: '/package-base-select/pages/select-storage-object/select-storage-object'  },
       chooseStorageOutReason: { key: 'chooseStorageOutReason', url: '/package-base-select/pages/select-data-dictionary/select-data-dictionary'  },
       chooseStorageOutReason: { key: 'chooseStorageOutReason', url: '/package-base-select/pages/select-data-dictionary/select-data-dictionary'  },
+      selectSourceSaleOrder:{
+        key:'selectSourceSaleOrder',url:'/package-base-select/pages/select-source-sale-order/select-source-sale-order'
+      }
     }
     }
   }
   }
 };
 };

+ 23 - 0
api/pages/ivt/saleOutBound.js

@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright(c) 2024 dongke All rights reserved. / Confidential
+ * 类的信息:
+ *		1.程序名称:
+ *		2.功能描述:入库
+ * 编辑履历:
+ *		作者				日期					版本				修改内容
+ *		于继渤		  	     2024-1-19       			1.00		       	新建
+ *******************************************************************************/
+module.exports = {
+  saleOutBoundService: {
+    // 前缀
+    prefix: 'mdm-server/ivt/outbound/',
+  },
+
+  routeUrl: {
+    saleOutBound: { 
+      selectSourceSaleOrder:{
+        key:'selectSourceSaleOrder',url:'/package-base-select/pages/select-source-sale-order/select-source-sale-order'
+      }
+    }
+  }
+};

+ 2 - 1
app.js

@@ -57,10 +57,11 @@ const cusFollow = require('./api/pages/mst/cusFollow.js');
 const transfer = require('./api/pages/mac/transfer.js');
 const transfer = require('./api/pages/mac/transfer.js');
 const order = require('./api/pages/sale/order.js');
 const order = require('./api/pages/sale/order.js');
 const income = require('./api/pages/mac/income.js');
 const income = require('./api/pages/mac/income.js');
+const saleOutBound = require('./api/pages/ivt/saleOutBound.js');
 
 
 // api服务路由文件
 // api服务路由文件
 var apiList = [common, oauth,setting, company, wechatPay,user, staff, staffRight, staffPurview, settingValue, customer, role, roleFun, org, roleSensitive, goodsBrand, goodsCategory, goodsSeries, unit, supplier, warehouse, saleChannel, goodsSku, basicData,customerMst,purchase,account,
 var apiList = [common, oauth,setting, company, wechatPay,user, staff, staffRight, staffPurview, settingValue, customer, role, roleFun, org, roleSensitive, goodsBrand, goodsCategory, goodsSeries, unit, supplier, warehouse, saleChannel, goodsSku, basicData,customerMst,purchase,account,
-  receiptPayment,inbound,inboundOther,inboundProcessing,inboundPurchaseReturn,outbound,outboundOther,outboundProcessing,outboundSaleReturn,inventory,moneyAccount,intoReturn,intoReturnItem,cusFollow,order,transfer,income]
+  receiptPayment,inbound,inboundOther,inboundProcessing,inboundPurchaseReturn,outbound,outboundOther,outboundProcessing,outboundSaleReturn,inventory,moneyAccount,intoReturn,intoReturnItem,cusFollow,order,transfer,income,saleOutBound]
 
 
 const util = require('./utils/util.js')
 const util = require('./utils/util.js')
 const baseMethod = require('./api/pages/baseMethod.js')
 const baseMethod = require('./api/pages/baseMethod.js')

+ 163 - 60
package-base-select/pages/select-source-sale-order/select-source-sale-order.js

@@ -1,66 +1,169 @@
-// package-base-select/pages/select-source-sale-order/select-source-sale-order.js
+const Constants = require('@/utils/Constants.js');
+const util = require('@/utils/util.js')
+const mixins = require('@/mixins/index.js')
 Page({
 Page({
+  mixins: [mixins],
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    returnTotalAmount: 0,
+    allChecked: false,
+    // 路由
+    routeObjName: 'inbound',
+    tableData: [],
+    choooseInboundItemList: [],
+    buttonSaveList: [{ code: 'add', title:  mixins.$t('confirm'), width: '120rpx', color: '#1B365D' }],
+    contentSaveList: [{code:'flag',title:'全出',type:'checkbox'},{code:'need',title:'合计金额',type:'str'},{code:'amount',content:0,type:'number'}],
+  },
+  /**
+   * @desc :   加载数据源
+   * @date : 2024/2/1 15:49
+   * @author : 于继渤
+   */
+  getData(params) {
+    return this.excute(this.data.service, this.data.service.selectInboundAndItem, params);
+  },
+
+  /**
+  * @desc :   设置查询参数
+  * @date : 2024/2/1 15:49
+  * @author : 于继渤
+  */
+  setSearchParams(params) {
+    params.intoType = Constants.intoType.pur
+    params.fromId = this.data.id
+    return params
+  },
+  /**
+   * @desc :   父级商品信息选择
+   * @date : 2024/2/1 15:49
+   * @author : 于继渤
+   */
+  onListItemChange(e) {
+    let tableData = this.data.tableData
+    let index = e.currentTarget.dataset.index
+    tableData[index].checked = !tableData[index].checked
+    let inboundItemList = tableData[index].inboundItemList
+    if (inboundItemList && inboundItemList.length > 0) {
+      inboundItemList.forEach(res => {
+        res.checked = tableData[index].checked
+      })
+    }
 
 
-    /**
-     * 页面的初始数据
-     */
-    data: {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad(options) {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload() {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
+    this.setData({
+      tableData: tableData
+    })
+    this.calculateTotal()
+  },
+  /**
+   * @desc :   子级商品信息选择
+   * @date : 2024/2/1 15:49
+   * @author : 于继渤
+   */
+  onChangeItemCheckbox(e) {
+    let tableData = this.data.tableData
+    let index = e.currentTarget.dataset.index
+    let index_ = e.currentTarget.dataset.index_
+    console.log(index, index_)
+    tableData[index].inboundItemList[index_].checked = !tableData[index].inboundItemList[index_].checked
+
+    this.setData({
+      tableData: tableData
+    })
+
+    this.calculateTotal()
+  },
+
+  /**
+    * @desc :  全退
+    * @date : 2024/2/1 15:49
+    * @author : 于继渤
+    */
+  onCheckboxChange(e) {
+    console.log(e.detail.checked)
+    let checked = e.detail.checked
+    let tableData = this.data.tableData
+    tableData.forEach(res => {
+      res.checked = checked
+      if (res.inboundItemList && res.inboundItemList.length > 0) {
+        res.inboundItemList.forEach(item => {
+          item.checked = checked
+        })
+      }
+    })
+    this.setData({
+      tableData: tableData
+    })
+    this.calculateTotal()
+  },
+
+  /**
+    * @desc :   计算金额/过滤出已选数据
+    * @date : 2024/2/1 15:49
+    * @author : 于继渤
+    */
+  calculateTotal() {
+    let tableData = this.data.tableData
+    let contentSaveList = this.data.contentSaveList
+    let choooseInboundItemList = []
+    let returnTotalAmount = Number(0)
+    //过滤出已选数据
+    tableData.forEach(res => {
+      if (res.inboundItemList && res.inboundItemList.length > 0) {
+        res.inboundItemList.forEach(item => {
+          if (item.checked) {
+            item.itemQty = Number(item.rejectQty * -1)
+            item.itemQtyMax = Number(item.rejectQty * -1)
+            item.priceReturn = Number(item.priceInto * -1)
+            item.itemAmt = Number(item.rejectQty * item.priceInto * -1)
+            choooseInboundItemList.push(item)
+          }
+        })
+      }
+    })
+    if (choooseInboundItemList && choooseInboundItemList.length > 0) {
+      choooseInboundItemList.forEach(res => {
+        returnTotalAmount += Number(res.rejectQty * res.priceInto)
+      })
+    }
 
 
-    },
+    contentSaveList[2]['content'] = returnTotalAmount.toFixed(2)
+
+    this.setData({
+      choooseInboundItemList: choooseInboundItemList,
+      contentSaveList: contentSaveList,
+    })
+  },
+  /**
+  * @desc :   跳转退货页
+  * @date : 2024/2/1 15:49
+  * @author : 于继渤
+  */
+  toAdd() {
+    let choooseInboundItemList = this.data.choooseInboundItemList
+    let that = this
+    let formData = that.data.formData
+    let item = that.data.item
+    wx.navigateTo({
+      url: this.data.route.addReturn.url,
+      success: function (res) {
+        res.eventChannel.emit('params', {
+          formMode:'add',
+          choooseInboundItemList: choooseInboundItemList,
+          goodsRejectedAmount: that.data.returnTotalAmount,
+          item: JSON.stringify(item)
+        })
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
 
 
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage() {
 
 
-    }
 })
 })

+ 2 - 1
package-base-select/pages/select-source-sale-order/select-source-sale-order.json

@@ -1,3 +1,4 @@
 {
 {
-    "usingComponents": {}
+    "usingComponents": {},
+    "navigationBarTitleText": "选择源单"
 }
 }

+ 70 - 2
package-base-select/pages/select-source-sale-order/select-source-sale-order.wxml

@@ -1,2 +1,70 @@
-<!--package-base-select/pages/select-source-sale-order/select-source-sale-order.wxml-->
-<text>package-base-select/pages/select-source-sale-order/select-source-sale-order.wxml</text>
+<wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
+<loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
+
+<van-sticky scroll-top="0">
+  <!-- 查询条件 -->
+  <dk-dropdown-menu model:value="{{searchForm}}" menuList="{{searchContent}}" pullMenuList="{{pullMenuList}}" bind:search="searchData" searchTextPlaceholder="{{wxmlUtil.setSearchPlaceholder($t,['roleName','roleCode'])}}">
+  </dk-dropdown-menu>
+
+</van-sticky>
+
+
+
+<view wx:for="{{tableData}}" data-item="{{item}}" wx:key="index" class="main-class">
+  <view class="main-foot" style="border-radius: 15rpx;">
+    <view class="table-content" data-item="{{item}}">
+      <view style="padding:16rpx;">
+        <view style="display:flex;justify-content: left;align-items: center;">
+          <view style="width: 20%;display: flex;">
+            <van-checkbox checked-color="#E4002B" value="{{ item.checked }}" data-index="{{index}}" data-index_="{{index_}}" bind:change="onListItemChange"></van-checkbox> <view style="color:#95A8CB;font-size:13px;padding-left: 6px;">全出</view>
+          </view>
+          <view style="width: 60%;">
+            <view style="font-size: 26rpx;color:#1B365D">{{item.intoNo}}</view>
+            <view style="font-size: 24rpx;color:#95A8CB;padding-top:10rpx"> {{item.makeTime ? wxmlUtil.format(item.makeTime) : ''}}</view>
+          </view>
+          <view style="width: 20%;text-align: right;font-size: 26rpx;color:#1B365D">销售订单</view>
+        </view>
+      </view>
+      <view wx:for="{{item.inboundItemList}}" wx:for-item="item_" wx:for-index="index_">
+        <view style="display: flex;" data-index="{{index}}" data-index_="{{index_}}">
+          <view style="place-self: center;padding-left: 15rpx;padding-right: 15rpx;">
+            <view style="display: flex;padding-left: 10rpx;">
+              <van-checkbox checked-color="#E4002B" value="{{ item_.checked }}" data-index="{{index}}" data-index_="{{index_}}" bind:change="onChangeItemCheckbox" checked-color="#E4002B"></van-checkbox>
+              <view class="red-checkbox" style="{{item_.checked ? 'color:#E4002B;' : ''}}">出</view>
+            </view>
+          </view>
+          <view class="border-solid" style="{{index_ === 0 ? (item.inboundItemList.length  == 1 ? 'margin-top:30rpx;margin-bottom:30rpx;' : 'margin-top:30rpx;') : index_ ===(item.inboundItemList.length -1) ? 'margin-bottom:30rpx;': ''}}"></view>
+          <view style="display: flex;width: 100%;">
+            <view style="padding:20rpx;">
+              <van-image radius="5px" width="80" height="80" src="{{item_.skuImages? item_.skuImages.path : ''}}" />
+            </view>
+            <view style="width: 100%;padding:20rpx;padding-left: 10rpx;">
+              <view>
+                <dk-title titleTag="{{'HEGII'}}" title="{{item_.skuCode}}"></dk-title>
+              </view>
+              <view>
+                <view style="width: 100%;margin-top: 10rpx;" class="font">{{item_.skuName}}</view>
+              </view>
+              <view style="display: flex;width: 100%;margin-top: 40rpx;position: absolute;">
+                <view style="width: 40%;">
+                  <dk-cell contentFontSize="15" height="25rpx" fontWeight="bold" left="0rpx" contentColor="#CAA977" title="" content="{{ item_.priceInto ? item_.priceInto : 0}}"></dk-cell>
+                </view>
+                <view style="width: 60%;font-size:24rpx;color: #95A8CB;line-height: 34rpx;">{{ ' x ' + (item_.rejectQty ? item_.rejectQty : 0)}}</view>
+              </view>
+            </view>
+          </view>
+        </view>
+        <view wx:if="{{index_ !== (item.inboundItemList.length -1)  && item.inboundItemList.length > 1}}" style="text-align: center;margin-left: 30rpx;margin-right: 30rpx;">
+          <view style="border: solid 1rpx #D3D3D3;"></view>
+        </view>
+      </view>
+    </view>
+  </view>
+</view>
+
+<van-empty wx:if="{{!tableData[0].inboundItemList || tableData[0].inboundItemList.length ==0}}" description="暂无出库单" />
+
+<view style="height: 200rpx;"></view>
+
+
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{true}}" btnRightFlag="{{true}}" buttonList="{{buttonSaveList}}" contentList="{{contentSaveList}}" bind:open="toAdd"></dk-save-button>

+ 70 - 1
package-base-select/pages/select-source-sale-order/select-source-sale-order.wxss

@@ -1 +1,70 @@
-/* package-base-select/pages/select-source-sale-order/select-source-sale-order.wxss */
+.fontSizeStyle {
+  font-size: 15px;
+}
+
+
+
+
+.choose-item {
+  display: flex;
+  background: #FFFFFF;
+  box-shadow: 0px 10rpx 20rpx rgba(225, 229, 238, 0.6);
+  border-radius: 15rpx;
+  margin-top: 25rpx;
+}
+
+/* 选中的样式 */
+.choose-item-select {
+  height: 255rpx;
+  background: #FFFFFF;
+  border: 2rpx solid #606EB2;
+  box-shadow: 0px 10rpx 20rpx rgba(225, 229, 238, 0.6);
+  border-radius: 15rpx;
+}
+
+
+/* 没有选中的样式 */
+.choose-item-unchecked {
+  height: 255rpx;
+}
+
+
+
+.red-checkbox {
+  color: #95A8CB;
+  font-size: 28rpx;
+  padding-left: 10rpx;
+}
+
+.border-solid {
+  border: solid 1rpx #D3D3D3;
+}
+
+
+.van-card {
+  width: 100% !important;
+}
+
+.font {
+  font-family: PingFang HK;
+  font-size: 28rpx;
+  font-weight: 600;
+  line-height: 34rpx;
+  letter-spacing: 0em;
+  text-align: left;
+
+}
+.top-class{
+ margin: 10px 32rpx 10px 32rpx;
+ margin-top: 15rpx;
+ border-radius: 15rpx;
+ box-shadow:2px 2px 5px #bbb7b7;
+}
+
+.top-class-2{
+ flex-direction: column;
+ justify-content: center;
+ align-items: flex-start;
+ background: linear-gradient(90.12deg, #718AC6 0.84%, #4A5E98 99.43%);
+ border-radius: 15rpx;
+}

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

@@ -46,7 +46,7 @@ Page({
         { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '业务员 ' }], title: '门店信息' }
         { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '业务员 ' }], title: '门店信息' }
       ],
       ],
     },
     },
-    buttonSaveList: [{ code: 'add', title: '新建' }],
+    buttonSaveList: [{ code: 'selectSourceSaleOrder', title: '新建' }],
     contentSaveList: [{ code: 'need', title: '合计金额', type: 'str' }, { code: 'amount', content: 2000, type: 'number' }],
     contentSaveList: [{ code: 'need', title: '合计金额', type: 'str' }, { code: 'amount', content: 2000, type: 'number' }],
 
 
     // 弹出按钮
     // 弹出按钮
@@ -56,7 +56,7 @@ Page({
       { name: '', title: '作废' }
       { name: '', title: '作废' }
     ],
     ],
     // 路由
     // 路由
-    routeObjName: 'outbound',
+    routeObjName: 'saleOutBound',
     active: 0
     active: 0
   },
   },
   /**
   /**