Commit 580e8759 by 董晓奇

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

parent 2d52f1ea
<template> <template>
<ResizePageWrapper :hasLeft="false"> <ResizePageWrapper :hasLeft="false">
<template #resizeRight> <template #resizeRight>
...@@ -11,7 +10,9 @@ ...@@ -11,7 +10,9 @@
<template #toolbar> <template #toolbar>
<template v-for="button in tableButtonConfig" :key="button.code"> <template v-for="button in tableButtonConfig" :key="button.code">
<a-button v-if="button.isDefault" type="primary" @click="buttonClick(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 }} {{ button.name }}
</a-button> </a-button>
<CustomButtonModal v-else-if="button.buttonType == 'modal'" :info="button" /> <CustomButtonModal v-else-if="button.buttonType == 'modal'" :info="button" />
...@@ -21,17 +22,15 @@ ...@@ -21,17 +22,15 @@
:danger="button.buttonType === 'danger'" :danger="button.buttonType === 'danger'"
@click="buttonClick(button.code)" @click="buttonClick(button.code)"
> >
<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 }">
<template v-if="column.dataIndex === 'action'"> <template v-if="column.dataIndex === 'action'">
<TableAction <TableAction
:actions="getLessActions(record)" :actions="getLessActions(record)"
:dropDownActions="getMoreActions(record)" :dropDownActions="getMoreActions(record)"
...@@ -44,27 +43,14 @@ ...@@ -44,27 +43,14 @@
}}</span> }}</span>
</template> </template>
</template> </template>
</BasicTable> </BasicTable>
</template> </template>
<ScjhModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel" />
</ResizePageWrapper>
<ScjhModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/>
</ResizePageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed,provide,Ref, createVNode, import { ref, computed, provide, Ref, createVNode } from 'vue';
} from 'vue';
import { Modal } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
...@@ -79,47 +65,21 @@ ...@@ -79,47 +65,21 @@
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
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 { executeListStyle, getValue } from '/@/hooks/web/useListStyle';//列表样式配置 import { executeListStyle, getValue } from '/@/hooks/web/useListStyle'; //列表样式配置
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import ScjhModal from './components/ScjhModal.vue'; import ScjhModal from './components/ScjhModal.vue';
import { searchFormSchema, columns } from './components/config'; import { searchFormSchema, columns } from './components/config';
import Icon from '/@/components/Icon/index'; import Icon from '/@/components/Icon/index';
const listSpliceNum = ref(3); //操作列最先展示几个 const listSpliceNum = ref(3); //操作列最先展示几个
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock'; import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
import {rksqMesProductOutput} from "/@/api/scgl/ccmx"; import { rksqMesProductOutput } from '/@/api/scgl/ccmx';
const pageParamsInfo = ref<any>({}); const pageParamsInfo = ref<any>({});
const { const {
...@@ -137,11 +97,6 @@ ...@@ -137,11 +97,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(() => {
...@@ -212,18 +167,12 @@ ...@@ -212,18 +167,12 @@
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string); const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
provide<Ref<string>>('currentFormId', formIdComputedRef); provide<Ref<string>>('currentFormId', formIdComputedRef);
const selectedKeys = ref<string[]>([]); const selectedKeys = ref<string[]>([]);
const selectedRowsData = ref<any[]>([]); const selectedRowsData = ref<any[]>([]);
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
const [registerTable, { reload }] = useTable({ const [registerTable, { reload }] = useTable({
...@@ -240,25 +189,18 @@ ...@@ -240,25 +189,18 @@
fieldMapToTime: [], fieldMapToTime: [],
showResetButton: false, showResetButton: false,
}, },
bordered:false, bordered: false,
beforeFetch: (params) => { beforeFetch: (params) => {
pageParamsInfo.value = {...params, FormId: formIdComputedRef.value,PK: 'id' } pageParamsInfo.value = { ...params, FormId: formIdComputedRef.value, PK: 'id' };
return pageParamsInfo.value; return pageParamsInfo.value;
}, },
afterFetch: (res) => { afterFetch: (res) => {
selectedKeys.value = []; selectedKeys.value = [];
selectedRowsData.value = []; selectedRowsData.value = [];
}, },
useSearchForm: true, useSearchForm: true,
showTableSetting: true, showTableSetting: true,
striped: false, striped: false,
actionColumn: { actionColumn: {
width: 195, width: 195,
...@@ -275,21 +217,16 @@ ...@@ -275,21 +217,16 @@
objectId: formIdComputedRef.value, ////系统表单formId,自定义表单releaseId的id值 objectId: formIdComputedRef.value, ////系统表单formId,自定义表单releaseId的id值
}); });
function buttonClick(code) { function buttonClick(code) {
btnEvent[code](); btnEvent[code]();
} }
function handleAdd() { function handleAdd() {
openModal(true, { isUpdate: false }); openModal(true, { isUpdate: false });
} }
async function handleEdit(record: Recordable) { async function handleEdit(record: Recordable) {
const hasNonDraft = (record.zt !== '草稿'); const hasNonDraft = record.zt !== '草稿';
if (hasNonDraft) { if (hasNonDraft) {
Modal.warning({ Modal.warning({
title: '提示', title: '提示',
...@@ -311,16 +248,12 @@ ...@@ -311,16 +248,12 @@
id: record[field], id: record[field],
isUpdate: true, isUpdate: true,
}; };
openModal(true, info); openModal(true, info);
} catch (error) {} } catch (error) {}
} }
function handleDelete(record: Recordable) { function handleDelete(record: Recordable) {
deleteList([record.id]); deleteList([record.id]);
} }
...@@ -345,10 +278,6 @@ ...@@ -345,10 +278,6 @@
}); });
} }
function onSelectChange(selectedRowKeys: [], selectedRows) { function onSelectChange(selectedRowKeys: [], selectedRows) {
selectedKeys.value = selectedRowKeys; selectedKeys.value = selectedRowKeys;
selectedRowsData.value = selectedRows; selectedRowsData.value = selectedRows;
...@@ -356,7 +285,6 @@ ...@@ -356,7 +285,6 @@
function customRow(record: Recordable) { function customRow(record: Recordable) {
return { return {
onClick: () => { onClick: () => {
let selectedRowKeys = [...selectedKeys.value]; let selectedRowKeys = [...selectedKeys.value];
if (selectedRowKeys.indexOf(record.id) >= 0) { if (selectedRowKeys.indexOf(record.id) >= 0) {
...@@ -376,26 +304,22 @@ ...@@ -376,26 +304,22 @@
} }
function handleSuccess() { function handleSuccess() {
selectedKeys.value = []; selectedKeys.value = [];
selectedRowsData.value = []; selectedRowsData.value = [];
reload(); reload();
} }
function handleFormSuccess() { function handleFormSuccess() {
handleSuccess(); handleSuccess();
handleCloseFormEnableLocke(buttonConfigs.value, 'edit'); handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
} }
function handleFormCancel() { function handleFormCancel() {
handleCloseFormEnableLocke(buttonConfigs.value, 'edit'); handleCloseFormEnableLocke(buttonConfigs.value, 'edit');
} }
function handleView(record: Recordable) { function handleView(record: Recordable) {
let info={ let info = {
isView: true, isView: true,
id: record.id, id: record.id,
}; };
...@@ -435,7 +359,6 @@ ...@@ -435,7 +359,6 @@
description: '下发成功!', description: '下发成功!',
}); });
}); });
}, },
onCancel() {}, onCancel() {},
}); });
...@@ -445,11 +368,13 @@ ...@@ -445,11 +368,13 @@
let list = getActions(record); let list = getActions(record);
return list.slice(0, listSpliceNum.value); return list.slice(0, listSpliceNum.value);
} }
function getMoreActions(record: Recordable) { function getMoreActions(record: Recordable) {
let list = getActions(record); let list = getActions(record);
return list.slice(listSpliceNum.value); return list.slice(listSpliceNum.value);
} }
function getActions(record: Recordable):ActionItem[] {
function getActions(record: Recordable): ActionItem[] {
record.isCanEdit = false; record.isCanEdit = false;
let actionsList: ActionItem[] = []; let actionsList: ActionItem[] = [];
...@@ -476,24 +401,17 @@ ...@@ -476,24 +401,17 @@
}); });
return actionsList; return actionsList;
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
:deep(.ant-table-selection-col) { :deep(.ant-table-selection-col) {
width: 50px; width: 50px;
} }
.show{ .show {
display: flex; display: flex;
} }
.hide{ .hide {
display: none !important; display: none !important;
} }
</style> </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