shish 4 лет назад
Родитель
Сommit
9d0dda0512

+ 261 - 0
hdApp/src/admin/goodsManage/cgNewPlant.vue

@@ -0,0 +1,261 @@
+<template>
+  <view class="app-content">
+    <form @submit="formSubmit">
+      <view class="module-com input-line-wrap">
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <view class="tui-title">名称</view>
+          <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>
+
+        <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" />
+        </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" />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <view class="tui-title">运费</view>
+          <input v-model="form.sendCost" placeholder-class="phcolor" class="tui-input" name="sendCost" @focus="form.sendCost=''" 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.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="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>
+            <text v-else>下架</text>
+          </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">
+        <view class="module-tit">
+          <span>图片</span>
+          <span class="app-color-3">(建议比例 1:1)</span>
+        </view>
+        <view class="module-det">
+          <htz-image-upload :max="1" :compress="true" v-model="currentImgData" :headers="headers"
+           @uploadSuccess="imgUploadSuccess" @imgDelete="imgDeleteFn" :action="getLoginInfo.imgUploadApi">
+          </htz-image-upload>
+        </view>
+      </view>
+
+      <view class="app-footer">
+        <button class="admin-button-com big default" @click="goBack()">取消</button>
+        <button class="admin-button-com big blue" formType="submit">提交</button>
+      </view>
+
+    </form>
+  </view>
+</template>
+
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+const form = require("@/utils/formValidation.js");
+import { getClass } from "@/api/category";
+import { cgPlant } from "@/api/goods/index";
+import { mapGetters } from "vuex"
+//图片上传插件来源:https://ext.dcloud.net.cn/plugin?id=2922 已改造,不能再升级 shish 20211228
+import htzImageUpload from './components/htz-image-upload/htz-image-upload.vue'
+export default {
+  name: "cgNewPlant",
+  components: {
+    TuiListCell,
+    htzImageUpload
+  },
+  data() {
+    return {
+      currentImgData: [],
+      form: {
+        name:"",
+        catId:'',
+        cgPrice:'',
+        shopImg:[],
+        status:1,
+        delStatus:0,
+        salePrice:'',
+        sendCost:'',
+        num:''
+      },
+      categorySelectedData:{},
+      plantClassData:[],
+      headers:{token:''}
+    };
+  },
+	computed:{
+		...mapGetters(["getLoginInfo","getDictionariesInfo"]),
+	},
+  onLoad() {
+    const token = uni.getStorageSync('token')
+    this.headers.token = token
+  },
+  watch:{
+  },
+  methods: {
+    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){
+        this.currentImgData.push(imgReturn.data.smallUrl)
+        this.form.shopImg.push(imgReturn.data.shortUrl)
+      }
+    },
+    imgDeleteFn(res){
+      const index = res.index
+      this.form.shopImg.splice(index,1)
+    },
+    init() {
+      this.getPlantCategory()
+    },
+    async getPlantCategory() {
+      await getClass().then(res => {
+        if (this.$util.isEmpty(res.data)){
+          return false;
+        }
+        this.plantClassData = res.data;
+      });
+    },
+    confirmFn() {
+      if (this.$util.isEmpty(this.form.shopImg)) {
+        this.$msg("请上传图片")
+        return false
+      }
+      if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.cgPrice) == false){
+        uni.showToast({title:"请填写进货单价哦",icon:"none"})
+        return;
+      }
+      if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.salePrice) == false){
+        uni.showToast({title:"请填写销售单价哦",icon:"none"})
+        return;
+      }
+      let form = JSON.parse(JSON.stringify(this.form))
+      cgPlant({...form}).then(res => {
+        if(res.code == 1){
+          this.pageTo({url: '/admin/goodsManage/cgNewPlantResult',type:2})
+        }
+      })
+    },
+    formSubmit(e) {
+      let rules = [
+        {
+          name: "name",
+          rule: ["required"],
+          msg: ["请填写名称"]
+        },
+        {
+          name: "catId",
+          rule: ["required"],
+          msg: ["请选择分类"]
+        },
+        {
+          name: "num",
+          rule: ["required"],
+          msg: ["请选择数量"]
+        },
+        {
+          name: "cgPrice",
+          rule: ["required"],
+          msg: ["请填写进货单价"]
+        },
+        {
+          name: "salePrice",
+          rule: ["required"],
+          msg: ["请填写销售单价"]
+        }
+      ];
+      let formData = e.detail.value;
+      let checkRes = form.validation(formData, rules);
+      if (!checkRes) {
+          this.confirmFn()
+      } else {
+        this.$msg(checkRes);
+      }
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.app-content {
+  min-height: calc(100vh - 100upx);
+  padding-bottom: 150upx;
+}
+.module-com {
+  margin-bottom: 20upx;
+  background-color: #fff;
+  color: $fontColor2;
+  .module-tit {
+    padding: 20upx 30upx;
+    font-size: 28upx;
+  }
+  .module-det {
+    padding: 0 30upx;
+  }
+}
+.category-wrap {
+  align-items: flex-start;
+  padding-bottom: 0 !important;
+  .tui-input {
+    @include disFlex(center, flex-start);
+    flex-wrap: wrap;
+    .admin-button-com {
+      margin-right: 20upx;
+      margin-bottom: 20upx;
+      position: relative;
+      z-index: 9999;
+    }
+  }
+}
+.summary-wrap {
+  .goods-summary {
+    height: 400upx;
+  }
+}
+.app-footer {
+  justify-content: space-evenly;
+  z-index: 9999;
+  .admin-button-com {
+    width: 46%;
+  }
+}
+</style>

+ 70 - 0
hdApp/src/admin/goodsManage/cgNewPlantResult.vue

@@ -0,0 +1,70 @@
+<template>
+	<view class="app-content">
+		<view class="billing_box_bg">
+			<view class="top-view"> </view>
+			<view class="result-view">
+				<view class="iconfont iconchenggong"></view>
+				<view class="result-title">操作成功</view>
+				<button class="admin-button-com big blue" style="width:45vh;" @click="goBackHome">返回首页</button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+    name: "success",
+	methods: {
+		goBackHome() {
+			uni.navigateBack({})
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.go-back{
+	width: 80%;
+	height: 80upx;
+	color: #FFFFFF;
+	margin-top: 50upx;
+	background: #3385FF;
+	border-radius: 10upx;
+	font-size:30upx;
+}
+.billing_box_bg {
+	position: relative;
+	padding: 60upx 30upx;
+	display: flex;
+	background: white;
+	flex-direction: column;
+    background-color: #f5f5f5;
+	.top-view {
+		position: absolute;
+		top: 0;
+		left: 0;
+		width: 100%;
+		height: 299upx;
+		background: #3385ff;
+		border-radius: 0upx 0upx 83upx 83upx;
+	}
+	.result-view {
+		position: relative;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		padding: 70upx;
+		width: 100%;
+		background: #ffffff;
+		border-radius: 20upx;
+		z-index: 1;
+		.iconchenggong {
+			font-size: 170upx;
+			color: $mainColor1;
+		}
+		.result-title {
+			margin: 50upx 0 70upx;
+			font-size: 32upx;
+		}
+	}
+}
+</style>

+ 1 - 1
hdApp/src/admin/goodsManage/components/plant-item.vue

@@ -12,7 +12,7 @@
             <view style="float:right;display:inlin-block;padding-right:10upx;color:#666666;">
                 <text>-</text>
                 <text style="width:100upx;display:inline-block;text-align:center;">
-                  <text v-if="Number(goodsInfo.bigCount)>2">{{goodsInfo.bigCount}}</text>
+                  <text v-if="Number(goodsInfo.bigCount)>0">{{goodsInfo.bigCount}}</text>
                 </text>
                 <text>+</text>
             </view>

+ 18 - 30
hdApp/src/admin/goodsManage/list.vue

@@ -1,6 +1,5 @@
 <template>
   <view class="app-content">
-
 		<view class="input-wrap" >
 			<view class="search-bar">
 				<app-search-module v-model="py" placeholder="输入英文字母搜索" @input="searchFn" />
@@ -9,7 +8,6 @@
 				<button class="admin-button-com middle blue" @click="cgPlant()">盆栽采购</button>
 			</view>
 		</view>
-
     <view class="app-middle">
       <scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop">
         <view v-for="(item,index) in tabbar" :key="index" class="tab-bar-item" :class="[currentTab==index ? 'active' : '']" :data-current="index" @tap.stop="swichTab($event ,item)" >
@@ -64,7 +62,7 @@ import ModalModule from "@/components/plugin/modal";
 import {categoryListB,getCategoryGoodsB,delB,changeStatusB} from "@/api/goods";
 import { list } from "@/mixins";
 export default {
-  name: "goods-manage-list",
+  name: "list",
   components: {
     OperateModule,
     AppWrapperEmpty,
@@ -79,7 +77,7 @@ export default {
       currentTab: 0,
       scrollTop: 0,
       form: {
-        categoryId: ""
+        catId: ""
       },
       delModal: false,
       operateData: {},
@@ -92,21 +90,12 @@ export default {
   computed: {
   },
   onLoad: function() {
-    if (this.$util.isLogin()) {
-      setTimeout(() => {
-        uni.getSystemInfo({
-          success: res => {
-            this.height = res.windowHeight - 90;
-            this.sInit();
-          }
-        });
-      }, 50);
-    }
+
   },
   methods: {
     goBottom(){
       if (!this.list.finished) {
-        this._list().then((res) => {
+        this.getGoodsList().then((res) => {
           uni.stopPullDownRefresh();
         });
       } else {
@@ -119,23 +108,22 @@ export default {
     edit(id){
         this.$util.pageTo({ url: "/admin/goodsManage/detail", query: { id: id } })
     },
-    async sInit() {
-      this._getClass();
-      this._list();
+    init() {
+      this.getCategoryData();
     },
-    _getClass() {
+    getCategoryData() {
       categoryListB().then(res => {
         this.tabbar = res.data;
+        if(this.tabbar && this.tabbar[0] && this.tabbar[0].id){
+          this.form.catId = this.tabbar[0].id
+          this.getGoodsList()
+        }
       });
     },
-    _list() {
-      return getCategoryGoodsB({
-        status: 1,
-        page: this.list.page,
-        ...this.form
-      }).then(res => {
-        this.completes(res);
-      });
+    getGoodsList() {
+      return getCategoryGoodsB({ status: 1, page: this.list.page, ...this.form }).then(res => {
+        this.completes(res)
+      })
     },
     swichTab(e, item) {
       let cur = e.currentTarget.dataset.current;
@@ -143,9 +131,9 @@ export default {
         return false;
       } else {
         this.currentTab = cur;
-        this.form.categoryId = item.id;
+        this.form.catId = item.id;
         this.resetList();
-        this._list();
+        this.getGoodsList();
       }
     },
     changeStatus(item) {
@@ -155,7 +143,7 @@ export default {
           this.$msg("修改成功")
           item.status = status
         }
-      });
+      })
     }
   }
 };

+ 20 - 23
hdApp/src/admin/goodsManage/plant.vue

@@ -42,17 +42,17 @@
           <view class="num_bx"> 
             <text style="font-size:35upx;font-weight:bold;color:#666666;margin-right:20upx;">单价</text>
             <!-- #ifdef APP-PLUS -->
-            <input style="width: 430upx" v-model="customData.userPrice" type="digit" :focus="isAddInputFocus" />
+            <input style="width: 430upx" v-model="customData.userPrice" type="digit" :focus="isAddInputFocus" @focus="customData.userPrice=''" />
             <!-- #endif -->
             <!-- #ifdef MP-WEIXIN -->
-            <input style="width: 430upx" v-model="customData.userPrice" type="digit" />
+            <input style="width: 430upx" v-model="customData.userPrice" type="digit" @focus="customData.userPrice=''" />
             <!-- #endif -->
           </view>
         </view>
         <view class="select-cmd_bx">
           <view class="num_bx"> 
             <text style="font-size:35upx;font-weight:bold;color:#666666;margin-right:20upx;">数量</text>
-            <input style="width: 430upx" v-model="customData.bigCount" type="number" />
+            <input style="width: 430upx" v-model="customData.bigCount" @focus="customData.bigCount=''" type="number" />
           </view>
         </view>
       </template>
@@ -91,7 +91,7 @@ export default {
       currentTab: 0,
       scrollTop: 0,
       form: {
-        categoryId: ""
+        catId: ""
       },
       delModal: false,
       operateData: {},
@@ -104,20 +104,14 @@ export default {
   computed: {
   },
   onLoad: function() {
-    if (this.$util.isLogin()) {
-      setTimeout(() => {
-        uni.getSystemInfo({
-          success: res => {
-            this.height = res.windowHeight - 90;
-            this.sInit();
-          }
-        });
-      }, 50)
-    }
+
   },
   methods: {
     clearSelect(){
-      this.removeFromSaveDirect()
+        let that = this
+        that.$util.confirmModal({content:'确认清除?'},() => {
+              that.removeFromSaveDirect()
+        })      
     },
     confirmToSave(){
       if (this.$util.isEmpty(this.selectList)){
@@ -136,19 +130,22 @@ export default {
       }
     },
     newCg(){
-      //this.$util.pageTo({url:"/admin/goodsManage/plant",type:2})
+      this.$util.pageTo({url:"/admin/goodsManage/cgNewPlant",type:2})
     },
-    async sInit() {
-      this.getPlantClass();
-      this.getPlantList();
+    init() {
+      this.getPlantClass()
     },
     getPlantClass() {
-      categoryListB().then(res => {
+      categoryListB({flower:0}).then(res => {
         this.tabbar = res.data;
-      });
+        if(this.tabbar && this.tabbar[0] && this.tabbar[0].id){
+          this.form.catId = this.tabbar[0].id
+          this.getPlantList()
+        }
+      })
     },
     getPlantList() {
-      return getCategoryGoodsB({ status: 1, page: this.list.page, ...this.form }).then(res => {
+      return getCategoryGoodsB({status:1,page:this.list.page,...this.form,flower:0}).then(res => {
         this.completes(res)
       })
     },
@@ -158,7 +155,7 @@ export default {
         return false;
       } else {
         this.currentTab = cur;
-        this.form.categoryId = item.id;
+        this.form.catId = item.id;
         this.resetList();
         this.getPlantList();
       }

+ 1 - 1
hdApp/src/admin/goodsManage/plantResult.vue

@@ -4,7 +4,7 @@
 			<view class="top-view"> </view>
 			<view class="result-view">
 				<view class="iconfont iconchenggong"></view>
-				<view class="result-title">报损成功</view>
+				<view class="result-title">操作成功</view>
 				<button class="admin-button-com big blue" style="width:45vh;" @click="goBackHome">返回首页</button>
 			</view>
 		</view>

+ 4 - 4
hdApp/src/admin/item/list.vue

@@ -5,11 +5,11 @@
 			<view class="search-bar">
 				<app-search-module v-model="py" placeholder="小菊输xj搜索" @input="searchFn"/>
 			</view>
-			<!-- <view style="padding:0 0upx 0 20upx;" >
-				<button class="admin-button-com middle blue" style="margin-right:8upx;" @click="itemMore()">更多</button>
-				<button class="admin-button-com middle blue" style="margin-right:8upx;" @click="downPriceTable()">价格表</button>
+			<view style="padding:0 0upx 0 20upx;" >
+				<!-- <button class="admin-button-com middle blue" style="margin-right:8upx;" @click="itemMore()">更多</button>
+				<button class="admin-button-com middle blue" style="margin-right:8upx;" @click="downPriceTable()">价格表</button> -->
 				<button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/ptItem/itemList' })">添花材</button>
-			</view> -->
+			</view>
 		</view>
 		<view class="scroll-middle_bx">
 			<scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop">

+ 151 - 0
hdApp/src/admin/ptItem/components/Item.vue

@@ -0,0 +1,151 @@
+<template>
+	<view class="item-cmd_bx" @click="selectItem(info)">
+		<view class="img_bx" style="background:#eeeeee">
+			<image :src="info.cover" v-if="isImg"></image>
+		</view>
+		<view class="cmd-info_bx">
+			<view class="tit">{{ info.name || "" }}</view>
+			<view class="kc">{{info.className}}
+				<text v-if="info.select == 2" style="color:#1f1cc0;float:right;margin-right:80upx;">已导入</text>
+				<text v-else style="color:green;float:right;margin-right:80upx;">选择</text>
+			</view>
+			<view class="num-open_bx">
+				<view class="open-bx warn">
+					单位:<text>{{ info.bigUnit }}</text>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+import AppImg from "@/components/app-img";
+export default {
+	name: "item",
+	components: {
+		AppImg
+	},
+	props: {
+
+		isPrice: {
+			type: Boolean,
+			default: true
+		},
+		isEdit: {
+			type: Boolean,
+			default: true
+		},
+		info: {
+			required: true
+		},
+		modifyStock:{
+			type:Object
+		}
+	},
+	data() {
+		return {
+			isImg:false,
+			currentStock:null,
+			hidden:0
+		};
+	},
+	mounted() {
+		setTimeout(()=>{
+			this.isImg = true;
+		},100)
+	},
+	watch: {
+		modifyStock:{
+			handler(){
+				if(this.modifyStock.id == this.info.id && this.modifyStock.stock != this.info.stock){
+					this.currentStock = this.modifyStock.stock
+					let that = this
+					setTimeout(function(){
+						that.hidden = that.modifyStock.hidden
+					},800)
+				}
+			},
+			deep:true
+		}
+	},
+	methods: {
+		selectItem(item){
+			this.$emit("selectItem",item);
+		},
+		addEvent() {
+			this.$emit("add");
+		},
+		subtractEvent() {
+			this.$emit("subtract");
+		},
+		delEvent() {
+			this.$emit("del");
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.item-cmd_bx {
+	position: relative;
+	margin-bottom: 10upx;
+	.img_bx {
+		height: 150upx;
+		width: 150upx;
+		position: absolute;
+		left: 0upx;
+		top: 0upx;
+		image{
+			width: 100%;
+			height: 100%;
+		}
+	}
+	.cmd-info_bx {
+		position: relative;
+		padding-left: 177upx;
+		&.active{
+			&:before{
+				content: ' ';
+				height: 22upx;
+				width: 22upx;
+				border-width: 2upx 2upx 0 0;
+				border-color: #b2b2b2;
+				border-style: solid;
+				-webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+				transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+				position: absolute;
+				top: 50%;
+				margin-top: -12upx;
+				right: 30upx;
+			}
+		}
+
+		& .tit {
+			font-size: 32upx;
+			font-weight: bold;
+			color: #333333;
+			padding-top: 0upx;
+		}
+		& .kc {
+			color: #9e9d9d;
+			font-size: 28upx;
+			padding: 17upx 0 17upx;
+		}
+		& .num-open_bx {
+			display: flex;
+			align-items: center;
+			& .price {
+				font-size: 28upx;
+				color: #999999;
+				flex: 1;
+			}
+			& .open-bx {
+				color: #9e9d9d;
+				text{
+					font-size: 24upx;
+				}
+			}
+		}
+	}
+}
+</style>

+ 246 - 0
hdApp/src/admin/ptItem/itemList.vue

@@ -0,0 +1,246 @@
+<template>
+<view class="app-content">
+	<view class="billing_box_bg">
+    <view class="input-wrap">
+			<view class="search-bar">
+				<app-search-module v-model="py" placeholder="输入英文字母搜索" @input="searchFnContrapose"/>
+			</view>
+			<view style="padding:0 0upx 0 20upx;" >
+				<button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/item/add',type:2 })">自定义</button>
+			</view>
+		</view>
+		<view class="scroll-middle_bx">
+			<block v-if="!$util.isEmpty(globalClassItemListContrapose)">
+				<view scroll-y class="item_list_bx" style="width: 100%">
+					<template v-for="(productItem, productIndex) in globalClassItemListContrapose">
+						<view style="padding: 20upx 0">
+						<ptItemInfo
+							:isPrice="false"
+							:key="productIndex"
+							:info="productItem"
+							:isEdit="true"
+							:modifyStock="modifyStock"
+							@selectItem="selectItem"
+						></ptItemInfo>
+						</view>
+					</template>
+				</view>
+			</block>
+			<block v-else>
+				<view style="width: 100%">
+					<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(globalClassItemListContrapose)"/></view>
+			</block>
+		</view>
+	</view>
+</view>
+</template>
+<script>
+import AppSearchModule from "@/components/module/app-search";
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import ptItemInfo from "./components/Item";
+import productMins from "@/mixins/product";
+import productContraposeMins from "@/mixins/ptProductContrapose";
+import { mapGetters } from "vuex";
+import { getAllItemClass } from "@/api/item-class";
+export default {
+	name: "ptItemList",
+	components: {
+		AppSearchModule,
+		AppWrapperEmpty,
+		ptItemInfo
+	},
+	mixins: [productMins, productContraposeMins],
+	data() {
+		return {
+			autoLoad: false,
+			selectJobType: "getPtItem",
+			tabIndex: 0,
+			modifyStock:{},
+			allClass:[]
+		};
+	},
+	computed:{
+		...mapGetters(["getMyShopInfo","getLoginInfo"]),
+	},
+	onLoad() {
+		this.ptItemInit()
+	},
+	onReachBottom(){
+		this.page++
+		this.shopId = this.getMyShopInfo.id;
+		this.initDataContrapose({ type:'waring', shopId: this.shopId,status:0,delStatus:0})
+	},
+	onShow(){
+	},
+	methods: {
+		ptItemInit(){
+			this.shopId = this.getMyShopInfo.id;
+			this.initDataContrapose({ type:'waring', shopId: this.shopId,status:0,delStatus:0})
+		},
+		init() {
+			let that = this
+			getAllItemClass().then(res => {
+				if (this.$util.isEmpty(res.data)){
+					return false;
+				}
+				that.allClass = res.data
+			});
+		},
+		selectItem(item){
+			if(item.select == 2){
+				this.$msg("已导入")
+				return
+			}
+			this.$util.pageTo({ url: '/admin/item/detail',type:2,query:{ptItemId:item.id}})
+		},
+		affirm(val) {
+			if (val.index === 0) {
+				this.modalCancel();
+			}
+		},
+		change(e) {
+			if (this.tabIndex == e.index) {
+				return false;
+			} else {
+				uni.showLoading({
+					title: "加载中"
+				});
+				this.tabIndex = e.index;
+				this.globalClassItemListContrapose = this.allFilterProductInfoContrapose;
+				uni.hideLoading();
+			}
+		},
+		scrollTop() {},
+		initProductInfo() {
+			this.globalClassItemListContrapose = [];
+			this.page = 1;
+			this.isMore = true;
+			},
+		selectSussess(val) {
+			uni.showLoading({ title: "加载中" })
+			this.initProductInfo();
+			let type = "waring";
+			this.shopId = val.selectItem.id;
+			this.initDataContrapose({ type, shopId: this.shopId,status:0,delStatus:0});
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.billing_box_bg {
+	height: 100%;
+	display: flex;
+	background: white;
+	flex-direction: column;
+	.input-wrap {
+		display: flex;
+		padding: 22upx 20upx 22upx 30upx;
+		.search-bar {
+			flex: 1;
+		}
+		.city-select {
+			display: flex;
+			flex-shrink: 0;
+			align-items: center;
+			margin-right: 15upx;
+			margin-left: 45upx;
+			background-color: #ffff;
+			.iconfont {
+				margin-left: 20upx;
+				font-size: 30upx;
+			}
+		}
+	}
+	.scroll-middle_bx {
+		flex: 1;
+		display: flex;
+		width: 100%;
+		height: 100%;
+		overflow: hidden;
+	}
+	.tab-view {
+		height: 100%;
+		width: 170upx;
+		flex-shrink: 0;
+		background-color: #f0f2f6;
+		.tab-bar-item {
+			position: relative;
+			width: 170upx;
+			height: 90upx;
+			box-sizing: border-box;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			font-size: 26upx;
+			color: #444;
+			font-weight: 400;
+			.tag {
+				display: flex;
+				padding: 0 20upx;
+				align-items: center;
+				position: absolute;
+				right: 0;
+				top: 0;
+				height: 32upx;
+				background: #ff2842;
+				border-radius: 16upx;
+				color: #fff;
+				font-size: 20upx;
+			}
+			&:last-child{
+				margin-bottom: 110upx;
+			}
+		}
+		.active {
+			position: relative;
+			color: $mainColor;
+			font-size: 26upx;
+			background: #fff;
+		}
+		.active::before {
+			content: "";
+			position: absolute;
+			border-left: 8upx solid $mainColor;
+			height: 100%;
+			left: 0;
+		}
+	}
+	.right-box {
+		height: 100%;
+		flex: 1;
+		box-sizing: border-box;
+	}
+	.item_list_bx {
+		padding: 10upx 40upx;
+	}
+	.item_list_title {
+		margin-bottom: 20upx;
+		font-size: 24upx;
+		font-weight: 600;
+		color: #666666;
+	}
+	.select-cmd_bx {
+		& .kc {
+			color: #999999;
+			font-size: 28upx;
+			font-weight: 400;
+			margin-bottom: 60upx;
+			text-align: center;
+			margin-top: 10upx;
+		}
+		& .num_bx {
+			display: flex;
+			align-items: center;
+			margin-bottom: 80upx;
+			& > input {
+				width: 212upx;
+				height: 80upx;
+				border: 1upx solid #dddddd;
+				border-radius: 4upx;
+				text-align: center;
+				margin-right: 24upx;
+			}
+		}
+	}
+}
+</style>

+ 58 - 0
hdApp/src/mixins/ptProductContrapose.js

@@ -0,0 +1,58 @@
+import { ptItemList } from "@/api/pt-item/index";
+import { mapGetters, mapActions } from "vuex";
+export default {
+	data() {
+		return {
+			selectJobType: "ptProductList", //选择商品页面类别  用于区分不同功能的数据
+			productInfoList: [], //商品信息
+			classIndex: 0, //当前商品类别下标
+			py: "", //拼音搜索条件
+			type: "", //库存预警时,固定为waring,其他情况不传或者传空
+			autoLoad: true, //自动获取商品信息
+			checkStock: true, //选择数量不能大于库存限制
+			globalClassItemListContrapose:[],
+			allFilterProductInfoContrapose:[],
+			isMore:true,
+			page:1,
+		};
+	},
+	onLoad(options) {
+		const { selectJobType } = options;
+		if (selectJobType) {
+			this.selectJobType = selectJobType;
+		}
+	},
+	onUnload() {},
+	computed: {
+		...mapGetters(["getSelectInfo","getMyShopInfo"]),
+	},
+	methods: {
+		...mapActions(["setSelectInfo", "reSetSelectInfo"]),
+		async initDataContrapose(extendInfo) {
+			let params = {
+				name: this.py,
+				page: this.page,
+			};
+			if (extendInfo) {
+				params = { ...params, ...extendInfo };
+			}
+			const { data } = await ptItemList(params);
+			data.list.forEach((ele)=>{
+				this.globalClassItemListContrapose.push(ele);
+			})
+			this.allFilterProductInfoContrapose = this.globalClassItemListContrapose;
+			if(this.globalClassItemListContrapose.length==data.totalNum){
+				this.isMore = false;
+			}
+			this.productInfoList = data.list;
+			uni.stopPullDownRefresh();
+			uni.hideLoading();
+		},
+		//搜索对应花材
+		searchFnContrapose() {
+			this.page = 1
+			this.globalClassItemListContrapose = []
+			this.initDataContrapose({shopId: this.shopId})			
+		}
+	}
+};

+ 9 - 1
hdApp/src/pages.json

@@ -8,6 +8,12 @@
 		{ "path": "admin/home/me", "style": { "navigationBarTitleText": "我的", "enablePullDownRefresh": true, "navigationStyle": "custom" } }
 	],
 	"subPackages": [
+		{
+			"root": "admin/ptItem",
+			"pages": [
+				{"path": "itemList","style": {"navigationBarTitleText": "平台花材列表","onReachBottonDistance":20}}
+			]
+		},
 		{
 			"root": "admin/breakage",
 			"pages": [
@@ -187,7 +193,9 @@
 				{ "path": "price-increase", "style": { "navigationBarTitleText": "节日自动涨价" } },
 				{ "path": "plant", "style": { "navigationBarTitleText": "盆栽绿植资材" } },
 				{ "path": "plantConfirm", "style": { "navigationBarTitleText": "确认采购" } },
-				{ "path": "plantResult", "style": { "navigationBarTitleText": "结果" } }
+				{ "path": "plantResult", "style": { "navigationBarTitleText": "结果" } },
+				{ "path": "cgNewPlant", "style": { "navigationBarTitleText": "新采购" } },
+				{ "path": "cgNewPlantResult", "style": { "navigationBarTitleText": "采购成功" } }
 			]
 		},
 		{