Browse Source

测试bug修复

master
ljlong_2630 8 months ago
parent
commit
5ad14c8f4d
  1. 2
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  2. 66
      src/views/eam/device/devicemaintenancejob/index.vue
  3. 49
      src/views/eam/mold/moldmaintenancejob/index.vue

2
src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts

@ -195,7 +195,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
}, },
dictType: DICT_TYPE.APP_DEVICE_MOLD_TYPE, // dictType: DICT_TYPE.APP_DEVICE_MOLD_TYPE,
isSearch: true, isSearch: true,
search: { search: {
component: 'Select', component: 'Select',

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

@ -126,6 +126,22 @@
<el-image v-for="url in urls" :key="url" :src="url" lazy /> <el-image v-for="url in urls" :key="url" :src="url" lazy />
</Dialog> </Dialog>
<Dialog
ref="confirmIfTempIdeaRef"
v-model="showTempIdeaRefView"
:key="tempIdeaRefViewKey"
:closeOnClickModal="true"
:title="tempIdeaRefViewTitle"
>
<div style="text-align: center;">
<el-checkbox ref="checkBoxTempDue" v-model="isTemporary">临时措施</el-checkbox>
</div>
<template #footer>
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="confirmIsTemporary">确定</el-button>
</template>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -170,6 +186,11 @@ const newRow = ref()
const deviceList = ref() const deviceList = ref()
const moldList = ref() const moldList = ref()
const repairUser = ref() const repairUser = ref()
const showTempIdeaRefView = ref(false)
const tempIdeaRefViewKey = ref(0)
const tempIdeaRefViewTitle = ref('是否临时措施')
const isTemporary = ref(false)
const tempIdeaRefViewData = ref()
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
@ -343,7 +364,7 @@ const butttondata = (row) => {
) )
}), // }), //
defaultButtons.turnOrderBtn({ defaultButtons.turnOrderBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && !row.hasDetails) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && !row.hasDetails )
}), // }), //
defaultButtons.repairBtn({ defaultButtons.repairBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
@ -385,13 +406,29 @@ const onChangeSec = (field, cur, item,formRefSec) => {
const setV = {} const setV = {}
setV['maintenance'] = '' setV['maintenance'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.options = res }).componentProps.options = res
}) })
const setV = {} const setV = {}
setV['deviceNumber'] = '' setV['deviceNumber'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
} else if (cur == 'TECH') {
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = deviceList.value
selecUserByType({ classType: 'TECH', factoryAreaNumber: '', flag: null }).then(res => {
repairUser.value = res
const setV = {}
setV['maintenance'] = ''
formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance'
}).componentProps.options = res
})
const setV = {}
setV['deviceNumber'] = ''
formRefSec.setValues(setV)
} else { } else {
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
@ -401,7 +438,7 @@ const onChangeSec = (field, cur, item,formRefSec) => {
const setV = {} const setV = {}
setV['maintenance'] = '' setV['maintenance'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.options = res }).componentProps.options = res
}) })
@ -614,21 +651,29 @@ function acceptOrder(row) {
getList() getList()
} }
// //
function turnOrder() {} function turnOrder() { }
// //
function finishOrder(row) { function finishOrder(row) {
showTempIdeaRefView.value = true
tempIdeaRefViewData.value = row
}
function confirmFinish(row) {
let param = { let param = {
id: row.id, id: row.id,
number: row.number, number: row.number,
status: row.status, status: row.status,
result: 'COMPLETED', result:isTemporary.value && isTemporary.value != ''?'TEMPORARILY':'COMPLETED',
requestNumber: row.requestNumber, requestNumber: row.requestNumber,
} }
DeviceMaintenanceMainApi.finishOrder(param).then(res => { DeviceMaintenanceMainApi.finishOrder(param).then(res => {
getList() getList()
showTempIdeaRefView.value = false;
message.success('操作成功') message.success('操作成功')
}) })
} }
// //
function verifyOrder(row) { function verifyOrder(row) {
let param = { let param = {
@ -834,7 +879,7 @@ const openFormCallBack = (type, row, masterParmas, callback) => {
function buttonControllFunction(row, val) { function buttonControllFunction(row, val) {
if (val == 'delete') { if (val == 'delete') {
if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance) ) { if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance) ) {
return false return false
} else { } else {
return true return true
@ -866,6 +911,15 @@ function isReceiver(orderPerson) {
} }
} }
const confirmIsTemporary = () => {
confirmFinish(tempIdeaRefViewData.value)
}
const cancel = () => {
showTempIdeaRefView.value = false;
};
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

49
src/views/eam/mold/moldmaintenancejob/index.vue

@ -126,6 +126,24 @@
</Dialog> </Dialog>
<Dialog
ref="confirmIfTempIdeaRef"
v-model="showTempIdeaRefView"
:key="tempIdeaRefViewKey"
:closeOnClickModal="true"
:title="tempIdeaRefViewTitle"
>
<div style="text-align: center;">
<el-checkbox ref="checkBoxTempDue" v-model="isTemporary">临时措施</el-checkbox>
</div>
<template #footer>
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="confirmIsTemporary">确定</el-button>
</template>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -146,9 +164,9 @@ import { selecUserByType } from '@/api/system/dept'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts' import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts'
import * as UserApi from '@/api/system/user'
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
const moldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'MOLD') const moldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'MOLD')
const userListAll = await UserApi.getSimpleUserList()
defineOptions({ name: 'MoldMaintenanceMain' }) defineOptions({ name: 'MoldMaintenanceMain' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -166,6 +184,11 @@ const newRow = ref()
const deviceList = ref() const deviceList = ref()
const moldList = ref() const moldList = ref()
const repairUser = ref() const repairUser = ref()
const showTempIdeaRefView = ref(false)
const tempIdeaRefViewKey = ref(0)
const tempIdeaRefViewTitle = ref('是否临时措施')
const isTemporary = ref(false)
const tempIdeaRefViewData = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(MoldMaintenanceMain.allSchemas.tableColumns) const tableColumns = ref(MoldMaintenanceMain.allSchemas.tableColumns)
@ -345,7 +368,7 @@ const butttondata = (row) => {
) )
}), // }), //
defaultButtons.turnOrderBtn({ defaultButtons.turnOrderBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && !row.hasDetails)
}), // }), //
defaultButtons.repairBtn({ defaultButtons.repairBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
@ -486,21 +509,29 @@ function acceptOrder(row) {
}) })
} }
// //
function turnOrder() {} function turnOrder() { }
// //
function finishOrder(row) { function finishOrder(row) {
showTempIdeaRefView.value = true
tempIdeaRefViewData.value = row
}
function confirmFinish(row) {
let param = { let param = {
id: row.id, id: row.id,
number: row.number, number: row.number,
status: row.status, status: row.status,
result: 'COMPLETED', result:isTemporary.value && isTemporary.value != ''?'TEMPORARILY':'COMPLETED',
requestNumber: row.requestNumber, requestNumber: row.requestNumber,
} }
MoldMaintenanceMainApi.finishOrder(param).then(res => { MoldMaintenanceMainApi.finishOrder(param).then(res => {
getList() getList()
showTempIdeaRefView.value = false;
message.success('操作成功') message.success('操作成功')
}) })
} }
// //
function verifyOrder(row) { function verifyOrder(row) {
let param = { let param = {
@ -859,6 +890,16 @@ function isReceiver(orderPerson) {
} }
} }
const confirmIsTemporary = () => {
confirmFinish(tempIdeaRefViewData.value)
}
const cancel = () => {
showTempIdeaRefView.value = false;
};
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

Loading…
Cancel
Save