Browse Source

reactor:延期调整;

zhangchong 1 month ago
parent
commit
5a1c3590c5
2 changed files with 27 additions and 3 deletions
  1. 11 0
      src/api/business/delay.ts
  2. 16 3
      src/views/business/delay/components/Delay-audit.vue

+ 11 - 0
src/api/business/delay.ts

@@ -114,3 +114,14 @@ export const delayBatchApprove = (data: object) => {
 		data,
 	});
 };
+/**
+ * @description 延期审批时修改延期时限
+ * @param {object} data
+ */
+export const delayApproveModify = (data: object) => {
+	return request({
+		url: `/api/v1/Order/alter_delay_day`,
+		method: 'post',
+		data,
+	});
+};

+ 16 - 3
src/views/business/delay/components/Delay-audit.vue

@@ -36,7 +36,9 @@
 							<el-button size="small" type="primary" class="ml5" @click="editConfirm">确定</el-button>
 							<el-button size="small" class="decrease" @click="editMode = false">取消</el-button>
 						</template>
-						<!--            <el-button type="primary" link class="ml10" @click="editMode = true" v-if="!editMode" v-auth="'business:delay:audit:edit'">修改</el-button>-->
+						<el-button type="primary" link class="ml10" @click="editMode = true" v-if="!editMode && isAlterDay" v-auth="'business:delay:audit:edit'"
+							>修改</el-button
+						>
 					</el-form-item>
 				</el-col>
 				<!--				<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
@@ -156,7 +158,7 @@ import { commonEnum } from '@/utils/constants';
 import { useAppConfig } from '@/stores/appConfig';
 import { storeToRefs } from 'pinia';
 import other from '@/utils/other';
-import { delayApproveParams, delayDetail } from '@/api/business/delay';
+import { delayApproveModify, delayApproveParams, delayDetail } from '@/api/business/delay';
 
 const AnnexList = defineAsyncComponent(() => import('@/components/AnnexList/index.vue')); // 附件列表
 const CommonAdvice = defineAsyncComponent(() => import('@/components/CommonAdvice/index.vue')); // 常用意见
@@ -212,7 +214,16 @@ const getDetail = async () => {
 // 修改延期数量
 const editMode = ref<boolean>(false);
 // 确定修改延期数量
-const editConfirm = () => {};
+const editConfirm = () => {
+	delayApproveModify({ id: currentRow.value.id, delayNum: state.infoForm.delayNum })
+		.then(() => {
+			ElMessage.success('修改成功');
+			getDetail();
+		})
+		.catch(() => {
+			getDetail();
+		});
+};
 const formatTraces = (val: any) => {
 	if (!val || !val.length) return [];
 	val.forEach((item: any) => {
@@ -234,10 +245,12 @@ const getWorkflow = async (workflowId: string) => {
 const nextHandlersRequired = ref<Boolean>(false); // 办理对象是否必填
 const canStartCountersign = ref<Boolean>(false); // 是否可以会签
 const selectNext = ref<any>({});
+const isAlterDay = ref<boolean>(false); // 是否可以修改申请天数
 // 查询流程办理节点
 const selectNextStepOptions = async (workflowId: string) => {
 	try {
 		const { result } = await delayApproveParams(workflowId); //获取延期审批流程参数
+		isAlterDay.value = result.isAlterDay ?? false;
 		state.nextStepOptions = result.steps; //办理对象选择内容
 		canStartCountersign.value = result.canStartCountersign ?? false; // 是否可以发起会签
 		if (state.nextStepOptions.length === 1) {