{"remainingRequest":"/Users/admin/projects/dms/src/dealer_admin/node_modules/vue-loader/lib/index.js??vue-loader-options!/Users/admin/projects/dms/src/dealer_admin/src/views/dealer/apply/components/account.vue?vue&type=script&lang=js","dependencies":[{"path":"/Users/admin/projects/dms/src/dealer_admin/src/views/dealer/apply/components/account.vue","mtime":1713161556000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/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\nimport * as API from \"@/api/dealer\";\nimport _ from \"lodash\";\nimport * as Utils from \"@/utils/validate\";\nimport {getUuidCode} from '@/utils';\n\nexport default {\n  components: {},\n  data() {\n    return {\n      dialogFormVisible: false,\n      form: {},\n      dealer_id: '',\n    };\n  },\n  computed: {},\n  created() {\n    this.$forceUpdate();\n  },\n  methods: {\n    resetForm() {\n      this.form = {};\n    },\n    change(e) {\n      this.$forceUpdate();\n    },\n    async init(id) {\n      this.dealer_id = id;\n      this.resetForm();\n      await this.detail();\n    },\n    randomPass(){\n      let form = this.form;\n      form.password = getUuidCode(8);\n      this.form = {};\n      this.form = form;\n    },\n    async detail(){\n      const resData = await API.getSimpleDetail(this.dealer_id);\n      if(resData.__error == 0){\n        let dealer = resData.result.detail;\n        this.form.account = dealer.account; //账号\n        this.dialogFormVisible = true;\n      }\n    },\n\n    /** 表单提交，区分好 是 新增 、 更新 */\n    async dataFormSubmit() {\n      const tempData = _.cloneDeep(this.form);\n      tempData.id = this.dealer_id;\n      //验证数据是否为空\n      if (tempData.account == undefined) {\n        this.showError(\"请输入账号\");\n        return;\n      }\n      if (tempData.password == undefined) {\n        this.showError(\"请输入密码\");\n        return;\n      }\n      //点击确认再次提示\n      this.$confirm(\"确认设置？\", \"提示\")\n        .then(_ => {\n          console.log(\"确认\");\n          this.$refs[\"dataForm\"].validate(async valid => {\n            if (valid) {\n              let res = await API.accountUpdate(tempData);\n              this.dialogFormVisible = false;\n\n              this.$message({\n                message: res.msg,\n                type: \"success\",\n                duration: 1501,\n                onClose: () => {}\n              });\n            }\n          });\n        })\n        .catch(_ => {});\n    },\n    showError(msg) {\n      this.$message.error(msg);\n    }\n  }\n};\n",null]}