Commit 0df90a54 by liang ce

更新bug

parent 1491b582
...@@ -5,14 +5,12 @@ var instance = axios.create() ...@@ -5,14 +5,12 @@ var instance = axios.create()
// axios.defaults.baseURL = 'http://192.168.1.102:8300/v1/isv' // 本地钱 // axios.defaults.baseURL = 'http://192.168.1.102:8300/v1/isv' // 本地钱
// axios.defaults.baseURL = 'http://139.196.213.18:8300/v1/isv' // beta环境 // axios.defaults.baseURL = 'http://139.196.213.18:8300/v1/isv' // beta环境
const BASE_URL = process.env.VUE_APP_API_URL const BASE_URL = process.env.VUE_APP_API_URL
console.log(BASE_URL)
let loadingInstance // 创建Loading 的实例 let loadingInstance // 创建Loading 的实例
// 配置发送请求前的拦截器可以设置token信息 // 配置发送请求前的拦截器可以设置token信息
axios.interceptors.request.use((config) => { axios.interceptors.request.use((config) => {
// loading开始loadingInstance.start() // loading开始loadingInstance.start()
let isRefreshToken = new Date().getTime() - sessionStorage.getItem('start_time') < sessionStorage.getItem('expires_in') - 5 * 60 * 1000 let isRefreshToken = new Date().getTime() - sessionStorage.getItem('start_time') < sessionStorage.getItem('expires_in') - 5 * 60 * 1000
if (isRefreshToken) { if (isRefreshToken) {
console.log(sessionStorage.getItem('access_token'))
config.headers['Authorization'] = `Bearer ${sessionStorage.getItem('access_token')}` config.headers['Authorization'] = `Bearer ${sessionStorage.getItem('access_token')}`
return config return config
} else { } else {
...@@ -68,7 +66,6 @@ const $http = { ...@@ -68,7 +66,6 @@ const $http = {
}, },
get: (url) => { get: (url) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
debugger
axios.get(`${BASE_URL}${url}`).then((res) => { axios.get(`${BASE_URL}${url}`).then((res) => {
return resolve(res) return resolve(res)
}).catch((error) => { }).catch((error) => {
......
<template> <template>
<div class="consumptionOrder"> <div class="consumptionOrder">
<div class="searchBox"> <div class="searchBox">
<div class="choosePeople" @click="choosePeople" style="width: 120px">选择成员</div> <div class="choosePeople" @click="choosePeople" style="width: 120px">选择消费人</div>
<a-select placeholder="经办人" :allowClear="true" style="width: 120px;margin-right: 20px;" @change="selectAgent"> <a-select placeholder="经办人" :allowClear="true" style="width: 120px;margin-right: 20px;" @change="selectAgent">
<a-select-option v-for="(item, index) in agentList" :key="index" :value="item.ddUserId">{{ item.name }}</a-select-option> <a-select-option v-for="(item, index) in agentList" :key="index" :value="item.ddUserId">{{ item.name }}</a-select-option>
</a-select> </a-select>
...@@ -11,29 +11,51 @@ ...@@ -11,29 +11,51 @@
</a-select> </a-select>
<a-button type="primary" @click="search()">查询</a-button> <a-button type="primary" @click="search()">查询</a-button>
</div> </div>
<a-table :columns="columns" :dataSource="chargeList" :pagination="pagination" @change="handleTableChange" rowKey="orderNo"> <div class="searchUserMessage" v-if="searchSource.UserMessage.emplId">
<span slot="userName">姓名</span> <div class="positionDiv"></div>
<span slot="departmentNameList" slot-scope="departmentNameList, record"> <div class="clearUserMessage"><a href="javascript:;" @click="clearUserMessage">清除</a></div>
<a-popover v-if="item" v-for="(item,indexOf) in buyerParentSysDeptList" :key="indexOf"> <div class="userListBox">
<div>
<img v-if="searchSource.UserMessage.avatar" :src="searchSource.UserMessage.avatar" :alt="searchSource.UserMessage.name"/>
<img v-else :src="this.avatarCanvasFn(searchSource.UserMessage.name)" :alt="searchSource.UserMessage.name">
<span>{{ searchSource.UserMessage.name }}</span>
</div>
</div>
</div>
<a-table :columns="columns" :dataSource="OrderList" :pagination="pagination" @change="handleTableChange" rowKey="orderId">
<span slot="buyerName">姓名</span>
<span slot="buyerSysDeptNameList" slot-scope="buyerSysDeptNameList, record">
<a-popover v-for="(item,indexOf) in buyerSysDeptNameList" :key="indexOf">
<template slot="content"> <template slot="content">
<p>{{record.buyerSysDeptNameList[indexOf]}}</p> <p>{{record.buyerParentSysDeptList[indexOf].sysParentName}}</p>
</template> </template>
<span class="deptModel">{{item}}</span> <span class="deptModel">{{item}}</span>
</a-popover> </a-popover>
</span> </span>
<span slot="chargeAmount">充值金额</span> <span slot="agentName">经办人</span>
<span slot="agent" slot-scope="agent, record"> <span slot="orderAmount">消费总额(元)</span>
{{ agent === '' && record.payTypeCode === 'EXTERNAL_ALI_RECHAGE' ? '支付宝自充' : agent }} <span slot="mingPayOrderDetailList" slot-scope="mingPayOrderDetailList">
<a-popover>
<template slot="content">
<div class="mingPayOrderDetailItem" v-for="item in mingPayOrderDetailList" :key="item.orderDetailId">
<div><img :src="item.productIcon" /></div>
<div>
<div>{{ item.productName }}</div>
<div>X{{ item.productQuantity }}</div>
</div>
<div>
¥{{ item.productPrice }}
</div>
</div>
</template>
<span class="deptModel">{{mingPayOrderDetailList[0].productName}} ···</span>
</a-popover>
</span> </span>
<span slot="orderStatus" slot-scope="orderStatus"> <span slot="orderStatus" slot-scope="orderStatus">
<a-badge v-if="orderStatus === MINGPAY_CHARGE_ORDERSTATUS.WAITING_PERMIT" status="processing" text="审批中" /> <a-badge v-if="orderStatus === 'SUCCESS'" status="success" text="已消费" />
<a-badge v-else-if="orderStatus === MINGPAY_CHARGE_ORDERSTATUS.SUCCESS" status="success" text="已完成" /> <a-badge v-else-if="orderStatus === 'REFUND_SUCCESS'" status="error" text="已退款" />
<a-badge v-else-if="orderStatus === MINGPAY_CHARGE_ORDERSTATUS.FAILED" status="error" text="审批未通过" />
</span>
<span slot="createTime" slot-scope="createTime">
{{ createTime }}
</span> </span>
<span slot="remark">备注</span> <span slot="createTime">时间</span>
</a-table> </a-table>
</div> </div>
</template> </template>
...@@ -67,26 +89,26 @@ export default { ...@@ -67,26 +89,26 @@ export default {
dataIndex: 'buyerName' dataIndex: 'buyerName'
}, { }, {
title: '部门', title: '部门',
dataIndex: 'departmentNameList', dataIndex: 'buyerSysDeptNameList',
scopedSlots: { customRender: 'departmentNameList' } scopedSlots: { customRender: 'buyerSysDeptNameList' }
}, {
title: '充值金额',
dataIndex: 'chargeAmount'
}, { }, {
title: '经办人', title: '经办人',
dataIndex: 'agent', dataIndex: 'agentName',
scopedSlots: { customRender: 'agent' } scopedSlots: { customRender: 'agentName' }
}, {
title: '消费总额',
dataIndex: 'orderAmount'
}, {
title: '消费菜品',
dataIndex: 'mingPayOrderDetailList',
scopedSlots: { customRender: 'mingPayOrderDetailList' }
}, { }, {
title: '状态', title: '状态',
dataIndex: 'orderStatus', dataIndex: 'orderStatus',
scopedSlots: { customRender: 'orderStatus' } scopedSlots: { customRender: 'orderStatus' }
}, { }, {
title: '时间', title: '时间',
dataIndex: 'createTime', dataIndex: 'createTime'
scopedSlots: { customRender: 'createTime' }
}, {
title: '备注',
dataIndex: 'remark'
}], }],
OrderList: [] OrderList: []
} }
...@@ -96,6 +118,10 @@ export default { ...@@ -96,6 +118,10 @@ export default {
this.queryOrderList() this.queryOrderList()
}, },
methods: { methods: {
handleTableChange (pagination, filters, sorter) {
this.pagination.current = pagination.current
this.queryOrderList()
},
// 获取收银员列表 // 获取收银员列表
getAgentList () { getAgentList () {
let AgentData = this.$qs.stringify({ let AgentData = this.$qs.stringify({
...@@ -110,8 +136,9 @@ export default { ...@@ -110,8 +136,9 @@ export default {
choosePeople () { choosePeople () {
const _that = this const _that = this
config.ddready('ddchooseOne').then((res) => { config.ddready('ddchooseOne').then((res) => {
debugger
this.searchSource.UserMessage = res[0] this.searchSource.UserMessage = res[0]
_that.queryRechargeList() _that.queryOrderList()
}) })
}, },
// 清理选择帅选人list // 清理选择帅选人list
...@@ -174,7 +201,7 @@ export default { ...@@ -174,7 +201,7 @@ export default {
this.pagination.total = parseInt(data.totalCount) this.pagination.total = parseInt(data.totalCount)
this.OrderList = data.list this.OrderList = data.list
}) })
}, }
} }
} }
</script> </script>
...@@ -261,4 +288,42 @@ export default { ...@@ -261,4 +288,42 @@ export default {
.ant-popover-inner-content>p{ .ant-popover-inner-content>p{
margin: 0; margin: 0;
} }
.mingPayOrderDetailItem{
display: flex;
width: 190px;
margin: 8px 0;
}
.mingPayOrderDetailItem > div:nth-of-type(1){
width: 40px;
height: 40px;
overflow: hidden;
}
.mingPayOrderDetailItem > div:nth-of-type(1) img{
width: 40px;
height: 40px;
display: block;
}
.mingPayOrderDetailItem > div:nth-of-type(2){
height: 40px;
width: 80px;
font-size: 14px;
margin-left: 10px;
}
.mingPayOrderDetailItem > div:nth-of-type(2) div:nth-of-type(1){
overflow: hidden;/*超出部分隐藏*/
text-overflow:ellipsis;/* 超出部分显示省略号 */
white-space: nowrap;/*规定段落中的文本不进行换行 */
width: 80px;/*需要配合宽度来使用*/
}
.mingPayOrderDetailItem > div:nth-of-type(2) div:nth-of-type(2){
overflow: hidden;/*超出部分隐藏*/
text-overflow:ellipsis;/* 超出部分显示省略号 */
white-space: nowrap;/*规定段落中的文本不进行换行 */
width: 80px;/*需要配合宽度来使用*/
}
.mingPayOrderDetailItem > div:nth-of-type(3){
height: 40px;
text-align: right;
flex: 1;
}
</style> </style>
<template> <template>
<div class="consumptionStatistics"> <div class="consumptionStatistics">
消费统计 <div class="searchBox">
<a-date-picker
:disabledDate="disabledStartDate"
format="YYYY-MM-DD"
v-model="startValue"
placeholder="开始日期"
@change="onChangeStartValue"
@openChange="handleStartOpenChange"
/>
<a-date-picker
:disabledDate="disabledEndDate"
format="YYYY-MM-DD"
placeholder="结束日期"
@change="onChangeEndValue"
v-model="endValue"
:open="endOpen"
@openChange="handleEndOpenChange"
/>
<a-button type="primary" @click="getStatisticalProductPage">查询</a-button>
</div>
<div class="title">账单汇总</div>
<a-table :columns="columns" :dataSource="dataSource" rowKey="productId" :pagination="pagination">
<span slot="productIcon" slot-scope="productIcon">
<img style="width: 100px" :src="productIcon" alt="" />
</span>
<span slot="productName"></span>
<span slot="productPrice"></span>
<span slot="productPrice"></span>
</a-table>
</div> </div>
</template> </template>
<script> <script>
import { $http } from './../../../api/axios.js'
import moment from 'moment'
export default { export default {
name: 'consumptionStatistics' name: 'consumptionStatistics',
data () {
return {
startTime: '',
endTime: '',
startValue: null,
endValue: null,
endOpen: false,
pagination: {
current: 1,
defaultCurrent: 10,
defaultPageSize: 10,
hideOnSinglePage: true,
total: 0
},
columns: [{
title: '产品图',
dataIndex: 'productIcon',
scopedSlots: { customRender: 'productIcon' }
}, {
title: '菜名',
dataIndex: 'productName',
}, {
title: '价格(元)',
dataIndex: 'productPrice'
}, {
title: '售出(份数)',
dataIndex: 'productStatisticalQuantity'
}],
dataSource: []
}
},
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.getStatisticalProductPage()
},
methods: {
moment,
disabledStartDate (startValue) {
const endValue = this.endValue
if (!startValue || !endValue) {
return false
}
return startValue.valueOf() > endValue.valueOf() || startValue.valueOf() >= moment().endOf('day').valueOf()
},
disabledEndDate (endValue) {
const startValue = this.startValue
if (!endValue || !startValue) {
return false
}
return startValue.valueOf() > endValue.valueOf() || endValue.valueOf() > moment().endOf('day').valueOf()
},
handleStartOpenChange (open) {
if (!open) {
this.endOpen = true
}
},
handleEndOpenChange (open) {
this.endOpen = open
},
onChangeStartValue (date, dateString) {
this.startTime = dateString
},
onChangeEndValue (date, dateString) {
this.endTime = dateString
},
getStatisticalProductPage () {
let SubsidyListData = {
startTime: this.startTime,
endTime: this.endTime,
orgId: localStorage.getItem('orgId'),
pageNumber: 10,
currentPage: this.pagination.current
}
$http.post(`/mingpay/v1/isv/order/statistical_product_page`, SubsidyListData).then((res) => {
if (res.data.resultCode === 0) {
this.dataSource = res.data.data.list
} else {
this.$message.error(res.data.message)
}
})
}
}
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.title{
font-weight: bold;
margin-top: 20px;
margin-bottom: 20px;
}
.searchBox button{
margin-left: 10px;
}
</style> </style>
...@@ -172,10 +172,10 @@ export default { ...@@ -172,10 +172,10 @@ export default {
let content let content
if (record.productStatus === 'UP') { if (record.productStatus === 'UP') {
title = '确认要下架该菜品吗?' title = '确认要下架该菜品吗?'
content = '下架后该菜品设备端不可见' content = '下架后该菜品设备端不可见'
} else { } else {
title = '确认上架该菜品吗?' title = '确认上架该菜品吗?'
content = '上架后该菜品可正常使用' content = '上架后该菜品在设备端可正常使用'
} }
this.$confirm({ this.$confirm({
title: title, title: title,
...@@ -261,13 +261,18 @@ export default { ...@@ -261,13 +261,18 @@ export default {
productName: this.addProduct.productName === this.tableSource[this.changeSourceIndex].productName ? '' : this.addProduct.productName, productName: this.addProduct.productName === this.tableSource[this.changeSourceIndex].productName ? '' : this.addProduct.productName,
productPrice: this.addProduct.productPrice === this.tableSource[this.changeSourceIndex].productPrice ? '' : this.addProduct.productPrice, productPrice: this.addProduct.productPrice === this.tableSource[this.changeSourceIndex].productPrice ? '' : this.addProduct.productPrice,
productIcon: this.fileList.length === 0 ? '' : this.addProduct.productIcon, productIcon: this.fileList.length === 0 ? '' : this.addProduct.productIcon,
productStatus: '0', productStatus: '',
productCategoryId: this.addProduct.productCategoryId === this.tableSource[this.changeSourceIndex].productCategoryId ? '' : this.addProduct.productCategoryId, productCategoryId: this.addProduct.productCategoryId === this.tableSource[this.changeSourceIndex].productCategoryId ? '' : this.addProduct.productCategoryId,
productId: this.addProduct.productId, productId: this.addProduct.productId,
sort: this.addProduct.sort === this.tableSource[this.changeSourceIndex].sort ? '' : parseInt(this.addProduct.sort) sort: this.addProduct.sort === this.tableSource[this.changeSourceIndex].sort ? '' : parseInt(this.addProduct.sort)
} }
$http.post(`/mingpay/v1/isv/product/update_product`, saveProductCategoryData).then((res) => { $http.post(`/mingpay/v1/isv/product/update_product`, saveProductCategoryData).then((res) => {
if (res.data.resultCode === 0) { if (res.data.resultCode === 0) {
this.addProduct = {}
this.imageUrl = ''
this.fileList = []
this.confirmLoading = false
this.visible = false
this.getProductCategoryList('refresh') this.getProductCategoryList('refresh')
this.$message.success('操作成功') this.$message.success('操作成功')
} else { } else {
...@@ -283,7 +288,7 @@ export default { ...@@ -283,7 +288,7 @@ export default {
productName: this.addProduct.productName, productName: this.addProduct.productName,
productPrice: this.addProduct.productPrice, productPrice: this.addProduct.productPrice,
productIcon: this.addProduct.productIcon, productIcon: this.addProduct.productIcon,
productStatus: '0', productStatus: '',
productCategoryId: this.addProduct.productCategoryId, productCategoryId: this.addProduct.productCategoryId,
sort: parseInt(this.addProduct.sort) sort: parseInt(this.addProduct.sort)
} }
...@@ -370,7 +375,6 @@ export default { ...@@ -370,7 +375,6 @@ export default {
headers: { 'Content-Type': 'multipart/form-data' } headers: { 'Content-Type': 'multipart/form-data' }
}).then((res) => { }).then((res) => {
console.log(res) console.log(res)
debugger
if (res.status === 200) { if (res.status === 200) {
that.loading = false that.loading = false
that.addProduct.productIcon = data.get('key') that.addProduct.productIcon = data.get('key')
......
...@@ -33,14 +33,18 @@ ...@@ -33,14 +33,18 @@
<a-table :columns="columns" :dataSource="accountList" size="default" rowKey="ddUserId" :pagination="pagination" @change="handleTableChange"> <a-table :columns="columns" :dataSource="accountList" size="default" rowKey="ddUserId" :pagination="pagination" @change="handleTableChange">
<span slot="name">姓名</span> <span slot="name">姓名</span>
<span slot="departmentNameList" slot-scope="departmentNameList, record"> <span slot="departmentNameList" slot-scope="departmentNameList, record">
<a-popover v-for="(item,indexOf) in departmentNameList" v-if="item" :key="indexOf"> <div v-if="departmentNameList.length > 0">
<template slot="content"> <a-popover v-for="(item,indexOf) in departmentNameList" :key="indexOf">
<p>{{record.parentSysDeptNameList[indexOf]}}</p> <template slot="content">
</template> <p>{{record.parentSysDeptNameList[indexOf]}}</p>
<span class="deptModel">{{item}}</span> </template>
</a-popover> <span class="deptModel">{{item}}</span>
</a-popover>
</div>
</span>
<span slot="realityBalance" slot-scope="realityBalance">余额
{{ realityBalance.toFixed(2) }}
</span> </span>
<span slot="realityBalance">余额</span>
<span slot="cardNo" slot-scope="cardNo"> <span slot="cardNo" slot-scope="cardNo">
{{ cardNo }} {{ cardNo }}
</span> </span>
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
<div class="OperationLog"> <div class="OperationLog">
<a-table :columns="columns" :dataSource="logData" size="default" rowKey="id" :pagination="pagination" @change="handleTableChange"> <a-table :columns="columns" :dataSource="logData" size="default" rowKey="id" :pagination="pagination" @change="handleTableChange">
<span slot="title"></span> <span slot="title"></span>
<span slot="createBy"></span> <span slot="createBy" slot-scope="createBy">
{{ createBy ? createBy : '系统操作' }}
</span>
<span slot="remoteAddr"></span> <span slot="remoteAddr"></span>
<span slot="createTime"></span> <span slot="createTime"></span>
</a-table> </a-table>
...@@ -28,7 +30,8 @@ export default { ...@@ -28,7 +30,8 @@ export default {
dataIndex: 'title' dataIndex: 'title'
}, { }, {
title: '操作人', title: '操作人',
dataIndex: 'createBy' dataIndex: 'createBy',
scopedSlots: { customRender: 'createBy' },
}, { }, {
title: 'IP地址', title: 'IP地址',
dataIndex: 'remoteAddr' dataIndex: 'remoteAddr'
......
...@@ -13,16 +13,16 @@ ...@@ -13,16 +13,16 @@
<a-button type="primary" @click="search()">查询</a-button> <a-button type="primary" @click="search()">查询</a-button>
</div> </div>
<div class="searchUserMessage" v-if="searchSource.UserMessage.emplId"> <div class="searchUserMessage" v-if="searchSource.UserMessage.emplId">
<div class="positionDiv"></div> <div class="positionDiv"></div>
<div class="clearUserMessage"><a href="javascript:;" @click="clearUserMessage">清除</a></div> <div class="clearUserMessage"><a href="javascript:;" @click="clearUserMessage">清除</a></div>
<div class="userListBox"> <div class="userListBox">
<div> <div>
<img v-if="searchSource.UserMessage.avatar" :src="searchSource.UserMessage.avatar" :alt="searchSource.UserMessage.name"/> <img v-if="searchSource.UserMessage.avatar" :src="searchSource.UserMessage.avatar" :alt="searchSource.UserMessage.name"/>
<img v-else :src="this.avatarCanvasFn(searchSource.UserMessage.name)" :alt="searchSource.UserMessage.name"> <img v-else :src="this.avatarCanvasFn(searchSource.UserMessage.name)" :alt="searchSource.UserMessage.name">
<span>{{ searchSource.UserMessage.name }}</span> <span>{{ searchSource.UserMessage.name }}</span>
</div>
</div> </div>
</div> </div>
</div>
<a-table :columns="columns" :dataSource="chargeList" :pagination="pagination" @change="handleTableChange" rowKey="orderNo"> <a-table :columns="columns" :dataSource="chargeList" :pagination="pagination" @change="handleTableChange" rowKey="orderNo">
<span slot="userName">姓名</span> <span slot="userName">姓名</span>
<span slot="departmentNameList" slot-scope="departmentNameList, record"> <span slot="departmentNameList" slot-scope="departmentNameList, record">
......
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