Browse Source

模具检修工单,状态完成后,明细应不能编辑、删除,现能编辑

master
叶佳兴 2 weeks ago
parent
commit
cf0e20ad4b
  1. 11
      src/views/eam/mold/moldinspectionjob/index.vue
  2. 12
      src/views/eam/mold/moldmaintainjob/index.vue

11
src/views/eam/mold/moldinspectionjob/index.vue

@ -45,7 +45,7 @@
:isBusiness="true"
@onChange="onChange"
:isShowReduceButton="isShowReduceButton"
:tableAllSchemas="MoldInspectionAddDetail.allSchemas"
:tableAllSchemas="MoldInspectionDetailFilter.allSchemas"
:tableFormRules="MoldInspectionAddDetailRules"
:tableData="tableData"
@handleAddTable="handleAddTable"
@ -59,7 +59,7 @@
<Detail ref="detailRef"
:isBasic="false"
:allSchemas="MoldInspectionMain.allSchemas"
:detailAllSchemas="MoldInspectionDetail.allSchemas"
:detailAllSchemas="MoldInspectionDetailFilter.allSchemas"
:detailAllSchemasRules="MoldInspectionDetailRules"
:apiCreate="MoldInspectionDetailApi.createMoldInspectionDetail"
:apiUpdate="MoldInspectionDetailApi.updateMoldInspectionDetail"
@ -135,6 +135,7 @@ import {
MoldMaintenanceMainSecRules,
} from '../moldmaintenancejob/moldMaintenanceMain.data'
import {MoldAccountsVO} from "@/api/eam/mold/moldAccounts";
import { cloneDeep } from 'lodash-es'
// import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
@ -159,6 +160,7 @@ const verifyFormValue = 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 MoldInspectionDetailFilter = ref(cloneDeep(MoldInspectionDetail))
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
@ -361,6 +363,11 @@ const formsSuccess = async (formType, data) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = async (row: any, titleName: any, titleValue: any) => {
if(row.status == 'COMPLETED'){
MoldInspectionDetailFilter.value.allSchemas.tableColumns = MoldInspectionDetail.allSchemas.tableColumns.filter(item => item.field !== 'action');
}else{
MoldInspectionDetailFilter.value.allSchemas.tableColumns = MoldInspectionDetail.allSchemas.tableColumns;
}
const factoryList = await selectAllFactoryArea()
const userListAll = await UserApi.getSimpleUserList()
row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name

12
src/views/eam/mold/moldmaintainjob/index.vue

@ -50,7 +50,7 @@
ref="formRef"
:rules="MoldMaintainOrderMainRules"
:formAllSchemas="MoldMaintainOrderMain.allSchemas"
:tableAllSchemas="MoldMaintainOrderDetail.allSchemas"
:tableAllSchemas="MoldMaintainOrderDetailFilter.allSchemas"
:tableFormRules="MoldMaintainOrderDetailRules"
:tableData="tableData"
:apiUpdate="MoldMaintainOrderMainApi.updateMoldMaintainOrderMain"
@ -70,7 +70,7 @@
ref="detailRef"
:isBasic="false"
:allSchemas="MoldMaintainOrderMain.allSchemas"
:detailAllSchemas="MoldMaintainOrderDetail.allSchemas"
:detailAllSchemas="MoldMaintainOrderDetailFilter.allSchemas"
:detailAllSchemasRules="MoldMaintainOrderDetailRules"
:apiCreate="MoldMaintainOrderDetailApi.createMoldMaintainOrderDetail"
:apiUpdate="MoldMaintainOrderDetailApi.updateMoldMaintainOrderDetail"
@ -171,7 +171,7 @@ import * as UserApi from '@/api/system/user'
import { getAccessToken } from '@/utils/auth'
import * as uploadApi from '@/api/eam/upload'
import * as fileApi from '@/api/infra/file'
import { cloneDeep } from 'lodash-es'
defineOptions({ name: 'MoldMaintainOrderMain' })
const message = useMessage() //
@ -206,6 +206,7 @@ const src = ref(BASE_URL + '/jmreport/view/940395429096013824?token=' + getAcces
const updataTableColumns = (val) => {
tableColumns.value = val
}
const MoldMaintainOrderDetailFilter = ref(cloneDeep(MoldMaintainOrderDetail))
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
@ -381,6 +382,11 @@ const openForm = (type: string, row?: any) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = async (row: any, titleName: any, titleValue: any) => {
if(row.status == 'COMPLETED'){
MoldMaintainOrderDetailFilter.value.allSchemas.tableColumns = MoldMaintainOrderDetail.allSchemas.tableColumns.filter(item => item.field !== 'action');
}else{
MoldMaintainOrderDetailFilter.value.allSchemas.tableColumns = MoldMaintainOrderDetail.allSchemas.tableColumns;
}
const userListAll = await UserApi.getSimpleUserList()
row.maintenanceName = userListAll.find((account) => account.id == row.maintenance)?.nickname
const factoryList = await selectAllFactoryArea()

Loading…
Cancel
Save