feat:战略研判调整
This commit is contained in:
@ -0,0 +1,449 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dialog" v-if="dialogForm">
|
||||||
|
<div class="head_box">
|
||||||
|
<span class="title">数据整理{{ title }} </span>
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" size="small" v-if="title != '详情'" :loading="loading" @click="submit">保存</el-button>
|
||||||
|
<el-button size="small" @click="close">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="padding-bottom: 40px;" class="form_cnt">
|
||||||
|
<FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules">
|
||||||
|
<template #bmList>
|
||||||
|
<div class="table-box">
|
||||||
|
<el-table :data="tableList" border style="width: 100%">
|
||||||
|
<el-table-column prop="ypbmmc" label="部门" width="150" align="center" />
|
||||||
|
<el-table-column label="研判素材" width="280" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-input v-model="row.scyq" :disabled="!isShiQingBaoZhongXin" placeholder="请输入研判素材" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="附件" width="200" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<UploadFile v-model="row.fj" :disabled="!isShiQingBaoZhongXin" :limit="1" :isImg="false"
|
||||||
|
:isAll="true" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="wcqk" label="完成状态" width="120" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-tag :type="row.wcqk === '02' ? 'success' : 'warning'">
|
||||||
|
{{ row.wcqk == '01' ? '准备中' : '已完成' }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="200" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button type="text" size="small" @click="updateStatus(row)" :disabled="updateDis(row)">
|
||||||
|
修改状态
|
||||||
|
</el-button>
|
||||||
|
<el-button type="text" size="small" @click="submitMaterial(row)" :disabled="updateDis(row)">
|
||||||
|
提交素材
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</FormMessage>
|
||||||
|
</div>
|
||||||
|
<!-- 底部按钮 -->
|
||||||
|
<div class="bottom-actions" v-if="title !== '新增' && listQuery.id">
|
||||||
|
<el-button type="primary" size="small" @click="sendNotice" :loading="noticeLoading">下发通知</el-button>
|
||||||
|
<el-button type="success" size="small" @click="confirmJudgment" :loading="confirmLoading">确认研判</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 修改状态弹框 -->
|
||||||
|
<div class="dialog" v-if="statusDialog">
|
||||||
|
<div class="head_box">
|
||||||
|
<span class="title">修改状态</span>
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" size="small" :loading="statusLoading" @click="submitStatus">保存</el-button>
|
||||||
|
<el-button size="small" @click="closeStatusDialog">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form_cnt">
|
||||||
|
<el-form :model="statusForm" label-width="80px">
|
||||||
|
<el-form-item label="附件">
|
||||||
|
<UploadFile v-model="statusForm.fj" :limit="2" :isImg="false" :isAll="true" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 提交素材弹框 -->
|
||||||
|
<div class="dialog" v-if="materialDialog">
|
||||||
|
<div class="head_box">
|
||||||
|
<span class="title">提交素材</span>
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" size="small" :loading="materialLoading" @click="submitMaterialAction">保存</el-button>
|
||||||
|
<el-button size="small" @click="closeMaterialDialog">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form_cnt">
|
||||||
|
<el-form :model="materialForm" label-width="80px">
|
||||||
|
<el-form-item label="附件">
|
||||||
|
<UploadFile v-model="materialForm.fj" :limit="2" :isImg="false" :isAll="true" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import FormMessage from "@/components/aboutTable/FormMessage.vue";
|
||||||
|
import UploadFile from "@/components/MyComponents/Upload/index.vue";
|
||||||
|
// import ChooseUser from "@/components/ChooseList/ChooseUser/index.vue"
|
||||||
|
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, watch, computed } from "vue";
|
||||||
|
import { sjzlAddEntity, sjzlEditEntity, sjzlGetInfo, sjzlPerfectlnfo, sjzlFstz, sjzlQryp, sjzlPerfectSorce } from '@//api/yj.js'
|
||||||
|
import { getItem } from '@//utils/storage.js'
|
||||||
|
|
||||||
|
const emit = defineEmits(["updateDate", "getList"]);
|
||||||
|
const props = defineProps({
|
||||||
|
dict: Object
|
||||||
|
});
|
||||||
|
const imgMsg = ref([])
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
const dialogForm = ref(false); //弹窗
|
||||||
|
const formData = ref([
|
||||||
|
|
||||||
|
]);
|
||||||
|
const { deptBizType, deptLevel, deptCode } = getItem('deptId')[0]
|
||||||
|
/** 登录人 */
|
||||||
|
const sfzh = getItem('idEntityCard')
|
||||||
|
/** 是否市情报指挥中心 */
|
||||||
|
const isShiQingBaoZhongXin = computed(() => {
|
||||||
|
const Jb = deptLevel[0] == '2' ? '01' : deptLevel[0] == '3' ? '02' : '03'
|
||||||
|
return deptBizType == '23' && Jb == '01'
|
||||||
|
})
|
||||||
|
const listQuery = ref({}); //表单
|
||||||
|
const loading = ref(false);
|
||||||
|
const elform = ref();
|
||||||
|
const title = ref("");
|
||||||
|
const tableList = ref([])
|
||||||
|
// const detailObj = ref({})
|
||||||
|
const statusDialog = ref(false) // 修改状态弹框
|
||||||
|
const statusLoading = ref(false)
|
||||||
|
const statusForm = ref({ fj: [] }) // 修改状态表单
|
||||||
|
const currentRow = ref({}) // 当前操作的行
|
||||||
|
|
||||||
|
// 提交素材相关
|
||||||
|
const materialDialog = ref(false) // 提交素材弹框
|
||||||
|
const materialLoading = ref(false)
|
||||||
|
const materialForm = ref({ fj: [] }) // 提交素材表单
|
||||||
|
const materialRow = ref({}) // 当前操作的行
|
||||||
|
|
||||||
|
/** 外面行数据 */
|
||||||
|
const outRow = ref({})
|
||||||
|
const noticeLoading = ref(false) // 下发通知加载状态
|
||||||
|
const confirmLoading = ref(false) // 确认研判加载状态
|
||||||
|
|
||||||
|
const rules = reactive({
|
||||||
|
// 可以在这里添加表单验证规则
|
||||||
|
});
|
||||||
|
watch(() => props.dict, (val) => {
|
||||||
|
if (val) {
|
||||||
|
formData.value = [
|
||||||
|
{ label: "研判议题", prop: "ypyt", type: "input", width: '48%' },
|
||||||
|
{ label: "研判时间", prop: "ypsj", type: "datetime", width: '48%' },
|
||||||
|
{ label: "报告类型", prop: "bglx", type: "radio", options: props.dict.D_BZ_YPLX, width: '48%' },
|
||||||
|
{ label: "研判方式", prop: "ypfs", type: "radio", options: props.dict.D_BZ_YPFS, width: '48%' },
|
||||||
|
{ label: "参与研判部门", prop: "jsdxBmDm", type: "department", multiple: true, depMc: 'jsdxBmMc', width: '48%' },
|
||||||
|
{ label: "研判要求", prop: "ypyq", type: "textarea", width: '100%' },
|
||||||
|
{ label: "列表", prop: "bmList", type: "slot", width: '100%' },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
/** 是否修改禁用 */
|
||||||
|
function updateDis(row) {
|
||||||
|
/** 无id 禁用 */
|
||||||
|
if (!listQuery.value.id) return true
|
||||||
|
/** 是否创建人 */
|
||||||
|
const iscjr = !row.cjrsfzh || row?.cjrsfzh == deptCode
|
||||||
|
/** 是否完成 */
|
||||||
|
const isFinish = row.wcqk === '02'
|
||||||
|
return isShiQingBaoZhongXin.value || !iscjr || isFinish
|
||||||
|
}
|
||||||
|
function getFjArr(fj) {
|
||||||
|
if (typeof fj !== 'string' || !fj) return []
|
||||||
|
let fjArr = []
|
||||||
|
try {
|
||||||
|
fjArr = JSON.parse(fj)
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
return fjArr
|
||||||
|
}
|
||||||
|
watch(() => listQuery.value.jsdxBmDm, (val) => {
|
||||||
|
/** @type {Array<{ypbmdm: string, ypbmmc: string, scyq: string, fj: Array, wcqk: string}>} 参与研判部门数据数组 */
|
||||||
|
const arr = Array.isArray(val) ? val : []
|
||||||
|
const cyypList = Array.isArray(listQuery.value.cyypList) ? listQuery.value.cyypList : []
|
||||||
|
|
||||||
|
tableList.value = arr.map((item, i) => {
|
||||||
|
/** 找原来的对象 */
|
||||||
|
const curr = cyypList.find(item2 => item2.ypbmdm == item) || {}
|
||||||
|
/** 是否是新增 */
|
||||||
|
const isAddForm = !listQuery.value.id
|
||||||
|
return {
|
||||||
|
// id: null,
|
||||||
|
// sjzlid: null, // 研判数据整理ID
|
||||||
|
/** 部门代码 */
|
||||||
|
ypbmdm: item,
|
||||||
|
ypbmmc: listQuery.value.jsdxBmMc[i],
|
||||||
|
/** 素材要求 */
|
||||||
|
scyq: isAddForm ? '' : curr.scyq,
|
||||||
|
fj: isAddForm ? [] : getFjArr(curr.fj),
|
||||||
|
/** 完成情况(01 准备中、02 已完成)*/
|
||||||
|
wcqk: isAddForm ? '01' : curr.wcqk || '01'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
// 初始化数据
|
||||||
|
const init = (type, row, wjlb) => {
|
||||||
|
dialogForm.value = true;
|
||||||
|
title.value = type == "add" ? "新增" : type == "edit" ? "编辑" : "详情";
|
||||||
|
outRow.value = row || {}
|
||||||
|
if (row) { getDataById(row.id) }
|
||||||
|
};
|
||||||
|
// 根据id查询详情
|
||||||
|
const getDataById = (id) => {
|
||||||
|
sjzlGetInfo(id).then((res) => {
|
||||||
|
listQuery.value = res || {};
|
||||||
|
const cyypList = Array.isArray(res.cyypList) ? res.cyypList : []
|
||||||
|
listQuery.value.jsdxBmDm = cyypList.map(item => {
|
||||||
|
return item.ypbmdm
|
||||||
|
})
|
||||||
|
listQuery.value.jsdxBmMc = cyypList.map(item => {
|
||||||
|
return item.ypbmmc
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
function getFjString(arr) {
|
||||||
|
arr = Array.isArray(arr) ? arr : []
|
||||||
|
return JSON.stringify(arr)
|
||||||
|
}
|
||||||
|
/**获取下发部门数据 */
|
||||||
|
const getXfbmList = () => {
|
||||||
|
const cyypList = Array.isArray(listQuery.value.cyypList) ? listQuery.value.cyypList : []
|
||||||
|
|
||||||
|
return tableList.value.map((item, i) => {
|
||||||
|
|
||||||
|
/** 找原来的对象 */
|
||||||
|
const curr = cyypList.find(item => item.ypbmdm == item.ypbmdm) || {}
|
||||||
|
return {
|
||||||
|
id: curr.id || null,
|
||||||
|
sjzlid: curr.sjzlid || null, // 研判数据整理ID
|
||||||
|
ypbmdm: item.ypbmdm,
|
||||||
|
ypbmmc: listQuery.value.jsdxBmMc[i],
|
||||||
|
/** 素材要求 */
|
||||||
|
scyq: item.scyq,
|
||||||
|
fj: getFjString(item.fj),
|
||||||
|
/** 完成情况(01 准备中、02 已完成)*/
|
||||||
|
wcqk: item.wcqk
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 提交
|
||||||
|
const submit = () => {
|
||||||
|
elform.value.submit(async (data) => {
|
||||||
|
const xfbmList = getXfbmList()
|
||||||
|
let params = {
|
||||||
|
...listQuery.value,
|
||||||
|
cyypList: xfbmList,
|
||||||
|
// cyypList: listQuery.value.jsdxBmDm.map((item, index) => {
|
||||||
|
// return {
|
||||||
|
// ypbmdm: item,
|
||||||
|
// ypbmmc: listQuery.value.jsdxBmMc[index],
|
||||||
|
// ypcylx: '01'
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
loading.value = true;
|
||||||
|
let res
|
||||||
|
if (title.value == "新增") {
|
||||||
|
res = await sjzlAddEntity(params)
|
||||||
|
} else {
|
||||||
|
res = await sjzlEditEntity(params)
|
||||||
|
}
|
||||||
|
if (res && res > 0) {
|
||||||
|
loading.value = false;
|
||||||
|
proxy.$message({ type: "success", message: title.value + "成功" });
|
||||||
|
emit("getList");
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
loading.value = false;
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// const chooseUserVisible = ref()
|
||||||
|
// const roleIds = ref([])
|
||||||
|
// const userList = ref([])
|
||||||
|
// const handleUserSelected = (val) => {
|
||||||
|
// userList.value = val
|
||||||
|
// listQuery.value.jsrxm = val.map(item => item.userName).join(',')
|
||||||
|
// }
|
||||||
|
// 修改状态
|
||||||
|
const updateStatus = (row) => {
|
||||||
|
const cyypList = Array.isArray(listQuery.value.cyypList) ? listQuery.value.cyypList : []
|
||||||
|
/** 找原来的对象 */
|
||||||
|
const curr = cyypList.find(item2 => item2.ypbmdm == row.ypbmdm) || {}
|
||||||
|
currentRow.value = { ...curr, row }
|
||||||
|
statusForm.value = { fj: [] }
|
||||||
|
statusDialog.value = true
|
||||||
|
};
|
||||||
|
|
||||||
|
// 提交修改状态
|
||||||
|
const submitStatus = async () => {
|
||||||
|
try {
|
||||||
|
statusLoading.value = true
|
||||||
|
const params = {
|
||||||
|
id: currentRow.value.id,
|
||||||
|
fj: statusForm.value.fj?.length > 0 ? getFjString(statusForm.value.fj) : '',
|
||||||
|
wcqk: '02'
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await sjzlPerfectlnfo(params)
|
||||||
|
if (res && res > 0) {
|
||||||
|
proxy.$message({ type: "success", message: "修改成功" })
|
||||||
|
// 更新本地状态
|
||||||
|
currentRow.value.wcqk = '02'
|
||||||
|
|
||||||
|
closeStatusDialog()
|
||||||
|
if (outRow.value.id) { getDataById(outRow.value.id) }
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
statusLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭修改状态弹框
|
||||||
|
const closeStatusDialog = () => {
|
||||||
|
statusDialog.value = false
|
||||||
|
statusForm.value = { fj: [] }
|
||||||
|
statusLoading.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交素材
|
||||||
|
const submitMaterial = (row) => {
|
||||||
|
const cyypList = Array.isArray(listQuery.value.cyypList) ? listQuery.value.cyypList : []
|
||||||
|
/** 找原来的对象 */
|
||||||
|
const curr = cyypList.find(item2 => item2.ypbmdm == row.ypbmdm) || {}
|
||||||
|
materialRow.value = { ...curr, row }
|
||||||
|
materialForm.value = { fj: [] }
|
||||||
|
materialDialog.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交素材操作
|
||||||
|
const submitMaterialAction = async () => {
|
||||||
|
try {
|
||||||
|
materialLoading.value = true
|
||||||
|
const params = {
|
||||||
|
id: materialRow.value.id,
|
||||||
|
fj: materialForm.value.fj?.length > 0 ? getFjString(materialForm.value.fj) : '',
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await sjzlPerfectSorce(params)
|
||||||
|
proxy.$message({ type: "success", message: "提交素材成功" })
|
||||||
|
|
||||||
|
closeMaterialDialog()
|
||||||
|
if (outRow.value.id) { getDataById(outRow.value.id) }
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
} finally {
|
||||||
|
materialLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭提交素材弹框
|
||||||
|
const closeMaterialDialog = () => {
|
||||||
|
materialDialog.value = false
|
||||||
|
materialForm.value = { fj: [] }
|
||||||
|
materialLoading.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下发通知
|
||||||
|
const sendNotice = () => {
|
||||||
|
proxy.$confirm('确认下发通知?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(async () => {
|
||||||
|
try {
|
||||||
|
noticeLoading.value = true;
|
||||||
|
const res = await sjzlFstz(listQuery.value.id);
|
||||||
|
proxy.$message({ type: "success", message: "下发通知成功" });
|
||||||
|
close();
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
} finally {
|
||||||
|
noticeLoading.value = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 确认研判
|
||||||
|
const confirmJudgment = () => {
|
||||||
|
|
||||||
|
proxy.$confirm('确认研判完成?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(async () => {
|
||||||
|
try {
|
||||||
|
confirmLoading.value = true;
|
||||||
|
const res = await sjzlQryp(listQuery.value.id);
|
||||||
|
proxy.$message({ type: "success", message: "确认研判成功" });
|
||||||
|
close();
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
} finally {
|
||||||
|
confirmLoading.value = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关闭
|
||||||
|
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";
|
||||||
|
|
||||||
|
::v-deep .form-item-box {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-actions {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 50%;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 10px;
|
||||||
|
width: 100%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
padding: 10px 20px;
|
||||||
|
|
||||||
|
border-radius: 4px;
|
||||||
|
background: white;
|
||||||
|
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
||||||
|
// z-index: 1000;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -1,208 +0,0 @@
|
|||||||
<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>
|
|
||||||
@ -2,12 +2,13 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="titleBox">
|
<div class="titleBox">
|
||||||
<PageTitle title="战略研判">
|
<PageTitle title="战略研判">
|
||||||
<el-button type="primary" @click="addEdit('add', '')">
|
<el-button type="primary" @click="getDataById('add', '')">
|
||||||
<el-icon style="vertical-align: middle">
|
<el-icon style="vertical-align: middle">
|
||||||
<CirclePlus />
|
<CirclePlus />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<span style="vertical-align: middle">新增</span>
|
<span style="vertical-align: middle">新增</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
</PageTitle>
|
</PageTitle>
|
||||||
</div>
|
</div>
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
@ -17,15 +18,18 @@
|
|||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<div class="tabBox">
|
<div class="tabBox">
|
||||||
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
||||||
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth"
|
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth">
|
||||||
@chooseData="chooseData">
|
<template #bglx="{ row }">
|
||||||
<template #ryMz="{ row }">
|
<DictTag :tag="false" :value="row.bglx" :options="D_BZ_YPLX" />
|
||||||
<DictTag :tag="false" :value="row.ryMz" :options="D_BZ_MZ" />
|
</template>
|
||||||
|
<template #ypfs="{ row }">
|
||||||
|
<DictTag :tag="false" :value="row.ypfs" :options="D_BZ_YPFS" />
|
||||||
</template>
|
</template>
|
||||||
<!-- 操作 -->
|
<!-- 操作 -->
|
||||||
<template #controls="{ row }">
|
<template #controls="{ row }">
|
||||||
<el-link size="small" type="success" @click="addEdit('edit', row)">编辑</el-link>
|
<el-link size="small" type="primary" @click="getDataById('edit', row)">修改</el-link>
|
||||||
<el-link size="small" type="danger" @click="deleteRow(row.id)">删除</el-link>
|
<el-link size="small" type="primary" @click="getDataById('detail', row)">详情</el-link>
|
||||||
|
<el-link size="small" type="danger" @click="deleteFile(row)">删除</el-link>
|
||||||
</template>
|
</template>
|
||||||
</MyTable>
|
</MyTable>
|
||||||
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
|
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
|
||||||
@ -33,10 +37,8 @@
|
|||||||
total: pageData.total
|
total: pageData.total
|
||||||
}"></Pages>
|
}"></Pages>
|
||||||
</div>
|
</div>
|
||||||
<!-- 详情 -->
|
|
||||||
<DetailForm v-if="show" @updateDate="getList" ref="detailDiloag"
|
|
||||||
:dic="{ D_BZ_WHCD, D_BZ_MZ, D_BZ_XB, D_BZ_ZZMM }" />
|
|
||||||
</div>
|
</div>
|
||||||
|
<AddForm ref="addForm" @getList="getList" :dict="{ D_BZ_YPFS, D_BZ_YPLX }" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -44,28 +46,33 @@ import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
|||||||
import MyTable from "@/components/aboutTable/MyTable.vue";
|
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||||
import Pages from "@/components/aboutTable/Pages.vue";
|
import Pages from "@/components/aboutTable/Pages.vue";
|
||||||
import Search from "@/components/aboutTable/Search.vue";
|
import Search from "@/components/aboutTable/Search.vue";
|
||||||
import DetailForm from "./components/addForm.vue";
|
import { useRoute } from 'vue-router'
|
||||||
import { strategicGet, strategicPost, strategicDelete } from "@/api/strategicApi.js";
|
import { sjzlGetPageList, sjzldeleteEntity } from "@/api/yj.js";
|
||||||
import { reactive, ref, onMounted, getCurrentInstance, nextTick } from "vue";
|
import { reactive, ref, onMounted, getCurrentInstance, watch,computed } from "vue";
|
||||||
import { ElMessage } from "element-plus";
|
import AddForm from "./addForm.vue";
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const { D_BZ_WHCD, D_BZ_MZ, D_BZ_XB, D_BZ_ZZMM } = proxy.$dict(
|
const { D_BZ_YPFS, D_BZ_YPLX } = proxy.$dict("D_BZ_YPFS", "D_BZ_YPLX")
|
||||||
"D_BZ_WHCD",
|
|
||||||
"D_BZ_MZ",
|
|
||||||
"D_BZ_XB",
|
|
||||||
"D_BZ_ZZMM"
|
|
||||||
); //获取字典数据
|
|
||||||
const detailDiloag = ref();
|
const detailDiloag = ref();
|
||||||
const searchBox = ref(); //搜索框
|
const searchBox = ref(); //搜索框
|
||||||
const show = ref(false);
|
onMounted(() => {
|
||||||
const searchConfiger = ref([
|
tabHeightFn()
|
||||||
{ label: "姓名", prop: "ryXm", placeholder: "请输入姓名", showType: "input" },
|
if (route.query.id) {
|
||||||
{
|
detailDiloag.value.init('edit', {
|
||||||
label: "身份证号",
|
id: route.query.id
|
||||||
prop: "rySfzh",
|
});
|
||||||
placeholder: "请输入身份证号",
|
return
|
||||||
showType: "input"
|
|
||||||
}
|
}
|
||||||
|
getList()
|
||||||
|
});
|
||||||
|
/** 是否市情报指挥中心 */
|
||||||
|
const isShiQingBaoZhongXin = computed(() => {
|
||||||
|
const Jb = deptLevel[0] == '2' ? '01' : deptLevel[0] == '3' ? '02' : '03'
|
||||||
|
return deptBizType == '23' && Jb == '01'
|
||||||
|
})
|
||||||
|
|
||||||
|
const searchConfiger = ref([
|
||||||
|
{ label: "研判议题", prop: 'ypyt', placeholder: "请输入研判议题", showType: "input" },
|
||||||
|
// { label: "研判方式", prop: 'ypfs', placeholder: "请输入研判方式", showType: "radio",options:D_BZ_YPFS },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const pageData = reactive({
|
const pageData = reactive({
|
||||||
@ -73,7 +80,7 @@ const pageData = reactive({
|
|||||||
keyCount: 0,
|
keyCount: 0,
|
||||||
tableConfiger: {
|
tableConfiger: {
|
||||||
rowHieght: 61,
|
rowHieght: 61,
|
||||||
showSelectType: "null",
|
showSelectType: "checkBox",
|
||||||
loading: false
|
loading: false
|
||||||
},
|
},
|
||||||
total: 0,
|
total: 0,
|
||||||
@ -81,90 +88,113 @@ const pageData = reactive({
|
|||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
pageCurrent: 1
|
pageCurrent: 1
|
||||||
},
|
},
|
||||||
controlsWidth: 120,
|
controlsWidth: 240,
|
||||||
tableColumn: [
|
tableColumn: [
|
||||||
{ label: "编号", prop: "bh" },
|
{ label: "研判议题", prop: "ypyt" },
|
||||||
{ label: "姓名", prop: "ryXm" },
|
{ label: "研判方式", prop: "ypfs", showSolt: true },
|
||||||
{ label: "联系电话", prop: "ryLxdh" },
|
{ label: "报告类型", prop: "bglx", showSolt: true },
|
||||||
{ label: "身份证号", prop: "rySfzh" },
|
{ label: "研判时间", prop: "ypsj" },
|
||||||
{ label: "工作阵地", prop: "gzzd",showOverflowTooltip: true },
|
{ label: "研判要求", prop: "ypyq" },
|
||||||
{ label: "发挥作用", prop: "zyfh" ,showOverflowTooltip: true},
|
{ label: "发起部门", prop: "ssbm" },
|
||||||
{ label: "民族", prop: "ryMz", showSolt: true },
|
|
||||||
{ label: "居住地址", prop: "jzdDz",showOverflowTooltip: true }
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
const queryFrom = ref({});
|
const queryFrom = ref({});
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getList();
|
|
||||||
tabHeightFn();
|
|
||||||
});
|
|
||||||
|
|
||||||
// 搜索
|
// 搜索
|
||||||
const onSearch = (val) => {
|
const onSearch = (val) => {
|
||||||
queryFrom.value = { ...val };
|
const promes = {
|
||||||
|
...val,
|
||||||
|
...pageData.pageConfiger,
|
||||||
|
}
|
||||||
|
queryFrom.value = { ...promes }
|
||||||
pageData.pageConfiger.pageCurrent = 1;
|
pageData.pageConfiger.pageCurrent = 1;
|
||||||
getList();
|
getList()
|
||||||
};
|
}
|
||||||
|
|
||||||
const changeNo = (val) => {
|
const changeNo = (val) => {
|
||||||
pageData.pageConfiger.pageCurrent = val;
|
pageData.pageConfiger.pageCurrent = val;
|
||||||
getList();
|
getList()
|
||||||
};
|
}
|
||||||
const changeSize = (val) => {
|
const changeSize = (val) => {
|
||||||
pageData.pageConfiger.pageSize = val;
|
pageData.pageConfiger.pageSize = val;
|
||||||
getList();
|
getList()
|
||||||
};
|
}
|
||||||
|
|
||||||
// 获取列表
|
// 获取列表
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
pageData.tableConfiger.loading = true;
|
pageData.tableConfiger.loading = true;
|
||||||
let data = { ...pageData.pageConfiger, ...queryFrom.value };
|
let data = { ...pageData.pageConfiger, ...queryFrom.value, wjlb: '01' };
|
||||||
strategicGet(data, "/mosty-api/mosty-gsxt/strategic/selectPage")
|
sjzlGetPageList(data).then(res => {
|
||||||
.then((res) => {
|
pageData.tableData = res.records || [];
|
||||||
pageData.tableData = res.records || [];
|
pageData.total = res.total;
|
||||||
pageData.total = res.total;
|
pageData.tableConfiger.loading = false;
|
||||||
pageData.tableConfiger.loading = false;
|
}).catch(() => { 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 = () => {
|
const tabHeightFn = () => {
|
||||||
pageData.tableHeight =
|
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 250;
|
||||||
window.innerHeight - searchBox.value.offsetHeight - 250;
|
|
||||||
window.onresize = function () {
|
window.onresize = function () {
|
||||||
tabHeightFn();
|
tabHeightFn();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
|
const addForm = ref(null)
|
||||||
|
const getDataById = (type, row) => {
|
||||||
|
addForm.value.init(type, row, '01');
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteFile = (row) => {
|
||||||
|
proxy.$confirm('确定删除选中数据吗?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
sjzldeleteEntity({ ids: [row.id] }).then(res => {
|
||||||
|
proxy.$message.success('删除成功');
|
||||||
|
getList();
|
||||||
|
}).catch(() => {
|
||||||
|
proxy.$message.error('删除失败');
|
||||||
|
});
|
||||||
|
}).catch(() => {
|
||||||
|
proxy.$message.info('已取消删除');
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.label-pop {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
position: absolute;
|
||||||
|
content: '*';
|
||||||
|
top: 0;
|
||||||
|
left: -7px;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.el-loading-mask {
|
.el-loading-mask {
|
||||||
background: rgba(0, 0, 0, 0.5) !important;
|
background: rgba(0, 0, 0, 0.5) !important;
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
:v-deep .el-dialog {
|
||||||
|
width: 90% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.zdy-model-dialogs {
|
||||||
|
/* background-color: rgb(50, 148, 214); */
|
||||||
|
background: url("~@/assets/images/bg46.png") no-repeat center center;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
padding: 8px 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
pointer-events: auto !important;
|
||||||
|
height: calc(100% - 50px);
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user