songguoqiang 6 months ago
parent
commit
aae753f970
  1. 4
      nginx.conf
  2. 2
      nginx_prod.conf
  3. 11
      src/api/eam/basic/fixedAssets/index.ts
  4. 1
      src/api/eam/basic/inspection/index.ts
  5. 2
      src/api/eam/device/deviceAccounts/index.ts
  6. 6
      src/api/eam/device/deviceMaintenanceDetail/index.ts
  7. 2
      src/api/eam/device/deviceMaintenanceMain/index.ts
  8. 51
      src/api/eam/device/techMaintenanceDetail/index.ts
  9. 94
      src/api/eam/device/techMaintenanceMain/index.ts
  10. 68
      src/api/eam/device/techRepair/index.ts
  11. 8
      src/api/eam/mold/moldInspectionMain/index.ts
  12. 1
      src/api/eam/mold/moldMaintenanceMain/index.ts
  13. 1
      src/api/eam/mold/moldRepair/index.ts
  14. 19
      src/components/Detail/src/DetailDeviceLedger.vue
  15. 11
      src/components/UploadFile/src/UploadFile.vue
  16. 3
      src/locales/zh-CN.ts
  17. 28
      src/views/eam/basic/classType/classType.data.ts
  18. 6
      src/views/eam/basic/fixedAssets/fixedAssets.data.ts
  19. 9
      src/views/eam/basic/fixedAssets/index.vue
  20. 3
      src/views/eam/basic/moldMaintenance/index.vue
  21. 4
      src/views/eam/device/deviceAccounts/index.vue
  22. 21
      src/views/eam/device/deviceRepair/deviceRepair.data.ts
  23. 68
      src/views/eam/device/deviceRepair/index.vue
  24. 4
      src/views/eam/device/deviceSpotInspectionRecordMain/index.vue
  25. 4
      src/views/eam/device/deviceinspectionjob/index.vue
  26. 12
      src/views/eam/device/devicemaintainjob/index.vue
  27. 18
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  28. 70
      src/views/eam/device/devicemaintenancejob/index.vue
  29. 391
      src/views/eam/device/techRepair/index.vue
  30. 248
      src/views/eam/device/techRepair/techRepair.data.ts
  31. 1195
      src/views/eam/device/techmaintenancejob/index.vue
  32. 950
      src/views/eam/device/techmaintenancejob/techMaintenanceMain.data.ts
  33. 4
      src/views/eam/mold/moldAccounts/index.vue
  34. 3
      src/views/eam/mold/moldAccounts/moldAccounts.data.ts
  35. 67
      src/views/eam/mold/moldRepair/index.vue
  36. 52
      src/views/eam/mold/moldRepair/moldRepair.data.ts
  37. 4
      src/views/eam/mold/moldSpotInspectionRecordMain/index.vue
  38. 8
      src/views/eam/mold/moldinspectionjob/index.vue
  39. 12
      src/views/eam/mold/moldmaintainjob/index.vue
  40. 23
      src/views/eam/mold/moldmaintenancejob/index.vue
  41. 6
      src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

4
nginx.conf

@ -32,7 +32,7 @@ http {
server {
listen 25200;
server_name_in_redirect off;
server_name dev.ccwin-in.com;
server_name _;
location /api/ {
proxy_pass http://eam/;
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
@ -57,4 +57,4 @@ http {
index index.html index.htm;
}
}
}
}

2
nginx_prod.conf

@ -32,7 +32,7 @@ http {
server {
listen 80;
server_name_in_redirect off;
server_name dev.ccwin-in.com;
server_name _;
location /api/ {
proxy_pass http://eam/;
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;

11
src/api/eam/basic/fixedAssets/index.ts

@ -1,7 +1,7 @@
import request from '@/config/axios'
import { getStrDictOptions } from '@/utils/dict'
import { useUserStore } from '@/store/modules/user'
import { checkPermi } from '@/utils/permission'
export interface FixedAssetsVO {
number: string
name: string
@ -30,14 +30,7 @@ export const getFixedAssetsPage = async (params) => {
deviceMoldTypeList.some(deviceMold => deviceMold.value === role)
);
const admin = userStore.roles.find(role => {
if (role == 'gdzc_admin') {
return true;
} else {
return false;
}
});
const admin = checkPermi(['gdzc_admin']);
// 如果找到了匹配的角色,将它作为manageDept的值加入到params中
if (matchingRole) {
params.manageDept = matchingRole; // 这里只添加第一个匹配的角色

1
src/api/eam/basic/inspection/index.ts

@ -55,7 +55,6 @@ export const createDeviceMoldItems = async (data: DeviceMoldItemsVO) => {
}
//新增模具
export const creatMoldItems = async (data: DeviceMoldItemsVO) => {
debugger
data.type="MOLD"
data.status="INSPECTION"
return await request.post({ url: `/eam/device-mold-items/create`, data })

2
src/api/eam/device/deviceAccounts/index.ts

@ -13,6 +13,7 @@ export interface DeviceAccountsVO {
productionDate: Date
purchasePrice: number
siteId: string
status: string
available: string
concurrencyStamp: number
}
@ -70,3 +71,4 @@ export const getDeviceAccountsAllNoPage = async (data: DeviceAccountsVO) => {
return await request.post({ url: `/eam/device-accounts/noPage`,data })
}

6
src/api/eam/device/deviceMaintenanceDetail/index.ts

@ -12,7 +12,7 @@ export const getDeviceMaintenanceDetailPage = async (params) => {
  if (params.isSearch) {
    delete params.isSearch
    const data = {...params}
    return await request.post({ url: '/wms/purchasereceipt-request-detail/senior', data })
    return await request.post({ url: '/eam/device-maintenance-job-detail/senior', data })
  } else {
    return await request.get({ url: `/eam/device-maintenance-job-detail/page`, params })
  }
@ -42,10 +42,10 @@ export const deleteDeviceMaintenanceDetail = async (id: number) => {
// 导出维修工单子 Excel
export const exportPurchasereceiptRequestDetail = async (params) => {
  return await request.download({ url: `/wms/purchasereceipt-request-detail/export-excel`, params })
  return await request.download({ url: `/eam/device-maintenance-job-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
  return request.download({ url: '/wms/purchasereceipt-request-detail/get-import-template' })
  return request.download({ url: '/eam/device-maintenance-job-detail/get-import-template' })
}

2
src/api/eam/device/deviceMaintenanceMain/index.ts

@ -16,7 +16,7 @@ export interface DeviceMaintenanceMainVO {
concurrencyStamp: number
}
// 查询维修工单主列表
// 查询设备维修工单主列表
export const getDeviceMaintenanceMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch

51
src/api/eam/device/techMaintenanceDetail/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface DeviceMaintenanceDetailVO {
  describes: string
  describes1: string
  workOut: string
  maintenances: string
}
// 查询维修工单子列表
export const getDeviceMaintenanceDetailPage = async (params) => {
  if (params.isSearch) {
    delete params.isSearch
    const data = {...params}
    return await request.post({ url: '/eam/tech-maintenance-job-detail/senior', data })
  } else {
    return await request.get({ url: `/eam/tech-maintenance-job-detail/page`, params })
  }
}
// 查询维修工单子详情
export const getPurchasereceiptRequestDetail = async (id) => {
  return await request.get({ url: `/eam/tech-maintenance-job-detail/selectListByNumber?id=` + id })
}
// 新增维修工单子
export const createDeviceMaintenanceDetail = async (data: DeviceMaintenanceDetailVO) => {
  return await request.post({ url: `/eam/tech-maintenance-job-detail/create`, data })
}
// 修改维修工单子
export const updateDeviceMaintenanceDetail = async (data: DeviceMaintenanceDetailVO) => {
  return await request.put({ url: `/eam/tech-maintenance-job-detail/update`, data })
}
// 删除维修工单子
export const deleteDeviceMaintenanceDetail = async (id: number) => {
  return await request.delete({ url: `/eam/tech-maintenance-job-detail/delete?id=` + id })
}
// 导出维修工单子 Excel
export const exportPurchasereceiptRequestDetail = async (params) => {
  return await request.download({ url: `/eam/tech-maintenance-job-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
  return request.download({ url: '/eam/tech-maintenance-job-detail/get-import-template' })
}

94
src/api/eam/device/techMaintenanceMain/index.ts

@ -0,0 +1,94 @@
import request from '@/config/axios'
export interface DeviceMaintenanceMainVO {
id: number
number: string
requestNumber: string
describe: string
deviceNumber: string
factoryAreaNumber: string
maintenance: number
maintenancePhone: string
status: string
type: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询工艺维修工单主列表
export const getTechMaintenanceMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/tech-maintenance-job-main/senior', data })
} else {
return await request.get({ url: `/eam/tech-maintenance-job-main/page`, params })
}
}
// 查询维修工单主详情
export const getDeviceMaintenanceMain = async (id: number) => {
return await request.get({ url: `/eam/tech-maintenance-job-main/get?id=` + id })
}
// 新增维修工单主
export const createDeviceMaintenanceMain = async (data: DeviceMaintenanceMainVO) => {
return await request.post({ url: `/eam/tech-maintenance-job-main/createPC`, data })
}
// 修改维修工单主
export const updateDeviceMaintenanceMain = async (data: DeviceMaintenanceMainVO) => {
return await request.put({ url: `/eam/tech-maintenance-job-main/update`, data })
}
// 删除维修工单主
export const deleteDeviceMaintenanceMain = async (id: number) => {
return await request.delete({ url: `/eam/tech-maintenance-job-main/delete?id=` + id })
}
// 导出维修工单主 Excel
export const exportDeviceMaintenanceMain = async (params) => {
return await request.download({ url: `/eam/tech-maintenance-job-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/tech-maintenance-job-main/get-import-template' })
}
// 修改维修工单主
export const orderStepChange = async (data: DeviceMaintenanceMainVO) => {
return await request.get({ url: `/eam/tech-maintenance-job-main/orderClick?number=`+data.number+`&status=`+data.status+`&id=`+data.id+`&requestNumber=`+data.requestNumber })
}
// 修改维修工单主
export const orderTurnTo = async (data: DeviceMaintenanceMainVO) => {
return await request.get({ url: `/eam/tech-maintenance-job-main/turnTo?deviceNumber=`+data.deviceNumber +`&id=`+data.id + `&receiverType=`+ data.type +`&receiverUserId=` + data.maintenance })
}
// 查询维修工单主列表不分页
export const getDeviceMainTempList = async (type: String) => {
return await request.get({ url: `/eam/tech-maintenance-job-main/getList?type=` + type })
}
// 完成维修工单
export const finishOrder = async (params) => {
return await request.get({ url: `/eam/tech-maintenance-job-main/orderClickFinish`, params})
}
// 校验维修工单
export const verifyOrder = async (params) => {
return await request.get({ url: `/eam/tech-maintenance-job-main/orderClickVerify`, params})
}
// 确认维修工单
export const confirmOrder = async (params) => {
return await request.get({ url: `/eam/tech-maintenance-job-main/orderClickConfirm`, params})
}

68
src/api/eam/device/techRepair/index.ts

@ -0,0 +1,68 @@
import request from '@/config/axios'
export interface DeviceRepairVO {
id: number
number: string
describe: string
deviceNumber: string
factoryAreaNumber: string
declarer: number
declarerPhone: string
faultType: string
type: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询报修申请列表
export const getDeviceRepairPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/tech-repair-request/senior', data })
} else {
return await request.get({ url: `/eam/tech-repair-request/page`, params })
}
}
// 查询报修申请详情
export const getDeviceRepair = async (id: number) => {
return await request.get({ url: `/eam/tech-repair-request/get?id=` + id })
}
// 新增报修申请
export const createDeviceRepair = async (data: DeviceRepairVO) => {
return await request.post({ url: `/eam/tech-repair-request/create`, data })
}
// 修改报修申请
export const updateDeviceRepair = async (data: DeviceRepairVO) => {
return await request.put({ url: `/eam/tech-repair-request/update`, data })
}
// 删除报修申请
export const deleteDeviceRepair = async (id: number) => {
return await request.delete({ url: `/eam/tech-repair-request/delete?id=` + id })
}
// 导出报修申请 Excel
export const exportDeviceRepair = async (params) => {
return await request.download({ url: `/eam/tech-repair-request/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/tech-repair-request/get-import-template' })
}
// 撤销申请
export const cancel = (id: Number) => {
return request.delete({ url: '/eam/tech-repair-request/cancel?id=' + id })
}
// 根据单号查询申请工单信息
export const getOrderByNumber = (number: Number) => {
return request.get({ url: '/eam/tech-repair-request/getOrderByNumber?number=' + number })
}

8
src/api/eam/mold/moldInspectionMain/index.ts

@ -58,6 +58,12 @@ export const importTemplate = () => {
}
// 检修完成
export const finishInspection = (id: number) => {
return request.get({ url: `/eam/mold-inspection-job-main/orderClickFinish?id=` + id })
}
// 查询检修工单主列表
export const getMoldInspectionMainNoPage = async (params) => {
return await request.get({ url: `/eam/mold-inspection-job-main/noPage`, params })
@ -66,5 +72,5 @@ export const getMoldInspectionMainNoPage = async (params) => {
//验证
export const verifyOrder = async (id: number,verifyContent: string) => {
return await request.get({ url: `/eam/mold-inspection-job-main/onVerify?id=`+id+`&verifyContent=` + verifyContent })
return await request.get({ url: `/eam/mold-inspection-job-main/orderClickVerify?id=`+id+`&verifyContent=` + verifyContent })
}

1
src/api/eam/mold/moldMaintenanceMain/index.ts

@ -18,7 +18,6 @@ export interface MoldMaintenanceMainVO {
// 查询维修工单主列表
export const getMoldMaintenanceMainPage = async (params) => {
params.type = 'MOLD'
if (params.isSearch) {
delete params.isSearch
const data = {...params}

1
src/api/eam/mold/moldRepair/index.ts

@ -16,7 +16,6 @@ export interface MoldRepairVO {
// 查询报修申请列表
export const getMoldRepairPage = async (params) => {
params.type = 'MOLD'
if (params.isSearch) {
delete params.isSearch
const data = { ...params }

19
src/components/Detail/src/DetailDeviceLedger.vue

@ -912,8 +912,8 @@ const setBeiJian = () => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hide: !hasmMilestoneRight(row)}), //
defaultButtons.uploadFileBtn({ hide: !hasmMilestoneRight(row)}),//
defaultButtons.mainListEditBtn({ hasPermi: 'eam:mold-milestone:edit'}), //
defaultButtons.uploadFileBtn({ hasPermi: 'eam:mold-milestone:upload'}),//
]
}
@ -984,8 +984,8 @@ const getDialogUpload = (row) => {
function dialogUploadFile() {
let data = {
number: dialogUploadNumber.value,
filePathList: fileDialogUploadData.value.filePathList.map((item) => item.url),
fileInfoList: fileDialogUploadData.value.filePathList,
filePathList: fileDialogUploadData.value.filePathList?fileDialogUploadData.value.filePathList.map((item) => item.url):null,
fileInfoList: fileDialogUploadData.value.filePathList?fileDialogUploadData.value.filePathList:[],
funcCode: props.milestoneFuncCode,
fileBusiType: dialogUploadBusiCode.value
}
@ -996,17 +996,6 @@ function dialogUploadFile() {
})
}
const hasmMilestoneRight = (row) => {
const rolesOk = userStore.roles.find(item => {
return item == 'mold_Engineer_role'
})
if (rolesOk != undefined && rolesOk != null) {
return true
} else {
return false
}
}
</script>
<style lang="scss">
.el-drawer__body {

11
src/components/UploadFile/src/UploadFile.vue

@ -145,11 +145,12 @@ const excelUploadError: UploadProps['onError'] = (): void => {
}
//
const handleRemove = (file) => {
const findex = fileList.value.map((f) => f.name).indexOf(file.name)
if (findex > -1) {
fileList.value.splice(findex, 1)
emit('update:modelValue', listToString(fileList.value))
}
// const findex = fileList.value.map((f) => f.name).indexOf(file.name)
// console.log(findex)
// if (findex > -1) {
// fileList.value.splice(findex, 1)
// emit('update:modelValue', listToString(fileList.value))
// }
}
const handlePreview: UploadProps['onPreview'] = (uploadFile) => {
console.log(uploadFile)

3
src/locales/zh-CN.ts

@ -67,7 +67,8 @@ export default {
confirmRefused: '确认审批驳回吗?',
confirmHandle: '确认处理吗?',
confirmSubmit: '确认提交吗?',
finishSuccess:'操作成功'
finishSuccess: '操作成功',
verifySuccess: '验证成功'
},
error: {
noPermission: `抱歉,您无权访问此页面。`,

28
src/views/eam/basic/classType/classType.data.ts

@ -3,6 +3,7 @@ import { dateFormatter } from '@/utils/formatTime'
import * as deptApi from '@/api/system/dept'
import * as roleApi from '@/api/system/role'
import { Role } from '@/views/system/role/role.data'
import { selectAllFactoryArea } from '@/api/system/dept'
// 表单校验
export const ClassTypeRules = reactive({
workerRoleId: [required],
@ -12,6 +13,7 @@ export const ClassTypeRules = reactive({
})
const FactoryAreaNoPage = await deptApi.getDeptPage({'deptGroup':'factory'})
const roleList = await roleApi.getSimpleRoleList({})
const factoryList = await selectAllFactoryArea()
console.log('FactoryAreaNoPage',FactoryAreaNoPage);
console.log('roleList',roleList);
@ -51,14 +53,14 @@ console.log('roleList',roleList);
]))
export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '维修工角色id',
label: '维修工角色',
field: 'workerRoleId',
sort: 'custom',
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择单号', // 输入框占位文本
searchListPlaceholder: '请选择角色', // 输入框占位文本
searchField: 'id', // 查询弹窗赋值字段
searchTitle: '维修工角色', // 查询弹窗标题
searchAllSchemas: Role.allSchemas, // 查询弹窗所需类
@ -77,18 +79,18 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([
},
},
{
label: '工程师角色id',
label: '工程师角色',
field: 'engineerRoleId',
sort: 'custom',
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择单号', // 输入框占位文本
searchListPlaceholder: '请选择角色', // 输入框占位文本
searchField: 'id', // 查询弹窗赋值字段
searchTitle: '工程师角色', // 查询弹窗标题
searchAllSchemas: Role.allSchemas, // 查询弹窗所需类
searchPage: roleApi.getRolePage, // 查询弹窗所需分页方法
searchPage: roleApi.getRolePages, // 查询弹窗所需分页方法
searchCondition: [
// {
// key: 'deptGroup',
@ -119,15 +121,27 @@ export const ClassType = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
},
{
label: '所属厂区编号',
label: '所属厂区',
field: 'factoryAreaNumber',
isSearch: true,
sort: 'custom',
search: {
show: true,
component: 'Select',
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
}
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择单号', // 输入框占位文本
searchListPlaceholder: '请选择厂区', // 输入框占位文本
searchField: 'id', // 查询弹窗赋值字段
searchTitle: '厂区信息', // 查询弹窗标题
searchAllSchemas: FactoryAreaNumbers.allSchemas, // 查询弹窗所需类

6
src/views/eam/basic/fixedAssets/fixedAssets.data.ts

@ -3,9 +3,13 @@ import { dateFormatter } from '@/utils/formatTime'
import { validateHanset,validateNumDot, validateEmail } from '@/utils/validator'
import * as LocationApi from '@/api/eam/basic/location'
import * as SupplierApi from '@/api/eam/basic/supplier'
import { useUserStore } from '@/store/modules/user'
import { checkPermi } from '@/utils/permission'
const localtionList = await LocationApi.getLocationNoPage()
const supplierList = await SupplierApi.getSupplierNoPage()
const userStore = useUserStore() // 用户信息
const admin = checkPermi(['gdzc_admin']);
// 表单校验
export const FixedAssetsRules = reactive({
@ -151,7 +155,7 @@ export const FixedAssets = useCrudSchemas(reactive<CrudSchema[]>([
label: '管理部门',
field: 'manageDept',
sort: 'custom',
isForm: false,
isForm: admin,
dictType: DICT_TYPE.SPECIAL_DEPT_ROLE,
dictClass: 'string',
table: {

9
src/views/eam/basic/fixedAssets/index.vue

@ -64,6 +64,7 @@ import download from '@/utils/download'
import { FixedAssets,FixedAssetsRules } from './fixedAssets.data'
import * as FixedAssetsApi from '@/api/eam/basic/fixedAssets'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { checkPermi } from '@/utils/permission'
// import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
// import Detail from '@/components/Detail/src/Detail.vue'
@ -179,12 +180,16 @@ const formsSuccess = async (formType,data) => {
matchingRole = userStore.getUser.id
}
if (formType === 'create') {
data.manageDept = matchingRole
if(!checkPermi(['gdzc_admin'])){
data.manageDept = matchingRole
}
await FixedAssetsApi.createFixedAssets(data)
message.success(t('common.createSuccess'))
} else {
data.manageDept = matchingRole
if(!checkPermi(['gdzc_admin'])){
data.manageDept = matchingRole
}
await FixedAssetsApi.updateFixedAssets(data)
message.success(t('common.updateSuccess'))
}

3
src/views/eam/basic/moldMaintenance/index.vue

@ -239,14 +239,12 @@ const formsSuccess = async (formType,data) => {
openDataNew.value = data
if(judgeSame()){
basicFormRef.value.dialogVisible = false
getList()
}else{
updateData.value = data
dialogVisible.value = true
}
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
@ -309,6 +307,7 @@ const onSubmit = async () => {
message.success(t('common.delSuccess'))
dialogVisible.value = false;
}
getList()
} catch (error) {
console.error(error);
// basicFormRef

4
src/views/eam/device/deviceAccounts/index.vue

@ -129,8 +129,8 @@
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:device-accounts:create'}), //
defaultButtons.selectQrCodeBatchBtn(null), //
defaultButtons.defaultImportBtn({hasPermi:'eam:device-accounts:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:device-accounts:export'}), //
// defaultButtons.defaultImportBtn({hasPermi:'eam:device-accounts:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'eam:device-accounts:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //

21
src/views/eam/device/deviceRepair/deviceRepair.data.ts

@ -72,16 +72,6 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
valueField: 'id'
},
filterable: true,
onChange: (val) => {
DeviceAccountsApi.getDeviceAccountsNoPage({
isSearch: false,
factoryAreaNumber: val
}).then((res) => {
deviceList.value = res
}).catch((e) => {
console.log(e)
})
}
},
}
},
@ -99,22 +89,25 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
search: {
component: 'Select',
componentProps: {
options: deviceTypeList,
options: deviceMoldTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
// disabled: true,
filterable: true,
},
placeholder: "请选择类型"
}
},
form: {
component: 'Select',
componentProps: {
options: deviceTypeList,
options: deviceMoldTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
// disabled: true,
filterable: true,
placeholder: "请选择设备"
}
@ -148,7 +141,7 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'Select',
componentProps: {
options: deviceList,
options: deviceListNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'number'

68
src/views/eam/device/deviceRepair/index.vue

@ -66,6 +66,7 @@ import { DeviceRepair, DeviceRepairRules } from './deviceRepair.data'
import * as DeviceRepairApi from '@/api/eam/device/deviceRepair'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as DeviceAccountApi from '@/api/eam/device/deviceAccounts'
import * as MoldAccountApi from '@/api/eam/mold/moldAccounts'
import { DeviceAccounts } from '../deviceAccounts/deviceAccounts.data'
import { useUserStore } from '@/store/modules/user'
// import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -88,7 +89,8 @@ const urls = ref([])
const viewKey = ref(0)
routeName.value = route.name
const tableColumns = ref(DeviceRepair.allSchemas.tableColumns)
const factoryAreaNumber = ref('');
const type = ref('');
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
@ -113,8 +115,8 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:device-repair-request:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:device-repair-request:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:device-repair-request:export'}), //
// defaultButtons.defaultImportBtn({hasPermi:'eam:device-repair-request:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'eam:device-repair-request:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -180,6 +182,11 @@ const buttonTableClick = async (val, row) => {
const basicFormRef = ref()
const basicFormViewRef = ref()
const openForm = (type: string, row?: any) => {
// if(type == 'create'){
// DeviceRepair.allSchemas.formSchema.find(item => {
// return item.field == 'type'
// }).value = 'DEVICE'
// }
if (type == 'view') {
showView.value = true
urls.value = row.filePathList
@ -303,6 +310,61 @@ const onChange = (field, cur, item,formRef) => {
setV['deviceNumber'] = ''
formRef.setValues(setV)
})
factoryAreaNumber.value = cur
if(type.value != 'MOLD'){
DeviceAccountApi.getDeviceAccountsAllNoPage({
factoryAreaNumber: cur,
type: type.value,
status: '0'
}).then((res) => {
DeviceRepair.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
}else{
MoldAccountApi.getMoldAccountsAllNoPage({
factoryAreaNumber: cur,
type: type.value,
status: '0'
}).then((res) => {
DeviceRepair.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
}
}
if (field == 'type') {
nextTick(() => {
const setV = {}
setV['deviceNumber'] = ''
formRef.setValues(setV)
})
type.value = cur
if(cur != 'MOLD'){
type.value = 'DEVICE'
DeviceAccountApi.getDeviceAccountsAllNoPage({
factoryAreaNumber: factoryAreaNumber.value,
type: 'DEVICE',
status: '0'
}).then((res) => {
DeviceRepair.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
}else{
type.value = 'MOLD'
MoldAccountApi.getMoldAccountsAllNoPage({
factoryAreaNumber: factoryAreaNumber.value,
type: 'MOLD',
status: '0'
}).then((res) => {
DeviceRepair.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
}
}
// if (field == 'factoryAreaNumber') {

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

@ -218,8 +218,8 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn({hasPermi:'eam:device-spot-inspection-record-main:import'}),
defaultButtons.defaultExportBtn({hasPermi:'eam:device-spot-inspection-record-main:export'}),
// defaultButtons.defaultImportBtn({hasPermi:'eam:device-spot-inspection-record-main:import'}),
// defaultButtons.defaultExportBtn({hasPermi:'eam:device-spot-inspection-record-main:export'}),
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //

4
src/views/eam/device/deviceinspectionjob/index.vue

@ -195,8 +195,8 @@ const judgeHasAddFunc = () => {
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi:'eam:device-inspection-job-main:create'}), //
defaultButtons.defaultImportBtn({ hasPermi:'eam:device-inspection-job-main:import'}), //
defaultButtons.defaultExportBtn({ hasPermi:'eam:device-inspection-job-main:export'}), //
// defaultButtons.defaultImportBtn({ hasPermi:'eam:device-inspection-job-main:import'}), //
// defaultButtons.defaultExportBtn({ hasPermi:'eam:device-inspection-job-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //

12
src/views/eam/device/devicemaintainjob/index.vue

@ -221,8 +221,8 @@ const { getList, setSearchParams } = tableMethods
const HeadButttondata = [
// defaultButtons.defaultAddBtn({
// }), //
defaultButtons.defaultImportBtn({hasPermi:'eam:device-maintain-job-main:import'}),
defaultButtons.defaultExportBtn({hasPermi:'eam:device-maintain-job-main:export'}),
// defaultButtons.defaultImportBtn({hasPermi:'eam:device-maintain-job-main:import'}),
// defaultButtons.defaultExportBtn({hasPermi:'eam:device-maintain-job-main:export'}),
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //
@ -647,9 +647,11 @@ const onCancel = () => {
}
const onSubmit = () => {
DeviceMaintainOrderMainApi.orderClickApprove(dialogRowData.value.id,'VERIFIED',updateFormValue.value.verifyContent)
dialogVisible.value = false
getList()
DeviceMaintainOrderMainApi.orderClickApprove(dialogRowData.value.id,'VERIFIED',updateFormValue.value.verifyContent).then(res => {
message.success(t('common.verifySuccess'))
dialogVisible.value = false
getList()
})
}
const orderPrint = (row) => {

18
src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts

@ -216,17 +216,6 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
},
// dictType: DICT_TYPE.APP_DEVICE_MOLD_TYPE,
isSearch: true,
search: {
component: 'Select',
componentProps: {
options: deviceTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
filterable: true,
},
},
form: {
component: 'Select',
componentProps: {
@ -238,7 +227,8 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
disabled: true,
filterable: true,
placeholder: "请选择设备"
}
},
value: 'DEVICE'
},
},
{
@ -715,7 +705,9 @@ export const DeviceMaintenanceMainSec = useCrudSchemas(reactive<CrudSchema[]>([
labelField: 'label',
valueField: 'value'
},
disabled: false,
filterable: true,
placeholder: "请选择类型"
},
},
form: {
@ -727,7 +719,7 @@ export const DeviceMaintenanceMainSec = useCrudSchemas(reactive<CrudSchema[]>([
valueField: 'value'
},
filterable: true,
placeholder: "请选择设备"
placeholder: "请选择类型"
}
},
},

70
src/views/eam/device/devicemaintenancejob/index.vue

@ -361,38 +361,22 @@ const judgeIsTheClass = (row) => {
}
}
const judgeIsTheFactory = (row) => {
return userStore.userSelfInfo.deptId == row.factoryAreaNumber
}
const judgeIsTheClassEngineer = (row) => {
const rolesOk = userStore.roles.find(item => {
if (row.type == 'DEVICE') {
return item == 'device_class_Engineer_role'
}else if (row.type == 'TECH') {
return item == 'tech_class_Engineer_role'
}
})
if (rolesOk != undefined && rolesOk != null) {
return true
} else {
return false
}
}
const judgeIsTheClassEngineerAndApply = (row,type) => {
//
// if (row.status === 'COMPLETED' && type == 'CONFIRM') {
if (row.status === 'COMPLETED') {
if (row.status === 'COMPLETED' && type == 'CONFIRM') {
// COMPLETEDrequestNumberdeclarer
if(row.requestNumber != null && row.requestNumber !== '' && row.declarer === userStore.getUser.id){
return true
}else{
return false
}
}else if(row.status === 'APPLYPASS' && type == 'VERIFY'){
return true
}else if(row.requestNumber == null || row.requestNumber == ''){
if(row.status === 'COMPLETED' && type == 'VERIFY'){
return true
}
}
// COMPLETEDAPPLYPASSCOMPLETEDfalse
return false;
}
@ -400,8 +384,8 @@ const judgeIsTheClassEngineerAndApply = (row,type) => {
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi:'eam:device-maintenance-job-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:device-maintenance-job-main:import'}),
defaultButtons.defaultExportBtn({hasPermi:'eam:device-maintenance-job-main:export'}),
// defaultButtons.defaultImportBtn({hasPermi:'eam:device-maintenance-job-main:import'}),
// defaultButtons.defaultExportBtn({hasPermi:'eam:device-maintenance-job-main:export'}),
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //
@ -452,7 +436,7 @@ const butttondata = (row) => {
defaultButtons.acceptOrderBtn({
hasPermi:'eam:device-maintenance-job-main:orderClick',
hide: !(
row.status == 'PENDING' && judgeIsTheFactory(row)
row.status == 'PENDING' && row.type == 'DEVICE'
)
}), //
defaultButtons.turnOrderBtn({
@ -466,7 +450,7 @@ const butttondata = (row) => {
defaultButtons.verifyOrderBtn({
hasPermi:'eam:device-maintenance-job-main:orderClickVerify',
hide: !(
judgeIsTheClassEngineerAndApply(row,'VERIFY') && judgeIsTheFactory(row)
judgeIsTheClassEngineerAndApply(row,'VERIFY')
)
}), //
defaultButtons.finishOrderBtn({
@ -491,11 +475,11 @@ const onChange = (field, cur, item) => {
// console.log(item)
// console.log(item.componentProps.options)
formRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id)
if (judgeIfDeviceRole()) {
formRef.value.formRef.formModel.type = 'DEVICE'
} else {
formRef.value.formRef.formModel.type = 'TECH'
}
// if (judgeIfDeviceRole()) {
// formRef.value.formRef.formModel.type = 'DEVICE'
// } else {
// formRef.value.formRef.formModel.type = 'TECH'
// }
}
}
@ -620,7 +604,7 @@ const onChangeSec = (field, cur, item,formRefSec) => {
setV['factoryAreaNumber'] = newRow.value.factoryAreaNumber
setV['maintenance'] = newRow.value.maintenance
formRefSec.setValues(setV)
DeviceMaintenanceMainSecRules.maintenance = [{ required: true }]
DeviceMaintenanceMainSecRules.maintenance = [{ required: true,message:'请选择维修人' }]
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.disabled = true
@ -1186,16 +1170,16 @@ const getActorClass = () => {
}
const judgeIfDeviceRole = () => {
const rolesOk = userStore.roles.find(item => {
return item == 'device_class_worker_role' || item == 'device_class_Engineer_role'
})
if (rolesOk != undefined && rolesOk != null) {
return true
} else {
return false
}
}
// const judgeIfDeviceRole = () => {
// const rolesOk = userStore.roles.find(item => {
// return item == 'device_class_worker_role' || item == 'device_class_Engineer_role'
// })
// if (rolesOk != undefined && rolesOk != null) {
// return true
// } else {
// return false
// }
// }
const validateRow = (row) => {
let flag = true;

391
src/views/eam/device/techRepair/index.vue

@ -0,0 +1,391 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DeviceRepair.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="DeviceRepair.allSchemas" />
<!-- 列表 -->
<ContentWrap>
<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 }">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #upload="{ row }">
<ButtonBase v-if="row.filePathList != null && row.filePathList.length != 0" :Butttondata="butttondataView(row)" @button-base-click="buttonTableClick($event, row)" />
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="DeviceRepairRules"
:formAllSchemas="DeviceRepair.allSchemas"
:apiUpdate="DeviceRepairApi.updateDeviceRepair"
:apiCreate="DeviceRepairApi.createDeviceRepair"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceRepair.allSchemas" />
<Dialog
ref="basicFormViewRef"
v-model="showView"
:key="viewKey"
:closeOnClickModal="true"
:title="viewTitle"
>
<el-image v-for="url in urls" :key="url" :src="url" lazy />
</Dialog>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/tech-repair-request/import" :importTemplateData="importTemplateData"
@success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DeviceRepair, DeviceRepairRules } from './techRepair.data'
import * as DeviceRepairApi from '@/api/eam/device/techRepair'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as DeviceAccountApi from '@/api/eam/device/deviceAccounts'
import * as MoldAccountApi from '@/api/eam/mold/moldAccounts'
import { DeviceAccounts } from '../deviceAccounts/deviceAccounts.data'
import { useUserStore } from '@/store/modules/user'
// 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: 'TechRepair' })
const userStore = useUserStore()
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
const showView = ref(false)
const viewTitle = ref('图片预览')
const urls = ref([])
const viewKey = ref(0)
routeName.value = route.name
const tableColumns = ref(DeviceRepair.allSchemas.tableColumns)
const factoryAreaNumber = ref('');
const type = ref('');
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: DeviceRepairApi.getDeviceRepairPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:tech-repair-request:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'eam:tech-repair-request:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'eam:tech-repair-request:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = (row) => {
return [
// defaultButtons.mainListEditBtn({hasPermi:'eam:deviceRepair:update'}), //
// defaultButtons.mainListDeleteBtn({ hasPermi: 'eam:deviceRepair:delete' }), //
defaultButtons.backoutBtn({hasPermi:'eam:tech-repair-request:cancel', hide: !(row.result == 'PENDING' && row.declarer == userStore.getUser.id )}), //
]
}
// -
const butttondataView = (row) => {
return [
defaultButtons.viewBtn(null),
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'backout') { //
handleBackout(row)
} else if (val == 'view') { //
openForm('view', row)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const basicFormViewRef = ref()
const openForm = (type: string, row?: any) => {
// if(type == 'create'){
// DeviceRepair.allSchemas.formSchema.find(item => {
// return item.field == 'type'
// }).value = 'TECH'
// }
if (type == 'view') {
showView.value = true
urls.value = row.filePathList
viewKey.value += 1
} else {
basicFormRef.value.open(type, row)
}
}
// form
const formsSuccess = async (formType, data) => {
var isHave = DeviceRepair.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.result = 'PENDING';
if (data.upload != null && data.upload != "") {
data.filePathList = data?.upload?.map((item: any) => {
return item.url
})
}
if (formType === 'create') {
await DeviceRepairApi.createDeviceRepair(data)
message.success(t('common.createSuccess'))
} else {
await DeviceRepairApi.updateDeviceRepair(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceRepair')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceRepairApi.deleteDeviceRepair(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await DeviceRepairApi.exportDeviceRepair(tableObject.params)
download.excel(data, '报修申请.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '报修申请导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
// function getAllFactoryAreaList() {
// selectAllFactoryArea().then(res => {
// factoryAreaList.value = res.data
// })
// }
function handleBackout(row) {
if (row.result != 'PENDING') {
message.error('该报修单正在处理中,不能撤销!')
}
DeviceRepairApi.cancel(row.id).then(res => {
console.log("撤销成功!")
getList() //
})
}
const onChange = (field, cur, item,formRef) => {
if (field == 'factoryAreaNumber') {
nextTick(() => {
const setV = {}
setV['deviceNumber'] = ''
formRef.setValues(setV)
})
factoryAreaNumber.value = cur
if(type.value != 'MOLD'){
DeviceAccountApi.getDeviceAccountsAllNoPage({
factoryAreaNumber: cur,
type: type.value,
status: '0'
}).then((res) => {
DeviceRepair.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
}else{
MoldAccountApi.getMoldAccountsAllNoPage({
factoryAreaNumber: cur,
type: type.value,
status: '0'
}).then((res) => {
DeviceRepair.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
}
}
if (field == 'type') {
nextTick(() => {
const setV = {}
setV['deviceNumber'] = ''
formRef.setValues(setV)
})
type.value = cur
if(cur != 'MOLD'){
type.value = 'DEVICE'
DeviceAccountApi.getDeviceAccountsAllNoPage({
factoryAreaNumber: factoryAreaNumber.value,
type: 'DEVICE',
status: '0'
}).then((res) => {
DeviceRepair.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
}else{
type.value = 'MOLD'
MoldAccountApi.getMoldAccountsAllNoPage({
factoryAreaNumber: factoryAreaNumber.value,
type: 'MOLD',
status: '0'
}).then((res) => {
DeviceRepair.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
}
}
// if (field == 'factoryAreaNumber') {
// //
// debugger
// delete DeviceRepair.allSchemas.formSchema.find(item => {
// return item.field == 'deviceNumber'
// }).value
// }
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await DeviceRepairApi.importTemplate()
})
</script>

248
src/views/eam/device/techRepair/techRepair.data.ts

@ -0,0 +1,248 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { selectAllFactoryArea } from '@/api/system/dept'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { validateHanset,validateNumDot, validateEmail } from '@/utils/validator'
import * as UserApi from '@/api/system/user'
const userListAll = await UserApi.getSimpleUserList()
// 邮箱账号的列表
const factoryList = await selectAllFactoryArea()
const deviceList = ref([]);
const deviceListNoPage = await DeviceAccountsApi.getDeviceAccountsAllNoPage({})
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD')
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
// 表单校验
export const DeviceRepairRules = reactive({
number: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
declarer: [required],
faultType: [required],
type: [required],
available: [required],
declarerPhone: [
required,
{ validator:validateHanset, message: '输入手机号格式不正确', trigger: 'blur'}
]
// result: [required],
})
export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '报修工单编号',
field: 'number',
sort: 'custom',
table: {
width: '150',
fixed: 'left',
},
isSearch: false,
isForm: false
},
{
label: '厂区',
field: 'factoryAreaNumber',
sort: 'custom',
table: {
width: '150',
},
api: () => factoryList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
}
},
form: {
component: 'Select',
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
},
}
},
{
label: '类型',
field: 'type',
sort: 'custom',
table: {
width: '150',
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
},
isSearch: true,
search: {
component: 'Select',
componentProps: {
options: deviceMoldTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
// disabled: true,
filterable: true,
placeholder: "请选择类型"
}
},
form: {
component: 'Select',
componentProps: {
options: deviceMoldTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
// disabled: true,
filterable: true,
placeholder: "请选择类型"
}
},
},
{
label: '设备',
field: 'deviceNumber',
sort: 'custom',
table: {
width: '150',
},
isSearch: true,
api: () => DeviceAccountsApi.getDeviceAccountsNoPage({
isSearch: false
}),
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceListNoPage.find((account) => account.number == cellValue)?.name
},
search: {
component: 'Select',
componentProps: {
options: deviceListNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
filterable: true,
},
},
form: {
component: 'Select',
componentProps: {
options: deviceListNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
filterable: true,
},
}
},
{
label: '报修人电话',
field: 'declarerPhone',
sort: 'custom',
table: {
width: '150',
},
},
{
label: '报修人',
field: 'declarer',
sort: 'custom',
table: {
width: '150',
},
isForm: false,
isDetail: false,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
search: {
component: 'Select',
componentProps: {
options: userListAll,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
},
},
},
// {
// label: '故障类型',
// field: 'faultType',
// sort: 'custom',
// table: {
// width: '150',
// },
// dictType: DICT_TYPE.FAULT_TYPE,
// dictClass: 'string',
// form: {
// component: 'Select'
// },
// },
{
label: '描述',
field: 'describes',
sort: 'custom',
table: {
width: '150',
},
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
{
label: '维修状态',
field: 'result',
sort: 'custom',
table: {
width: '150',
},
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string',
isSearch: true,
isForm: false,
form: {
component: 'Select',
},
},
{
label: '图片',
field: 'upload',
isForm: true,
form: {
component: 'UploadImgs',
componentProps: {
limit:3,
}
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

1195
src/views/eam/device/techmaintenancejob/index.vue

File diff suppressed because it is too large

950
src/views/eam/device/techmaintenancejob/techMaintenanceMain.data.ts

@ -0,0 +1,950 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { selectAllFactoryArea } from '@/api/system/dept'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import { useUserStore } from '@/store/modules/user'
import { ItemSearchTable } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
import * as UserApi from '@/api/system/user'
import { getStrDictOptions } from '@/utils/dict'
import { selecUserByType } from '@/api/system/dept'
const userStore = useUserStore()
const factoryList = await selectAllFactoryArea()
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({})
const userListAll = await UserApi.getSimpleUserList()
const deviceListAll = await DeviceAccountsApi.getDeviceAccountsAllNoPage({})
const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null })
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD')
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
// 表单校验
export const DeviceMaintenanceMainRules = reactive({
number: [required],
requestNumber: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
maintenance: [required],
type: [required],
classes: [required],
faultType: [required],
describes: [
required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
})
export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '维修工单编号',
field: 'number',
sort: 'custom',
table: {
width: '150',
fixed: 'left',
},
isSearch: false,
isForm: false,
},
{
label: '报修工单编号',
field: 'requestNumber',
sort: 'custom',
table: {
width: '150',
},
isForm: false,
isSearch: false,
isTable: true,
},
{
label: '设备',
field: 'deviceNumber',
sort: 'custom',
table: {
width: '150',
},
isDetail: false,
api: () => deviceList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceListAll.find((account) => account.number == cellValue)?.name
},
search: {
show: false,
component: 'Input',
api: () => deviceList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
filterable: true,
}
},
form: {
component: 'Select',
api: () => deviceList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
filterable: true,
},
}
},
{
label: '设备',
field: 'deviceNumberDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '厂区',
field: 'factoryAreaNumber',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
api: () => factoryList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
}
},
form: {
component: 'Select',
api: () => factoryList,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
placeholder: "请先选择设备"
},
}
},
{
label: '厂区',
field: 'factoryAreaNumberDetail',
sort: 'custom',etail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
table: {
width: 150
}
},
{
label: '维修人',
field: 'maintenance',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
form: {
component: 'Select',
api: () => userListAll,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
placeholder: "请先选择设备"
},
},
isSearch: true,
search: {
component: 'Select',
api: () => userListAll,
componentProps: {
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
}
}
},
{
label: '维修人',
field: 'maintenanceDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
table: {
width: 150
}
},
{
label: '类型',
field: 'type',
sort: 'custom',
table: {
width: '150',
},
isDetail: false,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
},
// dictType: DICT_TYPE.APP_DEVICE_MOLD_TYPE,
isSearch: true,
form: {
component: 'Select',
componentProps: {
options: deviceTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
disabled: true,
filterable: true,
placeholder: "请选择设备"
},
},
search: {
component: 'Select',
componentProps: {
options: deviceMoldTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
disabled: false,
filterable: true,
placeholder: "请选择设备"
},
},
},
{
label: '类型',
field: 'typeDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '班次',
field: 'classes',
sort: 'custom',
table: {
width: '150',
},
isSearch: true,
dictType: DICT_TYPE.MAINTENANCE_SHIFT,
dictClass: 'string',
form: {
component: 'Select'
},
},
{
label: '故障类型',
field: 'faultType',
sort: 'custom',
table: {
width: '150',
},
isDetail: false,
isSearch: false,
dictType: DICT_TYPE.FAULT_TYPE,
dictClass: 'string',
form: {
component: 'Select'
},
},
{
label: '描述',
field: 'describes',
sort: 'custom',
table: {
width: '150',
},
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
{
label: '是否完成',
field: 'status',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isTable: true,
isForm: false,
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string',
form: {
component: 'Select',
componentProps: {
disabled: false,
}
},
tableForm: {
type: 'Select',
componentProps: {
disabled: false,
}
},
},
{
label: '完成方式',
field: 'result',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isTable: true,
isForm: false,
dictType: DICT_TYPE.ORDER_COMPLETE_RESULT,
dictClass: 'string',
},
{
label: '报修人',
field: 'declarer',
sort: 'custom',
isDetail: false,
isForm: false,
isSearch: true,
table: {
width: '150',
},
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
search: {
component: 'Select',
api: () => userListAll,
componentProps: {
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
}
}
},
{
label: '报修人',
field: 'declarerDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
table: {
width: 150
}
},
{
label: '报修人意见',
field: 'applyContent',
sort: 'custom',
isForm: false,
table: {
width: 150
}
},
{
label: '验证人',
field: 'verifyer',
sort: 'custom',
isDetail: false,
isForm: false,
table: {
width: '150',
},
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
isSearch: true,
search: {
component: 'Select',
api: () => userListAll,
componentProps: {
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
}
}
},
{
label: '验证人',
field: 'verifyerDetail',
sort: 'custom',
table: {
width: 150
},
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '验证人意见',
field: 'verifyContent',
sort: 'custom',
isForm: false,
table: {
width: 150
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 300,
fixed: 'right'
},
isDetail: false
}
]))
export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '维修编号',
field: 'number',
sort: 'custom',
isSearch: false,
form: {
component: 'Input',
componentProps: {
disabled: true
}
},
},
{
label: '故障描述',
field: 'describes',
sort: 'custom',
table: {
},
isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
{
label: '故障真因',
field: 'describes1',
sort: 'custom',
table: {
},
isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
{
label: '解决措施',
field: 'workOut',
sort: 'custom',
table: {
},
isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
{
label: '维修人',
field: 'maintenances',
sort: 'custom',
isDetail: false,
// formatter: (_: Recordable, __: TableColumn, cellValue) => {
// let cellValueList = []
// if (Array.isArray(cellValue)) {
// cellValueList = cellValue
// } else {
// cellValueList = cellValue ? cellValue.split(',') : [];
// }
// // const cellValueList = cellValue ? cellValue.split(',') : [];
// return userListAll
// .filter(item => cellValueList.includes(item.id.toString()))
// .map(item => item.nickname)
// .join(',');
// },
isTable:true,
tableForm: {
type: 'Select',
initOptions: userListAll,
multiple: true,
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
filterable: true,
},
form: {
component: 'Select',
// api: () => dutyUserList,
componentProps: {
multiple: true,
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
}
}
},
{
label: '维修人',
field: 'maintenancesName',
sort: 'custom',
isForm:false,
isDetail:true,
isTable:false,
isTableForm:false
},
{
label: '备件',
field: 'itemNumbers1',
sort: 'custom',
table: {
},
tableForm: {
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择备件',
searchField: 'itemNumbers1',
searchTitle: '备件',
multiple: true,
searchAllSchemas: ItemSearchTable.allSchemas,
searchPage: ItemApi.getItemList,
searchCondition: [{
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true
}]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择备件', // 输入框占位文本
searchField: 'itemNumbers1', // 查询弹窗赋值字段
searchTitle: '备件', // 查询弹窗标题
multiple: true,
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'number',
value: 'deviceNumber',
message: '请选择设备模具编号!',
isMainValue: true
}]
}
},
isSearch: false,
},
{
label: '备件1',
field: 'itemNumbers',
sort: 'custom',
table: {
},
isForm: false,
isDetail: false,
isTable: false,
isSearch: false,
isTableForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 300,
fixed: 'right'
},
isDetail: false,
isTableForm: false,
}
]))
// 表单校验
export const DeviceMaintenanceDetailRules = reactive({
describes: [
required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
describes1: [
required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
workOut: [
required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
maintenances: [required],
})
// 表单校验
export const DeviceMaintenanceMainSecRules = reactive({
number: [required],
requestNumber: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
maintenance: [required],
turnType: [required],
type: [required],
classes: [required],
faultType: [required],
describes: [
required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
})
export const DeviceMaintenanceMainSec = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '维修工单编号',
field: 'number',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isForm: false,
},
{
label: '报修工单编号',
field: 'requestNumber',
sort: 'custom',
table: {
width: '150',
},
isForm: false,
isSearch: false,
isTable: true,
},
{
label: '转办类型',
field: 'turnType',
sort: 'custom',
isDetail: false,
isTable: false,
isSearch: false,
isForm: true,
dictType: DICT_TYPE.TURN_TYPE,
dictClass: 'string',
form: {
component: 'Select',
}
},
{
label: '类型',
field: 'type',
sort: 'custom',
table: {
width: '150',
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
},
isSearch: true,
search: {
component: 'Select',
componentProps: {
options: deviceMoldTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
filterable: true,
},
},
form: {
component: 'Select',
componentProps: {
options: deviceMoldTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
filterable: true,
placeholder: "请选择设备"
}
},
},
{
label: '厂区',
field: 'factoryAreaNumber',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
api: () => factoryList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
}
},
form: {
component: 'Select',
api: () => factoryList,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
placeholder: "请先选择设备"
},
}
},
{
label: '厂区',
field: 'factoryAreaNumber1',
sort: 'custom',
isDetail: true,
isSearch: false,
isForm: false,
isTable: false,
table: {
width: 150
}
},
{
label: '设备模具',
field: 'deviceNumber',
sort: 'custom',
table: {
width: '150',
},
api: () => deviceList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceListAll.find((account) => account.number == cellValue)?.name
},
search: {
show: false,
component: 'Input',
api: () => deviceList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
filterable: true,
}
},
form: {
component: 'Select',
api: () => deviceList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
filterable: true,
},
}
},
{
label: '维修人',
field: 'maintenance',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
api: () => dutyUserList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return dutyUserList.find((account) => account.id == cellValue)?.name
},
form: {
component: 'Select',
api: () => dutyUserList,
componentProps: {
disabled: false,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
filterable: true,
placeholder: "请先选择设备"
},
}
},
{
label: '维修人',
field: 'maintenance1',
sort: 'custom',
isDetail: true,
isSearch: false,
isForm: false,
isTable: false,
table: {
width: 150
}
},
{
label: '班次',
field: 'classes',
sort: 'custom',
table: {
width: '150',
},
isSearch: true,
dictType: DICT_TYPE.MAINTENANCE_SHIFT,
dictClass: 'string',
form: {
component: 'Select'
},
},
{
label: '故障类型',
field: 'faultType',
sort: 'custom',
table: {
width: '150',
},
isSearch: true,
dictType: DICT_TYPE.FAULT_TYPE,
dictClass: 'string',
form: {
component: 'Select'
},
},
{
label: '描述',
field: 'describes',
sort: 'custom',
table: {
width: '150',
},
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
{
label: '状态',
field: 'status',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isTable: true,
isForm: false,
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string',
form: {
component: 'Select',
componentProps: {
disabled: false,
}
},
tableForm: {
type: 'Select',
componentProps: {
disabled: false,
}
},
},
// {
// label: '完成方式',
// field: 'result',
// sort: 'custom',
// table: {
// width: '150',
// },
// isSearch: false,
// isTable: true,
// isForm: false,
// dictType: DICT_TYPE.ORDER_COMPLETE_RESULT,
// dictClass: 'string',
// },
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 300,
fixed: 'right'
},
isDetail: false
}
]))

4
src/views/eam/mold/moldAccounts/index.vue

@ -178,8 +178,8 @@ const { getList, setSearchParams } = tableMethods
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:mold-accounts:create'}), //
defaultButtons.selectQrCodeBatchBtn(null), //
defaultButtons.defaultImportBtn({hasPermi:'eam:mold-accounts:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:mold-accounts:export'}), //
// defaultButtons.defaultImportBtn({hasPermi:'eam:mold-accounts:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'eam:mold-accounts:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //

3
src/views/eam/mold/moldAccounts/moldAccounts.data.ts

@ -165,6 +165,9 @@ export const MoldAccounts = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
isForm: true,
isTable: true,
table: {
width: '150',
},
form: {
component: 'Input',
}

67
src/views/eam/mold/moldRepair/index.vue

@ -64,7 +64,8 @@ import download from '@/utils/download'
import { MoldRepair, MoldRepairRules } from './moldRepair.data'
import * as MoldRepairApi from '@/api/eam/mold/moldRepair'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as MoldAccountApi from '@/api/eam/mold/moldAccount'
import * as MoldAccountApi from '@/api/eam/mold/moldAccounts'
import * as DeviceAccountApi from '@/api/eam/device/deviceAccounts'
defineOptions({ name: 'MoldRepair' })
@ -80,6 +81,8 @@ const viewKey = ref(0)
routeName.value = route.name
const tableColumns = ref(MoldRepair.allSchemas.tableColumns)
const factoryAreaNumber = ref('');
const type = ref('');
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
@ -104,8 +107,8 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:mold-repair-request:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:mold-repair-request:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:mold-repair-request:export'}), //
// defaultButtons.defaultImportBtn({hasPermi:'eam:mold-repair-request:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'eam:mold-repair-request:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -182,7 +185,6 @@ const formsSuccess = async (formType, data) => {
}
if (data.activeTime == 0) data.activeTime = null;
if (data.expireTime == 0) data.expireTime = null;
data.type = 'MOLD';
data.result = 'PENDING';
if (data.upload != null && data.upload != "") {
data.filePathList = data?.upload?.map((item: any) => {
@ -289,13 +291,68 @@ onMounted(async () => {
importTemplateData.templateUrl = await MoldRepairApi.importTemplate()
})
const onChange = (field, cur, item, formRef) => {
const onChange = (field, cur, item,formRef) => {
if (field == 'factoryAreaNumber') {
nextTick(() => {
const setV = {}
setV['deviceNumber'] = ''
formRef.setValues(setV)
})
factoryAreaNumber.value = cur
if(type.value != 'MOLD'){
DeviceAccountApi.getDeviceAccountsAllNoPage({
factoryAreaNumber: cur,
type: type.value,
status: '0'
}).then((res) => {
MoldRepair.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
}else{
MoldAccountApi.getMoldAccountsAllNoPage({
factoryAreaNumber: cur,
type: type.value,
status: '0'
}).then((res) => {
MoldRepair.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
}
}
if (field == 'type') {
nextTick(() => {
const setV = {}
setV['deviceNumber'] = ''
formRef.setValues(setV)
})
if(cur != 'MOLD'){
type.value = 'DEVICE'
DeviceAccountApi.getDeviceAccountsAllNoPage({
factoryAreaNumber: factoryAreaNumber.value,
type: 'DEVICE',
status: '0'
}).then((res) => {
MoldRepair.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
}else{
type.value = 'MOLD'
MoldAccountApi.getMoldAccountsAllNoPage({
factoryAreaNumber: factoryAreaNumber.value,
type: 'MOLD',
status: '0'
}).then((res) => {
MoldRepair.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
}
}
}

52
src/views/eam/mold/moldRepair/moldRepair.data.ts

@ -2,9 +2,11 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { selectAllFactoryArea } from '@/api/system/dept'
import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { validateHanset,validateNumDot, validateEmail } from '@/utils/validator'
import * as UserApi from '@/api/system/user'
const userListAll = await UserApi.getSimpleUserList()
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
// 邮箱账号的列表
@ -73,19 +75,47 @@ export const MoldRepair = useCrudSchemas(reactive<CrudSchema[]>([
labelField: 'name',
valueField: 'id'
},
onChange: (val) => {
MoldAccountsApi.getMoldAccountsNoPage({
isSearch: false,
factoryAreaNumber: val
}).then((res) => {
moldList.value = res
}).catch((e) => {
console.log(e)
})
}
},
}
},
{
label: '类型',
field: 'type',
sort: 'custom',
table: {
width: '150',
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
},
isSearch: true,
search: {
component: 'Select',
componentProps: {
options: deviceMoldTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
// disabled: true,
filterable: true,
placeholder: "请选择类型"
}
},
form: {
component: 'Select',
componentProps: {
options: deviceMoldTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
// disabled: true,
filterable: true,
placeholder: "请选择类型"
}
},
},
{
label: '模具',
field: 'deviceNumber',
@ -101,7 +131,7 @@ export const MoldRepair = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'Select',
componentProps: {
options: moldList,
options: moldListNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'number'

4
src/views/eam/mold/moldSpotInspectionRecordMain/index.vue

@ -217,8 +217,8 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn({ hasPermi:'eam:mold-spot-inspection-record-main:import'}),
defaultButtons.defaultExportBtn({ hasPermi:'eam:mold-spot-inspection-record-main:export'}),
// defaultButtons.defaultImportBtn({ hasPermi:'eam:mold-spot-inspection-record-main:import'}),
// defaultButtons.defaultExportBtn({ hasPermi:'eam:mold-spot-inspection-record-main:export'}),
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //

8
src/views/eam/mold/moldinspectionjob/index.vue

@ -207,8 +207,8 @@ const judgeHasAddFunc = () => {
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi:'eam:mold-inspection-job-main:create'}), //
defaultButtons.defaultImportBtn({ hasPermi:'eam:mold-inspection-job-main:import'}),
defaultButtons.defaultExportBtn({ hasPermi:'eam:mold-inspection-job-main:export'}),
// defaultButtons.defaultImportBtn({ hasPermi:'eam:mold-inspection-job-main:import'}),
// defaultButtons.defaultExportBtn({ hasPermi:'eam:mold-inspection-job-main:export'}),
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -404,7 +404,7 @@ function handleFinishOrder(row) {
let param = {
masterId : row.id
}
DeviceInspectionDetailApi.getDeviceInspectionDetailPage(param
MoldInspectionDetailApi.getMoldInspectionDetailPage(param
).then(response => {
if (response != null) {
if (response.list.length == 0) {
@ -417,7 +417,7 @@ function handleFinishOrder(row) {
// message.error(t(''))
// return
// } else {
DeviceInspectionMainApi.finishInspection(row.id).then(res => {
MoldInspectionMainApi.finishInspection(row.id).then(res => {
message.success(t('common.finishSuccess'))
getList()
})

12
src/views/eam/mold/moldmaintainjob/index.vue

@ -222,8 +222,8 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn({hasPermi:'eam:mold-maintain-job-main:import'}),
defaultButtons.defaultExportBtn({hasPermi:'eam:mold-maintain-job-main:export'}),
// defaultButtons.defaultImportBtn({hasPermi:'eam:mold-maintain-job-main:import'}),
// defaultButtons.defaultExportBtn({hasPermi:'eam:mold-maintain-job-main:export'}),
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //
@ -631,9 +631,11 @@ const onCancel = () => {
}
const onSubmit = (val) => {
MoldMaintainOrderMainApi.orderClickApprove(dialogRowData.value.id,'VERIFIED',updateFormValue.value.verifyContent)
dialogVisible.value = false
getList()
MoldMaintainOrderMainApi.orderClickApprove(dialogRowData.value.id,'VERIFIED',updateFormValue.value.verifyContent).then(res => {
message.success(t('common.verifySuccess'))
dialogVisible.value = false
getList()
})
}
const orderPrint = (row) => {

23
src/views/eam/mold/moldmaintenancejob/index.vue

@ -357,10 +357,6 @@ const judgeIsTheClass = (row) => {
}
}
const judgeIsTheFactory = (row) => {
return userStore.userSelfInfo.deptId == row.factoryAreaNumber
}
const judgeIsTheClassEngineer = (row) => {
const rolesOk = userStore.roles.find(item => {
if (row.type == 'MOLD') {
@ -392,8 +388,8 @@ const judgeIsTheClassWorker = (row) => {
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi:'eam:mold-maintenance-job-main:create'}), //
defaultButtons.defaultImportBtn({ hasPermi:'eam:mold-maintenance-job-main:import'}),
defaultButtons.defaultExportBtn({ hasPermi:'eam:mold-maintenance-job-main:export'}),
// defaultButtons.defaultImportBtn({ hasPermi:'eam:mold-maintenance-job-main:import'}),
// defaultButtons.defaultExportBtn({ hasPermi:'eam:mold-maintenance-job-main:export'}),
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //
@ -449,7 +445,7 @@ const butttondata = (row) => {
defaultButtons.acceptOrderBtn({
hasPermi:'eam:mold-maintenance-job-main:orderClick',
hide: !(
row.status == 'PENDING' && judgeIsTheFactory(row)
row.status == 'PENDING' && row.type == 'MOLD'
)
}), //
defaultButtons.turnOrderBtn({
@ -463,7 +459,7 @@ const butttondata = (row) => {
defaultButtons.verifyOrderBtn({
hasPermi:'eam:mold-maintenance-job-main:orderClickVerify',
hide: !(
judgeIsTheClassEngineerAndApply(row,'VERIFY') && judgeIsTheFactory(row)
judgeIsTheClassEngineerAndApply(row,'VERIFY')
)
}), //
defaultButtons.finishOrderBtn({
@ -1163,21 +1159,24 @@ const validateRow = (row) => {
return true;
};
const judgeIsTheClassEngineerAndApply = (row,type) => {
//
if (row.status === 'COMPLETED') {
if (row.status === 'COMPLETED' && type == 'CONFIRM') {
// COMPLETEDrequestNumberdeclarer
if(row.requestNumber != null && row.requestNumber !== '' && row.declarer === userStore.getUser.id){
return true
}else{
return false
}
}else if(row.status === 'APPLYPASS' && type == 'VERIFY'){
return true
}else if(row.requestNumber == null || row.requestNumber == ''){
if(row.status === 'COMPLETED' && type == 'VERIFY'){
return true
}
}
// COMPLETEDAPPLYPASSCOMPLETEDfalse
return false;
}
/** 初始化 **/

6
src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

@ -116,16 +116,18 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
},
isSearch: false,
isSearch: true,
search: {
component: 'Select',
componentProps: {
options: deviceTypeList,
options: deviceMoldTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
disabled: false,
filterable: true,
placeholder: "请选择类型"
},
},
form: {

Loading…
Cancel
Save