feat : 战术研判,战略研判更新备用
This commit is contained in:
46
src/api/strategicApi.js
Normal file
46
src/api/strategicApi.js
Normal file
@ -0,0 +1,46 @@
|
||||
import request from "@/utils/request";
|
||||
const api = "/mosty-api/mosty-gsxt";
|
||||
|
||||
// 战略研判-分页查询
|
||||
export const strategicGet = (data, url) => {
|
||||
return request({
|
||||
url: url + `/ypbg/sjzl/getPageYpList`,
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 战略研判-新增
|
||||
export const strategicPost = (data, url) => {
|
||||
return request({
|
||||
url: url,
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 战略研判-删除
|
||||
export const strategicDelete = (data, url) => {
|
||||
return request({
|
||||
url: url,
|
||||
method: "delete",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 战略研判-根据ID查询详情
|
||||
export const strategicGetInfo = (id) => {
|
||||
return request({
|
||||
url: api + `/strategic/${id}`,
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
||||
// 战略研判-编辑
|
||||
export const strategicPut = (data, url) => {
|
||||
return request({
|
||||
url: url,
|
||||
method: "put",
|
||||
data
|
||||
})
|
||||
}
|
||||
62
src/api/tacticalApi.js
Normal file
62
src/api/tacticalApi.js
Normal file
@ -0,0 +1,62 @@
|
||||
import request from "@/utils/request";
|
||||
const api = "/mosty-api/mosty-gsxt";
|
||||
|
||||
/**
|
||||
* 战术研判-分页查询
|
||||
* @param {Object} params 查询参数
|
||||
* @param {number} [params.pageSize] 每页显示数量
|
||||
* @param {number} [params.pageCurrent] 页码
|
||||
* @param {string} [params.startTime] 开始时间
|
||||
* @param {string} [params.endTime] 结束时间
|
||||
* @param {string} [params.timeField] 时间范围查询字段
|
||||
* @param {string} [params.sort] 排序字段
|
||||
* @param {string} [params.order] 排序方式
|
||||
* @param {string} [params.ypyt] 研判议题
|
||||
* @param {string} [params.yppyq] 研判要求
|
||||
* @param {string} [params.ypfs] 研判方式(01 线上、02 线下、03 自建)
|
||||
* @param {string} [params.bglx] 报告类型(01 战术研判 02 战略研判)查询研判列表必传
|
||||
* @param {string} [params.ssbmdm] 所属部门代码
|
||||
* @returns {Promise} 请求Promise对象
|
||||
*/
|
||||
export const tacticalGet = (params) => {
|
||||
return request({
|
||||
url: api + `/ypbg/sjzl/getPageYpList`,
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 战术研判-新增
|
||||
export const tacticalPost = (data, url) => {
|
||||
return request({
|
||||
url: api,
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 战术研判-删除
|
||||
export const tacticalDelete = (data, url) => {
|
||||
return request({
|
||||
url: api,
|
||||
method: "delete",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 战术研判-根据ID查询详情
|
||||
export const tacticalGetInfo = (id) => {
|
||||
return request({
|
||||
url: api + `/tactical/${id}`,
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
||||
// 战术研判-编辑
|
||||
export const tacticalPut = (data, url) => {
|
||||
return request({
|
||||
url: api,
|
||||
method: "put",
|
||||
data
|
||||
})
|
||||
}
|
||||
@ -667,6 +667,24 @@ export const publicRoutes = [
|
||||
icon: "article"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/tacticalResearch",
|
||||
name: "tacticalResearch",
|
||||
component: () => import("@/views/backOfficeSystem/JudgmentHome/tacticalResearch/index"),
|
||||
meta: {
|
||||
title: "战术研判",
|
||||
icon: "article"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/strategicResearch",
|
||||
name: "strategicResearch",
|
||||
component: () => import("@/views/backOfficeSystem/JudgmentHome/strategicResearch/index"),
|
||||
meta: {
|
||||
title: "战略研判",
|
||||
icon: "article"
|
||||
}
|
||||
},
|
||||
|
||||
// {
|
||||
// path: "/analysisReport",
|
||||
|
||||
@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<div class="dialog" v-if="dialogForm">
|
||||
<div class="head_box">
|
||||
<span class="title">战略研判管理{{ title }} </span>
|
||||
<div>
|
||||
<el-button type="primary" size="small" :loading="loading" @click="submit">保存</el-button>
|
||||
<el-button size="small" @click="close">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_cnt">
|
||||
<FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules"></FormMessage>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { IdCard } from "@/utils/validate.js";
|
||||
import FormMessage from "@/components/aboutTable/FormMessage.vue";
|
||||
import { strategicGet, strategicPost, strategicPut } from "@/api/strategicApi.js";
|
||||
import * as rule from "@/utils/rules.js";
|
||||
import {
|
||||
ref,
|
||||
defineExpose,
|
||||
reactive,
|
||||
onMounted,
|
||||
defineEmits,
|
||||
getCurrentInstance,
|
||||
nextTick
|
||||
} from "vue";
|
||||
const emit = defineEmits(["updateDate"]);
|
||||
const props = defineProps({
|
||||
dic: Object
|
||||
});
|
||||
const validateIdentity = () => {
|
||||
return (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error("身份证号不能为空"));
|
||||
} else if (!/(^\d{15}$)|(^\d{17}(\d|X|x)$)/.test(value)) {
|
||||
callback(new Error("输入的身份证长度或格式错误"));
|
||||
}
|
||||
//身份证城市
|
||||
var aCity = {
|
||||
11: "北京",
|
||||
12: "天津",
|
||||
13: "河北",
|
||||
14: "山西",
|
||||
15: "内蒙古",
|
||||
21: "辽宁",
|
||||
22: "吉林",
|
||||
23: "黑龙江",
|
||||
31: "上海",
|
||||
32: "江苏",
|
||||
33: "浙江",
|
||||
34: "安徽",
|
||||
35: "福建",
|
||||
36: "江西",
|
||||
37: "山东",
|
||||
41: "河南",
|
||||
42: "湖北",
|
||||
43: "湖南",
|
||||
44: "广东",
|
||||
45: "广西",
|
||||
46: "海南",
|
||||
50: "重庆",
|
||||
51: "四川",
|
||||
52: "贵州",
|
||||
53: "云南",
|
||||
54: "西藏",
|
||||
61: "陕西",
|
||||
62: "甘肃",
|
||||
63: "青海",
|
||||
64: "宁夏",
|
||||
65: "新疆",
|
||||
71: "台湾",
|
||||
81: "香港",
|
||||
82: "澳门",
|
||||
91: "国外"
|
||||
};
|
||||
if (!aCity[parseInt(value?.substr(0, 2))])
|
||||
callback(new Error("身份证地区非法"));
|
||||
// 出生日期验证
|
||||
var sBirthday = (
|
||||
value.substr(6, 4) +
|
||||
"-" +
|
||||
Number(value.substr(10, 2)) +
|
||||
"-" +
|
||||
Number(value.substr(12, 2))
|
||||
).replace(/-/g, "-"),
|
||||
d = new Date(sBirthday);
|
||||
let yyyy = d.getFullYear();
|
||||
let mm = d.getMonth() + 1;
|
||||
let dd = d.getDate();
|
||||
if (sBirthday !== yyyy + "-" + mm + "-" + dd) {
|
||||
listQuery.value.ryCsrq = "";
|
||||
callback(new Error("身份证上的出生日期非法"));
|
||||
} else {
|
||||
let month = mm < 10 ? "0" + mm : mm;
|
||||
listQuery.value.ryCsrq = yyyy + "-" + month + "-" + dd;
|
||||
}
|
||||
// 身份证号码校验
|
||||
var sum = 0,
|
||||
weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2],
|
||||
codes = "10X98765432";
|
||||
for (var i = 0; i < value.length - 1; i++) {
|
||||
sum += value[i] * weights[i];
|
||||
}
|
||||
var last = codes[sum % 11]; //计算出来的最后一位身份证号码
|
||||
if (value[value.length - 1] !== last) {
|
||||
listQuery.value.ryXb = "";
|
||||
callback(new Error("输入的身份证号非法"));
|
||||
} else {
|
||||
if (value.length === 18) {
|
||||
listQuery.value.ryCsrq = IdCard(value, 1);
|
||||
listQuery.value.ryXb =
|
||||
parseInt(value.substr(16, 1)) % 2 === 1 ? "1" : "2";
|
||||
}
|
||||
}
|
||||
callback();
|
||||
};
|
||||
};
|
||||
const { proxy } = getCurrentInstance();
|
||||
const dialogForm = ref(false); //弹窗
|
||||
const formData = ref([
|
||||
// { label: "力量编号", prop: "bh", type: "input", width: "30%" },
|
||||
{ label: "管辖部门", prop: "gxbmDm", type: "department", width: "30%" },
|
||||
{ label: "姓名", prop: "ryXm", type: "input", width: "30%" },
|
||||
{ label: "联系电话", prop: "ryLxdh", type: "input", width: "30%" },
|
||||
{ label: "身份证号", prop: "rySfzh", type: "input", width: "30%" },
|
||||
{ label: "出生日期", prop: "ryCsrq", type: "date", width: "30%" },
|
||||
{ label: "性别", prop: "ryXb", type: "select", options: props.dic.D_BZ_XB, width: "30%" },
|
||||
{ label: "民族", prop: "ryMz", type: "select", options: props.dic.D_BZ_MZ, width: "30%" },
|
||||
{ label: "学历", prop: "ryXl", type: "select", options: props.dic.D_BZ_WHCD, width: "30%" },
|
||||
{
|
||||
label: "政治面貌",
|
||||
prop: "ryZzmm",
|
||||
type: "select",
|
||||
options: props.dic.D_BZ_ZZMM,
|
||||
width: "30%"
|
||||
},
|
||||
{ label: "所在单位", prop: "rySzdw", type: "input", width: "30%" },
|
||||
{ label: "工作阵地", prop: "gzzd", type: "input", width: "45%" },
|
||||
{ label: "作用发挥", prop: "zyfh", type: "input", width: "45%" },
|
||||
|
||||
{ label: "居住地地址", prop: "jzdDz", type: "textarea", width: "100%" }
|
||||
]);
|
||||
const listQuery = ref({}); //表单
|
||||
const loading = ref(false);
|
||||
const elform = ref();
|
||||
const title = ref("");
|
||||
const rules = reactive({
|
||||
gxbmDm: [{ required: true, message: "请选择管辖部门", trigger: "change" }],
|
||||
// ryXm: [{ required: true, message: "请输入人员姓名", trigger: "blur" }],
|
||||
// rySfzh: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: "请输入人员身份证号",
|
||||
// trigger: ["blur", "change"]
|
||||
// },
|
||||
// { trigger: ["blur", "change"], validator: validateIdentity() }
|
||||
// ],
|
||||
...rule.phoneRule({ require: true, validator: true }, "ryLxdh") // 是否必填 是否进行校验 可以传第二个参数
|
||||
});
|
||||
onMounted(() => { });
|
||||
|
||||
// 初始化数据
|
||||
const init = (type, row) => {
|
||||
dialogForm.value = true;
|
||||
title.value = type == "add" ? "新增" : "编辑";
|
||||
if (row) getDataById(row.id);
|
||||
};
|
||||
// 根据id查询详情
|
||||
const getDataById = (id) => {
|
||||
strategicGet({}, "/mosty-api/mosty-gsxt/strategic/" + id).then((res) => {
|
||||
listQuery.value = res;
|
||||
});
|
||||
};
|
||||
|
||||
// 提交
|
||||
const submit = () => {
|
||||
elform.value.submit((data) => {
|
||||
let url =
|
||||
title.value == "新增"
|
||||
? "/mosty-api/mosty-gsxt/strategic/save"
|
||||
: "/mosty-api/mosty-gsxt/strategic/update";
|
||||
let params = { ...data, ryLx: "03" }; // 战略研判类型标识
|
||||
strategicPost(params, url)
|
||||
.then((res) => {
|
||||
proxy.$message({ type: "success", message: title.value + "成功" });
|
||||
emit("updateDate");
|
||||
close();
|
||||
})
|
||||
.catch(() => { });
|
||||
});
|
||||
};
|
||||
|
||||
// 关闭
|
||||
const close = () => {
|
||||
listQuery.value = {};
|
||||
dialogForm.value = false;
|
||||
loading.value = false;
|
||||
};
|
||||
defineExpose({ init });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/css/layout.scss";
|
||||
@import "~@/assets/css/element-plus.scss";
|
||||
</style>
|
||||
@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="titleBox">
|
||||
<PageTitle title="战略研判">
|
||||
<el-button type="primary" @click="addEdit('add', '')">
|
||||
<el-icon style="vertical-align: middle">
|
||||
<CirclePlus />
|
||||
</el-icon>
|
||||
<span style="vertical-align: middle">新增</span>
|
||||
</el-button>
|
||||
</PageTitle>
|
||||
</div>
|
||||
<!-- 搜索 -->
|
||||
<div ref="searchBox">
|
||||
<Search :searchArr="searchConfiger" @submit="onSearch" :key="pageData.keyCount" />
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<div class="tabBox">
|
||||
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
||||
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth"
|
||||
@chooseData="chooseData">
|
||||
<template #ryMz="{ row }">
|
||||
<DictTag :tag="false" :value="row.ryMz" :options="D_BZ_MZ" />
|
||||
</template>
|
||||
<!-- 操作 -->
|
||||
<template #controls="{ row }">
|
||||
<el-link size="small" type="success" @click="addEdit('edit', row)">编辑</el-link>
|
||||
<el-link size="small" type="danger" @click="deleteRow(row.id)">删除</el-link>
|
||||
</template>
|
||||
</MyTable>
|
||||
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
|
||||
...pageData.pageConfiger,
|
||||
total: pageData.total
|
||||
}"></Pages>
|
||||
</div>
|
||||
<!-- 详情 -->
|
||||
<DetailForm v-if="show" @updateDate="getList" ref="detailDiloag"
|
||||
:dic="{ D_BZ_WHCD, D_BZ_MZ, D_BZ_XB, D_BZ_ZZMM }" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
||||
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||
import Pages from "@/components/aboutTable/Pages.vue";
|
||||
import Search from "@/components/aboutTable/Search.vue";
|
||||
import DetailForm from "./components/addForm.vue";
|
||||
import { strategicGet, strategicPost, strategicDelete } from "@/api/strategicApi.js";
|
||||
import { reactive, ref, onMounted, getCurrentInstance, nextTick } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { D_BZ_WHCD, D_BZ_MZ, D_BZ_XB, D_BZ_ZZMM } = proxy.$dict(
|
||||
"D_BZ_WHCD",
|
||||
"D_BZ_MZ",
|
||||
"D_BZ_XB",
|
||||
"D_BZ_ZZMM"
|
||||
); //获取字典数据
|
||||
const detailDiloag = ref();
|
||||
const searchBox = ref(); //搜索框
|
||||
const show = ref(false);
|
||||
const searchConfiger = ref([
|
||||
{ label: "姓名", prop: "ryXm", placeholder: "请输入姓名", showType: "input" },
|
||||
{
|
||||
label: "身份证号",
|
||||
prop: "rySfzh",
|
||||
placeholder: "请输入身份证号",
|
||||
showType: "input"
|
||||
}
|
||||
]);
|
||||
|
||||
const pageData = reactive({
|
||||
tableData: [],
|
||||
keyCount: 0,
|
||||
tableConfiger: {
|
||||
rowHieght: 61,
|
||||
showSelectType: "null",
|
||||
loading: false
|
||||
},
|
||||
total: 0,
|
||||
pageConfiger: {
|
||||
pageSize: 20,
|
||||
pageCurrent: 1
|
||||
},
|
||||
controlsWidth: 120,
|
||||
tableColumn: [
|
||||
{ label: "编号", prop: "bh" },
|
||||
{ label: "姓名", prop: "ryXm" },
|
||||
{ label: "联系电话", prop: "ryLxdh" },
|
||||
{ label: "身份证号", prop: "rySfzh" },
|
||||
{ label: "工作阵地", prop: "gzzd",showOverflowTooltip: true },
|
||||
{ label: "发挥作用", prop: "zyfh" ,showOverflowTooltip: true},
|
||||
{ label: "民族", prop: "ryMz", showSolt: true },
|
||||
{ label: "居住地址", prop: "jzdDz",showOverflowTooltip: true }
|
||||
]
|
||||
});
|
||||
|
||||
const queryFrom = ref({});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
tabHeightFn();
|
||||
});
|
||||
|
||||
// 搜索
|
||||
const onSearch = (val) => {
|
||||
queryFrom.value = { ...val };
|
||||
pageData.pageConfiger.pageCurrent = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
const changeNo = (val) => {
|
||||
pageData.pageConfiger.pageCurrent = val;
|
||||
getList();
|
||||
};
|
||||
const changeSize = (val) => {
|
||||
pageData.pageConfiger.pageSize = val;
|
||||
getList();
|
||||
};
|
||||
|
||||
// 获取列表
|
||||
const getList = () => {
|
||||
pageData.tableConfiger.loading = true;
|
||||
let data = { ...pageData.pageConfiger, ...queryFrom.value };
|
||||
strategicGet(data, "/mosty-api/mosty-gsxt/strategic/selectPage")
|
||||
.then((res) => {
|
||||
pageData.tableData = res.records || [];
|
||||
pageData.total = res.total;
|
||||
pageData.tableConfiger.loading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
pageData.tableConfiger.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
// 删除
|
||||
const deleteRow = (id) => {
|
||||
proxy
|
||||
.$confirm("确定要删除", "警告", { type: "warning" })
|
||||
.then(() => {
|
||||
strategicDelete({}, "/mosty-api/mosty-gsxt/strategic/" + id).then(() => {
|
||||
proxy.$message({ type: "success", message: "删除成功" });
|
||||
getList();
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
};
|
||||
|
||||
// 详情
|
||||
const addEdit = (type, row) => {
|
||||
show.value = true;
|
||||
nextTick(() => {
|
||||
detailDiloag.value.init(type, row);
|
||||
});
|
||||
};
|
||||
|
||||
// 表格高度计算
|
||||
const tabHeightFn = () => {
|
||||
pageData.tableHeight =
|
||||
window.innerHeight - searchBox.value.offsetHeight - 250;
|
||||
window.onresize = function () {
|
||||
tabHeightFn();
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-loading-mask {
|
||||
background: rgba(0, 0, 0, 0.5) !important;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<div class="dialog" v-if="dialogForm">
|
||||
<div class="head_box">
|
||||
<span class="title">战术研判管理{{ title }} </span>
|
||||
<div>
|
||||
<el-button type="primary" size="small" :loading="loading" @click="submit">保存</el-button>
|
||||
<el-button size="small" @click="close">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_cnt">
|
||||
<FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules"></FormMessage>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { IdCard } from "@/utils/validate.js";
|
||||
import FormMessage from "@/components/aboutTable/FormMessage.vue";
|
||||
import { tacticalGet, tacticalPost, tacticalPut } from "@/api/tacticalApi.js";
|
||||
import * as rule from "@/utils/rules.js";
|
||||
import {
|
||||
ref,
|
||||
defineExpose,
|
||||
reactive,
|
||||
onMounted,
|
||||
defineEmits,
|
||||
getCurrentInstance,
|
||||
nextTick
|
||||
} from "vue";
|
||||
const emit = defineEmits(["updateDate"]);
|
||||
const props = defineProps({
|
||||
dic: Object
|
||||
});
|
||||
const validateIdentity = () => {
|
||||
return (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error("身份证号不能为空"));
|
||||
} else if (!/(^\d{15}$)|(^\d{17}(\d|X|x)$)/.test(value)) {
|
||||
callback(new Error("输入的身份证长度或格式错误"));
|
||||
}
|
||||
//身份证城市
|
||||
var aCity = {
|
||||
11: "北京",
|
||||
12: "天津",
|
||||
13: "河北",
|
||||
14: "山西",
|
||||
15: "内蒙古",
|
||||
21: "辽宁",
|
||||
22: "吉林",
|
||||
23: "黑龙江",
|
||||
31: "上海",
|
||||
32: "江苏",
|
||||
33: "浙江",
|
||||
34: "安徽",
|
||||
35: "福建",
|
||||
36: "江西",
|
||||
37: "山东",
|
||||
41: "河南",
|
||||
42: "湖北",
|
||||
43: "湖南",
|
||||
44: "广东",
|
||||
45: "广西",
|
||||
46: "海南",
|
||||
50: "重庆",
|
||||
51: "四川",
|
||||
52: "贵州",
|
||||
53: "云南",
|
||||
54: "西藏",
|
||||
61: "陕西",
|
||||
62: "甘肃",
|
||||
63: "青海",
|
||||
64: "宁夏",
|
||||
65: "新疆",
|
||||
71: "台湾",
|
||||
81: "香港",
|
||||
82: "澳门",
|
||||
91: "国外"
|
||||
};
|
||||
if (!aCity[parseInt(value?.substr(0, 2))])
|
||||
callback(new Error("身份证地区非法"));
|
||||
// 出生日期验证
|
||||
var sBirthday = (
|
||||
value.substr(6, 4) +
|
||||
"-" +
|
||||
Number(value.substr(10, 2)) +
|
||||
"-" +
|
||||
Number(value.substr(12, 2))
|
||||
).replace(/-/g, "-"),
|
||||
d = new Date(sBirthday);
|
||||
let yyyy = d.getFullYear();
|
||||
let mm = d.getMonth() + 1;
|
||||
let dd = d.getDate();
|
||||
if (sBirthday !== yyyy + "-" + mm + "-" + dd) {
|
||||
listQuery.value.ryCsrq = "";
|
||||
callback(new Error("身份证上的出生日期非法"));
|
||||
} else {
|
||||
let month = mm < 10 ? "0" + mm : mm;
|
||||
listQuery.value.ryCsrq = yyyy + "-" + month + "-" + dd;
|
||||
}
|
||||
// 身份证号码校验
|
||||
var sum = 0,
|
||||
weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2],
|
||||
codes = "10X98765432";
|
||||
for (var i = 0; i < value.length - 1; i++) {
|
||||
sum += value[i] * weights[i];
|
||||
}
|
||||
var last = codes[sum % 11]; //计算出来的最后一位身份证号码
|
||||
if (value[value.length - 1] !== last) {
|
||||
listQuery.value.ryXb = "";
|
||||
callback(new Error("输入的身份证号非法"));
|
||||
} else {
|
||||
if (value.length === 18) {
|
||||
listQuery.value.ryCsrq = IdCard(value, 1);
|
||||
listQuery.value.ryXb =
|
||||
parseInt(value.substr(16, 1)) % 2 === 1 ? "1" : "2";
|
||||
}
|
||||
}
|
||||
callback();
|
||||
};
|
||||
};
|
||||
const { proxy } = getCurrentInstance();
|
||||
const dialogForm = ref(false); //弹窗
|
||||
const formData = ref([
|
||||
// { label: "力量编号", prop: "bh", type: "input", width: "30%" },
|
||||
{ label: "管辖部门", prop: "gxbmDm", type: "department", width: "30%" },
|
||||
{ label: "姓名", prop: "ryXm", type: "input", width: "30%" },
|
||||
{ label: "联系电话", prop: "ryLxdh", type: "input", width: "30%" },
|
||||
{ label: "身份证号", prop: "rySfzh", type: "input", width: "30%" },
|
||||
{ label: "出生日期", prop: "ryCsrq", type: "date", width: "30%" },
|
||||
{ label: "性别", prop: "ryXb", type: "select", options: props.dic.D_BZ_XB, width: "30%" },
|
||||
{ label: "民族", prop: "ryMz", type: "select", options: props.dic.D_BZ_MZ, width: "30%" },
|
||||
{ label: "学历", prop: "ryXl", type: "select", options: props.dic.D_BZ_WHCD, width: "30%" },
|
||||
{
|
||||
label: "政治面貌",
|
||||
prop: "ryZzmm",
|
||||
type: "select",
|
||||
options: props.dic.D_BZ_ZZMM,
|
||||
width: "30%"
|
||||
},
|
||||
{ label: "所在单位", prop: "rySzdw", type: "input", width: "30%" },
|
||||
{ label: "工作阵地", prop: "gzzd", type: "input", width: "45%" },
|
||||
{ label: "作用发挥", prop: "zyfh", type: "input", width: "45%" },
|
||||
|
||||
{ label: "居住地地址", prop: "jzdDz", type: "textarea", width: "100%" }
|
||||
]);
|
||||
const listQuery = ref({}); //表单
|
||||
const loading = ref(false);
|
||||
const elform = ref();
|
||||
const title = ref("");
|
||||
const rules = reactive({
|
||||
gxbmDm: [{ required: true, message: "请选择管辖部门", trigger: "change" }],
|
||||
// ryXm: [{ required: true, message: "请输入人员姓名", trigger: "blur" }],
|
||||
// rySfzh: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: "请输入人员身份证号",
|
||||
// trigger: ["blur", "change"]
|
||||
// },
|
||||
// { trigger: ["blur", "change"], validator: validateIdentity() }
|
||||
// ],
|
||||
...rule.phoneRule({ require: true, validator: true }, "ryLxdh") // 是否必填 是否进行校验 可以传第二个参数
|
||||
});
|
||||
onMounted(() => { });
|
||||
|
||||
// 初始化数据
|
||||
const init = (type, row) => {
|
||||
dialogForm.value = true;
|
||||
title.value = type == "add" ? "新增" : "编辑";
|
||||
if (row) getDataById(row.id);
|
||||
};
|
||||
// 根据id查询详情
|
||||
const getDataById = (id) => {
|
||||
tacticalGet({}, "/mosty-api/mosty-gsxt/tactical/" + id).then((res) => {
|
||||
listQuery.value = res;
|
||||
});
|
||||
};
|
||||
|
||||
// 提交
|
||||
const submit = () => {
|
||||
elform.value.submit((data) => {
|
||||
let url =
|
||||
title.value == "新增"
|
||||
? "/mosty-api/mosty-gsxt/tactical/save"
|
||||
: "/mosty-api/mosty-gsxt/tactical/update";
|
||||
let params = { ...data, ryLx: "02" }; // 战术研判类型标识
|
||||
tacticalPost(params, url)
|
||||
.then((res) => {
|
||||
proxy.$message({ type: "success", message: title.value + "成功" });
|
||||
emit("updateDate");
|
||||
close();
|
||||
})
|
||||
.catch(() => { });
|
||||
});
|
||||
};
|
||||
|
||||
// 关闭
|
||||
const close = () => {
|
||||
listQuery.value = {};
|
||||
dialogForm.value = false;
|
||||
loading.value = false;
|
||||
};
|
||||
defineExpose({ init });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/css/layout.scss";
|
||||
@import "~@/assets/css/element-plus.scss";
|
||||
</style>
|
||||
@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="titleBox">
|
||||
<PageTitle title="战术研判">
|
||||
<el-button type="primary" @click="addEdit('add', '')">
|
||||
<el-icon style="vertical-align: middle">
|
||||
<CirclePlus />
|
||||
</el-icon>
|
||||
<span style="vertical-align: middle">新增</span>
|
||||
</el-button>
|
||||
</PageTitle>
|
||||
</div>
|
||||
<!-- 搜索 -->
|
||||
<div ref="searchBox">
|
||||
<Search :searchArr="searchConfiger" @submit="onSearch" :key="pageData.keyCount" />
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<div class="tabBox">
|
||||
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
||||
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth"
|
||||
@chooseData="chooseData">
|
||||
<template #ryMz="{ row }">
|
||||
<DictTag :tag="false" :value="row.ryMz" :options="D_BZ_MZ" />
|
||||
</template>
|
||||
<!-- 操作 -->
|
||||
<template #controls="{ row }">
|
||||
<el-link size="small" type="success" @click="addEdit('edit', row)">编辑</el-link>
|
||||
<el-link size="small" type="danger" @click="deleteRow(row.id)">删除</el-link>
|
||||
</template>
|
||||
</MyTable>
|
||||
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
|
||||
...pageData.pageConfiger,
|
||||
total: pageData.total
|
||||
}"></Pages>
|
||||
</div>
|
||||
<!-- 详情 -->
|
||||
<DetailForm v-if="show" @updateDate="getList" ref="detailDiloag"
|
||||
:dic="{ D_BZ_WHCD, D_BZ_MZ, D_BZ_XB, D_BZ_ZZMM }" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
||||
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||
import Pages from "@/components/aboutTable/Pages.vue";
|
||||
import Search from "@/components/aboutTable/Search.vue";
|
||||
import DetailForm from "./components/addForm.vue";
|
||||
import { tacticalGet, tacticalPost, tacticalDelete } from "@/api/tacticalApi.js";
|
||||
import { reactive, ref, onMounted, getCurrentInstance, nextTick } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { D_BZ_WHCD, D_BZ_MZ, D_BZ_XB, D_BZ_ZZMM } = proxy.$dict(
|
||||
"D_BZ_WHCD",
|
||||
"D_BZ_MZ",
|
||||
"D_BZ_XB",
|
||||
"D_BZ_ZZMM"
|
||||
); //获取字典数据
|
||||
const detailDiloag = ref();
|
||||
const searchBox = ref(); //搜索框
|
||||
const show = ref(false);
|
||||
const searchConfiger = ref([
|
||||
{ label: "姓名", prop: "ryXm", placeholder: "请输入姓名", showType: "input" },
|
||||
{
|
||||
label: "身份证号",
|
||||
prop: "rySfzh",
|
||||
placeholder: "请输入身份证号",
|
||||
showType: "input"
|
||||
}
|
||||
]);
|
||||
|
||||
const pageData = reactive({
|
||||
tableData: [],
|
||||
keyCount: 0,
|
||||
tableConfiger: {
|
||||
rowHieght: 61,
|
||||
showSelectType: "null",
|
||||
loading: false
|
||||
},
|
||||
total: 0,
|
||||
pageConfiger: {
|
||||
pageSize: 20,
|
||||
pageCurrent: 1
|
||||
},
|
||||
controlsWidth: 120,
|
||||
tableColumn: [
|
||||
{ label: "编号", prop: "bh" },
|
||||
{ label: "姓名", prop: "ryXm" },
|
||||
{ label: "联系电话", prop: "ryLxdh" },
|
||||
{ label: "身份证号", prop: "rySfzh" },
|
||||
{ label: "工作阵地", prop: "gzzd",showOverflowTooltip: true },
|
||||
{ label: "发挥作用", prop: "zyfh" ,showOverflowTooltip: true},
|
||||
{ label: "民族", prop: "ryMz", showSolt: true },
|
||||
{ label: "居住地址", prop: "jzdDz",showOverflowTooltip: true }
|
||||
]
|
||||
});
|
||||
|
||||
const queryFrom = ref({});
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
tabHeightFn();
|
||||
});
|
||||
|
||||
// 搜索
|
||||
const onSearch = (val) => {
|
||||
queryFrom.value = { ...val };
|
||||
pageData.pageConfiger.pageCurrent = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
const changeNo = (val) => {
|
||||
pageData.pageConfiger.pageCurrent = val;
|
||||
getList();
|
||||
};
|
||||
const changeSize = (val) => {
|
||||
pageData.pageConfiger.pageSize = val;
|
||||
getList();
|
||||
};
|
||||
|
||||
// 获取列表
|
||||
const getList = () => {
|
||||
pageData.tableConfiger.loading = true;
|
||||
let data = { ...pageData.pageConfiger, ...queryFrom.value };
|
||||
tacticalGet(data, "/mosty-api/mosty-gsxt/tactical/selectPage")
|
||||
.then((res) => {
|
||||
pageData.tableData = res.records || [];
|
||||
pageData.total = res.total;
|
||||
pageData.tableConfiger.loading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
pageData.tableConfiger.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
// 删除
|
||||
const deleteRow = (id) => {
|
||||
proxy
|
||||
.$confirm("确定要删除", "警告", { type: "warning" })
|
||||
.then(() => {
|
||||
tacticalDelete({}, "/mosty-api/mosty-gsxt/tactical/" + id).then(() => {
|
||||
proxy.$message({ type: "success", message: "删除成功" });
|
||||
getList();
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
};
|
||||
|
||||
// 详情
|
||||
const addEdit = (type, row) => {
|
||||
show.value = true;
|
||||
nextTick(() => {
|
||||
detailDiloag.value.init(type, row);
|
||||
});
|
||||
};
|
||||
|
||||
// 表格高度计算
|
||||
const tabHeightFn = () => {
|
||||
pageData.tableHeight =
|
||||
window.innerHeight - searchBox.value.offsetHeight - 250;
|
||||
window.onresize = function () {
|
||||
tabHeightFn();
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-loading-mask {
|
||||
background: rgba(0, 0, 0, 0.5) !important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user