Browse Source

完善销售政策--增加停用、启用

master
yunuo970428 2 years ago
parent
commit
4332804dd8
  1. 10
      anrui-buscenter/anrui-buscenter-ui/src/api/jichuxinxi/salepolicy.js
  2. 80
      anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/xiaoshouzhengce/xiaoshouzhengce.vue

10
anrui-buscenter/anrui-buscenter-ui/src/api/jichuxinxi/salepolicy.js

@ -69,6 +69,16 @@ export function baseDisCountPackageGetVeh(data) {
})
}
// 停用或开启 0停用 1开启
export function setState(data) {
return request({
url: '/base/v1/basediscountpackage/setState',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
}
// 提交流程
export function submitVehicleApply(params) {
return request({

80
anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/xiaoshouzhengce/xiaoshouzhengce.vue

@ -113,7 +113,7 @@
</template>
<script>
import { deleteBySids, listPage } from '@/api/jichuxinxi/salepolicy'
import { deleteBySids, listPage, setState } from '@/api/jichuxinxi/salepolicy'
import { typeValues, selectHaveMessage } from '@/api/dictcommons/dictcommons'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
@ -145,6 +145,20 @@ export default {
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'danger',
size: 'small',
icon: '',
btnKey: 'toBlockUp',
btnLabel: '停用'
},
{
type: 'primary',
size: 'small',
icon: '',
btnKey: 'toOpen',
btnLabel: '启用'
},
{
type: 'danger',
size: 'small',
@ -244,6 +258,12 @@ export default {
case 'doDel':
this.doDel()
break
case 'toBlockUp':
this.toBlockUp()
break
case 'toOpen':
this.toOpen()
break
case 'doClose':
this.doClose()
break
@ -413,6 +433,64 @@ export default {
return
}
},
toBlockUp() {
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行停用操作' })
return
}
const tip = '请确认是否停用所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
setState({ sidsList: this.sids, useState: '0', userSid: window.sessionStorage.getItem('userSid') }).then(resp => {
if (resp.success) {
this.$message({ type: 'success', message: resp.msg, showClose: true })
}
this.getList()
loading.close()
}).catch(e => {
loading.close()
})
}).catch(() => {
})
},
toOpen() {
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行开启操作' })
return
}
const tip = '请确认是否开启所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
setState({ sidsList: this.sids, useState: '1', userSid: window.sessionStorage.getItem('userSid') }).then(resp => {
if (resp.success) {
this.$message({ type: 'success', message: resp.msg, showClose: true })
}
this.getList()
loading.close()
}).catch(e => {
loading.close()
})
}).catch(() => {
})
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)

Loading…
Cancel
Save