18016688350 před 4 roky
rodič
revize
5508c3b154

+ 5 - 2
pages/orderGoods/buy.js

@@ -113,13 +113,16 @@ Page({
   //   })
   // }
   reserve(){
-    console.log(this.data.sellProductList)
+    if(this.data.sellProductList.length==0){
+      util.toast('请选择订货商品')
+      return;
+    }
     var that = this;
     util.request(util.api.reserve, this.data.sellProductList, "post", false, true, app.globalData.token).then((res) => {
       if (res.code == 200) {
         util.toast('订货成功,等待平台审批')
         wx.navigateTo({
-          url: '/pages/stock/index',
+          url: '/pages/orderGoods/order',
         })
       }
     }).catch((res) => {})

+ 11 - 5
pages/stock/index.js

@@ -7,10 +7,9 @@ Page({
    */
   data: {
     storeList: [],
-    userInfo: app.globalData.userInfo,
+    userInfo: {},
     searchParams: {
-      storeId: '',
-      storeName: '',
+      agentName:''
     },
     stockList: []
   },
@@ -20,7 +19,11 @@ Page({
    */
   onLoad: function (options) {
     // this.bindStoreList()
-    this.bindProductStockList()
+    this.setData({
+      userInfo: app.globalData.userInfo,
+    })
+    console.log(this.data.userInfo)
+    this.bindProductStockList()    
   },
 
   bindStorePickerChange: function (e) {
@@ -88,7 +91,7 @@ Page({
     var that = this
    
     console.log( this.data.userInfo)
-    util.request(util.api.productStockList, null, "GET", true, true, app.globalData.token).then((res) => {
+    util.request(util.api.productStockList, this.data.searchParams, "GET", true, true, app.globalData.token).then((res) => {
       console.log(res)
       if (res.code == 200) {
         that.setData({
@@ -96,5 +99,8 @@ Page({
         })
       }
     }).catch((res) => {})
+  },
+  btnsearch(){
+    this.bindProductStockList()
   }
 })

+ 13 - 0
pages/stock/index.wxml

@@ -1,5 +1,18 @@
 <wxs src="../../utils/filter.wxs" module="filter"></wxs>
 <view class="container">
+  <!--screen-->
+  <view    wx:if="{{userInfo.mgvmRole!=3}}" class="tui-header-screen">
+    <view class="cu-bar search bg-white">
+      <view class="search-form round">
+        <text class="cuIcon-search"></text>
+        <input type="text" placeholder="输入代理名称" confirm-type="search" value="{{searchParams.agentName}}" data-name="searchParams.agentName" catchinput="inputedit" bindblur="inputedit"></input>
+      </view>
+      <view class="action"> 
+        <button class="cu-btn bg-blue shadow-blur round" bindtap="btnsearch">搜索</button>
+      </view>
+    </view>
+  </view>
+  <!--screen-->
 
   <form bindsubmit="formSubmit" bindreset="formReset">
     <!-- <picker bindchange="bindStorePickerChange" value="{{index}}" range="{{storeList}}" range-key="storeName">

+ 5 - 3
pages/vendingMachine/select.js

@@ -9,7 +9,8 @@ Page({
     searchParams: {
       pageNo: 1,
       pageSize: 10,
-      productName: ''
+      productName: '',
+      agentId:''
     },
     productList: [],
     loadding: false,
@@ -23,7 +24,8 @@ Page({
   onLoad: function (options) {
     let index = parseInt(options.index)
     this.setData({
-      index:index
+      index:index,
+      ['searchParams.agentId']:  options.agentId
     })
     this.bindProductList()
   },
@@ -112,7 +114,7 @@ Page({
   },
   bindProductList() {
     var that = this
-    util.request(util.api.MgVmProductSkuPage, that.data.searchParams, "GET", false, false, app.globalData.token).then((res) => {
+    util.request(util.api.mgVmStoreProductSkuList, that.data.searchParams, "GET", false, false, app.globalData.token).then((res) => {
       if (res.code == 200) {
         if (res.result.records.length > 0) {
           if (that.data.productList.length > 0) {

+ 3 - 2
pages/vendingMachine/select.wxml

@@ -23,8 +23,9 @@
             <view class="tui-goods-name">{{item.skuProductName}}</view>
             <view class="tui-goods-attr">商品售价(元):<text style="color:red;">¥{{filter.toDecimal2Penny(item.productPrice)}}</text></view>
             <!-- <view class="tui-goods-attr">商品售价(元):<text style="color:red;">¥{{filter.toDecimal2Penny(item.productSellPrice)}}</text></view> -->
-            <view class="tui-goods-attr">商品应用格子:
-        <tui-tag size="small" tui-tag-class="tui-mrbtm" wx:for="{{filter.gridList(item.productGrid)}}">{{item}}</tui-tag></view>
+            <view class="tui-goods-attr">商品库存:<text style="color:red;">{{item.skuStock}}</text></view>
+            <!-- <view class="tui-goods-attr">商品应用格子:
+            <tui-tag size="small" tui-tag-class="tui-mrbtm" wx:for="{{filter.gridList(item.productGrid)}}">{{item}}</tui-tag></view> -->
           </view>
           <view class="tui-price-right">
             <button class="tui-btn tui-btn-small tui-warning tui-fillet" hover-class="tui-warning-hover" bindtap="toEdit" data-item="{{item}}">添加</button>

+ 16 - 3
pages/vendingMachine/settledStore.js

@@ -46,6 +46,14 @@ Page({
     this.setData({
       userInfo: app.globalData.userInfo
     })
+    if(this.data.userInfo.mgvmRole==3){
+      this.setData({
+        ['values.agentId']: this.data.userInfo.id,
+        ['values.agentName']: this.data.userInfo.realname,
+      })
+    }
+
+
   },
 
   //商品方案列表
@@ -150,7 +158,7 @@ Page({
     }else{
       this.setData({
         ['values.agentId']: this.data.userInfo.id,
-        ['values.agentName']: this.data.userInfo.username,
+        ['values.agentName']: this.data.userInfo.realname,
       })
     }
 
@@ -218,6 +226,7 @@ Page({
 
 
     that.setData({
+      ['values.deviceNums']: item.deviceNums,
       ['values.deviceTypeId']: item.id,
       ['values.deviceTypeName']: item.deviceName,
       ['gridProductList']:gridLists,
@@ -256,13 +265,17 @@ Page({
       var item = this.data.agentList[e.detail.value]
       this.setData({
         ['values.agentId']: item.id,
-        ['values.agentName']: item.username
+        ['values.agentName']: item.realname
       })
     },
     //前往选择商品
     toSelect(e) {
+      if(this.data.values.agentId==null||this.data.values.agentId==''){
+        util.toast('请选择代理商')
+        return;
+      }
       wx.navigateTo({
-        url: '/pages/vendingMachine/select?index=' + e.currentTarget.dataset.index,
+        url: '/pages/vendingMachine/select?index=' + e.currentTarget.dataset.index+'&agentId=' + this.data.values.agentId,
       })
     },
     //选择支付类别 数组拼装成逗号分割

+ 5 - 5
pages/vendingMachine/settledStore.wxml

@@ -78,14 +78,14 @@
     </tui-list-cell>
   </picker>
 
-
   <tui-list-cell hover="{{false}}">
     <view class="tui-line-cell">
       <view class="tui-title">支付方式</view>
-        <checkbox-group bindchange="checkboxChange"  >
-          <lable wx:for="{{payTypeList}}" wx:key="key" wx:for-item="item">
-            <checkbox style="margin:0rpx 20rpx" value="{{item.value}}"  checked="{{item.value}}">{{item.name}}</checkbox>
-          </lable>
+        <checkbox-group style="line-height:40rpx" bindchange="checkboxChange"  >
+          <view wx:for="{{payTypeList}}" style="	display: inline-block;height:50rpx;margin:0rpx 20rpx;"  wx:key="key" wx:for-item="item">
+            <checkbox  value="{{item.value}}"  checked="{{item.value}}"></checkbox>
+            <label >{{item.name}} </label>
+          </view>
         </checkbox-group>
     </view>
   </tui-list-cell>

+ 18 - 16
pages/vendingMachine/settledStore.wxss

@@ -78,29 +78,31 @@
 
 
 	
-/*checkbox 选项框大小  */
-checkbox .wx-checkbox-input {
-  width: 30rpx;
-  height: 30rpx;
+
+/* 未选中的背景样式 */
+checkbox .wx-checkbox-input{
+  width: 40rpx; 
+  height: 40rpx; 
   border-radius: 50%;
 }
 
-/*checkbox选中后样式  */
-checkbox .wx-checkbox-input.wx-checkbox-input-checked {
-  background: #fed6e3;
+/* 选中后的背景样式 */
+checkbox .wx-checkbox-input.wx-checkbox-input-checked{
+  background: #37C674;
 }
 
-/*checkbox选中后图标样式  */
-checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
-  width: 30rpx;
-  height: 30rpx;
-  line-height: 28rpx;
+/* 选中后的勾子样式 */
+checkbox .wx-checkbox-input.wx-checkbox-input-checked::before{
+  width: 40rpx;
+  height: 40rpx;
+  line-height: 40rpx;
+  border-radius: 50%;
   text-align: center;
-  font-size: 18rpx;
-  color: #fff;
+  font-size:32rpx; 
+  color:#FFF; 
   background: transparent;
-  transform: translate(-50%, -50%) scale(1);
-  -webkit-transform: translate(-50%, -50%) scale(1);
+  transform:translate(-50%, -50%) scale(1);
+  -webkit-transform:translate(-50%, -50%) scale(1);
 }
 
 	

+ 4 - 4
utils/filter.wxs

@@ -46,9 +46,9 @@ var orderStatus = function (value){
 
 var auditStatus = function (value){
   if (value === 0) {
-    return '待审核';
+    return '待确认';
   } else if (value === 1) {
-    return '已审核';
+    return '已确认';
   } else if (value === 2) {
     return '已拒绝';
   }
@@ -69,9 +69,9 @@ var orderProductStatus = function (value){
   // }
 
     if (value === 1) {
-      return '待审核';
+      return '待确认';
     } else if (value === 2) {
-      return '审核通过';
+      return '已确认';
     } else if (value === 3) {
       return '审核失败';
     } 

+ 4 - 3
utils/util.js

@@ -209,8 +209,8 @@ const utils = {
     editStore: 'mgvm/mgVmStoreApi/editStore',
     stockDeviceList: 'api/device/stockDeviceList',
     upDevice:'api/device/upDeviceByStoreIdAnddevnceSn',
-    productStockList: 'mgvm/mgVmStoreProductSkuApi/productStockList',
-    editVmProductStock: 'mgvm/mgVmStoreProductSkuApi/editVmProductStock',
+    productStockList: 'api/mgVmStoreProductSku/productStockList',
+    editVmProductStock: 'api/mgVmStoreProductSku/editVmProductStock',
     addMerchantOrder: 'mgvm/mgSysProductOrder/addMerchantOrder',
     deviceListByStoreId: 'api/device/deviceListByStoreId',
     productOrderListPage: 'mgvm/mgSysProductOrder/productOrderListPage',   
@@ -255,7 +255,8 @@ const utils = {
 
     deviceTypeList:'/api/mgVmDeviceType/list',
     getDictByCode:'/api/sysDict/getDictByCode',
-    replenishment: 'api/device/replenishment'
+    replenishment: 'api/device/replenishment',
+    mgVmStoreProductSkuList:'/api/mgVmStoreProductSku/list'
   },
   staticDomain:'https://mgvm.oss-cn-beijing.aliyuncs.com/',