Browse Source

BUG修改

master
yejiaxing 10 months ago
parent
commit
34b95fed86
  1. 52
      src/api/eam/basic/item/index.ts
  2. 3
      src/api/eam/basic/rel/index.ts
  3. 4
      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. 63
      src/views/eam/basic/item/index.vue
  8. 14
      src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts

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

@ -1,32 +1,32 @@
import request from '@/config/axios' import request from '@/config/axios'
export interface ItemVO { export interface ItemVO {
number: string number : string
name: string name : string
brand: string brand : string
specifications: string specifications : string
isConstant: string isConstant : string
subject: string subject : string
classification: string classification : string
uom: string uom : string
singlePrice: number singlePrice : number
reprocurement: number reprocurement : number
safetyStock: number safetyStock : number
cost: string cost : string
purchaser: string purchaser : string
financer: string financer : string
isFramework: string isFramework : string
isRadeIn: string isRadeIn : string
siteId: string siteId : string
available: string available : string
concurrencyStamp: number concurrencyStamp : number
} }
// 查询备件列表 // 查询备件列表
export const getItemPage = async (params) => { export const getItemPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = { ...params }
return await request.post({ url: '/eam/item/senior', data }) return await request.post({ url: '/eam/item/senior', data })
} else { } else {
return await request.get({ url: `/eam/item/page`, params }) return await request.get({ url: `/eam/item/page`, params })
@ -34,27 +34,27 @@ export const getItemPage = async (params) => {
} }
// 生成标签 // 生成标签
export const genDevice = async (data: ItemVO) => { export const genDevice = async (data) => {
return await request.post({ url: `/eam/item/genDevice`,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 }) 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 }) 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 }) 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 }) return await request.delete({ url: `/eam/item/delete?id=` + id })
} }

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 }) return await request.download({ url: `/rel/device-item/export-excel`, params })
} }
// 新增设备备件关系
// 新增设备备件关系 // 新增设备备件关系
export const createDeviceItemBatch = async (data: Array<DeviceItemVO>) => { 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 });
}; };

4
src/utils/dict.ts

@ -282,5 +282,7 @@ export enum DICT_TYPE {
CLASS_TYPE = 'class_type', // 班组类型 CLASS_TYPE = 'class_type', // 班组类型
INVENTORY_ACTION = 'inventory_action', //库存动作 INVENTORY_ACTION = 'inventory_action', //库存动作
MAINTENANCE_TYPE = 'maintenance_type', //保养类型 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) { export function backoutBtn(option:any) {
return __defaultBtnOption(option,{ 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[]>([ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '保养项名称', label: '保养内容',
field: 'name', field: 'name',
sort: 'custom', sort: 'custom',
isSearch: true, 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: '是否可用', label: '是否可用',
field: 'available', 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[]>([ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '保养项名称', label: '保养内容',
field: 'name', field: 'name',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
@ -49,7 +49,7 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.DEVICE_MOLD_TYPE, dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string', dictClass: 'string',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
component: 'Select' component: 'Select'
}, },
@ -58,7 +58,7 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
label: '设备/模具编号', label: '设备/模具编号',
field: 'deviceNumber', field: 'deviceNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
@ -88,7 +88,7 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.DEVICEMOLDITEMS_STATUS, dictType: DICT_TYPE.DEVICEMOLDITEMS_STATUS,
dictClass: 'string', dictClass: 'string',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
component: 'Select', component: 'Select',
value: 'INSPECTION', value: 'INSPECTION',
@ -97,12 +97,20 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
}, },
{
label: '设备部位',
field: 'equipmentParts',
sort: 'custom',
isSearch: true,
},
{ {
label: '是否可用', label: '是否可用',
field: 'available', field: 'available',
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: false,
isTable: true, isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {

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

@ -30,18 +30,18 @@
:apiUpdate="ItemApi.updateItem" :apiCreate="ItemApi.createItem" @searchTableSuccess="searchTableSuccess" :apiUpdate="ItemApi.updateItem" :apiCreate="ItemApi.createItem" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" /> :isBusiness="false" />
<SearchTable ref="searchTableRef" @searchTableSuccess="submitItem" />
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Item.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="Item.allSchemas" />
<!-- 选择设备 -->
<SearchTable ref="searchTableRef" @success="formsSuccess" :formAllSchemas="Item.allSchemas"
@searchTableSuccess="searchTableSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { Item, ItemRules } from './item.data' import { Item, ItemRules } from './item.data'
import * as ItemApi from '@/api/eam/basic/item' 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 { DeviceAccounts, DeviceAccountsRules } from '@/views/eam/device/deviceAccounts/deviceAccounts.data'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -54,34 +54,19 @@
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const itemNumber = ref();
const tableColumns = ref(Item.allSchemas.tableColumns) const tableColumns = ref(Item.allSchemas.tableColumns)
const paramNumber = ref([])
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
// console.log(formField); nextTick(() => {
// console.log(val); const setV = {}
let dataResult = []; setV[formField] = val[0][searchField]
let param = []; formRef.setValues(setV)
val.forEach((element) => {
dataResult.push(element.number);
}) })
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 = [ const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), // // defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultExportBtn(null), // defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
] ]
// //
@ -131,7 +107,7 @@
// - // -
const butttondata = [ const butttondata = [
defaultButtons.mainListEditBtn(null), // defaultButtons.mainListEditBtn(null), //
defaultButtons.selectDeviceBtn(null), // defaultButtons.chooseDeviceBtn(null),//
defaultButtons.mainListDeleteBtn(null), // defaultButtons.mainListDeleteBtn(null), //
] ]
@ -139,21 +115,30 @@
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'selectDevice') { // } else if (val == 'chooseDevice') {
selectDevice(row) openItem(row.number)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) 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 searchTableRef = ref()
const selectDevice = (row) => { const openItem = (number : String) => {
searchTableRef.value.open('设备列表11', DeviceAccounts.allSchemas, DeviceAccountsApi.getDeviceAccountsPage, row.number, '', true, '', ''); itemNumber.value = number;
// ItemApi.createItem(row) 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 basicFormRef = ref()
const openForm = (type : string, row ?: any) => { const openForm = (type : string, row ?: any) => {

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

Loading…
Cancel
Save