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

案件管理-临时标签

parent 546766b0
...@@ -101,6 +101,7 @@ ...@@ -101,6 +101,7 @@
}); });
const onHide = () => { const onHide = () => {
form.value = { tag: '', fileUrl: '', check: false }; form.value = { tag: '', fileUrl: '', check: false };
uploadRef.value.clearFiles();
}; };
const handleFileSuccess = (response, file, fileList) => { const handleFileSuccess = (response, file, fileList) => {
if (!response.success) { if (!response.success) {
...@@ -129,8 +130,10 @@ ...@@ -129,8 +130,10 @@
if (type == 'import') title.value = '导入批量添加标签' if (type == 'import') title.value = '导入批量添加标签'
if (type == 'del') title.value = '删除临时标签' if (type == 'del') title.value = '删除临时标签'
if (selectlist && selectlist.length) { if (selectlist && selectlist.length) {
curParam.value['ids'] = selectlist.map((v) => v.id).join(','); curParam.value['caseId'] = selectlist.map((v) => v.caseId).join(',');
} else { } else {
delete paramsStatic.current
delete paramsStatic.size
curParam.value = paramsStatic; curParam.value = paramsStatic;
} }
listTags().then(res=>{ listTags().then(res=>{
...@@ -189,8 +192,8 @@ ...@@ -189,8 +192,8 @@
const param = { const param = {
tags: form.value.tag, tags: form.value.tag,
} }
if (!form.check) { if (!form.value.check) {
param['ids'] = curParam.value['ids'] param['caseId'] = curParam.value['caseId']
} }
deleteTag(param).then(res => { deleteTag(param).then(res => {
if (res.success) { if (res.success) {
...@@ -207,19 +210,6 @@ ...@@ -207,19 +210,6 @@
const downloadtemplate = () => { const downloadtemplate = () => {
downloadfile('/Loan/downloadTag', {}, '标签模版.xls'); 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({ defineExpose({
openModal, openModal,
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</template> </template>
</el-dropdown> </el-dropdown>
<el-button type="primary" @click="delTag" style="margin-left: 10px">删除临时标签</el-button> <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>
<div style="font-size: 15px; margin-top: 10px;" <div style="font-size: 15px; margin-top: 10px;"
>选中项:{{ selectdList.length }} >选中项:{{ selectdList.length }}
...@@ -235,7 +235,18 @@ ...@@ -235,7 +235,18 @@
return obj; return obj;
}; };
const download = (row) => { 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({ const config = reactive({
id: 'caseManage', id: 'caseManage',
......
...@@ -66,19 +66,27 @@ ...@@ -66,19 +66,27 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item class="w-full" label="是否启用白名单" prop="whitelistStatus"> <el-form-item class="w-full" label="是否启用IP验证" prop="ipStatus">
<el-radio-group v-model="form.whitelistStatus"> <el-radio-group v-model="form.ipStatus">
<el-radio value="Y"></el-radio> <el-radio value="Y"></el-radio>
<el-radio value="N"></el-radio> <el-radio value="N"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </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-form-item class="w-full" label="IP地址" prop="ip">
<el-input v-model="form.ip" placeholder="请输入IP地址" clearable /> <el-input v-model="form.ip" placeholder="请输入IP地址" clearable />
</el-form-item> </el-form-item>
</el-col> </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-form-item class="w-full" label="MAC地址" prop="mac">
<el-input v-model="form.mac" placeholder="请输入MAC地址" clearable /> <el-input v-model="form.mac" placeholder="请输入MAC地址" clearable />
</el-form-item> </el-form-item>
...@@ -124,7 +132,8 @@ ...@@ -124,7 +132,8 @@
departmentId: null, departmentId: null,
tenant: null, tenant: null,
status: 'enable', status: 'enable',
whitelistStatus: 'N' macStatus: 'N',
ipStatus: 'N'
}); });
const options = ref([]); const options = ref([]);
const departlist = ref([]); const departlist = ref([]);
...@@ -192,7 +201,8 @@ ...@@ -192,7 +201,8 @@
departmentId: null, departmentId: null,
tenant: null, tenant: null,
status: 'enable', status: 'enable',
whitelistStatus: 'N' macStatus: 'N',
ipStatus: 'N'
}; };
formRef.value.clearValidate(); formRef.value.clearValidate();
currentAccount.value = null; currentAccount.value = null;
......
...@@ -107,16 +107,32 @@ ...@@ -107,16 +107,32 @@
}, },
}, },
{ {
field: 'whitelistStatus', field: 'macStatus',
title: '是否启用白名单', title: '是否启用MAC验证',
width: 100, width: 100,
enum: Status, enum: Status,
search: { el: 'select', props: { clearable: true }, labelWidth: 85 }, search: { el: 'select', props: { clearable: true }, labelWidth: 85 },
slots: { slots: {
default: ({ row }) => { default: ({ row }) => {
return ( return (
<ElTag type={row.whitelistStatus == 'Y' ? 'primary' : 'danger'}> <ElTag type={row.macStatus == 'Y' ? 'primary' : 'danger'}>
{row.whitelistStatus == 'Y' ? '是' : '否'} {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> </ElTag>
); );
}, },
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
</div> </div>
</template> </template>
<template v-if="title === '导入批量添加标签'"> <template v-if="title === '导入批量添加标签'">
<div class="flex items-center"> <div class="flex justify-center" >
<div>上传文件:</div> <div style="line-height: 28px;">上传文件:</div>
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
:headers="{ timeout: 600000 }" :headers="{ timeout: 600000 }"
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
:action="upload.url" :action="upload.url"
:disabled="upload.isUploading" :disabled="upload.isUploading"
accept=".xls, .xlsx" accept=".xls, .xlsx"
:auto-upload="false" :auto-upload="true"
:limit="1" :limit="1"
:on-success="handleFileSuccess" :on-success="handleFileSuccess"
:on-remove="handleRemove" :on-remove="handleRemove"
...@@ -38,9 +38,29 @@ ...@@ -38,9 +38,29 @@
</el-upload> </el-upload>
</div> </div>
</template> </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> </div>
<template #footer> <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="default" @click="showModal = false">取消</el-button>
<el-button type="primary" @click="submitForm">确认</el-button> <el-button type="primary" @click="submitForm">确认</el-button>
</template> </template>
...@@ -51,22 +71,24 @@ ...@@ -51,22 +71,24 @@
import { UserFilled } from '@element-plus/icons-vue'; import { UserFilled } from '@element-plus/icons-vue';
import { RefreshRight } from '@element-plus/icons-vue'; import { RefreshRight } from '@element-plus/icons-vue';
import { ElInputNumber } from 'element-plus'; import { ElInputNumber } from 'element-plus';
import { addTag } from '@/api/property'; import { addTag, importTag, deleteTag, listTags } from '@/api/property';
import { inject } from 'vue'; import { inject } from 'vue';
import { computed } from 'vue'; import { computed } from 'vue';
import { getAppEnvConfig } from '@/utils/env'; import { getAppEnvConfig } from '@/utils/env';
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
const data = ref([]); const data = ref([]);
const uploadRef = ref(); const uploadRef = ref();
const tabledata = ref([]); const tabledata = ref([]);
const showModal = ref(false); const showModal = ref(false);
const form = ref({ tag: '' }); const form = ref({ tag: '', fileUrl: '', check: false });
const currentAllBtn = ref(1); const currentAllBtn = ref(1);
const editRowIndex = ref(-1); const editRowIndex = ref(-1);
const envs = getAppEnvConfig(); const envs = getAppEnvConfig();
const radio = ref(0); const tagOpt = ref([]);
const title = ref(); const title = ref();
const curParam = ref({}) const curParam = ref({})
const downloadfile = inject('download'); const downloadfile = inject('download');
...@@ -75,15 +97,16 @@ ...@@ -75,15 +97,16 @@
// 是否禁用上传 // 是否禁用上传
isUploading: false, isUploading: false,
// 上传的地址 // 上传的地址
url: envs.VITE_GLOB_API_URL_PREFIX + '/Loan/importTag', url: envs.VITE_GLOB_API_URL_PREFIX + '/sys/upload',
}); });
const onHide = () => { const onHide = () => {
form.value = { tag: '' }; form.value = { tag: '', fileUrl: '', check: false };
uploadRef.value.clearFiles();
}; };
const handleFileSuccess = (response, file, fileList) => { const handleFileSuccess = (response, file, fileList) => {
if (!response.success) { if (!response.success) {
ElMessage.error({ ElMessage.error({
message: response.message || '上传失败', message: response.message || '检查失败',
plain: true, plain: true,
}); });
upload.isUploading = false; upload.isUploading = false;
...@@ -94,12 +117,12 @@ ...@@ -94,12 +117,12 @@
message: '上传成功', message: '上传成功',
plain: true, plain: true,
}); });
form.value.fileUrl = response.message;
upload.isUploading = false; upload.isUploading = false;
showModal.value = false;
emits('success');
} }
}; };
const handleRemove = () => { const handleRemove = () => {
form.value.fileUrl = '';
}; };
const openModal = (type, paramsStatic, selectlist) => { const openModal = (type, paramsStatic, selectlist) => {
showModal.value = true; showModal.value = true;
...@@ -107,10 +130,17 @@ ...@@ -107,10 +130,17 @@
if (type == 'import') title.value = '导入批量添加标签' if (type == 'import') title.value = '导入批量添加标签'
if (type == 'del') title.value = '删除临时标签' if (type == 'del') title.value = '删除临时标签'
if (selectlist && selectlist.length) { if (selectlist && selectlist.length) {
curParam.value['ids'] = selectlist.map((v) => v.id); curParam.value['caseId'] = selectlist.map((v) => v.caseId).join(',');
} else { } else {
delete paramsStatic.current
delete paramsStatic.size
curParam.value = paramsStatic; curParam.value = paramsStatic;
} }
listTags().then(res=>{
if (res.success) {
tagOpt.value = res.result
}
})
}; };
const uploadVideoProcess = (event, file, fileList) => { const uploadVideoProcess = (event, file, fileList) => {
upload.isUploading = true; upload.isUploading = true;
...@@ -121,11 +151,11 @@ ...@@ -121,11 +151,11 @@
const submitForm = () => { const submitForm = () => {
if(title.value === '添加临时标签') { if(title.value === '添加临时标签') {
addTag({ addTag({
...form.value, tag: form.value.tag,
...curParam.value ...curParam.value
}).then(res => { }).then(res => {
if (res.success) { if (res.success) {
return ElMessage.success({ ElMessage.success({
message: '添加成功', message: '添加成功',
plain: true, plain: true,
}); });
...@@ -134,27 +164,52 @@ ...@@ -134,27 +164,52 @@
} }
}) })
} else if (title.value === '导入批量添加标签') { } 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{ } 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 = () => { const downloadtemplate = () => {
downloadfile('/Loan/downloadTag', {}, '标签模版.xls'); 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({ defineExpose({
openModal, openModal,
...@@ -165,7 +220,7 @@ ...@@ -165,7 +220,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center;
height: 100%; height: 100%;
padding-left: 20px;
} }
</style> </style>
...@@ -88,8 +88,8 @@ ...@@ -88,8 +88,8 @@
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
<el-button type="primary" @click="delTag" style="margin-left: 10px">删除临时标签</el-button> <!-- <el-button type="primary" @click="delTag" style="margin-left: 10px">删除临时标签</el-button> -->
<el-button type="primary" @click="stayCase">留案 </el-button> <el-button type="primary" style="margin-left: 10px" @click="stayCase">留案 </el-button>
</div> </div>
</template> </template>
</ProTable> </ProTable>
...@@ -153,7 +153,19 @@ ...@@ -153,7 +153,19 @@
} }
const handleClick1 = () => { 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 = () => { const delTag = () => {
tagModalRef.value?.openModal('del') 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