ljlong_2630
8 months ago
41 changed files with 3711 additions and 668 deletions
@ -0,0 +1,59 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface HolidayCalendarVO { |
|||
id: number |
|||
holidayDate: Date |
|||
endTime: Date |
|||
textOne: string |
|||
textTwo: string |
|||
textThree: string |
|||
textFour: string |
|||
textFive: string |
|||
deleteTime: Date |
|||
status: string |
|||
concurrencyStamp: number |
|||
remark: string |
|||
deleter: string |
|||
siteId: number |
|||
} |
|||
|
|||
// 查询节假日设置日历列表
|
|||
export const getHolidayCalendarPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/mes/holidayCalendar/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/holidayCalendar/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询节假日设置日历详情
|
|||
export const getHolidayCalendar = async (id: number) => { |
|||
return await request.get({ url: `/mes/holidayCalendar/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增节假日设置日历
|
|||
export const createHolidayCalendar = async (data: HolidayCalendarVO) => { |
|||
return await request.post({ url: `/mes/holidayCalendar/create`, data }) |
|||
} |
|||
|
|||
// 修改节假日设置日历
|
|||
export const updateHolidayCalendar = async (data: HolidayCalendarVO) => { |
|||
return await request.put({ url: `/mes/holidayCalendar/update`, data }) |
|||
} |
|||
|
|||
// 删除节假日设置日历
|
|||
export const deleteHolidayCalendar = async (id: number) => { |
|||
return await request.delete({ url: `/mes/holidayCalendar/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出节假日设置日历 Excel
|
|||
export const exportHolidayCalendar = async (params) => { |
|||
return await request.download({ url: `/mes/holidayCalendar/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/mes/holidayCalendar/get-import-template' }) |
|||
} |
@ -1,61 +0,0 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface HolidaySettingVO { |
|||
id: number |
|||
textOne: string |
|||
textTwo: string |
|||
textThree: string |
|||
textFour: string |
|||
textFive: string |
|||
deleteTime: Date |
|||
status: string |
|||
concurrencyStamp: number |
|||
remark: string |
|||
deleter: string |
|||
siteId: number |
|||
changeEmplId: number |
|||
holidayDate: Date |
|||
holidayFlag: string |
|||
holidayName: string |
|||
} |
|||
|
|||
// 查询节假日设置列表
|
|||
export const getHolidaySettingPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/mes/holidaySetting/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/holidaySetting/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询节假日设置详情
|
|||
export const getHolidaySetting = async (id: number) => { |
|||
return await request.get({ url: `/mes/holidaySetting/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增节假日设置
|
|||
export const createHolidaySetting = async (data: HolidaySettingVO) => { |
|||
return await request.post({ url: `/mes/holidaySetting/create`, data }) |
|||
} |
|||
|
|||
// 修改节假日设置
|
|||
export const updateHolidaySetting = async (data: HolidaySettingVO) => { |
|||
return await request.put({ url: `/mes/holidaySetting/update`, data }) |
|||
} |
|||
|
|||
// 删除节假日设置
|
|||
export const deleteHolidaySetting = async (id: number) => { |
|||
return await request.delete({ url: `/mes/holidaySetting/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出节假日设置 Excel
|
|||
export const exportHolidaySetting = async (params) => { |
|||
return await request.download({ url: `/mes/holidaySetting/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/mes/holidaySetting/get-import-template' }) |
|||
} |
@ -0,0 +1,60 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface MesOrderMonthMainVO { |
|||
deleteTime: Date |
|||
id: number |
|||
status: string |
|||
concurrencyStamp: number |
|||
remark: string |
|||
deleter: string |
|||
siteId: number |
|||
sourceType: string |
|||
planMasterCode: string |
|||
planSubCode: string |
|||
planType: string |
|||
checker: string |
|||
checkDate: string |
|||
factoryCode: string |
|||
factoryName: string |
|||
} |
|||
|
|||
// 查询订单计划月主列表
|
|||
export const getMesOrderMonthMainPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/plan/mes-order-month-main/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/plan/mes-order-month-main/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询订单计划月主详情
|
|||
export const getMesOrderMonthMain = async (id: number) => { |
|||
return await request.get({ url: `/plan/mes-order-month-main/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增订单计划月主
|
|||
export const createMesOrderMonthMain = async (data: MesOrderMonthMainVO) => { |
|||
return await request.post({ url: `/plan/mes-order-month-main/create`, data }) |
|||
} |
|||
|
|||
// 修改订单计划月主
|
|||
export const updateMesOrderMonthMain = async (data: MesOrderMonthMainVO) => { |
|||
return await request.put({ url: `/plan/mes-order-month-main/update`, data }) |
|||
} |
|||
|
|||
// 删除订单计划月主
|
|||
export const deleteMesOrderMonthMain = async (id: number) => { |
|||
return await request.delete({ url: `/plan/mes-order-month-main/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出订单计划月主 Excel
|
|||
export const exportMesOrderMonthMain = async (params) => { |
|||
return await request.download({ url: `/plan/mes-order-month-main/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/plan/mes-order-month-main/get-import-template' }) |
|||
} |
@ -0,0 +1,76 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface ReworkBatchVO { |
|||
deleteTime: Date |
|||
id: number |
|||
status: string |
|||
concurrencyStamp: number |
|||
remark: string |
|||
deleter: string |
|||
siteId: number |
|||
reworkType: string |
|||
productionCode: string |
|||
productionCount: string |
|||
reworkAction: string |
|||
replaceFlag: string |
|||
reworkPersoncode: string |
|||
reworkTime: Date |
|||
reworkResult: string |
|||
reworkbillNo: string |
|||
} |
|||
|
|||
// 查询返工登记批量列表
|
|||
export const getReworkBatchPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/mes/rework-batch/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/rework-batch/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询返工登记批量详情
|
|||
export const getReworkBatch = async (id: number) => { |
|||
return await request.get({ url: `/mes/rework-batch/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增返工登记批量
|
|||
export const createReworkBatch = async (data: ReworkBatchVO) => { |
|||
return await request.post({ url: `/mes/rework-batch/create`, data }) |
|||
} |
|||
|
|||
// 修改返工登记批量
|
|||
export const updateReworkBatch = async (data: ReworkBatchVO) => { |
|||
return await request.put({ url: `/mes/rework-batch/update`, data }) |
|||
} |
|||
|
|||
// 删除返工登记批量
|
|||
export const deleteReworkBatch = async (id: number) => { |
|||
return await request.delete({ url: `/mes/rework-batch/delete?id=` + id }) |
|||
} |
|||
|
|||
// 中止返工登记单件
|
|||
export const suspendReworkSingle = async (id: number) => { |
|||
return await request.delete({ url: `/mes/rework-batch/suspend?id=` + id }) |
|||
} |
|||
|
|||
// 领取返工登记单件
|
|||
export const receiveReworkSingle = async (id: number) => { |
|||
return await request.put({ url: `/mes/rework-batch/receive?id=` + id }) |
|||
} |
|||
|
|||
// 完成返工登记单件
|
|||
export const finishReworkSingle = async (id: number) => { |
|||
return await request.put({ url: `/mes/rework-batch/finish?id=` + id }) |
|||
} |
|||
|
|||
// 导出返工登记批量 Excel
|
|||
export const exportReworkBatch = async (params) => { |
|||
return await request.download({ url: `/mes/rework-batch/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/mes/rework-batch/get-import-template' }) |
|||
} |
@ -0,0 +1,30 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
|
|||
|
|||
// 查询采样过程列表
|
|||
export const getListByTempleteCode = async (code) => { |
|||
return await request.get({ url: `/qms/inspection-process/getListByTempleteCode?code=`+code}) |
|||
} |
|||
// 新增
|
|||
export const inspectionTemplateCreat = async (data) => { |
|||
return await request.post({ url: `/qms/programme-template/create`,data}) |
|||
} |
|||
// 编辑
|
|||
export const inspectionTemplateUpdate = async (data) => { |
|||
return await request.put({ url: `/qms/programme-template/update`,data}) |
|||
} |
|||
// 删除
|
|||
export const inspectionTemplateDelete = async (id) => { |
|||
return await request.delete({ url: `/qms/programme-template/delete?id=`+id}) |
|||
} |
|||
// 列表
|
|||
export const inspectionTemplatePage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return request.post({ url: '/wms/accountcalendar/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/qms/programme-template/page`, params }) |
|||
} |
|||
} |
@ -0,0 +1,109 @@ |
|||
<script lang="tsx"> |
|||
import { defineComponent, computed } from 'vue' |
|||
import { useRouter } from 'vue-router' |
|||
import { useAppStore } from '@/store/modules/app' |
|||
import { isUrl } from '@/utils/is' |
|||
import { pathResolve } from '@/utils/routerHelper' |
|||
import type { RouteMeta } from 'vue-router' |
|||
import { ElMenu, ElMenuItem } from 'element-plus' |
|||
import { usePermissionStore } from '@/store/modules/permission' |
|||
import { hasOneShowingChild } from '@/layout/components/Menu/src/helper' |
|||
import { useRenderMenuTitle } from '@/layout/components/Menu/src/components/useRenderMenuTitle' |
|||
// 头部工具 |
|||
import { useDesign } from '@/hooks/web/useDesign' |
|||
const { getPrefixCls, variables } = useDesign() |
|||
const appStore = useAppStore() |
|||
const layout = computed(() => appStore.getLayout) |
|||
|
|||
const prefixCls = getPrefixCls('tool-header') |
|||
const permissionStore = usePermissionStore() |
|||
const routers = computed(() => |
|||
unref(layout) === 'cutMenu' ? permissionStore.getMenuTabRouters : permissionStore.getRouters |
|||
) |
|||
|
|||
const getPath = (route) => { |
|||
let routePath = route.path |
|||
if(routePath.startsWith('/')){ |
|||
routePath = route.path |
|||
}else{ |
|||
routePath = '/'+route.path |
|||
} |
|||
if(route.redirect){ |
|||
return route.redirect |
|||
}else if(route.children){ |
|||
return routePath+getPath(route.children[0]) |
|||
}else{ |
|||
return routePath |
|||
} |
|||
} |
|||
|
|||
export default defineComponent({ |
|||
name: 'CategoryHeader', |
|||
setup() { |
|||
console.log('useRouter()',useRouter()) |
|||
const { push } = useRouter() |
|||
// backgroundColor="var(--left-menu-bg-color)" |
|||
// textColor="var(--left-menu-text-color)" |
|||
return () => ( |
|||
<div |
|||
id={`${variables.namespace}-tool-header`} |
|||
class={[ |
|||
prefixCls, |
|||
'h-[var(--top-tool-height)] relative px-[var(--top-tool-p-x)] flex items-center justify-between', |
|||
'dark:bg-[var(--el-bg-color)]' |
|||
]} |
|||
> |
|||
<ElMenu style="width:100%" |
|||
mode="horizontal" |
|||
backgroundColor="white" |
|||
textColor="var(--left-menu-bg-color)" |
|||
activeTextColor="var(--left-menu-text-active-color)" |
|||
> |
|||
{{ |
|||
default: () => { |
|||
const { renderMenuTitle } = useRenderMenuTitle() |
|||
const categoryRouters = unref(routers).filter(item=>item.meta.hidden!=true&&item.path!='/') |
|||
console.log('categoryRouters==',categoryRouters) |
|||
{/* default: () => renderMenuTitle(onlyOneChild ? onlyOneChild?.meta : meta) */} |
|||
return categoryRouters.map((v) => { |
|||
const meta = (v.meta ?? {}) as RouteMeta |
|||
const { onlyOneChild } = hasOneShowingChild(v.children, v) |
|||
const fullPath = isUrl(v.path) ? v.path : pathResolve('/', v.path) // getAllParentPath<AppRouteRecordRaw>(allRouters, v.path).join('/') |
|||
|
|||
return ( |
|||
<ElMenuItem index={fullPath} onClick={()=>{ |
|||
console.log(v) |
|||
appStore.setCategoryRoutePath(v.path) |
|||
}}> |
|||
{{ |
|||
default: () => renderMenuTitle(meta.title?meta:onlyOneChild?.meta) |
|||
}} |
|||
</ElMenuItem> |
|||
) |
|||
}) |
|||
} |
|||
}} |
|||
</ElMenu> |
|||
|
|||
</div> |
|||
) |
|||
} |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
$prefix-cls: #{$namespace}-tool-header; |
|||
|
|||
.#{$prefix-cls} { |
|||
transition: left var(--transition-time-02); |
|||
} |
|||
|
|||
::v-deep(.el-menu--horizontal>.el-menu-item){ |
|||
border-radius: 5px; |
|||
height: 40px; |
|||
margin-right: 10px; |
|||
background: linear-gradient(to top left,var(--left-menu-bg-color),var(--left-menu-text-color)); |
|||
} |
|||
|
|||
</style> |
|||
|
@ -0,0 +1,43 @@ |
|||
<template> |
|||
<div> |
|||
<el-calendar> |
|||
<template #date-cell="{ data }"> |
|||
<div |
|||
style="height: 100" |
|||
:class="data.isSelected ? 'is-selected' : ''" |
|||
@click="handleClick(data.day)"> |
|||
<div>{{ data.day.split('-').slice(1).join('-') }}</div> |
|||
<div v-if="arr.find((v) => v.date === data.day)">{{ arr.find((v) => v.date === data.day).content }} |
|||
</div> |
|||
<!-- <div>{{ data.isSelected ? '打羽毛球' : '' }}</div> --> |
|||
</div> |
|||
</template> |
|||
</el-calendar> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'Calendar', |
|||
data() { |
|||
return { |
|||
value: new Date(), |
|||
arr: [ |
|||
{ date: '2024-04-01', content: '打球' }, |
|||
{ date: '2024-04-02', content: '打台球' }, |
|||
{ date: '2024-04-03', content: '打篮球' }, |
|||
{ date: '2024-04-04', content: '踢足球' } |
|||
] |
|||
} |
|||
}, |
|||
methods: { |
|||
handleClick(date) { |
|||
alert(date) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
@ -0,0 +1,86 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const MesOrderMonthMainRules = reactive({ |
|||
}) |
|||
|
|||
export const MesOrderMonthMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isTable: false |
|||
}, |
|||
{ |
|||
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: 'creator', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: '主计划编码', |
|||
field: 'planMasterCode', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '计划辅助编码', |
|||
field: 'planSubCode', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '计划类型', |
|||
field: 'planType', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'SelectV2' |
|||
} |
|||
}, |
|||
{ |
|||
label: '审核人', |
|||
field: 'checker', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '工厂编码', |
|||
field: 'factoryCode', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '工厂名称', |
|||
field: 'factoryName', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,318 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="ReworkBatch.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="ReworkBatch.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 #reworkbillNo="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '单据号', row.reworkbillNo)"> |
|||
<span>{{ row.reworkbillNo }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="formsSuccess" |
|||
:rules="ReworkBatchRules" |
|||
:formAllSchemas="ReworkBatch.allSchemas" |
|||
:apiUpdate="ReworkBatchApi.updateReworkBatch" |
|||
:apiCreate="ReworkBatchApi.createReworkBatch" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="ReworkBatch.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/mes/rework-batch/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { ReworkBatch,ReworkBatchRules } from './reworkBatch.data' |
|||
import * as ReworkBatchApi from '@/api/mes/reworkBatch' |
|||
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: 'MesReworkBatch' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(ReworkBatch.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: ReworkBatchApi.getReworkBatchPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'mes:reworkBatch:create'}), // 新增 |
|||
//defaultButtons.defaultImportBtn({hasPermi:'mes:reworkBatch:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'mes:reworkBatch: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 isShowMainButton = (row,val) => { |
|||
if (val.indexOf(row.status) > -1) { |
|||
return false |
|||
} else { |
|||
return true |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = (row) => { |
|||
return [ |
|||
defaultButtons.mainListEditBtn({hide: isShowMainButton(row,['1']),hasPermi:'mes:reworkSingle:update'}), // 编辑 |
|||
defaultButtons.mainListSuspend1Btn({hide: isShowMainButton(row,['1']),hasPermi:'mes:reworkSingle:delete'}), // 中止1 |
|||
defaultButtons.mainListReceiveBtn({hide: isShowMainButton(row,['1']),hasPermi:'mes:reworkSingle:update'}), // 领取 |
|||
defaultButtons.mainListSuspend2Btn({hide: isShowMainButton(row,['2']),hasPermi:'mes:reworkSingle:delete'}), // 中止2 |
|||
defaultButtons.mainListFinishBtn({hide: isShowMainButton(row,['2']),hasPermi:'mes:reworkSingle:update'}), // 完成 |
|||
] |
|||
} |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'suspend') { // 中止1 |
|||
handleSuspend(row.id) |
|||
} else if (val == 'receive') { // 领取 |
|||
handleReceive(row.id) |
|||
} else if (val == 'suspend') { // 中止2 |
|||
handleSuspend(row.id) |
|||
} else if (val == 'finish') { // 完成 |
|||
handleFinish(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
if(type == "create"){ |
|||
ReworkBatch.allSchemas.formSchema.forEach((item) => { |
|||
if(item.field == 'status'){ |
|||
item.value = '1'; |
|||
item.componentProps.disabled = true |
|||
} |
|||
}) |
|||
}else{ |
|||
ReworkBatch.allSchemas.formSchema.forEach((item) => { |
|||
if(item.field == 'status'){ |
|||
item.componentProps.disabled = false |
|||
} |
|||
}) |
|||
} |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// form表单提交 |
|||
const formsSuccess = async (formType,data) => { |
|||
var isHave =ReworkBatch.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 ReworkBatchApi.createReworkBatch(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await ReworkBatchApi.updateReworkBatch(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, 'basicReworkBatch') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await ReworkBatchApi.deleteReworkBatch(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 中止按钮操作 */ |
|||
const handleSuspend = async (id: number) => { |
|||
try { |
|||
// 中止的二次确认 |
|||
await message.delConfirm('是否中止所选中任务?'); |
|||
// 发起删除 |
|||
await ReworkBatchApi.suspendReworkSingle(id) |
|||
message.success(t('中止成功')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
|
|||
/** 领取按钮操作 */ |
|||
const handleReceive = async (id: number) => { |
|||
try { |
|||
// 中止的二次确认 |
|||
await message.delConfirm('是否领取所选中任务?'); |
|||
// 发起删除 |
|||
await ReworkBatchApi.receiveReworkSingle(id) |
|||
message.success(t('领取成功')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 完成按钮操作 */ |
|||
const handleFinish = async (id: number) => { |
|||
try { |
|||
// 中止的二次确认 |
|||
await message.delConfirm('是否完成所选中任务?'); |
|||
// 发起删除 |
|||
await ReworkBatchApi.finishReworkSingle(id) |
|||
message.success(t('任务已完成')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await ReworkBatchApi.exportReworkBatch(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 ReworkBatchApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,229 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import * as ItembasicApi from '@/api/wms/itembasic' |
|||
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' |
|||
|
|||
// 表单校验
|
|||
export const ReworkBatchRules = reactive({ |
|||
reworkType: [required], |
|||
productionCode:[required], |
|||
replaceFlag:[required], |
|||
status:[required], |
|||
}) |
|||
|
|||
export const ReworkBatch = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '删除时间', |
|||
field: 'deleteTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail: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: 'id', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '并发乐观锁', |
|||
field: 'concurrencyStamp', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
|
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail: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')] |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除用户名', |
|||
field: 'deleter', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '位置ID', |
|||
field: 'siteId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '单据号', |
|||
field: 'reworkbillNo', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false, |
|||
isDetail: true |
|||
}, |
|||
{ |
|||
label: '工作类型', |
|||
field: 'reworkType', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
dictType: DICT_TYPE.REWORK_TYPE, |
|||
dictClass: 'string', |
|||
}, |
|||
{ |
|||
label: '产品编码', |
|||
field: 'productionCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
componentProps: { |
|||
isSearchList: true, // 开启查询弹窗
|
|||
searchTitle: '产品编码', // 查询弹窗标题
|
|||
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
|
|||
searchField: 'code', // 查询弹窗赋值字段
|
|||
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
|
|||
searchCondition: [{ |
|||
key: 'available', |
|||
value: 'TRUE', |
|||
isMainValue: false |
|||
}, |
|||
{ |
|||
key: 'type', |
|||
action: 'in', // 查询拼接条件
|
|||
isSearch: true, // 使用自定义拼接条件
|
|||
value: 'BCP,CCP',//,SEMI]
|
|||
isMainValue: false |
|||
}] |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '数量', |
|||
field: 'productionCount', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '返修动作', |
|||
field: 'reworkAction', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '是否有替换件', |
|||
field: 'replaceFlag', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
dictType: DICT_TYPE.REWORK_REPLACE_FLAG, |
|||
dictClass: 'string', |
|||
}, |
|||
{ |
|||
label: '返修人员', |
|||
field: 'reworkPersoncode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '返修时间', |
|||
field: 'reworkTime', |
|||
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: 'reworkResult', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
|
|||
{ |
|||
label: '状态', |
|||
field: 'status', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
dictType: DICT_TYPE.REWORK_STATUS, |
|||
dictClass: 'string', |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,83 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const MesOrderMonthMainRules = reactive({ |
|||
}) |
|||
|
|||
export const MesOrderMonthMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isTable: false |
|||
}, |
|||
{ |
|||
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: 'creator', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: '主计划编码', |
|||
field: 'planMasterCode', |
|||
sort: 'custom', |
|||
isTable: false, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '计划辅助编码', |
|||
field: 'planSubCode', |
|||
sort: 'custom', |
|||
isTable: false, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '计划类型', |
|||
field: 'planType', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'SelectV2' |
|||
} |
|||
}, |
|||
{ |
|||
label: '工厂编码', |
|||
field: 'factoryCode', |
|||
sort: 'custom', |
|||
isTable: false |
|||
}, |
|||
{ |
|||
label: '工厂名称', |
|||
field: 'factoryName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,864 @@ |
|||
<template> |
|||
<Dialog |
|||
:title="dialogTitle" |
|||
v-model="dialogVisible" |
|||
:width="dialogWidth" |
|||
:close-on-click-modal="false" |
|||
:vLoading="formLoading" |
|||
> |
|||
<div style="max-height: 60vh; overflow-y: auto; padding: 0px 20px"> |
|||
<!-- <Form ref="formRefMain" :schema="formAllSchemasMain" :is-col="true" :rules="rules" /> --> |
|||
<el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef"> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="编码" prop="code"> |
|||
<el-input v-model="data.code" placeholder="根据系统生成" :disabled="true" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="描述" prop="description"> |
|||
<el-input v-model="data.description" placeholder="请填写描述" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="版本" prop="version"> |
|||
<el-input v-model="data.version" placeholder="请填写版本" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<el-tabs |
|||
v-model="editableTabsValue" |
|||
editable |
|||
class="demo-tabs" |
|||
@edit="handleTabsEdit" |
|||
type="border-card" |
|||
tab-position="left" |
|||
:stretch="false" |
|||
> |
|||
<el-tab-pane |
|||
v-for="item in data.process" |
|||
:key="item.name" |
|||
:label="item.description" |
|||
:name="item.name" |
|||
> |
|||
<div class="small-title">检验工序</div> |
|||
<!-- <Form |
|||
:ref="`formRefProcess`+index" |
|||
:schema="formAllSchemasProcess" |
|||
:is-col="true" |
|||
labelWidth="150px" |
|||
:rules="rules" |
|||
/> --> |
|||
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef"> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="12"> |
|||
<el-form-item label="编码" prop="code"> |
|||
<el-input v-model="item.code" placeholder="根据系统生成" :disabled="true" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="检验方案模板编码"> |
|||
<el-input |
|||
v-model="item.inspectionCode" |
|||
placeholder="根据系统生成" |
|||
:disabled="true" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="描述" prop="description"> |
|||
<el-input v-model="item.description" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="顺序号" prop="sequenceCode"> |
|||
<el-input v-model="item.sequenceCode" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="检验特性编码"> |
|||
<el-input |
|||
v-model="item.inspectionCharCode" |
|||
placeholder="根据系统生成" |
|||
:disabled="true" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<div class="small-title">检验特性</div> |
|||
<el-form :model="item" label-width="auto" :rules="rules" ref="formFeaturesRef"> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="12"> |
|||
<el-form-item label="编码"> |
|||
<el-input |
|||
v-model="item.inspectionCharacteristicsBaseVO.code" |
|||
placeholder="根据系统生成" |
|||
:disabled="true" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="描述" prop="inspectionCharacteristicsBaseVO.description"> |
|||
<el-input v-model="item.inspectionCharacteristicsBaseVO.description" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item |
|||
label="检验方法编码" |
|||
prop="inspectionCharacteristicsBaseVO.inspectionMethodCode" |
|||
> |
|||
<div style="display: flex; width: 100%"> |
|||
<el-input |
|||
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethodCode" |
|||
disabled |
|||
placeholder="请选择检验方法编码" |
|||
/> |
|||
<el-button |
|||
type="info" |
|||
plain |
|||
style="width: 40px" |
|||
@click=" |
|||
opensearchTable( |
|||
'inspectionMethodCode', |
|||
null, |
|||
'检验方法', |
|||
SamplingProcess.allSchemas, |
|||
SamplingProcessApi.getSamplingProcessPage, |
|||
null, |
|||
false, |
|||
null, |
|||
item |
|||
) |
|||
" |
|||
><Icon icon="ep:search" |
|||
/></el-button> |
|||
</div> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item |
|||
label="采样过程编码" |
|||
prop="inspectionCharacteristicsBaseVO.dynamicUpdateCode" |
|||
> |
|||
<div style="display: flex; width: 100%"> |
|||
<el-input |
|||
v-model="item.inspectionCharacteristicsBaseVO.dynamicUpdateCode" |
|||
disabled |
|||
placeholder="请选择采样过程编码" |
|||
/> |
|||
<el-button |
|||
type="info" |
|||
plain |
|||
style="width: 40px" |
|||
@click=" |
|||
opensearchTable( |
|||
'dynamicUpdateCode', |
|||
null, |
|||
'采样过程编码', |
|||
SamplingProcess.allSchemas, |
|||
SamplingProcessApi.getSamplingProcessPage, |
|||
null, |
|||
false, |
|||
null, |
|||
item |
|||
) |
|||
" |
|||
><Icon icon="ep:search" |
|||
/></el-button> |
|||
</div> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item |
|||
label="动态修改规则编码" |
|||
prop="inspectionCharacteristicsBaseVO.inspectionMethod" |
|||
> |
|||
<div style="display: flex; width: 100%"> |
|||
<el-input |
|||
v-model="item.inspectionCharacteristicsBaseVO.inspectionMethod" |
|||
disabled |
|||
placeholder="请选择动态修改规则编码" |
|||
/> |
|||
<el-button |
|||
type="info" |
|||
plain |
|||
style="width: 40px" |
|||
@click=" |
|||
opensearchTable( |
|||
'inspectionMethod', |
|||
null, |
|||
'动态修改规则编码', |
|||
SamplingProcess.allSchemas, |
|||
SamplingProcessApi.getSamplingProcessPage, |
|||
null, |
|||
false, |
|||
null, |
|||
item |
|||
) |
|||
" |
|||
><Icon icon="ep:search" |
|||
/></el-button> |
|||
</div> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item |
|||
label="是否允许修改特征值" |
|||
prop="inspectionCharacteristicsBaseVO.isCanUpdate" |
|||
> |
|||
<el-select |
|||
v-model="item.inspectionCharacteristicsBaseVO.isCanUpdate" |
|||
placeholder="请选择是否允许修改特征值" |
|||
> |
|||
<el-option |
|||
v-for="item in isYesList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item |
|||
label="结果录入方式" |
|||
prop="inspectionCharacteristicsBaseVO.resultEntryMethod" |
|||
> |
|||
<el-select |
|||
v-model="item.inspectionCharacteristicsBaseVO.resultEntryMethod" |
|||
placeholder="请选择结果录入方式" |
|||
> |
|||
<el-option |
|||
v-for="dict in getStrDictOptions( |
|||
DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY |
|||
)" |
|||
:key="dict.value" |
|||
:label="dict.label" |
|||
:value="dict.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="特征类型" prop="inspectionCharacteristicsBaseVO.featureType"> |
|||
<!-- <el-input v-model="item.featureType" /> --> |
|||
<el-select |
|||
v-model="item.inspectionCharacteristicsBaseVO.featureType" |
|||
placeholder="请选择特征类型" |
|||
@change="changeFeatureType" |
|||
> |
|||
<el-option |
|||
v-for="dict in getStrDictOptions( |
|||
DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE |
|||
)" |
|||
:key="dict.value" |
|||
:label="dict.label" |
|||
:value="dict.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"> |
|||
<el-form-item |
|||
label="是否设定上限" |
|||
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" |
|||
> |
|||
<el-select |
|||
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping" |
|||
placeholder="请选择是否设定上限" |
|||
@change="changeIsCapping" |
|||
> |
|||
<el-option |
|||
v-for="item in isYesList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item |
|||
label="上限值" |
|||
prop="inspectionCharacteristicsBaseVO.quantifyCapping" |
|||
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|||
> |
|||
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyCapping" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item |
|||
prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit" |
|||
label="是否设定下限" |
|||
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|||
> |
|||
<el-select |
|||
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit" |
|||
placeholder="请选择是否设定下限" |
|||
@change="changeLowlimit" |
|||
> |
|||
<el-option |
|||
v-for="item in isYesList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item |
|||
label="下限值" |
|||
prop="inspectionCharacteristicsBaseVO.quantifyLowlimit" |
|||
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|||
> |
|||
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyLowlimit" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item |
|||
prop="inspectionCharacteristicsBaseVO.quantifyIsTarget" |
|||
label="是否设定目标值" |
|||
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|||
> |
|||
<el-select |
|||
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget" |
|||
placeholder="请选择是否设定目标值" |
|||
@change="changeIsTarget" |
|||
> |
|||
<el-option |
|||
v-for="item in isYesList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item |
|||
label="目标值" |
|||
prop="inspectionCharacteristicsBaseVO.quantifyTarget" |
|||
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|||
> |
|||
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyTarget" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
<el-col :span="12"> |
|||
<el-form-item |
|||
label="计量单位" |
|||
prop="inspectionCharacteristicsBaseVO.quantifyUom" |
|||
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|||
> |
|||
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyUom" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item |
|||
label="小数位" |
|||
prop="inspectionCharacteristicsBaseVO.quantifyDecimal" |
|||
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|||
> |
|||
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyDecimal" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item |
|||
label="选择集编码" |
|||
prop="inspectionCharacteristicsBaseVO.quantifyQuantifyCode" |
|||
v-if="item.inspectionCharacteristicsBaseVO.featureType == 1" |
|||
> |
|||
<div style="display: flex; width: 100%"> |
|||
<el-input |
|||
v-model="item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode" |
|||
disabled |
|||
placeholder="请选择选择集编码" |
|||
/> |
|||
<el-button |
|||
type="info" |
|||
plain |
|||
style="width: 40px" |
|||
@click=" |
|||
opensearchTable( |
|||
'quantifyQuantifyCode', |
|||
null, |
|||
'选择集编码', |
|||
SamplingProcess.allSchemas, |
|||
SamplingProcessApi.getSamplingProcessPage, |
|||
null, |
|||
false, |
|||
null, |
|||
item |
|||
) |
|||
" |
|||
><Icon icon="ep:search" |
|||
/></el-button> |
|||
</div> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</div> |
|||
<template #footer> |
|||
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" /> |
|||
</template> |
|||
</Dialog> |
|||
<Dialog title="修改名称" v-model="dialogVisibleName" width="500px" :close-on-click-modal="false"> |
|||
<div style="padding: 0px 20px"> |
|||
<el-form ref="nameRef" :model="nameForm"> |
|||
<el-form-item |
|||
:rules="[{ required: true, message: '请输入名称', trigger: 'blur' }]" |
|||
prop="name" |
|||
> |
|||
<el-input v-model="nameForm.name" style="width: 240px" placeholder="请输入名称" /> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
<template #footer> |
|||
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick1" /> |
|||
</template> |
|||
</Dialog> |
|||
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import { getCurrentInstance } from 'vue' |
|||
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|||
import * as InspectionProcessPageApi from '@/api/qms/inspectionTemplate' |
|||
import { SearchTable } from '@/components/SearchTable' |
|||
import { SamplingProcess } from '@/views/qms/samplingProcess/samplingProcess.data' |
|||
import * as SamplingProcessApi from '@/api/qms/samplingProcess' |
|||
const message = useMessage() // 消息弹窗 |
|||
|
|||
const props = defineProps({ |
|||
// 显示窗口宽度设置 |
|||
basicFormWidth: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
// 检验特性表单,列表 相关信息 |
|||
formAllSchemasFeatures: { |
|||
type: Object, |
|||
required: true, |
|||
default: null |
|||
}, |
|||
// 检验工序表单,列表 相关信息 |
|||
formAllSchemasProcess: { |
|||
type: Object, |
|||
required: true, |
|||
default: null |
|||
}, |
|||
// 检验模板表单,列表 相关信息 |
|||
formAllSchemasMain: { |
|||
type: Object, |
|||
required: true, |
|||
default: null |
|||
}, |
|||
// 底部按钮集合 |
|||
footButttondata: { |
|||
type: Array, |
|||
required: false, |
|||
default: null |
|||
} |
|||
}) |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const dialogVisible = ref(false) // 弹窗的是否展示 |
|||
const dialogTitle = ref('') // 弹窗的标题 |
|||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
|||
const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
|||
const dialogWidth = ref() |
|||
const formMainRef = ref() |
|||
const formFeaturesRef = ref() |
|||
const formProcessRef = ref() |
|||
|
|||
const data = ref({ |
|||
code: '', |
|||
description: '', |
|||
version: '', |
|||
process: [] |
|||
}) |
|||
const isYesList = [ |
|||
{ |
|||
value: true, |
|||
label: '是' |
|||
}, |
|||
{ |
|||
value: false, |
|||
label: '否' |
|||
} |
|||
] |
|||
const dialogVisibleName = ref(false) |
|||
const nameForm = ref({ |
|||
name: '' |
|||
}) |
|||
const nameRef = ref() |
|||
if (props.basicFormWidth) { |
|||
dialogWidth.value = props.basicFormWidth + '%' |
|||
} else { |
|||
dialogWidth.value = props.isBusiness ? '60%' : '40%' |
|||
} |
|||
const rules = ref({ |
|||
description: [{ required: true, message: '请填写描述', trigger: 'blur' }], |
|||
version: [{ required: true, message: '请填写版本', trigger: 'blur' }], |
|||
inspectionCode: [{ required: true, message: '请选择检验方案模板编码', trigger: 'blur' }], |
|||
sequenceCode: [{ required: true, message: '请填写顺序号', trigger: 'blur' }], |
|||
inspectionCharCode: [{ required: true, message: '请选择检验特性编码', trigger: 'blur' }], |
|||
'inspectionCharacteristicsBaseVO.description': [ |
|||
{ required: true, message: '请填写描述', trigger: ['blur', 'change'] } |
|||
], |
|||
'inspectionCharacteristicsBaseVO.inspectionMethodCode': [ |
|||
{ required: true, message: '请选择检验方法编码', trigger: 'blur' } |
|||
], |
|||
'inspectionCharacteristicsBaseVO.dynamicUpdateCode': [ |
|||
{ required: true, message: '请选择采样过程编码', trigger: ['blur', 'change'] } |
|||
], |
|||
'inspectionCharacteristicsBaseVO.inspectionMethod': [ |
|||
{ required: true, message: '请选择动态修改规则编码', trigger: ['blur', 'change'] } |
|||
], |
|||
'inspectionCharacteristicsBaseVO.isCanUpdate': [ |
|||
{ required: true, message: '请选择是否允许修改特征值', trigger: ['blur', 'change'] } |
|||
], |
|||
'inspectionCharacteristicsBaseVO.isDestructionInspection': [ |
|||
{ required: true, message: '请选择是否破坏性检验', trigger: ['blur', 'change'] } |
|||
], |
|||
'inspectionCharacteristicsBaseVO.resultEntryMethod': [ |
|||
{ required: true, message: '请选择结果录入方式', trigger: ['blur', 'change'] } |
|||
], |
|||
'inspectionCharacteristicsBaseVO.featureType': [ |
|||
{ required: true, message: '请选择特征类型', trigger: ['blur', 'change'] } |
|||
], |
|||
'inspectionCharacteristicsBaseVO.quantifyIsCapping': [ |
|||
{ required: true, message: '请选择是否设定上限', trigger: ['blur', 'change'] } |
|||
], |
|||
'inspectionCharacteristicsBaseVO.quantifyIsLowlimit': [ |
|||
{ required: true, message: '请选择是否设定下限', trigger: ['blur', 'change'] } |
|||
], |
|||
'inspectionCharacteristicsBaseVO.quantifyIsTarget': [ |
|||
{ required: true, message: '请选择是否设定目标值', trigger: ['blur', 'change'] } |
|||
], |
|||
|
|||
'inspectionCharacteristicsBaseVO.quantifyTarget': [ |
|||
{ required: true, message: '请输入目标值', trigger: 'blur' } |
|||
], |
|||
'inspectionCharacteristicsBaseVO.quantifyCapping': [ |
|||
{ required: true, message: '请输入上限值', trigger: 'blur' } |
|||
], |
|||
'inspectionCharacteristicsBaseVO.quantifyLowlimit': [ |
|||
{ required: true, message: '请输入下限值', trigger: 'blur' } |
|||
], |
|||
'inspectionCharacteristicsBaseVO.quantifyUom': [ |
|||
{ required: true, message: '请选择计量单位', trigger: 'blur' } |
|||
], |
|||
'inspectionCharacteristicsBaseVO.quantifyDecimal': [ |
|||
{ required: true, message: '请输入小数位', trigger: 'blur' } |
|||
], |
|||
'inspectionCharacteristicsBaseVO.quantifyQuantifyCode': [ |
|||
{ required: true, message: '请输入选择集编码', trigger: 'blur' } |
|||
] |
|||
}) |
|||
/** 打开弹窗 */ |
|||
let tabIndex = 1 |
|||
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => { |
|||
dialogVisible.value = true |
|||
if (titleName) { |
|||
dialogTitle.value = t('action.' + titleName) |
|||
} else { |
|||
dialogTitle.value = t('action.' + type) |
|||
} |
|||
formType.value = type |
|||
if (row) { |
|||
data.value = row |
|||
let list = await InspectionProcessPageApi.getListByTempleteCode(row.code) |
|||
list.forEach((item, index) => { |
|||
editableTabsValue.value = index + 1 |
|||
item.name = index + 1 |
|||
}) |
|||
data.value.process = list |
|||
} else { |
|||
data.value = { |
|||
code: '', |
|||
description: '', |
|||
version: '', |
|||
process: [] |
|||
} |
|||
} |
|||
|
|||
tabIndex = data.value.process.length + 1 |
|||
} |
|||
defineExpose({ open, dialogVisible, formLoading }) // 提供 open 方法,用于打开弹窗 |
|||
import type { TabPaneName } from 'element-plus' |
|||
|
|||
const editableTabsValue = ref('1') |
|||
// const editableTabs = ref([]) |
|||
|
|||
const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | 'add') => { |
|||
if (action === 'add') { |
|||
nameForm.value.name = '' |
|||
dialogVisibleName.value = true |
|||
} else if (action === 'remove') { |
|||
const tabs = data.value.process |
|||
let activeName = editableTabsValue.value |
|||
if (activeName === targetName) { |
|||
tabs.forEach((tab, index) => { |
|||
if (tab.name === targetName) { |
|||
const nextTab = tabs[index + 1] || tabs[index - 1] |
|||
if (nextTab) { |
|||
activeName = nextTab.name |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
editableTabsValue.value = activeName |
|||
data.value.process = tabs.filter((tab) => tab.name !== targetName) |
|||
} |
|||
} |
|||
/** 修改名称时间 */ |
|||
const buttonBaseClick1 = (val) => { |
|||
// 保存 |
|||
if (val == 'save') { |
|||
if (!nameRef.value) return |
|||
nameRef.value.validate((valid, fields) => { |
|||
if (valid) { |
|||
const newTabName = `${++tabIndex}` |
|||
data.value.process.push({ |
|||
description: nameForm.value.name, |
|||
name: newTabName, |
|||
inspectionCode: '', |
|||
sequenceCode: '', |
|||
inspectionCharCode: '', |
|||
inspectionCharacteristicsBaseVO: { |
|||
describe: '', |
|||
inspectionMethodCode: '', |
|||
dynamicUpdateCode: '', |
|||
inspectionMethod: '', |
|||
isCanUpdate: '', |
|||
isDestructionInspection: '', |
|||
resultEntryMethod: '', |
|||
featureType: '', |
|||
quantifyIsCapping: '', |
|||
quantifyIsLowlimit: '', |
|||
quantifyTarget: '', |
|||
quantifyCapping: '', |
|||
quantifyLowlimit: '', |
|||
quantifyUom: '', |
|||
quantifyDecimal: '', |
|||
quantifyQuantifyCode: '' |
|||
} |
|||
}) |
|||
console.log(data.value.process) |
|||
|
|||
editableTabsValue.value = newTabName |
|||
dialogVisibleName.value = false |
|||
} else { |
|||
console.log('error submit!') |
|||
return false |
|||
} |
|||
}) |
|||
} |
|||
// 关闭 |
|||
else if (val == 'close') { |
|||
dialogVisibleName.value = false |
|||
} |
|||
} |
|||
const buttonBaseClick = (val) => { |
|||
// 保存 |
|||
if (val == 'save') { |
|||
submitForm() |
|||
} |
|||
// 关闭 |
|||
else if (val == 'close') { |
|||
dialogVisible.value = false |
|||
} |
|||
} |
|||
// 传递给父类 |
|||
const emit = defineEmits(['submitForm', 'searchTableSuccess']) |
|||
const validateForm = (formRef) => { |
|||
// console.log(TableBaseForm_Ref.value) |
|||
let _lists = formRef?.map((v) => v.validate()) |
|||
return Promise.all(_lists) |
|||
.then(() => { |
|||
return true |
|||
}) |
|||
.catch(() => { |
|||
return false |
|||
}) |
|||
} |
|||
const submitForm = async () => { |
|||
try { |
|||
const validateForm1 = await validateForm(formProcessRef.value) |
|||
console.log(validateForm1) |
|||
await formMainRef.value.validate() |
|||
if (!data.value.process || data.value.process.length == 0) { |
|||
message.error(`请添加工序`) |
|||
return; |
|||
} |
|||
const bol1 = await validateForm(formProcessRef.value) |
|||
const bol2 = await validateForm(formFeaturesRef.value) |
|||
if (!bol1 || !bol2) { |
|||
message.error(`模板中有检验工序和检验特性未填写完全`) |
|||
return; |
|||
} |
|||
if (formType.value == 'create') { |
|||
// 主子表——提交请求 |
|||
emit('submitForm', formType.value, data) |
|||
} else { |
|||
// 编辑 |
|||
emit('submitForm', formType.value, data) |
|||
} |
|||
} catch { |
|||
console.log(111) |
|||
} |
|||
} |
|||
/** 弹窗按钮 */ |
|||
let Butttondata: any = [] |
|||
if (props.footButttondata) { |
|||
Butttondata = props.footButttondata |
|||
} else { |
|||
Butttondata = [ |
|||
defaultButtons.formSaveBtn(null), // 保存 |
|||
defaultButtons.formCloseBtn(null) // 关闭 |
|||
] |
|||
} |
|||
// 选择特征类型 |
|||
const changeFeatureType = (e) => { |
|||
console.log(e) |
|||
} |
|||
const searchTableRef = ref() |
|||
const opensearchTable = ( |
|||
formField, |
|||
searchField, |
|||
searchTitle, |
|||
searchAllSchemas, |
|||
searchPage, |
|||
searchCondition, |
|||
multiple, |
|||
type, |
|||
row |
|||
) => { |
|||
console.log(988, row) |
|||
const _searchCondition = {} |
|||
// 判断查询条件中,是否存在指向主表的数据 |
|||
if (searchCondition && searchCondition.length > 0) { |
|||
// 转换筛选条件所需 |
|||
let filters: any[] = [] |
|||
for (var i = 0; i < searchCondition.length; i++) { |
|||
// searchCondition.forEach((item) => { |
|||
// 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取 |
|||
if (searchCondition[i].isMainValue) { |
|||
_searchCondition[searchCondition[i].key] = formRef.value.formModel[searchCondition[i].value] |
|||
? formRef.value.formModel[searchCondition[i].value] |
|||
: props.detailData |
|||
? props.detailData[searchCondition[i].value] |
|||
: row |
|||
? row[searchCondition[i].value] |
|||
: '' |
|||
// 是否含有空参数情况 |
|||
let isNull = false |
|||
if ( |
|||
_searchCondition[searchCondition[i].key] == '' || |
|||
_searchCondition[searchCondition[i].key] == undefined |
|||
) { |
|||
isNull = true |
|||
} |
|||
if (isNull) { |
|||
message.warning( |
|||
searchCondition[i].message ? searchCondition[i].message : '前置条件未选择!' |
|||
) |
|||
return |
|||
} |
|||
} else { |
|||
// 扩展 转换为筛选条件进行查询 |
|||
if (searchCondition[i].isSearch) { |
|||
filters.push({ |
|||
action: searchCondition[i].action, |
|||
column: searchCondition[i].key, |
|||
value: searchCondition[i].value |
|||
}) |
|||
} else { |
|||
_searchCondition[searchCondition[i].key] = searchCondition[i].value |
|||
} |
|||
} |
|||
} |
|||
if (filters.length > 0) { |
|||
_searchCondition.isSearch = true |
|||
_searchCondition.filters = filters |
|||
} |
|||
} |
|||
const _searchTableTitle = searchTitle |
|||
const _searchTableAllSchemas = searchAllSchemas |
|||
const _searchTablePage = searchPage |
|||
searchTableRef.value.open( |
|||
_searchTableTitle, |
|||
_searchTableAllSchemas, |
|||
_searchTablePage, |
|||
formField, |
|||
searchField, |
|||
multiple, |
|||
type, |
|||
row, |
|||
_searchCondition |
|||
) |
|||
} |
|||
// 弹层确定返回所选数据 |
|||
// val : 弹层列表row 数据 |
|||
const searchTableSuccess = (formField, searchField, val, type, row) => { |
|||
console.log(row) |
|||
data.value.process.forEach((item) => { |
|||
if (item.description == row.description) { |
|||
item.inspectionCharacteristicsBaseVO[formField] = val[0].code |
|||
} |
|||
}) |
|||
|
|||
// row.inspectionCharacteristicsBaseVO.inspectionMethodCode = val[0].code |
|||
// emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row) |
|||
} |
|||
// 选择是否设定上限值 |
|||
const changeIsCapping = (e) => { |
|||
if (e) { |
|||
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true |
|||
} else { |
|||
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false |
|||
} |
|||
} |
|||
// 选择是否设定下限值 |
|||
const changeLowlimit = (e) => { |
|||
if (e) { |
|||
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true |
|||
} else { |
|||
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false |
|||
} |
|||
} |
|||
// 选择是否设定目标值 |
|||
const changeIsTarget = (e) => { |
|||
if (e) { |
|||
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true |
|||
} else { |
|||
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
.small-title { |
|||
font-weight: bold; |
|||
padding: 0px 10px 10px; |
|||
color: #1a8bfc; |
|||
font-size: 16px; |
|||
} |
|||
</style> |
|||
<style> |
|||
.el-tabs--left .el-tabs__header.is-left { |
|||
min-height: 700px !important; |
|||
min-width: 150px !important; |
|||
} |
|||
.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left { |
|||
min-width: 120px !important; |
|||
} |
|||
</style> |
@ -0,0 +1,197 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="InspectionTemplateMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="InspectionTemplateMain.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 #reqCode="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.reqCode)"> |
|||
<span>{{ row.reqCode }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<AddForm |
|||
ref="basicFormRef" |
|||
basicFormWidth="80" |
|||
:formAllSchemasFeatures="InspectionTemplateFeatures.allSchemas" |
|||
:formAllSchemasProcess="InspectionTemplateProcess.allSchemas" |
|||
:formAllSchemasMain="InspectionTemplateMain.allSchemas" |
|||
:rules="InspectionTemplateRules" |
|||
@submitForm="submitForm" |
|||
/> |
|||
<!-- 详情 --> |
|||
<Detail |
|||
ref="detailRef" |
|||
:isBasic="true" |
|||
:allSchemas="InspectionTemplateMain.allSchemas" |
|||
/> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/wms/agv-locationrelation/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { InspectionTemplateMain,InspectionTemplateProcess,InspectionTemplateFeatures,InspectionTemplateRules } from './inspectionPlan.data' |
|||
|
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|||
import Detail from '@/components/Detail/src/Detail.vue' |
|||
import AddForm from './addForm.vue' |
|||
import * as InspectionProcessPageApi from '@/api/qms/inspectionPlan' |
|||
|
|||
defineOptions({ name: 'AgvLocationrelation' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(InspectionTemplateMain.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: InspectionProcessPageApi.inspectionTemplatePage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'wms:agv-locationrelation:create'}), // 新增 |
|||
// defaultButtons.defaultImportBtn({hasPermi:'wms:agv-locationrelation:import'}), // 导入 |
|||
// defaultButtons.defaultExportBtn({hasPermi:'wms:agv-locationrelation: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:'qms:inspectionTemplate:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'qms:inspectionTemplate: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 submitForm = async (formType,data) => { |
|||
console.log(data.value) |
|||
if (formType === 'create') { |
|||
await InspectionProcessPageApi.inspectionTemplateCreat(data.value) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await InspectionProcessPageApi.inspectionTemplateUpdate(data.value) |
|||
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, 'basicAgvLocationrelation') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await InspectionProcessPageApi.inspectionTemplateDelete(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
}) |
|||
|
|||
</script> |
|||
./inspectionPlan.data |
@ -0,0 +1,287 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
|
|||
export const InspectionTemplateRules = reactive({ |
|||
description: [ |
|||
{ required: true , message: '请填写描述', trigger: 'blur' } |
|||
], |
|||
version: [ |
|||
{ required: true , message: '请填写版本', trigger: 'blur' } |
|||
], |
|||
inspectionCode: [ |
|||
{ required: true, message: '请选择检验方案模板编码', trigger: 'blur' } |
|||
], |
|||
sequenceCode: [ |
|||
{ required: true, message: '请填写顺序号', trigger: 'blur' } |
|||
], |
|||
inspectionCharCode: [ |
|||
{ required: true, message: '请选择检验特性编码', trigger: 'blur' } |
|||
], |
|||
describe: [ |
|||
{ required: true, message: '请填写描述', trigger: 'blur' } |
|||
], |
|||
inspectionMethodCode: [ |
|||
{ required: true, message: '请选择检验方法编码', trigger: 'blur' } |
|||
], |
|||
dynamicUpdateCode: [ |
|||
{ required: true, message: '请选择采样过程编码', trigger: 'blur' } |
|||
], |
|||
inspectionMethod: [ |
|||
{ required: true, message: '请选择动态修改规则编码', trigger: 'blur' } |
|||
], |
|||
isCanUpdate: [ |
|||
{ required: true, message: '请选择是否允许修改特征值', trigger: 'blur' } |
|||
], |
|||
isDestructionInspection: [ |
|||
{ required: true, message: '请选择是否破坏性检验', trigger: 'blur' } |
|||
], |
|||
resultEntryMethod: [ |
|||
{ required: true, message: '请选择结果录入方式', trigger: 'blur' } |
|||
], |
|||
featureType: [ |
|||
{ required: true, message: '请选择特征类型', trigger: 'blur' } |
|||
], |
|||
quantifyIsCapping: [ |
|||
{ required: true, message: '请选择是否设定上限', trigger: 'blur' } |
|||
], |
|||
quantifyIsLowlimit: [ |
|||
{ required: true, message: '请选择是否设定下限', trigger: 'blur' } |
|||
], |
|||
quantifyTarget: [ |
|||
{ required: true, message: '请输入目标值', trigger: 'blur' } |
|||
], |
|||
quantifyCapping: [ |
|||
{ required: true, message: '请输入上限值', trigger: 'blur' } |
|||
], |
|||
quantifyLowlimit: [ |
|||
{ required: true, message: '请输入下限值', trigger: 'blur' } |
|||
], |
|||
quantifyquantifyUomLowlimit: [ |
|||
{ required: true, message: '请选择计量单位', trigger: 'blur' } |
|||
], |
|||
quantifyDecimal: [ |
|||
{ required: true, message: '请输入小数位', trigger: 'blur' } |
|||
], |
|||
quantifyQuantifyCode: [ |
|||
{ required: true, message: '请输入选择集编码', trigger: 'blur' } |
|||
], |
|||
}) |
|||
export const InspectionTemplateMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '编码', |
|||
field: 'code', |
|||
sort: 'custom', |
|||
form:{ |
|||
componentProps:{ |
|||
disabled:true, |
|||
placeholder:'系统自动获取' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '描述', |
|||
field: 'description', |
|||
sort: 'custom', |
|||
},{ |
|||
label: '版本', |
|||
field: 'version', |
|||
sort: 'custom', |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
|||
export const InspectionTemplateProcess = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '编码', |
|||
field: 'code', |
|||
sort: 'custom', |
|||
form:{ |
|||
componentProps:{ |
|||
disabled:true, |
|||
placeholder:'系统自动获取' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '描述', |
|||
field: 'description', |
|||
sort: 'custom', |
|||
isForm:false |
|||
},{ |
|||
label: '检验方案模板编码', |
|||
field: 'inspectionCode', |
|||
sort: 'custom', |
|||
},{ |
|||
label: '顺序号', |
|||
field: 'sequenceCode', |
|||
},{ |
|||
label: '检验特性编码', |
|||
field: 'inspectionCharCode', |
|||
sort: 'custom', |
|||
} |
|||
])) |
|||
export const InspectionTemplateFeatures= useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '编码', |
|||
field: 'code', |
|||
sort: 'custom', |
|||
form:{ |
|||
componentProps:{ |
|||
disabled:true, |
|||
placeholder:'系统自动获取' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '描述', |
|||
field: 'describe', |
|||
sort: 'custom', |
|||
},{ |
|||
label: '检验方法编码', |
|||
field: 'inspectionMethodCode', |
|||
sort: 'custom', |
|||
},{ |
|||
label: '采样过程编码', |
|||
field: 'dynamicUpdateCode', |
|||
sort: 'custom', |
|||
},{ |
|||
label: '动态修改规则编码', |
|||
field: 'inspectionMethod', |
|||
sort: 'custom', |
|||
},{ |
|||
label: '是否允许修改特征值', |
|||
field: 'isCanUpdate', |
|||
sort: 'custom', |
|||
|
|||
form:{ |
|||
component:'Select', |
|||
api: () => [{ |
|||
value:0, |
|||
label:'是' |
|||
},{ |
|||
value:1, |
|||
label:'否' |
|||
}], |
|||
componentProps:{ |
|||
optionsAlias: { |
|||
labelField: 'label', |
|||
valueField: 'value' |
|||
} |
|||
} |
|||
} |
|||
},{ |
|||
label: '是否破坏性检验', |
|||
field: 'isDestructionInspection', |
|||
sort: 'custom', |
|||
form:{ |
|||
component:'Select', |
|||
api: () => [{ |
|||
value:0, |
|||
label:'是' |
|||
},{ |
|||
value:1, |
|||
label:'否' |
|||
}], |
|||
componentProps:{ |
|||
optionsAlias: { |
|||
labelField: 'label', |
|||
valueField: 'value' |
|||
} |
|||
} |
|||
} |
|||
},{ |
|||
label: '结果录入方式', |
|||
field: 'resultEntryMethod', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY, |
|||
dictClass: 'string', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
},{ |
|||
label: '特征类型', |
|||
field: 'featureType', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE, |
|||
dictClass: 'string', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
},{ |
|||
label: '是否设定上限', |
|||
field: 'quantifyIsCapping', |
|||
sort: 'custom', |
|||
form:{ |
|||
component:'Select', |
|||
api: () => [{ |
|||
value:0, |
|||
label:'是' |
|||
},{ |
|||
value:1, |
|||
label:'否' |
|||
}], |
|||
componentProps:{ |
|||
optionsAlias: { |
|||
labelField: 'label', |
|||
valueField: 'value' |
|||
} |
|||
} |
|||
} |
|||
},{ |
|||
label: '是否设定下限', |
|||
field: 'quantifyIsLowlimit', |
|||
sort: 'custom', |
|||
form:{ |
|||
component:'Select', |
|||
api: () => [{ |
|||
value:0, |
|||
label:'是' |
|||
},{ |
|||
value:1, |
|||
label:'否' |
|||
}], |
|||
componentProps:{ |
|||
optionsAlias: { |
|||
labelField: 'label', |
|||
valueField: 'value' |
|||
} |
|||
} |
|||
} |
|||
},{ |
|||
label: '目标值', |
|||
field: 'quantifyTarget', |
|||
sort: 'custom', |
|||
},{ |
|||
label: '上限值', |
|||
field: 'quantifyCapping', |
|||
sort: 'custom', |
|||
},{ |
|||
label: '下限值', |
|||
field: 'quantifyLowlimit', |
|||
sort: 'custom', |
|||
},{ |
|||
label: '计量单位', |
|||
field: 'quantifyUom', |
|||
sort: 'custom', |
|||
},{ |
|||
label: '小数位', |
|||
field: 'quantifyDecimal', |
|||
sort: 'custom', |
|||
},{ |
|||
label: '选择集编码', |
|||
field: 'quantifyQuantifyCode', |
|||
sort: 'custom', |
|||
form:{ |
|||
component:'Select' |
|||
} |
|||
} |
|||
])) |
Loading…
Reference in new issue