xiaohaizhao преди 1 година
родител
ревизия
0d97f6b94e

+ 2 - 1
app.json

@@ -47,7 +47,8 @@
         "orderForm/add/add",
         "orderForm/modules/setBrand/index",
         "orderForm/rows",
-        "dispatchBill/rows"
+        "dispatchBill/rows",
+        "dispatchBill/sentandback"
       ]
     },
     {

+ 91 - 0
packageA/dispatchBill/sentandback.js

@@ -0,0 +1,91 @@
+const _Http = getApp().globalData.http;
+
+import currency from "../../utils/currency";
+const CNY = value => currency(value, {
+  symbol: "¥",
+  precision: 2
+}).format();
+
+Page({
+  data: {
+    hidePrice: wx.getStorageSync('hidePrice'),
+    content: {
+      pageNumber: 1,
+      pageTotal: 1,
+      pageSize: 20,
+      where: {
+        condition: "",
+        type: "",
+        begindate: "",
+        enddate: ""
+      }
+    }
+  },
+  onLoad(options) {
+    this.getList()
+    this.setData({
+      userrole: wx.getStorageSync('userrole')
+    })
+  },
+  toDetail(e) {
+    const {
+      item
+    } = e.currentTarget.dataset;
+    wx.navigateTo({
+      url: (item.type == "发货" ? "/packageA/dispatchBill/detail" : "/packageA/returnOne/detail") + '?id=' + item.id
+    })
+  },
+  tabsChange(e) {
+    this.data.content.where.type = e.detail.name == "0" ? "" : e.detail.name;
+    this.getList(true)
+  },
+  /* 获取产品 */
+  getList(init = false) {
+    if (init.detail != undefined) init = init.detail;
+    let content = this.data.content;
+    if (init) content.pageNumber = 1;
+    if (content.pageNumber > content.pageTotal) return;
+    this.setListHeight();
+    console.log(content)
+    _Http.basic({
+      "id": "20230626104003",
+      "version": 1,
+      content
+    }).then(res => {
+      console.log("发货列表", res)
+      this.selectComponent('#ListBox').RefreshToComplete();
+      content.pageNumber = res.pageNumber + 1
+      content.pageTotal = res.pageTotal
+      res.data.map(v => {
+        v.amount = CNY(currency(v.price).multiply(v.qty));
+        v.price = CNY(v.price);
+        return v
+      })
+      this.setData({
+        list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+        content
+      })
+    })
+  },
+  /* 修改查看日期 */
+  changeDate(e) {
+    this.data.content.where[e.currentTarget.dataset.name] = e.detail.value;
+    this.getList(true)
+  },
+  initialize() {
+    this.data.content.where.enddate = "";
+    this.data.content.where.begindate = "";
+    this.getList(true)
+  },
+  /* 搜索 */
+  onSearch({
+    detail
+  }) {
+    this.data.content.where.condition = detail;
+    this.getList(true)
+  },
+  /* 设置页面高度 */
+  setListHeight() {
+    this.selectComponent("#ListBox").setHeight(".head", this);
+  }
+})

+ 3 - 0
packageA/dispatchBill/sentandback.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 28 - 0
packageA/dispatchBill/sentandback.scss

@@ -0,0 +1,28 @@
+.head {
+	width: 100vw;
+	display: flex;
+	line-height: 60rpx;
+	justify-content: center;
+
+	text {
+		margin: 0 20rpx;
+	}
+}
+
+.item {
+	padding: 20rpx 30rpx;
+	width: 100vw;
+	background-color: #fff;
+	border-bottom: 1px solid #ddd;
+
+	.title {
+		font-size: 28rpx;
+		font-weight: 700;
+		margin-bottom: 10rpx;
+	}
+
+	view {
+		font-size: 24rpx;
+		margin-top: 6rpx;
+	}
+}

+ 44 - 0
packageA/dispatchBill/sentandback.wxml

@@ -0,0 +1,44 @@
+<van-search use-action-slot placeholder='请输入搜索关键词' shape='round' bind:search="onSearch" bind:clear="onSearch" />
+<van-tabs active="{{ content.where.type }}" color='var(--assist)' title-active-color='var(--assist)' bind:change="tabsChange">
+	<van-tab title="全部" name='' />
+	<van-tab title="发货" name='发货' />
+	<van-tab title="退货" name='退货' />
+</van-tabs>
+<view class="head">
+	<picker mode="date" value="{{content.where.begindate}}" data-name="begindate" bindchange='changeDate'>{{content.where.begindate||'开始日期'}}</picker>
+	<text>-</text>
+	<picker mode="date" value="{{content.where.enddate}}" data-name="enddate" bindchange='changeDate'>{{content.where.enddate||'结束日期'}}</picker>
+	<text wx:if="{{content.where.begindate||content.where.enddate}}" style="color:var( --assist);" bindtap="initialize">重置</text>
+</view>
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+	<Yl_Empty wx:if="{{list.length==0}}" />
+	<navigator url='#' data-item="{{item}}" bindtap="toDetail" class="item" wx:for="{{list}}" wx:key="sa_dispatchid">
+		<view class="title">
+			{{item.type}}/{{item.sonum}}
+		</view>
+		<view>
+			日期:{{item.date}}
+		</view>
+		<view>
+			产品名称:{{item.itemname||" --"}}
+		</view>
+		<view>
+			产品编码:{{item.itemno||" --"}}
+		</view>
+		<view>
+			数量:{{item.qty||"0"}}({{item.unitname}})
+		</view>
+		<view wx:if="{{userrole=='经销商'}}">
+			单价/总金额:{{handleHide.query((item.price+'/'+item.amount),hidePrice)}}
+		</view>
+		<view>
+			包装数量:{{item.packageqty}}
+		</view>
+		<view>
+			备注:{{item.remarks||" --"}}
+		</view>
+	</navigator>
+	<view style="height:150rpx;" />
+</Yl_ListBox>
+
+<wxs src="/utils/hidePrice.wxs" module="handleHide" />

+ 4 - 0
pages/index/index.js

@@ -78,6 +78,10 @@ Page({
 					name: "发货明细",
 					path: "/packageA/dispatchBill/rows",
 					icon: "icon-shouhuo"
+				}, {
+					name: "工厂发退明细",
+					path: "/packageA/dispatchBill/sentandback",
+					icon: "icon-shouhuo"
 				}];
 				let edd = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-订单"], ["商品档案", "销售管理", "财务管理", "售后管理", "发货管理", "业绩查询"]),
 					list = [];