shish 3 лет назад
Родитель
Сommit
b44d8936f4

+ 6 - 6
hdApp/src/admin/clear/list.vue

@@ -1,13 +1,13 @@
 <template>
 	<view class="order-page">
+		<block v-if="!$util.isEmpty(list.data)">
 		<view scroll-y class="order-list">
-			<block v-if="!$util.isEmpty(list.data)">
-				<OrderItem v-for="(item, index) in list.data" :key="index" :info="item" @click="gotoDetail(item)"></OrderItem>
-			</block>
-			<block v-else>
-				<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
-			</block>
+			<OrderItem v-for="(item, index) in list.data" :key="index" :info="item" @click="gotoDetail(item)"></OrderItem>
 		</view>
+		</block>
+		<block v-else>
+			<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+		</block>
 	</view>
 </template>
 <script>

+ 10 - 42
hdApp/src/admin/goods/cgNewPlant.vue

@@ -8,23 +8,19 @@
           <input v-model="form.name" placeholder-class="phcolor" class="tui-input" name="name" placeholder="请填写名称" maxlength="50" type="text" />
         </tui-list-cell>
 
-        <tui-list-cell class="line-cell" :arrow="true">
-          <view class="tui-title">分类</view>
-          <picker mode="selector" :value="form.catId" :range="plantClassData" range-key="categoryName" @change="changePlantClassFn" class="tui-input" >
-            <input v-model="form.catId" name="catId" type="text" hidden />
-            <view v-if="form.catId" style="height:45upx;" >{{ categorySelectedData.categoryName }}</view>
-            <view class="tui-placeholder" style="height:45upx;" v-else>请选择</view>
-          </picker>
+        <tui-list-cell class="line-cell" :hover="false">
+          <view class="tui-title">采购单价</view>
+          <input v-model="form.cgPrice" placeholder-class="phcolor" class="tui-input" name="cgPrice" @focus="form.cgPrice=''" placeholder="请填写进货单价" maxlength="50" type="digit" />
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">数量</view>
-          <input v-model="form.num" placeholder-class="phcolor" class="tui-input" name="num" @focus="form.num=''" placeholder="请填写数量" maxlength="50" type="number" />
+          <view class="tui-title">销售单价</view>
+          <input v-model="form.salePrice" placeholder-class="phcolor" class="tui-input" name="salePrice" @focus="form.salePrice=''" placeholder="请填写销售单价" maxlength="50" type="digit" />
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">进货单价</view>
-          <input v-model="form.cgPrice" placeholder-class="phcolor" class="tui-input" name="cgPrice" @focus="form.cgPrice=''" placeholder="请填写进货单价" maxlength="50" type="digit" />
+          <view class="tui-title">数量</view>
+          <input v-model="form.num" placeholder-class="phcolor" class="tui-input" name="num" @focus="form.num=''" placeholder="请填写数量" maxlength="50" type="number" />
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :hover="false">
@@ -33,12 +29,7 @@
         </tui-list-cell>
 
         <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">销售单价</view>
-          <input v-model="form.salePrice" placeholder-class="phcolor" class="tui-input" name="salePrice" @focus="form.salePrice=''" placeholder="请填写销售单价" maxlength="50" type="digit" />
-        </tui-list-cell>
-
-        <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">上架状态</view>
+          <view class="tui-title">状态</view>
           <view class="switch_bx">
             <switch :checked="form.status == 2 ? false : true" @change="statusChange" style="transform: scale(0.8,0.8)" />
             <text v-if="form.status == 1">上架</text>
@@ -46,15 +37,6 @@
           </view>
         </tui-list-cell>
 
-        <tui-list-cell class="line-cell" :hover="false">
-          <view class="tui-title">使用状态</view>
-          <view class="switch_bx">
-            <switch :checked="form.delStatus == 0 ? true : false" @change="delStatusChange" style="transform: scale(0.8,0.8)" />
-            <text v-if="form.delStatus == 0">启用</text>
-            <text v-else>停用</text>
-          </view>
-        </tui-list-cell>
-
       </view>
 
       <view class="module-com input-line-wrap goods-wrap">
@@ -72,7 +54,7 @@
       <view class="module-com input-line-wrap">
         <tui-list-cell class="line-cell" :hover="false" :arrow="false">
         <view class="tui-title">备注</view>
-        <textarea style="height: 100upx" v-model="form.remark" placeholder="这里写备注..." />
+        <textarea style="height: 100upx" v-model="form.remark" placeholder="..." />
         </tui-list-cell>
       </view>
 
@@ -104,11 +86,9 @@ export default {
       currentImgData: [],
       form: {
         name:"",
-        catId:'',
         cgPrice:'',
         shopImg:[],
-        status:1,
-        delStatus:0,
+        status:2,
         salePrice:'',
         sendCost:'',
         num:'',
@@ -132,16 +112,9 @@ export default {
     statusChange(e){
       this.form.status = e.detail.value ? 1 : 2;
     },
-    delStatusChange(e){
-      this.form.delStatus = e.detail.value ? 0 : 1;
-    },
     goBack(){
       uni.navigateBack({delta:1})
     },
-    changePlantClassFn(e) {
-        this.categorySelectedData = this.plantClassData[e.detail.value];
-        this.form.catId = this.categorySelectedData.id;
-    },
     imgUploadSuccess(res) {
       var imgReturn = JSON.parse(res.data)
       if(imgReturn.code == 1){
@@ -193,11 +166,6 @@ export default {
           rule: ["required"],
           msg: ["请填写名称"]
         },
-        {
-          name: "catId",
-          rule: ["required"],
-          msg: ["请选择分类"]
-        },
         {
           name: "num",
           rule: ["required"],

+ 7 - 9
hdApp/src/admin/goods/plant.vue

@@ -1,13 +1,11 @@
 <template>
   <view class="app-content">
-
     <view class="input-wrap" >
       <view class="search-bar">
         <app-search-module v-model="py" placeholder="输入拼音首字母搜索" @input="searchFn" />
       </view>
-      <view style="float:right">
+      <view style="padding:0 0upx 0 15upx;" >
         <button class="admin-button-com middle blue" style="margin-right:10upx;" @click="clearSelect()">清除已选</button>
-        <button class="admin-button-com middle blue" @click="newCg()">新商品</button>
       </view>
     </view>
 
@@ -122,7 +120,7 @@ export default {
       }
     },
     newCg(){
-      this.$util.pageTo({url:"/admin/goods/cgNewPlant",type:2})
+      this.$util.pageTo({url:"/admin/goods/selectKind",type:2})
     },
     init() {
       this.getPlantClass()
@@ -252,11 +250,11 @@ page {
   }
 }
 .input-wrap {
-	padding: 22upx 20upx 22upx 30upx;
-	.search-bar {
-		display:inline-block;
-		width:400upx;
-	}
+		display: flex;
+		padding: 22upx 20upx 22upx 13upx;
+		.search-bar {
+			flex: 1;
+		}
 }
 .select-cmd_bx {
 	& .kc {

+ 21 - 14
hdApp/src/admin/goods/plantCg.vue

@@ -1,16 +1,17 @@
 <template>
   <view class="order-page">
     <app-tabs :tabs="tabs" :isFixed="true" :currentTab="tabIndex" @change="change" itemWidth="20%"/>
+    <block v-if="!$util.isEmpty(list.data)">
     <view class="pay_list">
-      <block v-if="!$util.isEmpty(list.data)">
         <plantCgItem v-for="(item, index) in list.data" :key="index" :info="item" @click="goDetailFn"></plantCgItem>
-      </block>
+    </view>
+    </block>
       <block v-else>
         <AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)"/>
       </block>
-    </view>
     <view class="app-footer open_btn">
-			<view @click="addEvent" class="admin-button-com big blue">新增采购</view>
+      <view @click="addOldEvent" class="admin-button-com big blue">已有商品采购</view>
+      <view @click="addNewEvent" class="admin-button-com big blue">新商品采购</view>
 		</view>
   </view>
 </template>
@@ -76,28 +77,34 @@ export default {
     init() {
       this.getCgList()
     },
-    // 获取采购记录列表
     getCgList () {
       return getPlantCg({ status: this.status }).then(res => {
         this.list.data = res.data.list
-        this.tabs[0].value = res.data.shop.totalPurchaseOrder // 全部
-        this.tabs[1].value = res.data.shop.cgUnPay // 待付款
-        this.tabs[2].value = res.data.shop.cgUnSend // 待配送
-        this.tabs[3].value = res.data.shop.cgSending // 配送中
-        this.tabs[4].value = res.data.shop.cgFinish // 已完成
+        this.tabs[0].value = res.data.shop.totalPurchaseOrder
+        this.tabs[1].value = res.data.shop.cgUnPay
+        this.tabs[2].value = res.data.shop.cgUnSend
+        this.tabs[3].value = res.data.shop.cgSending
+        this.tabs[4].value = res.data.shop.cgFinish
       })
     },
     goDetailFn (val) {
-      uni.navigateTo({ url: '/admin/goods/plantCgDetail?id=' + val.id })
+      uni.navigateTo({ url: '/admin/goods/plantCgDetail?id='+val.id})
+    },
+    addOldEvent() {
+      this.pageTo({url:'/admin/goods/plant'})
+    },
+    addNewEvent(){
+      this.pageTo({url:'/admin/goods/selectKind'})
     },
-    addEvent() {
-      uni.navigateTo({url: '/admin/goods/plant'})
-    }
   }
 }
 </script>
 <style lang="scss" scoped>
 .order-page {
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	background-color: #f0f2f6;
   .tabs {
     height: 80upx;
     line-height: 80upx;

+ 262 - 0
hdApp/src/admin/goods/selectKind.vue

@@ -0,0 +1,262 @@
+<template>
+  <div class="app-main app-content">
+    <view class="input-wrap_box">
+      <view>
+        <AppSearchModule placeholder="输入拼音首字母搜索" @input="searchFn"/>
+      </view>
+    </view>
+    <block v-if="!$util.isEmpty(list.data)">
+      <block v-for="(item, index) in list.data" :key="index">
+        <tui-list-cell :arrow="true" @click="selectCurrent(item)">
+          <div class="tui-msg-box">
+            <img :src="`${constant.imgUrl}/default-img.png`" class="tui-msg-pic" mode="widthFix" />
+            <div class="tui-msg-item">
+              <div class="tui-msg-name">
+                <div class="tui-user-name">{{ item.name }}</div>
+              </div>
+            </div>
+          </div>
+        </tui-list-cell>
+      </block>
+    </block>
+    <block v-else>
+      <app-wrapper-empty :is-empty="$util.isEmpty(list.data)" />
+    </block>
+  </div>
+</template>
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+import BadgeModule from "@/components/plugin/badge";
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import appVipModule from "@/components/module/app-vip";
+import AppTag from "@/components/module/app-tag.vue";
+import AppSearchModule from "@/components/module/app-search";
+import { list } from "@/mixins";
+import { getKindList } from "@/api/kind";
+export default {
+  name: "selectKind",
+  components: {
+    TuiListCell,
+    BadgeModule,
+    AppWrapperEmpty,
+    appVipModule,
+    AppTag,
+    AppSearchModule
+  },
+  mixins: [list],
+  data() {
+    return {
+      tabIndex: 0,
+      selectStyle:1
+    };
+  },
+  onPullDownRefresh() {
+    this.resetList();
+    this.getKindData().then((res) => {
+      uni.stopPullDownRefresh();
+    });
+  },
+  onReachBottom() {
+    if (!this.list.finished) {
+      this.getKindData().then((res) => {
+        uni.stopPullDownRefresh();
+      });
+    } else {
+      uni.stopPullDownRefresh();
+    }
+  },
+  methods: {
+    selectCurrent(item){
+      let style = this.option.style ? this.option.style : 1
+      this.selectStyle = style
+      if(style == 1){
+        this.$util.pageTo({url: '/admin/goods/cgNewPlant',type:2,query: {kindId: item.id,kindName:item.name}})
+      }else if(style == 2){
+        let pages = getCurrentPages();
+        let prevPage = pages[ pages.length - 2 ];
+        prevPage.$vm.form.customId = item.id;
+        prevPage.$vm.form.customName = item.name;
+        uni.navigateBack({})
+      }
+    },
+    init() {
+      if(!this.no_shop_show_model) {
+        this.getKindData();
+      }
+    },
+    searchFn(e) {
+        this.resetList();
+        this.seekVal = e;
+        this.getKindData();
+    },
+    getKindData() {
+      return getKindList({ search: "", type:this.tabIndex, page: this.list.page, name: this.seekVal, }).then((res) => {
+          this.completes(res)
+          if (this.$util.isEmpty(res.data)){
+            return false
+          }
+        })
+    },
+    change(e) {
+      if (this.tabIndex == e.index) {
+        return false
+      }
+      this.tabIndex = e.index
+      this.resetList()
+      this.getKindData()
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.app-content {
+  padding-top: 100upx;
+  padding-bottom: 20upx;
+}
+.tabs-wrap {
+  position: fixed;
+  .tabs-left {
+    width: 80%;
+  }
+  .tabs-right {
+    width: 19%;
+    border-left: $borderColor;
+    @include disFlex(center, center);
+  }
+}
+.input-wrap_box {
+  background-color: #fff;
+  position: fixed;
+  top: 0;
+  z-index: 10;
+  /* 手机mobile屏幕小于1000px */
+  @media screen and (max-width: 1100px) {
+    width: 100%;
+  }
+  /* 收银台cashier屏幕大于1000px */
+  @media screen and (min-width:1100px) {
+    width: 40%;
+  }
+  height: 100upx;
+  display: flex;
+  align-items: center;
+  padding: 0 30upx;
+  & > view:nth-child(1) {
+    flex: 1;
+  }
+}
+.tui-msg-box {
+  display: flex;
+  align-items: center;
+  .tui-msg-pic {
+    width: 80upx;
+    height: 80upx;
+    border-radius: 50%;
+    margin-right: 20upx;
+  }
+  .tui-msg-item {
+    max-width: 500upx;
+    min-height: 80upx;
+    overflow: hidden;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    & > div {
+      @include disFlex(center, flex-start);
+      & > div:first-child {
+        margin-right: 8upx;
+      }
+    }
+    .level-img {
+      /deep/.vip-text {
+        left: 70upx;
+        top: 8upx;
+      }
+    }
+    .normal-img {
+      width: 70upx;
+      padding: 2upx 6upx;
+      color: #999;
+      background-color: #f0f2f6;
+      border-radius: 20upx;
+      .vip-text {
+        font-size: 24upx;
+        transform: scale(0.6);
+        position: relative;
+        top: -2upx;
+        left: -8upx;
+      }
+    }
+    .member-img {
+      width: 70upx;
+      padding: 2upx 6upx;
+      color: green;
+      background-color: #f0f2f6;
+      border-radius: 20upx;
+      .vip-text {
+        font-size: 24upx;
+        transform: scale(0.6);
+        position: relative;
+        top: -2upx;
+        left: -8upx;
+      }
+    }
+    .iconfont {
+      color: #00aaed;
+    }
+  }
+  .tui-msg-name {
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    font-size: 30upx;
+    line-height: 1;
+    color: #262b3a;
+    .tui-user-name {
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      width: 290upx;
+      font-size: 32upx;
+      margin-top:23upx;
+    }
+  }
+  .tui-msg-content {
+    width:500upx;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    font-size: 24upx;
+    line-height: 1;
+    color: #9397a4;
+    .debt-amount{
+      margin-left:20upx;
+      .amount_num{
+        color:red;
+        margin-left:5upx;
+        font-weight:bold;
+      }
+    }
+  }
+}
+.tui-msg-right {
+  max-width: 120upx;
+  height: 80upx;
+  margin-left: auto;
+  margin-right: 24upx;
+  text-align: right;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.user_tag {
+  border: 1upx solid #cccccc;
+  padding: 5upx 12upx 5upx 12upx;
+  border-radius: 25upx;
+  color: #bbbbbb;
+  margin-right: 10upx;
+  margin-bottom: 12upx;
+  display: inline-block;
+  font-size: 30upx;
+}
+</style>

+ 3 - 2
hdApp/src/pages.json

@@ -228,7 +228,7 @@
 			"pages": [
 				{ "path": "list", "style": { "navigationBarTitleText": "商品列表" } },
 				{ "path": "category", "style": { "navigationBarTitleText": "分类" } },
-				{ "path": "kind", "style": { "navigationBarTitleText": "类" } },
+				{ "path": "kind", "style": { "navigationBarTitleText": "类" } },
 				{ "path": "detail", "style": { "navigationBarTitleText": "商品详情" } },
 				{ "path": "add", "style": { "navigationBarTitleText": "新增" } },
 				{ "path": "selectItem", "style": { "navigationBarTitleText": "选择花材" } },
@@ -242,7 +242,8 @@
 				{ "path": "flowerResult", "style": { "navigationBarTitleText": "结果" } },
 				{ "path": "plantConfirm", "style": { "navigationBarTitleText": "确认采购" } },
 				{ "path": "plantResult", "style": { "navigationBarTitleText": "结果" } },
-				{ "path": "cgNewPlant", "style": { "navigationBarTitleText": "新采购" } },
+				{ "path": "cgNewPlant", "style": { "navigationBarTitleText": "新商品采购" } },
+				{ "path": "selectKind", "style": { "navigationBarTitleText": "选择种类" } },
 				{ "path": "cgNewPlantResult", "style": { "navigationBarTitleText": "采购成功" } },
 				{ "path": "stockChange", "style": { "navigationBarTitleText": "库存变动记录" } },
 				{ "path": "plantCg", "style": { "navigationBarTitleText": "商品采购记录" } },