完成调查问卷
This commit is contained in:
@@ -51,16 +51,16 @@
|
||||
<el-table-column label="装修公司" align="center" prop="decorationCompany" />
|
||||
<el-table-column label="装修内容" align="center" prop="decorationContent" />
|
||||
<el-table-column label="装修押金" align="center" prop="decorationDeposit" />
|
||||
<el-table-column label="装修验收结果" align="center" prop="inspectionResult">
|
||||
<el-table-column label="验收结果" align="center" prop="inspectionResult">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_decoration_status" :value="scope.row.inspectionResult"></dict-tag>
|
||||
<dict-tag :options="com_decoration_status" :value="Number(scope.row.inspectionResult)"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请时间" align="center" prop="inspectionName" />
|
||||
<el-table-column label="验收人" align="center" prop="inspectionName" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['decoration:decoration:edit']">验收</el-button>
|
||||
<el-button link type="primary" @click="handleInspection(scope.row)" v-hasPermi="['decoration:decoration:edit']">验收</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['decoration:decoration:edit']">详情</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['decoration:decoration:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['decoration:decoration:remove']">删除</el-button>
|
||||
@@ -70,11 +70,33 @@
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="decorationFormRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="持卡人姓名" prop="inspectionName">
|
||||
<el-input v-model="form.inspectionName" placeholder="请输入持卡人姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="验收结果" prop="inspectionResult">
|
||||
<el-select v-model="form.inspectionResult" placeholder="请选择装修验收结果">
|
||||
<el-option v-for="item in com_decoration_status" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入" :rows="5"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Decoration" lang="ts">
|
||||
import { listDecoration, delDecoration } from '@/api/system/Decoration/index';
|
||||
import { listDecoration, delDecoration, updateDecoration } from '@/api/system/Decoration/index';
|
||||
import { DecorationVO, DecorationQuery, DecorationForm } from '@/api/system/Decoration/type';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@@ -91,6 +113,10 @@ const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const decorationFormRef = ref<ElFormInstance>();
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: DecorationForm = {
|
||||
id: undefined,
|
||||
@@ -120,7 +146,8 @@ const data = reactive<PageData<DecorationForm, DecorationQuery>>({
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '装修管理表id不能为空', trigger: 'blur' }]
|
||||
inspectionName: [{ required: true, message: '验收人姓名不能为空', trigger: 'blur' }],
|
||||
inspectionResult: [{ required: true, message: '验收结果不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
@@ -135,6 +162,17 @@ const getList = async () => {
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
decorationFormRef.value?.resetFields();
|
||||
};
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
@@ -172,6 +210,32 @@ const handleUpdate = async (row?: DecorationVO) => {
|
||||
});
|
||||
};
|
||||
|
||||
/** 验收 */
|
||||
const handleInspection = (row: DecorationVO) => {
|
||||
form.value = {
|
||||
...form.value,
|
||||
...row
|
||||
};
|
||||
console.log(form.value);
|
||||
dialog.visible = true;
|
||||
dialog.title = '验收';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
decorationFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateDecoration(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DecorationVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
|
||||
Reference in New Issue
Block a user