|
|
@@ -4,9 +4,6 @@
|
|
|
<block v-if="!$util.isEmpty(list.data)">
|
|
|
<div class="list" v-for="(item, index) in list.data" :key="index">
|
|
|
<div class="list-index">{{ item.id }}</div>
|
|
|
- <div class="list-img">
|
|
|
- <img :src="`${constant.imgUrl}/hhb_small.png`" alt="" mode="widthFix" style="width:90upx"/>
|
|
|
- </div>
|
|
|
<div class="list-det">
|
|
|
<div class="app-size-28 app-color-0">{{ item.name || '' }}</div>
|
|
|
<div class="list-operate">
|
|
|
@@ -14,22 +11,15 @@
|
|
|
<span>序号:{{ item.inTurn }}</span>
|
|
|
</div>
|
|
|
<text class="add-price" @click.stop="pageTo('/admin/itemClass/addPrice?classId='+item.id)">加价</text>
|
|
|
- <text class="add-price" @click.stop="pageTo('/admin/itemClass/more?classId='+item.id)">更多</text>
|
|
|
- <div class="operate-icon-wrap" @click="editItem(item)">
|
|
|
- <div class="operate-icon">
|
|
|
- <i class="iconfont" :class="[ index == operateIndex ? 'iconbianji' : 'iconbianji']" style="font-size:38upx;"></i>
|
|
|
- </div>
|
|
|
+ <text class="add-price" @click.stop="pageTo('/admin/itemClass/more?classId='+item.id)">排序</text>
|
|
|
+ <text class="add-price" @click.stop="barCodePrint(item.id)">条码打印</text>
|
|
|
+ <div class="operate-icon" @click="editItem(item)">
|
|
|
+ <i class="iconfont" :class="[ index == operateIndex ? 'iconbianji' : 'iconbianji']" style="font-size:38upx;"></i>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- operate -->
|
|
|
- <operate-module
|
|
|
- v-if="operateShow"
|
|
|
- :top="operateTop"
|
|
|
- :right="30"
|
|
|
- @clickFn="operateList"
|
|
|
- :btnData="btnData" />
|
|
|
+ <operate-module v-if="operateShow" :top="operateTop" :right="30" @clickFn="operateList" :btnData="btnData" />
|
|
|
</block>
|
|
|
<block v-else>
|
|
|
<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
|
|
|
@@ -38,7 +28,7 @@
|
|
|
<div class="app-footer">
|
|
|
<button class="admin-button-com middle blue" @click="addCategoryFn">添加分类</button>
|
|
|
</div>
|
|
|
- <modal-module :show="modifyModal" :maskClosable="false" @cancel="modalCancel" @click="replaceModalClick" width="92%" :title="modifyTitle" padding="30upx 30upx">
|
|
|
+ <modal-module :show="modifyModal" :maskClosable="false" @cancel="modalCancel" @click="replaceModalClick" :title="modifyTitle" padding="30upx 30upx">
|
|
|
<template v-slot:content>
|
|
|
<div class="app-modal-input-wrap modify-modal">
|
|
|
<div class="inp-list-line">
|
|
|
@@ -59,7 +49,6 @@
|
|
|
<modal-module :show="delModal" :maskClosable="false" @cancel="modalCancel" @click="delModalClick" content="确定删除?" color="#333" :size="32" padding="30upx 30upx"></modal-module>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
<script>
|
|
|
import ModalModule from '@/components/plugin/modal'
|
|
|
import AppUploader from '@/components/app-uploader'
|
|
|
@@ -67,6 +56,10 @@ import OperateModule from '@/admin/home/components/module/operate'
|
|
|
import AppWrapperEmpty from '@/components/app-wrapper-empty'
|
|
|
import { list } from '@/mixins'
|
|
|
import { getList,addClass,updateClass} from '@/api/item-class'
|
|
|
+import { allProduct } from "@/api/product/index";
|
|
|
+// #ifdef APP-PLUS
|
|
|
+const plug= uni.requireNativePlugin('Html5app-Gprinter')
|
|
|
+// #endif
|
|
|
export default {
|
|
|
name: 'item-class-list',
|
|
|
components: {
|
|
|
@@ -136,6 +129,75 @@ export default {
|
|
|
onLoad() {
|
|
|
},
|
|
|
methods: {
|
|
|
+ barCodePrint(classId){
|
|
|
+ let that = this
|
|
|
+ plug.state({},ret=>{
|
|
|
+ if(ret.code == 1){
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '您还没有连接蓝牙,请先链接',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ that.pageTo({url:'/admin/tools/blue'})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ allProduct({classId:classId}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ let itemData = res.data.list
|
|
|
+ if(!that.$util.isEmpty(itemData)){
|
|
|
+ itemData.forEach((item)=>{
|
|
|
+ console.log(item.name+item.id)
|
|
|
+ plug.printer({"TSC":that.OrderLable(item.name,item.id)},ret=>{
|
|
|
+ //uni.showToast({ title: JSON.stringify(ret), duration: 5000 })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ that.$msg('此分类下没有花材')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ OrderLable(itemName,itemId){
|
|
|
+
|
|
|
+ //制作标签格式,
|
|
|
+ var data=[]; //定义一个数组
|
|
|
+ var line={}; //每添加一个,代表一行字
|
|
|
+
|
|
|
+ //设置标签纸大小
|
|
|
+ line={};
|
|
|
+ line.width=30; //mm
|
|
|
+ line.height=20; //mm
|
|
|
+ line.gap=2; //标签纸之间,间隙长度 mm
|
|
|
+ line.page=1; //打印几份
|
|
|
+ data.push(line); //每添加一个,代表一行字
|
|
|
+
|
|
|
+ //添加文字
|
|
|
+ line={};
|
|
|
+ line.text= itemName;
|
|
|
+ line.rotation=0;
|
|
|
+ line.x=35;
|
|
|
+ line.y=20;
|
|
|
+ line.xscal=1;
|
|
|
+ line.yscal=1;
|
|
|
+ data.push(line); //每添加一个,代表一行字
|
|
|
+
|
|
|
+ //添加条型码
|
|
|
+ line={};
|
|
|
+ line.barcode=itemId;
|
|
|
+ line.x=35;
|
|
|
+ line.y=55;
|
|
|
+ line.type="CODE128";
|
|
|
+ line.height=50;
|
|
|
+ line.readable=true;
|
|
|
+ line.rotation=0;
|
|
|
+ data.push(line);
|
|
|
+
|
|
|
+ return data;
|
|
|
+ },
|
|
|
editItem(item){
|
|
|
this.modifyModal = true
|
|
|
this.modifyTitle = '编辑'
|
|
|
@@ -270,8 +332,8 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.list-det {
|
|
|
- width: calc(100% - 220upx);
|
|
|
- margin-left: 20upx;
|
|
|
+ width: calc(100% - 50upx);
|
|
|
+ margin-left: 10upx;
|
|
|
& > div {
|
|
|
margin-top: 14upx;
|
|
|
&:first-child {
|
|
|
@@ -291,6 +353,10 @@ export default {
|
|
|
.add-price{
|
|
|
text-decoration:underline;
|
|
|
font-size:30upx;
|
|
|
+ margin-left:10upx;
|
|
|
+ }
|
|
|
+ .operate-icon{
|
|
|
+ margin-left:30upx;
|
|
|
}
|
|
|
}
|
|
|
}
|