|
@@ -10,7 +10,7 @@
|
|
|
|
|
|
<div class="right-menu-item hover-effect">
|
|
<div class="right-menu-item hover-effect">
|
|
<el-tooltip effect="dark" content="工程机登录" placement="bottom">
|
|
<el-tooltip effect="dark" content="工程机登录" placement="bottom">
|
|
- <a class="el-icon-s-platform" style="font-size: 24px; line-height: 50px;" href="https://mpkf.weixin.qq.com/" target="_blank"></a>
|
|
|
|
|
|
+ <i class="el-icon-s-platform" style="font-size: 24px; line-height: 50px;" @click="toEngine"></i>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -39,6 +39,28 @@
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <el-dialog title="绑定工程机系统" :visible.sync="dialogFormVisible" :modal="false" width="30%">
|
|
|
|
+ <el-form ref="engineForm" :model="engineForm" :rules="engineFormRules">
|
|
|
|
+ <el-form-item label="账号" :label-width="formLabelWidth" prop="account">
|
|
|
|
+ <el-input v-model="engineForm.account" placeholder="请输入账号" autocomplete="off"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="密码" :label-width="formLabelWidth" prop="password">
|
|
|
|
+ <el-input v-model="engineForm.password" placeholder="请输入密码" autocomplete="off" show-password></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <input type="hidden" value="zfire" name="vcode" >
|
|
|
|
+ </el-form>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="dialogFormVisible = false">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <form v-show="false" :action="userInfo.enginSysUrl" method="POST">
|
|
|
|
+ <input type="hidden" :value="userInfo.enginUserName" name="username" />
|
|
|
|
+ <input type="hidden" :value="userInfo.enginPassword" name="password" />
|
|
|
|
+ <input type="hidden" value="zfire" name="vcode" >
|
|
|
|
+ <input type="submit" ref="engineSubmit">
|
|
|
|
+ </form>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -49,12 +71,29 @@ import Hamburger from '@/components/Hamburger'
|
|
import Screenfull from '@/components/Screenfull'
|
|
import Screenfull from '@/components/Screenfull'
|
|
import NavMenu from '@/components/NavMenu'
|
|
import NavMenu from '@/components/NavMenu'
|
|
import {getNoticeListCount} from "@/api/notice";
|
|
import {getNoticeListCount} from "@/api/notice";
|
|
|
|
+import { checkEngineAccount, bindEngineAccount } from '@/api/setting'
|
|
|
|
+import request from '@/utils/request'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
timer: '',
|
|
timer: '',
|
|
- noticeCount: 0
|
|
|
|
|
|
+ noticeCount: 0,
|
|
|
|
+ userInfo: '',
|
|
|
|
+ engineForm: {
|
|
|
|
+ account: '',
|
|
|
|
+ password: ''
|
|
|
|
+ },
|
|
|
|
+ engineFormRules: {
|
|
|
|
+ account: [
|
|
|
|
+ { required: true, message: '请输入工程机账号', trigger: 'blur' }
|
|
|
|
+ ],
|
|
|
|
+ password: [
|
|
|
|
+ { required: true, message: '请输入工程机密码', trigger: 'blur' }
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ formLabelWidth: '100px',
|
|
|
|
+ dialogFormVisible: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -64,6 +103,7 @@ export default {
|
|
this.timer = setInterval(function () {
|
|
this.timer = setInterval(function () {
|
|
that.initNotice()
|
|
that.initNotice()
|
|
}, 3000)
|
|
}, 3000)
|
|
|
|
+ this.userInfo = JSON.parse(localStorage.getItem("greemall_user"))
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
window.clearInterval(this.timer)
|
|
window.clearInterval(this.timer)
|
|
@@ -109,6 +149,41 @@ export default {
|
|
},
|
|
},
|
|
goNotice() {
|
|
goNotice() {
|
|
this.$router.push('/notice/index')
|
|
this.$router.push('/notice/index')
|
|
|
|
+ },
|
|
|
|
+ toEngine() {
|
|
|
|
+ const userInfoCopy = this.userInfo
|
|
|
|
+ if (userInfoCopy && userInfoCopy.bindEngin) {
|
|
|
|
+ checkEngineAccount().then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$refs.engineSubmit.click()
|
|
|
|
+ } else {
|
|
|
|
+ this.$errorMsg("账号密码错误,请重新绑定")
|
|
|
|
+ this.dialogFormVisible = true
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.dialogFormVisible = true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ submitForm() {
|
|
|
|
+ this.$refs.engineForm.validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ const params = {
|
|
|
|
+ enginUserName: this.engineForm.account,
|
|
|
|
+ enginPassword: this.engineForm.password
|
|
|
|
+ }
|
|
|
|
+ bindEngineAccount(params).then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$successMsg("绑定成功,正在打开工程机系统")
|
|
|
|
+ this.$store.dispatch('user/getInfo').then(() => {
|
|
|
|
+ this.userInfo.enginUserName = this.engineForm.account
|
|
|
|
+ this.userInfo.enginPassword = this.engineForm.password
|
|
|
|
+ this.$refs.engineSubmit.click()
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|