Browse Source

保养和检修工单打印功能,加上按钮连点问题

master
ljlong_2630 10 months ago
parent
commit
3ad7286943
  1. 12
      src/utils/disposition/defaultButtons.ts
  2. 2
      src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts
  3. 11
      src/views/eam/device/deviceinspectionjob/index.vue
  4. 2
      src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts
  5. 14
      src/views/eam/device/devicemaintainjob/index.vue
  6. 13
      src/views/eam/device/devicemaintenancejob/index.vue
  7. 14
      src/views/eam/mold/moldmaintenancejob/index.vue

12
src/utils/disposition/defaultButtons.ts

@ -1065,6 +1065,18 @@ export function confirmOrderBtn(option:any) {
}) })
} }
// 工单-打印
export function orderPrintBtn(option:any) {
return __defaultBtnOption(option,{
label: '工单打印',
name: 'orderPrint',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 默认按钮规则 // 默认按钮规则

2
src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts

@ -371,7 +371,7 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action', field: 'action',
isForm: false, isForm: false,
table: { table: {
width: 150, width: 200,
fixed: 'right' fixed: 'right'
}, },
isDetail: false isDetail: false

11
src/views/eam/device/deviceinspectionjob/index.vue

@ -121,6 +121,7 @@ import { selectAllFactoryArea } from '@/api/system/dept'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain' import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain'
import { getAccessToken } from '@/utils/auth'
// import TableHead from '@/components/TableHead/src/TableHead.vue' // import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue' // import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
@ -143,6 +144,8 @@ const verifyFormValue = ref({
verifyContent: '', verifyContent: '',
}) })
const openRowValue = ref() const openRowValue = ref()
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const src = ref(BASE_URL + '/jmreport/view/941184370359353344?token=' + getAccessToken())
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(() => {
@ -239,6 +242,9 @@ const butttondata = (row) => {
defaultButtons.verifyOrderBtn({ defaultButtons.verifyOrderBtn({
hide: !(row.status == 'COMPLETED' && judgeIsTheClassEngineer(row)) hide: !(row.status == 'COMPLETED' && judgeIsTheClassEngineer(row))
}), // }), //
defaultButtons.orderPrintBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) || !((row.status == 'COMPLETED' || row.status == 'PECEIVED') && judgeIsTheClassEngineer(row))
}) //
] ]
} }
@ -252,6 +258,8 @@ const buttonTableClick = async (val, row) => {
handleFinishOrder(row) handleFinishOrder(row)
} else if (val == 'verifyOrder') { // } else if (val == 'verifyOrder') { //
verifyOrder(row) verifyOrder(row)
} else if (val == 'orderPrint') {
orderPrint(row)
} }
} }
@ -666,6 +674,9 @@ const judgeIsTheClassEngineer = (row) => {
} }
} }
const orderPrint = (row) => {
window.open(src.value + "&id=" + row.id)
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {

2
src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts

@ -251,7 +251,7 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action', field: 'action',
isForm: false, isForm: false,
table: { table: {
width: 150, width: 200,
fixed: 'right' fixed: 'right'
}, },
isDetail: false, isDetail: false,

14
src/views/eam/device/devicemaintainjob/index.vue

@ -140,6 +140,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import { getAccessToken } from '@/utils/auth'
defineOptions({ name: 'DeviceMaintainOrderMain' }) defineOptions({ name: 'DeviceMaintainOrderMain' })
@ -157,6 +158,8 @@ const dialogRowData = ref()
const updateFormValue = ref({ const updateFormValue = ref({
verifyContent:'' verifyContent:''
}) })
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const src = ref(BASE_URL + '/jmreport/view/940395429096013824?token=' + getAccessToken())
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
@ -257,7 +260,6 @@ const butttondata = (row) => {
return [ return [
// defaultButtons.mainListEditBtn(null), // // defaultButtons.mainListEditBtn(null), //
defaultButtons.acceptOrderBtn({ defaultButtons.acceptOrderBtn({
hide: !( hide: !(
row.status == 'PENDING' && judgeIsTheClass(row) row.status == 'PENDING' && judgeIsTheClass(row)
) )
@ -271,6 +273,9 @@ const butttondata = (row) => {
defaultButtons.verifyOrderBtn({ defaultButtons.verifyOrderBtn({
hide: !(row.status == 'COMPLETED' && judgeIsTheClassEngineer(row)) hide: !(row.status == 'COMPLETED' && judgeIsTheClassEngineer(row))
}), // }), //
defaultButtons.orderPrintBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) || !((row.status == 'COMPLETED' || row.status == 'PECEIVED') && judgeIsTheClassEngineer(row))
}) //
] ]
} }
@ -301,7 +306,10 @@ const buttonTableClick = async (val, row) => {
openDialog(row) openDialog(row)
} else if (val == 'finishOrder') { } else if (val == 'finishOrder') {
finishOrder(row) finishOrder(row)
} else if (val == 'orderPrint') {
orderPrint(row)
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
@ -639,4 +647,8 @@ const onSubmit = () => {
getList() getList()
} }
const orderPrint = (row) => {
window.open(src.value + "&id=" + row.id)
}
</script> </script>

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

@ -133,6 +133,8 @@
:key="tempIdeaRefViewKey" :key="tempIdeaRefViewKey"
:closeOnClickModal="true" :closeOnClickModal="true"
:title="tempIdeaRefViewTitle" :title="tempIdeaRefViewTitle"
:vLoading="tempDialogLoading"
> >
<div style="text-align: center;"> <div style="text-align: center;">
<el-checkbox ref="checkBoxTempDue" v-model="isTemporary">临时措施</el-checkbox> <el-checkbox ref="checkBoxTempDue" v-model="isTemporary">临时措施</el-checkbox>
@ -151,6 +153,7 @@
:maxHeight="760" :maxHeight="760"
:style="{height:'500px'}" :style="{height:'500px'}"
:before-close="handleBeforeConfirmClose" :before-close="handleBeforeConfirmClose"
:vLoading="confirmDialogLoading"
> >
<el-form class="demo-form-inline"> <el-form class="demo-form-inline">
<el-form-item label="确认意见"> <el-form-item label="确认意见">
@ -186,6 +189,7 @@
:maxHeight="700" :maxHeight="700"
:style="{height:'450px'}" :style="{height:'450px'}"
:before-close="handleBeforeVerifyClose" :before-close="handleBeforeVerifyClose"
:vLoading="formLoading"
> >
<el-form :model="verifyFormValue" class="demo-form-inline"> <el-form :model="verifyFormValue" class="demo-form-inline">
<el-form-item label="验证意见"> <el-form-item label="验证意见">
@ -273,6 +277,9 @@ const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
const openRowValue = ref() const openRowValue = ref()
const formLoading = ref(false)
const tempDialogLoading = ref(false)
const confirmDialogLoading = ref(false)
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(() => {
@ -901,6 +908,7 @@ function finishOrder(row) {
} }
function confirmFinish(row) { function confirmFinish(row) {
tempDialogLoading.value = true
let param = { let param = {
id: row.id, id: row.id,
number: row.number, number: row.number,
@ -909,6 +917,7 @@ function confirmFinish(row) {
requestNumber: row.requestNumber, requestNumber: row.requestNumber,
} }
DeviceMaintenanceMainApi.finishOrder(param).then(res => { DeviceMaintenanceMainApi.finishOrder(param).then(res => {
tempDialogLoading.value = false
getList() getList()
showTempIdeaRefView.value = false; showTempIdeaRefView.value = false;
message.success('操作成功') message.success('操作成功')
@ -924,6 +933,7 @@ function verifyOrder(row) {
// //
function verifySubmit() { function verifySubmit() {
formLoading.value = true
const row = openRowValue.value const row = openRowValue.value
let param = { let param = {
id: row.id, id: row.id,
@ -933,6 +943,7 @@ function verifySubmit() {
content: verifyFormValue.value.verifyContent content: verifyFormValue.value.verifyContent
} }
DeviceMaintenanceMainApi.verifyOrder(param).then(res => { DeviceMaintenanceMainApi.verifyOrder(param).then(res => {
formLoading.value = false
verifyDialogVisible.value = false verifyDialogVisible.value = false
getList() getList()
message.success('操作成功') message.success('操作成功')
@ -954,6 +965,7 @@ function confirmOrder(row) {
// //
function confirmSubmit() { function confirmSubmit() {
confirmDialogLoading.value = true
const row = openRowValue.value const row = openRowValue.value
let param = { let param = {
id: row.id, id: row.id,
@ -964,6 +976,7 @@ function confirmSubmit() {
content: confirmFormValue.value.confirmContent, content: confirmFormValue.value.confirmContent,
} }
DeviceMaintenanceMainApi.confirmOrder(param).then(res => { DeviceMaintenanceMainApi.confirmOrder(param).then(res => {
confirmDialogLoading.value = false
confirmDialogVisible.value = false confirmDialogVisible.value = false
getList() getList()
message.success('操作成功') message.success('操作成功')

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

@ -132,6 +132,7 @@
:key="tempIdeaRefViewKey" :key="tempIdeaRefViewKey"
:closeOnClickModal="true" :closeOnClickModal="true"
:title="tempIdeaRefViewTitle" :title="tempIdeaRefViewTitle"
:vLoading="tempDialogLoading"
> >
<div style="text-align: center;"> <div style="text-align: center;">
<el-checkbox ref="checkBoxTempDue" v-model="isTemporary">临时措施</el-checkbox> <el-checkbox ref="checkBoxTempDue" v-model="isTemporary">临时措施</el-checkbox>
@ -150,6 +151,7 @@
:maxHeight="760" :maxHeight="760"
:style="{height:'500px'}" :style="{height:'500px'}"
:before-close="handleBeforeConfirmClose" :before-close="handleBeforeConfirmClose"
:vLoading="confirmDialogLoading"
> >
<el-form class="demo-form-inline"> <el-form class="demo-form-inline">
<el-form-item label="确认意见"> <el-form-item label="确认意见">
@ -185,6 +187,7 @@
:maxHeight="700" :maxHeight="700"
:style="{height:'450px'}" :style="{height:'450px'}"
:before-close="handleBeforeVerifyClose" :before-close="handleBeforeVerifyClose"
:vLoading="formLoading"
> >
<el-form :model="verifyFormValue" class="demo-form-inline"> <el-form :model="verifyFormValue" class="demo-form-inline">
<el-form-item label="验证意见"> <el-form-item label="验证意见">
@ -261,6 +264,9 @@ const verifyFormValue = ref({
verifyContent: '', verifyContent: '',
}) })
const openRowValue = ref() const openRowValue = ref()
const formLoading = ref(false)
const tempDialogLoading = ref(false)
const confirmDialogLoading = ref(false)
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(MoldMaintenanceMain.allSchemas.tableColumns) const tableColumns = ref(MoldMaintenanceMain.allSchemas.tableColumns)
@ -614,6 +620,7 @@ function finishOrder(row) {
} }
function confirmFinish(row) { function confirmFinish(row) {
tempDialogLoading.value = true
let param = { let param = {
id: row.id, id: row.id,
number: row.number, number: row.number,
@ -622,6 +629,7 @@ function confirmFinish(row) {
requestNumber: row.requestNumber, requestNumber: row.requestNumber,
} }
MoldMaintenanceMainApi.finishOrder(param).then(res => { MoldMaintenanceMainApi.finishOrder(param).then(res => {
tempDialogLoading.value = false
getList() getList()
showTempIdeaRefView.value = false; showTempIdeaRefView.value = false;
message.success('操作成功') message.success('操作成功')
@ -637,6 +645,7 @@ function verifyOrder(row) {
// //
function verifySubmit() { function verifySubmit() {
formLoading.value = true
const row = openRowValue.value const row = openRowValue.value
let param = { let param = {
id: row.id, id: row.id,
@ -646,6 +655,7 @@ function verifySubmit() {
content: verifyFormValue.value.verifyContent content: verifyFormValue.value.verifyContent
} }
MoldMaintenanceMainApi.verifyOrder(param).then(res => { MoldMaintenanceMainApi.verifyOrder(param).then(res => {
formLoading.value = false
verifyDialogVisible.value = false verifyDialogVisible.value = false
getList() getList()
message.success('操作成功') message.success('操作成功')
@ -667,6 +677,7 @@ function confirmOrder(row) {
// //
function confirmSubmit() { function confirmSubmit() {
confirmDialogLoading.value = true
const row = openRowValue.value const row = openRowValue.value
let param = { let param = {
id: row.id, id: row.id,
@ -677,6 +688,7 @@ function confirmSubmit() {
content: confirmFormValue.value.confirmContent, content: confirmFormValue.value.confirmContent,
} }
MoldMaintenanceMainApi.confirmOrder(param).then(res => { MoldMaintenanceMainApi.confirmOrder(param).then(res => {
confirmDialogLoading.value = false
confirmDialogVisible.value = false confirmDialogVisible.value = false
getList() getList()
message.success('操作成功') message.success('操作成功')
@ -807,8 +819,8 @@ const detailSubmitForm= async (formType,data,formRef,tableList) => {
}) })
item.itemNumbers1 = str.substring(0, str.length - 1) item.itemNumbers1 = str.substring(0, str.length - 1)
} }
}) })
await getList()
} finally { } finally {
formRef.value.formLoading = false formRef.value.formLoading = false
} }

Loading…
Cancel
Save