Commit ffdcaddd by sunhaiwei

Merge remote-tracking branch 'origin/weiqiao-vue3' into hongshun

# Conflicts:
#	xjrsoft-vue3/src/api/jcsj/cjx/model/CjxModel.ts
#	xjrsoft-vue3/src/views/ckgl/xsck/components/config.ts
#	xjrsoft-vue3/src/views/ckgl/xsck/components/workflowPermission.ts
#	xjrsoft-vue3/src/views/jcsj/cjx/components/Form.vue
#	xjrsoft-vue3/src/views/jcsj/cjx/components/config.ts
parents 99dd1c39 7829bf09
node_modules
dist
.git
.gitignore
README.md
.env.local
.env.*.local
.vscode
.idea
*.log
.DS_Store
coverage
.nyc_output
NODE_ENV=production
# Whether to open mock
# 是否开启mock
VITE_USE_MOCK = true
# public path
# 资源公共路径,需要以 / 开头和结尾
VITE_PUBLIC_PATH = /
# Delete console
# 是否删除Console.log
VITE_DROP_CONSOLE = true
# Whether to enable gzip or brotli compression
# Optional: gzip | brotli | none
# If you need multiple forms, you can use `,` to separate
VITE_BUILD_COMPRESS = 'none'
# 打包是否输出gz|br文件
# 可选: gzip | brotli | none
# 也可以有多个, 例如 ‘gzip’|'brotli',这样会同时生成 .gz和.br文件
VITE_BUILD_COMPRESS = 'gzip'
# Whether to delete origin files when using compress, default false
# 使用compress时是否删除源文件,默认false
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
# Basic interface address SPA
VITE_GLOB_API_URL=/basic-api
# 接口地址 可以由nginx做转发或者直接写实际地址
VITE_GLOB_API_URL=http://112.230.195.2:8053
# File upload address, optional
# It can be forwarded by nginx or write the actual address directly
VITE_GLOB_UPLOAD_URL=/upload
# 文件上传地址 可以由nginx做转发或者直接写实际地址
VITE_GLOB_UPLOAD_URL = /system/oss/upload
# 文件预览接口 可选
VITE_GLOB_UPLOAD_PREVIEW = http://114.116.210.204:8012/onlinePreview?url=
VITE_GLOB_UPLOAD_PREVIEW = http://112.230.195.2:9012/onlinePreview?url=
#外部url地址
VITE_GLOB_OUT_LINK_URL = http://localhost:4100,http://localhost:8827
VITE_GLOB_OUT_LINK_URL = http://vue.xjrsoft.com:3200
#打印项目地址
VITE_GLOB_PRINT_BASE_URL = http://114.116.210.204:3300
VITE_GLOB_PRINT_BASE_URL = https://vue.xjrsoft.com:7002
#IM URL 地址
VITE_GLOB_IM_LINK_URL = http://localhost:8827
# Interface prefix
VITE_GLOB_API_URL_PREFIX=
#调查问卷地址
VITE_GLOB_QN_LINK_URL = https://vue.xjrsoft.com
# Whether to enable image compression
VITE_USE_IMAGEMIN= true
# 接口地址前缀,有些系统所有接口地址都有前缀,可以在这里统一加,方便切换
VITE_GLOB_API_URL_PREFIX =
# use pwa
# 打包是否开启pwa功能
VITE_USE_PWA = false
# Is it compatible with older browsers
VITE_LEGACY = false
# 是否启用官网代码
VITE_GLOB_PRODUCTION = true
# 帆软服务地址
VITE_GLOB_FINE_REPORT_URL = http://127.0.0.1:8075
......@@ -39,3 +39,5 @@ jinayi
/src/api/jianyi
/src/views/code/demo3
.history
*.log
# ==========================================
# 阶段 1: 构建环境 (Builder)
# ==========================================
# 使用指定的 Node 22.22.0 版本
FROM node:22.22.0-alpine AS builder
# 设置工作目录
WORKDIR /app
# 安装 pnpm
# Alpine 镜像通常没有 pnpm,需要通过 corepack 启用或 npm 全局安装
# Node 22 默认内置 corepack,推荐以下方式启用 pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
# 复制 package.json 和 pnpm-lock.yaml (利用 Docker 缓存层)
COPY package.json pnpm-lock.yaml ./
# 安装依赖
# --frozen-lockfile 确保安装版本与锁文件严格一致,适合生产环境
RUN pnpm install --frozen-lockfile
# 复制所有源代码
COPY . .
# 执行构建命令 (假设你的构建脚本是 build,输出到 dist 目录)
ARG BUILD_MODE=production
RUN pnpm run build:${BUILD_MODE}
# ==========================================
# 阶段 2: 生产环境 (Production)
# ==========================================
# 使用轻量级 Nginx 镜像
FROM nginx:alpine AS production
# 设置工作目录
WORKDIR /usr/share/nginx/html
# 从 builder 阶段复制构建好的 dist 目录内容到 Nginx 静态目录
# 注意:Vue 3 + Vite 默认输出到 dist/,如果是 webpack 可能是 dist/ 或其他
COPY --from=builder /app/dist .
# 复制自定义的 Nginx 配置文件 (可选,但推荐用于解决 Vue Router History 模式刷新 404 问题)
COPY nginx.conf /etc/nginx/conf.d/default.conf
# 暴露端口
EXPOSE 8052
# 启动 Nginx
CMD ["nginx", "-g", "daemon off;"]
services:
xjrsoft-vue:
build:
context: .
dockerfile: Dockerfile
args:
BUILD_MODE: production
#BUILD_MODE: test
image: xjrsoft-vue:1.0.0
container_name: xjrsoft-vue
ports:
- "8052:8052"
restart: unless-stopped
server {
listen 8052;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Gzip压缩
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json;
# 缓存静态资源
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
access_log off;
}
# Vue Router history模式支持
location / {
try_files $uri $uri/ /index.html;
}
# 安全响应头
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
}
......@@ -11,6 +11,7 @@
"serve": "npm run dev",
"dev": "vite",
"build": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 vite build && esno ./build/script/postBuild.ts",
"build:production": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 vite build && esno ./build/script/postBuild.ts",
"build:test": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode test && esno ./build/script/postBuild.ts",
"build:no-cache": "pnpm clean:cache && npm run build",
"report": "cross-env REPORT=true npm run build",
......
......@@ -174,6 +174,8 @@ export interface MesWarehouseArrivedInfoModel {
modifyDate: string;
modifyUserId: string;
wlid: string;
}
/**
......
......@@ -6,11 +6,15 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
export interface MesCollectionItemPageParams extends BasicPageParams {
code: string;
name: string;
contentType: string;
qualityCategoryId: string;
name: string;
qualityCategoryId: string;
dataType: string;
}
/**
......@@ -65,7 +69,73 @@ export interface MesCollectionItemModel {
lowerValue: string;
note: string;
qualityCategoryId: string;
}
/**
* @description: MesCollectionItem表类型
*/
export interface MesCollectionItemModel {
id: string;
code: string;
name: string;
required: string;
categoryId: string;
contentType: string;
dataType: string;
dictId: string;
relatedModelId: string;
relatedModelName: string;
relatedModelDomain: string;
standardValue: string;
upperValue: string;
lowerValue: string;
note: string;
companyId: string;
qualityCategoryId: string;
analysisMethod: string;
qualityMethodId: string;
destructive: string;
keyItem: string;
deleteMark: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
sc: string;
dt: string;
bb: string;
mesCollectionScItOptionList?: MesCollectionScItOptionModel;
}
companyId: string;
qualityCategoryId: string;
......@@ -86,6 +156,30 @@ export interface MesCollectionItemModel {
modifyDate: string;
/**
* @description: MesCollectionScItOption表类型
*/
export interface MesCollectionScItOptionModel {
id: string;
code: string;
name: string;
stemId: string;
note: string;
deleteMark: string;
createDate: string;
createUserId: string;
modifyDate: string;
modifyUserId: string;
}
modifyUserId: string;
sc: string;
......
......@@ -28,6 +28,8 @@ export interface MesBaseProductInfoPageModel {
cplx: string;
bzzl: string;
sfqypc: string;
}
/**
......@@ -101,6 +103,8 @@ export interface MesBaseProductInfoModel {
modifyUserId: string;
p1: string;
sfqypc: string;
}
/**
......
......@@ -6,7 +6,19 @@ import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
export interface MesBaseBomPageParams extends BasicPageParams {
bommc: string;
cpid: string;
bomsl: string;
bombb: string;
cpbh: string;
cpgg: string;
cpxh: string;
sfyy: string;
bz: string;
}
/**
......@@ -17,7 +29,9 @@ export interface MesBaseBomPageModel {
bommc: string;
cpmc: string;
bomsl: string;
bombb: string;
cpbh: string;
......@@ -25,9 +39,9 @@ export interface MesBaseBomPageModel {
cpxh: string;
bomsl: string;
sfyy: string;
bombb: string;
bz: string;
}
/**
......
......@@ -8,8 +8,7 @@ enum Api {
List = '/system/finereport/list',
Info = '/system/finereport/info',
MesFineReport = '/system/finereport',
GetByCode = '/system/finereport/code',
InfoByCode = '/system/finereport/infoByCode',
}
......@@ -45,12 +44,13 @@ export async function getMesFineReport(id: String, mode: ErrorMessageMode = 'mod
}
/**
* @description: 根据模板标识获取MesFineReport信息
* @description: 根据标识获取MesFineReport信息
*/
export async function getMesFineReportByCode(code: String, mode: ErrorMessageMode = 'modal') {
return defHttp.get<MesFineReportPageModel>(
{
url: Api.GetByCode + '/' + code,
url: Api.InfoByCode,
params: { code },
},
{
errorMessageMode: mode,
......
......@@ -7,6 +7,16 @@ export interface MesFineReportPageParams extends BasicPageParams {
templateName: string;
templateCode: string;
previewUrl: string;
reportName: string;
printUrl: string;
description: string;
enabled: string;
}
/**
......@@ -22,6 +32,12 @@ export interface MesFineReportPageModel {
previewUrl: string;
enabled: string;
reportName: string;
printUrl: string;
description: string;
}
/**
......
......@@ -144,7 +144,7 @@ export interface FormProps {
formWidth?: number;
isSearch?: boolean;
slots?: Slots;
buttonList: buttonListInfo[];
buttonList?: buttonListInfo[];
}
export interface FormSchema {
// Field name
......
......@@ -521,7 +521,7 @@ export function testPwdState(pwd) {
} else if (pwd.length >= 5 && pwd.length <= 7) {
//5-7个字符
score += 10;
} else if (pwd.length > 8) {
} else if (pwd.length >= 8) {
//8个字符以上
score += 25;
}
......
......@@ -28,7 +28,52 @@ export const searchFormSchema: FormSchema[] = [
field: 'gys',
label: '供应商',
defaultValue: undefined,
component: 'Input',
component: 'XjrSelect',
componentProps: {
datasourceType: 'api',
apiConfig: {
path: '/jcxx/gysInfoList',
method: 'GET',
apiId: '9099e750be50417299aa85ac4f27608b',
apiParams: [
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'keyword',
value: null,
description: null,
required: false,
dataType: null,
type: null,
defaultValue: null,
validateType: null,
error: null,
expression: null,
children: null,
bindType: '',
},
],
},
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql ="select *,id as value,name as label from roke_partner where delete_mark = 0 and customer=\'2\'"+\r\n\' ?{keyword, AND name LIKE CONCAT("%", #{keyword}, "%")}\';\r\nreturn db.select(sql);',
outputParams: [
{ name: 'label', tableTitle: '名称', bindField: '', show: true, width: 150 },
{ name: 'code', tableTitle: '编号', bindField: '', show: true, width: 150 },
{ name: 'contacts', tableTitle: '联系人', bindField: '', show: true, width: 150 },
{ name: 'address', tableTitle: '地址', bindField: '', show: true, width: 150 },
],
},
labelField: 'label',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'zdr',
......@@ -297,34 +342,24 @@ export const formProps: FormProps = {
span: 8,
list: [
{
key: '2be7c2009d5d496fa83ebca7a699f656',
key: '8e8adb239db44a4ba19cd28a3d661f16',
field: 'djh',
label: '单据号',
type: 'input',
component: 'Input',
type: 'auto-code',
component: 'AutoCodeRule',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '',
placeholder: '请输入单据号',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
autoCodeRule: 'cgdhbh',
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
......@@ -458,34 +493,66 @@ export const formProps: FormProps = {
span: 8,
list: [
{
key: '9f64a605992b43cc9443c96669b33b3d',
key: '67205496b1c94fea99508f8b16520473',
field: 'gys',
label: '供应商',
type: 'input',
component: 'Input',
type: 'associate-popup',
component: 'MultiplePopup',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
popupType: 'associate',
width: '100%',
span: 7,
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
placeholder: '请选择供应商',
showLabel: true,
disabled: false,
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
pageSize: 10,
assoTitle: '供应商信息',
apiConfig: {
path: '/jcxx/gysInfoList',
method: 'GET',
apiId: '9099e750be50417299aa85ac4f27608b',
apiParams: [
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'keyword',
value: null,
description: null,
required: false,
dataType: null,
type: null,
defaultValue: null,
validateType: null,
error: null,
expression: null,
children: null,
bindType: '',
},
],
},
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql ="select *,id as value,name as label from roke_partner where delete_mark = 0 and customer=\'2\'"+\r\n\' ?{keyword, AND name LIKE CONCAT("%", #{keyword}, "%")}\';\r\nreturn db.select(sql);',
outputParams: [
{ name: 'label', tableTitle: '名称', show: true, width: 150 },
{ name: 'code', tableTitle: '编号', show: true, width: 150 },
{ name: 'contacts', tableTitle: '联系人', show: true, width: 150 },
{ name: 'address', tableTitle: '地址', show: true, width: 150 },
],
},
dicOptions: [],
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
......@@ -854,6 +921,100 @@ export const formProps: FormProps = {
},
},
{
key: 'c793430b933d4d6db6c492bdec4597b1',
title: '物料编码',
dataIndex: 'wlid',
componentType: 'MultiplePopup',
componentProps: {
popupType: 'associate',
width: '100%',
span: '',
placeholder: '请选择物料编码',
showLabel: true,
disabled: false,
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
pageSize: 10,
assoTitle: '联想弹层-联想数据配置',
apiConfig: {
path: '/jcxx/wlInfoList',
method: 'GET',
apiId: '58a1e5be580f4cc991e444e95142bbe7',
apiParams: [
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'keyword',
value: null,
description: null,
required: false,
dataType: 'String',
type: null,
defaultValue: null,
validateType: null,
error: null,
expression: null,
children: null,
bindType: '',
},
],
},
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql ="select *,id as value,cpbh as label from mes_base_product_info where delete_mark = 0"+\r\n\' ?{keyword, AND cpmc LIKE CONCAT("%", #{keyword}, "%")}\';\r\nreturn db.select(sql);',
outputParams: [
{
name: 'label',
tableTitle: '物料编码',
bindField: 'wlbm',
show: true,
width: 150,
component: 'd156328500cb4894ad6856524fb85d98',
bindTable: 'mes_warehouse_arrived_info',
},
{
name: 'cpmc',
tableTitle: '物料名称',
bindField: 'wlmc',
show: true,
width: 150,
component: 'e8b50d775cf34c278af462df13a9c865',
bindTable: 'mes_warehouse_arrived_info',
},
{
name: 'gg',
tableTitle: '规格',
bindField: 'gg',
show: true,
width: 150,
component: '0e6903d4d9014dcfae6b1cb666d448b7',
bindTable: 'mes_warehouse_arrived_info',
},
{
name: 'xh',
tableTitle: '型号',
bindField: 'xh',
show: true,
width: 150,
component: '63ed4d83c8bc4858872435c676ca8eb7',
bindTable: 'mes_warehouse_arrived_info',
},
],
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: 'd156328500cb4894ad6856524fb85d98',
title: '物料编码',
dataIndex: 'wlbm',
......@@ -876,7 +1037,7 @@ export const formProps: FormProps = {
events: {},
listStyle: '',
isSave: false,
isShow: true,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
......
......@@ -2,19 +2,18 @@ export const permissionList = [
{
required: false,
view: true,
edit: true,
disabled: false,
edit: false,
disabled: true,
isSaveTable: false,
tableName: '',
fieldName: '单据号',
fieldId: 'djh',
isSubTable: false,
showChildren: true,
type: 'input',
key: '2be7c2009d5d496fa83ebca7a699f656',
type: 'auto-code',
key: '8e8adb239db44a4ba19cd28a3d661f16',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......@@ -77,11 +76,10 @@ export const permissionList = [
fieldId: 'gys',
isSubTable: false,
showChildren: true,
type: 'input',
key: '9f64a605992b43cc9443c96669b33b3d',
type: 'associate-popup',
key: '67205496b1c94fea99508f8b16520473',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
......@@ -270,6 +268,21 @@ export const permissionList = [
showChildren: false,
tableName: 'mesWarehouseArrivedInfoList',
fieldName: '物料编码',
fieldId: 'wlid',
type: 'MultiplePopup',
key: 'c793430b933d4d6db6c492bdec4597b1',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseArrivedInfoList',
fieldName: '物料编码',
fieldId: 'wlbm',
type: 'Input',
key: 'd156328500cb4894ad6856524fb85d98',
......
......@@ -1031,7 +1031,7 @@ export const formProps: FormProps = {
{
key: '54d24d79d45b465aae192edd0afb5bcd',
title: '物料编码',
dataIndex: 'wlbm',
dataIndex: 'wlid',
componentType: 'MultiplePopup',
componentProps: {
popupType: 'associate',
......@@ -1061,7 +1061,15 @@ export const formProps: FormProps = {
script:
'var sql ="select *,cpmc as value,cpmc as label from mes_base_product_info where delete_mark = 0"+\r\n\' ?{keyword, AND cpmc LIKE CONCAT("%", #{keyword}, "%")}\';\r\nreturn db.select(sql);',
outputParams: [
{ name: 'label', tableTitle: '物料编码', show: true, width: 150 },
{
name: 'label',
tableTitle: '物料编码',
show: true,
width: 150,
component: '9ebd9378b9154d6789b918febd229fa0',
bindField: 'wlbm',
bindTable: 'mes_warehouse_saleout_info',
},
{
name: 'cpmc',
tableTitle: '物料名称',
......@@ -1100,6 +1108,36 @@ export const formProps: FormProps = {
},
},
{
key: '9ebd9378b9154d6789b918febd229fa0',
title: '物料编码',
dataIndex: 'wlbm',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '92b05df5ae0d4ba2b89a9916bab6b5b7',
title: '物料名称',
dataIndex: 'wlmc',
......@@ -1125,7 +1163,7 @@ export const formProps: FormProps = {
isShow: true,
scan: false,
bordered: true,
isShowAi: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
......@@ -1403,7 +1441,6 @@ export const formButtons = [
isShow: true,
index: 2,
type: 1,
modal: null,
},
{
key: 'cancel',
......@@ -1414,7 +1451,6 @@ export const formButtons = [
isShow: true,
index: 1,
type: 1,
modal: null,
},
{
key: 'reset',
......@@ -1425,6 +1461,5 @@ export const formButtons = [
isShow: true,
index: 0,
type: 1,
modal: null,
},
];
......@@ -290,7 +290,7 @@ export const permissionList = [
showChildren: false,
tableName: 'mesWarehouseSaleoutInfoList',
fieldName: '物料编码',
fieldId: 'wlbm',
fieldId: 'wlid',
type: 'MultiplePopup',
key: '54d24d79d45b465aae192edd0afb5bcd',
children: [],
......@@ -304,6 +304,21 @@ export const permissionList = [
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseSaleoutInfoList',
fieldName: '物料编码',
fieldId: 'wlbm',
type: 'Input',
key: '9ebd9378b9154d6789b918febd229fa0',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseSaleoutInfoList',
fieldName: '物料名称',
fieldId: 'wlmc',
type: 'Input',
......
<template>
<div class="pt-4">
<SimpleForm
ref="systemFormRef"
:formProps="data.formDataProps"
:formModel="state.formModel"
:isWorkFlow="props.fromPage!=FromPageType.MENU"
:isWorkFlow="props.fromPage != FromPageType.MENU"
:isCamelCase="true"
@model-change="handleChange"
/>
......@@ -15,13 +14,21 @@
import { reactive, ref, onMounted, nextTick, watch } from 'vue';
import { formProps, formEventConfigs } from './config';
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
import { addMesCollectionItem, getMesCollectionItem, updateMesCollectionItem } from '/@/api/jcsj/cjx';
import {
addMesCollectionItem,
getMesCollectionItem,
updateMesCollectionItem,
} from '/@/api/jcsj/cjx';
import { cloneDeep, isString } from 'lodash-es';
import { FormDataProps } from '/@/components/Designer/src/types';
import { usePermission } from '/@/hooks/web/usePermission';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { FromPageType } from '/@/enums/workflowEnum';
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent';
import {
createFormEvent,
getFormDataEvent,
loadFormEvent,
submitFormEvent,
} from '/@/hooks/web/useFormEvent';
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
import { useRouter } from 'vue-router';
......@@ -29,7 +36,7 @@
const { filterFormSchemaAuth } = usePermission();
const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'update:value']);
const emits = defineEmits(['changeUploadComponentIds', 'loadingCompleted', 'update:value']);
const props = defineProps({
fromPage: {
type: Number,
......@@ -42,7 +49,7 @@
});
const state = reactive({
formModel: {},
formInfo:{formId:'',formName:''}
formInfo: { formId: '', formName: '' },
});
const { currentRoute } = useRouter();
watch(
......@@ -59,17 +66,35 @@
try {
if (props.fromPage == FromPageType.MENU) {
setMenuPermission();
if(currentRoute.value.meta){
state.formInfo.formName = currentRoute.value.meta.title&&isString(currentRoute.value.meta.title)?currentRoute.value.meta.title:'';
state.formInfo.formId = currentRoute.value.meta.formId&&isString(currentRoute.value.meta.formId)?currentRoute.value.meta.formId:'';
if (currentRoute.value.meta) {
state.formInfo.formName =
currentRoute.value.meta.title && isString(currentRoute.value.meta.title)
? currentRoute.value.meta.title
: '';
state.formInfo.formId =
currentRoute.value.meta.formId && isString(currentRoute.value.meta.formId)
? currentRoute.value.meta.formId
: '';
}
await createFormEvent(formEventConfigs, state.formModel,
await createFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单
formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:初始化表单
await nextTick();
await loadFormEvent(formEventConfigs, state.formModel,
await loadFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:加载表单
} else if (props.fromPage == FromPageType.FLOW) {
emits('loadingCompleted'); //告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
......@@ -78,15 +103,28 @@
} else if (props.fromPage == FromPageType.DESKTOP) {
// 桌面设计 表单事件需要执行
emits('loadingCompleted'); //告诉系统表单已经加载完毕
await createFormEvent(formEventConfigs, state.formModel,
await createFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单
await loadFormEvent(formEventConfigs, state.formModel,
formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:初始化表单
await loadFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:加载表单
}
} catch (error) {}
});
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
function setMenuPermission() {
data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!);
......@@ -107,19 +145,25 @@
}
return values;
}
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】
async function setFormDataFromId(rowId) {
try {
const record = await getMesCollectionItem(rowId);
setFieldsValue(record);
state.formModel = record;
await getFormDataEvent(formEventConfigs, state.formModel,
await getFormDataEvent(
formEventConfigs,
state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:获取表单数据
} catch (error) {
}
formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:获取表单数据
} catch (error) {}
}
// 辅助返回表单数据
async function getFieldsValue() {
let values = [];
......@@ -135,45 +179,64 @@
}
return values;
}
// 辅助设置表单数据
function setFieldsValue(record) {
systemFormRef.value.setFieldsValue(record);
}
// 重置表单数据
async function resetFields() {
await systemFormRef.value.resetFields();
}
// 设置表单数据全部为Disabled 【查看】
async function setDisabledForm( ) {
async function setDisabledForm() {
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas));
}
// 获取行键值
function getRowKey() {
return RowKey;
}
// 更新api表单数据
async function update({ values, rowId }) {
try {
values[RowKey] = rowId;
state.formModel = values;
let saveVal = await updateMesCollectionItem(values);
await submitFormEvent(formEventConfigs, state.formModel,
await submitFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:提交表单
return saveVal;
} catch (error) {}
}
// 新增api表单数据
async function add(values) {
try {
state.formModel = values;
let saveVal = await addMesCollectionItem(values);
await submitFormEvent(formEventConfigs, state.formModel,
await submitFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:提交表单
return saveVal;
} catch (error) {}
}
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
async function setWorkFlowForm(obj: WorkFlowFormParams) {
try {
......@@ -189,16 +252,30 @@
state.formModel = formModels;
setFieldsValue(formModels);
} catch (error) {}
await createFormEvent(formEventConfigs, state.formModel,
await createFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单
await loadFormEvent(formEventConfigs, state.formModel,
formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:初始化表单
await loadFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:加载表单
}
function handleChange(val) {
emits('update:value', val);
}
async function sendMessageForAllIframe() {
try {
if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) {
......@@ -206,6 +283,7 @@
}
} catch (error) {}
}
defineExpose({
setFieldsValue,
resetFields,
......@@ -218,8 +296,6 @@
setWorkFlowForm,
getRowKey,
getFieldsValue,
sendMessageForAllIframe
sendMessageForAllIframe,
});
</script>
\ No newline at end of file
......@@ -9,12 +9,6 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input',
},
{
field: 'name',
label: '名称',
defaultValue: undefined,
component: 'Input',
},
{
field: 'contentType',
label: '采集内容',
defaultValue: undefined,
......@@ -30,6 +24,12 @@ export const searchFormSchema: FormSchema[] = [
},
},
{
field: 'name',
label: '名称',
defaultValue: undefined,
component: 'Input',
},
{
field: 'qualityCategoryId',
label: '项目类别',
defaultValue: undefined,
......@@ -44,6 +44,21 @@ export const searchFormSchema: FormSchema[] = [
getPopupContainer: () => document.body,
},
},
{
field: 'dataType',
label: '数据类型',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '2004076331787718658' },
labelField: 'name',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
];
export const columns: BasicColumn[] = [
......@@ -101,19 +116,6 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'standardValue',
title: '标准值',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'qualityCategoryId',
title: '项目类别',
componentType: 'select',
......@@ -208,9 +210,9 @@ export const formProps: FormProps = {
span: 8,
list: [
{
label: '编号',
key: '63358dcd4fc24817b7ed628c1628b768',
field: 'code',
label: '编号',
type: 'auto-code',
component: 'AutoCodeRule',
colProps: { span: 24 },
......@@ -231,9 +233,9 @@ export const formProps: FormProps = {
},
},
{
label: '采集内容',
key: 'e7f5cb98a72b435486e7b27202b20314',
field: 'contentType',
label: '采集内容',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
......@@ -271,9 +273,9 @@ export const formProps: FormProps = {
},
},
{
label: '标准值',
key: '6bcc83ede1a446bd95291c6af00ab4af',
field: 'standardValue',
label: '标准值',
type: 'input',
component: 'Input',
colProps: { span: 24 },
......@@ -303,15 +305,38 @@ export const formProps: FormProps = {
style: { width: '100%' },
},
},
{
label: '获取设备数采',
key: '781dbbcd076e4d3c87e7f1bef5a237d7',
field: 'deviceAcquisitionData',
type: 'switch',
component: 'Switch',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
span: 7,
defaultValue: 0,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#4da9ff',
unCheckedColor: '#6b6b6b',
showLabel: true,
disabled: false,
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: {},
},
},
],
},
{
span: 8,
list: [
{
label: '名称',
key: '94675ea0ccc842aaaeec56e898af23ec',
field: 'name',
label: '名称',
type: 'input',
component: 'Input',
colProps: { span: 24 },
......@@ -342,9 +367,9 @@ export const formProps: FormProps = {
},
},
{
label: '项目类别',
key: 'aeef62f898504ee69ec02be990a3e827',
field: 'qualityCategoryId',
label: '项目类别',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
......@@ -382,9 +407,9 @@ export const formProps: FormProps = {
},
},
{
label: '标准上限',
key: 'd1f5113e7e8a462d8b33908230ea7fc3',
field: 'upperValue',
label: '标准上限',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
......@@ -412,9 +437,9 @@ export const formProps: FormProps = {
span: 8,
list: [
{
label: '必填项',
key: '781dbbcd076e4d3c87e7f1bef5a237d7',
field: 'required',
label: '必填项',
type: 'switch',
component: 'Switch',
colProps: { span: 24 },
......@@ -435,16 +460,16 @@ export const formProps: FormProps = {
},
},
{
label: '数据类型',
key: 'a70a1e8f07f342a5b92de0a9e8bb1777',
field: 'dataType',
label: '数据类型',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择下拉选择数据类型',
placeholder: '',
showLabel: true,
showSearch: false,
isMultiple: false,
......@@ -475,9 +500,9 @@ export const formProps: FormProps = {
},
},
{
label: '标准下限',
key: '076321d9eb244b1c9f6e2f9ddc53091e',
field: 'lowerValue',
label: '标准下限',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
......@@ -505,9 +530,9 @@ export const formProps: FormProps = {
span: 24,
list: [
{
label: '备注',
key: '181de7ae00fd4ffda6cb3a729c65bc58',
field: 'note',
label: '备注',
type: 'textarea',
component: 'InputTextArea',
colProps: { span: 24 },
......@@ -548,6 +573,166 @@ export const formProps: FormProps = {
margin: '10px',
},
},
{
key: '0b0cc0ebc7c0471b85de8d6894339d09',
field: '',
label: '',
type: 'tab',
colProps: { span: 24 },
component: 'Tab',
children: [
{
span: 24,
name: '选项',
prefix: '',
suffix: '',
activeColor: '#1c8dff',
folderId: '',
imageUrl: '',
conFolderId: '',
conImageUrl: '',
list: [
{
key: 'df08e26c0e8a40c6bb78510f7091d068',
label: '',
field: 'mesCollectionScItOptionList',
type: 'form',
component: 'SubForm',
required: true,
colProps: { span: 24 },
componentProps: {
mainKey: 'mesCollectionScItOptionList',
columns: [
{
key: '56b0f6cb30cd421286fe2c0bb2bb729e',
title: '选项名称',
dataIndex: 'name',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '7cccbcf52f1c45b3916221a20f593586',
title: '备注',
dataIndex: 'note',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{ title: '操作', key: 'action', fixed: 'right', width: '50px' },
],
span: '24',
preloadType: 'api',
apiConfig: {},
itemId: '',
dicOptions: [],
useSelectButton: false,
buttonName: '选择数据',
showLabel: true,
showComponentBorder: true,
showBorder: false,
backgroundStyle: {
isShow: false,
bgColor: '#ffffff',
bgImgUrl: '',
fontColor: '',
borderColor: '',
},
theadStyle: {
isShow: false,
fontSize: 14,
fontColor: '#000000',
bgType: 'color',
gradientDegree: '',
gradientColors: '',
bgImageUrl: '',
bgColor: '',
bgRepeat: 'no-repeat',
},
tbodyStyle: {
isShow: false,
fontSize: 14,
fontColor: '#000000',
bgType: 'color',
gradientDegree: '',
gradientColors: '',
bgImageUrl: '',
bgColor: '',
bgRepeat: 'no-repeat',
},
bordercolor: '#f0f0f0',
bordershowtype: [true, true, true, true],
borderwidth: 1,
showIndex: true,
isShow: true,
multipleHeads: [],
buttonList: [],
topButtonList: [],
isExport: false,
isImport: false,
isDeleteSelected: false,
isListView: false,
viewList: [],
isShowAdd: true,
isShowDelete: true,
hasCheckedCol: false,
checkedColType: 'checkbox',
pageSize: 10,
events: {},
showPagenation: true,
},
},
],
},
],
componentProps: { tabPosition: 'top', size: 'default', type: 'line', isShow: true },
},
],
showActionButtonGroup: false,
buttonLocation: 'center',
......
......@@ -163,4 +163,49 @@ export const permissionList = [
options: {},
defaultValue: '',
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: true,
showChildren: false,
tableName: 'mesCollectionScItOptionList',
fieldName: '',
fieldId: 'mesCollectionScItOptionList',
type: 'form',
key: 'df08e26c0e8a40c6bb78510f7091d068',
children: [
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesCollectionScItOptionList',
fieldName: '选项名称',
fieldId: 'name',
type: 'Input',
key: '56b0f6cb30cd421286fe2c0bb2bb729e',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesCollectionScItOptionList',
fieldName: '备注',
fieldId: 'note',
type: 'Input',
key: '7cccbcf52f1c45b3916221a20f593586',
children: [],
},
],
},
];
import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';
import { uploadApi } from '/@/api/sys/upload';
export const searchFormSchema: FormSchema[] = [
{
......@@ -137,6 +136,19 @@ export const columns: BasicColumn[] = [
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'sfqypc',
title: '是否启用批次',
componentType: 'switch',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
];
//表头合并配置
export const headerMergingData = [];
......@@ -686,6 +698,29 @@ export const formProps: FormProps = {
style: { width: '100%' },
},
},
{
key: '1c96dccdc764461690cb631d5cc2662b',
field: 'sfqypc',
label: '是否启用批次',
type: 'switch',
component: 'Switch',
colProps: { span: 24 },
defaultValue: 1,
componentProps: {
span: 7,
defaultValue: 1,
checkedChildren: '',
unCheckedChildren: '',
checkedColor: '#1C8DFF',
unCheckedColor: '#bbbdbf',
showLabel: true,
disabled: false,
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: {},
},
},
],
},
{
......@@ -846,44 +881,6 @@ export const formProps: FormProps = {
},
],
},
{
span: 24,
name: '作业规范',
prefix: '',
suffix: '',
activeColor: '#1c8dff',
folderId: '',
imageUrl: '',
conFolderId: '',
conImageUrl: '',
list: [
{
key: '18b105f9641a4a03841e8397876a6a1e',
field: 'zygf',
label: '作业规范(文件)',
type: 'upload',
component: 'Upload',
colProps: { span: 24 },
componentProps: {
api: uploadApi,
span: 2,
defaultValue: '',
accept: '',
maxNumber: 10,
maxSize: '',
showLabel: true,
multiple: false,
disabled: false,
required: false,
isShow: true,
events: {},
listType: 'text',
sourceType: 'album,camera',
tooltipConfig: { visible: false, title: '提示文本' },
},
},
],
},
],
componentProps: { tabPosition: 'top', size: 'default', type: 'line', isShow: true },
},
......
......@@ -207,6 +207,23 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '是否启用批次',
fieldId: 'sfqypc',
isSubTable: false,
showChildren: true,
type: 'switch',
key: '1c96dccdc764461690cb631d5cc2662b',
children: [],
options: {},
defaultValue: 1,
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '型号',
fieldId: 'xh',
isSubTable: false,
......@@ -268,21 +285,4 @@ export const permissionList = [
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '作业规范(文件)',
fieldId: 'zygf',
isSubTable: false,
showChildren: true,
type: 'upload',
key: '18b105f9641a4a03841e8397876a6a1e',
children: [],
options: {},
defaultValue: '',
},
];
......@@ -28,7 +28,14 @@
</template>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.componentType === 'switch'">
<a-switch
v-model:checked="record[column.dataIndex]"
:unCheckedValue="0"
:checkedValue="1"
:disabled="true"
/>
</template>
<template v-if="column.dataIndex === 'action'">
......
<template>
<BasicModal
:height="500"
v-bind="$attrs" @register="registerModal" :title="getTitle"
@ok="handleSubmit" @cancel="handleClose" >
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
@cancel="handleClose"
>
<ModalForm ref="formRef" v-model:value="state.formModel" :fromPage="FromPageType.MENU" />
<template #footer v-if=" !state.isView">
<template #footer v-if="!state.isView">
<template v-for="(item, index) in sortBy(formButtons, 'index')" :key="item.key">
<template v-if="item.isShow">
<CustomButtonModal v-if="item.type == CustomButtonModalType.Modal" :info="item" />
......@@ -23,7 +24,6 @@
</template>
</template>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, reactive, provide, Ref } from 'vue';
......@@ -33,7 +33,7 @@
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { formProps ,formButtons } from './config';
import { formProps, formButtons } from './config';
import ModalForm from './Form.vue';
import { FromPageType } from '/@/enums/workflowEnum';
......@@ -44,7 +44,7 @@
const { notification } = useMessage();
const formRef = ref();
const isCopy = ref<boolean>(false)
const isCopy = ref<boolean>(false);
const state = reactive({
formModel: {},
isUpdate: true,
......@@ -58,10 +58,11 @@
await handleInner(data);
});
const getTitle = computed(() => (state.isView ? '查看' : state.isUpdate ? '编辑' : isCopy.value ? '复制数据' : '新增'));
const getTitle = computed(() =>
state.isView ? '查看' : state.isUpdate ? '编辑' : isCopy.value ? '复制数据' : '新增',
);
async function handleInner(data){
async function handleInner(data) {
state.isUpdate = !!data?.isUpdate;
state.isView = !!data?.isView;
isCopy.value = !!data?.isCopy;
......@@ -73,7 +74,8 @@
showOkBtn: false,
canFullscreen: true,
width: 900,
footer: state.isView ? null : undefined,defaultFullscreen:true,
footer: state.isView ? null : undefined,
defaultFullscreen: true,
});
if (state.isUpdate || state.isView || isCopy.value) {
......@@ -85,10 +87,9 @@
await formRef.value.setFormDataFromId(state.rowId);
} else {
formRef.value.resetFields();
}
}
async function saveModal() {
let saveSuccess = false;
try {
......@@ -140,15 +141,14 @@
emit('success');
}
} finally {
setModalProps({ confirmLoading: false });
}
}
function customClick(item) {
if (item.key == 'confirm') {
handleSubmit();
} else if (item.key == 'cancel' && props.formType !== 'normal') {
} else if (item.key == 'cancel') {
handleClose();
closeModal();
} else if (item.key == 'reset') {
......@@ -157,10 +157,8 @@
executeCurFormEvent(item.event, state.formModel, true);
}
}
function handleClose() {
formRef.value.resetFields();
}
</script>
\ No newline at end of file
......@@ -760,6 +760,7 @@ export const formProps: FormProps = {
showResetButton: false,
showSubmitButton: false,
hiddenComponent: [],
buttonList: [],
};
export const formButtons = [
......
......@@ -148,7 +148,7 @@
function customClick(item) {
if (item.key == 'confirm') {
handleSubmit();
} else if (item.key == 'cancel' && props.formType !== 'normal') {
} else if (item.key == 'cancel') {
handleClose();
closeModal();
} else if (item.key == 'reset') {
......@@ -163,4 +163,3 @@
</script>
\ No newline at end of file
......@@ -4,69 +4,68 @@ import { BasicColumn } from '/@/components/Table';
export const searchFormSchema: FormSchema[] = [
{
field: 'bommc',
label: '物料名称',
label: '产品名称',
defaultValue: undefined,
component: 'Input',
},
{
field: 'cpid',
label: '产品',
field: 'bomsl',
label: '产品数量',
defaultValue: undefined,
component: 'XjrSelect',
component: 'InputNumber',
componentProps: {
datasourceType: 'api',
apiConfig: {
path: '/scgl/scjh/getAllProduct',
method: 'GET',
apiId: 'f4fbb57f2f18425e97918a031c8aa7d8',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql = 'select *,id as value,cpmc as label from mes_base_product_info where delete_mark=0';\r\nreturn db.select(sql)",
outputParams: [
style: { width: '100%' },
},
},
{
name: 'cpbh',
tableTitle: '产品编号',
bindField: 'cpbh',
show: true,
width: 150,
component: 'b2682f1ff2dc48448211cacb4bf48bfd',
field: 'bombb',
label: 'BOM版本',
defaultValue: undefined,
component: 'Input',
},
{
name: 'cpmc',
tableTitle: '产品名称',
bindField: 'cpmc',
show: true,
width: 150,
component: 'db0bea5c2dbf4505833e67179e8618f3',
field: 'cpbh',
label: '产品编号',
defaultValue: undefined,
component: 'Input',
},
{
name: 'gg',
tableTitle: '产品规格',
bindField: 'cpgg',
show: true,
width: 150,
component: '3e7491b6d43c4ef7a7b6c2fd49a94a7f',
field: 'cpgg',
label: '产品规格',
defaultValue: undefined,
component: 'Input',
},
{
name: 'xh',
tableTitle: '产品型号',
bindField: 'cpxh',
show: true,
width: 150,
component: 'cf7d04d1e6374a3fbc4a9dfb9ebdf19e',
field: 'cpxh',
label: '产品型号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'sfyy',
label: '是否有效',
defaultValue: 1,
component: 'Select',
componentProps: {
getPopupContainer: () => document.body,
options: [
{
label: '开',
value: 1,
},
{
label: '关',
value: 0,
},
],
},
labelField: 'label',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
{
field: 'bz',
label: '备注',
defaultValue: undefined,
component: 'Input',
},
];
......@@ -74,20 +73,33 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'bommc',
title: '物料名称',
title: '产品名称',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'cpmc',
title: '产品名称',
dataIndex: 'bomsl',
title: '产品数量',
componentType: 'number',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'bombb',
title: 'BOM版本',
componentType: 'input',
fixed: false,
......@@ -138,9 +150,9 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'bomsl',
title: '物料数量',
componentType: 'number',
dataIndex: 'sfyy',
title: '是否有效',
componentType: 'switch',
fixed: false,
sorter: true,
......@@ -151,15 +163,15 @@ export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'bombb',
title: '物料版本',
componentType: 'input',
dataIndex: 'bz',
title: '备注',
componentType: 'textarea',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
listStyle: undefined,
},
];
//表头合并配置
......@@ -245,116 +257,9 @@ export const formProps: FormProps = {
span: 8,
list: [
{
key: '0bb6edfef8ac486482e02a6e650306e6',
field: 'bommc',
label: '物料名称',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入物料名称',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: true,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: '4bc74304a0144e879b2fc45ae28ab1c5',
field: 'bomsl',
label: '物料数量',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
width: '100%',
span: 7,
min: 0,
step: 1,
disabled: false,
showLabel: true,
controls: true,
required: true,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
defaultValue: 0,
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: '50bff2d4c82d40a98ace5fd2b1d3b41e',
field: 'bombb',
label: '物料版本',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入物料版本',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: 'c42ef62f38e1445b89e5c3362ffd3af2',
field: 'cpid',
label: '产品',
label: '产品名称',
type: 'associate-popup',
component: 'MultiplePopup',
colProps: { span: 24 },
......@@ -362,7 +267,7 @@ export const formProps: FormProps = {
popupType: 'associate',
width: '100%',
span: 7,
placeholder: '请产品选择',
placeholder: '请产品名称选择',
showLabel: true,
disabled: false,
datasourceType: 'api',
......@@ -393,10 +298,10 @@ export const formProps: FormProps = {
{
name: 'cpmc',
tableTitle: '产品名称',
bindField: 'cpmc',
show: true,
width: 150,
component: 'db0bea5c2dbf4505833e67179e8618f3',
component: 'b44ff861a87d45b5b264515d85935042',
bindField: 'bommc',
},
{
name: 'gg',
......@@ -431,9 +336,40 @@ export const formProps: FormProps = {
span: 8,
list: [
{
key: 'b2682f1ff2dc48448211cacb4bf48bfd',
field: 'cpbh',
label: '产品编号',
key: '4bc74304a0144e879b2fc45ae28ab1c5',
field: 'bomsl',
label: '产品数量',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
width: '100%',
span: 7,
min: 0,
step: 1,
disabled: false,
showLabel: true,
controls: true,
required: true,
subTotal: false,
isShow: true,
rules: [],
events: {},
tooltipConfig: { visible: false, title: '提示文本' },
defaultValue: 0,
style: { width: '100%' },
},
},
],
},
{
span: 8,
list: [
{
key: '50bff2d4c82d40a98ace5fd2b1d3b41e',
field: 'bombb',
label: 'BOM版本',
type: 'input',
component: 'Input',
colProps: { span: 24 },
......@@ -442,12 +378,12 @@ export const formProps: FormProps = {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '',
placeholder: '请输入BOM版本',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: true,
disabled: false,
allowClear: false,
showLabel: true,
required: false,
......@@ -469,9 +405,9 @@ export const formProps: FormProps = {
span: 8,
list: [
{
key: 'db0bea5c2dbf4505833e67179e8618f3',
field: 'cpmc',
label: '产品名称',
key: 'b2682f1ff2dc48448211cacb4bf48bfd',
field: 'cpbh',
label: '产品编号',
type: 'input',
component: 'Input',
colProps: { span: 24 },
......@@ -610,6 +546,45 @@ export const formProps: FormProps = {
],
},
{
span: 8,
list: [
{
key: 'b44ff861a87d45b5b264515d85935042',
field: 'bommc',
label: '产品名称',
type: 'input',
component: 'Input',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
placeholder: '请输入产品名称',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{ span: 8, list: [] },
{
span: 24,
list: [
{
......
......@@ -6,15 +6,14 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '物料名称',
fieldId: 'bommc',
fieldName: '产品名称',
fieldId: 'cpid',
isSubTable: false,
showChildren: true,
type: 'input',
key: '0bb6edfef8ac486482e02a6e650306e6',
type: 'associate-popup',
key: 'c42ef62f38e1445b89e5c3362ffd3af2',
children: [],
options: {},
defaultValue: '',
},
{
required: true,
......@@ -23,7 +22,7 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '物料数量',
fieldName: '产品数量',
fieldId: 'bomsl',
isSubTable: false,
showChildren: true,
......@@ -40,7 +39,7 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '物料版本',
fieldName: 'BOM版本',
fieldId: 'bombb',
isSubTable: false,
showChildren: true,
......@@ -51,22 +50,6 @@ export const permissionList = [
defaultValue: '',
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '产品',
fieldId: 'cpid',
isSubTable: false,
showChildren: true,
type: 'associate-popup',
key: 'c42ef62f38e1445b89e5c3362ffd3af2',
children: [],
options: {},
},
{
required: false,
view: true,
edit: false,
......@@ -90,23 +73,6 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '产品名称',
fieldId: 'cpmc',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'db0bea5c2dbf4505833e67179e8618f3',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: false,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '产品规格',
fieldId: 'cpgg',
isSubTable: false,
......@@ -158,6 +124,23 @@ export const permissionList = [
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '产品名称',
fieldId: 'bommc',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'b44ff861a87d45b5b264515d85935042',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '备注',
fieldId: 'bz',
isSubTable: false,
......
......@@ -24,7 +24,14 @@
</template>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.componentType === 'switch'">
<a-switch
v-model:checked="record[column.dataIndex]"
:unCheckedValue="0"
:checkedValue="1"
:disabled="true"
/>
</template>
<template v-if="column.dataIndex === 'action'">
......
......@@ -118,7 +118,7 @@
import ApprovalProcess from '/@/views/workflow/task/components/ApprovalProcess.vue';
import { getFormExecuteWorkflow } from '/@/api/form/execute';
import MesProcessPlErrorModal from './components/MesProcessPlErrorModal.vue';
import MesProcessPlErrorModal from './components/MesProcessPLErrorModal.vue';
import propsModal from '../mesprocessplerror/components/propsModal.vue';
import { searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index';
......
......@@ -58,7 +58,7 @@
import { useModal } from '/@/components/Modal';
import ProOrderWorkStepModal from './components/ProOrderWorkStepModal.vue';
import ProOrderWorkStepModal from './components/ProorderworkstepModal.vue';
import { searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index';
......
......@@ -59,7 +59,7 @@
import { useModal } from '/@/components/Modal';
import WhStockModal from './components/WhStockModal.vue';
import WhStockModal from './components/WhstockModal.vue';
import { downloadByData } from '/@/utils/file/download';
......
......@@ -16,6 +16,12 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input',
},
{
field: 'jhbh',
label: '计划编号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'ywzz',
label: '业务组织',
defaultValue: undefined,
......@@ -45,7 +51,18 @@ export const columns: BasicColumn[] = [
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'gxId',
title: '工序',
componentType: 'select',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'jhbh',
......
......@@ -230,6 +230,14 @@
async function handleEdit(record: Recordable) {
const hasNonDraft = (record.zt !== '草稿' && record.zt !== '未开始');
if (hasNonDraft) {
Modal.warning({
title: '提示',
content: '进行中或者已完成的工单无法编辑',
});
return;
}
let field = 'id';
try {
let hasIn = handleHasEnableLocke(buttonConfigs.value, 'edit');
......
......@@ -119,6 +119,7 @@
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
import {rksqMesProductOutput} from "/@/api/scgl/ccmx";
const pageParamsInfo = ref<any>({});
const {
......@@ -288,6 +289,14 @@
}
async function handleEdit(record: Recordable) {
const hasNonDraft = (record.zt !== '草稿');
if (hasNonDraft) {
Modal.warning({
title: '提示',
content: '已下发任务无法编辑',
});
return;
}
let field = 'id';
try {
let hasIn = handleHasEnableLocke(buttonConfigs.value, 'edit');
......@@ -395,6 +404,13 @@
}
function handleXiafa(record: Recordable) {
Modal.confirm({
title: t('提示信息'),
icon: createVNode(ExclamationCircleOutlined),
content: t('是否下发?'),
okText: t('确认'),
cancelText: t('取消'),
async onOk() {
if (selectedKeys.value.length === 0) {
Modal.warning({
title: '提示',
......@@ -419,6 +435,10 @@
description: '下发成功!',
});
});
},
onCancel() {},
});
}
function getLessActions(record: Recordable) {
......
......@@ -68,8 +68,24 @@ import { log } from 'node:console';
try {
const apiUrl = import.meta.env.VITE_GLOB_API_URL || '';
const response = await axios.get(apiUrl + '/magic-api/jcxx/wlxList', { params: { bomId: newBomId } });
state.formModel.mesWarehouseMaterialList = []
// Process API response data and assign to material list
state.formModel.mesWarehouseMaterialList = [];
//铸造量的值
let sl = state.formModel.sl;
if (sl && sl > 0) {
let data = response.data.data;
data.forEach((item) => {
//bom数量
let bomsl = item.bomsl;
if (bomsl && bomsl > 0) {
//用铸造量除以bom数量并保留2位小数
let result = Number((sl / bomsl).toFixed(2));
//物料数量等于原数量*倍数
if (item.wlsl && item.wlsl > 0) {
item.wlsl = Number((item.wlsl*result).toFixed(2));
}
}
})
}
state.formModel.mesWarehouseMaterialList = response.data.data.map(item => ({
wlbh: item.wlbh,
wlmc: item.wlmc,
......@@ -78,12 +94,9 @@ import { log } from 'node:console';
khbz: item.khbz,
nkbz: item.nkbz,
sftl: item.sftl,
bomsl: item.bomsl,
wlId: item.id
}
)
);
// state.formModel.mesWarehouseMaterialList = materialList;
}));
} catch (error) {
notification.error({ message: '获取物料清单失败' });
}
......
......@@ -93,6 +93,19 @@
} catch (error) {}
}
} catch (error) {
if (error) {
let errorFields = error["errorFields"];
if (Array.isArray(errorFields) && errorFields.length > 0) {
let errorInfos = errorFields[0]["errors"];
if (Array.isArray(errorInfos) && errorInfos.length > 0) {
let description = errorInfos[0];
notification.error({
message: t('提示'),
description: "物料清单列表"+description,
});
}
}
}
return saveSuccess;
}
}
......@@ -136,4 +149,3 @@
</script>
\ No newline at end of file
import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';
import {uploadApi} from "/@/api/sys/upload";
export const searchFormSchema: FormSchema[] = [
{
......@@ -330,7 +331,7 @@ export const formProps: FormProps = {
style: { width: '100%' },
},
},
{
/* {
key: '25e30bcce47a437fb5674d9dbce3523a',
field: 'zl',
label: '重量/KG',
......@@ -355,7 +356,7 @@ export const formProps: FormProps = {
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
},*/
{
key: 'd66e5ebfa5d64b829fde596c82155158',
field: 'sfnbdd',
......@@ -390,6 +391,32 @@ export const formProps: FormProps = {
style: {},
},
},
{
key: 'fd52ee27396a4a028c80e1f6b883efaf',
field: 'sl',
label: '铸造量',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
width: '100%',
span: 7,
defaultValue: 0,
min: 0,
step: 0.1,
disabled: false,
showLabel: true,
controls: true,
required: true,
subTotal: false,
isShow: true,
rules: [],
events: { change: '' },
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
......@@ -533,11 +560,11 @@ export const formProps: FormProps = {
},
},
{
key: '427fc55accd744d0a6359faf80e45a1b',
field: 'sccx',
label: '产线',
type: 'associate-select',
component: 'AssociateSelect',
key: '21610208f2b8428e84de66979709d296',
field: 'sccj',
label: '车间',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
......@@ -545,34 +572,29 @@ export const formProps: FormProps = {
placeholder: '请选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
defaultSelect: '',
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/scgl/scrw/getCxByCjbh',
path: '/scgl/scrw/getAllChejian',
method: 'GET',
apiId: 'ecbc0291292c49fca50468561b9770e8',
apiId: '59730efb7b4a4439a013cac04926e00e',
apiParams: [
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'cjid',
value:
'{"bindField":"sccj","fieldKey":"21610208f2b8428e84de66979709d296"}',
required: true,
defaultValue: '0',
bindType: 'data',
},
],
},
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql='select cx.*,cx.id as value,cx.cxmc as label from mes_base_chanxian cx join mes_base_cj_cx rela on cx.id=rela.cxid where rela.delete_mark=0 and cx.delete_mark=0 and rela.cjid=#{cjid}'\r\nreturn db.select(sql)",
"var sql='select *,id as value,cjmc as label from mes_base_chejian where delete_mark=0'\r\nreturn db.select(sql)",
},
dicOptions: [],
required: false,
......@@ -588,7 +610,7 @@ export const formProps: FormProps = {
{
span: 6,
list: [
{
/* {
key: 'eb29665fc1e3453d9ef8aa88f8dfac0c',
field: 'zzl',
label: '铸造量',
......@@ -620,7 +642,7 @@ export const formProps: FormProps = {
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
},*/
{
key: '99da98d5a335454a9d613715e539c7bd',
field: 'kh',
......@@ -693,11 +715,11 @@ export const formProps: FormProps = {
},
},
{
key: '21610208f2b8428e84de66979709d296',
field: 'sccj',
label: '车间',
type: 'select',
component: 'XjrSelect',
key: '427fc55accd744d0a6359faf80e45a1b',
field: 'sccx',
label: '产线',
type: 'associate-select',
component: 'AssociateSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
......@@ -705,29 +727,34 @@ export const formProps: FormProps = {
placeholder: '请选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },
{ key: 3, label: 'Option 3', value: 'Option 3' },
],
defaultSelect: '',
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/scgl/scrw/getAllChejian',
path: '/scgl/scrw/getCxByCjbh',
method: 'GET',
apiId: '59730efb7b4a4439a013cac04926e00e',
apiId: 'ecbc0291292c49fca50468561b9770e8',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'cjid',
value:
'{"bindField":"sccj","fieldKey":"21610208f2b8428e84de66979709d296"}',
required: true,
defaultValue: '0',
bindType: 'data',
},
],
},
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql='select *,id as value,cjmc as label from mes_base_chejian where delete_mark=0'\r\nreturn db.select(sql)",
"var sql='select cx.*,cx.id as value,cx.cxmc as label from mes_base_chanxian cx join mes_base_cj_cx rela on cx.id=rela.cxid where rela.delete_mark=0 and cx.delete_mark=0 and rela.cjid=#{cjid}'\r\nreturn db.select(sql)",
},
dicOptions: [],
required: false,
......@@ -738,6 +765,33 @@ export const formProps: FormProps = {
style: { width: '100%' },
},
},
{
key: 'c40beca261124a17b8ea5258ae8b3b19',
field: 'jsyq',
label: '技术要求',
type: 'upload',
component: 'Upload',
colProps: { span: 24 },
componentProps: {
api: uploadApi,
span: 7,
defaultValue: '',
accept: '',
maxNumber: 5,
maxSize: '',
showLabel: true,
multiple: false,
disabled: true,
required: false,
isShow: true,
events: {},
listType: 'text',
sourceType: 'album,camera',
tooltipConfig: { visible: false, title: '提示文本' },
},
},
],
},
{
......@@ -837,32 +891,7 @@ export const formProps: FormProps = {
style: { width: '100%' },
},
},
{
key: 'fd52ee27396a4a028c80e1f6b883efaf',
field: 'sl',
label: '数量',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: 0,
componentProps: {
width: '100%',
span: 7,
defaultValue: 0,
min: 0,
step: 0.1,
disabled: false,
showLabel: true,
controls: true,
required: true,
subTotal: false,
isShow: true,
rules: [],
events: { change: '' },
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
],
},
{
......
......@@ -234,6 +234,14 @@
async function handleEdit(record: Recordable) {
const hasNonDraft = (record.zt !== '草稿' && record.zt !== '未开始');
if (hasNonDraft) {
Modal.warning({
title: '提示',
content: '开工之后无法编辑',
});
return;
}
let field = 'id';
try {
let hasIn = handleHasEnableLocke(buttonConfigs.value, 'edit');
......
......@@ -14,6 +14,49 @@ export const searchFormSchema: FormSchema[] = [
defaultValue: undefined,
component: 'Input',
},
{
field: 'previewUrl',
label: '预览地址',
defaultValue: undefined,
component: 'Input',
},
{
field: 'reportName',
label: '报表名称',
defaultValue: undefined,
component: 'Input',
},
{
field: 'printUrl',
label: '打印地址',
defaultValue: undefined,
component: 'Input',
},
{
field: 'description',
label: '描述',
defaultValue: undefined,
component: 'Input',
},
{
field: 'enabled',
label: '是否启用',
defaultValue: 1,
component: 'Select',
componentProps: {
getPopupContainer: () => document.body,
options: [
{
label: '开',
value: 1,
},
{
label: '关',
value: 0,
},
],
},
},
];
export const columns: BasicColumn[] = [
......@@ -68,6 +111,45 @@ export const columns: BasicColumn[] = [
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'reportName',
title: '报表名称',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'printUrl',
title: '打印地址',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'description',
title: '描述',
componentType: 'textarea',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
];
//表头合并配置
export const headerMergingData = [];
......@@ -267,7 +349,7 @@ export const formProps: FormProps = {
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: true, title: '在设计器中报表模板的名称,.cpt后缀' },
tooltipConfig: { visible: true, title: '在设计器中报表模板的名称' },
style: { width: '100%' },
},
},
......
......@@ -6,7 +6,7 @@
<template #resizeRight>
<BasicTable @register="registerTable" isMenuTable ref="tableRef"
<BasicTable @register="registerTable" isMenuTable ref="tableRef" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }"
>
......@@ -73,7 +73,7 @@
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getMesFineReportPage, deleteMesFineReport} from '/@/api/system/finereport';
import { getMesFineReportPage, deleteMesFineReport, getMesFineReportByCode} from '/@/api/system/finereport';
import { ResizePageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
......@@ -120,6 +120,9 @@
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore();
const pageParamsInfo = ref<any>({});
const { enableLockeData,handleOpenFormEnableLockeData, handleCloseFormEnableLocke, handleHasEnableLocke } =
useConcurrentLock();
......@@ -138,9 +141,9 @@
//展示在列表内的按钮
const actionButtons = ref<string[]>(["view","edit","delete"]);
const actionButtons = ref<string[]>(["view","edit","preview","delete"]);
const buttonConfigs = computed(()=>{
const list = [{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isEnableLock":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}]
const list = [{"buttonId":"2017161412910284800","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2017161412914479104","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"buttonId":"2017161412914479105","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},{"buttonId":"2029469719079505920","name":"帆软打印","code":"fineReportPrint","icon":"ant-design:printer-outlined","isDefault":true,"isUse":true,"showType":"top","buttonType":"primary"},{"isUse":true,"name":"预览","code":"preview","icon":"ant-design:laptop-outlined","isDefault":false,"setting":[],"showType":"inline","buttonType":"primary"},{"buttonId":"2017161412914479106","name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]
return filterButtonAuth(list);
})
......@@ -152,7 +155,7 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
const btnEvent = {view : handleView,add : handleAdd,edit : handleEdit,delete : handleDelete,}
const btnEvent = {view : handleView,add : handleAdd,edit : handleEdit,delete : handleDelete,preview : handlePreview,fineReportPrint : handleFineReportPrint, }
const { currentRoute } = useRouter();
......@@ -164,6 +167,8 @@
const selectedKeys = ref<string[]>([]);
const selectedRowsData = ref<any[]>([]);
......@@ -196,6 +201,8 @@
selectedKeys.value = [];
selectedRowsData.value = [];
},
useSearchForm: true,
......@@ -268,6 +275,54 @@
deleteList([record.id]);
}
/**
* 预览fine report模板页面
* @param record
*/
function handlePreview(record: Recordable) {
const ssoToken = userStore.getFineReportToken;
const url = `${record.previewUrl}&id=${record.id}&ssoToken=${ssoToken}`;
window.open(url, '_blank');
}
/**
* 批量打印fine report模板
*/
async function handleFineReportPrint() {
if (!selectedKeys.value.length) {
notification.warning({
message: t('提示'),
description: t('请选择数据'),
});
return;
}
// 定义的模板标识
const code = 'code2';
const fineReportData = await getMesFineReportByCode(code);
let reportlets = "[";
for (const item of selectedKeys.value) {
reportlets += "{reportlet: '" + fineReportData.reportName + "', id: '" + item + "'},"
}
reportlets += "]";
const config = {
printUrl : fineReportData.printUrl,
isPopUp : false,
data :{
// 多模板格式: [{reportlet: 'name.cpt', a: 'a1'}, {reportlet: 'name.cpt', b: 'b1'}] 同样的模板会出现多页
// 单模板格式: [{reportlet: 'name.cpt', a: 'a1', b: 'b1'}] 同样的模板只会有单页
reportlets: reportlets // 需要打印的模板列表
// reportlets: [{reportlet: 'Certificate.cpt', id: '2016702346492686338'}, {reportlet: 'Certificate.cpt', id: '2016702576495734786'}]
// reportlets: "[{reportlet: 'Certificate.cpt',id: '2016702776895385601'}"
},
printType : 0, // 打印类型,0为零客户端打印,1为本地打印
// 以下为零客户端打印的参数,仅当 printType 为 0 时生效
ieQuietPrint : false,// IE静默打印设置 true为静默,false为不静默
};
window.FR.doURLPrint(config);
}
function deleteList(ids) {
Modal.confirm({
title: '提示信息',
......@@ -292,10 +347,24 @@
function onSelectChange(selectedRowKeys: [], selectedRows) {
selectedKeys.value = selectedRowKeys;
selectedRowsData.value = selectedRows;
}
function customRow(record: Recordable) {
return {
onClick: () => {
let selectedRowKeys = [...selectedKeys.value];
if (selectedRowKeys.indexOf(record.id) >= 0) {
let index = selectedRowKeys.indexOf(record.id);
selectedRowKeys.splice(index, 1);
} else {
selectedRowKeys.push(record.id);
}
selectedKeys.value = selectedRowKeys;
},
ondblclick: () => {
if (record.isCanEdit && hasPermission("finereport:edit")) {
handleEdit(record);
......@@ -307,6 +376,8 @@
function handleSuccess() {
selectedKeys.value = [];
selectedRowsData.value = [];
reload();
}
......
......@@ -89,9 +89,9 @@
</template>
</BasicTable>
</a-tab-pane>
<a-tab-pane key="6" tab="所持证书" force-render>
<BasicForm @register="registerForm3" />
</a-tab-pane>
<!-- <a-tab-pane key="6" tab="所持证书" force-render>-->
<!-- <BasicForm @register="registerForm3" />-->
<!-- </a-tab-pane>-->
</a-tabs>
<RoleModal @register="registerRoleModal" @success="handleRoleSuccess" />
<PostModal @register="registerPostModal" @success="handlePostSuccess" />
......@@ -148,10 +148,10 @@
},
{
field: 'departmentIds',
label: t('所属机构'),
label: t('部门'),
component: 'TreeSelect',
componentProps: {
placeholder: '请选择所属机构',
placeholder: '请选择部门',
fieldNames: {
label: 'name',
key: 'id',
......@@ -175,10 +175,10 @@
required: true,
validator: (_, value) => {
if (!value) {
return Promise.reject('请输入登录密码');
return Promise.reject('请输入登录密码');
}
if (pwdText.value === '弱') {
return Promise.reject('密码强度设置过低,请至少保证中等强度。');
return Promise.reject('密码强度设置过低,请至少保证长度>=5且包含大小写字母和至少3位数字!');
}
return Promise.resolve();
},
......@@ -200,7 +200,6 @@
label: t('邮箱'),
field: 'email',
component: 'Input',
required: true,
colProps: { span: 12 },
componentProps: {
placeholder: '请输入邮箱',
......@@ -432,7 +431,7 @@
dataIndex: 'name',
},
];
const certificateFormSchema: FormSchema[] = [
/*const certificateFormSchema: FormSchema[] = [
{
field: 'certificateCode',
label: '证书编号',
......@@ -451,7 +450,7 @@
placeholder: '请输入证书名称',
},
},
];
];*/
const emit = defineEmits(['success', 'register']);
const { notification } = useMessage();
const isUpdate = ref(true);
......@@ -464,7 +463,7 @@
const roleDatasource = ref<any[]>([]);
const postDatasource = ref<any[]>([]);
const orgDatasource = ref<any[]>([]);
const certificateDatasource = ref<any[]>([]);
//const certificateDatasource = ref<any[]>([]);
const [
registerForm1,
......@@ -501,7 +500,7 @@
},
});
const [
/*const [
registerForm3,
{ setFieldsValue: setFieldsValue3, resetFields: resetFields3, validate: validate3 },
] = useForm({
......@@ -514,7 +513,7 @@
actionColOptions: {
span: 23,
},
});
});*/
const [registerTable1, { setTableData: setTableData1, setPagination: setPagination1 }] = useTable(
{
......@@ -573,7 +572,7 @@
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields1();
resetFields2();
resetFields3();
//resetFields3();
setModalProps({ confirmLoading: false, width: 800, fixedHeight: true, destroyOnClose: true });
activeKey.value = '1';
isUpdate.value = !!data?.isUpdate;
......@@ -589,10 +588,10 @@
setFieldsValue2({
...record,
});
setFieldsValue3({
/*setFieldsValue3({
certificateCode: record.certificates?.[0]?.certificateCode || '',
certificateName: record.certificates?.[0]?.certificateName || '',
});
});*/
roleDatasource.value = record.roles || [];
postDatasource.value = record.posts || [];
orgDatasource.value = record.chargeDepartments || [];
......@@ -702,7 +701,7 @@
try {
const values = await validate1();
const values2 = await validate2();
const values3 = await validate3();
//const values3 = await validate3();
const roleIds = roleDatasource.value?.map((x) => x.id);
const postIds = postDatasource.value?.map((x) => x.id);
const chargeDepartmentIds = orgDatasource.value?.map((x) => x.id);
......@@ -713,10 +712,7 @@
roleIds,
postIds,
chargeDepartmentIds,
certificates: values3.certificateCode || values3.certificateName ? [{
certificateCode: values3.certificateCode || '',
certificateName: values3.certificateName || '',
}] : [],
certificates: [],
};
setModalProps({ confirmLoading: true });
......
......@@ -54,11 +54,18 @@
deep: true,
},
);
// 1. 定义初始化标记(默认不执行)
let isInitialized = false;
// 质检方案联动:根据方案id从接口获取明细,并整体替换当前明细列表
let zjfaReqSeq = 0;
async function handleZjfaChange(zjfaId: string) {
const seq = ++zjfaReqSeq;
// 2. 初始化阶段直接返回(不执行后续逻辑)
if (!isInitialized) {
// 可选:初始化完成后开启开关(如果需要后续操作生效)
isInitialized = true;
return;
}
try {
const resp = await axios.get(
import.meta.env.VITE_GLOB_API_URL + '/magic-api/zlgl/zjjcsj/getFaById',
......@@ -103,6 +110,8 @@
if (!newZjfaId) {
state.formModel = { ...(state.formModel as any), mesQualityInspectionDetailList: [] };
systemFormRef.value?.setFieldsValue?.({ mesQualityInspectionDetailList: [] });
//没有值将初始化标识改为true
isInitialized = true;
return;
}
await handleZjfaChange(newZjfaId);
......@@ -171,12 +180,12 @@
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:获取表单数据
// 打开编辑弹窗时:用当前方案id刷新明细(放在 getFormDataEvent 后,避免被其覆盖)
await nextTick();
const zjfaId = (state.formModel as any)?.zjfa;
if (zjfaId) {
await handleZjfaChange(zjfaId);
}
const nextModel = {
...(state.formModel as any),
mesQualityInspectionDetailList: record["mesQualityInspectionDetailList"],
};
state.formModel = nextModel;
} catch (error) {
}
......@@ -285,4 +294,3 @@
});
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment