客户需求

This commit is contained in:
‘huanghaiixia’
2026-01-21 17:56:35 +08:00
parent b0e03cecc0
commit bdbffe4c30
18 changed files with 886 additions and 157 deletions

View File

@ -88,4 +88,7 @@
:deep(.w-e-text-container) {
background-color: v-bind("props.disabled ? '#f5f5f5': '#fff'");
}
:deep(.w-e-text p img) {
margin: 0 auto;
}
</style>

View File

@ -0,0 +1,63 @@
<template>
<div>
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit"
@visible-change="handleVisibleChange" >
<a-table bordered rowKey="id" :columns="columns" :data-source="dataList" :pagination="false" :row-selection="{ type:'radio', selectedRowKeys: selectedKeys, onChange: onSelectChange }"/>
</BasicModal>
</div>
</template>
<script lang="ts" setup>
import { ref, computed, unref, nextTick } from 'vue';
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
const columns: BasicColumn[] = [
{ title: t('合同号'), dataIndex: 'id', sorter: true},
{ title: t('合同名称'), dataIndex: 'kName', sorter: true},
];
const emit = defineEmits(['success', 'register']);
const { notification } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
const selectedKeys = ref<string[]>([]);
const selectedValues = ref([]);
const dataList =ref([])
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false });
dataList.value = data.list || []
isUpdate.value = !!data?.isUpdate;
});
function onSelectChange(rowKeys: string[], e) {
selectedKeys.value = rowKeys;
selectedValues.value = e
}
const getTitle = computed(() => (!unref(isUpdate) ? t('合同列表') : t('')));
async function handleSubmit() {
if (!selectedValues.value.length) {
notification.warning({
message: t('提示'),
description: t('请选择合同')
});
return
}
closeModal();
emit('success', selectedValues.value);
}
</script>
<style >
</style>

View File

@ -1,112 +0,0 @@
<template>
<div>
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit"
@visible-change="handleVisibleChange" >
<BasicTable @register="registerTable" class="contractFactListModal"></BasicTable>
</BasicModal>
</div>
</template>
<script lang="ts" setup>
import { ref, computed, unref, nextTick } from 'vue';
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { getLngContract } from '/@/api/contract/ContractSales';
const { t } = useI18n();
const codeFormSchema: FormSchema[] = [
{ field: 'kName', label: '合同号/名称', component: 'Input'},
];
const columns: BasicColumn[] = [
{ title: t('合同号'), dataIndex: 'kNo', sorter: true},
{ title: t('合同名称'), dataIndex: 'kName', sorter: true},
{ title: t('客户'), dataIndex: 'cpName', sorter: true},
{ title: t('有效期开始'), dataIndex: 'dateFrom', sorter: true},
{ title: t('有效期结束'), dataIndex: 'dateTo', sorter: true,},
{ title: t('交割点'), dataIndex: 'pointUpName', sorter: true,},
{ title: t('合同主体'), dataIndex: 'comName', sorter: true,},
];
const emit = defineEmits(['success', 'register']);
const { notification } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
const selectedKeys = ref<string[]>([]);
const selectedValues = ref([]);
const props = defineProps({
selectType: { type: String, default: 'checkbox' },
});
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
});
const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload }] = useTable({
title: t('管道气销售合同列表'),
api: getLngContract,
columns,
bordered: true,
pagination: true,
canResize: false,
formConfig: {
labelCol:{span: 9, offSet:10},
schemas: codeFormSchema,
showResetButton: true,
},
immediate: false, // 设置为不立即调用
beforeFetch: (params) => {
return { ...params,approCode: 'YSP'};
},
rowSelection: {
type: props.selectType,
onChange: onSelectChange
},
});
const handleVisibleChange = (visible: boolean) => {
if (visible) {
nextTick(() => {
reload();
});
}
};
function onSelectChange(rowKeys: string[], e) {
selectedKeys.value = rowKeys;
selectedValues.value = e
}
const getTitle = computed(() => (!unref(isUpdate) ? t('合同列表') : t('')));
async function handleSubmit() {
if (!selectedValues.value.length) {
notification.warning({
message: t('提示'),
description: t('请选择合同')
});
return
}
closeModal();
emit('success', selectedValues.value);
}
</script>
<style >
.contractFactListModal .basicCol{
position: inherit !important;
top: 0;
}
</style>

View File

@ -0,0 +1,63 @@
<template>
<div>
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit"
@visible-change="handleVisibleChange" >
<a-table bordered rowKey="id" :columns="columns" :data-source="dataList" :pagination="false" :row-selection="{ type:'radio', selectedRowKeys: selectedKeys, onChange: onSelectChange }"/>
</BasicModal>
</div>
</template>
<script lang="ts" setup>
import { ref, computed, unref, nextTick } from 'vue';
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
const columns: BasicColumn[] = [
{ title: t('合同号'), dataIndex: 'id', sorter: true},
{ title: t('合同名称'), dataIndex: 'kName', sorter: true},
];
const emit = defineEmits(['success', 'register']);
const { notification } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
const selectedKeys = ref<string[]>([]);
const selectedValues = ref([]);
const dataList =ref([])
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false });
dataList.value = data.list || []
isUpdate.value = !!data?.isUpdate;
});
function onSelectChange(rowKeys: string[], e) {
selectedKeys.value = rowKeys;
selectedValues.value = e
}
const getTitle = computed(() => (!unref(isUpdate) ? t('合同列表') : t('')));
async function handleSubmit() {
if (!selectedValues.value.length) {
notification.warning({
message: t('提示'),
description: t('请选择合同')
});
return
}
closeModal();
emit('success', selectedValues.value);
}
</script>
<style >
</style>