|
|
@@ -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;
|