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

70
src/components/Detail/src/approveDetail.vue

@ -1,6 +1,6 @@
<template> <template>
<div> <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> <template #header>
<div class="font-size-18px"> <div class="font-size-18px">
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span> {{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span>
@ -144,24 +144,24 @@
required: false, required: false,
default: null default: null
}, },
// API // API
apiAgree: { apiAgree: {
type: Function, type: Function,
required: false, required: false,
default: null default: null
}, },
// API // API
apiDisAgree: { apiDisAgree: {
type: Function, type: Function,
required: false, required: false,
default: null default: null
}, },
// //
detailValidate: { detailValidate: {
type: Function, type: Function,
@ -230,10 +230,10 @@
required: false, required: false,
default: false default: false
}, },
}) })
const isShowDrawer = ref(false) const isShowDrawer = ref(false)
const detailLoading = ref(false) const detailLoading = ref(false)
@ -270,8 +270,8 @@
// //
const masterParmas = ref({ const masterParmas = ref({
maintenanceNumber: '' //id masterId: '', //id
// number: '', // number: '', //
// status: '' // // status: '' //
}) })
@ -290,12 +290,12 @@
// //
if (!props.isBasic) { if (!props.isBasic) {
// id // id
masterParmas.value.maintenanceNumber = row.number masterParmas.value.masterId = row.id
// masterParmas.value.number = row.number masterParmas.value.number = row.number
// masterParmas.value.status = row.status // masterParmas.value.status = row.status
tableObjectRef.value.params = { tableObjectRef.value.params = {
maintenanceNumber: row.number masterId: row.id
} }
await getList() await getList()
} }
isShowDrawer.value = true isShowDrawer.value = true
@ -375,7 +375,7 @@
// //
agree(detailData.value.id) agree(detailData.value.id)
} }
else if (val == 'disAgree') { else if (val == 'disAgree') {
// //
disAgree(detailData.value.id) disAgree(detailData.value.id)
@ -390,7 +390,7 @@
} }
} }
/** 审批通过按钮操作 */ /** 审批通过按钮操作 */
const agree = async (id : number) => { const agree = async (id : number) => {
try { try {
// //
@ -402,12 +402,12 @@
isShowDrawer.value = false isShowDrawer.value = false
updateKey.value += 1 updateKey.value += 1
setBeiJian() setBeiJian()
emit('agree') emit('agree')
} catch { } } catch { }
} }
/** 审批驳回按钮操作 */ /** 审批驳回按钮操作 */
const disAgree = async (id : number) => { const disAgree = async (id : number) => {
try { try {
// //
@ -501,17 +501,17 @@
setBeiJian() setBeiJian()
} catch { } } catch { }
} }
// //
const searchFormClick = async (searchData) => { const searchFormClick = async (searchData) => {
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage // getListApi: props.apiPage //
}) })
tableObject.params = { tableObject.params = {
isSearch: true, isSearch: true,
filters: searchData.filters filters: searchData.filters
? searchData.filters ? searchData.filters
: [{ column: 'number', action: '==', value: masterParmas.value.maintenanceNumber }] : [{ column: 'masterId', action: '==', value:masterParmas.value.masterId }]
} }
detailAllSchemasRef.value = props.detailAllSchemas detailAllSchemasRef.value = props.detailAllSchemas
tableObjectRef.value = tableObject tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods tableMethodsRef.value = tableMethods
@ -550,7 +550,7 @@
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage // getListApi: props.apiPage //
}) })
tableObject.params.maintenanceNumber = masterParmas.value.maintenanceNumber tableObject.params.masterId = masterParmas.value.masterId
detailAllSchemasRef.value = props.detailAllSchemas detailAllSchemasRef.value = props.detailAllSchemas
if (props.tableObjectExtend) { if (props.tableObjectExtend) {
props.tableObjectExtend.forEach((item) => { 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', field: 'estimatedMinutes',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
@ -146,7 +146,11 @@ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
}, },
form: { form: {
component: 'InputNumber', 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 download from '@/utils/download'
import { Item, ItemRules } from './item.data' import { Item, ItemRules } from './item.data'
import * as ItemApi from '@/api/eam/basic/item' 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 { DeviceAccounts, DeviceAccountsRules } from '@/views/eam/device/deviceAccounts/deviceAccounts.data'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -128,24 +128,44 @@
// itemNumber.value = number; // itemNumber.value = number;
// searchTableRef.value.open('', DeviceAccounts.allSchemas, DeviceAccountsApi.getDeviceAccountsPage(), null, Item.allSchemas.searchSchema, true, null, null, null, null); // searchTableRef.value.open('', DeviceAccounts.allSchemas, DeviceAccountsApi.getDeviceAccountsPage(), null, Item.allSchemas.searchSchema, true, null, null, null, null);
// } // }
const searchTableRef = ref() const searchTableRef = ref()
/** 绑定备件操作 */ /** 绑定备件操作 */
const openItem = async (number: String) => { const openItem = async (number : String) => {
itemNumber.value = number itemNumber.value = number
await CallBack1()
searchTableRef.value.open( searchTableRef.value.open(
'选择设备', '选择设备',
DeviceAccounts.allSchemas, DeviceAccounts.allSchemas,
getDeviceItemList, DeviceAccountsApi.getDeviceAccountsPage,
null, null,
Item.allSchemas.searchSchema, DeviceAccounts.allSchemas.searchSchema,
true, true,
null, null,
null, 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 submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map(element => ({ const deviceItemRelList = selections.map(element => ({
itemNumber: itemNumber.value, itemNumber: itemNumber.value,
@ -155,47 +175,6 @@
message.success(t('common.createSuccess')) 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() const basicFormRef = ref()

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

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

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

@ -105,6 +105,7 @@
:isSearchTableItem="true" :isSearchTableItem="true"
:openFormCallBack="openFormCallBack" :openFormCallBack="openFormCallBack"
:buttonControllFunction="buttonControllFunction" :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, isForm: false,
}, },
{
label: '描述',
field: 'describes',
sort: 'custom',
isSearch: false,
isForm: false,
},
{ {
label: '操作', label: '操作',

Loading…
Cancel
Save