feat: 半屏扫码、改密退出与表格并升至1.1.19
This commit is contained in:
@@ -142,6 +142,8 @@ const install = (Vue, vm) => {
|
||||
// PDA登录接口
|
||||
pdaLogin: (params = {}) => vm.$u.postJson('/login', params),
|
||||
pdaLogout: (params = {}) => vm.$u.postJson('/logout', params),
|
||||
// 修改密码:PUT pda/v1/user/updatePassword
|
||||
updatePassword: (params = {}) => vm.$u.putJson('/user/updatePassword', params),
|
||||
// 登录后获取当前用户信息、菜单与按钮权限
|
||||
pdaGetInformation: (params = {}) => vm.$u.get('/information', params),
|
||||
// 获取配布单列表
|
||||
|
||||
@@ -19,6 +19,7 @@ export default {
|
||||
registeredBrands: [],
|
||||
remoteScannerConfigs: [],
|
||||
usePhoneScanFallback: false,
|
||||
phoneScanPanelOpen: false,
|
||||
_scanCallback: null,
|
||||
}
|
||||
},
|
||||
@@ -72,6 +73,15 @@ export default {
|
||||
return configs.length ? configs[0] : null;
|
||||
},
|
||||
|
||||
closePhoneScanPanel() {
|
||||
this.phoneScanPanelOpen = false;
|
||||
},
|
||||
|
||||
/** 半屏连续扫:再次点击同一入口则收起 */
|
||||
togglePhoneScanPanel() {
|
||||
this.phoneScanPanelOpen = !this.phoneScanPanelOpen;
|
||||
},
|
||||
|
||||
openPhoneScan(options = {}) {
|
||||
const callback = options.callback || this._scanCallback;
|
||||
// #ifdef APP-PLUS || MP-WEIXIN
|
||||
@@ -317,10 +327,12 @@ export default {
|
||||
|
||||
onHide() {
|
||||
this.isPageActive = false;
|
||||
this.closePhoneScanPanel();
|
||||
},
|
||||
|
||||
onUnload() {
|
||||
this.isPageActive = false;
|
||||
this.closePhoneScanPanel();
|
||||
this.unregisterScanBroadcast();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,286 @@
|
||||
<template>
|
||||
<view v-show="visible" class="plus-barcode-panel">
|
||||
<view class="plus-barcode-panel__toolbar">
|
||||
<text class="plus-barcode-panel__tip">{{ tipText }}</text>
|
||||
<text class="plus-barcode-panel__close" @click.stop="close">收起</text>
|
||||
</view>
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view :id="barcodeViewId" class="plus-barcode-panel__holder" />
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef APP-PLUS -->
|
||||
<view class="plus-barcode-panel__fallback">
|
||||
<text>当前环境不支持半屏扫码,请使用输入框或系统扫码</text>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const DEFAULT_FILTERS = [0, 1, 2, 8, 10]; // QR EAN13 EAN8 CODE39 CODE128
|
||||
let barcodeSeq = 0;
|
||||
|
||||
export default {
|
||||
name: 'PlusBarcodePanel',
|
||||
props: {
|
||||
visible: { type: Boolean, default: false },
|
||||
hintText: { type: String, default: '将条码放入框内,可连续扫' },
|
||||
scanTimeSpace: { type: Number, default: 1200 },
|
||||
filters: { type: Array, default: () => DEFAULT_FILTERS.slice() },
|
||||
},
|
||||
data() {
|
||||
barcodeSeq += 1;
|
||||
return {
|
||||
barcodeViewId: `plusBarcodeView_${barcodeSeq}`,
|
||||
_barcode: null,
|
||||
_restartTimer: null,
|
||||
_active: false,
|
||||
_creating: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
tipText() {
|
||||
return this.hintText || '将条码放入框内,可连续扫';
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
visible(val) {
|
||||
if (val) {
|
||||
this.$nextTick(() => {
|
||||
this.openNative();
|
||||
});
|
||||
} else {
|
||||
this.destroyNative();
|
||||
}
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.destroyNative();
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
if (this.visible) {
|
||||
this.$nextTick(() => this.openNative());
|
||||
return;
|
||||
}
|
||||
this.$emit('update:visible', true);
|
||||
},
|
||||
close() {
|
||||
this.destroyNative();
|
||||
if (this.visible) {
|
||||
this.$emit('update:visible', false);
|
||||
}
|
||||
this.$emit('close');
|
||||
},
|
||||
getCurrentWebview() {
|
||||
// #ifdef APP-PLUS
|
||||
try {
|
||||
const pages = getCurrentPages();
|
||||
const page = pages[pages.length - 1];
|
||||
const vm = page && (page.$vm || page);
|
||||
const scope = (vm && vm.$scope) || (page && page.$scope);
|
||||
if (scope && typeof scope.$getAppWebview === 'function') {
|
||||
return scope.$getAppWebview();
|
||||
}
|
||||
if (page && typeof page.$getAppWebview === 'function') {
|
||||
return page.$getAppWebview();
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('PlusBarcodePanel getCurrentWebview failed', e);
|
||||
}
|
||||
// #endif
|
||||
return null;
|
||||
},
|
||||
openNative() {
|
||||
// #ifdef APP-PLUS
|
||||
if (!this.visible || this._creating) return;
|
||||
if (this._barcode) {
|
||||
this.resumeScan();
|
||||
return;
|
||||
}
|
||||
this._creating = true;
|
||||
this._active = true;
|
||||
// 等占位节点挂到页面后再创建,避免 view 层报 Not Found: Page[-1]
|
||||
setTimeout(() => {
|
||||
if (!this.visible || !this._active) {
|
||||
this._creating = false;
|
||||
return;
|
||||
}
|
||||
this.measureHolder(0);
|
||||
}, 200);
|
||||
// #endif
|
||||
},
|
||||
measureHolder(attempt) {
|
||||
// #ifdef APP-PLUS
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select(`#${this.barcodeViewId}`)
|
||||
.boundingClientRect((rect) => {
|
||||
if (!this.visible || !this._active) {
|
||||
this._creating = false;
|
||||
return;
|
||||
}
|
||||
if (!rect || !rect.width || !rect.height) {
|
||||
if (attempt < 8) {
|
||||
setTimeout(() => this.measureHolder(attempt + 1), 150);
|
||||
return;
|
||||
}
|
||||
const sys = uni.getSystemInfoSync();
|
||||
this._creating = false;
|
||||
this.createBarcode({
|
||||
top: (sys.statusBarHeight || 0) + 44,
|
||||
left: 0,
|
||||
width: sys.windowWidth || 300,
|
||||
height: 220,
|
||||
});
|
||||
return;
|
||||
}
|
||||
this._creating = false;
|
||||
this.createBarcode(rect);
|
||||
})
|
||||
.exec();
|
||||
// #endif
|
||||
},
|
||||
createBarcode(rect) {
|
||||
// #ifdef APP-PLUS
|
||||
const webview = this.getCurrentWebview();
|
||||
if (!webview || typeof plus === 'undefined' || !plus.barcode) {
|
||||
uni.showToast({ title: '当前环境不支持扫码', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
this.destroyNative(false);
|
||||
const width = Math.max(Math.round(rect.width), 1);
|
||||
const height = Math.max(Math.round(rect.height), 1);
|
||||
const top = Math.max(0, Math.round(rect.top || 0));
|
||||
const left = Math.max(0, Math.round(rect.left || 0));
|
||||
try {
|
||||
// 使用独立 id 覆盖在占位区域上,避免和页面节点 id 冲突导致 Not Found
|
||||
const barcode = plus.barcode.create(
|
||||
`plusBarcodeNative_${Date.now()}`,
|
||||
this.filters && this.filters.length ? this.filters : DEFAULT_FILTERS,
|
||||
{
|
||||
top: `${top}px`,
|
||||
left: `${left}px`,
|
||||
width: `${width}px`,
|
||||
height: `${height}px`,
|
||||
position: 'absolute',
|
||||
background: '#000000',
|
||||
frameColor: '#2979ff',
|
||||
scanbarColor: '#2979ff',
|
||||
},
|
||||
);
|
||||
barcode.onmarked = (type, code) => {
|
||||
this.onMarked(type, code);
|
||||
};
|
||||
barcode.onerror = (err) => {
|
||||
console.error('PlusBarcodePanel onerror', err);
|
||||
};
|
||||
webview.append(barcode);
|
||||
this._barcode = barcode;
|
||||
this._active = true;
|
||||
barcode.start({
|
||||
vibrate: true,
|
||||
sound: 'default',
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('PlusBarcodePanel create failed', e);
|
||||
uni.showToast({ title: '打开扫码失败', icon: 'none' });
|
||||
this._barcode = null;
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
onMarked(type, code) {
|
||||
const result = String(code || '').trim();
|
||||
if (!result || !this._active) return;
|
||||
try {
|
||||
if (this._barcode) this._barcode.cancel();
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
this.$emit('success', result, type);
|
||||
clearTimeout(this._restartTimer);
|
||||
const gap = Number(this.scanTimeSpace) > 0 ? Number(this.scanTimeSpace) : 1200;
|
||||
this._restartTimer = setTimeout(() => {
|
||||
this.resumeScan();
|
||||
}, gap);
|
||||
},
|
||||
resumeScan() {
|
||||
// #ifdef APP-PLUS
|
||||
if (!this.visible || !this._active || !this._barcode) return;
|
||||
try {
|
||||
this._barcode.start({
|
||||
vibrate: true,
|
||||
sound: 'default',
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn('PlusBarcodePanel resume failed', e);
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
destroyNative(clearActive = true) {
|
||||
clearTimeout(this._restartTimer);
|
||||
this._restartTimer = null;
|
||||
if (clearActive) this._active = false;
|
||||
// #ifdef APP-PLUS
|
||||
const barcode = this._barcode;
|
||||
this._barcode = null;
|
||||
if (!barcode) return;
|
||||
try {
|
||||
barcode.cancel();
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
try {
|
||||
barcode.close();
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '@/common/pda-typography.scss';
|
||||
|
||||
.plus-barcode-panel {
|
||||
background: #000;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
.plus-barcode-panel__toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
min-height: 72rpx;
|
||||
padding: 12rpx 26rpx;
|
||||
background: #1f1f1f;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.plus-barcode-panel__tip {
|
||||
flex: 1;
|
||||
color: #ffffff;
|
||||
font-size: $pda-font-action;
|
||||
padding-right: 16rpx;
|
||||
}
|
||||
.plus-barcode-panel__close {
|
||||
color: #2979ff;
|
||||
font-size: $pda-font-action;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.plus-barcode-panel__holder {
|
||||
width: 100%;
|
||||
height: 420rpx;
|
||||
background: #000;
|
||||
}
|
||||
.plus-barcode-panel__fallback {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 420rpx;
|
||||
padding: 24rpx;
|
||||
box-sizing: border-box;
|
||||
background: #333;
|
||||
color: #fff;
|
||||
font-size: $pda-font-body;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -4,46 +4,44 @@
|
||||
<slot name="before-list" />
|
||||
<view class="summary-wrap">
|
||||
<scroll-view scroll-x class="summary-scroll">
|
||||
<view class="summary-table" :style="{ width: tableWidth }">
|
||||
<view class="summary-row summary-head">
|
||||
<view
|
||||
v-for="col in columns"
|
||||
:key="col.key"
|
||||
class="summary-cell"
|
||||
:style="cellStyle(col)"
|
||||
>{{ col.label }}</view>
|
||||
</view>
|
||||
<view v-if="!list.length" class="summary-empty">暂无出仓明细</view>
|
||||
<view
|
||||
<t-table v-if="list.length" border="1" border-color="#e5e5e5" :style="{ width: tableWidth }">
|
||||
<t-tr class="summary-head" font-size="18" color="#666666" align="left">
|
||||
<t-th v-for="col in columns" :key="col.key" :style="cellStyle(col)">{{ col.label }}</t-th>
|
||||
</t-tr>
|
||||
<t-tr
|
||||
v-for="row in list"
|
||||
:key="row.group_key || row.id"
|
||||
class="summary-row"
|
||||
font-size="18"
|
||||
color="#333333"
|
||||
align="left"
|
||||
@click="$emit('fabric-info', row)"
|
||||
>
|
||||
<view class="summary-cell" :style="cellStyle(columns[0])">{{ row.grey_fabric_code || '-' }}</view>
|
||||
<view class="summary-cell" :style="cellStyle(columns[1])">{{ row.grey_fabric_name || '-' }}</view>
|
||||
<view class="summary-cell" :style="cellStyle(columns[2])">{{ displayNum(row.roll) }}</view>
|
||||
<view class="summary-cell" :style="cellStyle(columns[3])">{{ displayNum(row.weight) }}</view>
|
||||
<view
|
||||
class="summary-cell summary-action"
|
||||
:style="cellStyle(columns[4])"
|
||||
@click.stop="$emit('fine-code', row)"
|
||||
>细码</view>
|
||||
</view>
|
||||
<view v-if="list.length" class="summary-row summary-total">
|
||||
<view class="summary-cell" :style="cellStyle(columns[0])">合计</view>
|
||||
<view class="summary-cell" :style="cellStyle(columns[1])"></view>
|
||||
<view class="summary-cell" :style="cellStyle(columns[2])">{{ totalRoll }}</view>
|
||||
<view class="summary-cell" :style="cellStyle(columns[3])">{{ totalWeight }}</view>
|
||||
<view class="summary-cell" :style="cellStyle(columns[4])"></view>
|
||||
</view>
|
||||
</view>
|
||||
<t-td :style="cellStyle(columns[0])">{{ row.grey_fabric_code || '-' }}</t-td>
|
||||
<t-td :style="cellStyle(columns[1])">{{ row.grey_fabric_name || '-' }}</t-td>
|
||||
<t-td :style="cellStyle(columns[2])">{{ displayNum(row.roll) }}</t-td>
|
||||
<t-td :style="cellStyle(columns[3])">{{ displayNum(row.weight) }}</t-td>
|
||||
<t-td class="summary-action" :style="cellStyle(columns[4])" @click.stop="$emit('fine-code', row)">细码</t-td>
|
||||
</t-tr>
|
||||
<t-tr class="summary-total" font-size="18" color="#333333" align="left">
|
||||
<t-td :style="cellStyle(columns[0])">合计</t-td>
|
||||
<t-td :style="cellStyle(columns[1])"></t-td>
|
||||
<t-td :style="cellStyle(columns[2])">{{ totalRoll }}</t-td>
|
||||
<t-td :style="cellStyle(columns[3])">{{ totalWeight }}</t-td>
|
||||
<t-td :style="cellStyle(columns[4])"></t-td>
|
||||
</t-tr>
|
||||
</t-table>
|
||||
<view v-else class="summary-empty">暂无出仓明细</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import tTable from '@/components/t-table/t-table.vue';
|
||||
import tTh from '@/components/t-table/t-th.vue';
|
||||
import tTr from '@/components/t-table/t-tr.vue';
|
||||
import tTd from '@/components/t-table/t-td.vue';
|
||||
|
||||
const COLUMNS = [
|
||||
{ key: 'grey_fabric_code', label: '坯布编号', width: 220 },
|
||||
{ key: 'grey_fabric_name', label: '坯布名称', width: 260 },
|
||||
@@ -53,6 +51,7 @@ const COLUMNS = [
|
||||
];
|
||||
|
||||
export default {
|
||||
components: { tTable, tTh, tTr, tTd },
|
||||
props: {
|
||||
list: { type: Array, default: () => [] },
|
||||
title: { type: String, default: '出仓细码' },
|
||||
@@ -74,10 +73,12 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
cellStyle(col) {
|
||||
const width = `${col.width}rpx`;
|
||||
return {
|
||||
width: `${col.width}rpx`,
|
||||
minWidth: `${col.width}rpx`,
|
||||
maxWidth: `${col.width}rpx`,
|
||||
width,
|
||||
minWidth: width,
|
||||
maxWidth: width,
|
||||
flex: `0 0 ${width}`,
|
||||
};
|
||||
},
|
||||
displayNum(val) {
|
||||
@@ -111,42 +112,19 @@ export default {
|
||||
.summary-scroll {
|
||||
width: 100%;
|
||||
}
|
||||
.summary-row {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
.summary-row:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.summary-head {
|
||||
background: #f7f8fa;
|
||||
}
|
||||
.summary-total {
|
||||
background: #fff7e6;
|
||||
}
|
||||
.summary-cell {
|
||||
::v-deep .t-th,
|
||||
::v-deep .t-td {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: $pda-row-min-height;
|
||||
padding: 12rpx 16rpx;
|
||||
font-size: $pda-font-body;
|
||||
color: #333;
|
||||
border-right: 1rpx solid #f0f0f0;
|
||||
word-break: break-all;
|
||||
}
|
||||
.summary-head .summary-cell,
|
||||
.summary-total .summary-cell {
|
||||
font-weight: bold;
|
||||
::v-deep .summary-head {
|
||||
background: #f7f8fa;
|
||||
}
|
||||
.summary-head .summary-cell {
|
||||
color: #666;
|
||||
::v-deep .summary-total {
|
||||
background: #fff7e6;
|
||||
}
|
||||
.summary-cell:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
.summary-action {
|
||||
::v-deep .summary-action {
|
||||
color: #2979ff;
|
||||
}
|
||||
.summary-empty {
|
||||
|
||||
@@ -10,8 +10,13 @@
|
||||
@input="$emit('input', $event.detail.value)"
|
||||
@confirm="$emit('scan')"
|
||||
/>
|
||||
<view
|
||||
v-if="showPhoneScan && scanning"
|
||||
class="fabric-out-scanClose"
|
||||
@click.stop="$emit('phone-scan')"
|
||||
>关闭扫码</view>
|
||||
<u-icon
|
||||
v-if="showPhoneScan"
|
||||
v-else-if="showPhoneScan"
|
||||
class="fabric-out-phoneScanIcon"
|
||||
name="scan"
|
||||
size="44"
|
||||
@@ -38,15 +43,32 @@ export default {
|
||||
message: { type: String, default: '' },
|
||||
disabledTip: { type: String, default: '当前状态不可扫码' },
|
||||
showPhoneScan: { type: Boolean, default: false },
|
||||
scanning: { type: Boolean, default: false },
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
|
||||
@import '@/common/pda-typography.scss';
|
||||
|
||||
.fabric-out-phoneScanIcon {
|
||||
margin-left: 16rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.fabric-out-scanClose {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: 8rpx;
|
||||
padding: 0 16rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 1rpx solid #2979ff;
|
||||
background: #eaf2ff;
|
||||
color: #2979ff;
|
||||
font-size: $pda-font-action;
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -4,39 +4,26 @@
|
||||
<slot name="before-list" />
|
||||
<view class="summary-wrap">
|
||||
<scroll-view scroll-x class="summary-scroll">
|
||||
<view class="summary-table" :style="{ width: tableWidth }">
|
||||
<view class="summary-row summary-head">
|
||||
<view
|
||||
v-for="col in columns"
|
||||
:key="col.key"
|
||||
class="summary-cell"
|
||||
:style="cellStyle(col)"
|
||||
>{{ col.label }}</view>
|
||||
</view>
|
||||
<view v-if="!rows.length" class="summary-empty">{{ emptyText }}</view>
|
||||
<view
|
||||
<t-table v-if="rows.length" border="1" border-color="#e5e5e5" :style="{ width: tableWidth }">
|
||||
<t-tr class="summary-head" font-size="18" color="#666666" align="left">
|
||||
<t-th v-for="col in columns" :key="col.key" :style="cellStyle(col)">{{ col.label }}</t-th>
|
||||
</t-tr>
|
||||
<t-tr
|
||||
v-for="row in rows"
|
||||
:key="row.group_key"
|
||||
class="summary-row"
|
||||
font-size="18"
|
||||
color="#333333"
|
||||
align="left"
|
||||
:class="{ 'summary-row--open': expandedKey === row.group_key }"
|
||||
@click="toggleRow(row.group_key)"
|
||||
>
|
||||
<view
|
||||
v-for="col in columns"
|
||||
:key="col.key"
|
||||
class="summary-cell"
|
||||
:style="cellStyle(col)"
|
||||
>{{ formatCell(row, col.key) }}</view>
|
||||
</view>
|
||||
<view v-if="rows.length" class="summary-row summary-total">
|
||||
<view
|
||||
v-for="col in columns"
|
||||
:key="col.key"
|
||||
class="summary-cell"
|
||||
:style="cellStyle(col)"
|
||||
>{{ totalCell(col.key) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<t-td v-for="col in columns" :key="col.key" :style="cellStyle(col)">{{ formatCell(row, col.key) }}</t-td>
|
||||
</t-tr>
|
||||
<t-tr class="summary-total" font-size="18" color="#333333" align="left">
|
||||
<t-td v-for="col in columns" :key="col.key" :style="cellStyle(col)">{{ totalCell(col.key) }}</t-td>
|
||||
</t-tr>
|
||||
</t-table>
|
||||
<view v-else class="summary-empty">{{ emptyText }}</view>
|
||||
</scroll-view>
|
||||
|
||||
<view v-if="expandedRow" class="summary-fine">
|
||||
@@ -46,30 +33,26 @@
|
||||
</view>
|
||||
<view v-if="!expandedRow.fine_codes.length" class="summary-empty">暂无细码</view>
|
||||
<scroll-view v-else scroll-x class="summary-scroll">
|
||||
<view class="summary-table" :style="{ width: fineTableWidth }">
|
||||
<view class="summary-row summary-head">
|
||||
<view
|
||||
v-for="col in fineCols"
|
||||
:key="col.key"
|
||||
class="summary-cell"
|
||||
:style="cellStyle(col)"
|
||||
>{{ col.label }}</view>
|
||||
</view>
|
||||
<view
|
||||
<t-table border="1" border-color="#e5e5e5" :style="{ width: fineTableWidth }">
|
||||
<t-tr class="summary-head" font-size="18" color="#666666" align="left">
|
||||
<t-th v-for="col in fineCols" :key="col.key" :style="cellStyle(col)">{{ col.label }}</t-th>
|
||||
</t-tr>
|
||||
<t-tr
|
||||
v-for="(fc, fcIndex) in expandedRow.fine_codes"
|
||||
:key="fc.id || fcIndex"
|
||||
class="summary-row"
|
||||
font-size="18"
|
||||
color="#333333"
|
||||
align="left"
|
||||
>
|
||||
<view
|
||||
<t-td
|
||||
v-for="col in fineCols"
|
||||
:key="col.key"
|
||||
class="summary-cell"
|
||||
:class="{ 'summary-action': col.key === 'action' }"
|
||||
:style="cellStyle(col)"
|
||||
@click="onFineCellTap(col.key, fc)"
|
||||
>{{ formatFineCell(fc, col.key) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
>{{ formatFineCell(fc, col.key) }}</t-td>
|
||||
</t-tr>
|
||||
</t-table>
|
||||
</scroll-view>
|
||||
<view v-if="deletable && expandedRow.fine_codes.length" class="summary-tip">
|
||||
点击「删除」移除对应细码
|
||||
@@ -80,6 +63,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import tTable from '@/components/t-table/t-table.vue';
|
||||
import tTh from '@/components/t-table/t-th.vue';
|
||||
import tTr from '@/components/t-table/t-tr.vue';
|
||||
import tTd from '@/components/t-table/t-td.vue';
|
||||
|
||||
const SUMMARY_COLUMNS = [
|
||||
{ label: '成品编号', key: 'product_code', width: 260 },
|
||||
{ label: '色号', key: 'product_color_code', width: 220 },
|
||||
@@ -104,6 +92,7 @@ const TARE_COLUMNS = [
|
||||
];
|
||||
|
||||
export default {
|
||||
components: { tTable, tTh, tTr, tTd },
|
||||
props: {
|
||||
groups: { type: Array, default: () => [] },
|
||||
title: { type: String, default: '明细' },
|
||||
@@ -191,10 +180,12 @@ export default {
|
||||
return Number(total.toFixed(2));
|
||||
},
|
||||
cellStyle(col) {
|
||||
const width = `${col.width}rpx`;
|
||||
return {
|
||||
width: `${col.width}rpx`,
|
||||
minWidth: `${col.width}rpx`,
|
||||
maxWidth: `${col.width}rpx`,
|
||||
width,
|
||||
minWidth: width,
|
||||
maxWidth: width,
|
||||
flex: `0 0 ${width}`,
|
||||
};
|
||||
},
|
||||
joinName(code, name) {
|
||||
@@ -255,46 +246,23 @@ export default {
|
||||
.summary-scroll {
|
||||
width: 100%;
|
||||
}
|
||||
.summary-table {
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.summary-row {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
.summary-row:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.summary-head {
|
||||
background: #f7f8fa;
|
||||
}
|
||||
.summary-row--open {
|
||||
background: #f0f7ff;
|
||||
}
|
||||
.summary-total {
|
||||
background: #fff7e6;
|
||||
}
|
||||
.summary-cell {
|
||||
::v-deep .t-th,
|
||||
::v-deep .t-td {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: $pda-row-min-height;
|
||||
padding: 12rpx 16rpx;
|
||||
font-size: $pda-font-body;
|
||||
color: #333;
|
||||
border-right: 1rpx solid #f0f0f0;
|
||||
word-break: break-all;
|
||||
}
|
||||
.summary-head .summary-cell {
|
||||
font-weight: bold;
|
||||
color: #666;
|
||||
::v-deep .summary-head {
|
||||
background: #f7f8fa;
|
||||
}
|
||||
.summary-total .summary-cell {
|
||||
font-weight: bold;
|
||||
::v-deep .summary-row--open {
|
||||
background: #f0f7ff;
|
||||
}
|
||||
.summary-cell:last-child {
|
||||
border-right: none;
|
||||
::v-deep .summary-total {
|
||||
background: #fff7e6;
|
||||
}
|
||||
::v-deep .summary-action {
|
||||
color: #f5222d;
|
||||
}
|
||||
.summary-empty {
|
||||
padding: 28rpx 16rpx;
|
||||
|
||||
@@ -11,8 +11,13 @@
|
||||
@confirm="$emit('confirm')"
|
||||
/>
|
||||
<text v-if="name" class="process-in-binName">{{ name }}</text>
|
||||
<view
|
||||
v-if="showPhoneScan && scanning"
|
||||
class="fabric-out-scanClose"
|
||||
@click.stop="$emit('phone-scan')"
|
||||
>关闭扫码</view>
|
||||
<u-icon
|
||||
v-if="showPhoneScan"
|
||||
v-else-if="showPhoneScan"
|
||||
class="fabric-out-phoneScanIcon"
|
||||
name="scan"
|
||||
size="44"
|
||||
@@ -34,6 +39,7 @@ export default {
|
||||
code: { type: String, default: '' },
|
||||
name: { type: String, default: '' },
|
||||
showPhoneScan: { type: Boolean, default: false },
|
||||
scanning: { type: Boolean, default: false },
|
||||
showDisabledTip: { type: Boolean, default: true },
|
||||
disabledTip: { type: String, default: '请先提交保存后再扫仓位' },
|
||||
},
|
||||
@@ -42,6 +48,7 @@ export default {
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
|
||||
@import '@/common/pda-typography.scss';
|
||||
|
||||
.process-in-binRow {
|
||||
background: #fff;
|
||||
@@ -53,6 +60,21 @@ export default {
|
||||
margin-left: 16rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.fabric-out-scanClose {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: 8rpx;
|
||||
padding: 0 16rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 1rpx solid #2979ff;
|
||||
background: #eaf2ff;
|
||||
color: #2979ff;
|
||||
font-size: $pda-font-action;
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.process-in-binName {
|
||||
margin-left: 12rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
@@ -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" : "浩拓ERP",
|
||||
"appid" : "__UNI__F79F300",
|
||||
"description" : "浩拓ERP",
|
||||
"versionName" : "1.1.18",
|
||||
"versionCode" : 118,
|
||||
"versionName" : "1.1.19",
|
||||
"versionCode" : 119,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"optimization" : {
|
||||
|
||||
@@ -15,10 +15,22 @@
|
||||
<u-form-item>
|
||||
<text class="title" style="width: 200px">备注内容:{{ BillRemark }}</text>
|
||||
</u-form-item>
|
||||
<PlusBarcodePanel
|
||||
v-if="usePhoneScanFallback"
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
hint-text="连续扫码配布,扫完可继续下一条"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<u-form-item label-width="130" label="条码资料:">
|
||||
<input type="text" v-model="QRBarCode" maxlength="-1" style="width: 170px" @confirm="SalePickBillDetailScan" />
|
||||
<text
|
||||
v-if="usePhoneScanFallback && phoneScanPanelOpen"
|
||||
class="phone-scan-close"
|
||||
@click.stop="handlePhoneScan"
|
||||
>关闭扫码</text>
|
||||
<u-icon
|
||||
v-if="usePhoneScanFallback"
|
||||
v-else-if="usePhoneScanFallback"
|
||||
name="scan"
|
||||
size="44"
|
||||
color="#2979ff"
|
||||
@@ -83,8 +95,10 @@ import util, {
|
||||
} from "../../common/util";
|
||||
import wybTable from "@/components/wyb-table/wyb-table.vue";
|
||||
import scanMixin from "@/common/scanMixin.js";
|
||||
import PlusBarcodePanel from "@/components/common/PlusBarcodePanel.vue";
|
||||
let that = "";
|
||||
export default {
|
||||
components: { PlusBarcodePanel },
|
||||
mixins: [scanMixin],
|
||||
data() {
|
||||
return {
|
||||
@@ -215,7 +229,10 @@ export default {
|
||||
|
||||
methods: {
|
||||
handlePhoneScan() {
|
||||
this.openPhoneScan();
|
||||
this.togglePhoneScanPanel();
|
||||
},
|
||||
onPlusBarcodeSuccess(scanResult) {
|
||||
this.handleScanResult(scanResult, this._scanCallback);
|
||||
},
|
||||
|
||||
playSuccess(text) {
|
||||
@@ -454,6 +471,18 @@ export default {
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.phone-scan-close {
|
||||
margin-left: 8px;
|
||||
padding: 0 12px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
border: 1px solid #2979ff;
|
||||
border-radius: 4px;
|
||||
color: #2979ff;
|
||||
background: #eaf2ff;
|
||||
font-size: 34rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
page {
|
||||
background-color: #f8f8f8;
|
||||
padding-bottom: 260rpx;
|
||||
|
||||
@@ -76,6 +76,13 @@
|
||||
|
||||
>
|
||||
|
||||
<PlusBarcodePanel
|
||||
slot="before-list"
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
hint-text="连续扫码出仓,扫完可继续下一条"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<FabricOutScanBar
|
||||
slot="before-list"
|
||||
:can-scan="canScan"
|
||||
@@ -84,6 +91,7 @@
|
||||
:message="BillDataMessage"
|
||||
disabled-tip="请先提交保存后再扫码"
|
||||
:show-phone-scan="usePhoneScanFallback"
|
||||
:scanning="phoneScanPanelOpen"
|
||||
@input="QRBarCode = $event"
|
||||
@scan="handleScan"
|
||||
@phone-scan="handlePhoneScan"
|
||||
@@ -158,12 +166,16 @@ import FabricOutScanDetail from '@/components/storefabric/FabricOutScanDetail.vu
|
||||
|
||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
|
||||
components: {
|
||||
|
||||
PlusBarcodePanel,
|
||||
|
||||
FabricInfoPopup,
|
||||
|
||||
FineCodePopup,
|
||||
|
||||
@@ -30,6 +30,13 @@
|
||||
@fabric-info="openFabricInfo"
|
||||
@fine-code="openFineCode"
|
||||
>
|
||||
<PlusBarcodePanel
|
||||
slot="before-list"
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
hint-text="连续扫码出仓,扫完可继续下一条"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<FabricOutScanBar
|
||||
slot="before-list"
|
||||
:can-scan="canScan"
|
||||
@@ -37,6 +44,7 @@
|
||||
:delete-mode="BarCodeDelStatus"
|
||||
:message="BillDataMessage"
|
||||
:show-phone-scan="usePhoneScanFallback"
|
||||
:scanning="phoneScanPanelOpen"
|
||||
@input="QRBarCode = $event"
|
||||
@scan="handleScan"
|
||||
@phone-scan="handlePhoneScan"
|
||||
@@ -69,9 +77,11 @@ import FabricOutDetailList from '@/components/storefabric/FabricOutDetailList.vu
|
||||
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
||||
import FabricOutScanDetail from '@/components/storefabric/FabricOutScanDetail.vue';
|
||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PlusBarcodePanel,
|
||||
FabricInfoPopup,
|
||||
FineCodePopup,
|
||||
OrderStatusBar,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
import util from '@/common/util';
|
||||
import scanMixin from '@/common/scanMixin.js';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
import remoteSelectMixin from '@/common/remoteSelectMixin.js';
|
||||
import { withNameParam } from '@/common/remoteSelect';
|
||||
import { initTts, speak } from '@/common/tts.js';
|
||||
@@ -38,6 +39,7 @@ import {
|
||||
} from '@/common/storeFabricBusinessOut';
|
||||
|
||||
export default {
|
||||
components: { PlusBarcodePanel },
|
||||
mixins: [scanMixin, remoteSelectMixin],
|
||||
data() {
|
||||
return {
|
||||
@@ -115,7 +117,15 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handlePhoneScan() {
|
||||
this.openPhoneScan();
|
||||
if (!this.canScan) {
|
||||
this.showError('请先提交保存后再扫码');
|
||||
return;
|
||||
}
|
||||
this.togglePhoneScanPanel();
|
||||
},
|
||||
onPlusBarcodeSuccess(scanResult) {
|
||||
this.QRBarCode = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||
return this.handleScan();
|
||||
},
|
||||
registerOrderScanBroadcast() {
|
||||
this.registerScanBroadcast((scanResult) => {
|
||||
@@ -127,6 +137,7 @@ export default {
|
||||
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
||||
if (this.canScan && !nextCanScan) {
|
||||
this.unregisterScanBroadcast();
|
||||
this.closePhoneScanPanel();
|
||||
}
|
||||
this.canScan = nextCanScan;
|
||||
},
|
||||
|
||||
@@ -29,10 +29,22 @@
|
||||
</view>
|
||||
<u-input v-model="Remark" maxlength="-1" type="textarea" :border="true" :height="100" :auto-height="true" />
|
||||
</view>
|
||||
<PlusBarcodePanel
|
||||
v-if="usePhoneScanFallback"
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
hint-text="连续扫码盘点,扫完可继续下一条"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<u-form-item label-width="150" label="条码资料:">
|
||||
<input type="text" maxlength="-1" v-model="QRBarCode" style="width:200px;" @confirm="GoodsCheckBillDetailScan" />
|
||||
<text
|
||||
v-if="usePhoneScanFallback && phoneScanPanelOpen"
|
||||
class="phone-scan-close"
|
||||
@click.stop="handlePhoneScan"
|
||||
>关闭扫码</text>
|
||||
<u-icon
|
||||
v-if="usePhoneScanFallback"
|
||||
v-else-if="usePhoneScanFallback"
|
||||
name="scan"
|
||||
size="44"
|
||||
color="#2979ff"
|
||||
@@ -106,8 +118,10 @@
|
||||
playErrorAudio
|
||||
} from '../../common/util';
|
||||
import scanMixin from '@/common/scanMixin.js';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
||||
export default {
|
||||
components: { PlusBarcodePanel },
|
||||
mixins: [scanMixin],
|
||||
data() {
|
||||
return {
|
||||
@@ -245,7 +259,26 @@
|
||||
},
|
||||
methods: {
|
||||
handlePhoneScan() {
|
||||
this.openPhoneScan();
|
||||
this.togglePhoneScanPanel();
|
||||
},
|
||||
onPlusBarcodeSuccess(scanResult) {
|
||||
const code = String(scanResult || '').replace(/\s+/g, '').replace(/[\r\n]/g, '');
|
||||
if (!code) return;
|
||||
if (!this.StoreName) {
|
||||
this.showError('请先选择仓库');
|
||||
return;
|
||||
}
|
||||
if (!this.StoreStationNo) {
|
||||
this.StoreStationNo = code;
|
||||
this.$nextTick(() => this.GetStoreStationName());
|
||||
return;
|
||||
}
|
||||
if (!this.GoodsCheckBillID) {
|
||||
this.showError('请先提交');
|
||||
return;
|
||||
}
|
||||
this.QRBarCode = code;
|
||||
this.$nextTick(() => this.GoodsCheckBillDetailScan());
|
||||
},
|
||||
|
||||
// 添加通用错误提示方法
|
||||
@@ -692,6 +725,18 @@
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.phone-scan-close {
|
||||
margin-left: 8px;
|
||||
padding: 0 12px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
border: 1px solid #2979ff;
|
||||
border-radius: 4px;
|
||||
color: #2979ff;
|
||||
background: #eaf2ff;
|
||||
font-size: 34rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
page {
|
||||
background-color: #F8F8F8;
|
||||
padding-bottom: 260rpx;
|
||||
|
||||
@@ -9,11 +9,23 @@
|
||||
<text class="title" style="width:200px;">仓库名称:{{ StoreName }}</text>
|
||||
<text class="title" style="width:200px;">仓位名称:{{ StoreStationName }}</text>
|
||||
</u-form-item>
|
||||
<PlusBarcodePanel
|
||||
v-if="usePhoneScanFallback"
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
hint-text="连续扫码盘点,扫完可继续下一条"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<u-form-item label-width="150" label="条码资料:">
|
||||
<input type="text" v-model="QRBarCode" maxlength="-1" style="width:200px;"
|
||||
@confirm="GoodsCheckBillDetailScan" />
|
||||
<text
|
||||
v-if="usePhoneScanFallback && phoneScanPanelOpen"
|
||||
class="phone-scan-close"
|
||||
@click.stop="handlePhoneScan"
|
||||
>关闭扫码</text>
|
||||
<u-icon
|
||||
v-if="usePhoneScanFallback"
|
||||
v-else-if="usePhoneScanFallback"
|
||||
name="scan"
|
||||
size="44"
|
||||
color="#2979ff"
|
||||
@@ -78,9 +90,11 @@ import util, {
|
||||
playErrorAudio
|
||||
} from '../../common/util';
|
||||
import scanMixin from '@/common/scanMixin.js';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
||||
//let that = '';
|
||||
export default {
|
||||
components: { PlusBarcodePanel },
|
||||
mixins: [scanMixin],
|
||||
data() {
|
||||
return {
|
||||
@@ -178,7 +192,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handlePhoneScan() {
|
||||
this.openPhoneScan();
|
||||
this.togglePhoneScanPanel();
|
||||
},
|
||||
onPlusBarcodeSuccess(scanResult) {
|
||||
this.handleScanResult(scanResult, this._scanCallback);
|
||||
},
|
||||
|
||||
// 添加通用错误提示方法
|
||||
@@ -375,6 +392,18 @@ export default {
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.phone-scan-close {
|
||||
margin-left: 8px;
|
||||
padding: 0 12px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
border: 1px solid #2979ff;
|
||||
border-radius: 4px;
|
||||
color: #2979ff;
|
||||
background: #eaf2ff;
|
||||
font-size: 34rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
page {
|
||||
background-color: #F8F8F8;
|
||||
padding-bottom: 260rpx;
|
||||
|
||||
@@ -23,11 +23,23 @@
|
||||
<checkbox ref="checkBoxRef" :checked="AllStoreStationScanStatus">整架</checkbox>
|
||||
</checkbox-group>
|
||||
</u-form-item>
|
||||
<PlusBarcodePanel
|
||||
v-if="usePhoneScanFallback"
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
hint-text="连续扫码移仓,扫完可继续下一条"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<u-form-item label-width="150" label="条码资料:" :class="{ 'input-highlight': shouldHighlightQR }">
|
||||
<input type="text" v-model="QRBarCode" maxlength="-1" style="width:150px;"
|
||||
@confirm="GoodsStoreStationMoveScan" />
|
||||
<text
|
||||
v-if="usePhoneScanFallback && phoneScanPanelOpen"
|
||||
class="phone-scan-close"
|
||||
@click.stop="handlePhoneScan"
|
||||
>关闭扫码</text>
|
||||
<u-icon
|
||||
v-if="usePhoneScanFallback"
|
||||
v-else-if="usePhoneScanFallback"
|
||||
name="scan"
|
||||
size="44"
|
||||
color="#2979ff"
|
||||
@@ -83,7 +95,9 @@ import util, {
|
||||
} from '../../common/util';
|
||||
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
||||
import scanMixin from '@/common/scanMixin.js';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
export default {
|
||||
components: { PlusBarcodePanel },
|
||||
mixins: [scanMixin],
|
||||
data() {
|
||||
return {
|
||||
@@ -183,7 +197,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handlePhoneScan() {
|
||||
this.openPhoneScan();
|
||||
this.togglePhoneScanPanel();
|
||||
},
|
||||
onPlusBarcodeSuccess(scanResult) {
|
||||
this.handleScanResult(scanResult, this._scanCallback);
|
||||
},
|
||||
|
||||
playSuccess() {
|
||||
@@ -511,6 +528,18 @@ export default {
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.phone-scan-close {
|
||||
margin-left: 8px;
|
||||
padding: 0 12px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
border: 1px solid #2979ff;
|
||||
border-radius: 4px;
|
||||
color: #2979ff;
|
||||
background: #eaf2ff;
|
||||
font-size: 34rpx;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.first {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -65,12 +65,19 @@
|
||||
</view>
|
||||
</OrderHeaderFold>
|
||||
|
||||
<PlusBarcodePanel
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
:hint-text="phoneScanHint"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<ProcessInBinBar
|
||||
:can-scan="canScan"
|
||||
:bin-id="warehouseBinId"
|
||||
:code="warehouseBinCode"
|
||||
:name="warehouseBinName"
|
||||
:show-phone-scan="canScan"
|
||||
:scanning="phoneScanPanelOpen && phoneScanTarget === 'bin'"
|
||||
@code-input="warehouseBinCode = $event"
|
||||
@confirm="resolveWarehouseBin"
|
||||
@phone-scan="handleBinPhoneScan"
|
||||
@@ -83,6 +90,7 @@
|
||||
:message="BillDataMessage"
|
||||
:disabled-tip="qrDisabledTip"
|
||||
:show-phone-scan="canScanQr"
|
||||
:scanning="phoneScanPanelOpen && phoneScanTarget === 'qr'"
|
||||
@input="QRBarCode = $event"
|
||||
@scan="handleScan"
|
||||
@phone-scan="handlePhoneScan"
|
||||
@@ -122,9 +130,11 @@ import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
||||
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
||||
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PlusBarcodePanel,
|
||||
OrderStatusBar,
|
||||
OrderHeaderFold,
|
||||
FabricOutScanBar,
|
||||
|
||||
@@ -53,12 +53,19 @@
|
||||
</view>
|
||||
</OrderHeaderFold>
|
||||
|
||||
<PlusBarcodePanel
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
:hint-text="phoneScanHint"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<ProcessInBinBar
|
||||
:can-scan="canScan"
|
||||
:bin-id="warehouseBinId"
|
||||
:code="warehouseBinCode"
|
||||
:name="warehouseBinName"
|
||||
:show-phone-scan="canScan"
|
||||
:scanning="phoneScanPanelOpen && phoneScanTarget === 'bin'"
|
||||
@code-input="warehouseBinCode = $event"
|
||||
@confirm="resolveWarehouseBin"
|
||||
@phone-scan="handleBinPhoneScan"
|
||||
@@ -71,6 +78,7 @@
|
||||
:message="BillDataMessage"
|
||||
:disabled-tip="qrDisabledTip"
|
||||
:show-phone-scan="canScanQr"
|
||||
:scanning="phoneScanPanelOpen && phoneScanTarget === 'qr'"
|
||||
@input="QRBarCode = $event"
|
||||
@scan="handleScan"
|
||||
@phone-scan="handlePhoneScan"
|
||||
@@ -100,9 +108,11 @@ import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
||||
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
||||
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PlusBarcodePanel,
|
||||
OrderStatusBar,
|
||||
OrderHeaderFold,
|
||||
FabricOutScanBar,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
import util from '@/common/util';
|
||||
import scanMixin from '@/common/scanMixin.js';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
import remoteSelectMixin from '@/common/remoteSelectMixin.js';
|
||||
import { withNameParam } from '@/common/remoteSelect';
|
||||
import { initTts, speak } from '@/common/tts.js';
|
||||
@@ -38,6 +39,7 @@ import {
|
||||
} from '@/common/storeGoodsProcessIn';
|
||||
|
||||
export default {
|
||||
components: { PlusBarcodePanel },
|
||||
mixins: [scanMixin, remoteSelectMixin],
|
||||
data() {
|
||||
return {
|
||||
@@ -110,6 +112,11 @@ export default {
|
||||
if (!this.warehouseBinId && !this.BarCodeDelStatus) return '请先扫描仓位后再扫布匹二维码';
|
||||
return '当前状态不可扫码';
|
||||
},
|
||||
phoneScanHint() {
|
||||
return this.phoneScanTarget === 'bin'
|
||||
? '请扫描仓位,成功后自动扫布飞'
|
||||
: '连续扫描布飞二维码,扫完可继续下一条';
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.isPageActive = true;
|
||||
@@ -134,6 +141,9 @@ export default {
|
||||
this.warehouseBinCode = '';
|
||||
this.warehouseBinName = '';
|
||||
this.phoneContinuousScan = false;
|
||||
this._phoneBinLocked = false;
|
||||
this._pendingFabricCode = '';
|
||||
if (this.phoneScanTarget === 'bin') this.closePhoneScanPanel();
|
||||
},
|
||||
/** 重扫仓位:先清空输入框再填入,避免残留旧码拼接 */
|
||||
applyWarehouseBinScan(scanResult) {
|
||||
@@ -145,19 +155,42 @@ export default {
|
||||
this.$nextTick(() => this.resolveWarehouseBin());
|
||||
});
|
||||
},
|
||||
openHalfScreenScan(target) {
|
||||
if (this.phoneScanPanelOpen && this.phoneScanTarget === target) {
|
||||
this.closePhoneScanPanel();
|
||||
return;
|
||||
}
|
||||
this.phoneContinuousScan = false;
|
||||
if (target === 'bin') this._phoneBinLocked = false;
|
||||
this.phoneScanTarget = target;
|
||||
this.phoneScanPanelOpen = true;
|
||||
},
|
||||
onPlusBarcodeSuccess(scanResult) {
|
||||
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||
if (!code) return;
|
||||
if (this.phoneScanTarget === 'bin') {
|
||||
if (this._phoneBinLocked) {
|
||||
if (!this.warehouseBinId) {
|
||||
this._pendingFabricCode = code;
|
||||
return;
|
||||
}
|
||||
this.phoneScanTarget = 'qr';
|
||||
} else {
|
||||
this._phoneBinLocked = true;
|
||||
this._pendingFabricCode = '';
|
||||
this.applyWarehouseBinScan(code);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.QRBarCode = code;
|
||||
this.$nextTick(() => this.handleScan());
|
||||
},
|
||||
handleBinPhoneScan() {
|
||||
if (!this.canScan || !this.orderId) {
|
||||
this.showError('请先提交保存后再扫码');
|
||||
return;
|
||||
}
|
||||
this.phoneContinuousScan = false;
|
||||
this.phoneScanTarget = 'bin';
|
||||
this.openPhoneScan({
|
||||
callback: (scanResult) => {
|
||||
this.applyWarehouseBinScan(scanResult);
|
||||
},
|
||||
fail: () => {},
|
||||
});
|
||||
this.openHalfScreenScan('bin');
|
||||
},
|
||||
handlePhoneScan() {
|
||||
if (!this.canScan || !this.orderId) {
|
||||
@@ -169,11 +202,10 @@ export default {
|
||||
this.handleBinPhoneScan();
|
||||
return;
|
||||
}
|
||||
this.phoneScanTarget = 'qr';
|
||||
this.phoneContinuousScan = true;
|
||||
this.openContinuousPhoneScan();
|
||||
this.openHalfScreenScan('qr');
|
||||
},
|
||||
openContinuousPhoneScan() {
|
||||
if (this.phoneScanPanelOpen) return;
|
||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||
this.phoneContinuousScan = false;
|
||||
return;
|
||||
@@ -189,6 +221,7 @@ export default {
|
||||
});
|
||||
},
|
||||
scheduleNextPhoneScan() {
|
||||
if (this.phoneScanPanelOpen) return;
|
||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||
this.phoneContinuousScan = false;
|
||||
return;
|
||||
@@ -246,9 +279,19 @@ export default {
|
||||
this.BillDataMessage = '';
|
||||
speak('仓位成功');
|
||||
uni.showToast({ title: '仓位识别成功', icon: 'success' });
|
||||
if (this.phoneScanPanelOpen) this.phoneScanTarget = 'qr';
|
||||
this._phoneBinLocked = false;
|
||||
const pending = this._pendingFabricCode;
|
||||
this._pendingFabricCode = '';
|
||||
if (pending && this.phoneScanPanelOpen) {
|
||||
this.QRBarCode = pending;
|
||||
this.$nextTick(() => this.handleScan());
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
uni.hideLoading();
|
||||
this._phoneBinLocked = false;
|
||||
this._pendingFabricCode = '';
|
||||
this.warehouseBinId = 0;
|
||||
this.warehouseBinCode = '';
|
||||
this.warehouseBinName = '';
|
||||
@@ -259,6 +302,7 @@ export default {
|
||||
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
||||
if (this.canScan && !nextCanScan) {
|
||||
this.phoneContinuousScan = false;
|
||||
this.closePhoneScanPanel();
|
||||
this.unregisterScanBroadcast();
|
||||
}
|
||||
this.canScan = nextCanScan;
|
||||
|
||||
@@ -34,6 +34,12 @@
|
||||
</view>
|
||||
</OrderHeaderFold>
|
||||
|
||||
<PlusBarcodePanel
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
hint-text="连续扫码出仓,扫完可继续下一条"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<FabricOutScanBar
|
||||
:can-scan="showQrScanBar"
|
||||
:value="QRBarCode"
|
||||
@@ -41,6 +47,7 @@
|
||||
:message="BillDataMessage"
|
||||
:disabled-tip="qrDisabledTip"
|
||||
:show-phone-scan="canScanQr"
|
||||
:scanning="phoneScanPanelOpen"
|
||||
@input="QRBarCode = $event"
|
||||
@scan="handleScan"
|
||||
@phone-scan="handlePhoneScan"
|
||||
@@ -78,9 +85,11 @@ import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||
import ProcessOutScanDetail from '@/components/storegoods/ProcessOutScanDetail.vue';
|
||||
import ProcessOutDetailList from '@/components/storegoods/ProcessOutDetailList.vue';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PlusBarcodePanel,
|
||||
OrderStatusBar,
|
||||
OrderHeaderFold,
|
||||
FabricOutScanBar,
|
||||
|
||||
@@ -25,6 +25,12 @@
|
||||
</view>
|
||||
</OrderHeaderFold>
|
||||
|
||||
<PlusBarcodePanel
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
hint-text="连续扫码出仓,扫完可继续下一条"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<FabricOutScanBar
|
||||
:can-scan="showQrScanBar"
|
||||
:value="QRBarCode"
|
||||
@@ -32,6 +38,7 @@
|
||||
:message="BillDataMessage"
|
||||
:disabled-tip="qrDisabledTip"
|
||||
:show-phone-scan="canScanQr"
|
||||
:scanning="phoneScanPanelOpen"
|
||||
@input="QRBarCode = $event"
|
||||
@scan="handleScan"
|
||||
@phone-scan="handlePhoneScan"
|
||||
@@ -59,9 +66,11 @@ import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||
import ProcessOutScanDetail from '@/components/storegoods/ProcessOutScanDetail.vue';
|
||||
import ProcessOutDetailList from '@/components/storegoods/ProcessOutDetailList.vue';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PlusBarcodePanel,
|
||||
OrderStatusBar,
|
||||
OrderHeaderFold,
|
||||
FabricOutScanBar,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
import util from '@/common/util';
|
||||
import scanMixin from '@/common/scanMixin.js';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
import remoteSelectMixin from '@/common/remoteSelectMixin.js';
|
||||
import { withNameParam } from '@/common/remoteSelect';
|
||||
import { initTts, speak } from '@/common/tts.js';
|
||||
@@ -34,6 +35,7 @@ import {
|
||||
} from '@/common/storeGoodsProcessOut';
|
||||
|
||||
export default {
|
||||
components: { PlusBarcodePanel },
|
||||
mixins: [scanMixin, remoteSelectMixin],
|
||||
data() {
|
||||
return {
|
||||
@@ -114,10 +116,15 @@ export default {
|
||||
this.showError('请先提交保存后再扫码');
|
||||
return;
|
||||
}
|
||||
this.phoneContinuousScan = true;
|
||||
this.openContinuousPhoneScan();
|
||||
this.phoneContinuousScan = false;
|
||||
this.togglePhoneScanPanel();
|
||||
},
|
||||
onPlusBarcodeSuccess(scanResult) {
|
||||
this.QRBarCode = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||
this.$nextTick(() => this.handleScan());
|
||||
},
|
||||
openContinuousPhoneScan() {
|
||||
if (this.phoneScanPanelOpen) return;
|
||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||
this.phoneContinuousScan = false;
|
||||
return;
|
||||
@@ -133,6 +140,7 @@ export default {
|
||||
});
|
||||
},
|
||||
scheduleNextPhoneScan() {
|
||||
if (this.phoneScanPanelOpen) return;
|
||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||
this.phoneContinuousScan = false;
|
||||
return;
|
||||
@@ -153,6 +161,7 @@ export default {
|
||||
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
||||
if (this.canScan && !nextCanScan) {
|
||||
this.phoneContinuousScan = false;
|
||||
this.closePhoneScanPanel();
|
||||
this.unregisterScanBroadcast();
|
||||
}
|
||||
this.canScan = nextCanScan;
|
||||
|
||||
@@ -31,12 +31,19 @@
|
||||
</view>
|
||||
</OrderHeaderFold>
|
||||
|
||||
<PlusBarcodePanel
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
:hint-text="phoneScanHint"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<ProcessInBinBar
|
||||
:can-scan="canScan"
|
||||
:bin-id="warehouseBinId"
|
||||
:code="warehouseBinCode"
|
||||
:name="warehouseBinName"
|
||||
:show-phone-scan="canScan"
|
||||
:scanning="phoneScanPanelOpen && phoneScanTarget === 'bin'"
|
||||
@code-input="warehouseBinCode = $event"
|
||||
@confirm="resolveWarehouseBin"
|
||||
@phone-scan="handleBinPhoneScan"
|
||||
@@ -49,6 +56,7 @@
|
||||
:message="BillDataMessage"
|
||||
:disabled-tip="qrDisabledTip"
|
||||
:show-phone-scan="canScanQr"
|
||||
:scanning="phoneScanPanelOpen && phoneScanTarget === 'qr'"
|
||||
@input="QRBarCode = $event"
|
||||
@scan="handleScan"
|
||||
@phone-scan="handlePhoneScan"
|
||||
@@ -87,9 +95,11 @@ import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
||||
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
||||
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PlusBarcodePanel,
|
||||
OrderStatusBar,
|
||||
OrderHeaderFold,
|
||||
FabricOutScanBar,
|
||||
|
||||
@@ -25,12 +25,19 @@
|
||||
</view>
|
||||
</OrderHeaderFold>
|
||||
|
||||
<PlusBarcodePanel
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
:hint-text="phoneScanHint"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<ProcessInBinBar
|
||||
:can-scan="canScan"
|
||||
:bin-id="warehouseBinId"
|
||||
:code="warehouseBinCode"
|
||||
:name="warehouseBinName"
|
||||
:show-phone-scan="canScan"
|
||||
:scanning="phoneScanPanelOpen && phoneScanTarget === 'bin'"
|
||||
@code-input="warehouseBinCode = $event"
|
||||
@confirm="resolveWarehouseBin"
|
||||
@phone-scan="handleBinPhoneScan"
|
||||
@@ -43,6 +50,7 @@
|
||||
:message="BillDataMessage"
|
||||
:disabled-tip="qrDisabledTip"
|
||||
:show-phone-scan="canScanQr"
|
||||
:scanning="phoneScanPanelOpen && phoneScanTarget === 'qr'"
|
||||
@input="QRBarCode = $event"
|
||||
@scan="handleScan"
|
||||
@phone-scan="handlePhoneScan"
|
||||
@@ -71,9 +79,11 @@ import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
||||
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
||||
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PlusBarcodePanel,
|
||||
OrderStatusBar,
|
||||
OrderHeaderFold,
|
||||
FabricOutScanBar,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
import util from '@/common/util';
|
||||
import scanMixin from '@/common/scanMixin.js';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
import remoteSelectMixin from '@/common/remoteSelectMixin.js';
|
||||
import { withNameParam } from '@/common/remoteSelect';
|
||||
import { initTts, speak } from '@/common/tts.js';
|
||||
@@ -33,6 +34,7 @@ import {
|
||||
} from '@/common/storeGoodsProcessReturnIn';
|
||||
|
||||
export default {
|
||||
components: { PlusBarcodePanel },
|
||||
mixins: [scanMixin, remoteSelectMixin],
|
||||
data() {
|
||||
return {
|
||||
@@ -99,6 +101,11 @@ export default {
|
||||
if (!this.warehouseBinId && !this.BarCodeDelStatus) return '请先扫描仓位后再扫布匹二维码';
|
||||
return '当前状态不可扫码';
|
||||
},
|
||||
phoneScanHint() {
|
||||
return this.phoneScanTarget === 'bin'
|
||||
? '请扫描仓位,成功后自动扫布飞'
|
||||
: '连续扫描布飞二维码,扫完可继续下一条';
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.isPageActive = true;
|
||||
@@ -123,6 +130,9 @@ export default {
|
||||
this.warehouseBinCode = '';
|
||||
this.warehouseBinName = '';
|
||||
this.phoneContinuousScan = false;
|
||||
this._phoneBinLocked = false;
|
||||
this._pendingFabricCode = '';
|
||||
if (this.phoneScanTarget === 'bin') this.closePhoneScanPanel();
|
||||
},
|
||||
/** 重扫仓位:先清空输入框再填入,避免残留旧码拼接 */
|
||||
applyWarehouseBinScan(scanResult) {
|
||||
@@ -134,19 +144,42 @@ export default {
|
||||
this.$nextTick(() => this.resolveWarehouseBin());
|
||||
});
|
||||
},
|
||||
openHalfScreenScan(target) {
|
||||
if (this.phoneScanPanelOpen && this.phoneScanTarget === target) {
|
||||
this.closePhoneScanPanel();
|
||||
return;
|
||||
}
|
||||
this.phoneContinuousScan = false;
|
||||
if (target === 'bin') this._phoneBinLocked = false;
|
||||
this.phoneScanTarget = target;
|
||||
this.phoneScanPanelOpen = true;
|
||||
},
|
||||
onPlusBarcodeSuccess(scanResult) {
|
||||
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||
if (!code) return;
|
||||
if (this.phoneScanTarget === 'bin') {
|
||||
if (this._phoneBinLocked) {
|
||||
if (!this.warehouseBinId) {
|
||||
this._pendingFabricCode = code;
|
||||
return;
|
||||
}
|
||||
this.phoneScanTarget = 'qr';
|
||||
} else {
|
||||
this._phoneBinLocked = true;
|
||||
this._pendingFabricCode = '';
|
||||
this.applyWarehouseBinScan(code);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.QRBarCode = code;
|
||||
this.$nextTick(() => this.handleScan());
|
||||
},
|
||||
handleBinPhoneScan() {
|
||||
if (!this.canScan || !this.orderId) {
|
||||
this.showError('请先提交保存后再扫码');
|
||||
return;
|
||||
}
|
||||
this.phoneContinuousScan = false;
|
||||
this.phoneScanTarget = 'bin';
|
||||
this.openPhoneScan({
|
||||
callback: (scanResult) => {
|
||||
this.applyWarehouseBinScan(scanResult);
|
||||
},
|
||||
fail: () => {},
|
||||
});
|
||||
this.openHalfScreenScan('bin');
|
||||
},
|
||||
handlePhoneScan() {
|
||||
if (!this.canScan || !this.orderId) {
|
||||
@@ -158,11 +191,10 @@ export default {
|
||||
this.handleBinPhoneScan();
|
||||
return;
|
||||
}
|
||||
this.phoneScanTarget = 'qr';
|
||||
this.phoneContinuousScan = true;
|
||||
this.openContinuousPhoneScan();
|
||||
this.openHalfScreenScan('qr');
|
||||
},
|
||||
openContinuousPhoneScan() {
|
||||
if (this.phoneScanPanelOpen) return;
|
||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||
this.phoneContinuousScan = false;
|
||||
return;
|
||||
@@ -178,6 +210,7 @@ export default {
|
||||
});
|
||||
},
|
||||
scheduleNextPhoneScan() {
|
||||
if (this.phoneScanPanelOpen) return;
|
||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||
this.phoneContinuousScan = false;
|
||||
return;
|
||||
@@ -235,9 +268,19 @@ export default {
|
||||
this.BillDataMessage = '';
|
||||
speak('仓位成功');
|
||||
uni.showToast({ title: '仓位识别成功', icon: 'success' });
|
||||
if (this.phoneScanPanelOpen) this.phoneScanTarget = 'qr';
|
||||
this._phoneBinLocked = false;
|
||||
const pending = this._pendingFabricCode;
|
||||
this._pendingFabricCode = '';
|
||||
if (pending && this.phoneScanPanelOpen) {
|
||||
this.QRBarCode = pending;
|
||||
this.$nextTick(() => this.handleScan());
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
uni.hideLoading();
|
||||
this._phoneBinLocked = false;
|
||||
this._pendingFabricCode = '';
|
||||
this.warehouseBinId = 0;
|
||||
this.warehouseBinCode = '';
|
||||
this.warehouseBinName = '';
|
||||
@@ -248,6 +291,7 @@ export default {
|
||||
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
||||
if (this.canScan && !nextCanScan) {
|
||||
this.phoneContinuousScan = false;
|
||||
this.closePhoneScanPanel();
|
||||
this.unregisterScanBroadcast();
|
||||
}
|
||||
this.canScan = nextCanScan;
|
||||
|
||||
@@ -65,12 +65,19 @@
|
||||
</view>
|
||||
</OrderHeaderFold>
|
||||
|
||||
<PlusBarcodePanel
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
:hint-text="phoneScanHint"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<ProcessInBinBar
|
||||
:can-scan="canScan"
|
||||
:bin-id="warehouseBinId"
|
||||
:code="warehouseBinCode"
|
||||
:name="warehouseBinName"
|
||||
:show-phone-scan="canScan"
|
||||
:scanning="phoneScanPanelOpen && phoneScanTarget === 'bin'"
|
||||
@code-input="warehouseBinCode = $event"
|
||||
@confirm="resolveWarehouseBin"
|
||||
@phone-scan="handleBinPhoneScan"
|
||||
@@ -83,6 +90,7 @@
|
||||
:message="BillDataMessage"
|
||||
:disabled-tip="qrDisabledTip"
|
||||
:show-phone-scan="canScanQr"
|
||||
:scanning="phoneScanPanelOpen && phoneScanTarget === 'qr'"
|
||||
@input="QRBarCode = $event"
|
||||
@scan="handleScan"
|
||||
@phone-scan="handlePhoneScan"
|
||||
@@ -122,9 +130,11 @@ import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
||||
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
||||
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PlusBarcodePanel,
|
||||
OrderStatusBar,
|
||||
OrderHeaderFold,
|
||||
FabricOutScanBar,
|
||||
|
||||
@@ -53,12 +53,19 @@
|
||||
</view>
|
||||
</OrderHeaderFold>
|
||||
|
||||
<PlusBarcodePanel
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
:hint-text="phoneScanHint"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<ProcessInBinBar
|
||||
:can-scan="canScan"
|
||||
:bin-id="warehouseBinId"
|
||||
:code="warehouseBinCode"
|
||||
:name="warehouseBinName"
|
||||
:show-phone-scan="canScan"
|
||||
:scanning="phoneScanPanelOpen && phoneScanTarget === 'bin'"
|
||||
@code-input="warehouseBinCode = $event"
|
||||
@confirm="resolveWarehouseBin"
|
||||
@phone-scan="handleBinPhoneScan"
|
||||
@@ -71,6 +78,7 @@
|
||||
:message="BillDataMessage"
|
||||
:disabled-tip="qrDisabledTip"
|
||||
:show-phone-scan="canScanQr"
|
||||
:scanning="phoneScanPanelOpen && phoneScanTarget === 'qr'"
|
||||
@input="QRBarCode = $event"
|
||||
@scan="handleScan"
|
||||
@phone-scan="handlePhoneScan"
|
||||
@@ -100,9 +108,11 @@ import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
||||
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
||||
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PlusBarcodePanel,
|
||||
OrderStatusBar,
|
||||
OrderHeaderFold,
|
||||
FabricOutScanBar,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
import util from '@/common/util';
|
||||
import scanMixin from '@/common/scanMixin.js';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
import remoteSelectMixin from '@/common/remoteSelectMixin.js';
|
||||
import { withNameParam } from '@/common/remoteSelect';
|
||||
import { initTts, speak } from '@/common/tts.js';
|
||||
@@ -40,6 +41,7 @@ import {
|
||||
} from '@/common/storeGoodsPurchaseIn';
|
||||
|
||||
export default {
|
||||
components: { PlusBarcodePanel },
|
||||
mixins: [scanMixin, remoteSelectMixin],
|
||||
data() {
|
||||
return {
|
||||
@@ -112,6 +114,11 @@ export default {
|
||||
if (!this.warehouseBinId && !this.BarCodeDelStatus) return '请先扫描仓位后再扫布匹二维码';
|
||||
return '当前状态不可扫码';
|
||||
},
|
||||
phoneScanHint() {
|
||||
return this.phoneScanTarget === 'bin'
|
||||
? '请扫描仓位,成功后自动扫布飞'
|
||||
: '连续扫描布飞二维码,扫完可继续下一条';
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.isPageActive = true;
|
||||
@@ -136,6 +143,9 @@ export default {
|
||||
this.warehouseBinCode = '';
|
||||
this.warehouseBinName = '';
|
||||
this.phoneContinuousScan = false;
|
||||
this._phoneBinLocked = false;
|
||||
this._pendingFabricCode = '';
|
||||
if (this.phoneScanTarget === 'bin') this.closePhoneScanPanel();
|
||||
},
|
||||
/** 重扫仓位:先清空输入框再填入,避免残留旧码拼接 */
|
||||
applyWarehouseBinScan(scanResult) {
|
||||
@@ -147,19 +157,42 @@ export default {
|
||||
this.$nextTick(() => this.resolveWarehouseBin());
|
||||
});
|
||||
},
|
||||
openHalfScreenScan(target) {
|
||||
if (this.phoneScanPanelOpen && this.phoneScanTarget === target) {
|
||||
this.closePhoneScanPanel();
|
||||
return;
|
||||
}
|
||||
this.phoneContinuousScan = false;
|
||||
if (target === 'bin') this._phoneBinLocked = false;
|
||||
this.phoneScanTarget = target;
|
||||
this.phoneScanPanelOpen = true;
|
||||
},
|
||||
onPlusBarcodeSuccess(scanResult) {
|
||||
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||
if (!code) return;
|
||||
if (this.phoneScanTarget === 'bin') {
|
||||
if (this._phoneBinLocked) {
|
||||
if (!this.warehouseBinId) {
|
||||
this._pendingFabricCode = code;
|
||||
return;
|
||||
}
|
||||
this.phoneScanTarget = 'qr';
|
||||
} else {
|
||||
this._phoneBinLocked = true;
|
||||
this._pendingFabricCode = '';
|
||||
this.applyWarehouseBinScan(code);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.QRBarCode = code;
|
||||
this.$nextTick(() => this.handleScan());
|
||||
},
|
||||
handleBinPhoneScan() {
|
||||
if (!this.canScan || !this.orderId) {
|
||||
this.showError('请先提交保存后再扫码');
|
||||
return;
|
||||
}
|
||||
this.phoneContinuousScan = false;
|
||||
this.phoneScanTarget = 'bin';
|
||||
this.openPhoneScan({
|
||||
callback: (scanResult) => {
|
||||
this.applyWarehouseBinScan(scanResult);
|
||||
},
|
||||
fail: () => {},
|
||||
});
|
||||
this.openHalfScreenScan('bin');
|
||||
},
|
||||
handlePhoneScan() {
|
||||
if (!this.canScan || !this.orderId) {
|
||||
@@ -171,11 +204,10 @@ export default {
|
||||
this.handleBinPhoneScan();
|
||||
return;
|
||||
}
|
||||
this.phoneScanTarget = 'qr';
|
||||
this.phoneContinuousScan = true;
|
||||
this.openContinuousPhoneScan();
|
||||
this.openHalfScreenScan('qr');
|
||||
},
|
||||
openContinuousPhoneScan() {
|
||||
if (this.phoneScanPanelOpen) return;
|
||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||
this.phoneContinuousScan = false;
|
||||
return;
|
||||
@@ -191,6 +223,7 @@ export default {
|
||||
});
|
||||
},
|
||||
scheduleNextPhoneScan() {
|
||||
if (this.phoneScanPanelOpen) return;
|
||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||
this.phoneContinuousScan = false;
|
||||
return;
|
||||
@@ -248,9 +281,19 @@ export default {
|
||||
this.BillDataMessage = '';
|
||||
speak('仓位成功');
|
||||
uni.showToast({ title: '仓位识别成功', icon: 'success' });
|
||||
if (this.phoneScanPanelOpen) this.phoneScanTarget = 'qr';
|
||||
this._phoneBinLocked = false;
|
||||
const pending = this._pendingFabricCode;
|
||||
this._pendingFabricCode = '';
|
||||
if (pending && this.phoneScanPanelOpen) {
|
||||
this.QRBarCode = pending;
|
||||
this.$nextTick(() => this.handleScan());
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
uni.hideLoading();
|
||||
this._phoneBinLocked = false;
|
||||
this._pendingFabricCode = '';
|
||||
this.warehouseBinId = 0;
|
||||
this.warehouseBinCode = '';
|
||||
this.warehouseBinName = '';
|
||||
@@ -261,6 +304,7 @@ export default {
|
||||
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
||||
if (this.canScan && !nextCanScan) {
|
||||
this.phoneContinuousScan = false;
|
||||
this.closePhoneScanPanel();
|
||||
this.unregisterScanBroadcast();
|
||||
}
|
||||
this.canScan = nextCanScan;
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<u-cell-group class="personal-list" :border="false">
|
||||
<u-cell-item icon="question-circle" :iconStyle="{ color: '#ff8d06' }" title="常见问题" :center="true" @click="navTo('problem')"></u-cell-item>
|
||||
<u-cell-item icon="kefu-ermai" :iconStyle="{ color: '#5f8dff' }" title="意见反馈" :center="true" @click="navTo('comment')"></u-cell-item>
|
||||
<u-cell-item icon="map" :iconStyle="{ color: '#316ede' }" title="账号安全" :center="true" @click="navTo('pwd')"></u-cell-item>
|
||||
<u-cell-item icon="lock" :iconStyle="{ color: '#316ede' }" title="修改密码" :center="true" @click="navTo('pwd')"></u-cell-item>
|
||||
<u-cell-item icon="scan" :iconStyle="{ color: '#36cfc9' }" title="扫描设置" :center="true" @click="navTo('scan-settings')"></u-cell-item>
|
||||
<u-cell-item icon="order" :iconStyle="{ color: '#59bdf9' }" title="清除缓存" :center="true" @click="navTo('clear-cache')"></u-cell-item>
|
||||
</u-cell-group>
|
||||
@@ -49,6 +49,8 @@
|
||||
<u-cell-item icon="reload" :iconStyle="{ color: '#19be6b' }" title="版本更新" :center="true" @click="upgrade"></u-cell-item>
|
||||
<u-cell-item icon="setting" :iconStyle="{ color: '#2767dc' }" title="系统设置" :center="true" @click="navTo('setting')"></u-cell-item>
|
||||
</u-cell-group>
|
||||
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
||||
<u-button class="sign-out logout-btn" @click="logout" :hair-line="false">退出登录</u-button>
|
||||
</view>
|
||||
<view class="app-meta">
|
||||
<text class="app-name">{{ appName }}</text>
|
||||
@@ -60,6 +62,7 @@
|
||||
import CommonNavbar from "@/components/common-navbar/index";
|
||||
import app_upgrade from '@/uni_modules/app-upgrade/js_sdk/index.js';
|
||||
import config from '@/common/config.js';
|
||||
import { clearUserSession } from '@/common/userSession.js';
|
||||
import manifest from '@/manifest.json';
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
||||
@@ -100,16 +103,17 @@ export default {
|
||||
});
|
||||
},
|
||||
logout() {
|
||||
this.$u.api.logout().then(res => {
|
||||
this.$u.toast(res.msg);
|
||||
if (res.code == '200' || res.code == '401') {
|
||||
let self = this;
|
||||
setTimeout(() => {
|
||||
const goLogin = () => {
|
||||
clearUserSession();
|
||||
uni.reLaunch({
|
||||
url: '/pages/sys/login/index'
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
};
|
||||
this.$u.api.pdaLogout().then(() => {
|
||||
goLogin();
|
||||
}).catch((error) => {
|
||||
console.log('logout error', error);
|
||||
goLogin();
|
||||
});
|
||||
},
|
||||
upgrade(){
|
||||
@@ -211,4 +215,9 @@ page {
|
||||
font-size: $pda-font-nav-sub;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.logout-btn {
|
||||
min-height: $pda-row-min-height;
|
||||
font-size: $pda-font-body;
|
||||
line-height: $pda-row-min-height;
|
||||
}
|
||||
</style>
|
||||
|
||||
+32
-15
@@ -33,7 +33,7 @@ export default {
|
||||
model: {
|
||||
oldPassword: '',
|
||||
newPassword: '',
|
||||
confirmNewPassword: ''
|
||||
confirmPassword: ''
|
||||
},
|
||||
rules: {
|
||||
oldPassword: [
|
||||
@@ -79,26 +79,27 @@ export default {
|
||||
submit() {
|
||||
this.$refs.uForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.$u.api.user.infoSavePwd({
|
||||
oldPassword: this.model.oldPassword,
|
||||
newPassword: this.model.newPassword
|
||||
}).then(res => {
|
||||
if(res.code == '200'){
|
||||
this.$u.api.updatePassword({
|
||||
old_password: this.model.oldPassword,
|
||||
new_password: this.model.newPassword
|
||||
}).then(() => {
|
||||
const saved = uni.getStorageSync('UserInfo');
|
||||
if (saved && typeof saved === 'object') {
|
||||
uni.setStorageSync('UserInfo', {
|
||||
...saved,
|
||||
password: this.model.newPassword
|
||||
});
|
||||
}
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: res.msg,
|
||||
content: '密码修改成功',
|
||||
showCancel: false,
|
||||
success: function () {
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: res.msg,
|
||||
showCancel: false
|
||||
});
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log('updatePassword error', error);
|
||||
});
|
||||
} else {
|
||||
this.$u.toast('您填写的信息有误,请根据提示修正。');
|
||||
@@ -112,15 +113,31 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import '@/common/pda-typography.scss';
|
||||
page{
|
||||
background: #f5f5f5;
|
||||
}
|
||||
.u-form{
|
||||
background: #fff;
|
||||
padding: 0px 15px;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.remind-text{
|
||||
padding: 20rpx 30rpx;
|
||||
color: #666666;
|
||||
font-size: $pda-font-popup-sub;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.form-footer {
|
||||
padding: 40rpx 30rpx;
|
||||
}
|
||||
::v-deep .u-form-item--left__content__label {
|
||||
font-size: $pda-font-body;
|
||||
}
|
||||
::v-deep .u-input__input {
|
||||
font-size: $pda-font-body;
|
||||
}
|
||||
::v-deep .u-btn {
|
||||
height: $pda-button-height;
|
||||
font-size: $pda-font-button;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -7,17 +7,12 @@
|
||||
<u-cell-item title="隐私政策" @click="navTo('')" :arrow="true"></u-cell-item>
|
||||
<u-cell-item title="用户协议" @click="navTo('')" :arrow="true"></u-cell-item>
|
||||
</u-cell-group>
|
||||
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
||||
<view>
|
||||
<u-button class="sign-out" @click="logout" :hair-line="false">退出登录</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
||||
*/
|
||||
import { clearUserSession } from '@/common/userSession.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -49,20 +44,6 @@ export default {
|
||||
// #ifndef APP-PLUS
|
||||
this.$u.toast('小程序端或H5端已是最新版,无需检查更新!');
|
||||
// #endif
|
||||
},
|
||||
logout() {
|
||||
const goLogin = () => {
|
||||
clearUserSession();
|
||||
uni.reLaunch({
|
||||
url: '/pages/sys/login/index'
|
||||
});
|
||||
};
|
||||
this.$u.api.pdaLogout().then(() => {
|
||||
goLogin();
|
||||
}).catch(error => {
|
||||
console.log('error',error)
|
||||
goLogin();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user