up
This commit is contained in:
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
"name" : "Operations",
|
"name" : "Operations",
|
||||||
"appid" : "__UNI__8A0DE5E",
|
"appid" : "__UNI__8A0DE5E",
|
||||||
"description" : "Operations(运营)的缩写,一个前后端分离的工作流/运营管理系统。",
|
"description" : "Operations(运营)的缩写,一个前后端分离的工作流/运营管理系统。",
|
||||||
"versionName" : "1.2.1",
|
"versionName" : "1.2.2",
|
||||||
"versionCode" : 121,
|
"versionCode" : "122s",
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"usingComponents" : true,
|
"usingComponents" : true,
|
||||||
|
|||||||
@@ -3,8 +3,11 @@
|
|||||||
<view class="header">
|
<view class="header">
|
||||||
<text class="back-btn" @click="goBack">‹ 返回</text>
|
<text class="back-btn" @click="goBack">‹ 返回</text>
|
||||||
<text class="title">订单详情</text>
|
<text class="title">订单详情</text>
|
||||||
<text v-if="canModify" class="edit-btn" @click="goEdit">编辑</text>
|
<view class="header-actions">
|
||||||
<view v-else class="header-right"></view>
|
<text v-if="order" class="print-btn" @click="printOrder">🖨</text>
|
||||||
|
<text v-if="canModify" class="edit-btn" @click="goEdit">编辑</text>
|
||||||
|
<view v-else class="header-right"></view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<scroll-view scroll-y class="content" refresher-enabled @refresherrefresh="onRefresh" :refresher-triggered="refreshing">
|
<scroll-view scroll-y class="content" refresher-enabled @refresherrefresh="onRefresh" :refresher-triggered="refreshing">
|
||||||
@@ -24,6 +27,10 @@
|
|||||||
<text class="info-label">链接</text>
|
<text class="info-label">链接</text>
|
||||||
<text class="info-value link" @click="openLink">{{ order.Link }}</text>
|
<text class="info-value link" @click="openLink">{{ order.Link }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="info-row" v-if="order.Styles">
|
||||||
|
<text class="info-label">样式</text>
|
||||||
|
<text class="info-value">{{ order.Styles }}</text>
|
||||||
|
</view>
|
||||||
<view class="info-row" v-if="order.Remark">
|
<view class="info-row" v-if="order.Remark">
|
||||||
<text class="info-label">备注</text>
|
<text class="info-label">备注</text>
|
||||||
<text class="info-value">{{ order.Remark }}</text>
|
<text class="info-value">{{ order.Remark }}</text>
|
||||||
@@ -324,6 +331,58 @@ async function confirmStatusChange() {
|
|||||||
|
|
||||||
function goBack() { uni.navigateBack() }
|
function goBack() { uni.navigateBack() }
|
||||||
|
|
||||||
|
function printOrder() {
|
||||||
|
if (!order.value) return
|
||||||
|
|
||||||
|
// #ifndef APP-PLUS
|
||||||
|
uni.showToast({ title: '打印功能仅在 App 端可用', icon: 'none' })
|
||||||
|
return
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
const printer = uni.requireNativePlugin('LcPrinter')
|
||||||
|
|
||||||
|
// 初始化打印机
|
||||||
|
printer.initPrinter({})
|
||||||
|
printer.setConcentration({ level: 39 })
|
||||||
|
printer.setLineSpacing({ spacing: 1 })
|
||||||
|
|
||||||
|
// 标签打印模式(使用黑标定位)
|
||||||
|
printer.printEnableMark({ enable: true })
|
||||||
|
|
||||||
|
// 第一行:标题(加粗大字)
|
||||||
|
printer.setFontSize({ fontSize: 1 })
|
||||||
|
printer.setTextBold({ bold: true })
|
||||||
|
printer.printText({ content: (order.value.Title || '(无标题)')+'\n' })
|
||||||
|
//printer.printLine({ line_length: 1 })
|
||||||
|
|
||||||
|
// 第二行:备注
|
||||||
|
printer.setFontSize({ fontSize: 0 })
|
||||||
|
printer.setTextBold({ bold: false })
|
||||||
|
printer.printText({ content: '备注: ' + (order.value.Remark || '(无备注)')+'\n' })
|
||||||
|
//printer.printLine({ line_length: 1 })
|
||||||
|
|
||||||
|
// 第三行:样式
|
||||||
|
printer.printText({ content: '样式: ' + (order.value.Styles || '(无样式)')+'\n' })
|
||||||
|
//printer.printLine({ line_length: 1 })
|
||||||
|
|
||||||
|
// 第四行:创建日期
|
||||||
|
printer.printText({ content: '日期: ' + formatDate(order.value.CreatedAt) })
|
||||||
|
//printer.printLine({ line_length: 1 })
|
||||||
|
|
||||||
|
// 条形码:内容 po:ID,高度 4
|
||||||
|
printer.printBarcode({
|
||||||
|
text: 'po:' + orderId.value,
|
||||||
|
height: 40,
|
||||||
|
barcodeType: 73
|
||||||
|
})
|
||||||
|
|
||||||
|
printer.printGoToNextMark()
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function goEdit() {
|
function goEdit() {
|
||||||
uni.navigateTo({ url: `/pages/order/edit-order?id=${orderId.value}` })
|
uni.navigateTo({ url: `/pages/order/edit-order?id=${orderId.value}` })
|
||||||
}
|
}
|
||||||
@@ -368,6 +427,8 @@ onShow(() => {
|
|||||||
.header { background-color: #fff; padding: 30rpx; display: flex; align-items: center; }
|
.header { background-color: #fff; padding: 30rpx; display: flex; align-items: center; }
|
||||||
.back-btn { font-size: 32rpx; color: #007AFF; margin-right: 20rpx; }
|
.back-btn { font-size: 32rpx; color: #007AFF; margin-right: 20rpx; }
|
||||||
.title { font-size: 36rpx; font-weight: bold; color: #333; flex: 1; text-align: center; }
|
.title { font-size: 36rpx; font-weight: bold; color: #333; flex: 1; text-align: center; }
|
||||||
|
.header-actions { display: flex; align-items: center; gap: 20rpx; }
|
||||||
|
.print-btn { font-size: 36rpx; color: #007AFF; }
|
||||||
.edit-btn { font-size: 28rpx; color: #007AFF; }
|
.edit-btn { font-size: 28rpx; color: #007AFF; }
|
||||||
.header-right { width: 60rpx; }
|
.header-right { width: 60rpx; }
|
||||||
.content { padding: 20rpx; height: calc(100vh - 120rpx); }
|
.content { padding: 20rpx; height: calc(100vh - 120rpx); }
|
||||||
|
|||||||
@@ -343,6 +343,11 @@ function printItem() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 初始化打印机
|
||||||
|
printer.initPrinter({})
|
||||||
|
printer.setConcentration({ level: 39 })
|
||||||
|
printer.setLineSpacing({ spacing: 1 })
|
||||||
|
|
||||||
// 标签打印,使用黑标
|
// 标签打印,使用黑标
|
||||||
printer.printEnableMark({
|
printer.printEnableMark({
|
||||||
enable: true
|
enable: true
|
||||||
|
|||||||
@@ -606,6 +606,11 @@ async function printContainer() {
|
|||||||
|
|
||||||
const container = res.data.container
|
const container = res.data.container
|
||||||
|
|
||||||
|
// 初始化打印机
|
||||||
|
printer.initPrinter({})
|
||||||
|
printer.setConcentration({ level: 39 })
|
||||||
|
printer.setLineSpacing({ spacing: 1 })
|
||||||
|
|
||||||
// 标签打印,使用黑标
|
// 标签打印,使用黑标
|
||||||
printer.printEnableMark({
|
printer.printEnableMark({
|
||||||
enable: true
|
enable: true
|
||||||
|
|||||||
@@ -361,6 +361,11 @@ function printWorkOrder() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 初始化打印机
|
||||||
|
printer.initPrinter({})
|
||||||
|
printer.setConcentration({ level: 39 })
|
||||||
|
printer.setLineSpacing({ spacing: 1 })
|
||||||
|
|
||||||
// 标签打印,使用黑标
|
// 标签打印,使用黑标
|
||||||
printer.printEnableMark({
|
printer.printEnableMark({
|
||||||
enable: true
|
enable: true
|
||||||
|
|||||||
Reference in New Issue
Block a user