ljlong_2630 8 months ago
parent
commit
deaa8a0a3e
  1. 2
      src/components/Detail/src/Detail.vue
  2. 70
      src/components/Detail/src/approveDetail.vue
  3. 8
      src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts
  4. 73
      src/views/eam/basic/item/index.vue
  5. 8
      src/views/eam/device/deviceAccounts/deviceAccounts.data.ts
  6. 1
      src/views/eam/device/devicemaintenancejob/index.vue
  7. 7
      src/views/eam/mold/moldAccounts/moldAccounts.data.ts

2
src/components/Detail/src/Detail.vue

@ -531,6 +531,7 @@ const emit = defineEmits([
'openImage',
'detailSubmitForm',
'detailOnChange',
'deleteDetail'
])
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
@ -543,6 +544,7 @@ const handleDelete = async (id: number) => {
//
await getList()
updateKey.value += 1
emit('deleteDetail')
setBeiJian()
} catch {}
}

70
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>
@ -144,24 +144,24 @@
required: false,
default: null
},
// API
apiAgree: {
type: Function,
required: false,
default: null
},
// API
apiDisAgree: {
type: Function,
required: false,
default: null
},
//
detailValidate: {
type: Function,
@ -230,10 +230,10 @@
required: false,
default: false
},
})
const isShowDrawer = ref(false)
const detailLoading = ref(false)
@ -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
@ -375,7 +375,7 @@
//
agree(detailData.value.id)
}
else if (val == 'disAgree') {
//
disAgree(detailData.value.id)
@ -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
}
},
},
{

73
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'
@ -128,24 +128,44 @@
// itemNumber.value = number;
// searchTableRef.value.open('', DeviceAccounts.allSchemas, DeviceAccountsApi.getDeviceAccountsPage(), null, Item.allSchemas.searchSchema, true, null, null, null, null);
// }
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,
@ -155,47 +175,6 @@
message.success(t('common.createSuccess'))
})
};
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()

8
src/views/eam/device/deviceAccounts/deviceAccounts.data.ts

@ -256,14 +256,6 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
isForm: false,
},
{
label: '描述',
field: 'describes',
sort: 'custom',
isSearch: false,
isForm: false,
},
{
label: '操作',

1
src/views/eam/device/devicemaintenancejob/index.vue

@ -105,6 +105,7 @@
:isSearchTableItem="true"
:openFormCallBack="openFormCallBack"
:buttonControllFunction="buttonControllFunction"
@deleteDetail="getList"
/>
<!-- 导入 -->

7
src/views/eam/mold/moldAccounts/moldAccounts.data.ts

@ -211,13 +211,6 @@ export const MoldAccounts = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false,
},
{
label: '描述',
field: 'describes',
sort: 'custom',
isSearch: false,
isForm: false,
},
{
label: '操作',

Loading…
Cancel
Save