zhaoxiaohai 2 years ago
parent
commit
e9cb85ea6a

+ 80 - 0
packageA/shipment/detail.js

@@ -0,0 +1,80 @@
+const _Http = getApp().globalData.http;
+
+Page({
+    data: {
+        loading: true,
+        sa_orderid: null,
+        tabsActive: 0,
+        tabsList: [{
+            label: "详细信息",
+            icon: "icon-tabchanpin",
+            model: "#Product"
+        }, {
+            label: "物流查询",
+            icon: "icon-tabfujian1",
+            model: "#Query"
+        }, {
+            label: "装箱明细",
+            icon: "icon-tabcaozuojilu1",
+            model: "#Progress"
+        }],
+    },
+    onLoad(options) {
+        /* this.setData({
+            sa_orderid: options.id
+        });
+        this.getDetail(true); */
+    },
+    /* 获取详情 */
+    getDetail(init = false, show = true) {
+        _Http.basic({
+            "id": 20221108151302,
+            "content": {
+                nocache: true,
+                "sa_orderid": this.data.sa_orderid
+            }
+        }, show).then(res => {
+            console.log("订单详情", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.msg,
+                icon: "none"
+            });
+            this.setData({
+                detail: res.data,
+                loading: false
+            });
+            if (init) this.partialRenewal(true)
+        })
+    },
+    //tabs 切换
+    tabsChange({
+        detail
+    }) {
+        this.setData({
+            tabsActive: detail
+        });
+        this.partialRenewal();
+    },
+    //局部数据更新 tabs
+    partialRenewal(init = false) {
+        return ;
+        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_orderid;
+            if (total == null || init) {
+                Component.getList(id, init);
+            } else if (pageNumber < pageTotal) {
+                Component.getList(id, false);
+            }
+        }
+    },
+    onReachBottom() {
+        this.partialRenewal();
+    },
+})

+ 5 - 0
packageA/shipment/detail.json

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

+ 67 - 0
packageA/shipment/detail.scss

@@ -0,0 +1,67 @@
+.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;
+    }
+
+    .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;
+        }
+    }
+}

+ 12 - 0
packageA/shipment/detail.wxml

@@ -0,0 +1,12 @@
+<view class="intr">
+	<view class="num">
+		sa6489144646846484
+	</view>
+	<view class="exp">状态:{{detail.status}}</view>
+	<view class="exp">单据日期:{{detail.submitdate || '暂无'}}</view>
+	<view class="exp">创建日期:{{detail.createdate}}</view>
+	<view class="exp">收货状态:{{detail.invoicestatus}}</view>
+</view>
+<Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
+	<Query slot='物流查询' id='Query' />
+</Yl_FunTabs>

+ 107 - 0
packageA/shipment/index.js

@@ -0,0 +1,107 @@
+const _Http = getApp().globalData.http;
+
+Page({
+    data: {
+        loading: true,
+        active: 1,
+        amount: 0,
+        "content": {
+            "isExport": 0,
+            "pageNumber": 1,
+            "pageTotal": 1,
+            "pageSize": 20,
+            total: 0,
+            "where": {
+                "condition": "",
+                "status": "",
+                "brandname": "",
+                "tradefield": ""
+            },
+            sort: []
+        },
+        filter: [{
+            label: "品牌",
+            index: null,
+            showName: "brandname", //显示字段
+            valueKey: "brandname", //返回Key
+            selectKey: "brandname", //传参 代表选着字段 不传参返回整个选择对象
+            value: "", //选中值
+            list: []
+        }, {
+            label: "领域",
+            index: null,
+            showName: "tradefield", //显示字段
+            valueKey: "tradefield", //返回Key
+            selectKey: "tradefield", //传参 代表选着字段 不传参返回整个选择对象
+            value: "", //选中值
+            list: []
+        }]
+    },
+    onLoad(options) {
+    },
+    /* 处理筛选 */
+    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": wx.getStorageSync('userMsg').usertype == 1 ? 20221111145202 : 20221224180302,
+            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,
+                amount: res.tips.amount || 0
+            })
+        })
+    },
+    /* 搜索 */
+    onSearch({
+        detail
+    }) {
+        this.setData({
+            "content.where.condition": detail
+        });
+        this.getList(true)
+    },
+    /* 切换tabs */
+    tabsChange(e) {
+        let status = "";
+        switch (e.detail.title) {
+            case '全部':
+                status = "";
+                break;
+            case '待确认':
+                status = "交期待确认";
+                break;
+            default:
+                status = e.detail.title
+                break;
+        }
+        this.setData({
+            active: e.detail.index,
+            "content.where.status": status
+        });
+        this.getList(true);
+    },
+    onReady() {
+        this.setListHeight()
+    },
+    /* 设置页面高度 */
+    setListHeight() {
+        this.selectComponent("#ListBox").setHeight(".tips", this);
+    },
+})

+ 5 - 0
packageA/shipment/index.json

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

+ 12 - 0
packageA/shipment/index.scss

@@ -0,0 +1,12 @@
+
+.tips {
+	width: 750rpx;
+	text-align: center;
+	height: 64rpx;
+	line-height: 64rpx;
+	background: #FFEFD9;
+	font-size: 28rpx;
+	font-family: PingFang SC-Semibold, PingFang SC;
+	font-weight: 600;
+	color: #FA8C16;
+}

+ 20 - 0
packageA/shipment/index.wxml

@@ -0,0 +1,20 @@
+<Yl_HeadNav styleType="1" sort='{{content.sort}}' placeholder='搜索' bindonSearch="onSearch" />
+<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-tab title="交期确认" />
+    <van-tab title="审核" />
+    <van-tab title="关闭" />
+</van-tabs>
+<view class="tips">
+    共计{{content.total}}单,合计¥{{amount}}
+</view>
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+    <List list="{{list}}" />
+</Yl_ListBox>
+<!-- 新建浮动按钮 -->
+<Float />
+<!-- 筛选条件 -->
+<Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{false}}' />

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

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

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

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

+ 63 - 0
packageA/shipment/modules/list/index.scss

@@ -0,0 +1,63 @@
+.item {
+    width: 100vw;
+    padding-left: 30rpx;
+    box-sizing: border-box;
+    margin-bottom: 20rpx;
+    background-color: #ffffff;
+
+
+    .top {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        height: 80rpx;
+        width: 100%;
+        border-bottom: 1rpx solid #ddd;
+        box-sizing: border-box;
+        padding-right: 30rpx;
+
+        .tags {
+            text {
+                display: inline-block;
+                height: 40rpx;
+                line-height: 40rpx;
+                background: #E7EEFF;
+                border-radius: 20rpx;
+                padding: 0 15rpx;
+                font-size: 20rpx;
+                color: #3874F6;
+                margin-right: 10rpx;
+            }
+        }
+
+        .statu {
+            font-size: 28rpx;
+        }
+    }
+
+    .content {
+        position: relative;
+        padding-bottom: 20rpx;
+        .num {
+            height: 40rpx;
+            line-height: 40rpx;
+            font-size: 28rpx;
+            color: #333333;
+            padding: 20rpx 0;
+        }
+
+        .exp {
+            height: 34rpx;
+            font-size: 24rpx;
+            margin-bottom: 8rpx;
+            color: #999999;
+        }
+    }
+}
+
+/* 文本行数限制 */
+.line-1 {
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+}

+ 48 - 0
packageA/shipment/modules/list/index.wxml

@@ -0,0 +1,48 @@
+<navigator url="/packageA/shipment/detail" class="item" wx:for="{{5}}" wx:key="item.sonum">
+    <view class="top">
+        <view class="tags">
+            <text>{{item.type}}</text>
+            <text>{{item.brandname}}</text>
+            <text>{{item.tradefield}}</text>
+        </view>
+        <!--  style="color: {{set.color(item.status)}};" -->
+        <view class="statu">
+            新建
+        </view>
+    </view>
+    <view class="content">
+        <view class="num">
+            202212345646545654
+        </view>
+        <view class="exp">
+            收货人:zzz
+        </view>
+        <view class="exp">
+            单据时间:2022-05-06 11:11:11
+        </view>
+        <view class="exp">
+            审核时间:2022-05-06 11:11:11
+        </view>
+    </view>
+</navigator>
+
+<Yl_Empty wx:if="{{list.length==0}}" />
+<wxs module="set">
+    module.exports = {
+        color: function (statu) {
+            var color = '#999999';
+            switch (statu) {
+                case "审核":
+                    color = '#FA8C16';
+                    break;
+                case "提交":
+                    color = '#52C41A';
+                    break;
+                case "新建":
+                    color = '#333333';
+                    break;
+            };
+            return color;
+        }
+    }
+</wxs>

+ 54 - 0
packageA/shipment/modules/query/index.js

@@ -0,0 +1,54 @@
+const _Http = getApp().globalData.http;
+Component({
+  data: {
+    steps: [{
+        text: '步骤一',
+        desc: '描述信息',
+      },
+      {
+        text: '步骤二',
+        desc: '描述信息',
+      },
+      {
+        text: '步骤三',
+        desc: '描述信息',
+      },
+      {
+        text: '步骤四',
+        desc: '描述信息',
+      },
+    ],
+    sa_orderid: 0,
+    content: {
+      nocache: true,
+      pageNumber: 1,
+      pageTotal: 1,
+      total: null
+    }
+  },
+  methods: {
+    getList(id, init) {
+      let content = this.data.content;
+      content.sa_orderid = id;
+      if (init) content.pageNumber = 1;
+      _Http.basic({
+        "id": "20221229093602",
+        content
+      }).then(res => {
+        console.log("订单进度", res)
+        if (res.msg != '成功') return wx.showToast({
+          title: res.msg,
+          icon: "none"
+        })
+        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,
+          sa_orderid: id
+        })
+      })
+    }
+  }
+})

+ 6 - 0
packageA/shipment/modules/query/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "van-steps": "@vant/weapp/steps/index"
+  }
+}

+ 5 - 0
packageA/shipment/modules/query/index.scss

@@ -0,0 +1,5 @@
+.title {
+	font-size: 28rpx;
+	color: #333333;
+	margin: 30rpx;
+}

+ 3 - 0
packageA/shipment/modules/query/index.wxml

@@ -0,0 +1,3 @@
+<view class="title">物流查询</view>
+
+<van-steps steps="{{ steps }}" active="{{ active }}" direction="vertical" active-color="#375CAC" />