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. 98
      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 * as ItemApi from '@/api/eam/basic/item'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import { fa } from 'element-plus/es/locale'
// 邮箱账号的列表 // 邮箱账号的列表
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({}) const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({})
@ -16,6 +17,13 @@ const userListAll = await UserApi.getSimpleUserList()
const deviceListNoPage = await DeviceAccountsApi.getDeviceAccountsAllNoPage({}) const deviceListNoPage = await DeviceAccountsApi.getDeviceAccountsAllNoPage({})
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'DEVICE') const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'DEVICE')
const deviceDeviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) const deviceDeviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
const isConformList = [{
label:'是',
value:'TRUE'
},{
label:'否',
value:'FALSE'
}]
// 表单校验 // 表单校验
export const DeviceSpotInspectionRecordMainRules = reactive({ export const DeviceSpotInspectionRecordMainRules = reactive({
deviceNumber: [required], deviceNumber: [required],
@ -81,6 +89,7 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname return userListAll.find((account) => account.id == cellValue)?.nickname
}, },
isDetail:false,
form: { form: {
component: 'Select', component: 'Select',
api: () => userList, 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: '状态', label: '状态',
field: 'status', field: 'status',
@ -140,6 +161,9 @@ export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema
placeholder: "请选择设备" placeholder: "请选择设备"
} }
}, },
detail:{
dictType:DICT_TYPE.APP_DEVICE_MOLD_TYPE
}
}, },
{ {
label: '描述', label: '描述',
@ -190,6 +214,9 @@ export const DeviceSpotInspectionRecordDetail = useCrudSchemas(reactive<CrudSche
table: { table: {
width: 'auto', 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 DeviceSpotInspectionRecordDetailApi from '@/api/eam/device/deviceSpotInspectionRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import * as UserApi from '@/api/system/user'
defineOptions({ name: 'DeviceSpotInspectionRecordMain' }) defineOptions({ name: 'DeviceSpotInspectionRecordMain' })
const message = useMessage() // const message = useMessage() //
@ -286,7 +287,9 @@ const openForm = (type: string, row?: any) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() 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') 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:{ detail:{
dateFormat:'YYYY-MM-DD HH:mm:ss' dateFormat:'YYYY-MM-DD HH:mm:ss'
} }
}, },
{ {
label: '完成时间', label: '完成时间',
field: 'finishedTime', field: 'completionTime',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
table: { table: {

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

@ -1,20 +1,36 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="ProblemSolving.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="ProblemSolving.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" <TableHead
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :HeadButttondata="HeadButttondata"
:allSchemas="ProblemSolving.allSchemas" /> @button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ProblemSolving.allSchemas"
/>
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{ <Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total total: tableObject.total
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" }"
v-model:sort="tableObject.sort"> v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{ row }"> <template #code="{ row }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span> <span>{{ row.code }}</span>
@ -27,16 +43,27 @@
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="ProblemSolvingRules" <BasicForm
:formAllSchemas="ProblemSolving.allSchemas" :apiUpdate="ProblemSolvingApi.updateProblemSolving" ref="basicFormRef"
:apiCreate="ProblemSolvingApi.createProblemSolving" @searchTableSuccess="searchTableSuccess" :isBusiness="false" /> @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" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="ProblemSolving.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/item-accounts/import" :importTemplateData="importTemplateData" <ImportForm
@success="importSuccess" /> ref="importFormRef"
url="/eam/item-accounts/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -81,7 +108,7 @@
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn(null), // defaultButtons.defaultAddBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -94,16 +121,22 @@
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
@ -111,14 +144,16 @@
// - // -
const butttondata = [ const butttondata = [
defaultButtons.mainListEditBtn(null), // defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), // defaultButtons.mainListDeleteBtn(null) //
] ]
// - // -
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 == 'delete') { // } else if (val == 'delete') {
//
handleDelete(row.id) handleDelete(row.id)
} }
} }
@ -127,31 +162,34 @@
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
// console.log(99,row) // 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 { return {
name: item, name: item,
url: item url: item
} }
}) })
}
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
// form // form
const formsSuccess = async (formType, data) => { const formsSuccess = async (formType, data) => {
var isHave = ProblemSolving.allSchemas.formSchema.some(function (item) { 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 (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) { if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间') message.error('失效时间要大于生效时间')
return; return
} }
} }
if (data.activeTime == 0) data.activeTime = null; if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null; if (data.expireTime == 0) data.expireTime = null
data.filePathList=[]; data.filePathList = []
for (let i = 0; i < data.filePathListView.length; i++) { 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') { if (formType === 'create') {
await ProblemSolvingApi.createProblemSolving(data) await ProblemSolvingApi.createProblemSolving(data)

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

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

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

@ -129,21 +129,8 @@
// form // form
const formsSuccess = async (formType, data) => { 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; if (data.expireTime == 0) data.expireTime = null;
data.filePathList = []; data.filePathList = data.filePathList.map(item=>item.url)
for (let i = 0; i < data.filePathList.length; i++) {
data.filePathList.push(data.filePathList[i].url);
}
if (formType === 'create') { if (formType === 'create') {
await ReplaceItemDesApi.createReplaceItemDes(data) await ReplaceItemDesApi.createReplaceItemDes(data)
message.success(t('common.createSuccess')) 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({ export const ReplaceItemDesRules = reactive({
itemNumber: [required], number: [required],
areaNumber: [required], filePathList: [required],
concurrencyStamp: [required],
}) })
export const ReplaceItemDes = useCrudSchemas(reactive<CrudSchema[]>([ 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: '完成时间', label: '完成时间',
field: 'finishedTime', field: 'completionTime',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
table: { table: {

Loading…
Cancel
Save