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. 36
      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 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({ export const DeviceItemRules = reactive({
itemNumber: [required], itemNumber: [required],
@ -9,42 +12,24 @@ export const DeviceItemRules = reactive({
export const DeviceItem = useCrudSchemas(reactive<CrudSchema[]>([ export const DeviceItem = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '备件编号', label: '设备',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
},
{
label: '设备编号',
field: 'deviceNumber', field: 'deviceNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
api: () => deviceListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceListAll.find((account) => account.number == cellValue)?.name
},
}, },
{ {
label: '是否可用', label: '备件',
field: 'available', field: 'itemNumber',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom', sort: 'custom',
table: { isSearch: true,
width: 150 api: () => itemListAll,
}, formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
tableForm: { return itemListAll.find((account) => account.number == cellValue)?.name
type: 'Select',
inactiveValue: 'FALSE',
disabled: true
}, },
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
}, },
{ {
label: '操作', 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) // tableData.value.itemNumbers1 = value.map(item => item.itemNumber)
}, },
searchCondition: [{ searchCondition: [{
key: 'deviceNumber', key: 'number',
value: 'deviceNumber', value: 'deviceNumber',
message: '请选择设备模具编号!', message: '请选择设备模具编号!',
isMainValue: true isMainValue: true
@ -526,7 +526,7 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类 searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法 searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [{
key: 'deviceNumber', key: 'number',
value: 'deviceNumber', value: 'deviceNumber',
message: '请选择设备模具编号!', message: '请选择设备模具编号!',
isMainValue: true isMainValue: true

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

@ -42,7 +42,7 @@
:apiUpdate="DeviceInspectionMainApi.updateDeviceInspectionMain" :apiUpdate="DeviceInspectionMainApi.updateDeviceInspectionMain"
:apiCreate="DeviceInspectionMainApi.createDeviceInspectionMain" :apiCreate="DeviceInspectionMainApi.createDeviceInspectionMain"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="true" :isBusiness="false"
@onChange="onChange" @onChange="onChange"
:tableAllSchemas="DeviceInspectionDetail.allSchemas" :tableAllSchemas="DeviceInspectionDetail.allSchemas"
:tableFormRules="DeviceInspectionDetailRules" :tableFormRules="DeviceInspectionDetailRules"
@ -72,6 +72,7 @@
:isSearchTableItem="true" :isSearchTableItem="true"
:openFormCallBack="openFormCallBack" :openFormCallBack="openFormCallBack"
@detailOnChange="detailOnChange" @detailOnChange="detailOnChange"
:buttonControllFunction="buttonControllFunction"
/> />
<!-- 导入 --> <!-- 导入 -->
@ -188,7 +189,7 @@ const butttondata = (row) => {
return [ return [
// defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), // // defaultButtons.mainListEditBtn({hasPermi:'eam:deviceInspectionMain:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceInspectionMain:delete'}), // // 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.mainInspectionOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //
defaultButtons.finishOrderBtn({ 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) { if (response.list.length == 0) {
message.error(t('请先填写并完成检修明细内容!')) message.error(t('请先填写并完成检修明细内容!'))
} else { } else {
let unFinishedList = response.list.filters(item => { let unFinishedList = response.list.filter(item => {
return item.status == 0 return item.status == 1
}) })
if (unFinishedList != null && unFinishedList.length > 0) { if (unFinishedList != null && unFinishedList.length > 0) {
message.error(t('请先完成各检修明细内容!')) 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 () => { onMounted(async () => {
getList() getList()

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

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

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

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

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

@ -38,9 +38,9 @@
:detailAllSchemas="ItemApplyDetail.allSchemas" :detailAllSchemasRules="ItemApplyDetailRules" :detailAllSchemas="ItemApplyDetail.allSchemas" :detailAllSchemasRules="ItemApplyDetailRules"
:apiCreate="ItemApplyDetailApi.createItemApplyDetail" :apiUpdate="ItemApplyDetailApi.updateItemApplyDetail" :apiCreate="ItemApplyDetailApi.createItemApplyDetail" :apiUpdate="ItemApplyDetailApi.updateItemApplyDetail"
:apiPage="ItemApplyDetailApi.getItemApplyDetailPage" :apiDelete="ItemApplyDetailApi.deleteItemApplyDetail" :apiPage="ItemApplyDetailApi.getItemApplyDetailPage" :apiDelete="ItemApplyDetailApi.deleteItemApplyDetail"
@searchTableSuccessDetail="searchTableSuccessDetail" @detailSubmitForm='detailSubmitForm' @searchTableSuccessDetail="searchTableSuccessDetail" @detailSubmitForm='detailSubmitForm'
:isShowAddBtn="isShowAddBtn" :isShowAddBtn="isShowAddBtn"
:detailButtonIsShow="detailButtonIsShow" :detailButtonIsShow="detailButtonIsShow"
/> />
<!-- 导入 --> <!-- 导入 -->
@ -63,9 +63,9 @@
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
const isShowAddBtn = ref(true) const isShowAddBtn = ref(true)
const detailButtonIsShow = ref(false) const detailButtonIsShow = ref(false)
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(ItemApplyMain.allSchemas.tableColumns) const tableColumns = ref(ItemApplyMain.allSchemas.tableColumns)
@ -225,13 +225,13 @@
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => { const openDetail = (row : any, titleName : any, titleValue : any) => {
if(row.status!='0'){ if(row.status!='0'){
isShowAddBtn.value=false isShowAddBtn.value=false
detailButtonIsShow.value=true detailButtonIsShow.value=true
}else{ }else{
isShowAddBtn.value=true isShowAddBtn.value=true
detailButtonIsShow.value=false detailButtonIsShow.value=false
} }
detailRef.value.openDetail(row, titleName, titleValue, 'basicItemApplyMain') detailRef.value.openDetail(row, titleName, titleValue, 'basicItemApplyMain')
} }
@ -334,17 +334,19 @@
getList() // getList() //
} }
const detailSubmitForm = async (formType, data, getList, formRef, tableList) => { const detailSubmitForm = async (formType, data, getList, formRef, tableList) => {
try { if (formType === 'create') { try {
if (formType === 'create') {
await ItemApplyDetailApi.createItemApplyDetail(data) await ItemApplyDetailApi.createItemApplyDetail(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
formRef.dialogVisible = false formRef.dialogVisible = false
formRef.getList await formRef.getList
} else { } else {
await ItemApplyDetailApi.updateItemApplyDetail(data) await ItemApplyDetailApi.updateItemApplyDetail(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
formRef.dialogVisible = false formRef.dialogVisible = false
formRef.getList formRef.getList
} }catch { }
}catch {
} finally { } finally {
formRef.formLoading = false formRef.formLoading = false
} }
@ -356,4 +358,4 @@
getList() getList()
importTemplateData.templateUrl = await ItemApplyMainApi.importTemplate() importTemplateData.templateUrl = await ItemApplyMainApi.importTemplate()
}) })
</script> </script>

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

@ -42,7 +42,7 @@
:apiUpdate="MoldInspectionMainApi.updateMoldInspectionMain" :apiUpdate="MoldInspectionMainApi.updateMoldInspectionMain"
:apiCreate="MoldInspectionMainApi.createMoldInspectionMain" :apiCreate="MoldInspectionMainApi.createMoldInspectionMain"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="true" :isBusiness="false"
@onChange="onChange" @onChange="onChange"
:tableAllSchemas="MoldInspectionDetail.allSchemas" :tableAllSchemas="MoldInspectionDetail.allSchemas"
:tableFormRules="MoldInspectionDetailRules" :tableFormRules="MoldInspectionDetailRules"
@ -72,6 +72,7 @@
:isSearchTableItem="true" :isSearchTableItem="true"
:openFormCallBack="openFormCallBack" :openFormCallBack="openFormCallBack"
@detailOnChange="detailOnChange" @detailOnChange="detailOnChange"
:buttonControllFunction="buttonControllFunction"
/> />
<!-- 导入 --> <!-- 导入 -->
@ -88,6 +89,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { selectAllFactoryArea } from '@/api/system/dept' import { selectAllFactoryArea } from '@/api/system/dept'
import * as UserApi from '@/api/system/user' 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 TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue' // import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
@ -184,7 +187,7 @@ const butttondata = (row) => {
return [ return [
// defaultButtons.mainListEditBtn({hasPermi:'eam:moldInspectionMain:update'}), // // defaultButtons.mainListEditBtn({hasPermi:'eam:moldInspectionMain:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:moldInspectionMain:delete'}), // // 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.mainInspectionOrderBtn({ hide: !(row.status == 'PROCCED' && (userStore.getUser.id == row.maintenance)) }), //
defaultButtons.finishOrderBtn({ 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) { 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) => { const onChange = (field, cur, item) => {
@ -495,6 +523,27 @@ const openFormCallBack = (type, row, masterParmas, callback) => {
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 () => { onMounted(async () => {
getList() 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) // tableData.value.itemNumbers1 = value.map(item => item.itemNumber)
}, },
searchCondition: [{ searchCondition: [{
key: 'deviceNumber', key: 'number',
value: 'deviceNumber', value: 'deviceNumber',
message: '请选择设备模具编号!', message: '请选择设备模具编号!',
isMainValue: true isMainValue: true
@ -523,7 +523,7 @@ export const MoldInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类 searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法 searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [{
key: 'deviceNumber', key: 'number',
value: 'deviceNumber', value: 'deviceNumber',
message: '请选择设备模具编号!', message: '请选择设备模具编号!',
isMainValue: true 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) // tableData.value.itemNumbers1 = value.map(item => item.itemNumber)
}, },
searchCondition: [{ searchCondition: [{
key: 'deviceNumber', key: 'number',
value: 'deviceNumber', value: 'deviceNumber',
message: '请选择设备模具编号!', message: '请选择设备模具编号!',
isMainValue: true isMainValue: true
@ -458,7 +458,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类 searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法 searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [{
key: 'deviceNumber', key: 'number',
value: 'deviceNumber', value: 'deviceNumber',
message: '请选择设备模具编号!', message: '请选择设备模具编号!',
isMainValue: true isMainValue: true

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

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

Loading…
Cancel
Save