فهرست منبع

颜色管理优化

shish 4 سال پیش
والد
کامیت
c0b736806b

+ 1 - 1
ghsApp/src/admin/home/apply.vue

@@ -35,7 +35,7 @@ export default {
                     list:[
                     list:[
                         {name: "花材",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/item/list"},
                         {name: "花材",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/item/list"},
                         {name: "花材分类",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/list"},
                         {name: "花材分类",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/list"},
-                        {name: "小菊颜色",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/item/xjSelect"},
+                        {name: "花材颜色",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/item/colorManage"},
                         {name: "排序加价",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/add"},
                         {name: "排序加价",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/add"},
                         {name: "停用花材",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/item/list?delStatus=1"},
                         {name: "停用花材",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/item/list?delStatus=1"},
                     ]
                     ]

+ 194 - 0
ghsApp/src/admin/item/colorManage.vue

@@ -0,0 +1,194 @@
+<template>
+	<view class="app-main app-content">
+		<view class="list-wrap role-list">
+			<block v-if="!$util.isEmpty(colorList)">
+				<view class="list" v-for="(item, index) in colorList" :key="index">
+					<view class="app-size-32" @click="changeColor(item)" style="width:700upx;">{{ item.name }}</view>
+				</view>
+			</block>
+			<block v-else>
+				<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(colorList)" />
+			</block>
+		</view>
+	</view>
+</template>
+<script>
+import AppAvatarModule from '@/components/module/app-avatar'
+import AppWrapperEmpty from '@/components/app-wrapper-empty'
+import ModalModule from '@/components/plugin/modal'
+import AppSearchModule from "@/components/module/app-search";
+import { getColorList } from "@/api/item"
+import { mapGetters } from "vuex"
+export default {
+	name: 'colorManage',
+	components: {
+		AppAvatarModule,
+		AppWrapperEmpty,
+		ModalModule,
+		AppSearchModule
+	},
+	mixins: [],
+	data() {
+		return {
+			colorList:[]
+		}
+	},
+	computed: {
+		...mapGetters({ loginInfo: "getLoginInfo" }),
+	},
+	methods: {
+		async init() {
+			this.getItemList()
+		},
+		getItemList() {
+			getColorList().then(res => {
+				if(res.code == 1){
+					this.colorList = res.data.list
+				}
+			})
+		},
+		changeColor(item){
+			this.$util.pageTo({url: "/admin/item/xjSelect?itemId="+item.id,type:2})
+		}
+	}
+}
+</script>
+<style lang="scss" scoped>
+	.app-content {
+		padding-bottom:50upx;
+	}
+	.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;
+		}
+	}
+	// 列表公共
+	.list-wrap {
+		background-color: #fff;
+		margin-top:0upx;
+		.list {
+			@include disFlex(center, flex-start);
+			margin: 0 30upx;
+			padding: 30upx 0;
+			border-bottom: 2upx solid $borderColor;
+		}
+	}
+	// 员工列表
+	.staff-list {
+		.list-det {
+			width: calc(100% - 110upx);
+			color: $fontColor3;
+			margin-left: 20upx;
+			@include disFlex(center, space-between);
+			.list-det-left {
+				.staff-name {
+					color: #333;
+					font-size: 30upx;
+					font-weight: 600;
+					margin-right: 10upx;
+					display: inline-block;
+					overflow: hidden;
+					text-overflow:ellipsis;
+					white-space: nowrap;
+					width:150upx;
+				}
+				.flex-center {
+					margin-top: 10upx;
+				}
+				.status-list {
+					margin-left: 25upx;
+					&:first-child {
+						margin-left: 0;
+					}
+					.iconfont {
+						// color: $fontColor3;
+						font-size: 24upx;
+						margin-right: 10upx;
+					}
+				}
+			}
+			.list-det-right {
+				@include disFlex(center, flex-start);
+				& > div {
+					margin-left: 50upx;
+					&:first-child {
+						margin-left: 0;
+					}
+				}
+				.iconfont {
+					font-size: 36upx;
+					color: $fontColor3;
+				}
+			}
+		}
+	}
+	// 角色管理
+	.role-list {
+		.list {
+			justify-content: space-between;
+		}
+		.role-option {
+			@include disFlex(center, flex-start);
+			& > div {
+				margin-left: 50upx;
+				&:first-child {
+					margin-left: 0;
+				}
+			}
+			.iconfont {
+				font-size: 36upx;
+				color: $fontColor3;
+			}
+		}
+	}
+	// 操作记录
+	.axis-wrap {
+		position: relative;
+		padding: 30upx 30upx 30upx 40upx;
+		background-color: #fff;
+		.axis-list {
+			&:last-child .axis-det {
+				margin-bottom: 0;
+			}
+		}
+		.axis-title {
+			font-size: 30upx;
+			font-weight: 600;
+			margin-bottom: 14upx;
+		}
+		.axis-det {
+			color: $fontColor2;
+			margin-bottom: 40upx;
+			& > div {
+				margin-top: 6upx;
+				&:first-child {
+					margin-top: 0;
+				}
+			}
+		}
+	}
+	// 按钮
+	.app-footer {
+		justify-content: flex-end;
+		.admin-button-com {
+			width: 160upx;
+			margin-right: 30upx;
+		}
+	}
+</style>

+ 16 - 3
ghsApp/src/admin/item/detail.vue

@@ -84,7 +84,16 @@
         </tui-list-cell>
         </tui-list-cell>
 
 
         <tui-list-cell class="line-cell" :hover="false">
         <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.variety == 0 ? false : true" @change="varietyChange" style="transform: scale(0.8,0.8)" />
+            <text v-if="form.variety == 1">可选</text>
+            <text v-else>不可选</text>
+          </view>
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <view class="tui-title">开单基数</view>
           <input v-model="form.scanNum" style="width:300upx;" @focus="form.scanNum=''" placeholder-class="phcolor" class="tui-input" name="scanNum" placeholder="0表示增加1扎,大于0表示增加多少支" maxlength="50" type="number" />
           <input v-model="form.scanNum" style="width:300upx;" @focus="form.scanNum=''" placeholder-class="phcolor" class="tui-input" name="scanNum" placeholder="0表示增加1扎,大于0表示增加多少支" maxlength="50" type="number" />
         </tui-list-cell>
         </tui-list-cell>
 
 
@@ -190,7 +199,8 @@ export default {
         status:2,
         status:2,
         delStatus:0,
         delStatus:0,
         itemId:0,
         itemId:0,
-        scanNum:0
+        scanNum:0,
+        variety:0
       },
       },
       itemClassSelectedData:{},
       itemClassSelectedData:{},
       itemClassData:[],
       itemClassData:[],
@@ -284,6 +294,9 @@ export default {
     goStockDetail(id){
     goStockDetail(id){
 				this.$util.pageTo({url: "/pagesStorehouse/stockWarn/detailed?id="+id})
 				this.$util.pageTo({url: "/pagesStorehouse/stockWarn/detailed?id="+id})
 		},
 		},
+    varietyChange(e){
+      this.form.variety = e.detail.value ? 1 : 0;
+    },
     statusChange(e){
     statusChange(e){
       this.form.status = e.detail.value ? 1 : 2;
       this.form.status = e.detail.value ? 1 : 2;
     },
     },
@@ -556,7 +569,7 @@ export default {
         {
         {
           name: "scanNum",
           name: "scanNum",
           rule: ["required"],
           rule: ["required"],
-          msg: ["请填写扫码增加数量"]
+          msg: ["请填写开单基数数量"]
         }
         }
       ];
       ];
       // 进行表单检查
       // 进行表单检查

+ 1 - 2
ghsApp/src/admin/item/xj.vue

@@ -140,9 +140,8 @@ export default {
 			uni.navigateBack({});
 			uni.navigateBack({});
 		},
 		},
 		init(){
 		init(){
-			getSjXj().then(res => {
+			getSjXj({itemId:0}).then(res => {
 				this.xjList = res.data.list
 				this.xjList = res.data.list
-				console.log('list',this.xjList)
 			});
 			});
 		}
 		}
 	}
 	}

+ 8 - 14
ghsApp/src/admin/item/xjSelect.vue

@@ -1,13 +1,13 @@
 <template>
 <template>
 <view class="app-content">
 <view class="app-content">
   <view>
   <view>
-    <form @submit="formSubmit">
+    <form @submit="saveAllImg">
       <div class="module-com input-line-wrap">
       <div class="module-com input-line-wrap">
 		  
 		  
       <div class="module-com input-line-wrap goods-wrap">
       <div class="module-com input-line-wrap goods-wrap">
         <div class="module-tit">
         <div class="module-tit">
           <span>选择图片</span>
           <span>选择图片</span>
-          <span class="app-color-3">(每次最多可选9张)</span>
+          <span class="app-color-3">(最多可选9张)</span>
         </div>
         </div>
         <div class="module-det">
         <div class="module-det">
           <htz-image-upload :max="9" :compress="true" v-model="xjImgData" :headers="headers"
           <htz-image-upload :max="9" :compress="true" v-model="xjImgData" :headers="headers"
@@ -23,7 +23,7 @@
 	</view>
 	</view>
 
 
 	<view style="text-align:center;border-top:1upx dashed #cccccc;padding-top:30upx;padding-bottom:30upx;">
 	<view style="text-align:center;border-top:1upx dashed #cccccc;padding-top:30upx;padding-bottom:30upx;">
-		<button @click="clearXj" class="admin-button-com small default">清空全部小菊</button>
+		<button @click="clearXj" class="admin-button-com small default">清空全部</button>
 	</view>
 	</view>
 
 
 	<view class="billing_box_bg">
 	<view class="billing_box_bg">
@@ -95,17 +95,12 @@ export default {
 
 
 		const token = uni.getStorageSync('token')
 		const token = uni.getStorageSync('token')
 		this.headers.token = token
 		this.headers.token = token
-
-	},
-	onPullDownRefresh() {
-	},
-	onShow(){
 	},
 	},
 	methods: {
 	methods: {
 		clearXj(){
 		clearXj(){
 			let that = this
 			let that = this
-			that.$util.confirmModal({content:'确认清空全部小菊?'},() => {
-				clearAll().then(res => {
+			that.$util.confirmModal({content:'确认清空全部?'},() => {
+				clearAll({itemId:this.option.itemId}).then(res => {
 					that.$msg(res.msg)
 					that.$msg(res.msg)
 					if(res.code == 1){
 					if(res.code == 1){
 						that.initXj()
 						that.initXj()
@@ -133,7 +128,7 @@ export default {
 			this.init = false
 			this.init = false
 		},
 		},
 		initXj(){
 		initXj(){
-			getFilterXj().then(res => {
+			getFilterXj({itemId:this.option.itemId}).then(res => {
 				this.xjList = res.data.list
 				this.xjList = res.data.list
 			});
 			});
 		},
 		},
@@ -148,15 +143,14 @@ export default {
 			const index = res.index
 			const index = res.index
 			this.uploadXjImg.splice(index,1)
 			this.uploadXjImg.splice(index,1)
 		},
 		},
-		// 表单验证
-		formSubmit(e) {
+		saveAllImg(e) {
 			let that = this
 			let that = this
 			if (that.$util.isEmpty(this.uploadXjImg)){
 			if (that.$util.isEmpty(this.uploadXjImg)){
 				that.$msg('请选择图片')
 				that.$msg('请选择图片')
 				return false
 				return false
 			}
 			}
 			let imgData = JSON.stringify(this.uploadXjImg)
 			let imgData = JSON.stringify(this.uploadXjImg)
-			batchAdd({xjData:imgData}).then(res=>{
+			batchAdd({xjData:imgData,itemId:this.option.itemId}).then(res=>{
 				that.$msg(res.msg)
 				that.$msg(res.msg)
 				if(res.code == 1){
 				if(res.code == 1){
 					that.initXj()
 					that.initXj()

+ 5 - 0
ghsApp/src/api/item/index.js

@@ -0,0 +1,5 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const getColorList = data => {
+	return https.get('/item/color-list', data)
+}

+ 2 - 1
ghsApp/src/pages.json

@@ -348,7 +348,8 @@
 				{"path": "copy","style": {"navigationBarTitleText": "复制花材"}},
 				{"path": "copy","style": {"navigationBarTitleText": "复制花材"}},
 				{"path": "xj","style": {"navigationBarTitleText": "请选择颜色"}},
 				{"path": "xj","style": {"navigationBarTitleText": "请选择颜色"}},
 				{"path": "xjSelect","style": {"navigationBarTitleText": "小菊颜色选择"}},
 				{"path": "xjSelect","style": {"navigationBarTitleText": "小菊颜色选择"}},
-				{"path": "rechargeHb","style": {"navigationBarTitleText": "充值活动"}}
+				{"path": "rechargeHb","style": {"navigationBarTitleText": "充值活动"}},
+				{"path": "colorManage","style": {"navigationBarTitleText": "花材颜色"}}
 			]
 			]
 		},
 		},
 		{
 		{

+ 1 - 1
hdApp/src/pages.json

@@ -365,7 +365,7 @@
 				{ "path": "gatherResult", "style": { "navigationBarTitleText": "", "enablePullDownRefresh": false } },
 				{ "path": "gatherResult", "style": { "navigationBarTitleText": "", "enablePullDownRefresh": false } },
 				{ "path": "purDetails", "style": { "navigationBarTitleText": "采购详情", "enablePullDownRefresh": true } },
 				{ "path": "purDetails", "style": { "navigationBarTitleText": "采购详情", "enablePullDownRefresh": true } },
 				{ "path": "info", "style": { "navigationBarTitleText": "订单详情", "enablePullDownRefresh": true } },
 				{ "path": "info", "style": { "navigationBarTitleText": "订单详情", "enablePullDownRefresh": true } },
-				{ "path": "xj", "style": { "navigationBarTitleText": "选择小菊颜色", "enablePullDownRefresh": true } },
+				{ "path": "xj", "style": { "navigationBarTitleText": "选择颜色", "enablePullDownRefresh": true } },
 				{ "path": "refundDetail", "style": { "navigationBarTitleText": "退款详情", "enablePullDownRefresh": true } },
 				{ "path": "refundDetail", "style": { "navigationBarTitleText": "退款详情", "enablePullDownRefresh": true } },
 				{ "path": "level", "style": { "navigationBarTitleText": "会员等级", "enablePullDownRefresh": true } },
 				{ "path": "level", "style": { "navigationBarTitleText": "会员等级", "enablePullDownRefresh": true } },
 				{ "path": "bookProduct", "style": { "navigationBarTitleText": "预订花材", "enablePullDownRefresh": true } },
 				{ "path": "bookProduct", "style": { "navigationBarTitleText": "预订花材", "enablePullDownRefresh": true } },

+ 1 - 12
hdApp/src/pagesPurchase/components/item.vue

@@ -5,7 +5,7 @@
 		</view>
 		</view>
 		<view class="cmd-info_bx">
 		<view class="cmd-info_bx">
 			<view class="tit" >{{ info.itemName}}</view>
 			<view class="tit" >{{ info.itemName}}</view>
-			<view class="kc num-open_bx flex-space" v-if="type == COMMODITY_TYPE.COMMON">
+			<view class="kc num-open_bx flex-space">
 				<view v-if="!offPrice">
 				<view v-if="!offPrice">
 					<view class="flex-space" style="margin-top:15upx" v-if="Number(info.discountPrice)>0">
 					<view class="flex-space" style="margin-top:15upx" v-if="Number(info.discountPrice)>0">
 						<view style="padding:2upx 10upx 5upx 10upx;text-align: center;color: red;border: 1px solid red;margin-right: 20upx;line-height: 1;font-size: 20upx">
 						<view style="padding:2upx 10upx 5upx 10upx;text-align: center;color: red;border: 1px solid red;margin-right: 20upx;line-height: 1;font-size: 20upx">
@@ -31,17 +31,6 @@
 					</view>
 					</view>
 				</view>
 				</view>
 			</view>
 			</view>
-			<view class="num-open_bx flex-space" v-if="type == COMMODITY_TYPE.CHANGE">
-				<view class="price" v-if="!offPrice">¥{{ showPrice }}</view>
-				<view class="price" v-else></view>
-				<view class="open-bx" style="padding-bottom: 40upx" >
-					<allSelectInput :inputType="'digit'" :isActive="isAloneAllActive" :isFocus="isAloneAllFocus" :value="changeAutoPrice" :placeholder="'自动调价'"
-									@deleteInputVal="deleteInputVal" @initAllInput="initAloneAllInput" @moveAllInput="moveAllInput">
-					</allSelectInput>
-					<i :class="isShowSucceed?'position iconfont iconjihuo':'position'" ></i>
-					<view class="btn-box" @click="changePriceEvent">确定</view>
-				</view>
-			</view>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>

+ 31 - 8
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -60,7 +60,7 @@
 					<view class="item_list_bx selectAll" v-for="(classItem, classIndex) in filterProductInfo" :key="classIndex" :id="`class_${classIndex}`">
 					<view class="item_list_bx selectAll" v-for="(classItem, classIndex) in filterProductInfo" :key="classIndex" :id="`class_${classIndex}`">
 						<view class="item_list_title">{{ classItem.className }}</view>
 						<view class="item_list_title">{{ classItem.className }}</view>
 						<template v-for="(productItem, productIndex) in classItem.child">
 						<template v-for="(productItem, productIndex) in classItem.child">
-							<view style="height: 185upx" :id="`class_${classItem.classId}_${productItem.id}`" :key="productIndex">
+							<view :class="[productItem.variety == 1 ? 'color-box' : 'box']"  :id="`class_${classItem.classId}_${productItem.id}`" :key="productIndex">
 								<Commondity v-if="classItem.isActive"
 								<Commondity v-if="classItem.isActive"
 									:info="productItem"
 									:info="productItem"
 									:offVerifyRepertory="true"
 									:offVerifyRepertory="true"
@@ -74,6 +74,9 @@
 									@showBigCover="showBigCover"
 									@showBigCover="showBigCover"
 									@goToSpecialVariety="goToSpecialVariety"
 									@goToSpecialVariety="goToSpecialVariety"
 								></Commondity>
 								></Commondity>
+								<view v-if="productItem.variety && productItem.variety == 1" class="has-color" @click="goToSpecialVariety(productItem)">
+									<view class="has-color-button">点我选颜色</view>
+								</view>
 							</view>
 							</view>
 						</template>
 						</template>
 					</view>
 					</view>
@@ -333,7 +336,7 @@ export default {
 			if(item.variety == 0){
 			if(item.variety == 0){
 				this.delEvent(item)
 				this.delEvent(item)
 			}else{
 			}else{
-				this.$msg('小菊请在列表里修改')
+				this.$msg('多颜色请在列表里修改')
 			}
 			}
 		},
 		},
 		addEvents(item) {
 		addEvents(item) {
@@ -351,7 +354,7 @@ export default {
 				}
 				}
 				this.addEvent(item)
 				this.addEvent(item)
 			}else{
 			}else{
-				this.$msg('小菊请在列表里修改')
+				this.$msg('多颜色请在列表里修改')
 			}
 			}
 		},
 		},
 		customUpdate(item) {
 		customUpdate(item) {
@@ -362,7 +365,7 @@ export default {
 				}
 				}
 				this.customNum({ ...item, bigCount: item.bigCount, smallCount: item.smallCount })
 				this.customNum({ ...item, bigCount: item.bigCount, smallCount: item.smallCount })
 			}else{
 			}else{
-				this.$msg('小菊请在列表里修改')
+				this.$msg('多颜色请在列表里修改')
 			}
 			}
 		},
 		},
 		showCartItem(){
 		showCartItem(){
@@ -391,7 +394,7 @@ export default {
 			if(info.stock <= 0){
 			if(info.stock <= 0){
 				uni.showToast({title:"没有库存",icon:"none"})
 				uni.showToast({title:"没有库存",icon:"none"})
 			}else{
 			}else{
-				this.$util.pageTo({url: "/pagesPurchase/xj",query: {stock:info.stock,price: info.price,ghsId:this.option.id}})
+				this.$util.pageTo({url: "/pagesPurchase/xj",query: {stock:info.stock,price: info.price,ghsId:this.option.id,itemId:info.id}})
 			}
 			}
 		},
 		},
 	    showPopup() {
 	    showPopup() {
@@ -799,9 +802,29 @@ export default {
 	}
 	}
 	.item_list_bx {
 	.item_list_bx {
 		padding: 40upx 16upx;
 		padding: 40upx 16upx;
-    &:last-child{
-      margin-bottom: 70upx;
-    }
+		&:last-child{
+			margin-bottom: 70upx;
+		}
+		.box{
+			height: 185upx
+		}
+		.color-box{
+			height: 285upx
+		}
+		.has-color{
+			display:flex;
+			justify-content:center;
+			align-items:center;
+			height:110upx;
+			border-bottom:1upx solid rgb(247, 243, 243);
+			.has-color-button{
+				border:1upx solid #5a99f7;
+				border-radius:15upx;
+				padding:13upx 16upx;
+				font-size:30upx;
+				color:#3385ff;
+			}
+		}
 	}
 	}
 	.item_list_title {
 	.item_list_title {
 		margin-bottom: 20upx;
 		margin-bottom: 20upx;

+ 1 - 1
hdApp/src/pagesPurchase/xj.vue

@@ -147,7 +147,7 @@ export default {
 
 
 		},
 		},
 		init(){
 		init(){
-			getGhsXj({ghsId:this.option.ghsId}).then(res => {
+			getGhsXj({ghsId:this.option.ghsId,itemId:this.option.itemId}).then(res => {
 				this.xjList = res.data.list
 				this.xjList = res.data.list
 				console.log('list',this.xjList)
 				console.log('list',this.xjList)
 			});
 			});