feat: 手机连续扫与出仓汇总表改用t-table并升至1.1.24
This commit is contained in:
+84
-2
@@ -72,20 +72,63 @@ export default {
|
|||||||
return configs.length ? configs[0] : null;
|
return configs.length ? configs[0] : null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/** 停止手机连续扫码(含 Ba-Scanner) */
|
||||||
|
stopPhoneScanContinuous() {
|
||||||
|
this._phoneScanContinuousActive = false;
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
try {
|
||||||
|
const scanner = uni.requireNativePlugin('Ba-Scanner');
|
||||||
|
if (scanner && typeof scanner.onClose === 'function') {
|
||||||
|
scanner.onClose();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// 未购买/未打包原生插件时忽略
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打开手机扫码
|
||||||
|
* @param {{ continuous?: boolean, callback?: Function, fail?: Function, scanType?: string[], hintText?: string, scanTimeSpace?: number }} options
|
||||||
|
* continuous=true 时优先用 Ba-Scanner 连续扫;无插件则扫完自动再开相机
|
||||||
|
*/
|
||||||
openPhoneScan(options = {}) {
|
openPhoneScan(options = {}) {
|
||||||
const callback = options.callback || this._scanCallback;
|
const callback = options.callback || this._scanCallback;
|
||||||
|
const continuous = !!options.continuous;
|
||||||
|
this._phoneScanContinuousActive = continuous;
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
if (continuous && this.openBaScannerContinuous(options, callback)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
// #ifdef APP-PLUS || MP-WEIXIN
|
// #ifdef APP-PLUS || MP-WEIXIN
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
scanType: options.scanType || ['qrCode', 'barCode'],
|
scanType: options.scanType || ['qrCode', 'barCode'],
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
this.handleScanResult(res.result, callback);
|
const result = this.handleScanResult(res.result, callback);
|
||||||
|
if (!continuous || !this._phoneScanContinuousActive) return;
|
||||||
|
Promise.resolve(result)
|
||||||
|
.catch(() => null)
|
||||||
|
.then(() => {
|
||||||
|
if (!this._phoneScanContinuousActive || !this.isPageActive) return;
|
||||||
|
setTimeout(() => {
|
||||||
|
if (!this._phoneScanContinuousActive || !this.isPageActive) return;
|
||||||
|
this.openPhoneScan(options);
|
||||||
|
}, Number(options.scanTimeSpace) > 0 ? Number(options.scanTimeSpace) : 400);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.error('手机扫码失败:', err);
|
console.error('手机扫码失败:', err);
|
||||||
|
this._phoneScanContinuousActive = false;
|
||||||
if (options.fail) {
|
if (options.fail) {
|
||||||
options.fail(err);
|
options.fail(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 用户取消不打扰
|
||||||
|
const msg = (err && (err.errMsg || err.message)) || '';
|
||||||
|
if (/cancel|取消/i.test(msg)) return;
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '扫码失败',
|
title: '扫码失败',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@@ -103,6 +146,41 @@ export default {
|
|||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ba-Scanner 连续扫码(插件市场 id=9669)
|
||||||
|
* @returns {boolean} 是否已成功唤起原生连续扫
|
||||||
|
*/
|
||||||
|
openBaScannerContinuous(options = {}, callback) {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
try {
|
||||||
|
const scanner = uni.requireNativePlugin('Ba-Scanner');
|
||||||
|
if (!scanner || typeof scanner.onScan !== 'function') return false;
|
||||||
|
scanner.onScan(
|
||||||
|
{
|
||||||
|
isContinuous: true,
|
||||||
|
scanTimeSpace: Number(options.scanTimeSpace) > 0 ? Number(options.scanTimeSpace) : 1500,
|
||||||
|
isShowVibrate: options.isShowVibrate !== false,
|
||||||
|
isShowBeep: !!options.isShowBeep,
|
||||||
|
isShowToast: false,
|
||||||
|
isShowPhotoAlbum: options.isShowPhotoAlbum !== false,
|
||||||
|
hintText: options.hintText || '扫二维码/条形码,可连续扫',
|
||||||
|
barcodeFormats: options.barcodeFormats || ['QR Code', 'Code 128', 'Code 39', 'EAN-13', 'EAN-8'],
|
||||||
|
},
|
||||||
|
(ret) => {
|
||||||
|
if (!ret || !ret.result) return;
|
||||||
|
if (!this._phoneScanContinuousActive) return;
|
||||||
|
this.handleScanResult(ret.result, callback);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('Ba-Scanner 不可用,回退 uni.scanCode', e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
triggerScan() {
|
triggerScan() {
|
||||||
if (this.usePhoneScanFallback) {
|
if (this.usePhoneScanFallback) {
|
||||||
this.openPhoneScan();
|
this.openPhoneScan();
|
||||||
@@ -261,11 +339,12 @@ export default {
|
|||||||
console.log("扫码结果:", cleanCode);
|
console.log("扫码结果:", cleanCode);
|
||||||
|
|
||||||
if (scanCallback) {
|
if (scanCallback) {
|
||||||
scanCallback(cleanCode);
|
return scanCallback(cleanCode);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("处理扫码结果时出错:", error);
|
console.error("处理扫码结果时出错:", error);
|
||||||
}
|
}
|
||||||
|
return undefined;
|
||||||
},
|
},
|
||||||
|
|
||||||
unregisterScanBroadcast() {
|
unregisterScanBroadcast() {
|
||||||
@@ -317,10 +396,13 @@ export default {
|
|||||||
|
|
||||||
onHide() {
|
onHide() {
|
||||||
this.isPageActive = false;
|
this.isPageActive = false;
|
||||||
|
// 不在 onHide 里关 Ba-Scanner:打开原生扫码页也会触发 hide,误关会打断连续扫
|
||||||
|
// 无插件回退模式靠 isPageActive 控制是否自动再开相机
|
||||||
},
|
},
|
||||||
|
|
||||||
onUnload() {
|
onUnload() {
|
||||||
this.isPageActive = false;
|
this.isPageActive = false;
|
||||||
|
this.stopPhoneScanContinuous();
|
||||||
this.unregisterScanBroadcast();
|
this.unregisterScanBroadcast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +1,52 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="fabric-out-summary">
|
<view class="fabric-out-summary">
|
||||||
<scroll-view scroll-x class="fabric-out-summaryScroll">
|
<scroll-view scroll-x class="fabric-out-summaryScroll">
|
||||||
<wyb-table
|
<view class="fabric-out-summaryInner" :style="{ width: tableWidth }">
|
||||||
:headers="headers"
|
<t-table border="1" border-color="#e1e1e1">
|
||||||
:contents="contents"
|
<t-tr font-size="18" color="#3e3e3e" align="center">
|
||||||
:width="tableWidth"
|
<t-th
|
||||||
height="auto"
|
v-for="col in headers"
|
||||||
:font-size="[36, 36]"
|
:key="col.key"
|
||||||
:min-height="[100, 100]"
|
align="center"
|
||||||
:padding="[16, 12]"
|
>
|
||||||
:first-line-fixed="false"
|
<view class="fabric-out-th" :style="cellStyle(col)">{{ col.label }}</view>
|
||||||
empty-string=""
|
</t-th>
|
||||||
@onCellClick="$emit('cell-click', $event)"
|
</t-tr>
|
||||||
/>
|
<t-tr
|
||||||
|
v-for="(row, rowIndex) in contents"
|
||||||
|
:key="row.group_key || rowIndex"
|
||||||
|
font-size="18"
|
||||||
|
color="#333"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<t-td
|
||||||
|
v-for="col in headers"
|
||||||
|
:key="col.key"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="fabric-out-td"
|
||||||
|
:style="cellStyle(col)"
|
||||||
|
@click="onCellClick(col.key, row)"
|
||||||
|
>{{ formatCell(row, col.key) }}</view>
|
||||||
|
</t-td>
|
||||||
|
</t-tr>
|
||||||
|
</t-table>
|
||||||
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<view v-if="!contents.length" class="fabric-out-summaryEmpty">暂无数据~~</view>
|
<view v-if="!contents.length" class="fabric-out-summaryEmpty">暂无数据~~</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
import tTable from '@/components/t-table/t-table.vue';
|
||||||
|
import tTr from '@/components/t-table/t-tr.vue';
|
||||||
|
import tTh from '@/components/t-table/t-th.vue';
|
||||||
|
import tTd from '@/components/t-table/t-td.vue';
|
||||||
import { SUMMARY_TABLE_COLUMNS } from '@/common/storeFabricBusinessOut';
|
import { SUMMARY_TABLE_COLUMNS } from '@/common/storeFabricBusinessOut';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { wybTable },
|
components: { tTable, tTr, tTh, tTd },
|
||||||
props: {
|
props: {
|
||||||
rows: { type: Array, default: () => [] },
|
rows: { type: Array, default: () => [] },
|
||||||
},
|
},
|
||||||
@@ -47,10 +70,30 @@ export default {
|
|||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
cellStyle(col) {
|
||||||
|
const width = `${col.width || 160}rpx`;
|
||||||
|
return {
|
||||||
|
width,
|
||||||
|
minWidth: width,
|
||||||
|
maxWidth: width,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
formatCell(row, key) {
|
||||||
|
const val = row[key];
|
||||||
|
if (val === 0) return '0';
|
||||||
|
return val != null && val !== '' ? val : '-';
|
||||||
|
},
|
||||||
|
onCellClick(key, row) {
|
||||||
|
this.$emit('cell-click', { key, lineData: row });
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
@import '@/common/pda-typography.scss';
|
||||||
|
|
||||||
.fabric-out-summary {
|
.fabric-out-summary {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
margin-top: 16rpx;
|
margin-top: 16rpx;
|
||||||
@@ -58,16 +101,40 @@ export default {
|
|||||||
.fabric-out-summaryScroll {
|
.fabric-out-summaryScroll {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.fabric-out-summary ::v-deep .wyb-table-scroll-view {
|
.fabric-out-summaryInner {
|
||||||
height: auto !important;
|
min-width: 100%;
|
||||||
overflow-x: auto;
|
}
|
||||||
overflow-y: visible;
|
.fabric-out-summary ::v-deep .t-table {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.fabric-out-summary ::v-deep .t-th,
|
||||||
|
.fabric-out-summary ::v-deep .t-td {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
width: auto;
|
||||||
|
padding: 0;
|
||||||
|
min-height: $pda-row-min-height;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.fabric-out-th,
|
||||||
|
.fabric-out-td {
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
min-height: $pda-row-min-height;
|
||||||
|
padding: 16rpx 12rpx;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
word-break: break-all;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.fabric-out-th {
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.fabric-out-summaryEmpty {
|
.fabric-out-summaryEmpty {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 36rpx;
|
font-size: $pda-font-body;
|
||||||
line-height: 100rpx;
|
line-height: $pda-row-min-height;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<template>
|
||||||
|
<view class="t-table" :style="{ 'border-width': border + 'px', 'border-color': borderColor }">
|
||||||
|
<slot />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
border: {
|
||||||
|
type: String,
|
||||||
|
default: '1'
|
||||||
|
},
|
||||||
|
borderColor: {
|
||||||
|
type: String,
|
||||||
|
default: '#d0dee5'
|
||||||
|
},
|
||||||
|
isCheck: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
provide() {
|
||||||
|
return {
|
||||||
|
table: this
|
||||||
|
};
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.childrens = [];
|
||||||
|
this.index = 0;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fire(e, index, len) {
|
||||||
|
let childrens = this.childrens;
|
||||||
|
console.log(childrens);
|
||||||
|
// 全选
|
||||||
|
if (index === 0) {
|
||||||
|
childrens.map((vm, index) => {
|
||||||
|
vm.checkboxData.checked = e;
|
||||||
|
return vm;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
let isAll = childrens.find((n, ids) => ids !== 0 && !n.checkboxData.checked);
|
||||||
|
childrens[0].checkboxData.checked = isAll ? false : true;
|
||||||
|
}
|
||||||
|
|
||||||
|
let fireArr = [];
|
||||||
|
for (let i = 0; i < childrens.length; i++) {
|
||||||
|
if (childrens[i].checkboxData.checked && i !== 0) {
|
||||||
|
fireArr.push(childrens[i].checkboxData.value - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$emit('change', {
|
||||||
|
detail: fireArr
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.t-table {
|
||||||
|
width: 100%;
|
||||||
|
border: 1px #d0dee5 solid;
|
||||||
|
border-left: none;
|
||||||
|
border-top: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t-table>>>t-tr {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t-table>>>t-tr:nth-child(2n) {
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* #ifdef H5 */
|
||||||
|
.t-table>>>.t-tr:nth-child(2n) {
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
/* #endif */
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<template>
|
||||||
|
<view class="t-td" :style="{ 'border-width': thBorder + 'px','border-color':borderColor ,'font-size':fontSize+'px' ,'color':color,'justify-content':tdAlignCpd}">
|
||||||
|
<slot></slot>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
align: String
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
thBorder: '1',
|
||||||
|
borderColor: '#d0dee5',
|
||||||
|
fontSize: '14',
|
||||||
|
color: '#555c60',
|
||||||
|
tdAlign: 'center'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
inject: ['table', 'tr'],
|
||||||
|
|
||||||
|
created() {
|
||||||
|
this.thBorder = this.table.border;
|
||||||
|
this.borderColor = this.table.borderColor;
|
||||||
|
this.fontSize = this.tr.fontSize;
|
||||||
|
this.color = this.tr.color;
|
||||||
|
if (this.align) {
|
||||||
|
this.tdAlign = this.align;
|
||||||
|
} else {
|
||||||
|
this.tdAlign = this.tr.align
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
tdAlignCpd() {
|
||||||
|
let nameAlign = '';
|
||||||
|
switch (this.tdAlign) {
|
||||||
|
case 'left':
|
||||||
|
nameAlign = 'flex-start'
|
||||||
|
break;
|
||||||
|
case 'center':
|
||||||
|
nameAlign = 'center'
|
||||||
|
break;
|
||||||
|
case 'right':
|
||||||
|
nameAlign = 'flex-end'
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
nameAlign = 'center'
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return nameAlign
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.t-td {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
padding: 14upx;
|
||||||
|
border-top: 1px #d0dee5 solid;
|
||||||
|
border-left: 1px #d0dee5 solid;
|
||||||
|
text-align: center;
|
||||||
|
color: #555c60;
|
||||||
|
font-size: 28upx;
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<template>
|
||||||
|
<view class="t-th" :style="{ 'border-width': thBorder + 'px' ,'border-color':borderColor,'font-size':fontSize+'px' ,'color':color,'justify-content':thAlignCpd}">
|
||||||
|
<slot></slot>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
align: String,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
thBorder: '1',
|
||||||
|
borderColor: '#d0dee5',
|
||||||
|
fontSize: '15',
|
||||||
|
color: '#3b4246',
|
||||||
|
thAlign: 'center'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
inject: ['table', 'tr'],
|
||||||
|
|
||||||
|
created() {
|
||||||
|
this.thBorder = this.table.border;
|
||||||
|
this.borderColor = this.table.borderColor;
|
||||||
|
this.fontSize = this.tr.fontSize;
|
||||||
|
this.color = this.tr.color;
|
||||||
|
if (this.align) {
|
||||||
|
this.thAlign = this.align;
|
||||||
|
} else {
|
||||||
|
this.thAlign = this.tr.align
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
thAlignCpd() {
|
||||||
|
let nameAlign = '';
|
||||||
|
switch (this.thAlign) {
|
||||||
|
case 'left':
|
||||||
|
nameAlign = 'flex-start'
|
||||||
|
break;
|
||||||
|
case 'center':
|
||||||
|
nameAlign = 'center'
|
||||||
|
break;
|
||||||
|
case 'right':
|
||||||
|
nameAlign = 'flex-end'
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
nameAlign = 'center'
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return nameAlign
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.t-th {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 30upx;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
color: #3b4246;
|
||||||
|
border-left: 1px #d0dee5 solid;
|
||||||
|
border-top: 1px #d0dee5 solid;
|
||||||
|
padding: 15upx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
<template>
|
||||||
|
<view class="t-tr">
|
||||||
|
<view v-if="isCheck" class="t-check-box" :style="{ 'border-width': thBorder + 'px' ,'border-color':borderColor}">
|
||||||
|
<checkbox-group @change="checkboxChange">
|
||||||
|
<checkbox :value="checkboxData.value + ''" :checked="checkboxData.checked" />
|
||||||
|
</checkbox-group>
|
||||||
|
</view>
|
||||||
|
<slot></slot>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
fontSize: String,
|
||||||
|
color: String,
|
||||||
|
align: String
|
||||||
|
},
|
||||||
|
inject: ['table'],
|
||||||
|
provide() {
|
||||||
|
return {
|
||||||
|
tr: this
|
||||||
|
};
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isCheck: false,
|
||||||
|
checkboxData: {
|
||||||
|
value: 0,
|
||||||
|
checked: false
|
||||||
|
},
|
||||||
|
checked: false,
|
||||||
|
thBorder: '1',
|
||||||
|
borderColor: '#d0dee5'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.thBorder = this.table.border;
|
||||||
|
this.borderColor = this.table.borderColor;
|
||||||
|
this.table.childrens.push(this);
|
||||||
|
this.checkboxData.value = this.table.index++;
|
||||||
|
this.isCheck = this.table.isCheck;
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkboxChange(e) {
|
||||||
|
this.checkboxData.checked = !this.checkboxData.checked;
|
||||||
|
this.table.childrens[this.checkboxData.value] = this;
|
||||||
|
this.table.fire(e.detail.value[0] ? true : false, this.checkboxData.value, this.table.index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.t-tr {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t-tr t-th,
|
||||||
|
.t-tr t-td {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t-tr .t-check-box {
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 80upx;
|
||||||
|
color: #3b4246;
|
||||||
|
border-left: 1px #d0dee5 solid;
|
||||||
|
border-top: 1px #d0dee5 solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t-tr .t-check-box checkbox {
|
||||||
|
transform: scale(0.8);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
"name" : "浩拓织厂",
|
"name" : "浩拓织厂",
|
||||||
"appid" : "__UNI__F79F300",
|
"appid" : "__UNI__F79F300",
|
||||||
"description" : "周尚-浩拓织厂",
|
"description" : "周尚-浩拓织厂",
|
||||||
"versionName" : "1.1.23",
|
"versionName" : "1.1.24",
|
||||||
"versionCode" : 123,
|
"versionCode" : 124,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"optimization" : {
|
"optimization" : {
|
||||||
|
|||||||
@@ -120,7 +120,16 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handlePhoneScan() {
|
handlePhoneScan() {
|
||||||
this.openPhoneScan();
|
// 手机连续扫:优先 Ba-Scanner;无插件时扫完自动再开相机
|
||||||
|
this.openPhoneScan({
|
||||||
|
continuous: true,
|
||||||
|
hintText: '连续扫码出仓,扫完可继续下一条',
|
||||||
|
scanTimeSpace: 1200,
|
||||||
|
callback: (scanResult) => {
|
||||||
|
this.QRBarCode = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||||
|
return this.handleScan();
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
registerOrderScanBroadcast() {
|
registerOrderScanBroadcast() {
|
||||||
this.registerScanBroadcast((scanResult) => {
|
this.registerScanBroadcast((scanResult) => {
|
||||||
@@ -314,14 +323,14 @@ export default {
|
|||||||
if (!this.canScan || !this.orderId) {
|
if (!this.canScan || !this.orderId) {
|
||||||
this.showError('请先提交保存后再扫码');
|
this.showError('请先提交保存后再扫码');
|
||||||
this.QRBarCode = '';
|
this.QRBarCode = '';
|
||||||
return;
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
if (!code) {
|
if (!code) {
|
||||||
this.QRBarCode = '';
|
this.QRBarCode = '';
|
||||||
return;
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
const scanType = this.BarCodeDelStatus ? 2 : 1;
|
const scanType = this.BarCodeDelStatus ? 2 : 1;
|
||||||
this.doScanUpdate(code, scanType);
|
return this.doScanUpdate(code, scanType);
|
||||||
},
|
},
|
||||||
BarCodeDelChange(e) {
|
BarCodeDelChange(e) {
|
||||||
this.BarCodeDelStatus = (e.detail.value || []).length > 0;
|
this.BarCodeDelStatus = (e.detail.value || []).length > 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user