Browse Source

BUG修改

master
yejiaxing 10 months ago
parent
commit
34b95fed86
  1. 54
      src/api/eam/basic/item/index.ts
  2. 3
      src/api/eam/basic/rel/index.ts
  3. 6
      src/utils/dict.ts
  4. 13
      src/utils/disposition/defaultButtons.ts
  5. 13
      src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts
  6. 18
      src/views/eam/basic/inspection/deviceMoldItems.data.ts
  7. 65
      src/views/eam/basic/item/index.vue
  8. 14
      src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts

54
src/api/eam/basic/item/index.ts

@ -1,32 +1,32 @@
import request from '@/config/axios'
export interface ItemVO {
number: string
name: string
brand: string
specifications: string
isConstant: string
subject: string
classification: string
uom: string
singlePrice: number
reprocurement: number
safetyStock: number
cost: string
purchaser: string
financer: string
isFramework: string
isRadeIn: string
siteId: string
available: string
concurrencyStamp: number
number : string
name : string
brand : string
specifications : string
isConstant : string
subject : string
classification : string
uom : string
singlePrice : number
reprocurement : number
safetyStock : number
cost : string
purchaser : string
financer : string
isFramework : string
isRadeIn : string
siteId : string
available : string
concurrencyStamp : number
}
// 查询备件列表
export const getItemPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
const data = { ...params }
return await request.post({ url: '/eam/item/senior', data })
} else {
return await request.get({ url: `/eam/item/page`, params })
@ -34,31 +34,31 @@ export const getItemPage = async (params) => {
}
// 生成标签
export const genDevice = async (data: ItemVO) => {
return await request.post({ url: `/eam/item/genDevice`,data})
export const genDevice = async (data) => {
return await request.post({ url: `/eam/item/genDevice`, data })
}
// 查询备件详情
export const getItem = async (id: number) => {
export const getItem = async (id : number) => {
return await request.get({ url: `/eam/item/get?id=` + id })
}
// 新增备件
export const createItem = async (data: ItemVO) => {
export const createItem = async (data : ItemVO) => {
return await request.post({ url: `/eam/item/create`, data })
}
// 修改备件
export const updateItem = async (data: ItemVO) => {
export const updateItem = async (data : ItemVO) => {
return await request.put({ url: `/eam/item/update`, data })
}
// 删除备件
export const deleteItem = async (id: number) => {
export const deleteItem = async (id : number) => {
return await request.delete({ url: `/eam/item/delete?id=` + id })
}
// 导出备件 Excel
export const exportItem = async (params) => {
return await request.download({ url: `/eam/item/export-excel`, params })
}
}

3
src/api/eam/basic/rel/index.ts

@ -44,8 +44,7 @@ export const exportDeviceItem = async (params) => {
return await request.download({ url: `/rel/device-item/export-excel`, params })
}
// 新增设备备件关系
// 新增设备备件关系
export const createDeviceItemBatch = async (data: Array<DeviceItemVO>) => {
return await request.post({url: `/rel/device-item/createBatch`, data });
return await request.post({url: `/rel/device-item/createBatch `, data });
};

6
src/utils/dict.ts

@ -282,5 +282,7 @@ export enum DICT_TYPE {
CLASS_TYPE = 'class_type', // 班组类型
INVENTORY_ACTION = 'inventory_action', //库存动作
MAINTENANCE_TYPE = 'maintenance_type', //保养类型
JX_STATUS = 'JX_STATUS', //检修状态
}
JX_STATUS = 'JX_STATUS', //检修状态,
EXECUTION_CYCLE = 'execution_cycle', //模具保养周期
MOLD_EXECUTION_CYCLE = 'mold_execution_cycle', //模具保养周期
}

13
src/utils/disposition/defaultButtons.ts

@ -775,6 +775,19 @@ export function selectItemBtn(option:any) {
})
}
// 主列表-备件选设备
export function chooseDeviceBtn(option:any) {
return __defaultBtnOption(option,{
label: '选择设备',
name: 'chooseDevice',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-撤销
export function backoutBtn(option:any) {
return __defaultBtnOption(option,{

13
src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts

@ -37,7 +37,7 @@ export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([
export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '保养项名称',
label: '保养内容',
field: 'name',
sort: 'custom',
isSearch: true,
@ -114,6 +114,17 @@ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
}
},
},
{
label: '保养类型',
field: 'executionCycle',
dictType: DICT_TYPE.EXECUTION_CYCLE,
dictClass: 'string',
sort: 'custom',
isSearch: false,
form: {
component: 'Select'
},
},
{
label: '是否可用',
field: 'available',

18
src/views/eam/basic/inspection/deviceMoldItems.data.ts

@ -37,7 +37,7 @@ export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([
export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '保养项名称',
label: '保养内容',
field: 'name',
sort: 'custom',
isSearch: true,
@ -49,7 +49,7 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: true,
isSearch: false,
form: {
component: 'Select'
},
@ -58,7 +58,7 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
label: '设备/模具编号',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
isSearch: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
@ -88,7 +88,7 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.DEVICEMOLDITEMS_STATUS,
dictClass: 'string',
sort: 'custom',
isSearch: true,
isSearch: false,
form: {
component: 'Select',
value: 'INSPECTION',
@ -97,12 +97,20 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
}
},
},
{
label: '设备部位',
field: 'equipmentParts',
sort: 'custom',
isSearch: true,
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isSearch: false,
isTable: true,
sort: 'custom',
table: {

65
src/views/eam/basic/item/index.vue

@ -30,18 +30,18 @@
:apiUpdate="ItemApi.updateItem" :apiCreate="ItemApi.createItem" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" />
<SearchTable ref="searchTableRef" @searchTableSuccess="submitItem" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Item.allSchemas" />
<!-- 选择设备 -->
<SearchTable ref="searchTableRef" @success="formsSuccess" :formAllSchemas="Item.allSchemas"
@searchTableSuccess="searchTableSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Item, ItemRules } from './item.data'
import * as ItemApi from '@/api/eam/basic/item'
import { createDeviceItemBatch, getDeviceItemPage } from '@/api/eam/basic/rel'
import { DeviceAccounts, DeviceAccountsRules } from '@/views/eam/device/deviceAccounts/deviceAccounts.data'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -54,34 +54,19 @@
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const itemNumber = ref();
const tableColumns = ref(Item.allSchemas.tableColumns)
const paramNumber = ref([])
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
// console.log(formField);
// console.log(val);
let dataResult = [];
let param = [];
val.forEach((element) => {
dataResult.push(element.number);
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
paramNumber.value.push(formField, dataResult);
ItemApi.genDevice(paramNumber.value);
message.success(t('common.delSuccess '))
//
getList()
// nextTick(() => {
// const setV = {}
// setV[formField] = val[0][searchField]
// formRef.setValues(setV)
// })
}
//
@ -100,18 +85,9 @@
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
@ -131,7 +107,7 @@
// -
const butttondata = [
defaultButtons.mainListEditBtn(null), //
defaultButtons.selectDeviceBtn(null), //
defaultButtons.chooseDeviceBtn(null),//
defaultButtons.mainListDeleteBtn(null), //
]
@ -139,21 +115,30 @@
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'selectDevice') { //
selectDevice(row)
} else if (val == 'chooseDevice') {
openItem(row.number)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加设备操作 */
// (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any,multiple: any, type: any, row: any, searchCondition:any , isCountRequestRe:any )
const searchTableRef = ref()
const selectDevice = (row) => {
searchTableRef.value.open('设备列表11', DeviceAccounts.allSchemas, DeviceAccountsApi.getDeviceAccountsPage, row.number, '', true, '', '');
// ItemApi.createItem(row)
const openItem = (number : String) => {
itemNumber.value = number;
searchTableRef.value.open('设备列表', DeviceAccounts.allSchemas, DeviceAccountsApi.getDeviceAccountsPage, null, Item.allSchemas.searchSchema, true, null, null, null, null);
}
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map(element => ({
itemNumber: itemNumber.value,
deviceNumber: element.number,
}));
createDeviceItemBatch(deviceItemRelList).then(res => {
message.success(t('common.createSuccess'))
})
};
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {
@ -232,4 +217,4 @@
onMounted(async () => {
getList()
})
</script>
</script>

14
src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts

@ -37,7 +37,7 @@ export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([
export const MoldMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '保养项名称',
label: '保养内容',
field: 'name',
sort: 'custom',
isSearch: true,
@ -110,6 +110,18 @@ export const MoldMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
component: 'Select'
},
},
{
label: '保养周期',
field: 'executionCycle',
dictType: DICT_TYPE.MOLD_EXECUTION_CYCLE,
dictClass: 'string',
sort: 'custom',
isSearch: false,
form: {
component: 'Select'
},
},
{
label: '是否可用',
field: 'available',

Loading…
Cancel
Save