|
@@ -0,0 +1,263 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <DialogCom
|
|
|
|
|
+ title="管理历史出入人员"
|
|
|
|
|
+ :visible.sync="isShow"
|
|
|
|
|
+ class="g-dialog-select-safe-check"
|
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
|
+ width="55%"
|
|
|
|
|
+ top="10vh"
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="el-dialog-div" style="margin-bottom:20px">
|
|
|
|
|
+ <g-search-table
|
|
|
|
|
+ ref="st"
|
|
|
|
|
+ url="/core/outInHistoryUser/list"
|
|
|
|
|
+ method="get"
|
|
|
|
|
+ :search-data="search"
|
|
|
|
|
+ :pageable="true"
|
|
|
|
|
+ :select="false"
|
|
|
|
|
+ :select-default="selectList"
|
|
|
|
|
+ :drag="false"
|
|
|
|
|
+ :tableMaxHeight="600"
|
|
|
|
|
+ :tableHeight="600"
|
|
|
|
|
+ @select="onSelect"
|
|
|
|
|
+ >
|
|
|
|
|
+ <!-- 搜索 -->
|
|
|
|
|
+ <template slot="searchs">
|
|
|
|
|
+ <el-form-item prop="keyWords" label="关键字">
|
|
|
|
|
+ <el-input v-model="search.keyWords" placeholder="请输入人员姓名或证件号关键字"/>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 表格 -->
|
|
|
|
|
+ <template slot="columns">
|
|
|
|
|
+ <el-table-column label="申请单位" width="100" align="center" prop="companyName" />
|
|
|
|
|
+ <el-table-column label="出入人员" width="100" align="center" prop="userName" />
|
|
|
|
|
+ <el-table-column label="证件类型" width="100" align="center" prop="idType">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <dict-tag :options="dict.type.letter_id_type" :value="scope.row.idType"/>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="证件号码" width="200" align="center" prop="idCard">
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="证件图片" align="center" prop="imgFile">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <ImageListPreview width="50px" height="50px" v-model="scope.row.imgFile"></ImageListPreview>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ icon="el-icon-edit-outline"
|
|
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
|
|
+ v-hasPermi="['core:letter:edit']"
|
|
|
|
|
+ >编辑</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
|
|
+ v-hasPermi="['core:letter:remove']"
|
|
|
|
|
+ >删除</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </g-search-table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <DialogCom
|
|
|
|
|
+ title="编辑"
|
|
|
|
|
+ :visible.sync="open"
|
|
|
|
|
+ width="600px"
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ @close="onHideUser"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-form
|
|
|
|
|
+ ref="formUser"
|
|
|
|
|
+ :model="userInfo"
|
|
|
|
|
+ :rules="userInfoRules"
|
|
|
|
|
+ label-width="140px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-form-item label="申请单位" prop="companyName">
|
|
|
|
|
+ <el-input v-model="userInfo.companyName" maxlength="20" placeholder="请输入申请单位" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="出入人员" prop="userName">
|
|
|
|
|
+ <el-input v-model="userInfo.userName" maxlength="10" placeholder="请输入出入人员" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="证件类型" prop="idType">
|
|
|
|
|
+ <el-select style="width:100%" v-model="userInfo.idType" placeholder="请选择证件类型" clearable>
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="dict in dict.type.letter_id_type"
|
|
|
|
|
+ :key="dict.value"
|
|
|
|
|
+ :label="dict.label"
|
|
|
|
|
+ :value="parseInt(dict.value)"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="证件号码" prop="idCard">
|
|
|
|
|
+ <el-input v-model="userInfo.idCard" maxlength="20" placeholder="请输入证件号码" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item prop="imgFile" v-if="parseInt(userInfo.idType) === 0" ref="userImgFile" label="上传证件正反面" :rules="[{ required: true,message:'请上传证件正反面'}]">
|
|
|
|
|
+ <!-- <ImageListPreview v-model="userInfo.imgFile"></ImageListPreview> -->
|
|
|
|
|
+ <imgUpload ref="uploadimage" type="more" :value="userInfo.imgFile" :limit=2
|
|
|
|
|
+ @input="imageListChanged"></imgUpload>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item prop="imgFile" v-else ref="userImgFile" label="上传证件图片" :rules="[{ required: true,message:'请上传证件图片'}]">
|
|
|
|
|
+ <!-- <ImageListPreview v-model="userInfo.imgFile"></ImageListPreview> -->
|
|
|
|
|
+ <imgUpload ref="uploadimage" type="more" :value="userInfo.imgFile" :limit=2
|
|
|
|
|
+ @input="imageListChanged"></imgUpload>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button type="primary" @click="submitUser">确 定</el-button>
|
|
|
|
|
+ <el-button @click="onHideUser">取 消</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </DialogCom>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button type="primary" @click="onSubmit">确 定</el-button>
|
|
|
|
|
+ <el-button @click="onHide">关 闭</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </DialogCom>
|
|
|
|
|
+</template>
|
|
|
|
|
+<script>
|
|
|
|
|
+import GSearchTable from "@/components/table/gx.search.table.vue";
|
|
|
|
|
+import imgUpload from "@/components/ImageUpload";
|
|
|
|
|
+import imgFileUpload from "@/components/ImageFileUpload";
|
|
|
|
|
+// import { ruleListForOrg } from "@/api/resumption/rule.js";
|
|
|
|
|
+import {
|
|
|
|
|
+ delHistoryUser,updateHistoryUser
|
|
|
|
|
+} from "@/api/core/letter";
|
|
|
|
|
+export default {
|
|
|
|
|
+ components: { GSearchTable,imgUpload,imgFileUpload },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ isShow: false,
|
|
|
|
|
+ open: false,
|
|
|
|
|
+ userInfo: this.resetUserInfo(),
|
|
|
|
|
+ imageList: [],
|
|
|
|
|
+ letterFileType:["jpg", "png", "bmp"],
|
|
|
|
|
+ selectList: [],
|
|
|
|
|
+ // ruleList: [],
|
|
|
|
|
+ search: this.emptySearch(),
|
|
|
|
|
+ userInfoRules: {
|
|
|
|
|
+ userName: [{ required: true, message: "请输入出入人员" }],
|
|
|
|
|
+ companyName: [{ required: true, message: "请输入申请单位" }],
|
|
|
|
|
+ idType: [{ required: true, message: "请选择证件类型" }],
|
|
|
|
|
+ idCard: [{ required: true, message: "请输入证件号码" }],
|
|
|
|
|
+ //imgFile: [{ required: true, message: "请上传证件图片" }],
|
|
|
|
|
+ },
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {},
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ orgId(newval) {
|
|
|
|
|
+ console.log("orgId",newval);
|
|
|
|
|
+ this.search.orgId=newval;
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ dicts: ["letter_id_type"],
|
|
|
|
|
+ props: {
|
|
|
|
|
+ defaultSelect:{
|
|
|
|
|
+ type:Array
|
|
|
|
|
+ },
|
|
|
|
|
+ orgId:{
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ show() {
|
|
|
|
|
+ this.search= this.emptySearch();
|
|
|
|
|
+ console.log("this.search",this.search)
|
|
|
|
|
+ this.isShow = true;
|
|
|
|
|
+ this.selectList =this.defaultSelect;
|
|
|
|
|
+ // TODO: 处理第一次进入弹窗时,表格数据不加载
|
|
|
|
|
+ },
|
|
|
|
|
+ onHide() {
|
|
|
|
|
+ this.isShow = false;
|
|
|
|
|
+ this.search=this.emptySearch();
|
|
|
|
|
+ },
|
|
|
|
|
+ onSelect(item) {
|
|
|
|
|
+ this.selectList = item;
|
|
|
|
|
+ },
|
|
|
|
|
+ onSubmit() {
|
|
|
|
|
+ let s=this.selectList
|
|
|
|
|
+ this.$emit("select", this.selectList);
|
|
|
|
|
+ this.onHide();
|
|
|
|
|
+ },
|
|
|
|
|
+ emptySearch() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ keyWords: null,
|
|
|
|
|
+ orgId:this.$store.getters.orgId,
|
|
|
|
|
+ pageSize:100000,
|
|
|
|
|
+ pageNum:1,
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ resetUserInfo() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ userName: null,
|
|
|
|
|
+ companyName: null,
|
|
|
|
|
+ idType:0,
|
|
|
|
|
+ idCard: null,
|
|
|
|
|
+ imgFile: null,
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ handleUpdate(row)
|
|
|
|
|
+ {
|
|
|
|
|
+ this.open = true;
|
|
|
|
|
+ this.userInfo = {...row};
|
|
|
|
|
+ console.log("handleUpdate",this.userInfo)
|
|
|
|
|
+ },
|
|
|
|
|
+ handleDelete(row)
|
|
|
|
|
+ {
|
|
|
|
|
+ this.$modal.confirm('是否确认删除出入人员 "' + row.userName + '" 的数据项?').then(function() {
|
|
|
|
|
+ delHistoryUser(row.id).then(res=>{
|
|
|
|
|
+ this.$message.success("删除成功");
|
|
|
|
|
+ this.search= this.emptySearch();
|
|
|
|
|
+ })
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ }).catch(() => {});
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ submitUser()
|
|
|
|
|
+ {
|
|
|
|
|
+ updateHistoryUser(this.userInfo).then(res=>{
|
|
|
|
|
+ this.$message.success("修改成功");
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.userInfo =this.resetUserInfo( );
|
|
|
|
|
+ this.search= this.emptySearch();
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ onHideUser() {
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.imageList = [];
|
|
|
|
|
+ this.userInfo = this.resetUserInfo();
|
|
|
|
|
+ },
|
|
|
|
|
+ imageListChanged(list) {
|
|
|
|
|
+ this.userInfo.imgFile = list;
|
|
|
|
|
+ this.$refs.userImgFile.clearValidate();
|
|
|
|
|
+ },
|
|
|
|
|
+ downLoadFile(url)
|
|
|
|
|
+ {
|
|
|
|
|
+ if(process.env.VUE_APP_BASE_API!=='/')
|
|
|
|
|
+ {
|
|
|
|
|
+ url=process.env.VUE_APP_BASE_API+url;
|
|
|
|
|
+ }
|
|
|
|
|
+ const a = document.createElement("a");
|
|
|
|
|
+ a.setAttribute("download", name);
|
|
|
|
|
+ a.setAttribute("target", "_blank");
|
|
|
|
|
+ a.setAttribute("href", url);
|
|
|
|
|
+ a.click();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
|
|
+</script>
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
|
+.el-dialog-div {
|
|
|
|
|
+ overflow: auto;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|