Commit 8144298d authored by 沈翠玲's avatar 沈翠玲

案件管理-临时标签

parent 546766b0
......@@ -101,6 +101,7 @@
});
const onHide = () => {
form.value = { tag: '', fileUrl: '', check: false };
uploadRef.value.clearFiles();
};
const handleFileSuccess = (response, file, fileList) => {
if (!response.success) {
......@@ -129,8 +130,10 @@
if (type == 'import') title.value = '导入批量添加标签'
if (type == 'del') title.value = '删除临时标签'
if (selectlist && selectlist.length) {
curParam.value['ids'] = selectlist.map((v) => v.id).join(',');
curParam.value['caseId'] = selectlist.map((v) => v.caseId).join(',');
} else {
delete paramsStatic.current
delete paramsStatic.size
curParam.value = paramsStatic;
}
listTags().then(res=>{
......@@ -189,8 +192,8 @@
const param = {
tags: form.value.tag,
}
if (!form.check) {
param['ids'] = curParam.value['ids']
if (!form.value.check) {
param['caseId'] = curParam.value['caseId']
}
deleteTag(param).then(res => {
if (res.success) {
......@@ -207,19 +210,6 @@
const downloadtemplate = () => {
downloadfile('/Loan/downloadTag', {}, '标签模版.xls');
};
const handleNodeClick = (data) => {
console.log(data);
};
const resetAllocation = () => {
editRowIndex.value = -1;
};
const changeNum = (type, row, index) => {
editRowIndex.value = index;
console.log('changeNum', type, row, index);
};
const leftChange = (value, direction) => {
console.log(value, direction); //这个就是它包含的所有的属性以及事件,如果需要别的操作直接执行,也可以查询到
};
defineExpose({
openModal,
......
......@@ -71,7 +71,7 @@
</template>
</el-dropdown>
<el-button type="primary" @click="delTag" style="margin-left: 10px">删除临时标签</el-button>
<el-button type="primary" @click="download" v-permission="'caseManageExport'" style="margin-left: 10px" v-if="dataValue === '对查询结果操作'">导出</el-button>
<el-button type="primary" @click="download" v-permission="'caseManageExport'" style="margin-left: 10px">导出</el-button>
</div>
<div style="font-size: 15px; margin-top: 10px;"
>选中项:{{ selectdList.length }}
......@@ -235,7 +235,18 @@
return obj;
};
const download = (row) => {
downloadfile('/LoanExcel/download', paramsStatic.value, '资产列表.xls');
if (dataValue.value === '对选中项操作' && (!selectdList.value || !selectdList.value.length)) {
return ElMessage.warning({
message: '请先选择操作对象!',
plain: true,
});
}
if (dataValue.value === '对选中项操作') {
const loanIds = selectdList.value.map(v => v.id).join(',')
downloadfile('/LoanExcel/download', {loanIds}, '资产列表.xls');
} else {
downloadfile('/LoanExcel/download', paramsStatic.value, '资产列表.xls');
}
};
const config = reactive({
id: 'caseManage',
......
......@@ -66,19 +66,27 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="是否启用白名单" prop="whitelistStatus">
<el-radio-group v-model="form.whitelistStatus">
<el-form-item class="w-full" label="是否启用IP验证" prop="ipStatus">
<el-radio-group v-model="form.ipStatus">
<el-radio value="Y"></el-radio>
<el-radio value="N"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24" v-if="form.whitelistStatus === 'Y'">
<el-col :span="24" v-if="form.ipStatus === 'Y'">
<el-form-item class="w-full" label="IP地址" prop="ip">
<el-input v-model="form.ip" placeholder="请输入IP地址" clearable />
</el-form-item>
</el-col>
<el-col :span="24" v-if="form.whitelistStatus === 'Y'">
<el-col :span="24">
<el-form-item class="w-full" label="是否启用MAC验证" prop="macStatus">
<el-radio-group v-model="form.macStatus">
<el-radio value="Y"></el-radio>
<el-radio value="N"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24" v-if="form.macStatus === 'Y'">
<el-form-item class="w-full" label="MAC地址" prop="mac">
<el-input v-model="form.mac" placeholder="请输入MAC地址" clearable />
</el-form-item>
......@@ -124,7 +132,8 @@
departmentId: null,
tenant: null,
status: 'enable',
whitelistStatus: 'N'
macStatus: 'N',
ipStatus: 'N'
});
const options = ref([]);
const departlist = ref([]);
......@@ -192,7 +201,8 @@
departmentId: null,
tenant: null,
status: 'enable',
whitelistStatus: 'N'
macStatus: 'N',
ipStatus: 'N'
};
formRef.value.clearValidate();
currentAccount.value = null;
......
......@@ -107,16 +107,32 @@
},
},
{
field: 'whitelistStatus',
title: '是否启用白名单',
field: 'macStatus',
title: '是否启用MAC验证',
width: 100,
enum: Status,
search: { el: 'select', props: { clearable: true }, labelWidth: 85 },
slots: {
default: ({ row }) => {
return (
<ElTag type={row.whitelistStatus == 'Y' ? 'primary' : 'danger'}>
{row.whitelistStatus == 'Y' ? '是' : '否'}
<ElTag type={row.macStatus == 'Y' ? 'primary' : 'danger'}>
{row.macStatus == 'Y' ? '是' : '否'}
</ElTag>
);
},
},
},
{
field: 'ipStatus',
title: '是否启用IP验证',
width: 100,
enum: Status,
search: { el: 'select', props: { clearable: true }, labelWidth: 85 },
slots: {
default: ({ row }) => {
return (
<ElTag type={row.ipStatus == 'Y' ? 'primary' : 'danger'}>
{row.ipStatus == 'Y' ? '是' : '否'}
</ElTag>
);
},
......
......@@ -17,8 +17,8 @@
</div>
</template>
<template v-if="title === '导入批量添加标签'">
<div class="flex items-center">
<div>上传文件:</div>
<div class="flex justify-center" >
<div style="line-height: 28px;">上传文件:</div>
<el-upload
class="avatar-uploader"
:headers="{ timeout: 600000 }"
......@@ -26,7 +26,7 @@
:action="upload.url"
:disabled="upload.isUploading"
accept=".xls, .xlsx"
:auto-upload="false"
:auto-upload="true"
:limit="1"
:on-success="handleFileSuccess"
:on-remove="handleRemove"
......@@ -38,9 +38,29 @@
</el-upload>
</div>
</template>
<template v-if="title === '删除临时标签'">
<div class="flex items-center">
<div>临时标签:</div>
<el-select
v-model="form.tag"
style="width: 200px"
placeholder="请选择临时标签"
>
<el-option
v-for="item in tagOpt"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</div>
<div class="w-full">
<el-checkbox v-model="form.check">从所有案件中删除此标签</el-checkbox>
</div>
</template>
</div>
<template #footer>
<el-button type="default" link style="margin-right:auto" v-if="title === '导入批量添加标签'" @click="downloadtemplate">点击下载模版</el-button>
<el-button type="primary" link style="float: left;" v-if="title === '导入批量添加标签'" @click="downloadtemplate">点击下载模版</el-button>
<el-button type="default" @click="showModal = false">取消</el-button>
<el-button type="primary" @click="submitForm">确认</el-button>
</template>
......@@ -51,22 +71,24 @@
import { UserFilled } from '@element-plus/icons-vue';
import { RefreshRight } from '@element-plus/icons-vue';
import { ElInputNumber } from 'element-plus';
import { addTag } from '@/api/property';
import { addTag, importTag, deleteTag, listTags } from '@/api/property';
import { inject } from 'vue';
import { computed } from 'vue';
import { getAppEnvConfig } from '@/utils/env';
import { reactive, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
const data = ref([]);
const uploadRef = ref();
const tabledata = ref([]);
const showModal = ref(false);
const form = ref({ tag: '' });
const form = ref({ tag: '', fileUrl: '', check: false });
const currentAllBtn = ref(1);
const editRowIndex = ref(-1);
const envs = getAppEnvConfig();
const radio = ref(0);
const tagOpt = ref([]);
const title = ref();
const curParam = ref({})
const downloadfile = inject('download');
......@@ -75,15 +97,16 @@
// 是否禁用上传
isUploading: false,
// 上传的地址
url: envs.VITE_GLOB_API_URL_PREFIX + '/Loan/importTag',
url: envs.VITE_GLOB_API_URL_PREFIX + '/sys/upload',
});
const onHide = () => {
form.value = { tag: '' };
form.value = { tag: '', fileUrl: '', check: false };
uploadRef.value.clearFiles();
};
const handleFileSuccess = (response, file, fileList) => {
if (!response.success) {
ElMessage.error({
message: response.message || '上传失败',
message: response.message || '检查失败',
plain: true,
});
upload.isUploading = false;
......@@ -94,12 +117,12 @@
message: '上传成功',
plain: true,
});
form.value.fileUrl = response.message;
upload.isUploading = false;
showModal.value = false;
emits('success');
}
};
const handleRemove = () => {
form.value.fileUrl = '';
};
const openModal = (type, paramsStatic, selectlist) => {
showModal.value = true;
......@@ -107,10 +130,17 @@
if (type == 'import') title.value = '导入批量添加标签'
if (type == 'del') title.value = '删除临时标签'
if (selectlist && selectlist.length) {
curParam.value['ids'] = selectlist.map((v) => v.id);
curParam.value['caseId'] = selectlist.map((v) => v.caseId).join(',');
} else {
delete paramsStatic.current
delete paramsStatic.size
curParam.value = paramsStatic;
}
listTags().then(res=>{
if (res.success) {
tagOpt.value = res.result
}
})
};
const uploadVideoProcess = (event, file, fileList) => {
upload.isUploading = true;
......@@ -121,11 +151,11 @@
const submitForm = () => {
if(title.value === '添加临时标签') {
addTag({
...form.value,
tag: form.value.tag,
...curParam.value
}).then(res => {
if (res.success) {
return ElMessage.success({
ElMessage.success({
message: '添加成功',
plain: true,
});
......@@ -134,27 +164,52 @@
}
})
} else if (title.value === '导入批量添加标签') {
uploadRef.value?.submit()
if (!form.value.fileUrl) {
return ElMessage.warning({
message: '请上传标签文件',
plain: true,
});
}
importTag({
fileUrl: form.value.fileUrl
}).then(res => {
if (res.success) {
ElMessage.success({
message: '上传成功',
plain: true,
});
showModal.value = false;
emits('success');
}
})
} else{
if (!form.value.tag) {
return ElMessage.warning({
message: '请选择临时标签',
plain: true,
});
}
const param = {
tags: form.value.tag,
}
if (!form.value.check) {
param['caseId'] = curParam.value['caseId']
}
deleteTag(param).then(res => {
if (res.success) {
ElMessage.success({
message: '上传成功',
plain: true,
});
showModal.value = false;
emits('success');
}
})
}
};
const downloadtemplate = () => {
downloadfile('/Loan/downloadTag', {}, '标签模版.xls');
};
const handleNodeClick = (data) => {
console.log(data);
};
const resetAllocation = () => {
editRowIndex.value = -1;
};
const changeNum = (type, row, index) => {
editRowIndex.value = index;
console.log('changeNum', type, row, index);
};
const leftChange = (value, direction) => {
console.log(value, direction); //这个就是它包含的所有的属性以及事件,如果需要别的操作直接执行,也可以查询到
};
defineExpose({
openModal,
......@@ -165,7 +220,7 @@
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
padding-left: 20px;
}
</style>
......@@ -88,8 +88,8 @@
</el-dropdown-menu>
</template>
</el-dropdown>
<el-button type="primary" @click="delTag" style="margin-left: 10px">删除临时标签</el-button>
<el-button type="primary" @click="stayCase">留案 </el-button>
<!-- <el-button type="primary" @click="delTag" style="margin-left: 10px">删除临时标签</el-button> -->
<el-button type="primary" style="margin-left: 10px" @click="stayCase">留案 </el-button>
</div>
</template>
</ProTable>
......@@ -153,7 +153,19 @@
}
const handleClick1 = () => {
tagModalRef.value?.openModal('import')
if (dataValue.value === '对选中项操作' && (!selectdList.value || !selectdList.value.length)) {
return ElMessage.warning({
message: '请先选择操作对象!',
plain: true,
});
}
if (dataValue.value === '对选中项操作') {
tagModalRef.value?.openModal('import', JSON.parse(JSON.stringify(curParam.value)),
JSON.parse(JSON.stringify(selectdList.value)))
} else {
tagModalRef.value?.openModal('import', JSON.parse(JSON.stringify(curParam.value)),
[])
}
}
const delTag = () => {
tagModalRef.value?.openModal('del')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment