综合服务增加业务维修处理反馈,修复公告编辑新增浏览量问题
This commit is contained in:
1 parent
f60218c832
commit
c09fc8b1e5
4 files changed
+113
-18
No files matched your search
@@ -46,3 +46,11 @@ export function getScreenMaintenanceOrderList() {
|
||||
})
|
||||
}
|
||||
|
||||
export function handleObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/integrated/maintenanceOrder/handle',
|
||||
method: 'post',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<el-dialog title="开始处理" v-model="visible" :close-on-click-modal="false" draggable width="600px">
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="100px" v-loading="loading">
|
||||
<el-form-item label="处理情况" prop="handleRemark">
|
||||
<el-input
|
||||
v-model="form.handleRemark"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入处理情况"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="处理图片" prop="handlePicUrl">
|
||||
<upload-imgs v-model="form.handlePicUrl" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认提交</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="MaintenanceOrderHandleDialog">
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { handleObj } from "/@/api/integrated/maintenanceOrder"
|
||||
|
||||
const emit = defineEmits(["refresh"])
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref()
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id: "",
|
||||
handleRemark: "",
|
||||
handlePicUrl: "",
|
||||
status: "1", // 默认设置为已处理状态
|
||||
})
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
handleRemark: [{ required: true, message: "处理情况不能为空", trigger: "blur" }],
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = id
|
||||
form.handleRemark = ""
|
||||
form.handlePicUrl = ""
|
||||
form.status = "1" // 默认设置为已处理状态
|
||||
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields()
|
||||
})
|
||||
}
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await dataFormRef.value.validate().catch(() => {})
|
||||
if (!valid) return false
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
await handleObj(form)
|
||||
useMessage().success("处理成功")
|
||||
visible.value = false
|
||||
emit("refresh")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog,
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button icon="Check" text type="primary" v-if="scope.row.status != 1" @click="handleProcessed(scope.row)">
|
||||
标记为已处理
|
||||
开始处理
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -99,6 +99,9 @@
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
<!-- 处理弹窗 -->
|
||||
<handle-dialog ref="handleDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -110,11 +113,13 @@ import { useDict } from "/@/hooks/dict"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
const HandleDialog = defineAsyncComponent(() => import("./handleDialog.vue"))
|
||||
// 定义查询字典
|
||||
|
||||
const { maintenance_urgency, maintenance_status } = useDict("maintenance_urgency", "maintenance_status")
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const handleDialogRef = ref()
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
@@ -167,19 +172,8 @@ const handleDelete = async (ids: string[]) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 添加已处理操作
|
||||
const handleProcessed = async (row: any) => {
|
||||
try {
|
||||
await useMessageBox().confirm("确定将该工单标记为已处理吗?")
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
try {
|
||||
await putObj({ ...row, status: 1 })
|
||||
useMessage().success("已处理")
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
// 开始处理操作
|
||||
const handleProcessed = (row: any) => {
|
||||
handleDialogRef.value.openDialog(row.id)
|
||||
}
|
||||
</script>
|
||||
@@ -81,7 +81,7 @@ const loading = ref(false)
|
||||
const {push_status, is_top} = useDict('push_status', 'is_top')
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
const defaultForm = {
|
||||
id: '',
|
||||
description: '',
|
||||
status: '',
|
||||
@@ -92,7 +92,8 @@ const form = reactive({
|
||||
isTop: '',
|
||||
viewCount: '',
|
||||
expireTime: '',
|
||||
});
|
||||
}
|
||||
const form = reactive({ ...defaultForm })
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
@@ -115,7 +116,7 @@ const disabledTime = () => {
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = ''
|
||||
Object.assign(form, defaultForm)
|
||||
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
|
||||
Reference in new issue
Block a user