浏览代码

到货通知

xiaohaizhao 3 月之前
父节点
当前提交
0381ebec10

+ 4 - 2
app.json

@@ -58,7 +58,8 @@
         "target/index",
         "favorites/index",
         "activity/bindingProduct/index",
-        "deliveryConfirmation/index"
+        "deliveryConfirmation/index",
+        "deliveryConfirmation/detail"
       ]
     },
     {
@@ -129,7 +130,8 @@
     "van-icon": "@vant/weapp/icon/index",
     "van-tab": "@vant/weapp/tab/index",
     "van-tabs": "@vant/weapp/tabs/index",
-    "van-search": "@vant/weapp/search/index"
+    "van-search": "@vant/weapp/search/index",
+    "record": "/components/record/index"
   },
   "window": {
     "backgroundTextStyle": "light",

+ 53 - 0
components/record/index.js

@@ -0,0 +1,53 @@
+const _Http = getApp().globalData.http;
+Component({
+    options: {
+        addGlobalClass: true
+    },
+    properties: {
+        ownertable: {
+            type: String
+        },
+        ownerid: {
+            type: String
+        },
+    },
+    data: {
+        content: {
+            nocache: true,
+            pageNumber: 1,
+            pageSize: 10,
+            pageTotal: 1,
+            total: null
+        },
+        list: []
+    },
+    methods: {
+        getList(id, init = false) {
+            let content = {
+                ...this.data.content,
+                "ownertable": this.data.ownertable,
+                "ownerid": this.data.ownerid,
+            };
+            if (init) {
+                content.pageNumber = 1
+                content.pageTotal = 1
+            }
+            _Http.basic({
+                "id": 20221114125401,
+                content
+            }).then(res => {
+                console.log("操作记录", res)
+                if (res.code != '1') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                });
+                this.setData({
+                    "content.pageNumber": res.pageNumber + 1,
+                    "content.pageTotal": res.pageTotal,
+                    "content.total": res.total,
+                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
+                })
+            })
+        },
+    }
+})

+ 4 - 0
components/record/index.json

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

+ 120 - 0
components/record/index.scss

@@ -0,0 +1,120 @@
+.head {
+    display: flex;
+    align-items: center;
+    width: 100vw;
+    height: 120rpx;
+    padding: 0 20rpx 0 30rpx;
+    box-sizing: border-box;
+
+    .count {
+        font-size: 28rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #333333;
+    }
+
+    .expand {
+        flex: 1;
+        display: flex;
+        justify-content: flex-end;
+        align-items: center;
+
+        .but {
+            flex-shrink: 0;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            width: 80rpx;
+            height: 80rpx;
+            background: #FFFFFF;
+            border-radius: 8rpx;
+            border: 2rpx solid #CCCCCC;
+            margin-left: 20rpx;
+            color: #666666;
+        }
+    }
+}
+
+.exp {
+    margin-top: 8rpx;
+    font-size: 24rpx;
+    font-family: PingFang SC-Regular, PingFang SC;
+    color: #333333;
+}
+
+.record-box {
+    width: 100vw;
+    padding: 0 30rpx;
+    box-sizing: border-box;
+    background-color: #ffffff;
+
+    .item {
+        width: 100%;
+        border-bottom: 1px solid #DDDDDD;
+        padding: 20rpx 0;
+
+        .head {
+            display: flex;
+            width: 100%;
+            height: 80rpx;
+
+            .portrait {
+                width: 80rpx;
+                height: 80rpx;
+                border-radius: 50%;
+                overflow: hidden;
+                margin-right: 20rpx;
+                flex-shrink: 0;
+
+                .replace {
+                    text-align: center;
+                    line-height: 80rpx;
+                    background-color: #3874F6;
+                    font-size: 28rpx;
+                    font-family: PingFang SC-Regular, PingFang SC;
+                    color: #FFFFFF;
+                }
+            }
+
+            .introduce {
+                flex: 1;
+                height: 80rpx;
+
+                .title {
+                    display: flex;
+                    align-items: flex-end;
+                    height: 42rpx;
+                    font-size: 30rpx;
+                    font-weight: 400;
+                    color: #333333;
+                    font-family: PingFang SC-Regular, PingFang SC;
+
+                    .line-1 {
+                        max-width: 400rpx;
+                    }
+
+                    text {
+                        display: inline-block;
+                        margin-left: 20rpx;
+                        font-size: 24rpx;
+                        color: #666666;
+                    }
+                }
+
+                .time {
+                    font-size: 24rpx;
+                    color: #999999;
+                    margin-top: 6rpx;
+                }
+            }
+        }
+
+        .remarks {
+            font-size: 24rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #666666;
+            line-height: 28rpx;
+            margin-top: 20rpx;
+            word-break: break-all;
+        }
+    }
+}

+ 33 - 0
components/record/index.wxml

@@ -0,0 +1,33 @@
+<view class="head">
+    <view class="count">
+        <text wx:if="{{language['总共']}}">{{language['总共']}}:{{content.total}}</text>
+        <text wx:else>总共{{content.total}}个</text>
+    </view>
+</view>
+<navigator class="record-box" url="#" wx:for="{{list}}" wx:key="actionuserid">
+    <view class="item">
+        <view class="head">
+            <view class="portrait">
+                <van-image wx:if="{{item.headpic}}" width="100%" height="100%" src="{{item.headpic}}" use-loading-slot lazy-load>
+                    <van-loading slot="loading" type="spinner" size="20" vertical />
+                </van-image>
+                <view class="replace" wx:else>
+                    {{item.actionby[0]}}
+                </view>
+            </view>
+            <view class="introduce">
+                <view class="title">
+                    <view class="line-1">{{item.actionby}}</view>
+                    <text>{{language[item.action]||item.action}}</text>
+                </view>
+                <view class="time">
+                    {{item.actiondate}}
+                </view>
+            </view>
+        </view>
+        <view class="remarks" wx:if="{{item.remarks}}">
+            {{language[item.remarks]||item.remarks}}
+        </view>
+    </view>
+</navigator>
+<Yl_Empty wx:if="{{list.length==0}}" />

+ 106 - 0
packageA/deliveryConfirmation/detail.js

@@ -0,0 +1,106 @@
+const _Http = getApp().globalData.http;
+
+Page({
+  data: {
+    st_stockbillid: null,
+    detail: {},
+    tabsActive: 0,
+    tabsList: [{
+      label: "产品明细",
+      icon: "icon-tabchanpin",
+      model: "#Product"
+    }, {
+      label: "操作记录",
+      icon: "icon-tabcaozuojilu1",
+      model: "#record"
+    }]
+  },
+  onLoad(options) {
+    this.setData({
+      st_stockbillid: options.id
+    })
+    this.getDetail()
+  },
+  getDetail() {
+    _Http.basic({
+      "id": 20230719153803,
+      "content": {
+        "st_stockbillid": this.data.st_stockbillid
+      }
+    }).then(res => {
+      console.log("到货通知详情", res)
+      if (res.msg != '成功') return wx.showToast({
+        title: res.msg,
+        icon: "none"
+      })
+      this.setData({
+        detail: res.data
+      })
+      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.st_stockbillid;
+      if (total == null || init) {
+        Component.getList(id, init);
+      } else if (pageNumber <= pageTotal) {
+        Component.getList(id, false);
+      }
+    }
+  }, //tabs 切换
+  tabsChange({
+    detail
+  }) {
+    this.setData({
+      tabsActive: detail
+    });
+    this.partialRenewal();
+  },
+  ConfirmReceiptOfGoods() {
+    let that = this,
+      isreceiver = this.data.detail.isreceiver;
+    wx.showModal({
+      content: '是否确定' + (isreceiver ? '收货反确认' : '收货确认') + '?',
+      complete: (res) => {
+        if (res.confirm) _Http.basic({
+          id: "2025061311223103",
+          content: {
+            st_stockbillid: that.data.st_stockbillid,
+            isreceiver: isreceiver ? 0 : 1
+          }
+        }).then(res => {
+          wx.showToast({
+            title: res.msg != '成功' ? res.msg : "操作成功",
+            icon: "none"
+          })
+          if (res.msg != '成功') return
+          that.setData({
+            "detail.isreceiver": isreceiver ? 0 : 1
+          })
+
+          let page = getCurrentPages()[getCurrentPages().length - 2]
+          if (page) {
+            let index = page.data.list.findIndex(v => v.st_stockbillid == that.data.st_stockbillid);
+            if (index != -1) {
+              page.setData({
+                [`list[${index}].isreceiver`]: that.data.detail.isreceiver
+              })
+            }
+          }
+        })
+      }
+    })
+  },
+  onReachBottom() {
+    this.partialRenewal();
+  },
+
+})

+ 5 - 0
packageA/deliveryConfirmation/detail.json

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

+ 75 - 0
packageA/deliveryConfirmation/detail.scss

@@ -0,0 +1,75 @@
+.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;
+	}
+
+	.tags {
+		margin-bottom: 15rpx;
+
+		text {
+			display: inline-block;
+			height: 40rpx;
+			line-height: 40rpx;
+			background: #E7EEFF;
+			border-radius: 20rpx;
+			padding: 0 15rpx;
+			font-size: 20rpx;
+			color: #fff;
+			margin-right: 10rpx;
+		}
+	}
+
+	.exp {
+		height: 34rpx;
+		line-height: 34rpx;
+		font-size: 26rpx;
+		margin-top: 10rpx;
+		color: #666;
+	}
+
+	.copy {
+		position: absolute;
+		right: 30rpx;
+		top: 20rpx;
+		background-color: #FF9933;
+		border-radius: 12rpx;
+		padding: 0 10rpx;
+		color: #fff;
+		border: none;
+		height: 70rpx;
+	}
+}
+
+
+.footer {
+	display: flex;
+	justify-content: center;
+	position: fixed;
+	bottom: 0;
+	width: 100vw;
+	min-height: 130rpx;
+	background-color: #fff;
+	box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
+
+	.but {
+		width: 690rpx;
+		height: 90rpx;
+		background: #FA8C16;
+		border-radius: 16rpx;
+		font-size: 28rpx;
+		font-weight: 600;
+		color: #FFFFFF;
+		margin-top: 10rpx;
+	}
+}

+ 31 - 0
packageA/deliveryConfirmation/detail.wxml

@@ -0,0 +1,31 @@
+<view class="intr">
+	<view class="num">
+		{{detail.billno}}
+	</view>
+	<view class="exp">
+		红蓝字:{{detail.rb ? '蓝' : '红'}}字
+	</view>
+	<view class="exp">
+		单据日期:{{detail.billdate}}
+	</view>
+	<view class="exp">
+		联系人:{{detail.createby || ' --'}}
+	</view>
+	<view class="exp">
+		地址:{{detail.address || ' --'}}
+	</view>
+	<view class="exp">
+		备注:{{detail.remarks || ' --'}}
+	</view>
+	<view class="exp">
+		是否收货:{{detail.isreceiver ?'已收货':'未收货'}}
+	</view>
+</view>
+<view style="height: 10rpx;"></view>
+<Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
+	<product slot='产品明细' id='Product' />
+	<record slot='操作记录' id='record' ownertable='st_stockbill' ownerid='{{st_stockbillid}}' />
+</Yl_FunTabs>
+<view class="footer">
+	<van-button custom-class='but' bindtap="ConfirmReceiptOfGoods">{{detail.isreceiver == 0 ? '收货确认' : '收货反确认'}}</van-button>
+</view>

+ 90 - 54
packageA/deliveryConfirmation/index.js

@@ -1,66 +1,102 @@
-// packageA/deliveryConfirmation/index.js
+const _Http = getApp().globalData.http;
 Page({
-
-  /**
-   * 页面的初始数据
-   */
   data: {
-
+    list: [],
+    filtrate: false,
+    "content": {
+      "nocache": true,
+      "pageNumber": 1,
+      "pageSize": 20,
+      "pageTotal": 1,
+      "where": {
+        "condition": ""
+      }
+    },
+    filtratelist: [{
+      label: "红蓝字",
+      index: null,
+      showName: "name", //显示字段
+      valueKey: "rb", //返回Key
+      selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
+      value: "", //选中值
+      list: [{
+        name: "红字",
+        value: 0
+      }, {
+        name: "蓝字",
+        value: 1
+      }]
+    }, {
+      label: "是否收货",
+      index: null,
+      showName: "name", //显示字段
+      valueKey: "isreceiver", //返回Key
+      selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
+      value: "", //选中值
+      list: [{
+        name: "未收货",
+        value: 0
+      }, {
+        name: "已收货",
+        value: 1
+      }]
+    }]
   },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
   onLoad(options) {
-
+    this.getList(true);
   },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
+  // {"id":20230719154303,"content":{"st_stockbillid":"1","pageNumber":1,"pageSize":20,"where":{"condition":""}},"accesstoken":"cc80c07dec16ecad16b9e71eac20b05d","systemappid":372}
+  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: 2025061311114103,
+      content: content
+    }).then(res => {
+      console.log("到货列表", res)
+      this.selectComponent('#ListBox').RefreshToComplete();
+      if (res.msg != '成功') return wx.showToast({
+        title: res.msg,
+        icon: "none"
+      })
+      this.setData({
+        total: res.total,
+        list: (res.pageNumber == 1) ? res.data : this.data.list.concat(res.data),
+        'content.pageNumber': res.pageNumber + 1,
+        'content.pageTotal': res.pageTotal
+      })
+    })
   },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow() {
-
+  onReady() {
+    this.selectComponent("#ListBox").setHeight(".top", this);
   },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-
+  startSearch({
+    detail
+  }) {
+    if (detail == this.data.content.where.condition) return;
+    this.data.content.where.condition = detail;
+    this.getList(true);
   },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
+  /* 取消搜索 */
+  onClear() {
+    this.data.content.where.condition = "";
+    this.getList(true);
   },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
+  openFiltrate() {
+    this.setData({
+      filtrate: true
+    })
   },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
+  /* 处理筛选 */
+  handleFilter(e) {
+    e.detail.condition = this.data.content.where.condition;
+    e.detail.begindate = e.detail.startdate
+    this.setData({
+      "content.where": e.detail
+    })
+    console.log("this.data.content", this.data.content)
+    this.getList(true)
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
-
-  }
 })

+ 46 - 1
packageA/deliveryConfirmation/index.scss

@@ -1 +1,46 @@
-/* packageA/deliveryConfirmation/index.wxss */
+page {
+	height: 100vh;
+	overflow: hidden;
+}
+
+.list-box {
+	width: 690rpx;
+	background: #FFFFFF;
+	border-radius: 16rpx;
+	margin: 20rpx auto 0;
+	padding: 30rpx 20rpx;
+
+	.title {
+		line-height: 38rpx;
+		font-family: Microsoft YaHei, Microsoft YaHei;
+		font-weight: bold;
+		font-size: 28rpx;
+		color: #333333;
+	}
+
+	.row {
+		line-height: 32rpx;
+		font-family: Microsoft YaHei, Microsoft YaHei;
+		font-size: 24rpx;
+		color: #999999;
+		margin-top: 10rpx;
+	}
+}
+
+.iconfont {
+	font-size: 28rpx;
+	font-family: PingFang SC-Regular, PingFang SC;
+	color: #666666;
+	padding: 0 10rpx;
+}
+
+/* 未读 */
+.unread {
+	width: 750rpx;
+	height: 34rpx;
+	text-align: center;
+	font-size: 24rpx;
+	font-family: PingFang SC-Regular, PingFang SC;
+	color: #999999;
+	margin: 12rpx 0 -5rpx 0;
+}

+ 35 - 2
packageA/deliveryConfirmation/index.wxml

@@ -1,2 +1,35 @@
-<!--packageA/deliveryConfirmation/index.wxml-->
-<text>packageA/deliveryConfirmation/index.wxml</text>
+<van-search value="{{ content.where.condition }}" shape='round' placeholder="请输入搜索关键词" use-action-slot bind:clear='onClear' bind:search="startSearch">
+	<navigator url="#" slot="action" class="iconfont icon-shaixuan" bindtap="openFiltrate">
+		筛选
+	</navigator>
+</van-search>
+<view class="top" />
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+	<!-- <view class="unread">总共{{total}}条</view> -->
+	<navigator class="list-box" url="/packageA/deliveryConfirmation/detail?id={{item.st_stockbillid}}" wx:for="{{list}}" wx:key="st_stockbillid">
+		<view class="title">{{item.billno}}</view>
+		<view class="row">
+			红蓝字:{{item.rb ? '蓝' : '红'}}字
+		</view>
+		<view class="row">
+			单据日期:{{item.billdate}}
+		</view>
+		<view class="row">
+			联系人:{{item.createby || ' --'}}
+		</view>
+		<view class="row">
+			地址:{{item.address || ' --'}}
+		</view>
+		<view class="row">
+			备注:{{item.remarks || ' --'}}
+		</view>
+		<view class="row">
+			是否收货:{{item.isreceiver ?'已收货':'未收货'}}
+		</view>
+	</navigator>
+	<Yl_Empty wx:if="{{!list.length}}" />
+</Yl_ListBox>
+
+
+
+<Yl_Filtrate show='{{filtrate}}' list="{{filtratelist}}" bindhandle="handleFilter" />

+ 49 - 0
packageA/deliveryConfirmation/modules/product/index.js

@@ -0,0 +1,49 @@
+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
+        }
+    },
+    methods: {
+        /* 获取产品列表 */
+        getList(id, init) {
+            let content = this.data.content;
+            this.data.st_stockbillid = id;
+            content.st_stockbillid = id || this.data.st_stockbillid;
+            if (init) content.pageNumber = 1;
+            _Http.basic({
+                "id": "20230719154303",
+                content
+            }).then(res => {
+                console.log("产品信息列表", res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.msg,
+                    icon: "none"
+                })
+                res.data = res.data.map(v => {
+                    v.sum = CNY(v.sum)
+                    v.amount = CNY(v.amount)
+                    v.price = CNY(v.price)
+                    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,
+                })
+            })
+        },
+    }
+})

+ 5 - 0
packageA/deliveryConfirmation/modules/product/index.json

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

+ 25 - 0
packageA/deliveryConfirmation/modules/product/index.scss

@@ -0,0 +1,25 @@
+@import "../../../../static/common-head.scss";
+
+.list-box {
+	width: 690rpx;
+	background: #FFFFFF;
+	border-radius: 16rpx;
+	margin: 0 auto 20rpx;
+	padding: 30rpx 20rpx;
+
+	.title {
+		line-height: 38rpx;
+		font-family: Microsoft YaHei, Microsoft YaHei;
+		font-weight: bold;
+		font-size: 28rpx;
+		color: #333333;
+	}
+
+	.row {
+		line-height: 32rpx;
+		font-family: Microsoft YaHei, Microsoft YaHei;
+		font-size: 24rpx;
+		color: #999999;
+		margin-top: 10rpx;
+	}
+}

+ 36 - 0
packageA/deliveryConfirmation/modules/product/index.wxml

@@ -0,0 +1,36 @@
+<view class="head">
+  <view class="count">产品明细</view>
+</view>
+
+<navigator class="list-box" url="#" wx:for="{{list}}" wx:key="st_stockbillid">
+  <view class="title">品名:{{item.item_itemname || '--'}}</view>
+  <view class="row">
+    品号:{{item.item_itemno || ' --'}}
+  </view>
+  <view class="row">
+    行号:{{item.rowindex}}
+  </view>
+  <view class="row">
+    型号:{{item.item_model}}
+  </view>
+  <view class="row">
+    规格:{{item.item_spec || ' --'}}
+  </view>
+  <view class="row">
+    单位:{{item.unitname || ' --'}}
+  </view>
+  <view class="row">
+    未税单价:{{item.price || ' --'}}
+  </view>
+  <view class="row">
+    数量:{{item.qty || ' --'}}
+  </view>
+  <view class="row">
+    未税金额:{{item.amount || ' --'}}
+  </view>
+  <view class="row">
+    价税合计{{item.sum || ' --'}}
+  </view>
+</navigator>
+
+<view style="height: 200rpx;"></view>

+ 21 - 0
project.private.config.json

@@ -10,6 +10,27 @@
   "condition": {
     "miniprogram": {
       "list": [
+        {
+          "name": "packageA/deliveryConfirmation/index",
+          "pathName": "packageA/deliveryConfirmation/index",
+          "query": "",
+          "scene": null,
+          "launchMode": "default"
+        },
+        {
+          "name": "packageA/deliveryConfirmation/detail",
+          "pathName": "packageA/deliveryConfirmation/detail",
+          "query": "id=1",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
+          "name": "到货通知",
+          "pathName": "packageA/deliveryConfirmation/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
         {
           "name": "packageA/shipment/detail",
           "pathName": "packageA/shipment/detail",