国际采购
This commit is contained in:
@ -3,16 +3,38 @@ import { defHttp } from '/@/utils/http/axios';
|
|||||||
import { ErrorMessageMode } from '/#/axios';
|
import { ErrorMessageMode } from '/#/axios';
|
||||||
|
|
||||||
enum Api {
|
enum Api {
|
||||||
Page = '/contract/contractPurInt/page',
|
// Page = '/contract/contractPurInt/page',
|
||||||
|
Page = '/magic-api/contract/contractPurInt/page',
|
||||||
List = '/contract/contractPurInt/list',
|
List = '/contract/contractPurInt/list',
|
||||||
Info = '/contract/contractPurInt/info',
|
Info = '/contract/contractPurInt/info',
|
||||||
LngContract = '/contract/contractPurInt',
|
LngContract = '/contract/contractPurInt',
|
||||||
|
queryAllPriceTerm = '/magic-api/mdm/queryAllPriceTerm',
|
||||||
|
queryCom = '/magic-api/mdm/queryCom',
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
export async function getAllCom (mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<LngContractPageResult>(
|
||||||
|
{
|
||||||
|
url: Api.queryCom,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export async function getAllPriceTerm (mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<LngContractPageResult>(
|
||||||
|
{
|
||||||
|
url: Api.queryAllPriceTerm,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @description: 查询LngContract分页列表
|
* @description: 查询LngContract分页列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -30,11 +30,11 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<a-form-item v-if="_action === 'reject'" label="退回至" name="rejectNode">
|
<!-- <a-form-item v-if="_action === 'reject'" label="退回至" name="rejectNode">
|
||||||
<a-select v-model:value="rejectNodeId" :disabled="loading">
|
<a-select v-model:value="rejectNodeId" :disabled="loading">
|
||||||
<a-select-option v-for="(item, index) in rejectNodeList" :key="index" :value="item.activityId">{{ item.activityName }}</a-select-option>
|
<a-select-option v-for="(item, index) in rejectNodeList" :key="index" :value="item.activityId">{{ item.activityName }}</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item> -->
|
||||||
<template v-for="node in rejectNodeList" :key="node.activityId">
|
<template v-for="node in rejectNodeList" :key="node.activityId">
|
||||||
<a-form-item required v-if="_action === 'reject' && rejectNodeId === node.activityId" label="审批人">
|
<a-form-item required v-if="_action === 'reject' && rejectNodeId === node.activityId" label="审批人">
|
||||||
<a-select
|
<a-select
|
||||||
@ -258,9 +258,9 @@
|
|||||||
}
|
}
|
||||||
if (_action.value === 'reject') {
|
if (_action.value === 'reject') {
|
||||||
const isChoose = rejectNodeList.value.find((node) => node.activityId == rejectNodeId.value && node.assignees?.length);
|
const isChoose = rejectNodeList.value.find((node) => node.activityId == rejectNodeId.value && node.assignees?.length);
|
||||||
if (!isChoose) {
|
// if (!isChoose) {
|
||||||
return message.error('请选择审批人');
|
// return message.error('请选择审批人');
|
||||||
}
|
// }
|
||||||
if (!formState.opinion) {
|
if (!formState.opinion) {
|
||||||
return message.error('请填写审批意见');
|
return message.error('请填写审批意见');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,15 +19,12 @@
|
|||||||
const codeFormSchema: FormSchema[] = [
|
const codeFormSchema: FormSchema[] = [
|
||||||
{ field: 'kName', label: '合同号/名称', component: 'Input'},
|
{ field: 'kName', label: '合同号/名称', component: 'Input'},
|
||||||
{
|
{
|
||||||
field: 'relTypeCode',
|
field: 'dateFrom',
|
||||||
label: '关联类别',
|
label: '有效期',
|
||||||
component: 'XjrSelect',
|
component: 'RangePicker',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
datasourceType: 'dic',
|
format: 'YYYY-MM-DD',
|
||||||
params: { itemId: '2003815292742479874' },
|
style: { width: '100%' },
|
||||||
labelField: 'name',
|
|
||||||
valueField: 'value',
|
|
||||||
|
|
||||||
getPopupContainer: () => document.body,
|
getPopupContainer: () => document.body,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -36,7 +33,9 @@
|
|||||||
const columns: BasicColumn[] = [
|
const columns: BasicColumn[] = [
|
||||||
{ title: t('合同号'), dataIndex: 'kNo', },
|
{ title: t('合同号'), dataIndex: 'kNo', },
|
||||||
{ title: t('合同名称'), dataIndex: 'kName', },
|
{ title: t('合同名称'), dataIndex: 'kName', },
|
||||||
{ title: t('关联类别'), dataIndex: 'relTypeName', },
|
{ dataIndex: 'periodTypeName', title: '合同期限', width: 120},
|
||||||
|
{ dataIndex: 'dateFrom', title: '有效期开始', width: 120,},
|
||||||
|
{ dataIndex: 'dateTo', title: '有效期结束', width: 120},
|
||||||
{ title: t('合同类别'), dataIndex: 'kTypeName1', },
|
{ title: t('合同类别'), dataIndex: 'kTypeName1', },
|
||||||
{ title: t('承办人'), dataIndex: 'empName' ,},
|
{ title: t('承办人'), dataIndex: 'empName' ,},
|
||||||
{ title: t('承办部门'), dataIndex: 'bDeptName' ,},
|
{ title: t('承办部门'), dataIndex: 'bDeptName' ,},
|
||||||
@ -72,6 +71,7 @@
|
|||||||
formConfig: {
|
formConfig: {
|
||||||
labelCol:{span: 9, offSet:10},
|
labelCol:{span: 9, offSet:10},
|
||||||
schemas: codeFormSchema,
|
schemas: codeFormSchema,
|
||||||
|
fieldMapToTime: [['dateFrom', ['startDate', 'endDate'], 'YYYY-MM-DD']],
|
||||||
showResetButton: true,
|
showResetButton: true,
|
||||||
},
|
},
|
||||||
immediate: false, // 设置为不立即调用
|
immediate: false, // 设置为不立即调用
|
||||||
@ -120,4 +120,14 @@
|
|||||||
position: inherit !important;
|
position: inherit !important;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
:deep( .ant-col-8:nth-child(2)) {
|
||||||
|
width: 360px !important;
|
||||||
|
max-width: 360px !important;;
|
||||||
|
}
|
||||||
|
:deep(.ant-col-8:nth-child(2) .ant-form-item-label) {
|
||||||
|
width: 80px !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'operation'">
|
<template v-if="column.dataIndex === 'operation'">
|
||||||
<a style="margin-right: 10px" @click="btnCheck('view', record, index)">查看</a>
|
<a style="margin-right: 10px" @click="btnCheck('view', record, index)">查看</a>
|
||||||
<a v-if="!disabled" style="margin-right: 10px" @click="btnCheck('delete', record, index)">删除</a>
|
<a v-if="!disabled" style="margin-right: 10px" @click="btnCheck('delete', record, index)">取消关联</a>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'operation'">
|
<template v-if="column.dataIndex === 'operation'">
|
||||||
<a style="margin-right: 10px" @click="btnCheck('view', record, index)">查看</a>
|
<a style="margin-right: 10px" @click="btnCheck('view', record, index)">查看</a>
|
||||||
<a v-if="!disabled" style="margin-right: 10px" @click="btnCheck('delete', record, index)">删除</a>
|
<a v-if="!disabled" style="margin-right: 10px" @click="btnCheck('delete', record, index)">取消关联</a>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
|
|||||||
@ -6,29 +6,40 @@ export const formConfig = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const searchFormSchema: FormSchema[] = [
|
export const searchFormSchema: FormSchema[] = [
|
||||||
|
{
|
||||||
|
field: 'dateFrom',
|
||||||
|
label: '有效期',
|
||||||
|
component: 'RangePicker',
|
||||||
|
componentProps: {
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
style: { width: '100%' },
|
||||||
|
getPopupContainer: () => document.body,
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'kName',
|
field: 'kName',
|
||||||
label: '合同号/名称',
|
label: '合同号/名称',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'relTypeCode',
|
field: 'comId',
|
||||||
label: '关联类别',
|
label: '合同主体',
|
||||||
component: 'XjrSelect',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
datasourceType: 'dic',
|
showSearch: true,
|
||||||
params: { itemId: '2003815292742479874' },
|
optionFilterProp: 'label',
|
||||||
labelField: 'name',
|
filterOption: (input: string, option: any) => {
|
||||||
valueField: 'value',
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
|
},
|
||||||
|
options: [
|
||||||
|
// { label: '全部', value: '' },
|
||||||
|
],
|
||||||
|
placeholder: '请选择',
|
||||||
|
allowClear: true,
|
||||||
|
|
||||||
getPopupContainer: () => document.body,
|
getPopupContainer: () => document.body,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
field: 'comId',
|
|
||||||
label: '合同主体',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
field: 'approCode',
|
field: 'approCode',
|
||||||
label: '审批状态',
|
label: '审批状态',
|
||||||
|
|||||||
@ -52,12 +52,12 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="有效期开始" name="dateFrom">
|
<a-form-item label="有效期开始" name="dateFrom">
|
||||||
<a-date-picker v-model:value="formState.dateFrom" style="width: 100%" :disabled="isDisable" :disabled-date="disabledDateStart" placeholder="请选择开始日期" />
|
<a-date-picker v-model:value="formState.dateFrom" style="width: 100%" @change="dateChange(formState.dateFrom, 'dateFrom')" :disabled="isDisable" :disabled-date="disabledDateStart" placeholder="请选择开始日期" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="有效期结束" name="dateTo">
|
<a-form-item label="有效期结束" name="dateTo">
|
||||||
<a-date-picker v-model:value="formState.dateTo" style="width: 100%" :disabled="isDisable" :disabled-date="disabledDateEnd" placeholder="请选择结束日期" />
|
<a-date-picker v-model:value="formState.dateTo" style="width: 100%" @change="dateChange(formState.dateTo, 'dateTo')" :disabled="isDisable" :disabled-date="disabledDateEnd" placeholder="请选择结束日期" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
@ -452,6 +452,12 @@
|
|||||||
if (!val) return
|
if (!val) return
|
||||||
formState.amountCn = amountToChinese(Number(val)*10000)
|
formState.amountCn = amountToChinese(Number(val)*10000)
|
||||||
}
|
}
|
||||||
|
const dateChange = (val, k) => {
|
||||||
|
if (!val) {
|
||||||
|
k=='dateFrom' && (formState.dateFrom = null)
|
||||||
|
k=='dateTo' && (formState.dateTo = null)
|
||||||
|
}
|
||||||
|
}
|
||||||
const disabledDateStart = (startValue) => {
|
const disabledDateStart = (startValue) => {
|
||||||
const endValue = formState?.dateTo;
|
const endValue = formState?.dateTo;
|
||||||
if (!startValue || !endValue) {
|
if (!startValue || !endValue) {
|
||||||
|
|||||||
@ -52,6 +52,7 @@
|
|||||||
import ApprovalProcess from '/@/views/workflow/task/components/ApprovalProcess.vue';
|
import ApprovalProcess from '/@/views/workflow/task/components/ApprovalProcess.vue';
|
||||||
import { getDraftInfo } from '/@/api/workflow/process';
|
import { getDraftInfo } from '/@/api/workflow/process';
|
||||||
import { isValidJSON } from '/@/utils/event/design';
|
import { isValidJSON } from '/@/utils/event/design';
|
||||||
|
import { getAllCom } from '/@/api/contract/ContractPurInt';
|
||||||
|
|
||||||
import ContractFactModal from './components/ContractFactModal.vue';
|
import ContractFactModal from './components/ContractFactModal.vue';
|
||||||
import {formConfig, searchFormSchema, columns } from './components/config';
|
import {formConfig, searchFormSchema, columns } from './components/config';
|
||||||
@ -79,7 +80,7 @@
|
|||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
//所有按钮
|
//所有按钮
|
||||||
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true,"type":"primary"},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"审批","code":"approve","icon":"ant-design:check-outlined","isDefault":false,"isUse":true},{"name":"变更","code":"update","icon":"ant-design:edit-filled","isDefault":false,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]);
|
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true,"type":"primary"},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"审批","code":"approve","icon":"ant-design:check-outlined","isDefault":false,"isUse":true},{"name":"变更","code":"update","icon":"ant-design:edit-filled","isDefault":false,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true},{"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true,"isUse":true},]);
|
||||||
//展示在列表内的按钮
|
//展示在列表内的按钮
|
||||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete','update', 'startwork','flowRecord','approve']);
|
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete','update', 'startwork','flowRecord','approve']);
|
||||||
const buttonConfigs = computed(()=>{
|
const buttonConfigs = computed(()=>{
|
||||||
@ -94,7 +95,7 @@
|
|||||||
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
||||||
});
|
});
|
||||||
|
|
||||||
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete,update: handleUpdate, approve: handleApprove}
|
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete,update: handleUpdate, approve: handleApprove,datalog : handleDatalog}
|
||||||
|
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -127,7 +128,7 @@
|
|||||||
gutter: 16,
|
gutter: 16,
|
||||||
},
|
},
|
||||||
schemas: customSearchFormSchema,
|
schemas: customSearchFormSchema,
|
||||||
fieldMapToTime: [],
|
fieldMapToTime: [['dateFrom', ['startDate', 'endDate'], 'YYYY-MM-DD']],
|
||||||
showResetButton: true,
|
showResetButton: true,
|
||||||
},
|
},
|
||||||
beforeFetch: (params) => {
|
beforeFetch: (params) => {
|
||||||
@ -324,8 +325,18 @@
|
|||||||
dbClickRow(record);
|
dbClickRow(record);
|
||||||
|
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
|
let res = await getAllCom() || []
|
||||||
|
customSearchFormSchema.value.forEach(v => {
|
||||||
|
if (v.field == 'comId') {
|
||||||
|
v.componentProps.options = res.map(v=> {
|
||||||
|
return {
|
||||||
|
label: v.name,
|
||||||
|
value: v.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
if (schemaIdComputedRef.value) {
|
if (schemaIdComputedRef.value) {
|
||||||
bus.on(FLOW_PROCESSED, handleRefresh);
|
bus.on(FLOW_PROCESSED, handleRefresh);
|
||||||
bus.on(CREATE_FLOW, handleRefresh);
|
bus.on(CREATE_FLOW, handleRefresh);
|
||||||
@ -352,7 +363,7 @@
|
|||||||
let approveBtn: ActionItem[] = [];
|
let approveBtn: ActionItem[] = [];
|
||||||
let hasFlowRecord = false;
|
let hasFlowRecord = false;
|
||||||
actionButtonConfig.value?.map((button) => {
|
actionButtonConfig.value?.map((button) => {
|
||||||
if (['view', 'copyData', 'enable', 'disable'].includes(button.code)) {
|
if (['view', 'copyData', 'enable', 'disable', 'datalog'].includes(button.code)) {
|
||||||
actionsList.push({
|
actionsList.push({
|
||||||
icon: button?.icon,
|
icon: button?.icon,
|
||||||
tooltip: button?.name,
|
tooltip: button?.name,
|
||||||
@ -504,4 +515,22 @@
|
|||||||
.hide{
|
.hide{
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep( .ant-col-8:nth-child(1)) {
|
||||||
|
width: 320px !important;
|
||||||
|
max-width: 320px !important;;
|
||||||
|
}
|
||||||
|
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
|
||||||
|
width: 80px !important;
|
||||||
|
}
|
||||||
|
:deep( .ant-col-8:nth-child(4)) {
|
||||||
|
width: 320px !important;
|
||||||
|
max-width: 320px !important;;
|
||||||
|
}
|
||||||
|
:deep(.ant-col-8:nth-child(4) .ant-form-item-label) {
|
||||||
|
width: 80px !important;
|
||||||
|
}
|
||||||
|
:deep(.ant-col-8:nth-child(3) .ant-select-selector) {
|
||||||
|
width: 172px !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -6,6 +6,16 @@ export const formConfig = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const searchFormSchema: FormSchema[] = [
|
export const searchFormSchema: FormSchema[] = [
|
||||||
|
{
|
||||||
|
field: 'dateFrom',
|
||||||
|
label: '有效期',
|
||||||
|
component: 'RangePicker',
|
||||||
|
componentProps: {
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
style: { width: '100%' },
|
||||||
|
getPopupContainer: () => document.body,
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'kName',
|
field: 'kName',
|
||||||
label: '合同号/名称',
|
label: '合同号/名称',
|
||||||
@ -16,6 +26,51 @@ export const searchFormSchema: FormSchema[] = [
|
|||||||
label: '供应商',
|
label: '供应商',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'longSpotCode',
|
||||||
|
label: '长协现货',
|
||||||
|
component: 'XjrSelect',
|
||||||
|
componentProps: {
|
||||||
|
datasourceType: 'dic',
|
||||||
|
params: { itemId: '2018871666841546754' },
|
||||||
|
labelField: 'name',
|
||||||
|
valueField: 'value',
|
||||||
|
|
||||||
|
getPopupContainer: () => document.body,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'comId',
|
||||||
|
label: '合同主体',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
showSearch: true,
|
||||||
|
optionFilterProp: 'label',
|
||||||
|
filterOption: (input: string, option: any) => {
|
||||||
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
|
},
|
||||||
|
options: [
|
||||||
|
// { label: '全部', value: '' },
|
||||||
|
],
|
||||||
|
placeholder: '请选择',
|
||||||
|
allowClear: true,
|
||||||
|
|
||||||
|
getPopupContainer: () => document.body,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'approCode',
|
||||||
|
label: '审批状态',
|
||||||
|
component: 'XjrSelect',
|
||||||
|
componentProps: {
|
||||||
|
datasourceType: 'dic',
|
||||||
|
params: { itemId: '1990669393069129729' },
|
||||||
|
labelField: 'name',
|
||||||
|
valueField: 'value',
|
||||||
|
|
||||||
|
getPopupContainer: () => document.body,
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
@ -25,7 +80,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '合同号',
|
title: '合同号',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width:150,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -39,7 +94,7 @@ export const columns: BasicColumn[] = [
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'cpCode',
|
dataIndex: 'cpName',
|
||||||
title: '供应商',
|
title: '供应商',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
@ -52,7 +107,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '有效期开始',
|
title: '有效期开始',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -61,30 +116,30 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '有效期结束',
|
title: '有效期结束',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'approCode',
|
dataIndex: 'approName',
|
||||||
title: '状态',
|
title: '状态',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 100,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'ruleUserId',
|
dataIndex: 'longSpotName',
|
||||||
title: '长协/现货',
|
title: '长协/现货',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 100,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'comId',
|
dataIndex: 'comName',
|
||||||
title: '合同主体',
|
title: '合同主体',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|||||||
718
src/views/contract/ContractPurInt/components/createForm.vue
Normal file
718
src/views/contract/ContractPurInt/components/createForm.vue
Normal file
@ -0,0 +1,718 @@
|
|||||||
|
<template>
|
||||||
|
<a-spin :spinning="spinning" tip="加载中...">
|
||||||
|
<div class="page-bg-wrap formViewStyle">
|
||||||
|
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
|
||||||
|
<Card title="合同档案" :bordered="false" >
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="合同号" name="kNo">
|
||||||
|
<a-input v-model:value="formState.kNo" :disabled="isDisable" style="width: 65%" /><a-button v-if="!isDisable" type="primary" @click="onContract">关联合同</a-button>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="16">
|
||||||
|
<a-form-item label="合同名称" name="kName" :label-col="{ span: 4 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-input v-model:value="formState.kName" placeholder="请输入合同名称" :disabled="isDisable"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="合同期限" name="kPeriod">
|
||||||
|
<a-select v-model:value="formState.kPeriod" :disabled="isDisable" placeholder="请选择合同期限" style="width: 100%" allow-clear @change="periodTypeCodeChange">
|
||||||
|
<a-select-option v-for="item in optionSelect.kPeriodList" :key="item.code" :value="item.code">
|
||||||
|
{{ item.name }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="有效期开始" name="dateFrom">
|
||||||
|
<a-date-picker v-model:value="formState.dateFrom" style="width: 100%" @change="dateChange(formState.dateFrom, 'dateFrom')" :disabled="isDisable" :disabled-date="disabledDateStart" placeholder="请选择开始日期" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="有效期结束" name="dateTo">
|
||||||
|
<a-date-picker v-model:value="formState.dateTo" style="width: 100%" @change="dateChange(formState.dateTo, 'dateTo')" :disabled="isDisable" :disabled-date="disabledDateEnd" placeholder="请选择结束日期" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="供应商" name="cpName">
|
||||||
|
<a-input-search v-model:value="formState.cpName" :disabled="isDisable" placeholder="请选择供应商" readonly @search="onSearchCustomer"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="业务人员" name="empName">
|
||||||
|
<a-input-search v-model:value="formState.empName" :disabled="isDisable" placeholder="请选择业务联系人" readonly @search="onSearchUser"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="业务部门" name="bDeptName">
|
||||||
|
<a-input-search v-model:value="formState.bDeptName" :disabled="isDisable" placeholder="请选择业务部门" readonly @search="onSearch"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="合同主体" name="comName">
|
||||||
|
<a-input v-model:value="formState.comName" disabled />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="币种" name="curCode">
|
||||||
|
<a-select v-model:value="formState.curCode" :disabled="isDisable" placeholder="请选择币种" style="width: 100%" allow-clear>
|
||||||
|
<a-select-option v-for="item in optionSelect.curCodeList" :key="item.code" :value="item.code">
|
||||||
|
{{ item.fullName }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="状态" name="approCode">
|
||||||
|
<a-select v-model:value="formState.approCode" disabled style="width: 100%" allow-clear>
|
||||||
|
<a-select-option v-for="item in optionSelect.approCodeList" :key="item.code" :value="item.code">
|
||||||
|
{{ item.name }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</Card>
|
||||||
|
<Card title="业务信息" :bordered="false" >
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="长协/现货" name="longSpotCode">
|
||||||
|
<a-select v-model:value="formState.longSpotCode" :disabled="isDisable" placeholder="请选择" style="width: 100%" allow-clear @change="periodTypeCodeChange">
|
||||||
|
<a-select-option v-for="item in optionSelect.longSpotCodeList" :key="item.code" :value="item.code">
|
||||||
|
{{ item.name }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="气源地" name="sourceName">
|
||||||
|
<a-input v-model:value="formState.lngContractPurIntList[0].sourceName" :disabled="isDisable" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="销售区域" name="salesAreaCode">
|
||||||
|
<a-cascader v-model:value="formState.salesAreaCode" :options="options" :load-data="loadData" @change="onChange" change-on-select
|
||||||
|
:field-names="{label: 'fullName', value: 'code', children: 'children'}" placeholder="请选择区域"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="价格条款" name="prcTermCode">
|
||||||
|
<a-select v-model:value="formState.prcTermCode" :disabled="isDisable" placeholder="请选择" style="width: 100%" allow-clear @change="periodTypeCodeChange">
|
||||||
|
<a-select-option v-for="item in optionSelect.prcTermCodeList" :key="item.code" :value="item.code">
|
||||||
|
{{ item.fullName }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="价格说明" name="prcDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.lngContractPurIntList[0].prcDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="信用担保" name="crTermCode">
|
||||||
|
<a-select v-model:value="formState.crTermCode" :disabled="isDisable" placeholder="请选择" style="width: 100%" allow-clear @change="periodTypeCodeChange">
|
||||||
|
<a-select-option v-for="item in optionSelect.crTermCodeList" :key="item.code" :value="item.code">
|
||||||
|
{{ item.name }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="担保说明" name="crDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.lngContractPurIntList[0].crDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="合同量" name="qtyFrom" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-input-number v-model:value="formState.lngContractPurIntList[0].qtyFrom" style="width: 120px" :disabled="isDisable" :precision="3" :min="0" :max="formState.lngContractPurIntList[0].qtyTo ? formState.lngContractPurIntList[0].qtyTo : 999999999999999"/>
|
||||||
|
-
|
||||||
|
<a-input-number v-model:value="formState.lngContractPurIntList[0].qtyTo" style="width: 120px" :disabled="isDisable" :precision="3" :min="formState.lngContractPurIntList[0].qtyFrom ? formState.lngContractPurIntList[0].qtyFrom : 0"></a-input-number>
|
||||||
|
<span>(百万英热)</span>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="合同约定" name="qtyDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.qtyDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="甲烷最低含量" name="specCh4From">
|
||||||
|
<a-input-number v-model:value="formState.specCh4From" :disabled="isDisable" style="width: 100%" :precision="3" :min="0" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="13">
|
||||||
|
<a-form-item label="热值范围" name="specMmbtuFrom">
|
||||||
|
<div class="inputCss">
|
||||||
|
<div> <a-input-number v-model:value="formState.specMmbtuFrom" :disabled="isDisable" :precision="3" :min="0" :max="formState.specMmbtuTo ? formState.specMmbtuTo : 999999999999999"/> </div>
|
||||||
|
<div style="margin: 0 5px">-</div>
|
||||||
|
<a-form-item name="specMmbtuTo">
|
||||||
|
<a-input-number v-model:value="formState.specMmbtuTo" :disabled="isDisable" :precision="3" :min="formState.specMmbtuFrom ? formState.specMmbtuFrom : 0"/>
|
||||||
|
(百万英热/立方英尺)
|
||||||
|
</a-form-item>
|
||||||
|
</div>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="气质约定" name="specDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.lngContractPurIntList[0].specDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="付款日" name="afterInv" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<div style="display: flex;align-items: center;">
|
||||||
|
(收到发票后)
|
||||||
|
<a-input-number v-model:value="formState.lngContractPurIntList[0].afterInv" :disabled="isDisable" :min="0" :precision="0" />
|
||||||
|
<a-select v-model:value="formState.lngContractPurIntList[0].calTypeCode" :disabled="isDisable" placeholder="请选择" allow-clear style="width: 100px;margin-left: 10px;">
|
||||||
|
<a-select-option v-for="item in optionSelect.calTypeCodeList" :key="item.code" :value="item.code">
|
||||||
|
{{ item.name }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</div>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="付款说明" name="paymentDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.paymentDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="装港" name="loadingPort" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-input v-model:value="formState.lngContractPurIntList[0].loadingPort" :disabled="isDisable" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="装港描述" name="loadingPortDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.lngContractPurIntList[0].loadingPortDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="卸港" name="unloadingPort" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-input v-model:value="formState.lngContractPurIntList[0].unloadingPort" :disabled="isDisable" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="卸港描述" name="unloadingPortDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.lngContractPurIntList[0].unloadingPortDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="装卸港条款" name="loadUnloadDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.lngContractPurIntList[0].loadUnloadDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="滞期费说明" name="dmDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.dmDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<div class="tip" @click="tipCheck">{{isExpend ? '其他说明收起' : '其他说明展开'}}</div>
|
||||||
|
<a-row v-show="isExpend">
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="交付说明" name="deliveryDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.lngContractPurIntList[0].deliveryDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="计量说明" name="meaDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.lngContractPurIntList[0].meaDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="保险说明" name="insurDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.lngContractPurIntList[0].insurDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="所有权和风险说明" name="riskDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.lngContractPurIntList[0].riskDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="GT&C" name="gtc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.lngContractPurIntList[0].gtc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="法律仲裁" name="legalDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.lngContractPurIntList[0].legalDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="违约条款" name="defaultDesc" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.lngContractPurIntList[0].defaultDesc" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.lngContractPurIntList[0].note" :disabled="isDisable" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
|
</a-row>
|
||||||
|
</Card>
|
||||||
|
<Card title="附件信息" :bordered="false" >
|
||||||
|
<UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/>
|
||||||
|
</Card>
|
||||||
|
<Card title="关联合同信息" :bordered="false" >
|
||||||
|
<correlationContractFactList :list="dataListContractFact" :disabled="isDisable" @change="getApproContractFactList"></correlationContractFactList>
|
||||||
|
</Card>
|
||||||
|
<Card title="签报列表" :bordered="false" >
|
||||||
|
<correlationApproList :list="dataListAppro" :disabled="isDisable" @change="getApproList"></correlationApproList>
|
||||||
|
</Card>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
<deptUserModal @register="register" @success="handleSuccess"/>
|
||||||
|
<deptListModal @register="registerDept" @success="handleSuccessDept" />
|
||||||
|
<contractFactListModal @register="registerContractFact" @success="handleSuccessContractFact" />
|
||||||
|
<supplierListModal @register="registerSupplier" @success="handleSuccessSupplier" selectType="radio" />
|
||||||
|
</a-spin>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { Card } from 'ant-design-vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import { FromPageType, RecordType } from '/@/enums/workflowEnum';
|
||||||
|
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
|
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||||
|
import useEventBus from '/@/hooks/event/useEventBus';
|
||||||
|
import type { Rule } from 'ant-design-vue/es/form';
|
||||||
|
import { getDictionary } from '/@/api/sales/Customer';
|
||||||
|
import { useModal } from '/@/components/Modal';
|
||||||
|
import { addLngContract,updateLngContract, getLngContract, getAllPriceTerm} from '/@/api/contract/ContractPurInt';
|
||||||
|
import { getAllCurrency } from '/@/api/contract/ContractFact';
|
||||||
|
import { getLngAppro,getCompDept } from '/@/api/approve/Appro';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import { getAppEnvConfig } from '/@/utils/env';
|
||||||
|
import { message } from 'ant-design-vue';
|
||||||
|
import UploadList from '/@/components/Form/src/components/UploadList.vue';
|
||||||
|
import deptUserModal from '/@/components/common/deptUserModal.vue';
|
||||||
|
import deptListModal from '/@/components/common/deptListModal.vue';
|
||||||
|
import correlationApproList from '/@/components/common/correlationApproList.vue';
|
||||||
|
import correlationContractFactList from '/@/components/common/correlationContractFactList.vue';
|
||||||
|
import contractFactListModal from '/@/components/common/contractFactListModal.vue';
|
||||||
|
import supplierListModal from '/@/components/common/supplierListModal.vue';
|
||||||
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
import type { CascaderProps } from 'ant-design-vue';
|
||||||
|
import { getAreaList, getAreaInfo} from '/@/api/mdm/CountryRegion';
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const userInfo = userStore.getUserInfo;
|
||||||
|
|
||||||
|
const tableName = 'ContractPurInt';
|
||||||
|
const columnName = 'ContractPurInt'
|
||||||
|
|
||||||
|
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
||||||
|
const formRef = ref();
|
||||||
|
const props = defineProps({
|
||||||
|
disabled: false,
|
||||||
|
id: ''
|
||||||
|
|
||||||
|
});
|
||||||
|
const { bus, FORM_LIST_MODIFIED } = useEventBus();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { currentRoute } = router;
|
||||||
|
const isDisable = ref(false);
|
||||||
|
const { formPath } = currentRoute.value.query;
|
||||||
|
const pathArr = [];
|
||||||
|
|
||||||
|
const tabStore = useMultipleTabStore();
|
||||||
|
const formProps = ref(null);
|
||||||
|
const formId = ref(currentRoute.value?.params?.id);
|
||||||
|
const pageType = ref(currentRoute.value.query?.type);
|
||||||
|
const pageId = ref(currentRoute.value.query?.id)
|
||||||
|
|
||||||
|
const contractQty = ref()
|
||||||
|
const spinning = ref(false);
|
||||||
|
const curIdx = ref(null)
|
||||||
|
const { notification } = useMessage();
|
||||||
|
const { t } = useI18n();
|
||||||
|
const isExpend=ref(false)
|
||||||
|
|
||||||
|
const formState = reactive({
|
||||||
|
approCode: 'WTJ',
|
||||||
|
typeCode: 'SP',
|
||||||
|
onlineSign: 'N',
|
||||||
|
cpTableName: 'lng_customer',
|
||||||
|
lngContractPurIntList: [{}]
|
||||||
|
});
|
||||||
|
const [register, { openModal:openModal}] = useModal();
|
||||||
|
const [registerDept, { openModal:openModalDept}] = useModal();
|
||||||
|
const [registerContractFact, { openModal:openModalContractFact}] = useModal();
|
||||||
|
const [registerSupplier, { openModal:openModalCustomer}] = useModal();
|
||||||
|
const rules= reactive({
|
||||||
|
kNo: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
kName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
cpName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
curCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
empName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
bDeptName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
dateTo:[{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
dateFrom:[{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
longSpotCode:[{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
prcTermCode:[{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
crTermCode:[{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
qtyDesc:[{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
specCh4From:[{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
specMmbtuFrom:[{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
specMmbtuTo:[{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
paymentDesc:[{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
dmDesc:[{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
});
|
||||||
|
const layout = {
|
||||||
|
labelCol: { span: 8 },
|
||||||
|
wrapperCol: { span: 16 },
|
||||||
|
}
|
||||||
|
const dataFile = ref([]);
|
||||||
|
const dataListAppro = ref([])
|
||||||
|
const dataListContractFact = ref([])
|
||||||
|
let optionSelect= reactive({
|
||||||
|
approCodeList: [],
|
||||||
|
kPeriodList: [],
|
||||||
|
crTermCodeList: [],
|
||||||
|
longSpotCodeList: [],
|
||||||
|
curCodeList: [],
|
||||||
|
prcTermCodeList: [],
|
||||||
|
calTypeCodeList: []
|
||||||
|
});
|
||||||
|
watch(
|
||||||
|
() => props.id,
|
||||||
|
(val) => {
|
||||||
|
if (val) {
|
||||||
|
getInfo(val)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => props.disabled,
|
||||||
|
(val) => {
|
||||||
|
isDisable.value = val
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
onMounted(() => {
|
||||||
|
getOption()
|
||||||
|
if (pageId.value) {
|
||||||
|
getInfo(pageId.value)
|
||||||
|
} else {
|
||||||
|
formState.empName = userInfo.name
|
||||||
|
formState.empId = userInfo.id
|
||||||
|
formState.tel = userInfo.mobile
|
||||||
|
}
|
||||||
|
initialFetch()
|
||||||
|
|
||||||
|
});
|
||||||
|
const options = ref<CascaderProps['options']>([]);
|
||||||
|
|
||||||
|
const loadData: CascaderProps['loadData'] = async (selectedOptions) => {
|
||||||
|
const targetOption = selectedOptions[selectedOptions.length - 1];
|
||||||
|
targetOption.loading = true;
|
||||||
|
try {
|
||||||
|
const res = await getAreaList({pid: targetOption.id, excludeType:'CONTINENT'});
|
||||||
|
|
||||||
|
if (Array.isArray(res)) {
|
||||||
|
const children = (res || []).map(item => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
isLeaf: !item.hasChild,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
targetOption.children = children;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
} finally {
|
||||||
|
targetOption.loading = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
async function initialFetch() {
|
||||||
|
try {
|
||||||
|
const res = await getAreaList({pid: '', excludeType:'CONTINENT'});
|
||||||
|
options.value = (res || []).map(item => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
isLeaf: !item.hasChild,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} catch (error) {}
|
||||||
|
}
|
||||||
|
const onChange = (value, selectedOptions) => {
|
||||||
|
}
|
||||||
|
const getArea = async (val) => {
|
||||||
|
const resData = await getAreaInfo({code: val,excludeType:'CONTINENT' });
|
||||||
|
options.value = resData.areaList
|
||||||
|
formState.salesAreaCode = resData.regionCode
|
||||||
|
}
|
||||||
|
const periodTypeCodeChange = (val) => {
|
||||||
|
if (val !== 'Y') {
|
||||||
|
formState.dateFrom = dayjs('2000-01-01')
|
||||||
|
formState.dateTo = dayjs('2999-12-31')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const uploadListChange = (val) => {
|
||||||
|
dataFile.value = val
|
||||||
|
}
|
||||||
|
async function getInfo(id) {
|
||||||
|
spinning.value = true
|
||||||
|
try {
|
||||||
|
let data = await getLngContract(id)
|
||||||
|
spinning.value = false
|
||||||
|
Object.assign(formState, {...data})
|
||||||
|
Object.assign(dataFile.value, formState.lngFileUploadList || [])
|
||||||
|
Object.assign(dataListContractFact.value, formState.lngContractFactList || [])
|
||||||
|
Object.assign(dataListAppro.value, formState.lngApproVoList || [])
|
||||||
|
formState.dateFrom = formState.dateFrom ? dayjs(formState.dateFrom) : null
|
||||||
|
formState.dateTo = formState.dateTo ? dayjs(formState.dateTo) : null
|
||||||
|
formState.lngContractPurIntList = formState?.lngContractPurIntList || [{}]
|
||||||
|
|
||||||
|
formState.longSpotCode = (formState?.lngContractPurIntList[0] || {}).longSpotCode
|
||||||
|
formState.prcTermCode = (formState?.lngContractPurIntList[0] || {}).prcTermCode
|
||||||
|
formState.crTermCode = (formState?.lngContractPurIntList[0] || {}).crTermCode
|
||||||
|
formState.qtyDesc = (formState?.lngContractPurIntList[0] || {}).qtyDesc
|
||||||
|
formState.specCh4From = (formState?.lngContractPurIntList[0] || {}).specCh4From
|
||||||
|
formState.specMmbtuFrom = (formState?.lngContractPurIntList[0] || {}).specMmbtuFrom
|
||||||
|
formState.specMmbtuTo = (formState?.lngContractPurIntList[0] || {}).specMmbtuTo
|
||||||
|
formState.paymentDesc = (formState?.lngContractPurIntList[0] || {}).paymentDesc
|
||||||
|
formState.dmDesc = (formState?.lngContractPurIntList[0] || {}).dmDesc
|
||||||
|
|
||||||
|
if ((formState?.lngContractPurIntList[0] || {}).salesAreaCode) {
|
||||||
|
getArea((formState?.lngContractPurIntList[0] || {}).salesAreaCode)
|
||||||
|
}
|
||||||
|
dataListAppro.value.forEach(v => {
|
||||||
|
v.approId = v.id
|
||||||
|
})
|
||||||
|
dataListContractFact.value.forEach(v => {
|
||||||
|
v.kFactId = v.id
|
||||||
|
})
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error, 'error')
|
||||||
|
spinning.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function getOption() {
|
||||||
|
optionSelect.kPeriodList = await getDictionary('LNG_K_PER')
|
||||||
|
optionSelect.uomCodeList = await getDictionary('LNG_UOM')
|
||||||
|
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
||||||
|
optionSelect.curCodeList = await getAllCurrency()
|
||||||
|
optionSelect.prcTermCodeList = await getAllPriceTerm()
|
||||||
|
|
||||||
|
optionSelect.longSpotCodeList = await getDictionary('LNG_LONG')
|
||||||
|
optionSelect.crTermCodeList = await getDictionary('LNG_CREDIT')
|
||||||
|
optionSelect.calTypeCodeList = await getDictionary('LNG_CAL')
|
||||||
|
|
||||||
|
|
||||||
|
if (!pageId.value) {
|
||||||
|
const res = await getCompDept(userInfo.id)
|
||||||
|
formState.bDeptName = res?.dept?.name
|
||||||
|
formState.bDeptId = res?.dept?.id
|
||||||
|
|
||||||
|
formState.comName = res?.comp?.name
|
||||||
|
formState.comId = res?.comp?.id
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
const tipCheck = () => {
|
||||||
|
isExpend.value = !isExpend.value
|
||||||
|
}
|
||||||
|
const getApproList = (val) => {
|
||||||
|
dataListAppro.value = val
|
||||||
|
}
|
||||||
|
const getApproContractFactList = (val) => {
|
||||||
|
dataListContractFact.value = val
|
||||||
|
}
|
||||||
|
const dateChange = (val, k) => {
|
||||||
|
if (!val) {
|
||||||
|
k=='dateFrom' && (formState.dateFrom = null)
|
||||||
|
k=='dateTo' && (formState.dateTo = null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const disabledDateStart = (startValue) => {
|
||||||
|
const endValue = formState?.dateTo;
|
||||||
|
if (!startValue || !endValue) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return startValue.valueOf() >= endValue.valueOf();
|
||||||
|
}
|
||||||
|
const disabledDateEnd = (endValue) => {
|
||||||
|
const startValue = formState?.dateFrom;
|
||||||
|
if (!endValue || !startValue) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return endValue.valueOf() <= startValue.valueOf();
|
||||||
|
}
|
||||||
|
const onSearch = (val)=> {
|
||||||
|
openModalDept(true,{isUpdate: false})
|
||||||
|
}
|
||||||
|
const onSearchCustomer = () => {
|
||||||
|
openModalCustomer(true,{isUpdate: false})
|
||||||
|
}
|
||||||
|
const onSearchUser = (val)=> {
|
||||||
|
openModal(true,{isUpdate: false})
|
||||||
|
}
|
||||||
|
const onContract = (val)=> {
|
||||||
|
openModalContractFact(true,{isUpdate: false})
|
||||||
|
}
|
||||||
|
const handleSuccess = (val) => {
|
||||||
|
formState.empName = val[0].name
|
||||||
|
formState.empId = val[0].id
|
||||||
|
formState.tel = val[0].mobile
|
||||||
|
}
|
||||||
|
const handleSuccessDept = (val, info) => {
|
||||||
|
formState.bDeptName = val[0].name
|
||||||
|
formState.bDeptId = val[0].id
|
||||||
|
|
||||||
|
formState.comName = info.name
|
||||||
|
formState.comId = info.id
|
||||||
|
}
|
||||||
|
const handleSuccessSupplier = (val) => {
|
||||||
|
formState.cpCode = val[0].suCode
|
||||||
|
formState.cpName = val[0].suName
|
||||||
|
}
|
||||||
|
const handleSuccessContractFact = (val) => {
|
||||||
|
val.forEach(v => {
|
||||||
|
v.kFactId = v.id
|
||||||
|
v.id = null
|
||||||
|
})
|
||||||
|
if (!dataListContractFact.value.length) {
|
||||||
|
dataListContractFact.value = val
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let arr = []
|
||||||
|
val.forEach(v => {
|
||||||
|
dataListContractFact.value.forEach(i => {
|
||||||
|
if (v.kNo == i.kNo){
|
||||||
|
message.warning(v.kNo + '已重复, 合同不需要重复选择')
|
||||||
|
} else {
|
||||||
|
arr.push(v)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
dataListContractFact.value = unique([...dataListContractFact.value, ...arr], 'kNo')
|
||||||
|
}
|
||||||
|
function unique(arr, u_key) {
|
||||||
|
const map = new Map()
|
||||||
|
arr.forEach((item, index) => {
|
||||||
|
if (!map.has(item[u_key])) {
|
||||||
|
map.set(item[u_key], item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return [...map.values()]
|
||||||
|
}
|
||||||
|
function close() {
|
||||||
|
tabStore.closeTab(currentRoute.value, router);
|
||||||
|
}
|
||||||
|
async function getFormValue() {
|
||||||
|
return formState
|
||||||
|
}
|
||||||
|
async function handleSubmit(type) {
|
||||||
|
try {
|
||||||
|
await formRef.value.validateFields();
|
||||||
|
dataListAppro.value.forEach((v,idx)=>{
|
||||||
|
v.tableName = 'Ing_contract'
|
||||||
|
v.sort = idx
|
||||||
|
})
|
||||||
|
dataListContractFact.value.forEach((v,idx)=> {
|
||||||
|
v.sort = idx
|
||||||
|
})
|
||||||
|
|
||||||
|
let obj = {
|
||||||
|
...formState,
|
||||||
|
lngFileUploadList: dataFile.value,
|
||||||
|
lngContractFactRelList: dataListContractFact.value,
|
||||||
|
lngContractApproRelList: dataListAppro.value,
|
||||||
|
lngContractPurIntList: [
|
||||||
|
{
|
||||||
|
...formState.lngContractPurIntList[0],
|
||||||
|
"kId": formState.id,
|
||||||
|
"longSpotCode": formState.longSpotCode,
|
||||||
|
"prcTermCode": formState.prcTermCode,
|
||||||
|
"crTermCode": formState.crTermCode,
|
||||||
|
'qtyDesc': formState.qtyDesc,
|
||||||
|
'specCh4From': formState.specCh4From,
|
||||||
|
specMmbtuFrom: formState.specMmbtuFrom,
|
||||||
|
specMmbtuTo: formState.specMmbtuTo,
|
||||||
|
paymentDesc: formState.paymentDesc,
|
||||||
|
dmDesc: formState.dmDesc,
|
||||||
|
salesAreaCode: formState.salesAreaCode ? formState.salesAreaCode[formState.salesAreaCode.length -1] : ''
|
||||||
|
}
|
||||||
|
],
|
||||||
|
salesAreaCode: '',
|
||||||
|
approCode: pageType.value=='update' ? 'WTJ' : formState.approCode
|
||||||
|
|
||||||
|
}
|
||||||
|
spinning.value = true;
|
||||||
|
let request = !formState.id ? addLngContract :updateLngContract
|
||||||
|
|
||||||
|
try {
|
||||||
|
const data = await request(obj);
|
||||||
|
// 新增保存
|
||||||
|
if (data?.id) {
|
||||||
|
getInfo(data?.id)
|
||||||
|
}
|
||||||
|
// 同意保存不提示
|
||||||
|
if (!type) {
|
||||||
|
notification.success({
|
||||||
|
message: 'Tip',
|
||||||
|
description: data?.id ? t('新增成功!') : t('修改成功!')
|
||||||
|
}); //提示消息
|
||||||
|
}
|
||||||
|
return data?.id ? data : obj
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
spinning.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (errorInfo) {
|
||||||
|
console.log(errorInfo, 'errorInfo')
|
||||||
|
spinning.value = false;
|
||||||
|
errorInfo?.errorFields?.length && notification.warning({
|
||||||
|
message: 'Tip',
|
||||||
|
description: '请完善信息'
|
||||||
|
});
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
handleSubmit,
|
||||||
|
getFormValue
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
:deep(.ant-form-item .ant-form-item-label) {
|
||||||
|
width: 135px !important;
|
||||||
|
max-width: 135px !important;
|
||||||
|
}
|
||||||
|
.page-bg-wrap {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-toolbar {
|
||||||
|
min-height: 44px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
.inputCss {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: -24px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.tip {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
color: #5e95ff;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -34,7 +34,7 @@
|
|||||||
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';
|
||||||
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||||
import { getLngContractPage, deleteLngContract} from '/@/api/contract/ContractPurInt';
|
import { getLngContractPage, deleteLngContract, getAllCom} from '/@/api/contract/ContractPurInt';
|
||||||
import { PageWrapper } from '/@/components/Page';
|
import { PageWrapper } from '/@/components/Page';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
@ -57,6 +57,9 @@
|
|||||||
|
|
||||||
import useEventBus from '/@/hooks/event/useEventBus';
|
import useEventBus from '/@/hooks/event/useEventBus';
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const userInfo = userStore.getUserInfo;
|
||||||
|
|
||||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||||
|
|
||||||
@ -72,7 +75,7 @@
|
|||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
//所有按钮
|
//所有按钮
|
||||||
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true, "type":"primary"},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"变更","code":"update","icon":"ant-design:edit-filled","isDefault":true,"isUse":true},{"name":"审批","code":"approve","icon":"ant-design:check-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]);
|
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true, "type":"primary"},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"变更","code":"update","icon":"ant-design:edit-filled","isDefault":true,"isUse":true},{"name":"审批","code":"approve","icon":"ant-design:check-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true},{"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true,"isUse":true}]);
|
||||||
//展示在列表内的按钮
|
//展示在列表内的按钮
|
||||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord', 'update', 'approve']);
|
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord', 'update', 'approve']);
|
||||||
const buttonConfigs = computed(()=>{
|
const buttonConfigs = computed(()=>{
|
||||||
@ -87,7 +90,7 @@
|
|||||||
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
||||||
});
|
});
|
||||||
|
|
||||||
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,update : handleUpdate,approve : handleApprove,delete : handleDelete,}
|
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,update : handleUpdate,approve : handleApprove,delete : handleDelete,datalog : handleDatalog}
|
||||||
|
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -119,7 +122,7 @@
|
|||||||
gutter: 16,
|
gutter: 16,
|
||||||
},
|
},
|
||||||
schemas: customSearchFormSchema,
|
schemas: customSearchFormSchema,
|
||||||
fieldMapToTime: [],
|
fieldMapToTime: [['dateFrom', ['startDate', 'endDate'], 'YYYY-MM-DD']],
|
||||||
showResetButton: true,
|
showResetButton: true,
|
||||||
},
|
},
|
||||||
beforeFetch: (params) => {
|
beforeFetch: (params) => {
|
||||||
@ -157,7 +160,9 @@
|
|||||||
query: {
|
query: {
|
||||||
taskId: taskIds[0],
|
taskId: taskIds[0],
|
||||||
formName: formName,
|
formName: formName,
|
||||||
formId:currentRoute.value.meta.formId
|
formId:currentRoute.value.meta.formId,
|
||||||
|
id: record.id,
|
||||||
|
readonly: 1,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (schemaId && !taskIds && processId) {
|
} else if (schemaId && !taskIds && processId) {
|
||||||
@ -167,19 +172,33 @@
|
|||||||
readonly: 1,
|
readonly: 1,
|
||||||
taskId: '',
|
taskId: '',
|
||||||
formName: formName,
|
formName: formName,
|
||||||
formId:currentRoute.value.meta.formId
|
formId:currentRoute.value.meta.formId,
|
||||||
|
id: record.id,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
if (schemaIdComputedRef.value) {
|
||||||
router.push({
|
router.push({
|
||||||
path: '/form/ContractPurInt/' + record.id + '/viewForm',
|
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||||
query: {
|
query: {
|
||||||
formPath: 'contract/ContractPurInt',
|
formPath: 'contract/ContractPurInt',
|
||||||
formName: formName,
|
formName: "查看"+formName,
|
||||||
formId:currentRoute.value.meta.formId
|
formId:currentRoute.value.meta.formId,
|
||||||
|
type:'edit',
|
||||||
|
id: record.id,
|
||||||
|
disabled: 1,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// router.push({
|
||||||
|
// path: '/form/ContractPurInt/' + record.id + '/viewForm',
|
||||||
|
// query: {
|
||||||
|
// formPath: 'contract/ContractPurInt',
|
||||||
|
// formName: formName,
|
||||||
|
// formId:currentRoute.value.meta.formId
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function buttonClick(code) {
|
function buttonClick(code) {
|
||||||
@ -194,7 +213,11 @@
|
|||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
if (schemaIdComputedRef.value) {
|
if (schemaIdComputedRef.value) {
|
||||||
router.push({
|
router.push({
|
||||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow'
|
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||||
|
query: {
|
||||||
|
formPath: 'contract/ContractPurInt',
|
||||||
|
formName: "新建"+formName,
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
router.push({
|
router.push({
|
||||||
@ -209,7 +232,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleEdit(record: Recordable) {
|
function handleEdit(record: Recordable) {
|
||||||
|
if (schemaIdComputedRef.value) {
|
||||||
|
router.push({
|
||||||
|
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||||
|
query: {
|
||||||
|
formPath: 'contract/ContractPurInt',
|
||||||
|
formName: "编辑"+formName,
|
||||||
|
formId:currentRoute.value.meta.formId,
|
||||||
|
type:'edit',
|
||||||
|
id: record.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
router.push({
|
router.push({
|
||||||
path: '/form/ContractPurInt/' + record.id + '/updateForm',
|
path: '/form/ContractPurInt/' + record.id + '/updateForm',
|
||||||
query: {
|
query: {
|
||||||
@ -219,11 +253,36 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function handleUpdate(record: Recordable) {
|
function handleUpdate(record: Recordable) {
|
||||||
|
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||||
|
if (schemaIdComputedRef.value) {
|
||||||
|
router.push({
|
||||||
|
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||||
|
query: {
|
||||||
|
formPath: 'contract/ContractPurInt',
|
||||||
|
formName: "变更"+formName,
|
||||||
|
formId:currentRoute.value.meta.formId,
|
||||||
|
type:'update',
|
||||||
|
id: record.id,
|
||||||
|
processId: processId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function handleApprove(record: Recordable) {
|
function handleApprove(record: Recordable) {
|
||||||
|
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||||
|
if (taskIds && taskIds.length) {
|
||||||
|
router.push({
|
||||||
|
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||||
|
query: {
|
||||||
|
taskId: taskIds[0],
|
||||||
|
formName: "审批"+formName,
|
||||||
|
formId:currentRoute.value.meta.formId,
|
||||||
|
id: record.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function handleDelete(record: Recordable) {
|
function handleDelete(record: Recordable) {
|
||||||
deleteList([record.id]);
|
deleteList([record.id]);
|
||||||
@ -260,7 +319,18 @@
|
|||||||
dbClickRow(record);
|
dbClickRow(record);
|
||||||
|
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
|
let res = await getAllCom() || []
|
||||||
|
customSearchFormSchema.value.forEach(v => {
|
||||||
|
if (v.field == 'comId') {
|
||||||
|
v.componentProps.options = res.map(v=> {
|
||||||
|
return {
|
||||||
|
label: v.name,
|
||||||
|
value: v.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (schemaIdComputedRef.value) {
|
if (schemaIdComputedRef.value) {
|
||||||
bus.on(FLOW_PROCESSED, handleRefresh);
|
bus.on(FLOW_PROCESSED, handleRefresh);
|
||||||
@ -284,9 +354,11 @@
|
|||||||
|
|
||||||
let actionsList: ActionItem[] = [];
|
let actionsList: ActionItem[] = [];
|
||||||
let editAndDelBtn: ActionItem[] = [];
|
let editAndDelBtn: ActionItem[] = [];
|
||||||
|
let updateBtn: ActionItem[] = [];
|
||||||
|
let approveBtn: ActionItem[] = [];
|
||||||
let hasFlowRecord = false;
|
let hasFlowRecord = false;
|
||||||
actionButtonConfig.value?.map((button) => {
|
actionButtonConfig.value?.map((button) => {
|
||||||
if (['view', 'copyData'].includes(button.code)) {
|
if (['view', 'copyData','datalog'].includes(button.code)) {
|
||||||
actionsList.push({
|
actionsList.push({
|
||||||
icon: button?.icon,
|
icon: button?.icon,
|
||||||
tooltip: button?.name,
|
tooltip: button?.name,
|
||||||
@ -301,21 +373,54 @@
|
|||||||
onClick: btnEvent[button.code].bind(null, record),
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (['update'].includes(button.code)) {
|
||||||
|
updateBtn.push({
|
||||||
|
icon: button?.icon,
|
||||||
|
tooltip: button?.name,
|
||||||
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (['approve'].includes(button.code)) {
|
||||||
|
approveBtn.push({
|
||||||
|
icon: button?.icon,
|
||||||
|
tooltip: button?.name,
|
||||||
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
|
});
|
||||||
|
}
|
||||||
if (button.code === 'flowRecord') hasFlowRecord = true;
|
if (button.code === 'flowRecord') hasFlowRecord = true;
|
||||||
});
|
});
|
||||||
if (record.workflowData?.enabled) {
|
|
||||||
//与工作流有关联的表单
|
// 未提交或已驳回
|
||||||
if (record.workflowData.status) {
|
if (record.approCode == 'WTJ' || record.approCode == 'YBH' ) {
|
||||||
actionsList.unshift(setIndexFlowStatus(record.workflowData))
|
|
||||||
} else {
|
|
||||||
actionsList = actionsList.concat(editAndDelBtn);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!record.workflowData?.processId) {
|
|
||||||
//与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上
|
|
||||||
actionsList = actionsList.concat(editAndDelBtn);
|
actionsList = actionsList.concat(editAndDelBtn);
|
||||||
|
|
||||||
|
if (record.createUserId !== userInfo.id) {
|
||||||
|
let idx = actionsList.findIndex(v =>v.tooltip == '删除')
|
||||||
|
idx > -1 && actionsList.splice(idx, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 审批中SPZ
|
||||||
|
if (record.workflowData?.editable) {
|
||||||
|
actionsList = actionsList.concat(approveBtn);
|
||||||
|
}
|
||||||
|
// 已审批
|
||||||
|
if (record.approCode == 'YSP') {
|
||||||
|
actionsList = actionsList.concat(updateBtn);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (record.workflowData?.enabled) {
|
||||||
|
// //与工作流有关联的表单
|
||||||
|
// if (record.workflowData.status) {
|
||||||
|
// actionsList.unshift(setIndexFlowStatus(record.workflowData))
|
||||||
|
// } else {
|
||||||
|
// actionsList = actionsList.concat(editAndDelBtn);
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// if (!record.workflowData?.processId) {
|
||||||
|
// //与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上
|
||||||
|
// actionsList = actionsList.concat(editAndDelBtn);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
return actionsList;
|
return actionsList;
|
||||||
}
|
}
|
||||||
function handleStartwork(record: Recordable) {
|
function handleStartwork(record: Recordable) {
|
||||||
@ -406,4 +511,21 @@
|
|||||||
.hide{
|
.hide{
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
:deep( .ant-col-8:nth-child(1)) {
|
||||||
|
width: 320px !important;
|
||||||
|
max-width: 320px !important;;
|
||||||
|
}
|
||||||
|
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
|
||||||
|
width: 80px !important;
|
||||||
|
}
|
||||||
|
:deep( .ant-col-8:nth-child(4)) {
|
||||||
|
width: 320px !important;
|
||||||
|
max-width: 320px !important;;
|
||||||
|
}
|
||||||
|
:deep(.ant-col-8:nth-child(4) .ant-form-item-label) {
|
||||||
|
width: 80px !important;
|
||||||
|
}
|
||||||
|
:deep(.ant-col-8:nth-child(5) .ant-select-selector) {
|
||||||
|
width: 172px !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -182,8 +182,8 @@
|
|||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const userInfo = userStore.getUserInfo;
|
const userInfo = userStore.getUserInfo;
|
||||||
|
|
||||||
const tableName = 'ContractSales';
|
const tableName = 'ContractSalesLng';
|
||||||
const columnName = 'ContractSales'
|
const columnName = 'ContractSalesLng'
|
||||||
|
|
||||||
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
@ -566,19 +566,6 @@
|
|||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid #eee;
|
||||||
}
|
}
|
||||||
.redStyle {
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
.iconStyle {
|
|
||||||
position: absolute;
|
|
||||||
color: rgba(0, 0, 0, 0.45);
|
|
||||||
// top: 0;
|
|
||||||
}
|
|
||||||
.tbStyle {
|
|
||||||
border: 1px dashed #d9d9d9;
|
|
||||||
padding: 10px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h4 {
|
h4 {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
|||||||
@ -8,6 +8,7 @@ export const customFormConfig = {
|
|||||||
'contractFactApprove',
|
'contractFactApprove',
|
||||||
'addContractPurPng',
|
'addContractPurPng',
|
||||||
'addContractSales',
|
'addContractSales',
|
||||||
'addContractSalesLng'
|
'addContractSalesLng',
|
||||||
|
'ContractPurInt'
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user