Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/americanContainer
| | |
| | | default: false |
| | | }, |
| | | row: { |
| | | |
| | | type: Object, |
| | | default: null |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | created() { |
| | | getMsg({ extra: localStorage.getItem('extra') }).then(res => { |
| | | this.tableData = res.data |
| | | // 回显选中行 |
| | | // this.setCurrent(this.row) |
| | | }) |
| | | }, |
| | | mounted() { }, |
| | |
| | | <template> |
| | | <div> |
| | | <div class="header_content"> |
| | | <div class="color1 fs--24 font-bold">{{ userInfo.companyName }}</div> |
| | | <div @click="$router.push('/home')" class="color1 fs--24 font-bold pointer">{{ userInfo.companyName }}</div> |
| | | <div class="flex a-center j-between"> |
| | | <div @click="userInfoShow = true" class="flex a-center mr--55 shrink0 pointer"> |
| | | <div class="mr--24 fs--20 font-bold shrink0 color2">{{ userInfo.userName }}</div> |
| | | <div class="mr--24 fs--20 font-bold shrink0 color2">{{ $store.state.userName }}</div> |
| | | <img src="../assets/img/bianji@2x.png" class="w--23 h--23" /> |
| | | </div> |
| | | <img @click="logOutShow = true" src="../assets/img/tuichu@2x.png" class="w--40 h--40 shrink0 pointer" /> |
| | |
| | | <el-form-item label="备注:" label-width="120px"> |
| | | <div style="display: flex;align-items: center;"><el-input |
| | | v-model="item.mark"></el-input> |
| | | <img style="width: 19px;height: 21px;cursor: pointer;margin-left: 26px;" |
| | | <img @click="delEmail(item, index)" |
| | | style="width: 19px;height: 21px;cursor: pointer;margin-left: 26px;" |
| | | src="@/assets/delete.png" alt=""> |
| | | </div> |
| | | </el-form-item> |
| | |
| | | <el-col :span="20" style="padding-right: 52px;position: relative;"> |
| | | <el-form-item label="备注:"> |
| | | <div style="display: flex;align-items: center;"><el-input type="textarea" :rows="3" |
| | | v-model="item.mark"></el-input> |
| | | <img style="width: 19px;height: 21px;cursor: pointer;position: absolute;right: -175px;" |
| | | v-model="item.remark"></el-input> |
| | | <img @click="delContact(item, index)" |
| | | style="width: 19px;height: 21px;cursor: pointer;position: absolute;right: -175px;" |
| | | src="@/assets/delete.png" alt=""> |
| | | </div> |
| | | </el-form-item> |
| | |
| | | |
| | | <script> |
| | | import { mapState } from 'vuex' |
| | | import { saveUserInfo, getUserInfo } from '@/view/service' |
| | | export default { |
| | | props: ['show'], |
| | | data() { |
| | |
| | | submit() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | console.log(this.form); |
| | | let params = { |
| | | extra: localStorage.getItem('extra'), |
| | | info: { |
| | | name: this.form.userName, |
| | | phone: this.form.phone, |
| | | mail: this.form.userEmail, |
| | | }, |
| | | emails: this.form.otherEmails, |
| | | addressInfos: this.form.contactInfoList |
| | | } |
| | | saveUserInfo(params).then(res => { |
| | | if (res.status == 0) { |
| | | this.$message.success('保存成功') |
| | | this.$store.commit('SET_USERNAME', this.form.userName) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // 打开 |
| | | open() { |
| | | let userInfo = JSON.parse(JSON.stringify(this.userInfo)); |
| | | this.form = { |
| | | userName: userInfo.userName, |
| | | phone: userInfo.phone, |
| | | userEmail: userInfo.userEmail, |
| | | otherEmails: userInfo.otherEmails, |
| | | contactInfoList: userInfo.contactInfoList, |
| | | } |
| | | getUserInfo({ extra: localStorage.getItem('extra') }).then(res => { |
| | | if (res.data.emails) { |
| | | res.data.emails.map(item => { |
| | | item.mail = item.email |
| | | }) |
| | | } |
| | | if (res.data.addressInfo) { |
| | | res.data.addressInfo.map(item => { |
| | | item.remark = item.mark |
| | | }) |
| | | } |
| | | this.form = { |
| | | userName: res.data.name, |
| | | phone: res.data.phone, |
| | | userEmail: res.data.email, |
| | | otherEmails: res.data.emails || [], |
| | | contactInfoList: res.data.addressInfo || [], |
| | | } |
| | | }) |
| | | }, |
| | | // 删除其他邮箱 |
| | | delEmail(item, index) { |
| | | this.form.otherEmails.splice(index, 1) |
| | | }, |
| | | // 新增其他邮箱 |
| | | addEmail() { |
| | | this.form.otherEmails.push({ |
| | | email: '', |
| | | mail: '', |
| | | mark: '' |
| | | }) |
| | | }, |
| | | // 删除收件人 |
| | | delContact(item, index) { |
| | | this.form.contactInfoList.splice(index, 1) |
| | | }, |
| | | // 新增收件人 |
| | | addContact() { |
| | | this.form.contactInfoList.push({ |
| | |
| | | routes, |
| | | }); |
| | | |
| | | // 前置路由拦截器 |
| | | // 路由拦截 |
| | | router.beforeEach((to, from, next) => { |
| | | // 没有登录并且要去的页面不是登录页面,强制跳转到登录 |
| | | if (!localStorage.getItem('extra') && to.path !== '/login') { |
| | | const extra = localStorage.getItem('extra'); |
| | | if (!extra && to.path !== '/login') { |
| | | next('/login'); |
| | | } else if (extra && to.path === '/login') { |
| | | next('/home'); |
| | | } else { |
| | | if (to.path === '/login') { |
| | | localStorage.clear(); |
| | |
| | | |
| | | const store = new Vuex.Store({ |
| | | state: { |
| | | userInfo: JSON.parse(localStorage.getItem('userInfo')) || {} |
| | | userInfo: JSON.parse(localStorage.getItem('userInfo')) || {}, |
| | | userName: '' || localStorage.getItem('userName') |
| | | }, |
| | | mutations: { |
| | | SET_USERINFO(state, userInfo) { |
| | | state.userInfo = userInfo |
| | | localStorage.setItem('userInfo', JSON.stringify(userInfo)) |
| | | localStorage.setItem('userName', userInfo.userName) |
| | | }, |
| | | SET_USERNAME(state, userName) { |
| | | state.userInfo.userName = userName |
| | | state.userName = userName |
| | | |
| | | localStorage.setItem('userName', userName) |
| | | } |
| | | }, |
| | | actions: { |
| | |
| | | created() { |
| | | this.codeStr = generateVerificationCode() |
| | | }, |
| | | mounted() { }, |
| | | mounted() { |
| | | document.addEventListener("keydown", this.handleKeyDown); |
| | | }, |
| | | methods: { |
| | | // 监听当前页面是否按下了回车 |
| | | handleKeyDown(event) { |
| | | if (event.key === "Enter") { |
| | | this.loginFun(); |
| | | } |
| | | }, |
| | | loginFun() { |
| | | if (!this.account) { |
| | | this.$message({ |
| | |
| | | //下单须知 |
| | | export const getNotice = (data) => { |
| | | return axios.post('/zj0FFk5wx4S05X-zlHKJ68bVk80Xr-1', data) |
| | | } |
| | | |
| | | //保存用户信息 |
| | | export const saveUserInfo = (data) => { |
| | | return axios.post('/zj0FFk5wx4S05X-zlITt79YYN60Xv-1', data) |
| | | } |
| | | |
| | | //获取用户信息 |
| | | export const getUserInfo = (data) => { |
| | | return axios.post('/zj0FFk5wx4S05X-zlIX6NdPQS80X0-1', data) |
| | | } |