shish 2 maanden geleden
bovenliggende
commit
9324820094
3 gewijzigde bestanden met toevoegingen van 142 en 6 verwijderingen
  1. 36 2
      hdApp/src/admin/item/components/item2.vue
  2. 97 3
      hdApp/src/admin/item/list2.vue
  3. 9 1
      hdApp/src/api/item/index.js

+ 36 - 2
hdApp/src/admin/item/components/item2.vue

@@ -61,7 +61,12 @@
 			</view>
 		</view>
 	</view>
-	
+
+	<view class="remark-bar" v-if="info.itemRemark">
+		<text class="remark-label">备注</text>
+		<text class="remark-text">{{ info.itemRemark }}</text>
+	</view>
+
 	<view class="bottom-buttons-container">
 		<text class="bottom-button" @click.stop="doPrintLabel(info,1)">价码</text>
 		<text class="bottom-button" @click.stop="doPrintLabel(info,0)">标签</text>
@@ -135,7 +140,36 @@ export default {
 </script>
 <style lang="scss" scoped>
 .product{
-	height:230upx;
+	min-height:230upx;
+}
+.remark-bar {
+	display: flex;
+	align-items: center;
+	margin-top: 4upx;
+	margin-bottom: 6upx;
+	padding: 6upx 10upx;
+	background: #fff8f2;
+	border-left: 5upx solid #ff8c3a;
+	box-sizing: border-box;
+}
+.remark-label {
+	font-size: 28upx;
+	font-weight: bold;
+	color: #ff8c3a;
+	line-height: 1.2;
+	margin-right: 10upx;
+	flex-shrink: 0;
+}
+.remark-text {
+	font-size: 30upx;
+	font-weight: bold;
+	color: #ff2842;
+	line-height: 1.3;
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+	flex: 1;
+	min-width: 0;
 }
 .bottom-buttons-container{
 	display: flex;

+ 97 - 3
hdApp/src/admin/item/list2.vue

@@ -46,8 +46,9 @@
 						<view class="item_list_bx selectAll">
 							<view v-if="!$util.isEmpty(globalItemData)">
 								<template v-for="(productItem, productIndex) in globalItemData">
-									<view class="item_list_title" :key="`title-${productIndex}`" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
-									<view style="height:255upx" :key="productIndex">
+									<view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
+									<!-- 下面这个key显示有问题,不要动,动了好像会有问题!!!! -->
+									<view class="item-row" :class="{ 'item-row--remark': productItem.itemRemark }" :key="productIndex">
 										<ItemStock :info="productItem" @moreAction="moreAction" 
 										@doPrintLabel="doPrintLabel" @cancelDiscountFn="cancelDiscountFn" @cancelFullOff="cancelFullOff"
 										:ref="`productRef${productItem.id}`" @hideChangeFn="hideChangeFn" 
@@ -146,6 +147,12 @@
 				<view class="action-button-item">
 					<button class="action-button" @click="delItem()">删除</button>
 				</view>
+				<view class="action-button-item">
+					<button class="action-button" @click="addItemRemark()">增加备注</button>
+				</view>
+				<view class="action-button-item">
+					<button class="action-button" @click="clearItemRemarkFn()">清除备注</button>
+				</view>
 				<view class="action-button-item">
 					<button class="action-button" @click="sendStock()">分配库存</button>
 				</view>
@@ -194,6 +201,18 @@
 		</template>
 		</modal-module>
 
+		<modal-module :show="remarkShow" @click="remarkConfirm" :maskClosable="true" title="花材备注" padding="30rpx 30rpx" >
+		<template v-slot:content>
+			<view class="app-modal-input-wrap">
+			<view class="inp-list-line">
+			<view class="line-input">
+			<input type="text" style="width:90%;text-align:center;" @blur="remarkBlur" :focus="remarkFocus" v-model="remarkText" maxlength="200" :adjust-position="false" class="inp-input" placeholder="请输入备注" />
+			</view>
+			</view>
+		</view>
+		</template>
+		</modal-module>
+
 	</view>
 </template>
 <script>
@@ -204,7 +223,8 @@ 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,getPoster,breakItem,changeFrontHide,applyAuth,changeHalf,moveToLosing } from '@/api/item'
+import { getHdPoster,getPoster,breakItem,changeFrontHide,applyAuth,changeHalf,moveToLosing,updateItemRemark,clearItemRemark } 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"
 import { wastage } from "@/api/order"
@@ -214,6 +234,7 @@ export default {
 		AppSearchModule,
 		AppWrapperEmpty,
 		ItemStock,
+		uniPopup,
 		ModalModule
 	},
 	mixins: [productMins],
@@ -241,6 +262,9 @@ export default {
 			partNum:'',
 			partShow:false,
 			partFocus:false,
+			remarkShow: false,
+			remarkText: '',
+			remarkFocus: false
 		};
 	},
 	computed:{
@@ -508,6 +532,70 @@ export default {
 				}
 			})
 		},
+		addItemRemark(){
+			this.closeRightShow()
+			this.remarkText = this.currentInfo.itemRemark || ''
+			this.remarkShow = true
+			let that = this
+			setTimeout(() => {
+				that.$nextTick(() => {
+					that.remarkFocus = true
+				})
+			}, 300)
+		},
+		remarkBlur(){
+			this.remarkFocus = false
+		},
+		closeRemarkPop(){
+			this.remarkShow = false
+			this.remarkFocus = false
+			this.remarkText = ''
+		},
+		remarkConfirm(val){
+			let that = this
+			if (val.index == 0) {
+				this.closeRemarkPop()
+				return
+			}
+			const text = (that.remarkText || '').trim()
+			if (!text) {
+				that.$msg('请填写备注')
+				return
+			}
+			updateItemRemark({ id: that.currentInfo.id, itemRemark: text }).then(res => {
+				if (res.code == 1) {
+					that.syncItemRemark(that.currentInfo.id, text)
+					that.closeRemarkPop()
+					that.$msg(res.msg || '保存成功')
+				}
+			})
+		},
+		clearItemRemarkFn(){
+			let that = this
+			this.closeRightShow()
+			if (!that.currentInfo.itemRemark) {
+				that.$msg('暂无备注')
+				return
+			}
+			that.$util.confirmModal({ content: '确定清除备注?' }, () => {
+				clearItemRemark({ id: that.currentInfo.id }).then(res => {
+					if (res.code == 1) {
+						that.syncItemRemark(that.currentInfo.id, '')
+						that.$msg(res.msg || '清除成功')
+					}
+				})
+			})
+		},
+		syncItemRemark(id, itemRemark){
+			this.currentInfo.itemRemark = itemRemark
+			if (!this.$util.isEmpty(this.globalItemData)) {
+				this.globalItemData.forEach((item, index) => {
+					if (item.id == id) {
+						this.$set(this.globalItemData[index], 'itemRemark', itemRemark)
+					}
+				})
+			}
+		},
 		closeRightShow(){
 			this.$refs.rightShowMore.close()
 		},
@@ -707,6 +795,12 @@ export default {
 	.item_list_bx {
 		padding: 40upx 16upx;
 	}
+	.item-row {
+		min-height: 255upx;
+	}
+	.item-row--remark {
+		min-height: 300upx;
+	}
 	.item_list_title {
 		margin-bottom: 20upx;
 		font-size: 30upx;

+ 9 - 1
hdApp/src/api/item/index.js

@@ -38,4 +38,12 @@ export const clearOneLimitBuy = data => {
 
 export const hasLimitBuyCustomList = data => {
 	return https.get('/item/has-limit-buy-custom-list', data)
-}
+}
+
+export const updateItemRemark = data => {
+	return https.get('/item/update-item-remark', data)
+}
+
+export const clearItemRemark = data => {
+	return https.get('/item/clear-item-remark', data)
+}