Browse Source

选定集和动态修改规则详情里按钮权限

master_hella_20240701
ljlong_2630 6 months ago
parent
commit
df4008433b
  1. 61
      src/api/eam/equipmentShutdown/index.ts
  2. 72
      src/api/eam/equipmentSigning/index.ts
  3. 7
      src/api/system/user/index.ts
  4. 20
      src/components/Detail/src/DetailLedger.vue
  5. 4
      src/utils/dict.ts
  6. 3
      src/views/eam/equipmentAccounts/equipmentAccounts.data.ts
  7. 112
      src/views/eam/equipmentShutdown/equipmentShutdown.data.ts
  8. 244
      src/views/eam/equipmentShutdown/index.vue
  9. 343
      src/views/eam/equipmentSigning/equipmentSigning.data.ts
  10. 263
      src/views/eam/equipmentSigning/index.vue
  11. 128
      src/views/eam/equipmentSpotCheckRecordDetail/equipmentSpotCheckRecordDetail.data.ts
  12. 156
      src/views/eam/equipmentTransferRecord/equipmentTransferRecord.data.ts
  13. 10
      src/views/eam/equipmentTransferRecord/index.vue
  14. 9
      src/views/qms/dynamicRule/index.vue
  15. 7
      src/views/qms/selectedSet/index.vue

61
src/api/eam/equipmentShutdown/index.ts

@ -0,0 +1,61 @@
import request from '@/config/axios'
export interface EquipmentShutdownVO {
id: number
equipmentCode: string
operationDate: Date
operationer: string
factoryAreaCode: string
workshopCode: string
workshopSectionCode: string
status: string
shutdownCause: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询设备停机记录列表
export const getEquipmentShutdownPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/equipment-shutdown/senior', data })
} else {
return await request.get({ url: `/eam/equipment-shutdown/page`, params })
}
}
// 查询设备停机记录详情
export const getEquipmentShutdown = async (id: number) => {
return await request.get({ url: `/eam/equipment-shutdown/get?id=` + id })
}
// 新增设备停机记录
export const createEquipmentShutdown = async (data: EquipmentShutdownVO) => {
return await request.post({ url: `/eam/equipment-shutdown/create`, data })
}
// 修改设备停机记录
export const updateEquipmentShutdown = async (data: EquipmentShutdownVO) => {
return await request.put({ url: `/eam/equipment-shutdown/update`, data })
}
// 删除设备停机记录
export const deleteEquipmentShutdown = async (id: number) => {
return await request.delete({ url: `/eam/equipment-shutdown/delete?id=` + id })
}
// 导出设备停机记录 Excel
export const exportEquipmentShutdown = async (params) => {
return await request.download({ url: `/eam/equipment-shutdown/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-shutdown/get-import-template' })
}

72
src/api/eam/equipmentSigning/index.ts

@ -0,0 +1,72 @@
import request from '@/config/axios'
export interface EquipmentSigningVO {
id: number
equipmentCode: string
operationDate: Date
operationer: string
operationDept: string
telephone: string
supplierCode: string
supplierPeople: string
supplierTelephone: string
status: string
approver: number
approveContent: string
approveTime: Date
autoExamine: string
autoAgree: string
directCreateRecord: string
storageLocation: string
factoryAreaCode: string
workshopCode: string
workshopSectionCode: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询设备到货签收记录列表
export const getEquipmentSigningPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/equipment-signing/senior', data })
} else {
return await request.get({ url: `/eam/equipment-signing/page`, params })
}
}
// 查询设备到货签收记录详情
export const getEquipmentSigning = async (id: number) => {
return await request.get({ url: `/eam/equipment-signing/get?id=` + id })
}
// 新增设备到货签收记录
export const createEquipmentSigning = async (data: EquipmentSigningVO) => {
return await request.post({ url: `/eam/equipment-signing/create`, data })
}
// 修改设备到货签收记录
export const updateEquipmentSigning = async (data: EquipmentSigningVO) => {
return await request.put({ url: `/eam/equipment-signing/update`, data })
}
// 删除设备到货签收记录
export const deleteEquipmentSigning = async (id: number) => {
return await request.delete({ url: `/eam/equipment-signing/delete?id=` + id })
}
// 导出设备到货签收记录 Excel
export const exportEquipmentSigning = async (params) => {
return await request.download({ url: `/eam/equipment-signing/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/equipment-signing/get-import-template' })
}

7
src/api/system/user/index.ts

@ -97,3 +97,10 @@ export const forgetPassword = (data : UserVO) => {
export const updatePassword = (data : UserVO) => {
return request.put({ url: '/system/user/updatePassword', data })
}
// 查询用户详情
export const getUserListByDeptIds = (data : Array<number>) => {
return request.post({ url: '/system/user/getUserListByDeptIds', data })
}

20
src/components/Detail/src/DetailLedger.vue

@ -216,6 +216,23 @@
@onBlur="onBlur"
@formFormDateChange="formFormDateChange"
/>
<Dialog
:title="dialogTitle"
v-model="dialogVisible"
:width="600"
:maxHeight="900"
:style="{height:'600px'}"
>
<Table
v-if="true"
:columns="dialogAllSchemasRef.tableColumns.filter(column => column.field !== 'action')"
:data="dialogTableObjectRef.tableList"
:loading="dialogTableObjectRef.loading"
:pagination="{ total: dialogTableObjectRef.total }"
v-model:pageSize="dialogTableObjectRef.pageSize"
v-model:currentPage="dialogTableObjectRef.currentPage"
/>
</Dialog>
</div>
</template>
@ -1123,6 +1140,7 @@ const dialogUploadNumber = ref()
const dialogUploadBusiCode = ref()
const dialogFormKey = ref(0)
const openDialog = async(row: any, titleName: any, titleValue: any) => {
debugger
const { tableObject, tableMethods } = useTable({
getListApi: props.dialogApiPage, //
defaultParams: getDialogParams(row)
@ -1140,7 +1158,7 @@ const openDialog = async(row: any, titleName: any, titleValue: any) => {
function getDialogParams(row: any) {
return {
number: row.number
'masterId': row.id
}
}

4
src/utils/dict.ts

@ -348,9 +348,9 @@ export enum DICT_TYPE {
SUBJECT = 'subject', //科目
REGION = 'region', //区域
PART_CLASS = 'part_class', //备件分类
FAILURE_DEGREE = 'failure_degree', // 紧急程度
FAILURE_DEGREE = 'failure_degree', // 故障紧急程度
FAILURE_REASON = 'failure_reason', //故障类型
REPAIR_DEGREE = 'repair_degree', //
REPAIR_DEGREE = 'repair_degree', //维修紧急程度
REPAIR_LEVEL = 'repair_level', //维修级别
IS_COMPLETED = 'is_completed', //是否完成
MAINTENANCE_CYCLE ='maintenance_cycle', // 保养周期

3
src/views/eam/equipmentAccounts/equipmentAccounts.data.ts

@ -1,8 +1,9 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { TableColumn } from '@/types/table'
import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import { validateHanset, validateNum, validateNum100 } from '@/utils/validator'
import { validateHanset, validateNum } from '@/utils/validator'
import { EquipmentSupplier } from '@/views/eam/equipmentSupplier/equipmentSupplier.data'
import * as EquipmentSupplierApi from '@/api/eam/equipmentSupplier'
import { EquipmentManufacturer } from '@/views/eam/equipmentManufacturer/equipmentManufacturer.data'

112
src/views/eam/equipmentShutdown/equipmentShutdown.data.ts

@ -0,0 +1,112 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const EquipmentShutdownRules = reactive({
equipmentCode: [required],
operationDate: [required],
concurrencyStamp: [required]
})
export const EquipmentShutdown = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '设备编码',
field: 'equipmentCode',
sort: 'custom',
isSearch: true
},
{
label: '操作日期',
field: 'operationDate',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
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: 'operationer',
sort: 'custom',
isSearch: true
},
// {
// label: '所属厂区编号',
// field: 'factoryAreaCode',
// sort: 'custom',
// isSearch: true
// },
{
label: '车间编号',
field: 'workshopCode',
sort: 'custom',
isSearch: true
},
{
label: '工段编号',
field: 'workshopSectionCode',
sort: 'custom',
isSearch: false
},
{
label: '是否停机',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: false,
form: {
component: 'Radio'
}
},
{
label: '设备停机原因',
field: 'shutdownCause',
sort: 'custom',
isSearch: false
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false
},
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: true,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/equipmentShutdown/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentShutdown.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentShutdown.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="EquipmentShutdownRules"
:formAllSchemas="EquipmentShutdown.allSchemas"
:apiUpdate="EquipmentShutdownApi.updateEquipmentShutdown"
:apiCreate="EquipmentShutdownApi.createEquipmentShutdown"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentShutdown.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-shutdown/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentShutdown,EquipmentShutdownRules } from './equipmentShutdown.data'
import * as EquipmentShutdownApi from '@/api/eam/equipmentShutdown'
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: 'EquipmentShutdown' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(EquipmentShutdown.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: EquipmentShutdownApi.getEquipmentShutdownPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:equipment-shutdown:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:equipment-shutdown:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:equipment-shutdown: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:equipment-shutdown:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipment-shutdown: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 =EquipmentShutdown.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 EquipmentShutdownApi.createEquipmentShutdown(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentShutdownApi.updateEquipmentShutdown(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, 'basicEquipmentShutdown')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EquipmentShutdownApi.deleteEquipmentShutdown(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 EquipmentShutdownApi.exportEquipmentShutdown(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 EquipmentShutdownApi.importTemplate()
})
</script>

343
src/views/eam/equipmentSigning/equipmentSigning.data.ts

@ -0,0 +1,343 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import { handleTreeToComponentOptions } from '@/utils/tree'
import * as DeptApi from '@/api/system/dept'
import * as UserApi from '@/api/system/user'
import { EquipmentAccounts,EquipmentAccountsRules } from '../equipmentAccounts/equipmentAccounts.data'
import * as EquipmentAccountsApi from '@/api/eam/equipmentAccounts'
export interface User {
id: number,
nickname: string
}
const deptList = ref<Tree[]>([]) // 树形结构
const workshopNoPage = await WorkshopApi.getWorkshopNoPage({})
const userList = ref<User[]>([])
// 加载部门树(默认格式)
deptList.value = handleTreeToComponentOptions(await DeptApi.getSimpleDeptList())
// 表单校验
export const EquipmentSigningRules = reactive({
equipmentCode: [required],
operationDate: [required],
operationer: [required],
operationDept: [required],
supplierCode: [required],
status: [required],
storageLocation: [required],
concurrencyStamp: [required]
})
export const EquipmentSigning = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '设备编码',
field: 'equipmentCode',
sort: 'custom',
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择设备', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '设备信息', // 查询弹窗标题
searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类
searchPage: EquipmentAccountsApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
},
{
label: '验收日期',
field: 'operationDate',
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: 'operationDept',
sort: 'custom',
isSearch: true,
form: {
component: 'TreeSelect',
componentProps: { // 假设deptList是部门数据列表
data: deptList,
disabled: false,
placeholder: "请选择部门",
filterable: true,
multiple: false,
}
}
},
{
label: '验收人',
field: 'operationer',
sort: 'custom',
isSearch: true,
form: {
component: 'Select',
componentProps: { // 假设deptList是部门数据列表
options: [],
optionsAlias: {
valueField: 'id',
labelField: 'nickname'
},
disabled: false,
placeholder: "请先选择部门",
filterable: true,
multiple: false,
}
}
},
{
label: '验收人联系方式',
field: 'telephone',
sort: 'custom',
isSearch: false
},
{
label: '供应商编号',
field: 'supplierCode',
sort: 'custom',
isSearch: true
},
{
label: '供应商联系人',
field: 'supplierPeople',
sort: 'custom',
isSearch: true
},
{
label: '供应商联系方式',
field: 'supplierTelephone',
sort: 'custom',
isSearch: false
},
// {
// label: '流程状态',
// field: 'status',
// sort: 'custom',
// isSearch: true,
// dictType: DICT_TYPE.JOB_STATUS,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// form: {
// component: 'Select'
// }
// },
// {
// label: '审核人',
// field: 'approver',
// sort: 'custom',
// isSearch: true,
// form: {
// component: 'InputNumber',
// value: 0
// }
// },
// {
// label: '审核内容',
// field: 'approveContent',
// sort: 'custom',
// isSearch: false,
// form: {
// component: 'Input',
// componentProps: {
// type: 'textarea',
// valueHtml: '',
// height: 200
// }
// }
// },
// {
// label: '审核时间',
// field: 'approveTime',
// 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: 'autoExamine',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: false,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
// {
// label: '自动通过',
// field: 'autoAgree',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: false,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
// {
// label: '直接生成记录',
// field: 'directCreateRecord',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: false,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
{
label: '存放位置描述',
field: 'storageLocation',
sort: 'custom',
isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
placeholder: '请输入存放位置描述'
}
}
},
// {
// label: '所属厂区编号',
// field: 'factoryAreaCode',
// sort: 'custom',
// isSearch: false
// },
{
label: '车间编号',
field: 'workshopCode',
sort: 'custom',
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择车间代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
},
{
label: '产线编号',
field: 'lineCode',
sort: 'custom',
isSearch: true,
form: {
component: 'Select'
}
},
{
label: '工序编号',
field: 'processCode',
sort: 'custom',
isSearch: true,
form: {
component: 'Select'
}
},
{
label: '工位编号',
field: 'workstationCode',
sort: 'custom',
isSearch: true,
form: {
component: 'Select'
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false
},
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: true,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

263
src/views/eam/equipmentSigning/index.vue

@ -0,0 +1,263 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentSigning.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentSigning.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="EquipmentSigningRules"
:formAllSchemas="EquipmentSigning.allSchemas"
:apiUpdate="EquipmentSigningApi.updateEquipmentSigning"
:apiCreate="EquipmentSigningApi.createEquipmentSigning"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentSigning.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-signing/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentSigning,EquipmentSigningRules } from './equipmentSigning.data'
import * as EquipmentSigningApi from '@/api/eam/equipmentSigning'
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'
import * as UserApi from '@/api/system/user'
defineOptions({ name: 'EquipmentSigning' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
export interface User {
id: number,
nickname: string
}
const userList = ref<User[]>([])
routeName.value = route.name
const tableColumns = ref(EquipmentSigning.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: EquipmentSigningApi.getEquipmentSigningPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:equipment-signing:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:equipment-signing:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:equipment-signing: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:equipment-signing:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipment-signing: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 =EquipmentSigning.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 EquipmentSigningApi.createEquipmentSigning(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentSigningApi.updateEquipmentSigning(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, 'basicEquipmentSigning')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EquipmentSigningApi.deleteEquipmentSigning(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 EquipmentSigningApi.exportEquipmentSigning(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() //
}
const onChange = async (field, cur, formRef) => {
if(field == 'operationDept'){
userList.value = await UserApi.getUserListByDeptIds([cur])
EquipmentSigning.allSchemas.formSchema.find(item => item.field == 'operationer').componentProps.options = userList.value
let setV = {}
setV['operationer'] = ''
formRef.value.setValues(setV)
}
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EquipmentSigningApi.importTemplate()
})
</script>

128
src/views/eam/equipmentSpotCheckRecordDetail/equipmentSpotCheckRecordDetail.data.ts

@ -10,34 +10,28 @@ export const EquipmentSpotCheckRecordDetailRules = reactive({
})
export const EquipmentSpotCheckRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '点检工单号',
field: 'number',
sort: 'custom',
isSearch: true
},
{
label: '主表',
field: 'masterId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
// {
// label: '主表',
// field: 'masterId',
// sort: 'custom',
// isSearch: false,
// form: {
// component: 'InputNumber',
// value: 0
// }
// },
{
label: '完成时间',
field: 'completionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -58,27 +52,27 @@ export const EquipmentSpotCheckRecordDetail = useCrudSchemas(reactive<CrudSchema
label: '未完成原因',
field: 'uncompletedCause',
sort: 'custom',
isSearch: true
isSearch: false
},
{
label: '结果枚举',
field: 'result',
sort: 'custom',
dictType: DICT_TYPE.IS_COMPLETED,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true
dictType: DICT_TYPE.IS_COMPLETED,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: false
},
{
label: '名称自动带出',
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true
isSearch: false
},
{
label: '点检内容自动带出',
label: '点检内容',
field: 'content',
sort: 'custom',
isSearch: true,
isSearch: false,
form: {
component: 'Editor',
componentProps: {
@ -88,38 +82,16 @@ export const EquipmentSpotCheckRecordDetail = useCrudSchemas(reactive<CrudSchema
}
},
{
label: '点检部位自动带出',
label: '点检部位',
field: 'equipmentParts',
sort: 'custom',
isSearch: true
},
{
label: '点检方法自动带出',
label: '点检方法',
field: 'methods',
sort: 'custom',
isSearch: true
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
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')]
}
},
isForm: false
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: true
isSearch: false
},
{
label: '备注',
@ -127,66 +99,22 @@ export const EquipmentSpotCheckRecordDetail = useCrudSchemas(reactive<CrudSchema
sort: 'custom',
isSearch: true
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isSearch: true
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
formatter: dateFormatter,
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
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',
component: 'Switch',
value: 'TRUE',
componentProps: {
type: 'datetime',
valueFormat: 'x'
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '删除人',
field: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '操作',
field: 'action',

156
src/views/eam/equipmentTransferRecord/equipmentTransferRecord.data.ts

@ -8,12 +8,6 @@ export const EquipmentTransferRecordRules = reactive({
})
export const EquipmentTransferRecord = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false
},
{
label: '设备编码',
field: 'equipmentCode',
@ -24,19 +18,19 @@ export const EquipmentTransferRecord = useCrudSchemas(reactive<CrudSchema[]>([
label: '设备类型枚举',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: false,
form: {
component: 'Select'
}
},
{
label: '操作日期',
field: 'operationDate',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -57,14 +51,14 @@ export const EquipmentTransferRecord = useCrudSchemas(reactive<CrudSchema[]>([
label: '操作人',
field: 'operationer',
sort: 'custom',
isSearch: true
},
{
label: '原所属厂区编号',
field: 'beforeFactoryAreaCode',
sort: 'custom',
isSearch: true
isSearch: false
},
// {
// label: '原所属厂区编号',
// field: 'beforeFactoryAreaCode',
// sort: 'custom',
// isSearch: false
// },
{
label: '原地点',
field: 'beforeLocation',
@ -81,7 +75,7 @@ export const EquipmentTransferRecord = useCrudSchemas(reactive<CrudSchema[]>([
label: '原工段编号',
field: 'beforeWorkshopSectionCode',
sort: 'custom',
isSearch: true
isSearch: false
},
{
label: '现地点',
@ -89,12 +83,12 @@ export const EquipmentTransferRecord = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: true
},
{
label: '所属厂区编号',
field: 'factoryAreaCode',
sort: 'custom',
isSearch: true
},
// {
// label: '所属厂区编号',
// field: 'factoryAreaCode',
// sort: 'custom',
// isSearch: true
// },
{
label: '车间编号',
field: 'workshopCode',
@ -105,96 +99,24 @@ export const EquipmentTransferRecord = useCrudSchemas(reactive<CrudSchema[]>([
label: '工段编号',
field: 'workshopSectionCode',
sort: 'custom',
isSearch: true
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
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')]
}
},
isForm: false
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: true
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isSearch: true
},
{
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
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: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
isSearch: false
},
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: false,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
{
label: '操作',
field: 'action',

10
src/views/eam/equipmentTransferRecord/index.vue

@ -99,9 +99,9 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentTransferRecord:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentTransferRecord:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentTransferRecord:export'}), //
defaultButtons.defaultAddBtn({hasPermi:'eam:equipment-transfer-record:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:equipment-transfer-record:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:equipment-transfer-record:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -133,8 +133,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentTransferRecord:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentTransferRecord:delete'}), //
defaultButtons.mainListEditBtn({hasPermi:'eam:equipment-transfer-record:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipment-transfer-record:delete'}), //
]
// -

9
src/views/qms/dynamicRule/index.vue

@ -70,10 +70,10 @@
:apiPage="InspectionStageApi.getInspectionStagePage"
:apiDelete="InspectionStageApi.deleteInspectionStage"
:detailValidate="detailValidate"
@searchTableSuccessDetail="searchTableSuccessDetail"
:detailButtonIsShowEdit=true
:detailButtonIsShowAdd=true
:detailButtonIsShowDelete=true
@searchTableSuccessDetail="searchTableSuccessDetail"
:detailButtonIsShowEdit="checkPermi(['qms:inspection-stage:update'])"
:detailButtonIsShowAdd="checkPermi(['qms:inspection-stage:create'])"
:detailButtonIsShowDelete="checkPermi(['qms:inspection-stage:delete'])"
@detailOpenForm="detailOpenForm"
myFuncTypeSign="InspectionStage"
/>
@ -91,6 +91,7 @@ import * as InspectionStageApi from '@/api/qms/inspectionStage'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import UploadFile from '@/components/UploadFile/src/UploadFile.vue'
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'

7
src/views/qms/selectedSet/index.vue

@ -72,9 +72,9 @@
:apiDelete="SelectedProjectApi.deleteSelectedProject"
:detailValidate="detailValidate"
@searchTableSuccessDetail="searchTableSuccessDetail"
:detailButtonIsShowEdit=true
:detailButtonIsShowAdd=true
:detailButtonIsShowDelete=true
:detailButtonIsShowEdit="checkPermi(['qms:selected-project:update'])"
:detailButtonIsShowAdd="checkPermi(['qms:selected-project:create'])"
:detailButtonIsShowDelete="checkPermi(['qms:selected-project:delete'])"
@detailOpenForm="detailOpenForm"
@detailBasicFormOnChange="detailBasiFormOnChange"
:detailButtonIsShowFilter="false"
@ -94,6 +94,7 @@ import * as SelectedProjectApi from '@/api/qms/selectedProject'
import * as DictDataApi from '@/api/system/dict/dict.data'
import component from 'virtual:svg-icons-register'
import * as DictTypeApi from '@/api/system/dict/dict.type'
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'

Loading…
Cancel
Save