|
|
@@ -26,8 +26,8 @@
|
|
|
<view class="item_list_title"> {{ classItem.className }}</view>
|
|
|
<view v-if="classItem.child && !$util.isEmpty(classItem.child)">
|
|
|
<template v-for="(productItem, productIndex) in classItem.child">
|
|
|
- <view style="height:250upx" :id="`class_${classIndex}`" :key="productIndex">
|
|
|
- <ItemStock v-if="classItem.isActive" :info="productItem" @goToProduct="goToProduct" @moreToDo="moreToDo" @doPrintLabel="doPrintLabel" >
|
|
|
+ <view style="height:255upx" :id="`class_${classIndex}`" :key="productIndex">
|
|
|
+ <ItemStock v-if="classItem.isActive" :info="productItem" @moreAction="moreAction" @breakSingleItem="breakSingleItem" @doPrintLabel="doPrintLabel" >
|
|
|
</ItemStock>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -60,6 +60,18 @@
|
|
|
</template>
|
|
|
</modal-module>
|
|
|
|
|
|
+ <modal-module :show="breakShow" @click="breakConfirm" :maskClosable="true" title="拆散数量" padding="30rpx 30rpx" >
|
|
|
+ <template v-slot:content>
|
|
|
+ <div class="app-modal-input-wrap">
|
|
|
+ <div class="inp-list-line">
|
|
|
+ <div class="line-input">
|
|
|
+ <input type="number" ref="input" style="width:61.8%;text-align:center;" @blur="blur" :focus="breakFocus" v-model="breakNum" :adjust-position="false" class="inp-input" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </modal-module>
|
|
|
+
|
|
|
<uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
|
|
|
<view style="display:flex;padding:20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
|
|
|
|
|
|
@@ -71,7 +83,19 @@
|
|
|
</view>
|
|
|
</uni-popup>
|
|
|
|
|
|
- <image v-if="showClassRemind" @click="hideClassRemind" style="position:absolute;width:610upx;height:699upx;top:225upx;left:80upx;z-index:9999;" :src="`${constant.imgUrl}/class_remind.png`"></image>
|
|
|
+ <uni-popup ref="rightShowMore" background-color="#fff" type="center" :animation="true" class="class-popup-style">
|
|
|
+ <view style="display:flex;width:100vw;padding:20upx 20upx 40upx 20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
|
|
|
+ <view style="width:100vw;"><button @click="costChange()">成本变动记录</button></view>
|
|
|
+ <view style="width:100vw;margin-top:8upx;"><button @click="priceChange()">价格变动记录</button></view>
|
|
|
+ <view style="width:100vw;margin-top:8upx;"><button @click="varietyManage()">多颜色管理</button></view>
|
|
|
+ <view style="width:100vw;margin-top:8upx;"><button @click="preSell()">预售管理</button></view>
|
|
|
+ <view style="width:100vw;margin-top:8upx;"><button @click="orderRecord()">下单记录</button></view>
|
|
|
+ <view style="width:100vw;margin-top:8upx;"><button @click="copyCreate()">复制并新建</button></view>
|
|
|
+ <view style="width:100vw;margin-top:8upx;"><button @click="shareItem()">分享</button></view>
|
|
|
+ <view style="width:100vw;margin-top:8upx;"><button @click="breakMore()">{{breakName}}</button></view>
|
|
|
+ <view style="width:100vw;margin-top:30upx;"><button @click="closeRightShow()">取消</button></view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -82,7 +106,8 @@ import ItemStock from "./components/item";
|
|
|
import productMins from "@/mixins/product";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import { getWeixinId } from "@/api/invite/index";
|
|
|
-import { print,statusUpdate } from '@/api/product';
|
|
|
+import { print } from '@/api/product';
|
|
|
+import { breakItem } from '@/api/item'
|
|
|
import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue';
|
|
|
import ModalModule from "@/components/plugin/modal"
|
|
|
export default {
|
|
|
@@ -107,16 +132,18 @@ export default {
|
|
|
printLabelShow:false,
|
|
|
printNum:'',
|
|
|
printFocus:false,
|
|
|
- showClassRemind:false,
|
|
|
- warning:0
|
|
|
+ warning:0,
|
|
|
+ breakName:'拆多份',
|
|
|
+ currentInfo:{},
|
|
|
+ breakNum:'',
|
|
|
+ breakFocust:false,
|
|
|
+ breakShow:false
|
|
|
};
|
|
|
},
|
|
|
computed:{
|
|
|
...mapGetters(["getMyShopInfo","getLoginInfo"]),
|
|
|
...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo" })
|
|
|
},
|
|
|
- onShow(){
|
|
|
- },
|
|
|
onLoad() {
|
|
|
this.shopId = this.getMyShopInfo.id;
|
|
|
let type = '';
|
|
|
@@ -131,15 +158,61 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ breakSingleItem(item){
|
|
|
+ let that = this
|
|
|
+ this.breakNum = 1
|
|
|
+ that.$util.confirmModal({content:'确定拆1'+item.bigUnit+'?'},() => {
|
|
|
+ that.breakAction()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ breakMore(){
|
|
|
+ this.closeRightShow()
|
|
|
+ this.breakShow = true
|
|
|
+ this.breakNum = null
|
|
|
+ setTimeout(x => {
|
|
|
+ this.$nextTick(() => this.setBreakFocus())
|
|
|
+ }, 200)
|
|
|
+ },
|
|
|
+ breakAction(){
|
|
|
+ let that = this
|
|
|
+ breakItem({breakNum:that.breakNum,id:that.currentInfo.id}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ that.breakShow = false
|
|
|
+ that.breakFocus = false
|
|
|
+ that.$msg(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ breakConfirm(val){
|
|
|
+ let that=this;
|
|
|
+ if (val.index == 0) {
|
|
|
+ that.breakShow = false
|
|
|
+ that.breakFocus = false
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (this.breakNum == null) {
|
|
|
+ that.$msg('请填写数量')
|
|
|
+ that.breakFocus = true
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (Number(this.breakNum) <= 0) {
|
|
|
+ that.$msg('数量不能小于1')
|
|
|
+ that.breakFocus = true
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ that.$util.confirmModal({content:'确认拆'+that.breakNum+that.currentInfo.bigUnit+'?'},() => {
|
|
|
+ that.breakAction()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setBreakFocus(){
|
|
|
+ this.breakFocust = true
|
|
|
+ },
|
|
|
changeClass(index){
|
|
|
this.$refs.selectFlowerNumRef.close()
|
|
|
this.swichClass(index)
|
|
|
},
|
|
|
selectFlowerNumFn(){
|
|
|
this.$refs.selectFlowerNumRef.open('top')
|
|
|
- },
|
|
|
- hideClassRemind(){
|
|
|
-
|
|
|
},
|
|
|
blur() {
|
|
|
this.printFocus = false
|
|
|
@@ -148,32 +221,29 @@ export default {
|
|
|
this.printItemId = id
|
|
|
this.printLabelShow = true
|
|
|
this.printNum = null
|
|
|
-
|
|
|
setTimeout(x => {
|
|
|
- this.$nextTick(() => this.setFocus()); // just watch out with going too fast !!!
|
|
|
- }, 200);
|
|
|
+ this.$nextTick(() => this.setFocus())
|
|
|
+ }, 200)
|
|
|
},
|
|
|
setFocus() {
|
|
|
this.printFocus = true
|
|
|
},
|
|
|
dialogInputConfirm(val) {
|
|
|
- console.log(val)
|
|
|
let that=this;
|
|
|
if (val.index == 0) {
|
|
|
that.printLabelShow = false
|
|
|
that.printFocus = false
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
let currentNum = this.printNum
|
|
|
let itemId = this.printItemId
|
|
|
if (currentNum == null) {
|
|
|
- that.$msg('打印数量未填写')
|
|
|
+ that.$msg('请填写数量')
|
|
|
that.printFocus = true
|
|
|
return
|
|
|
}
|
|
|
if (currentNum <= 0) {
|
|
|
- that.$msg('打印数量不能小于等于0')
|
|
|
+ that.$msg('数量不能小于1')
|
|
|
that.printFocus = true
|
|
|
return
|
|
|
}
|
|
|
@@ -186,6 +256,7 @@ export default {
|
|
|
print({id:itemId,num:currentNum}).then(res=>{
|
|
|
if(res.code == 1){
|
|
|
that.printLabelShow = false
|
|
|
+ that.printFocus = false
|
|
|
uni.showToast({ title: '操作成功', duration: 1500 })
|
|
|
} else if(res.code == 0){
|
|
|
that.printLabelShow = false
|
|
|
@@ -194,37 +265,42 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- moreToDo(item){
|
|
|
- let that=this;
|
|
|
- let doList = ['成本变动记录','价格变动记录','复制并新建','多颜色管理', '下单记录','预售管理']
|
|
|
- uni.showActionSheet({
|
|
|
- itemList: doList,
|
|
|
- success: function (respond) {
|
|
|
- let index = respond.tapIndex
|
|
|
- if(index == 0){
|
|
|
- that.pageTo({url: '/admin/changePrice/costChangeList',query: {id: item.id}})
|
|
|
- }else if (index == 1) {
|
|
|
- that.pageTo({url: '/admin/changePrice/changeList',query: {id: item.id}})
|
|
|
- }else if (index == 2) {
|
|
|
- that.pageTo({url: '/admin/item/copy',query: {id: item.id}})
|
|
|
- } else if (index == 3) {
|
|
|
- if(item.variety == 0){
|
|
|
- that.$msg('请先开启多颜色管理')
|
|
|
- return false
|
|
|
- }
|
|
|
- that.pageTo({url: "/admin/item/xjSelect?itemId="+item.id})
|
|
|
- } else if (index == 4) {
|
|
|
- that.pageTo({url: "/admin/order/itemOrder?productId="+item.id})
|
|
|
- } else if (index == 5) {
|
|
|
- that.pageTo({url: "/admin/item/presell?id="+item.id})
|
|
|
- }else{
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ closeRightShow(){
|
|
|
+ this.$refs.rightShowMore.close()
|
|
|
+ },
|
|
|
+ costChange(){
|
|
|
+ this.closeRightShow()
|
|
|
+ this.pageTo({url: '/admin/changePrice/costChangeList?id='+this.currentInfo.id})
|
|
|
+ },
|
|
|
+ priceChange(){
|
|
|
+ this.closeRightShow()
|
|
|
+ this.pageTo({url: '/admin/changePrice/changeList?id='+this.currentInfo.id})
|
|
|
+ },
|
|
|
+ varietyManage(){
|
|
|
+ this.closeRightShow()
|
|
|
+ this.pageTo({url: "/admin/item/xjSelect?itemId="+this.currentInfo.id})
|
|
|
+ },
|
|
|
+ copyCreate(){
|
|
|
+ this.closeRightShow()
|
|
|
+ this.pageTo({url: '/admin/item/copy?id='+this.currentInfo.id})
|
|
|
+ },
|
|
|
+ orderRecord(){
|
|
|
+ this.closeRightShow()
|
|
|
+ this.pageTo({url: "/admin/order/itemOrder?productId="+this.currentInfo.id})
|
|
|
+ },
|
|
|
+ preSell(){
|
|
|
+ this.closeRightShow()
|
|
|
+ this.pageTo({url: "/admin/item/presell?id="+this.currentInfo.id})
|
|
|
+ },
|
|
|
+ moreAction(item){
|
|
|
+ this.breakName = '拆多'+item.bigUnit
|
|
|
+ this.currentInfo = item
|
|
|
+ this.$refs.rightShowMore.open('top')
|
|
|
},
|
|
|
- goToProduct (id) {
|
|
|
+ shareItem() {
|
|
|
let that = this
|
|
|
+ let id = this.currentInfo.id
|
|
|
+ this.closeRightShow()
|
|
|
// #ifdef MP-WEIXIN
|
|
|
console.log('admin/ghsProduct/detail?shopId='+ that.loginInfo.shopId+'&id=0&ghsShopAdminId='+that.loginInfo.shopAdminId+'&id='+id)
|
|
|
uni.navigateToMiniProgram({
|