1 line
19 KiB
JSON
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\\student\\student-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\\student\\student-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\nimport {\n\tgetDictDataList\n} from '@/utils'\nimport {\n\tisMobile,\n\tidCardValidate\n} from '@/utils/validate'\nimport debounce from 'lodash/debounce'\nimport Cookies from 'js-cookie'\nimport imgClip from '@/components/public/img-clip'\nexport default {\n\tcomponents: {\n\t\timgClip\n\t},\n\twatch: {\n\t\t'dataForm.scIdno': {\n\t\t\timmediate: true,\n\t\t\thandler(val) {\n\t\t\t\tlet gender = '0';\n\t\t\t\tif (val && val.length == 18) {\n\t\t\t\t\tgender = val[16] % 2 == 0 ? '0' : '1';\n\t\t\t\t}\n\t\t\t\tthis.dataForm.scSex = gender\n\t\t\t}\n\t\t}\n\t},\n\tdata() {\n\t\tlet _this = this;\n\t\treturn {\n\t\t\tdialogVisible: false,\n\t\t\tloading: false,\n\t\t\timgLoading: false,\n\t\t\ttype: 'post',\n\t\t\tdataForm: {\n\t\t\t\tscPhotoimg: '',\n\t\t\t\tscStuname: '',\n\t\t\t\tscIdno: '',\n\t\t\t\tscSex: '0',\n\t\t\t\tscPhonenum: '',\n\t\t\t\tscNo: '',\n\t\t\t\tscStatus: '',\n\t\t\t\tscEducation: '',\n\t\t\t\tscRegisterdate: '',\n\t\t\t\tscGraduationdate: '',\n\t\t\t\tscHeadphotoimg: \"\",\n\t\t\t\tscSchool:\"\", // 学院\n\t\t\t},\n\t\t\tpickerOptions: {\n\t\t\t\tdisabledDate: (time) => {\n\t\t\t\t\treturn time.getTime() < new Date(this.dataForm.scRegisterdate).getTime()\n\t\t\t\t}\n\t\t\t},\n\t\t\tgenderList: getDictDataList('gender').filter(item => item.dictValue < 2),\n\t\t\tstudentStatusList: getDictDataList('studentStatus'),\n\t\t\teducationList: getDictDataList('education'),\n\t\t\tschoolList: getDictDataList('school'), // 电子科技大学深圳高等研究院 学院列表\n\t\t\trules: {\n\t\t\t\tscHeadphotoimg: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请上传图片',\n\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t}, ],\n\t\t\t\tscStuname: [{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: '请输入',\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tmax: 50,\n\t\t\t\t\t\tmessage: '最多50个字符',\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tscIdno: [{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: '请输入',\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tvalidator: idCardValidate,\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tscSex: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入',\n\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t}],\n\t\t\t\tscPhonenum: [{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: '请输入',\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tvalidator: isMobile,\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tscNo: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入',\n\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t}],\n\t\t\t\tscEducation: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请选择',\n\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t}],\n\t\t\t\tscRegisterdate: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请选择',\n\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t}],\n\t\t\t\tscStatus: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请选择',\n\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t}]\n\n\t\t\t},\n\t\t\tuploadHeaders: {},\n\t\t\tuploadUrl: window.SITE_CONFIG['apiURL'] + '/system/upload'\n\t\t}\n\t},\n\tcreated() {\n\t\tthis.uploadHeaders = {\n\t\t\tAuthorization: 'Bearer ' + Cookies.get('access_token') || ''\n\t\t}\n\t},\n\tmethods: {\n\t\tinit(data) {\n\t\t\tthis.dialogVisible = true;\n\t\t\t// 编辑\n\t\t\tif (data) {\n\t\t\t\tthis.type = \"put\";\n\t\t\t\tthis.dataForm = {\n\t\t\t\t\t...data,\n\t\t\t\t\tscSex: String(data.scSex),\n\t\t\t\t\tscStatus: String(data.scStatus),\n\t\t\t\t\tscEducation: String(data.scEducation),\n\t\t\t\t}\n\t\t\t\tthis.$nextTick(()=>{\n\t\t\t\t\tthis.$refs['img'].init(this.dataForm.scHeadphotoimg)\n\t\t\t\t})\n\t\t\t}\n\t\t\t// 新增\n\t\t\telse {\n\t\t\t\tthis.type = \"post\";\n\t\t\t\tthis.dataForm = {\n\t\t\t\t\tscPhotoimg: '',\n\t\t\t\t\tscStuname: '',\n\t\t\t\t\tscIdno: '',\n\t\t\t\t\tscSex: '0',\n\t\t\t\t\tscPhonenum: '',\n\t\t\t\t\tscNo: '',\n\t\t\t\t\tscStatus: '',\n\t\t\t\t\tscEducation: '',\n\t\t\t\t\tscRegisterdate: '',\n\t\t\t\t\tscGraduationdate: null,\n\t\t\t\t\tscHeadphotoimg: \"\",\n\t\t\t\t\tscSchool:\"\", // 学院\n\t\t\t\t};\n\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\tthis.$refs['dataForm'].clearValidate()\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\tsubmitInfo: debounce(function() {\n\t\t\tthis.$refs['dataForm'].validate((valid) => {\n\t\t\t\tif (!valid) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tthis.loading = true;\n\t\t\t\tthis.dataForm.scPhotoimg = sessionStorage.getItem(\"eightPic\")\n\t\t\t\tsessionStorage.removeItem(\"fivePic\")\n\t\t\t\tthis.dataForm.scGraduationdate = this.dataForm.scGraduationdate ? this.dataForm.scGraduationdate : null;\n\t\t\t\tthis.$http({\n\t\t\t\t\turl: \"/system/scstudents\",\n\t\t\t\t\tmethod: this.type,\n\t\t\t\t\tdata: this.dataForm\n\t\t\t\t}).then(({\n\t\t\t\t\tdata\n\t\t\t\t}) => {\n\t\t\t\t\tif (data.code != 0) {\n\t\t\t\t\t\treturn this.$message.error(data.msg)\n\t\t\t\t\t}\n\t\t\t\t\tthis.dialogVisible = false;\n\t\t\t\t\tif (this.type == 'post') {\n\t\t\t\t\t\tthis.$parent.$parent.resetQuery();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.$parent.$parent.search();\n\t\t\t\t\t}\n\t\t\t\t\tthis.$message.success(data.msg)\n\t\t\t\t}).finally(() => {\n\t\t\t\t\tthis.loading = false\n\t\t\t\t})\n\t\t\t})\n\n\t\t}, 1000),\n\t}\n}\n",{"version":3,"sources":["student-add-or-update.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA","file":"student-add-or-update.vue","sourceRoot":"src/views/modules/personData/student","sourcesContent":["<template>\n\t<el-dialog :title=\"type=='post'?'新建':'修改'\" :visible.sync=\"dialogVisible\" :close-on-click-modal=\"false\">\n\t\t<div>\n\t\t\t<el-form ref=\"dataForm\" :model=\"dataForm\" :rules=\"rules\" label-width=\"100px\">\n\t\t\t\t<el-row>\n\t\t\t\t\t<el-col>\n\t\t\t\t\t\t<el-form-item class=\"block-item\" label=\"照片\" prop=\"scPhotoimg\">\n\t\t\t\t\t\t\t<img-clip v-model=\"dataForm.scHeadphotoimg\" folder-name=\"student\" ref=\"img\"></img-clip>\n\t\t\t\t\t\t</el-form-item>\n\t\t\t\t\t</el-col>\n\t\t\t\t</el-row>\n\t\t\t\t<el-row>\n\t\t\t\t\t<el-col :span=\"12\">\n\t\t\t\t\t\t<el-form-item label=\"姓名\" prop=\"scStuname\">\n\t\t\t\t\t\t\t<el-input v-model.trim=\"dataForm.scStuname\" placeholder=\"请输入\"></el-input>\n\t\t\t\t\t\t</el-form-item>\n\t\t\t\t\t</el-col>\n\t\t\t\t\t<el-col :span=\"11\" :offset=\"1\">\n\t\t\t\t\t\t<el-form-item label=\"身份证号\" prop=\"scIdno\">\n\t\t\t\t\t\t\t<el-input v-model=\"dataForm.scIdno\" placeholder=\"请输入\"></el-input>\n\t\t\t\t\t\t</el-form-item>\n\t\t\t\t\t</el-col>\n\t\t\t\t</el-row>\n\t\t\t\t<el-row>\n\t\t\t\t\t<el-col :span=\"12\">\n\t\t\t\t\t\t<el-form-item label=\"联系电话\" prop=\"scPhonenum\">\n\t\t\t\t\t\t\t<el-input v-model=\"dataForm.scPhonenum\" placeholder=\"请输入\"></el-input>\n\t\t\t\t\t\t</el-form-item>\n\t\t\t\t\t</el-col>\n\t\t\t\t\t<el-col :span=\"11\" :offset=\"1\">\n\t\t\t\t\t\t<el-form-item label=\"性别\" prop=\"scSex\">\n\t\t\t\t\t\t\t<el-radio-group v-model=\"dataForm.scSex\" placeholder=\"请输入\">\n\t\t\t\t\t\t\t\t<el-radio disabled v-for=\"item in genderList\" :key=\"item.dictLabel\" :label=\"item.dictValue\">{{item.dictLabel}}</el-radio>\n\t\t\t\t\t\t\t</el-radio-group>\n\t\t\t\t\t\t</el-form-item>\n\t\t\t\t\t</el-col>\n\t\t\t\t</el-row>\n\t\t\t\t<el-row>\n\t\t\t\t\t<el-col :span=\"12\">\n\t\t\t\t\t\t<el-form-item label=\"学号\" prop=\"scNo\">\n\t\t\t\t\t\t\t<el-input v-model=\"dataForm.scNo\" placeholder=\"请输入\"></el-input>\n\t\t\t\t\t\t</el-form-item>\n\t\t\t\t\t</el-col>\n\t\t\t\t\t<el-col :span=\"11\" :offset=\"1\">\n\t\t\t\t\t\t<el-form-item label=\"学历\" prop=\"scEducation\">\n\t\t\t\t\t\t\t<el-select v-model=\"dataForm.scEducation\" placeholder=\"请选择\" clearable>\n\t\t\t\t\t\t\t\t<el-option v-for=\"item in educationList\" :key=\"item.dictLabel\" :label=\"item.dictLabel\" :value=\"item.dictValue\"></el-option>\n\t\t\t\t\t\t\t</el-select>\n\t\t\t\t\t\t</el-form-item>\n\t\t\t\t\t</el-col>\n\t\t\t\t</el-row>\n\t\t\t\t<el-row>\n\t\t\t\t\t<el-col :span=\"12\">\n\t\t\t\t\t\t<el-form-item label=\"入学时间\" prop=\"scRegisterdate\">\n\t\t\t\t\t\t\t<el-date-picker v-model=\"dataForm.scRegisterdate\" type=\"date\" value-format=\"yyyy-MM-dd\" placeholder=\"请选择\"></el-date-picker>\n\t\t\t\t\t\t</el-form-item>\n\t\t\t\t\t</el-col>\n\t\t\t\t\t<el-col :span=\"11\" :offset=\"1\">\n\t\t\t\t\t\t<el-form-item label=\"学生状态\" prop=\"scStatus\">\n\t\t\t\t\t\t\t<el-select v-model=\"dataForm.scStatus\" placeholder=\"请选择\" clearable>\n\t\t\t\t\t\t\t\t<el-option v-for=\"item in studentStatusList\" :key=\"item.dictLabel\" :label=\"item.dictLabel\" :value=\"item.dictValue\"></el-option>\n\t\t\t\t\t\t\t</el-select>\n\t\t\t\t\t\t</el-form-item>\n\t\t\t\t\t</el-col>\n\t\t\t\t</el-row>\n\t\t\t\t<el-row v-if=\"type=='put'\">\n\t\t\t\t\t<el-col :span=\"12\">\n\t\t\t\t\t\t<el-form-item label=\"毕业时间\">\n\t\t\t\t\t\t\t<el-date-picker v-model=\"dataForm.scGraduationdate\" type=\"date\" value-format=\"yyyy-MM-dd\" placeholder=\"请选择\"\n\t\t\t\t\t\t\t :picker-options=\"pickerOptions\"></el-date-picker>\n\t\t\t\t\t\t</el-form-item>\n\t\t\t\t\t</el-col>\n\t\t\t\t</el-row>\n\t\t\t\t<el-row>\n\t\t\t\t\t<el-col :span=\"12\">\n\t\t\t\t\t\t<el-form-item label=\"学院\" prop=\"scSchool\">\n\t\t\t\t\t\t\t<el-select v-model=\"dataForm.scSchool\" placeholder=\"请选择\" clearable>\n\t\t\t\t\t\t\t\t<el-option v-for=\"item in schoolList\" :key=\"item.dictLabel\" :label=\"item.dictLabel\" :value=\"item.dictValue\"></el-option>\n\t\t\t\t\t\t\t</el-select>\n\t\t\t\t\t\t</el-form-item>\n\t\t\t\t\t</el-col>\n\t\t\t\t</el-row>\n\t\t\t</el-form>\n\t\t</div>\n\t\t<div slot=\"footer\">\n\t\t\t<el-button @click=\"dialogVisible = false\">取 消</el-button>\n\t\t\t<el-button type=\"primary\" v-loading=\"loading\" @click=\"submitInfo\">确 定</el-button>\n\t\t</div>\n\t</el-dialog>\n</template>\n<script>\n\timport {\n\t\tgetDictDataList\n\t} from '@/utils'\n\timport {\n\t\tisMobile,\n\t\tidCardValidate\n\t} from '@/utils/validate'\n\timport debounce from 'lodash/debounce'\n\timport Cookies from 'js-cookie'\n\timport imgClip from '@/components/public/img-clip'\n\texport default {\n\t\tcomponents: {\n\t\t\timgClip\n\t\t},\n\t\twatch: {\n\t\t\t'dataForm.scIdno': {\n\t\t\t\timmediate: true,\n\t\t\t\thandler(val) {\n\t\t\t\t\tlet gender = '0';\n\t\t\t\t\tif (val && val.length == 18) {\n\t\t\t\t\t\tgender = val[16] % 2 == 0 ? '0' : '1';\n\t\t\t\t\t}\n\t\t\t\t\tthis.dataForm.scSex = gender\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tdata() {\n\t\t\tlet _this = this;\n\t\t\treturn {\n\t\t\t\tdialogVisible: false,\n\t\t\t\tloading: false,\n\t\t\t\timgLoading: false,\n\t\t\t\ttype: 'post',\n\t\t\t\tdataForm: {\n\t\t\t\t\tscPhotoimg: '',\n\t\t\t\t\tscStuname: '',\n\t\t\t\t\tscIdno: '',\n\t\t\t\t\tscSex: '0',\n\t\t\t\t\tscPhonenum: '',\n\t\t\t\t\tscNo: '',\n\t\t\t\t\tscStatus: '',\n\t\t\t\t\tscEducation: '',\n\t\t\t\t\tscRegisterdate: '',\n\t\t\t\t\tscGraduationdate: '',\n\t\t\t\t\tscHeadphotoimg: \"\",\n\t\t\t\t\tscSchool:\"\", // 学院\n\t\t\t\t},\n\t\t\t\tpickerOptions: {\n\t\t\t\t\tdisabledDate: (time) => {\n\t\t\t\t\t\treturn time.getTime() < new Date(this.dataForm.scRegisterdate).getTime()\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgenderList: getDictDataList('gender').filter(item => item.dictValue < 2),\n\t\t\t\tstudentStatusList: getDictDataList('studentStatus'),\n\t\t\t\teducationList: getDictDataList('education'),\n\t\t\t\tschoolList: getDictDataList('school'), // 电子科技大学深圳高等研究院 学院列表\n\t\t\t\trules: {\n\t\t\t\t\tscHeadphotoimg: [{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: '请上传图片',\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t}, ],\n\t\t\t\t\tscStuname: [{\n\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\tmessage: '请输入',\n\t\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmax: 50,\n\t\t\t\t\t\t\tmessage: '最多50个字符',\n\t\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\tscIdno: [{\n\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\tmessage: '请输入',\n\t\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalidator: idCardValidate,\n\t\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\tscSex: [{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: '请输入',\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t}],\n\t\t\t\t\tscPhonenum: [{\n\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\tmessage: '请输入',\n\t\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalidator: isMobile,\n\t\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\tscNo: [{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: '请输入',\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t}],\n\t\t\t\t\tscEducation: [{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: '请选择',\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t}],\n\t\t\t\t\tscRegisterdate: [{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: '请选择',\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t}],\n\t\t\t\t\tscStatus: [{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: '请选择',\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t}]\n\n\t\t\t\t},\n\t\t\t\tuploadHeaders: {},\n\t\t\t\tuploadUrl: window.SITE_CONFIG['apiURL'] + '/system/upload'\n\t\t\t}\n\t\t},\n\t\tcreated() {\n\t\t\tthis.uploadHeaders = {\n\t\t\t\tAuthorization: 'Bearer ' + Cookies.get('access_token') || ''\n\t\t\t}\n\t\t},\n\t\tmethods: {\n\t\t\tinit(data) {\n\t\t\t\tthis.dialogVisible = true;\n\t\t\t\t// 编辑\n\t\t\t\tif (data) {\n\t\t\t\t\tthis.type = \"put\";\n\t\t\t\t\tthis.dataForm = {\n\t\t\t\t\t\t...data,\n\t\t\t\t\t\tscSex: String(data.scSex),\n\t\t\t\t\t\tscStatus: String(data.scStatus),\n\t\t\t\t\t\tscEducation: String(data.scEducation),\n\t\t\t\t\t}\n\t\t\t\t\tthis.$nextTick(()=>{\n\t\t\t\t\t\tthis.$refs['img'].init(this.dataForm.scHeadphotoimg)\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\t// 新增\n\t\t\t\telse {\n\t\t\t\t\tthis.type = \"post\";\n\t\t\t\t\tthis.dataForm = {\n\t\t\t\t\t\tscPhotoimg: '',\n\t\t\t\t\t\tscStuname: '',\n\t\t\t\t\t\tscIdno: '',\n\t\t\t\t\t\tscSex: '0',\n\t\t\t\t\t\tscPhonenum: '',\n\t\t\t\t\t\tscNo: '',\n\t\t\t\t\t\tscStatus: '',\n\t\t\t\t\t\tscEducation: '',\n\t\t\t\t\t\tscRegisterdate: '',\n\t\t\t\t\t\tscGraduationdate: null,\n\t\t\t\t\t\tscHeadphotoimg: \"\",\n\t\t\t\t\t\tscSchool:\"\", // 学院\n\t\t\t\t\t};\n\t\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\t\tthis.$refs['dataForm'].clearValidate()\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t},\n\t\t\tsubmitInfo: debounce(function() {\n\t\t\t\tthis.$refs['dataForm'].validate((valid) => {\n\t\t\t\t\tif (!valid) {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t\tthis.loading = true;\n\t\t\t\t\tthis.dataForm.scPhotoimg = sessionStorage.getItem(\"eightPic\")\n\t\t\t\t\tsessionStorage.removeItem(\"fivePic\")\n\t\t\t\t\tthis.dataForm.scGraduationdate = this.dataForm.scGraduationdate ? this.dataForm.scGraduationdate : null;\n\t\t\t\t\tthis.$http({\n\t\t\t\t\t\turl: \"/system/scstudents\",\n\t\t\t\t\t\tmethod: this.type,\n\t\t\t\t\t\tdata: this.dataForm\n\t\t\t\t\t}).then(({\n\t\t\t\t\t\tdata\n\t\t\t\t\t}) => {\n\t\t\t\t\t\tif (data.code != 0) {\n\t\t\t\t\t\t\treturn this.$message.error(data.msg)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.dialogVisible = false;\n\t\t\t\t\t\tif (this.type == 'post') {\n\t\t\t\t\t\t\tthis.$parent.$parent.resetQuery();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.$parent.$parent.search();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.$message.success(data.msg)\n\t\t\t\t\t}).finally(() => {\n\t\t\t\t\t\tthis.loading = false\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t}, 1000),\n\t\t}\n\t}\n</script>\n<style lang=\"scss\" scoped>\n\t.el-dialog {\n\t\t.el-form {\n\t\t\t.el-form-item {\n\n\t\t\t\t.el-date-editor--date,\n\t\t\t\t.el-select {\n\t\t\t\t\twidth: 100%;\n\t\t\t\t}\n\n\t\t\t\t/deep/ .el-upload {\n\t\t\t\t\tborder: 1px dashed #d9d9d9;\n\t\t\t\t\tborder-radius: 6px;\n\t\t\t\t\tcursor: pointer;\n\t\t\t\t\tposition: relative;\n\t\t\t\t\toverflow: hidden;\n\t\t\t\t\tmargin-left: 20px;\n\n\t\t\t\t\t.avatar-uploader-icon {\n\t\t\t\t\t\tfont-size: 28px;\n\t\t\t\t\t\tcolor: #fff;\n\t\t\t\t\t\theight: 150px;\n\t\t\t\t\t\twidth: 106px;\n\t\t\t\t\t\tline-height: 150px;\n\t\t\t\t\t\ttext-align: center;\n\t\t\t\t\t}\n\n\t\t\t\t\t.avatar {\n\t\t\t\t\t\theight: 150px;\n\t\t\t\t\t\twidth: 106px;\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n</style>\n"]}]} |