Merge branch 'dev' of http://47.94.165.164:13000/geg-gas/geg-gas-web into dev
This commit is contained in:
26
src/App.vue
26
src/App.vue
@ -88,29 +88,5 @@
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formViewStyle {
|
|
||||||
|
|
||||||
.ant-input-number-disabled, input.ant-input-disabled,.ant-picker.ant-picker-disabled {
|
|
||||||
border: none !important;
|
|
||||||
background-color: transparent !important;
|
|
||||||
padding-left: 0 !important;
|
|
||||||
color: rgb(0 0 0 / 85%) !important;
|
|
||||||
::placeholder {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
input.ant-input-disabled:placeholder-shown{
|
|
||||||
opacity: 0 !important;
|
|
||||||
}
|
|
||||||
.ant-picker-input > input[disabled], .ant-radio-disabled + span {
|
|
||||||
color: rgb(0 0 0 / 85%) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ant-picker.ant-picker-disabled .ant-picker-input .ant-picker-suffix {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
.ant-input-search > .ant-input-group > .ant-input-group-addon-disabled:last-child {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -7,12 +7,40 @@ enum Api {
|
|||||||
List = '/contract/contractSales/list',
|
List = '/contract/contractSales/list',
|
||||||
Info = '/contract/contractSales/info',
|
Info = '/contract/contractSales/info',
|
||||||
LngContract = '/contract/contractSales',
|
LngContract = '/contract/contractSales',
|
||||||
|
PointTransList = '/magic-api/contract/queryLngContractSalesPngPointTransList',
|
||||||
|
PointPurList = '/magic-api/contract/queryLngContractSalesPngPointPurList'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @description: //管输(自主托运)列表
|
||||||
|
*/
|
||||||
|
export async function getTransList(ksppId: String, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<LngContractPageModel>(
|
||||||
|
{
|
||||||
|
url: Api.PointTransList,
|
||||||
|
params: { ksppId },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @description: //上载信息列表
|
||||||
|
*/
|
||||||
|
export async function getPurList(ksppId: String, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<LngContractPageModel>(
|
||||||
|
{
|
||||||
|
url: Api.PointPurList,
|
||||||
|
params: { ksppId },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @description: 查询LngContract分页列表
|
* @description: 查询LngContract分页列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -501,4 +501,11 @@
|
|||||||
.ant-input-disabled {
|
.ant-input-disabled {
|
||||||
color: rgb(0 0 0 / 85%) !important;
|
color: rgb(0 0 0 / 85%) !important;
|
||||||
}
|
}
|
||||||
|
.ant-input[disabled] {
|
||||||
|
border: none !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
.page-bg-wrap .ant-form-item-label > label {
|
||||||
|
color: rgba(0, 0, 0, 0.65) !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -108,7 +108,7 @@
|
|||||||
}
|
}
|
||||||
if (btn == 'view') {
|
if (btn == 'view') {
|
||||||
router.push({
|
router.push({
|
||||||
path: '/approve/Appro/form',
|
path: '/approve/Appro/viewForm',
|
||||||
query: {
|
query: {
|
||||||
id: record.id || record.approId,
|
id: record.id || record.approId,
|
||||||
disabled: true
|
disabled: true
|
||||||
|
|||||||
@ -63,6 +63,7 @@
|
|||||||
}
|
}
|
||||||
const handleSuccess = (val) =>{
|
const handleSuccess = (val) =>{
|
||||||
val.forEach(v => {
|
val.forEach(v => {
|
||||||
|
v.kFactId = v.id
|
||||||
v.id = null
|
v.id = null
|
||||||
})
|
})
|
||||||
if (!dataList.value.length) {
|
if (!dataList.value.length) {
|
||||||
@ -109,7 +110,7 @@
|
|||||||
}
|
}
|
||||||
if (btn == 'view') {
|
if (btn == 'view') {
|
||||||
router.push({
|
router.push({
|
||||||
path: '/contract/ContractFact/form',
|
path: '/contract/ContractFact/viewForm',
|
||||||
query: {
|
query: {
|
||||||
id: record.id || record.approId,
|
id: record.id || record.approId,
|
||||||
disabled: true
|
disabled: true
|
||||||
|
|||||||
@ -42,3 +42,38 @@ svg,
|
|||||||
span {
|
span {
|
||||||
outline: none !important;
|
outline: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.formViewStyle {
|
||||||
|
margin-left: 1px ;
|
||||||
|
margin-right: 1px ;
|
||||||
|
padding: 3px;
|
||||||
|
.ant-input-number-disabled, input.ant-input-disabled,.ant-picker.ant-picker-disabled {
|
||||||
|
border: none !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
padding-left: 0 !important;
|
||||||
|
color: rgb(0 0 0 / 85%) !important;
|
||||||
|
::placeholder {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
input.ant-input-disabled:placeholder-shown{
|
||||||
|
opacity: 0 !important;
|
||||||
|
}
|
||||||
|
.ant-picker-input > input[disabled], .ant-radio-disabled + span {
|
||||||
|
color: rgb(0 0 0 / 85%) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-picker.ant-picker-disabled .ant-picker-input .ant-picker-suffix {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
.ant-input-search > .ant-input-group > .ant-input-group-addon-disabled:last-child {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
.ant-input[disabled] {
|
||||||
|
border: none !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
.ant-form-item-label > label {
|
||||||
|
color: rgba(0, 0, 0, 0.65) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -90,6 +90,45 @@ html[data-theme='light'] {
|
|||||||
|
|
||||||
.page-bg-wrap {
|
.page-bg-wrap {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 12px 12px 0 12px;
|
// padding: 12px 12px 0 12px;
|
||||||
margin: 12px 12px 0 12px;
|
margin: 6px 12px 0 12px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
.ant-card-head {
|
||||||
|
padding: 0 12px !important;
|
||||||
|
}
|
||||||
|
.ant-card-head {
|
||||||
|
min-height: 32px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.ant-card-body {
|
||||||
|
padding: 12px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formViewStyle {
|
||||||
|
.ant-card {
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.1) !important;
|
||||||
|
// box-shadow: 0 4px 4px 4px #0000001a !important; /* 扩散半径为4px,模糊半径为12px */
|
||||||
|
// box-shadow: -8px 2px 4px #0000001a;
|
||||||
|
// box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
|
||||||
|
margin-bottom: 15px;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-card-head-title::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
width: 2px;
|
||||||
|
height: 1em;
|
||||||
|
background-color: #5e95ff; /* 竖线的颜色 */
|
||||||
|
margin-right: 8px; /* 与标题内容的间距 */
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.ant-card-head-title {
|
||||||
|
padding: 10px 0 !important;
|
||||||
|
display: flex !important;
|
||||||
|
align-items: center !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -44,12 +44,12 @@ export const tabListData: TabItem[] = [
|
|||||||
list: [],
|
list: [],
|
||||||
unreadNum: 0,
|
unreadNum: 0,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
key: '3',
|
// key: '3',
|
||||||
name: t('日程'),
|
// name: t('日程'),
|
||||||
list: [],
|
// list: [],
|
||||||
unreadNum: 0,
|
// unreadNum: 0,
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
key: '4',
|
key: '4',
|
||||||
name: t('工作流'),
|
name: t('工作流'),
|
||||||
|
|||||||
@ -255,7 +255,7 @@ export const PAGE_CUSTOM_ROUTE: AppRouteRecordRaw[] = [{
|
|||||||
component: LAYOUT,
|
component: LAYOUT,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/approve/Appro/form',
|
path: '/approve/Appro/viewForm',
|
||||||
name: 'ApproForm',
|
name: 'ApproForm',
|
||||||
component: () => import('/@/views/approve/Appro/components/createForm.vue'),
|
component: () => import('/@/views/approve/Appro/components/createForm.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
@ -263,7 +263,7 @@ export const PAGE_CUSTOM_ROUTE: AppRouteRecordRaw[] = [{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/contract/ContractFact/form',
|
path: '/contract/ContractFact/viewForm',
|
||||||
name: 'ContractFactForm',
|
name: 'ContractFactForm',
|
||||||
component: () => import('/@/views/contract/ContractFact/components/createForm.vue'),
|
component: () => import('/@/views/contract/ContractFact/components/createForm.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
|
|||||||
@ -267,8 +267,8 @@
|
|||||||
await formRef.value.validateFields();
|
await formRef.value.validateFields();
|
||||||
let obj = {
|
let obj = {
|
||||||
...formState,
|
...formState,
|
||||||
lngFileUploadList: dataFile.value
|
lngFileUploadList: dataFile.value,
|
||||||
|
approCode: pageType.value=='update' ? 'WTJ' : formState.approCode
|
||||||
}
|
}
|
||||||
spinning.value = true;
|
spinning.value = true;
|
||||||
let request = !formState.id ? addLngAppro :updateLngAppro
|
let request = !formState.id ? addLngAppro :updateLngAppro
|
||||||
|
|||||||
@ -74,9 +74,9 @@
|
|||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
//所有按钮
|
//所有按钮
|
||||||
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"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},,{"name":"变更","code":"update","icon":"ant-design:edit-filled","isDefault":false,"isUse":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}]);
|
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"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},{"name":"审批","code":"approve","icon":"ant-design:check-outlined","isDefault":false,"isUse":true},{"name":"变更","code":"update","icon":"ant-design:edit-filled","isDefault":false,"isUse":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}]);
|
||||||
//展示在列表内的按钮
|
//展示在列表内的按钮
|
||||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete','update', 'startwork','flowRecord']);
|
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete','update', 'startwork','flowRecord', 'approve']);
|
||||||
const buttonConfigs = computed(()=>{
|
const buttonConfigs = computed(()=>{
|
||||||
return filterButtonAuth(buttons.value);
|
return filterButtonAuth(buttons.value);
|
||||||
})
|
})
|
||||||
@ -89,7 +89,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}
|
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete,update: handleUpdate, approve: handleApprove}
|
||||||
|
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -160,7 +160,8 @@
|
|||||||
taskId: taskIds[0],
|
taskId: taskIds[0],
|
||||||
formName: formName,
|
formName: formName,
|
||||||
formId:currentRoute.value.meta.formId,
|
formId:currentRoute.value.meta.formId,
|
||||||
id: record.id
|
id: record.id,
|
||||||
|
readonly: 1,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (schemaId && !taskIds && processId) {
|
} else if (schemaId && !taskIds && processId) {
|
||||||
@ -249,20 +250,35 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
function handleUpdate(record: Recordable) {
|
function handleUpdate(record: Recordable) {
|
||||||
const { processId, taskIds, schemaId, status } = record.workflowData || {};
|
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||||
router.push({
|
if (schemaIdComputedRef.value) {
|
||||||
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
router.push({
|
||||||
query: {
|
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||||
readonly: 1,
|
query: {
|
||||||
taskId: '',
|
formPath: 'approve/Appro',
|
||||||
formName: formName,
|
formName: formName,
|
||||||
formId:currentRoute.value.meta.formId,
|
formId:currentRoute.value.meta.formId,
|
||||||
id: record.id,
|
type:'update',
|
||||||
status
|
id: record.id,
|
||||||
}
|
processId: processId
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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]);
|
||||||
@ -323,9 +339,11 @@
|
|||||||
|
|
||||||
let actionsList: ActionItem[] = [];
|
let actionsList: ActionItem[] = [];
|
||||||
let editAndDelBtn: ActionItem[] = [];
|
let editAndDelBtn: ActionItem[] = [];
|
||||||
let hasFlowRecord = false;
|
let updateBtn: ActionItem[] = [];
|
||||||
|
let approveBtn: ActionItem[] = [];
|
||||||
|
let hasFlowRecord = false;
|
||||||
actionButtonConfig.value?.map((button) => {
|
actionButtonConfig.value?.map((button) => {
|
||||||
if (['view', 'copyData'].includes(button.code)) {
|
if (['view', 'copyData', 'enable', 'disable'].includes(button.code)) {
|
||||||
actionsList.push({
|
actionsList.push({
|
||||||
icon: button?.icon,
|
icon: button?.icon,
|
||||||
tooltip: button?.name,
|
tooltip: button?.name,
|
||||||
@ -340,27 +358,49 @@
|
|||||||
onClick: btnEvent[button.code].bind(null, record),
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (button.code === 'flowRecord') hasFlowRecord = true;
|
if (['update'].includes(button.code)) {
|
||||||
if (record.approCode == 'YSP' && button.code== 'update') {
|
updateBtn.push({
|
||||||
let idx = actionsList.findIndex(v =>v.tooltip == '变更')
|
icon: button?.icon,
|
||||||
idx<0 && actionsList.push({icon: button?.icon,
|
|
||||||
tooltip: button?.name,
|
tooltip: button?.name,
|
||||||
onClick: btnEvent[button.code].bind(null, record),})
|
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 (record.workflowData?.enabled) {
|
// 未提交或已驳回
|
||||||
//与工作流有关联的表单
|
if (record.approCode == 'WTJ' || record.approCode == 'YBH' ) {
|
||||||
if (record.workflowData.status) {
|
actionsList = actionsList.concat(editAndDelBtn);
|
||||||
// actionsList.unshift(setIndexFlowStatus(record.workflowData))
|
|
||||||
} else {
|
|
||||||
actionsList = actionsList.concat(editAndDelBtn);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!record.workflowData?.processId) {
|
|
||||||
//与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上
|
|
||||||
actionsList = actionsList.concat(editAndDelBtn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// 审批中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) {
|
||||||
|
|||||||
@ -568,7 +568,8 @@
|
|||||||
...formState,
|
...formState,
|
||||||
lngFileUploadList: dataFile.value,
|
lngFileUploadList: dataFile.value,
|
||||||
lngContractFactCpList: dataList.value,
|
lngContractFactCpList: dataList.value,
|
||||||
lngContractApproRelList: dataListAppro.value
|
lngContractApproRelList: dataListAppro.value,
|
||||||
|
approCode: pageType.value=='update' ? 'WTJ' : formState.approCode
|
||||||
|
|
||||||
}
|
}
|
||||||
spinning.value = true;
|
spinning.value = true;
|
||||||
|
|||||||
@ -74,9 +74,9 @@
|
|||||||
|
|
||||||
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":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}]);
|
||||||
//展示在列表内的按钮
|
//展示在列表内的按钮
|
||||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete','update', 'startwork','flowRecord']);
|
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete','update', 'startwork','flowRecord','approve']);
|
||||||
const buttonConfigs = computed(()=>{
|
const buttonConfigs = computed(()=>{
|
||||||
return filterButtonAuth(buttons.value);
|
return filterButtonAuth(buttons.value);
|
||||||
})
|
})
|
||||||
@ -89,7 +89,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}
|
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete,update: handleUpdate, approve: handleApprove}
|
||||||
|
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -160,7 +160,8 @@
|
|||||||
taskId: taskIds[0],
|
taskId: taskIds[0],
|
||||||
formName: formName,
|
formName: formName,
|
||||||
formId:currentRoute.value.meta.formId,
|
formId:currentRoute.value.meta.formId,
|
||||||
id: record.id
|
id: record.id,
|
||||||
|
readonly: 1,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (schemaId && !taskIds && processId) {
|
} else if (schemaId && !taskIds && processId) {
|
||||||
@ -248,20 +249,35 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function handleUpdate(record: Recordable) {
|
function handleUpdate(record: Recordable) {
|
||||||
const { processId, taskIds, schemaId, status } = record.workflowData || {};
|
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||||
router.push({
|
if (schemaIdComputedRef.value) {
|
||||||
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
router.push({
|
||||||
query: {
|
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||||
readonly: 1,
|
query: {
|
||||||
taskId: '',
|
formPath: 'contract/ContractFact',
|
||||||
formName: formName,
|
formName: formName,
|
||||||
formId:currentRoute.value.meta.formId,
|
formId:currentRoute.value.meta.formId,
|
||||||
id: record.id,
|
type:'update',
|
||||||
status
|
id: record.id,
|
||||||
}
|
processId: processId
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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]);
|
||||||
@ -322,9 +338,11 @@
|
|||||||
|
|
||||||
let actionsList: ActionItem[] = [];
|
let actionsList: ActionItem[] = [];
|
||||||
let editAndDelBtn: ActionItem[] = [];
|
let editAndDelBtn: ActionItem[] = [];
|
||||||
let hasFlowRecord = false;
|
let updateBtn: ActionItem[] = [];
|
||||||
|
let approveBtn: ActionItem[] = [];
|
||||||
|
let hasFlowRecord = false;
|
||||||
actionButtonConfig.value?.map((button) => {
|
actionButtonConfig.value?.map((button) => {
|
||||||
if (['view', 'copyData'].includes(button.code)) {
|
if (['view', 'copyData', 'enable', 'disable'].includes(button.code)) {
|
||||||
actionsList.push({
|
actionsList.push({
|
||||||
icon: button?.icon,
|
icon: button?.icon,
|
||||||
tooltip: button?.name,
|
tooltip: button?.name,
|
||||||
@ -339,27 +357,49 @@
|
|||||||
onClick: btnEvent[button.code].bind(null, record),
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (button.code === 'flowRecord') hasFlowRecord = true;
|
if (['update'].includes(button.code)) {
|
||||||
if (record.approCode == 'YSP' && button.code== 'update') {
|
updateBtn.push({
|
||||||
let idx = actionsList.findIndex(v =>v.tooltip == '变更')
|
icon: button?.icon,
|
||||||
idx<0 && actionsList.push({icon: button?.icon,
|
|
||||||
tooltip: button?.name,
|
tooltip: button?.name,
|
||||||
onClick: btnEvent[button.code].bind(null, record),})
|
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 (record.workflowData?.enabled) {
|
// 未提交或已驳回
|
||||||
//与工作流有关联的表单
|
if (record.approCode == 'WTJ' || record.approCode == 'YBH' ) {
|
||||||
if (record.workflowData.status) {
|
actionsList = actionsList.concat(editAndDelBtn);
|
||||||
// actionsList.unshift(setIndexFlowStatus(record.workflowData))
|
|
||||||
} else {
|
|
||||||
actionsList = actionsList.concat(editAndDelBtn);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!record.workflowData?.processId) {
|
|
||||||
//与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上
|
|
||||||
actionsList = actionsList.concat(editAndDelBtn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// 审批中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) {
|
||||||
|
|||||||
@ -9,7 +9,7 @@ export const searchFormSchema: FormSchema[] = [
|
|||||||
|
|
||||||
{
|
{
|
||||||
field: 'kNo',
|
field: 'kNo',
|
||||||
label: '合同号/合同名称',
|
label: '合同号/名称',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -15,9 +15,9 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="合同期限" name="kPriod">
|
<a-form-item label="合同期限" name="kPeriod">
|
||||||
<a-select v-model:value="formState.kPriod" :disabled="isDisable" placeholder="请选择合同期限" style="width: 100%" allow-clear>
|
<a-select v-model:value="formState.kPeriod" :disabled="isDisable" placeholder="请选择合同期限" style="width: 100%" allow-clear>
|
||||||
<a-select-option v-for="item in optionSelect.kPriodList" :key="item.code" :value="item.code">
|
<a-select-option v-for="item in optionSelect.kPeriodList" :key="item.code" :value="item.code">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
@ -50,7 +50,7 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="供应商" name="cpName">
|
<a-form-item label="供应商" name="cpName">
|
||||||
<a-input-search v-model:value="formState.cpName" :disabled="isDisable" placeholder="请选择供应商" readonly @search="onSearcSupplier"/>
|
<a-input-search v-model:value="formState.cpName" :disabled="isDisable" placeholder="请选择供应商" readonly @search="onSearchSupplier"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
@ -70,7 +70,7 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="定价机制" name="prcTypeCode">
|
<a-form-item label="定价机制" name="prcTypeCode">
|
||||||
<a-select v-model:value="formState.prcTypeCode" style="width: 100%" allow-clear>
|
<a-select v-model:value="formState.prcTypeCode" :disabled="isDisable" style="width: 100%" allow-clear>
|
||||||
<a-select-option v-for="item in optionSelect.prcTypeCodeList" :key="item.code" :value="item.code">
|
<a-select-option v-for="item in optionSelect.prcTypeCodeList" :key="item.code" :value="item.code">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
@ -79,7 +79,7 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="量价周期" name="periodTypeCode">
|
<a-form-item label="量价周期" name="periodTypeCode">
|
||||||
<a-select v-model:value="formState.periodTypeCode" style="width: 100%" allow-clear>
|
<a-select v-model:value="formState.periodTypeCode" :disabled="isDisable" style="width: 100%" allow-clear>
|
||||||
<a-select-option v-for="item in optionSelect.periodTypeCodeList" :key="item.code" :value="item.code">
|
<a-select-option v-for="item in optionSelect.periodTypeCodeList" :key="item.code" :value="item.code">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
@ -88,7 +88,7 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="主计量单位" name="uomCode">
|
<a-form-item label="主计量单位" name="uomCode">
|
||||||
<a-select v-model:value="formState.uomCode" style="width: 100%" allow-clear>
|
<a-select v-model:value="formState.uomCode" :disabled="isDisable" style="width: 100%" allow-clear>
|
||||||
<a-select-option v-for="item in optionSelect.uomCodeList" :key="item.code" :value="item.code">
|
<a-select-option v-for="item in optionSelect.uomCodeList" :key="item.code" :value="item.code">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
@ -113,12 +113,18 @@
|
|||||||
<div v-for="(item, idx) in dataListPoint">
|
<div v-for="(item, idx) in dataListPoint">
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="上载点" name="pointUpName">
|
<a-form-item name="pointUpName">
|
||||||
|
<template #label>
|
||||||
|
<span><span style="color:red">*</span>上载点</span>
|
||||||
|
</template>
|
||||||
<a-input-search v-model:value="item.pointUpName" :disabled="isDisable" placeholder="请选择上载点" readonly @search="onSearchDownLoad('up', idx)"/>
|
<a-input-search v-model:value="item.pointUpName" :disabled="isDisable" placeholder="请选择上载点" readonly @search="onSearchDownLoad('up', idx)"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="是否托运" name="transSign">
|
<a-form-item name="transSign">
|
||||||
|
<template #label>
|
||||||
|
<span><span style="color:red">*</span>是否托运</span>
|
||||||
|
</template>
|
||||||
<a-select v-model:value="item.transSign" style="width: 100%" allow-clear>
|
<a-select v-model:value="item.transSign" style="width: 100%" allow-clear>
|
||||||
<a-select-option v-for="item in optionSelect.transSignList" :key="item.code" :value="item.code">
|
<a-select-option v-for="item in optionSelect.transSignList" :key="item.code" :value="item.code">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
@ -132,7 +138,10 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="交割点" name="pointDelyName" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
<a-form-item name="pointDelyName" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<template #label>
|
||||||
|
<span><span style="color:red">*</span>交割点</span>
|
||||||
|
</template>
|
||||||
<div style="position: relative;">
|
<div style="position: relative;">
|
||||||
<a-textarea style="width:95%;" v-model:value="item.pointDelyName" :disabled="isDisable" readonly placeholder="请选择交割点" :auto-size="{ minRows: 1, maxRows: 5 }"/>
|
<a-textarea style="width:95%;" v-model:value="item.pointDelyName" :disabled="isDisable" readonly placeholder="请选择交割点" :auto-size="{ minRows: 1, maxRows: 5 }"/>
|
||||||
<a-button :icon="h(SearchOutlined)" class="iconStyle" @click="onSearchDownLoad('dely', idx)" />
|
<a-button :icon="h(SearchOutlined)" class="iconStyle" @click="onSearchDownLoad('dely', idx)" />
|
||||||
@ -169,42 +178,42 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record, index }">
|
<template #bodyCell="{ column, record, index }">
|
||||||
<template v-if="column.dataIndex === 'dateFrom'">
|
<template v-if="column.dataIndex === 'dateFrom'">
|
||||||
<a-date-picker v-model:value="record.dateFrom" @change="dateFromTb(record.dateFrom, index, record)" style="width: 100%" />
|
<a-date-picker v-model:value="record.dateFrom" :disabled="isDisable" @change="dateFromTb(record.dateFrom, index, record)" style="width: 100%" />
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'dateTo'">
|
<template v-if="column.dataIndex === 'dateTo'">
|
||||||
<a-date-picker v-model:value="record.dateTo" @change="dateToTb(record.dateTo, index, record)" style="width: 100%" />
|
<a-date-picker v-model:value="record.dateTo" :disabled="isDisable" @change="dateToTb(record.dateTo, index, record)" style="width: 100%" />
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'sort'">
|
<template v-if="column.dataIndex === 'sort'">
|
||||||
<a-input-number v-model:value="record.sort" :min="0" style="width: 100%" />
|
<a-input-number v-model:value="record.sort" :disabled="isDisable" :min="0" style="width: 100%" />
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'baseInc'">
|
<template v-if="column.dataIndex === 'baseInc'">
|
||||||
<a-select v-model:value="record.baseInc" style="width: 100%" allow-clear>
|
<a-select v-model:value="record.baseInc" :disabled="isDisable" style="width: 100%" allow-clear>
|
||||||
<a-select-option v-for="item in optionSelect.baseIncList" :key="item.code" :value="item.code">
|
<a-select-option v-for="item in optionSelect.baseIncList" :key="item.code" :value="item.code">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'rateM3Gj'">
|
<template v-if="column.dataIndex === 'rateM3Gj'">
|
||||||
<a-input-number v-model:value="record.rateM3Gj" :min="0" @change="numChange('rateM3Gj', record, index)" style="width: 100%" />
|
<a-input-number v-model:value="record.rateM3Gj" :disabled="isDisable" :min="0" @change="numChange('rateM3Gj', record, index)" style="width: 100%" />
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'qtyGjMonth'">
|
<template v-if="column.dataIndex === 'qtyGjMonth'">
|
||||||
<a-input-number v-model:value="record.qtyGjMonth" :min="0" @change="numChange('qtyGjMonth', record, index)" style="width: 100%" />
|
<a-input-number v-model:value="record.qtyGjMonth" :disabled="isDisable" :min="0" @change="numChange('qtyGjMonth', record, index)" style="width: 100%" />
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'qtyM3Month'">
|
<template v-if="column.dataIndex === 'qtyM3Month'">
|
||||||
<a-input-number v-model:value="record.qtyM3Month" :min="0" @change="numChange('qtyM3Month', record, index)" style="width: 100%" />
|
<a-input-number v-model:value="record.qtyM3Month" :disabled="isDisable" :min="0" @change="numChange('qtyM3Month', record, index)" style="width: 100%" />
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'zfbyTypeCode'">
|
<template v-if="column.dataIndex === 'zfbyTypeCode'">
|
||||||
<a-select v-model:value="record.zfbyTypeCode" style="width: 100%" allow-clear>
|
<a-select v-model:value="record.zfbyTypeCode" :disabled="isDisable" style="width: 100%" allow-clear>
|
||||||
<a-select-option v-for="item in optionSelect.zfbyTypeCodeList" :key="item.code" :value="item.code">
|
<a-select-option v-for="item in optionSelect.zfbyTypeCodeList" :key="item.code" :value="item.code">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'zfbyValue'">
|
<template v-if="column.dataIndex === 'zfbyValue'">
|
||||||
<a-input-number v-model:value="record.zfbyValue" :min="0" style="width: 100%" />
|
<a-input-number v-model:value="record.zfbyValue" :disabled="isDisable" :min="0" style="width: 100%" />
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'note'">
|
<template v-if="column.dataIndex === 'note'">
|
||||||
<a-input v-model:value="record.note" style="width: 100%" />
|
<a-input v-model:value="record.note" :disabled="isDisable" style="width: 100%" />
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'operation'">
|
<template v-if="column.dataIndex === 'operation'">
|
||||||
<a v-if="!isDisable" style="margin-right: 10px" @click="btnCheck(record, index)">删除</a>
|
<a v-if="!isDisable" style="margin-right: 10px" @click="btnCheck(record, index)">删除</a>
|
||||||
@ -293,7 +302,8 @@
|
|||||||
typeCode: 'PP',
|
typeCode: 'PP',
|
||||||
onlineSign: 'N',
|
onlineSign: 'N',
|
||||||
cpTableName: 'lng_supplier',
|
cpTableName: 'lng_supplier',
|
||||||
curCode: 'CNY'
|
curCode: 'CNY',
|
||||||
|
lngContractPurPngList: [{}]
|
||||||
});
|
});
|
||||||
const [register, { openModal:openModal}] = useModal();
|
const [register, { openModal:openModal}] = useModal();
|
||||||
const [registerDept, { openModal:openModalDept}] = useModal();
|
const [registerDept, { openModal:openModalDept}] = useModal();
|
||||||
@ -345,7 +355,7 @@
|
|||||||
}])
|
}])
|
||||||
let optionSelect= reactive({
|
let optionSelect= reactive({
|
||||||
approCodeList: [],
|
approCodeList: [],
|
||||||
kPriodList: [],
|
kPeriodList: [],
|
||||||
prcTypeCodeList: [],
|
prcTypeCodeList: [],
|
||||||
uomCodeList: [],
|
uomCodeList: [],
|
||||||
periodTypeCodeList: [],
|
periodTypeCodeList: [],
|
||||||
@ -407,13 +417,15 @@
|
|||||||
formState.dateSign = formState.dateSign ? dayjs(formState.dateSign) : null
|
formState.dateSign = formState.dateSign ? dayjs(formState.dateSign) : null
|
||||||
formState.dateFrom = formState.dateFrom ? dayjs(formState.dateFrom) : null
|
formState.dateFrom = formState.dateFrom ? dayjs(formState.dateFrom) : null
|
||||||
formState.dateTo = formState.dateTo ? dayjs(formState.dateTo) : null
|
formState.dateTo = formState.dateTo ? dayjs(formState.dateTo) : null
|
||||||
formState.prcTypeCode = (formState?.lngContractPurPngList[0] || {}).uomCode
|
formState.prcTypeCode = (formState?.lngContractPurPngList[0] || {}).prcTypeCode
|
||||||
formState.periodTypeCode = (formState?.lngContractPurPngList[0] || {}).periodTypeCode
|
formState.periodTypeCode = (formState?.lngContractPurPngList[0] || {}).periodTypeCode
|
||||||
formState.uomCode = (formState?.lngContractPurPngList[0] || {}).uomCode
|
formState.uomCode = (formState?.lngContractPurPngList[0] || {}).uomCode
|
||||||
|
|
||||||
dataListContractAgree.forEach(v => {
|
dataListContractAgree.value.forEach(v => {
|
||||||
v.qtyM3Month = Number(v.qtyM3Month)/10000
|
v.qtyM3Month = Number(v.qtyM3Month)/10000
|
||||||
v.qtyM3Day = Number(v.qtyM3Day)/10000
|
v.qtyM3Day = Number(v.qtyM3Day)/10000
|
||||||
|
v.dateFrom = v.dateFrom ? dayjs(v.dateFrom) : null
|
||||||
|
v.dateTo = v.dateTo ? dayjs(v.dateTo) : null
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -421,7 +433,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function getOption() {
|
async function getOption() {
|
||||||
optionSelect.kPriodList = await getDictionary('LNG_K_PER')
|
optionSelect.kPeriodList = await getDictionary('LNG_K_PER')
|
||||||
optionSelect.prcTypeCodeList = await getDictionary('LNG_PRC')
|
optionSelect.prcTypeCodeList = await getDictionary('LNG_PRC')
|
||||||
optionSelect.periodTypeCodeList = await getDictionary('LNG_PRC_P')
|
optionSelect.periodTypeCodeList = await getDictionary('LNG_PRC_P')
|
||||||
optionSelect.uomCodeList = await getDictionary('LNG_UOM')
|
optionSelect.uomCodeList = await getDictionary('LNG_UOM')
|
||||||
@ -540,7 +552,7 @@
|
|||||||
const onSearch = (val)=> {
|
const onSearch = (val)=> {
|
||||||
openModalDept(true,{isUpdate: false})
|
openModalDept(true,{isUpdate: false})
|
||||||
}
|
}
|
||||||
const onSearcSupplier = () => {
|
const onSearchSupplier = () => {
|
||||||
openModalSupplier(true,{isUpdate: false})
|
openModalSupplier(true,{isUpdate: false})
|
||||||
}
|
}
|
||||||
const onSearchUser = (val)=> {
|
const onSearchUser = (val)=> {
|
||||||
@ -658,9 +670,29 @@
|
|||||||
arr[i].qtyM3Month = Number(arr[i].qtyM3Month)*10000
|
arr[i].qtyM3Month = Number(arr[i].qtyM3Month)*10000
|
||||||
arr[i].qtyM3Day = Number(arr[i].qtyM3Day)*10000
|
arr[i].qtyM3Day = Number(arr[i].qtyM3Day)*10000
|
||||||
}
|
}
|
||||||
|
for(let i=0; i<dataListPoint.value.length; i++) {
|
||||||
|
if (!dataListPoint.value[i].pointUpCode || !dataListPoint.value[i].transSign || !dataListPoint.value[i].lngContractPurPngPointSalesList.length) {
|
||||||
|
message.warn('请完善交割点必选项')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let arr1 = []
|
||||||
dataListAppro.value.forEach(v=>{
|
dataListAppro.value.forEach(v=>{
|
||||||
v.approId = ''
|
v.approId = ''
|
||||||
|
arr1.concat(v.lngContractPurPngPointSalesList || [])
|
||||||
})
|
})
|
||||||
|
let newArr = arr1.map(v=>v.pointDelyCode)
|
||||||
|
let codeList = dataListPoint.value.map(v =>v.pointUpCode)
|
||||||
|
const isRepeat=codeList.some((item,index,arr)=>arr.indexOf(item)!=index);
|
||||||
|
const isRepeatNew=newArr.some((item,index,arr)=>arr.indexOf(item)!=index);
|
||||||
|
if(isRepeat){
|
||||||
|
message.warn('上载点不可重复');
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(isRepeatNew){
|
||||||
|
message.warn('交割点不可重复');
|
||||||
|
return
|
||||||
|
}
|
||||||
let obj = {
|
let obj = {
|
||||||
...formState,
|
...formState,
|
||||||
lngContractPurPngPointList: dataListPoint.value,
|
lngContractPurPngPointList: dataListPoint.value,
|
||||||
@ -676,7 +708,8 @@
|
|||||||
"periodTypeCode": formState.periodTypeCode,
|
"periodTypeCode": formState.periodTypeCode,
|
||||||
"uomCode": formState.uomCode,
|
"uomCode": formState.uomCode,
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
approCode: pageType.value=='update' ? 'WTJ' : formState.approCode
|
||||||
|
|
||||||
}
|
}
|
||||||
spinning.value = true;
|
spinning.value = true;
|
||||||
|
|||||||
@ -74,9 +74,9 @@
|
|||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
//所有按钮
|
//所有按钮
|
||||||
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"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":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},{"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 actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord', 'approve', 'update']);
|
||||||
const buttonConfigs = computed(()=>{
|
const buttonConfigs = computed(()=>{
|
||||||
return filterButtonAuth(buttons.value);
|
return filterButtonAuth(buttons.value);
|
||||||
})
|
})
|
||||||
@ -89,7 +89,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,}
|
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete, update:handleUpdate, approve:handleApprove}
|
||||||
|
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -157,9 +157,12 @@
|
|||||||
router.push({
|
router.push({
|
||||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||||
query: {
|
query: {
|
||||||
|
readonly: 1,
|
||||||
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) {
|
||||||
@ -169,18 +172,32 @@
|
|||||||
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 {
|
||||||
router.push({
|
if (schemaIdComputedRef.value) {
|
||||||
path: '/form/ContractPurPng/' + record.id + '/viewForm',
|
router.push({
|
||||||
query: {
|
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||||
formPath: 'contract/ContractPurPng',
|
query: {
|
||||||
formName: formName,
|
formPath: 'contract/ContractPurPng',
|
||||||
formId:currentRoute.value.meta.formId
|
formName: formName,
|
||||||
}
|
formId:currentRoute.value.meta.formId,
|
||||||
});
|
type:'edit',
|
||||||
|
id: record.id,
|
||||||
|
disabled: 1,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// router.push({
|
||||||
|
// path: '/form/ContractPurPng/' + record.id + '/viewForm',
|
||||||
|
// query: {
|
||||||
|
// formPath: 'contract/ContractPurPng',
|
||||||
|
// formName: formName,
|
||||||
|
// formId:currentRoute.value.meta.formId
|
||||||
|
// }
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,6 +250,36 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function handleUpdate(record: Recordable) {
|
||||||
|
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||||
|
if (schemaIdComputedRef.value) {
|
||||||
|
router.push({
|
||||||
|
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||||
|
query: {
|
||||||
|
formPath: 'contract/ContractPurPng',
|
||||||
|
formName: formName,
|
||||||
|
formId:currentRoute.value.meta.formId,
|
||||||
|
type:'update',
|
||||||
|
id: record.id,
|
||||||
|
processId: processId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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]);
|
||||||
}
|
}
|
||||||
@ -292,9 +339,11 @@
|
|||||||
|
|
||||||
let actionsList: ActionItem[] = [];
|
let actionsList: ActionItem[] = [];
|
||||||
let editAndDelBtn: ActionItem[] = [];
|
let editAndDelBtn: ActionItem[] = [];
|
||||||
let hasFlowRecord = false;
|
let updateBtn: ActionItem[] = [];
|
||||||
|
let approveBtn: ActionItem[] = [];
|
||||||
|
let hasFlowRecord = false;
|
||||||
actionButtonConfig.value?.map((button) => {
|
actionButtonConfig.value?.map((button) => {
|
||||||
if (['view', 'copyData'].includes(button.code)) {
|
if (['view', 'copyData', 'enable', 'disable'].includes(button.code)) {
|
||||||
actionsList.push({
|
actionsList.push({
|
||||||
icon: button?.icon,
|
icon: button?.icon,
|
||||||
tooltip: button?.name,
|
tooltip: button?.name,
|
||||||
@ -309,21 +358,49 @@
|
|||||||
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.approCode == 'WTJ' || record.approCode == 'YBH' ) {
|
||||||
if (record.workflowData.status) {
|
actionsList = actionsList.concat(editAndDelBtn);
|
||||||
actionsList.unshift(setIndexFlowStatus(record.workflowData))
|
|
||||||
} else {
|
|
||||||
actionsList = actionsList.concat(editAndDelBtn);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!record.workflowData?.processId) {
|
|
||||||
//与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上
|
|
||||||
actionsList = actionsList.concat(editAndDelBtn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// 审批中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) {
|
||||||
@ -409,11 +486,11 @@
|
|||||||
width: 50px;
|
width: 50px;
|
||||||
}
|
}
|
||||||
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
|
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
|
||||||
width: 118px !important;
|
width: 100px !important;
|
||||||
}
|
}
|
||||||
:deep(.ant-col-8:nth-child(1)) {
|
:deep(.ant-col-8:nth-child(1)) {
|
||||||
max-width: 330px !important;
|
max-width: 300px !important;
|
||||||
width: 330px !important;
|
width: 300px !important;
|
||||||
}
|
}
|
||||||
.show{
|
.show{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -6,72 +6,19 @@ export const formConfig = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const searchFormSchema: FormSchema[] = [
|
export const searchFormSchema: FormSchema[] = [
|
||||||
{
|
|
||||||
field: 'id',
|
|
||||||
label: 'id',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'kNo',
|
|
||||||
label: '合同号',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
field: 'kName',
|
field: 'kName',
|
||||||
label: '合同名称',
|
label: '合同号/名称',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'cpName',
|
field: 'cpName',
|
||||||
label: '客户',
|
label: '客户',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
}
|
||||||
{
|
|
||||||
field: 'dateFrom',
|
|
||||||
label: '有效期开始',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'dateTo',
|
|
||||||
label: '有效期结束',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'approCode',
|
|
||||||
label: '状态',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'onlineSign',
|
|
||||||
label: '交割点',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'cpTableName',
|
|
||||||
label: '是否托运',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'comId',
|
|
||||||
label: '合同主体',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'note',
|
|
||||||
label: '备注',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
{
|
|
||||||
dataIndex: 'id',
|
|
||||||
title: 'id',
|
|
||||||
componentType: 'input',
|
|
||||||
align: 'left',
|
|
||||||
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'kNo',
|
dataIndex: 'kNo',
|
||||||
@ -119,7 +66,7 @@ export const columns: BasicColumn[] = [
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'approCode',
|
dataIndex: 'approName',
|
||||||
title: '状态',
|
title: '状态',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
@ -128,7 +75,7 @@ export const columns: BasicColumn[] = [
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'onlineSign',
|
dataIndex: 'pointUpName',
|
||||||
title: '交割点',
|
title: '交割点',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
@ -137,7 +84,7 @@ export const columns: BasicColumn[] = [
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'cpTableName',
|
dataIndex: 'transSignName',
|
||||||
title: '是否托运',
|
title: '是否托运',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
@ -146,7 +93,7 @@ export const columns: BasicColumn[] = [
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'comId',
|
dataIndex: 'comName',
|
||||||
title: '合同主体',
|
title: '合同主体',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|||||||
821
src/views/contract/ContractSales/components/createForm.vue
Normal file
821
src/views/contract/ContractSales/components/createForm.vue
Normal file
@ -0,0 +1,821 @@
|
|||||||
|
<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>
|
||||||
|
<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%" :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%" :disabled="isDisable" :disabled-date="disabledDateEnd" placeholder="请选择结束日期" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="合同签订日期" name="dateSign">
|
||||||
|
<a-date-picker v-model:value="formState.dateSign" style="width: 100%" :disabled="isDisable" placeholder="请选择合同签订日期" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="确认函开始日" name="dateCfmFrom">
|
||||||
|
<a-date-picker v-model:value="formState.dateCfmFrom" style="width: 100%" :disabled="isDisable" :disabled-date="disabledDateCfmStart" placeholder="请选择确认函开始日" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="确认函结束日" name="dateCfmTo">
|
||||||
|
<a-date-picker v-model:value="formState.dateCfmTo" style="width: 100%" :disabled="isDisable" :disabled-date="disabledDateCfmEnd" 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="prcTypeCode">
|
||||||
|
<a-select v-model:value="formState.prcTypeCode" :disabled="isDisable" style="width: 100%" allow-clear>
|
||||||
|
<a-select-option v-for="item in optionSelect.prcTypeCodeList" :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="periodTypeCode">
|
||||||
|
<a-select v-model:value="formState.periodTypeCode" :disabled="isDisable" style="width: 100%" allow-clear>
|
||||||
|
<a-select-option v-for="item in optionSelect.periodTypeCodeList" :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="uomCode">
|
||||||
|
<a-select v-model:value="formState.uomCode" :disabled="isDisable" style="width: 100%" allow-clear>
|
||||||
|
<a-select-option v-for="item in optionSelect.uomCodeList" :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="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-col :span="22">
|
||||||
|
<a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="formState.note" :disabled="isDisable" placeholder="请输入备注,最多200字" :maxlength="200" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</Card>
|
||||||
|
<Card title="业务信息" :bordered="false" >
|
||||||
|
<h4>交割点</h4>
|
||||||
|
<a-button type="primary" style="margin-bottom: 10px;margin-right: 10px;" @click="addUpLoad" v-if="!isDisable">新增</a-button>
|
||||||
|
<a-button type="primary" @click="deleteUpLoad" v-if="!isDisable">删除</a-button>
|
||||||
|
<div v-for="(item, idx) in dataListPoint" class="tbStyle">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item name="pointDelyName">
|
||||||
|
<template #label>
|
||||||
|
<span><span style="color:red">*</span>计量交割点</span>
|
||||||
|
</template>
|
||||||
|
<a-input-search v-model:value="item.pointDelyName" :disabled="isDisable" placeholder="请选择计量交割点" readonly @search="onSearchDownLoad('dely', idx)"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="交气点" name="pointTransName">
|
||||||
|
<a-input-search v-model:value="item.pointTransName" :disabled="isDisable" placeholder="请选择交气点" readonly @search="onSearchDownLoad('trans', idx)"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item name="transSign">
|
||||||
|
<template #label>
|
||||||
|
<span><span style="color:red">*</span>是否托运</span>
|
||||||
|
</template>
|
||||||
|
<a-select v-model:value="item.transSign" style="width: 100%" allow-clear>
|
||||||
|
<a-select-option v-for="item in optionSelect.transSignList" :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="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-textarea v-model:value="item.note" :disabled="isDisable" placeholder="请输入备注" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<h4 style="margin: 5px 0">上载信息</h4>
|
||||||
|
<a-table style="width: 100%" :columns="columnsUp" :data-source="item.purList || []" :pagination="false" :scroll="{x: 300}"></a-table>
|
||||||
|
<h4 style="margin: 5px 0">管输(是否托运)</h4>
|
||||||
|
<a-table style="width: 100%" :columns="columnsTrans" :data-source="item.transList || []" :pagination="false" :scroll="{x: 300}"></a-table>
|
||||||
|
</a-row>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
<Card title="合同约定" :bordered="false" >
|
||||||
|
<div style="width: 100%">
|
||||||
|
<a-button type="primary" style="margin-bottom: 10px" @click="addContractAgree" v-if="!isDisable">新增行</a-button>
|
||||||
|
<a-table style="width: 100%" :columns="columns" :data-source="dataListContractAgree" :pagination="false" :scroll="{x: 300}">
|
||||||
|
<template #headerCell="{ column }">
|
||||||
|
<template v-if="column.dataIndex == 'dateFrom'">
|
||||||
|
<span><span class="redStyle">*</span>开始日期</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex == 'dateTo'">
|
||||||
|
<span><span class="redStyle">*</span>结束日期</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex == 'baseInc'">
|
||||||
|
<span><span class="redStyle">*</span>基础量/增量</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex == 'sort'">
|
||||||
|
<span><span class="redStyle">*</span>优先级</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex == 'qtyGjMonth'">
|
||||||
|
<span><span class="redStyle">*</span>月气量(吉焦)</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex == 'qtyM3Month'">
|
||||||
|
<span><span class="redStyle">*</span>月气量(万方)</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record, index }">
|
||||||
|
<template v-if="column.dataIndex === 'dateFrom'">
|
||||||
|
<a-date-picker v-model:value="record.dateFrom" :disabled="isDisable" @change="dateFromTb(record.dateFrom, index, record)" style="width: 100%" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'dateTo'">
|
||||||
|
<a-date-picker v-model:value="record.dateTo" :disabled="isDisable" @change="dateToTb(record.dateTo, index, record)" style="width: 100%" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'sort'">
|
||||||
|
<a-input-number v-model:value="record.sort" :disabled="isDisable" :min="0" style="width: 100%" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'baseInc'">
|
||||||
|
<a-select v-model:value="record.baseInc" :disabled="isDisable" style="width: 100%" allow-clear>
|
||||||
|
<a-select-option v-for="item in optionSelect.baseIncList" :key="item.code" :value="item.code">
|
||||||
|
{{ item.name }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'rateM3Gj'">
|
||||||
|
<a-input-number v-model:value="record.rateM3Gj" :disabled="isDisable" :min="0" @change="numChange('rateM3Gj', record, index)" style="width: 100%" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'qtyGjMonth'">
|
||||||
|
<a-input-number v-model:value="record.qtyGjMonth" :disabled="isDisable" :min="0" @change="numChange('qtyGjMonth', record, index)" style="width: 100%" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'qtyM3Month'">
|
||||||
|
<a-input-number v-model:value="record.qtyM3Month" :disabled="isDisable" :min="0" @change="numChange('qtyM3Month', record, index)" style="width: 100%" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'zfbyTypeCode'">
|
||||||
|
<a-select v-model:value="record.zfbyTypeCode" :disabled="isDisable" style="width: 100%" allow-clear>
|
||||||
|
<a-select-option v-for="item in optionSelect.zfbyTypeCodeList" :key="item.code" :value="item.code">
|
||||||
|
{{ item.name }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'zfbyValue'">
|
||||||
|
<a-input-number v-model:value="record.zfbyValue" :disabled="isDisable" :min="0" style="width: 100%" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'note'">
|
||||||
|
<a-input v-model:value="record.note" :disabled="isDisable" style="width: 100%" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'operation'">
|
||||||
|
<a v-if="!isDisable" style="margin-right: 10px" @click="btnCheck(record, index)">删除</a>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</a-table>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
<Card title="附件信息" :bordered="false" >
|
||||||
|
<UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/>
|
||||||
|
</Card>
|
||||||
|
<correlationContractFactList :list="dataListContractFact" :disabled="isDisable" @change="getApproContractFactList"></correlationContractFactList>
|
||||||
|
<correlationApproList :list="dataListAppro" :disabled="isDisable" @change="getApproList"></correlationApproList>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
<deptUserModal @register="register" @success="handleSuccess"/>
|
||||||
|
<deptListModal @register="registerDept" @success="handleSuccessDept" />
|
||||||
|
<contractFactListModal @register="registerContractFact" @success="handleSuccessContractFact" />
|
||||||
|
<downloadPointModal @register="registerDownLoad" @success="handleSuccessDownLoad" />
|
||||||
|
<customerListModal @register="registerCustomer" @success="handleSuccessCustomer" 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, getTransList, getPurList } from '/@/api/contract/ContractSales';
|
||||||
|
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 downloadPointModal from '/@/components/common/downloadPointModal.vue';
|
||||||
|
import customerListModal from '/@/components/common/customerListModal.vue';
|
||||||
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const userInfo = userStore.getUserInfo;
|
||||||
|
|
||||||
|
const tableName = 'ContractSales';
|
||||||
|
const columnName = 'ContractSales'
|
||||||
|
|
||||||
|
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 spinning = ref(false);
|
||||||
|
const curIdx = ref(null)
|
||||||
|
const { notification } = useMessage();
|
||||||
|
const { t } = useI18n();
|
||||||
|
const hasDel = ref(false)
|
||||||
|
const formState = reactive({
|
||||||
|
approCode: 'WTJ',
|
||||||
|
typeCode: 'SP',
|
||||||
|
onlineSign: 'N',
|
||||||
|
cpTableName: 'lng_customer',
|
||||||
|
curCode: 'CNY',
|
||||||
|
lngContractSalesPngList: [{}]
|
||||||
|
});
|
||||||
|
const [register, { openModal:openModal}] = useModal();
|
||||||
|
const [registerDept, { openModal:openModalDept}] = useModal();
|
||||||
|
const [registerContractFact, { openModal:openModalContractFact}] = useModal();
|
||||||
|
const [registerDownLoad, { openModal:openModalDownLoad}] = useModal();
|
||||||
|
const [registerCustomer, { openModal:openModalCustomer}] = useModal();
|
||||||
|
const rules= reactive({
|
||||||
|
kNo: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
kName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
cpName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
prcTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
uomCode: [{ 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' }]
|
||||||
|
});
|
||||||
|
const layout = {
|
||||||
|
labelCol: { span: 8 },
|
||||||
|
wrapperCol: { span: 16 },
|
||||||
|
}
|
||||||
|
const columns= ref([
|
||||||
|
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 80},
|
||||||
|
{ title: t('开始日期'), dataIndex: 'dateFrom', sorter: true, width:150},
|
||||||
|
{ title: t('结束日期'), dataIndex: 'dateTo', sorter: true, width: 150},
|
||||||
|
{ title: t('基础量/增量'), dataIndex: 'baseInc', sorter: true, width: 130},
|
||||||
|
{ title: t('优先级'), dataIndex: 'sort', sorter: true, width: 100},
|
||||||
|
{ title: t('比值(方/吉焦)'), dataIndex: 'rateM3Gj', sorter: true, width: 150},
|
||||||
|
{ title: t('月气量(吉焦)'), dataIndex: 'qtyGjMonth', sorter: true, width: 150},
|
||||||
|
{ title: t('月气量(万方)'), dataIndex: 'qtyM3Month', sorter: true, width: 150},
|
||||||
|
{ title: t('日气量(吉焦)'), dataIndex: 'qtyGjDay', sorter: true, width: 120},
|
||||||
|
{ title: t('日气量(万方)'), dataIndex: 'qtyM3Day', sorter: true, width: 120},
|
||||||
|
{ title: t('照付不议类型'), dataIndex: 'zfbyTypeCode', sorter: true, width: 120},
|
||||||
|
{ title: t('照付不议比例%/量数值'), dataIndex: 'zfbyValue', sorter: true, width: 120},
|
||||||
|
{ title: t('备注'), dataIndex: 'note', sorter: true, width: 200},
|
||||||
|
{ title: t('操作'), dataIndex: 'operation', width: 80, fixed: 'right',align: 'center'},
|
||||||
|
]);
|
||||||
|
const columnsUp = ref([
|
||||||
|
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 80},
|
||||||
|
{ title: t('交割点'), dataIndex: 'pointDelyName', sorter: true, width:150},
|
||||||
|
{ title: t('是否托运'), dataIndex: 'transName', sorter: true, width: 150},
|
||||||
|
{ title: t('供应商'), dataIndex: 'cpName', sorter: true, width: 130},
|
||||||
|
{ title: t('合同名称'), dataIndex: 'kName', sorter: true, width: 100},
|
||||||
|
{ title: t('上载点'), dataIndex: 'pointUpName', sorter: true, width: 150},
|
||||||
|
{ title: t('有效期开始'), dataIndex: 'dateFrom', sorter: true, width: 150},
|
||||||
|
{ title: t('有效期结束'), dataIndex: 'dateTo', sorter: true, width: 150},
|
||||||
|
{ title: t('备注)'), dataIndex: 'note', sorter: true, width: 180}
|
||||||
|
])
|
||||||
|
const columnsTrans = ref([
|
||||||
|
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 80},
|
||||||
|
{ title: t('交割点'), dataIndex: 'pointDelyName', sorter: true, width:150},
|
||||||
|
{ title: t('是否托运'), dataIndex: 'transName', sorter: true, width: 150},
|
||||||
|
{ title: t('托运商'), dataIndex: 'cpName', sorter: true, width: 130},
|
||||||
|
{ title: t('合同名称'), dataIndex: 'kName', sorter: true, width: 100},
|
||||||
|
{ title: t('管输上载点'), dataIndex: 'pointUpTransName', sorter: true, width: 150},
|
||||||
|
{ title: t('管输下载点'), dataIndex: 'pointDelyTransName', sorter: true, width: 150},
|
||||||
|
{ title: t('有效期开始'), dataIndex: 'dateFrom', sorter: true, width: 150},
|
||||||
|
{ title: t('有效期结束'), dataIndex: 'dateTo', sorter: true, width: 150},
|
||||||
|
{ title: t('备注)'), dataIndex: 'note', sorter: true, width: 180}
|
||||||
|
])
|
||||||
|
const dataListContractAgree = ref([])
|
||||||
|
const dataFile = ref([]);
|
||||||
|
const dataListAppro = ref([])
|
||||||
|
const dataListContractFact = ref([])
|
||||||
|
const dataListPoint = ref([{
|
||||||
|
"pointTransCode": "",
|
||||||
|
"transSign": "",
|
||||||
|
"note": null,
|
||||||
|
'pointDelyCode':'',
|
||||||
|
}])
|
||||||
|
let optionSelect= reactive({
|
||||||
|
approCodeList: [],
|
||||||
|
kPeriodList: [],
|
||||||
|
prcTypeCodeList: [],
|
||||||
|
uomCodeList: [],
|
||||||
|
periodTypeCodeList: [],
|
||||||
|
transSignList: [],
|
||||||
|
baseIncList: [],
|
||||||
|
zfbyTypeCodeList: []
|
||||||
|
});
|
||||||
|
watch(
|
||||||
|
() => props.id,
|
||||||
|
(val) => {
|
||||||
|
if (val) {
|
||||||
|
getInfo(val)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => props.disabled,
|
||||||
|
(val) => {
|
||||||
|
isDisable.value = val
|
||||||
|
if (val) {
|
||||||
|
let idx = columns.value.findIndex(v =>v.dataIndex == 'operation')
|
||||||
|
idx>-1 && columns.value.splice(idx, 1)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
onMounted(() => {
|
||||||
|
getOption()
|
||||||
|
if (pageId.value) {
|
||||||
|
getInfo(pageId.value)
|
||||||
|
} else {
|
||||||
|
formState.empName = userInfo.name
|
||||||
|
formState.empId = userInfo.id
|
||||||
|
formState.tel = userInfo.mobile
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
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(dataListPoint.value, formState.lngContractSalesPngPointList || [{}])
|
||||||
|
Object.assign(dataListContractAgree.value, formState.lngContractSalesPngQtyList || [])
|
||||||
|
Object.assign(dataFile.value, formState.lngFileUploadList || [])
|
||||||
|
Object.assign(dataListContractFact.value, formState.lngContractFactList || [])
|
||||||
|
Object.assign(dataListAppro.value, formState.lngApproVoList || [])
|
||||||
|
formState.dateCfmFrom = formState.dateCfmFrom ? dayjs(formState.dateCfmFrom) : null
|
||||||
|
formState.dateCfmTo = formState.dateCfmTo ? dayjs(formState.dateCfmTo) : null
|
||||||
|
formState.dateSign = formState.dateSign ? dayjs(formState.dateSign) : null
|
||||||
|
formState.dateFrom = formState.dateFrom ? dayjs(formState.dateFrom) : null
|
||||||
|
formState.dateTo = formState.dateTo ? dayjs(formState.dateTo) : null
|
||||||
|
formState.prcTypeCode = (formState?.lngContractSalesPngList[0] || {}).prcTypeCode
|
||||||
|
formState.periodTypeCode = (formState?.lngContractSalesPngList[0] || {}).periodTypeCode
|
||||||
|
formState.uomCode = (formState?.lngContractSalesPngList[0] || {}).uomCode
|
||||||
|
|
||||||
|
dataListAppro.value.forEach(v => {
|
||||||
|
v.approId = v.id
|
||||||
|
})
|
||||||
|
dataListContractFact.value.forEach(v => {
|
||||||
|
v.kFactId = v.id
|
||||||
|
})
|
||||||
|
dataListContractAgree.value.forEach(v => {
|
||||||
|
v.qtyM3Month = Number(v.qtyM3Month)/10000
|
||||||
|
v.qtyM3Day = Number(v.qtyM3Day)/10000
|
||||||
|
v.dateFrom = v.dateFrom ? dayjs(v.dateFrom) : null
|
||||||
|
v.dateTo = v.dateTo ? dayjs(v.dateTo) : null
|
||||||
|
});
|
||||||
|
getList()
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error, 'error')
|
||||||
|
spinning.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function getList () {
|
||||||
|
for (let i = 0; i < dataListPoint.value.length; i++) {
|
||||||
|
dataListPoint.value[i].transList = await getTransList(dataListPoint.value[i].pointDelyCode)
|
||||||
|
dataListPoint.value[i].purList = await getPurList(dataListPoint.value[i].pointDelyCode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function getOption() {
|
||||||
|
optionSelect.kPeriodList = await getDictionary('LNG_K_PER')
|
||||||
|
optionSelect.prcTypeCodeList = await getDictionary('LNG_PRC')
|
||||||
|
optionSelect.periodTypeCodeList = await getDictionary('LNG_PRC_P')
|
||||||
|
optionSelect.uomCodeList = await getDictionary('LNG_UOM')
|
||||||
|
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
||||||
|
optionSelect.transSignList = await getDictionary('LNG_YN')
|
||||||
|
optionSelect.baseIncList = await getDictionary('LNG_BASE')
|
||||||
|
optionSelect.zfbyTypeCodeList = await getDictionary('LNG_ZFBY')
|
||||||
|
|
||||||
|
|
||||||
|
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 getApproList = (val) => {
|
||||||
|
dataListAppro.value = val
|
||||||
|
}
|
||||||
|
const getApproContractFactList = (val) => {
|
||||||
|
console.log(val, 'dataListContractFact')
|
||||||
|
dataListContractFact.value = val
|
||||||
|
}
|
||||||
|
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 disabledDateCfmStart = (startValue) => {
|
||||||
|
const endValue = formState?.dateCfmTo;
|
||||||
|
if (!startValue || !endValue) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return startValue.valueOf() >= endValue.valueOf();
|
||||||
|
}
|
||||||
|
const disabledDateCfmEnd = (endValue) => {
|
||||||
|
const startValue = formState?.dateCfmFrom;
|
||||||
|
if (!endValue || !startValue) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return endValue.valueOf() <= startValue.valueOf();
|
||||||
|
}
|
||||||
|
const dateFromTb = (startValue, index, record) => {
|
||||||
|
if (!startValue) return
|
||||||
|
const endValue = dataListContractAgree.value[index]?.dateTo;
|
||||||
|
if (!startValue || !endValue) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (startValue.valueOf() > endValue.valueOf()) {
|
||||||
|
message.warning('结束日期须大于等于开始日期')
|
||||||
|
dataListContractAgree.value[index].dateFrom = ''
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dayCount(record)
|
||||||
|
}
|
||||||
|
|
||||||
|
const dateToTb = (endValue, index, record) => {
|
||||||
|
if (!endValue) return
|
||||||
|
const startValue = dataListContractAgree.value[index]?.dateFrom;
|
||||||
|
if (!endValue || !startValue) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (startValue.valueOf() > endValue.valueOf()) {
|
||||||
|
message.warning('结束日期须大于等于开始日期')
|
||||||
|
dataListContractAgree.value.splice(index, 1, { ...dataListContractAgree.value[index], dateTo: '' });
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dayCount(record)
|
||||||
|
}
|
||||||
|
const numChange = (key, record) => {
|
||||||
|
if (key == 'qtyGjMonth') {
|
||||||
|
numCount2(record)
|
||||||
|
dayCount(record)
|
||||||
|
}
|
||||||
|
if (key == 'qtyM3Month') {
|
||||||
|
numCount1(record)
|
||||||
|
dayCount(record)
|
||||||
|
}
|
||||||
|
if (key == 'rateM3Gj') {
|
||||||
|
numCount1(record)
|
||||||
|
numCount2(record)
|
||||||
|
dayCount(record)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const numCount1 = (record) => {
|
||||||
|
// 月气量(吉焦) =月气量(方)qty_m3_month*rate_m3_gj (比值(方/吉焦)
|
||||||
|
record.qtyGjMonth = (Number(record.qtyM3Month) || 0) * (Number(record.rateM3Gj) || 0)
|
||||||
|
record.qtyGjMonth = record.qtyGjMonth ? record.qtyGjMonth.toFixed(4) : '0'
|
||||||
|
}
|
||||||
|
const numCount2 = (record) => {
|
||||||
|
// 月气量(方) = 月气量(吉焦) qty_gj_month/rate_m3_gj/10000 显示时字段值/10000;保存时页面值*10000
|
||||||
|
record.qtyM3Month = Number(record.rateM3Gj) ? (Number(record.qtyGjMonth) || 0) /Number(record.rateM3Gj) : 0
|
||||||
|
record.qtyM3Month = record.qtyM3Month ? record.qtyM3Month.toFixed(4) : '0'
|
||||||
|
}
|
||||||
|
const dayCount = (record) => {
|
||||||
|
// 日气量(吉焦) = 月气量(吉焦)qty_gj_month/开始日期到结束日期的天数;计算结果保留整数
|
||||||
|
const days = dayjs(record.dateTo).diff(dayjs(record.dateFrom), 'day');
|
||||||
|
record.qtyGjDay = days ? (Number(record.qtyGjMonth) || 0) /days : 0
|
||||||
|
record.qtyGjDay = parseInt(record.qtyGjDay)
|
||||||
|
// 日气量(方) = 月气量(万方)/开始日期到结束日期的天数;计算结果保留4位小数;显示时字段值/10000;保存时页面值*10000
|
||||||
|
record.qtyM3Day = days ? (Number(record.qtyM3Month) || 0) /days : 0
|
||||||
|
record.qtyM3Day = record.qtyM3Day ? record.qtyM3Day.toFixed(4) : '0'
|
||||||
|
}
|
||||||
|
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 onSearchDownLoad = (val, index)=> {
|
||||||
|
curIdx.value = index
|
||||||
|
openModalDownLoad(true,{isUpdate: false, type: val})
|
||||||
|
}
|
||||||
|
const addContractAgree = () => {
|
||||||
|
dataListContractAgree.value.push({
|
||||||
|
dateFrom: null, dateTo: null, rateM3Gj: null, qtyGjMonth: null, qtyM3Month: null, qtyGjDay: null, qtyM3Day: null
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const addUpLoad = ()=> {
|
||||||
|
dataListPoint.value.push({
|
||||||
|
"pointTransCode": "",
|
||||||
|
"transSign": "",
|
||||||
|
"note": null,
|
||||||
|
'pointDelyCode':'',
|
||||||
|
transList: [],
|
||||||
|
purList: []
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const deleteUpLoad = () => {
|
||||||
|
if (dataListPoint.value[dataListPoint.value.length -1].id) {
|
||||||
|
hasDel.value = true
|
||||||
|
}
|
||||||
|
if (dataListPoint.value.length == 1) return
|
||||||
|
dataListPoint.value.pop()
|
||||||
|
}
|
||||||
|
|
||||||
|
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 handleSuccessCustomer = (val) => {
|
||||||
|
formState.cpCode = val[0].cuCode
|
||||||
|
formState.cpName = val[0].cuName
|
||||||
|
}
|
||||||
|
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')
|
||||||
|
}
|
||||||
|
const handleSuccessDownLoad = async (val, type) => {
|
||||||
|
if (type == 'trans') {
|
||||||
|
dataListPoint.value[curIdx.value].pointTransCode = val[0].code
|
||||||
|
dataListPoint.value[curIdx.value].pointTransName = val[0].fullName
|
||||||
|
} else {
|
||||||
|
dataListPoint.value[curIdx.value].pointDelyCode = val[0].code
|
||||||
|
dataListPoint.value[curIdx.value].pointDelyName = val[0].fullName
|
||||||
|
dataListPoint.value[curIdx.value].transList = await getTransList(dataListPoint.value[curIdx.value].pointDelyCode)
|
||||||
|
dataListPoint.value[curIdx.value].purList = await getPurList(dataListPoint.value[curIdx.value].pointDelyCode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const btnCheck = (record, index) => {
|
||||||
|
dataListContractAgree.value.splice(index, 1)
|
||||||
|
}
|
||||||
|
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();
|
||||||
|
let arr = JSON.parse(JSON.stringify(dataListContractAgree.value))
|
||||||
|
for(let i=0; i<arr.length; i++) {
|
||||||
|
let isFlag = !arr[i].dateFrom || !arr[i].dateTo || !arr[i].baseInc || arr[i].rateM3Gj == null || arr[i].rateM3Gj == '' || arr[i].qtyGjMonth == null || arr[i].qtyGjMonth == ''|| arr[i].qtyM3Month == null || arr[i].qtyM3Month == ''
|
||||||
|
if (isFlag) {
|
||||||
|
message.warn('请完善合同约定必选项')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
arr[i].dateFrom = dayjs(arr[i].dateFrom).format('YYYY-MM-DD HH:mm:ss')
|
||||||
|
arr[i].dateTo = dayjs(arr[i].dateTo).format('YYYY-MM-DD HH:mm:ss')
|
||||||
|
arr[i].qtyM3Month = Number(arr[i].qtyM3Month)*10000
|
||||||
|
arr[i].qtyM3Day = Number(arr[i].qtyM3Day)*10000
|
||||||
|
}
|
||||||
|
dataListAppro.value.forEach((v,idx)=>{
|
||||||
|
v.tableName = 'Ing_contract'
|
||||||
|
v.sort = idx
|
||||||
|
})
|
||||||
|
dataListContractFact.value.forEach((v,idx)=> {
|
||||||
|
v.sort = idx
|
||||||
|
})
|
||||||
|
for(let i=0; i<dataListPoint.value.length; i++) {
|
||||||
|
dataListPoint.value[i].hasDel = hasDel.value
|
||||||
|
if (!dataListPoint.value[i].pointDelyCode || !dataListPoint.value[i].transSign) {
|
||||||
|
message.warn('请完善交割点必选项')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let newArr = dataListPoint.value.map(v=>v.pointTransCode)
|
||||||
|
let codeList = dataListPoint.value.map(v =>v.pointDelyCode)
|
||||||
|
const isRepeat=codeList.some((item,index,arr)=>arr.indexOf(item)!=index);
|
||||||
|
const isRepeatNew=newArr.some((item,index,arr)=>arr.indexOf(item)!=index);
|
||||||
|
if(isRepeat){
|
||||||
|
message.warn('交割点不可重复');
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(isRepeatNew){
|
||||||
|
message.warn('交气点不可重复');
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let obj = {
|
||||||
|
...formState,
|
||||||
|
lngContractSalesPngPointList: dataListPoint.value,
|
||||||
|
lngContractSalesPngQtyList: arr,
|
||||||
|
lngFileUploadList: dataFile.value,
|
||||||
|
lngContractFactRelList: dataListContractFact.value,
|
||||||
|
lngContractApproRelList: dataListAppro.value,
|
||||||
|
lngContractSalesPngList: [
|
||||||
|
{
|
||||||
|
...formState.lngContractSalesPngList[0],
|
||||||
|
"kId": formState.id,
|
||||||
|
"prcTypeCode": formState.prcTypeCode,
|
||||||
|
"periodTypeCode": formState.periodTypeCode,
|
||||||
|
"uomCode": formState.uomCode,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -74,9 +74,9 @@
|
|||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
//所有按钮
|
//所有按钮
|
||||||
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"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":false},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}]);
|
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"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}]);
|
||||||
//展示在列表内的按钮
|
//展示在列表内的按钮
|
||||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord', 'update', 'approve']);
|
||||||
const buttonConfigs = computed(()=>{
|
const buttonConfigs = computed(()=>{
|
||||||
return filterButtonAuth(buttons.value);
|
return filterButtonAuth(buttons.value);
|
||||||
})
|
})
|
||||||
@ -89,7 +89,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,}
|
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete, update:handleUpdate, approve:handleApprove}
|
||||||
|
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -122,7 +122,7 @@
|
|||||||
},
|
},
|
||||||
schemas: customSearchFormSchema,
|
schemas: customSearchFormSchema,
|
||||||
fieldMapToTime: [],
|
fieldMapToTime: [],
|
||||||
showResetButton: false,
|
showResetButton: true,
|
||||||
},
|
},
|
||||||
beforeFetch: (params) => {
|
beforeFetch: (params) => {
|
||||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||||
@ -159,7 +159,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) {
|
||||||
@ -169,18 +171,32 @@
|
|||||||
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 {
|
||||||
router.push({
|
if (schemaIdComputedRef.value) {
|
||||||
path: '/form/ContractSales/' + record.id + '/viewForm',
|
router.push({
|
||||||
query: {
|
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||||
formPath: 'contract/ContractSales',
|
query: {
|
||||||
formName: formName,
|
formPath: 'contract/ContractSales',
|
||||||
formId:currentRoute.value.meta.formId
|
formName: formName,
|
||||||
}
|
formId:currentRoute.value.meta.formId,
|
||||||
});
|
type:'edit',
|
||||||
|
id: record.id,
|
||||||
|
disabled: 1,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// router.push({
|
||||||
|
// path: '/form/ContractSales/' + record.id + '/viewForm',
|
||||||
|
// query: {
|
||||||
|
// formPath: 'contract/ContractSales',
|
||||||
|
// formName: formName,
|
||||||
|
// formId:currentRoute.value.meta.formId
|
||||||
|
// }
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,15 +227,57 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleEdit(record: Recordable) {
|
function handleEdit(record: Recordable) {
|
||||||
|
if (schemaIdComputedRef.value) {
|
||||||
router.push({
|
router.push({
|
||||||
path: '/form/ContractSales/' + record.id + '/updateForm',
|
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||||
query: {
|
query: {
|
||||||
formPath: 'contract/ContractSales',
|
formPath: 'contract/ContractSales',
|
||||||
formName: formName,
|
formName: formName,
|
||||||
formId:currentRoute.value.meta.formId
|
formId:currentRoute.value.meta.formId,
|
||||||
}
|
type:'edit',
|
||||||
});
|
id: record.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
router.push({
|
||||||
|
path: '/form/ContractSales/' + record.id + '/updateForm',
|
||||||
|
query: {
|
||||||
|
formPath: 'contract/ContractSales',
|
||||||
|
formName: formName,
|
||||||
|
formId:currentRoute.value.meta.formId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function handleUpdate(record: Recordable) {
|
||||||
|
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||||
|
if (schemaIdComputedRef.value) {
|
||||||
|
router.push({
|
||||||
|
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||||
|
query: {
|
||||||
|
formPath: 'contract/ContractSales',
|
||||||
|
formName: formName,
|
||||||
|
formId:currentRoute.value.meta.formId,
|
||||||
|
type:'update',
|
||||||
|
id: record.id,
|
||||||
|
processId: processId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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]);
|
||||||
@ -280,9 +338,11 @@
|
|||||||
|
|
||||||
let actionsList: ActionItem[] = [];
|
let actionsList: ActionItem[] = [];
|
||||||
let editAndDelBtn: ActionItem[] = [];
|
let editAndDelBtn: ActionItem[] = [];
|
||||||
let hasFlowRecord = false;
|
let updateBtn: ActionItem[] = [];
|
||||||
|
let approveBtn: ActionItem[] = [];
|
||||||
|
let hasFlowRecord = false;
|
||||||
actionButtonConfig.value?.map((button) => {
|
actionButtonConfig.value?.map((button) => {
|
||||||
if (['view', 'copyData'].includes(button.code)) {
|
if (['view', 'copyData', 'enable', 'disable'].includes(button.code)) {
|
||||||
actionsList.push({
|
actionsList.push({
|
||||||
icon: button?.icon,
|
icon: button?.icon,
|
||||||
tooltip: button?.name,
|
tooltip: button?.name,
|
||||||
@ -297,21 +357,49 @@
|
|||||||
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.approCode == 'WTJ' || record.approCode == 'YBH' ) {
|
||||||
if (record.workflowData.status) {
|
actionsList = actionsList.concat(editAndDelBtn);
|
||||||
actionsList.unshift(setIndexFlowStatus(record.workflowData))
|
|
||||||
} else {
|
|
||||||
actionsList = actionsList.concat(editAndDelBtn);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!record.workflowData?.processId) {
|
|
||||||
//与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上
|
|
||||||
actionsList = actionsList.concat(editAndDelBtn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// 审批中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) {
|
||||||
|
|||||||
@ -72,7 +72,7 @@ export const columns: BasicColumn[] = [
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'approCode',
|
dataIndex: 'approName',
|
||||||
title: '审批状态',
|
title: '审批状态',
|
||||||
componentType: 'select',
|
componentType: 'select',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|||||||
@ -288,8 +288,8 @@
|
|||||||
let obj = {
|
let obj = {
|
||||||
...formState,
|
...formState,
|
||||||
lngScoreDtlList: dataList.value,
|
lngScoreDtlList: dataList.value,
|
||||||
lngFileUploadList: dataFile.value
|
lngFileUploadList: dataFile.value,
|
||||||
|
approCode: pageType.value=='update' ? 'WTJ' : formState.approCode
|
||||||
}
|
}
|
||||||
spinning.value = true;
|
spinning.value = true;
|
||||||
let request = !formState.id ? addLngScore :updateLngScore
|
let request = !formState.id ? addLngScore :updateLngScore
|
||||||
|
|||||||
@ -74,9 +74,12 @@
|
|||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
//所有按钮
|
//所有按钮
|
||||||
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"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":"delete","icon":"ant-design:delete-outlined","isDefault":true}]);
|
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"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":"delete","icon":"ant-design:delete-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}]);
|
||||||
//展示在列表内的按钮
|
//展示在列表内的按钮
|
||||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord', 'update', 'approve']);
|
||||||
const buttonConfigs = computed(()=>{
|
const buttonConfigs = computed(()=>{
|
||||||
return filterButtonAuth(buttons.value);
|
return filterButtonAuth(buttons.value);
|
||||||
})
|
})
|
||||||
@ -89,7 +92,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,}
|
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete, update: handleUpdate, approve: handleApprove}
|
||||||
|
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -161,7 +164,8 @@
|
|||||||
taskId: taskIds[0],
|
taskId: taskIds[0],
|
||||||
formName: formName,
|
formName: formName,
|
||||||
formId:currentRoute.value.meta.formId,
|
formId:currentRoute.value.meta.formId,
|
||||||
id: record.id
|
id: record.id,
|
||||||
|
readonly: 1
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (schemaId && !taskIds && processId) {
|
} else if (schemaId && !taskIds && processId) {
|
||||||
@ -173,7 +177,6 @@
|
|||||||
formName: formName,
|
formName: formName,
|
||||||
formId:currentRoute.value.meta.formId,
|
formId:currentRoute.value.meta.formId,
|
||||||
id: record.id,
|
id: record.id,
|
||||||
status
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -250,6 +253,36 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function handleUpdate(record: Recordable) {
|
||||||
|
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||||
|
if (schemaIdComputedRef.value) {
|
||||||
|
router.push({
|
||||||
|
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||||
|
query: {
|
||||||
|
formPath: 'sales/ScoreCustomer',
|
||||||
|
formName: formName,
|
||||||
|
formId:currentRoute.value.meta.formId,
|
||||||
|
type:'update',
|
||||||
|
id: record.id,
|
||||||
|
processId: processId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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]);
|
||||||
}
|
}
|
||||||
@ -309,9 +342,11 @@
|
|||||||
|
|
||||||
let actionsList: ActionItem[] = [];
|
let actionsList: ActionItem[] = [];
|
||||||
let editAndDelBtn: ActionItem[] = [];
|
let editAndDelBtn: ActionItem[] = [];
|
||||||
let hasFlowRecord = false;
|
let updateBtn: ActionItem[] = [];
|
||||||
|
let approveBtn: ActionItem[] = [];
|
||||||
|
let hasFlowRecord = false;
|
||||||
actionButtonConfig.value?.map((button) => {
|
actionButtonConfig.value?.map((button) => {
|
||||||
if (['view', 'copyData'].includes(button.code)) {
|
if (['view', 'copyData', 'enable', 'disable'].includes(button.code)) {
|
||||||
actionsList.push({
|
actionsList.push({
|
||||||
icon: button?.icon,
|
icon: button?.icon,
|
||||||
tooltip: button?.name,
|
tooltip: button?.name,
|
||||||
@ -326,21 +361,49 @@
|
|||||||
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.approCode == 'WTJ' || record.approCode == 'YBH' ) {
|
||||||
if (record.workflowData.status) {
|
actionsList = actionsList.concat(editAndDelBtn);
|
||||||
// actionsList.unshift(setIndexFlowStatus(record.workflowData))
|
|
||||||
} else {
|
|
||||||
actionsList = actionsList.concat(editAndDelBtn);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!record.workflowData?.processId) {
|
|
||||||
//与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上
|
|
||||||
actionsList = actionsList.concat(editAndDelBtn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// 审批中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) {
|
||||||
|
|||||||
@ -47,6 +47,10 @@
|
|||||||
<FormInformation v-else :key="randKey" ref="formInformation" :disabled="false" :formAssignmentData="data.formAssignmentData" :formInfos="data.formInfos" :opinions="data.opinions" :opinionsComponents="data.opinionsComponents" />
|
<FormInformation v-else :key="randKey" ref="formInformation" :disabled="false" :formAssignmentData="data.formAssignmentData" :formInfos="data.formInfos" :opinions="data.opinions" :opinionsComponents="data.opinionsComponents" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="rQuery.type == 'update'">
|
||||||
|
<Title :font-size="18" default-value="流转信息"></Title>
|
||||||
|
<flow-history :items="historyList"></flow-history>
|
||||||
|
</div>
|
||||||
<a-modal :visible="showFlowChart" centered class="geg" closable title="流程图" width="1200px" @cancel="closeFlowChart">
|
<a-modal :visible="showFlowChart" centered class="geg" closable title="流程图" width="1200px" @cancel="closeFlowChart">
|
||||||
<process-information :process-id="processId" :xml="data.xml" />
|
<process-information :process-id="processId" :xml="data.xml" />
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@ -75,6 +79,8 @@
|
|||||||
import { ApproveCode, ApproveType } from '/@/enums/workflowEnum';
|
import { ApproveCode, ApproveType } from '/@/enums/workflowEnum';
|
||||||
import useEventBus from '/@/hooks/event/useEventBus';
|
import useEventBus from '/@/hooks/event/useEventBus';
|
||||||
import {customFormConfig} from './customFormConfig'
|
import {customFormConfig} from './customFormConfig'
|
||||||
|
import Title from '/@/components/Title/src/Title.vue';
|
||||||
|
import FlowHistory from '/@/components/SecondDev/FlowHistory.vue';
|
||||||
|
|
||||||
const { bus, CREATE_FLOW } = useEventBus();
|
const { bus, CREATE_FLOW } = useEventBus();
|
||||||
|
|
||||||
@ -90,6 +96,7 @@
|
|||||||
const rSchemaId = rParams.arg1;
|
const rSchemaId = rParams.arg1;
|
||||||
let rDraftsId = ref(rParams.arg2);
|
let rDraftsId = ref(rParams.arg2);
|
||||||
const taskId = ref();
|
const taskId = ref();
|
||||||
|
const historyList = ref([])
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const draftsJsonStr = localStorage.getItem('draftsJsonStr');
|
const draftsJsonStr = localStorage.getItem('draftsJsonStr');
|
||||||
const formJsonStr = localStorage.getItem('formJsonStr');
|
const formJsonStr = localStorage.getItem('formJsonStr');
|
||||||
@ -176,6 +183,11 @@
|
|||||||
await nextTick();
|
await nextTick();
|
||||||
await initDraftsFormData();
|
await initDraftsFormData();
|
||||||
await initFromFormData();
|
await initFromFormData();
|
||||||
|
|
||||||
|
if (rQuery.processId) {
|
||||||
|
let res = await getReStartProcessInfo(rQuery.taskId, rQuery.processId);
|
||||||
|
historyList.value = res?.taskApproveOpinions || []
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
async function initDraftsFormData() {
|
async function initDraftsFormData() {
|
||||||
@ -338,6 +350,12 @@
|
|||||||
}
|
}
|
||||||
async function onSave() {
|
async function onSave() {
|
||||||
let value = await formInformation.value.handleSubmit();
|
let value = await formInformation.value.handleSubmit();
|
||||||
|
if (rQuery.type == 'update') {
|
||||||
|
setTimeout(() => {
|
||||||
|
bus.emit(CREATE_FLOW, {});
|
||||||
|
close();
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
async function saveLaunchNew() {
|
async function saveLaunchNew() {
|
||||||
if (!taskId.value && rDraftsId.value != '0') {
|
if (!taskId.value && rDraftsId.value != '0') {
|
||||||
@ -367,7 +385,6 @@
|
|||||||
let value = await formInformation.value.handleSubmit(true);
|
let value = await formInformation.value.handleSubmit(true);
|
||||||
obj[key] = value
|
obj[key] = value
|
||||||
mainFormModels.value = obj
|
mainFormModels.value = obj
|
||||||
console.log(mainFormModels.value, 6666)
|
|
||||||
if (!value) return
|
if (!value) return
|
||||||
|
|
||||||
data.submitLoading = true;
|
data.submitLoading = true;
|
||||||
|
|||||||
@ -1,3 +1,12 @@
|
|||||||
export const customFormConfig = {
|
export const customFormConfig = {
|
||||||
codeList: ['addCustomer','addSupplier', 'addCustomerScore', 'addSupplierScore', 'addAppro', 'contractFactApprove', 'addContractPurPng'],
|
codeList: [
|
||||||
|
'addCustomer',
|
||||||
|
'addSupplier',
|
||||||
|
'addCustomerScore',
|
||||||
|
'addSupplierScore',
|
||||||
|
'addAppro',
|
||||||
|
'contractFactApprove',
|
||||||
|
'addContractPurPng',
|
||||||
|
'addContractSales'
|
||||||
|
],
|
||||||
};
|
};
|
||||||
@ -73,7 +73,7 @@ export const columns: BasicColumn[] = [
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'approCode',
|
dataIndex: 'approName',
|
||||||
title: '审批状态',
|
title: '审批状态',
|
||||||
componentType: 'select',
|
componentType: 'select',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|||||||
@ -289,7 +289,8 @@
|
|||||||
let obj = {
|
let obj = {
|
||||||
...formState,
|
...formState,
|
||||||
lngScoreDtlList: dataList.value,
|
lngScoreDtlList: dataList.value,
|
||||||
lngFileUploadList: dataFile.value
|
lngFileUploadList: dataFile.value,
|
||||||
|
approCode: pageType.value=='update' ? 'WTJ' : formState.approCode
|
||||||
|
|
||||||
}
|
}
|
||||||
spinning.value = true;
|
spinning.value = true;
|
||||||
|
|||||||
@ -74,9 +74,9 @@
|
|||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
//所有按钮
|
//所有按钮
|
||||||
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"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":"delete","icon":"ant-design:delete-outlined","isDefault":true}]);
|
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"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":"delete","icon":"ant-design:delete-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}]);
|
||||||
//展示在列表内的按钮
|
//展示在列表内的按钮
|
||||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord', 'update', 'approve']);
|
||||||
const buttonConfigs = computed(()=>{
|
const buttonConfigs = computed(()=>{
|
||||||
return filterButtonAuth(buttons.value);
|
return filterButtonAuth(buttons.value);
|
||||||
})
|
})
|
||||||
@ -89,7 +89,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,}
|
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete, update:handleUpdate, approve:handleApprove}
|
||||||
|
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -161,7 +161,8 @@
|
|||||||
taskId: taskIds[0],
|
taskId: taskIds[0],
|
||||||
formName: formName,
|
formName: formName,
|
||||||
formId:currentRoute.value.meta.formId,
|
formId:currentRoute.value.meta.formId,
|
||||||
id: record.id
|
id: record.id,
|
||||||
|
readonly: 1,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (schemaId && !taskIds && processId) {
|
} else if (schemaId && !taskIds && processId) {
|
||||||
@ -173,7 +174,6 @@
|
|||||||
formName: formName,
|
formName: formName,
|
||||||
formId:currentRoute.value.meta.formId,
|
formId:currentRoute.value.meta.formId,
|
||||||
id: record.id,
|
id: record.id,
|
||||||
status
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -250,6 +250,36 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function handleUpdate(record: Recordable) {
|
||||||
|
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||||
|
if (schemaIdComputedRef.value) {
|
||||||
|
router.push({
|
||||||
|
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||||
|
query: {
|
||||||
|
formPath: 'supplier/ScoreSupplier',
|
||||||
|
formName: formName,
|
||||||
|
formId:currentRoute.value.meta.formId,
|
||||||
|
type:'update',
|
||||||
|
id: record.id,
|
||||||
|
processId: processId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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]);
|
||||||
}
|
}
|
||||||
@ -309,9 +339,11 @@
|
|||||||
|
|
||||||
let actionsList: ActionItem[] = [];
|
let actionsList: ActionItem[] = [];
|
||||||
let editAndDelBtn: ActionItem[] = [];
|
let editAndDelBtn: ActionItem[] = [];
|
||||||
let hasFlowRecord = false;
|
let updateBtn: ActionItem[] = [];
|
||||||
|
let approveBtn: ActionItem[] = [];
|
||||||
|
let hasFlowRecord = false;
|
||||||
actionButtonConfig.value?.map((button) => {
|
actionButtonConfig.value?.map((button) => {
|
||||||
if (['view', 'copyData'].includes(button.code)) {
|
if (['view', 'copyData', 'enable', 'disable'].includes(button.code)) {
|
||||||
actionsList.push({
|
actionsList.push({
|
||||||
icon: button?.icon,
|
icon: button?.icon,
|
||||||
tooltip: button?.name,
|
tooltip: button?.name,
|
||||||
@ -326,21 +358,49 @@
|
|||||||
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.approCode == 'WTJ' || record.approCode == 'YBH' ) {
|
||||||
if (record.workflowData.status) {
|
actionsList = actionsList.concat(editAndDelBtn);
|
||||||
// actionsList.unshift(setIndexFlowStatus(record.workflowData))
|
|
||||||
} else {
|
|
||||||
actionsList = actionsList.concat(editAndDelBtn);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!record.workflowData?.processId) {
|
|
||||||
//与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上
|
|
||||||
actionsList = actionsList.concat(editAndDelBtn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// 审批中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) {
|
||||||
|
|||||||
@ -63,9 +63,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<a-form class="approval-form" :model="approvalData.stampInfo" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" @finish="onFinish" @finish-failed="onFinishFailed">
|
<a-form class="approval-form" :model="approvalData.stampInfo" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" @finish="onFinish" @finish-failed="onFinishFailed">
|
||||||
<!-- 电子签章 -->
|
<!-- 电子签章 -->
|
||||||
<a-form-item :label="t('电子签章')" name="stampId" :rules="[{ required: true, message: t('请选择电子签章') }]" v-if="data.hasStamp">
|
<!-- <a-form-item :label="t('电子签章')" name="stampId" :rules="[{ required: true, message: t('请选择电子签章') }]" v-if="data.hasStamp">
|
||||||
<SelectStamp v-if="data.hasStamp" v-model:stampId="approvalData.stampInfo.stampId" />
|
<SelectStamp v-if="data.hasStamp" v-model:stampId="approvalData.stampInfo.stampId" />
|
||||||
</a-form-item>
|
</a-form-item> -->
|
||||||
<a-form-item :label="t('签章密码')" name="password" :rules="[{ required: true, message: t('请输入签章密码') }]" v-if="data.hasStampPassword">
|
<a-form-item :label="t('签章密码')" name="password" :rules="[{ required: true, message: t('请输入签章密码') }]" v-if="data.hasStampPassword">
|
||||||
<a-input-password v-model:value="approvalData.stampInfo.password" />
|
<a-input-password v-model:value="approvalData.stampInfo.password" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|||||||
Reference in New Issue
Block a user