一单n制等功能,接入随手拍之前我先提交一版本

This commit is contained in:
王利强
2026-08-12 14:43:53 +08:00
parent ec76d588e2
commit 47deeedb22
664 changed files with 1429 additions and 2894 deletions

View File

@@ -46,35 +46,39 @@
<up-textarea v-model="formData.selfVerifyContent" placeholder="请输入隐患治理责任单位自行验收的情况"></up-textarea>
<view class="flex margin-bottom margin-top">
<view class="text-gray">下一步流程</view>
<view class="text-gray">是否结束销号</view>
<view class="text-red">*</view>
</view>
<view class="static-field">{{ nextStepDisplay }}</view>
<view class="flex margin-bottom margin-top">
<view class="text-gray">下一步处理人</view>
<view class="text-red">*</view>
</view>
<view class="select-trigger" @click="openAssigneePopup">
<view class="select-content" :class="{ 'text-gray': !selectedAssigneeName }">
{{ selectedAssigneeName || '请选择下一步处理人' }}
</view>
<text class="cuIcon-unfold"></text>
</view>
<view class="flex margin-bottom margin-top">
<view class="text-gray">短信提醒</view>
<view class="text-red">*</view>
</view>
<up-radio-group v-model="sendMsgFlagRadio" placement="row" activeColor="#2667e9">
<up-radio-group :key="'hazard-end-' + hazardEndRadio" v-model="hazardEndRadio" placement="row" activeColor="#2667e9">
<up-radio
label=""
name="yes"
label=""
name="no"
:customStyle="{ marginRight: '48rpx' }"
></up-radio>
<up-radio label="" name="no"></up-radio>
<up-radio label="" name="yes"></up-radio>
</up-radio-group>
<template v-if="!hazardEnd">
<view class="flex margin-bottom margin-top">
<view class="text-gray">下一步流程</view>
<view class="text-red">*</view>
</view>
<view class="static-field">{{ nextStepDisplay }}</view>
<view class="flex margin-bottom margin-top">
<view class="text-gray">短信提醒</view>
<view class="text-red">*</view>
</view>
<up-radio-group v-model="sendMsgFlagRadio" placement="row" activeColor="#2667e9">
<up-radio
label="是"
name="yes"
:customStyle="{ marginRight: '48rpx' }"
></up-radio>
<up-radio label="否" name="no"></up-radio>
</up-radio-group>
</template>
<view class="flex margin-top-xl" style="gap: 20rpx;">
<button class="round flex-sub" @click="handleCancel">取消</button>
<button class="bg-blue round flex-sub" @click="handleSubmit">提交申请</button>
@@ -90,6 +94,7 @@
@close="showHazardPicker = false"
></up-picker>
<!-- 暂时注释下一步处理人弹窗
<u-popup :show="showAssigneePopup" mode="bottom" round="20" @close="cancelAssigneeSelect">
<view class="user-popup">
<view class="popup-header">
@@ -118,11 +123,12 @@
</view>
</view>
</u-popup>
-->
</view>
</template>
<script setup>
import { ref, reactive, computed } from 'vue';
import { ref, reactive, computed, nextTick } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import {
applyDelete,
@@ -145,6 +151,9 @@
const selectableHazardList = ref([]);
const selectedDeptName = ref('');
const aiGenerating = ref(false);
const hazardEndRadio = ref('no');
const hazardEnd = computed(() => hazardEndRadio.value === 'yes');
const normalizeHazardEndRadio = (value) => (value === 'yes' ? 'yes' : 'no');
const sendMsgFlagRadio = ref('yes');
const sendMsgFlag = computed(() => sendMsgFlagRadio.value === 'yes');
@@ -542,10 +551,11 @@
uni.showToast({ title: '请选择隐患', icon: 'none' });
return;
}
if (!selectedAssigneeIdentityId.value) {
uni.showToast({ title: '请选择下一步处理人', icon: 'none' });
return;
}
// 暂时注释:下一步处理人必选校验
// if (!selectedAssigneeIdentityId.value) {
// uni.showToast({ title: '请选择下一步处理人', icon: 'none' });
// return;
// }
const params = {
hazardId: Number(selectedHazardId.value),
@@ -555,9 +565,14 @@
mainTreatmentContent: formData.mainTreatmentContent || '',
treatmentResult: formData.treatmentResult || '',
selfVerifyContent: formData.selfVerifyContent || '',
assigneeIdentityId: selectedAssigneeIdentityId.value,
sendMsgFlag: sendMsgFlag.value
hazardEnd: hazardEnd.value,
quickApprove: hazardEnd.value ? null : true,
sendMsgFlag: hazardEnd.value ? null : sendMsgFlag.value
};
// 非快速审批时需传 assigneeIdentityId
// if (!params.quickApprove) {
// params.assigneeIdentityId = selectedAssigneeIdentityId.value;
// }
try {
const res = await applyDelete(params);
@@ -587,16 +602,19 @@
const hazardFromOptions = buildWriteoffHazardFromOptions(options);
if (hazardFromOptions?.hazardId) {
await applySelectedHazard(hazardFromOptions);
return;
} else {
if (!hazardLocked.value) {
await fetchSelectableHazardList();
}
if (taskId.value) {
await fetchNextStep();
}
}
if (!hazardLocked.value) {
await fetchSelectableHazardList();
}
if (taskId.value) {
await fetchNextStep();
}
nextTick(() => {
hazardEndRadio.value = normalizeHazardEndRadio(hazardEndRadio.value);
});
});
</script>