@@ -49,15 +38,15 @@ const searchDialogVisible = ref(false) // 弹窗的是否展示
const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
-// 列表头部按钮
-const HeadButttondata = [
- defaultButtons.defaultFilterBtn(null), // 筛选
-]
/** 打开弹窗 */
const getListRef = ref()
const setSearchParamsRef = ref()
-const tableObjectRef = ref()
+const tableObjectRef = ref({
+ tableList:'',
+ loading:false,
+ params:{}
+})
const getPage:any = ref()
const searchSchema = ref()
const tableColumns = ref()
@@ -72,6 +61,7 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s
searchDialogVisible.value = true
formFieldRef.value = formField
searchFieldRef.value = searchField
+
allSchemasRef.value = allSchemas
searchSchema.value = allSchemas.searchSchema
tableColumns.value = allSchemas.tableColumns.filter(item => (item.field !== 'action'))
@@ -79,53 +69,20 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s
typeRef.value = type
rowRef.value = row
multipleBol.value = multiple
- // dialogTitle.value = t('action.' + type)
dialogTitle.value = titleName
- const {tableObject, tableMethods } = useTable({
- getListApi: getPage.value // 分页接口
+ const getList = async () => {
+ await getPage.value().then((res)=>{
+ tableObjectRef.value.tableList = res
})
- tableObjectRef.value = tableObject
searchConditionRef.value = searchCondition
if (searchCondition) tableObjectRef.value.params = searchCondition;
+ }
+ console.log(tableObjectRef.value)
- // 获得表格的各种操作
- const { getList } = tableMethods
- // setSearchParamsRef.value = setSearchParams
- setSearchParamsRef.value = tableObject.params
- getListRef.value = getList
getList()
}
-// 筛选提交
-const searchFormClick = (searchData) => {
- // console.log(99, rowRef.value)
- // console.log(100, searchData)
- // console.log(101, searchConditionRef.value)
- // 20240104 修改 判断 当前弹窗 是否有条件 如果有条件 需拼接到 筛选中 searchData.filters
- if (searchConditionRef.value) {
- Object.keys(searchConditionRef.value).forEach(key => {
- if (searchData.filters) {
- searchData.filters.push({
- action: "==",
- column: key,
- value: searchConditionRef.value[key]
- })
- // }
- } else {
- searchData.filters = [{
- action: "==",
- column: key,
- value: searchConditionRef.value[key]
- }]
- }
- });
- }
- tableObjectRef.value.params = {
- isSearch: true,
- filters: searchData.filters
- }
- getListRef.value() // 刷新当前列表
-}
+
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
@@ -153,9 +110,15 @@ const submitForm = async () => {
return
}
}
-
+ let isQtyNone = selections.filter(item=>!item.qty)
+ if(isQtyNone&&isQtyNone.length>0){
+ message.warning('请填写数量')
+ formLoading.value = false
+ return
+ }
try {
searchDialogVisible.value = false
+ console.log(selections)
// 发送操作成功的事件
emit('searchTableSuccess', formFieldRef.value, searchFieldRef.value, selections, typeRef.value, rowRef.value)
} finally {
diff --git a/src/components/TableForm/src/TableForm.vue b/src/components/TableForm/src/TableForm.vue
index 7a37be9..7f22412 100644
--- a/src/components/TableForm/src/TableForm.vue
+++ b/src/components/TableForm/src/TableForm.vue
@@ -115,8 +115,8 @@
@change="formSelectChange(headerItem.field, $event,row)">
@@ -347,10 +347,17 @@ const emit = defineEmits([
])
// 获取下拉列表 | type = radio | type = select
const initSelectOptions = (item) => {
+ // if(!item.dictType ){
+ // console.log( item.tableForm.initOptions)
+ // item.tableForm.initOptions.for
+ // }
return item.dictType ? getStrDictOptions(item.dictType) : item.tableForm.initOptions
}
//普通下拉改变事件
const formSelectChange = (field, val,row) => {
+ console.log(field)
+ console.log(val)
+ console.log(row)
emit('formSelectChange', field, val,row)
}
diff --git a/src/utils/dict.ts b/src/utils/dict.ts
index 60b2fe4..1da1f92 100644
--- a/src/utils/dict.ts
+++ b/src/utils/dict.ts
@@ -276,6 +276,7 @@ export enum DICT_TYPE {
DEVICE_MOLD_TYPE = 'device_mold_type', // 设备/模具类型
TRANSACTION_TYPE = 'transaction_Type', // 事务类型
RESULT = 'result', // 维修结果
+ MAINTENANCE_SHIFT = 'maintenance_shift',//班次
FAULT_TYPE = 'fault_type',//故障类型
WEI_XIU_ORDER_STATUS = 'wei_xiu_order_status',//维修单状态
BASIC_STATUS = 'basic_status',//设备模具状态
diff --git a/src/utils/disposition/tabsList.ts b/src/utils/disposition/tabsList.ts
index 96c2fa0..a7f0bf1 100644
--- a/src/utils/disposition/tabsList.ts
+++ b/src/utils/disposition/tabsList.ts
@@ -1,40 +1,31 @@
// 页面tabs标签
export const ItemBasicTabsList = [{
- label: "供应商物品",
- prop: 'SupplierItems',
+ label: "设备信息",
+ prop: 'info',
},
{
- label: "客户物品",
- prop: 'CustomerItems',
+ label: "设备图片",
+ prop: 'Image',
},
{
- label: "采购订单",
- prop: 'PurchaseOrder',
+ label: "关联文档",
+ prop: 'Word',
},
{
- label: "要货计划",
- prop: 'PurchasingPlan',
+ label: "关联备件",
+ prop: 'Part',
},
{
- label: "库存余额",
- prop: 'InventoryBalance',
+ label: "报修记录",
+ prop: 'deviceReportRecord',
},
{
- label: "预计入库存",
- prop: 'ExpectedIn',
+ label: "维修记录",
+ prop: 'RepairRecord',
},{
- label: "预计出库存",
- prop: 'ExpectedOut',
+ label: "保养记录",
+ prop: 'MaintenanceRecord',
},
]
-export const PurchasereceiptRequestTabsList = [{
- label: "收货明细",
- prop: 'receiptDetail',
- },
- {
- label: "缺货明细",
- prop: 'scarceGoodsDetail',
- }
-]
diff --git a/src/views/eam/basic/item/item.data.ts b/src/views/eam/basic/item/item.data.ts
index dd78d93..a8b1839 100644
--- a/src/views/eam/basic/item/item.data.ts
+++ b/src/views/eam/basic/item/item.data.ts
@@ -186,3 +186,29 @@ export const Item = useCrudSchemas(reactive
([
}
}
]))
+
+export const ItemSearchTable = useCrudSchemas(reactive([
+ {
+ label: '备件编号',
+ field: 'number',
+ sort: 'custom',
+ isSearch: true,
+ isForm: false,
+ table: {
+ fixed: 'left'
+ },
+ },
+ {
+ label: '备件名称',
+ field: 'name',
+ sort: 'custom',
+ isSearch: true,
+ table: {
+ },
+ },
+ {
+ label: '数量',
+ field: 'qty',
+ sort: 'custom',
+ }
+]))
diff --git a/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts b/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts
index f00de59..9715c1b 100644
--- a/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts
+++ b/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts
@@ -57,6 +57,9 @@ export const DeviceAccounts = useCrudSchemas(reactive([
type: 'datetime',
valueFormat: 'x'
}
+ },
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
}
},
{
diff --git a/src/views/eam/device/deviceAccounts/index.vue b/src/views/eam/device/deviceAccounts/index.vue
index 9a95ced..dc1958e 100644
--- a/src/views/eam/device/deviceAccounts/index.vue
+++ b/src/views/eam/device/deviceAccounts/index.vue
@@ -27,9 +27,9 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
-
-
- {{ row.code }}
+
+
+ {{ row.number }}
@@ -57,7 +57,18 @@
/>
-
+
+
@@ -70,6 +81,7 @@ import { Item } from '@/views/eam/basic/item/item.data'
import { createDeviceItemBatch,getDeviceItemPage } from '@/api/eam/basic/rel'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
+import { ItemBasicTabsList } from '@/utils/disposition/tabsList'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
diff --git a/src/views/eam/device/deviceMaintenanceMain/deviceMaintenanceMain.data.ts b/src/views/eam/device/deviceMaintenanceMain/deviceMaintenanceMain.data.ts
index 428b97f..66dcc76 100644
--- a/src/views/eam/device/deviceMaintenanceMain/deviceMaintenanceMain.data.ts
+++ b/src/views/eam/device/deviceMaintenanceMain/deviceMaintenanceMain.data.ts
@@ -3,6 +3,8 @@ import { selectAllFactoryArea } from '@/api/system/dept'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import { useUserStore } from '@/store/modules/user'
import { selecUserByType } from '@/api/system/dept'
+import { ItemSearchTable } from '../../basic/item/item.data'
+import * as ItemApi from '@/api/eam/basic/item'
const userStore = useUserStore()
const factoryList = await selectAllFactoryArea()
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({})
@@ -14,10 +16,10 @@ export const DeviceMaintenanceMainRules = reactive({
deviceNumber: [required],
factoryAreaNumber: [required],
maintenance: [required],
- status: [required],
type: [required],
- siteId: [required],
- concurrencyStamp: [required],
+ classes: [required],
+ faultType: [required],
+ describes : [required],
})
export const DeviceMaintenanceMain = useCrudSchemas(reactive([
@@ -84,9 +86,6 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([
width: '150',
},
api: () => factoryList,
- formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
- return factoryList.find((account) => account.id == cellValue)?.name
- },
search: {
show: true,
component: 'Select',
@@ -118,21 +117,6 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([
table: {
width: '150',
},
- api: () => userList,
- formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
- return userList.find((account) => account.id == cellValue)?.name
- },
- search: {
- show: true,
- component: 'Select',
- api: () => userList,
- componentProps: {
- optionsAlias: {
- labelField: 'name',
- valueField: 'id'
- }
- }
- },
form: {
component: 'Select',
api: () => userList,
@@ -146,42 +130,50 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([
},
}
},
- // {
- // label: '报修人联系电话',
- // field: 'maintenancePhone',
- // sort: 'custom',
- // },
{
- label: '状态',
- field: 'status',
+ label: '类型设备',
+ field: 'type',
sort: 'custom',
table: {
width: '150',
},
isSearch: true,
- isForm: false,
- dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
+ isForm: true,
+ dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
+ form: {
+ component: 'Select',
+ componentProps: {
+ disabled: true,
+ }
+ },
+ },
+ {
+ label: '班次',
+ field: 'classes',
+ sort: 'custom',
+ table: {
+ width: '150',
+ },
+ isSearch: true,
+ dictType: DICT_TYPE.MAINTENANCE_SHIFT,
+ dictClass: 'number',
form: {
component: 'Select'
},
},
{
- label: '类型设备',
- field: 'type',
+ label: '故障类型',
+ field: 'faultType',
sort: 'custom',
table: {
width: '150',
},
isSearch: true,
- isForm: true,
- dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
+ dictType: DICT_TYPE.FAULT_TYPE,
dictClass: 'string',
form: {
- component: 'Select',
- componentProps: {
- disabled: true,
- }
+ component: 'Select'
},
},
{
@@ -196,26 +188,6 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([
},
},
- // {
- // label: '地点ID',
- // field: 'siteId',
- // sort: 'custom',
- // },
- // {
- // label: '是否可用',
- // field: 'available',
- // sort: 'custom',
- // dictType: DICT_TYPE.TRUE_FALSE,
- // dictClass: 'string',
- // form: {
- // component: 'Switch',
- // value: 'TRUE',
- // componentProps: {
- // inactiveValue: 'FALSE',
- // activeValue: 'TRUE'
- // }
- // },
- // },
{
label: '操作',
field: 'action',
@@ -223,6 +195,110 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([
table: {
width: 300,
fixed: 'right'
- }
+ },
+ isDetail:false
}
]))
+export const DeviceMaintenanceDetail = useCrudSchemas(reactive([
+ {
+ label: '故障描述',
+ field: 'describes',
+ sort: 'custom',
+ table: {
+ width: '150',
+ },
+ isForm: false,
+ isSearch: false,
+ isTable: false,
+ },
+ {
+ label: '故障真因',
+ field: 'describes1',
+ sort: 'custom',
+ table: {
+ width: '150',
+ },
+ isForm: false,
+ isSearch: false,
+ isTable: false,
+ },
+ {
+ label: '解决措施',
+ field: 'workOut',
+ sort: 'custom',
+ table: {
+ width: '150',
+ },
+ isForm: false,
+ isSearch: false,
+ isTable: false,
+ },
+ {
+ label: '维修人',
+ field: 'maintenances',
+ sort: 'custom',
+ table: {
+ width: '150',
+ },
+ api: () => userList,
+ formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
+ return userList.find((account) => account.id == cellValue)?.name
+ },
+ search: {
+ show: true,
+ component: 'Select',
+ api: () => userList,
+ componentProps: {
+ optionsAlias: {
+ labelField: 'name',
+ valueField: 'id'
+ }
+ }
+ },
+ tableForm: {
+ type: 'Select',
+ initOptions: userList,
+ multiple:true,
+ collapseTags:true,
+ collapseTagsTooltip:true,
+ optionsAlias: {
+ labelField: 'name',
+ valueField: 'id'
+ }
+ }
+ },
+ {
+ label: '备件',
+ field: 'itemNUmbers',
+ sort: 'custom',
+ table: {
+ width: '150',
+ },
+ tableForm:{
+ isInpuFocusShow: true, // 开启查询弹窗
+ searchListPlaceholder: '请选择备件',
+ searchField: 'itemNUmbers',
+ searchTitle: '备件',
+ multiple:true,
+ searchAllSchemas: ItemSearchTable.allSchemas,
+ searchPage: ItemApi.getItemList,
+ searchCondition: [{
+ key: 'deviceNumber',
+ value: 'deviceNumber',
+ message: '请选择设备模具编号!',
+ isMainValue: true
+ }]
+ },
+ isForm: false,
+ isSearch: false,
+ isTable: false,
+ },
+]))
+// 表单校验
+export const DeviceMaintenanceDetailRules = reactive({
+ describes: [required],
+ describes1: [required],
+ workOut: [required],
+ maintenance: [required],
+ itemNUmbers: [required],
+})
\ No newline at end of file
diff --git a/src/views/eam/device/deviceMaintenanceMain/index.vue b/src/views/eam/device/deviceMaintenanceMain/index.vue
index 5716d26..6ed691b 100644
--- a/src/views/eam/device/deviceMaintenanceMain/index.vue
+++ b/src/views/eam/device/deviceMaintenanceMain/index.vue
@@ -1,78 +1,168 @@
-
+
-
+
-
-
-
- {{ row.code }}
+
+
+
+ {{ row.number }}
-
+
-
+
-
+
+
-
+