Commit 8cb9cbd3 by liang ce

新增设置模块

parent 6dcb6030
import axios from 'axios'
import qs from 'qs'
// axios.defaults.baseURL = 'http://192.168.1.193:8300' // 本地荣
// axios.defaults.baseURL = 'http://192.168.1.174:8300' // 本地钱
// axios.defaults.baseURL = 'http://192.168.1.101:8300' // 本地荣
// axios.defaults.baseURL = 'http://192.168.1.102:8300' // 本地钱
axios.defaults.baseURL = 'http://139.196.213.18:8300' // beta环境
let loadingInstance // 创建Loading 的实例
// axios.defaults.headers.post['Content-Type'] = 'application/json; charset=utf-8'
......
......@@ -326,26 +326,30 @@ export default {
// 内部充值接口
internalRecharge () {
let _that = this
this.spinning = !this.spinning
this.visible = false
this.rechargeData.orderPrice = this.form.getFieldsValue().orderPrice
this.rechargeData.remark = this.form.getFieldsValue().remark
this.rechargeData.orgId = localStorage.getItem('orgId')
let rechargeData = this.$qs.stringify(this.rechargeData)
$http.get(`/v1/charge/charge?${rechargeData}`).then((res) => {
if (res.data.message === 'SUCCESS') {
this.form.resetFields()
this.$message.success('充值已提交,审批中请耐心等待')
this.spinning = !this.spinning
} else {
this.spinning = !this.spinning
this.$message.success(res.data.message)
}
}).catch((err) => {
console.log(err)
if (this.form.getFieldsValue().orderPrice === '' || this.form.getFieldsValue().remark === '') {
this.$message.error('备注不能为空')
} else {
this.spinning = !this.spinning
this.$message.error('充值失败')
})
this.visible = false
this.rechargeData.orderPrice = this.form.getFieldsValue().orderPrice
this.rechargeData.remark = this.form.getFieldsValue().remark
this.rechargeData.orgId = localStorage.getItem('orgId')
let rechargeData = this.$qs.stringify(this.rechargeData)
$http.get(`/v1/charge/charge?${rechargeData}`).then((res) => {
if (res.data.message === 'SUCCESS') {
this.form.resetFields()
this.$message.success('充值已提交,审批中请耐心等待')
this.spinning = !this.spinning
} else {
this.spinning = !this.spinning
this.$message.success(res.data.message)
}
}).catch((err) => {
console.log(err)
this.spinning = !this.spinning
this.$message.error('充值失败')
})
}
},
// 充值modal
showModal (userId, userName, index) {
......
......@@ -15,6 +15,7 @@
<a-menu-item key="recordsOfConsumption">消费记录</a-menu-item>
<a-menu-item key="cashierManagement">收银员管理</a-menu-item>
<a-menu-item key="systemReconciliation">系统对账</a-menu-item>
<a-menu-item key="paymentManagementSetting">设置中心</a-menu-item>
<!-- <a-menu-item key="operationLog">操作日志</a-menu-item> -->
</a-menu>
</a-layout-sider>
......
<template>
<div class="paymentManagementSetting">
<div class="title">
<span>以下功能是否需要审批</span>
<span>开启后钉钉管理员将会收到需要审批的审批单</span>
</div>
<div class="paymentManagementSettingContent">
<div>
<label>现金充值:</label>
<a-input v-model="OrgSettingData.chargeProcessInstanceId" placeholder="请输入审批模板ID"/>
<a-switch checkedChildren="开" unCheckedChildren="关" :checked="OrgSettingData.chargeSwitch !== '' && OrgSettingData.chargeSwitch !== 'CLOSE'" @change='chargeSwitchOnChange'/>
</div>
<div>
<label>津贴发放:</label>
<a-input v-model="OrgSettingData.provideSubsidyId" placeholder="请输入审批模板ID"/>
<a-switch checkedChildren="开" unCheckedChildren="关" :checked="OrgSettingData.provideSubsidySwitch !== '' && OrgSettingData.provideSubsidySwitch !== 'CLOSE'" @change='provideSubsidySwitchOnChange'/>
</div>
<!-- <div>
<label>退款:</label>
<a-input v-model="refundNotice" placeholder="请输入审批模板ID"/>
<a-switch checkedChildren="开" unCheckedChildren="关" defaultChecked @change='onChange'/>
</div> -->
<p><span>*</span>请先到钉钉的管理后台创建相关的审批模板</p>
</div>
<div class="title">
<span>以下功能是否开启消息通知</span>
<span>开启后用户将收到钉钉消息通知</span>
</div>
<div class="switchList">
<div>
<label>充值通知:</label>
<a-switch checkedChildren="开" unCheckedChildren="关" :checked="OrgSettingData.chargeNotice !== '' && OrgSettingData.chargeNotice !== 'CLOSE'" @change='chargeNoticeOnChange'/>
</div>
<div>
<label>退款通知:</label>
<a-switch checkedChildren="开" unCheckedChildren="关" :checked="OrgSettingData.refundNotice !== '' && OrgSettingData.refundNotice !== 'CLOSE'" @change='refundNoticeOnChange'/>
</div>
<div>
<label>发津贴通知:</label>
<a-switch checkedChildren="开" unCheckedChildren="关" :checked="OrgSettingData.provideSubsidyNotice !== '' && OrgSettingData.provideSubsidyNotice !== 'CLOSE'" @change='provideSubsidyNoticeOnChange'/>
</div>
<div>
<label>消费通知:</label>
<a-switch checkedChildren="开" unCheckedChildren="关" :checked="OrgSettingData.consumeSwitch !== '' && OrgSettingData.consumeSwitch !== 'CLOSE'" @change='consumeSwitchOnChange'/>
</div>
</div>
<div style="margin-top: 60px;margin-left: 200px">
<a-button type="primary" @click="updateOrgSetting()">保存修改</a-button>
</div>
</div>
</template>
<script>
import { $http } from './../../../api/axios.js'
export default {
name: 'paymentManagementSetting',
data () {
return {
OrgSettingData: {}
}
},
watch: {},
computed: {},
created: function () {
this.queryOrgSetting()
},
methods: {
queryOrgSetting () {
let querySettingData = this.$qs.stringify({
orgId: localStorage.getItem('orgId')
})
$http.post(`/v1/org_setting/query_org_setting_by_org_id?${querySettingData}`).then((res) => {
console.log(res)
this.OrgSettingData = res.data.data
}).catch((err) => {
console.log(err)
})
},
updateOrgSetting () {
let updateSettingData = this.$qs.stringify(this.OrgSettingData)
if (this.OrgSettingData.chargeProcessInstanceId === '' && this.OrgSettingData.chargeSwitch === 'OPEN') {
this.$message.error('打开审批开关后必须填写审批模版ID')
} else if (this.OrgSettingData.provideSubsidyId === '' && this.OrgSettingData.provideSubsidySwitch === 'OPEN') {
this.$message.error('打开审批开关后必须填写审批模版ID')
} else {
$http.post(`/v1/org_setting/update_org_setting_by_org_id?${updateSettingData}`).then((res) => {
if (res.data.resultCode === '0') {
this.$message.success('保存成功')
} else {
this.$message.error('保存失败')
}
}).catch((err) => {
this.$message.error(err)
})
}
},
chargeSwitchOnChange (checked) {
this.OrgSettingData.chargeSwitch = checked ? 'OPEN' : 'CLOSE'
},
provideSubsidySwitchOnChange (checked) {
this.OrgSettingData.provideSubsidySwitch = checked ? 'OPEN' : 'CLOSE'
console.log(`a-switch to ${checked}`)
},
chargeNoticeOnChange (checked) {
console.log(`a-switch to ${checked}`)
this.OrgSettingData.chargeNotice = checked ? 'OPEN' : 'CLOSE'
},
refundNoticeOnChange (checked) {
this.OrgSettingData.refundNotice = checked ? 'OPEN' : 'CLOSE'
console.log(`a-switch to ${checked}`)
},
provideSubsidyNoticeOnChange (checked) {
this.OrgSettingData.provideSubsidyNotice = checked ? 'OPEN' : 'CLOSE'
console.log(`a-switch to ${checked}`)
},
consumeSwitchOnChange (checked) {
this.OrgSettingData.consumeSwitch = checked ? 'OPEN' : 'CLOSE'
console.log(`a-switch to ${checked}`)
}
}
}
</script>
<style lang="less" scoped>
.title{
height: 47px;
width: 100%;
background: #f7f7f7;
line-height: 47px;
font-size: 14px;
}
.title span:nth-of-type(1){
margin: 0 20px;
}
.title span:nth-of-type(2){
color: #979797;
}
.paymentManagementSettingContent{
padding-left: 10px;
padding-top: 20px;
padding-bottom: 20px;
}
.paymentManagementSettingContent div{
margin: 10px 0;
}
.paymentManagementSettingContent div label{
width: 70px;
font-size: 14px;
display: inline-block;
}
.paymentManagementSettingContent div input{
width: 210px;
margin: 0 10px;
}
.paymentManagementSettingContent p{
padding-left: 80px;
font-size: 12px;
margin: 0 0 10px 0;
}
.paymentManagementSettingContent p span{
color: #FF0000;
}
.switchList{
padding-top: 30px;
padding-left: 10px;
}
.switchList div{
display: inline-block;
margin-right: 20px;
}
</style>
......@@ -2,7 +2,7 @@ import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import { Menu, Layout, Breadcrumb, Icon, Button, DatePicker, Input, Table, Tag, Divider, Dropdown, Modal, Form, Select, message, Pagination, LocaleProvider, Spin, Badge } from 'ant-design-vue'
import { Menu, Layout, Breadcrumb, Icon, Button, DatePicker, Input, Table, Tag, Divider, Dropdown, Modal, Form, Select, message, Pagination, LocaleProvider, Spin, Badge, Switch } from 'ant-design-vue'
import 'ant-design-vue/dist/antd.css'
import { config } from './api/config'
import './assets/css/global.css'
......@@ -13,6 +13,7 @@ Vue.use(Layout)
Vue.use(LocaleProvider)
Vue.use(Menu)
Vue.use(Badge)
Vue.use(Switch)
Vue.use(Spin)
Vue.use(Breadcrumb)
Vue.use(Icon)
......
......@@ -81,6 +81,12 @@ export default new Router({
name: 'allowanceDetails',
meta: { title: '支付管理/津贴发放/津贴详情' },
component: resolve => require(['./components/pages/PaymentManagement/AllowanceDetails.vue'], resolve)
},
{
path: '/paymentManagementSetting',
name: 'paymentManagementSetting',
meta: { title: '支付管理/设置中心' },
component: resolve => require(['./components/pages/PaymentManagement/PaymentManagementSetting.vue'], resolve)
}
]
}
......
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