Browse Source

BUG修改

master
parent
commit
4b1daa9bad
  1. 46
      src/components/Detail/src/approveDetail.vue
  2. 8
      src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts
  3. 71
      src/views/eam/basic/item/index.vue

46
src/components/Detail/src/approveDetail.vue

@ -1,6 +1,6 @@
<template>
<div>
<Dialog v-model="isShowDrawer" title="审批详情" direction="rtl" size="80%" v-loading="detailLoading">
<Dialog v-model="isShowDrawer" title="审批详情" direction="rtl" width="60%" v-loading="detailLoading">
<template #header>
<div class="font-size-18px">
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span>
@ -270,8 +270,8 @@
//
const masterParmas = ref({
maintenanceNumber: '' //id
// number: '', //
masterId: '', //id
number: '', //
// status: '' //
})
@ -290,12 +290,12 @@
//
if (!props.isBasic) {
// id
masterParmas.value.maintenanceNumber = row.number
// masterParmas.value.number = row.number
masterParmas.value.masterId = row.id
masterParmas.value.number = row.number
// masterParmas.value.status = row.status
tableObjectRef.value.params = {
maintenanceNumber: row.number
}
tableObjectRef.value.params = {
masterId: row.id
}
await getList()
}
isShowDrawer.value = true
@ -390,7 +390,7 @@
}
}
/** 审批通过按钮操作 */
/** 审批通过按钮操作 */
const agree = async (id : number) => {
try {
//
@ -402,12 +402,12 @@
isShowDrawer.value = false
updateKey.value += 1
setBeiJian()
emit('agree')
emit('agree')
} catch { }
}
/** 审批驳回按钮操作 */
/** 审批驳回按钮操作 */
const disAgree = async (id : number) => {
try {
//
@ -501,17 +501,17 @@
setBeiJian()
} catch { }
}
//
const searchFormClick = async (searchData) => {
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
tableObject.params = {
isSearch: true,
filters: searchData.filters
? searchData.filters
: [{ column: 'number', action: '==', value: masterParmas.value.maintenanceNumber }]
}
//
const searchFormClick = async (searchData) => {
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
tableObject.params = {
isSearch: true,
filters: searchData.filters
? searchData.filters
: [{ column: 'masterId', action: '==', value:masterParmas.value.masterId }]
}
detailAllSchemasRef.value = props.detailAllSchemas
tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods
@ -550,7 +550,7 @@
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
tableObject.params.maintenanceNumber = masterParmas.value.maintenanceNumber
tableObject.params.masterId = masterParmas.value.masterId
detailAllSchemasRef.value = props.detailAllSchemas
if (props.tableObjectExtend) {
props.tableObjectExtend.forEach((item) => {

8
src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts

@ -137,7 +137,7 @@ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
}
},
{
label: '保养所需时间(h)',
label: '保养所需时间(分钟)',
field: 'estimatedMinutes',
sort: 'custom',
isSearch: false,
@ -146,7 +146,11 @@ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
},
form: {
component: 'InputNumber',
}
componentProps: {
min: 1,
precision: 0
}
},
},
{

71
src/views/eam/basic/item/index.vue

@ -41,7 +41,7 @@
import download from '@/utils/download'
import { Item, ItemRules } from './item.data'
import * as ItemApi from '@/api/eam/basic/item'
import { createDeviceItemBatch, getDeviceItemPage } from '@/api/eam/basic/rel'
import { createDeviceItemBatch, getDeviceItemPage, getDeviceItemNoPage } from '@/api/eam/basic/rel'
import { DeviceAccounts, DeviceAccountsRules } from '@/views/eam/device/deviceAccounts/deviceAccounts.data'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -131,21 +131,41 @@
const searchTableRef = ref()
/** 绑定备件操作 */
const openItem = async (number: String) => {
const openItem = async (number : String) => {
itemNumber.value = number
await CallBack1()
searchTableRef.value.open(
'选择设备',
DeviceAccounts.allSchemas,
getDeviceItemList,
DeviceAccountsApi.getDeviceAccountsPage,
null,
Item.allSchemas.searchSchema,
DeviceAccounts.allSchemas.searchSchema,
true,
null,
null,
null,
null
null,
searchTableSelections.value
)
}
const searchTableSelections = ref([])
const CallBack1 = async () => {
await getDeviceItemNoPage({ itemNumber: itemNumber.value }).then(async (res) => {
await DeviceAccountsApi.getDeviceAccountsAllNoPage({}).then(response => {
searchTableSelections.value = response.filter(element => {
let flag = false;
res.forEach(item => {
if (element.number == item.deviceNumber) {
flag = true;
}
});
return flag;
});
});
});
};
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map(element => ({
itemNumber: itemNumber.value,
@ -156,47 +176,6 @@
})
};
const getItemWithOutBind = async () => {
try {
const res = await DeviceAccountsApi.getDeviceAccountsPage({
...Item.allSchemas.searchSchema
})
if (res.list?.length > 0) {
// const response = await getDeviceItemPage(DeviceAccounts.allSchemas.searchSchema);
// const filteredList = res.list.filter(item => {
// return !response.list?.some(element => {
// return item.number === element.itemNumber
// });
// });
// console.log('filteredList',filteredList);
const filteredList = res.list
return filteredList //
}
return [] //
} catch (error) {
console.error(error)
throw error //
}
}
// getListApi getItemWithOutBind
const getDeviceItemList = async () => {
tableObject.loading = true
try {
const res = await getItemWithOutBind()
let result = {
list: res,
total: res.length
}
return result
} catch (error) {
console.error(error)
} finally {
tableObject.loading = false
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {

Loading…
Cancel
Save