Browse Source

完善单车返利核对 -- 重推功能

master
yunuo970428 3 months ago
parent
commit
dc1bbec9e4
  1. 8
      anrui-scm/anrui-scm-ui/src/api/bikerebate/bicyclerebatecheck.js
  2. 52
      anrui-scm/anrui-scm-ui/src/views/bikerebate/bicyclerebatecheck/bicyclerebatecheck.vue

8
anrui-scm/anrui-scm-ui/src/api/bikerebate/bicyclerebatecheck.js

@ -66,6 +66,14 @@ export default {
headers: { 'Content-Type': 'application/json' }
})
},
// 重推
rePushVoucher: function(data) {
return request({
url: '/scm/v1/scmvehrebatecheckapply/rePushVoucher',
method: 'post',
params: data
})
},
// 删除
delete: function(params) {
return request({

52
anrui-scm/anrui-scm-ui/src/views/bikerebate/bicyclerebatecheck/bicyclerebatecheck.vue

@ -102,7 +102,7 @@ import req from '@/api/bikerebate/bicyclerebatecheck'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import { brandDown, getOrgSidByPath } from '@/api/cheliang/dictcommons'
import { brandDown, getButtonPermissions, getOrgSidByPath } from '@/api/cheliang/dictcommons'
import bicyclerebatecheckAdd from './bicyclerebatecheckAdd'
import bicyclerebatecheckInfo from './bicyclerebatecheckInfo'
import { getStorage } from '@/utils/auth'
@ -123,6 +123,13 @@ export default {
centerDialogVisible: false,
btndisabled: false,
btnList: [
{
type: 'primary',
size: 'small',
icon: '',
btnKey: 'toRepush',
btnLabel: '重推'
},
{
type: 'danger',
size: 'small',
@ -145,6 +152,7 @@ export default {
tableKey: 0,
list: [],
sids: [],
multipleSelection: [],
FormLoading: false,
listLoading: false,
brand_list: '',
@ -174,7 +182,18 @@ export default {
mounted() {
// vuewindowpostMessagehandleMessage
window.addEventListener('message', this.handleMessage)
this.$refs['btnbar'].setButtonList(this.btnList)
getButtonPermissions({ userSid: window.sessionStorage.getItem('userSid'), url: this.$route.path, type: 0 }).then((res) => {
if (res.success) {
for (var i = 0; i < res.data.length; i++) {
for (var k = 0; k < this.btnList.length; k++) {
if (res.data[i].buttonId === this.btnList[k].btnKey) {
this.btnList.splice(k, 1)
}
}
}
this.$refs['btnbar'].setButtonList(this.btnList)
}
})
},
methods: {
async handleMessage(event) {
@ -231,6 +250,9 @@ export default {
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toRepush':
this.toRepush()
break
case 'doDel':
this.doDel()
break
@ -249,11 +271,11 @@ export default {
},
handleSelectionChange(row) {
const aa = []
this.multipleSelection = row
row.forEach((element) => {
aa.push(element.sid)
})
this.sids = aa
console.log('sids', this.sids)
},
//
getList() {
@ -301,6 +323,30 @@ export default {
}
this.init()
},
toRepush() {
if (this.multipleSelection.length === 1 && this.multipleSelection[0].nodeState === '已办结') {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.rePushVoucher({ sid: this.sids[0] }).then((resp) => {
if (resp.success) {
loading.close()
this.$message({ showClose: true, type: 'success', message: '重推成功' })
this.getList()
} else {
loading.close()
}
}).catch(() => {
loading.close()
})
} else {
this.$message({ showClose: true, type: 'error', message: '请选择一条记录且状态为已办结的进行重推操作' })
return
}
},
handleClick() {
this.$parent.resetState()
this.$parent.handleReset()

Loading…
Cancel
Save