Browse Source

情指行、重点对象组织机构映射

main
wxc 11 months ago
parent
commit
c6f66680cd
  1. 28
      src/api/system/departMaping.ts
  2. 100
      src/views/system/Depart.vue
  3. 254
      src/views/system/DepartMaping.vue
  4. 19
      src/views/work/BatchDistribute.vue

28
src/api/system/departMaping.ts

@ -0,0 +1,28 @@
import request from "@/api/request";
export function listDepartMaping(source, query) {
return request.get({
url: '/depart/maping/' + source,
query
});
}
export function addDepartMaping(body) {
return request.post({
url: '/depart/maping',
body
});
}
export function updateDepartMaping(body) {
return request.put({
url: '/depart/maping',
body
});
}
export function delDepartMaping(id) {
return request.del({
url: '/depart/maping/' + id
});
}

100
src/views/system/Depart.vue

@ -74,50 +74,44 @@
</el-tab-pane>
<el-tab-pane label="列表" name="list">
<header class="mb-20">
<el-form>
<el-form :label-width="114">
<el-row>
<el-col :span="6">
<el-form-item label="机构简称">
<el-input
placeholder="请输入机构简称"
v-model="query.shortName"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="机构全称">
<el-input
placeholder="请输入机构全称"
v-model="query.name"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="机构编码">
<el-input
placeholder="请输入机构编码"
v-model="query.code"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="6">
<div class="flex end">
<el-button
type="primary"
@click="getList"
>查询</el-button
>
<el-button @click="reset"
>重置</el-button
>
</div>
</el-col>
</el-row>
</el-form>
<el-form :label-width="114">
<el-row>
<el-col :span="6">
<el-form-item label="机构简称">
<el-input
placeholder="请输入机构简称"
v-model="query.shortName"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="机构全称">
<el-input
placeholder="请输入机构全称"
v-model="query.name"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="机构编码">
<el-input
placeholder="请输入机构编码"
v-model="query.code"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="6">
<div class="flex end">
<el-button type="primary" @click="getList"
>查询</el-button
>
<el-button @click="reset">重置</el-button>
</div>
</el-col>
</el-row>
</el-form>
</header>
<div class="table-container">
@ -244,11 +238,17 @@
:headers="{ Authorization: getToken() }"
:show-file-list="false"
@success="handleSuccess"
accept="image/*"
>
<img v-if="form.img" :src="`${BASE_PATH}/file/stream/${form.img}`" class="depart-img" />
<div class="flex v-center center column upload-action" v-else>
<img
v-if="form.img"
:src="`${BASE_PATH}/file/stream/${form.img}`"
class="depart-img"
/>
<div
class="flex v-center center column upload-action"
v-else
>
<icon :size="16" name="el-icon-Plus" />
<span>上传照片</span>
</div>
@ -413,10 +413,10 @@ async function submit() {
function handleSuccess(result, file) {
if (result.code !== 200) {
feedback.msgError('上传失败')
return
feedback.msgError("上传失败");
return;
}
form.value.img = result.data.filePath
form.value.img = result.data.filePath;
}
</script>
<style lang="scss" scoped>

254
src/views/system/DepartMaping.vue

@ -0,0 +1,254 @@
<template>
<div class="container">
<el-tabs v-model="activeName">
<el-tab-pane label="情指行" name="情指行"> </el-tab-pane>
<el-tab-pane label="重点人员" name="重点人员"> </el-tab-pane>
<el-tab-pane label="民意感知" name="民意感知"> </el-tab-pane>
</el-tabs>
<header>
<el-row>
<el-col :span="12">
<div class="form-row flex">
<label class="text-center">{{ activeName }}</label>
<div class="flex wrap query-box">
<el-input
placeholder="单位编码"
v-model="query.originId"
clearable
style="width: 200px"
/>
<el-input
placeholder="单位名称"
v-model="query.originId"
clearable
style="width: 200px"
/>
</div>
</div>
</el-col>
<el-col :span="12">
<div class="form-row flex">
<label class="text-center">数字督察</label>
<div class="flex wrap query-box">
<div style="width: 280px">
<depart-tree-select
v-model="query.involveDepartId"
placeholder="请选择机构"
/>
</div>
</div>
</div>
</el-col>
</el-row>
<div class="flex between mt-20 mb-26">
<el-button type="primary" @click="handleAdd">
<template #icon><icon name="el-icon-Plus" /></template>
新增</el-button
>
<div>
<el-button type="primary" @click="getList">
<template #icon
><icon name="el-icon-Search"
/></template>
查询</el-button
>
<el-button @click="reset">重置</el-button>
</div>
</div>
</header>
<div class="table-container">
<el-table :data="list">
<el-table-column
:label="`${activeName}单位编码`"
prop="externalId"
width="150"
/>
<el-table-column
:label="`${activeName}单位名称`"
prop="externalName"
/>
<el-table-column label="数字督察单位" prop="internalName" />
<el-table-column
label="最后修改时间"
prop="updateTime"
width="160"
/>
<el-table-column label="操作" width="160">
<template #default="{ row }">
<el-button type="primary" link @click="handleEdit(row)"
>编辑</el-button
>
<el-button type="danger" link @click="handleDel(row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex end mt-8">
<el-pagination
@size-change="getList"
@current-change="getList"
:current-page="query.current"
:page-sizes="[10, 20, 50]"
v-model:page-size="query.size"
v-model:current-page="query.current"
layout="total, sizes, prev, pager, next"
:total="total"
>
</el-pagination>
</div>
</div>
<el-dialog
v-model="show"
:title="mode === 'add' ? '新增机构映射' : '编辑机构映射'"
width="600"
>
<el-form :label-width="140" :model="formData" ref="fomrRef">
<el-form-item
label="来源"
prop="source"
:rules="{
required: true,
message: '请选择',
trigger: ['blur'],
}"
>
<el-select
v-model="formData.source"
clearable
style="width: 280px"
>
<el-option label="情指行" value="情指行"></el-option>
<el-option label="重点人员" value="重点人员"></el-option>
<el-option label="民意感知" value="民意感知"></el-option>
</el-select>
</el-form-item>
<el-form-item
label="单位编码"
prop="externalId"
:rules="{
required: true,
message: '请输入',
trigger: ['blur'],
}"
>
<el-input
v-model="formData.externalId"
clearable
style="width: 280px"
placeholder="请输入"
/>
</el-form-item>
<el-form-item
label="单位名称"
prop="externalName"
:rules="{
required: true,
message: '请输入',
trigger: ['blur'],
}"
>
<el-input
v-model="formData.externalName"
clearable
style="width: 280px"
placeholder="请输入"
/>
</el-form-item>
<el-form-item
label="数字督察单位"
prop="internalId"
:rules="{
required: true,
message: '请选择',
trigger: ['blur'],
}"
>
<depart-tree-select
v-model="formData.internalId"
placeholder="请选择"
style="width: 280px"
/>
</el-form-item>
</el-form>
<footer class="flex end mt-40">
<el-button @click="show = false" size="large">取消</el-button>
<el-button type="primary" @click="submit" size="large"
>确定</el-button
>
</footer>
</el-dialog>
</template>
<script setup>
import {
listDepartMaping,
addDepartMaping,
updateDepartMaping,
delDepartMaping
} from "@/api/system/departMaping";
import feedback from "@/utils/feedback";
const activeName = ref("情指行");
const query = ref({});
const list = ref([]);
const total = ref(0);
function getList() {
listDepartMaping(activeName.value, query.value).then((data) => {
list.value = data.records;
total.value = data.total;
});
}
watch(activeName, () => {
getList();
});
onMounted(() => {
getList();
});
const show = ref(false);
const mode = ref("add");
const formData = ref({});
const fomrRef = ref();
function handleAdd() {
formData.value = {
source: activeName.value,
};
show.value = true;
mode.value = "add";
}
function handleEdit(row) {
formData.value = { ...row };
formData.value.source = activeName.value;
show.value = true;
mode.value = "edit";
}
async function handleDel(row) {
await feedback.confirm("确定要删除该数据?");
await delDepartMaping(row.id);
getList();
feedback.msgSuccess('删除成功')
}
async function submit() {
await fomrRef.value.validate();
if (mode.value === "add") {
await addDepartMaping(formData.value);
} else {
await updateDepartMaping(formData.value);
}
show.value = false;
formData.value = {
source: activeName.value,
};
getList();
feedback.msgSuccess('操作成功')
}
</script>
<style lang="scss" scoped>
</style>

19
src/views/work/BatchDistribute.vue

@ -6,16 +6,25 @@
<el-col :span="6">
<el-form-item label="任务名称">
<el-input
placeholder="请输入登录名"
v-model="query.userName"
placeholder="请输入任务名称"
v-model="query.taskName"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="数据来源">
<el-select v-model="query.source"
clearable>
<el-option label="标准模板" value="标准模板"></el-option>
<el-option label="12337" value="12337"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="下发时间">
<el-input
placeholder="请输入登录名"
v-model="query.userName"
<date-time-range-picker-ext
v-model="query.crtTime"
/>
</el-form-item>
</el-col>

Loading…
Cancel
Save