Merge remote-tracking branch 'origin/master'

master
zhongwenkai 3 days ago
commit a52277bca2

@ -866,7 +866,9 @@ export default {
deviceStatus: 'Device Status', deviceStatus: 'Device Status',
lineFilter: 'Line', lineFilter: 'Line',
allFilter: 'All Filters', allFilter: 'All Filters',
moreFilter: 'More Filters',
categoryStatus: 'Category & Status', categoryStatus: 'Category & Status',
categoryInfo: 'Category Info',
dateFilter: 'Date Filter', dateFilter: 'Date Filter',
deviceBrand: 'Device Brand', deviceBrand: 'Device Brand',
sn: 'Serial No.', sn: 'Serial No.',
@ -908,6 +910,8 @@ export default {
placeholderDataCollectionCapacity: 'Enter data collection capacity', placeholderDataCollectionCapacity: 'Enter data collection capacity',
placeholderProductionDate: 'Select production date', placeholderProductionDate: 'Select production date',
placeholderOutgoingTime: 'Select outgoing date', placeholderOutgoingTime: 'Select outgoing date',
placeholderOutgoingStartTime: 'Start date',
placeholderOutgoingEndTime: 'End date',
placeholderFactoryEntryDate: 'Select factory entry date', placeholderFactoryEntryDate: 'Select factory entry date',
placeholderDeviceLocation: 'Enter device location', placeholderDeviceLocation: 'Enter device location',
placeholderRemark: 'Enter remark', placeholderRemark: 'Enter remark',

@ -865,11 +865,13 @@ export default {
deviceType: '设备类型', deviceType: '设备类型',
deviceStatus: '设备状态', deviceStatus: '设备状态',
lineFilter: '产线', lineFilter: '产线',
allFilter: '\u5168\u90e8\u7b5b\u9009', allFilter: '全部筛选',
categoryStatus: '\u5206\u7c7b\u72b6\u6001', moreFilter: '更多筛选',
dateFilter: '\u65e5\u671f\u7b5b\u9009', categoryStatus: '分类状态',
deviceBrand: '\u8bbe\u5907\u54c1\u724c', categoryInfo: '分类信息',
sn: '\u5e8f\u5217\u53f7', dateFilter: '日期筛选',
deviceBrand: '设备品牌',
sn: '序列号',
scanUnrecognized: '未识别二维码内容', scanUnrecognized: '未识别二维码内容',
scanTypeMismatch: '二维码类型不匹配', scanTypeMismatch: '二维码类型不匹配',
scanFailed: '扫码失败', scanFailed: '扫码失败',
@ -899,8 +901,8 @@ export default {
loadFailed: '加载设备详情失败', loadFailed: '加载设备详情失败',
placeholderDeviceCode: '请输入设备编码', placeholderDeviceCode: '请输入设备编码',
placeholderDeviceName: '请输入设备名称', placeholderDeviceName: '请输入设备名称',
placeholderDeviceBrand: '\u8bf7\u8f93\u5165\u8bbe\u5907\u54c1\u724c', placeholderDeviceBrand: '请输入设备品牌',
placeholderSn: '\u8bf7\u8f93\u5165\u5e8f\u5217\u53f7', placeholderSn: '请输入序列号',
placeholderDeviceType: '请选择设备类型', placeholderDeviceType: '请选择设备类型',
placeholderDeviceSpec: '请输入设备规格', placeholderDeviceSpec: '请输入设备规格',
placeholderRatedCapacity: '请输入额定产能', placeholderRatedCapacity: '请输入额定产能',
@ -908,6 +910,8 @@ export default {
placeholderDataCollectionCapacity: '请输入数据采集产能', placeholderDataCollectionCapacity: '请输入数据采集产能',
placeholderProductionDate: '请选择生产日期', placeholderProductionDate: '请选择生产日期',
placeholderOutgoingTime: '请选择出厂日期', placeholderOutgoingTime: '请选择出厂日期',
placeholderOutgoingStartTime: '开始日期',
placeholderOutgoingEndTime: '结束日期',
placeholderFactoryEntryDate: '请选择入厂日期', placeholderFactoryEntryDate: '请选择入厂日期',
placeholderDeviceLocation: '请输入设备位置', placeholderDeviceLocation: '请输入设备位置',
placeholderRemark: '请输入备注', placeholderRemark: '请输入备注',
@ -1541,7 +1545,7 @@ export default {
moduleName: '产品盘点执行', moduleName: '产品盘点执行',
createTitle: '新增产品盘点', createTitle: '新增产品盘点',
executeTitle: '执行盘点', executeTitle: '执行盘点',
detailTitle: '\u4ea7\u54c1\u76d8\u70b9\u8be6\u60c5', detailTitle: '产品盘点详情',
selectProductTitle: '选择产品', selectProductTitle: '选择产品',
selectItemTitle: '选择盘点项', selectItemTitle: '选择盘点项',
selectWarehouseTitle: '选择仓库', selectWarehouseTitle: '选择仓库',

@ -26,7 +26,7 @@
<input id="equipment-ledger-keyword-input" v-model="searchKeyword" class="keyword-input" type="text" <input id="equipment-ledger-keyword-input" v-model="searchKeyword" class="keyword-input" type="text"
:placeholder="t('equipmentLedger.searchPlaceholder')" confirm-type="search" @confirm="handleSearch" /> :placeholder="t('equipmentLedger.searchPlaceholder')" confirm-type="search" @confirm="handleSearch" />
</view> </view>
<view class="icon-filter-btn" @click="refreshList"> <view class="icon-filter-btn" @click="resetFilters">
<uni-icons type="refresh" size="24" color="#7b8491"></uni-icons> <uni-icons type="refresh" size="24" color="#7b8491"></uni-icons>
</view> </view>
<view class="icon-filter-btn" @click="openFilterDrawer"> <view class="icon-filter-btn" @click="openFilterDrawer">
@ -75,10 +75,11 @@
<uni-icons type="top" size="22" color="#ffffff"></uni-icons> <uni-icons type="top" size="22" color="#ffffff"></uni-icons>
</view> </view>
<uni-popup ref="filterPopupRef" type="right" background-color="#ffffff"> <uni-popup ref="filterPopupRef" class="equipment-filter-popup" type="right" background-color="#ffffff"
:animation="false">
<view class="filter-drawer"> <view class="filter-drawer">
<view class="drawer-header"> <view class="drawer-header">
<text class="drawer-title">{{ t('equipmentLedger.allFilter') }}</text> <text class="drawer-title">{{ t('equipmentLedger.moreFilter') }}</text>
</view> </view>
<scroll-view scroll-y class="drawer-body"> <scroll-view scroll-y class="drawer-body">
<view class="drawer-section"> <view class="drawer-section">
@ -86,16 +87,6 @@
<text class="drawer-section-title">{{ t('equipmentLedger.basicInfo') }}</text> <text class="drawer-section-title">{{ t('equipmentLedger.basicInfo') }}</text>
</view> </view>
<view class="drawer-grid"> <view class="drawer-grid">
<view class="drawer-field">
<text class="drawer-label">{{ t('equipmentLedger.deviceCode') }}</text>
<input v-model="deviceCodeFilter" class="drawer-input" type="text"
:placeholder="t('equipmentLedger.placeholderDeviceCode')" />
</view>
<view class="drawer-field">
<text class="drawer-label">{{ t('equipmentLedger.deviceName') }}</text>
<input v-model="deviceNameFilter" class="drawer-input" type="text"
:placeholder="t('equipmentLedger.placeholderDeviceName')" />
</view>
<view class="drawer-field"> <view class="drawer-field">
<text class="drawer-label">{{ t('equipmentLedger.deviceBrand') }}</text> <text class="drawer-label">{{ t('equipmentLedger.deviceBrand') }}</text>
<input v-model="deviceBrandFilter" class="drawer-input" type="text" <input v-model="deviceBrandFilter" class="drawer-input" type="text"
@ -111,21 +102,9 @@
<view class="drawer-section"> <view class="drawer-section">
<view class="drawer-section-head"> <view class="drawer-section-head">
<text class="drawer-section-title">{{ t('equipmentLedger.categoryStatus') }}</text> <text class="drawer-section-title">{{ t('equipmentLedger.categoryInfo') }}</text>
</view> </view>
<view class="drawer-grid"> <view class="drawer-grid">
<view class="drawer-field">
<text class="drawer-label">{{ t('equipmentLedger.deviceStatus') }}</text>
<picker :range="statusPickerLabels" :value="statusPickerIndex" @change="onDrawerStatusFilterChange">
<view class="drawer-picker">
<text :class="[
'drawer-picker-text',
selectedStatus === '' ? 'placeholder' : '',
]">{{ selectedStatusLabel }}</text>
<uni-icons type="bottom" size="14" color="#9ca3af"></uni-icons>
</view>
</picker>
</view>
<view class="drawer-field drawer-field-wide"> <view class="drawer-field drawer-field-wide">
<text class="drawer-label">{{ t('equipmentLedger.deviceType') }}</text> <text class="drawer-label">{{ t('equipmentLedger.deviceType') }}</text>
<view class="drawer-picker" @click="toggleDrawerDeviceTypePanel"> <view class="drawer-picker" @click="toggleDrawerDeviceTypePanel">
@ -145,24 +124,6 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="drawer-field drawer-field-wide">
<text class="drawer-label">{{ t('equipmentLedger.lineFilter') }}</text>
<view class="drawer-picker" @click="toggleDrawerLinePanel">
<text :class="[
'drawer-picker-text',
selectedLineId === '' ? 'placeholder' : '',
]">{{ selectedLineLabel }}</text>
<uni-icons type="bottom" size="14" color="#9ca3af"></uni-icons>
</view>
<scroll-view v-if="drawerLinePanelOpen" scroll-y class="drawer-option-panel">
<view v-for="option in drawerLineOptions" :key="`line-${option.id}`" :class="[
'drawer-option-item',
String(selectedLineId) === String(option.id) ? 'active' : '',
]" :style="{ paddingLeft: `${24 + option.level * 24}rpx` }" @click="selectDrawerLine(option)">
<text class="drawer-option-text">{{ option.name }}</text>
</view>
</scroll-view>
</view>
</view> </view>
</view> </view>
@ -173,8 +134,9 @@
<view class="drawer-field drawer-field-wide"> <view class="drawer-field drawer-field-wide">
<text class="drawer-label">{{ t('equipmentLedger.outgoingTime') }}</text> <text class="drawer-label">{{ t('equipmentLedger.outgoingTime') }}</text>
<view class="drawer-date"> <view class="drawer-date">
<uni-datetime-picker v-model="outgoingTimeFilter" type="date" :clear-icon="true" <uni-datetime-picker v-model="outgoingTimeFilter" type="daterange" :clear-icon="true"
:placeholder="t('equipmentLedger.placeholderOutgoingTime')" /> :start-placeholder="t('equipmentLedger.placeholderOutgoingStartTime')"
:end-placeholder="t('equipmentLedger.placeholderOutgoingEndTime')" />
</view> </view>
</view> </view>
</view> </view>
@ -222,13 +184,10 @@ const searchKeyword = ref('');
const selectedStatus = ref(''); const selectedStatus = ref('');
const selectedLineId = ref(''); const selectedLineId = ref('');
const selectedDeviceTypeId = ref(''); const selectedDeviceTypeId = ref('');
const deviceCodeFilter = ref('');
const deviceNameFilter = ref('');
const deviceBrandFilter = ref(''); const deviceBrandFilter = ref('');
const snFilter = ref(''); const snFilter = ref('');
const outgoingTimeFilter = ref(''); const outgoingTimeFilter = ref([]);
const drawerDeviceTypePanelOpen = ref(false); const drawerDeviceTypePanelOpen = ref(false);
const drawerLinePanelOpen = ref(false);
const filterPopupRef = ref(null); const filterPopupRef = ref(null);
const lineTree = ref([]); const lineTree = ref([]);
const deviceTypeTree = ref([]); const deviceTypeTree = ref([]);
@ -294,10 +253,6 @@ const selectedLineLabel = computed(() => {
); );
return found?.name || t('equipmentLedger.lineFilter'); return found?.name || t('equipmentLedger.lineFilter');
}); });
const drawerLineOptions = computed(() => [
{ id: '', name: t('functionCommon.all'), level: 0 },
...lineOptions.value,
]);
const deviceTypeOptions = computed(() => flattenLineTree(deviceTypeTree.value)); const deviceTypeOptions = computed(() => flattenLineTree(deviceTypeTree.value));
const deviceTypeCascaderOptions = computed(() => [ const deviceTypeCascaderOptions = computed(() => [
{ label: t('functionCommon.all'), value: '' }, { label: t('functionCommon.all'), value: '' },
@ -449,15 +404,14 @@ async function fetchList(reset) {
} }
try { try {
const keyword = searchKeyword.value.trim(); const keyword = searchKeyword.value.trim();
const deviceCode = deviceCodeFilter.value.trim();
const deviceName = deviceNameFilter.value.trim();
const deviceBrand = deviceBrandFilter.value.trim(); const deviceBrand = deviceBrandFilter.value.trim();
const sn = snFilter.value.trim(); const sn = snFilter.value.trim();
const outgoingTimeRange = Array.isArray(outgoingTimeFilter.value) ? outgoingTimeFilter.value : [];
const params = { const params = {
pageNo: pageNo.value, pageNo: pageNo.value,
pageSize: pageSize.value, pageSize: pageSize.value,
deviceCode: deviceCode || keyword || undefined, deviceCode: keyword || undefined,
deviceName: deviceName || keyword || undefined, deviceName: keyword || undefined,
deviceStatus: deviceStatus:
selectedStatus.value === '' ? undefined : selectedStatus.value, selectedStatus.value === '' ? undefined : selectedStatus.value,
deviceLine: deviceLine:
@ -466,7 +420,8 @@ async function fetchList(reset) {
selectedDeviceTypeId.value === '' ? undefined : selectedDeviceTypeId.value, selectedDeviceTypeId.value === '' ? undefined : selectedDeviceTypeId.value,
deviceBrand: deviceBrand || undefined, deviceBrand: deviceBrand || undefined,
sn: sn || undefined, sn: sn || undefined,
outgoingTime: outgoingTimeFilter.value || undefined, 'outgoingTime[0]': outgoingTimeRange[0] || undefined,
'outgoingTime[1]': outgoingTimeRange[1] || undefined,
}; };
const res = await getDeviceLedgerPage(params); const res = await getDeviceLedgerPage(params);
const page = normalizePageData(res); const page = normalizePageData(res);
@ -509,38 +464,26 @@ function onStatusFilterChange(e) {
fetchList(true); fetchList(true);
} }
function onDrawerStatusFilterChange(e) {
const idx = Number(e?.detail?.value || 0);
selectedStatus.value = statusOptions.value[idx]?.value ?? '';
}
function openFilterDrawer() { function openFilterDrawer() {
filterPopupRef.value?.open(); filterPopupRef.value?.open();
} }
function closeFilterDrawer() { function closeFilterDrawer() {
filterPopupRef.value?.close(); filterPopupRef.value?.close();
} }
async function confirmFilterDrawer() { async function confirmFilterDrawer() {
drawerDeviceTypePanelOpen.value = false; drawerDeviceTypePanelOpen.value = false;
drawerLinePanelOpen.value = false;
closeFilterDrawer(); closeFilterDrawer();
await fetchList(true); await fetchList(true);
} }
async function refreshList() {
await fetchList(true);
}
function toggleDrawerDeviceTypePanel() { function toggleDrawerDeviceTypePanel() {
drawerDeviceTypePanelOpen.value = !drawerDeviceTypePanelOpen.value; drawerDeviceTypePanelOpen.value = !drawerDeviceTypePanelOpen.value;
if (drawerDeviceTypePanelOpen.value) drawerLinePanelOpen.value = false;
} }
function toggleDrawerLinePanel() {
drawerLinePanelOpen.value = !drawerLinePanelOpen.value;
if (drawerLinePanelOpen.value) drawerDeviceTypePanelOpen.value = false;
}
function selectDrawerDeviceType(option) { function selectDrawerDeviceType(option) {
selectedDeviceTypeId.value = option?.id === '' ? '' : String(option?.id ?? ''); selectedDeviceTypeId.value = option?.id === '' ? '' : String(option?.id ?? '');
@ -550,13 +493,6 @@ function selectDrawerDeviceType(option) {
drawerDeviceTypePanelOpen.value = false; drawerDeviceTypePanelOpen.value = false;
} }
function selectDrawerLine(option) {
selectedLineId.value = option?.id === '' ? '' : String(option?.id ?? '');
lineCascaderValue.value = selectedLineId.value
? findLinePath(lineTree.value, selectedLineId.value)
: [];
drawerLinePanelOpen.value = false;
}
function openDeviceTypeCascader() { function openDeviceTypeCascader() {
deviceTypeCascaderShow.value = true; deviceTypeCascaderShow.value = true;
} }
@ -585,16 +521,13 @@ function onLineCascaderConfirm(values) {
} }
async function resetFilters() { async function resetFilters() {
searchKeyword.value = ''; searchKeyword.value = '';
deviceCodeFilter.value = '';
deviceNameFilter.value = '';
deviceBrandFilter.value = ''; deviceBrandFilter.value = '';
snFilter.value = ''; snFilter.value = '';
outgoingTimeFilter.value = ''; outgoingTimeFilter.value = [];
selectedStatus.value = ''; selectedStatus.value = '';
selectedLineId.value = ''; selectedLineId.value = '';
selectedDeviceTypeId.value = ''; selectedDeviceTypeId.value = '';
drawerDeviceTypePanelOpen.value = false; drawerDeviceTypePanelOpen.value = false;
drawerLinePanelOpen.value = false;
lineCascaderValue.value = []; lineCascaderValue.value = [];
deviceTypeCascaderValue.value = []; deviceTypeCascaderValue.value = [];
lineCascaderShow.value = false; lineCascaderShow.value = false;
@ -852,6 +785,10 @@ function formatDateValue(value) {
border-radius: 28rpx 0 0 28rpx; border-radius: 28rpx 0 0 28rpx;
} }
:deep(.equipment-filter-popup.right .uni-popup__content-transition) {
transform: none !important;
}
.drawer-header { .drawer-header {
height: 104rpx; height: 104rpx;
padding: 18rpx 34rpx 0; padding: 18rpx 34rpx 0;
@ -1017,17 +954,31 @@ function formatDateValue(value) {
color: #1f2937; color: #1f2937;
} }
.drawer-date :deep(.uni-date) { .drawer-date :deep(.uni-date),
.drawer-date :deep(.uni-date-editor),
.drawer-date :deep(.uni-date-editor--x),
.drawer-date :deep(.uni-date-x) {
width: 100%; width: 100%;
} }
.drawer-date :deep(.uni-date-editor),
.drawer-date :deep(.uni-date-editor--x),
.drawer-date :deep(.uni-date-x) { .drawer-date :deep(.uni-date-x) {
min-height: 74rpx; min-height: 74rpx;
}
.drawer-date :deep(.uni-date-editor--x),
.drawer-date :deep(.uni-date-x) {
border: 0; border: 0;
padding: 0; padding: 0;
background: transparent; background: transparent;
} }
.drawer-date :deep(.uni-date-range) {
display: flex;
align-items: center;
}
.drawer-date :deep(.uni-date__x-input) { .drawer-date :deep(.uni-date__x-input) {
text-align: center; text-align: center;
font-size: 26rpx; font-size: 26rpx;

@ -3,7 +3,7 @@
<view @touchstart="touchstart"> <view @touchstart="touchstart">
<uni-transition key="1" v-if="maskShow" name="mask" mode-class="fade" :styles="maskClass" <uni-transition key="1" v-if="maskShow" name="mask" mode-class="fade" :styles="maskClass"
:duration="duration" :show="showTrans" @click="onTap" /> :duration="duration" :show="showTrans" @click="onTap" />
<uni-transition key="2" :mode-class="ani" name="content" :styles="transClass" :duration="duration" <uni-transition key="2" :mode-class="ani" name="content" custom-class="uni-popup__content-transition" :styles="transClass" :duration="duration"
:show="showTrans" @click="onTap"> :show="showTrans" @click="onTap">
<view class="uni-popup__wrapper" :style="{ backgroundColor: bg }" :class="[popupstyle]" @click="clear"> <view class="uni-popup__wrapper" :style="{ backgroundColor: bg }" :class="[popupstyle]" @click="clear">
<slot /> <slot />

Loading…
Cancel
Save