shish 7 месяцев назад
Родитель
Сommit
c4ff1672ba

+ 14 - 26
ghsApp/src/admin/item/xj.vue

@@ -2,9 +2,9 @@
 <view class="app-content">
 <view class="app-content">
 	<view class="billing_box_bg">
 	<view class="billing_box_bg">
     	<view class="input-wrap">
     	<view class="input-wrap">
-			<text style="margin-right:30upx;">库存:{{stock}}扎</text>
-			单价:<input @focus="option.price=''" style="border:1upx solid #CCC;width:160upx;margin-right:40upx;" placeholder-style="color:#CCCCCC" v-model="option.price" type="digit" placeholder="请填写" />
-			<button class="admin-button-com mini-btn blue" @click="goChange()">修改库存</button>
+			<text style="margin-right:30upx;">{{stock}}扎</text>
+			单价:<input @focus="option.price=''" style="border:1upx solid #CCC;width:110upx;margin-right:40upx;height:70upx;" placeholder-style="color:#CCCCCC" v-model="option.price" type="digit" placeholder="" />
+			<button class="admin-button-com middle blue" @click="goChange()">修改库存</button>
 		</view>
 		</view>
 		<view class="scroll-middle_bx">
 		<view class="scroll-middle_bx">
 			<block>
 			<block>
@@ -34,7 +34,7 @@
 		<div class="app-footer footer-button">
 		<div class="app-footer footer-button">
 			<button class="admin-button-com big blue" @click="clearXj()">清除全部</button>
 			<button class="admin-button-com big blue" @click="clearXj()">清除全部</button>
 			<button class="admin-button-com big blue" @click="goBack()" style="margin-left:58upx;padding:30upx 55upx 30upx 55upx;">返回</button>
 			<button class="admin-button-com big blue" @click="goBack()" style="margin-left:58upx;padding:30upx 55upx 30upx 55upx;">返回</button>
-			<button class="admin-button-com big blue" @click="confirmXj()" style="margin-left:58upx;padding:30upx 65upx; 30upx 65upx;" >确认</button>
+			<button class="admin-button-com big blue" @click="confirmXj()" style="margin-left:58upx;padding:30upx 65upx 30upx 65upx;" >确认</button>
 		</div>
 		</div>
 
 
 	</view>
 	</view>
@@ -191,24 +191,12 @@ export default {
 	background: white;
 	background: white;
 	flex-direction: column;
 	flex-direction: column;
 	.input-wrap {
 	.input-wrap {
-		font-size:30upx;
+		font-size:49upx;
+		font-weight: normal;
 		display: flex;
 		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;
-			}
-		}
+		padding: 22upx 0upx 22upx 20upx;
+		border-bottom: 1upx solid #dddddd;
+		margin-bottom:20upx;
 	}
 	}
 	.scroll-middle_bx {
 	.scroll-middle_bx {
 		margin-bottom:110upx;
 		margin-bottom:110upx;
@@ -363,15 +351,15 @@ export default {
 	}
 	}
 }
 }
 .change-input {
 .change-input {
-	width: 285upx;
-	height: 60upx;
-	line-height: 60upx;
+	width: 260upx;
+	height: 70upx;
+	line-height: 70upx;
 	text-align: center;
 	text-align: center;
 	background: #ffffff;
 	background: #ffffff;
 	border: 1upx solid #b4b4b4;
 	border: 1upx solid #b4b4b4;
 	border-radius: 4upx;
 	border-radius: 4upx;
-	font-size: 25upx;
-	color:#5e5d5d;
+	font-size: 27upx;
+	color:#1d1d1d;
 	position: relative;
 	position: relative;
 	left:120upx;
 	left:120upx;
 	top:-36upx;
 	top:-36upx;

+ 5 - 0
ghsPad/src/api/xj/index.js

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

+ 18 - 0
ghsPad/src/mixins/product.js

@@ -3,6 +3,7 @@ import { copyObject } from "@/utils/util";
 import { getBySn } from '@/api/goods'
 import { getBySn } from '@/api/goods'
 import { showClass } from '@/api/item-class/index'
 import { showClass } from '@/api/item-class/index'
 import { showList } from '@/api/item/index'
 import { showList } from '@/api/item/index'
+import { getSjXj } from '@/api/xj'
 export default {
 export default {
 	data() {
 	data() {
 		return {
 		return {
@@ -29,6 +30,7 @@ export default {
             globalRightItemCategoryId: '',
             globalRightItemCategoryId: '',
             globalRightAllItemInfo:[],
             globalRightAllItemInfo:[],
             globalRightItemInfloList:[],
             globalRightItemInfloList:[],
+            globalGridFlowerList:[]
 		};
 		};
 	},
 	},
 	onLoad(options) {
 	onLoad(options) {
@@ -250,6 +252,22 @@ export default {
 					return false
 					return false
 				}
 				}
 			}
 			}
+
+			//多颜色选项
+			if(info.variety == 1){
+				getSjXj({itemId:info.id}).then(res=>{
+					if(res.code == 1){
+						let currentXjList = res.data.list ? res.data.list : []
+						this.globalGridFlowerList = currentXjList.map(item => ({
+							...item,
+							selectedQty: 0
+						}))
+						this.$refs.selectFlowerGridRef.open('center')
+					}
+				})
+				return true
+			}
+
 			this.$refs.selectNumPriceRef.open('center')
 			this.$refs.selectNumPriceRef.open('center')
 			this.customData = copyObject(info)
 			this.customData = copyObject(info)
 			this.$nextTick(()=>{
 			this.$nextTick(()=>{

+ 2 - 101
ghsPad/src/pages/home/components/rightItem.vue

@@ -20,11 +20,6 @@
         </view>
         </view>
         <slot name="footer"></slot>
         <slot name="footer"></slot>
 
 
-        <!-- 测试按钮:打开花材网格选择弹框 -->
-        <view class="flower-grid-test-btn" @tap="openFlowerGridPopup">
-            <text>📋 批量选择花材</text>
-        </view>
-
         <!-- 开单选花材输入数量和金额 -->
         <!-- 开单选花材输入数量和金额 -->
         <uni-popup ref="selectNumPriceRef" background-color="#fff" type="center" :animation="false">
         <uni-popup ref="selectNumPriceRef" background-color="#fff" type="center" :animation="false">
             <selectNum v-if="currentJobType=='make'" @confirmAddItemModel="confirmAddItemModel" :customData.sync="customData" @cancelKdSelectNumPrice="addItemModelHidden"></selectNum>
             <selectNum v-if="currentJobType=='make'" @confirmAddItemModel="confirmAddItemModel" :customData.sync="customData" @cancelKdSelectNumPrice="addItemModelHidden"></selectNum>
@@ -33,7 +28,7 @@
 
 
         <!-- 花材网格选择弹框 -->
         <!-- 花材网格选择弹框 -->
         <uni-popup ref="selectFlowerGridRef" background-color="#fff" type="center" :animation="false">
         <uni-popup ref="selectFlowerGridRef" background-color="#fff" type="center" :animation="false">
-            <selectFlowerGrid :flowerData="gridFlowerList" @confirm="confirmFlowerGrid" @cancel="cancelFlowerGrid"></selectFlowerGrid>
+            <selectFlowerGrid :flowerData="globalGridFlowerList" @confirm="confirmFlowerGrid" @cancel="cancelFlowerGrid"></selectFlowerGrid>
         </uni-popup>
         </uni-popup>
 
 
     </view>
     </view>
@@ -50,8 +45,7 @@ export default {
     data(){
     data(){
         return {
         return {
             currentJobType:'bill',
             currentJobType:'bill',
-            currentJobId:0,
-            gridFlowerList:[]
+            currentJobId:0
         }
         }
     },
     },
 	props: {
 	props: {
@@ -118,98 +112,6 @@ export default {
         addListenScan(){
         addListenScan(){
             this.listenScanItem()
             this.listenScanItem()
         },
         },
-        // 打开花材网格选择弹框
-        openFlowerGridPopup() {
-            this.$util.hitVoice()
-            
-            // 如果有真实数据,使用真实数据;否则使用模拟数据
-            const mockFlowers = [
-                {
-                    id: 1,
-                    name: '自由女神A级',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23C41E3A" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23fff" text-anchor="middle" dy=".3em"%3E自由女神%3C/text%3E%3C/svg%3E',
-                    price: 88,
-                    stock: 150,
-                    property: 0
-                },
-                {
-                    id: 2,
-                    name: '香槟玫瑰',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23F4D03F" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23333" text-anchor="middle" dy=".3em"%3E香槟玫瑰%3C/text%3E%3C/svg%3E',
-                    price: 65,
-                    stock: 200,
-                    property: 0
-                },
-                {
-                    id: 3,
-                    name: '白玫瑰',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FFFFFF" width="200" height="200"/%3E%3Crect fill="none" stroke="%23ddd" stroke-width="2" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23333" text-anchor="middle" dy=".3em"%3E白玫瑰%3C/text%3E%3C/svg%3E',
-                    price: 55,
-                    stock: 180,
-                    property: 0
-                },
-                {
-                    id: 4,
-                    name: '粉玫瑰',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FFB6C1" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23fff" text-anchor="middle" dy=".3em"%3E粉玫瑰%3C/text%3E%3C/svg%3E',
-                    price: 60,
-                    stock: 160,
-                    property: 0
-                },
-                {
-                    id: 5,
-                    name: '向日葵',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FFD700" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23333" text-anchor="middle" dy=".3em"%3E向日葵%3C/text%3E%3C/svg%3E',
-                    price: 45,
-                    stock: 120,
-                    property: 0
-                },
-                {
-                    id: 6,
-                    name: '郁金香',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FF69B4" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23fff" text-anchor="middle" dy=".3em"%3E郁金香%3C/text%3E%3C/svg%3E',
-                    price: 50,
-                    stock: 140,
-                    property: 0
-                },
-                {
-                    id: 7,
-                    name: '百合',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FFF8DC" width="200" height="200"/%3E%3Crect fill="none" stroke="%23ddd" stroke-width="2" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23333" text-anchor="middle" dy=".3em"%3E百合%3C/text%3E%3C/svg%3E',
-                    price: 75,
-                    stock: 100,
-                    property: 0
-                },
-                {
-                    id: 8,
-                    name: '康乃馨',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FFB6C1" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23fff" text-anchor="middle" dy=".3em"%3E康乃馨%3C/text%3E%3C/svg%3E',
-                    price: 35,
-                    stock: 250,
-                    property: 0
-                },
-                {
-                    id: 9,
-                    name: '绣球花',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%239370DB" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23fff" text-anchor="middle" dy=".3em"%3E绣球花%3C/text%3E%3C/svg%3E',
-                    price: 70,
-                    stock: 110,
-                    property: 0
-                }
-            ]
-            
-            // 使用真实数据或模拟数据
-            const sourceData = this.globalRightItemInfloList && this.globalRightItemInfloList.length > 0 
-                ? this.globalRightItemInfloList 
-                : mockFlowers
-            
-            // 将列表数据传递给弹框,并重置选择数量
-            this.gridFlowerList = sourceData.map(item => ({
-                ...item,
-                selectedQty: 0
-            }))
-            this.$refs.selectFlowerGridRef.open()
-        },
         // 确认花材网格选择
         // 确认花材网格选择
         confirmFlowerGrid(selectedItems) {
         confirmFlowerGrid(selectedItems) {
             // 处理选中的花材
             // 处理选中的花材
@@ -218,7 +120,6 @@ export default {
                 // 例如添加到购物车或其他操作
                 // 例如添加到购物车或其他操作
                 console.log(`已选择: ${item.name}, 数量: ${item.selectedQty}`)
                 console.log(`已选择: ${item.name}, 数量: ${item.selectedQty}`)
             })
             })
-            
             this.$msg(`已选择 ${selectedItems.length} 种花材`)
             this.$msg(`已选择 ${selectedItems.length} 种花材`)
             this.$refs.selectFlowerGridRef.close()
             this.$refs.selectFlowerGridRef.close()
         },
         },

+ 3 - 95
ghsPad/src/pages/home/components/selectFlowerGrid.vue

@@ -2,7 +2,7 @@
     <view class="flower-grid-popup">
     <view class="flower-grid-popup">
         <!-- 标题栏 -->
         <!-- 标题栏 -->
         <view class="popup-header">
         <view class="popup-header">
-            <text class="popup-title">多颜色选择</text>
+            <text class="popup-title">多颜色</text>
             <view class="close-btn" @tap="handleCancel">
             <view class="close-btn" @tap="handleCancel">
                 <text>✕</text>
                 <text>✕</text>
             </view>
             </view>
@@ -16,7 +16,6 @@
                     <view class="flower-img-box">
                     <view class="flower-img-box">
                         <image 
                         <image 
                             :src="item.cover" 
                             :src="item.cover" 
-                            :style="{ backgroundColor: getImageBgColor(item.id) }"
                             mode="aspectFill"
                             mode="aspectFill"
                             class="flower-img"
                             class="flower-img"
                             lazy-load="false">
                             lazy-load="false">
@@ -72,89 +71,14 @@ export default {
     data() {
     data() {
         return {
         return {
             flowerList: [],
             flowerList: [],
-            scrollHeight: '600upx',
-            // 默认模拟数据
-            defaultMockFlowers: [
-                {
-                    id: 1,
-                    name: '自由女神A级',
-                    cover: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><rect fill="%23C41E3A" width="200" height="200"/><text x="100" y="100" font-size="24" fill="%23fff" text-anchor="middle" dominant-baseline="middle">自由女神</text></svg>',
-                    price: 88,
-                    stock: 150,
-                    property: 0
-                },
-                {
-                    id: 2,
-                    name: '香槟玫瑰',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23F4D03F" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23333" text-anchor="middle" dy=".3em"%3E香槟玫瑰%3C/text%3E%3C/svg%3E',
-                    price: 65,
-                    stock: 200,
-                    property: 0
-                },
-                {
-                    id: 3,
-                    name: '白玫瑰',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FFFFFF" width="200" height="200"/%3E%3Crect fill="none" stroke="%23ddd" stroke-width="2" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23333" text-anchor="middle" dy=".3em"%3E白玫瑰%3C/text%3E%3C/svg%3E',
-                    price: 55,
-                    stock: 180,
-                    property: 0
-                },
-                {
-                    id: 4,
-                    name: '粉玫瑰',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FFB6C1" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23fff" text-anchor="middle" dy=".3em"%3E粉玫瑰%3C/text%3E%3C/svg%3E',
-                    price: 60,
-                    stock: 160,
-                    property: 0
-                },
-                {
-                    id: 5,
-                    name: '向日葵',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FFD700" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23333" text-anchor="middle" dy=".3em"%3E向日葵%3C/text%3E%3C/svg%3E',
-                    price: 45,
-                    stock: 120,
-                    property: 0
-                },
-                {
-                    id: 6,
-                    name: '郁金香',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FF69B4" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23fff" text-anchor="middle" dy=".3em"%3E郁金香%3C/text%3E%3C/svg%3E',
-                    price: 50,
-                    stock: 140,
-                    property: 0
-                },
-                {
-                    id: 7,
-                    name: '百合',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FFF8DC" width="200" height="200"/%3E%3Crect fill="none" stroke="%23ddd" stroke-width="2" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23333" text-anchor="middle" dy=".3em"%3E百合%3C/text%3E%3C/svg%3E',
-                    price: 75,
-                    stock: 100,
-                    property: 0
-                },
-                {
-                    id: 8,
-                    name: '康乃馨',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FFB6C1" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23fff" text-anchor="middle" dy=".3em"%3E康乃馨%3C/text%3E%3C/svg%3E',
-                    price: 35,
-                    stock: 250,
-                    property: 0
-                },
-                {
-                    id: 9,
-                    name: '绣球花',
-                    cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%239370DB" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23fff" text-anchor="middle" dy=".3em"%3E绣球花%3C/text%3E%3C/svg%3E',
-                    price: 70,
-                    stock: 110,
-                    property: 0
-                }
-            ]
+            scrollHeight: '600upx'
         }
         }
     },
     },
     watch: {
     watch: {
         flowerData: {
         flowerData: {
             handler(newData) {
             handler(newData) {
                 // 如果没有传入数据或数据为空,使用默认模拟数据
                 // 如果没有传入数据或数据为空,使用默认模拟数据
-                const dataToUse = (newData && newData.length > 0) ? newData : this.defaultMockFlowers
+                const dataToUse = (newData && newData.length > 0) ? newData : []
                 
                 
                 this.flowerList = dataToUse.map(item => ({
                 this.flowerList = dataToUse.map(item => ({
                     ...item,
                     ...item,
@@ -216,22 +140,6 @@ export default {
             }
             }
 
 
             this.$emit('confirm', selectedItems)
             this.$emit('confirm', selectedItems)
-        },
-
-        // 获取图片背景色
-        getImageBgColor(id) {
-            const colors = [
-                '#C41E3A',  // 自由女神
-                '#F4D03F',  // 香槟玫瑰
-                '#FFFFFF',  // 白玫瑰
-                '#FFB6C1',  // 粉玫瑰
-                '#FFD700',  // 向日葵
-                '#FF69B4',  // 郁金香
-                '#FFF8DC',  // 百合
-                '#FFB6C1',  // 康乃馨
-                '#9370DB'   // 绣球花
-            ]
-            return colors[id - 1] || '#f5f5f5'
         }
         }
     }
     }
 }
 }