<template>
|
<view>
|
<page-nav title="采购到货"></page-nav>
|
|
|
<view class="mainContent" :style="{maxHeight: '1340rpx',overflow: 'scroll'}">
|
<view>
|
<view class="head_block">
|
<view class="head_left">
|
<view class="head_bar"></view>
|
<view class="head_title" style="font-weight: bold;">
|
物料信息
|
</view>
|
</view>
|
<!-- <view style="margin-right: 10rpx;font-weight: bold;">
|
{{cgdh}}
|
</view> -->
|
</view>
|
<u-gap height="10" bgColor="#eff0f1"></u-gap>
|
<view class="head">
|
<!-- <view class="head_block">
|
<view class="head_left">
|
<view class="head_bar"></view>
|
<view class="head_title">
|
物料信息
|
</view>
|
</view>
|
</view> -->
|
|
<view style="padding:20rpx 20rpx 20rpx 30rpx;">
|
|
|
<u-radio-group v-model="radioValue" class="flex_column">
|
<view class="marginBottom20 flex_column" style="width: 100%;"
|
@click="radioValueClick(item.partcode)" v-for="(item,index) in purchorderArr"
|
:key="item.partcode">
|
|
|
|
<view class="orderNumber" :key="item.partcode">
|
{{(index+1).toString().padStart(2,0)}}
|
</view>
|
|
<view class="trash" @click="trashClick(index)" v-show="purchorderArr.length>1">
|
<u-icon name="trash" size='20'></u-icon>
|
</view>
|
<view v-show="purchorderArr.length===1" style="width: 48rpx;height: 48rpx;">
|
</view>
|
|
|
<view class="flex_between marginBottom20">
|
<view style="display: flex;">
|
<view class="flex_column titleFont">
|
<view>物料编码:</view>
|
<view>物料名称:</view>
|
<view>物料规格:</view>
|
<!-- <view>采购/已到货:</view> -->
|
<view>采购单号:</view>
|
</view>
|
<view class="flex_column contentFont">
|
<view>{{item.partcode}}</view>
|
<view>{{item.partname}}</view>
|
<view>{{item.partspec?item.partspec:'/'}}</view>
|
<!-- <view>{{item.quantity+"/"+item.countarrivalquantity}}</view> -->
|
<view>{{cgdh}}</view>
|
</view>
|
</view>
|
<u-radio size='20' :key="item.partcode" :name="item.partcode"
|
activeColor="red"></u-radio>
|
</view>
|
|
<!-- <u-gap height="20" v-show="!item.arrowType" bgColor="#eff0f1"
|
style='width: 100%;'></u-gap> -->
|
|
<view class="" v-show="!item.arrowType">
|
<view class="head_block" style="margin-left: -20rpx;">
|
<view class="head_left">
|
<view class="head_bar"></view>
|
<view class="head_title" style="font-weight: bold;">
|
到货信息
|
</view>
|
</view>
|
</view>
|
|
<view class="" style="display: flex;flex-direction: column;">
|
<view class="f_c_c">
|
<view class="titleFont">供方信息:</view>
|
<view class="ellipsis contentFont"
|
style="width: 490rpx;padding-right: 15rpx;">
|
{{item.customername}}
|
</view>
|
<!-- <view @click='gfxxClick' class="custominputClass">
|
<view v-show='item.customername===""'
|
style="color: rgb(192, 196, 204);">请选择</view>
|
<view v-show='item.customername!==""' class="ellipsis"
|
style="width: 390rpx;">
|
{{item.customername}}
|
</view>
|
<u-icon
|
:name="!gfxxSheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
|
</view> -->
|
</view>
|
|
<view v-if="item.is_batchno==='Y'" class="f_c_c">
|
<view class="titleFont">采购批次:</view>
|
<u--input placeholder="请输入" border="bottom" v-model="item.cgpc"
|
class="contentFont"
|
style="border-bottom: 3rpx #eff0f1 solid;margin-left: 20rpx;"></u--input>
|
</view>
|
<view class="f_c_c">
|
<view class="titleFont">单位:</view>
|
<view class="ellipsis contentFont"
|
style="width: 490rpx;padding-right: 15rpx;">
|
{{item.uomname}}
|
</view>
|
<!-- <view @click='dwClick' class="custominputClass">
|
<view v-show='item.uomname===""' style="color: rgb(192, 196, 204);">请选择
|
</view>
|
<view v-show='item.uomname!==""' class="ellipsis"
|
style="width: 390rpx;">
|
{{item.uomname}}
|
</view>
|
<u-icon :name="!dwSheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
|
</view> -->
|
</view>
|
</view>
|
|
</view>
|
|
|
<!--
|
<view class="f_c_c" style="margin-top: 10rpx;">
|
<view class="">采购单号:</view>
|
<u--input placeholder="请输入" border="bottom" v-model="cgdh" disabled
|
style="border-bottom: 3rpx #eff0f1 solid;margin-left: 20rpx;"></u--input>
|
</view> -->
|
|
<view v-show="!item.arrowType" class="f_c_c"
|
style="padding-bottom: 12rpx;margin-top:10rpx;">
|
<view class="titleFont">采购/已到货:</view>
|
<view style="display: flex;" class="contentFont">
|
<view>{{item.quantity}} / </view>
|
<view style="color: rgb(41, 121, 255);margin-left: 10rpx;padding-right: 15rpx;">
|
{{item.countarrivalquantity}}
|
</view>
|
</view>
|
<!-- <u--input placeholder="请输入" border="bottom" disabled
|
:value='item.quantity+"/"+item.countarrivalquantity'
|
style="border-bottom: 3rpx #eff0f1 solid;margin-left: 20rpx;"></u--input> -->
|
</view>
|
|
<view v-show="!item.arrowType" class="f_c_c numberBox"
|
style="margin-top: 20rpx;border: 0;">
|
<view class="titleFont">到货数量:</view>
|
<u-number-box inputWidth='110' v-model="item.dhsl" min='0'
|
:max='item.quantity-item.countarrivalquantity' class="contentFont"
|
@change="dhslChange"></u-number-box>
|
</view>
|
|
|
|
<view v-show="!item.arrowType" class="head_block"
|
style="margin-left: -20rpx; margin-top:40rpx; ">
|
<view class="head_left">
|
<view class="head_bar"></view>
|
<view class="head_title" style="font-weight: bold;">
|
标签产出
|
</view>
|
</view>
|
<view style="display: flex;align-items:center;position: relative;">
|
<view
|
style="position: absolute;top: -6rpx;z-index: 2;right:174rpx;font-size: 26rpx;"
|
:style="{color:bqcc?'#eff0f1':'#2979FF'}" @click=" bqcc=!bqcc">
|
系统生成
|
<!-- {{bqcc?'系统生成':'扫描标签'}} -->
|
</view>
|
<view
|
style="position: absolute;top: -6rpx;z-index: 2;right:26rpx;font-size: 26rpx;"
|
:style="{color:!bqcc?'#eff0f1':'#2979FF'}" @click="bqcc=!bqcc">
|
<!-- {{!bqcc?'系统生成':'扫描标签'}} -->
|
扫描标签
|
</view>
|
<u-switch v-model="bqcc" @change="bqccChange"></u-switch>
|
</view>
|
|
</view>
|
|
<u-gap v-show="!item.arrowType" height="5" bgColor="#eff0f1"
|
style='width: 100%;border-radius: 10rpx;'></u-gap>
|
<view v-show="!item.arrowType"
|
style="display: flex;font-size: 28rpx;height: 46rpx;align-items: center;">
|
<view style="color: rgb(41, 121, 255);margin-left: 10rpx;">
|
{{purchorderArr[index].labelCount?purchorderArr[index].labelCount:0 }}
|
</view>
|
<vuew style="margin: 0 10rpx;"> / </vuew>
|
<view> {{item.dhsl}} pcs</view>
|
</view>
|
<u-gap v-show="!item.arrowType" height="5" bgColor="#eff0f1"
|
style='width: 100%;border-radius: 10rpx;'></u-gap>
|
|
<u-button v-show="!item.arrowType" type="primary" icon='plus-circle' plain
|
style="height: 80rpx;width: 98%;margin-top: 10rpx;" @click="addLabel"
|
class='addClass' text="添加">
|
</u-button>
|
|
<view v-show="!item.arrowType" class="flex_between titleFont"
|
style="margin: 20rpx 30rpx 30rpx;">
|
<view style="width: 60rpx;">序号</view>
|
<view style="width: 170rpx;">物料标签</view>
|
<view style="width: 170rpx;">单标签数量</view>
|
<view>操作</view>
|
</view>
|
|
<view v-show="!item.arrowType"
|
class="flex_column marginLeft20 marginRight20 contentFont" :key="it.labcode"
|
v-for="(it,ind) in item.labelArr">
|
<view class="flex_between marginLeft20 marginRight20">
|
<view style="width: 60rpx;text-align: center;">{{(ind+1)}}</view>
|
<view style="width: 200rpx;text-align: center;">{{it.labcode}}</view>
|
<view style="width: 200rpx;text-align: center;">{{it.labqty}}</view>
|
<u-icon @click="deleteLabel(index,it)" style="width: 50rpx;text-align: center;"
|
name="trash" min='0' max='100' color="#2979ff" size="20">
|
</u-icon>
|
</view>
|
<u-divider v-if="ind!==item.labelArr.length-1"></u-divider>
|
</view>
|
|
|
|
<view style="display: flex;justify-content: center;margin : 10rpx; 0">
|
<view class="arrowClass"
|
@click="item.arrowType?arrowDownClick(item):arrowUpClick(item)">
|
<u-icon :name="item.arrowType?'arrow-down':'arrow-up'" color="#c8c8c8"
|
size="25"></u-icon>
|
</view>
|
</view>
|
|
|
<u-gap height="16" v-if="index!==purchorderArr.length-1" bgColor="#eff0f1"
|
style='width: 110%;margin: 0rpx -5%;'></u-gap>
|
</view>
|
|
</u-radio-group>
|
|
</view>
|
|
|
</view>
|
</view>
|
</view>
|
|
<u-button size="large" :loading="isDisabledSubmitButton"
|
:disabled="purchorderArr.map(i => i.labelArr).flat().length === 0" loadingText="正在提交,请稍等..." type="primary"
|
@click="submit" text="确认提交">
|
</u-button>
|
|
<!-- 采购供方 -->
|
<!-- <u-picker :show="gfxxSheetShow" :columns="gfxxColumns" :itemHeight='55' :closeOnClickOverlay='true'
|
@close='gfxxSheetShow=false' @confirm='gfxxPickerConfirm' @cancel='gfxxSheetShow=false'>
|
</u-picker> -->
|
<!-- 单位 -->
|
<!-- <u-picker :show="dwSheetShow" :columns="dwColumns" :itemHeight='55' :closeOnClickOverlay='true'
|
@close='dwSheetShow=false' @confirm='dwPickerConfirm' @cancel='dwSheetShow=false'>
|
</u-picker> -->
|
|
<!-- 添加的弹窗事件 -->
|
<u-modal :show="modalShow" :showCancelButton='true' cancelText='取消' @close="modalShow=false"
|
:closeOnClickOverlay="true" @cancel="modalCancel" @confirm="modalConfirm">
|
<view class="" style="display: flex;justify-content: flex-start;flex-direction: column;">
|
<view>物料编码:{{modalContent.code}}</view>
|
<view>物料名称:{{modalContent.name}}</view>
|
<view>到货数量:{{modalContent.dhsl}}</view>
|
<view style="margin-top: 20rpx;display: flex;">
|
<view>单标签数量:</view>
|
<u-number-box class="modelNumber" inputWidth='110' v-model="modalContent.numberBox" min='0'
|
:max='modalContent.dhsl' @change="modelNumberChange"></u-number-box>
|
</view>
|
</view>
|
</u-modal>
|
|
</view>
|
</template>
|
|
|
<script>
|
const modal = uni.requireNativePlugin("modal");
|
import api from "../../static/js/lpapi-uniplugin";
|
|
import {
|
MesAppPurchOrderPartSearch,
|
PurchSupplierSelect,
|
UnitSerch,
|
MesAppPurchOrderLabelBarCode,
|
MesAppPurchOrderSave
|
|
} from '../../config/api.js';
|
import Vue from 'vue'
|
const App = getApp()
|
export default {
|
onLoad(option) {
|
|
},
|
|
onPullDownRefresh() {
|
setTimeout(() => {
|
this.init(() => {
|
uni.stopPullDownRefresh();
|
})
|
}, 1000);
|
},
|
|
data() {
|
return {
|
|
isDisabledSubmitButton: false,
|
radioValue: '',
|
|
purchorderArr: [],
|
|
gfxxSheetShow: false,
|
gfxxArr: [], //供方信息
|
gfxxColumns: [
|
['测试1', '测试2']
|
],
|
cgpc: '', //采购批次
|
dwSheetShow: false,
|
dwArr: [], //单位
|
dwColumns: [
|
['测试1', '测试2']
|
],
|
cgdh: '', //采购单号
|
bqcc: true,
|
labelArr: [],
|
|
modalShow: false,
|
modalContent: {},
|
|
labelCount: 0, //标签产出数量值
|
|
printerList: [],
|
index: 0,
|
printerName: "",
|
}
|
},
|
created() {
|
|
},
|
mounted() {
|
this.init()
|
|
|
// this.getPurchSupplierSelect()
|
// this.getUnitSerch()
|
},
|
async onLoad(option) {
|
|
// this.openBluetoothAdapter()
|
// console.log("onLoad");
|
// this.printerList.splice(0);
|
// const list = await api.getPrinters();
|
// console.log(list, 8)
|
// if (list.length > 0) {
|
// for (let item of list) {
|
// console.log(item);
|
// this.printerList.push(item.name);
|
// }
|
// } else {
|
// this.printerList.push("未检测到打印机");
|
// }
|
// // 自动连接打印机
|
// this.onPrinterChanged();
|
// this.openPrinter()
|
|
|
this.cgdh = option.ordercode
|
this.getMesAppPurchOrderPartSearch()
|
},
|
methods: {
|
// 获取标签
|
async getMesAppPurchOrderLabelBarCode(partcode, arrivalqty, onelableqty) {
|
const data = {
|
partcode,
|
arrivalqty,
|
onelableqty
|
}
|
|
const res = await MesAppPurchOrderLabelBarCode(this.global.formatData(data))
|
|
this.purchorderArr.forEach(it => {
|
if (it.partcode === partcode) {
|
it.labelArr = res.data
|
it.labelCount = 0
|
res.data.map(i => i.labqty).forEach(i => {
|
it.labelCount += parseFloat(i)
|
})
|
}
|
})
|
|
console.log(this.purchorderArr, 88)
|
this.$forceUpdate()
|
|
},
|
async getMesAppPurchOrderPartSearch() {
|
const res = await MesAppPurchOrderPartSearch(this.cgdh)
|
this.purchorderArr = res.data
|
this.purchorderArr.forEach((item, index) => {
|
item.cgpc = ''
|
item.dhsl = item.quantity - item.countarrivalquantity
|
item.arrowType = index !== 0
|
// item.arrowType = true
|
item.labelArr = []
|
if (index === 0) {
|
this.radioValue = item.partcode
|
}
|
})
|
},
|
// 获取供方信息下拉
|
async getPurchSupplierSelect() {
|
const res = await PurchSupplierSelect()
|
this.gfxxArr = res.data
|
this.gfxxColumns = [res.data.map(i => i.name)]
|
},
|
// 获取单位下拉
|
async getUnitSerch() {
|
const res = await UnitSerch()
|
this.dwArr = res.data
|
this.dwColumns = [res.data.map(i => i.name)]
|
},
|
init() {
|
uni.stopPullDownRefresh();
|
},
|
radioValueClick(partcode) {
|
this.radioValue = partcode
|
},
|
// 箭头由向下变为向上时触发
|
arrowDownClick(val) {
|
console.log('执行了111', val)
|
// val.arrowType = !val.arrowType
|
this.purchorderArr.forEach(i => {
|
if (i.partcode === val.partcode) {
|
i.arrowType = false
|
} else {
|
i.arrowType = true
|
}
|
})
|
// val.arrowType = false
|
this.$forceUpdate()
|
},
|
// 箭头由向上变为向下时触发
|
arrowUpClick(val) {
|
console.log('执行了222', val)
|
val.arrowType = true
|
this.$forceUpdate()
|
},
|
gfxxClick() {
|
// this.gfxxSheetShow = true //暂时注释
|
},
|
gfxxPickerConfirm(val) {
|
this.purchorderArr.forEach(i => {
|
if (i.partcode === this.radioValue) {
|
i.customername = val.value[0]
|
i.customercode = this.gfxxArr.find(it => it.name === val.value[0]).code
|
}
|
})
|
this.gfxxSheetShow = false
|
},
|
dwClick() {
|
// this.dwSheetShow = true //暂时注释
|
},
|
dwPickerConfirm(val) {
|
this.purchorderArr.forEach(i => {
|
if (i.partcode === this.radioValue) {
|
i.uomname = val.value[0]
|
i.uomcode = this.dwArr.find(it => it.name === val.value[0]).code
|
}
|
})
|
this.dwSheetShow = false
|
},
|
|
// 到货数量
|
dhslChange(val) {
|
|
this.$forceUpdate()
|
|
},
|
// 标签产出
|
bqccChange(val) {
|
// this.$forceUpdate()
|
},
|
|
// 添加
|
addLabel() {
|
let temp = this.purchorderArr.find(i => i.partcode === this.radioValue)
|
this.modalContent.code = temp.partcode
|
this.modalContent.name = temp.partname
|
this.modalContent.dhsl = temp.dhsl
|
this.modalContent.numberBox = 0
|
this.modalShow = true
|
},
|
|
// 删除
|
deleteLabel(number, val) {
|
this.purchorderArr[number].labelArr = this.purchorderArr[number].labelArr.filter(i => i.labcode !== val
|
.labcode)
|
this.purchorderArr[number].labelCount = 0
|
|
this.purchorderArr[number].labelArr.map(i => i.labqty).forEach(i => {
|
this.purchorderArr[number].labelCount += parseFloat(i)
|
})
|
|
this.$forceUpdate()
|
},
|
|
// 提交
|
async submit() {
|
const data1 = {
|
purordercode: this.cgdh,
|
username: uni.getStorageSync("username")
|
}
|
let submitData = JSON.parse(JSON.stringify(this.purchorderArr))
|
let data2 = []
|
|
submitData.forEach(i => {
|
if (i.labelArr.length > 0) {
|
console.log(i.is_batchno)
|
data2.push({
|
hacceptdate: i.acceptdate ? i.acceptdate : '',
|
hdepartmentcode: i.departmentcode ? i.departmentcode : '',
|
hcustomercode: i.customercode,
|
hbatchno: i.cgpc,
|
hsourcebillno: this.cgdh,
|
rownumber: i.rownumber,
|
hpartcode: i.partcode,
|
hplanqty: i.quantity,
|
hqty: i.labelCount,
|
hsourceid: i.orderid,
|
hsourcesbid: i.sbid,
|
hischeck: i.is_incheck, //暂时写死
|
children: i.labelArr
|
})
|
}
|
})
|
|
|
this.isDisabledSubmitButton = true
|
MesAppPurchOrderSave(this.global.formatData(
|
data1), data2).then(res => {
|
if (res.code === '200') {
|
submitData.forEach(i => {
|
if (i.labelArr.length > 0) {
|
i.labelArr.forEach(it => {
|
this.printWL(it
|
.labcode, res
|
.data,
|
i.partcode, i
|
.partname, i
|
.partspec ? i
|
.partspec :
|
'/', it
|
.labqty)
|
})
|
}
|
})
|
let prevPage = getCurrentPages()[getCurrentPages()
|
.length -
|
2]; // 上一页面实例
|
prevPage.$vm
|
.getMesAppPurchOrderSearch() // 调用上一页 定义的方法
|
uni.navigateBack({
|
delta: 1, //返回层数,2则上上页
|
})
|
}
|
this.isDisabledSubmitButton = false
|
this.$u.toast(res.Message)
|
})
|
|
},
|
|
// 模态框取消
|
modalCancel() {
|
this.modalShow = false
|
},
|
|
// 模态框确认
|
modalConfirm() {
|
this.getMesAppPurchOrderLabelBarCode(this.modalContent.code, this.modalContent.dhsl, this
|
.modalContent
|
.numberBox)
|
this.modalShow = false
|
},
|
|
// 模态框数值改变
|
modelNumberChange() {
|
|
},
|
// 删除事件点击
|
trashClick(val) {
|
this.purchorderArr.splice(val, 1)
|
},
|
|
|
// 打印物料
|
async printWL(t2, t4, t5, t6, t7, t8) {
|
// 当前时间
|
const time = new Date();
|
const strTime =
|
`${time.getFullYear()}-${(time.getMonth() + 1).toString().padStart(2,'0')}-${(time.getDate()).toString().padStart(2,'0')} ${(time.getHours()).toString().padStart(2,'0')}:${time.getMinutes().toString().padStart(2,'0')}:${(time.getSeconds()).toString().padStart(2,'0')}`;
|
|
const text1 = '物料标签'
|
const text2 = t2
|
const text3 = '采购订单:' + this.cgdh
|
const text4 = '到货单号:' + t4
|
const text5 = '物料编码:' + t5
|
const text6 = '物料名称:' + t6
|
const text7 = '规格型号:' + t7
|
const text8 = '标签数量:' + t8
|
const text9 = '操作人员:' + uni.getStorageSync('username')
|
const text10 = '操作时间:' + strTime
|
|
// 第一步,先判断打印机是否已经打开
|
// 当测试纸为竖向时,横向对应宽,竖向对应高
|
if (api.isPrinterOpened()) {
|
api.startJob({
|
width: 78,
|
height: 80
|
});
|
|
//标题
|
// 标题部分垂直居中,水平居中,字体大小5mm,加粗显示
|
api.setItemHorizontalAlignment(1);
|
api.setItemVerticalAlignment(1);
|
api.drawText({
|
text: text1,
|
x: 52,
|
y: 9,
|
// width: 50,
|
// height: 20,
|
fontHeight: 7,
|
fontStyle: 1
|
});
|
api.draw2DQRCode({
|
text: text2,
|
x: 41,
|
y: 14,
|
width: 22,
|
eccLevel: 2,
|
horizontalAlignment: 1,
|
verticalAlignment: 1
|
});
|
api.drawText({
|
text: text3,
|
x: 30,
|
y: 40,
|
fontHeight: 3.1,
|
fontStyle: 0,
|
horizontalAlignment: 0,
|
});
|
api.drawText({
|
text: text4,
|
x: 30,
|
y: 45,
|
fontHeight: 3.1,
|
fontStyle: 0,
|
horizontalAlignment: 0,
|
});
|
api.drawText({
|
text: text5,
|
x: 30,
|
y: 50,
|
fontHeight: 3.1,
|
fontStyle: 0,
|
horizontalAlignment: 0,
|
});
|
api.drawText({
|
text: text6,
|
x: 30,
|
y: 55,
|
fontHeight: 3.1,
|
horizontalAlignment: 0,
|
fontStyle: 0
|
});
|
api.drawText({
|
text: text7,
|
x: 30,
|
y: 60,
|
fontHeight: 3.1,
|
horizontalAlignment: 0,
|
fontStyle: 0
|
});
|
api.drawText({
|
text: text8,
|
x: 30,
|
y: 65,
|
fontHeight: 3.1,
|
horizontalAlignment: 0,
|
fontStyle: 0
|
});
|
api.drawText({
|
text: text9,
|
x: 30,
|
y: 70,
|
fontHeight: 3.1,
|
horizontalAlignment: 0,
|
fontStyle: 0
|
});
|
api.drawText({
|
text: text10,
|
x: 30,
|
y: 75,
|
fontHeight: 3.1,
|
horizontalAlignment: 0,
|
fontStyle: 0
|
});
|
// 绘制结束,开始提交打印
|
api.commitJob();
|
}
|
},
|
// 初始化蓝牙设备
|
openBluetoothAdapter() {
|
uni.openBluetoothAdapter({
|
success: e => {
|
console.log('初始化蓝牙成功:' + e.errMsg);
|
console.log(JSON.stringify(e));
|
this.getBluetoothAdapterState();
|
},
|
fail: e => {
|
console.log(e)
|
console.log('初始化蓝牙失败,错误码:' + (e.errCode || e.errMsg));
|
uni.showModal({
|
title: '提示!',
|
content: '初始化蓝牙失败,请打开本机蓝牙!',
|
confirmText: "确定",
|
cancelText: "取消",
|
success: (res) => {
|
if (res.confirm) {
|
this.bluetoothSettings()
|
}
|
}
|
});
|
if (e.errCode !== 0) {
|
//initTypes(e.errCode, e.errMsg);
|
}
|
}
|
});
|
},
|
// 自动连接打印机
|
onPrinterChanged(e) {
|
console.log(e);
|
this.index = e ? e.target.value : 0;
|
this.printerName = this.printerList[this.index];
|
},
|
// 连接打印机
|
async openPrinter() {
|
this.isSuccess = false
|
console.log('执行了1')
|
if (this.printerName) {
|
console.log('执行了2')
|
this.isSuccess = true
|
this.keyGetTime = new Date().getTime()
|
// 连接新的打印机
|
api.openPrinter(this.printerName, (value) => {
|
if (value) {
|
modal.toast({
|
message: "打印机连接成功",
|
duration: 1.5,
|
});
|
}
|
});
|
}
|
// this.openPrinter()
|
},
|
// 蓝牙设置
|
bluetoothSettings() {
|
var main = plus.android.runtimeMainActivity();
|
var Intent = plus.android.importClass("android.content.Intent");
|
var mIntent = new Intent('android.settings.BLUETOOTH_SETTINGS');
|
main.startActivity(mIntent);
|
},
|
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import url('@/style/global.css');
|
|
::v-deep .uicon-arrow-left>span {
|
display: block;
|
}
|
|
.arrowClass {
|
display: flex;
|
justify-content: center;
|
// background-color: #efefef;
|
width: 100rpx;
|
// border-radius: 10rpx;
|
height: 56rpx;
|
}
|
|
.custominputClass {
|
width: 450rpx;
|
// height: 50rpx;
|
display: flex;
|
justify-content: space-between;
|
border: 3rpx #eff0f1 solid;
|
border-radius: 10rpx;
|
padding: 4rpx 16rpx;
|
|
}
|
|
.ellipsis {
|
text-overflow: ellipsis;
|
overflow: hidden;
|
white-space: nowrap;
|
padding: 12rpx 2rpx;
|
}
|
|
.f_c_c {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
text-align: right;
|
margin-top: 10rpx;
|
border-bottom: 1px solid #eff0f1;
|
// line-height: 80rpx;
|
// height:70rpx;
|
}
|
|
::v-deep .uni-input-wrapper {
|
text-align: right;
|
}
|
|
.numberBox {
|
::v-deep .uni-input-wrapper {
|
text-align: center;
|
}
|
}
|
|
|
::v-deep .u-number-box__minus {
|
height: 50rpx !important;
|
}
|
|
::v-deep .u-number-box__input {
|
height: 50rpx !important;
|
|
}
|
|
::v-deep .u-number-box__plus {
|
height: 50rpx !important;
|
}
|
|
::v-deep .addClass .uicon-plus-circle {
|
font-size: 40rpx !important;
|
margin-right: 20rpx !important;
|
}
|
|
::v-deep .addClass .u-button__text {
|
font-size: 36rpx !important;
|
}
|
|
::v-deep .u-modal__content {
|
justify-content: flex-start;
|
}
|
|
|
.modelNumber {
|
::v-deep .uni-input-input {
|
text-align: center;
|
}
|
}
|
|
::v-deep .u-input--no-radius {
|
padding-bottom: 0 !important;
|
}
|
|
.orderNumber {
|
width: 60rpx;
|
height: 40rpx;
|
margin: -22rpx 0 0 -30rpx;
|
background-color: #d3daf9;
|
color: #2979FF;
|
font-size: 26rpx;
|
padding: 4rpx 0 0 10rpx;
|
border-radius: 0 0 90% 0;
|
}
|
|
.trash {
|
width: 48rpx;
|
height: 48rpx;
|
margin: -22rpx 0 0 610rpx;
|
background-color: #d3daf9;
|
font-size: 26rpx;
|
padding: 6rpx 0 0 10rpx;
|
border-radius: 100%;
|
}
|
|
::v-deep .u-switch {
|
width: 300rpx !important;
|
height: 46rpx !important;
|
// margin-bottom: 8rpx !important;
|
line-height: 46rpx !important;
|
background-color: #EFF0F1 !important;
|
}
|
|
// ::v-deep .u-switch__bg{
|
// height: 46rpx !important;
|
// line-height: 46rpx !important;
|
// width: 100% !important;
|
// }
|
|
::v-deep .u-switch__node {
|
width: 150rpx !important;
|
// margin-bottom: 8rpx !important;
|
height: 46rpx !important;
|
line-height: 46rpx !important;
|
background-color: rgba(41, 121, 255, 0.8);
|
transform: translateX(0) !important;
|
|
}
|
|
::v-deep .u-switch__node--on {
|
// width: 100rpx !important;
|
// width: 20px;
|
height: 46rpx !important;
|
line-height: 46rpx !important;
|
// margin-bottom: 8rpx !important;
|
// height: 20px;
|
transform: translateX(-150rpx) !important;
|
}
|
</style>
|