Commit 580e8759 by 董晓奇

生产计划右图内容调整,计划明细名称(tab页)不能为物料,改为计划明细

parent 2d52f1ea
<template>
<ResizePageWrapper :hasLeft="false">
<template #resizeRight>
......@@ -11,7 +10,9 @@
<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>
<template #icon>
<Icon :icon="button.icon" />
</template>
{{ button.name }}
</a-button>
<CustomButtonModal v-else-if="button.buttonType == 'modal'" :info="button" />
......@@ -21,51 +22,36 @@
:danger="button.buttonType === 'danger'"
@click="buttonClick(button.code)"
>
<template #icon><Icon :icon="button.icon" /></template>
<template #icon>
<Icon :icon="button.icon" />
</template>
{{ button.name }}
</a-button>
</template>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<TableAction
<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>
<ScjhModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/>
</ResizePageWrapper>
</template>
<ScjhModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel" />
</ResizePageWrapper>
</template>
<script lang="ts" setup>
import { ref, computed,provide,Ref, createVNode,
} from 'vue';
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';
......@@ -78,48 +64,22 @@
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 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 ScjhModal from './components/ScjhModal.vue';
import { searchFormSchema, columns } from './components/config';
import { searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index';
const listSpliceNum = ref(3); //操作列最先展示几个
const listSpliceNum = ref(3); //操作列最先展示几个
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
import {rksqMesProductOutput} from "/@/api/scgl/ccmx";
import { rksqMesProductOutput } from '/@/api/scgl/ccmx';
const pageParamsInfo = ref<any>({});
const {
......@@ -136,12 +96,7 @@
const filterColumns = filterColumnAuth(columns);
const tableRef = ref();
//展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit', 'delete']);
const buttonConfigs = computed(() => {
......@@ -211,19 +166,13 @@
};
const { currentRoute } = useRouter();
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
provide<Ref<string>>('currentFormId', formIdComputedRef);
const selectedKeys = ref<string[]>([]);
const selectedRowsData = ref<any[]>([]);
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload }] = useTable({
......@@ -240,25 +189,18 @@
fieldMapToTime: [],
showResetButton: false,
},
bordered:false,
beforeFetch: (params) => {
pageParamsInfo.value = {...params, FormId: formIdComputedRef.value,PK: 'id' }
bordered: false,
beforeFetch: (params) => {
pageParamsInfo.value = { ...params, FormId: formIdComputedRef.value, PK: 'id' };
return pageParamsInfo.value;
},
afterFetch: (res) => {
selectedKeys.value = [];
selectedRowsData.value = [];
},
useSearchForm: true,
showTableSetting: true,
striped: false,
actionColumn: {
width: 195,
......@@ -270,26 +212,21 @@
size: false,
},
customRow,
isAdvancedQuery: false,
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) {
const hasNonDraft = (record.zt !== '草稿');
const hasNonDraft = record.zt !== '草稿';
if (hasNonDraft) {
Modal.warning({
title: '提示',
......@@ -298,33 +235,29 @@
return;
}
let field = 'id';
try {
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) {}
}
let info = {
id: record[field],
isUpdate: true,
};
openModal(true, info);
} catch (error) {}
}
function handleDelete(record: Recordable) {
deleteList([record.id]);
deleteList([record.id]);
}
function deleteList(ids) {
Modal.confirm({
title: '提示信息',
......@@ -344,19 +277,14 @@
onCancel() {},
});
}
function onSelectChange(selectedRowKeys: [], selectedRows) {
selectedKeys.value = selectedRowKeys;
selectedRowsData.value = selectedRows;
}
function customRow(record: Recordable) {
return {
onClick: () => {
let selectedRowKeys = [...selectedKeys.value];
if (selectedRowKeys.indexOf(record.id) >= 0) {
......@@ -374,33 +302,29 @@
},
};
}
function handleSuccess() {
selectedKeys.value = [];
selectedRowsData.value = [];
selectedKeys.value = [];
selectedRowsData.value = [];
reload();
}
function handleFormSuccess() {
function handleFormSuccess() {
handleSuccess();
handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
}
function handleFormCancel() {
handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
}
function handleView(record: Recordable) {
let info={
let info = {
isView: true,
id: record.id,
};
openModal(true, info);
openModal(true, info);
}
function handleXiafa(record: Recordable) {
......@@ -435,7 +359,6 @@
description: '下发成功!',
});
});
},
onCancel() {},
});
......@@ -445,20 +368,22 @@
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[] {
function getActions(record: Recordable): ActionItem[] {
record.isCanEdit = false;
let actionsList: ActionItem[] = [];
let actionsList: ActionItem[] = [];
actionButtonConfig.value?.map((button) => {
if (!record?.workflowData?.processId) {
if (!record?.workflowData?.processId) {
record.isCanEdit = true;
actionsList.push({
...button,
auth: `scjh:${button.code}`,
label: button?.name,
color: button.code === 'delete' ? 'error' : undefined,
......@@ -471,29 +396,22 @@
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{
.show {
display: flex;
}
.hide{
.hide {
display: none !important;
}
</style>
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