Commit 9eb47e07 by liang ce

修改es报错

parents 7796486c 3cacfdf4
NODE_ENV = 'test'
VUE_APP_API_URL = 'https://gateway-beta.mingwork.com'
\ No newline at end of file
.DS_Store .DS_Store
node_modules node_modules
dist dist
<<<<<<< HEAD
=======
>>>>>>> ISV
# local env files # local env files
.env.local .env.local
.env.*.local .env.*.local
......
...@@ -7,12 +7,14 @@ ...@@ -7,12 +7,14 @@
"devserve": "vue-cli-service serve --model development", "devserve": "vue-cli-service serve --model development",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"probuild": "vue-cli-service build --mode production", "probuild": "vue-cli-service build --mode production",
"test": "vue-cli-service build --mode test",
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"ant-design-vue": "^1.3.8", "ant-design-vue": "^1.3.8",
"core-js": "^2.6.5", "core-js": "^2.6.5",
"dingtalk-jsapi": "^2.6.44", "dingtalk-jsapi": "^2.6.44",
"echarts": "^4.5.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.0.3", "vue-router": "^3.0.3",
"vuex": "^3.0.1" "vuex": "^3.0.1"
......
...@@ -14,7 +14,7 @@ axios.interceptors.request.use((config) => { ...@@ -14,7 +14,7 @@ axios.interceptors.request.use((config) => {
} else { } else {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
refreshToken().then((res) => { refreshToken().then((res) => {
console.log('res', res); console.log('res', res)
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
}) })
......
...@@ -54,7 +54,7 @@ const config = { ...@@ -54,7 +54,7 @@ const config = {
let isRefreshToken = new Date().getTime() - localStorage.getItem(`start_time_${localStorage.getItem('orgId')}`) < localStorage.getItem(`expires_in_${localStorage.getItem('orgId')}`) - 5 * 60 * 1000 let isRefreshToken = new Date().getTime() - localStorage.getItem(`start_time_${localStorage.getItem('orgId')}`) < localStorage.getItem(`expires_in_${localStorage.getItem('orgId')}`) - 5 * 60 * 1000
if (localStorage.getItem(`access_token_${localStorage.getItem('orgId')}`) && isRefreshToken) { if (localStorage.getItem(`access_token_${localStorage.getItem('orgId')}`) && isRefreshToken) {
resolve('ok') resolve('ok')
} else if (localStorage.getItem('refresh_token')) { } else if (localStorage.getItem(`refresh_token_${localStorage.getItem('orgId')}`)) {
refreshToken().then((res) => { refreshToken().then((res) => {
if (res === 'ok') { if (res === 'ok') {
resolve('ok') resolve('ok')
......
...@@ -18,6 +18,8 @@ instance.interceptors.response.use(res => { ...@@ -18,6 +18,8 @@ instance.interceptors.response.use(res => {
router.push({ router.push({
path: '/noPermission' path: '/noPermission'
}) })
} else {
resolve('ok')
} }
}) })
} }
...@@ -106,11 +108,11 @@ function getToken () { ...@@ -106,11 +108,11 @@ function getToken () {
} }
// 刷新token接口 // 刷新token接口
function refreshToken () { function refreshToken () {
let loginData = qs.stringify({
refresh_token: localStorage.getItem(`refresh_token_${localStorage.getItem('orgId')}`),
grant_type: 'refresh_token'
})
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let loginData = qs.stringify({
refresh_token: localStorage.getItem(`refresh_token_${localStorage.getItem('orgId')}`),
grant_type: 'refresh_token'
})
instance.post(`${BASE_URL}/auth/oauth/token`, loginData, { instance.post(`${BASE_URL}/auth/oauth/token`, loginData, {
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
...@@ -122,9 +124,8 @@ function refreshToken () { ...@@ -122,9 +124,8 @@ function refreshToken () {
localStorage.setItem(`expires_in_${localStorage.getItem('orgId')}`, response.data.expires_in * 1000) localStorage.setItem(`expires_in_${localStorage.getItem('orgId')}`, response.data.expires_in * 1000)
localStorage.setItem(`start_time_${localStorage.getItem('orgId')}`, new Date().getTime()) localStorage.setItem(`start_time_${localStorage.getItem('orgId')}`, new Date().getTime())
resolve('ok') resolve('ok')
}).catch((err) => { }).catch(() => {
console.log('refreshToken', err) resolve('ok')
resolve(err)
}) })
}) })
} }
......
...@@ -21,18 +21,86 @@ ...@@ -21,18 +21,86 @@
:open="endOpen" :open="endOpen"
@openChange="handleEndOpenChange" @openChange="handleEndOpenChange"
/> />
<a-button type="primary" @click="getStatisticalProductPage">查询</a-button> <a-button type="primary" @click="queryRecordList">查询</a-button>
</div> </div>
<!-- <a-table :columns="columns" :dataSource="dataSource" rowKey="productId" :pagination="pagination" @change="handleTableChange"> <a-table :columns="columns" :dataSource="dataSource" style="margin-top: 20px;" rowKey="recordId" :pagination="pagination" @change="handleTableChange">
<span slot="productIcon" slot-scope="productIcon"> <span slot="visitorList" slot-scope="visitorList">
<img style="width: 100px" :src="productIcon" alt="" /> <span v-for="(item, index) in visitorList" :key="item.visitorId">
{{ index === visitorList.length - 1 ? item.name : `${item.name},`}}
</span>
</span> </span>
<span slot="productName"></span> <span slot="companyName"></span>
<span slot="productPrice" slot-scope="productPrice"> <span slot="purpose"></span>
{{ productPrice.toFixed(2) }} <span slot="byVisitorName"></span>
<span slot="startTime" slot-scope="startTime, record">
{{ startTime }} - {{ record.endTime }}
</span> </span>
<span slot="productStatisticalQuantity"></span> <span slot="processStatus" slot-scope="processStatus">
</a-table> --> {{processStatus === 'invite' ? '已邀请' : processStatus === 'reach' ? '已接待' : '已取消'}}
</span>
<span slot="byVisitorName"></span>
<span slot="action" slot-scope="text, record">
<a @click="showModal(record)">查看详情</a>
</span>
</a-table>
<a-modal v-model="visible" title="访客详情" :footer="null">
<div class="recordDetails">
<div>
<label>到访情况</label>
<div>{{showModalData.processStatus === 'invite' ? '已邀请' : showModalData.processStatus === 'reach' ? '已接待' : '已取消'}}</div>
</div>
<div>
<label>主访客</label>
<div>{{showModalData.visitorName}} {{showModalData.mobile}}</div>
</div>
<div>
<label>随行访客</label>
<div v-if="showModalData.visitorList1 && showModalData.visitorList1.length !== 1">
<p v-for="item in showModalData.visitorList1" :key="item.visitorId" v-show="item.mobile !== showModalData.mobile">{{item.name}} {{item.mobile}}</p>
</div>
<div v-else>
暂无
</div>
</div>
<div>
<label>访客公司</label>
<div>{{showModalData.companyName ? showModalData.companyName : '暂无'}}</div>
</div>
<div>
<label>被约时间</label>
<div>{{showModalData.inviteTime}}</div>
</div>
<div>
<label>被访人</label>
<div>{{showModalData.byVisitorName}}</div>
</div>
<div>
<label>开始时间</label>
<div>{{showModalData.startTime}}</div>
</div>
<div>
<label>结束时间</label>
<div>{{showModalData.endTime}}</div>
</div>
<div>
<label>来访目的</label>
<div>{{showModalData.purpose}}</div>
</div>
<div>
<label>到访地址</label>
<div>{{showModalData.visitAddress}}</div>
</div>
<div>
<label>周知人员</label>
<div v-if="showModalData.participatorUserList && showModalData.participatorUserList.length === 0">暂无</div>
<div v-else><span v-for="item in showModalData.participatorUserList" :key="item.ddUserId" style="margin-right: 10px;">{{item.username}}</span></div>
</div>
<div>
<label>备注</label>
<div>{{showModalData.remark}}</div>
</div>
</div>
</a-modal>
</div> </div>
</template> </template>
...@@ -58,31 +126,51 @@ export default { ...@@ -58,31 +126,51 @@ export default {
total: 0 total: 0
}, },
columns: [{ columns: [{
title: '产品图', title: '访客姓名',
dataIndex: 'productIcon', dataIndex: 'visitorList',
scopedSlots: { customRender: 'productIcon' } scopedSlots: { customRender: 'visitorList' },
width: '90px'
}, {
title: '访客单位',
dataIndex: 'companyName'
}, {
title: '来访目的',
dataIndex: 'purpose'
}, {
title: '被访人',
dataIndex: 'byVisitorName'
}, { }, {
title: '菜名', title: '被约时间',
dataIndex: 'productName' dataIndex: 'startTime',
scopedSlots: { customRender: 'startTime' }
}, { }, {
title: '售出(份数)', title: '状态',
dataIndex: 'productStatisticalQuantity' dataIndex: 'processStatus',
scopedSlots: { customRender: 'processStatus' }
}, {
title: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
}], }],
dataSource: [] dataSource: [],
showModalData: {},
visible: false
} }
}, },
created () { created () {
let date = new Date()
let year = date.getFullYear()
let month = date.getMonth() + 1
let day = (new Date(year, month, 0).getDate().toString()).length > 1 ? new Date(year, month, 0).getDate() : '0' + new Date(year, month, 0).getDate()
this.startTime = `${year}-${month.toString().length > 1 ? month : '0' + month}-01`
this.endTime = `${year}-${month.toString().length > 1 ? month : '0' + month}-${day}`
this.startValue = this.moment(`${year}-${month.toString().length > 1 ? month : '0' + month}-01`, 'YYYY-MM-DD')
this.endValue = this.moment(`${year}-${month.toString().length > 1 ? month : '0' + month}-${day}`, 'YYYY-MM-DD')
this.queryRecordList() this.queryRecordList()
}, },
methods: { methods: {
showModal (record) {
this.showModalData = record
this.visible = true
},
// handleOk (e) {
// this.visible = false
// },
// handleCancel (e) {
// this.visible = false
// },
moment, moment,
disabledStartDate (startValue) { disabledStartDate (startValue) {
const endValue = this.endValue const endValue = this.endValue
...@@ -114,14 +202,16 @@ export default { ...@@ -114,14 +202,16 @@ export default {
}, },
queryRecordList () { queryRecordList () {
let RecordListData = { let RecordListData = {
startTime: `${this.startTime} 00:00:00`, visitorName: this.visitorName,
endTime: `${this.endTime} 23:59:59`, byVisitorName: this.byVisitorName,
startTime: this.startTime ? `${this.startTime} 00:00:00` : '',
endTime: this.endTime ? `${this.endTime} 23:59:59` : '',
pageNumber: 10, pageNumber: 10,
currentPage: this.pagination.current currentPage: this.pagination.current
} }
$http.post(`/admin/visitor/queryRecordList`, RecordListData).then((res) => { $http.post(`/admin/visitor/getRecordList`, RecordListData).then((res) => {
if (res.data.resultCode === 0) { if (res.data.code === 0) {
this.dataSource = res.data.data.list this.dataSource = res.data.data.records
this.pagination.total = res.data.data.total this.pagination.total = res.data.data.total
} else { } else {
this.$message.error(res.data.message) this.$message.error(res.data.message)
...@@ -149,4 +239,15 @@ export default { ...@@ -149,4 +239,15 @@ export default {
.searchBox input{ .searchBox input{
margin-right: 20px; margin-right: 20px;
} }
.recordDetails>div{
width: 100%;
display: flex;
margin: 10px;
}
.recordDetails>div label {
width: 120px;
font-weight: bolder;
margin-right: 10px;
text-align: right;
}
</style> </style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="visitorSetting"> <div class="visitorSetting">
<div class="title">新增到访目的</div> <div class="title">新增到访目的</div>
<div class="purposeList"> <div class="purposeList">
<a-input placeholder="请输入来访目的" v-model="addtags" style="width: 320px;margin-right:20px"/> <a-input placeholder="请输入来访目的" maxlength="20" v-model="addtags" style="width: 320px;margin-right:20px"/>
<a-button type="primary" @click="savePurpose">保存</a-button> <a-button type="primary" @click="savePurpose">保存</a-button>
<div class="purposeListContent"> <div class="purposeListContent">
<template v-for="item in tagsData"> <template v-for="item in tagsData">
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<a-input <a-input
v-decorator="[ v-decorator="[
'address', 'address',
{ rules: [{ required: true, message: '请填写省/市/街道' }] }, { rules: [{ required: true, message: '请填写省/市/街道' }, { max: 120, message: '最大长度为120字符' } ]},
]" ]"
placeholder="请填写省/市/街道" placeholder="请填写省/市/街道"
/> />
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<a-textarea <a-textarea
v-decorator="[ v-decorator="[
'addressDetail', 'addressDetail',
{ rules: [{ required: true, message: '请输入详细地址信息,如道路、楼栋号、单位、门牌号等' }] }, { rules: [{ required: true, message: '请输入详细地址信息,如道路、楼栋号、单位、门牌号等' }, { max: 120, message: '最大长度为120字符' } ]},
]" ]"
placeholder="请输入详细地址信息,如道路、楼栋号、单位、门牌号等" placeholder="请输入详细地址信息,如道路、楼栋号、单位、门牌号等"
/> />
...@@ -197,12 +197,21 @@ export default { ...@@ -197,12 +197,21 @@ export default {
}) })
}, },
deleteAddress (id) { deleteAddress (id) {
let removeData = { let that = this
addressId: id this.$confirm({
} title: '删除到访地址',
$http.delete(`/admin/address/remove`, removeData).then((res) => { content: '确认删除该删除到访地址么?',
if (res.data.code === 0) { okText: '确定',
this.queryAddressList() cancelText: '取消',
onOk () {
let removeData = {
addressId: id
}
$http.delete(`/admin/address/remove`, removeData).then((res) => {
if (res.data.code === 0) {
that.queryAddressList()
}
})
} }
}) })
}, },
...@@ -224,6 +233,7 @@ export default { ...@@ -224,6 +233,7 @@ export default {
$http.post(`/admin/address/save`, saveData).then((res) => { $http.post(`/admin/address/save`, saveData).then((res) => {
if (res.data.code === 0) { if (res.data.code === 0) {
this.checkNick = false this.checkNick = false
this.form.resetFields()
this.queryAddressList() this.queryAddressList()
} }
}) })
......
...@@ -6,6 +6,7 @@ import { Upload, Menu, Layout, Checkbox, Breadcrumb, Popover, Icon, Button, Date ...@@ -6,6 +6,7 @@ import { Upload, Menu, Layout, Checkbox, Breadcrumb, Popover, Icon, Button, Date
import 'ant-design-vue/dist/antd.css' import 'ant-design-vue/dist/antd.css'
import { config } from './api/config' import { config } from './api/config'
import './assets/css/global.css' import './assets/css/global.css'
import echarts from 'echarts'
Vue.use(Layout) Vue.use(Layout)
Vue.use(Upload) Vue.use(Upload)
...@@ -32,8 +33,10 @@ Vue.use(Input.TextArea) ...@@ -32,8 +33,10 @@ Vue.use(Input.TextArea)
Vue.use(message) Vue.use(message)
Vue.use(Pagination) Vue.use(Pagination)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$confirm = Modal.confirm Vue.prototype.$confirm = Modal.confirm
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.$echarts = echarts
router.beforeEach(function (to, from, next) { router.beforeEach(function (to, from, next) {
// 项目初始化进行鉴权 // 项目初始化进行鉴权
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment