Browse Source

EAM ——> 报修工单 报修验证 维修验证

master_hella_20240701
gaojs 5 months ago
parent
commit
c67dc8c6c0
  1. 15
      src/api/eam/equipmentRepairJobMain/index.ts
  2. 3
      src/hooks/web/useMessage.ts
  3. 26
      src/utils/disposition/defaultButtons.ts
  4. 5
      src/views/eam/equipmentMaintenanceMain/finishForm1.vue
  5. 18
      src/views/eam/equipmentMaintenanceMain/index.vue
  6. 46
      src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts
  7. 211
      src/views/eam/equipmentRepairJobMain/finishForm1.vue
  8. 209
      src/views/eam/equipmentRepairJobMain/finishForm3.vue
  9. 117
      src/views/eam/equipmentRepairJobMain/index.vue
  10. 2
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

15
src/api/eam/equipmentRepairJobMain/index.ts

@ -14,9 +14,12 @@ export interface EquipmentRepairJobMainVO {
startTime: Date
endTime: Date
totalMinutes: number
verifyer: number
verifyContent: string
verifyTime: Date
verifyerRepair: number
verifyContentRepair: string
verifyTimeRepair: Date
verifyerReport: number
verifyContentReport: string
verifyTimeReport: Date
maintenancer: number
maintenancePhone: string
completeResult: string
@ -100,3 +103,9 @@ export const importTemplate = () => {
export const updateEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO) => {
return await request.post({ url: `/eam/equipment-repair-job-main/updateOrder`, data })
}
//验证不通过,打回维修工单
export const backEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO) => {
return await request.post({ url: `/eam/equipment-repair-job-main/fallback`, data })
}

3
src/hooks/web/useMessage.ts

@ -62,9 +62,10 @@ export const useMessage = () => {
// 验证窗体
confirmPassword(content: string, tip?: string) {
return ElMessageBox.confirm(content, tip ? tip : t('common.confirmTitle'), {
distinguishCancelAndClose: true,
confirmButtonText: t('验证通过'),
cancelButtonText: t('验证不通过'),
type: 'warning'
type: 'warning',
})
},
// 审核窗体

26
src/utils/disposition/defaultButtons.ts

@ -415,6 +415,32 @@ export function mainListValidateBtn(option:any) {
})
}
// 主列表-报修验证按钮
export function mainListValidateReportBtn(option:any) {
return __defaultBtnOption(option,{
label: t(`ts.报修验证`).replace('ts.', ''),
name: 'validate_report',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-维修验证按钮
export function mainListValidateRepairBtn(option:any) {
return __defaultBtnOption(option,{
label: t(`ts.维修验证`).replace('ts.', ''),
name: 'validate_repair',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-审核按钮
export function mainListAuditingBtn(option:any) {
return __defaultBtnOption(option,{

5
src/views/eam/equipmentMaintenanceMain/finishForm1.vue

@ -169,8 +169,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 提交表单 */
const submitForm = async (val) => {
//success
emit('success',formData.value.id)
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
@ -178,6 +177,8 @@ const submitForm = async (val) => {
//
await EquipmentMaintenanceMainApi.updateEquipmentMaintenanceMain(formData.value)
//success
emit('success',formData.value.id)
dialogVisible.value = false
}

18
src/views/eam/equipmentMaintenanceMain/index.vue

@ -363,14 +363,16 @@ const handleValidate = async (row) => {
//
//
finishForm1Ref.value.open('update', row);
}).catch (async () => {
const params = ref({id: '', status:''})
params.value.id = row.id
params.value.status = '5'
await EquipmentMaintenanceMainApi.backMaintenanceOrder(params.value)
message.success(t('工单已打回'))
//
await getList()
}).catch (async (action: Action) => {
if(action === 'cancel'){
const params = ref({id: '', status:''})
params.value.id = row.id
params.value.status = '5'
await EquipmentMaintenanceMainApi.backMaintenanceOrder(params.value)
message.success(t('工单已打回'))
//
await getList()
}
})
}

46
src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts

@ -166,20 +166,54 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
},
{
label: '验证人',
field: 'verifyer',
label: '维修验证人',
field: 'verifyerRepair',
sort: 'custom',
isSearch: false,
},
{
label: '验证内容',
field: 'verifyContent',
label: '维修验证内容',
field: 'verifyContentRepair',
sort: 'custom',
isSearch: false,
},
{
label: '验证时间',
field: 'verifyTime',
label: '维修验证时间',
field: 'verifyTimeRepair',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '报修验证人',
field: 'verifyerReport',
sort: 'custom',
isSearch: false,
},
{
label: '报修验证内容',
field: 'verifyContentReport',
sort: 'custom',
isSearch: false,
},
{
label: '报修验证时间',
field: 'verifyTimeReport',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,

211
src/views/eam/equipmentRepairJobMain/finishForm1.vue

@ -0,0 +1,211 @@
<template>
<Dialog v-model="dialogVisible" :title="dialogTitle" :close-on-click-modal="false">
<el-form ref="basicFormRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="维修验证人" prop="verifyerRepair">
<el-input v-model="formData.verifyerRepair" placeholder="请输入维修验证人" :disabled="isDisabled"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="维修验证内容" prop="verifyContentRepair">
<el-input v-model="formData.verifyContentRepair" placeholder="请输入维修验证内容" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="维修验证时间" prop="verifyTimeRepair">
<el-date-picker
v-model="formData.verifyTimeRepair"
type="datetime"
value-format="x"
placeholder="选择维修验证时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')"> </el-button>
<el-button @click="handleClose('close')"> </el-button>
</template>
</Dialog>
<!--添加巡检项弹窗-->
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
</template>
<script lang="ts" setup>
import * as EquipmentMaintenanceMainApi from '@/api/eam/equipmentMaintenanceMain'
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
import * as EquipmentRepairJobMainApi from "@/api/eam/equipmentRepairJobMain";
import {updateEquipmentRepairJobMain} from "@/api/eam/equipmentRepairJobMain";
defineOptions({ name: 'TeamForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const tags=ref([])
const inputValue = ref('')
const inputVisible = ref(false)
const isDisabled = ref(false)
const InputRef = ref<InstanceType<typeof ElInput>>()
const formData = ref({
id:'',
number:'',
verifyerRepair: '',
verifyContentRepair: '',
verifyTimeRepair: '',
})
const formRules = reactive({
verifyerRepair: [
{ required: true, message: '验证人不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
verifyContentRepair: [
{ required: true, message: '验证内容不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
verifyTimeRepair: [
{ required: true, message: '验证时间不能为空', trigger: 'blur' },
],
})
const basicFormRef = ref() // Ref
// /** */
// const searchTableRef = ref();
// const _searchTableTitle = ref();
// const _searchTableAllSchemas = ref();
// const _searchTablePage = ref();
// const _formField = ref();
// const _searchField = ref();
// const _multiple = ref();
// const _type = ref();
// const _row = ref();
// const _searchCondition = ref({})
//
//
// const addItem = () =>{
// addItemCommon(true,'xunJianItem')
// }
//
// /** */
// const addItemCommon = (multiple,field) => {
// _searchCondition.value = {}
// const filters: any[] = []
// filters.push({
// action: "==",
// column: 'available',
// value: 'TRUE'
// })
// //
// _searchCondition.value.isSearch = true
// _searchCondition.value.filters = filters
// _searchTableTitle.value = ''
// _multiple.value = multiple
// _formField.value = field
// _searchField.value = field
// _searchTablePage.value = inspectionItemApi.getInspectionItemPage
// _searchTableAllSchemas.value = InspectionItem.allSchemas
// openCommon()
// }
//
// /** */
// const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
// nextTick?.(() => {
// if (formField === 'xunJianItem') {
// val.forEach(item => {
// const isExist = tags.value.some(tag => tag.content === item.content);
// if (!isExist){
// const newItem = {};
// newItem['content'] = item.content;
// newItem['id'] = item.id;
// tags.value.push(newItem);
// }
// });
// }
// })
// }
// /**/
// const openCommon = () => {
// searchTableRef.value.open(
// _searchTableTitle.value,
// _searchTableAllSchemas.value,
// _searchTablePage.value,
// _formField.value,
// _searchField.value,
// _multiple.value,
// _type.value,
// _row.value,
// _searchCondition.value
// )
// }
/** 初始化弹窗 */
const open = async (type: string, row?: object) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
//
formData.value.id = row.id
formData.value.number = row.number
}
defineExpose({ open }) // open
/** 提交表单 */
const submitForm = async (val) => {
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
if (!valid) return
//
await EquipmentRepairJobMainApi.updateEquipmentRepairJobMain(formData.value)
//success
emit('success',formData.value.id)
dialogVisible.value = false
}
const handleClose=(val)=>{
dialogVisible.value = false
emit('close',val)
}
//
const emit = defineEmits(['close','success'])
</script>
<style scoped>
.tag-container {
margin-top: 10px; /* 可根据需要调整标签容器与表单项之间的间距 */
border: 1px solid #ccc; /* 添加边框样式 */
padding: 10px; /* 可根据需要调整容器内边距 */
width: 950px; /* 设置固定宽度为 950px */
overflow-y: auto; /* 当内容溢出容器高度时显示滚动条 */
word-wrap: break-word; /* 使用 word-wrap 属性实现超出范围换行 */
overflow-wrap: break-word; /* 兼容性更好的写法 */
flex-wrap: wrap;
}
.input-with-button {
display: flex;
align-items: center;
width: 100%;
}
.input-with-button > .el-input {
flex: 1;
/*margin-right: 10px;*/
}
</style>

209
src/views/eam/equipmentRepairJobMain/finishForm3.vue

@ -0,0 +1,209 @@
<template>
<Dialog v-model="dialogVisible" :title="dialogTitle" :close-on-click-modal="false">
<el-form ref="basicFormRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="报修验证人" prop="verifyerReport">
<el-input v-model="formData.verifyerReport" placeholder="请输入报修验证人" :disabled="isDisabled"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报修验证内容" prop="verifyContentReport">
<el-input v-model="formData.verifyContentReport" placeholder="请输入报修验证内容" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="报修验证时间" prop="verifyTimeReport">
<el-date-picker
v-model="formData.verifyTimeReport"
type="datetime"
value-format="x"
placeholder="选择报修验证时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')"> </el-button>
<el-button @click="handleClose('close')"> </el-button>
</template>
</Dialog>
<!--添加巡检项弹窗-->
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
</template>
<script lang="ts" setup>
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
import * as EquipmentRepairJobMainApi from "@/api/eam/equipmentRepairJobMain";
defineOptions({ name: 'TeamForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const tags=ref([])
const inputValue = ref('')
const inputVisible = ref(false)
const isDisabled = ref(false)
const InputRef = ref<InstanceType<typeof ElInput>>()
const formData = ref({
id:'',
number:'',
verifyerReport: '',
verifyContentReport: '',
verifyTimeReport: '',
})
const formRules = reactive({
verifyerReport: [
{ required: true, message: '验证人不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
verifyContentReport: [
{ required: true, message: '验证内容不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
verifyTimeReport: [
{ required: true, message: '验证时间不能为空', trigger: 'blur' },
],
})
const basicFormRef = ref() // Ref
// /** */
// const searchTableRef = ref();
// const _searchTableTitle = ref();
// const _searchTableAllSchemas = ref();
// const _searchTablePage = ref();
// const _formField = ref();
// const _searchField = ref();
// const _multiple = ref();
// const _type = ref();
// const _row = ref();
// const _searchCondition = ref({})
//
//
// const addItem = () =>{
// addItemCommon(true,'xunJianItem')
// }
//
// /** */
// const addItemCommon = (multiple,field) => {
// _searchCondition.value = {}
// const filters: any[] = []
// filters.push({
// action: "==",
// column: 'available',
// value: 'TRUE'
// })
// //
// _searchCondition.value.isSearch = true
// _searchCondition.value.filters = filters
// _searchTableTitle.value = ''
// _multiple.value = multiple
// _formField.value = field
// _searchField.value = field
// _searchTablePage.value = inspectionItemApi.getInspectionItemPage
// _searchTableAllSchemas.value = InspectionItem.allSchemas
// openCommon()
// }
//
// /** */
// const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
// nextTick?.(() => {
// if (formField === 'xunJianItem') {
// val.forEach(item => {
// const isExist = tags.value.some(tag => tag.content === item.content);
// if (!isExist){
// const newItem = {};
// newItem['content'] = item.content;
// newItem['id'] = item.id;
// tags.value.push(newItem);
// }
// });
// }
// })
// }
// /**/
// const openCommon = () => {
// searchTableRef.value.open(
// _searchTableTitle.value,
// _searchTableAllSchemas.value,
// _searchTablePage.value,
// _formField.value,
// _searchField.value,
// _multiple.value,
// _type.value,
// _row.value,
// _searchCondition.value
// )
// }
/** 初始化弹窗 */
const open = async (type: string, row?: object) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
//
formData.value.id = row.id
formData.value.number = row.number
}
defineExpose({ open }) // open
/** 提交表单 */
const submitForm = async (val) => {
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
if (!valid) return
//
await EquipmentRepairJobMainApi.updateEquipmentRepairJobMain(formData.value)
//success
emit('success',formData.value.id)
dialogVisible.value = false
}
const handleClose=(val)=>{
dialogVisible.value = false
emit('close',val)
}
//
const emit = defineEmits(['close','success'])
</script>
<style scoped>
.tag-container {
margin-top: 10px; /* 可根据需要调整标签容器与表单项之间的间距 */
border: 1px solid #ccc; /* 添加边框样式 */
padding: 10px; /* 可根据需要调整容器内边距 */
width: 950px; /* 设置固定宽度为 950px */
overflow-y: auto; /* 当内容溢出容器高度时显示滚动条 */
word-wrap: break-word; /* 使用 word-wrap 属性实现超出范围换行 */
overflow-wrap: break-word; /* 兼容性更好的写法 */
flex-wrap: wrap;
}
.input-with-button {
display: flex;
align-items: center;
width: 100%;
}
.input-with-button > .el-input {
flex: 1;
/*margin-right: 10px;*/
}
</style>

117
src/views/eam/equipmentRepairJobMain/index.vue

@ -50,7 +50,9 @@
:isBusiness="false"
/>
<FinishForm1 ref="finishForm1Ref" @success="getData1" @close="getClosed1"/>
<FinishForm2 ref="finishForm2Ref" @success="getData2" @close="getClosed2"/>
<FinishForm3 ref="finishForm3Ref" @success="getData3" @close="getClosed3"/>
<!-- 详情 -->
<Detail ref="detailRef"
@ -83,7 +85,9 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/views/eam/equipmentRepairJobMain/EquipmentRepairJobDetail.vue'
import FinishForm1 from '@/views/eam/equipmentRepairJobMain/finishForm1.vue'
import FinishForm2 from '@/views/eam/equipmentRepairJobMain/finishForm2.vue'
import FinishForm3 from '@/views/eam/equipmentRepairJobMain/finishForm3.vue'
defineOptions({ name: 'EquipmentRepairJobMain' })
@ -167,6 +171,8 @@ const butttondata = (row) => {
defaultButtons.mainListReceiveOrderBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
defaultButtons.mainListValidateRepairBtn({hide: isShowStatusButton(row,['6']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
defaultButtons.mainListValidateReportBtn({hide: isShowStatusButton(row,['7']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
]
}
@ -182,6 +188,10 @@ const buttonTableClick = async (val, row) => {
handleExecute(row.id)
} else if (val == 'finish') { //
handleFinish(row)
} else if (val == 'validate_repair') { //
handleValidateRepair(row)
} else if (val == 'validate_report') { //
handleValidateReport(row)
}
@ -251,6 +261,52 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
})
}
/** 报修验证按钮操作 */
const finishForm3Ref = ref()
const handleValidateReport = async (row) => {
await message.delConfirm('是否验证所选中工单?');
message.confirmPassword(t('')).then(async () => {
//
//
finishForm3Ref.value.open('update', row);
}).catch (async (action: Action) => {
if(action === 'cancel'){
const params = ref({id: '', status:''})
params.value.id = row.id
params.value.status = '5'
//
await EquipmentRepairJobMainApi.backEquipmentRepairOrder(params.value)
message.success(t('工单已打回'))
//
await getList()
}
})
}
/** 维修验证按钮操作 */
const finishForm1Ref = ref()
const handleValidateRepair = async (row) => {
await message.delConfirm('是否验证所选中工单?');
message.confirmPassword(t('')).then(async () => {
//
//
finishForm1Ref.value.open('update', row);
}).catch (async (action: Action) => {
if(action === 'cancel'){
const params = ref({id: '', status:''})
params.value.id = row.id
params.value.status = '5'
await EquipmentRepairJobMainApi.backEquipmentRepairOrder(params.value)
message.success(t('工单已打回'))
//
await getList()
}
})
}
/** 完成按钮操作 */
const finishForm2Ref = ref()
const handleFinish = async (row) => {
@ -313,6 +369,36 @@ const handleDelete = async (id: number) => {
}
//finishForm1
const getClosed1=(val)=> {
nextTick?.(() => {
console.log(val)
getList()
})
}
//finishForm1
const getData1=(val)=> {
nextTick?.(async () => {
console.log(val)
try {
const params = ref({
id: '',
status:'',
})
params.value.id = val
params.value.status = '7'
await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value)
message.success(t('工单已流转'))
//
await getList()
} catch {}
}
)
}
//finishForm2
const getClosed2=(val)=> {
@ -338,6 +424,37 @@ const getData2=(val)=> {
})
}
//finishForm3
const getClosed3=(val)=> {
nextTick?.(() => {
console.log(val)
getList()
})
}
//finishForm3
const getData3=(val)=> {
nextTick?.(async () => {
console.log(val)
try {
const params = ref({
id: '',
status:'',
})
params.value.id = val
params.value.status = '7'
await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value)
message.success(t('工单已流转'))
//
await getList()
} catch {}
}
)
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {

2
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

@ -28,7 +28,7 @@ const requestsettingData = data?.list[0] || {}
userDept.id = userDept.id.toString()
const userDeptArray:any = [userDept]
const procurementCreators = await SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode({ roleCode: 'purchase',pageSize: 1000,pageNo: 1,sort: '',by: 'ASC' })
const procurementCreators = await SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode({ roleCode: 'procurement_role',pageSize: 1000,pageNo: 1,sort: '',by: 'ASC' })
/**
* @returns {Array}
*/

Loading…
Cancel
Save