|
@@ -1,52 +1,56 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="app-content" style="background:white;">
|
|
<view class="app-content" style="background:white;">
|
|
|
- <view class="billing_box_bg">
|
|
|
|
|
- <view class="input-wrap">
|
|
|
|
|
- <view class="search-bar">
|
|
|
|
|
- <app-search-module v-model="py" placeholder="小菊输xj搜索" @input="searchFn"/>
|
|
|
|
|
|
|
+ <view class="billing_box_bg">
|
|
|
|
|
+ <view class="input-wrap">
|
|
|
|
|
+ <view class="search-bar">
|
|
|
|
|
+ <app-search-module v-model="py" placeholder="小菊输xj搜索" @input="searchFn"/>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view style="padding:0 0upx 0 20upx;" >
|
|
|
|
|
+ <button class="admin-button-com middle blue" style="margin-right:8upx;" @click="downPriceTable()">价格表</button>
|
|
|
|
|
+ <button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/ptItem/itemList' })">添花材</button>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view style="padding:0 0upx 0 20upx;" >
|
|
|
|
|
- <button class="admin-button-com middle blue" style="margin-right:8upx;" @click="downPriceTable()">价格表</button>
|
|
|
|
|
- <button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/ptItem/itemList' })">添花材</button>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="scroll-middle_bx">
|
|
|
|
|
- <scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop">
|
|
|
|
|
- <div v-for="(item, index) in globalClassItemList" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass(index)">
|
|
|
|
|
- <text>{{ item.className || "" }}</text>
|
|
|
|
|
- </div>
|
|
|
|
|
- </scroll-view>
|
|
|
|
|
- <scroll-view scroll-y class="right-box" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
|
|
|
|
|
- @scroll="scroll_detail"
|
|
|
|
|
- lower-threshold="100"
|
|
|
|
|
- @scrolltolower="scroll_bottom">
|
|
|
|
|
- <!--内容部分-->
|
|
|
|
|
- <block v-if="!$util.isEmpty(globalClassItemList)">
|
|
|
|
|
- <view class="item_list_bx selectAll" v-for="(classItem, classIndex) in globalClassItemList" :key="classIndex" :id="`class_${classIndex}`">
|
|
|
|
|
- <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:240upx" :id="`class_${classIndex}`" :key="productIndex">
|
|
|
|
|
- <ItemStock v-if="classItem.isActive" :isPrice="false" :info="productItem" @goToProduct="goToProduct" @moreToDo="moreToDo" ></ItemStock>
|
|
|
|
|
|
|
+ <view class="scroll-middle_bx">
|
|
|
|
|
+ <scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop">
|
|
|
|
|
+ <div v-for="(item, index) in globalClassItemList" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass(index)">
|
|
|
|
|
+ <text>{{ item.className || "" }}</text>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </scroll-view>
|
|
|
|
|
+ <scroll-view scroll-y class="right-box" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
|
|
|
|
|
+ @scroll="scroll_detail" lower-threshold="100" @scrolltolower="scroll_bottom">
|
|
|
|
|
+ <!--内容部分-->
|
|
|
|
|
+ <block v-if="!$util.isEmpty(globalClassItemList)">
|
|
|
|
|
+ <view class="item_list_bx selectAll" v-for="(classItem, classIndex) in globalClassItemList" :key="classIndex" :id="`class_${classIndex}`">
|
|
|
|
|
+ <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:240upx" :id="`class_${classIndex}`" :key="productIndex">
|
|
|
|
|
+ <ItemStock v-if="classItem.isActive" :isPrice="false" :info="productItem" @goToProduct="goToProduct" @moreToDo="moreToDo" @doPrintLabel="doPrintLabel" ></ItemStock>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-else>
|
|
|
|
|
+ <view style="height:260upx;text-align:center;color:#CCCCCC;position: relative;">
|
|
|
|
|
+ <view style="position: absolute;margin:auto;top:130upx;left:0;right:0;bottom:0;">暂无花材</view>
|
|
|
</view>
|
|
</view>
|
|
|
- </template>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view v-else>
|
|
|
|
|
- <view style="height:260upx;text-align:center;color:#CCCCCC;position: relative;">
|
|
|
|
|
- <view style="position: absolute;margin:auto;top:130upx;left:0;right:0;bottom:0;">暂无花材</view>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
- </block>
|
|
|
|
|
- <block v-else>
|
|
|
|
|
- <view style="width:100%">
|
|
|
|
|
- <app-wrapper-empty title="暂无花材" :is-empty="$util.isEmpty(globalClassItemList)" />
|
|
|
|
|
- </view>
|
|
|
|
|
- </block>
|
|
|
|
|
- </scroll-view>
|
|
|
|
|
|
|
+ </block>
|
|
|
|
|
+ <block v-else>
|
|
|
|
|
+ <view style="width:100%">
|
|
|
|
|
+ <app-wrapper-empty title="暂无花材" :is-empty="$util.isEmpty(globalClassItemList)" />
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </block>
|
|
|
|
|
+ </scroll-view>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 输入框示例 -->
|
|
|
|
|
+ <uni-popup ref="inputDialog" type="dialog">
|
|
|
|
|
+ <uni-popup-dialog ref="inputClose" mode="input" title="标签数量" value=""
|
|
|
|
|
+ placeholder="请输入标签数量" @confirm="dialogInputConfirm"></uni-popup-dialog>
|
|
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
import AppSearchModule from "@/components/module/app-search";
|
|
import AppSearchModule from "@/components/module/app-search";
|
|
@@ -55,14 +59,16 @@ import ItemStock from "./components/ItemStock";
|
|
|
import productMins from "@/mixins/product";
|
|
import productMins from "@/mixins/product";
|
|
|
import { mapGetters } from "vuex";
|
|
import { mapGetters } from "vuex";
|
|
|
import { getWeixinId } from "@/api/invite/index";
|
|
import { getWeixinId } from "@/api/invite/index";
|
|
|
-import { generatePriceTable,generateBarcodeTable,print } from '@/api/product'
|
|
|
|
|
|
|
+import { generatePriceTable,generateBarcodeTable,print } from '@/api/product';
|
|
|
|
|
+import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue';
|
|
|
import { CURRENT_ENV } from '@/config'
|
|
import { CURRENT_ENV } from '@/config'
|
|
|
export default {
|
|
export default {
|
|
|
name: "item_list",
|
|
name: "item_list",
|
|
|
components: {
|
|
components: {
|
|
|
AppSearchModule,
|
|
AppSearchModule,
|
|
|
AppWrapperEmpty,
|
|
AppWrapperEmpty,
|
|
|
- ItemStock
|
|
|
|
|
|
|
+ ItemStock,
|
|
|
|
|
+ uniPopup
|
|
|
},
|
|
},
|
|
|
mixins: [productMins],
|
|
mixins: [productMins],
|
|
|
data() {
|
|
data() {
|
|
@@ -72,7 +78,8 @@ export default {
|
|
|
tabIndex: 0,
|
|
tabIndex: 0,
|
|
|
getAppIdList:{},
|
|
getAppIdList:{},
|
|
|
status:0,
|
|
status:0,
|
|
|
- delStatus:0
|
|
|
|
|
|
|
+ delStatus:0,
|
|
|
|
|
+ printItemId:0,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed:{
|
|
computed:{
|
|
@@ -95,9 +102,38 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ doPrintLabel(id){
|
|
|
|
|
+ this.printItemId = id
|
|
|
|
|
+ this.$refs.inputDialog.open()
|
|
|
|
|
+ },
|
|
|
|
|
+ dialogInputConfirm(count) {
|
|
|
|
|
+ let that=this;
|
|
|
|
|
+ this.$refs.inputDialog.close()
|
|
|
|
|
+
|
|
|
|
|
+ let currentNum = Number(count)
|
|
|
|
|
+ let itemId = this.printItemId
|
|
|
|
|
+ if (currentNum <= 0) {
|
|
|
|
|
+ that.$msg('打印数量不能小于等于0')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (itemId == 0) {
|
|
|
|
|
+ that.$msg('打印的花材id出错')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ print({id:itemId,num:currentNum}).then(res=>{
|
|
|
|
|
+ if(res.code == 1){
|
|
|
|
|
+ that.$msg(res.msg)
|
|
|
|
|
+ } else if(res.code == 0){
|
|
|
|
|
+ that.$msg(res.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ testFunc() {
|
|
|
|
|
+ console.log(1111)
|
|
|
|
|
+ },
|
|
|
moreToDo(item){
|
|
moreToDo(item){
|
|
|
let that=this;
|
|
let that=this;
|
|
|
- let doList = ['复制花材', '打1个标签', '打2个标签', '打10个标签','打100个标签','打500个标签']
|
|
|
|
|
|
|
+ let doList = ['复制花材', '销售记录']
|
|
|
let doNum = [0,1,2,10,100,500]
|
|
let doNum = [0,1,2,10,100,500]
|
|
|
uni.showActionSheet({
|
|
uni.showActionSheet({
|
|
|
itemList: doList,
|
|
itemList: doList,
|
|
@@ -105,6 +141,8 @@ export default {
|
|
|
let index = respond.tapIndex
|
|
let index = respond.tapIndex
|
|
|
if (index == 0) {
|
|
if (index == 0) {
|
|
|
that.pageTo({url: '/admin/item/copy',query: {id: item.id}})
|
|
that.pageTo({url: '/admin/item/copy',query: {id: item.id}})
|
|
|
|
|
+ } else if (index == 1) {
|
|
|
|
|
+ that.pageTo({url: "/admin/order/itemOrder?id="+item.id})
|
|
|
}else{
|
|
}else{
|
|
|
let currentNum = Number(doNum[index])
|
|
let currentNum = Number(doNum[index])
|
|
|
print({id:item.id,num:currentNum}).then(res=>{
|
|
print({id:item.id,num:currentNum}).then(res=>{
|