7/4新增公安备案底部链接
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="关联房屋" prop="houseId">
|
||||
<el-cascader v-model="form.houseId" :options="treedata" @change="handleChangehouse" />
|
||||
<el-cascader v-model="form.houseId" :options="treedata" @change="handleChangeHouse" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="2"></el-col>
|
||||
@@ -22,7 +22,7 @@
|
||||
v-model="form.maintenanceItemId"
|
||||
placeholder="请选择维修项目"
|
||||
:options="maintenanceItemTreeData"
|
||||
@change="handleChangemaintenanceItem"
|
||||
@change="handleChangeMaintenanceItem"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -47,7 +47,7 @@
|
||||
<Holder :isMultiple="false" :userid="form.residentId ?? ''" ref="HolderRef" @change="handleChange">
|
||||
<template #default>
|
||||
<div class="residentBox" @click="choiceResidentFun">
|
||||
<div class="defaultbox" v-if="form.residentId === '' || form.residentId === null">
|
||||
<div class="defaultBox" v-if="form.residentId === '' || form.residentId === null">
|
||||
<span>请选择</span>
|
||||
<el-icon><Search /></el-icon>
|
||||
</div>
|
||||
@@ -114,14 +114,12 @@ import { gettreelistRepairProject } from '@/api/system/RepairProject';
|
||||
import { useHouseStore } from '@/store/modules/house';
|
||||
import { validator } from '@/utils/Reg';
|
||||
import { Plus } from '@element-plus/icons-vue';
|
||||
import { RepairProjectVO } from '@/api/system/RepairProject/type';
|
||||
|
||||
const houseStore = useHouseStore();
|
||||
const { treedata } = storeToRefs(houseStore);
|
||||
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/repair/uploadImages';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_pay_method } = toRefs<any>(proxy?.useDict('com_pay_method'));
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
@@ -147,7 +145,7 @@ const rules = ref({
|
||||
phone: [
|
||||
{ required: true, message: '请输入手机号', trigger: 'blur' },
|
||||
{
|
||||
validator: (_, val) => validator(val, 'phone'),
|
||||
validator: (_: any, val: string | number) => validator(val, 'phone'),
|
||||
message: '请输入正确的手机号码',
|
||||
trigger: 'blur'
|
||||
}
|
||||
@@ -155,8 +153,6 @@ const rules = ref({
|
||||
problem: [{ required: true, message: '请输入问题描述', trigger: 'blur' }]
|
||||
});
|
||||
const userid = ref(null);
|
||||
// 当前小区
|
||||
const currentviliage = ref();
|
||||
// 报修项目 tree 结构
|
||||
const maintenanceItemTreeData = ref();
|
||||
function init() {
|
||||
@@ -186,19 +182,14 @@ function init() {
|
||||
}
|
||||
init();
|
||||
|
||||
function handleTreeDisable(TreeData) {
|
||||
const arr = TreeData.map((item) => {
|
||||
if (item.status === '1') {
|
||||
item.disabled = true;
|
||||
} else {
|
||||
item.disabled = false;
|
||||
}
|
||||
function handleTreeDisable(TreeData: RepairProjectVO[]) {
|
||||
return TreeData.map((item) => {
|
||||
item.disabled = item.status === '1';
|
||||
if (item && item.children && item.children.length > 0) {
|
||||
item.children = handleTreeDisable(item.children);
|
||||
}
|
||||
return item;
|
||||
});
|
||||
return arr;
|
||||
}
|
||||
|
||||
// ! 上传图片 =--==================================================================
|
||||
@@ -235,14 +226,14 @@ function handleChange(pop) {
|
||||
}
|
||||
|
||||
// !== 房屋 ===========================================================================
|
||||
function handleChangehouse(val: (string | number)[]) {
|
||||
function handleChangeHouse(val: (string | number)[]) {
|
||||
if (val.length >= 3) {
|
||||
form.value.houseId = val.pop() as number;
|
||||
} else {
|
||||
form.value.houseId = null;
|
||||
}
|
||||
}
|
||||
function handleChangemaintenanceItem(val: (string | number)[]) {
|
||||
function handleChangeMaintenanceItem(val: (string | number)[]) {
|
||||
if (val.length >= 2) {
|
||||
form.value.maintenanceItemId = val.pop() as number;
|
||||
} else {
|
||||
@@ -258,28 +249,28 @@ const submitForm = () => {
|
||||
let str = '';
|
||||
if (fileList.value.length > 0) {
|
||||
// 有图片
|
||||
const formdata = new FormData();
|
||||
const formData = new FormData();
|
||||
fileList.value.forEach((item) => {
|
||||
if (item.raw && item.raw instanceof File) {
|
||||
formdata.append('files', item.raw);
|
||||
formData.append('files', item.raw);
|
||||
} else {
|
||||
str += item.url + ',';
|
||||
}
|
||||
});
|
||||
if (!hasFormData(formdata)) return sendForm(str);
|
||||
uploadRepairImages(formdata).then((res) => {
|
||||
const successlist = res.data.success;
|
||||
const errorlist = res.data.error;
|
||||
if (successlist.length > 0) {
|
||||
successlist.forEach((item) => {
|
||||
if (!hasFormData(formData)) return sendForm(str);
|
||||
uploadRepairImages(formData).then((res) => {
|
||||
const successList = res.data.success;
|
||||
const errorList = res.data.error;
|
||||
if (successList.length > 0) {
|
||||
successList.forEach((item: { url: string }) => {
|
||||
str += item.url + ',';
|
||||
});
|
||||
}
|
||||
if (errorlist.length > 0) {
|
||||
errorlist.forEach((item) => {
|
||||
if (errorList.length > 0) {
|
||||
errorList.forEach((item: string) => {
|
||||
fileList.value = fileList.value.filter((file) => file.name !== item);
|
||||
});
|
||||
ElMessage.error('图片上传失败: ' + errorlist.join(','));
|
||||
ElMessage.error('图片上传失败: ' + errorList.join(','));
|
||||
}
|
||||
sendForm(str);
|
||||
});
|
||||
@@ -293,14 +284,13 @@ const submitForm = () => {
|
||||
const sendForm = (str: string) => {
|
||||
form.value.problemImageUrl = str;
|
||||
if (userid.value) {
|
||||
updateRepair(form.value).then((res) => {
|
||||
updateRepair(form.value).then(() => {
|
||||
ElMessage.success('编辑成功');
|
||||
cancelForm();
|
||||
});
|
||||
} else {
|
||||
addRepair(form.value).then((res) => {
|
||||
addRepair(form.value).then(() => {
|
||||
ElMessage.success('添加成功');
|
||||
|
||||
cancelForm();
|
||||
});
|
||||
}
|
||||
@@ -367,7 +357,7 @@ const cancelForm = () => {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
padding: 0 10px;
|
||||
.defaultbox {
|
||||
.defaultBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
import { ref } from 'vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { addRepairProject, getRepairProject, listRepairProject, updateRepairProject } from '@/api/system/RepairProject';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_repair_project_types } = toRefs<any>(proxy?.useDict('com_repair_project_types'));
|
||||
const { com_repair_project_status } = toRefs<any>(proxy?.useDict('com_repair_project_status'));
|
||||
@@ -87,14 +88,14 @@ const rules = ref({
|
||||
const userid = ref(null);
|
||||
const options = ref([]);
|
||||
|
||||
function handleChange(val) {
|
||||
function handleChange(val: string) {
|
||||
if (!val) return;
|
||||
const find = options.value.find((item) => item.id === val);
|
||||
if (find) {
|
||||
form.value.projectType = find.projectType;
|
||||
}
|
||||
}
|
||||
// != ==========================================
|
||||
// != ==========================================8╬
|
||||
|
||||
async function init() {
|
||||
form.value = {
|
||||
@@ -106,8 +107,8 @@ async function init() {
|
||||
status: '0' //状态
|
||||
};
|
||||
const res = await listRepairProject();
|
||||
const arr = res.rows.filter((ite) => ite.projectLevel === 0);
|
||||
options.value = arr;
|
||||
|
||||
options.value = res.rows.filter((ite) => ite.projectLevel === 0);
|
||||
|
||||
if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
@@ -115,11 +116,7 @@ async function init() {
|
||||
form.value = res.data;
|
||||
form.value.status = res.data.status ?? '0' + '';
|
||||
options.value = options.value.map((ite) => {
|
||||
if (ite.id === res.data.id) {
|
||||
ite.disabled = true;
|
||||
} else {
|
||||
ite.disabled = false;
|
||||
}
|
||||
ite.disabled = ite.id === res.data.id;
|
||||
return ite;
|
||||
});
|
||||
handleChange(res.data.parentId);
|
||||
|
||||
@@ -13,17 +13,17 @@
|
||||
<span class="ml-20px color-blue cursor-pointer" @click="handleEdit">编辑</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="w-full h-full CarinfoBox">
|
||||
<div class="w-full h-full CarInfoBox">
|
||||
<el-row class="mb-20px">
|
||||
<el-col :span="10">
|
||||
<div class="carinfo_item">
|
||||
<div class="carInfo_Item">
|
||||
<div class="label">报修房屋</div>
|
||||
<div class="main">{{ form.houseName }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="4"></el-col>
|
||||
<el-col :span="10">
|
||||
<div class="carinfo_item">
|
||||
<div class="carInfo_Item">
|
||||
<div class="label">维修项目</div>
|
||||
<div class="main">{{ form.maintenanceItemName }}</div>
|
||||
</div>
|
||||
@@ -32,14 +32,14 @@
|
||||
|
||||
<el-row class="mb-20px">
|
||||
<el-col :span="10">
|
||||
<div class="carinfo_item">
|
||||
<div class="carInfo_Item">
|
||||
<div class="label">报修人</div>
|
||||
<div class="main">{{ form.residentName }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="4"></el-col>
|
||||
<el-col :span="10">
|
||||
<div class="carinfo_item">
|
||||
<div class="carInfo_Item">
|
||||
<div class="label">手机号码</div>
|
||||
<div class="main">{{ form.phone }}</div>
|
||||
</div>
|
||||
@@ -47,7 +47,7 @@
|
||||
</el-row>
|
||||
<el-row class="mb-20px">
|
||||
<el-col>
|
||||
<div class="carinfo_item">
|
||||
<div class="carInfo_Item">
|
||||
<div class="label">预约日期</div>
|
||||
<div class="main">{{ form.orderDate }}</div>
|
||||
</div>
|
||||
@@ -55,7 +55,7 @@
|
||||
</el-row>
|
||||
<el-row class="mb-20px">
|
||||
<el-col>
|
||||
<div class="carinfo_item">
|
||||
<div class="carInfo_Item">
|
||||
<div class="label">问题描述</div>
|
||||
<div class="main">{{ form.problem }}</div>
|
||||
</div>
|
||||
@@ -63,7 +63,7 @@
|
||||
</el-row>
|
||||
<el-row v-if="form.problemImageUrl.trim() === ''">
|
||||
<el-col :span="24">
|
||||
<div class="carinfo_item">
|
||||
<div class="carInfo_Item">
|
||||
<div class="label">附件</div>
|
||||
<div class="main fileImagebox">
|
||||
<el-image
|
||||
@@ -71,13 +71,13 @@
|
||||
:zoom-rate="1.2"
|
||||
:max-scale="7"
|
||||
:min-scale="0.2"
|
||||
:preview-src-list="form.problemImageUrl.split(',').filter((item) => item)"
|
||||
:preview-src-list="form.problemImageUrl.split(',').filter(Boolean)"
|
||||
show-progress
|
||||
:initial-index="0"
|
||||
v-for="(item, index) in form.problemImageUrl.split(',').filter((item) => item)"
|
||||
v-for="(item, index) in form.problemImageUrl.split(',').filter(Boolean)"
|
||||
:key="index"
|
||||
:src="splitImages(item)"
|
||||
class="carinfoImage"
|
||||
class="carInfoImage"
|
||||
></el-image>
|
||||
</div>
|
||||
</div>
|
||||
@@ -92,7 +92,7 @@
|
||||
<span>分配工单</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="preivewBody w-full h-full flex flex-items-start mt-2">
|
||||
<div class="repair w-full h-full flex flex-items-start mt-2">
|
||||
<div class="title">维修师傅</div>
|
||||
<div class="preivewBodybox flex-1 ml-5">
|
||||
<repairUser :is-multiple="false" :username="form.repairName" :userid="form.repairUserId" @change="handleChange"> </repairUser>
|
||||
@@ -260,7 +260,7 @@ if (route.query.id) {
|
||||
init();
|
||||
}
|
||||
|
||||
/** 派单 */
|
||||
/** 派单 ╬>*/
|
||||
function handleSend() {
|
||||
// 已分配
|
||||
form.value.problemStatus = '1';
|
||||
@@ -307,15 +307,15 @@ function handleEdit() {
|
||||
.ResidentMainBody {
|
||||
margin-top: 20px;
|
||||
flex: 1;
|
||||
.CarinfoBox {
|
||||
&.gridbox {
|
||||
.CarInfoBox {
|
||||
&.gridBox {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-rows: repeat(4, 1fr);
|
||||
gap: 20px;
|
||||
row-gap: 40px;
|
||||
}
|
||||
.carinfo_item {
|
||||
.carInfo_Item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
@@ -326,7 +326,7 @@ function handleEdit() {
|
||||
padding-right: 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.carinfoImage {
|
||||
.carInfoImage {
|
||||
margin: 10px;
|
||||
width: 200px;
|
||||
height: 150px;
|
||||
@@ -337,7 +337,7 @@ function handleEdit() {
|
||||
.subtitle {
|
||||
font-size: 15px;
|
||||
}
|
||||
.preivewBody {
|
||||
.repair {
|
||||
font-size: 16px;
|
||||
}
|
||||
.repairBox {
|
||||
|
||||
Reference in New Issue
Block a user