Commit 21b17708 by 董晓奇

Merge branch 'hongshun' of https://git.rokedata.com/jinmin/weiqiao-vue into hongshun

parents ff270647 e230bf78
import { MesDisassembleOutboundDetailPageModel, MesDisassembleOutboundDetailPageParams, MesDisassembleOutboundDetailPageResult } from './model/CcckmxModel';
import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
enum Api {
Page = '/chaiche/ccckmx/page',
List = '/chaiche/ccckmx/list',
Info = '/chaiche/ccckmx/info',
MesDisassembleOutboundDetail = '/chaiche/ccckmx',
}
/**
* @description: 查询MesDisassembleOutboundDetail分页列表
*/
export async function getMesDisassembleOutboundDetailPage(params: MesDisassembleOutboundDetailPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<MesDisassembleOutboundDetailPageResult>(
{
url: Api.Page,
params,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 获取MesDisassembleOutboundDetail信息
*/
export async function getMesDisassembleOutboundDetail(id: String, mode: ErrorMessageMode = 'modal') {
return defHttp.get<MesDisassembleOutboundDetailPageModel>(
{
url: Api.Info,
params: { id },
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 新增MesDisassembleOutboundDetail
*/
export async function addMesDisassembleOutboundDetail(mesDisassembleOutboundDetail: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.MesDisassembleOutboundDetail,
params: mesDisassembleOutboundDetail,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 更新MesDisassembleOutboundDetail
*/
export async function updateMesDisassembleOutboundDetail(mesDisassembleOutboundDetail: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.put<boolean>(
{
url: Api.MesDisassembleOutboundDetail,
params: mesDisassembleOutboundDetail,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 删除MesDisassembleOutboundDetail(批量删除)
*/
export async function deleteMesDisassembleOutboundDetail(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.delete<boolean>(
{
url: Api.MesDisassembleOutboundDetail,
data: ids,
},
{
errorMessageMode: mode,
},
);
}
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
/**
* @description: MesDisassembleOutboundDetail分页参数 模型
*/
export interface MesDisassembleOutboundDetailPageParams extends BasicPageParams {
cphm: string;
clppxh: string;
cllx: string;
clys: string;
clzl: string;
createDate: string;
}
/**
* @description: MesDisassembleOutboundDetail分页返回值模型
*/
export interface MesDisassembleOutboundDetailPageModel {
id: string;
clppxh: string;
clys: string;
clzl: string;
createDate: string;
cphm: string;
cllx: string;
}
/**
* @description: MesDisassembleOutboundDetail表类型
*/
export interface MesDisassembleOutboundDetailModel {
id: string;
cllx: string;
cphm: string;
clzl: string;
clppxh: string;
clys: string;
createDate: string;
modifyDate: string;
}
/**
* @description: MesDisassembleOutboundDetail分页返回值结构
*/
export type MesDisassembleOutboundDetailPageResult =
BasicFetchResult<MesDisassembleOutboundDetailPageModel>;
...@@ -29,10 +29,6 @@ export interface MesWarehouseProductPageModel { ...@@ -29,10 +29,6 @@ export interface MesWarehouseProductPageModel {
crklx: string; crklx: string;
kgy: string;
scbm: string;
ck: string; ck: string;
pch: string; pch: string;
...@@ -42,6 +38,8 @@ export interface MesWarehouseProductPageModel { ...@@ -42,6 +38,8 @@ export interface MesWarehouseProductPageModel {
djzt: string; djzt: string;
bz: string; bz: string;
kgy: string;
} }
/** /**
......
...@@ -21,12 +21,6 @@ export interface MesQualityInspectionSteelScrapWorkflowPageParams extends BasicP ...@@ -21,12 +21,6 @@ export interface MesQualityInspectionSteelScrapWorkflowPageParams extends BasicP
cpmc: string; cpmc: string;
sfpsyj: string; sfpsyj: string;
scbmyj: string;
mybmyj: string;
pkyfbmyj: string;
} }
/** /**
...@@ -52,12 +46,6 @@ export interface MesQualityInspectionSteelScrapWorkflowPageModel { ...@@ -52,12 +46,6 @@ export interface MesQualityInspectionSteelScrapWorkflowPageModel {
createDate: string; createDate: string;
modifyDate: string; modifyDate: string;
scbmyj: string;
mybmyj: string;
pkyfbmyj: string;
} }
/** /**
......
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
registerButton: '注册', registerButton: '注册',
rememberMe: '记住我', rememberMe: '记住我',
forgetPassword: '忘记密码?', forgetPassword: '忘记密码?',
otherSignIn: '其他登录方式', // otherSignIn: '其他登录方式',
// notify // notify
loginSuccessTitle: '登录成功', loginSuccessTitle: '登录成功',
......
<template>
<BasicModal
:height="500"
v-bind="$attrs" @register="registerModal" :title="getTitle"
@ok="handleSubmit" @cancel="handleClose" >
<ModalForm ref="formRef" v-model:value="state.formModel" :fromPage="FromPageType.MENU" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, reactive, provide, Ref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { formProps } from './config';
import ModalForm from './Form.vue';
import { FromPageType } from '/@/enums/workflowEnum';
const emit = defineEmits(['success', 'register']);
const { notification } = useMessage();
const formRef = ref();
const isCopy = ref<boolean>(false)
const state = reactive({
formModel: {},
isUpdate: true,
isView: false,
rowId: '',
});
provide<Ref<boolean>>('isCopy', isCopy);
const { t } = useI18n();
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await handleInner(data);
});
const getTitle = computed(() => (state.isView ? '查看' : state.isUpdate ? '编辑' : isCopy.value ? '复制数据' : '新增'));
async function handleInner(data){
state.isUpdate = !!data?.isUpdate;
state.isView = !!data?.isView;
isCopy.value = !!data?.isCopy;
setModalProps({
destroyOnClose: true,
maskClosable: false,
showCancelBtn: !state.isView,
showOkBtn: !state.isView,
canFullscreen: true,
width: 900,
footer: state.isView ? null : undefined,defaultFullscreen:true,
});
if (state.isUpdate || state.isView || isCopy.value) {
state.rowId = data.id;
if (state.isView) {
await formRef.value.setDisabledForm();
}
await formRef.value.setFormDataFromId(state.rowId);
} else {
formRef.value.resetFields();
}
}
async function saveModal() {
let saveSuccess = false;
try {
const values = await formRef.value?.validate();
//添加隐藏组件
if (formProps.hiddenComponent?.length) {
formProps.hiddenComponent.forEach((component) => {
values[component.bindField] = component.value;
});
}
if (values !== false) {
try {
if (!state.isUpdate || isCopy.value) {
saveSuccess = await formRef.value.add(values);
} else {
saveSuccess = await formRef.value.update({ values, rowId: state.rowId });
}
return saveSuccess;
} catch (error) {}
}
} catch (error) {
return saveSuccess;
}
}
async function handleSubmit() {
try {
const saveSuccess = await saveModal();
setModalProps({ confirmLoading: true });
if (saveSuccess) {
if (!state.isUpdate || isCopy.value) {
//false 新增
notification.success({
message: 'Tip',
description: isCopy.value ? '复制成功' : t('新增成功!'),
}); //提示消息
} else {
notification.success({
message: 'Tip',
description: t('修改成功!'),
}); //提示消息
}
closeModal();
formRef.value.resetFields();
emit('success');
}
} finally {
setModalProps({ confirmLoading: false });
}
}
function handleClose() {
formRef.value.resetFields();
}
</script>
\ No newline at end of file
<template>
<div class="pt-4">
<SimpleForm
ref="systemFormRef"
:formProps="data.formDataProps"
:formModel="state.formModel"
:isWorkFlow="props.fromPage!=FromPageType.MENU"
:isCamelCase="true"
@model-change="handleChange"
/>
</div>
</template>
<script lang="ts" setup>
import { reactive, ref, onMounted, nextTick, watch } from 'vue';
import { formProps, formEventConfigs } from './config';
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
import { addMesDisassembleOutboundDetail, getMesDisassembleOutboundDetail, updateMesDisassembleOutboundDetail } from '/@/api/chaiche/ccckmx';
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 { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
import { useRouter } from 'vue-router';
const { filterFormSchemaAuth } = usePermission();
const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'update:value']);
const props = defineProps({
fromPage: {
type: Number,
default: FromPageType.MENU,
},
});
const systemFormRef = ref();
const data: { formDataProps: FormDataProps } = reactive({
formDataProps: cloneDeep(formProps),
});
const state = reactive({
formModel: {},
formInfo:{formId:'',formName:''}
});
const { currentRoute } = useRouter();
watch(
() => state.formModel,
(val) => {
emits('update:value', val);
},
{
deep: true,
},
);
onMounted(async () => {
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:'';
}
await createFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单
await nextTick();
await loadFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单
} else if (props.fromPage == FromPageType.FLOW) {
emits('loadingCompleted'); //告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
} else if (props.fromPage == FromPageType.PREVIEW) {
// 预览 无需权限,表单事件也无需执行
} else if (props.fromPage == FromPageType.DESKTOP) {
// 桌面设计 表单事件需要执行
emits('loadingCompleted'); //告诉系统表单已经加载完毕
await createFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
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); //表单事件:加载表单
}
} catch (error) {}
});
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
function setMenuPermission() {
data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!);
}
// 校验form 通过返回表单数据
async function validate() {
let values = [];
try {
values = await systemFormRef.value?.validate();
//添加隐藏组件
if (data.formDataProps.hiddenComponent?.length) {
data.formDataProps.hiddenComponent.forEach((component) => {
values[component.bindField] = component.value;
});
}
} finally {
}
return values;
}
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】
async function setFormDataFromId(rowId) {
try {
const record = await getMesDisassembleOutboundDetail(rowId);
setFieldsValue(record);
state.formModel = record;
await getFormDataEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:获取表单数据
} catch (error) {
}
}
// 辅助返回表单数据
async function getFieldsValue() {
let values = [];
try {
values = await systemFormRef.value?.getFieldsValue();
//添加隐藏组件
if (data.formDataProps.hiddenComponent?.length) {
data.formDataProps.hiddenComponent.forEach((component) => {
values[component.bindField] = component.value;
});
}
} finally {
}
return values;
}
// 辅助设置表单数据
function setFieldsValue(record) {
systemFormRef.value.setFieldsValue(record);
}
// 重置表单数据
async function resetFields() {
await systemFormRef.value.resetFields();
}
// 设置表单数据全部为Disabled 【查看】
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 updateMesDisassembleOutboundDetail(values);
await submitFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
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 addMesDisassembleOutboundDetail(values);
await submitFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单
return saveVal;
} catch (error) {}
}
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
async function setWorkFlowForm(obj: WorkFlowFormParams) {
try {
if (obj.formId) state.formInfo.formId = obj.formId;
if (obj.formName) state.formInfo.formName = obj.formName;
let flowData = await changeWorkFlowForm(cloneDeep(formProps), obj);
let { buildOptionJson, uploadComponentIds, formModels, isViewProcess } = flowData;
data.formDataProps = buildOptionJson;
emits('changeUploadComponentIds', uploadComponentIds); //工作流中必须保存上传组件id【附件汇总需要】
if (isViewProcess) {
setDisabledForm(); //查看
}
state.formModel = formModels;
setFieldsValue(formModels);
} catch (error) {}
await createFormEvent(formEventConfigs, state.formModel,
systemFormRef.value,
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); //表单事件:加载表单
}
function handleChange(val) {
emits('update:value', val);
}
async function sendMessageForAllIframe() {
try {
if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) {
systemFormRef.value.sendMessageForAllIframe();
}
} catch (error) {}
}
defineExpose({
setFieldsValue,
resetFields,
validate,
add,
update,
setFormDataFromId,
setDisabledForm,
setMenuPermission,
setWorkFlowForm,
getRowKey,
getFieldsValue,
sendMessageForAllIframe
});
</script>
\ No newline at end of file
import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';
export const searchFormSchema: FormSchema[] = [
{
field: 'cphm',
label: '车牌号码',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'api',
apiConfig: {
path: '/cheliang/cc-list',
method: 'GET',
apiId: '4f46d9d7f8de47c5b744ac88e2ab7eaa',
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 cl.id, cl.cllx, dic.`name` AS cllx_name, cl.gbzl, cl.cphm AS `value`, cl.cphm AS label ' +\r\n'FROM mes_base_cheliang cl ' +\r\n'LEFT JOIN ' +\r\n'(SELECT detail.`value`, detail.`name` ' +\r\n'FROM xjr_dictionary_item item ' +\r\n'LEFT JOIN xjr_dictionary_detail detail ON detail.item_id = item.id ' +\r\n'WHERE item.`code` = \"cllx\") dic ON cl.cllx = dic.`value` COLLATE utf8mb4_0900_ai_ci ' +\r\n'WHERE cl.ypybg = \"1\" AND cl.jcdj = \"2\" ' +\r\n'?{keyword, AND cl.cphm LIKE CONCAT(\"%\", #{keyword}, \"%\")}'\r\nreturn db.select(sql);",
outputParams: [
{ name: 'label', tableTitle: '车牌号码', bindField: '', show: true, width: 150 },
{ name: 'cllx_name', tableTitle: '车辆类型', bindField: '', show: true, width: 150 },
{
name: 'gbzl',
tableTitle: '车辆重量',
bindField: 'clzl',
show: true,
width: 150,
component: 'dc201b28b3cb46d0bc482359c77dd324',
},
{
name: 'cllx',
tableTitle: '',
bindField: 'cllx',
show: false,
width: 150,
component: '0651a99e23cc41d6b014216cfcab1985',
},
],
},
labelField: 'label',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'clppxh',
label: '品牌型号',
defaultValue: undefined,
component: 'Input',
},
{
field: 'cllx',
label: '车辆类型',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '2017066632836796418' },
labelField: 'name',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'clys',
label: '车辆颜色',
defaultValue: undefined,
component: 'Input',
},
{
field: 'clzl',
label: '车辆重量',
defaultValue: undefined,
component: 'InputNumber',
componentProps: {
style: { width: '100%' },
},
},
{
field: 'createDate',
label: '创建日期',
defaultValue: undefined,
component: 'RangePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm:ss',
style: { width: '100%' },
getPopupContainer: () => document.body,
},
},
];
export const columns: BasicColumn[] = [
{
resizable: true,
dataIndex: 'clppxh',
title: '品牌型号',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'clys',
title: '车辆颜色',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{
resizable: true,
dataIndex: 'clzl',
title: '车辆重量',
componentType: 'number',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'createDate',
title: '创建日期',
componentType: 'date',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'cphm',
title: '车牌号码',
componentType: 'associate-popup',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'cllx',
title: '车辆类型',
componentType: 'select',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
];
//表头合并配置
export const headerMergingData = [];
//表单事件
export const formEventConfigs = {
0: [
{
type: 'circle',
color: '#2774ff',
text: '开始节点',
icon: '#icon-kaishi',
bgcColor: '#D8E5FF',
isUserDefined: false,
},
{
color: '#F6AB01',
icon: '#icon-chushihua',
text: '初始化表单',
bgcColor: '#f9f5ea',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
1: [
{
color: '#B36EDB',
icon: '#icon-shujufenxi',
text: '获取表单数据',
detail: '(新增无此操作)',
bgcColor: '#F8F2FC',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
2: [
{
color: '#F8625C',
icon: '#icon-jiazai',
text: '加载表单',
bgcColor: '#FFF1F1',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
3: [
{
color: '#6C6AE0',
icon: '#icon-jsontijiao',
text: '提交表单',
bgcColor: '#F5F4FF',
isUserDefined: false,
nodeInfo: { processEvent: [] },
},
],
4: [
{
type: 'circle',
color: '#F8625C',
text: '结束节点',
icon: '#icon-jieshuzhiliao',
bgcColor: '#FFD6D6',
isLast: true,
isUserDefined: false,
},
],
};
export const formProps: FormProps = {
labelCol: { span: 3, offset: 0 },
labelAlign: 'right',
layout: 'vertical',
size: 'default',
schemas: [
{
key: '5bf8715c07db410abbc3a61ca7c0c43b',
field: '',
label: '',
type: 'grid',
colProps: { span: 24 },
component: 'Grid',
children: [
{
span: 8,
list: [
{
key: 'b6f573efd5c140bea1dd7208aa30b96d',
field: 'cphm',
label: '车牌号码',
type: 'associate-popup',
component: 'MultiplePopup',
colProps: { span: 24 },
componentProps: {
popupType: 'associate',
width: '100%',
span: 7,
placeholder: '请选择车牌号码',
showLabel: true,
disabled: false,
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
pageSize: 10,
assoTitle: '车牌号码',
apiConfig: {
path: '/cheliang/cc-list',
method: 'GET',
apiId: '4f46d9d7f8de47c5b744ac88e2ab7eaa',
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 cl.id, cl.cllx, dic.`name` AS cllx_name, cl.gbzl, cl.cphm AS `value`, cl.cphm AS label ' +\r\n'FROM mes_base_cheliang cl ' +\r\n'LEFT JOIN ' +\r\n'(SELECT detail.`value`, detail.`name` ' +\r\n'FROM xjr_dictionary_item item ' +\r\n'LEFT JOIN xjr_dictionary_detail detail ON detail.item_id = item.id ' +\r\n'WHERE item.`code` = \"cllx\") dic ON cl.cllx = dic.`value` COLLATE utf8mb4_0900_ai_ci ' +\r\n'WHERE cl.ypybg = \"1\" AND cl.jcdj = \"2\" ' +\r\n'?{keyword, AND cl.cphm LIKE CONCAT(\"%\", #{keyword}, \"%\")}'\r\nreturn db.select(sql);",
outputParams: [
{ name: 'label', tableTitle: '车牌号码', show: true, width: 150 },
{ name: 'cllx_name', tableTitle: '车辆类型', show: true, width: 150 },
{
name: 'gbzl',
tableTitle: '车辆重量',
bindField: 'clzl',
show: true,
width: 150,
component: 'dc201b28b3cb46d0bc482359c77dd324',
},
{
name: 'cllx',
tableTitle: '',
bindField: 'cllx',
show: false,
width: 150,
component: '0651a99e23cc41d6b014216cfcab1985',
},
],
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'b4b62820f0374a1aa8d5831a79a32597',
field: 'clppxh',
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: 'd4d3cc7b98d74a428b4bd12af85df446',
field: 'cllx',
label: '车辆类型',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
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: null,
datasourceType: 'dic',
params: { itemId: '2017066632836796418' },
labelField: 'name',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2017066632836796418',
style: { width: '100%' },
},
},
{
key: '67cfb0e1a71d44bca85f3bd9346ff680',
field: 'clys',
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: 'dc201b28b3cb46d0bc482359c77dd324',
field: 'clzl',
label: '车辆重量',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
min: 0,
max: 100,
step: 1,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
placeholder: '请输入车辆重量',
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: 'e2e2bbb4c6af4ce8a1f131acc969d2e2',
field: 'createDate',
label: '创建日期',
type: 'date',
component: 'DatePicker',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
span: 7,
defaultValue: '',
width: '100%',
placeholder: '请选择创建日期',
format: 'YYYY-MM-DD HH:mm:ss',
showLabel: true,
allowClear: true,
disabled: false,
required: false,
isShow: true,
rules: [],
events: {},
isGetCurrent: false,
tooltipConfig: { visible: false, title: '提示文本' },
searchType: 'time',
style: { width: '100%' },
},
},
],
},
],
componentProps: {
gutter: 16,
justify: 'start',
align: 'top',
isShow: true,
showBorder: false,
bordercolor: '#d9d9d9',
bordershowtype: [true, true, true, true],
borderwidth: 1,
padding: '10px',
margin: '10px',
},
},
],
showActionButtonGroup: false,
buttonLocation: 'center',
actionColOptions: { span: 24 },
showResetButton: false,
showSubmitButton: false,
hiddenComponent: [],
};
export const permissionList = [
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '车牌号码',
fieldId: 'cphm',
isSubTable: false,
showChildren: true,
type: 'associate-popup',
key: 'b6f573efd5c140bea1dd7208aa30b96d',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '品牌型号',
fieldId: 'clppxh',
isSubTable: false,
showChildren: true,
type: 'input',
key: 'b4b62820f0374a1aa8d5831a79a32597',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '车辆类型',
fieldId: 'cllx',
isSubTable: false,
showChildren: true,
type: 'select',
key: 'd4d3cc7b98d74a428b4bd12af85df446',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '车辆颜色',
fieldId: 'clys',
isSubTable: false,
showChildren: true,
type: 'input',
key: '67cfb0e1a71d44bca85f3bd9346ff680',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '车辆重量',
fieldId: 'clzl',
isSubTable: false,
showChildren: true,
type: 'number',
key: 'dc201b28b3cb46d0bc482359c77dd324',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '创建日期',
fieldId: 'createDate',
isSubTable: false,
showChildren: true,
type: 'date',
key: 'e2e2bbb4c6af4ce8a1f131acc969d2e2',
children: [],
options: {},
defaultValue: '',
},
];
<template>
<ResizePageWrapper :hasLeft="false">
<template #resizeRight>
<BasicTable @register="registerTable" isMenuTable ref="tableRef"
>
<template #toolbar>
<template v-for="button in tableButtonConfig" :key="button.code">
<a-button v-if="button.isDefault" type="primary" @click="buttonClick(button.code)">
<template #icon><Icon :icon="button.icon" /></template>
{{ button.name }}
</a-button>
<CustomButtonModal v-else-if="button.buttonType == 'modal'" :info="button" />
<a-button v-else :type="button.buttonType === 'danger' ? 'default' : button.buttonType || 'primary'" :danger="button.buttonType === 'danger'" >
<template #icon><Icon :icon="button.icon" /></template>
{{ button.name }}
</a-button>
</template>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<TableAction
:actions="getLessActions(record)"
:dropDownActions="getMoreActions(record)"
/>
</template>
<template v-else-if="column.dataIndex && column?.listStyle">
<span :style="executeListStyle(getValue(record, column, 'style'), column?.listStyle)">{{
getValue(record, column, 'value')
}}</span>
</template>
</template>
</BasicTable>
</template>
<CcckmxModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/>
</ResizePageWrapper>
</template>
<script lang="ts" setup>
import { ref, computed,provide,Ref, createVNode,
} from 'vue';
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getMesDisassembleOutboundDetailPage, deleteMesDisassembleOutboundDetail} from '/@/api/chaiche/ccckmx';
import { ResizePageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { usePermission } from '/@/hooks/web/usePermission';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { executeListStyle, getValue } from '/@/hooks/web/useListStyle';//列表样式配置
import { useRouter } from 'vue-router';
import { useModal } from '/@/components/Modal';
import CcckmxModal from './components/CcckmxModal.vue';
import { searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index';
const listSpliceNum = ref(3); //操作列最先展示几个
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
const pageParamsInfo = ref<any>({});
const { enableLockeData,handleOpenFormEnableLockeData, handleCloseFormEnableLocke, handleHasEnableLocke } =
useConcurrentLock();
const { notification } = useMessage();
const { t } = useI18n();
defineEmits(['register']);
const { filterColumnAuth, filterButtonAuth, hasPermission } = usePermission();
const filterColumns = filterColumnAuth(columns);
const tableRef = ref();
//展示在列表内的按钮
const actionButtons = ref<string[]>(["view","edit","delete"]);
const buttonConfigs = computed(()=>{
const list = [{"buttonId":"2033130191933898752","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"buttonId":"2033130191933898753","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"buttonId":"2033130191933898754","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},{"buttonId":"2033130191933898755","name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]
return filterButtonAuth(list);
})
const tableButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
});
const actionButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
const btnEvent = {view : handleView,add : handleAdd,edit : handleEdit,delete : handleDelete,}
const { currentRoute } = useRouter();
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
provide<Ref<string>>('currentFormId', formIdComputedRef);
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, }] = useTable({
title: 'Ccckmx列表',
api: getMesDisassembleOutboundDetailPage,
rowKey: 'id',
columns: filterColumns,
pagination: {
pageSize: 10,
},
formConfig: {
labelWidth: 100,
schemas: searchFormSchema,
fieldMapToTime: [['createDate', ['createDateStart', 'createDateEnd'], 'YYYY-MM-DD HH:mm:ss ', true],],
showResetButton: false,
},
bordered:false,
beforeFetch: (params) => {
pageParamsInfo.value = {...params, FormId: formIdComputedRef.value,PK: 'id' }
return pageParamsInfo.value;
},
afterFetch: (res) => {
},
useSearchForm: true,
showTableSetting: true,
striped: false,
actionColumn: {
width: 195,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
},
tableSetting: {
size: false,
},
customRow,
isAdvancedQuery: false,
querySelectOption: JSON.stringify(searchFormSchema),
objectId: formIdComputedRef.value, ////系统表单formId,自定义表单releaseId的id值
});
function buttonClick(code) {
btnEvent[code]();
}
function handleAdd() {
openModal(true, { isUpdate: false, });
}
async function handleEdit(record: Recordable) {
let field = 'id';
try {
let hasIn = handleHasEnableLocke(buttonConfigs.value, 'edit');
if (hasIn) {
let res = await handleOpenFormEnableLockeData(
record[field],
formIdComputedRef.value,
);
if (res !== null) {
return;
}
}
let info = {
id: record[field],
isUpdate: true,
};
openModal(true, info);
} catch (error) {}
}
function handleDelete(record: Recordable) {
deleteList([record.id]);
}
function deleteList(ids) {
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
content: '是否确认删除?',
okText: '确认',
cancelText: '取消',
onOk() {
deleteMesDisassembleOutboundDetail(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('删除成功!'),
});
});
},
onCancel() {},
});
}
function customRow(record: Recordable) {
return {
ondblclick: () => {
if (record.isCanEdit && hasPermission("ccckmx:edit")) {
handleEdit(record);
}
},
};
}
function handleSuccess() {
reload();
}
function handleFormSuccess() {
handleSuccess();
handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
}
function handleFormCancel() {
handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
}
function handleView(record: Recordable) {
let info={
isView: true,
id: record.id,
}
openModal(true, info);
}
function getLessActions(record: Recordable) {
let list = getActions(record);
return list.slice(0, listSpliceNum.value);
}
function getMoreActions(record: Recordable) {
let list = getActions(record);
return list.slice(listSpliceNum.value);
}
function getActions(record: Recordable):ActionItem[] {
record.isCanEdit = false;
let actionsList: ActionItem[] = [];
actionButtonConfig.value?.map((button) => {
if (!record?.workflowData?.processId) {
record.isCanEdit = true;
actionsList.push({
...button,
auth: `ccckmx:${button.code}`,
label: button?.name,
color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code]?.bind(null, record),
});
} else {
if (!['edit', 'delete'].includes(button.code)) {
actionsList.push({
auth: `ccckmx:${button.code}`,
label: button?.name,
onClick: btnEvent[button.code]?.bind(null, record),
});
}
}
});
return actionsList;
}
</script>
<style lang="less" scoped>
:deep(.ant-table-selection-col) {
width: 50px;
}
.show{
display: flex;
}
.hide{
display: none !important;
}
</style>
\ No newline at end of file
...@@ -936,7 +936,7 @@ export const formProps: FormProps = { ...@@ -936,7 +936,7 @@ export const formProps: FormProps = {
labelField: 'label', labelField: 'label',
valueField: 'value', valueField: 'value',
pageSize: 10, pageSize: 10,
assoTitle: '联想弹层-联想数据配置', assoTitle: '物料编码',
apiConfig: { apiConfig: {
path: '/jcxx/wlInfoList', path: '/jcxx/wlInfoList',
method: 'GET', method: 'GET',
...@@ -1169,74 +1169,110 @@ export const formProps: FormProps = { ...@@ -1169,74 +1169,110 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: 'ac4098a101a84c40b7ef51f714b136d9', key: '36635cbf40d14baf96358f8fa129ce0f',
title: '实收数量', title: '实收数量',
dataIndex: 'sssl', dataIndex: 'sssl',
componentType: 'InputNumber', componentType: 'Computation',
defaultValue: 0,
componentProps: { componentProps: {
width: '100%',
span: '', span: '',
min: 0, width: '100%',
step: 1, defaultValue: 0,
disabled: false, placeholder: '请输入实收数量',
addonBefore: '',
addonAfter: '',
prefix: '',
maxlength: null,
showLabel: true, showLabel: true,
controls: true, disabled: false,
required: false,
subTotal: false, subTotal: false,
computationalConfig: [],
computationalConfigValue: '== 请填写计算式配置 ==',
beAdoptedComponent: ['4be31cc0258a426bb3ed21612076b687'],
decimals: 0,
required: false,
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'sssl',
listStyle: "return 'width:100%'",
}, },
}, },
{ {
key: '9cd15589c75f476ebe5605b3352e8ffc', key: '5e4377f941cd450ba40bbc1f9d26ff27',
title: '应收数量', title: '应收数量',
dataIndex: 'yssl', dataIndex: 'yssl',
componentType: 'InputNumber', componentType: 'Computation',
defaultValue: 0,
componentProps: { componentProps: {
width: '100%',
span: '', span: '',
min: 0, width: '100%',
step: 1, defaultValue: 0,
disabled: false, placeholder: '请输入应收数量',
addonBefore: '',
addonAfter: '',
prefix: '',
maxlength: null,
showLabel: true, showLabel: true,
controls: true, disabled: false,
required: false,
subTotal: false, subTotal: false,
computationalConfig: [],
computationalConfigValue: '== 请填写计算式配置 ==',
beAdoptedComponent: ['4be31cc0258a426bb3ed21612076b687'],
decimals: 0,
required: false,
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: 'yssl',
listStyle: "return 'width:100%'",
}, },
}, },
{ {
key: '3b7ca3cc16344d6787f1676dcd3a77b7', key: '4be31cc0258a426bb3ed21612076b687',
title: '剩余数量', title: '剩余数量',
dataIndex: 'sysl', dataIndex: 'sysl',
componentType: 'InputNumber', componentType: 'Computation',
defaultValue: '', defaultValue: 0,
componentProps: { componentProps: {
width: '100%',
span: '', span: '',
defaultValue: '', width: '100%',
min: 0, defaultValue: 0,
step: 1, placeholder: '请输入剩余数量',
disabled: false, addonBefore: '',
addonAfter: '',
prefix: '',
maxlength: null,
showLabel: true, showLabel: true,
controls: true, disabled: false,
required: false,
subTotal: false, subTotal: false,
computationalConfig: [
{
$index: 145,
label: '应收数量',
type: 'computational',
key: '5e4377f941cd450ba40bbc1f9d26ff27',
bindTable: 'mesWarehouseArrivedInfo',
bindField: 'yssl',
isMainForm: false,
},
{ $index: 841, label: '-', type: 'operation', key: 2 },
{
$index: 830,
label: '实收数量',
type: 'computational',
key: '36635cbf40d14baf96358f8fa129ce0f',
bindTable: 'mesWarehouseArrivedInfo',
bindField: 'sssl',
isMainForm: false,
},
],
computationalConfigValue: '应收数量-实收数量',
beAdoptedComponent: [],
decimals: 0,
required: false,
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
placeholder: '请输入剩余数量',
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
listStyle: "return 'width:100%'",
}, },
}, },
{ {
...@@ -1320,7 +1356,10 @@ export const formProps: FormProps = { ...@@ -1320,7 +1356,10 @@ export const formProps: FormProps = {
showLabel: true, showLabel: true,
required: false, required: false,
rules: [], rules: [],
events: {}, events: {
click:
"const pch = formModel['pch'];\nconst length =formModel['mesWarehouseArrivedInfoList'].length;\nformModel.mesWarehouseArrivedInfoList[length-1].pch=pch; ",
},
listStyle: '', listStyle: '',
isSave: false, isSave: false,
isShow: true, isShow: true,
......
...@@ -359,8 +359,8 @@ export const permissionList = [ ...@@ -359,8 +359,8 @@ export const permissionList = [
tableName: 'mesWarehouseArrivedInfoList', tableName: 'mesWarehouseArrivedInfoList',
fieldName: '实收数量', fieldName: '实收数量',
fieldId: 'sssl', fieldId: 'sssl',
type: 'InputNumber', type: 'Computation',
key: 'ac4098a101a84c40b7ef51f714b136d9', key: '36635cbf40d14baf96358f8fa129ce0f',
children: [], children: [],
}, },
{ {
...@@ -374,8 +374,8 @@ export const permissionList = [ ...@@ -374,8 +374,8 @@ export const permissionList = [
tableName: 'mesWarehouseArrivedInfoList', tableName: 'mesWarehouseArrivedInfoList',
fieldName: '应收数量', fieldName: '应收数量',
fieldId: 'yssl', fieldId: 'yssl',
type: 'InputNumber', type: 'Computation',
key: '9cd15589c75f476ebe5605b3352e8ffc', key: '5e4377f941cd450ba40bbc1f9d26ff27',
children: [], children: [],
}, },
{ {
...@@ -389,8 +389,8 @@ export const permissionList = [ ...@@ -389,8 +389,8 @@ export const permissionList = [
tableName: 'mesWarehouseArrivedInfoList', tableName: 'mesWarehouseArrivedInfoList',
fieldName: '剩余数量', fieldName: '剩余数量',
fieldId: 'sysl', fieldId: 'sysl',
type: 'InputNumber', type: 'Computation',
key: '3b7ca3cc16344d6787f1676dcd3a77b7', key: '4be31cc0258a426bb3ed21612076b687',
children: [], children: [],
}, },
{ {
......
...@@ -292,34 +292,87 @@ export const formProps: FormProps = { ...@@ -292,34 +292,87 @@ export const formProps: FormProps = {
span: 8, span: 8,
list: [ list: [
{ {
key: '5a82773c288f4bb49914109c9f112f9e', key: '1339633e12984e499ca9ceb44a89b739',
field: 'cpbh', field: 'cpbh',
label: '产品编号', label: '产品编号',
type: 'input', type: 'associate-popup',
component: 'Input', component: 'MultiplePopup',
colProps: { span: 24 }, colProps: { span: 24 },
defaultValue: '',
componentProps: { componentProps: {
popupType: 'associate',
width: '100%', width: '100%',
span: 7, span: 7,
defaultValue: '', placeholder: '请选择产品编号',
placeholder: '请输入产品编号',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true, showLabel: true,
disabled: false,
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
pageSize: 10,
assoTitle: '产品信息',
apiConfig: {
path: '/jcxx/wlbhList',
method: 'GET',
apiId: '588543bf8c6045fd89f63b8337f5aec6',
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 *,cpbh 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: '产品编码', show: true, width: 150 },
{
name: 'cpmc',
tableTitle: '产品名称',
bindField: 'cpmc',
show: true,
width: 150,
component: '464846c54eb54238b89b5b87fca84e3b',
},
{
name: 'gg',
tableTitle: '规格',
bindField: 'gg',
show: true,
width: 150,
component: '55216a96a79245c2894a1e7ed60537aa',
},
{
name: 'xh',
tableTitle: '型号',
bindField: 'xh',
show: true,
width: 150,
component: 'afdf24cf5fe14e898257fe820d398723',
},
],
},
dicOptions: [],
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '',
isSave: false,
isShow: true, isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' }, style: { width: '100%' },
}, },
......
...@@ -10,11 +10,10 @@ export const permissionList = [ ...@@ -10,11 +10,10 @@ export const permissionList = [
fieldId: 'cpbh', fieldId: 'cpbh',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'input', type: 'associate-popup',
key: '5a82773c288f4bb49914109c9f112f9e', key: '1339633e12984e499ca9ceb44a89b739',
children: [], children: [],
options: {}, options: {},
defaultValue: '',
}, },
{ {
required: false, required: false,
......
...@@ -25,12 +25,6 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -25,12 +25,6 @@ export const searchFormSchema: FormSchema[] = [
}, },
}, },
{ {
field: 'scbm',
label: '生产部门',
defaultValue: undefined,
component: 'Input',
},
{
field: 'ywzz', field: 'ywzz',
label: '业务组织', label: '业务组织',
defaultValue: undefined, defaultValue: undefined,
...@@ -433,47 +427,75 @@ export const formProps: FormProps = { ...@@ -433,47 +427,75 @@ export const formProps: FormProps = {
span: 8, span: 8,
list: [ list: [
{ {
key: '6948582a4bcc4ed59c2a9e20b0eb0a40', key: '5138ee5cb107492e994b7e0b9e69be26',
field: 'kgy', field: 'kgy',
label: '库管员', label: '库管员',
type: 'input', type: 'associate-popup',
component: 'Input', component: 'MultiplePopup',
colProps: { span: 24 }, colProps: { span: 24 },
defaultValue: '',
componentProps: { componentProps: {
popupType: 'associate',
width: '100%', width: '100%',
span: 7, span: 7,
defaultValue: '', placeholder: '请选择库管员',
placeholder: '请输入库管员',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true, showLabel: true,
disabled: false,
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
pageSize: 10,
assoTitle: '库管员',
apiConfig: {
path: '/test3/getUserByName',
method: 'GET',
apiId: 'b0e85dd1dd054888a1452a3261938b28',
apiParams: [
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'name',
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 xjr_user WHERE delete_mark = 0 ?{name, and name like concat("%",#{name},"%")}\'\r\nreturn db.select(sql);\r\n',
outputParams: [{ name: 'label', tableTitle: '用户名', show: true, width: 150 }],
},
dicOptions: [],
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '',
isSave: false,
isShow: true, isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' }, style: { width: '100%' },
}, },
}, },
], ],
}, },
{ {
span: 8, span: 8,
list: [ list: [
{ {
key: '4974e34247094ea5bce99f66f4169b27', key: 'ec89abed664a4341acd26ac8509d311a',
field: 'scbm', field: 'pch',
label: '生产部门', label: '批次号',
type: 'input', type: 'input',
component: 'Input', component: 'Input',
colProps: { span: 24 }, colProps: { span: 24 },
...@@ -482,7 +504,7 @@ export const formProps: FormProps = { ...@@ -482,7 +504,7 @@ export const formProps: FormProps = {
width: '100%', width: '100%',
span: 7, span: 7,
defaultValue: '', defaultValue: '',
placeholder: '请输入生产部门', placeholder: '请输入批次号',
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
...@@ -505,6 +527,8 @@ export const formProps: FormProps = { ...@@ -505,6 +527,8 @@ export const formProps: FormProps = {
}, },
], ],
}, },
{ {
span: 8, span: 8,
list: [ list: [
...@@ -596,13 +620,14 @@ export const formProps: FormProps = { ...@@ -596,13 +620,14 @@ export const formProps: FormProps = {
}, },
], ],
}, },
{ {
span: 8, span: 8,
list: [ list: [
{ {
key: 'ec89abed664a4341acd26ac8509d311a', key: '4974e34247094ea5bce99f66f4169b27',
field: 'pch', field: 'scbm',
label: '批次号', label: '生产部门',
type: 'input', type: 'input',
component: 'Input', component: 'Input',
colProps: { span: 24 }, colProps: { span: 24 },
...@@ -611,7 +636,7 @@ export const formProps: FormProps = { ...@@ -611,7 +636,7 @@ export const formProps: FormProps = {
width: '100%', width: '100%',
span: 7, span: 7,
defaultValue: '', defaultValue: '',
placeholder: '请输入批次号', placeholder: '请输入生产部门',
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
...@@ -624,7 +649,7 @@ export const formProps: FormProps = { ...@@ -624,7 +649,7 @@ export const formProps: FormProps = {
events: {}, events: {},
listStyle: '', listStyle: '',
isSave: false, isSave: false,
isShow: true, isShow: false,
scan: false, scan: false,
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
...@@ -634,6 +659,7 @@ export const formProps: FormProps = { ...@@ -634,6 +659,7 @@ export const formProps: FormProps = {
}, },
], ],
}, },
{ {
span: 24, span: 24,
list: [ list: [
...@@ -785,6 +811,100 @@ export const formProps: FormProps = { ...@@ -785,6 +811,100 @@ export const formProps: FormProps = {
mainKey: 'mesWarehouseProductInfoList', mainKey: 'mesWarehouseProductInfoList',
columns: [ columns: [
{ {
key: '9f9255da541c4ab6987fb95a9cd10fe0',
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: '67758677bce44720b4af09091d5590f3',
bindTable: 'mes_warehouse_product_info',
},
{
name: 'cpmc',
tableTitle: '物料名称',
bindField: 'wlmc',
show: true,
width: 150,
component: '90eb56185b5c419b9f0d7d6179beed9b',
bindTable: 'mes_warehouse_product_info',
},
{
name: 'gg',
tableTitle: '规格',
bindField: 'gg',
show: true,
width: 150,
component: 'e5b7433c899c4af095639be8726ede96',
bindTable: 'mes_warehouse_product_info',
},
{
name: 'xh',
tableTitle: '型号',
bindField: 'xh',
show: true,
width: 150,
component: '3d33a3a9e46545c5ba831660038ebc88',
bindTable: 'mes_warehouse_product_info',
},
],
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '67758677bce44720b4af09091d5590f3', key: '67758677bce44720b4af09091d5590f3',
title: '物料编码', title: '物料编码',
dataIndex: 'wlbm', dataIndex: 'wlbm',
...@@ -802,12 +922,12 @@ export const formProps: FormProps = { ...@@ -802,12 +922,12 @@ export const formProps: FormProps = {
disabled: false, disabled: false,
allowClear: false, allowClear: false,
showLabel: true, showLabel: true,
required: true, required: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '', listStyle: '',
isSave: false, isSave: false,
isShow: true, isShow: false,
scan: false, scan: false,
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
...@@ -915,9 +1035,7 @@ export const formProps: FormProps = { ...@@ -915,9 +1035,7 @@ export const formProps: FormProps = {
span: '', span: '',
defaultValue: '', defaultValue: '',
min: 0, min: 0,
max: null,
step: 1, step: 1,
maxlength: null,
disabled: false, disabled: false,
showLabel: true, showLabel: true,
controls: true, controls: true,
...@@ -967,9 +1085,7 @@ export const formProps: FormProps = { ...@@ -967,9 +1085,7 @@ export const formProps: FormProps = {
span: '', span: '',
defaultValue: '', defaultValue: '',
min: 0, min: 0,
max: null,
step: 1, step: 1,
maxlength: null,
disabled: false, disabled: false,
showLabel: true, showLabel: true,
controls: true, controls: true,
...@@ -1014,32 +1130,42 @@ export const formProps: FormProps = { ...@@ -1014,32 +1130,42 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: '5d9a11c345e24ff59f416012ae5fb4c1', key: 'f48fe405a2dc46799eb0c943254d6c88',
title: '货位', title: '货位',
dataIndex: 'hw', dataIndex: 'hw',
componentType: 'Input', componentType: 'MultiplePopup',
defaultValue: '',
componentProps: { componentProps: {
popupType: 'associate',
width: '100%', width: '100%',
span: '', span: '',
defaultValue: '', placeholder: '请选择货位',
placeholder: '请输入货位',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true, showLabel: true,
disabled: false,
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
pageSize: 10,
assoTitle: '货位信息',
apiConfig: {
path: '/getStoreLocation',
method: 'GET',
apiId: 'd55f1866db284ecd8b038a3956b9c5b7',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
"var sql=\"select name as value,name as label from mes_storage_location where delete_mark = 0 ?{keyword, and code like concat('%',#{keyword},'%')}\";\r\nreturn db.select(sql);",
outputParams: [
{ name: 'label', tableTitle: '货位名称', show: true, width: 150 },
],
},
dicOptions: [],
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '',
isSave: false,
isShow: true, isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
}, },
}, },
...@@ -1160,6 +1286,100 @@ export const formProps: FormProps = { ...@@ -1160,6 +1286,100 @@ export const formProps: FormProps = {
mainKey: 'mesWarehouseProductChangeList', mainKey: 'mesWarehouseProductChangeList',
columns: [ columns: [
{ {
key: 'c2c87879074c465cbf872c30f274f080',
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: 'd1de0271a0aa489e8fbed33e705c4f5a',
bindTable: 'mes_warehouse_product_change',
},
{
name: 'cpmc',
tableTitle: '物料名称',
bindField: 'wlmc',
show: true,
width: 150,
component: '0f703bdd6bbe49f1ac1bac1b332090f2',
bindTable: 'mes_warehouse_product_change',
},
{
name: 'gg',
tableTitle: '规格',
bindField: 'gg',
show: true,
width: 150,
component: 'c35ad73504024d5ba769b876b00733d2',
bindTable: 'mes_warehouse_product_change',
},
{
name: 'xh',
tableTitle: '型号',
bindField: 'xh',
show: true,
width: 150,
component: '431253da65194e0290f806281603a46f',
bindTable: 'mes_warehouse_product_change',
},
],
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: 'd1de0271a0aa489e8fbed33e705c4f5a', key: 'd1de0271a0aa489e8fbed33e705c4f5a',
title: '物料编码', title: '物料编码',
dataIndex: 'wlbm', dataIndex: 'wlbm',
...@@ -1170,7 +1390,6 @@ export const formProps: FormProps = { ...@@ -1170,7 +1390,6 @@ export const formProps: FormProps = {
span: '', span: '',
defaultValue: '', defaultValue: '',
placeholder: '请输入物料编码', placeholder: '请输入物料编码',
maxlength: null,
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
...@@ -1183,7 +1402,7 @@ export const formProps: FormProps = { ...@@ -1183,7 +1402,7 @@ export const formProps: FormProps = {
events: {}, events: {},
listStyle: '', listStyle: '',
isSave: false, isSave: false,
isShow: true, isShow: false,
scan: false, scan: false,
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
...@@ -1201,7 +1420,6 @@ export const formProps: FormProps = { ...@@ -1201,7 +1420,6 @@ export const formProps: FormProps = {
span: '', span: '',
defaultValue: '', defaultValue: '',
placeholder: '请输入物料名称', placeholder: '请输入物料名称',
maxlength: null,
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
...@@ -1232,7 +1450,6 @@ export const formProps: FormProps = { ...@@ -1232,7 +1450,6 @@ export const formProps: FormProps = {
span: '', span: '',
defaultValue: '', defaultValue: '',
placeholder: '请输入规格', placeholder: '请输入规格',
maxlength: null,
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
...@@ -1263,7 +1480,6 @@ export const formProps: FormProps = { ...@@ -1263,7 +1480,6 @@ export const formProps: FormProps = {
span: '', span: '',
defaultValue: '', defaultValue: '',
placeholder: '请输入型号', placeholder: '请输入型号',
maxlength: null,
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
...@@ -1294,7 +1510,6 @@ export const formProps: FormProps = { ...@@ -1294,7 +1510,6 @@ export const formProps: FormProps = {
span: '', span: '',
defaultValue: '', defaultValue: '',
placeholder: '请输入批次号', placeholder: '请输入批次号',
maxlength: null,
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
...@@ -1315,33 +1530,61 @@ export const formProps: FormProps = { ...@@ -1315,33 +1530,61 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: '4ff849ba704342fa901be52adeab6bb8', key: 'fe0be7ab60d8433d8c4b5832b15acd60',
title: '货位', title: '货位',
dataIndex: 'hw', dataIndex: 'hw',
componentType: 'Input', componentType: 'MultiplePopup',
defaultValue: '',
componentProps: { componentProps: {
popupType: 'associate',
width: '100%', width: '100%',
span: '', span: '',
defaultValue: '', placeholder: '请选择货位',
placeholder: '请输入货位',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
allowClear: false,
showLabel: true, showLabel: true,
disabled: false,
datasourceType: 'api',
labelField: 'label',
valueField: 'value',
pageSize: 10,
assoTitle: '货位信息',
apiConfig: {
path: '/getStoreLocation',
method: 'GET',
apiId: 'd55f1866db284ecd8b038a3956b9c5b7',
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 name as value,name as label from mes_storage_location where delete_mark = 0 ?{keyword, and name like concat('%',#{keyword},'%')}\";\r\nreturn db.select(sql);",
outputParams: [
{ name: 'label', tableTitle: '名称', show: true, width: 150 },
],
},
dicOptions: [],
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
listStyle: '',
isSave: false,
isShow: true, isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
}, },
}, },
...@@ -1356,9 +1599,7 @@ export const formProps: FormProps = { ...@@ -1356,9 +1599,7 @@ export const formProps: FormProps = {
span: '', span: '',
defaultValue: '', defaultValue: '',
min: 0, min: 0,
max: null,
step: 1, step: 1,
maxlength: null,
disabled: false, disabled: false,
showLabel: true, showLabel: true,
controls: true, controls: true,
...@@ -1383,7 +1624,6 @@ export const formProps: FormProps = { ...@@ -1383,7 +1624,6 @@ export const formProps: FormProps = {
span: '', span: '',
defaultValue: '', defaultValue: '',
placeholder: '请输入备注', placeholder: '请输入备注',
maxlength: null,
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
......
...@@ -76,11 +76,10 @@ export const permissionList = [ ...@@ -76,11 +76,10 @@ export const permissionList = [
fieldId: 'kgy', fieldId: 'kgy',
isSubTable: false, isSubTable: false,
showChildren: true, showChildren: true,
type: 'input', type: 'associate-popup',
key: '6948582a4bcc4ed59c2a9e20b0eb0a40', key: '5138ee5cb107492e994b7e0b9e69be26',
children: [], children: [],
options: {}, options: {},
defaultValue: '',
}, },
{ {
required: false, required: false,
...@@ -223,6 +222,21 @@ export const permissionList = [ ...@@ -223,6 +222,21 @@ export const permissionList = [
showChildren: false, showChildren: false,
tableName: 'mesWarehouseProductInfoList', tableName: 'mesWarehouseProductInfoList',
fieldName: '物料编码', fieldName: '物料编码',
fieldId: 'wlid',
type: 'MultiplePopup',
key: '9f9255da541c4ab6987fb95a9cd10fe0',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseProductInfoList',
fieldName: '物料编码',
fieldId: 'wlbm', fieldId: 'wlbm',
type: 'Input', type: 'Input',
key: '67758677bce44720b4af09091d5590f3', key: '67758677bce44720b4af09091d5590f3',
...@@ -344,8 +358,8 @@ export const permissionList = [ ...@@ -344,8 +358,8 @@ export const permissionList = [
tableName: 'mesWarehouseProductInfoList', tableName: 'mesWarehouseProductInfoList',
fieldName: '货位', fieldName: '货位',
fieldId: 'hw', fieldId: 'hw',
type: 'Input', type: 'MultiplePopup',
key: '5d9a11c345e24ff59f416012ae5fb4c1', key: 'f48fe405a2dc46799eb0c943254d6c88',
children: [], children: [],
}, },
{ {
...@@ -403,6 +417,21 @@ export const permissionList = [ ...@@ -403,6 +417,21 @@ export const permissionList = [
showChildren: false, showChildren: false,
tableName: 'mesWarehouseProductChangeList', tableName: 'mesWarehouseProductChangeList',
fieldName: '物料编码', fieldName: '物料编码',
fieldId: 'wlid',
type: 'MultiplePopup',
key: 'c2c87879074c465cbf872c30f274f080',
children: [],
},
{
required: true,
view: true,
edit: true,
disabled: false,
isSubTable: false,
isSaveTable: false,
showChildren: false,
tableName: 'mesWarehouseProductChangeList',
fieldName: '物料编码',
fieldId: 'wlbm', fieldId: 'wlbm',
type: 'Input', type: 'Input',
key: 'd1de0271a0aa489e8fbed33e705c4f5a', key: 'd1de0271a0aa489e8fbed33e705c4f5a',
...@@ -479,8 +508,8 @@ export const permissionList = [ ...@@ -479,8 +508,8 @@ export const permissionList = [
tableName: 'mesWarehouseProductChangeList', tableName: 'mesWarehouseProductChangeList',
fieldName: '货位', fieldName: '货位',
fieldId: 'hw', fieldId: 'hw',
type: 'Input', type: 'MultiplePopup',
key: '4ff849ba704342fa901be52adeab6bb8', key: 'fe0be7ab60d8433d8c4b5832b15acd60',
children: [], children: [],
}, },
{ {
......
<template> <template>
<BasicModal <BasicModal
:height="500" :height="500"
v-bind="$attrs" @register="registerModal" :title="getTitle" v-bind="$attrs"
@ok="handleSubmit" @cancel="handleClose" > @register="registerModal"
:title="getTitle"
@ok="handleSubmit"
@cancel="handleClose"
>
<ModalForm ref="formRef" v-model:value="state.formModel" :fromPage="FromPageType.MENU" /> <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-for="(item, index) in sortBy(formButtons, 'index')" :key="item.key">
<template v-if="item.isShow"> <template v-if="item.isShow">
<CustomButtonModal v-if="item.type == CustomButtonModalType.Modal" :info="item" /> <CustomButtonModal v-if="item.type == CustomButtonModalType.Modal" :info="item" />
...@@ -23,7 +24,6 @@ ...@@ -23,7 +24,6 @@
</template> </template>
</template> </template>
</BasicModal> </BasicModal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, reactive, provide, Ref } from 'vue'; import { ref, computed, reactive, provide, Ref } from 'vue';
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue'; import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
import { formProps ,formButtons } from './config'; import { formProps, formButtons } from './config';
import ModalForm from './Form.vue'; import ModalForm from './Form.vue';
import { FromPageType } from '/@/enums/workflowEnum'; import { FromPageType } from '/@/enums/workflowEnum';
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
const { notification } = useMessage(); const { notification } = useMessage();
const formRef = ref(); const formRef = ref();
const isCopy = ref<boolean>(false) const isCopy = ref<boolean>(false);
const state = reactive({ const state = reactive({
formModel: {}, formModel: {},
isUpdate: true, isUpdate: true,
...@@ -58,10 +58,11 @@ ...@@ -58,10 +58,11 @@
await handleInner(data); 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.isUpdate = !!data?.isUpdate;
state.isView = !!data?.isView; state.isView = !!data?.isView;
isCopy.value = !!data?.isCopy; isCopy.value = !!data?.isCopy;
...@@ -73,7 +74,8 @@ ...@@ -73,7 +74,8 @@
showOkBtn: false, showOkBtn: false,
canFullscreen: true, canFullscreen: true,
width: 900, width: 900,
footer: state.isView ? null : undefined,defaultFullscreen:true, footer: state.isView ? null : undefined,
defaultFullscreen: true,
}); });
if (state.isUpdate || state.isView || isCopy.value) { if (state.isUpdate || state.isView || isCopy.value) {
...@@ -85,10 +87,9 @@ ...@@ -85,10 +87,9 @@
await formRef.value.setFormDataFromId(state.rowId); await formRef.value.setFormDataFromId(state.rowId);
} else { } else {
formRef.value.resetFields(); formRef.value.resetFields();
} }
} }
async function saveModal() { async function saveModal() {
let saveSuccess = false; let saveSuccess = false;
try { try {
...@@ -140,15 +141,14 @@ ...@@ -140,15 +141,14 @@
emit('success'); emit('success');
} }
} finally { } finally {
setModalProps({ confirmLoading: false }); setModalProps({ confirmLoading: false });
} }
} }
function customClick(item) { function customClick(item) {
if (item.key == 'confirm') { if (item.key == 'confirm') {
handleSubmit(); handleSubmit();
} else if (item.key == 'cancel' && props.formType !== 'normal') { } else if (item.key == 'cancel') {
handleClose(); handleClose();
closeModal(); closeModal();
} else if (item.key == 'reset') { } else if (item.key == 'reset') {
...@@ -157,10 +157,8 @@ ...@@ -157,10 +157,8 @@
executeCurFormEvent(item.event, state.formModel, true); executeCurFormEvent(item.event, state.formModel, true);
} }
} }
function handleClose() { function handleClose() {
formRef.value.resetFields(); formRef.value.resetFields();
} }
</script> </script>
\ No newline at end of file
<template> <template>
<div class="pt-4"> <div class="pt-4">
<SimpleForm <SimpleForm
ref="systemFormRef" ref="systemFormRef"
:formProps="data.formDataProps" :formProps="data.formDataProps"
:formModel="state.formModel" :formModel="state.formModel"
:isWorkFlow="props.fromPage!=FromPageType.MENU" :isWorkFlow="props.fromPage != FromPageType.MENU"
:isCamelCase="true" :isCamelCase="true"
@model-change="handleChange" @model-change="handleChange"
/> />
...@@ -15,13 +14,22 @@ ...@@ -15,13 +14,22 @@
import { reactive, ref, onMounted, nextTick, watch } from 'vue'; import { reactive, ref, onMounted, nextTick, watch } from 'vue';
import { formProps, formEventConfigs } from './config'; import { formProps, formEventConfigs } from './config';
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue'; import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
import { addMesCollectionScheme, getMesCollectionScheme, updateMesCollectionScheme } from '/@/api/jcsj/cjfa'; import {
addMesCollectionScheme,
getMesCollectionScheme,
updateMesCollectionScheme,
} from '/@/api/jcsj/cjfa';
import { cloneDeep, isString } from 'lodash-es'; import { cloneDeep, isString } from 'lodash-es';
import { FormDataProps } from '/@/components/Designer/src/types'; import { FormDataProps } from '/@/components/Designer/src/types';
import { usePermission } from '/@/hooks/web/usePermission'; import { usePermission } from '/@/hooks/web/usePermission';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue'; import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { FromPageType } from '/@/enums/workflowEnum'; 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 { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig'; import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
...@@ -29,7 +37,7 @@ ...@@ -29,7 +37,7 @@
const { filterFormSchemaAuth } = usePermission(); const { filterFormSchemaAuth } = usePermission();
const RowKey = 'id'; const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'update:value']); const emits = defineEmits(['changeUploadComponentIds', 'loadingCompleted', 'update:value']);
const props = defineProps({ const props = defineProps({
fromPage: { fromPage: {
type: Number, type: Number,
...@@ -42,7 +50,7 @@ ...@@ -42,7 +50,7 @@
}); });
const state = reactive({ const state = reactive({
formModel: {}, formModel: {},
formInfo:{formId:'',formName:''} formInfo: { formId: '', formName: '' },
}); });
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
watch( watch(
...@@ -59,17 +67,35 @@ ...@@ -59,17 +67,35 @@
try { try {
if (props.fromPage == FromPageType.MENU) { if (props.fromPage == FromPageType.MENU) {
setMenuPermission(); setMenuPermission();
if(currentRoute.value.meta){ if (currentRoute.value.meta) {
state.formInfo.formName = currentRoute.value.meta.title&&isString(currentRoute.value.meta.title)?currentRoute.value.meta.title:''; state.formInfo.formName =
state.formInfo.formId = currentRoute.value.meta.formId&&isString(currentRoute.value.meta.formId)?currentRoute.value.meta.formId:''; 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, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:初始化表单
await nextTick(); await nextTick();
await loadFormEvent(formEventConfigs, state.formModel, await loadFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, 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) { } else if (props.fromPage == FromPageType.FLOW) {
emits('loadingCompleted'); //告诉系统表单已经加载完毕 emits('loadingCompleted'); //告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法 // loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
...@@ -78,15 +104,28 @@ ...@@ -78,15 +104,28 @@
} else if (props.fromPage == FromPageType.DESKTOP) { } else if (props.fromPage == FromPageType.DESKTOP) {
// 桌面设计 表单事件需要执行 // 桌面设计 表单事件需要执行
emits('loadingCompleted'); //告诉系统表单已经加载完毕 emits('loadingCompleted'); //告诉系统表单已经加载完毕
await createFormEvent(formEventConfigs, state.formModel, await createFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单 formProps.schemas,
await loadFormEvent(formEventConfigs, state.formModel, true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:初始化表单
await loadFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:加载表单
} }
} catch (error) {} } catch (error) {}
}); });
// 根据菜单页面权限,设置表单属性(必填,禁用,显示) // 根据菜单页面权限,设置表单属性(必填,禁用,显示)
function setMenuPermission() { function setMenuPermission() {
data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!); data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!);
...@@ -107,19 +146,25 @@ ...@@ -107,19 +146,25 @@
} }
return values; return values;
} }
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】 // 根据行唯一ID查询行数据,并设置表单数据 【编辑】
async function setFormDataFromId(rowId) { async function setFormDataFromId(rowId) {
try { try {
const record = await getMesCollectionScheme(rowId); const record = await getMesCollectionScheme(rowId);
setFieldsValue(record); setFieldsValue(record);
state.formModel = record; state.formModel = record;
await getFormDataEvent(formEventConfigs, state.formModel, await getFormDataEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:获取表单数据 formProps.schemas,
} catch (error) { true,
state.formInfo.formName,
} state.formInfo.formId,
); //表单事件:获取表单数据
} catch (error) {}
} }
// 辅助返回表单数据 // 辅助返回表单数据
async function getFieldsValue() { async function getFieldsValue() {
let values = []; let values = [];
...@@ -135,45 +180,64 @@ ...@@ -135,45 +180,64 @@
} }
return values; return values;
} }
// 辅助设置表单数据 // 辅助设置表单数据
function setFieldsValue(record) { function setFieldsValue(record) {
systemFormRef.value.setFieldsValue(record); systemFormRef.value.setFieldsValue(record);
} }
// 重置表单数据 // 重置表单数据
async function resetFields() { async function resetFields() {
await systemFormRef.value.resetFields(); await systemFormRef.value.resetFields();
} }
// 设置表单数据全部为Disabled 【查看】 // 设置表单数据全部为Disabled 【查看】
async function setDisabledForm( ) { async function setDisabledForm() {
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas)); data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas));
} }
// 获取行键值 // 获取行键值
function getRowKey() { function getRowKey() {
return RowKey; return RowKey;
} }
// 更新api表单数据 // 更新api表单数据
async function update({ values, rowId }) { async function update({ values, rowId }) {
try { try {
values[RowKey] = rowId; values[RowKey] = rowId;
state.formModel = values; state.formModel = values;
let saveVal = await updateMesCollectionScheme(values); let saveVal = await updateMesCollectionScheme(values);
await submitFormEvent(formEventConfigs, state.formModel, await submitFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
// 新增api表单数据 // 新增api表单数据
async function add(values) { async function add(values) {
try { try {
state.formModel = values; state.formModel = values;
let saveVal = await addMesCollectionScheme(values); let saveVal = await addMesCollectionScheme(values);
await submitFormEvent(formEventConfigs, state.formModel, await submitFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
// 根据工作流页面权限,设置表单属性(必填,禁用,显示) // 根据工作流页面权限,设置表单属性(必填,禁用,显示)
async function setWorkFlowForm(obj: WorkFlowFormParams) { async function setWorkFlowForm(obj: WorkFlowFormParams) {
try { try {
...@@ -189,16 +253,30 @@ ...@@ -189,16 +253,30 @@
state.formModel = formModels; state.formModel = formModels;
setFieldsValue(formModels); setFieldsValue(formModels);
} catch (error) {} } catch (error) {}
await createFormEvent(formEventConfigs, state.formModel, await createFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单 formProps.schemas,
await loadFormEvent(formEventConfigs, state.formModel, true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:初始化表单
await loadFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:加载表单
} }
function handleChange(val) { function handleChange(val) {
emits('update:value', val); emits('update:value', val);
} }
async function sendMessageForAllIframe() { async function sendMessageForAllIframe() {
try { try {
if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) { if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) {
...@@ -206,6 +284,7 @@ ...@@ -206,6 +284,7 @@
} }
} catch (error) {} } catch (error) {}
} }
defineExpose({ defineExpose({
setFieldsValue, setFieldsValue,
resetFields, resetFields,
...@@ -218,8 +297,6 @@ ...@@ -218,8 +297,6 @@
setWorkFlowForm, setWorkFlowForm,
getRowKey, getRowKey,
getFieldsValue, getFieldsValue,
sendMessageForAllIframe sendMessageForAllIframe,
}); });
</script> </script>
\ No newline at end of file
...@@ -523,6 +523,7 @@ export const formProps: FormProps = { ...@@ -523,6 +523,7 @@ export const formProps: FormProps = {
{ name: 'code', tableTitle: '编码' }, { name: 'code', tableTitle: '编码' },
{ name: 'name', tableTitle: '名称' }, { name: 'name', tableTitle: '名称' },
{ name: 'note', tableTitle: '备注' }, { name: 'note', tableTitle: '备注' },
{ name: 'type', tableTitle: '类型' },
{ name: 'id', tableTitle: 'ID' }, { name: 'id', tableTitle: 'ID' },
], ],
}, },
......
...@@ -135,4 +135,3 @@ ...@@ -135,4 +135,3 @@
</script> </script>
\ No newline at end of file
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
{{ button.name }} {{ button.name }}
</a-button> </a-button>
<CustomButtonModal v-else-if="button.buttonType == 'modal'" :info="button" /> <CustomButtonModal v-else-if="button.buttonType == 'modal'" :info="button" />
<a-button v-else :type="button.buttonType === 'danger' ? 'default' : button.buttonType || 'primary'" :danger="button.buttonType === 'danger'" > <!-- <a-button v-else :type="button.buttonType === 'danger' ? 'default' : button.buttonType || 'primary'" :danger="button.buttonType === 'danger'" >-->
<template #icon><Icon :icon="button.icon" /></template> <!-- <template #icon><Icon :icon="button.icon" /></template>-->
{{ button.name }} <!-- {{ button.name }}-->
</a-button> <!-- </a-button>-->
</template> </template>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
...@@ -137,11 +137,6 @@ ...@@ -137,11 +137,6 @@
const filterColumns = filterColumnAuth(columns); const filterColumns = filterColumnAuth(columns);
const tableRef = ref(); const tableRef = ref();
//展示在列表内的按钮 //展示在列表内的按钮
const actionButtons = ref<string[]>(["view","edit","delete"]); const actionButtons = ref<string[]>(["view","edit","delete"]);
const buttonConfigs = computed(()=>{ const buttonConfigs = computed(()=>{
......
...@@ -267,7 +267,7 @@ export const formProps: FormProps = { ...@@ -267,7 +267,7 @@ export const formProps: FormProps = {
popupType: 'associate', popupType: 'associate',
width: '100%', width: '100%',
span: 7, span: 7,
placeholder: '请产品名称选择', placeholder: '请选择产品名称',
showLabel: true, showLabel: true,
disabled: false, disabled: false,
datasourceType: 'api', datasourceType: 'api',
...@@ -927,7 +927,8 @@ export const formProps: FormProps = { ...@@ -927,7 +927,8 @@ export const formProps: FormProps = {
{ key: '3', title: 'Body' }, { key: '3', title: 'Body' },
], ],
script: script:
"if(keyword!=null && keyword!=''){\r\n var sql = \"select *,id as value,cpmc as label from mes_base_product_info where delete_mark=0 and cpmc like '%${keyword}%' \";\r\n return db.select(sql)\r\n}\r\nvar sql = 'select *,id as value,cpmc as label from mes_base_product_info where delete_mark=0';\r\nreturn db.select(sql)", "if(keyword!=null && keyword!=''){\r\n var sql " +
"= \"select *,id as value,cpmc as label from mes_base_product_info where delete_mark=0 and cpmc like '%${keyword}%' \";\r\n return db.select(sql)\r\n}\r\nvar sql = 'select *,id as value,cpmc as label from mes_base_product_info where delete_mark=0';\r\nreturn db.select(sql)",
outputParams: [ outputParams: [
{ name: 'cpbh', tableTitle: '编号' }, { name: 'cpbh', tableTitle: '编号' },
{ name: 'cpmc', tableTitle: '名称' }, { name: 'cpmc', tableTitle: '名称' },
......
...@@ -1126,6 +1126,35 @@ export const formProps: FormProps = { ...@@ -1126,6 +1126,35 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: 'f77409b09aba410ca08f78847b871a45',
field: 'jhsl',
label: '计划数量',
type: 'number',
component: 'InputNumber',
colProps: { span: 24 },
defaultValue: '',
componentProps: {
width: '100%',
span: 7,
defaultValue: '',
min: 0,
max: null,
step: 1,
maxlength: null,
disabled: false,
showLabel: true,
controls: true,
required: false,
subTotal: false,
isShow: true,
rules: [],
events: {},
placeholder: '请输入计划数量',
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '32d66a3f683c4cb482f439d0619412fd', key: '32d66a3f683c4cb482f439d0619412fd',
field: 'bz', field: 'bz',
label: '备注', label: '备注',
...@@ -1138,7 +1167,7 @@ export const formProps: FormProps = { ...@@ -1138,7 +1167,7 @@ export const formProps: FormProps = {
span: 7, span: 7,
defaultValue: '', defaultValue: '',
placeholder: '请输入备注', placeholder: '请输入备注',
rows: 4, rows: 3,
autoSize: false, autoSize: false,
showCount: false, showCount: false,
disabled: false, disabled: false,
......
...@@ -387,6 +387,23 @@ export const permissionList = [ ...@@ -387,6 +387,23 @@ export const permissionList = [
disabled: false, disabled: false,
isSaveTable: false, isSaveTable: false,
tableName: '', tableName: '',
fieldName: '计划数量',
fieldId: 'jhsl',
isSubTable: false,
showChildren: true,
type: 'number',
key: 'f77409b09aba410ca08f78847b871a45',
children: [],
options: {},
defaultValue: '',
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '备注', fieldName: '备注',
fieldId: 'bz', fieldId: 'bz',
isSubTable: false, isSubTable: false,
......
...@@ -111,11 +111,20 @@ import { log } from 'node:console'; ...@@ -111,11 +111,20 @@ import { log } from 'node:console';
if (newGylxId && !state.isInitializing) { if (newGylxId && !state.isInitializing) {
try { try {
const response = await getRokeRouting(newGylxId); const response = await getRokeRouting(newGylxId);
//计划数量
const jhsl = state.formModel["sl"];
//计划开始时间
const jhksrq = state.formModel["jhksrq"];
//计划结束时间
const jhjsrq = state.formModel["jhjsrq"];
// Assign the process list from API response to production order list with field mapping // Assign the process list from API response to production order list with field mapping
state.formModel.mesProductionGongdanList = response.rokeRoutingProcessList.map(item => ({ state.formModel.mesProductionGongdanList = response.rokeRoutingProcessList.map(item => ({
gxbh: item.code, // 工序编号 → 工序编号 gxbh: item.code, // 工序编号 → 工序编号
gxmc: item.name, // 工序名称 → 工序名称 gxmc: item.name, // 工序名称 → 工序名称
jhsl: jhsl,
jhksrq: jhksrq,
jhjsrq: jhjsrq,
gxId: item.processId // 工序ID → 工序ID gxId: item.processId // 工序ID → 工序ID
})); }));
} catch (error) { } catch (error) {
......
...@@ -782,7 +782,7 @@ export const formProps: FormProps = { ...@@ -782,7 +782,7 @@ export const formProps: FormProps = {
maxSize: '', maxSize: '',
showLabel: true, showLabel: true,
multiple: false, multiple: false,
disabled: true, disabled: false,
required: false, required: false,
isShow: true, isShow: true,
events: {}, events: {},
...@@ -817,7 +817,7 @@ export const formProps: FormProps = { ...@@ -817,7 +817,7 @@ export const formProps: FormProps = {
disabled: false, disabled: false,
allowClear: false, allowClear: false,
showLabel: true, showLabel: true,
required: false, required: true,
rules: [], rules: [],
events: { change: '' }, events: { change: '' },
listStyle: '', listStyle: '',
...@@ -1384,6 +1384,102 @@ export const formProps: FormProps = { ...@@ -1384,6 +1384,102 @@ export const formProps: FormProps = {
}, },
}, },
{ {
key: '512d436e22c895a098efc1be72a113ea',
title: '计划数量',
dataIndex: 'jhsl',
componentType: 'InputNumber',
defaultValue: null,
componentProps: {
width: '100%',
span: '',
defaultValue: null,
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: true,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
prestrainField: '',
},
},
{
key: '983d777e22c113a965efc1be72a225ea',
title: '计划开始时间',
dataIndex: 'jhksrq',
componentType: 'DatePicker',
defaultValue: null,
componentProps: {
width: '100%',
span: '',
defaultValue: null,
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
format: 'YYYY-MM-DD HH:mm:ss',
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: '提示文本' },
prestrainField: '',
},
},
{
key: '345d623e15c966a965efc1be72a446ea',
title: '计划结束时间',
dataIndex: 'jhjsrq',
componentType: 'DatePicker',
defaultValue: null,
componentProps: {
width: '100%',
span: '',
defaultValue: null,
placeholder: '',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
format: 'YYYY-MM-DD HH:mm:ss',
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: '提示文本' },
prestrainField: '',
},
},
{
key: '2f069a67fe784742a2729fa09af94ec4', key: '2f069a67fe784742a2729fa09af94ec4',
title: '工序ID隐藏', title: '工序ID隐藏',
dataIndex: 'gxId', dataIndex: 'gxId',
......
...@@ -35,23 +35,23 @@ ...@@ -35,23 +35,23 @@
</template> </template>
</InputPassword> </InputPassword>
</FormItem> </FormItem>
<FormItem name="code" class="enter-x" v-if="formData.showCaptcha"> <!-- <FormItem name="code" class="enter-x" v-if="formData.showCaptcha">-->
<label class="form-title"> {{ t('验证码') }}</label> <!-- <label class="form-title"> {{ t('验证码') }}</label>-->
<div style="display: flex"> <!-- <div style="display: flex">-->
<Input <!-- <Input-->
size="large" <!-- size="large"-->
v-model:value="formData.code" <!-- v-model:value="formData.code"-->
:placeholder="t('验证码')" <!-- :placeholder="t('验证码')"-->
class="fix-auto-fill" <!-- class="fix-auto-fill"-->
style="height: 58px" <!-- style="height: 58px"-->
/> <!-- />-->
<img <!-- <img-->
:src="formData.captchaImg" <!-- :src="formData.captchaImg"-->
style="width: 100%; height: 60px; margin-left: 10px" <!-- style="width: 100%; height: 60px; margin-left: 10px"-->
@click="getImg" <!-- @click="getImg"-->
/> <!-- />-->
</div> <!-- </div>-->
</FormItem> <!-- </FormItem>-->
<ARow class="enter-x"> <ARow class="enter-x">
<ACol :span="12"> <ACol :span="12">
<FormItem> <FormItem>
...@@ -97,16 +97,16 @@ ...@@ -97,16 +97,16 @@
</ACol> </ACol>
</ARow> --> </ARow> -->
<a-divider class="enter-x">{{ t('其他登录方式') }}</a-divider> <!-- <a-divider class="enter-x">{{ t('其他登录方式') }}</a-divider>-->
</div> </div>
<!-- <div style="height: 1000px; width: 800px" v-else> <!-- <div style="height: 1000px; width: 800px" v-else>
<iframe id="iframeId" style="height: 100%; width: 100%" :src="authorizeUrl"></iframe> <iframe id="iframeId" style="height: 100%; width: 100%" :src="authorizeUrl"></iframe>
</div> --> </div> -->
<div class="text-center" :class="`${prefixCls}-sign-in-way`"> <!-- <div class="text-center" :class="`${prefixCls}-sign-in-way`">-->
<WechatOutlined @click="oauthLogin('wechat_enterprise')" class="methods-icon mr-5" /> <!-- <WechatOutlined @click="oauthLogin('wechat_enterprise')" class="methods-icon mr-5" />-->
<DingdingOutlined @click="oauthLogin('dingtalk')" class="methods-icon" /> <!-- <DingdingOutlined @click="oauthLogin('dingtalk')" class="methods-icon" />-->
</div> <!-- </div>-->
</Form> </Form>
<Modal <Modal
......
...@@ -50,12 +50,12 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -50,12 +50,12 @@ export const searchFormSchema: FormSchema[] = [
defaultValue: undefined, defaultValue: undefined,
component: 'Input', component: 'Input',
}, },
{ // {
field: 'gkyj', // field: 'gkyj',
label: '顾客意见', // label: '顾客意见',
defaultValue: undefined, // defaultValue: undefined,
component: 'Input', // component: 'Input',
}, // },
]; ];
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
...@@ -137,18 +137,18 @@ export const columns: BasicColumn[] = [ ...@@ -137,18 +137,18 @@ export const columns: BasicColumn[] = [
listStyle: '', listStyle: '',
}, },
{ // {
resizable: true, // resizable: true,
dataIndex: 'gkyj', // dataIndex: 'gkyj',
title: '顾客意见', // title: '顾客意见',
componentType: 'input', // componentType: 'input',
//
fixed: false, // fixed: false,
sorter: true, // sorter: true,
//
styleConfig: undefined, // styleConfig: undefined,
listStyle: '', // listStyle: '',
}, // },
]; ];
//表头合并配置 //表头合并配置
export const headerMergingData = []; export const headerMergingData = [];
...@@ -435,55 +435,55 @@ export const formProps: FormProps = { ...@@ -435,55 +435,55 @@ export const formProps: FormProps = {
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
}, },
}, },
{ // {
key: '2908e95b40994ef4aa819972bd840713', // key: '2908e95b40994ef4aa819972bd840713',
field: '', // field: '',
label: '分割线', // label: '分割线',
colProps: { span: 24 }, // colProps: { span: 24 },
type: 'divider', // type: 'divider',
component: 'Divider', // component: 'Divider',
componentProps: { // componentProps: {
dashed: false, // dashed: false,
orientation: 'left', // orientation: 'left',
text: '审批意见', // text: '审批意见',
isShow: true, // isShow: true,
style: { marginTop: '0px', marginBottom: '0px' }, // style: { marginTop: '0px', marginBottom: '0px' },
}, // },
}, // },
{ // {
key: '879e17939485432c8c0dfb17101a4942', // key: '879e17939485432c8c0dfb17101a4942',
field: 'gkyj', // field: 'gkyj',
label: '顾客意见', // label: '顾客意见',
type: 'input', // type: 'input',
component: 'Input', // component: 'Input',
colProps: { span: 24 }, // colProps: { span: 24 },
defaultValue: '', // defaultValue: '',
componentProps: { // componentProps: {
width: '100%', // width: '100%',
span: '', // span: '',
defaultValue: '', // defaultValue: '',
placeholder: '请输入顾客意见', // placeholder: '请输入顾客意见',
maxlength: null, // maxlength: null,
prefix: '', // prefix: '',
suffix: '', // suffix: '',
addonBefore: '', // addonBefore: '',
addonAfter: '', // addonAfter: '',
disabled: false, // disabled: false,
allowClear: false, // allowClear: false,
showLabel: true, // showLabel: true,
required: false, // required: false,
rules: [], // rules: [],
events: {}, // events: {},
listStyle: '', // listStyle: '',
isSave: false, // isSave: false,
isShow: true, // isShow: true,
scan: false, // scan: false,
bordered: true, // bordered: true,
isShowAi: false, // isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' }, // tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' }, // style: { width: '100%' },
}, // },
}, // },
], ],
showActionButtonGroup: false, showActionButtonGroup: false,
buttonLocation: 'center', buttonLocation: 'center',
......
...@@ -287,6 +287,18 @@ export const columns: BasicColumn[] = [ ...@@ -287,6 +287,18 @@ export const columns: BasicColumn[] = [
styleConfig: undefined, styleConfig: undefined,
listStyle: undefined, listStyle: undefined,
}, },
{
resizable: true,
dataIndex: 'createDate',
title: '创建时间',
componentType: 'date',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{ {
resizable: true, resizable: true,
...@@ -303,6 +315,19 @@ export const columns: BasicColumn[] = [ ...@@ -303,6 +315,19 @@ export const columns: BasicColumn[] = [
{ {
resizable: true, resizable: true,
dataIndex: 'lydh',
title: '来源单号',
componentType: 'select',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'zt', dataIndex: 'zt',
title: '质检状态', title: '质检状态',
componentType: 'select', componentType: 'select',
......
...@@ -287,4 +287,3 @@ ...@@ -287,4 +287,3 @@
}); });
</script> </script>
\ No newline at end of file
...@@ -75,7 +75,18 @@ export const columns: BasicColumn[] = [ ...@@ -75,7 +75,18 @@ export const columns: BasicColumn[] = [
styleConfig: undefined, styleConfig: undefined,
listStyle: '', listStyle: '',
}, },
{
resizable: true,
dataIndex: 'createDate',
title: '创建时间',
componentType: 'input',
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: '',
},
{ {
resizable: true, resizable: true,
dataIndex: 'cp', dataIndex: 'cp',
......
...@@ -80,60 +80,6 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -80,60 +80,6 @@ export const searchFormSchema: FormSchema[] = [
defaultValue: undefined, defaultValue: undefined,
component: 'Input', component: 'Input',
}, },
{
field: 'scbmyj',
label: '生产部门意见',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'staticData',
staticOptions: [
{ key: 2, label: '同意', value: '1' },
{ key: 3, label: '不同意', value: '2' },
],
labelField: 'label',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'mybmyj',
label: '贸易部门意见',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'staticData',
staticOptions: [
{ key: 1, label: '同意', value: '1' },
{ key: 3, label: '不同意', value: '2' },
],
labelField: 'label',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
{
field: 'pkyfbmyj',
label: '品控研发部门意见',
defaultValue: undefined,
component: 'XjrSelect',
componentProps: {
datasourceType: 'staticData',
staticOptions: [
{ key: 1, label: '同意', value: '1' },
{ key: 3, label: '不同意', value: '2' },
],
labelField: 'label',
valueField: 'value',
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
},
},
]; ];
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
...@@ -253,72 +199,6 @@ export const columns: BasicColumn[] = [ ...@@ -253,72 +199,6 @@ export const columns: BasicColumn[] = [
styleConfig: undefined, styleConfig: undefined,
listStyle: undefined, listStyle: undefined,
}, },
{
resizable: true,
dataIndex: 'scbmyj',
title: '生产部门意见',
componentType: 'select',
customRender: ({ record }) => {
const staticOptions = [
{ key: 2, label: '同意', value: '1' },
{ key: 3, label: '不同意', value: '2' },
];
return staticOptions.filter((x) => x.value == record.scbmyj)[0]?.label;
},
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'mybmyj',
title: '贸易部门意见',
componentType: 'select',
customRender: ({ record }) => {
const staticOptions = [
{ key: 1, label: '同意', value: '1' },
{ key: 3, label: '不同意', value: '2' },
];
return staticOptions.filter((x) => x.value == record.mybmyj)[0]?.label;
},
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
{
resizable: true,
dataIndex: 'pkyfbmyj',
title: '品控研发部门意见',
componentType: 'select',
customRender: ({ record }) => {
const staticOptions = [
{ key: 1, label: '同意', value: '1' },
{ key: 3, label: '不同意', value: '2' },
];
return staticOptions.filter((x) => x.value == record.pkyfbmyj)[0]?.label;
},
fixed: false,
sorter: true,
styleConfig: undefined,
listStyle: undefined,
},
]; ];
//表头合并配置 //表头合并配置
export const headerMergingData = []; export const headerMergingData = [];
...@@ -703,135 +583,6 @@ export const formProps: FormProps = { ...@@ -703,135 +583,6 @@ export const formProps: FormProps = {
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
}, },
}, },
{
key: '94ff603208e949a8992d2ce6251bfe94',
field: '',
label: '分割线',
colProps: { span: 24 },
type: 'divider',
component: 'Divider',
componentProps: {
dashed: false,
orientation: 'left',
text: '审批意见',
isShow: true,
style: { marginTop: '0px', marginBottom: '0px' },
},
},
{
key: '70230001853c40149d6dc73cb37a1c03',
field: 'scbmyj',
label: '生产部门意见',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: '',
placeholder: '请选择下拉选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 2, label: '同意', value: '1' },
{ key: 3, label: '不同意', value: '2' },
],
defaultSelect: '',
datasourceType: 'staticData',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '3d255e7e46574b888d81e83ae1b5fa3f',
field: 'mybmyj',
label: '贸易部门意见',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: '',
placeholder: '请选择下拉选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: '同意', value: '1' },
{ key: 3, label: '不同意', value: '2' },
],
defaultSelect: '',
datasourceType: 'staticData',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
{
key: '7ff2a8c3be574905879884c618cfa7db',
field: 'pkyfbmyj',
label: '品控研发部门意见',
type: 'select',
component: 'XjrSelect',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: '',
placeholder: '请选择下拉选择',
showLabel: true,
showSearch: false,
isMultiple: false,
clearable: false,
disabled: false,
staticOptions: [
{ key: 1, label: '同意', value: '1' },
{ key: 3, label: '不同意', value: '2' },
],
defaultSelect: '',
datasourceType: 'staticData',
labelField: 'label',
valueField: 'value',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
dicOptions: [],
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
], ],
showActionButtonGroup: false, showActionButtonGroup: false,
buttonLocation: 'center', buttonLocation: 'center',
......
...@@ -185,68 +185,4 @@ export const permissionList = [ ...@@ -185,68 +185,4 @@ export const permissionList = [
options: {}, options: {},
defaultValue: '', defaultValue: '',
}, },
{
required: false,
view: true,
edit: false,
disabled: true,
isSaveTable: false,
tableName: '',
fieldName: '分割线',
fieldId: '',
isSubTable: false,
showChildren: true,
type: 'divider',
key: '94ff603208e949a8992d2ce6251bfe94',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '生产部门意见',
fieldId: 'scbmyj',
isSubTable: false,
showChildren: true,
type: 'select',
key: '70230001853c40149d6dc73cb37a1c03',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '贸易部门意见',
fieldId: 'mybmyj',
isSubTable: false,
showChildren: true,
type: 'select',
key: '3d255e7e46574b888d81e83ae1b5fa3f',
children: [],
options: {},
},
{
required: false,
view: true,
edit: true,
disabled: false,
isSaveTable: false,
tableName: '',
fieldName: '品控研发部门意见',
fieldId: 'pkyfbmyj',
isSubTable: false,
showChildren: true,
type: 'select',
key: '7ff2a8c3be574905879884c618cfa7db',
children: [],
options: {},
},
]; ];
...@@ -77,6 +77,53 @@ ...@@ -77,6 +77,53 @@
}, },
); );
watch(
() => formModel.value.cp,
async (newCpflId, oldCpflId) => {
if (newCpflId && newCpflId !== oldCpflId) {
await handleCpflChange(newCpflId);
}
},
);
// 产品名称变化:根据产品分类ID查询对应的质检方案
async function handleCpflChange(cpflId: string) {
try {
const response = await axios.get(
import.meta.env.VITE_GLOB_API_URL + '/magic-api/zlgl/zjjcsj/getZjfaByCpfl',
{
params: { id: cpflId },
},
);
const zjfaData = (response as any)?.data?.data;
console.log(zjfaData);
// return;
if (zjfaData) {
// 回填质检方案字段
formModel.value.zjfa = zjfaData[0].mc;
// 手动触发一次质检方案变化的处理,带出质检明细
// 由于watch是异步的,直接赋值会触发上面的zjfa监听
// 但为了确保立即执行,可以手动调用
await handleZjfaChange(zjfaData[0].id);
notification.success({ message: '已自动匹配质检方案' });
} else {
// 如果没有找到对应的质检方案,清空质检方案和相关明细
formModel.value.zjfa = '';
formModel.value.mesQualityInspectionDetailList = [];
notification.info({ message: '该产品分类未配置质检方案' });
}
} catch (error) {
formModel.value.zjfa = '';
formModel.value.mesQualityInspectionDetailList = [];
console.error('获取产品对应的质检方案失败:', error);
notification.error({ message: '获取质检方案失败' });
}
}
// 质检方案变化:根据方案id从接口获取明细,并整体替换当前明细列表 // 质检方案变化:根据方案id从接口获取明细,并整体替换当前明细列表
let zjfaReqSeq = 0; let zjfaReqSeq = 0;
async function handleZjfaChange(zjfaId: string) { async function handleZjfaChange(zjfaId: string) {
......
...@@ -415,6 +415,62 @@ export const formProps: FormProps = { ...@@ -415,6 +415,62 @@ export const formProps: FormProps = {
style: { width: '100%' }, style: { width: '100%' },
}, },
}, },
{
key: '2c05765e50b44fa8be4aec443066f781',
field: 'cpfl',
label: '产品分类',
type: 'cascader',
component: 'ApiCascader',
colProps: { span: 24 },
componentProps: {
width: '100%',
span: 7,
placeholder: '请选择产品类别',
showFormat: 'all',
separator: '/',
selectedConfig: 'any',
disabled: false,
allowClear: false,
showLabel: true,
apiConfig: {
path: '/jcxx/cplx/getAllCPLXTree_zujian',
method: 'GET',
apiId: 'copy1770283483454d34933',
apiParams: [
{
key: '1',
title: 'Query Params',
tableInfo: [
{
name: 'code',
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 = ""\r\n + "select id,"\r\n + " pid as \'parentId\', "\r\n + " id as \'value\', "\r\n + " cm as \'label\' "\r\n + "from mes_base_cplx "\r\n + "where delete_mark = 0 "\r\n + "order by pid, id";\r\nvar list = db.select(sql);\r\n\r\nif (list == null || list.size() == 0) {\r\n return [];\r\n}\r\nvar map = new HashMap();\r\nvar idx = 0;\r\nwhile (idx < list.size()) {\r\n var itemNode = list.get(idx);\r\n itemNode.children = [];\r\n map.put(itemNode.id, itemNode);\r\n idx = idx + 1;\r\n}\r\nvar dataList = [];\r\nidx = 0;\r\nwhile (idx < list.size()) {\r\n var itemNode = list.get(idx);\r\n if (itemNode.parentId == null || itemNode.parentId == \'0\' || itemNode.parentId == \'\') {\r\n dataList.add(itemNode);\r\n } else {\r\n var pid = null;\r\n if (itemNode.parentId.contains(",")){\r\n var arr = itemNode.parentId.split(",");\r\n pid=arr[arr.length-1]\r\n }else{\r\n pid=itemNode.parentId;\r\n }\r\n var parentNode = map.get(pid);\r\n if (parentNode != null) {\r\n parentNode.children.add(itemNode);\r\n } else {\r\n dataList.add(itemNode);\r\n }\r\n }\r\n idx = idx + 1;\r\n}\r\nreturn dataList\r\n',
},
required: false,
rules: [],
events: {},
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' },
},
},
], ],
}, },
{ {
......
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