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,17 +22,15 @@
: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
:actions="getLessActions(record)"
:dropDownActions="getMoreActions(record)"
......@@ -44,27 +43,14 @@
}}</span>
</template>
</template>
</BasicTable>
</template>
<ScjhModal @register="registerModal" @success="handleFormSuccess" @cancel="handleFormCancel"/>
</ResizePageWrapper>
<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';
......@@ -79,47 +65,21 @@
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 { 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 Icon from '/@/components/Icon/index';
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 {
......@@ -137,11 +97,6 @@
const filterColumns = filterColumnAuth(columns);
const tableRef = ref();
//展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit', 'delete']);
const buttonConfigs = computed(() => {
......@@ -212,18 +167,12 @@
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,
bordered: false,
beforeFetch: (params) => {
pageParamsInfo.value = {...params, FormId: formIdComputedRef.value,PK: 'id' }
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,
......@@ -275,21 +217,16 @@
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: '提示',
......@@ -311,16 +248,12 @@
id: record[field],
isUpdate: true,
};
openModal(true, info);
} catch (error) {}
}
function handleDelete(record: Recordable) {
deleteList([record.id]);
}
......@@ -345,10 +278,6 @@
});
}
function onSelectChange(selectedRowKeys: [], selectedRows) {
selectedKeys.value = selectedRowKeys;
selectedRowsData.value = selectedRows;
......@@ -356,7 +285,6 @@
function customRow(record: Recordable) {
return {
onClick: () => {
let selectedRowKeys = [...selectedKeys.value];
if (selectedRowKeys.indexOf(record.id) >= 0) {
......@@ -376,26 +304,22 @@
}
function handleSuccess() {
selectedKeys.value = [];
selectedRowsData.value = [];
reload();
}
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,
};
......@@ -435,7 +359,6 @@
description: '下发成功!',
});
});
},
onCancel() {},
});
......@@ -445,11 +368,13 @@
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[] = [];
......@@ -476,24 +401,17 @@
});
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