{"remainingRequest":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\damDance-fvue\\src\\views\\Comprehensive\\components\\PersonalDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\damDance-fvue\\src\\views\\Comprehensive\\components\\PersonalDialog.vue","mtime":1704339787440},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\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//\n//\n\r\nimport utils from '@/utils.js'\r\nimport Personal from '@/api/basicConfiguration/Personal'\r\nimport Team from '@/api/basicConfiguration/Team'\r\n\r\nexport default {\r\n props: {},\r\n name: 'PersonalDialog',\r\n components: {placesDialog},\r\n data() {\r\n const validatePhone = (rule, value, callback) => {\r\n const regExp = /^1[3|4|5|7|8|9][0-9]{9}$/\r\n if (!regExp.test(value)) {\r\n callback(new Error('请输入正确的手机号'))\r\n } else {\r\n callback()\r\n }\r\n }\r\n const validateSquare = (rule, value, callback) => {\r\n console.log(value)\r\n if (value.length) {\r\n callback()\r\n } else {\r\n callback(new Error('请选择广场舞地点'))\r\n }\r\n }\r\n return {\r\n visible: false,\r\n loading: false,\r\n rules: {\r\n name: [\r\n {\r\n required: true,\r\n message: '请输入姓名',\r\n trigger: 'blur',\r\n },\r\n ],\r\n phone: [\r\n {\r\n required: true,\r\n message: '请输入联系电话',\r\n trigger: 'blur',\r\n },\r\n {\r\n validator: validatePhone,\r\n tirgger: 'blur',\r\n },\r\n ],\r\n areaCode: [\r\n {\r\n required: true,\r\n message: '请选择行政区划',\r\n trigger: 'blur',\r\n },\r\n ],\r\n squareTeamList: [\r\n {\r\n required: true,\r\n validator: validateSquare,\r\n tirgger: 'change',\r\n },\r\n ],\r\n },\r\n type: '新增',\r\n formData: {\r\n squareTeamList: [],\r\n },\r\n areaCode: [],\r\n btnLoading: false,\r\n options: [],\r\n }\r\n },\r\n created() {\r\n this.getTownTree()\r\n },\r\n methods: {\r\n getTownTree() {\r\n Team.townTree({}, (res) => {\r\n if (res.state) {\r\n this.options = res.value\r\n }\r\n })\r\n },\r\n open(data) {\r\n this.formData = {\r\n squareTeamList: [],\r\n }\r\n this.visible = true\r\n this.type = '新增'\r\n },\r\n edit(id) {\r\n this.formData = {}\r\n this.visible = true\r\n this.type = '编辑'\r\n Personal.detailId(id, (res) => {\r\n this.formData = res\r\n this.areaCode = res.areaFullCode\r\n ? res.areaFullCode.split('/').splice(1)\r\n : []\r\n console.log(this.areaCode)\r\n })\r\n },\r\n handleClose() {\r\n this.visible = false\r\n },\r\n resetForm(formName) {\r\n this.$refs.form.resetFields()\r\n },\r\n handleChange(val) {\r\n let arr = JSON.parse(JSON.stringify(val))\r\n this.formData.areaFullCode = '/' + arr.join('/')\r\n this.formData.areaCode = arr.pop()\r\n },\r\n //保存\r\n handleSave() {\r\n this.$refs.form.validate((valid) => {\r\n if (valid) {\r\n this.btnLoading = true\r\n let method\r\n if (this.type === '新增') {\r\n method = Personal.addSave\r\n } else {\r\n method = Personal.upData\r\n }\r\n console.log(this.formData)\r\n\r\n method(this.formData, (response) => {\r\n if (response.state) {\r\n this.$notify({\r\n type: 'success',\r\n message: this.type + '成功',\r\n duration: 2000,\r\n })\r\n this.handleClose()\r\n this.$emit('getData')\r\n } else {\r\n this.$message.warning(response.message)\r\n }\r\n this.btnLoading = false\r\n })\r\n } else {\r\n this.$notify({\r\n type: 'warning',\r\n message: '请完善表单信息!',\r\n duration: 2000,\r\n })\r\n }\r\n })\r\n },\r\n handleSearchPlaces() {\r\n this.$refs.placesDialog.open(this.formData.squareTeamList)\r\n },\r\n changePlaces(data) {\r\n console.log(data)\r\n this.formData.squareTeamList = data\r\n },\r\n },\r\n}\r\n",null]}