|
@@ -147,28 +147,51 @@
|
|
|
<el-form-item label="身份证号" prop="card" :rules="cardRules">
|
|
<el-form-item label="身份证号" prop="card" :rules="cardRules">
|
|
|
<el-input v-model="form.card" placeholder="请输入身份证号" />
|
|
<el-input v-model="form.card" placeholder="请输入身份证号" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="图片文件" prop="fileId">
|
|
|
|
|
- <el-upload ref="uploadRef"
|
|
|
|
|
- :limit="3"
|
|
|
|
|
- :multiple="true"
|
|
|
|
|
- accept=".jpg, .png"
|
|
|
|
|
- :headers="upload.headers"
|
|
|
|
|
- :action="upload.url + '?updateSupport=' + upload.updateSupport"
|
|
|
|
|
- :disabled="upload.isUploading"
|
|
|
|
|
- :data="{moduleName:'投诉模块'}"
|
|
|
|
|
- :before-upload="beforeUpload"
|
|
|
|
|
- :on-success="handleFileSuccess"
|
|
|
|
|
- :auto-upload="false"
|
|
|
|
|
- drag>
|
|
|
|
|
- <el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
|
|
|
|
- <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
|
|
- <template #tip>
|
|
|
|
|
- <div class="el-upload__tip text-center">
|
|
|
|
|
- <span>仅允许导入.jpg, .png格式文件。</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
|
|
+<!-- <el-form-item label="图片文件" :rules="imagesRules" prop="fileId">-->
|
|
|
|
|
+<!-- <el-upload ref="uploadRef"-->
|
|
|
|
|
+<!-- :limit="3"-->
|
|
|
|
|
+<!-- :multiple="true"-->
|
|
|
|
|
+<!-- accept=".jpg, .png"-->
|
|
|
|
|
+<!-- :headers="upload.headers"-->
|
|
|
|
|
+<!-- :action="upload.url + '?updateSupport=' + upload.updateSupport"-->
|
|
|
|
|
+<!-- :disabled="upload.isUploading"-->
|
|
|
|
|
+<!-- :data="{moduleName:'投诉模块'}"-->
|
|
|
|
|
+<!-- :before-upload="beforeUpload"-->
|
|
|
|
|
+<!-- :on-success="handleFileSuccess"-->
|
|
|
|
|
+<!-- :auto-upload="false"-->
|
|
|
|
|
+<!-- drag>-->
|
|
|
|
|
+<!-- <el-icon class="el-icon--upload"><upload-filled /></el-icon>-->
|
|
|
|
|
+<!-- <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>-->
|
|
|
|
|
+<!-- <template #tip>-->
|
|
|
|
|
+<!-- <div class="el-upload__tip text-center">-->
|
|
|
|
|
+<!-- <span>仅允许导入.jpg, .png格式文件。</span>-->
|
|
|
|
|
+<!-- </div>-->
|
|
|
|
|
+<!-- </template>-->
|
|
|
|
|
+<!-- </el-upload>-->
|
|
|
|
|
+<!-- </el-form-item>-->
|
|
|
|
|
+ <el-form-item label="图片文件" prop="files">
|
|
|
|
|
+ <el-upload
|
|
|
|
|
+ ref="uploadRef"
|
|
|
|
|
+ v-model:file-list="fileList"
|
|
|
|
|
+ :action="upload.url"
|
|
|
|
|
+ list-type="picture-card"
|
|
|
|
|
+ :on-preview="handlePictureCardPreview"
|
|
|
|
|
+ :on-remove="handleRemove"
|
|
|
|
|
+ :multiple="true"
|
|
|
|
|
+ accept=".jpg, .png"
|
|
|
|
|
+ :before-upload="beforeUpload"
|
|
|
|
|
+ :on-success="handleFileSuccess"
|
|
|
|
|
+ :headers="upload.headers"
|
|
|
|
|
+ :data="{moduleName:'投诉模块'}"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-icon><Plus /></el-icon>
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog v-model="dialogVisible">
|
|
|
|
|
+ <img w-full :src="dialogImageUrl" alt="Preview Image" />
|
|
|
|
|
+ </el-dialog>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+
|
|
|
<el-form-item label="备注" prop="remark">
|
|
<el-form-item label="备注" prop="remark">
|
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -187,9 +210,10 @@
|
|
|
import { listComplain, getComplain, delComplain, addComplain, updateComplain } from "@/api/basicData/complain";
|
|
import { listComplain, getComplain, delComplain, addComplain, updateComplain } from "@/api/basicData/complain";
|
|
|
import {Editor} from "@wangeditor/editor-for-vue";
|
|
import {Editor} from "@wangeditor/editor-for-vue";
|
|
|
import {ElMessage} from "element-plus";
|
|
import {ElMessage} from "element-plus";
|
|
|
-import {reactive} from "vue";
|
|
|
|
|
|
|
+import {reactive, ref} from "vue";
|
|
|
import {getToken} from "../../../utils/auth";
|
|
import {getToken} from "../../../utils/auth";
|
|
|
import {likeQueryMethod} from "../../../utils/likeQueryMethod";
|
|
import {likeQueryMethod} from "../../../utils/likeQueryMethod";
|
|
|
|
|
+import {delImgById} from "../../../api/basicData/complain";
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
|
|
@@ -203,17 +227,41 @@ const multiple = ref(true);
|
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
|
const title = ref("");
|
|
const title = ref("");
|
|
|
const beforeUpdateLimit = ref(0);
|
|
const beforeUpdateLimit = ref(0);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+const fileList = ref([])
|
|
|
|
|
+
|
|
|
|
|
+const dialogImageUrl = ref('')
|
|
|
|
|
+const dialogVisible = ref(false)
|
|
|
|
|
+
|
|
|
|
|
+const handleRemove = (uploadFile, uploadFiles) => {
|
|
|
|
|
+ delImgById(uploadFile.id).then(res=>{
|
|
|
|
|
+ if(res.code === 200){
|
|
|
|
|
+ proxy.$modal.msgSuccess("删除成功");
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const handlePictureCardPreview = (uploadFile) => {
|
|
|
|
|
+ dialogImageUrl.value = uploadFile.url
|
|
|
|
|
+ dialogVisible.value = true
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
const cardRules = [
|
|
const cardRules = [
|
|
|
{ required: true, message: '请输入身份证号', trigger: 'blur' },
|
|
{ required: true, message: '请输入身份证号', trigger: 'blur' },
|
|
|
{ pattern: /^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/, message: '身份证号格式不正确' },
|
|
{ pattern: /^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/, message: '身份证号格式不正确' },
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
const handleFileSuccess = (e,v)=>{
|
|
const handleFileSuccess = (e,v)=>{
|
|
|
|
|
+ console.log(beforeUpdateLimit.value);
|
|
|
beforeUpdateLimit.value = beforeUpdateLimit.value-1
|
|
beforeUpdateLimit.value = beforeUpdateLimit.value-1
|
|
|
|
|
+ console.log(beforeUpdateLimit.value);
|
|
|
form.value.files.push(e.data)
|
|
form.value.files.push(e.data)
|
|
|
- if(beforeUpdateLimit.value == 0){
|
|
|
|
|
- task()
|
|
|
|
|
- }
|
|
|
|
|
if(e.code == 200){
|
|
if(e.code == 200){
|
|
|
ElMessage({
|
|
ElMessage({
|
|
|
type:"success",
|
|
type:"success",
|
|
@@ -223,18 +271,21 @@ const handleFileSuccess = (e,v)=>{
|
|
|
}
|
|
}
|
|
|
const task = ()=>{
|
|
const task = ()=>{
|
|
|
proxy.$refs["complainRef"].validate(valid => {
|
|
proxy.$refs["complainRef"].validate(valid => {
|
|
|
|
|
+ console.log(form.value.id);
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
if (form.value.id != null) {
|
|
if (form.value.id != null) {
|
|
|
updateComplain(form.value).then(response => {
|
|
updateComplain(form.value).then(response => {
|
|
|
proxy.$modal.msgSuccess("修改成功");
|
|
proxy.$modal.msgSuccess("修改成功");
|
|
|
open.value = false;
|
|
open.value = false;
|
|
|
getList();
|
|
getList();
|
|
|
|
|
+ beforeUpdateLimit.value = 0
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
addComplain(form.value).then(response => {
|
|
addComplain(form.value).then(response => {
|
|
|
proxy.$modal.msgSuccess("新增成功");
|
|
proxy.$modal.msgSuccess("新增成功");
|
|
|
open.value = false;
|
|
open.value = false;
|
|
|
getList();
|
|
getList();
|
|
|
|
|
+ beforeUpdateLimit.value = 0
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -254,7 +305,22 @@ const upload = reactive({
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const data = reactive({
|
|
const data = reactive({
|
|
|
- form: {},
|
|
|
|
|
|
|
+ form: {
|
|
|
|
|
+ id: null,
|
|
|
|
|
+ type: null,
|
|
|
|
|
+ title: null,
|
|
|
|
|
+ content: null,
|
|
|
|
|
+ name: null,
|
|
|
|
|
+ phone: null,
|
|
|
|
|
+ card: '',
|
|
|
|
|
+ fileId: null,
|
|
|
|
|
+ createBy: null,
|
|
|
|
|
+ createTime: null,
|
|
|
|
|
+ updateBy: null,
|
|
|
|
|
+ updateTime: null,
|
|
|
|
|
+ remark: null,
|
|
|
|
|
+ files:[]
|
|
|
|
|
+ },
|
|
|
queryParams: {
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
@@ -310,6 +376,7 @@ function reset() {
|
|
|
};
|
|
};
|
|
|
proxy.resetForm("complainRef");
|
|
proxy.resetForm("complainRef");
|
|
|
beforeUpdateLimit.value = 0
|
|
beforeUpdateLimit.value = 0
|
|
|
|
|
+ fileList.value = [];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
@@ -343,7 +410,14 @@ function handleUpdate(row) {
|
|
|
reset();
|
|
reset();
|
|
|
const id = row.id || ids.value
|
|
const id = row.id || ids.value
|
|
|
getComplain(id).then(response => {
|
|
getComplain(id).then(response => {
|
|
|
- form.value = response.data;
|
|
|
|
|
|
|
+ form.value = response.data.data;
|
|
|
|
|
+ fileList.value = response.data.data.files.map(item=>{
|
|
|
|
|
+ return{
|
|
|
|
|
+ name:item.fileName,
|
|
|
|
|
+ url: import.meta.env.VITE_APP_BASE_API + item.fileUrl,
|
|
|
|
|
+ id:item.id
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
open.value = true;
|
|
open.value = true;
|
|
|
title.value = "修改投诉";
|
|
title.value = "修改投诉";
|
|
|
});
|
|
});
|
|
@@ -355,6 +429,9 @@ const beforeUpload = ()=>{
|
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
|
function submitForm() {
|
|
function submitForm() {
|
|
|
proxy.$refs['uploadRef'].submit()
|
|
proxy.$refs['uploadRef'].submit()
|
|
|
|
|
+ if(beforeUpdateLimit.value == 0){
|
|
|
|
|
+ task()
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|