style:设备台账-备件选项接口更换

main
黄伟杰 2 weeks ago
parent 6437c0c408
commit b27e5324bc

@ -643,7 +643,7 @@
<el-dialog <el-dialog
v-model="beijianDialogVisible" v-model="beijianDialogVisible"
:title="t('EquipmentManagement.EquipmentLedger.bjTitle')" :title="t('EquipmentManagement.EquipmentLedger.bjTitle')"
width="860px" width="1000px"
class="device-ledger-transfer-dialog" class="device-ledger-transfer-dialog"
append-to-body append-to-body
> >
@ -669,7 +669,7 @@
v-model="bjQueryParams.barCode" v-model="bjQueryParams.barCode"
:placeholder="t('SparePartsManagement.SpareInfo.placeholderCode')" :placeholder="t('SparePartsManagement.SpareInfo.placeholderCode')"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="bjHandleQuery"
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </el-form-item>
@ -997,6 +997,7 @@ const criticalComponentOptions = ref<SelectionOption[]>([])
const beijianOptions = ref<SelectionOption[]>([]) const beijianOptions = ref<SelectionOption[]>([])
const savedCriticalComponentOptions = ref<SelectionOption[]>([]) const savedCriticalComponentOptions = ref<SelectionOption[]>([])
const savedBeijianOptions = ref<SelectionOption[]>([]) const savedBeijianOptions = ref<SelectionOption[]>([])
const SPARE_PART_CATEGORY_TYPE = 3
const buildCriticalComponentOptions = (items: any[] = []): SelectionOption[] => const buildCriticalComponentOptions = (items: any[] = []): SelectionOption[] =>
(items ?? []) (items ?? [])
.map((item: any) => { .map((item: any) => {
@ -1262,12 +1263,12 @@ const ensureOptionsLoaded = async () => {
DeviceTypeApi.getDeviceTypeTree({ pageNo: 1, pageSize: 10 }), DeviceTypeApi.getDeviceTypeTree({ pageNo: 1, pageSize: 10 }),
getSimpleUserList(), getSimpleUserList(),
CriticalComponentApi.getCriticalComponentList(), CriticalComponentApi.getCriticalComponentList(),
ProductApi.getComponentSimpleList() ProductApi.getProductPage({ pageNo: 1, pageSize: 10, categoryType: SPARE_PART_CATEGORY_TYPE })
]) ])
deviceTypeTree.value = deviceTypeRes deviceTypeTree.value = deviceTypeRes
users.value = userRes ?? [] users.value = userRes ?? []
criticalComponentOptions.value = buildCriticalComponentOptions(criticalRes ?? []) criticalComponentOptions.value = buildCriticalComponentOptions(criticalRes ?? [])
beijianOptions.value = buildBeijianOptions(beijianRes ?? []) beijianOptions.value = buildBeijianOptions(beijianRes?.list ?? [])
} }
/** 鎵撳紑寮圭獥 */ /** 鎵撳紑寮圭獥 */
@ -1340,8 +1341,9 @@ const queryParams = reactive({
const bjQueryParams = reactive({ const bjQueryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
barCode: undefined,
name: undefined, name: undefined,
categoryId: undefined categoryType: SPARE_PART_CATEGORY_TYPE
}) })
const iotDeviceQueryParams = reactive({ const iotDeviceQueryParams = reactive({
@ -1483,10 +1485,11 @@ const getList = async () => {
const bjGetList = async () => { const bjGetList = async () => {
loading.value = true loading.value = true
try { try {
bjQueryParams.categoryId = 5 bjQueryParams.categoryType = SPARE_PART_CATEGORY_TYPE
const data = await ProductApi.getProductPage(bjQueryParams) const data = await ProductApi.getProductPage(bjQueryParams)
bjList.value = data.list bjList.value = data.list
bjTotal.value = data.total bjTotal.value = data.total
beijianOptions.value = mergeSelectionOptions(beijianOptions.value, buildBeijianOptions(bjList.value))
// ? // ?
nextTick(() => { nextTick(() => {
bjToggleSelection() bjToggleSelection()

Loading…
Cancel
Save