feat: 进仓等级可多选并提示改密,升至1.1.19
This commit is contained in:
@@ -19,9 +19,16 @@
|
|||||||
v-for="item in filteredList"
|
v-for="item in filteredList"
|
||||||
:key="String(item.value)"
|
:key="String(item.value)"
|
||||||
class="search-select__item"
|
class="search-select__item"
|
||||||
@click="confirm(item)"
|
:class="{ 'is-selected': multiple && isPicked(item) }"
|
||||||
>{{ item.label }}</view>
|
@click="onItemClick(item)"
|
||||||
|
>
|
||||||
|
<text class="search-select__item-label">{{ item.label }}</text>
|
||||||
|
<text v-if="multiple && isPicked(item)" class="search-select__check">已选</text>
|
||||||
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
<view v-if="multiple" class="search-select__footer">
|
||||||
|
<view class="search-select__ok" @click="confirmMultiple">确定</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
</template>
|
</template>
|
||||||
@@ -33,12 +40,15 @@ export default {
|
|||||||
title: { type: String, default: '请选择' },
|
title: { type: String, default: '请选择' },
|
||||||
placeholder: { type: String, default: '请输入名称搜索' },
|
placeholder: { type: String, default: '请输入名称搜索' },
|
||||||
list: { type: Array, default: () => [] },
|
list: { type: Array, default: () => [] },
|
||||||
|
multiple: { type: Boolean, default: false },
|
||||||
|
selected: { type: Array, default: () => [] },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
keyword: '',
|
keyword: '',
|
||||||
panelMaxHeight: 520,
|
panelMaxHeight: 520,
|
||||||
listHeight: 360,
|
listHeight: 360,
|
||||||
|
picked: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -56,6 +66,7 @@ export default {
|
|||||||
show(val) {
|
show(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
this.keyword = '';
|
this.keyword = '';
|
||||||
|
this.picked = (this.selected || []).map((item) => String(item));
|
||||||
this.calcHeight();
|
this.calcHeight();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -70,16 +81,37 @@ export default {
|
|||||||
const winH = sys.windowHeight || 600;
|
const winH = sys.windowHeight || 600;
|
||||||
// 弹层约占屏高 65%,列表为弹层去掉标题+搜索后的剩余高度
|
// 弹层约占屏高 65%,列表为弹层去掉标题+搜索后的剩余高度
|
||||||
this.panelMaxHeight = Math.floor(winH * 0.65);
|
this.panelMaxHeight = Math.floor(winH * 0.65);
|
||||||
this.listHeight = Math.max(220, this.panelMaxHeight - 140);
|
const chrome = this.multiple ? 230 : 140;
|
||||||
|
this.listHeight = Math.max(220, this.panelMaxHeight - chrome);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.panelMaxHeight = 520;
|
this.panelMaxHeight = 520;
|
||||||
this.listHeight = 360;
|
this.listHeight = this.multiple ? 280 : 360;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
isPicked(item) {
|
||||||
|
return this.picked.includes(String(item.value));
|
||||||
|
},
|
||||||
|
onItemClick(item) {
|
||||||
|
if (!this.multiple) {
|
||||||
|
this.confirm(item);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const key = String(item.value);
|
||||||
|
if (this.picked.includes(key)) {
|
||||||
|
this.picked = this.picked.filter((value) => value !== key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.picked = this.picked.concat(key);
|
||||||
|
},
|
||||||
confirm(item) {
|
confirm(item) {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
this.$emit('confirm', item);
|
this.$emit('confirm', item);
|
||||||
},
|
},
|
||||||
|
confirmMultiple() {
|
||||||
|
const selected = (this.list || []).filter((item) => this.isPicked(item));
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('confirm', selected);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -126,9 +158,42 @@ export default {
|
|||||||
font-size: $pda-font-popup-sub;
|
font-size: $pda-font-popup-sub;
|
||||||
}
|
}
|
||||||
.search-select__item {
|
.search-select__item {
|
||||||
padding: 32rpx 30rpx;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
min-height: $pda-row-min-height;
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
font-size: $pda-font-popup-item;
|
font-size: $pda-font-popup-item;
|
||||||
color: #202328;
|
color: #202328;
|
||||||
border-bottom: 1px solid #f2f2f2;
|
border-bottom: 1px solid #f2f2f2;
|
||||||
}
|
}
|
||||||
|
.search-select__item-label {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
font-size: $pda-font-popup-item;
|
||||||
|
color: #202328;
|
||||||
|
}
|
||||||
|
.search-select__item.is-selected .search-select__item-label {
|
||||||
|
color: #2f78e6;
|
||||||
|
}
|
||||||
|
.search-select__check {
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-left: 16rpx;
|
||||||
|
font-size: $pda-font-action;
|
||||||
|
color: #2f78e6;
|
||||||
|
}
|
||||||
|
.search-select__footer {
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 16rpx 30rpx 8rpx;
|
||||||
|
}
|
||||||
|
.search-select__ok {
|
||||||
|
height: $pda-button-height;
|
||||||
|
line-height: $pda-button-height;
|
||||||
|
text-align: center;
|
||||||
|
font-size: $pda-font-button;
|
||||||
|
color: #fff;
|
||||||
|
background: #2979ff;
|
||||||
|
border-radius: 46rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
"name" : "浩拓织厂",
|
"name" : "浩拓织厂",
|
||||||
"appid" : "__UNI__F79F300",
|
"appid" : "__UNI__F79F300",
|
||||||
"description" : "周尚-浩拓织厂",
|
"description" : "周尚-浩拓织厂",
|
||||||
"versionName" : "1.1.18",
|
"versionName" : "1.1.19",
|
||||||
"versionCode" : 118,
|
"versionCode" : 119,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"optimization" : {
|
"optimization" : {
|
||||||
|
|||||||
@@ -109,6 +109,8 @@
|
|||||||
title="选择等级"
|
title="选择等级"
|
||||||
placeholder="请输入等级名称"
|
placeholder="请输入等级名称"
|
||||||
:list="levelOptions"
|
:list="levelOptions"
|
||||||
|
multiple
|
||||||
|
:selected="detail.grey_fabric_level_id"
|
||||||
@confirm="onLevelConfirm"
|
@confirm="onLevelConfirm"
|
||||||
/>
|
/>
|
||||||
<SearchSelectPopup
|
<SearchSelectPopup
|
||||||
@@ -199,7 +201,14 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
levelDisplayName() {
|
levelDisplayName() {
|
||||||
return this.detail.grey_fabric_level_name || '';
|
if (this.detail.grey_fabric_level_name) return this.detail.grey_fabric_level_name;
|
||||||
|
const ids = normalizeLevelIds(this.detail.grey_fabric_level_id);
|
||||||
|
if (!ids.length) return '';
|
||||||
|
const nameMap = {};
|
||||||
|
this.levelOptions.forEach((item) => {
|
||||||
|
nameMap[String(item.value)] = item.label;
|
||||||
|
});
|
||||||
|
return ids.map((id) => nameMap[String(id)]).filter(Boolean).join('、');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@@ -272,10 +281,15 @@ export default {
|
|||||||
}
|
}
|
||||||
this.levelPickerShow = true;
|
this.levelPickerShow = true;
|
||||||
},
|
},
|
||||||
onLevelConfirm(item) {
|
onLevelConfirm(items) {
|
||||||
if (!item) return;
|
const list = Array.isArray(items) ? items : (items ? [items] : []);
|
||||||
this.detail.grey_fabric_level_id = [Number(item.value)];
|
this.detail.grey_fabric_level_id = list
|
||||||
this.detail.grey_fabric_level_name = item.label || '';
|
.map((item) => Number(item.value))
|
||||||
|
.filter((item) => Number.isFinite(item));
|
||||||
|
this.detail.grey_fabric_level_name = list
|
||||||
|
.map((item) => item.label)
|
||||||
|
.filter(Boolean)
|
||||||
|
.join('、');
|
||||||
},
|
},
|
||||||
async loadInspectorOptions() {
|
async loadInspectorOptions() {
|
||||||
try {
|
try {
|
||||||
@@ -338,6 +352,8 @@ export default {
|
|||||||
this.detail = {
|
this.detail = {
|
||||||
...emptyDetail(),
|
...emptyDetail(),
|
||||||
fabric_piece_code: code,
|
fabric_piece_code: code,
|
||||||
|
inspector_id: this.detail.inspector_id,
|
||||||
|
inspector_name: this.detail.inspector_name,
|
||||||
};
|
};
|
||||||
this.weightKg = '';
|
this.weightKg = '';
|
||||||
} finally {
|
} finally {
|
||||||
@@ -347,6 +363,8 @@ export default {
|
|||||||
applyScanDetail(res, fallbackCode) {
|
applyScanDetail(res, fallbackCode) {
|
||||||
const data = res || {};
|
const data = res || {};
|
||||||
const levelIds = normalizeLevelIds(data.grey_fabric_level_id);
|
const levelIds = normalizeLevelIds(data.grey_fabric_level_id);
|
||||||
|
const hasIncomingInspector = data.inspector_id != null && data.inspector_id !== ''
|
||||||
|
|| String(data.inspector_name || '').trim();
|
||||||
this.detail = {
|
this.detail = {
|
||||||
...emptyDetail(),
|
...emptyDetail(),
|
||||||
fabric_piece_code: data.fabric_piece_code || fallbackCode || '',
|
fabric_piece_code: data.fabric_piece_code || fallbackCode || '',
|
||||||
@@ -356,9 +374,15 @@ export default {
|
|||||||
grey_fabric_code: data.grey_fabric_code || '',
|
grey_fabric_code: data.grey_fabric_code || '',
|
||||||
inspection_weight: formatDisplayWeightKg(data.inspection_weight) ? data.inspection_weight : null,
|
inspection_weight: formatDisplayWeightKg(data.inspection_weight) ? data.inspection_weight : null,
|
||||||
grey_fabric_level_id: levelIds,
|
grey_fabric_level_id: levelIds,
|
||||||
grey_fabric_level_name: data.grey_fabric_level_name || '',
|
grey_fabric_level_name: Array.isArray(data.grey_fabric_level_name)
|
||||||
inspector_id: data.inspector_id != null ? data.inspector_id : null,
|
? data.grey_fabric_level_name.filter(Boolean).join('、')
|
||||||
inspector_name: data.inspector_name || '',
|
: (data.grey_fabric_level_name || ''),
|
||||||
|
inspector_id: hasIncomingInspector && data.inspector_id != null && data.inspector_id !== ''
|
||||||
|
? data.inspector_id
|
||||||
|
: this.detail.inspector_id,
|
||||||
|
inspector_name: hasIncomingInspector
|
||||||
|
? (data.inspector_name || this.detail.inspector_name || '')
|
||||||
|
: (this.detail.inspector_name || ''),
|
||||||
};
|
};
|
||||||
this.weightKg = formatDisplayWeightKg(data.inspection_weight);
|
this.weightKg = formatDisplayWeightKg(data.inspection_weight);
|
||||||
this.scanCode = this.detail.fabric_piece_code;
|
this.scanCode = this.detail.fabric_piece_code;
|
||||||
@@ -421,11 +445,15 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
resetForNextScan() {
|
resetForNextScan() {
|
||||||
|
const inspectorId = this.detail.inspector_id;
|
||||||
|
const inspectorName = this.detail.inspector_name;
|
||||||
this.scanCode = '';
|
this.scanCode = '';
|
||||||
this.detail = emptyDetail();
|
this.detail = {
|
||||||
|
...emptyDetail(),
|
||||||
|
inspector_id: inspectorId,
|
||||||
|
inspector_name: inspectorName,
|
||||||
|
};
|
||||||
this.weightKg = '';
|
this.weightKg = '';
|
||||||
this.warehouseBinId = null;
|
|
||||||
this.warehouseBinName = '';
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.scanFocus = false;
|
this.scanFocus = false;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@@ -525,6 +553,7 @@ export default {
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: $pda-font-body;
|
font-size: $pda-font-body;
|
||||||
color: #202328;
|
color: #202328;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.manual-in__unit {
|
.manual-in__unit {
|
||||||
|
|||||||
@@ -125,6 +125,15 @@ import md5 from '@/common/md5.js';
|
|||||||
import manifest from '@/manifest.json';
|
import manifest from '@/manifest.json';
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
import app_upgrade from '@/uni_modules/app-upgrade/js_sdk/index.js'
|
import app_upgrade from '@/uni_modules/app-upgrade/js_sdk/index.js'
|
||||||
|
|
||||||
|
function isDefaultPassword(data) {
|
||||||
|
if (!data || typeof data !== 'object') return false;
|
||||||
|
const value = data.is_default_password != null
|
||||||
|
? data.is_default_password
|
||||||
|
: (data.user && data.user.is_default_password);
|
||||||
|
return value === true || value === 1 || value === '1' || value === 'true';
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -356,9 +365,12 @@ export default {
|
|||||||
getApp().globalData.StoreNameID = aLoginUserData.default_physical_warehouse_id;
|
getApp().globalData.StoreNameID = aLoginUserData.default_physical_warehouse_id;
|
||||||
getApp().globalData.StoreName = aLoginUserData.default_physical_warehouse_name;
|
getApp().globalData.StoreName = aLoginUserData.default_physical_warehouse_name;
|
||||||
getApp().globalData.StoreTypeNo = '';
|
getApp().globalData.StoreTypeNo = '';
|
||||||
|
const workbenchUrl = isDefaultPassword(aLoginUserData)
|
||||||
|
? '/pages/sys/workbench/index?defaultPassword=1'
|
||||||
|
: '/pages/sys/workbench/index';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/sys/workbench/index'
|
url: workbenchUrl
|
||||||
});
|
});
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
|
|||||||
@@ -76,9 +76,12 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
const sys = uni.getSystemInfoSync();
|
const sys = uni.getSystemInfoSync();
|
||||||
this.statusBarHeight = sys.statusBarHeight || 20;
|
this.statusBarHeight = sys.statusBarHeight || 20;
|
||||||
|
if (options && String(options.defaultPassword) === '1') {
|
||||||
|
this.promptChangePassword();
|
||||||
|
}
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
plus.runtime.getProperty(plus.runtime.appid, (inf) => {
|
plus.runtime.getProperty(plus.runtime.appid, (inf) => {
|
||||||
if (inf && inf.version) {
|
if (inf && inf.version) {
|
||||||
@@ -90,6 +93,20 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
promptChangePassword() {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '当前使用的是默认密码,请修改密码',
|
||||||
|
confirmText: '去修改',
|
||||||
|
cancelText: '稍后',
|
||||||
|
success: (res) => {
|
||||||
|
if (!res.confirm) return;
|
||||||
|
uni.navigateTo({ url: '/pages/sys/user/pwd' });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}, 400);
|
||||||
|
},
|
||||||
handleScanCode(scanResult) {
|
handleScanCode(scanResult) {
|
||||||
const cleanResult = scanResult.trim().replace(/[\r\n]/g, '');
|
const cleanResult = scanResult.trim().replace(/[\r\n]/g, '');
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
Reference in New Issue
Block a user