{"remainingRequest":"E:\\hz-zhhq-web\\node_modules\\babel-loader\\lib\\index.js!E:\\hz-zhhq-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!E:\\hz-zhhq-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!E:\\hz-zhhq-web\\src\\views\\visitor\\addVisitor\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"E:\\hz-zhhq-web\\src\\views\\visitor\\addVisitor\\index.vue","mtime":1737610069453},{"path":"E:\\hz-zhhq-web\\babel.config.js","mtime":1737610069371},{"path":"E:\\hz-zhhq-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1740463332762},{"path":"E:\\hz-zhhq-web\\node_modules\\babel-loader\\lib\\index.js","mtime":1740463332584},{"path":"E:\\hz-zhhq-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1740463332762},{"path":"E:\\hz-zhhq-web\\node_modules\\vue-loader\\lib\\index.js","mtime":1740463340941}],"contextDependencies":[],"result":["\"use strict\";\n\nvar _interopRequireDefault = require(\"E:/hz-zhhq-web/node_modules/@babel/runtime/helpers/interopRequireDefault.js\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nrequire(\"core-js/modules/es6.function.name\");\nrequire(\"core-js/modules/es6.regexp.split\");\nrequire(\"core-js/modules/es6.regexp.constructor\");\nvar _getdata = require(\"@/api/getdata\");\nvar _popup = _interopRequireDefault(require(\"@/views/estate/examine/dialog/popup.vue\"));\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nvar _default = exports.default = {\n components: {\n Popup: _popup.default\n },\n data: function data() {\n var priceCard = function priceCard(rule, value, callback) {\n var reg = /^\\d{15}|\\d{18}$/;\n if (reg.test(value)) {\n callback();\n } else {\n callback(new Error(\"请输入正确身份证号!\"));\n }\n };\n var pricePhone = function pricePhone(rule, value, callback) {\n // var reg = /^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\\d{8}$/;\n var reg = /^(17[0-9)|14[0-9]|13[0-9]|15[0|1|2|3|5|6|7|8|9]|18[0-9])\\d{8}$/;\n if (reg.test(value)) {\n callback();\n } else {\n callback(new Error(\"请输入正确手机号!\"));\n }\n };\n var priceVas = function priceVas(rule, value, callback) {\n var reg1 = new RegExp(/^[a-zA-Z]+$/);\n var reg2 = new RegExp(/^[\\u4e00-\\u9fa5]+$/);\n if (reg1.test(value) == false && reg2.test(value) == false && value != '') {\n callback(new Error(\"姓名格式只支持输入全中或全英文!\"));\n } else {\n callback();\n }\n };\n return {\n fileList: [],\n //文件上传\n formDate: new FormData(),\n userList: [],\n //被访问人数组\n examine: '',\n examList: [],\n //审批人数组\n indexCall: this.$route.query.index ? this.$route.query.index : window.localStorage.getItem(\"consIndex\"),\n til: \"添加\",\n id: \"\",\n validation: false,\n completeTitle: \"\",\n btn: 3,\n dialogVisible: false,\n nav: \"\",\n ruleForm: {\n personnelName: \"\",\n personnelCard: \"\",\n personnelPhone: \"\",\n visitingTime: \"\",\n reason: \"\",\n userName: \"\",\n orgName: \"\",\n phone: \"\",\n entourage: ''\n // useLocal: \"\"\n },\n cardDesenShow: true,\n cardDesen: \"\",\n peopleData: [],\n //随行人员\n rules: {\n personnelName: [{\n required: true,\n message: \"请填写访客名称\",\n trigger: \"blur\"\n }],\n personnelPhone: [{\n required: true,\n message: \"请填写访客手机号\",\n trigger: \"blur\"\n }, {\n validator: pricePhone,\n trigger: \"blur\"\n }],\n personnelCard: [{\n required: true,\n message: \"请填写访客身份证\",\n trigger: \"blur\"\n }, {\n validator: priceCard,\n trigger: \"blur\"\n }],\n visitingTime: [{\n required: true,\n message: \"请选择来访时间\",\n trigger: \"blur\"\n }],\n userName: [{\n required: true,\n message: \"请选择被访人姓名\",\n trigger: \"blur\"\n }]\n // phone: [\n // { required: true, message: \"请填写被访人手机号\", trigger: \"blur\" },\n // {\n // // validator: priceVas,\n // trigger: \"blur\"\n // }\n // ],\n // orgName: [\n // { required: true, message: \"请填写被访人部门\", trigger: \"blur\" },\n // {\n // // validator: priceVas,\n // trigger: \"blur\"\n // }\n // ],\n // deviceState: [{ required: true, message: \"请选择\", trigger: \"blur\" }]\n }\n };\n },\n created: function created() {},\n mounted: function mounted() {\n var data = typeof this.$route.query.rowdata == \"string\" ? JSON.parse(window.localStorage.getItem(\"rowdata\")) : this.$route.query.rowdata;\n console.log(data);\n this.ruleForm.personnelName = data ? data.PERSONNEL_NAME : \"\";\n this.ruleForm.personnelCard = data ? data.PERSONNEL_CARD : \"\";\n this.cardDesen = this.regular.tmIdCard(this.ruleForm.personnelCard);\n this.ruleForm.visitingTime = data ? data.VISITING_TIME : \"\";\n this.ruleForm.userId = data ? data.USER_ID : \"\";\n this.ruleForm.userName = data ? data.USER_NAME : \"\";\n this.ruleForm.phone = data ? data.PHONE : \"\";\n this.ruleForm.orgName = data ? data.ORG_NAME : \"\";\n this.ruleForm.orgId = data ? data.ORG_ID : \"\";\n this.ruleForm.entourage = data ? data.ENTOURAGE : \"\";\n this.ruleForm.reason = data ? data.REASON : \"\";\n this.ruleForm.personnelPhone = data ? data.PERSONNEL_PHONE : \"\";\n this.ruleForm.examineBatch = data ? data.EXAMINE_BATCH : \"\";\n this.ruleForm.examinePersonId = data ? data.EXAMINE_PERSON_ID : \"\";\n this.ruleForm.examinePersonName = data ? data.EXAMINE_PERSON_NAME : \"\";\n this.examine = data ? data.EXAMINE_PERSON_NAME : \"\";\n console.log(this.ruleForm.entourage);\n if (this.ruleForm.entourage != \"\" && this.ruleForm.entourage) {\n var arr = this.ruleForm.entourage.split('@');\n this.peopleData = arr.map(function (item) {\n var subArr = item.split(',');\n var obj = {\n name: subArr[0],\n phone: subArr[1],\n card: subArr[2]\n };\n return obj;\n });\n }\n // console.log(this.peopleData)\n this.til = data ? data.til : \"添加\";\n this.ruleForm.id = data ? data.ID : \"\";\n },\n methods: {\n cardBlur: function cardBlur(captain) {\n //*脱敏\n this.cardDesen = captain ? this.regular.tmIdCard(captain) : \"\"; //脱敏\n this.cardDesenShow = true;\n },\n selectExamine: function selectExamine(row, b) {\n this.ruleForm.examinePersonId = row.id;\n this.ruleForm.examinePersonName = row.name;\n },\n getExamList: function getExamList() {\n var _this = this;\n this.examList = [];\n var Content = {\n departmentId: this.ruleForm.orgId\n };\n (0, _getdata.getDeptExamineAuth)(Content).then(function (res) {\n if (res.returnCode == \"1\") {\n _this.examList = res.returnData;\n } else {\n _this.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n }\n }).catch(function (err) {\n console.log(err);\n });\n },\n handleSubmit: function handleSubmit(item) {\n // console.log(item)\n this.ruleForm.userName = item.value;\n this.ruleForm.userId = item.name;\n this.ruleForm.orgId = item.orgId;\n this.ruleForm.orgName = item.orgName;\n this.ruleForm.phone = item.phone;\n this.examine = '';\n this.getExamList();\n //根据自身情况\n //该方法是提交时触发\n },\n //输入框获取焦点时调用的方法\n querySearch: function querySearch(queryString, cb) {\n var _this2 = this;\n var Content = {\n userName: this.ruleForm.userName\n };\n (0, _getdata.getUser)(Content).then(function (res) {\n if (res.returnCode == \"1\") {\n _this2.userList = res.returnData;\n var results = [];\n results = _this2.userList.map(function (item) {\n return {\n value: item.REAL_NAME,\n name: item.ID,\n orgId: item.ORG_ID,\n orgName: item.ORG_NAME,\n phone: item.MOBILE\n };\n });\n if (_this2.userList.length == '0') {\n results.push({\n id: '-1',\n value: '无匹配结果'\n });\n }\n cb(results);\n } else {\n _this2.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n }\n }).catch(function (err) {\n console.log(err);\n });\n },\n // 模版下载\n templateExcel: function templateExcel() {\n console.log(\"模版下载\");\n // let url =\"/greenH5/greenWebmodul/rest/greenConsumableMaterial/exportByExcel?\";\n // window.location.href = url;\n },\n //导入\n bs64: function bs64(_bs) {\n var reader = new FileReader();\n reader.readAsDataURL(_bs);\n return new Promise(function (resolve) {\n reader.onload = function (e) {\n resolve(e.target.result);\n };\n });\n },\n handlePreview: function handlePreview() {\n this.formDate = new FormData();\n this.$refs.upload.clearFiles();\n },\n onchange: function onchange(file) {\n var _this3 = this;\n this.fileList = [];\n this.formDate = new FormData();\n this.formDate.append(\"file\", file.raw);\n // console.log(this.formDate,246)\n this.fileList.push(file);\n var flag = false;\n if (this.fileList.length > 0) {\n flag = false;\n var Lastindex = this.fileList[0].name.lastIndexOf(\".\");\n if (this.fileList[0].name.slice(Lastindex) != \".xls\" && this.fileList[0].name.slice(Lastindex) != \".xlsx\") {\n flag = false;\n this.$message({\n message: \"请选择正确的Excel格式\",\n type: \"warning\"\n });\n return false;\n } else {\n flag = true;\n }\n } else {\n flag = true;\n }\n this.bs64(file.raw).then(function (bs64) {\n _this3.formDate = {\n file: bs64\n };\n if (flag) {\n // this.createLoad();\n (0, _getdata.visitorImportByExcel)(_this3.formDate).then(function (res) {\n if (res.returnCode == \"1\") {\n _this3.$message({\n message: res.returnMsg,\n type: \"success\"\n });\n // console.log('bs64',res.returnData)\n _this3.peopleData = res.returnData;\n var results = _this3.peopleData.map(function (item) {\n return item.name;\n });\n _this3.ruleForm.entourage = results.join(\",\");\n console.log();\n } else {\n _this3.clearLoad();\n _this3.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n }\n }).catch(function (err) {\n console.log(\"error\");\n });\n }\n });\n },\n // 自定义上传 导入数据\n uploadFile: function uploadFile(item) {\n var _this4 = this;\n var form = new FormData();\n form.append(\"file\", item.file);\n (0, _getdata.visitorImportByExcel)(form).then(function (res) {\n if (res.returnCode == \"1\") {\n _this4.$message({\n message: res.returnMsg,\n type: \"success\"\n });\n // this.getDate();\n console.log(\"uploadFile\");\n } else {\n _this4.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n }\n }).catch(function (err) {\n _this4.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n });\n },\n comeBack: function comeBack() {\n this.$router.push({\n name: \"visitor\",\n params: {\n index: this.indexCall\n }\n });\n },\n //保存\n submitForm: function submitForm(formName) {\n var _this5 = this;\n this.$refs[formName].validate(function (valid) {\n if (valid) {\n _this5.validation = true;\n _this5.btn = 3;\n if (_this5.til == \"修改\") {\n _this5.completeTitle = \"修改\";\n _this5.nav = \"是否修改?\";\n } else {\n _this5.completeTitle = \"添加\";\n _this5.nav = \"是否添加?\";\n }\n }\n });\n },\n closeDialogDel: function closeDialogDel(val) {\n var _this6 = this;\n if (val == \"2\") {\n var Content = this.ruleForm;\n Content.entourageList = this.peopleData;\n console.log(this.ruleForm);\n (0, _getdata.updateVisitor)(Content).then(function (res) {\n if (res.returnCode == \"1\") {\n _this6.$message({\n message: res.returnMsg,\n type: \"success\"\n });\n _this6.$router.push({\n name: \"visitor-index\",\n params: {\n index: _this6.indexCall\n }\n });\n } else {\n _this6.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n }\n }).catch(function (err) {\n console.log(err);\n });\n } else if (val == \"3\") {\n var _Content = this.ruleForm;\n _Content.entourageList = this.peopleData;\n (0, _getdata.addVisitor)(_Content).then(function (res) {\n if (res.returnCode == \"1\") {\n _this6.$message({\n message: res.returnMsg,\n type: \"success\"\n });\n _this6.$router.push({\n name: \"visitor-index\",\n params: {\n index: 1\n }\n });\n } else {\n _this6.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n }\n }).catch(function (err) {\n console.log(err);\n });\n }\n this.validation = false;\n },\n //取消\n resetForm: function resetForm(formName) {\n this.$refs[formName].resetFields();\n this.$router.push({\n name: \"visitor-index\",\n params: {\n index: this.indexCall\n }\n });\n }\n }\n};",null]}