1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/.cache/babel-loader/ec5930793388a1e471e0b8c72ba...

1 line
25 KiB
JSON

{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!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":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.regexp.search\";\nimport _defineProperty from \"C:\\\\Users\\\\27446\\\\Desktop\\\\up\\\\front\\\\dkha-web-sz-main\\\\node_modules\\\\@babel\\\\runtime-corejs2/helpers/esm/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\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//\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: {\n imgClip: imgClip\n },\n watch: {\n 'dataForm.scIdno': {\n immediate: true,\n handler: function handler(val) {\n var gender = '0';\n\n if (val && val.length == 18) {\n gender = val[16] % 2 == 0 ? '0' : '1';\n }\n\n this.dataForm.scWasex = gender;\n }\n }\n },\n data: function 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(function (item) {\n return item.dictValue < 2;\n }),\n staffStatusList: getDictDataList('staffStatus'),\n employTypeList: getDictDataList('employType').filter(function (item) {\n return item.dictLabel != '学生' && item.dictLabel != '访客';\n }),\n rules: {\n scPhotoimg: [{\n required: true,\n message: '请上传图片',\n trigger: ['blur', 'change']\n }],\n scWaname: [{\n required: true,\n message: '请输入',\n trigger: ['blur', 'change']\n }, {\n max: 50,\n message: '最多50个字符',\n trigger: ['blur', 'change']\n }],\n scIdno: [{\n required: true,\n message: '请输入',\n trigger: ['blur', 'change']\n }, {\n validator: idCardValidate,\n trigger: ['blur', 'change']\n }],\n scWasex: [{\n required: true,\n message: '请输入',\n trigger: ['blur', 'change']\n }],\n scPhonenum: [{\n required: true,\n message: '请输入',\n trigger: ['blur', 'change']\n }, {\n validator: isMobile,\n trigger: ['blur', 'change']\n }],\n scEmpno: [{\n required: true,\n message: '请输入',\n trigger: ['blur', 'change']\n }, {\n max: 15,\n message: '最多15个字符',\n trigger: ['blur', 'change']\n }],\n scEmptype: [{\n required: true,\n message: '请选择',\n trigger: ['blur', 'change']\n }],\n scHiredate: [{\n required: true,\n message: '请选择',\n trigger: ['blur', 'change']\n }],\n scStatus: [{\n required: true,\n message: '请选择',\n trigger: ['blur', 'change']\n }]\n },\n uploadHeaders: {},\n uploadUrl: window.SITE_CONFIG['apiURL'] + '/system/upload'\n };\n },\n created: function created() {\n this.uploadHeaders = {\n Authorization: 'Bearer ' + Cookies.get('access_token') || ''\n };\n },\n methods: {\n init: function init(data) {\n var _this = this;\n\n this.dialogVisible = true; // 编辑\n\n if (data) {\n this.type = \"put\";\n this.dataForm = _objectSpread({}, data, {\n scWasex: String(data.scWasex),\n scStatus: String(data.scStatus),\n scEmptype: String(data.scEmptype)\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(function () {\n _this.$refs['dataForm'].clearValidate();\n });\n }\n },\n submitInfo: debounce(function () {\n var _this2 = this;\n\n this.$refs['dataForm'].validate(function (valid) {\n if (!valid) {\n return false;\n }\n\n _this2.loading = true;\n\n _this2.$http({\n url: \"/system/scworkersarchives\",\n method: _this2.type,\n data: _this2.dataForm\n }).then(function (_ref) {\n var data = _ref.data;\n\n if (data.code != 0) {\n return _this2.$message.error(data.msg);\n }\n\n _this2.dialogVisible = false;\n\n if (_this2.type == 'post') {\n _this2.$parent.$parent.resetQuery();\n } else {\n _this2.$parent.$parent.search();\n }\n\n _this2.$message.success(data.msg);\n }).finally(function () {\n _this2.loading = false;\n });\n });\n }, 1000),\n handleUploadSuccess: function handleUploadSuccess(res) {\n this.imgLoading = false;\n\n if (res.code != 0) {\n return this.$message.error(res.msg);\n }\n\n this.dataForm.scPhotoimg = res.data.path;\n },\n beforeUpload: function beforeUpload(file) {\n var isJPG = file.type == 'image/jpeg' || file.type == 'image/png';\n var isLess2M = file.size / 1024 / 1024 < 2;\n\n if (!isJPG) {\n this.$message.error('上传头像图片只能是 JPG 或 PNG 格式!');\n }\n\n if (!isLess2M) {\n this.$message.error('上传头像图片大小不能超过 2MB!');\n }\n\n this.imgLoading = isJPG && isLess2M;\n return isJPG && isLess2M;\n }\n }\n};",{"version":3,"sources":["staff-add-or-update.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+GA,SAAA,eAAA,QAAA,SAAA;AACA,SAAA,QAAA,EAAA,cAAA,QAAA,kBAAA;AACA,OAAA,QAAA,MAAA,iBAAA;AACA,OAAA,OAAA,MAAA,WAAA;AACA,OAAA,OAAA,MAAA,8BAAA;AACA,eAAA;AACA,EAAA,UAAA,EAA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MAAA,CAAA,OAAA,CAAA,OAAA,CAAA,MAAA;AACA;;AACA,UAAA,MAAA,CAAA,QAAA,CAAA,OAAA,CAAA,IAAA,CAAA,GAAA;AACA,SAhBA,EAgBA,OAhBA,CAgBA,YAAA;AACA,UAAA,MAAA,CAAA,OAAA,GAAA,KAAA;AACA,SAlBA;AAmBA,OAxBA;AA0BA,KA3BA,EA2BA,IA3BA,CAhCA;AA4DA,IAAA,mBA5DA,+BA4DA,GA5DA,EA4DA;AACA,WAAA,UAAA,GAAA,KAAA;;AACA,UAAA,GAAA,CAAA,IAAA,IAAA,CAAA,EAAA;AACA,eAAA,KAAA,QAAA,CAAA,KAAA,CAAA,GAAA,CAAA,GAAA,CAAA;AACA;;AACA,WAAA,QAAA,CAAA,UAAA,GAAA,GAAA,CAAA,IAAA,CAAA,IAAA;AACA,KAlEA;AAmEA,IAAA,YAnEA,wBAmEA,IAnEA,EAmEA;AACA,UAAA,KAAA,GAAA,IAAA,CAAA,IAAA,IAAA,YAAA,IAAA,IAAA,CAAA,IAAA,IAAA,WAAA;AACA,UAAA,QAAA,GAAA,IAAA,CAAA,IAAA,GAAA,IAAA,GAAA,IAAA,GAAA,CAAA;;AACA,UAAA,CAAA,KAAA,EAAA;AACA,aAAA,QAAA,CAAA,KAAA,CAAA,yBAAA;AACA;;AACA,UAAA,CAAA,QAAA,EAAA;AACA,aAAA,QAAA,CAAA,KAAA,CAAA,mBAAA;AACA;;AACA,WAAA,UAAA,GAAA,KAAA,IAAA,QAAA;AACA,aAAA,KAAA,IAAA,QAAA;AACA;AA9EA;AA5EA,CAAA","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>"],"sourceRoot":"src/views/modules/personData/staff"}]}