Browse Source

测试bug修复,冲突解决

master
ljlong_2630 8 months ago
parent
commit
35ae46d6ec
  1. 45
      src/views/eam/basic/deviceItem/deviceItem.data.ts
  2. 4
      src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts
  3. 30
      src/views/eam/device/deviceinspectionjob/index.vue
  4. 4
      src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts
  5. 4
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  6. 8
      src/views/eam/item/itemApplyMain/index.vue
  7. 55
      src/views/eam/mold/moldinspectionjob/index.vue
  8. 4
      src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts
  9. 4
      src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts
  10. 4
      src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

45
src/views/eam/basic/deviceItem/deviceItem.data.ts

@ -1,5 +1,8 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import * as ItemApi from '@/api/eam/basic/item'
const deviceListAll = await DeviceAccountsApi.getDeviceAccountsAllNoPage({})
const itemListAll = await ItemApi.getItemNoPage({})
// 表单校验
export const DeviceItemRules = reactive({
itemNumber: [required],
@ -9,42 +12,24 @@ export const DeviceItemRules = reactive({
export const DeviceItem = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
},
{
label: '设备编号',
label: '设备',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
api: () => deviceListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceListAll.find((account) => account.number == cellValue)?.name
},
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
label: '备件',
field: 'itemNumber',
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
inactiveValue: 'FALSE',
disabled: true
isSearch: true,
api: () => itemListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return itemListAll.find((account) => account.number == cellValue)?.name
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '操作',

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

@ -509,7 +509,7 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
// tableData.value.itemNumbers1 = value.map(item => item.itemNumber)
},
searchCondition: [{
key: 'deviceNumber',
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true
@ -526,7 +526,7 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'deviceNumber',
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true

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

@ -42,7 +42,7 @@
:apiUpdate="DeviceInspectionMainApi.updateDeviceInspectionMain"
:apiCreate="DeviceInspectionMainApi.createDeviceInspectionMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="true"
:isBusiness="false"
@onChange="onChange"
:tableAllSchemas="DeviceInspectionDetail.allSchemas"
:tableFormRules="DeviceInspectionDetailRules"
@ -72,6 +72,7 @@
:isSearchTableItem="true"
:openFormCallBack="openFormCallBack"
@detailOnChange="detailOnChange"
:buttonControllFunction="buttonControllFunction"
/>
<!-- 导入 -->
@ -188,7 +189,7 @@ const butttondata = (row) => {
return [
// defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain:delete'}), //
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED')}), //
defaultButtons.mainInspectionOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //
defaultButtons.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //
]
@ -322,8 +323,8 @@ function handleFinishOrder(row) {
if (response.list.length == 0) {
message.error(t('请先填写并完成检修明细内容!'))
} else {
let unFinishedList = response.list.filters(item => {
return item.status == 0
let unFinishedList = response.list.filter(item => {
return item.status == 1
})
if (unFinishedList != null && unFinishedList.length > 0) {
message.error(t('请先完成各检修明细内容!'))
@ -534,6 +535,27 @@ const openFormCallBack = (type, row, masterParmas, callback) => {
}
function buttonControllFunction(row, val) {
if (val == 'delete') {
return false
} else if (val == 'edit') {
if (row.status == 'COMPLETED') {
return false
} else {
return true
}
} else if(val == 'add') {
if (row.status == 'COMPLETED') {
return false
} else {
return true
}
} else {
return true
}
}
/** 初始化 **/
onMounted(async () => {
getList()

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

@ -393,7 +393,7 @@ export const DeviceMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
console.log('value', value)
},
searchCondition: [{
key: 'deviceNumber',
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true
@ -409,7 +409,7 @@ export const DeviceMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'deviceNumber',
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true

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

@ -392,7 +392,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: ItemSearchTable.allSchemas,
searchPage: ItemApi.getItemList,
searchCondition: [{
key: 'deviceNumber',
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true
@ -409,7 +409,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'deviceNumber',
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true

8
src/views/eam/item/itemApplyMain/index.vue

@ -334,17 +334,19 @@
getList() //
}
const detailSubmitForm = async (formType, data, getList, formRef, tableList) => {
try { if (formType === 'create') {
try {
if (formType === 'create') {
await ItemApplyDetailApi.createItemApplyDetail(data)
message.success(t('common.createSuccess'))
formRef.dialogVisible = false
formRef.getList
await formRef.getList
} else {
await ItemApplyDetailApi.updateItemApplyDetail(data)
message.success(t('common.updateSuccess'))
formRef.dialogVisible = false
formRef.getList
} }catch {
}
}catch {
} finally {
formRef.formLoading = false
}

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

@ -42,7 +42,7 @@
:apiUpdate="MoldInspectionMainApi.updateMoldInspectionMain"
:apiCreate="MoldInspectionMainApi.createMoldInspectionMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="true"
:isBusiness="false"
@onChange="onChange"
:tableAllSchemas="MoldInspectionDetail.allSchemas"
:tableFormRules="MoldInspectionDetailRules"
@ -72,6 +72,7 @@
:isSearchTableItem="true"
:openFormCallBack="openFormCallBack"
@detailOnChange="detailOnChange"
:buttonControllFunction="buttonControllFunction"
/>
<!-- 导入 -->
@ -88,6 +89,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user'
import { selectAllFactoryArea } from '@/api/system/dept'
import * as UserApi from '@/api/system/user'
import * as DeviceInspectionDetailApi from '@/api/eam/device/deviceInspectionDetail'
import * as DeviceInspectionMainApi from '@/api/eam/device/deviceInspectionMain'
// import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
@ -184,7 +187,7 @@ const butttondata = (row) => {
return [
// defaultButtons.mainListEditBtn({hasPermi:'eam:moldInspectionMain:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldInspectionMain:delete'}), //
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED')}), //
defaultButtons.mainInspectionOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //
defaultButtons.finishOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //
]
@ -300,7 +303,32 @@ function handleMaintenanceOrder(row) {
}
function handleFinishOrder(row) {
let param = {
masterId : row.id
}
DeviceInspectionDetailApi.getDeviceInspectionDetailPage(param
).then(response => {
if (response != null) {
if (response.list.length == 0) {
message.error(t('请先填写并完成检修明细内容!'))
} else {
let unFinishedList = response.list.filter(item => {
return item.status == 1
})
if (unFinishedList != null && unFinishedList.length > 0) {
message.error(t('请先完成各检修明细内容!'))
return
} else {
DeviceInspectionMainApi.finishInspection(row.id).then(res => {
message.success(t('common.finishSuccess'))
getList()
})
}
}
} else {
message.error(t('common.finishFail'))
}
})
}
const onChange = (field, cur, item) => {
@ -495,6 +523,27 @@ const openFormCallBack = (type, row, masterParmas, callback) => {
callback()
}
function buttonControllFunction(row, val) {
if (val == 'delete') {
return false
} else if (val == 'edit') {
if (row.status == 'COMPLETED') {
return false
} else {
return true
}
} else if(val == 'add') {
if (row.status == 'COMPLETED') {
return false
} else {
return true
}
} else {
return true
}
}
/** 初始化 **/
onMounted(async () => {
getList()

4
src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts

@ -506,7 +506,7 @@ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
// tableData.value.itemNumbers1 = value.map(item => item.itemNumber)
},
searchCondition: [{
key: 'deviceNumber',
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true
@ -523,7 +523,7 @@ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'deviceNumber',
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true

4
src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts

@ -441,7 +441,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
// tableData.value.itemNumbers1 = value.map(item => item.itemNumber)
},
searchCondition: [{
key: 'deviceNumber',
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true
@ -458,7 +458,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'deviceNumber',
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true

4
src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

@ -330,7 +330,7 @@ export const MoldMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: ItemSearchTable.allSchemas,
searchPage: ItemApi.getItemList,
searchCondition: [{
key: 'deviceNumber',
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true
@ -347,7 +347,7 @@ export const MoldMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'deviceNumber',
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true

Loading…
Cancel
Save