Sfoglia il codice sorgente

花材列表的优化

shish 1 anno fa
parent
commit
554dab1547

+ 5 - 6
hdApp/src/admin/home/workbench.vue

@@ -315,17 +315,16 @@ export default {
       },
       tabsData: [
         { name: "商城", img: `ghs/home/shop2.png`, url: "/admin/cg/mall",pf:1},
-        { name: "花材", img: `ghs/home/hcgl2.png`, url: "/admin/item/list2",pf:1 },
         { name: "改价", img: `ghs/home/gj2.png`, url: "/admin/changePrice/list2",pf:1},
+        { name: "花材", img: `ghs/home/hcgl2.png`, url: "/admin/item/list2",pf:1 },
+        { name: "接花束", img: `ghs/home/shop2.png`, url: "/admin/order/workOrder",pf:1 },
         { name: "拆散", img: `ghs/home/kcyjs2.png`, url: "/admin/part/list",pf:1},
         { name: "损耗", img: `ghs/home/kcyjs2.png`, url: "/admin/breakage/list",pf:1},
         { name: "任务", img: `ghs/home/kcyjs2.png`, url: "/admin/work/list",pf:1 },
-        { name: "买花", img: `ghs/home/icon_ghs2.png`, url: "/pagesPurchase/order",pf:1 },
+        { name: "买花", img: `ghs/home/shop2.png`, url: "/pagesPurchase/order",pf:1 },
         { name: "买花记录", img: `ghs/home/shop2.png`, url: "/pagesPurchase/shopping",pf:1 },
-        { name: "花束", img: `ghs/home/hcgl2.png`, url: "/admin/goods/list",pf:1 },
-        { name: "绿植", img: `ghs/home/hcgl2.png`, url: "/admin/goods/lz",pf:1 },
-        { name: "绿植采购", img: `ghs/home/icon_caigou2.png`, url: "/admin/goods/plantCg",pf:1},
-        { name: "失信人员", img: `ghs/home/kcyjs2.png`, url: "/admin/ll/list",pf:1 },
+        { name: "花束绿植", img: `ghs/home/hcgl2.png`, url: "/admin/goods/list",pf:1 },
+        { name: "客户充值", img: `ghs/home/kcyjs2.png`, url: "/admin/recharge/rechargeCode",pf:1 },
       ],
       totalData: [
         { name: "客户数", value: 0 },

+ 1 - 1
hdApp/src/admin/item/components/item2.vue

@@ -60,7 +60,7 @@
 	</view>
 	<text class="bottom-button" @click.stop="moreAction(info)">更多</text>
 	<text class="bottom-button" @click.stop="goToStockDetail(info)">库明细</text>
-	<!-- <text class="bottom-button" @click.stop="hideChangeFn(info)">{{ frontHide == 0 ? '隐藏' : '显示' }}</text> -->
+	<text class="bottom-button" @click.stop="hideChangeFn(info)">{{ frontHide == 0 ? '隐藏' : '显示' }}</text>
 	<text class="bottom-button" @click.stop="doPrintLabel(info,0)">标签</text>
 	<text class="bottom-button" @click.stop="doPrintLabel(info,1)">价码</text>
 </view>

+ 2 - 2
hdApp/src/admin/item/list2.vue

@@ -171,7 +171,7 @@ import productMins from "@/mixins/product2";
 import { mapGetters } from "vuex";
 import { getWeixinId } from "@/api/invite";
 import { print,cancelDiscountPrice,cancelPreSell,delStatusUpdate,cancelFullOffFn } from '@/api/product';
-import { getHdPoster,getSkPoster,breakItem,changeFrontHide,applyAuth,changeHalf,moveToLosing } from '@/api/item'
+import { getHdPoster,getPoster,breakItem,changeFrontHide,applyAuth,changeHalf,moveToLosing } from '@/api/item'
 import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue';
 import ModalModule from "@/components/plugin/modal"
 import { partItem } from "@/api/part"
@@ -398,7 +398,7 @@ export default {
 			this.closeRightShow()
 			let that = this
 			uni.showLoading({mask:true})
-			getSkPoster({id:this.currentInfo.id}).then(res=>{
+			getPoster({id:this.currentInfo.id}).then(res=>{
 				uni.hideLoading()
 				if(res.code == 1){
 					that.posterUrl = res.data.imgUrl

+ 1 - 1
hdApp/src/admin/order/itemOrder.vue

@@ -146,7 +146,7 @@ export default {
     },
     getOrderList() {
       if(this.option.productId){
-        return getOrderInfoList({ productId:this.option.productId, page: this.list.page,ids:ids }).then((res) => {
+        return getOrderInfoList({ productId:this.option.productId, page: this.list.page }).then((res) => {
           this.completes(res)
         })
       }

+ 30 - 13
hdApp/src/admin/ptItem/components/Item.vue

@@ -1,23 +1,36 @@
 <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 class="item-cmd_bx">
+		<view class="img_bx" style="background:#EEEEEE;z-index:99;" @click="showBigCover(info.bigCover)">
+			<image :src="info.cover"></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 class="tit" style="display:flex;align-items:center;">
+				{{ info.name || "" }}
+				<image v-if="info.auth == 1" :src="`${constant.imgUrl}/icon/official8.png`" mode="widthFix" 
+				style="width:42upx;height:42upx;display:inline-block;margin-left:10upx;border-radius:12upx;"></image>
+			</view>
+			<view class="kc" @click="selectItem(info)">
+				<text style="font-size:28upx;">{{info.className}}</text> 
+				<text style="margin-left:20upx;color:#735d5d;font-size:28upx;font-weight:bold;">{{info.useNum}}家在用</text>
+				
+				<text v-if="info.select == 2 && info.is_delete == 1" style="position:absolute;right:7upx;color:#1f1cc0;">恢复</text>
+
+				<text v-if="info.select == 2 && info.is_delete == 0" style="position:absolute;right:7upx;color:#1f1cc0;">查看</text>
+
+				<text v-if="info.select == 2 && info.is_delete == 1" style="color:red;float:right;margin-right:110upx;font-weight:bold;">已删除</text>
+				<text v-else-if="info.select == 2" style="color:green;float:right;margin-right:110upx;font-weight:bold;">使用中</text>
+				<text v-else style="color:green;float:right;margin-right:110upx;border:1upx solid green;padding:10upx 10upx 10upx 10upx;border-radius:5upx;">采用</text>
 			</view>
 			<view class="num-open_bx">
 				<view class="open-bx warn">
-					单位:<text>{{ info.bigUnit }}</text>
+					<text>编号 {{info.id}}</text>
+					<text style="margin-left:25upx;" v-if="info.ratioType == 0">{{info.ratio}}{{info.smallUnit}}/<text @click="changeAuth(info.id)">{{ info.bigUnit }}</text></text>
+					<text style="margin-left:25upx;" v-else>若干{{info.smallUnit}}/<text @click="changeAuth(info.id)">{{ info.bigUnit }}</text></text>
 				</view>
 			</view>
 		</view>
 	</view>
 </template>
-
 <script>
 import AppImg from "@/components/app-img";
 export default {
@@ -44,15 +57,11 @@ export default {
 	},
 	data() {
 		return {
-			isImg:false,
 			currentStock:null,
 			hidden:0
 		};
 	},
 	mounted() {
-		setTimeout(()=>{
-			this.isImg = true;
-		},100)
 	},
 	watch: {
 		modifyStock:{
@@ -69,6 +78,10 @@ export default {
 		}
 	},
 	methods: {
+		showBigCover(url){
+			console.log(url)
+			uni.previewImage({ urls: [url] })
+		},
 		selectItem(item){
 			this.$emit("selectItem",item);
 		},
@@ -80,6 +93,9 @@ export default {
 		},
 		delEvent() {
 			this.$emit("del");
+		},
+		changeAuth(id){
+			this.$emit("modifyAuth",id)
 		}
 	}
 };
@@ -98,6 +114,7 @@ export default {
 		image{
 			width: 100%;
 			height: 100%;
+			border-radius:10upx;
 		}
 	}
 	.cmd-info_bx {

+ 47 - 8
hdApp/src/admin/ptItem/itemList.vue

@@ -1,14 +1,20 @@
 <template>
 <view class="app-content">
 	<view class="billing_box_bg">
-    <view class="input-wrap">
+    	<view class="input-wrap" style="position: fixed;z-index:99999;background-color: white;width:100%;">
 			<view class="search-bar">
-				<app-search-module v-model="py" placeholder="输入拼音首字母搜索" @input="searchFnContrapose"/>
+				<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>
+				<button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/item/add',type:2 })">创建新花材</button>
 			</view>
 		</view>
+		<view style="position:fixed;z-index:99999;text-align:center;top:100upx;background-color:white;width:100%;height:60upx;font-size:26upx;">
+			<view style="display:flex;align-items:center;justify-content:center;margin-top:12upx;">带
+			<image :src="`${constant.imgUrl}/icon/official8.png`" mode="widthFix" 
+				style="width:38upx;height:38upx;display:inline-block;"></image>
+				为平台认证品种,请优先采用,用后可改名称图片</view>
+		</view>
 		<view class="scroll-middle_bx">
 			<block v-if="!$util.isEmpty(globalClassItemListContrapose)">
 				<view scroll-y class="item_list_bx" style="width: 100%">
@@ -21,6 +27,7 @@
 							:isEdit="true"
 							:modifyStock="modifyStock"
 							@selectItem="selectItem"
+							@modifyAuth="modifyAuth"
 						></ptItemInfo>
 						</view>
 					</template>
@@ -42,6 +49,8 @@ import productMins from "@/mixins/product";
 import productContraposeMins from "@/mixins/ptProductContrapose";
 import { mapGetters } from "vuex";
 import { getAllItemClass } from "@/api/item-class";
+import { delStatusUpdate } from "@/api/product";
+import { changeAuth } from "@/api/pt-item";
 export default {
 	name: "ptItemList",
 	components: {
@@ -56,7 +65,11 @@ export default {
 			selectJobType: "getPtItem",
 			tabIndex: 0,
 			modifyStock:{},
-			allClass:[]
+			allClass:[],
+			form: {
+        id:0,
+        delStatus:0,
+      },
 		};
 	},
 	computed:{
@@ -73,6 +86,15 @@ export default {
 	onShow(){
 	},
 	methods: {
+		modifyAuth(id){
+			this.$util.confirmModal({content:'?'},() => {
+				changeAuth({id:id}).then(res=>{
+					if(res.code == 1){
+						this.$msg('success')
+					}
+				})
+			})
+		},
 		ptItemInit(){
 			this.shopId = this.getMyShopInfo.id;
 			this.initDataContrapose({ type:'waring', shopId: this.shopId,status:0,delStatus:0})
@@ -87,11 +109,27 @@ export default {
 			});
 		},
 		selectItem(item){
-			if(item.select == 2){
-				this.$msg("已导入")
-				return
+			let that = this
+			if(item.select == 2 && item.is_delete == 1){
+				that.$util.confirmModal({content:'确认恢复?'},() => {
+					delStatusUpdate({id: item.ghs_item_id, delStatus: 0}).then(res => {
+						uni.hideLoading()
+						if(res.code == 1){
+							that.$msg("恢复成功")
+						}
+					})
+				})
+			}else{
+				if(item.select == 2){
+					this.$util.confirmModal({content:'确认查看?'},() => {
+						this.$util.pageTo({ url: '/admin/item/detail?id='+item.ghs_item_id})
+					})
+					return
+				}
+				this.$util.confirmModal({content:'确认采用?'},() => {
+					this.$util.pageTo({ url: '/admin/item/detail',type:2,query:{ptItemId:item.id}})
+				})
 			}
-			this.$util.pageTo({ url: '/admin/item/detail',type:2,query:{ptItemId:item.id}})
 		},
 		affirm(val) {
 			if (val.index === 0) {
@@ -157,6 +195,7 @@ export default {
 		width: 100%;
 		height: 100%;
 		overflow: hidden;
+		margin-top:155upx;
 	}
 	.tab-view {
 		height: 100%;

+ 4 - 0
hdApp/src/api/item/index.js

@@ -14,4 +14,8 @@ export const getItemList = data => {
 
 export const getCostChangeList = data => {
 	return https.get('/cost-change/list', data)
+}
+
+export const getPoster = data => {
+	return https.get('/item/get-poster', data)
 }

+ 5 - 0
hdApp/src/api/product/index.js

@@ -1,5 +1,10 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 
+//复制新建花材
+export const cloneProduct = data => {
+	return https.post("/product/clone", data);
+};
+
 export const delStatusUpdate = data => {
 	return https.post("/product/del-status-update", data);
 };