瀏覽代碼

发货单

xiaohaizhao 2 年之前
父節點
當前提交
dc1eca3bac

+ 140 - 0
packageA/dispatchBill/detail.js

@@ -0,0 +1,140 @@
+const _Http = getApp().globalData.http,
+  currency = require("../../utils/currency");
+
+let sa_dispatchid = null;
+Page({
+  data: {
+    tabsActive: 1,
+    tabsList: [{
+      label: "详细信息",
+      icon: "icon-tabchanpin"
+    }, {
+      label: "发货明细",
+      icon: "icon-tabcaozuojilu1",
+      model: "#Rows"
+    }]
+  },
+  onLoad(options) {
+    sa_dispatchid = options.id;
+    this.getDetail();
+  },
+  /* 获取详情 */
+  getDetail() {
+    _Http.basic({
+      "id": 20221114135303,
+      "content": {
+        nocache: true,
+        sa_dispatchid
+      }
+    }).then(res => {
+      console.log("发货详情", res)
+      if (res.msg != '成功') return wx.showToast({
+        title: res.msg,
+        icon: "none"
+      });
+      this.setPreview(res.data);
+      this.setData({
+        detail: res.data,
+        loading: false
+      });
+      this.partialRenewal()
+    })
+  },
+  /* 设置详情信息 */
+  setPreview(data) {
+    let list1 = [{
+        label: "发货单号",
+        value: data.billno
+      }, {
+        label: "单据日期",
+        value: data.billdate
+      }, {
+        label: "单据状态",
+        value: data.status
+      }, {
+        label: "来源单号",
+        value: data.sonum
+      }, {
+        label: "经销商编号",
+        value: data.agentnum
+      }, {
+        label: "经销商名称",
+        value: data.enterprisename
+      }, {
+        label: "发货数量",
+        value: data.qty
+      }, {
+        label: "发货金额",
+        value: currency(data.sumamount, {
+          symbol: "¥",
+          precision: 2
+        }).format()
+      }, {
+        label: "备注",
+        value: data.remarks
+      }],
+      list2 = [{
+        label: "创建人",
+        value: data.createby
+      }, {
+        label: "创建时间",
+        value: data.createdate
+      }, {
+        label: "审核人",
+        value: data.checkby
+      }, {
+        label: "审核时间",
+        value: data.checkdate
+      }];
+    this.setData({
+      list1,
+      list2
+    })
+  },
+  //tabs 切换
+  tabsChange({
+    detail
+  }) {
+    this.setData({
+      tabsActive: detail
+    });
+    this.partialRenewal();
+  },
+  //局部数据更新 tabs
+  partialRenewal(init = false) {
+    let model = this.data.tabsList[this.data.tabsActive].model;
+    if (model) {
+      let Component = this.selectComponent(model),
+        {
+          total,
+          pageNumber,
+          pageTotal
+        } = Component.data.content,
+        id = this.data.detail.sa_dispatchid;
+      if (total == null || init) {
+        Component.getList(id, init);
+      } else if (pageNumber < pageTotal) {
+        Component.getList(id, false);
+      }
+    }
+  },
+  onReachBottom() {
+    this.partialRenewal();
+  },
+  onUnload() {
+    console.log("更新列表数据")
+    let page = getCurrentPages().find(v => v.__route__ == 'packageA/dispatchBill/index');
+    let content = JSON.parse(JSON.stringify(page.data.content));
+    content.pageNumber = 1;
+    content.pageSize = (page.data.content.pageNumber - 1) * page.data.content.pageSize;
+    _Http.basic({
+      "id": 20230320160203,
+      content
+    }).then(res => {
+      console.log("更新订单列表", res)
+      if (res.msg == '成功') page.setData({
+        list: res.data
+      })
+    })
+  },
+})

+ 6 - 0
packageA/dispatchBill/detail.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+    "Preview": "/packageA/shipment/modules/preview/index",
+    "Rows": "./modules/rows/index"
+  }
+}

+ 96 - 0
packageA/dispatchBill/detail.scss

@@ -0,0 +1,96 @@
+.intr {
+	position: relative;
+	width: 100vw;
+	box-sizing: border-box;
+	background-color: #fff;
+	padding: 20rpx 30rpx;
+
+	.num {
+		height: 40rpx;
+		line-height: 40rpx;
+		font-size: 32rpx;
+		font-family: PingFang SC-Bold, PingFang SC;
+		font-weight: bold;
+		color: #333333;
+		margin-bottom: 10rpx;
+	}
+
+	.exp {
+		height: 34rpx;
+		line-height: 34rpx;
+		font-size: 26rpx;
+		margin-bottom: 8rpx;
+		color: #666;
+	}
+
+	.copy {
+		position: absolute;
+		right: 30rpx;
+		top: 20rpx;
+		background-color: #FF9933;
+		border-radius: 12rpx;
+		padding: 0 10rpx;
+		color: #fff;
+		border: none;
+		height: 70rpx;
+	}
+
+}
+
+.box {
+	width: 100vw;
+	padding: 20rpx 30rpx;
+	box-sizing: border-box;
+	background-color: #fff;
+	margin-top: 10rpx;
+
+	.row {
+		display: flex;
+		justify-content: space-between;
+		min-height: 60rpx;
+		align-items: center;
+
+		.label {
+			font-size: 28rpx;
+		}
+
+		checkbox {
+			width: 36rpx;
+			height: 36rpx;
+			margin-right: 6rpx;
+		}
+
+		checkbox .wx-checkbox-input {
+			width: 36rpx;
+			height: 36rpx;
+		}
+	}
+}
+
+
+.footer {
+	display: flex;
+	justify-content: center;
+	padding: 0 30rpx;
+	position: fixed;
+	width: 100vw;
+	height: 130rpx;
+	background: #FFFFFF;
+	box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+	bottom: 0;
+	box-sizing: border-box;
+	z-index: 9999;
+	padding-top: 10rpx;
+
+	.but {
+		width: 690rpx;
+		height: 90rpx;
+		background: var(--warning);
+		border-radius: 16rpx;
+		font-size: 28rpx;
+		font-family: PingFang SC-Bold, PingFang SC;
+		font-weight: bold;
+		color: #fff;
+	}
+
+}

+ 13 - 0
packageA/dispatchBill/detail.wxml

@@ -0,0 +1,13 @@
+<view class="intr">
+	<view class="num">
+		{{detail.billno}}
+	</view>
+	<view class="exp">单据日期:{{detail.billdate || '--'}}</view>
+	<view class="exp">来源单号:{{detail.sonum || '--'}}</view>
+	<view class="exp">状态:{{detail.STATUS || '--'}}</view>
+</view>
+<Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
+	<Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
+	<Rows id='Rows' />
+	<view style="height: 70rpx;" />
+</Yl_FunTabs>

+ 76 - 0
packageA/dispatchBill/index.js

@@ -0,0 +1,76 @@
+const _Http = getApp().globalData.http;
+
+Page({
+  data: {
+    loading: true,
+    active: 0,
+    content: {
+      nocache: true,
+      isExport: 0,
+      pageNumber: 1,
+      pageTotal: 1,
+      pageSize: 20,
+      total: 0,
+      where: {
+        condition: "",
+        tablefilter: {}
+      },
+      sort: []
+    },
+    filter: []
+  },
+  onLoad(options) {
+    this.getList()
+  },
+  /* 处理筛选 */
+  handleFilter({
+    detail
+  }) {
+    console.log(detail)
+  },
+  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;
+    _Http.basic({
+      "id": 20230320160203,
+      content
+    }).then(res => {
+      console.log("发货单列表", res)
+      this.selectComponent('#ListBox').RefreshToComplete();
+      this.setData({
+        list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+        "content.pageNumber": res.pageNumber + 1,
+        "content.pageTotal": res.pageTotal,
+        "content.sort": res.sort,
+        "content.total": res.total,
+        loading: false
+      })
+    })
+  },
+  /* 搜索 */
+  onSearch({
+    detail
+  }) {
+    this.setData({
+      "content.where.condition": detail
+    });
+    this.getList(true)
+  },
+  /* 切换tabs */
+  tabsChange(e) {
+    this.setData({
+      active: e.detail.index,
+      "content.where.status": e.detail.title == '全部' ? "" : e.detail.title
+    });
+    this.getList(true);
+  },
+  onReady() {
+    this.setListHeight()
+  },
+  /* 设置页面高度 */
+  setListHeight() {
+    this.selectComponent("#ListBox").setHeight(".head", this);
+  },
+})

+ 5 - 0
packageA/dispatchBill/index.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "List":"./modules/list/index"
+  }
+}

+ 1 - 0
packageA/dispatchBill/index.scss

@@ -0,0 +1 @@
+/* packageA/dispatchBill/index.wxss */

+ 14 - 0
packageA/dispatchBill/index.wxml

@@ -0,0 +1,14 @@
+<Yl_HeadNav  styleType="1" sort='{{content.sort}}' placeholder='搜索' bindonSearch="onSearch" />
+<view class="head" />
+<van-tabs active="{{ active }}" color='var(--assist)' title-active-color='var(--assist)' bind:change="tabsChange">
+	<van-tab title="全部" />
+	<van-tab title="审核" />
+	<van-tab title="关闭" />
+	<van-tab title="手工关闭" />
+</van-tabs>
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+	<List list="{{list}}" />
+	<view style="height: 20px;" />
+</Yl_ListBox>
+<!-- 筛选条件 -->
+<Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{false}}' />

+ 5 - 0
packageA/dispatchBill/modules/list/index.js

@@ -0,0 +1,5 @@
+Component({
+  properties: {
+    list: Array
+  }
+})

+ 4 - 0
packageA/dispatchBill/modules/list/index.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 31 - 0
packageA/dispatchBill/modules/list/index.scss

@@ -0,0 +1,31 @@
+.item {
+	width: 100vw;
+	padding-left: 30rpx;
+	padding-bottom: 20rpx;
+	box-sizing: border-box;
+	margin-top: 20rpx;
+	background-color: #ffffff;
+
+	.num {
+		height: 40rpx;
+		line-height: 40rpx;
+		font-size: 28rpx;
+		color: #333333;
+		font-weight: 600;
+		padding: 20rpx 0;
+	}
+
+	.exp {
+		height: 34rpx;
+		font-size: 24rpx;
+		margin-bottom: 8rpx;
+		color: #999999;
+	}
+}
+
+/* 文本行数限制 */
+.line-1 {
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+}

+ 18 - 0
packageA/dispatchBill/modules/list/index.wxml

@@ -0,0 +1,18 @@
+<navigator url="/packageA/dispatchBill/detail?id={{item.sa_dispatchid}}" class="item" wx:for="{{list}}" wx:key="sonum">
+	<view class="num">
+		发货单号:{{item.billno || ' --'}}
+	</view>
+	<view class="exp line-1">
+		来源单号:{{item.sonum}}
+	</view>
+	<view class="exp">
+		单据日期:{{item.billdate}}
+	</view>
+	<view class="exp">
+		状态:{{item.STATUS}}
+	</view>
+	<view class="exp">
+		备注:{{item.remarks|| ' --'}}
+	</view>
+</navigator>
+<Yl_Empty wx:if="{{list.length==0}}" />

+ 53 - 0
packageA/dispatchBill/modules/rows/index.js

@@ -0,0 +1,53 @@
+const _Http = getApp().globalData.http,
+  currency = require("../../../../utils/currency");
+let CNY = num => currency(num, {
+  symbol: "¥",
+  precision: 2
+}).format();
+
+Component({
+  data: {
+    content: {
+      nocache: true,
+      pageNumber: 1,
+      pageTotal: 1,
+      total: null,
+      "where": {
+        "condition": ""
+      }
+    }
+  },
+  methods: {
+    /* 获取产品列表 */
+    getList(id, init) {
+      let content = this.data.content;
+      content.sa_dispatchid = id;
+      if (init) content.pageNumber = 1;
+      _Http.basic({
+        "id": "20221115104703",
+        content
+      }).then(res => {
+        console.log("发货清单列表", res)
+        if (res.msg != '成功') return wx.showToast({
+          title: res.msg,
+          icon: "none"
+        })
+        res.data = res.data.map(v => {
+     /*      if (v.attinfos.length != 0) {
+            v.attinfos = file.fileList(v.attinfos)
+            let image = v.attinfos.find(v => v.fileType == "image");
+            v.cover = image ? image.cover : "";
+          }; */
+          return v;
+        })
+        this.setData({
+          list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+          "content.pageNumber": res.pageNumber + 1,
+          "content.pageSize": res.pageSize,
+          "content.pageTotal": res.pageTotal,
+          "content.total": res.total
+        })
+      })
+    },
+  }
+})

+ 4 - 0
packageA/dispatchBill/modules/rows/index.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 33 - 0
packageA/dispatchBill/modules/rows/index.scss

@@ -0,0 +1,33 @@
+@import "../../../../static/common-head.scss";
+
+.item {
+	width: 100vw;
+	padding-left: 30rpx;
+	padding-bottom: 20rpx;
+	box-sizing: border-box;
+	margin-bottom: 20rpx;
+	background-color: #ffffff;
+
+	.num {
+		height: 40rpx;
+		line-height: 40rpx;
+		font-size: 28rpx;
+		color: #333333;
+		font-weight: 600;
+		padding: 20rpx 0;
+	}
+
+	.exp {
+		height: 34rpx;
+		font-size: 24rpx;
+		margin-bottom: 8rpx;
+		color: #999999;
+	}
+}
+
+/* 文本行数限制 */
+.line-1 {
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+}

+ 27 - 0
packageA/dispatchBill/modules/rows/index.wxml

@@ -0,0 +1,27 @@
+<view class="head">
+	<view class="count">发货明细 共{{content.total}}条</view>
+</view>
+
+<view class="item" wx:for="{{list}}" wx:key="sa_dispatch_itemsid">
+	<view class="num">
+		品名:{{item.itemname || ' --'}}
+	</view>
+	<view class="exp line-1">
+		品号:{{item.itemno}}
+	</view>
+	<view class="exp line-1">
+		来源单号:{{item.sonum||' --'}}
+	</view>
+	<view class="exp">
+		型号:{{item.model || ' --'}}
+	</view>
+	<view class="exp">
+		数量:{{item.qty || ' --'}} ({{item.unitname}})
+	</view>
+	<view class="exp">
+		已发数量:{{item.sumqty || '0'}} ({{item.unitname}})
+	</view>
+	<view class="exp">
+		备注:{{item.remarks|| ' --'}}
+	</view>
+</view>