{"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":["\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 {{item.dictLabel}}\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"]}]}