shish 3 年 前
コミット
f1eff144b2

+ 2 - 2
hdApp/src/admin/goods/category.vue

@@ -74,7 +74,7 @@ import AppUploader from '@/components/app-uploader'
 import OperateModule from '@/admin/home/components/module/operate'
 import AppWrapperEmpty from '@/components/app-wrapper-empty'
 import { list } from '@/mixins'
-import { categoryListB, categoryStatusB, categoryAddB, categoryUpdateB, categoryDelB } from '@/api/goods'
+import { categoryListInfo, categoryStatusB, categoryAddB, categoryUpdateB, categoryDelB } from '@/api/goods'
 export default {
 	name: 'category',
 	components: {
@@ -164,7 +164,7 @@ export default {
 			this._list()
 		},
 		_list() {
-			return categoryListB().then(res => {
+			return categoryListInfo().then(res => {
 				let data = { code: res.code, msg: res.msg, data: { list: res.data } }
 				this.completes(data)
 			})

+ 2 - 1
hdApp/src/admin/goods/cgNewPlantResult.vue

@@ -5,7 +5,8 @@
 			<view class="result-view">
 				<view class="iconfont iconchenggong"></view>
 				<view class="result-title">操作成功</view>
-				<button class="admin-button-com big blue" style="width:45vw;" @click="goDetail">打印标签</button>
+				<button class="admin-button-com big blue" style="width:45vw;" @click="goDetail">查看详情</button>
+				<button class="admin-button-com big blue" style="width:45vw;margin-top:30upx;" @click="goDetail">打印标签</button>
 				<button class="admin-button-com big default" style="width:45vw;margin-top:30upx;" @click="goBackHome">返回</button>
 			</view>
 		</view>

+ 3 - 3
hdApp/src/admin/goods/flower.vue

@@ -71,7 +71,7 @@ import OperateModule from "@/admin/home/components/module/operate";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import ModalModule from "@/components/plugin/modal";
 import flowerItem from "./components/flower-item";
-import {categoryListB,getCategoryGoodsB} from "@/api/goods";
+import {categoryListInfo,getCategoryToGoods} from "@/api/goods";
 import FooterCart from "@/components/module/app-footer-cg-plant-cart";
 import { list } from "@/mixins";
 import productMins from "@/mixins/cgPlantProduct";
@@ -148,7 +148,7 @@ export default {
       this.getPlantClass()
     },
     getPlantClass() {
-      categoryListB({flower:1}).then(res => {
+      categoryListInfo({flower:1}).then(res => {
         this.tabbar = res.data;
         if(this.tabbar && this.tabbar[0] && this.tabbar[0].id){
           this.catId = this.tabbar[0].id
@@ -157,7 +157,7 @@ export default {
       })
     },
     getPlantList() {
-      return getCategoryGoodsB({status:1,page:this.list.page,catId:this.catId,flower:1,flowerNum:this.flowerNum}).then(res => {
+      return getCategoryToGoods({status:1,page:this.list.page,catId:this.catId,flower:1,flowerNum:this.flowerNum}).then(res => {
         this.completes(res)
       })
     },

+ 3 - 3
hdApp/src/admin/goods/list.vue

@@ -79,7 +79,7 @@ import AppSearchModule from "@/components/module/app-search"
 import OperateModule from "@/admin/home/components/module/operate"
 import AppWrapperEmpty from "@/components/app-wrapper-empty"
 import ModalModule from "@/components/plugin/modal"
-import {categoryListB,getCategoryGoodsB,print} from "@/api/goods"
+import {categoryListInfo,getCategoryToGoods,print} from "@/api/goods"
 import { list } from "@/mixins"
 export default {
   name: "list",
@@ -172,7 +172,7 @@ export default {
         this.$util.pageTo({ url: "/admin/goods/detail", query: { id: id } })
     },
     getCategoryData() {
-      categoryListB().then(res => {
+      categoryListInfo().then(res => {
         this.tabbar = res.data;
         if(this.tabbar && this.tabbar[0] && this.tabbar[0].id){
           this.catId = this.tabbar[0].id
@@ -181,7 +181,7 @@ export default {
       });
     },
     getGoodsList() {
-      return getCategoryGoodsB({ status:'', page: this.list.page, catId:this.catId,flowerNum:this.flowerNum }).then(res => {
+      return getCategoryToGoods({ status:'', page: this.list.page, catId:this.catId,flowerNum:this.flowerNum }).then(res => {
         this.completes(res)
       })
     },

+ 21 - 21
hdApp/src/admin/goods/plant.vue

@@ -2,16 +2,16 @@
   <view class="app-content">
     <view class="input-wrap" >
       <view class="search-bar">
-        <app-search-module v-model="py" placeholder="输入拼音首字母搜索" @input="searchFn" />
+        <app-search-module v-model="searchText" placeholder="输入拼音首字母搜索" @input="searchFn()" />
       </view>
       <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="clearSelect()">清除已选</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)" >
+        <view v-for="(item,index) in tabbar" :key="index" class="tab-bar-item" :class="[currentTab==index ? 'active' : '']" :data-current="index" @tap.stop="changeClass($event ,item)" >
           <text>{{item.categoryName || ''}}</text>
         </view>
       </scroll-view>
@@ -63,7 +63,7 @@ import OperateModule from "@/admin/home/components/module/operate";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import ModalModule from "@/components/plugin/modal";
 import PlantItem from "./components/plant-item";
-import {categoryListB,getCategoryGoodsB,changeStatusB} from "@/api/goods";
+import {categoryListInfo,getCategoryToGoods} from "@/api/goods";
 import FooterCart from "@/components/module/app-footer-cg-plant-cart";
 import { list } from "@/mixins";
 import productMins from "@/mixins/cgPlantProduct";
@@ -93,7 +93,8 @@ export default {
       operateShow: false,
       operateIndex: null,
       operateTop: 0,
-      checkStock:false
+      checkStock:false,
+      searchText:''
     };
   },
   methods: {
@@ -110,6 +111,16 @@ export default {
       }
       this.$util.pageTo({url:"/admin/goods/plantConfirm",type:2})
     },
+    searchFn(){
+      if (this.$util.isEmpty(this.searchText)){
+
+      }else{
+        this.form.catId = 0
+        getCategoryToGoods({status:'',page:this.list.page,...this.form,flower:0,searchText:this.searchText}).then(res => {
+          this.completes(res)
+        })
+      }
+    },
     goBottom(){
       if (!this.list.finished) {
         this.getPlantList().then((res) => {
@@ -126,7 +137,7 @@ export default {
       this.getPlantClass()
     },
     getPlantClass() {
-      categoryListB({flower:0}).then(res => {
+      categoryListInfo({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
@@ -135,29 +146,18 @@ export default {
       })
     },
     getPlantList() {
-      return getCategoryGoodsB({status:'',page:this.list.page,...this.form,flower:0}).then(res => {
+      return getCategoryToGoods({status:'',page:this.list.page,...this.form,flower:0,searchText:this.searchText}).then(res => {
         this.completes(res)
       })
     },
-    swichTab(e, item) {
+    changeClass(e, item) {
       let cur = e.currentTarget.dataset.current;
-      if (this.currentTab == cur) {
-        return false;
-      } else {
+      if (this.currentTab != cur) {
         this.currentTab = cur;
         this.form.catId = item.id;
         this.resetList();
         this.getPlantList();
       }
-    },
-    changeStatus(item) {
-      let status = item.status == 0 ? 1 : 0
-      changeStatusB({id: item.id,status: status}).then(res => {
-        if(res.code == 1){
-          this.$msg("修改成功")
-          item.status = status
-        }
-      });
     }
   }
 };
@@ -251,7 +251,7 @@ page {
 }
 .input-wrap {
 		display: flex;
-		padding: 22upx 20upx 22upx 13upx;
+		padding: 22upx 20upx 10upx 13upx;
 		.search-bar {
 			flex: 1;
 		}

+ 1 - 1
hdApp/src/admin/goods/plantCg.vue

@@ -10,8 +10,8 @@
         <AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)"/>
       </block>
     <view class="app-footer open_btn">
-      <view @click="addOldEvent" class="admin-button-com big blue">已有商品采购</view>
       <view @click="addNewEvent" class="admin-button-com big blue">新商品采购</view>
+      <view @click="addOldEvent" class="admin-button-com big blue">已有商品采购</view>
 		</view>
   </view>
 </template>

+ 17 - 14
hdApp/src/admin/goods/plantConfirm.vue

@@ -14,14 +14,13 @@
                     <text class="item-price">
                       <text class="unit"></text>
                       <text class="price">
-                        <text>{{item.bigCount}}*¥{{parseFloat(item.userPrice)}}</text>
+                        <text>¥{{parseFloat(item.userPrice)}}</text>
                       </text>
                     </text>
                   </view>
                   <view class="info-line">
                     <text class="item-type"></text>
-                    <text class="item-count">
-                    </text>
+                    <text class="item-count">x {{item.bigCount}}</text>
                   </view>
                 </view>
               </view>
@@ -36,19 +35,19 @@
 
           <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" />
+            <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" :arrow="false">
             <view class="tui-title">备注</view>
-						<input type="text" v-model="form.remark" placeholder="选填"/>
+						<input type="text" v-model="form.remark" placeholder="..." placeholder-class="phcolor" />
 					</tui-list-cell>
         </view>
       </form>
     </view>
     <view class="under-bar">
       <view class="price-view"></view>
-      <button class="admin-button-com blue middle" @click="confirmToSubmit">提交</button>
+      <button class="admin-button-com blue big" @click="confirmToSubmit">提交</button>
     </view>
   </view>
 </view>
@@ -94,10 +93,14 @@ export default {
         return {goodsId: ele.id, num: ele.bigCount,price: ele.userPrice,goodsSn:ele.sn,cover:ele.shortCover}
       })
       that.$util.confirmModal({content:'确认提交?'},() => {
+          uni.showLoading({mask:true})
           cgPlant({goods:JSON.stringify(goods),...that.form}).then((res) => {
-            that.removeFromSaveDirect()
-            that.pageTo({url: '/admin/goods/cgNewPlantResult',type:2,query:{id:res.data.id}})
-          });
+            uni.hideLoading()
+            if(res.code == 1){
+              that.removeFromSaveDirect()
+              that.pageTo({url: '/admin/goods/cgNewPlantResult',type:2,query:{id:res.data.id}})
+            }
+          })
       })
     },
     gobackEvent () {
@@ -145,8 +148,8 @@ export default {
               justify-content: space-between;
               align-items: flex-end;
               .item-name {
-                color: #666;
-                font-size: 28upx;
+                color: black;
+                font-size:30upx;
               }
               .item-price {
                 color: #333;
@@ -161,8 +164,8 @@ export default {
                 font-size: 24upx;
               }
               .item-count {
-                color: #666;
-                font-size: 24upx;
+                color: rgb(15, 15, 15);
+                font-size:28upx;
               }
             }
           }
@@ -179,7 +182,7 @@ export default {
           display: flex;
           align-items: center;
           color: #3385ff;
-          font-size: 28upx;
+          font-size:30upx;
           font-weight:bold;
           .iconfont {
             margin-right: 20upx;

+ 3 - 3
hdApp/src/admin/order/addOrder.vue

@@ -77,7 +77,7 @@ import OperateModule from "@/admin/home/components/module/operate";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import ModalModule from "@/components/plugin/modal";
 import OrderItem from "./components/order-item";
-import {categoryListB,getCategoryGoodsB,changeStatusB} from "@/api/goods";
+import {categoryListInfo,getCategoryToGoods,changeStatusB} from "@/api/goods";
 import FooterCart from "@/components/module/app-footer-cg-plant-cart";
 import { list } from "@/mixins";
 import productMins from "@/mixins/cgPlantProduct";
@@ -154,7 +154,7 @@ export default {
       this.getPlantClass()
     },
     getPlantClass() {
-      categoryListB().then(res => {
+      categoryListInfo().then(res => {
         this.tabbar = res.data;
         if(this.tabbar && this.tabbar[0] && this.tabbar[0].id){
           this.form.catId = this.tabbar[0].id
@@ -163,7 +163,7 @@ export default {
       })
     },
     getPlantList() {
-      return getCategoryGoodsB({status:1,page:this.list.page,...this.form,flowerNum:this.flowerNum}).then(res => {
+      return getCategoryToGoods({status:1,page:this.list.page,...this.form,flowerNum:this.flowerNum}).then(res => {
         this.completes(res)
       })
     },

+ 2 - 2
hdApp/src/api/goods/index.js

@@ -43,7 +43,7 @@ export const getPlantCgDetail = async data => {
 /** *
  * 获取分类的商品 b
  */
-export const getCategoryGoodsB = data => {
+export const getCategoryToGoods = data => {
 	return https.get('/category/goods-list', data)
 }
 
@@ -113,7 +113,7 @@ export const usageListB = data => {
 /** *
  * 商品分类-列表(无分页) b
  */
-export const categoryListB = data => {
+export const categoryListInfo = data => {
 	return https.get('/category/list', data)
 }
 

+ 1 - 1
hdApp/src/utils/config.js

@@ -3,7 +3,7 @@ import CONSTANT from '@/constant'
 import UTIL from '@/utils/util'
 
 import { getList as getLevelList } from '@/api/level'
-import { categoryListB as getCategoryList, usageListB as getUsageList } from '@/api/goods'
+import { categoryListInfo as getCategoryList, usageListB as getUsageList } from '@/api/goods'
 import { getFestList } from '@/api/common'
 import { orderRelate as getOrderRelate } from '@/api/order'