ljlong_2630 8 months ago
parent
commit
820b6e17e8
  1. 27
      src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts
  2. 5
      src/views/eam/device/deviceSpotInspectionRecordMain/index.vue
  3. 3
      src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts
  4. 256
      src/views/eam/device/problemSolving/index.vue
  5. 6
      src/views/eam/item/itemApplyMain/itemApplyMain.data.ts
  6. 15
      src/views/eam/item/replaceItemDes/index.vue
  7. 5
      src/views/eam/item/replaceItemDes/replaceItemDes.data.ts
  8. 2
      src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts

27
src/views/eam/device/deviceSpotInspectionRecordMain/deviceSpotInspectionRecordMain.data.ts

@ -8,6 +8,7 @@ import { ItemSearchTable } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import * as UserApi from '@/api/system/user'
import { fa } from 'element-plus/es/locale'
// 邮箱账号的列表
const factoryList = await selectAllFactoryArea()
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({})
@ -16,6 +17,13 @@ const userListAll = await UserApi.getSimpleUserList()
const deviceListNoPage = await DeviceAccountsApi.getDeviceAccountsAllNoPage({})
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'DEVICE')
const deviceDeviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
const isConformList = [{
label:'是',
value:'TRUE'
},{
label:'否',
value:'FALSE'
}]
// 表单校验
export const DeviceSpotInspectionRecordMainRules = reactive({
deviceNumber: [required],
@ -81,6 +89,7 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
isDetail:false,
form: {
component: 'Select',
api: () => userList,
@ -93,6 +102,18 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
},
}
},
{
label: '维修人',
field: 'maintenanceName',
sort: 'custom',
table: {
width: '150',
},
isForm:false,
isDetail:true,
isSearch:false,
isTable:false
},
{
label: '状态',
field: 'status',
@ -140,6 +161,9 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
placeholder: "请选择设备"
}
},
detail:{
dictType:DICT_TYPE.APP_DEVICE_MOLD_TYPE
}
},
{
label: '描述',
@ -190,6 +214,9 @@ export const DeviceSpotInspectionRecordDetail = useCrudSchemas(reactive<CrudSche
table: {
width: 'auto',
},
formatter: (_: Recordable, __: TableColumn, cellValue: String) => {
return isConformList.find((account) => account.value == cellValue)?.label
},
},
{

5
src/views/eam/device/deviceSpotInspectionRecordMain/index.vue

@ -106,6 +106,7 @@ import * as DeviceSpotInspectionRecordMainApi from '@/api/eam/device/deviceSpotI
import * as DeviceSpotInspectionRecordDetailApi from '@/api/eam/device/deviceSpotInspectionRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user'
import * as UserApi from '@/api/system/user'
defineOptions({ name: 'DeviceSpotInspectionRecordMain' })
const message = useMessage() //
@ -286,7 +287,9 @@ const openForm = (type: string, row?: any) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
const openDetail =async (row: any, titleName: any, titleValue: any) => {
const userListAll = await UserApi.getSimpleUserList()
row.maintenanceName = userListAll.find((account) => account.id == row.maintenance)?.nickname
detailRef.value.openDetail(row, titleName, titleValue,'DeviceSpotInspectionRecordMain')
}

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

@ -186,10 +186,11 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
detail:{
dateFormat:'YYYY-MM-DD HH:mm:ss'
}
},
{
label: '完成时间',
field: 'finishedTime',
field: 'completionTime',
sort: 'custom',
isSearch: false,
table: {

256
src/views/eam/device/problemSolving/index.vue

@ -1,87 +1,114 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ProblemSolving.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="ProblemSolving.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="ProblemSolving.allSchemas" />
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ProblemSolving.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort">
<template #code="{row}">
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="ProblemSolvingRules"
:formAllSchemas="ProblemSolving.allSchemas" :apiUpdate="ProblemSolvingApi.updateProblemSolving"
:apiCreate="ProblemSolvingApi.createProblemSolving" @searchTableSuccess="searchTableSuccess" :isBusiness="false" />
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ProblemSolvingRules"
:formAllSchemas="ProblemSolving.allSchemas"
:apiUpdate="ProblemSolvingApi.updateProblemSolving"
:apiCreate="ProblemSolvingApi.createProblemSolving"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ProblemSolving.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/item-accounts/import" :importTemplateData="importTemplateData"
@success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/eam/item-accounts/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ProblemSolving, ProblemSolvingRules } from './problemSolving.data'
import * as ProblemSolvingApi from '@/api/eam/device/problemSolving'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'ProblemSolving' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ProblemSolving.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
import download from '@/utils/download'
import { ProblemSolving, ProblemSolvingRules } from './problemSolving.data'
import * as ProblemSolvingApi from '@/api/eam/device/problemSolving'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'ProblemSolving' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ProblemSolving.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
}
//
const updataTableColumns = (val) => {
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
}
const { tableObject, tableMethods } = useTable({
const { tableObject, tableMethods } = useTable({
getListApi: ProblemSolvingApi.getProblemSolvingPage //
})
})
//
const { getList, setSearchParams } = tableMethods
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -90,68 +117,79 @@
// icon: 'Select',
// color: ''
// },
]
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
//
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
}
// -
const butttondata = [
// -
const butttondata = [
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
defaultButtons.mainListDeleteBtn(null) //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
}
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
// console.log(99,row)
row.filePathListView = row.filePathList.map(item=>{
console.log(row)
if (row&&row.filePathList && row.filePathList.length > 0) {
row.filePathListView = row.filePathList.map((item) => {
return {
name:item,
url:item
name: item,
url: item
}
})
basicFormRef.value.open(type, row)
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType, data) => {
// form
const formsSuccess = async (formType, data) => {
var isHave = ProblemSolving.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
return item.field === 'activeTime' || item.field === 'expireTime'
})
if (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间')
return;
return
}
}
if (data.activeTime == 0) data.activeTime = null;
if (data.expireTime == 0) data.expireTime = null;
data.filePathList=[];
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
data.filePathList = []
for (let i = 0; i < data.filePathListView.length; i++) {
data.filePathList.push(data.filePathListView[i].url);
data.filePathList.push(data.filePathListView[i].url)
}
if (formType === 'create') {
await ProblemSolvingApi.createProblemSolving(data)
@ -162,16 +200,16 @@
}
basicFormRef.value.dialogVisible = false
getList()
}
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicProblemSolving')
}
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
@ -180,12 +218,12 @@
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
@ -197,35 +235,35 @@
} finally {
exportLoading.value = false
}
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备件台账导入模版.xlsx'
})
//
const importSuccess = () => {
})
//
const importSuccess = () => {
getList()
}
}
//
const searchFormClick = (searchData) => {
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
}
/** 初始化 **/
onMounted(async () => {
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ProblemSolvingApi.importTemplate()
})
})
</script>

6
src/views/eam/item/itemApplyMain/itemApplyMain.data.ts

@ -327,6 +327,12 @@ export const ItemApplyDetailRules = reactive({
itemNumber: [
{ required: true, message: '请选择备件编号', trigger: 'change' }
],
type: [
{ required: true, message: '请选择类型', trigger: 'change' }
],
deviceNumber: [
{ required: true, message: '请选择设备模具编号', trigger: 'change' }
],
qty: [
{ required: true, message: '请输入申领数量', trigger: 'change' }
],

15
src/views/eam/item/replaceItemDes/index.vue

@ -129,21 +129,8 @@
// form
const formsSuccess = async (formType, data) => {
var isHave = ReplaceItemDes.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间')
return;
}
}
if (data.activeTime == 0) data.activeTime = null;
if (data.expireTime == 0) data.expireTime = null;
data.filePathList = [];
for (let i = 0; i < data.filePathList.length; i++) {
data.filePathList.push(data.filePathList[i].url);
}
data.filePathList = data.filePathList.map(item=>item.url)
if (formType === 'create') {
await ReplaceItemDesApi.createReplaceItemDes(data)
message.success(t('common.createSuccess'))

5
src/views/eam/item/replaceItemDes/replaceItemDes.data.ts

@ -6,9 +6,8 @@ import * as ItemApi from '@/api/eam/basic/item'
// 表单校验
export const ReplaceItemDesRules = reactive({
itemNumber: [required],
areaNumber: [required],
concurrencyStamp: [required],
number: [required],
filePathList: [required],
})
export const ReplaceItemDes = useCrudSchemas(reactive<CrudSchema[]>([

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

@ -180,7 +180,7 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '完成时间',
field: 'finishedTime',
field: 'completionTime',
sort: 'custom',
isSearch: false,
table: {

Loading…
Cancel
Save