|
@@ -2,55 +2,67 @@
|
|
<Dialog v-model="visible" type="sm" title="任务反馈" class="box1" height="650px" hide-footer>
|
|
<Dialog v-model="visible" type="sm" title="任务反馈" class="box1" height="650px" hide-footer>
|
|
<div class="dialog-content">
|
|
<div class="dialog-content">
|
|
<div class="dialog-body">
|
|
<div class="dialog-body">
|
|
- <el-form ref="taskForm" :model="newTask">
|
|
|
|
|
|
+ <el-form ref="taskFormRef" :model="newTask" :rules="rules">
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-form-item label="任务描述:">
|
|
|
|
|
|
+ <el-form-item label="任务描述:" label-width="90px" >
|
|
<div class="display-field">{{ newTask.task_description }}</div>
|
|
<div class="display-field">{{ newTask.task_description }}</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-form-item label="任务类型:">
|
|
|
|
|
|
+ <el-form-item label="任务类型:" label-width="90px" >
|
|
<div class="display-field">{{ get_task_type_text(newTask.task_type) }}</div>
|
|
<div class="display-field">{{ get_task_type_text(newTask.task_type) }}</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-form-item label="执行人:">
|
|
|
|
|
|
+ <el-form-item label="登记人:" label-width="90px" >
|
|
<div class="display-field">{{ newTask.registrar }}</div>
|
|
<div class="display-field">{{ newTask.registrar }}</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-form-item label="执行单位:">
|
|
|
|
|
|
+ <el-form-item label="执行人:" label-width="90px" >
|
|
|
|
+ <div class="display-field">{{ newTask.executor }}</div>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-form-item label="执行单位:" label-width="90px" >
|
|
<div class="display-field">{{ newTask.unit_name }}</div>
|
|
<div class="display-field">{{ newTask.unit_name }}</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-form-item label="预估完成时间:">
|
|
|
|
- <div class="display-field">{{ newTask.complete_time }}</div>
|
|
|
|
|
|
+ <el-form-item label="联系电话:" label-width="90px" >
|
|
|
|
+ <div class="display-field">{{ newTask.contact_phone }}</div>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-form-item label="完成时限:" label-width="90px" >
|
|
|
|
+ <div class="display-field">{{ newTask.expire_time }}</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <!--
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-form-item label="图片:">
|
|
|
|
|
|
+ <el-form-item label="图片:">
|
|
<div class="display-field">{{ newTask.complete_time }}</div>
|
|
<div class="display-field">{{ newTask.complete_time }}</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-form-item label="文件:">
|
|
|
|
|
|
+ <el-form-item label="文件:">
|
|
<div class="display-field">{{ newTask.complete_time }}</div>
|
|
<div class="display-field">{{ newTask.complete_time }}</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ -->
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-form-item label="反馈人:">
|
|
|
|
|
|
+ <el-form-item label="反馈人:" label-width="90px" >
|
|
<div class="display-field">{{ newTask.registrar }}</div>
|
|
<div class="display-field">{{ newTask.registrar }}</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-form-item label="反馈内容:">
|
|
|
|
|
|
+ <el-form-item label="反馈内容:" label-width="90px" prop="feedback_content">
|
|
<el-input v-model="newTask.feedback_content" class="custom-input2" clearable placeholder="请输入反馈内容"></el-input>
|
|
<el-input v-model="newTask.feedback_content" class="custom-input2" clearable placeholder="请输入反馈内容"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-form-item label="完成进度:">
|
|
|
|
|
|
+ <el-form-item label="完成进度:" label-width="90px" prop="processing_status">
|
|
<el-select
|
|
<el-select
|
|
v-model="newTask.processing_status"
|
|
v-model="newTask.processing_status"
|
|
class="custom-select"
|
|
class="custom-select"
|
|
@@ -63,26 +75,8 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-form-item label="上传图片:">
|
|
|
|
- <!-- <el-upload-->
|
|
|
|
- <!-- v-model="newTask.attachments"-->
|
|
|
|
- <!-- action="/uploadAttachments"-->
|
|
|
|
- <!-- list-type="picture-card"-->
|
|
|
|
- <!-- :teleported="false"-->
|
|
|
|
- <!-- auto-upload="true"-->
|
|
|
|
- <!-- limit="9"-->
|
|
|
|
- <!-- :teleported="false"-->
|
|
|
|
- <!-- popper-class="custom-uploadper"-->
|
|
|
|
- <!-- class="custom-upload"-->
|
|
|
|
- <!-- :teleported="false"-->
|
|
|
|
- <!-- clearable-->
|
|
|
|
- <!-- filterable-->
|
|
|
|
- <!-- >-->
|
|
|
|
- <!-- <el-upload-list-item v-for="file in newTask.attachments" :key="file.name">-->
|
|
|
|
- <!-- <el-icon name="el-icon-upload" class="upload-icon"></el-icon>-->
|
|
|
|
- <!-- <el-button type="danger" size="mini" @click="removeAttachment(file)">移除</el-button>-->
|
|
|
|
- <!-- </el-upload-list-item>-->
|
|
|
|
- <!-- </el-upload>-->
|
|
|
|
|
|
+ <el-form-item label="上传图片:" label-width="90px" prop="attachList">
|
|
|
|
+ <FileUpload v-model="newTask.attachList" :file-type="['jpg', 'jpeg', 'png']" :limit="9" :file-size="5" class="upload-box" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -90,8 +84,9 @@
|
|
</div>
|
|
</div>
|
|
<div class="footer">
|
|
<div class="footer">
|
|
<div class="flex">
|
|
<div class="flex">
|
|
- <div class="common-btn-primary" :disabled="!isFormValid" @click="confirmRegister">确定</div>
|
|
|
|
<div class="common-btn" @click="closeDialog">取消</div>
|
|
<div class="common-btn" @click="closeDialog">取消</div>
|
|
|
|
+ <div class="common-btn-primary" :disabled="!isFormValid" @click="confirmRegister">确定</div>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -100,14 +95,18 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
import { ref, reactive, defineEmits, computed, watch } from 'vue';
|
|
import { ref, reactive, defineEmits, computed, watch } from 'vue';
|
|
-import { updateTaskRegistration } from '@/api/emergencyCommandMap/JointDuty.ts';
|
|
|
|
|
|
+import { updateTaskRegistration } from '@/api/emergencyCommandMap/JointDuty';
|
|
|
|
+const proxy = getCurrentInstance()?.proxy;
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
modelValue: { type: Boolean, required: true },
|
|
modelValue: { type: Boolean, required: true },
|
|
- task: { type: Object, default: () => ({ task_id: '', task_description: '', unit_name: '', registrar: '', processing_status: '' }) },
|
|
|
|
|
|
+ task: { type: Object, default: () => (
|
|
|
|
+ { task_id: '', task_description: '', unit_name: '', registrar: '', processing_status: '', feedback_content: '', attachList: [] })
|
|
|
|
+ },
|
|
eventId: { type: String, required: true }
|
|
eventId: { type: String, required: true }
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+const taskFormRef = ref();
|
|
const emit = defineEmits(['update:modelValue', 'update-success']);
|
|
const emit = defineEmits(['update:modelValue', 'update-success']);
|
|
const newTask = reactive({ ...props.task });
|
|
const newTask = reactive({ ...props.task });
|
|
const units = ref(['待处理', '已完成']);
|
|
const units = ref(['待处理', '已完成']);
|
|
@@ -120,6 +119,11 @@ const opt_task_type = [
|
|
{ text: "督办任务", value: "3" }
|
|
{ text: "督办任务", value: "3" }
|
|
];
|
|
];
|
|
|
|
|
|
|
|
+const rules = ref({
|
|
|
|
+ processing_status: [{ required: true, message: '完成进度不能为空', trigger: 'blur' }],
|
|
|
|
+ feedback_content: [{ required: true, message: '反馈内容不能为空', trigger: 'blur' }]
|
|
|
|
+});
|
|
|
|
+
|
|
const get_task_type_text = (val) => {
|
|
const get_task_type_text = (val) => {
|
|
return opt_task_type.find(item => item.value == val).text
|
|
return opt_task_type.find(item => item.value == val).text
|
|
}
|
|
}
|
|
@@ -138,26 +142,31 @@ const resetForm = () => {
|
|
newTask.unit_name = '';
|
|
newTask.unit_name = '';
|
|
newTask.registrar = '';
|
|
newTask.registrar = '';
|
|
newTask.processing_status = '';
|
|
newTask.processing_status = '';
|
|
|
|
+ newTask.attachList = [];
|
|
};
|
|
};
|
|
|
|
|
|
// 任务进度更新
|
|
// 任务进度更新
|
|
-const confirmRegister = async () => {
|
|
|
|
|
|
+const confirmRegister = () => {
|
|
console.log('任务进度更新:', newTask);
|
|
console.log('任务进度更新:', newTask);
|
|
- try {
|
|
|
|
- const response = await updateTaskRegistration({
|
|
|
|
- task_id: newTask.task_id,
|
|
|
|
- processing_status: newTask.processing_status,
|
|
|
|
- event_code: props.eventId
|
|
|
|
- });
|
|
|
|
- if (response.code === 200) {
|
|
|
|
- emit('update-success', newTask);
|
|
|
|
- closeDialog();
|
|
|
|
- } else {
|
|
|
|
- console.error('任务进度更新失败:', response.msg);
|
|
|
|
|
|
+ taskFormRef.value?.validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ updateTaskRegistration({
|
|
|
|
+ task_id: newTask.task_id,
|
|
|
|
+ processing_status: newTask.processing_status,
|
|
|
|
+ feedback_content: newTask.feedback_content,
|
|
|
|
+ attachList: newTask.attachList,
|
|
|
|
+ event_code: props.eventId
|
|
|
|
+ }).then((response)=>{
|
|
|
|
+ if (response.code === 200) {
|
|
|
|
+ proxy?.$modal.msgSuccess('任务进度更新成功');
|
|
|
|
+ emit('update-success', newTask);
|
|
|
|
+ closeDialog();
|
|
|
|
+ } else {
|
|
|
|
+ console.error('任务进度更新失败:', response.msg);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- } catch (error) {
|
|
|
|
- console.error('请求任务进度更新失败:', error);
|
|
|
|
- }
|
|
|
|
|
|
+ });
|
|
};
|
|
};
|
|
|
|
|
|
const closeDialog = () => {
|
|
const closeDialog = () => {
|