songguoqiang 7 months ago
parent
commit
9644b9f81d
  1. 7
      Dockerfile_prod
  2. 60
      nginx_prod.conf
  3. 4
      src/api/eam/basic/deviceMaintenance/index.ts
  4. 60
      src/api/eam/basic/deviceMoldItemsHistory/index.ts
  5. 4
      src/api/eam/basic/inspection/index.ts
  6. 4
      src/api/eam/basic/moldMaintenance/index.ts
  7. 4
      src/api/eam/device/deviceMaintainOrderMain/index.ts
  8. 5
      src/api/eam/device/deviceMaintenanceMain/index.ts
  9. 6
      src/api/eam/device/deviceRepair/index.ts
  10. 7
      src/api/eam/mold/moldMaintainOrderMain/index.ts
  11. 6
      src/api/eam/mold/moldMaintenanceMain/index.ts
  12. 28
      src/utils/disposition/defaultButtons.ts
  13. 115
      src/views/eam/basic/deviceMaintenance/index.vue
  14. 158
      src/views/eam/basic/deviceMoldItemsHistory/deviceMoldItemsHistory.data.ts
  15. 244
      src/views/eam/basic/deviceMoldItemsHistory/index.vue
  16. 3
      src/views/eam/basic/fixedAssets/fixedAssets.data.ts
  17. 104
      src/views/eam/basic/inspection/index.vue
  18. 119
      src/views/eam/basic/moldMaintenance/index.vue
  19. 40
      src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts
  20. 90
      src/views/eam/device/devicemaintainjob/index.vue
  21. 123
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  22. 202
      src/views/eam/device/devicemaintenancejob/index.vue
  23. 96
      src/views/eam/mold/moldmaintainjob/index.vue
  24. 44
      src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts
  25. 222
      src/views/eam/mold/moldmaintenancejob/index.vue
  26. 125
      src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

7
Dockerfile_prod

@ -0,0 +1,7 @@
# 设置基础镜像
FROM win-nginx
WORKDIR /opt/eam
COPY nginx_prod.conf /usr/local/nginx/conf/nginx.conf
# 将dist文件中的内容复制到 /opt/eam 这个目录下面
COPY eam/ /opt/eam

60
nginx_prod.conf

@ -0,0 +1,60 @@
user root;
worker_processes 2;
events {
worker_connections 1024;
}
http {
include mime.types;
charset utf-8,gbk;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$request_time $upstream_response_time"';
proxy_cache_path /opt/nginx_cache/ levels=1:2 keys_zone=my_zone:10m inactive=300s max_size=5g;
access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 600s;
client_max_body_size 200m;
gzip on;
gzip_min_length 10k;
gzip_comp_level 9;
gzip_buffers 4 16k;
gzip_types text/plain application/javascript text/css application/xml text/javascript image/jpeg image/gif image/png;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
upstream eam {
server localhost:90 weight=10 max_fails=3 fail_timeout=10s;
}
server {
listen 80;
server_name_in_redirect off;
server_name dev.ccwin-in.com;
location /api/ {
proxy_pass http://eam/;
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
}
location /profile/ {
proxy_cache my_zone;
proxy_cache_valid 200 304 12h;
proxy_cache_key $host$uri$is_args$args;
alias /opt/profile/;
index index.html index.htm;
}
location / {
proxy_cache my_zone;
proxy_cache_valid 200 304 12h;
proxy_cache_key $host$uri$is_args$args;
try_files $uri $uri/ /index.html;
root /opt/eam;
index index.html index.htm;
}
}
}

4
src/api/eam/basic/deviceMaintenance/index.ts

@ -49,8 +49,8 @@ export const updateDeviceMoldItems = async (data: DeviceMoldItemsVO) => {
} }
// 删除项记录表(设备 模具 保养 维修 巡检点检) // 删除项记录表(设备 模具 保养 维修 巡检点检)
export const deleteDeviceMoldItems = async (id: number) => { export const deleteDeviceMoldItems = async (id: number,remark: string) => {
return await request.delete({ url: `/eam/device-mold-items/delete?id=` + id }) return await request.delete({ url: `/eam/device-mold-items/delete?id=` + id + `&remark=` + remark })
} }
// 导出项记录表(设备 模具 保养 维修 巡检点检) Excel // 导出项记录表(设备 模具 保养 维修 巡检点检) Excel

60
src/api/eam/basic/deviceMoldItemsHistory/index.ts

@ -0,0 +1,60 @@
import request from '@/config/axios'
export interface DeviceMoldItemsHistoryVO {
id: number
name: string
deviceNumber: string
executionCycle: string
equipmentParts: string
type: string
status: string
peoples: number
estimatedMinutes: number
remark: string
siteId: string
available: string
concurrencyStamp: number
peopleNum: number
maintenanceTime: number
}
// 查询项记录历史表(设备 模具 保养 维修 巡检点检)列表
export const getDeviceMoldItemsHistoryPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/record/device-mold-items-history/senior', data })
} else {
return await request.get({ url: `/record/device-mold-items-history/page`, params })
}
}
// 查询项记录历史表(设备 模具 保养 维修 巡检点检)详情
export const getDeviceMoldItemsHistory = async (id: number) => {
return await request.get({ url: `/record/device-mold-items-history/get?id=` + id })
}
// 新增项记录历史表(设备 模具 保养 维修 巡检点检)
export const createDeviceMoldItemsHistory = async (data: DeviceMoldItemsHistoryVO) => {
return await request.post({ url: `/record/device-mold-items-history/create`, data })
}
// 修改项记录历史表(设备 模具 保养 维修 巡检点检)
export const updateDeviceMoldItemsHistory = async (data: DeviceMoldItemsHistoryVO) => {
return await request.put({ url: `/record/device-mold-items-history/update`, data })
}
// 删除项记录历史表(设备 模具 保养 维修 巡检点检)
export const deleteDeviceMoldItemsHistory = async (id: number) => {
return await request.delete({ url: `/record/device-mold-items-history/delete?id=` + id })
}
// 导出项记录历史表(设备 模具 保养 维修 巡检点检) Excel
export const exportDeviceMoldItemsHistory = async (params) => {
return await request.download({ url: `/record/device-mold-items-history/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/record/device-mold-items-history/get-import-template' })
}

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

@ -77,8 +77,8 @@ export const updateMoldItems = async (data: DeviceMoldItemsVO) => {
} }
// 删除项记录表(设备 模具 保养 维修 巡检点检) // 删除项记录表(设备 模具 保养 维修 巡检点检)
export const deleteDeviceMoldItems = async (id: number) => { export const deleteDeviceMoldItems = async (id: number, remark: string) => {
return await request.delete({ url: `/eam/device-mold-items/delete?id=` + id }) return await request.delete({ url: `/eam/device-mold-items/delete?id=` + id + `&remark=` + remark })
} }
// 导出项记录表(设备 模具 保养 维修 巡检点检) Excel // 导出项记录表(设备 模具 保养 维修 巡检点检) Excel

4
src/api/eam/basic/moldMaintenance/index.ts

@ -49,8 +49,8 @@ export const updateDeviceMoldItems = async (data: DeviceMoldItemsVO) => {
} }
// 删除项记录表(设备 模具 保养 维修 巡检点检) // 删除项记录表(设备 模具 保养 维修 巡检点检)
export const deleteDeviceMoldItems = async (id: number) => { export const deleteDeviceMoldItems = async (id: number, remark: string) => {
return await request.delete({ url: `/eam/device-mold-items/delete?id=` + id }) return await request.delete({ url: `/eam/device-mold-items/delete?id=` + id + `&remark=` + remark })
} }
// 导出项记录表(设备 模具 保养 维修 巡检点检) Excel // 导出项记录表(设备 模具 保养 维修 巡检点检) Excel

4
src/api/eam/device/deviceMaintainOrderMain/index.ts

@ -70,3 +70,7 @@ export const orderClickFinish = (id: number) => {
return request.get({ url: '/eam/device-maintain-job-main/orderClickFinish?id=' + id }) return request.get({ url: '/eam/device-maintain-job-main/orderClickFinish?id=' + id })
} }
// 验证
export const orderClickApprove = (id: number,status: string,verifyContent: string) => {
return request.get({ url: '/eam/device-maintain-job-main/orderClickVerify?id=' + id + '&status=' + status + '&verifyContent=' + verifyContent })
}

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

@ -87,5 +87,8 @@ export const verifyOrder = async (params) => {
} }
// 确认维修工单
export const confirmOrder = async (params) => {
return await request.get({ url: `/eam/device-maintenance-job-main/orderClick`, params})
}

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

@ -60,3 +60,9 @@ export const importTemplate = () => {
export const rejected = (id: Number) => { export const rejected = (id: Number) => {
return request.delete({ url: '/eam/device-repair-request/rejected?id=' + id }) return request.delete({ url: '/eam/device-repair-request/rejected?id=' + id })
} }
// 根据单号查询申请工单信息
export const getOrderByNumber = (number: Number) => {
return request.get({ url: '/eam/device-repair-request/getOrderByNumber?number=' + number })
}

7
src/api/eam/mold/moldMaintainOrderMain/index.ts

@ -71,3 +71,10 @@ export const orderClickFinish = (id: number) => {
return request.get({ url: '/eam/device-maintain-job-main/orderClickFinish?id=' + id }) return request.get({ url: '/eam/device-maintain-job-main/orderClickFinish?id=' + id })
} }
// 验证
export const orderClickApprove = (id: number,status: string,verifyContent: string) => {
return request.get({ url: '/eam/device-maintain-job-main/orderClickApprove?id=' + id + '&status=' + status + '&approveOpinion=' + verifyContent })
}

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

@ -80,6 +80,12 @@ export const finishOrder = async (params) => {
} }
// 申请人确认工单
export const confirmOrder = async (params) => {
return await request.get({ url: `/eam/device-maintenance-job-main/orderClick`, params})
}
// 校验维修工单 // 校验维修工单
export const verifyOrder = async (params) => { export const verifyOrder = async (params) => {
return await request.get({ url: `/eam/device-maintenance-job-main/orderClick`, params}) return await request.get({ url: `/eam/device-maintenance-job-main/orderClick`, params})

28
src/utils/disposition/defaultButtons.ts

@ -1039,6 +1039,34 @@ export function selectQrCodeBatchBtn(option:any) {
}) })
} }
// 保养
export function maintainBtn(option:any) {
return __defaultBtnOption(option,{
label: '保养',
name: 'maintain',
hide: false,
type: 'warning',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 确认
export function confirmOrderBtn(option:any) {
return __defaultBtnOption(option,{
label: '确认',
name: 'confirmOrder',
hide: false,
type: 'success',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 默认按钮规则 // 默认按钮规则
function __defaultBtnOption(option:any,specific:any){ function __defaultBtnOption(option:any,specific:any){
return { return {

115
src/views/eam/basic/deviceMaintenance/index.vue

@ -54,6 +54,33 @@
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceMaintenance.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceMaintenance.allSchemas" />
<Dialog
ref="updateDialog"
title="本次修改修改描述"
v-model="dialogVisible"
:width="600"
:maxHeight="700"
:style="{height:'450px'}"
:before-close="handleBeforeClose"
>
<el-form :model="updateFormValue" class="demo-form-inline">
<el-form-item label="备注">
<el-input
type="textarea"
v-model="updateFormValue.remark"
placeholder="请对本次修改内容添加备注"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="onSubmit">提交</el-button>
</div>
</template>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -61,8 +88,9 @@ import download from '@/utils/download'
import { DeviceMaintenance,DeviceMaintenanceRules } from './deviceMaintenance.data' import { DeviceMaintenance,DeviceMaintenanceRules } from './deviceMaintenance.data'
import * as DeviceMaintenanceApi from '@/api/eam/basic/deviceMaintenance' import * as DeviceMaintenanceApi from '@/api/eam/basic/deviceMaintenance'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import { useUserStore } from '@/store/modules/user'
import Detail from '@/components/Detail/src/Detail.vue' import { updateForm } from '@/api/bpm/form'
const userStore = useUserStore() //
defineOptions({ name: 'DeviceMaintenance' }) defineOptions({ name: 'DeviceMaintenance' })
@ -72,6 +100,16 @@ const route = useRoute() // 路由信息
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(DeviceMaintenance.allSchemas.tableColumns) const tableColumns = ref(DeviceMaintenance.allSchemas.tableColumns)
const updateDialog = ref()
const dialogVisible = ref(false)
const updateData = ref()
const updateFormValue = reactive({
remark: '',
})
const openDataOld = ref()
const openDataNew = ref()
const operatType = ref('')
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -134,8 +172,11 @@ const butttondata = [
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //
operatType.value = 'edit'
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
operatType.value = 'delete'
updateData.value = row
handleDelete(row.id) handleDelete(row.id)
} }
} }
@ -143,6 +184,8 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
openDataOld.value = row
updateFormValue.remark = ''
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
@ -162,12 +205,20 @@ const formsSuccess = async (formType,data) => {
if (formType === 'create') { if (formType === 'create') {
await DeviceMaintenanceApi.createDeviceMoldItems(data) await DeviceMaintenanceApi.createDeviceMoldItems(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
basicFormRef.value.dialogVisible = false
getList()
} else { } else {
await DeviceMaintenanceApi.updateDeviceMoldItems(data) openDataNew.value = data
message.success(t('common.updateSuccess')) if(judgeSame()){
}
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
getList() getList()
}else{
updateData.value = data
dialogVisible.value = true
}
}
} }
/** 详情操作 */ /** 详情操作 */
@ -181,11 +232,9 @@ const handleDelete = async (id: number) => {
try { try {
// //
await message.delConfirm() await message.delConfirm()
//
await DeviceMaintenanceApi.deleteDeviceMoldItems(id) dialogVisible.value = true
message.success(t('common.delSuccess'))
//
await getList()
} catch {} } catch {}
} }
@ -216,6 +265,52 @@ const searchFormClick = (searchData) => {
getList() // getList() //
} }
const onSubmit = async () => {
console.log('submit!');
updateData.value.remark = updateFormValue.remark
try {
if(operatType.value == 'edit'){
await DeviceMaintenanceApi.updateDeviceMoldItems(updateData.value);
message.success(t('common.updateSuccess'));
// ""
basicFormRef.value.dialogVisible = false; // basicFormRef
dialogVisible.value = false; // updateDialog
}else if(operatType.value == 'delete'){
//
await DeviceMaintenanceApi.deleteDeviceMoldItems(updateData.value.id,updateData.value.remark)
message.success(t('common.delSuccess'))
dialogVisible.value = false;
}
//
await getList()
} catch (error) {
console.error(error);
// basicFormRef
// updateDialog
message.error(t('common.updateFailed'));
}
};
const handleBeforeClose = async(done)=>{
basicFormRef.value.formLoading = false
done()
}
//
const judgeSame = () => {
// openDataOld.value
const keys = Object.keys(openDataOld.value);
// 使every()
const isSame = keys.every(key => {
// openDataNew.value
return openDataNew.value.hasOwnProperty(key) && openDataOld.value[key] === openDataNew.value[key];
});
//
return isSame;
};
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

158
src/views/eam/basic/deviceMoldItemsHistory/deviceMoldItemsHistory.data.ts

@ -0,0 +1,158 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const operatTypeList = getStrDictOptions(DICT_TYPE.SYSTEM_OPERATE_TYPE).filter(item => {
return (item.value == '2' || item.value == '3' || item.value == '4')
})
// 表单校验
export const DeviceMoldItemsHistoryRules = reactive({
name: [required],
deviceNumber: [required],
type: [required],
status: [required],
concurrencyStamp: [required]
})
export const DeviceMoldItemsHistory = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '保养内容',
field: 'name',
sort: 'custom',
isSearch: false
},
{
label: '设备模具编号',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
},
{
label: '设备模具名称',
field: 'deviceName',
sort: 'custom',
isSearch: false,
},
{
label: '执行周期',
field: 'executionCycle',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.MOLD_EXECUTION_CYCLE,
dictClass: 'string',
},
{
label: '设备部位',
field: 'equipmentParts',
sort: 'custom',
isSearch: false
},
{
label: '类型',
field: 'type',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
form: {
component: 'Select'
}
},
{
label: '项类型',
field: 'status',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.DEVICEMOLDITEMS_STATUS,
dictClass: 'string',
form: {
component: 'Select',
value: 'MAINTAIN',
componentProps: {
disabled: true
}
},
},
{
label: '人数',
field: 'peoples',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '预计所需时间',
field: 'estimatedMinutes',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '人数',
field: 'peopleNum',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '保养所需时间(单位小时)',
field: 'maintenanceTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '操作类型',
field: 'operatType',
sort: 'custom',
isSearch: true,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return operatTypeList.find((account) => account.value == cellValue)?.label
},
search: {
component: 'Select',
componentProps: {
disabled: false,
options:operatTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
filterable: true,
placeholder: "请选择责类型",
},
}
},
{
label: '操作备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
]))

244
src/views/eam/basic/deviceMoldItemsHistory/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DeviceMoldItemsHistory.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeviceMoldItemsHistory.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 #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="DeviceMoldItemsHistoryRules"
:formAllSchemas="DeviceMoldItemsHistory.allSchemas"
:apiUpdate="DeviceMoldItemsHistoryApi.updateDeviceMoldItemsHistory"
:apiCreate="DeviceMoldItemsHistoryApi.createDeviceMoldItemsHistory"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceMoldItemsHistory.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/record/device-mold-items-history/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DeviceMoldItemsHistory,DeviceMoldItemsHistoryRules } from './deviceMoldItemsHistory.data'
import * as DeviceMoldItemsHistoryApi from '@/api/eam/basic/deviceMoldItemsHistory'
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: 'DeviceMoldItemsHistory' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DeviceMoldItemsHistory.allSchemas.tableColumns)
//
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: DeviceMoldItemsHistoryApi.getDeviceMoldItemsHistoryPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:deviceMoldItemsHistory:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:deviceMoldItemsHistory:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:deviceMoldItemsHistory: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 = [
defaultButtons.mainListEditBtn({hasPermi:'eam:deviceMoldItemsHistory:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceMoldItemsHistory:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =DeviceMoldItemsHistory.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 (formType === 'create') {
await DeviceMoldItemsHistoryApi.createDeviceMoldItemsHistory(data)
message.success(t('common.createSuccess'))
} else {
await DeviceMoldItemsHistoryApi.updateDeviceMoldItemsHistory(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, 'basicDeviceMoldItemsHistory')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceMoldItemsHistoryApi.deleteDeviceMoldItemsHistory(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 DeviceMoldItemsHistoryApi.exportDeviceMoldItemsHistory(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() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await DeviceMoldItemsHistoryApi.importTemplate()
})
</script>

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

@ -138,6 +138,9 @@ export const FixedAssets = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: '150', width: '150',
}, },
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return supplierList.find((account) => account.number == cellValue)?.name
},
form:{ form:{
component: 'Select', component: 'Select',
componentProps: { componentProps: {

104
src/views/eam/basic/inspection/index.vue

@ -53,6 +53,34 @@
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceMoldItems.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceMoldItems.allSchemas" />
<Dialog
ref="updateDialog"
title="本次修改修改描述"
v-model="dialogVisible"
:width="600"
:maxHeight="700"
:style="{height:'450px'}"
:before-close="handleBeforeClose"
>
<el-form :model="updateFormValue" class="demo-form-inline">
<el-form-item label="备注">
<el-input
type="textarea"
v-model="updateFormValue.remark"
placeholder="请对本次修改内容添加备注"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="onSubmit">提交</el-button>
</div>
</template>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -72,6 +100,15 @@ const route = useRoute() // 路由信息
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(DeviceMoldItems.allSchemas.tableColumns) const tableColumns = ref(DeviceMoldItems.allSchemas.tableColumns)
const updateDialog = ref()
const dialogVisible = ref(false)
const updateData = ref()
const updateFormValue = reactive({
remark: '',
})
const openDataOld = ref()
const openDataNew = ref()
const operatType = ref('')
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -134,8 +171,11 @@ const butttondata = [
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //
operatType.value = 'edit'
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
operatType.value = 'delete'
updateData.value = row
handleDelete(row.id) handleDelete(row.id)
} }
} }
@ -143,6 +183,8 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
openDataOld.value = row
updateFormValue.remark = ''
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
@ -163,8 +205,14 @@ const formsSuccess = async (formType,data) => {
await DeviceMoldItemsApi.createDeviceMoldItems(data) await DeviceMoldItemsApi.createDeviceMoldItems(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await DeviceMoldItemsApi.updateDeviceMoldItems(data) openDataNew.value = data
message.success(t('common.updateSuccess')) if(judgeSame()){
basicFormRef.value.dialogVisible = false
getList()
}else{
updateData.value = data
dialogVisible.value = true
}
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
getList() getList()
@ -181,11 +229,8 @@ const handleDelete = async (id: number) => {
try { try {
// //
await message.delConfirm() await message.delConfirm()
//
await DeviceMoldItemsApi.deleteDeviceMoldItems(id) dialogVisible.value = true
message.success(t('common.delSuccess'))
//
await getList()
} catch {} } catch {}
} }
@ -216,6 +261,51 @@ const searchFormClick = (searchData) => {
getList() // getList() //
} }
const onSubmit = async () => {
console.log('submit!');
updateData.value.remark = updateFormValue.remark
try {
if(operatType.value == 'edit'){
await DeviceMoldItemsApi.updateDeviceMoldItems(updateData.value);
message.success(t('common.updateSuccess'));
// ""
basicFormRef.value.dialogVisible = false; // basicFormRef
dialogVisible.value = false; // updateDialog
}else if(operatType.value == 'delete'){
//
await DeviceMoldItemsApi.deleteDeviceMoldItems(updateData.value.id,updateData.value.remark)
message.success(t('common.delSuccess'))
dialogVisible.value = false;
}
//
await getList()
} catch (error) {
console.error(error);
// basicFormRef
// updateDialog
message.error(t('common.updateFailed'));
}
};
const handleBeforeClose = async(done)=>{
basicFormRef.value.formLoading = false
done()
}
//
const judgeSame = () => {
// openDataOld.value
const keys = Object.keys(openDataOld.value);
// 使every()
const isSame = keys.every(key => {
// openDataNew.value
return openDataNew.value.hasOwnProperty(key) && openDataOld.value[key] === openDataNew.value[key];
});
//
return isSame;
};
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

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

@ -53,6 +53,33 @@
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="MoldMaintenance.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="MoldMaintenance.allSchemas" />
<Dialog
ref="updateDialog"
title="本次修改修改描述"
v-model="dialogVisible"
:width="600"
:maxHeight="700"
:style="{height:'450px'}"
:before-close="handleBeforeClose"
>
<el-form :model="updateFormValue" class="demo-form-inline">
<el-form-item label="备注">
<el-input
type="textarea"
v-model="updateFormValue.remark"
placeholder="请对本次修改内容添加备注"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="onSubmit">提交</el-button>
</div>
</template>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -60,8 +87,8 @@ import download from '@/utils/download'
import { MoldMaintenance,MoldMaintenanceRules } from './moldMaintenance.data' import { MoldMaintenance,MoldMaintenanceRules } from './moldMaintenance.data'
import * as MoldMaintenanceApi from '@/api/eam/basic/moldMaintenance' import * as MoldMaintenanceApi from '@/api/eam/basic/moldMaintenance'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import { useUserStore } from '@/store/modules/user'
import Detail from '@/components/Detail/src/Detail.vue' const userStore = useUserStore() //
defineOptions({ name: 'MoldMaintenance' }) defineOptions({ name: 'MoldMaintenance' })
@ -71,6 +98,15 @@ const route = useRoute() // 路由信息
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(MoldMaintenance.allSchemas.tableColumns) const tableColumns = ref(MoldMaintenance.allSchemas.tableColumns)
const updateDialog = ref()
const dialogVisible = ref(false)
const updateData = ref()
const updateFormValue = reactive({
remark: '',
})
const openDataOld = ref()
const openDataNew = ref()
const operatType = ref('')
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -133,8 +169,11 @@ const butttondata = [
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //
operatType.value = 'edit'
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
operatType.value = 'delete'
updateData.value = row
handleDelete(row.id) handleDelete(row.id)
} }
} }
@ -142,6 +181,8 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
openDataOld.value = row
updateFormValue.remark = ''
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
@ -162,8 +203,14 @@ const formsSuccess = async (formType,data) => {
await MoldMaintenanceApi.createDeviceMoldItems(data) await MoldMaintenanceApi.createDeviceMoldItems(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await MoldMaintenanceApi.updateDeviceMoldItems(data) openDataNew.value = data
message.success(t('common.updateSuccess')) if(judgeSame()){
basicFormRef.value.dialogVisible = false
getList()
}else{
updateData.value = data
dialogVisible.value = true
}
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
getList() getList()
@ -180,10 +227,8 @@ const handleDelete = async (id: number) => {
try { try {
// //
await message.delConfirm() await message.delConfirm()
//
await MoldMaintenanceApi.deleteDeviceMoldItems(id) dialogVisible.value = true
message.success(t('common.delSuccess'))
//
await getList() await getList()
} catch {} } catch {}
} }
@ -215,6 +260,64 @@ const searchFormClick = (searchData) => {
getList() // getList() //
} }
const onSubmit = async () => {
console.log('submit!');
updateData.value.remark = updateFormValue.remark
try {
if(operatType.value == 'edit'){
await MoldMaintenanceApi.updateDeviceMoldItems(updateData.value);
message.success(t('common.updateSuccess'));
// ""
basicFormRef.value.dialogVisible = false; // basicFormRef
dialogVisible.value = false; // updateDialog
}else if(operatType.value == 'delete'){
//
await MoldMaintenanceApi.deleteDeviceMoldItems(updateData.value.id,updateData.value.remark)
message.success(t('common.delSuccess'))
dialogVisible.value = false;
}
} catch (error) {
console.error(error);
// basicFormRef
// updateDialog
message.error(t('common.updateFailed'));
}
};
const handleBeforeClose = async(done)=>{
basicFormRef.value.formLoading = false
done()
}
//
const judgeSame = () => {
// openDataOld.value
const keys = Object.keys(openDataOld.value);
// 使every()
const isSame = keys.every(key => {
// openDataNew.value
return openDataNew.value.hasOwnProperty(key) && openDataOld.value[key] === openDataNew.value[key];
});
//
return isSame;
};
const judgeIsTheClassEngineer = (row) => {
const rolesOk = userStore.roles.find(item => {
return item == 'device_class_Engineer_role'
})
if (rolesOk != undefined && rolesOk != null) {
return true
} else {
return false
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

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

@ -215,6 +215,37 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
dateFormat:'YYYY-MM-DD HH:mm:ss' dateFormat:'YYYY-MM-DD HH:mm:ss'
} }
}, },
{
label: '审批人',
field: 'verifyer',
sort: 'custom',
isSearch: false,
isTableForm: false,
isForm: false,
isDetail: false,
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
},
{
label: '审批人',
field: 'verifyerDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '审批意见',
field: 'verifyContent',
sort: 'custom',
isSearch: false,
isTableForm: false,
isForm: false,
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
@ -234,26 +265,22 @@ export const DeviceMaintainOrderDetailRules = reactive({
concurrencyStamp: [required], concurrencyStamp: [required],
name: [required], name: [required],
number: [required], number: [required],
status: [required],
peoples: [ peoples: [
required, required,
{ validator:validateNum, message: '请输入正整数', trigger: 'blur'}, { validator:validateNum, message: '请输入正整数', trigger: 'blur'},
{ validator:validateNum100, message: '预估人数不得超出100', trigger: 'blur'}, { validator:validateNum100, message: '预估人数不得超出100', trigger: 'blur'},
], ],
estimatedMinutes: [ estimatedMinutes: [
required, required,
{ validator:validateNum, message: '请输入正整数', trigger: 'blur'}, { validator:validateNum, message: '请输入正整数', trigger: 'blur'},
], ],
actualMinutes: [ actualMinutes: [
required, required,
{ validator:validateNum, message: '请输入正整数', trigger: 'blur'}, { validator:validateNum, message: '请输入正整数', trigger: 'blur'},
], ],
chargePeoples: [required], chargePeoples: [required],
completionTime: [required], completionTime: [required],
engineer: [required],
uncompleted: [required], uncompleted: [required],
contents: [required], contents: [required],
}) })
@ -338,7 +365,6 @@ export const DeviceMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
}, },
api: () => dutyUserList, api: () => dutyUserList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userList.filter(item=>cellValue?.includes(item.id)).map(cur=>cur.name).join(',') return userList.filter(item=>cellValue?.includes(item.id)).map(cur=>cur.name).join(',')
}, },
form: { form: {
@ -493,7 +519,7 @@ export const DeviceMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
component: 'Input', component: 'Input',
componentProps: { componentProps: {
type:'TextArea' type:'textarea'
} }
} }
}, },

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

@ -96,6 +96,33 @@
@success="importSuccess" @success="importSuccess"
/> />
<Dialog
ref="updateDialog"
title="验证意见"
v-model="dialogVisible"
:width="600"
:maxHeight="700"
:style="{height:'450px'}"
:before-close="handleBeforeClose"
>
<el-form :model="updateFormValue" class="demo-form-inline">
<el-form-item label="验证意见">
<el-input
type="textarea"
v-model="updateFormValue.verifyContent"
placeholder="请填写验证意见"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="onCancel">取消</el-button>
<el-button type="primary" @click="onSubmit">提交</el-button>
</div>
</template>
</Dialog>
</template> </template>
@ -112,6 +139,8 @@ import * as DeviceMaintainOrderDetailApi from '@/api/eam/device/deviceMaintainOr
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' import * as UserApi from '@/api/system/user'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
defineOptions({ name: 'DeviceMaintainOrderMain' }) defineOptions({ name: 'DeviceMaintainOrderMain' })
const message = useMessage() // const message = useMessage() //
@ -123,6 +152,11 @@ const formRef = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(DeviceMaintainOrderMain.allSchemas.tableColumns) const tableColumns = ref(DeviceMaintainOrderMain.allSchemas.tableColumns)
const tableData = ref([]) const tableData = ref([])
const dialogVisible = ref(false)
const dialogRowData = ref()
const updateFormValue = ref({
verifyContent:''
})
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
@ -228,20 +262,16 @@ const butttondata = (row) => {
row.status == 'PENDING' && judgeIsTheClass(row) row.status == 'PENDING' && judgeIsTheClass(row)
) )
}), // }), //
// defaultButtons.turnOrderBtn({ defaultButtons.maintainBtn({
// hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
// }), // }),//
// defaultButtons.repairBtn({
// hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
// }), //
// defaultButtons.verifyOrderBtn({
// hide: !(
// row.status == 'COMPLETED'
// )
// }), //
defaultButtons.finishOrderBtn({ defaultButtons.finishOrderBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
}) // }), //
defaultButtons.verifyOrderBtn({
hide: !(row.status == 'COMPLETED' && judgeIsTheClassEngineer(row))
}), //
] ]
} }
const onChange = (field, cur, item) => { const onChange = (field, cur, item) => {
@ -265,6 +295,10 @@ const buttonTableClick = async (val, row) => {
acceptOrder(row) acceptOrder(row)
} else if (val == 'turnOrder') { } else if (val == 'turnOrder') {
openForm('turnOrder', row) openForm('turnOrder', row)
} else if (val == 'maintain') {
openDetail(row, '代码', row.number)
} else if (val == 'verifyOrder') {
openDialog(row)
} else if (val == 'finishOrder') { } else if (val == 'finishOrder') {
finishOrder(row) finishOrder(row)
} }
@ -280,11 +314,9 @@ const openForm = (type: string, row?: any) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail =async (row: any, titleName: any, titleValue: any) => { const openDetail =async (row: any, titleName: any, titleValue: any) => {
const deviceListAll = await DeviceAccountsApi.getDeviceAccountsAllNoPage({})
const userListAll = await UserApi.getSimpleUserList() const userListAll = await UserApi.getSimpleUserList()
row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name
row.maintenanceName = userListAll.find((account) => account.id == row.maintenance)?.nickname row.maintenanceName = userListAll.find((account) => account.id == row.maintenance)?.nickname
row.verifyerDetail = userListAll.find((account) => account.id == row.verifyer)?.nickname
detailRef.value.openDetail(row, titleName, titleValue,'DeviceMaintainOrderMain') detailRef.value.openDetail(row, titleName, titleValue,'DeviceMaintainOrderMain')
} }
@ -578,4 +610,32 @@ const openFormCallBack = (type, row, masterParmas, callback) => {
callback() callback()
} }
const judgeIsTheClassEngineer = (row) => {
const rolesOk = userStore.roles.find(item => {
return item == 'device_class_Engineer_role'
})
if (rolesOk != undefined && rolesOk != null) {
return true
} else {
return false
}
}
const openDialog = (row) => {
dialogRowData.value = row
dialogVisible.value = true
}
const onCancel = () => {
dialogVisible.value = false
}
const onSubmit = () => {
DeviceMaintainOrderMainApi.orderClickApprove(dialogRowData.value.id,'VERIFIED',updateFormValue.value.verifyContent)
dialogVisible.value = false
getList()
}
</script> </script>

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

@ -334,6 +334,129 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.ORDER_COMPLETE_RESULT, dictType: DICT_TYPE.ORDER_COMPLETE_RESULT,
dictClass: 'string', dictClass: 'string',
}, },
{
label: '报修人',
field: 'declarer',
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: 'declarerDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
table: {
width: 150
}
},
{
label: '报修人意见',
field: 'applyContent',
sort: 'custom',
table: {
width: 150
}
},
{
label: '验证人',
field: 'verifyer',
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: 'verifyerDetail',
sort: 'custom',
table: {
width: 150
},
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '验证人意见',
field: 'verifyContent',
sort: 'custom',
table: {
width: 150
}
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',

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

@ -143,6 +143,68 @@
</template> </template>
</Dialog> </Dialog>
<Dialog
ref="confirmDialog"
title="确认意见"
v-model="confirmDialogVisible"
:width="600"
:maxHeight="760"
:style="{height:'500px'}"
:before-close="handleBeforeConfirmClose"
>
<el-form class="demo-form-inline">
<el-form-item label="确认意见">
<!-- 确保@change事件绑定在el-radio-group上 -->
<el-radio-group v-model="confirmFormValue.confirmStatus">
<el-radio :label="'APPLYPASS'">通过</el-radio>
<el-radio :label="'APPLYREJECTED'">驳回</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="意见">
<el-input
type="textarea"
v-model="confirmFormValue.confirmContent"
placeholder="请填写意见"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="confirmCancel">取消</el-button>
<el-button type="primary" @click="confirmSubmit">提交</el-button>
</div>
</template>
</Dialog>
<Dialog
ref="verifyDialog"
title="验证意见"
v-model="verifyDialogVisible"
:width="600"
:maxHeight="700"
:style="{height:'450px'}"
:before-close="handleBeforeVerifyClose"
>
<el-form :model="verifyFormValue" class="demo-form-inline">
<el-form-item label="验证意见">
<el-input
type="textarea"
v-model="verifyFormValue.verifyContent"
placeholder="请填写验证意见"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="verifyCancel">取消</el-button>
<el-button type="primary" @click="verifySubmit">提交</el-button>
</div>
</template>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -168,6 +230,8 @@ import { selectAllFactoryArea } from '@/api/system/dept'
import { ItemSearchTable } from '../../basic/item/item.data' import { ItemSearchTable } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item' import * as ItemApi from '@/api/eam/basic/item'
import { emit } from 'process' import { emit } from 'process'
import { verify } from 'crypto'
import { watch } from 'vue';
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD') const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD')
defineOptions({ name: 'DeviceMaintenanceMain' }) defineOptions({ name: 'DeviceMaintenanceMain' })
@ -195,10 +259,20 @@ const tempIdeaRefViewKey = ref(0)
const tempIdeaRefViewTitle = ref('是否临时措施') const tempIdeaRefViewTitle = ref('是否临时措施')
const isTemporary = ref(false) const isTemporary = ref(false)
const tempIdeaRefViewData = ref() const tempIdeaRefViewData = ref()
const confirmDialogVisible = ref(false)
const verifyDialogVisible = ref(false)
const confirmFormValue = ref({
confirmStatus: 'APPLYPASS',
confirmContent: '',
})
const verifyFormValue = ref({
verifyContent: '',
})
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
const openRowValue = ref()
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(() => {
@ -296,6 +370,37 @@ const judgeIsTheClassEngineer = (row) => {
} }
} }
const judgeIsTheClassEngineerAndApply = (row,type) => {
//
const rolesOk = userStore.roles.some(item => {
if (row.type == 'DEVICE') {
return item === 'device_class_Engineer_role';
} else if (row.type == 'TECH') {
return item === 'tech_class_Engineer_role';
}
});
// false
if (!rolesOk) return false;
//
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') {
// APPLYPASStrue
//
return true;
}
// COMPLETEDAPPLYPASSCOMPLETEDfalse
return false;
}
const judgeIsTheClassWorker = (row) => { const judgeIsTheClassWorker = (row) => {
const rolesOk = userStore.roles.find(item => { const rolesOk = userStore.roles.find(item => {
if (row.type == 'DEVICE') { if (row.type == 'DEVICE') {
@ -361,7 +466,7 @@ const isShowMainButton = (row, val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance) )}), // defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && row.status != 'APPLYPASS' && isReceiver(row.maintenance) )}), //
defaultButtons.acceptOrderBtn({ defaultButtons.acceptOrderBtn({
hide: !( hide: !(
row.status == 'PENDING' && judgeIsTheClass(row) row.status == 'PENDING' && judgeIsTheClass(row)
@ -375,12 +480,17 @@ const butttondata = (row) => {
}), // }), //
defaultButtons.verifyOrderBtn({ defaultButtons.verifyOrderBtn({
hide: !( hide: !(
row.status == 'COMPLETED' && judgeIsTheClassEngineer(row) judgeIsTheClassEngineerAndApply(row,'VERIFY')
) )
}), // }), //
defaultButtons.finishOrderBtn({ defaultButtons.finishOrderBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && row.hasDetails) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && row.hasDetails)
}), // }), //
defaultButtons.confirmOrderBtn({
hide: !(
judgeIsTheClassEngineerAndApply(row,'CONFIRM')
)
}), //
defaultButtons.pictureBtn({ defaultButtons.pictureBtn({
hide: !(row.filePathList != null && row.filePathList.length > 0) hide: !(row.filePathList != null && row.filePathList.length > 0)
}) // }) //
@ -417,19 +527,14 @@ const onChangeSec = (field, cur, item,formRefSec) => {
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = moldList.value }).componentProps.options = moldList.value
selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: null }).then(res => { MoldAccountsApi.getMoldAccountsNoPage({}).then(res => {
repairUser.value = res
const setV = {} const setV = {}
setV['deviceNumber'] = ''
setV['maintenance'] = '' setV['maintenance'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.options = res }).componentProps.disabled = true
})
MoldAccountsApi.getMoldAccountsNoPage({}).then(res => {
const setV = {}
setV['deviceNumber'] = ''
formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = res }).componentProps.options = res
@ -438,19 +543,14 @@ const onChangeSec = (field, cur, item,formRefSec) => {
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = deviceList.value }).componentProps.options = deviceList.value
selecUserByType({ classType: 'TECH', factoryAreaNumber: '', flag: null }).then(res => { DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
repairUser.value = res
const setV = {} const setV = {}
setV['deviceNumber'] = ''
setV['maintenance'] = '' setV['maintenance'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.options = res }).componentProps.disabled = true
})
DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
const setV = {}
setV['deviceNumber'] = ''
formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = res }).componentProps.options = res
@ -459,19 +559,14 @@ const onChangeSec = (field, cur, item,formRefSec) => {
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = deviceList.value }).componentProps.options = deviceList.value
selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null }).then(res => { DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
repairUser.value = res
const setV = {} const setV = {}
setV['deviceNumber'] = ''
setV['maintenance'] = '' setV['maintenance'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.options = res }).componentProps.disabled = true
})
DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
const setV = {}
setV['deviceNumber'] = ''
formRefSec.setValues(setV)
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = res }).componentProps.options = res
@ -489,6 +584,7 @@ const onChangeSec = (field, cur, item,formRefSec) => {
setV['deviceNumber'] = newRow.value.deviceNumber setV['deviceNumber'] = newRow.value.deviceNumber
setV['type'] = newRow.value.type setV['type'] = newRow.value.type
formRefSec.setValues(setV) formRefSec.setValues(setV)
DeviceMaintenanceMainSecRules.maintenance = [{ required: false }]
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'type' return item.field == 'type'
}).componentProps.disabled = false }).componentProps.disabled = false
@ -536,6 +632,7 @@ const onChangeSec = (field, cur, item,formRefSec) => {
setV['factoryAreaNumber'] = newRow.value.factoryAreaNumber setV['factoryAreaNumber'] = newRow.value.factoryAreaNumber
setV['maintenance'] = newRow.value.maintenance setV['maintenance'] = newRow.value.maintenance
formRefSec.setValues(setV) formRefSec.setValues(setV)
DeviceMaintenanceMainSecRules.maintenance = [{ required: true }]
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'type' return item.field == 'type'
}).componentProps.disabled = true }).componentProps.disabled = true
@ -628,6 +725,8 @@ const buttonTableClick = async (val, row) => {
finishOrder(row) finishOrder(row)
} else if (val == 'verifyOrder') { } else if (val == 'verifyOrder') {
verifyOrder(row) verifyOrder(row)
} else if (val == 'confirmOrder') {
confirmOrder(row)
} else if (val == 'picture') { } else if (val == 'picture') {
showView.value = true showView.value = true
urls.value = row.filePathList urls.value = row.filePathList
@ -650,6 +749,10 @@ const openFormSec = async (type: string, row?: any) => {
tableData.value = [] // tableData.value = [] //
newRow.value = { ...row } newRow.value = { ...row }
newRow.value.turnType = '0' newRow.value.turnType = '0'
DeviceMaintenanceMainSecRules.classes = [{ required: false }]
DeviceMaintenanceMainSecRules.faultType = [{ required: false }]
DeviceMaintenanceMainSecRules.describes = [{ required: false }]
DeviceMaintenanceMainSecRules.maintenance = [{ required: false }]
DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => { DeviceMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'type' return item.field == 'type'
}).componentProps.disabled = false }).componentProps.disabled = false
@ -703,6 +806,8 @@ const openDetail = async (row: any, titleName: any, titleValue: any) => {
row.deviceNumberDetail = moldAllList.find((account) => account.number == row.deviceNumber)?.name row.deviceNumberDetail = moldAllList.find((account) => account.number == row.deviceNumber)?.name
row.factoryAreaNumberDetail = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name row.factoryAreaNumberDetail = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name
row.maintenanceDetail = userListAll.find((account) => account.id == row.maintenance)?.nickname row.maintenanceDetail = userListAll.find((account) => account.id == row.maintenance)?.nickname
row.declarerDetail = userListAll.find((account) => account.id == row.declarer)?.nickname
row.verifyerDetail = userListAll.find((account) => account.id == row.verifyer)?.nickname
console.log(row) console.log(row)
operatRecord.value = row; operatRecord.value = row;
detailRef.value.openDetail(row, titleName, titleValue,'DeviceMaintenanceMain') detailRef.value.openDetail(row, titleName, titleValue,'DeviceMaintenanceMain')
@ -799,17 +904,61 @@ function confirmFinish(row) {
// //
function verifyOrder(row) { function verifyOrder(row) {
openRowValue.value = row
verifyDialogVisible.value = true
}
//
function verifySubmit() {
const row = openRowValue.value
let param = { let param = {
id: row.id, id: row.id,
number: row.number, number: row.number,
status: row.status, status: row.status,
requestNumber: row.requestNumber, requestNumber: row.requestNumber,
content: verifyFormValue.value.verifyContent
} }
DeviceMaintenanceMainApi.verifyOrder(param).then(res => { DeviceMaintenanceMainApi.verifyOrder(param).then(res => {
verifyDialogVisible.value = false
getList() getList()
message.success('操作成功') message.success('操作成功')
}) })
} }
//
function verifyCancel(row) {
verifyDialogVisible.value = false
}
//
function confirmOrder(row) {
openRowValue.value = row
confirmDialogVisible.value = true
}
//
function confirmSubmit() {
const row = openRowValue.value
let param = {
id: row.id,
number: row.number,
status: row.status,
result: confirmFormValue.value.confirmStatus,
requestNumber: row.requestNumber,
content: confirmFormValue.value.confirmContent,
}
DeviceMaintenanceMainApi.confirmOrder(param).then(res => {
confirmDialogVisible.value = false
getList()
message.success('操作成功')
})
}
//
function confirmCancel(row) {
confirmDialogVisible.value = false
}
// //
function repair() {} function repair() {}
@ -1077,6 +1226,7 @@ const validateRow = (row) => {
return true; return true;
}; };
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

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

@ -95,6 +95,36 @@
:importTemplateData="importTemplateData" :importTemplateData="importTemplateData"
@success="importSuccess" @success="importSuccess"
/> />
<Dialog
ref="updateDialog"
title="验证意见"
v-model="dialogVisible"
:width="600"
:maxHeight="700"
:style="{height:'450px'}"
:before-close="handleBeforeClose"
>
<el-form :model="updateFormValue" class="demo-form-inline">
<el-form-item label="验证意见">
<el-input
type="textarea"
v-model="updateFormValue.verifyContent"
placeholder="请填写验证意见"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="onCancel">取消</el-button>
<el-button type="primary" @click="onSubmit">提交</el-button>
</div>
</template>
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -124,6 +154,11 @@ const tableColumns = ref(MoldMaintainOrderMain.allSchemas.tableColumns)
const apiPage = ref(MoldMaintainOrderDetailApi.getMoldMaintainOrderDetailPage) const apiPage = ref(MoldMaintainOrderDetailApi.getMoldMaintainOrderDetailPage)
const detailAllSchemas = ref(MoldMaintainOrderDetail.allSchemas) const detailAllSchemas = ref(MoldMaintainOrderDetail.allSchemas)
const tableData = ref([]) const tableData = ref([])
const updateFormValue = ref({
verifyContent:''
})
const dialogVisible = ref(false)
const dialogRowData = ref()
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
@ -228,20 +263,15 @@ const butttondata = (row) => {
row.status == 'PENDING' && judgeIsTheClass(row) row.status == 'PENDING' && judgeIsTheClass(row)
) )
}), // }), //
// defaultButtons.turnOrderBtn({ defaultButtons.maintainBtn({
// hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
// }), // }),//
// defaultButtons.repairBtn({
// hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
// }), //
// defaultButtons.verifyOrderBtn({
// hide: !(
// row.status == 'COMPLETED'
// )
// }), //
defaultButtons.finishOrderBtn({ defaultButtons.finishOrderBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
}) // }), //
defaultButtons.verifyOrderBtn({
hide: !(row.status == 'COMPLETED' && judgeIsTheClassEngineer(row))
}), //
] ]
} }
const onChange = (field, cur, item) => { const onChange = (field, cur, item) => {
@ -267,6 +297,10 @@ const buttonTableClick = async (val, row) => {
acceptOrder(row) acceptOrder(row)
} else if (val == 'turnOrder') { } else if (val == 'turnOrder') {
openForm('turnOrder', row) openForm('turnOrder', row)
} else if (val == 'maintain') {
openDetail(row, '代码', row.number)
} else if (val == 'verifyOrder') {
openDialog(row)
} else if (val == 'finishOrder') { } else if (val == 'finishOrder') {
finishOrder(row) finishOrder(row)
} }
@ -286,6 +320,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any) => {
row.maintenanceName = userListAll.find((account) => account.id == row.maintenance)?.nickname row.maintenanceName = userListAll.find((account) => account.id == row.maintenance)?.nickname
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name row.factoryAreaNumber1 = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name
row.verifyerDetail = userListAll.find((account) => account.id == row.verifyer)?.nickname
detailRef.value.openDetail(row, titleName, titleValue,'MoldMaintainOrderMain') detailRef.value.openDetail(row, titleName, titleValue,'MoldMaintainOrderMain')
} }
@ -353,6 +388,17 @@ function acceptOrder(row) {
function turnOrder() {} function turnOrder() {}
// //
function finishOrder(row) { function finishOrder(row) {
// MoldMaintainOrderDetailApi.getMoldMaintainOrderDetailPage({
// masterId: row.id,
// isSearch: false,
// status: 0,
// }).then(( res) => {
// if (res.data.length === 0) {
// message.warning('')
// return
// }
// })
MoldMaintainOrderMainApi.orderClickFinish(row.id).then(() => { MoldMaintainOrderMainApi.orderClickFinish(row.id).then(() => {
message.success('完成保养') message.success('完成保养')
getList(); getList();
@ -576,6 +622,32 @@ const judgeIsTheClass = (row) => {
} }
} }
const judgeIsTheClassEngineer = (row) => {
const rolesOk = userStore.roles.find(item => {
return item == 'mold_class_Engineer_role'
})
if (rolesOk != undefined && rolesOk != null) {
return true
} else {
return false
}
}
const openDialog = (row) => {
dialogRowData.value = row
dialogVisible.value = true
}
const onCancel = () => {
dialogVisible.value = false
}
const onSubmit = (val) => {
MoldMaintainOrderMainApi.orderClickApprove(dialogRowData.value.id,'VERIFIED',updateFormValue.value.verifyContent)
dialogVisible.value = false
getList()
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {

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

@ -5,6 +5,9 @@ import { dateFormatter } from '@/utils/formatTime'
import { ItemSearchTable } from '../../basic/item/item.data' import { ItemSearchTable } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item' import * as ItemApi from '@/api/eam/basic/item'
import { validateNum,validateNum100 } from '@/utils/validator' import { validateNum,validateNum100 } from '@/utils/validator'
import * as UserApi from '@/api/system/user'
const userListAll = await UserApi.getSimpleUserList()
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
const userList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 }) const userList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 })
const dutyUserList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: undefined }) const dutyUserList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: undefined })
@ -150,6 +153,10 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '接单人员', label: '接单人员',
field: 'maintenance', field: 'maintenance',
sort: 'custom', sort: 'custom',
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
isSearch: false, isSearch: false,
table: { table: {
width: '150', width: '150',
@ -209,7 +216,37 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
dateFormat:'YYYY-MM-DD HH:mm:ss' dateFormat:'YYYY-MM-DD HH:mm:ss'
} }
}, },
{
label: '审批人',
field: 'verifyer',
sort: 'custom',
isSearch: false,
isTableForm: false,
isForm: false,
isDetail: false,
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
},
{
label: '审批人',
field: 'verifyerDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '审批意见',
field: 'verifyContent',
sort: 'custom',
isSearch: false,
isTableForm: false,
isForm: false,
},
// { // {
// label: '创建时间', // label: '创建时间',
// field: 'createTime', // field: 'createTime',
@ -266,6 +303,7 @@ export const MoldMaintainOrderDetailRules = reactive({
concurrencyStamp: [required], concurrencyStamp: [required],
name: [required], name: [required],
number: [required], number: [required],
status: [required],
peoples: [ peoples: [
required, required,
{ validator: validateNum, message: '请输入正整数', trigger: 'blur' }, { validator: validateNum, message: '请输入正整数', trigger: 'blur' },
@ -515,8 +553,6 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false, isSearch: false,
isTableForm: false, isTableForm: false,
}, },
{ {
label: '工程师确认', label: '工程师确认',
field: 'engineer', field: 'engineer',
@ -525,7 +561,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
component: 'Input', component: 'Input',
componentProps: { componentProps: {
type: 'TextArea' type: 'textarea'
} }
} }
}, },

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

@ -142,7 +142,68 @@
</template> </template>
</Dialog> </Dialog>
<Dialog
ref="confirmDialog"
title="确认意见"
v-model="confirmDialogVisible"
:width="600"
:maxHeight="760"
:style="{height:'500px'}"
:before-close="handleBeforeConfirmClose"
>
<el-form class="demo-form-inline">
<el-form-item label="确认意见">
<!-- 确保@change事件绑定在el-radio-group上 -->
<el-radio-group v-model="confirmFormValue.confirmStatus">
<el-radio :label="'APPLYPASS'">通过</el-radio>
<el-radio :label="'APPLYREJECTED'">驳回</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="意见">
<el-input
type="textarea"
v-model="confirmFormValue.confirmContent"
placeholder="请填写意见"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="confirmCancel">取消</el-button>
<el-button type="primary" @click="confirmSubmit">提交</el-button>
</div>
</template>
</Dialog>
<Dialog
ref="verifyDialog"
title="验证意见"
v-model="verifyDialogVisible"
:width="600"
:maxHeight="700"
:style="{height:'450px'}"
:before-close="handleBeforeVerifyClose"
>
<el-form :model="verifyFormValue" class="demo-form-inline">
<el-form-item label="验证意见">
<el-input
type="textarea"
v-model="verifyFormValue.verifyContent"
placeholder="请填写验证意见"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="verifyCancel">取消</el-button>
<el-button type="primary" @click="verifySubmit">提交</el-button>
</div>
</template>
</Dialog>
</template> </template>
@ -190,6 +251,16 @@ const tempIdeaRefViewKey = ref(0)
const tempIdeaRefViewTitle = ref('是否临时措施') const tempIdeaRefViewTitle = ref('是否临时措施')
const isTemporary = ref(false) const isTemporary = ref(false)
const tempIdeaRefViewData = ref() const tempIdeaRefViewData = ref()
const confirmDialogVisible = ref(false)
const verifyDialogVisible = ref(false)
const confirmFormValue = ref({
confirmStatus: 'APPLYPASS',
confirmContent: '',
})
const verifyFormValue = ref({
verifyContent: '',
})
const openRowValue = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(MoldMaintenanceMain.allSchemas.tableColumns) const tableColumns = ref(MoldMaintenanceMain.allSchemas.tableColumns)
@ -362,7 +433,7 @@ const isShowMainButton = (row, val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance)) }), // defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && row.status != 'APPLYPASS' && isReceiver(row.maintenance) )}), //
defaultButtons.acceptOrderBtn({ defaultButtons.acceptOrderBtn({
hide: !( hide: !(
row.status == 'PENDING' && judgeIsTheClass(row) row.status == 'PENDING' && judgeIsTheClass(row)
@ -376,12 +447,17 @@ const butttondata = (row) => {
}), // }), //
defaultButtons.verifyOrderBtn({ defaultButtons.verifyOrderBtn({
hide: !( hide: !(
row.status == 'COMPLETED' && judgeIsTheClassEngineer(row) judgeIsTheClassEngineerAndApply(row,'VERIFY')
) )
}), // }), //
defaultButtons.finishOrderBtn({ defaultButtons.finishOrderBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && row.hasDetails) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && row.hasDetails)
}), // }), //
defaultButtons.confirmOrderBtn({
hide: !(
judgeIsTheClassEngineerAndApply(row,'CONFIRM')
)
}), //
defaultButtons.pictureBtn({ defaultButtons.pictureBtn({
hide: !(row.filePathList != null && row.filePathList.length > 0) hide: !(row.filePathList != null && row.filePathList.length > 0)
}) // }) //
@ -421,6 +497,8 @@ const buttonTableClick = async (val, row) => {
finishOrder(row) finishOrder(row)
} else if (val == 'verifyOrder') { } else if (val == 'verifyOrder') {
verifyOrder(row) verifyOrder(row)
} else if (val == 'confirmOrder') {
confirmOrder(row)
} else if (val == 'repair') { } else if (val == 'repair') {
openDetail(row, '代码', row.code) openDetail(row, '代码', row.code)
} else if (val == 'picture') { } else if (val == 'picture') {
@ -453,6 +531,8 @@ const openDetail = async (row: any, titleName: any, titleValue: any) => {
row.deviceNumberDetail = moldListAll.find((account) => account.number == row.deviceNumber)?.name row.deviceNumberDetail = moldListAll.find((account) => account.number == row.deviceNumber)?.name
row.factoryAreaNumberDetail = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name row.factoryAreaNumberDetail = factoryList.find((account) => account.id == row.factoryAreaNumber)?.name
row.maintenanceDetail = userListAll.find((account) => account.id == row.maintenance)?.nickname row.maintenanceDetail = userListAll.find((account) => account.id == row.maintenance)?.nickname
row.declarerDetail = userListAll.find((account) => account.id == row.declarer)?.nickname
row.verifyerDetail = userListAll.find((account) => account.id == row.verifyer)?.nickname
operatRecord.value = row; operatRecord.value = row;
detailRef.value.openDetail(row, titleName, titleValue,'MoldMaintenanceMain') detailRef.value.openDetail(row, titleName, titleValue,'MoldMaintenanceMain')
} }
@ -545,17 +625,61 @@ function confirmFinish(row) {
// //
function verifyOrder(row) { function verifyOrder(row) {
openRowValue.value = row
verifyDialogVisible.value = true
}
//
function verifySubmit() {
const row = openRowValue.value
let param = { let param = {
id: row.id, id: row.id,
number: row.number, number: row.number,
status: row.status, status: row.status,
requestNumber: row.requestNumber, requestNumber: row.requestNumber,
content: verifyFormValue.value.verifyContent
} }
MoldMaintenanceMainApi.verifyOrder(param).then(res => { MoldMaintenanceMainApi.verifyOrder(param).then(res => {
verifyDialogVisible.value = false
getList() getList()
message.success('操作成功') message.success('操作成功')
}) })
} }
//
function verifyCancel(row) {
verifyDialogVisible.value = false
}
//
function confirmOrder(row) {
openRowValue.value = row
confirmDialogVisible.value = true
}
//
function confirmSubmit() {
const row = openRowValue.value
let param = {
id: row.id,
number: row.number,
status: row.status,
result: confirmFormValue.value.confirmStatus,
requestNumber: row.requestNumber,
content: confirmFormValue.value.confirmContent,
}
MoldMaintenanceMainApi.confirmOrder(param).then(res => {
confirmDialogVisible.value = false
getList()
message.success('操作成功')
})
}
//
function confirmCancel(row) {
confirmDialogVisible.value = false
}
// //
function repair() {} function repair() {}
@ -718,6 +842,10 @@ const openFormSec = async (type: string, row?: any) => {
tableData.value = [] // tableData.value = [] //
newRow.value = { ...row } newRow.value = { ...row }
newRow.value.turnType = '0' newRow.value.turnType = '0'
MoldMaintenanceMainSecRules.classes = [{ required: false }]
MoldMaintenanceMainSecRules.faultType = [{ required: false }]
MoldMaintenanceMainSecRules.describes = [{ required: false }]
MoldMaintenanceMainSecRules.maintenance = [{ required: false }]
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'type' return item.field == 'type'
}).componentProps.disabled = false }).componentProps.disabled = false
@ -764,82 +892,50 @@ const openFormSec = async (type: string, row?: any) => {
const onChangeSec = (field, cur, item,formRefSec) => { const onChangeSec = (field, cur, item,formRefSec) => {
if (field == 'type') { if (field == 'type') {
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance'
}).componentProps.optionsAlias = {
labelField: 'name',
valueField: 'id'
}
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.disabled = false }).componentProps.disabled = false
if (cur == 'MOLD') { if (cur == 'MOLD') {
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = moldList.value
selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: null }).then(res => {
repairUser.value = res
const setV = {}
setV['maintenance'] = ''
formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance'
}).componentProps.options = res
})
MoldAccountsApi.getMoldAccountsNoPage({}).then(res => { MoldAccountsApi.getMoldAccountsNoPage({}).then(res => {
const setV = {} const setV = {}
setV['deviceNumber'] = '' setV['deviceNumber'] = ''
setV['maintenance'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = res }).componentProps.options = moldList.value
})
} else if (cur == 'TECH') {
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = deviceList.value
selecUserByType({ classType: 'TECH', factoryAreaNumber: '', flag: null }).then(res => {
repairUser.value = res
const setV = {}
setV['maintenance'] = ''
formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance'
}).componentProps.options = res }).componentProps.options = res
}) })
} else if (cur == 'TECH') {
DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => { DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
const setV = {} const setV = {}
setV['deviceNumber'] = '' setV['deviceNumber'] = ''
setV['maintenance'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = res
})
} else if(cur == 'DEVICE'){
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = deviceList.value }).componentProps.options = deviceList.value
selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null }).then(res => {
repairUser.value = res
const setV = {}
setV['maintenance'] = ''
formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'deviceNumber'
}).componentProps.options = res }).componentProps.options = res
}) })
} else if(cur == 'DEVICE'){
DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => { DeviceAccountsApi.getDeviceAccountsNoPage({}).then(res => {
const setV = {} const setV = {}
setV['deviceNumber'] = '' setV['deviceNumber'] = ''
setV['maintenance'] = ''
formRefSec.setValues(setV) formRefSec.setValues(setV)
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber'
}).componentProps.options = deviceList.value
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'deviceNumber' return item.field == 'deviceNumber'
}).componentProps.options = res }).componentProps.options = res
}) })
} }
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance'
}).componentProps.disabled = false
} }
if (field == 'turnType') { if (field == 'turnType') {
if (cur == '0') { if (cur == '0') {
@ -849,6 +945,7 @@ const onChangeSec = (field, cur, item,formRefSec) => {
setV['deviceNumber'] = newRow.value.deviceNumber setV['deviceNumber'] = newRow.value.deviceNumber
setV['type'] = newRow.value.type setV['type'] = newRow.value.type
formRefSec.setValues(setV) formRefSec.setValues(setV)
MoldMaintenanceMainSecRules.maintenance = [{ required: false }]
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'type' return item.field == 'type'
}).componentProps.disabled = false }).componentProps.disabled = false
@ -897,6 +994,7 @@ const onChangeSec = (field, cur, item,formRefSec) => {
setV['deviceNumber'] = newRow.value.deviceNumber setV['deviceNumber'] = newRow.value.deviceNumber
setV['type'] = newRow.value.type setV['type'] = newRow.value.type
formRefSec.setValues(setV) formRefSec.setValues(setV)
MoldMaintenanceMainSecRules.maintenance = [{ required: true }]
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'type' return item.field == 'type'
}).componentProps.disabled = true }).componentProps.disabled = true
@ -938,6 +1036,7 @@ const onChangeSec = (field, cur, item,formRefSec) => {
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.disabled = false }).componentProps.disabled = false
MoldMaintenanceMainSecRules.maintenance = [{ required: true }]
MoldMaintenanceMainSec.allSchemas.formSchema.find(item => { MoldMaintenanceMainSec.allSchemas.formSchema.find(item => {
return item.field == 'maintenance' return item.field == 'maintenance'
}).componentProps.options = res }).componentProps.options = res
@ -1037,6 +1136,39 @@ const validateRow = (row) => {
}; };
const judgeIsTheClassEngineerAndApply = (row,type) => {
//
const rolesOk = userStore.roles.some(item => {
if (row.type == 'MOLD') {
return item === 'mold_class_Engineer_role';
}
});
// false
if (!rolesOk) return false;
//
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') {
// APPLYPASStrue
//
return true;
}
// COMPLETEDAPPLYPASSCOMPLETEDfalse
return false;
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

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

@ -329,6 +329,128 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.ORDER_COMPLETE_RESULT, dictType: DICT_TYPE.ORDER_COMPLETE_RESULT,
dictClass: 'string', dictClass: 'string',
}, },
{
label: '报修人',
field: 'declarer',
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: 'declarerDetail',
sort: 'custom',
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
table: {
width: 150
}
},
{
label: '报修人意见',
field: 'applyContent',
sort: 'custom',
table: {
width: 150
}
},
{
label: '验证人',
field: 'verifyer',
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: 'verifyerDetail',
sort: 'custom',
table: {
width: 150
},
isDetail: true,
isForm: false,
isSearch: false,
isTable: false,
isTableForm: false,
},
{
label: '验证人意见',
field: 'verifyContent',
sort: 'custom',
table: {
width: 150
}
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
@ -636,7 +758,7 @@ export const MoldMaintenanceMainSec = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
{ {
label: '设备模具', label: '模具',
field: 'deviceNumber', field: 'deviceNumber',
sort: 'custom', sort: 'custom',
table: { table: {
@ -691,7 +813,6 @@ export const MoldMaintenanceMainSec = useCrudSchemas(reactive<CrudSchema[]>([
valueField: 'id' valueField: 'id'
}, },
filterable: true, filterable: true,
placeholder: "请先选择模具"
}, },
} }
}, },

Loading…
Cancel
Save