Browse Source

完善单车返利预提 -- 重推功能

master
yunuo970428 5 months ago
parent
commit
c64f485987
  1. 8
      anrui-scm/anrui-scm-ui/src/api/bikerebate/bicyclerebatewithholding.js
  2. 50
      anrui-scm/anrui-scm-ui/src/views/bikerebate/bicyclerebatewithholding/bicyclerebatewithholding.vue

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

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

50
anrui-scm/anrui-scm-ui/src/views/bikerebate/bicyclerebatewithholding/bicyclerebatewithholding.vue

@ -94,7 +94,7 @@ import req from '@/api/bikerebate/bicyclerebatewithholding'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import { getOrgSidByPath } from '@/api/cheliang/dictcommons'
import { getButtonPermissions, getOrgSidByPath } from '@/api/cheliang/dictcommons'
import bicyclerebatewithholdingAdd from './bicyclerebatewithholdingAdd'
import bicyclerebatewithholdingInfo from './bicyclerebatewithholdingInfo'
import { getStorage } from '@/utils/auth'
@ -122,6 +122,13 @@ export default {
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'primary',
size: 'small',
icon: '',
btnKey: 'toRepush',
btnLabel: '重推'
},
{
type: 'danger',
size: 'small',
@ -144,6 +151,7 @@ export default {
tableKey: 0,
list: [],
sids: [],
multipleSelection: [],
FormLoading: false,
listLoading: false,
listQuery: {
@ -176,7 +184,18 @@ export default {
mounted() {
// vuewindowpostMessagehandleMessage
window.addEventListener('message', this.handleMessage)
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 {
case 'toAdd':
this.toAdd()
break
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() {
@ -305,6 +327,30 @@ export default {
this.viewState = 2
this.$refs['divAdd'].showAdd(this.listQuery.params.createOrgSid)
},
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.rePushVouche({ 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
}
},
toEdit(row) {
this.viewState = 3
this.$refs['divAdd'].showEdit(row)

Loading…
Cancel
Save