人员与辨别部位对接第三方

pull/1/head
dearlin 2024-01-25 14:22:04 +08:00
parent 0a76bcbdf0
commit 53b63fabc1
3 changed files with 146 additions and 2 deletions

View File

@ -13,6 +13,10 @@ export const getRiskPointInspectList = (params) =>
post("/riskunit/getRisByUnitId", params); // 风险点单元检查内容 post("/riskunit/getRisByUnitId", params); // 风险点单元检查内容
export const getIdentifyingPartsList = (params) => export const getIdentifyingPartsList = (params) =>
post("/identificationparts/list", params); // 辨识部位列表 post("/identificationparts/list", params); // 辨识部位列表
export const getRyRegionList = (params) =>
post("/identificationparts/ryRegionList", params); // 电子围栏列表
export const getIdentifyingPartsListById = (params) => export const getIdentifyingPartsListById = (params) =>
post("/identificationparts/listAllByIdens", params); // 辨识部位列表所有根据ID post("/identificationparts/listAllByIdens", params); // 辨识部位列表所有根据ID
export const getIdentifyingPartsView = (params) => export const getIdentifyingPartsView = (params) =>

View File

@ -54,6 +54,17 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24">
<el-form-item label="定位卡号" prop="CARDNO">
<el-input
v-model="data.form.CARDNO"
maxlength="4"
minlength="4"
show-word-limit
placeholder="请输入"
/>
</el-form-item>
</el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="姓名" prop="NAME"> <el-form-item label="姓名" prop="NAME">
<el-input v-model="data.form.NAME" placeholder="请输入" /> <el-input v-model="data.form.NAME" placeholder="请输入" />
@ -516,6 +527,14 @@ const rules = {
ENTRY_DATE: [ ENTRY_DATE: [
{ required: true, message: "请选择入职日期", trigger: "change" }, { required: true, message: "请选择入职日期", trigger: "change" },
], ],
CARDNO: [
{ required: true, message: "请输入定位卡号(4位纯数字)", trigger: "blur" },
{
pattern: /^-?[0-9]\d*$/,
message: "请输入正确的定位卡号(4位纯数字)",
trigger: "blur",
},
],
WORKING_DATE: [ WORKING_DATE: [
{ required: true, message: "请选择参加工作日期", trigger: "change" }, { required: true, message: "请选择参加工作日期", trigger: "change" },
], ],
@ -560,6 +579,7 @@ const data = reactive({
oldDepartId: "", oldDepartId: "",
form: { form: {
ROLE_ID: "", ROLE_ID: "",
CARDNO: "",
DEPARTMENT_ID: "", DEPARTMENT_ID: "",
POST_ID: "", POST_ID: "",
USERNAME: "", USERNAME: "",

View File

@ -27,44 +27,135 @@
:limit="99" :limit="99"
/> />
</el-form-item> </el-form-item>
<el-form-item label="电子围栏" prop="ELECTRONIC_FENCE">
<el-input
v-model="form.ELECTRONIC_FENCE"
style="width: 240px"
disabled
/>
<el-button type="primary" @click="fnRegName" style="margin-left: 10px"
>添加</el-button
>
<el-button
type="danger"
@click="fnRemoveRegName"
style="margin-left: 10px"
>移除</el-button
>
</el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="fnClose"></el-button> <el-button @click="fnClose"></el-button>
<el-button type="primary" @click="fnSubmit"> </el-button> <el-button type="primary" @click="fnSubmit"> </el-button>
</template> </template>
</el-dialog> </el-dialog>
<el-drawer
v-model="data.drawer"
title="电子围栏台账"
direction="rtl"
:before-close="handleClose"
size="50%"
>
<el-card>
<el-form
:model="searchForm"
label-width="20px"
@submit.prevent="fnResetPagination"
>
<el-row>
<el-col :span="12">
<el-form-item label="关键字" prop="KEYWORDS" label-width="60px">
<el-input
v-model="searchForm.KEYWORDS"
placeholder="请输入关键字"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="30px">
<el-button type="primary" native-type="submit">搜索</el-button>
<el-button native-type="reset" @click="fnResetPagination">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<layout-card>
<layout-table
ref="tableRef"
:data="list"
v-model:pagination="pagination"
@get-data="fnGetData"
>
<el-table-column reserve-selection type="selection" width="55" />
<el-table-column label="序号" width="70">
<template v-slot="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column property="layName" label="所属图层" width="150" />
<el-table-column property="regName" label="名称" />
<el-table-column label="操作" width="200">
<template v-slot="{ row }">
<el-button type="primary" text link @click="handleJoin(row)"
>绑定</el-button
>
</template>
</el-table-column>
</layout-table>
</layout-card>
</el-drawer>
</template> </template>
<script setup> <script setup>
import { ref } from "vue"; import { serialNumber } from "@/assets/js/utils.js";
import { nextTick, reactive, ref } from "vue";
import { useVModels } from "@vueuse/core"; import { useVModels } from "@vueuse/core";
import { debounce } from "throttle-debounce"; import { debounce } from "throttle-debounce";
import useFormValidate from "@/assets/js/useFormValidate.js"; import useFormValidate from "@/assets/js/useFormValidate.js";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { import {
getRiskPointListAll, getRiskPointListAll,
getRyRegionList,
setIdentifyingPartsAdd, setIdentifyingPartsAdd,
setIdentifyingPartsEdit, setIdentifyingPartsEdit,
} from "@/request/risk_control.js"; } from "@/request/risk_control.js";
import LayoutUpload from "@/components/upload/index.vue"; import LayoutUpload from "@/components/upload/index.vue";
import useListData from "@/assets/js/useListData.js";
const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } =
useListData(getRyRegionList);
const props = defineProps({ const props = defineProps({
visible: { visible: {
type: Boolean, type: Boolean,
required: true, required: true,
default: false, default: false,
}, },
loading: {
type: Boolean,
required: true,
default: false,
},
form: { form: {
type: Object, type: Object,
required: true, required: true,
default: () => ({}), default: () => ({}),
}, },
options: {
type: Array,
required: true,
default: () => [],
},
type: { type: {
type: String, type: String,
required: true, required: true,
default: "", default: "",
}, },
}); });
const data = reactive({
drawer: false,
});
const emits = defineEmits(["update:visible", "update:form", "get-data"]); const emits = defineEmits(["update:visible", "update:form", "get-data"]);
const { visible, form } = useVModels(props, emits); const { visible, form } = useVModels(props, emits);
const rules = { const rules = {
@ -86,6 +177,35 @@ const fnClose = () => {
formRef.value.resetFields(); formRef.value.resetFields();
visible.value = false; visible.value = false;
}; };
const handleJoin = debounce(
1000,
async (row) => {
form.value.ELECTRONIC_FENCE = row.regName;
form.value.ELECTRONIC_FENCE_ID = row.uuid;
data.drawer = false;
await nextTick();
},
{ atBegin: true }
);
const fnRemoveRegName = debounce(
1000,
async () => {
form.value.ELECTRONIC_FENCE = "";
form.value.ELECTRONIC_FENCE_ID = "";
},
{ atBegin: true }
);
const fnRegName = debounce(
1000,
async () => {
data.drawer = true;
},
{ atBegin: true }
);
const handleClose = () => {
data.drawer = false;
};
const fnSubmit = debounce( const fnSubmit = debounce(
1000, 1000,
async () => { async () => {