Browse Source

Merge branch 'master' of http://git.cc-lotus.info/Consumables/mobiles-two

zs 3 years ago
parent
commit
defb984bd1

+ 78 - 70
app.json

@@ -1,73 +1,81 @@
 {
-    "pages": [
-        "pages/index/index",
-        "pages/login/index",
-        "pages/login/agreement",
-        "pages/home/index",
-        "pages/basic/index",
-        "pages/user/index",
-        "pages/user/detail",
-        "pages/type/index",
-        "pages/type/detail",
-        "pages/stock/index",
-        "pages/stock/detail",
-        "pages/stock_order/index",
-        "pages/indepot/index",
-        "pages/indepot/detail",
-        "pages/outdepot/index",
-        "pages/outdepot/detail",
-        "pages/password/index",
-        "pages/test/index",
-        "pages/logs/logs"
-    ],
-    "usingComponents": {
-        "van-button": "/miniprogram_npm/@vant/weapp/button/index",
-        "van-row": "/miniprogram_npm/@vant/weapp/row/index",
-        "van-col": "/miniprogram_npm/@vant/weapp/col/index",
-        "van-datetime-picker": "/miniprogram_npm/@vant/weapp/datetime-picker/index",
-        "van-picker": "/miniprogram_npm/@vant/weapp/picker/index",
-        "van-popup": "/miniprogram_npm/@vant/weapp/popup/index",
-        "van-radio": "/miniprogram_npm/@vant/weapp/radio/index",
-        "van-radio-group": "/miniprogram_npm/@vant/weapp/radio-group/index",
-        "van-action-sheet": "/miniprogram_npm/@vant/weapp/action-sheet/index",
-        "van-search": "/miniprogram_npm/@vant/weapp/search/index",
-        "van-tree-select": "/miniprogram_npm/@vant/weapp/tree-select/index",
-        "van-overlay": "/miniprogram_npm/@vant/weapp/overlay/index",
-        "van-dialog": "/miniprogram_npm/@vant/weapp/dialog/index",
-        "van-tab": "/miniprogram_npm/@vant/weapp/tab/index",
-        "van-tabs": "/miniprogram_npm/@vant/weapp/tabs/index",
-        "van-stepper": "/miniprogram_npm/@vant/weapp/stepper/index",
-        "van-collapse": "/miniprogram_npm/@vant/weapp/collapse/index",
-        "van-collapse-item": "/miniprogram_npm/@vant/weapp/collapse-item/index",
-        "van-cell": "/miniprogram_npm/@vant/weapp/cell/index",
-        "van-cell-group": "/miniprogram_npm/@vant/weapp/cell-group/index",
-        "van-toast": "/miniprogram_npm/@vant/weapp/toast/index",
-        "van-field": "/miniprogram_npm/@vant/weapp/field/index",
-        "van-checkbox": "/miniprogram_npm/@vant/weapp/checkbox/index",
-        "van-checkbox-group": "/miniprogram_npm/@vant/weapp/checkbox-group/index",
-        "van-loading": "/miniprogram_npm/@vant/weapp/loading/index",
-        "van-icon": "/miniprogram_npm/@vant/weapp/icon/index",
-        "van-nav-bar": "/miniprogram_npm/@vant/weapp/nav-bar/index",
-        "van-tabbar": "/miniprogram_npm/@vant/weapp/tabbar/index",
-        "van-tabbar-item": "/miniprogram_npm/@vant/weapp/tabbar-item/index",
-        "van-rate": "/miniprogram_npm/@vant/weapp/rate/index",
-        "van-uploader": "@vant/weapp/uploader/index",
-        "van-divider": "@vant/weapp/divider/index"
-    },
-    "window": {
-        "backgroundTextStyle": "light",
-        "navigationBarBackgroundColor": "#fff",
-        "navigationBarTitleText": "耗材-小程序",
-        "navigationBarTextStyle": "black",
-        "navigationStyle": "custom"
-    },
-    "requiredBackgroundModes": [
-        "location"
-    ],
-    "sitemapLocation": "sitemap.json",
-    "permission": {
-        "scope.userLocation": {
-            "desc": "你的位置信息将用于小程序位置接口的效果展示"
-        }
+  "pages": [
+    "pages/index/index",
+    "pages/login/index",
+    "pages/login/agreement",
+    "pages/home/index",
+    "pages/apply/index",
+    "pages/apply/detail",
+    "pages/apply_examine/index",
+    "pages/apply_review/index",
+    "pages/market_buy/index",
+    "pages/market_buy/detail",
+    "pages/market/index",
+    "pages/market/detail",
+    "pages/basic/index",
+    "pages/user/index",
+    "pages/user/detail",
+    "pages/type/index",
+    "pages/type/detail",
+    "pages/stock/index",
+    "pages/stock/detail",
+    "pages/stock_order/index",
+    "pages/indepot/index",
+    "pages/indepot/detail",
+    "pages/outdepot/index",
+    "pages/outdepot/detail",
+    "pages/password/index",
+    "pages/test/index",
+    "pages/logs/logs"
+  ],
+  "usingComponents": {
+    "van-button": "/miniprogram_npm/@vant/weapp/button/index",
+    "van-row": "/miniprogram_npm/@vant/weapp/row/index",
+    "van-col": "/miniprogram_npm/@vant/weapp/col/index",
+    "van-datetime-picker": "/miniprogram_npm/@vant/weapp/datetime-picker/index",
+    "van-picker": "/miniprogram_npm/@vant/weapp/picker/index",
+    "van-popup": "/miniprogram_npm/@vant/weapp/popup/index",
+    "van-radio": "/miniprogram_npm/@vant/weapp/radio/index",
+    "van-radio-group": "/miniprogram_npm/@vant/weapp/radio-group/index",
+    "van-action-sheet": "/miniprogram_npm/@vant/weapp/action-sheet/index",
+    "van-search": "/miniprogram_npm/@vant/weapp/search/index",
+    "van-tree-select": "/miniprogram_npm/@vant/weapp/tree-select/index",
+    "van-overlay": "/miniprogram_npm/@vant/weapp/overlay/index",
+    "van-dialog": "/miniprogram_npm/@vant/weapp/dialog/index",
+    "van-tab": "/miniprogram_npm/@vant/weapp/tab/index",
+    "van-tabs": "/miniprogram_npm/@vant/weapp/tabs/index",
+    "van-stepper": "/miniprogram_npm/@vant/weapp/stepper/index",
+    "van-collapse": "/miniprogram_npm/@vant/weapp/collapse/index",
+    "van-collapse-item": "/miniprogram_npm/@vant/weapp/collapse-item/index",
+    "van-cell": "/miniprogram_npm/@vant/weapp/cell/index",
+    "van-cell-group": "/miniprogram_npm/@vant/weapp/cell-group/index",
+    "van-toast": "/miniprogram_npm/@vant/weapp/toast/index",
+    "van-field": "/miniprogram_npm/@vant/weapp/field/index",
+    "van-checkbox": "/miniprogram_npm/@vant/weapp/checkbox/index",
+    "van-checkbox-group": "/miniprogram_npm/@vant/weapp/checkbox-group/index",
+    "van-loading": "/miniprogram_npm/@vant/weapp/loading/index",
+    "van-icon": "/miniprogram_npm/@vant/weapp/icon/index",
+    "van-nav-bar": "/miniprogram_npm/@vant/weapp/nav-bar/index",
+    "van-tabbar": "/miniprogram_npm/@vant/weapp/tabbar/index",
+    "van-tabbar-item": "/miniprogram_npm/@vant/weapp/tabbar-item/index",
+    "van-rate": "/miniprogram_npm/@vant/weapp/rate/index",
+    "van-uploader": "@vant/weapp/uploader/index",
+    "van-divider": "@vant/weapp/divider/index"
+  },
+  "window": {
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#fff",
+    "navigationBarTitleText": "耗材-小程序",
+    "navigationBarTextStyle": "black",
+    "navigationStyle": "custom"
+  },
+  "requiredBackgroundModes": [
+    "location"
+  ],
+  "sitemapLocation": "sitemap.json",
+  "permission": {
+    "scope.userLocation": {
+      "desc": "你的位置信息将用于小程序位置接口的效果展示"
     }
+  }
 }

+ 120 - 0
pages/apply/detail.js

@@ -0,0 +1,120 @@
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '需求信息添加', leftArrow: true, useBar: false },
+    // 主体高度
+    infoHeight: '',
+    form: {},
+    // 商品列表
+    order: [],
+    user_id: '12333',
+    // 弹框
+    dialog: { title: '添加商品', show: false, type: '1' },
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/apply/index' })
+  },
+
+  // 添加商品
+  addOrder: function () {
+    this.setData({ dialog: { title: '添加商品', show: true, type: '1' } })
+  },
+  // 商品保存
+  orderSubmit: function (e) {
+    const params = e.detail.value;
+    if (!params.name) wx.showToast({ title: `商品名称`, icon: 'error', duration: 2000 });
+    else if (!params.num) wx.showToast({ title: `商品数量`, icon: 'error', duration: 2000 });
+    if (params.name && params.num) {
+      this.setData({ order: [...this.data.order, params] });
+      this.setData({ orderForm: {} });
+      this.setData({ dialog: { title: '添加商品', show: false, type: '1' } });
+    }
+  },
+  // 商品取消保存
+  orderReset: function (e) {
+    this.setData({ dialog: { title: '添加商品', show: false, type: '1' } })
+  },
+  // 取消保存
+  onReset: function (e) {
+    this.back()
+  },
+  // 提交保存
+  onSubmit: function (e) {
+    const params = e.detail.value;
+    params.order = this.data.order;
+    params.user_id = this.data.user_id;
+    console.log(params);
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // 监听用户是否登录
+    // this.watchLogin();
+    // 计算高度
+    this.searchHeight();
+  },
+  // 计算高度
+  searchHeight: function () {
+    let frameStyle = this.data.frameStyle;
+    let client = app.globalData.client;
+    // 减去状态栏
+    let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+    // 是否减去底部菜单
+    if (frameStyle.useBar) infoHeight = infoHeight - 50;
+    if (infoHeight) this.setData({ infoHeight: infoHeight })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 6 - 0
pages/apply/detail.json

@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+   "mobile-main": "/commpents/mobile-frame/mobile-main"
+ }
+}

+ 115 - 0
pages/apply/detail.less

@@ -0,0 +1,115 @@
+.main {
+ position: relative;
+ width: 100%;
+
+ .one {
+  position: relative;
+  padding: 10px;
+
+  .content {
+   position: relative;
+   padding: 10px 0;
+   box-shadow: 0 0 5px #000000;
+   margin: 0 0 10px 0;
+   border-radius: 5px;
+
+   .left {
+    float: left;
+    margin: 0 10px;
+   }
+  }
+
+  .order {
+   position: relative;
+   padding: 10px;
+   box-shadow: 0 0 5px #000000;
+   margin: 0 0 10px 0;
+   border-radius: 5px;
+
+   .order_1 {
+    position: relative;
+    text-align: center;
+   }
+
+   .order_2 {
+    position: relative;
+
+    .list {
+     margin: 0 0 8px 0;
+     background-color: #f9f9f9;
+     border-radius: 5px;
+     padding: 8px 0;
+
+     .name {
+      font-size: 16px;
+      margin: 0 0 5px 0;
+      padding: 0 10px;
+     }
+
+     .other {
+      .otherInfo {
+       margin: 0 0 5px 0;
+       font-size: 14px;
+       color: #666666;
+       padding: 0 10px;
+      }
+     }
+    }
+   }
+  }
+
+  .save {
+   text-align: center;
+
+   button {
+    margin: 10px;
+   }
+  }
+ }
+}
+
+.dialog {
+ min-height: 30px;
+ max-height: 320px;
+ overflow-y: auto;
+ padding: 0 8px;
+
+ .dialog_1 {
+  .content {
+   position: relative;
+   padding: 8px 0;
+   border-radius: 6px;
+   margin: 0 0 5px 0;
+   background-color: #f1f1f1;
+
+   .left {
+    float: left;
+    margin: 0 10px;
+
+    text {
+     font-size: 14px;
+     color: #666666;
+    }
+   }
+
+   .right {
+    input {
+     font-size: 12px;
+    }
+   }
+  }
+
+  .save {
+   text-align: center;
+
+   button {
+    margin: 10px;
+   }
+  }
+ }
+}
+
+.van-dialog__header {
+ padding-top: 0 !important;
+ padding: 10px 0 !important;
+}

+ 86 - 0
pages/apply/detail.wxml

@@ -0,0 +1,86 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="main" style="height:{{infoHeight}}px;">
+        <view class="one">
+            <form bindsubmit="onSubmit" catchreset="onReset">
+                <view class="content" style="display: none;">
+                    <view class="left">
+                        <text class="icon iconfont icon-xingming1"></text>
+                    </view>
+                    <view class="right">
+                        <input name="user_id" value="{{form.user_id}}" disabled></input>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="left">
+                        <text class="icon iconfont icon-xingming1"></text>
+                    </view>
+                    <view class="right">
+                        <input name="user_name" value="{{form.user_name}}" placeholder='请输入姓名' placeholder-class="placeholder"></input>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="left">
+                        <text class="icon iconfont icon-dianhua"></text>
+                    </view>
+                    <view class="right">
+                        <input name="user_phone" type="number" maxlength="11" value="{{form.user_phone}}" placeholder='请输入电话' placeholder-class="placeholder"></input>
+                    </view>
+                </view>
+                <view class="order">
+                    <view class="order_1">
+                        <button type="primary" size="mini" bindtap="addOrder">添加商品</button>
+                    </view>
+                    <view class="order_2">
+                        <view class="list" wx:key="item" wx:for="{{order}}">
+                            <view class="name">{{item.name}}</view>
+                            <view class="other">
+                                <view class="otherInfo">商品数量:<text>{{item.num||'暂无' }}</text></view>
+                                <view class="otherInfo">特殊说明:<text>{{item.desc||'暂无' }}</text></view>
+                            </view>
+                        </view>
+                    </view>
+                </view>
+                <view class="save">
+                    <button type="warn" size="mini" formType="reset">取消保存</button>
+                    <button type="primary" size="mini" formType="submit">提交保存</button>
+                </view>
+            </form>
+        </view>
+    </view>
+</mobile-main>
+<van-dialog use-slot title="{{dialog.title}}" show="{{ dialog.show }}" show-confirm-button="{{false}}">
+    <view class="dialog">
+        <view wx:if="{{dialog.type=='1'}}" class="dialog_1">
+            <form bindsubmit="orderSubmit" catchreset="orderReset">
+                <view class="content">
+                    <view class="left">
+                        <text class="icon iconfont icon-mingcheng"></text>
+                    </view>
+                    <view class="right">
+                        <input name="name" value="{{orderForm.name}}" placeholder='请输入商品名称' placeholder-class="placeholder"></input>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="left">
+                        <text class="icon iconfont icon-navicon-jhslsz"></text>
+                    </view>
+                    <view class="right">
+                        <input name="num" value="{{orderForm.num}}" type="number" placeholder='请输入商品数量' placeholder-class="placeholder"></input>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="left">
+                        <text class="icon iconfont icon-icon"></text>
+                    </view>
+                    <view class="right">
+                        <input name="desc" value="{{orderForm.desc}}" placeholder='请输入特殊说明' placeholder-class="placeholder"></input>
+                    </view>
+                </view>
+                <view class="save">
+                    <button type="warn" size="mini" formType="reset">取消保存</button>
+                    <button type="primary" size="mini" formType="submit">提交保存</button>
+                </view>
+            </form>
+        </view>
+    </view>
+</van-dialog>

+ 90 - 0
pages/apply/detail.wxss

@@ -0,0 +1,90 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+.main .one {
+  position: relative;
+  padding: 10px;
+}
+.main .one .content {
+  position: relative;
+  padding: 10px 0;
+  box-shadow: 0 0 5px #000000;
+  margin: 0 0 10px 0;
+  border-radius: 5px;
+}
+.main .one .content .left {
+  float: left;
+  margin: 0 10px;
+}
+.main .one .order {
+  position: relative;
+  padding: 10px;
+  box-shadow: 0 0 5px #000000;
+  margin: 0 0 10px 0;
+  border-radius: 5px;
+}
+.main .one .order .order_1 {
+  position: relative;
+  text-align: center;
+}
+.main .one .order .order_2 {
+  position: relative;
+}
+.main .one .order .order_2 .list {
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+}
+.main .one .order .order_2 .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.main .one .order .order_2 .list .other .otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.main .one .save {
+  text-align: center;
+}
+.main .one .save button {
+  margin: 10px;
+}
+.dialog {
+  min-height: 30px;
+  max-height: 320px;
+  overflow-y: auto;
+  padding: 0 8px;
+}
+.dialog .dialog_1 .content {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_1 .content .left {
+  float: left;
+  margin: 0 10px;
+}
+.dialog .dialog_1 .content .left text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_1 .content .right input {
+  font-size: 12px;
+}
+.dialog .dialog_1 .save {
+  text-align: center;
+}
+.dialog .dialog_1 .save button {
+  margin: 10px;
+}
+.van-dialog__header {
+  padding-top: 0 !important;
+  padding: 10px 0 !important;
+}

+ 101 - 0
pages/apply/index.js

@@ -0,0 +1,101 @@
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameStyle: { useTop: true, name: '采购申请', leftArrow: true, useBar: false },
+    // 主体高度
+    infoHeight: '',
+    // 采购申请
+    list: [{ user_name: '法外狂徒张三', user_phone: '12345678901', examine_date: '111', status_name: '待审', status: '2' }],
+    // 弹框
+    dialog: { title: '详细信息', show: false, type: '1' },
+    // 详细信息
+    info: { user_name: '法外狂徒张三', user_phone: '12345678901', examine_name: '李四', examine_date: '111', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], },
+  },
+  back: function () {
+    wx.navigateBack({ url: '/pages/apply/index' })
+  },
+  // 添加采购申请
+  toAdd: function () {
+    wx.navigateTo({ url: `/pages/apply/detail` })
+  },
+  // 详细信息
+  toView: function (e) {
+    this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+  },
+  // 领取确认
+  toConfirm: function (e) {
+    wx.showToast({ title: `领取确认成功`, icon: 'success', duration: 2000 });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // 监听用户是否登录
+    // this.watchLogin();
+    // 计算高度
+    this.searchHeight();
+  },
+  // 计算高度
+  searchHeight: function () {
+    let frameStyle = this.data.frameStyle;
+    let client = app.globalData.client;
+    // 减去状态栏
+    let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+    // 是否减去底部菜单
+    if (frameStyle.useBar) infoHeight = infoHeight - 50;
+    if (infoHeight) this.setData({ infoHeight: infoHeight })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 6 - 0
pages/apply/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "mobile-main": "/commpents/mobile-frame/mobile-main"
+  }
+}

+ 147 - 0
pages/apply/index.less

@@ -0,0 +1,147 @@
+.main {
+ position: relative;
+ width: 100%;
+
+ .one {
+  position: relative;
+  width: 100%;
+  text-align: center;
+  border-bottom: 1px dashed #000000;
+
+  button {
+   margin: 10px;
+  }
+ }
+
+ .two {
+  position: relative;
+  padding: 10px;
+
+  .list {
+   float: left;
+   width: 100%;
+   margin: 0 0 8px 0;
+   background-color: #f9f9f9;
+   border-radius: 5px;
+   padding: 8px 0;
+
+   .name {
+    font-size: 16px;
+    margin: 0 0 5px 0;
+    padding: 0 10px;
+   }
+
+   .other {
+    .otherInfo {
+     margin: 0 0 5px 0;
+     font-size: 14px;
+     color: #666666;
+     padding: 0 10px;
+
+     text {
+      color: #000000;
+     }
+    }
+   }
+
+   .btn {
+    text-align: center;
+
+    button {
+     margin: 0 5px;
+    }
+   }
+
+
+  }
+ }
+}
+
+.dialog {
+ min-height: 30px;
+ max-height: 320px;
+ overflow-y: auto;
+ padding: 0 8px;
+
+ .dialog_1 {
+  .content {
+   position: relative;
+   padding: 8px 0;
+   border-radius: 6px;
+   margin: 0 0 5px 0;
+   background-color: #f1f1f1;
+
+   .left {
+    float: left;
+    margin: 0 10px;
+
+    text {
+     font-size: 14px;
+     color: #666666;
+    }
+   }
+
+   .right {
+    input {
+     font-size: 12px;
+    }
+   }
+  }
+
+  .order {
+   position: relative;
+   padding: 8px 0;
+   border-radius: 6px;
+   margin: 0 0 5px 0;
+   background-color: #f1f1f1;
+
+   .order_1 {
+    position: relative;
+    margin: 0 10px;
+
+    text {
+     font-size: 14px;
+     color: #666666;
+    }
+   }
+
+   .order_2 {
+    position: relative;
+    padding: 0 5px;
+    margin: 5px 0 0 0;
+
+    .list {
+     margin: 0 0 8px 0;
+     background-color: #f9f9f9;
+     border-radius: 5px;
+     padding: 8px 0;
+
+     .name {
+      font-size: 16px;
+      margin: 0 0 5px 0;
+      padding: 0 10px;
+     }
+
+     .other {
+      .otherInfo {
+       margin: 0 0 5px 0;
+       font-size: 14px;
+       color: #666666;
+       padding: 0 10px;
+
+       text {
+        color: #000000;
+       }
+      }
+     }
+    }
+   }
+  }
+ }
+
+}
+
+.van-dialog__header {
+ padding-top: 0 !important;
+ padding: 10px 0 !important;
+}

+ 61 - 0
pages/apply/index.wxml

@@ -0,0 +1,61 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+  <view slot="info" class="main" style="height:{{infoHeight}}px;">
+    <view class="one">
+      <button type="primary" size="mini" bindtap="toAdd">添加采购申请</button>
+    </view>
+    <view class="two">
+      <view class="list" wx:key="item" wx:for="{{list}}">
+        <view class="name">{{item.user_name}}</view>
+        <view class="other">
+          <view class="otherInfo">联系电话:<text>{{item.user_phone||'暂无' }}</text></view>
+          <view class="otherInfo textOver">审核时间:<text>{{item.examine_date||'暂无' }}</text></view>
+          <view class="otherInfo textOver">审核状态:<text>{{item.status_name }}</text></view>
+        </view>
+        <view class="btn">
+          <button type="info" size="mini" bindtap="toView" data-id="{{item.id}}">详细信息</button>
+          <button type="primary" size="mini" bindtap="toConfirm" data-id="{{item.id}}" wx:if="{{item.status=='2'}}">领取确定</button>
+        </view>
+      </view>
+    </view>
+  </view>
+</mobile-main>
+<van-dialog use-slot title="{{dialog.title}}" show="{{ dialog.show }}" confirmButtonText="返回">
+  <view class="dialog">
+    <view wx:if="{{dialog.type=='1'}}" class="dialog_1">
+      <form>
+        <view class="content">
+          <view class="left"><text>姓名:</text></view>
+          <view class="right"><input name="user_name" value="{{info.user_name}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>电话:</text></view>
+          <view class="right"><input name="user_phone" value="{{info.user_phone}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>审核人:</text></view>
+          <view class="right"><input name="examine_name" value="{{info.examine_name||'暂无' }}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>审核时间:</text></view>
+          <view class="right"><input name="examine_date" value="{{info.examine_date||'暂无'}}" disabled></input></view>
+        </view>
+        <view class="content">
+          <view class="left"><text>审核意见:</text></view>
+          <view class="right"><input name="examine_desc" value="{{info.examine_desc||'暂无'}}" disabled></input></view>
+        </view>
+        <view class="order">
+          <view class="order_1"><text>商品列表:</text></view>
+          <view class="order_2">
+            <view class="list" wx:key="item" wx:for="{{info.order}}">
+              <view class="name">{{item.name}}</view>
+              <view class="other">
+                <view class="otherInfo">商品数量:<text>{{item.num||'暂无' }}</text></view>
+                <view class="otherInfo">特殊说明:<text>{{item.desc||'暂无' }}</text></view>
+              </view>
+            </view>
+          </view>
+        </view>
+      </form>
+    </view>
+  </view>
+</van-dialog>

+ 113 - 0
pages/apply/index.wxss

@@ -0,0 +1,113 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+.main .one {
+  position: relative;
+  width: 100%;
+  text-align: center;
+  border-bottom: 1px dashed #000000;
+}
+.main .one button {
+  margin: 10px;
+}
+.main .two {
+  position: relative;
+  padding: 10px;
+}
+.main .two .list {
+  float: left;
+  width: 100%;
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+}
+.main .two .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.main .two .list .other .otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.main .two .list .other .otherInfo text {
+  color: #000000;
+}
+.main .two .list .btn {
+  text-align: center;
+}
+.main .two .list .btn button {
+  margin: 0 5px;
+}
+.dialog {
+  min-height: 30px;
+  max-height: 320px;
+  overflow-y: auto;
+  padding: 0 8px;
+}
+.dialog .dialog_1 .content {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_1 .content .left {
+  float: left;
+  margin: 0 10px;
+}
+.dialog .dialog_1 .content .left text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_1 .content .right input {
+  font-size: 12px;
+}
+.dialog .dialog_1 .order {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_1 .order .order_1 {
+  position: relative;
+  margin: 0 10px;
+}
+.dialog .dialog_1 .order .order_1 text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_1 .order .order_2 {
+  position: relative;
+  padding: 0 5px;
+  margin: 5px 0 0 0;
+}
+.dialog .dialog_1 .order .order_2 .list {
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+}
+.dialog .dialog_1 .order .order_2 .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo text {
+  color: #000000;
+}
+.van-dialog__header {
+  padding-top: 0 !important;
+  padding: 10px 0 !important;
+}

+ 152 - 0
pages/apply_examine/index.js

@@ -0,0 +1,152 @@
+const { apply_status } = require('../../utils/dict');
+const app = getApp();
+Page({
+
+ /**
+  * 页面的初始数据
+  */
+ data: {
+  frameStyle: { useTop: true, name: '采购申请审核', leftArrow: true, useBar: false },
+  // 主体高度
+  infoHeight: '',
+  // 采购申请审核
+  list: [
+   { id: '001', user_name: '法外狂徒张三', user_phone: '12345678901', examine_name: '李四', examine_date: '111', status_name: '待审', status: '0', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], },
+   { id: '002', user_name: '小红帽', user_phone: '98765432109', examine_date: '222', examine_name: '赵五', status_name: '待审', status: '0', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], }
+  ],
+  // 弹框
+  dialog: { title: '详细信息', show: false, type: '1' },
+  // 详细信息
+  info: {},
+  // 审核
+  checkForm: { examine_name: '李四' },
+  // 导出条件
+  exportForm: {},
+  // 商品状态
+  statusList: apply_status
+ },
+ back: function () {
+  wx.navigateBack({ url: '/pages/home/index' })
+ },
+ // 导出条件
+ export_term: function () {
+  this.setData({ dialog: { title: '导出条件', show: true, type: '3' }, })
+ },
+ // 选择状态
+ statusChange: function (e) {
+  let { value } = e.detail;
+  if (value) {
+   let data = this.data.statusList[value];
+   this.setData({ 'exportForm.status': data.value })
+  }
+ },
+ // 开始时间
+ startChange: function (e) {
+  let { value } = e.detail;
+  this.setData({ 'exportForm.apply_date@start': value })
+ },
+ // 结束时间
+ endChange: function (e) {
+  let { value } = e.detail;
+  this.setData({ 'exportForm.apply_date@end': value })
+ },
+ // 重置条件
+ expertReset: function (e) {
+  this.setData({ exportForm: { user_name: '', status: '' } })
+ },
+ // 确认导出
+ exportSubmit: function (e) {
+  console.log('打开文档成功')
+ },
+ // 采购申请审核
+ toCheck: function (e) {
+  this.setData({ dialog: { title: '采购申请审核', show: true, type: '2' } })
+ },
+ // 提交审核
+ checkSubmit: function (e) {
+  wx.showToast({ title: `审核信息成功`, icon: 'success', duration: 2000 });
+  this.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
+ },
+ // 详细信息
+ toView: function (e) {
+  let item = e.currentTarget.dataset.item;
+  this.setData({ info: item })
+  this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+ },
+ // 刪除信息
+ toDel: function (e) {
+ },
+ // 查询
+ shoppinginput: function (e) {
+  this.setData({ shoopingtext: e.detail.value })
+ },
+ /**
+  * 生命周期函数--监听页面加载
+  */
+ onLoad: function (options) {
+  // 计算高度
+  this.searchHeight();
+ },
+ // 查询数据
+ search: function (e) {
+ },
+ // 计算高度
+ searchHeight: function () {
+  let frameStyle = this.data.frameStyle;
+  let client = app.globalData.client;
+  // 减去状态栏
+  let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+  // 是否减去底部菜单
+  if (frameStyle.useBar) infoHeight = infoHeight - 50;
+  if (infoHeight) this.setData({ infoHeight: infoHeight })
+ },
+
+ /**
+  * 生命周期函数--监听页面初次渲染完成
+  */
+ onReady: function () {
+
+ },
+
+ /**
+  * 生命周期函数--监听页面显示
+  */
+ onShow: function () {
+  this.search();
+ },
+
+ /**
+  * 生命周期函数--监听页面隐藏
+  */
+ onHide: function () {
+
+ },
+
+ /**
+  * 生命周期函数--监听页面卸载
+  */
+ onUnload: function () {
+
+ },
+
+ /**
+  * 页面相关事件处理函数--监听用户下拉动作
+  */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+  * 页面上拉触底事件的处理函数
+  */
+ onReachBottom: function () {
+
+ },
+
+ /**
+  * 用户点击右上角分享
+  */
+ onShareAppMessage: function () {
+
+ }
+})

+ 6 - 0
pages/apply_examine/index.json

@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+  "mobile-main": "/commpents/mobile-frame/mobile-main"
+ }
+}

+ 179 - 0
pages/apply_examine/index.less

@@ -0,0 +1,179 @@
+.main {
+ position: relative;
+ width: 100%;
+
+ .one {
+  position: relative;
+  padding: 8px 5px;
+  text-align: center;
+  border-bottom: 1px dashed #000000;
+
+  button {
+   margin: 0 5px;
+  }
+ }
+
+ .two {
+  position: relative;
+  padding: 10px;
+
+  .list {
+   float: left;
+   width: 100%;
+   margin: 0 0 8px 0;
+   background-color: #f9f9f9;
+   border-radius: 5px;
+   padding: 8px 0;
+
+   .name {
+    font-size: 16px;
+    margin: 0 0 5px 0;
+    padding: 0 10px;
+   }
+
+   .other {
+    .otherInfo {
+     margin: 0 0 5px 0;
+     font-size: 14px;
+     color: #666666;
+     padding: 0 10px;
+
+     text {
+      color: #000000;
+     }
+    }
+   }
+
+   .btn {
+    text-align: center;
+
+    button {
+     margin: 0 5px;
+    }
+
+   }
+  }
+ }
+
+}
+
+.dialog {
+ min-height: 30px;
+ max-height: 320px;
+ overflow-y: auto;
+ padding: 0 8px;
+
+ .dialog_1 {
+  .content {
+   position: relative;
+   padding: 8px 0;
+   border-radius: 6px;
+   margin: 0 0 5px 0;
+   background-color: #f1f1f1;
+
+   .left {
+    float: left;
+    margin: 0 10px;
+
+    text {
+     font-size: 14px;
+     color: #666666;
+    }
+   }
+
+   .right {
+    input {
+     font-size: 12px;
+    }
+   }
+  }
+
+  .order {
+   position: relative;
+   padding: 8px 0;
+   border-radius: 6px;
+   margin: 0 0 5px 0;
+   background-color: #f1f1f1;
+
+   .order_1 {
+    text {
+     font-size: 14px;
+     color: #666666;
+    }
+   }
+
+   .order_2 {
+    position: relative;
+    padding: 0 5px;
+    margin: 5px 0 0 0;
+
+    .list {
+     margin: 0 0 8px 0;
+     background-color: #f9f9f9;
+     border-radius: 5px;
+     padding: 8px 0;
+
+     .name {
+      font-size: 16px;
+      margin: 0 0 5px 0;
+      padding: 0 10px;
+     }
+
+     .other {
+      .otherInfo {
+       margin: 0 0 5px 0;
+       font-size: 14px;
+       color: #666666;
+       padding: 0 10px;
+
+       text {
+        color: #000000;
+       }
+      }
+     }
+    }
+   }
+  }
+ }
+
+ .dialog_2 {
+  .content {
+   position: relative;
+   padding: 8px 0;
+   border-radius: 6px;
+   margin: 0 0 5px 0;
+   background-color: #f1f1f1;
+
+   .left {
+    float: left;
+    margin: 0 10px;
+
+    text {
+     font-size: 14px;
+     color: #666666;
+    }
+   }
+
+   .right {
+    input {
+     font-size: 12px;
+    }
+   }
+
+  }
+
+  .save {
+   text-align: center;
+
+   button {
+    margin: 10px;
+   }
+  }
+ }
+}
+
+
+.van-dialog__header {
+ padding-top: 0 !important;
+ padding: 10px 0 !important;
+}

+ 157 - 0
pages/apply_examine/index.wxml

@@ -0,0 +1,157 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+ <view slot="info" class="main" style="height:{{infoHeight}}px;">
+  <view class="one">
+   <button type="primary" size="mini" bindtap="export_term">导出数据</button>
+  </view>
+  <view class="two">
+   <view class="list" wx:key="item" wx:for="{{list}}">
+    <view class="name">{{item.user_name}}</view>
+    <view class="other">
+     <view class="otherInfo">联系电话:<text>{{item.user_phone||'暂无' }}</text></view>
+     <view class="otherInfo textOver">审核时间:<text>{{item.examine_date||'暂无' }}</text></view>
+     <view class="otherInfo textOver">审核状态:<text>{{item.status_name }}</text></view>
+    </view>
+    <view class="btn">
+     <button type="info" size="mini" bindtap="toView" data-item="{{item}}" data-id="{{item.id}}">详细信息</button>
+     <button type="info" size="mini" bindtap="toCheck" data-id="{{item.id}}" wx:if="{{item.status=='0'}}">审核信息</button>
+    </view>
+   </view>
+  </view>
+ </view>
+</mobile-main>
+<van-dialog use-slot title="{{dialog.title}}" show="{{ dialog.show }}" confirmButtonText="返回">
+ <view class="dialog">
+  <view wx:if="{{dialog.type=='1'}}" class="dialog_1">
+   <form>
+    <view class="content">
+     <view class="left"><text>姓名:</text></view>
+     <view class="right"><input name="user_name" value="{{info.user_name}}" disabled></input></view>
+    </view>
+    <view class="content">
+     <view class="left"><text>电话:</text></view>
+     <view class="right"><input name="user_phone" value="{{info.user_phone}}" disabled></input></view>
+    </view>
+    <view class="content">
+     <view class="left"><text>审核人:</text></view>
+     <view class="right"><input name="examine_name" value="{{info.examine_name||'暂无' }}" disabled></input></view>
+    </view>
+    <view class="content">
+     <view class="left"><text>审核时间:</text></view>
+     <view class="right"><input name="examine_date" value="{{info.examine_date||'暂无'}}" disabled></input></view>
+    </view>
+    <view class="content">
+     <view class="left"><text>审核意见:</text></view>
+     <view class="right"><input name="examine_desc" value="{{info.examine_desc||'暂无'}}" disabled></input></view>
+    </view>
+    <view class="order">
+     <view class="order_1"><text>商品列表:</text></view>
+     <view class="order_2">
+      <view class="list" wx:key="item" wx:for="{{info.order}}">
+       <view class="name">{{item.name}}</view>
+       <view class="other">
+        <view class="otherInfo">商品数量:<text>{{item.num||'暂无' }}</text></view>
+        <view class="otherInfo">特殊说明:<text>{{item.desc||'暂无' }}</text></view>
+       </view>
+      </view>
+     </view>
+    </view>
+   </form>
+  </view>
+  <view wx:if="{{dialog.type=='2'}}" class="dialog_2">
+   <form bindsubmit="checkSubmit">
+    <view class="content" style="display: none;">
+     <view class="left">
+      <text class="icon iconfont icon-xingming1"></text>
+     </view>
+     <view class="right">
+      <input name="id" value="{{checkForm.id}}" disabled></input>
+     </view>
+    </view>
+    <view class="content" style="display: none;">
+     <view class="left">
+      <text class="icon iconfont icon-xingming1"></text>
+     </view>
+     <view class="right">
+      <input name="examine_id" value="{{checkForm.examine_id}}" disabled></input>
+     </view>
+    </view>
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-xingming1"></text>
+     </view>
+     <view class="right">
+      <input name="examine_name" value="{{checkForm.examine_name}}" disabled></input>
+     </view>
+    </view>
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-icon"></text>
+     </view>
+     <view class="right">
+      <input name="examine_desc" value="{{checkForm.examine_desc}}" placeholder='请输入审核意见' placeholder-class="placeholder"></input>
+     </view>
+    </view>
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-zhuangtai"></text>
+     </view>
+     <view class="right">
+      <radio-group name="status">
+       <radio value="1">通过</radio>
+       <radio value="-1">拒绝</radio>
+      </radio-group>
+     </view>
+    </view>
+    <view class="save">
+     <button type="primary" size="mini" formType="submit">提交审核</button>
+    </view>
+   </form>
+  </view>
+  <view wx:if="{{dialog.type=='3'}}" class="dialog_2">
+   <form bindsubmit="exportSubmit" catchreset="expertReset">
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-xingming1"></text>
+     </view>
+     <view class="right">
+      <input name="user_name" value="{{exportForm.user_name}}" placeholder='请输入申请人姓名' placeholder-class="placeholder"></input>
+     </view>
+    </view>
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-zhuangtai"></text>
+     </view>
+     <view class="right">
+      <picker class="picker" bindchange="statusChange" name="status" value="{{twoorderForm.status}}" range="{{statusList}}" range-key="label">
+       <view>{{exportForm.status||'选择商品状态'}}</view>
+      </picker>
+     </view>
+    </view>
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-shijian"></text>
+     </view>
+     <view class="right">
+      <picker mode="date" name="apply_date@start" bindchange="startChange" value="{{exportForm['apply_date@start']}}">
+       <view>{{exportForm['apply_date@start']||'请选择开始时间'}}</view>
+      </picker>
+     </view>
+    </view>
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-shijian"></text>
+     </view>
+     <view class="right">
+      <picker mode="date" name="apply_date@end" bindchange="endChange" value="{{exportForm['apply_date@end']}}">
+       <view>{{exportForm['apply_date@end']||'请选择开始时间'}}</view>
+      </picker>
+     </view>
+    </view>
+    <view class="save">
+     <button type="warn" size="mini" formType="reset">重置条件</button>
+     <button type="primary" size="mini" formType="submit">确认导出</button>
+    </view>
+   </form>
+  </view>
+ </view>
+</van-dialog>

+ 133 - 0
pages/apply_examine/index.wxss

@@ -0,0 +1,133 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+.main .one {
+  position: relative;
+  padding: 8px 5px;
+  text-align: center;
+  border-bottom: 1px dashed #000000;
+}
+.main .one button {
+  margin: 0 5px;
+}
+.main .two {
+  position: relative;
+  padding: 10px;
+}
+.main .two .list {
+  float: left;
+  width: 100%;
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+}
+.main .two .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.main .two .list .other .otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.main .two .list .other .otherInfo text {
+  color: #000000;
+}
+.main .two .list .btn {
+  text-align: center;
+}
+.main .two .list .btn button {
+  margin: 0 5px;
+}
+.dialog {
+  min-height: 30px;
+  max-height: 320px;
+  overflow-y: auto;
+  padding: 0 8px;
+}
+.dialog .dialog_1 .content {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_1 .content .left {
+  float: left;
+  margin: 0 10px;
+}
+.dialog .dialog_1 .content .left text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_1 .content .right input {
+  font-size: 12px;
+}
+.dialog .dialog_1 .order {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_1 .order .order_1 text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_1 .order .order_2 {
+  position: relative;
+  padding: 0 5px;
+  margin: 5px 0 0 0;
+}
+.dialog .dialog_1 .order .order_2 .list {
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+}
+.dialog .dialog_1 .order .order_2 .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo text {
+  color: #000000;
+}
+.dialog .dialog_2 .content {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_2 .content .left {
+  float: left;
+  margin: 0 10px;
+}
+.dialog .dialog_2 .content .left text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_2 .content .right input {
+  font-size: 12px;
+}
+.dialog .dialog_2 .save {
+  text-align: center;
+}
+.dialog .dialog_2 .save button {
+  margin: 10px;
+}
+.van-dialog__header {
+  padding-top: 0 !important;
+  padding: 10px 0 !important;
+}

+ 123 - 0
pages/apply_review/index.js

@@ -0,0 +1,123 @@
+const { apply_status } = require('../../utils/dict');
+const app = getApp();
+Page({
+
+ /**
+  * 页面的初始数据
+  */
+ data: {
+  frameStyle: { useTop: true, name: '采购需求信息', leftArrow: true, useBar: false },
+  // 主体高度
+  infoHeight: '',
+  // 采购申请
+  list: [
+   { id: '001', user_name: '法外狂徒张三', user_phone: '12345678901', examine_name: '李四', examine_date: '111', status_name: '待审', status: '1', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], },
+   { id: '002', user_name: '小红帽', user_phone: '98765432109', examine_date: '222', examine_name: '赵五', status_name: '待审', status: '1', examine_desc: '我想不同意,但我还是同意了', order: [{ name: '小洋人', num: '121', desc: '别卖太便宜了,赔钱' }], }
+  ],
+  // 弹框
+  dialog: { title: '详细信息', show: false, type: '1' },
+  // 详细信息
+  info: {},
+  // 查询
+  shoopingtext: '',
+  // 审核
+  checkForm: {},
+  // 比对结果
+  resultList: [{ name: '121', num: '9999999' }]
+ },
+ back: function () {
+  wx.navigateBack({ url: '/pages/home/index' })
+ },
+ // 详细信息
+ toView: function (e) {
+  let item = e.currentTarget.dataset.item;
+  this.setData({ info: item })
+  this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+ },
+ // 自动对比库存
+ toContrast: function (e) {
+  this.setData({ dialog: { title: '比对结果', show: true, type: '3' } })
+ },
+ // 审核信息是否是采买,还是领取
+ toCheck: function (e) {
+  this.setData({ dialog: { title: '审核信息', show: true, type: '2' } })
+ },
+ // 提交审核
+ checkSubmit: function (e) {
+  this.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
+ },
+ // 查询
+ shoppinginput: function (e) {
+  console.log('搜索', e.detail.value);
+  this.setData({ shoopingtext: e.detail.value })
+ },
+ /**
+  * 生命周期函数--监听页面加载
+  */
+ onLoad: function (options) {
+  // 计算高度
+  this.searchHeight();
+ },
+ // 查询数据
+ search: function (e) {
+ },
+ // 计算高度
+ searchHeight: function () {
+  let frameStyle = this.data.frameStyle;
+  let client = app.globalData.client;
+  // 减去状态栏
+  let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+  // 是否减去底部菜单
+  if (frameStyle.useBar) infoHeight = infoHeight - 50;
+  if (infoHeight) this.setData({ infoHeight: infoHeight })
+ },
+
+ /**
+  * 生命周期函数--监听页面初次渲染完成
+  */
+ onReady: function () {
+
+ },
+
+ /**
+  * 生命周期函数--监听页面显示
+  */
+ onShow: function () {
+  this.search();
+ },
+
+ /**
+  * 生命周期函数--监听页面隐藏
+  */
+ onHide: function () {
+
+ },
+
+ /**
+  * 生命周期函数--监听页面卸载
+  */
+ onUnload: function () {
+
+ },
+
+ /**
+  * 页面相关事件处理函数--监听用户下拉动作
+  */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+  * 页面上拉触底事件的处理函数
+  */
+ onReachBottom: function () {
+
+ },
+
+ /**
+  * 用户点击右上角分享
+  */
+ onShareAppMessage: function () {
+
+ }
+})

+ 6 - 0
pages/apply_review/index.json

@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+  "mobile-main": "/commpents/mobile-frame/mobile-main"
+ }
+}

+ 220 - 0
pages/apply_review/index.less

@@ -0,0 +1,220 @@
+.main {
+ position: relative;
+ width: 100%;
+
+ .one {
+  position: relative;
+  padding: 0 8px;
+  height: 40px;
+  overflow: hidden;
+  border-bottom: 1px dashed #000000;
+
+  input {
+   float: left;
+   width: 85%;
+   padding: 2px 5px;
+   margin: 5px 0;
+   border-radius: 5px;
+   border: 1px solid #cccccc;
+   background-color: #ffffff;
+  }
+
+  text {
+   position: relative;
+   left: 10px;
+   top: 6px;
+   font-size: 17px;
+  }
+ }
+
+ .two {
+  position: relative;
+  padding: 10px;
+
+  .list {
+   float: left;
+   width: 100%;
+   margin: 0 0 8px 0;
+   background-color: #f9f9f9;
+   border-radius: 5px;
+   padding: 8px 0;
+
+   .name {
+    font-size: 16px;
+    margin: 0 0 5px 0;
+    padding: 0 10px;
+   }
+
+   .other {
+    .otherInfo {
+     margin: 0 0 5px 0;
+     font-size: 14px;
+     color: #666666;
+     padding: 0 10px;
+
+     text {
+      color: #000000;
+     }
+    }
+   }
+
+   .btn {
+    text-align: center;
+
+    button {
+     margin: 0 5px;
+    }
+   }
+  }
+ }
+}
+
+.dialog {
+ min-height: 30px;
+ max-height: 320px;
+ overflow-y: auto;
+ padding: 0 8px;
+
+ .dialog_1 {
+  .content {
+   position: relative;
+   padding: 8px 0;
+   border-radius: 6px;
+   margin: 0 0 5px 0;
+   background-color: #f1f1f1;
+
+   .left {
+    float: left;
+    margin: 0 10px;
+
+    text {
+     font-size: 14px;
+     color: #666666;
+    }
+   }
+
+   .right {
+    input {
+     font-size: 12px;
+    }
+   }
+  }
+
+  .order {
+   position: relative;
+   padding: 8px 0;
+   border-radius: 6px;
+   margin: 0 0 5px 0;
+   background-color: #f1f1f1;
+
+   .order_1 {
+    position: relative;
+    margin: 0 10px;
+
+    text {
+     font-size: 14px;
+     color: #666666;
+    }
+   }
+
+   .order_2 {
+    position: relative;
+    padding: 0 5px;
+    margin: 5px 0 0 0;
+
+    .list {
+     margin: 0 0 8px 0;
+     background-color: #f9f9f9;
+     border-radius: 5px;
+     padding: 8px 0;
+
+     .name {
+      font-size: 16px;
+      margin: 0 0 5px 0;
+      padding: 0 10px;
+     }
+
+     .other {
+      .otherInfo {
+       margin: 0 0 5px 0;
+       font-size: 14px;
+       color: #666666;
+       padding: 0 10px;
+
+       text {
+        color: #000000;
+       }
+      }
+     }
+    }
+   }
+  }
+ }
+
+ .dialog_2 {
+  .content {
+   position: relative;
+   padding: 8px 0;
+   border-radius: 6px;
+   margin: 0 0 5px 0;
+   background-color: #f1f1f1;
+
+   .left {
+    float: left;
+    margin: 0 10px;
+
+    text {
+     font-size: 14px;
+     color: #666666;
+    }
+   }
+
+   .right {
+    input {
+     font-size: 12px;
+    }
+   }
+  }
+
+  .save {
+   text-align: center;
+
+   button {
+    margin: 10px;
+   }
+  }
+ }
+
+ .dialog_3 {
+  .list {
+   margin: 0 0 8px 0;
+   background-color: #f9f9f9;
+   border-radius: 5px;
+   padding: 8px 0;
+
+   .name {
+    font-size: 16px;
+    margin: 0 0 5px 0;
+    padding: 0 10px;
+   }
+
+   .other {
+    .otherInfo {
+     margin: 0 0 5px 0;
+     font-size: 14px;
+     color: #666666;
+     padding: 0 10px;
+
+     text {
+      color: #000000;
+     }
+    }
+   }
+  }
+ }
+}
+
+.van-dialog__header {
+ padding-top: 0 !important;
+ padding: 10px 0 !important;
+}

+ 97 - 0
pages/apply_review/index.wxml

@@ -0,0 +1,97 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+ <view slot="info" class="main" style="height:{{infoHeight}}px;">
+  <view class="one">
+   <input value="{{shoopingtext}}" bindinput="shoppinginput" placeholder="请输入申请人姓名"></input>
+   <text bindtap="search">搜索</text>
+  </view>
+  <view class="two">
+   <view class="list" wx:key="item" wx:for="{{list}}">
+    <view class="name">{{item.user_name}}</view>
+    <view class="other">
+     <view class="otherInfo">联系电话:<text>{{item.user_phone||'暂无' }}</text></view>
+     <view class="otherInfo textOver">审核时间:<text>{{item.examine_date||'暂无' }}</text></view>
+     <view class="otherInfo textOver">审核状态:<text>{{item.status_name }}</text></view>
+    </view>
+    <view class="btn">
+     <button type="info" size="mini" bindtap="toView" data-item="{{item}}" data-id="{{item.id}}">详细信息</button>
+     <button type="primary" size="mini" bindtap="toContrast" data-id="{{item.id}}" data-order="{{item.order}}" wx:if="{{item.status=='1'}}">自动对比库存</button>
+     <button type="info" size="mini" bindtap="toCheck" data-id="{{item.id}}" wx:if="{{item.status=='1'}}">审核信息</button>
+    </view>
+   </view>
+  </view>
+ </view>
+</mobile-main>
+<van-dialog use-slot title="{{dialog.title}}" show="{{ dialog.show }}" confirmButtonText="返回">
+ <view class="dialog">
+  <view wx:if="{{dialog.type=='1'}}" class="dialog_1">
+   <form>
+    <view class="content">
+     <view class="left"><text>姓名:</text></view>
+     <view class="right"><input name="user_name" value="{{info.user_name}}" disabled></input></view>
+    </view>
+    <view class="content">
+     <view class="left"><text>电话:</text></view>
+     <view class="right"><input name="user_phone" value="{{info.user_phone}}" disabled></input></view>
+    </view>
+    <view class="content">
+     <view class="left"><text>审核人:</text></view>
+     <view class="right"><input name="examine_name" value="{{info.examine_name||'暂无' }}" disabled></input></view>
+    </view>
+    <view class="content">
+     <view class="left"><text>审核时间:</text></view>
+     <view class="right"><input name="examine_date" value="{{info.examine_date||'暂无'}}" disabled></input></view>
+    </view>
+    <view class="content">
+     <view class="left"><text>审核意见:</text></view>
+     <view class="right"><input name="examine_desc" value="{{info.examine_desc||'暂无'}}" disabled></input></view>
+    </view>
+    <view class="order">
+     <view class="order_1"><text>商品列表:</text></view>
+     <view class="order_2">
+      <view class="list" wx:key="item" wx:for="{{info.order}}">
+       <view class="name">{{item.name}}</view>
+       <view class="other">
+        <view class="otherInfo">商品数量:<text>{{item.num||'暂无' }}</text></view>
+        <view class="otherInfo">特殊说明:<text>{{item.desc||'暂无' }}</text></view>
+       </view>
+      </view>
+     </view>
+    </view>
+   </form>
+  </view>
+  <view wx:if="{{dialog.type=='2'}}" class="dialog_2">
+   <form bindsubmit="checkSubmit">
+    <view class="content" style="display: none;">
+     <view class="left">
+      <text class="icon iconfont icon-xingming1"></text>
+     </view>
+     <view class="right">
+      <input name="id" value="{{checkForm.id}}" disabled></input>
+     </view>
+    </view>
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-zhuangtai"></text>
+     </view>
+     <view class="right">
+      <radio-group name="status">
+       <radio value="2">有货</radio>
+       <radio value="3">无货</radio>
+      </radio-group>
+     </view>
+    </view>
+    <view class="save">
+     <button type="primary" size="mini" formType="submit">提交审核</button>
+    </view>
+   </form>
+  </view>
+  <view wx:if="{{dialog.type=='3'}}" class="dialog_3">
+   <view class="list" wx:key="item" wx:for="{{resultList}}">
+    <view class="name">{{item.name}}</view>
+    <view class="other">
+     <view class="otherInfo">库存数量:<text>{{item.num||'暂无' }}</text></view>
+    </view>
+   </view>
+  </view>
+ </view>
+</van-dialog>

+ 170 - 0
pages/apply_review/index.wxss

@@ -0,0 +1,170 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+.main .one {
+  position: relative;
+  padding: 0 8px;
+  height: 40px;
+  overflow: hidden;
+  border-bottom: 1px dashed #000000;
+}
+.main .one input {
+  float: left;
+  width: 85%;
+  padding: 2px 5px;
+  margin: 5px 0;
+  border-radius: 5px;
+  border: 1px solid #cccccc;
+  background-color: #ffffff;
+}
+.main .one text {
+  position: relative;
+  left: 10px;
+  top: 6px;
+  font-size: 17px;
+}
+.main .two {
+  position: relative;
+  padding: 10px;
+}
+.main .two .list {
+  float: left;
+  width: 100%;
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+}
+.main .two .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.main .two .list .other .otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.main .two .list .other .otherInfo text {
+  color: #000000;
+}
+.main .two .list .btn {
+  text-align: center;
+}
+.main .two .list .btn button {
+  margin: 0 5px;
+}
+.dialog {
+  min-height: 30px;
+  max-height: 320px;
+  overflow-y: auto;
+  padding: 0 8px;
+}
+.dialog .dialog_1 .content {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_1 .content .left {
+  float: left;
+  margin: 0 10px;
+}
+.dialog .dialog_1 .content .left text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_1 .content .right input {
+  font-size: 12px;
+}
+.dialog .dialog_1 .order {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_1 .order .order_1 {
+  position: relative;
+  margin: 0 10px;
+}
+.dialog .dialog_1 .order .order_1 text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_1 .order .order_2 {
+  position: relative;
+  padding: 0 5px;
+  margin: 5px 0 0 0;
+}
+.dialog .dialog_1 .order .order_2 .list {
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+}
+.dialog .dialog_1 .order .order_2 .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo text {
+  color: #000000;
+}
+.dialog .dialog_2 .content {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_2 .content .left {
+  float: left;
+  margin: 0 10px;
+}
+.dialog .dialog_2 .content .left text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_2 .content .right input {
+  font-size: 12px;
+}
+.dialog .dialog_2 .save {
+  text-align: center;
+}
+.dialog .dialog_2 .save button {
+  margin: 10px;
+}
+.dialog .dialog_3 .list {
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+}
+.dialog .dialog_3 .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.dialog .dialog_3 .list .other .otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.dialog .dialog_3 .list .other .otherInfo text {
+  color: #000000;
+}
+.van-dialog__header {
+  padding-top: 0 !important;
+  padding: 10px 0 !important;
+}

+ 1 - 1
pages/home/index.js

@@ -79,7 +79,7 @@ Page({
   },
   // 监听用户是否登录
   watchLogin: function () {
-    let data = { type: '4' }
+    let data = { type: '0' }
     this.searchRouter(data);
     // wx.getStorage({
     // key: 'user',

+ 112 - 0
pages/market/index.js

@@ -0,0 +1,112 @@
+// pages/market/index.js
+const app = getApp();
+Page({
+
+   /**
+    * 页面的初始数据
+    */
+   data: {
+      frameStyle: { useTop: true, name: '商品管理', leftArrow: true, useBar: false },
+      // 主体高度
+      infoHeight: '',
+      // 商品列表
+      list: [
+         { name: '喜羊羊', type_name: '羊肉', money: '22', status: '1', brief: '一份' },
+         { name: '喜羊羊', type_name: '羊肉', money: '22', status: '0', brief: '一份' },
+         { name: '喜羊羊', type_name: '羊肉', money: '22', status: '1', brief: '一份' },
+      ],
+      // 弹框
+      dialog: { title: '详细信息', show: false, type: '1' },
+      // 详细信息
+      info: {},
+   },
+   back: function () {
+      wx.navigateBack({ url: '/pages/home/index' })
+   },
+   // 添加采购申请
+   toAdd: function () {
+      wx.navigateTo({ url: `/pages/market/detail` })
+   },
+   // 详细信息
+   toView: function (e) {
+      let item = e.currentTarget.dataset.item;
+      this.setData({ info: item })
+      this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+   },
+   // 上架,下架
+   toCheck: function (e) {
+      wx.showModal({
+         title: '操作提示',
+         content: '您确认上架/下架此产品吗?',
+         success: (res) => {
+            wx.showToast({ title: `操作成功`, icon: 'success', duration: 2000 })
+         }
+      })
+   },
+   /**
+    * 生命周期函数--监听页面加载
+    */
+   onLoad: function (options) {
+      // 计算高度
+      this.searchHeight();
+   },
+   // 计算高度
+   searchHeight: function () {
+      let frameStyle = this.data.frameStyle;
+      let client = app.globalData.client;
+      // 减去状态栏
+      let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+      // 是否减去底部菜单
+      if (frameStyle.useBar) infoHeight = infoHeight - 50;
+      if (infoHeight) this.setData({ infoHeight: infoHeight })
+   },
+
+   /**
+    * 生命周期函数--监听页面初次渲染完成
+    */
+   onReady: function () {
+
+   },
+
+   /**
+    * 生命周期函数--监听页面显示
+    */
+   onShow: function () {
+      this.onLoad()
+   },
+
+   /**
+    * 生命周期函数--监听页面隐藏
+    */
+   onHide: function () {
+
+   },
+
+   /**
+    * 生命周期函数--监听页面卸载
+    */
+   onUnload: function () {
+
+   },
+
+   /**
+    * 页面相关事件处理函数--监听用户下拉动作
+    */
+   onPullDownRefresh: function () {
+
+   },
+
+   /**
+    * 页面上拉触底事件的处理函数
+    */
+   onReachBottom: function () {
+
+   },
+
+   /**
+    * 用户点击右上角分享
+    */
+   onShareAppMessage: function () {
+
+   }
+})

+ 6 - 0
pages/market/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "mobile-main": "/commpents/mobile-frame/mobile-main"
+  }
+}

+ 95 - 0
pages/market/index.less

@@ -0,0 +1,95 @@
+.main {
+   position: relative;
+   width: 100%;
+
+   .one {
+      position: relative;
+      width: 100%;
+      text-align: center;
+      border-bottom: 1px dashed #000000;
+
+      button {
+         margin: 10px;
+      }
+   }
+
+   .two {
+      position: relative;
+      padding: 10px;
+
+      .list {
+         float: left;
+         width: 100%;
+         margin: 0 0 8px 0;
+         background-color: #f9f9f9;
+         border-radius: 5px;
+         padding: 8px 0;
+
+         .name {
+            font-size: 16px;
+            margin: 0 0 5px 0;
+            padding: 0 10px;
+         }
+
+         .other {
+            .otherInfo {
+               margin: 0 0 5px 0;
+               font-size: 14px;
+               color: #666666;
+               padding: 0 10px;
+
+               text {
+                  color: #000000;
+               }
+            }
+         }
+
+         .btn {
+            text-align: center;
+
+            button {
+               margin: 0 5px;
+            }
+         }
+      }
+   }
+}
+
+
+.dialog {
+   min-height: 30px;
+   max-height: 320px;
+   overflow-y: auto;
+   padding: 0 8px;
+
+   .dialog_1 {
+      .content {
+         position: relative;
+         padding: 8px 0;
+         border-radius: 6px;
+         margin: 0 0 5px 0;
+         background-color: #f1f1f1;
+
+         .left {
+            float: left;
+            margin: 0 10px;
+
+            text {
+               font-size: 14px;
+               color: #666666;
+            }
+         }
+
+         .right {
+            input {
+               font-size: 12px;
+            }
+         }
+      }
+   }
+}
+
+.van-dialog__header {
+   padding-top: 0 !important;
+   padding: 10px 0 !important;
+}

+ 56 - 0
pages/market/index.wxml

@@ -0,0 +1,56 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+  <view slot="info" class="main" style="height:{{infoHeight}}px;">
+    <view class="one">
+      <button type="primary" size="mini" bindtap="toAdd">添加商品</button>
+    </view>
+    <view class="two">
+      <view class="list" wx:key="item" wx:for="{{list}}">
+        <view class="name">{{item.name}}</view>
+        <view class="other">
+          <view class="otherInfo textOver">商品类型:<text>{{item.type_name||'暂无' }}</text></view>
+          <view class="otherInfo textOver">商品价格:<text style="color: #ff0000;">{{item.money||'暂无' }}¥</text></view>
+          <view class="otherInfo textOver">商品状态:<text>{{item.status=='0'?'待上架':item.status=='1'?'已上架':item.status=='2'?'已下架':'暂无' }}</text></view>
+        </view>
+        <view class="btn">
+          <button type="info" size="mini" bindtap="toView" data-item="{{item}}" data-id="{{item.id}}">详细信息</button>
+          <button type="primary" size="mini" bindtap="toCheck" data-id="{{item.id}}" data-status="{{item.status}}">{{item.status=='0'?'上架':item.status=='1'?'下架':item.status=='2'?'重新上架':'暂无'}}</button>
+        </view>
+      </view>
+    </view>
+  </view>
+</mobile-main>
+<van-dialog use-slot title="{{dialog.title}}" show="{{ dialog.show }}" confirmButtonText="返回">
+  <view class="dialog">
+    <view wx:if="{{dialog.type=='1'}}" class="dialog_1">
+      <form>
+        <view class="content">
+          <view class="right">
+            <swiper indicator-dots='true' autoplay='true' interval='2000' duration='1000' circular='true'>
+              <block wx:for="{{info.img_url}}" wx:key="item">
+                <swiper-item>
+                  <image src='{{item.url}}' mode='aspectFill'></image>
+                </swiper-item>
+              </block>
+            </swiper>
+          </view>
+        </view>
+        <view class="content">
+          <view class="left"><text>商品名称:</text></view>
+          <view class="right">{{info.name||'暂无'}}</view>
+        </view>
+        <view class="content">
+          <view class="left"><text>商品类型:</text></view>
+          <view class="right">{{info.type_name||'暂无'}}</view>
+        </view>
+        <view class="content">
+          <view class="left"><text>商品单价:</text></view>
+          <view class="right">{{info.money||'暂无'}}¥</view>
+        </view>
+        <view class="content">
+          <view class="left"><text>商品简介:</text></view>
+          <view class="right">{{info.brief||'暂无'}}</view>
+        </view>
+      </form>
+    </view>
+  </view>
+</van-dialog>

+ 73 - 0
pages/market/index.wxss

@@ -0,0 +1,73 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+.main .one {
+  position: relative;
+  width: 100%;
+  text-align: center;
+  border-bottom: 1px dashed #000000;
+}
+.main .one button {
+  margin: 10px;
+}
+.main .two {
+  position: relative;
+  padding: 10px;
+}
+.main .two .list {
+  float: left;
+  width: 100%;
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+}
+.main .two .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.main .two .list .other .otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.main .two .list .other .otherInfo text {
+  color: #000000;
+}
+.main .two .list .btn {
+  text-align: center;
+}
+.main .two .list .btn button {
+  margin: 0 5px;
+}
+.dialog {
+  min-height: 30px;
+  max-height: 320px;
+  overflow-y: auto;
+  padding: 0 8px;
+}
+.dialog .dialog_1 .content {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_1 .content .left {
+  float: left;
+  margin: 0 10px;
+}
+.dialog .dialog_1 .content .left text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_1 .content .right input {
+  font-size: 12px;
+}
+.van-dialog__header {
+  padding-top: 0 !important;
+  padding: 10px 0 !important;
+}

+ 170 - 0
pages/market_buy/detail.js

@@ -0,0 +1,170 @@
+// pages/market_buy/detail.js
+const app = getApp();
+Page({
+
+ /**
+  * 页面的初始数据
+  */
+ data: {
+  frameStyle: { useTop: true, name: '信息管理', leftArrow: true, useBar: false },
+  // 主体高度
+  infoHeight: '',
+  userInfo: { user_id: '00038494480001', name: '123', phone: '1239999999' },
+  // 上架的商品
+  marketList: [
+   { id: '001', name: '喜羊羊', money: '22', type_name: '羊肉', type_id: '111', brief: '一份', mech_id: '000000001', mech_name: '羊村' },
+   { id: '002', name: '美羊羊', money: '23', type_name: '羊肉', type_id: '222', brief: '一份', mech_id: '000000001', mech_name: '羊村' },
+   { id: '003', name: '懒羊羊', money: '24', type_name: '羊肉', type_id: '333', brief: '一份', mech_id: '000000001', mech_name: '羊村' },
+   { id: '004', name: '沸羊羊', money: '25', type_name: '羊肉', type_id: '444', brief: '一份', mech_id: '000000001', mech_name: '羊村' },
+   { id: '005', name: '慢羊羊', money: '26', type_name: '羊肉', type_id: '555', brief: '一份', mech_id: '000000001', mech_name: '羊村' },
+   { id: '006', name: '暖羊羊', money: '27', type_name: '羊肉', type_id: '666', brief: '一份', mech_id: '000000001', mech_name: '羊村' }
+  ],
+  // 类型
+  typeList: [],
+  // 详细信息
+  info: {},
+  // 弹框
+  dialog: { title: '详细信息', show: false, type: '1' },
+  // 选购
+  formList: [],
+  list: [],
+  // 收货信息
+  receiveForm: {}
+ },
+ back: function () {
+  wx.navigateBack({ url: '/pages/home/index' })
+ },
+ // 详细信息
+ toView: function (e) {
+  let item = e.currentTarget.dataset.item;
+  this.setData({ info: item })
+  this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+ },
+ // 添加
+ toPlus: function (e) {
+  let p1 = this.data.formList;
+  // console.log(this.data.formList);
+  // 商品
+  let { item } = e.currentTarget.dataset;
+  // console.log(e.currentTarget.dataset);
+  let data = { user_id: this.data.userInfo.id, user_name: this.data.userInfo.name, user_phone: this.data.userInfo.phone, order: [] };
+  // 查询是否已有订单
+  if (p1.length > 0) {
+   // 查询供货单位是否已经加入商品
+   let p2 = p1.find(i => i.mech_id == item.mech_id);
+   if (p2) {
+    // 查找该商品是否已经加入订单
+    let p3 = p2.order.find(i => i.id == item.id);
+    if (p3) {
+     p3.num = p3.num + 1;
+     p2.money = p2.money + p3.money;
+    }
+    else {
+     item.num = 1; p2.money = p2.money + item.money; p2.order.push(item);
+    }
+   } else {
+    item.num = 1; data.mech_id = item.mech_id; data.mech_name = item.mech_name; data.money = item.money * item.num; data.order.push(item); p1.push(data);
+   }
+  } else {
+   item.num = 1; data.mech_id = item.mech_id; data.mech_name = item.mech_name; data.money = item.money * item.num; data.order.push(item); p1.push(data);
+  }
+ },
+ // 減少
+ toMinus: function (e) {
+  let p1 = this.data.formList;
+  // 商品
+  let { item } = e.currentTarget.dataset;
+  let p2 = p1.find(i => i.mech_id == item.mech_id);
+  if (p2) {
+   p2.money = p2.money - item.money;
+   if (p2 && p2.money === 0) {
+    // 获取索引值,删除指定无商品商家信息
+    var key = p1.indexOf(p2.mech_id);
+    p1.splice(key, 1);
+   } else {
+    let p3 = p2.order.find(i => i.id == item.id);
+    if (p3) p3.num = p3.num - 1;
+    if (p3 && p3.num === 0) p3 = {};
+   }
+  }
+ },
+ // 查看选购
+ toBuy: function () {
+  this.setData({ list: this.data.formList })
+  this.setData({ dialog: { title: '查看选购', show: true, type: '2' } })
+ },
+ // 确认选购
+ toConfirm: function () {
+  this.setData({ dialog: { title: '收货信息', show: true, type: '3' } })
+ },
+ // 提交订单
+ onSubmit: function (e) {
+  wx.showToast({ title: `采买发布成功`, icon: 'error', duration: 2000 });
+ },
+ /**
+  * 生命周期函数--监听页面加载
+  */
+ onLoad: function (options) {
+  // 计算高度
+  this.searchHeight();
+ },
+ // 计算高度
+ searchHeight: function () {
+  let frameStyle = this.data.frameStyle;
+  let client = app.globalData.client;
+  // 减去状态栏
+  let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+  // 是否减去底部菜单
+  if (frameStyle.useBar) infoHeight = infoHeight - 50;
+  if (infoHeight) this.setData({ infoHeight: infoHeight })
+ },
+
+ /**
+  * 生命周期函数--监听页面初次渲染完成
+  */
+ onReady: function () {
+
+ },
+
+ /**
+  * 生命周期函数--监听页面显示
+  */
+ onShow: function () {
+
+ },
+
+ /**
+  * 生命周期函数--监听页面隐藏
+  */
+ onHide: function () {
+
+ },
+
+ /**
+  * 生命周期函数--监听页面卸载
+  */
+ onUnload: function () {
+
+ },
+
+ /**
+  * 页面相关事件处理函数--监听用户下拉动作
+  */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+  * 页面上拉触底事件的处理函数
+  */
+ onReachBottom: function () {
+
+ },
+
+ /**
+  * 用户点击右上角分享
+  */
+ onShareAppMessage: function () {
+
+ }
+})

+ 6 - 0
pages/market_buy/detail.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+   "mobile-main": "/commpents/mobile-frame/mobile-main"
+  }
+ }

+ 207 - 0
pages/market_buy/detail.less

@@ -0,0 +1,207 @@
+.main {
+ position: relative;
+ width: 100%;
+
+ .one {
+  position: relative;
+  overflow-y: auto;
+  padding: 10px 0;
+
+  .list {
+   float: left;
+   width: 47%;
+   background-color: #ffffff;
+   margin: 0 0 8px 8px;
+   border-radius: 10px;
+
+   .images {
+    width: 100%;
+    height: 160px;
+    overflow: hidden;
+    border-bottom: 1px solid #f1f1f1;
+    border-top-left-radius: 10px;
+    border-top-right-radius: 10px;
+   }
+
+   .info {
+    position: relative;
+    padding: 0 5px 5px 5px;
+
+    .name {
+     font-size: 14px;
+     margin: 0 0 2px 0;
+    }
+
+    .money {
+     font-size: 12px;
+     font-weight: bold;
+     color: #ff0000;
+     margin: 0 0 2px 0;
+    }
+
+    .btn {
+     text-align: center;
+    }
+   }
+  }
+ }
+
+ .two {
+  position: absolute;
+  width: 100%;
+  bottom: 0;
+  height: 50px;
+  z-index: 999;
+  background-color: #ffffff;
+  border-top: 1px solid #f1f1f1;
+  text-align: center;
+
+  button {
+   margin: 10px;
+  }
+ }
+}
+
+.dialog {
+ min-height: 30px;
+ max-height: 320px;
+ overflow-y: auto;
+ padding: 0 8px;
+}
+
+.dialog .dialog_1 .content {
+ position: relative;
+ padding: 8px 0;
+ border-radius: 6px;
+ margin: 0 0 5px 0;
+ background-color: #f1f1f1;
+}
+
+.dialog .dialog_1 .content .left {
+ float: left;
+ margin: 0 0 0 10px;
+}
+
+.dialog .dialog_1 .content .left text {
+ font-size: 14px;
+ color: #666666;
+}
+
+.dialog .dialog_1 .content .right input {
+ font-size: 12px;
+}
+
+.dialog .dialog_2 {
+ position: relative;
+}
+
+.dialog .dialog_2 .list {
+ float: left;
+ width: 100%;
+ margin: 0 0 8px 0;
+ background-color: #f9f9f9;
+ border-radius: 5px;
+ padding: 8px 0;
+ box-shadow: 0 0 5px #cccccc;
+}
+
+.dialog .dialog_2 .list .name {
+ font-size: 16px;
+ margin: 0 0 5px 0;
+ padding: 0 10px;
+}
+
+.dialog .dialog_2 .list .list_other .list_otherInfo {
+ margin: 0 0 5px 0;
+ font-size: 14px;
+ color: #666666;
+ padding: 0 10px;
+}
+
+.dialog .dialog_2 .list .list_other .list_otherInfo text {
+ color: #000000;
+}
+
+.dialog .dialog_2 .list .order {
+ position: relative;
+ padding: 0 10px;
+}
+
+.dialog .dialog_2 .list .order .order_name {
+ position: relative;
+ text-align: center;
+ margin: 4px 0;
+}
+
+.dialog .dialog_2 .list .order .order_name text {
+ padding: 5px 10px;
+ background-color: #409eff;
+ color: #fff;
+ font-size: 14px;
+}
+
+.dialog .dialog_2 .list .order .orderList {
+ float: left;
+ width: 100%;
+ margin: 0 0 10px 0;
+ background-color: #ffffff;
+ border-radius: 5px;
+ padding: 8px 0;
+ box-shadow: 0 0 5px #cccccc;
+}
+
+.dialog .dialog_2 .list .order .orderList .orderList_name {
+ font-size: 16px;
+ margin: 0 0 5px 0;
+ padding: 0 10px;
+}
+
+.dialog .dialog_2 .list .order .orderList .order_otherInfo {
+ margin: 0 0 5px 0;
+ font-size: 14px;
+ color: #666666;
+ padding: 0 10px;
+}
+
+.dialog .dialog_2 .list .order .orderList .order_otherInfo text {
+ color: #000000;
+}
+
+.dialog .dialog_3 {
+ position: relative;
+ padding: 5px 0 0 0;
+}
+
+.dialog .dialog_3 .content {
+ position: relative;
+ padding: 10px 0;
+ box-shadow: 0 0 5px #000000;
+ margin: 0 0 10px 0;
+ border-radius: 5px;
+}
+
+.dialog .dialog_3 .content .left {
+ float: left;
+ margin: 0 10px;
+}
+
+.dialog .dialog_3 .content .left .icon {
+ color: #000000;
+}
+
+.dialog .dialog_3 .content .right input {
+ color: #000000;
+}
+
+.dialog .dialog_3 .save {
+ text-align: center;
+}
+
+.dialog .dialog_3 .save button {
+ margin: 10px;
+}
+
+.van-dialog__header {
+ padding-top: 0 !important;
+ padding: 10px 0 !important;
+}

+ 103 - 0
pages/market_buy/detail.wxml

@@ -0,0 +1,103 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+ <view slot="info" class="main" style="height:{{infoHeight}}px;">
+  <view class="one" style="height:{{infoHeight-60}}px;">
+   <view class="list" wx:key="item" wx:for="{{marketList}}">
+    <image class="images" src='{{item.img_one}}' bindtap="toView" data-item="{{item}}" data-id="{{item.id}}"></image>
+    <view class="info">
+     <view class="name textOver">{{item.name}}</view>
+     <view class="money"><text style="vertical-align: sub;">¥</text>{{item.money}}</view>
+     <view class="btn">
+      <van-stepper v-model="item.num" theme="round" button-size="25" disable-input min='0' data-item="{{item}}" bind:plus="toPlus" bind:minus="toMinus" long-press="{{false}}" />
+     </view>
+    </view>
+   </view>
+  </view>
+  <view class="two">
+   <button type="primary" size="mini" bindtap="toBuy">查看选购</button>
+   <button type="primary" size="mini" bindtap="toConfirm">确认选购</button>
+  </view>
+ </view>
+</mobile-main>
+<van-dialog use-slot title="{{dialog.title}}" show="{{ dialog.show }}" confirmButtonText="返回">
+ <view class="dialog">
+  <view wx:if="{{dialog.type=='1'}}" class="dialog_1">
+   <form>
+    <view class="content">
+     <view class="right">
+      <swiper indicator-dots='true' autoplay='true' interval='2000' duration='1000' circular='true'>
+       <block wx:for="{{info.img_url}}" wx:key="item">
+        <swiper-item>
+         <image src='{{item.url}}' mode='aspectFill'></image>
+        </swiper-item>
+       </block>
+      </swiper>
+     </view>
+    </view>
+    <view class="content">
+     <view class="left"><text>商品名称:</text></view>
+     <view class="right">{{info.name||'暂无'}}</view>
+    </view>
+    <view class="content">
+     <view class="left"><text>商品类型:</text></view>
+     <view class="right">{{info.type_name||'暂无'}}</view>
+    </view>
+    <view class="content">
+     <view class="left"><text>商品单价(元):</text></view>
+     <view class="right" style="color: #ff0000;">{{info.money||'暂无'}}</view>
+    </view>
+    <view class="content">
+     <view class="left"><text>商品简介:</text></view>
+     <view class="right">{{info.brief||'暂无'}}</view>
+    </view>
+   </form>
+  </view>
+  <view wx:if="{{dialog.type=='2'}}" class="dialog_2">
+   <view class="list" wx:key="item" wx:for="{{list}}">
+    <view class="list_other">
+     <view class="list_otherInfo textOver">供货单位:<text>{{item.mech_name }}</text></view>
+     <view class="list_otherInfo textOver">选购总价:<text style="color: #ff0000;">{{item.money }}¥</text></view>
+    </view>
+    <view class="order">
+     <view class="orderList" wx:key="tag" wx:for="{{item.order}}">
+      <view class="orderList_name">{{item.name}}</view>
+      <view class="order_other">
+       <view class="order_otherInfo textOver">选购数量:<text>{{item.num }}</text></view>
+       <view class="order_otherInfo textOver">商品单价:<text style="color: #ff0000;">{{item.money }}¥</text></view>
+      </view>
+     </view>
+    </view>
+   </view>
+  </view>
+  <view wx:if="{{dialog.type=='3'}}" class="dialog_3">
+   <form bindsubmit="onSubmit">
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-xingming"></text>
+     </view>
+     <view class="right">
+      <input name="receive_user_name" value="{{receiveForm.receive_user_name}}" placeholder='请输入收货人' placeholder-class="placeholder"></input>
+     </view>
+    </view>
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-dianhua"></text>
+     </view>
+     <view class="right">
+      <input name="receive_user_phone" value="{{receiveForm.receive_user_phone}}" type="number" maxlength="11" placeholder='请输入收货电话' placeholder-class="placeholder"></input>
+     </view>
+    </view>
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-dizhi"></text>
+     </view>
+     <view class="right">
+      <input name="receive_address" value="{{receiveForm.receive_address}}" placeholder='请输入收货地址' placeholder-class="placeholder"></input>
+     </view>
+    </view>
+    <view class="save">
+     <button type="primary" size="mini" formType="submit">提交订单</button>
+    </view>
+   </form>
+  </view>
+ </view>
+</van-dialog>

+ 173 - 0
pages/market_buy/detail.wxss

@@ -0,0 +1,173 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+.main .one {
+  position: relative;
+  overflow-y: auto;
+  padding: 10px 0;
+}
+.main .one .list {
+  float: left;
+  width: 47%;
+  background-color: #ffffff;
+  margin: 0 0 8px 8px;
+  border-radius: 10px;
+}
+.main .one .list .images {
+  width: 100%;
+  height: 160px;
+  overflow: hidden;
+  border-bottom: 1px solid #f1f1f1;
+  border-top-left-radius: 10px;
+  border-top-right-radius: 10px;
+}
+.main .one .list .info {
+  position: relative;
+  padding: 0 5px 5px 5px;
+}
+.main .one .list .info .name {
+  font-size: 14px;
+  margin: 0 0 2px 0;
+}
+.main .one .list .info .money {
+  font-size: 12px;
+  font-weight: bold;
+  color: #ff0000;
+  margin: 0 0 2px 0;
+}
+.main .one .list .info .btn {
+  text-align: center;
+}
+.main .two {
+  position: absolute;
+  width: 100%;
+  bottom: 0;
+  height: 50px;
+  z-index: 999;
+  background-color: #ffffff;
+  border-top: 1px solid #f1f1f1;
+  text-align: center;
+}
+.main .two button {
+  margin: 10px;
+}
+.dialog {
+  min-height: 30px;
+  max-height: 320px;
+  overflow-y: auto;
+  padding: 0 8px;
+}
+.dialog .dialog_1 .content {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_1 .content .left {
+  float: left;
+  margin: 0 0 0 10px;
+}
+.dialog .dialog_1 .content .left text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_1 .content .right input {
+  font-size: 12px;
+}
+.dialog .dialog_2 {
+  position: relative;
+}
+.dialog .dialog_2 .list {
+  float: left;
+  width: 100%;
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+  box-shadow: 0 0 5px #cccccc;
+}
+.dialog .dialog_2 .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.dialog .dialog_2 .list .list_other .list_otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.dialog .dialog_2 .list .list_other .list_otherInfo text {
+  color: #000000;
+}
+.dialog .dialog_2 .list .order {
+  position: relative;
+  padding: 0 10px;
+}
+.dialog .dialog_2 .list .order .order_name {
+  position: relative;
+  text-align: center;
+  margin: 4px 0;
+}
+.dialog .dialog_2 .list .order .order_name text {
+  padding: 5px 10px;
+  background-color: #409eff;
+  color: #fff;
+  font-size: 14px;
+}
+.dialog .dialog_2 .list .order .orderList {
+  float: left;
+  width: 100%;
+  margin: 0 0 10px 0;
+  background-color: #ffffff;
+  border-radius: 5px;
+  padding: 8px 0;
+  box-shadow: 0 0 5px #cccccc;
+}
+.dialog .dialog_2 .list .order .orderList .orderList_name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.dialog .dialog_2 .list .order .orderList .order_otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.dialog .dialog_2 .list .order .orderList .order_otherInfo text {
+  color: #000000;
+}
+.dialog .dialog_3 {
+  position: relative;
+  padding: 5px 0 0 0;
+}
+.dialog .dialog_3 .content {
+  position: relative;
+  padding: 10px 0;
+  box-shadow: 0 0 5px #000000;
+  margin: 0 0 10px 0;
+  border-radius: 5px;
+}
+.dialog .dialog_3 .content .left {
+  float: left;
+  margin: 0 10px;
+}
+.dialog .dialog_3 .content .left .icon {
+  color: #000000;
+}
+.dialog .dialog_3 .content .right input {
+  color: #000000;
+}
+.dialog .dialog_3 .save {
+  text-align: center;
+}
+.dialog .dialog_3 .save button {
+  margin: 10px;
+}
+.van-dialog__header {
+  padding-top: 0 !important;
+  padding: 10px 0 !important;
+}

+ 141 - 0
pages/market_buy/index.js

@@ -0,0 +1,141 @@
+// pages/market_buy/index.js
+const { buy_status } = require('../../utils/dict');
+const app = getApp();
+Page({
+
+ /**
+  * 页面的初始数据
+  */
+ data: {
+  frameStyle: { useTop: true, name: '采买需求信息', leftArrow: true, useBar: false },
+  // 主体高度
+  infoHeight: '',
+  // 采买列表
+  list: [{ order_num: 'Hgj4757945hdFueu', receive_user_name: '胡图图', mech_name: '翻斗幼儿园-小豆班', status_name: '待供货单位确认', status: '1', user_name: '采购人员', user_phone: '12345678901', money: '3344', receive_user_phone: '98765432109', receive_address: '翻斗大街翻斗花园2号楼1001室', order: [{ name: '小洋人', num: '123', money: '3000' }, { name: '娃哈哈', num: '123', money: '344' }] }],
+  // 弹框
+  dialog: { title: '详细信息', show: false, type: '1' },
+  // 详细信息
+  info: {},
+  // 导出条件
+  exportForm: {},
+  // 商品状态
+  statusList: buy_status
+ },
+ back: function () {
+  wx.navigateBack({ url: '/pages/home/index' })
+ },
+ // 导出条件
+ export_term: function () {
+  this.setData({ dialog: { title: '导出条件', show: true, type: '2' }, })
+ },
+ // 选择状态
+ statusChange: function (e) {
+  let { value } = e.detail;
+  if (value) {
+   let data = this.data.statusList[value];
+   this.setData({ 'exportForm.status': data.value })
+  }
+ },
+ // 开始时间
+ startChange: function (e) {
+  let { value } = e.detail;
+  this.setData({ 'exportForm.apply_date@start': value })
+ },
+ // 结束时间
+ endChange: function (e) {
+  let { value } = e.detail;
+  this.setData({ 'exportForm.apply_date@end': value })
+ },
+ // 重置条件
+ expertReset: function (e) {
+  this.setData({ exportForm: { user_name: '', mech_name: '', receive_user_name: '', status: null } })
+ },
+ // 确认导出
+ exportSubmit: function (e) {
+  console.log(e.detail.value);
+  console.log('打开文档成功')
+ },
+ // 添加采购申请
+ toAdd: function () {
+  wx.navigateTo({ url: `/pages/market_buy/detail` })
+ },
+ // 详细信息
+ toView: function (e) {
+  let item = e.currentTarget.dataset.item;
+  this.setData({ info: item })
+  this.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+ },
+ // 订单签收
+ toSign: function (e) {
+  wx.showToast({ title: `订单签收完成`, icon: 'success', duration: 2000 })
+ },
+ /**
+  * 生命周期函数--监听页面加载
+  */
+ onLoad: function (options) {
+  // 计算高度
+  this.searchHeight();
+ },
+ search: function (data) {
+
+ },
+ // 计算高度
+ searchHeight: function () {
+  let frameStyle = this.data.frameStyle;
+  let client = app.globalData.client;
+  // 减去状态栏
+  let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+  // 是否减去底部菜单
+  if (frameStyle.useBar) infoHeight = infoHeight - 50;
+  if (infoHeight) this.setData({ infoHeight: infoHeight })
+ },
+
+ /**
+  * 生命周期函数--监听页面初次渲染完成
+  */
+ onReady: function () {
+
+ },
+
+ /**
+  * 生命周期函数--监听页面显示
+  */
+ onShow: function () {
+  this.search();
+ },
+
+ /**
+  * 生命周期函数--监听页面隐藏
+  */
+ onHide: function () {
+
+ },
+
+ /**
+  * 生命周期函数--监听页面卸载
+  */
+ onUnload: function () {
+
+ },
+
+ /**
+  * 页面相关事件处理函数--监听用户下拉动作
+  */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+  * 页面上拉触底事件的处理函数
+  */
+ onReachBottom: function () {
+
+ },
+
+ /**
+  * 用户点击右上角分享
+  */
+ onShareAppMessage: function () {
+
+ }
+})

+ 6 - 0
pages/market_buy/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+   "mobile-main": "/commpents/mobile-frame/mobile-main"
+  }
+ }

+ 171 - 0
pages/market_buy/index.less

@@ -0,0 +1,171 @@
+.main {
+ position: relative;
+ width: 100%;
+
+ .one {
+  position: relative;
+  width: 100%;
+  text-align: center;
+  border-bottom: 1px dashed #000000;
+
+  button {
+   margin: 10px;
+  }
+ }
+
+ .two {
+  position: relative;
+  padding: 10px;
+
+  .list {
+   float: left;
+   width: 100%;
+   margin: 0 0 8px 0;
+   background-color: #f9f9f9;
+   border-radius: 5px;
+   padding: 8px 0;
+
+   .name {
+    font-size: 16px;
+    margin: 0 0 5px 0;
+    padding: 0 10px;
+    font-weight: bold;
+
+
+   }
+
+   .other {
+    .otherInfo {
+     margin: 0 0 5px 0;
+     font-size: 14px;
+     color: #666666;
+     padding: 0 10px;
+
+     text {
+      color: #000000;
+     }
+    }
+   }
+
+   .btn {
+    text-align: center;
+
+    button {
+     margin: 0 5px;
+    }
+   }
+  }
+ }
+}
+
+.dialog {
+ min-height: 30px;
+ max-height: 320px;
+ overflow-y: auto;
+ padding: 0 8px;
+}
+
+.dialog .dialog_1 .content {
+ position: relative;
+ padding: 8px 0;
+ border-radius: 6px;
+ margin: 0 0 5px 0;
+ background-color: #f1f1f1;
+}
+
+.dialog .dialog_1 .content .left {
+ float: left;
+ margin: 0 0 0 10px;
+}
+
+.dialog .dialog_1 .content .left text {
+ font-size: 14px;
+ color: #666666;
+}
+
+.dialog .dialog_1 .content .right input {
+ font-size: 12px;
+}
+
+.dialog .dialog_1 .order {
+ position: relative;
+ padding: 8px 0;
+ border-radius: 6px;
+ margin: 0 0 5px 0;
+ background-color: #f1f1f1;
+}
+
+.dialog .dialog_1 .order .order_1 {
+ position: relative;
+ margin: 0 10px;
+}
+
+.dialog .dialog_1 .order .order_1 text {
+ font-size: 14px;
+ color: #666666;
+}
+
+.dialog .dialog_1 .order .order_2 {
+ position: relative;
+ padding: 0 5px;
+ margin: 5px 0 0 0;
+}
+
+.dialog .dialog_1 .order .order_2 .list {
+ margin: 0 0 8px 0;
+ background-color: #f9f9f9;
+ border-radius: 5px;
+ padding: 8px 0;
+}
+
+.dialog .dialog_1 .order .order_2 .list .name {
+ font-size: 16px;
+ margin: 0 0 5px 0;
+ padding: 0 10px;
+}
+
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo {
+ margin: 0 0 5px 0;
+ font-size: 14px;
+ color: #666666;
+ padding: 0 10px;
+}
+
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo text {
+ color: #000000;
+}
+
+.dialog .dialog_2 .content {
+ position: relative;
+ padding: 8px 0;
+ border-radius: 6px;
+ margin: 0 0 5px 0;
+ background-color: #f1f1f1;
+}
+
+.dialog .dialog_2 .content .left {
+ float: left;
+ margin: 0 10px;
+}
+
+.dialog .dialog_2 .content .left text {
+ font-size: 14px;
+ color: #666666;
+}
+
+.dialog .dialog_2 .content .right input {
+ font-size: 12px;
+}
+
+.dialog .dialog_2 .save {
+ text-align: center;
+}
+
+.dialog .dialog_2 .save button {
+ margin: 10px;
+}
+
+.van-dialog__header {
+ padding-top: 0 !important;
+ padding: 10px 0 !important;
+}

+ 136 - 0
pages/market_buy/index.wxml

@@ -0,0 +1,136 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+ <view slot="info" class="main" style="height:{{infoHeight}}px;">
+  <view class="one">
+   <button type="primary" size="mini" bindtap="toAdd">添加采购申请</button>
+   <button type="primary" size="mini" bindtap="export_term">导出数据</button>
+  </view>
+  <view class="two">
+   <view class="list" wx:key="item" wx:for="{{list}}">
+    <view class="name">{{item.order_num}}</view>
+    <view class="other">
+     <view class="otherInfo textOver">收货人:<text>{{item.receive_user_name }}</text></view>
+     <view class="otherInfo textOver">供货单位:<text>{{item.mech_name }}</text></view>
+     <view class="otherInfo textOver">货物状态:<text>{{item.status_name }}</text></view>
+    </view>
+    <view class="btn">
+     <button type="info" size="mini" bindtap="toView" data-item="{{item}}" data-id="{{item.id}}">详细信息</button>
+     <button type="primary" size="mini" bindtap="toSign" data-id="{{item.id}}" wx:if="{{item.status=='1'}}">订单签收</button>
+    </view>
+   </view>
+  </view>
+ </view>
+</mobile-main>
+<van-dialog use-slot title="{{dialog.title}}" show="{{ dialog.show }}" confirmButtonText="返回">
+ <view class="dialog">
+  <view wx:if="{{dialog.type=='1'}}" class="dialog_1">
+   <form>
+    <view class="content">
+     <view class="left"><text>订单号:</text></view>
+     <view class="right"><input name="order_num" value="{{info.order_num}}" disabled></input></view>
+    </view>
+    <view class="content">
+     <view class="left"><text>采买人:</text></view>
+     <view class="right"><input name="user_name" value="{{info.user_name}}" disabled></input></view>
+    </view>
+    <view class="content">
+     <view class="left"><text>采买人电话:</text></view>
+     <view class="right"><input name="user_phone" value="{{info.user_phone}}" disabled></input></view>
+    </view>
+    <view class="content">
+     <view class="left"><text>供货单位:</text></view>
+     <view class="right"><input name="mech_name" value="{{info.mech_name}}" disabled></input></view>
+    </view>
+    <view class="content">
+     <view class="left"><text>供货总价(元):</text></view>
+     <view class="right" style="color: #ff0000;font-weight: bold;"><input name="money" value="{{info.money}}" disabled></input></view>
+    </view>
+    <view class="content">
+     <view class="left"><text>收货人:</text></view>
+     <view class="right"><input name="receive_user_name" value="{{info.receive_user_name}}" disabled></input></view>
+    </view>
+    <view class="content">
+     <view class="left"><text>收货人电话:</text></view>
+     <view class="right"><input name="receive_user_phone" value="{{info.receive_user_phone}}" disabled></input></view>
+    </view>
+    <view class="content">
+     <view class="left"><text>收货地址:</text></view>
+     <view class="right"><input name="receive_address" value="{{info.receive_address}}" disabled></input></view>
+    </view>
+    <view class="order">
+     <view class="order_1"><text>商品列表:</text></view>
+     <view class="order_2">
+      <view class="list" wx:key="item" wx:for="{{info.order}}">
+       <view class="name">{{item.name}}</view>
+       <view class="other">
+        <view class="otherInfo">购买数量:<text>{{item.num||'暂无' }}</text></view>
+        <view class="otherInfo">商品单价:<text>{{item.money||'暂无' }}</text></view>
+       </view>
+      </view>
+     </view>
+    </view>
+   </form>
+  </view>
+  <view wx:if="{{dialog.type=='2'}}" class="dialog_2">
+   <form bindsubmit="exportSubmit" catchreset="expertReset">
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-xingming1"></text>
+     </view>
+     <view class="right">
+      <input name="user_name" value="{{exportForm.user_name}}" placeholder='请输入采买人姓名' placeholder-class="placeholder"></input>
+     </view>
+    </view>
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-xingming1"></text>
+     </view>
+     <view class="right">
+      <input name="mech_name" value="{{exportForm.mech_name}}" placeholder='请输入供货单位' placeholder-class="placeholder"></input>
+     </view>
+    </view>
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-xingming1"></text>
+     </view>
+     <view class="right">
+      <input name="receive_user_name" value="{{exportForm.receive_user_name}}" placeholder='请输入收货人姓名' placeholder-class="placeholder"></input>
+     </view>
+    </view>
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-zhuangtai"></text>
+     </view>
+     <view class="right">
+      <picker class="picker" bindchange="statusChange" name="status" value="{{twoorderForm.status}}" range="{{statusList}}" range-key="label">
+       <view>{{exportForm.status||'选择商品状态'}}</view>
+      </picker>
+     </view>
+    </view>
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-shijian"></text>
+     </view>
+     <view class="right">
+      <picker mode="date" name="apply_date@start" bindchange="startChange" value="{{exportForm['apply_date@start']}}">
+       <view>{{exportForm['apply_date@start']||'请选择开始时间'}}</view>
+      </picker>
+     </view>
+    </view>
+    <view class="content">
+     <view class="left">
+      <text class="icon iconfont icon-shijian"></text>
+     </view>
+     <view class="right">
+      <picker mode="date" name="apply_date@end" bindchange="endChange" value="{{exportForm['apply_date@end']}}">
+       <view>{{exportForm['apply_date@end']||'请选择开始时间'}}</view>
+      </picker>
+     </view>
+    </view>
+    <view class="save">
+     <button type="warn" size="mini" formType="reset">重置条件</button>
+     <button type="primary" size="mini" formType="submit">确认导出</button>
+    </view>
+   </form>
+  </view>
+ </view>
+</van-dialog>

+ 138 - 0
pages/market_buy/index.wxss

@@ -0,0 +1,138 @@
+.main {
+  position: relative;
+  width: 100%;
+}
+.main .one {
+  position: relative;
+  width: 100%;
+  text-align: center;
+  border-bottom: 1px dashed #000000;
+}
+.main .one button {
+  margin: 10px;
+}
+.main .two {
+  position: relative;
+  padding: 10px;
+}
+.main .two .list {
+  float: left;
+  width: 100%;
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+}
+.main .two .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+  font-weight: bold;
+}
+.main .two .list .other .otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.main .two .list .other .otherInfo text {
+  color: #000000;
+}
+.main .two .list .btn {
+  text-align: center;
+}
+.main .two .list .btn button {
+  margin: 0 5px;
+}
+.dialog {
+  min-height: 30px;
+  max-height: 320px;
+  overflow-y: auto;
+  padding: 0 8px;
+}
+.dialog .dialog_1 .content {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_1 .content .left {
+  float: left;
+  margin: 0 0 0 10px;
+}
+.dialog .dialog_1 .content .left text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_1 .content .right input {
+  font-size: 12px;
+}
+.dialog .dialog_1 .order {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_1 .order .order_1 {
+  position: relative;
+  margin: 0 10px;
+}
+.dialog .dialog_1 .order .order_1 text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_1 .order .order_2 {
+  position: relative;
+  padding: 0 5px;
+  margin: 5px 0 0 0;
+}
+.dialog .dialog_1 .order .order_2 .list {
+  margin: 0 0 8px 0;
+  background-color: #f9f9f9;
+  border-radius: 5px;
+  padding: 8px 0;
+}
+.dialog .dialog_1 .order .order_2 .list .name {
+  font-size: 16px;
+  margin: 0 0 5px 0;
+  padding: 0 10px;
+}
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo {
+  margin: 0 0 5px 0;
+  font-size: 14px;
+  color: #666666;
+  padding: 0 10px;
+}
+.dialog .dialog_1 .order .order_2 .list .other .otherInfo text {
+  color: #000000;
+}
+.dialog .dialog_2 .content {
+  position: relative;
+  padding: 8px 0;
+  border-radius: 6px;
+  margin: 0 0 5px 0;
+  background-color: #f1f1f1;
+}
+.dialog .dialog_2 .content .left {
+  float: left;
+  margin: 0 10px;
+}
+.dialog .dialog_2 .content .left text {
+  font-size: 14px;
+  color: #666666;
+}
+.dialog .dialog_2 .content .right input {
+  font-size: 12px;
+}
+.dialog .dialog_2 .save {
+  text-align: center;
+}
+.dialog .dialog_2 .save button {
+  margin: 10px;
+}
+.van-dialog__header {
+  padding-top: 0 !important;
+  padding: 10px 0 !important;
+}

+ 8 - 5
pages/user/detail.less

@@ -24,8 +24,10 @@
                 }
             }
 
-            .right input {
-                color: #000000;
+            .right {
+                input {
+                    color: #000000;
+                }
             }
         }
 
@@ -33,10 +35,11 @@
             float: left;
             width: 100%;
             text-align: center;
-        }
 
-        .save button {
-            margin: 10px;
+            button {
+                margin: 10px;
+            }
         }
+
     }
 }

+ 18 - 22
pages/user/index.less

@@ -7,10 +7,10 @@
         width: 100%;
         text-align: center;
         border-bottom: 1px dashed #000000;
-    }
 
-    .one button {
-        margin: 10px;
+        button {
+            margin: 10px;
+        }
     }
 
     .two {
@@ -38,20 +38,22 @@
                     font-size: 14px;
                     color: #666666;
                     padding: 0 10px;
-                }
 
-                .otherInfo text {
-                    color: #000000;
+                    text {
+                        color: #000000;
+                    }
                 }
+
             }
 
             .btn {
                 text-align: center;
-            }
 
-            .btn button {
-                margin: 2px 5px;
+                button {
+                    margin: 0 5px;
+                }
             }
+
         }
     }
 }
@@ -65,23 +67,17 @@
     .dialog_1 {
         .content {
             float: left;
-            width: 100%;
-            padding: 8px 0;
-            border-radius: 6px;
-            margin: 0 0 5px 0;
-            background-color: #f1f1f1;
-
-            .left {
-                float: left;
-                margin: 0 10px;
-            }
+            margin: 0 10px;
 
-            .left text {
+            text {
                 font-size: 14px;
                 color: #666666;
             }
+        }
+
 
-            .right input {
+        .right {
+            input {
                 font-size: 12px;
             }
         }
@@ -92,4 +88,4 @@
 .van-dialog__header {
     padding-top: 0 !important;
     padding: 10px 0 !important;
-}
+}