management/front/dkha-web-sz-main/node_modules/.cache/vue-loader/66a5a03d92f71613d810755939e...

1 line
19 KiB
JSON

{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\personData\\staff\\staff-add-or-update.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\personData\\staff\\staff-add-or-update.vue","mtime":1614735254000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport { getDictDataList} from '@/utils'\nimport { isMobile,idCardValidate } from '@/utils/validate'\nimport debounce from 'lodash/debounce'\nimport Cookies from 'js-cookie'\nimport imgClip from '@/components/public/img-clip'\nexport default {\n components:{ imgClip },\n watch:{\n 'dataForm.scIdno':{\n immediate:true,\n handler(val){\n let gender='0';\n if(val&&val.length==18){\n gender=val[16]%2==0?'0':'1';\n }\n this.dataForm.scWasex=gender\n }\n }\n },\n data(){\n return {\n dialogVisible:false,\n loading:false,\n imgLoading:false,\n type:'post',\n dataForm:{\n scPhotoimg:'',\n scWaname:'',\n scIdno:'',\n scWasex:'0',\n scPhonenum:'',\n scEmpno:'',\n scStatus:'',\n scEmptype:'',\n scHiredate:'',\n scGraduationdate:''\n },\n genderList:getDictDataList('gender').filter(item=>item.dictValue<2),\n staffStatusList:getDictDataList('staffStatus'),\n employTypeList:getDictDataList('employType').filter(item=>item.dictLabel!='学生'&&item.dictLabel!='访客'),\n rules:{\n scPhotoimg:[\n {required: true, message:'请上传图片', trigger: ['blur','change']},\n ],\n scWaname:[\n {required: true, message:'请输入', trigger: ['blur','change']},\n {max: 50, message:'最多50个字符', trigger: ['blur','change']}\n ],\n scIdno:[\n {required: true, message:'请输入', trigger: ['blur','change']},\n { validator: idCardValidate, trigger: ['blur','change'] }\n ],\n scWasex:[\n {required: true, message:'请输入', trigger: ['blur','change']}\n ],\n scPhonenum:[\n {required: true, message:'请输入', trigger: ['blur','change']},\n { validator: isMobile, trigger: ['blur','change'] }\n ],\n scEmpno:[\n {required: true, message:'请输入', trigger: ['blur','change']},\n {max: 15, message:'最多15个字符', trigger: ['blur','change']}\n ], scEmptype:[\n {required: true, message:'请选择', trigger: ['blur','change']}\n ], scHiredate:[\n {required: true, message:'请选择', trigger: ['blur','change']}\n ]\n , scStatus:[\n {required: true, message:'请选择', trigger: ['blur','change']}\n ]\n\n },\n uploadHeaders:{},\n uploadUrl:window.SITE_CONFIG['apiURL']+'/system/upload'\n }\n },\n created(){\n this.uploadHeaders={\n Authorization:'Bearer ' + Cookies.get('access_token') || ''\n }\n },\n methods:{\n init(data){\n this.dialogVisible=true;\n // 编辑\n if(data){\n this.type=\"put\";\n this.dataForm={\n ...data,\n scWasex:String(data.scWasex),\n scStatus:String(data.scStatus),\n scEmptype:String(data.scEmptype),\n }\n }\n else{\n this.type=\"post\";\n this.dataForm={\n scPhotoimg:'',\n scWaname:'',\n scIdno:'',\n scWasex:'0',\n scPhonenum:'',\n scEmpno:'',\n scStatus:'',\n scEmptype:'',\n scHiredate:'',\n scGraduationdate:''\n }\n this.$nextTick(()=>{\n this.$refs['dataForm'].clearValidate()\n })\n }\n },\n submitInfo:debounce(function(){\n this.$refs['dataForm'].validate((valid)=>{\n if(!valid){\n return false\n }\n this.loading=true;\n this.$http({\n url:\"/system/scworkersarchives\",\n method:this.type,\n data:this.dataForm\n }).then(({data})=>{\n if(data.code!=0){\n return this.$message.error(data.msg)\n }\n this.dialogVisible=false;\n if(this.type=='post'){\n this.$parent.$parent.resetQuery();\n }\n else{\n this.$parent.$parent.search();\n }\n this.$message.success(data.msg)\n }).finally(()=>{\n this.loading=false;\n })\n })\n \n },1000),\n handleUploadSuccess(res){\n this.imgLoading=false;\n if(res.code!=0){\n return this.$message.error(res.msg)\n }\n this.dataForm.scPhotoimg=res.data.path;\n },\n beforeUpload(file){\n const isJPG=file.type=='image/jpeg'||file.type=='image/png';\n const isLess2M=file.size/1024 /1024<2;\n if(!isJPG){\n this.$message.error('上传头像图片只能是 JPG 或 PNG 格式!');\n }\n if(!isLess2M){\n this.$message.error('上传头像图片大小不能超过 2MB!');\n }\n this.imgLoading=isJPG && isLess2M;\n return isJPG && isLess2M;\n }\n }\n}\n",{"version":3,"sources":["staff-add-or-update.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"staff-add-or-update.vue","sourceRoot":"src/views/modules/personData/staff","sourcesContent":["<template>\n <el-dialog\n :title=\"type=='post'?'新建':'修改'\"\n :visible.sync=\"dialogVisible\"\n :close-on-click-modal=\"false\"\n >\n <div>\n <el-form ref=\"dataForm\" :model=\"dataForm\" :rules=\"rules\" label-width=\"100px\">\n <el-row>\n <el-col>\n <el-form-item class=\"block-item\" label=\"照片\" prop=\"scPhotoimg\">\n <!-- <el-upload\n class=\"avatar-uploader\"\n :action=\"uploadUrl\"\n :headers=\"uploadHeaders\"\n :show-file-list=\"false\"\n :on-success=\"handleUploadSuccess\"\n :before-upload=\"beforeUpload\"\n :data=\"{folderName:'staff'}\"\n >\n <img v-if=\"dataForm.scPhotoimg\" :src=\"$ImgServerUrl+dataForm.scPhotoimg\" class=\"avatar\" />\n <i v-else class=\"el-icon-plus avatar-uploader-icon\" v-loading=\"imgLoading\"></i>\n </el-upload> -->\n <img-clip v-model=\"dataForm.scPhotoimg\" folder-name=\"staff\"></img-clip>\n\n </el-form-item>\n </el-col>\n </el-row>\n <el-row>\n <el-col :span=\"12\">\n <el-form-item label=\"姓名\" prop=\"scWaname\">\n <el-input v-model.trim=\"dataForm.scWaname\" placeholder=\"请输入\"></el-input>\n </el-form-item>\n </el-col>\n <el-col :span=\"11\" :offset=\"1\">\n <el-form-item label=\"身份证号\" prop=\"scIdno\">\n <el-input v-model=\"dataForm.scIdno\" placeholder=\"请输入\"></el-input>\n </el-form-item>\n </el-col>\n </el-row>\n <el-row>\n <el-col :span=\"12\">\n <el-form-item label=\"联系电话\" prop=\"scPhonenum\">\n <el-input v-model=\"dataForm.scPhonenum\" placeholder=\"请输入\"></el-input>\n </el-form-item>\n </el-col>\n <el-col :span=\"11\" :offset=\"1\">\n <el-form-item label=\"性别\" prop=\"scWasex\">\n <el-radio-group v-model=\"dataForm.scWasex\" placeholder=\"请输入\">\n <el-radio\n disabled\n v-for=\"item in genderList\"\n :key=\"item.dictLabel\"\n :label=\"item.dictValue\"\n >{{item.dictLabel}}</el-radio>\n </el-radio-group>\n </el-form-item>\n </el-col>\n </el-row>\n <el-row>\n <el-col :span=\"12\">\n <el-form-item label=\"职工编号\" prop=\"scEmpno\">\n <el-input v-model=\"dataForm.scEmpno\" placeholder=\"请输入\"></el-input>\n </el-form-item>\n </el-col>\n <el-col :span=\"11\" :offset=\"1\">\n <el-form-item label=\"类型\" prop=\"scEmptype\">\n <el-select v-model=\"dataForm.scEmptype\" placeholder=\"请选择\" clearable>\n <el-option\n v-for=\"item in employTypeList\"\n :key=\"item.dictLabel\"\n :label=\"item.dictLabel\"\n :value=\"item.dictValue\"\n ></el-option>\n </el-select>\n </el-form-item>\n </el-col>\n </el-row>\n <el-row>\n <el-col :span=\"12\">\n <el-form-item label=\"入职时间\" prop=\"scHiredate\">\n <el-date-picker\n v-model=\"dataForm.scHiredate\"\n type=\"date\"\n value-format=\"yyyy-MM-dd\"\n placeholder=\"请选择\"\n ></el-date-picker>\n </el-form-item>\n </el-col>\n <el-col :span=\"11\" :offset=\"1\">\n <el-form-item label=\"状态\" prop=\"scStatus\">\n <el-select v-model=\"dataForm.scStatus\" placeholder=\"请选择\" clearable>\n <el-option\n v-for=\"item in staffStatusList\"\n :key=\"item.dictLabel\"\n :label=\"item.dictLabel\"\n :value=\"item.dictValue\"\n ></el-option>\n </el-select>\n </el-form-item>\n </el-col>\n </el-row>\n </el-form>\n </div>\n <div slot=\"footer\">\n <el-button @click=\"dialogVisible = false\">取 消</el-button>\n <el-button type=\"primary\" v-loading=\"loading\" @click=\"submitInfo\">确 定</el-button>\n </div>\n </el-dialog>\n</template>\n<script>\nimport { getDictDataList} from '@/utils'\nimport { isMobile,idCardValidate } from '@/utils/validate'\nimport debounce from 'lodash/debounce'\nimport Cookies from 'js-cookie'\nimport imgClip from '@/components/public/img-clip'\nexport default {\n components:{ imgClip },\n watch:{\n 'dataForm.scIdno':{\n immediate:true,\n handler(val){\n let gender='0';\n if(val&&val.length==18){\n gender=val[16]%2==0?'0':'1';\n }\n this.dataForm.scWasex=gender\n }\n }\n },\n data(){\n return {\n dialogVisible:false,\n loading:false,\n imgLoading:false,\n type:'post',\n dataForm:{\n scPhotoimg:'',\n scWaname:'',\n scIdno:'',\n scWasex:'0',\n scPhonenum:'',\n scEmpno:'',\n scStatus:'',\n scEmptype:'',\n scHiredate:'',\n scGraduationdate:''\n },\n genderList:getDictDataList('gender').filter(item=>item.dictValue<2),\n staffStatusList:getDictDataList('staffStatus'),\n employTypeList:getDictDataList('employType').filter(item=>item.dictLabel!='学生'&&item.dictLabel!='访客'),\n rules:{\n scPhotoimg:[\n {required: true, message:'请上传图片', trigger: ['blur','change']},\n ],\n scWaname:[\n {required: true, message:'请输入', trigger: ['blur','change']},\n {max: 50, message:'最多50个字符', trigger: ['blur','change']}\n ],\n scIdno:[\n {required: true, message:'请输入', trigger: ['blur','change']},\n { validator: idCardValidate, trigger: ['blur','change'] }\n ],\n scWasex:[\n {required: true, message:'请输入', trigger: ['blur','change']}\n ],\n scPhonenum:[\n {required: true, message:'请输入', trigger: ['blur','change']},\n { validator: isMobile, trigger: ['blur','change'] }\n ],\n scEmpno:[\n {required: true, message:'请输入', trigger: ['blur','change']},\n {max: 15, message:'最多15个字符', trigger: ['blur','change']}\n ], scEmptype:[\n {required: true, message:'请选择', trigger: ['blur','change']}\n ], scHiredate:[\n {required: true, message:'请选择', trigger: ['blur','change']}\n ]\n , scStatus:[\n {required: true, message:'请选择', trigger: ['blur','change']}\n ]\n\n },\n uploadHeaders:{},\n uploadUrl:window.SITE_CONFIG['apiURL']+'/system/upload'\n }\n },\n created(){\n this.uploadHeaders={\n Authorization:'Bearer ' + Cookies.get('access_token') || ''\n }\n },\n methods:{\n init(data){\n this.dialogVisible=true;\n // 编辑\n if(data){\n this.type=\"put\";\n this.dataForm={\n ...data,\n scWasex:String(data.scWasex),\n scStatus:String(data.scStatus),\n scEmptype:String(data.scEmptype),\n }\n }\n else{\n this.type=\"post\";\n this.dataForm={\n scPhotoimg:'',\n scWaname:'',\n scIdno:'',\n scWasex:'0',\n scPhonenum:'',\n scEmpno:'',\n scStatus:'',\n scEmptype:'',\n scHiredate:'',\n scGraduationdate:''\n }\n this.$nextTick(()=>{\n this.$refs['dataForm'].clearValidate()\n })\n }\n },\n submitInfo:debounce(function(){\n this.$refs['dataForm'].validate((valid)=>{\n if(!valid){\n return false\n }\n this.loading=true;\n this.$http({\n url:\"/system/scworkersarchives\",\n method:this.type,\n data:this.dataForm\n }).then(({data})=>{\n if(data.code!=0){\n return this.$message.error(data.msg)\n }\n this.dialogVisible=false;\n if(this.type=='post'){\n this.$parent.$parent.resetQuery();\n }\n else{\n this.$parent.$parent.search();\n }\n this.$message.success(data.msg)\n }).finally(()=>{\n this.loading=false;\n })\n })\n \n },1000),\n handleUploadSuccess(res){\n this.imgLoading=false;\n if(res.code!=0){\n return this.$message.error(res.msg)\n }\n this.dataForm.scPhotoimg=res.data.path;\n },\n beforeUpload(file){\n const isJPG=file.type=='image/jpeg'||file.type=='image/png';\n const isLess2M=file.size/1024 /1024<2;\n if(!isJPG){\n this.$message.error('上传头像图片只能是 JPG 或 PNG 格式!');\n }\n if(!isLess2M){\n this.$message.error('上传头像图片大小不能超过 2MB!');\n }\n this.imgLoading=isJPG && isLess2M;\n return isJPG && isLess2M;\n }\n }\n}\n</script>\n<style lang=\"scss\" scoped>\n.el-dialog {\n .el-form {\n .el-form-item {\n .el-date-editor--date,\n .el-select {\n width: 100%;\n }\n /deep/ .el-upload {\n border: 1px dashed #d9d9d9;\n border-radius: 6px;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n margin-left: 20px;\n .avatar-uploader-icon {\n font-size: 28px;\n color: #fff;\n height: 150px;\n width: 106px;\n line-height: 150px;\n text-align: center;\n }\n .avatar {\n height: 150px;\n width: 106px;\n display: block;\n }\n }\n }\n }\n}\n</style>"]}]}