Browse Source

开发专项返利预提

master
yunuo970428 3 years ago
parent
commit
406a355005
  1. 110
      anrui-scm/anrui-scm-ui/src/api/specialrebate/specialrebatewithholding.js
  2. 131
      anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/relation/zhuanxiangfanliAdd.vue
  3. 94
      anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/relation/zhuanxiangfanliInfo.vue
  4. 254
      anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/relation/zhuanxiangfanliselect.vue
  5. 347
      anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/specialrebatewithholding.vue
  6. 414
      anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/specialrebatewithholdingAdd.vue
  7. 178
      anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/specialrebatewithholdingInfo.vue
  8. 131
      anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/relation/zhuanxiangfanliyutiAdd.vue
  9. 94
      anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/relation/zhuanxiangfanliyutiInfo.vue
  10. 254
      anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/relation/zhuanxiangfanliyutichoose.vue
  11. 377
      anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiDaiBanInfo.vue
  12. 412
      anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiEdit.vue
  13. 249
      anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiYiBanInfo.vue

110
anrui-scm/anrui-scm-ui/src/api/specialrebate/specialrebatewithholding.js

@ -0,0 +1,110 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(data) {
return request({
url: '/scm/v1/scmspecialrebatewithapply/listPage',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
},
// 选择车辆信息--查询分页列表
pageList: function(data) {
return request({
url: '/scm/v1/scmspecialrebate/withApplyGetSpecialRebate',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
},
// 删除
delete: function(params) {
return request({
url: '/scm/v1/scmspecialrebatewithapply/delBySids',
method: 'DELETE',
data: params,
headers: { 'Content-Type': 'application/json' }
})
},
// 新增保存修改记录
save: function(data) {
return request({
url: '/scm/v1/scmspecialrebatewithapply/save',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
},
// 通过sid查询一条记录
fetchBySid: function(data) {
return request({
url: '/scm/v1/scmspecialrebatewithapply/fetchDetailsBySid/' + data,
method: 'get'
})
},
// 查看明细
vehRebateWithDetails: function(data) {
return request({
url: '/scm/v1/scmspecialrebatewith/specialRebateWithDetails/' + data,
method: 'get'
})
},
// 提交流程
submitVehicleApply: function(params) {
return request({
url: '/scm/v1/scmspecialrebatewithapply/submitSpecialRebateWithApply',
method: 'post',
data: params,
headers: { 'Content-Type': 'application/json' }
})
},
// 代办任务同意办理
complete: function(params) {
return request({
url: '/scm/v1/scmspecialrebatewithapply/complete',
method: 'post',
data: params
})
},
// 代办任务驳回任务
reject: function(params) {
return request({
url: '/scm/v1/scmspecialrebatewithapply/reject',
method: 'post',
data: params
})
},
// 代办任务终止任务
breakProcess: function(params) {
return request({
url: '/scm/v1/scmspecialrebatewithapply/breakProcess',
method: 'post',
data: params
})
},
// 代办任务撤回任务
revokeProcess: function(params) {
return request({
url: '/scm/v1/scmspecialrebatewithapply/revokeProcess',
method: 'post',
data: params
})
},
getNextNodesForSubmit: function(data) {
return request({
url: '/scm/v1/scmspecialrebatewithapply/getNextNodesForSubmit',
method: 'get',
params: data
})
},
getPreviousNodesForReject(data) {
return request({
url: '/scm/v1/scmspecialrebatewithapply/getPreviousNodesForReject',
method: 'get',
params: data
})
}
}

131
anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/relation/zhuanxiangfanliAdd.vue

@ -0,0 +1,131 @@
<template>
<div class="app-container">
<div>
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="danger" size="small" @click="handleDelete">删除</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="listconadd">
<el-form ref="form_obj" :rules="rules" class="formadd">
<el-table :key="tableKey" :data="list" :index="index" border style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" align="center" width="50px"/>
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column label="品牌" align="center">
<template slot-scope="scope">
<span>{{ scope.row.brandName }}</span>
</template>
</el-table-column>
<el-table-column label="创建日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column label="返利类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="返利名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateName }}</span>
</template>
</el-table-column>
<el-table-column label="预计返利" align="center">
<template slot-scope="scope">
<span>{{ scope.row.estimateRebate }}</span>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
</div>
<!--End 添加修改部分-->
</div>
</template>
<script>
import req from '@/api/specialrebate/specialrebatewithholding'
export default {
name: 'zhuanxiangfanliAdd',
data() {
return {
viewTitle: '',
index: 0,
tableKey: 0,
rebateType: '',
sids: [],
//
list: [],
rules: {},
submitdisabled: false
}
},
methods: {
handleSelectionChange(row) {
const aa = []
row.forEach((element) => {
aa.push(element.sid)
})
this.sids = aa
console.log('sids', this.sids)
},
showInfo(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.viewTitle = '待预提专项返利明细'
this.rebateType = row.rebateTypeValue
console.log('编辑回显', row.sid)
req.vehRebateWithDetails(row.specialRebateSids).then((resp) => {
this.list = resp.data
}).catch((e) => {
this.formobj = row
})
},
handleDelete() {
if (this.sids.length === 0) {
this.$message({
showClose: true,
type: 'error',
message: '请选择至少一条记录进行删除操作'
})
return
}
for (var i = 0; i < this.list.length; i++) {
for (var j = 0; j < this.sids.length; j++) {
if (this.list[i].sid === this.sids[j]) {
this.list.splice(i, 1)
}
}
}
},
// ===
handleReturn() {
const data_list = []
for (var i = 0; i < this.list.length; i++) {
data_list.push({
sid: this.list[i].sid,
rebateTypeValue: this.list[i].rebateTypeValue,
rebateTypeKey: this.list[i].rebateTypeKey,
withRebate: this.list[i].estimateRebate,
brandName: this.list[i].brandName,
brandSid: this.list[i].brandSid
})
}
this.$emit('backAdd', data_list, this.rebateType)
}
}
}
</script>
<style scoped>
</style>

94
anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/relation/zhuanxiangfanliInfo.vue

@ -0,0 +1,94 @@
<template>
<div class="app-container">
<div>
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="listconadd">
<el-form ref="form_obj" :rules="rules" class="formadd">
<el-table :key="tableKey" :data="list" :index="index" border style="width: 100%">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column label="品牌" align="center">
<template slot-scope="scope">
<span>{{ scope.row.brandName }}</span>
</template>
</el-table-column>
<el-table-column label="创建日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column label="返利类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="返利名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateName }}</span>
</template>
</el-table-column>
<el-table-column label="预计返利" align="center">
<template slot-scope="scope">
<span>{{ scope.row.estimateRebate }}</span>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
</div>
<!--End 添加修改部分-->
</div>
</template>
<script>
import req from '@/api/specialrebate/specialrebatewithholding'
export default {
name: 'zhuanxiangfanliInfo',
data() {
return {
viewTitle: '',
index: 0,
tableKey: 0,
list: [],
//
rules: {},
submitdisabled: false
}
},
methods: {
showInfo(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.viewTitle = '待预提专项返利明细'
console.log('编辑回显', row.sid)
req.vehRebateWithDetails(row.specialRebateSids).then((resp) => {
this.list = resp.data
}).catch((e) => {
this.formobj = row
})
},
// ===
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
//
this.list = []
this.$refs['form_obj'].resetFields()
this.$emit('doback')
}
}
}
</script>
<style scoped>
</style>

254
anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/relation/zhuanxiangfanliselect.vue

@ -0,0 +1,254 @@
<template>
<div class="app-container">
<!-- Start 列表页面 -->
<div>
<button-bar view-title="待预提专项返利列表" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
<el-form-item label="品牌">
<el-select v-model="listQuery.params.brandSid" placeholder="请选择" filterable clearable>
<el-option v-for="item in brand_list" :key="item.sid" :label="item.brandName" :value="item.sid"/>
</el-select>
</el-form-item>
<el-form-item label="创建日期">
<el-date-picker v-model="listQuery.params.createStartTime" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
<span style="padding: 0 8px"></span>
<el-date-picker v-model="listQuery.params.createEndTime" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
</el-form-item>
<el-form-item label="返利类型">
<el-select v-model="listQuery.params.rebateTypeKey" placeholder="请选择" filterable clearable>
<el-option v-for="item in rebateType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
</el-select>
</el-form-item>
<el-form-item label="返利名称">
<el-input v-model="listQuery.params.rebateName" placeholder="" clearable/>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" icon="el-icon-search" @click="handleFilter" size="small">查询</el-button>
<el-button type="primary" icon="el-icon-refresh" @click="handleReset" size="small">重置</el-button>
</div>
</div>
</div>
<div class="listtop">
<div class="tit">待预提专项返利列表</div>
<el-button size="small" type="primary" @click="handleConfirm">确定</el-button>
</div>
<div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" align="center" width="50px"/>
<el-table-column fixed label="序号" type="index" :index="indexMethod" align="center" width="80px"/>
<el-table-column label="品牌" align="center">
<template slot-scope="scope">
<span>{{ scope.row.brandName }}</span>
</template>
</el-table-column>
<el-table-column label="创建日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column label="返利类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="返利名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateName }}</span>
</template>
</el-table-column>
<el-table-column label="预计返利" align="center">
<template slot-scope="scope">
<span>{{ scope.row.estimateRebate }}</span>
</template>
</el-table-column>
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/specialrebate/specialrebatewithholding'
import Pagination from '@/components/pagination'
import ButtonBar from '@/components/ButtonBar'
import { brandDown, typeValues } from '@/api/cheliang/dictcommons'
export default {
name: 'zhuanxiangfanliSelect',
components: {
Pagination,
ButtonBar
},
data() {
return {
btndisabled: false,
btnList: [
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
isSearchShow: false,
searchxianshitit: '显示查询条件',
// -----------
tableKey: 0,
list: [],
sids: [],
FormLoading: false,
listLoading: false,
rebateType_list: [],
brand_list: [],
listQuery: {
params: {
createOrgSid: '',
brandSid: '',
rebateTypeKey: '',
rebateName: '',
createEndTime: '',
createStartTime: '',
sidList: []
},
current: 1,
size: 5,
total: 0
},
rules: {}
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
methods: {
init() {
typeValues({ type: 'rebateType' }).then((res) => {
if (res.success) {
this.rebateType_list = res.data
}
})
brandDown({ useOrg: this.listQuery.params.createOrgSid }).then((res) => {
if (res.success) {
this.brand_list = res.data
}
})
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'doClose':
this.doClose()
break
default:
break
}
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
handleSelectionChange(row) {
const aa = []
row.forEach((element) => {
aa.push({
sid: element.sid,
rebateTypeValue: element.rebateTypeValue,
rebateTypeKey: element.rebateTypeKey,
withRebate: element.estimateRebate,
brandName: element.brandName,
brandSid: element.brandSid
})
})
this.sids = aa
console.log('sids', this.sids)
},
//
getList() {
this.listLoading = true
this.listQuery.params.createBySid = window.sessionStorage.getItem('userSid')
req.pageList(this.listQuery).then((response) => {
console.log('列表查询结果:', response)
this.listLoading = false
if (response.success && response.data && response.data.total > 0) {
this.list = response.data.records
this.listQuery.total = response.data.total
} else {
this.list = []
this.listQuery.total = 0
}
})
},
showData(value, createOrgSid, brandSid) {
this.listQuery.params.createOrgSid = createOrgSid
this.listQuery.params.brandSid = brandSid
const aa = []
if (value.length > 0) {
for (var i = 0; i < value.length; i++) {
for (var j = 0; j < value[i].specialRebateSids.length; j++) {
aa.push(value[i].specialRebateSids[j])
}
}
this.listQuery.params.sidList = aa
} else {
this.listQuery.params.sidList = []
}
this.init()
this.getList()
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
this.listQuery.current = 1
this.listQuery.total = 0
this.listQuery.size = 5
this.listQuery.params.createStartTime = ''
this.listQuery.params.createEndTime = ''
this.listQuery.params.rebateTypeKey = ''
this.listQuery.params.rebateName = ''
this.getList()
},
handleConfirm() {
if (this.sids.length > 0) {
this.$emit('backData', this.sids)
} else {
this.$notify({
title: '提示',
message: '请选择至少一条记录!',
type: 'error',
duration: 2000
})
}
},
doClose() {
this.$emit('doback')
}
}
}
</script>
<style scoped>
</style>

347
anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/specialrebatewithholding.vue

@ -0,0 +1,347 @@
<template>
<div class="app-container">
<!-- Start 列表页面 -->
<div v-show="viewState == 1">
<button-bar view-title="专项返利预提申请管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
<el-form-item label="品牌">
<el-select v-model="listQuery.params.brandSid" placeholder="请选择" filterable clearable>
<el-option v-for="item in brand_list" :key="item.sid" :label="item.brandName" :value="item.sid"/>
</el-select>
</el-form-item>
<el-form-item label="申请标题">
<el-input v-model="listQuery.params.withApply" clearable placeholder=""></el-input>
</el-form-item>
<el-form-item label="创建日期">
<el-date-picker v-model="listQuery.params.createStartTime" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
<span style="padding: 0 8px"></span>
<el-date-picker v-model="listQuery.params.createEndTime" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" icon="el-icon-search" @click="handleFilter" size="small">查询</el-button>
<el-button type="primary" icon="el-icon-refresh" @click="handleReset" size="small">重置</el-button>
</div>
</div>
</div>
<div class="listtop">
<div class="tit">专项返利预提申请列表</div>
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
<div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" align="center" width="50px"/>
<el-table-column fixed label="序号" type="index" :index="indexMethod" align="center" width="80px"/>
<el-table-column fixed label="操作" align="center" width="180px" >
<template slot-scope="scope">
<el-button type="primary" size="mini" :disabled="scope.row.nodeState =='发起申请' ? false : scope.row.nodeState == '待提交' ? false : true" @click="toEdit(scope.row)">办理</el-button>
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button>
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<span v-if="scope.row.nodeState=='待提交'" type="primary" size="mini">待提交</span>
<span v-else @click="flowRecord(scope.row)" class="bluezi">{{ scope.row.nodeState }}</span>
</template>
</el-table-column>
<el-table-column label="分公司" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createOrgName }}</span>
</template>
</el-table-column>
<el-table-column label="品牌" align="center">
<template slot-scope="scope">
<span>{{ scope.row.brandName }}</span>
</template>
</el-table-column>
<el-table-column label="预提申请" align="center">
<template slot-scope="scope">
<span>{{ scope.row.withApply }}</span>
</template>
</el-table-column>
<el-table-column label="预提返利" align="center">
<template slot-scope="scope">
<span>{{ scope.row.withRebateTotal }}</span>
</template>
</el-table-column>
<el-table-column label="创建日期" align="center" width="120">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column label="创建人" align="center" width="120">
<template slot-scope="scope">
<span>{{ scope.row.createByName }}</span>
</template>
</el-table-column>
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
</div>
</div>
<specialrebatewithholdingAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="getList"/>
<specialrebatewithholdingInfo v-show="viewState == 4" ref="divInfo" @doback="resetState"/>
<el-dialog title="" :visible.sync="centerDialogVisible" width="78%" height="1%" :before-close="closeIt" center>
<iframe frameborder="0" id="iframe" style="width:100%;" scrolling="no" :src="this.centerDialogVisible === true ? url :''"></iframe>
</el-dialog>
</div>
</template>
<script>
import req from '@/api/specialrebate/specialrebatewithholding'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import { brandDown, getPathSidByUserSid } from '@/api/cheliang/dictcommons'
import specialrebatewithholdingAdd from './specialrebatewithholdingAdd'
import specialrebatewithholdingInfo from './specialrebatewithholdingInfo'
import { getStorage } from '@/utils/auth'
export default {
name: 'ZhuanXiangFanLiYuTi',
components: {
Pagination,
pageye,
ButtonBar,
specialrebatewithholdingAdd,
specialrebatewithholdingInfo
},
data() {
return {
url: '',
dialogHeight: '80%',
centerDialogVisible: false,
btndisabled: false,
btnList: [
{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'danger',
size: 'small',
icon: 'del',
btnKey: 'doDel',
btnLabel: '删除'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
isSearchShow: false,
searchxianshitit: '显示查询条件',
viewState: 1,
// -----------
tableKey: 0,
list: [],
sids: [],
FormLoading: false,
listLoading: false,
brand_list: [],
listQuery: {
params: {
createBySid: '',
createEndTime: '',
createStartTime: '',
withApply: '',
brandSid: ''
},
current: 1,
size: 5,
total: 0
},
rules: {}
}
},
created() {
//
this.init()
},
mounted() {
// vuewindowpostMessagehandleMessage
window.addEventListener('message', this.handleMessage)
this.$refs['btnbar'].setButtonList(this.btnList)
},
methods: {
async handleMessage(event) {
var code = ''
if (event.data.params !== null && event.data.params !== undefined) {
code = event.data.params.code
}
if (code === 1) {
this.init()
this.centerDialogVisible = false
} else if (code === 2) {
this.dialogHeight = event.data.params.data
this.setIframeHeight(document.getElementById('iframe'))
}
},
closeIt() {
this.url = ''
this.centerDialogVisible = false
},
setIframeHeight(iframe) {
iframe.height = this.dialogHeight
},
flowRecord(row) {
this.centerDialogVisible = true
var params = {
deployId: row.procDefId,
procInsId: row.procInstId,
token: getStorage()
}
this.url = '/#/flow/flowRecordForBusiness?data=' + encodeURI((JSON.stringify(params)))
},
init() {
getPathSidByUserSid({ userSid: window.sessionStorage.getItem('userSid') }).then((resp) => {
if (resp.success) {
this.listQuery.params.createOrgSid = resp.data
brandDown({ useOrg: this.listQuery.params.createOrgSid }).then((res) => {
if (res.success) {
this.brand_list = res.data
}
})
this.getList()
}
})
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doDel':
this.doDel()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
handleSelectionChange(row) {
const aa = []
row.forEach((element) => {
aa.push(element.sid)
})
this.sids = aa
console.log('sids', this.sids)
},
//
getList() {
this.listLoading = true
this.listQuery.params.createBySid = window.sessionStorage.getItem('userSid')
req.listPage(this.listQuery).then((response) => {
console.log('列表查询结果:', response)
this.listLoading = false
if (response.success && response.data && response.data.total > 0) {
this.list = response.data.records
this.listQuery.total = response.data.total
} else {
this.list = []
this.listQuery.total = 0
}
})
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
this.listQuery = {
params: {
createBySid: '',
createEndTime: '',
createStartTime: ''
},
current: 1,
size: 5,
total: 0
}
this.init()
},
toAdd() {
this.viewState = 2
this.$refs['divAdd'].showAdd(this.listQuery.params.createOrgSid)
},
toEdit(row) {
this.viewState = 3
this.$refs['divAdd'].showEdit(row)
},
toInfo(row) {
this.viewState = 4
this.$refs['divInfo'].showInfo(row)
},
doDel() {
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)'
})
req.delete(this.sids).then(resp => {
if (resp.success) {
this.$message({ type: 'success', message: resp.msg, showClose: true })
}
this.getList()
loading.close()
}).catch(e => {
loading.close()
})
}).catch(() => {
})
},
resetState() {
this.viewState = 1
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
}
}
}
</script>
<style scoped>
</style>

414
anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/specialrebatewithholdingAdd.vue

@ -0,0 +1,414 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="save()">保存
</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submit()">提交
</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="listconadd">
<div class="titwu"><span>{{ formobj.withApply }}专项返利预提申请</span></div>
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd">
<el-row class="rowStyle">
<el-col :span="24" class="tleftb colOneStyle">
<div><span style="font-size: 16px">金额单位</span></div>
</el-col>
</el-row>
<el-row class="rowStyle">
<el-col :span="2" class="tleftb colOneStyle">
<span>品牌:</span>
</el-col>
<el-col :span="4" class="colOneStyle">
<el-form-item>
<el-select :disabled="dialogStatus === 'edit'" v-model="formobj.brandName" placeholder="请选择" filterable clearable @change="changeBrand">
<el-option v-for="item in brand_list" :key="item.sid" :label="item.brandName" :value="item.brandName"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="18" class="tleftb colOneStyle">
<el-button size="small" type="primary" @click="handleSelect()">选择</el-button>
</el-col>
</el-row>
<el-table :key="tableKey" :data="formobj.scmSpecialRebateWiths" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column label="返利类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="台数" align="center">
<template slot-scope="scope">
<span>{{ scope.row.num }}</span>
</template>
</el-table-column>
<el-table-column prop="withRebate" label="预提返利" align="center">
<template slot-scope="scope">
<span>{{ scope.row.withRebate }}</span>
</template>
</el-table-column>
<el-table-column label="明细" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleLook(scope.row)">查看</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="备注" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.remarks" clearable placeholder="" class="addinputw"></el-input>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<el-row>
<el-col :span="2" class="tleftb">
<span>备注</span>
</el-col>
<el-col :span="22">
<el-form-item>
<el-input v-model="formobj.remarks" clearable placeholder="" class="addinputw"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<!--End 添加修改部分-->
<zhuanxiangfanliselect v-show="viewState == 2" ref="divSelect" @doback="resetState" @backData="backData"/>
<zhuanxiangfanliAdd v-show="viewState == 3" ref="divAdd" @backAdd="backAdd" />
</div>
</template>
<script>
import req from '@/api/specialrebate/specialrebatewithholding'
import { brandDown, fetchBySid } from '@/api/cheliang/dictcommons'
import zhuanxiangfanliselect from './relation/zhuanxiangfanliselect'
import zhuanxiangfanliAdd from './relation/zhuanxiangfanliAdd'
export default {
name: 'ZhuanXiangFanLiYuTiAdd',
components: {
zhuanxiangfanliselect,
zhuanxiangfanliAdd
},
data() {
return {
viewTitle: '',
index: 0,
tableKey: 0,
viewState: 1,
dialogStatus: '',
brand_list: [],
//
formobj: {
brandName: '',
brandSid: '',
sid: '',
withApply: '',
createOrgName: '',
createOrgSid: '',
useOrgName: '',
useOrgSid: '',
remarks: '',
withRebateTotal: '',
createByName: '',
createBySid: '',
instanceId: '', // ID
taskId: '', // ID
scmSpecialRebateWiths: []
},
rules: {},
submitdisabled: false
}
},
methods: {
init() {
fetchBySid(this.formobj.createOrgSid).then((res) => {
if (res.success) {
this.formobj.createOrgName = res.data.name
this.formobj.useOrgName = res.data.name
}
})
brandDown({ useOrg: this.formobj.createOrgSid }).then((res) => {
if (res.success) {
this.brand_list = res.data
}
})
},
//
newDate() {
let date = new Date()
let year = date.getFullYear() //
let month = date.getMonth() + 1 //
this.formobj.withApply = year + '年' + month + '月'
},
showAdd(createOrgSid) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
this.init()
this.newDate()
})
this.dialogStatus = 'add'
this.formobj.createBySid = window.sessionStorage.getItem('userSid')
this.formobj.createOrgSid = createOrgSid
this.formobj.useOrgSid = createOrgSid
this.formobj.createByName = window.sessionStorage.getItem('name')
this.viewTitle = '【新增】专项返利预提申请'
},
showEdit(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.dialogStatus = 'edit'
this.viewTitle = '【编辑】专项返利预提申请'
console.log('编辑回显', row.sid)
req.fetchBySid(row.sid).then((resp) => {
this.formobj = resp.data
this.formobj.instanceId = resp.data.procInstId
}).catch((e) => {
this.formobj = row
})
},
changeBrand(value) {
let bb = null
this.brand_list.forEach((e) => {
if (e.brandName === value) {
bb = {
name: e.brandName,
sid: e.sid
}
}
})
this.formobj.brandSid = bb.sid
},
// --
handleSelect() {
if (this.formobj.brandName === '' || this.formobj.brandName === null || this.formobj.brandName === undefined) {
this.$message({ showClose: true, type: 'error', message: '请先选择品牌' })
return
}
this.viewState = 2
this.$refs['divSelect'].showData(this.formobj.scmSpecialRebateWiths, this.formobj.createOrgSid, this.formobj.brandSid)
},
// --
backData(value) {
this.viewState = 1
for (var i in value) {
let cval = value[i]
if (!this.formobj.scmSpecialRebateWiths || this.formobj.scmSpecialRebateWiths.length === 0) {
this.formobj.scmSpecialRebateWiths = []
}
let v = 0
for (var j in this.formobj.scmSpecialRebateWiths) {
if (this.formobj.scmSpecialRebateWiths[j].rebateTypeValue === cval.rebateTypeValue) {
this.formobj.scmSpecialRebateWiths[j].num = parseInt(this.formobj.scmSpecialRebateWiths[j].num) + parseInt(1)
this.formobj.scmSpecialRebateWiths[j].withRebate = parseInt(this.formobj.scmSpecialRebateWiths[j].withRebate) + parseInt(cval.withRebate)
this.formobj.scmSpecialRebateWiths[j].specialRebateSids.push(cval.sid)
v = 1
break
}
}
if (v === 0) {
this.formobj.scmSpecialRebateWiths.push({
rebateTypeKey: cval.rebateTypeKey,
rebateTypeValue: cval.rebateTypeValue,
num: 1,
withRebate: cval.withRebate,
brandName: cval.brandName,
brandSid: cval.brandSid,
specialRebateSids: [cval.sid],
// remarks: '',
sid: '',
mainSid: ''
})
}
}
},
// --
handleLook(row) {
this.viewState = 3
this.$refs['divAdd'].showInfo(row)
},
// --
backAdd(value, rebateType) {
this.viewState = 1
const aa = []
if (value.length > 0) {
for (var i in value) {
let cval = value[i]
let v = 0
for (var j in aa) {
if (aa[j].rebateTypeValue === cval.rebateTypeValue) {
aa[j].num = parseInt(aa[j].num) + parseInt(1)
aa[j].withRebate = parseInt(aa[j].withRebate) + parseInt(cval.withRebate)
aa[j].specialRebateSids.push(cval.sid)
v = 1
break
}
}
if (v === 0) {
aa.push({
rebateTypeKey: cval.rebateTypeKey,
rebateTypeValue: cval.rebateTypeValue,
num: 1,
withRebate: cval.withRebate,
brandName: cval.brandName,
brandSid: cval.brandSid,
specialRebateSids: [cval.sid],
// remarks: '',
sid: '',
mainSid: ''
})
}
}
for (var k = 0; k < this.formobj.scmSpecialRebateWiths.length; k++) {
if (this.formobj.scmSpecialRebateWiths[k].rebateTypeValue === rebateType) {
this.formobj.scmSpecialRebateWiths[k].rebateTypeKey = aa[0].rebateTypeKey
this.formobj.scmSpecialRebateWiths[k].rebateTypeValue = aa[0].rebateTypeValue
this.formobj.scmSpecialRebateWiths[k].num = aa[0].num
this.formobj.scmSpecialRebateWiths[k].withRebate = aa[0].withRebate
this.formobj.scmSpecialRebateWiths[k].brandName = aa[0].brandName
this.formobj.scmSpecialRebateWiths[k].brandSid = aa[0].brandSid
this.formobj.scmSpecialRebateWiths[k].specialRebateSids = aa[0].specialRebateSids
break
}
}
} else if (value.length === 0) {
for (var l = 0; l < this.formobj.scmSpecialRebateWiths.length; l++) {
if (this.formobj.scmSpecialRebateWiths[l].rebateTypeValue === rebateType) {
this.formobj.scmSpecialRebateWiths.splice(l, 1)
break
}
}
}
},
resetState() {
this.viewState = 1
},
save() {
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.submitdisabled = true
req.save(this.formobj).then((resp) => {
this.submitdisabled = false
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
}
}).catch(() => {
this.submitdisabled = false
})
} else {
return false
}
})
},
submit() {
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.submitdisabled = true
req.submitVehicleApply(this.formobj).then((resp) => {
this.submitdisabled = false
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
}
}).catch(() => {
this.submitdisabled = false
})
} else {
return false
}
})
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property === 'withRebate') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ''
this.formobj.withRebateTotal = sums[index] += ''
} else {
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ''
this.amount = sums[index] += ''
} else {
sums[index] = ''
}
}
})
return sums
},
// ===
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
//
this.formobj = {
brandName: '',
brandSid: '',
sid: '',
withApply: '',
createOrgName: '',
createOrgSid: '',
useOrgName: '',
useOrgSid: '',
remarks: '',
withRebateTotal: '',
createByName: '',
createBySid: '',
instanceId: '', // ID
taskId: '', // ID
scmSpecialRebateWiths: []
}
this.$refs['form_obj'].resetFields()
this.$emit('doback')
}
}
}
</script>
<style scoped>
.rowStyle {
border-left: 0px;
}
.colOneStyle {
border-right: 0px !important;
border-bottom: 0px !important;
}
</style>

178
anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/specialrebatewithholdingInfo.vue

@ -0,0 +1,178 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="listconadd">
<div class="titwu"><span>{{ formobj.withApply }}专项返利预提申请</span></div>
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd">
<el-row class="rowStyle">
<el-col :span="24" class="tleftb colOneStyle">
<div><span style="font-size: 16px">金额单位</span></div>
</el-col>
</el-row>
<el-row class="rowStyle">
<el-col :span="2" class="tleftb colOneStyle">
<span>品牌:</span>
</el-col>
<el-col :span="22" class="colOneStyle">
<el-form-item>
<span>{{ formobj.brandName }}</span>
</el-form-item>
</el-col>
</el-row>
<el-table :key="tableKey" :data="formobj.scmSpecialRebateWiths" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column label="返利类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="台数" align="center">
<template slot-scope="scope">
<span>{{ scope.row.num }}</span>
</template>
</el-table-column>
<el-table-column prop="withRebate" label="预提返利" align="center">
<template slot-scope="scope">
<span>{{ scope.row.withRebate }}</span>
</template>
</el-table-column>
<el-table-column label="明细" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleLook(scope.row)">查看</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="备注" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ scope.row.remarks }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<el-row>
<el-col :span="2" class="tleftb">
<span>备注</span>
</el-col>
<el-col :span="22">
<el-form-item>
<span>{{ formobj.remarks }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<!--End 添加修改部分-->
<zhuanxiangfanliInfo v-show="viewState == 2" ref="divInfo" @doback="resetState"/>
</div>
</template>
<script>
import req from '@/api/specialrebate/specialrebatewithholding'
import zhuanxiangfanliInfo from './relation/zhuanxiangfanliInfo'
export default {
name: 'ZhuanXiangFanLiYuTiInfo',
components: {
zhuanxiangfanliInfo
},
data() {
return {
viewTitle: '',
index: 0,
tableKey: 0,
viewState: 1,
//
formobj: {},
rules: {},
submitdisabled: false
}
},
methods: {
showInfo(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.viewTitle = '预提申请详情'
console.log('编辑回显', row.sid)
req.fetchBySid(row.sid).then((resp) => {
this.formobj = resp.data
}).catch((e) => {
this.formobj = row
})
},
handleLook(row) {
this.viewState = 2
this.$refs['divInfo'].showInfo(row)
},
resetState() {
this.viewState = 1
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property === 'withRebate') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ''
} else {
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ''
this.amount = sums[index] += ''
} else {
sums[index] = ''
}
}
})
return sums
},
// ===
handleReturn() {
//
this.formobj = {}
this.$refs['form_obj'].resetFields()
this.$emit('doback')
}
}
}
</script>
<style scoped>
.rowStyle {
border-left: 0px;
}
.colOneStyle {
border-right: 0px !important;
border-bottom: 0px !important;
}
</style>

131
anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/relation/zhuanxiangfanliyutiAdd.vue

@ -0,0 +1,131 @@
<template>
<div class="app-container">
<div>
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="danger" size="small" @click="handleDelete">删除</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="">
<el-form ref="form_obj" :rules="rules" class="formadd">
<el-table :key="tableKey" :data="list" :index="index" border style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" align="center" width="50px"/>
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column label="品牌" align="center">
<template slot-scope="scope">
<span>{{ scope.row.brandName }}</span>
</template>
</el-table-column>
<el-table-column label="创建日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column label="返利类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="返利名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateName }}</span>
</template>
</el-table-column>
<el-table-column label="预计返利" align="center">
<template slot-scope="scope">
<span>{{ scope.row.estimateRebate }}</span>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
</div>
<!--End 添加修改部分-->
</div>
</template>
<script>
import req from '@/api/specialrebate/specialrebatewithholding'
export default {
name: 'zhuanxiangfanliyutiAdd',
data() {
return {
viewTitle: '',
index: 0,
tableKey: 0,
rebateType: '',
sids: [],
//
list: [],
rules: {},
submitdisabled: false
}
},
methods: {
handleSelectionChange(row) {
const aa = []
row.forEach((element) => {
aa.push(element.sid)
})
this.sids = aa
console.log('sids', this.sids)
},
showInfo(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.viewTitle = '待预提专项返利明细'
this.rebateType = row.rebateTypeValue
console.log('编辑回显', row.sid)
req.vehRebateWithDetails(row.specialRebateSids).then((resp) => {
this.list = resp.data
}).catch((e) => {
this.formobj = row
})
},
handleDelete() {
if (this.sids.length === 0) {
this.$message({
showClose: true,
type: 'error',
message: '请选择至少一条记录进行删除操作'
})
return
}
for (var i = 0; i < this.list.length; i++) {
for (var j = 0; j < this.sids.length; j++) {
if (this.list[i].sid === this.sids[j]) {
this.list.splice(i, 1)
}
}
}
},
// ===
handleReturn() {
const data_list = []
for (var i = 0; i < this.list.length; i++) {
data_list.push({
sid: this.list[i].sid,
rebateTypeValue: this.list[i].rebateTypeValue,
rebateTypeKey: this.list[i].rebateTypeKey,
withRebate: this.list[i].estimateRebate,
brandName: this.list[i].brandName,
brandSid: this.list[i].brandSid
})
}
this.$emit('backAdd', data_list, this.rebateType)
}
}
}
</script>
<style scoped>
</style>

94
anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/relation/zhuanxiangfanliyutiInfo.vue

@ -0,0 +1,94 @@
<template>
<div class="app-container">
<div>
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="">
<el-form ref="form_obj" :rules="rules" class="formadd">
<el-table :key="tableKey" :data="list" :index="index" border style="width: 100%">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column label="品牌" align="center">
<template slot-scope="scope">
<span>{{ scope.row.brandName }}</span>
</template>
</el-table-column>
<el-table-column label="创建日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column label="返利类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="返利名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateName }}</span>
</template>
</el-table-column>
<el-table-column label="预计返利" align="center">
<template slot-scope="scope">
<span>{{ scope.row.estimateRebate }}</span>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
</div>
<!--End 添加修改部分-->
</div>
</template>
<script>
import req from '@/api/specialrebate/specialrebatewithholding'
export default {
name: 'zhuanxiangfanliyutiInfo',
data() {
return {
viewTitle: '',
index: 0,
tableKey: 0,
list: [],
//
rules: {},
submitdisabled: false
}
},
methods: {
showInfo(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.viewTitle = '待预提专项返利明细'
console.log('编辑回显', row.sid)
req.vehRebateWithDetails(row.specialRebateSids).then((resp) => {
this.list = resp.data
}).catch((e) => {
this.formobj = row
})
},
// ===
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
//
this.list = []
this.$refs['form_obj'].resetFields()
this.$emit('doback')
}
}
}
</script>
<style scoped>
</style>

254
anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/relation/zhuanxiangfanliyutichoose.vue

@ -0,0 +1,254 @@
<template>
<div class="app-container">
<!-- Start 列表页面 -->
<div>
<button-bar view-title="待预提专项返利列表" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<div class="">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
<el-form-item label="品牌">
<el-select v-model="listQuery.params.brandSid" placeholder="请选择" filterable clearable>
<el-option v-for="item in brand_list" :key="item.sid" :label="item.brandName" :value="item.sid"/>
</el-select>
</el-form-item>
<el-form-item label="创建日期">
<el-date-picker v-model="listQuery.params.createStartTime" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
<span style="padding: 0 8px"></span>
<el-date-picker v-model="listQuery.params.createEndTime" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/>
</el-form-item>
<el-form-item label="返利类型">
<el-select v-model="listQuery.params.rebateTypeKey" placeholder="请选择" filterable clearable>
<el-option v-for="item in rebateType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
</el-select>
</el-form-item>
<el-form-item label="返利名称">
<el-input v-model="listQuery.params.rebateName" placeholder="" clearable/>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" icon="el-icon-search" @click="handleFilter" size="small">查询</el-button>
<el-button type="primary" icon="el-icon-refresh" @click="handleReset" size="small">重置</el-button>
</div>
</div>
</div>
<div class="listtop">
<div class="tit">待预提专项返利列表</div>
<el-button size="small" type="primary" @click="handleConfirm">确定</el-button>
</div>
<div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" align="center" width="50px"/>
<el-table-column fixed label="序号" type="index" :index="indexMethod" align="center" width="80px"/>
<el-table-column label="品牌" align="center">
<template slot-scope="scope">
<span>{{ scope.row.brandName }}</span>
</template>
</el-table-column>
<el-table-column label="创建日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column label="返利类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="返利名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateName }}</span>
</template>
</el-table-column>
<el-table-column label="预计返利" align="center">
<template slot-scope="scope">
<span>{{ scope.row.estimateRebate }}</span>
</template>
</el-table-column>
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
</div>
</div>
</div>
</template>
<script>
import req from '@/api/specialrebate/specialrebatewithholding'
import Pagination from '@/components/pagination'
import ButtonBar from '@/components/ButtonBar'
import { brandDown, typeValues } from '@/api/cheliang/dictcommons'
export default {
name: 'zhuanxiangfanliyutichoose',
components: {
Pagination,
ButtonBar
},
data() {
return {
btndisabled: false,
btnList: [
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
isSearchShow: false,
searchxianshitit: '显示查询条件',
// -----------
tableKey: 0,
list: [],
sids: [],
FormLoading: false,
listLoading: false,
rebateType_list: [],
brand_list: [],
listQuery: {
params: {
createOrgSid: '',
brandSid: '',
rebateTypeKey: '',
rebateName: '',
createEndTime: '',
createStartTime: '',
sidList: []
},
current: 1,
size: 5,
total: 0
},
rules: {}
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
methods: {
init() {
typeValues({ type: 'rebateType' }).then((res) => {
if (res.success) {
this.rebateType_list = res.data
}
})
brandDown({ useOrg: this.listQuery.params.createOrgSid }).then((res) => {
if (res.success) {
this.brand_list = res.data
}
})
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'doClose':
this.doClose()
break
default:
break
}
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
handleSelectionChange(row) {
const aa = []
row.forEach((element) => {
aa.push({
sid: element.sid,
rebateTypeValue: element.rebateTypeValue,
rebateTypeKey: element.rebateTypeKey,
withRebate: element.estimateRebate,
brandName: element.brandName,
brandSid: element.brandSid
})
})
this.sids = aa
console.log('sids', this.sids)
},
//
getList() {
this.listLoading = true
this.listQuery.params.createBySid = window.sessionStorage.getItem('userSid')
req.pageList(this.listQuery).then((response) => {
console.log('列表查询结果:', response)
this.listLoading = false
if (response.success && response.data && response.data.total > 0) {
this.list = response.data.records
this.listQuery.total = response.data.total
} else {
this.list = []
this.listQuery.total = 0
}
})
},
showData(value, createOrgSid, brandSid) {
this.listQuery.params.createOrgSid = createOrgSid
this.listQuery.params.brandSid = brandSid
const aa = []
if (value.length > 0) {
for (var i = 0; i < value.length; i++) {
for (var j = 0; j < value[i].specialRebateSids.length; j++) {
aa.push(value[i].specialRebateSids[j])
}
}
this.listQuery.params.sidList = aa
} else {
this.listQuery.params.sidList = []
}
this.init()
this.getList()
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
this.listQuery.current = 1
this.listQuery.total = 0
this.listQuery.size = 5
this.listQuery.params.createStartTime = ''
this.listQuery.params.createEndTime = ''
this.listQuery.params.rebateTypeKey = ''
this.listQuery.params.rebateName = ''
this.getList()
},
handleConfirm() {
if (this.sids.length > 0) {
this.$emit('backData', this.sids)
} else {
this.$notify({
title: '提示',
message: '请选择至少一条记录!',
type: 'error',
duration: 2000
})
}
},
doClose() {
this.$emit('doback')
}
}
}
</script>
<style scoped>
</style>

377
anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiDaiBanInfo.vue

@ -0,0 +1,377 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="primary" size="small" @click="openAgree('同意')"> </el-button>
<el-button type="danger" size="small" @click="openReject('驳回')"> </el-button>
<el-button type="danger" size="small" @click="openStop('终止')"> </el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="">
<div class="titwu"><span>{{ formobj.withApply }}专项返利预提申请</span></div>
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd">
<el-row class="rowStyle">
<el-col :span="24" class="tleftb colOneStyle">
<div><span style="font-size: 16px">金额单位</span></div>
</el-col>
</el-row>
<el-row class="rowStyle">
<el-col :span="2" class="tleftb colOneStyle">
<span>品牌:</span>
</el-col>
<el-col :span="22" class="colOneStyle">
<el-form-item>
<span>{{ formobj.brandName }}</span>
</el-form-item>
</el-col>
</el-row>
<el-table :key="tableKey" :data="formobj.scmSpecialRebateWiths" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column label="返利类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="台数" align="center">
<template slot-scope="scope">
<span>{{ scope.row.num }}</span>
</template>
</el-table-column>
<el-table-column prop="withRebate" label="预提返利" align="center">
<template slot-scope="scope">
<span>{{ scope.row.withRebate }}</span>
</template>
</el-table-column>
<el-table-column label="明细" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleLook(scope.row)">查看</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="备注" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ scope.row.remarks }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<el-row>
<el-col :span="2" class="tleftb">
<span>备注</span>
</el-col>
<el-col :span="22">
<el-form-item>
<span>{{ formobj.remarks }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<!--End 添加修改部分-->
<zhuanxiangfanliyutiInfo v-show="viewState == 2" ref="divInfo" @doback="resetState"/>
<!-- 选择待办人 的弹出框-->
<el-dialog title="填写审批意见" :visible.sync="nodeDialogVisible" width="80%">
<el-form class="formaddcopy02" >
<el-row v-show="currentLink" style="border-top: 1px solid #e0e3eb">
<el-col :span="24">
<div class="span-sty spanTwoWidth"><span>当前环节:</span></div>
<el-form-item><span class="addinputInfo addinputOne">{{ current.taskName }}->{{ nextNode.name }}</span></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty spanTwoWidth"><span>意见:</span></div>
<el-form-item><el-input size="small" v-model="dialogList.comment" placeholder="审批意见" class="addinputw addinputOne" clearable ></el-input></el-form-item>
</el-col>
</el-row>
<div style="text-align:center;margin-top: 20px;">
<el-button type="primary" size="mini" @click="reject"> </el-button>
<el-button type="info " size="mini" @click="nodeDialogVisible = false"> </el-button>
</div>
</el-form>
</el-dialog>
</div>
</template>
<script>
import req from '@/api/specialrebate/specialrebatewithholding'
import zhuanxiangfanliyutiInfo from './relation/zhuanxiangfanliyutiInfo'
export default {
name: 'zhuanxiangfanliyutiDaiBanInfo',
components: {
zhuanxiangfanliyutiInfo
},
data() {
return {
viewTitle: '',
index: 0,
tableKey: 0,
viewState: 1,
operation: '', //
dialogList: {
comment: ''
},
startTask: true,
current: {
taskDefKey: '',
taskName: '' //
},
nextNode: {}, //
nodeDialogVisible: false,
currentLink: true,
//
formobj: {},
rules: {},
submitdisabled: false,
//
linkByParameter: {
businessSid: '',
comment: '',
instanceId: '',
taskId: '',
orgSidPath: '',
taskDefKey: '',
userSid: ''
}
}
},
created() {
console.log('url:' + window.location.href)
var one = window.location.href.indexOf('&data') + 6
const data = window.location.href.substr(one) // urlunescape()web,使
const obj = JSON.parse(decodeURIComponent(data))
console.log('iframe页面获取的obj:', obj)
//
this.linkByParameter.businessSid = obj.businessSid
this.linkByParameter.instanceId = obj.instanceId
this.linkByParameter.taskId = obj.taskId
this.linkByParameter.taskDefKey = obj.taskDefKey
this.linkByParameter.orgSidPath = window.sessionStorage.getItem('orgSidPath')
this.linkByParameter.userSid = window.sessionStorage.getItem('userSid')
this.current.taskDefKey = obj.taskDefKey
this.current.taskName = obj.taskName
//
this.showInfo(obj.businessSid)
},
mounted() {
window.parent.postMessage({
cmd: 'returnHeight',
params: {
//
code: 2,
data: 400 + 'px'
}
}, '*')
},
methods: {
showInfo(sid) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.viewTitle = '预提申请详情'
console.log('编辑回显', sid)
req.fetchBySid(sid).then((resp) => {
this.formobj = resp.data
}).catch((e) => {
this.formobj = {}
})
},
//
openAgree(val) {
this.operation = val
this.currentLink = true
this.dialogList.comment = '同意'
req.getNextNodesForSubmit({ taskDefKey: this.current.taskDefKey }).then((resp) => {
if (resp.success) {
var arr = resp.data
this.nextNode = arr[0]
this.nodeDialogVisible = true
}
this.submitdisabled = false
})
},
//
openReject(val) {
this.operation = val
this.currentLink = true
this.dialogList.comment = ''
req.getPreviousNodesForReject({ taskDefKey: this.current.taskDefKey }).then((resp) => {
if (resp.success) {
var arr = resp.data
this.nextNode = arr[0]
this.nodeDialogVisible = true
}
this.submitdisabled = false
})
},
//
openStop(val) {
this.operation = val
this.currentLink = false
this.dialogList.comment = ''
this.nodeDialogVisible = true
},
reject() {
if (this.operation === '同意') {
this.handleAgree()
} else if (this.operation === '驳回') {
if (this.dialogList.comment === '') {
this.$message({ showClose: true, type: 'error', message: '请填写审批意见' })
} else {
this.handleReject()
}
} else if (this.operation === '终止') {
if (this.dialogList.comment === '') {
this.$message({ showClose: true, type: 'error', message: '请填写审批意见' })
} else {
this.handleStop()
}
}
},
/** 同意任务 */
handleAgree() {
this.linkByParameter.comment = this.dialogList.comment
req.complete(this.linkByParameter).then((response) => {
if (response.success) {
this.$notify({
title: '提示',
message: '执行成功',
type: 'success',
duration: 2000
})
this.nodeDialogVisible = false
//
window.parent.postMessage({
cmd: 'returnHeight',
params: {
//
code: 1
}
}, '*')
}
})
},
/** 驳回任务 */
handleReject() {
this.linkByParameter.comment = this.dialogList.comment
req.reject(this.linkByParameter).then((response) => {
if (response.success) {
this.$notify({
title: '提示',
message: '执行成功',
type: 'success',
duration: 2000
})
this.nodeDialogVisible = false
//
window.parent.postMessage({
cmd: 'returnHeight',
params: {
//
code: 1
}
}, '*')
}
})
},
/** 终止任务 */
handleStop() {
this.linkByParameter.comment = this.dialogList.comment
req.breakProcess(this.linkByParameter).then((response) => {
if (response.success) {
this.$notify({
title: '提示',
message: '执行成功',
type: 'success',
duration: 2000
})
this.nodeDialogVisible = false
//
window.parent.postMessage({
cmd: 'returnHeight',
params: {
//
code: 1
}
}, '*')
}
})
},
handleLook(row) {
this.viewState = 2
this.$refs['divInfo'].showInfo(row)
},
resetState() {
this.viewState = 1
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property === 'withRebate') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ''
} else {
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ''
this.amount = sums[index] += ''
} else {
sums[index] = ''
}
}
})
return sums
},
}
}
</script>
<style scoped>
.titwu {
font-size: 28px;
text-align: center;
padding: 30px 0 20px 0;
}
.spanTwoWidth {
width: 150px !important;
}
.addinputOne {
margin-left: 140px !important;
}
.rowStyle {
border-left: 0px;
}
.colOneStyle {
border-right: 0px !important;
border-bottom: 0px !important;
}
</style>

412
anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiEdit.vue

@ -0,0 +1,412 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="save()">保存
</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submit()">提交
</el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="">
<div class="titwu"><span>{{ formobj.withApply }}专项返利预提申请</span></div>
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd">
<el-row class="rowStyle">
<el-col :span="24" class="tleftb colOneStyle">
<div><span style="font-size: 16px">金额单位</span></div>
</el-col>
</el-row>
<el-row class="rowStyle">
<el-col :span="2" class="tleftb colOneStyle">
<span>品牌:</span>
</el-col>
<el-col :span="4" class="colOneStyle">
<el-form-item>
<el-select :disabled="dialogStatus === 'edit'" v-model="formobj.brandName" placeholder="请选择" filterable clearable @change="changeBrand">
<el-option v-for="item in brand_list" :key="item.sid" :label="item.brandName" :value="item.brandName"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="18" class="tleftb colOneStyle">
<el-button size="small" type="primary" @click="handleSelect()">选择</el-button>
</el-col>
</el-row>
<el-table :key="tableKey" :data="formobj.scmSpecialRebateWiths" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column label="返利类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="台数" align="center">
<template slot-scope="scope">
<span>{{ scope.row.num }}</span>
</template>
</el-table-column>
<el-table-column prop="withRebate" label="预提返利" align="center">
<template slot-scope="scope">
<span>{{ scope.row.withRebate }}</span>
</template>
</el-table-column>
<el-table-column label="明细" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleLook(scope.row)">查看</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="备注" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.remarks" clearable placeholder="" class="addinputw"></el-input>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<el-row>
<el-col :span="2" class="tleftb">
<span>备注</span>
</el-col>
<el-col :span="22">
<el-form-item>
<el-input v-model="formobj.remarks" clearable placeholder="" class="addinputw"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<!--End 添加修改部分-->
<zhuanxiangfanliyutichoose v-show="viewState == 2" ref="divSelect" @doback="resetState" @backData="backData"/>
<zhuanxiangfanliyutiAdd v-show="viewState == 3" ref="divAdd" @backAdd="backAdd" />
</div>
</template>
<script>
import req from '@/api/specialrebate/specialrebatewithholding'
import { brandDown, fetchBySid } from '@/api/cheliang/dictcommons'
import zhuanxiangfanliyutichoose from './relation/zhuanxiangfanliyutichoose'
import zhuanxiangfanliyutiAdd from './relation/zhuanxiangfanliyutiAdd'
export default {
name: 'zhuanxiangfanliyutiEdit',
components: {
zhuanxiangfanliyutichoose,
zhuanxiangfanliyutiAdd
},
data() {
return {
viewTitle: '',
index: 0,
tableKey: 0,
viewState: 1,
dialogStatus: '',
brand_list: [],
//
formobj: {
brandName: '',
brandSid: '',
sid: '',
withApply: '',
createOrgName: '',
createOrgSid: '',
useOrgName: '',
useOrgSid: '',
remarks: '',
withRebateTotal: '',
createByName: '',
createBySid: '',
instanceId: '', // ID
taskId: '', // ID
scmSpecialRebateWiths: []
},
rules: {},
submitdisabled: false
}
},
created() {
console.log('url:' + window.location.href)
var one = window.location.href.indexOf('&data') + 6
const data = window.location.href.substr(one) // urlunescape()web,使
const obj = JSON.parse(decodeURIComponent(data))
this.showInfo(obj.businessSid)
},
mounted() {
window.parent.postMessage({
cmd: 'returnHeight',
params: {
//
code: 2,
data: 400 + 'px'
}
}, '*')
},
methods: {
init() {
fetchBySid(this.formobj.createOrgSid).then((res) => {
if (res.success) {
this.formobj.createOrgName = res.data.name
this.formobj.useOrgName = res.data.name
}
})
brandDown({ useOrg: this.formobj.createOrgSid }).then((res) => {
if (res.success) {
this.brand_list = res.data
}
})
},
//
newDate() {
let date = new Date()
let year = date.getFullYear() //
let month = date.getMonth() + 1 //
this.formobj.withApply = year + '年' + month + '月'
},
showInfo(sid) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.dialogStatus = 'edit'
this.viewTitle = '【编辑】专项返利预提申请'
console.log('编辑回显', sid)
req.fetchBySid(sid).then((resp) => {
this.formobj = resp.data
this.formobj.instanceId = resp.data.procInstId
}).catch((e) => {
this.formobj = {}
})
},
changeBrand(value) {
let bb = null
this.brand_list.forEach((e) => {
if (e.brandName === value) {
bb = {
name: e.brandName,
sid: e.sid
}
}
})
this.formobj.brandSid = bb.sid
},
// --
handleSelect() {
if (this.formobj.brandName === '' || this.formobj.brandName === null || this.formobj.brandName === undefined) {
this.$message({ showClose: true, type: 'error', message: '请先选择品牌' })
return
}
this.viewState = 2
this.$refs['divSelect'].showData(this.formobj.scmSpecialRebateWiths, this.formobj.createOrgSid, this.formobj.brandSid)
},
// --
backData(value) {
this.viewState = 1
for (var i in value) {
let cval = value[i]
if (!this.formobj.scmSpecialRebateWiths || this.formobj.scmSpecialRebateWiths.length === 0) {
this.formobj.scmSpecialRebateWiths = []
}
let v = 0
for (var j in this.formobj.scmSpecialRebateWiths) {
if (this.formobj.scmSpecialRebateWiths[j].rebateTypeValue === cval.rebateTypeValue) {
this.formobj.scmSpecialRebateWiths[j].num = parseInt(this.formobj.scmSpecialRebateWiths[j].num) + parseInt(1)
this.formobj.scmSpecialRebateWiths[j].withRebate = parseInt(this.formobj.scmSpecialRebateWiths[j].withRebate) + parseInt(cval.withRebate)
this.formobj.scmSpecialRebateWiths[j].specialRebateSids.push(cval.sid)
v = 1
break
}
}
if (v === 0) {
this.formobj.scmSpecialRebateWiths.push({
rebateTypeKey: cval.rebateTypeKey,
rebateTypeValue: cval.rebateTypeValue,
num: 1,
withRebate: cval.withRebate,
brandName: cval.brandName,
brandSid: cval.brandSid,
specialRebateSids: [cval.sid],
// remarks: '',
sid: '',
mainSid: ''
})
}
}
},
// --
handleLook(row) {
this.viewState = 3
this.$refs['divAdd'].showInfo(row)
},
// --
backAdd(value, rebateType) {
this.viewState = 1
const aa = []
if (value.length > 0) {
for (var i in value) {
let cval = value[i]
let v = 0
for (var j in aa) {
if (aa[j].rebateTypeValue === cval.rebateTypeValue) {
aa[j].num = parseInt(aa[j].num) + parseInt(1)
aa[j].withRebate = parseInt(aa[j].withRebate) + parseInt(cval.withRebate)
aa[j].specialRebateSids.push(cval.sid)
v = 1
break
}
}
if (v === 0) {
aa.push({
rebateTypeKey: cval.rebateTypeKey,
rebateTypeValue: cval.rebateTypeValue,
num: 1,
withRebate: cval.withRebate,
brandName: cval.brandName,
brandSid: cval.brandSid,
specialRebateSids: [cval.sid],
// remarks: '',
sid: '',
mainSid: ''
})
}
}
for (var k = 0; k < this.formobj.scmSpecialRebateWiths.length; k++) {
if (this.formobj.scmSpecialRebateWiths[k].rebateTypeValue === rebateType) {
this.formobj.scmSpecialRebateWiths[k].rebateTypeKey = aa[0].rebateTypeKey
this.formobj.scmSpecialRebateWiths[k].rebateTypeValue = aa[0].rebateTypeValue
this.formobj.scmSpecialRebateWiths[k].num = aa[0].num
this.formobj.scmSpecialRebateWiths[k].withRebate = aa[0].withRebate
this.formobj.scmSpecialRebateWiths[k].brandName = aa[0].brandName
this.formobj.scmSpecialRebateWiths[k].brandSid = aa[0].brandSid
this.formobj.scmSpecialRebateWiths[k].specialRebateSids = aa[0].specialRebateSids
break
}
}
} else if (value.length === 0) {
for (var l = 0; l < this.formobj.scmSpecialRebateWiths.length; l++) {
if (this.formobj.scmSpecialRebateWiths[l].rebateTypeValue === rebateType) {
this.formobj.scmSpecialRebateWiths.splice(l, 1)
break
}
}
}
},
resetState() {
this.viewState = 1
},
save() {
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.submitdisabled = true
req.save(this.formobj).then((resp) => {
this.submitdisabled = false
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
// ()
window.parent.postMessage({
cmd: 'returnHeight',
params: {
//
code: 1
}
}, '*')
}
}).catch(() => {
this.submitdisabled = false
})
} else {
return false
}
})
},
submit() {
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.submitdisabled = true
req.submitVehicleApply(this.formobj).then((resp) => {
this.submitdisabled = false
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
// ()
window.parent.postMessage({
cmd: 'returnHeight',
params: {
//
code: 1
}
}, '*')
}
}).catch(() => {
this.submitdisabled = false
})
} else {
return false
}
})
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property === 'withRebate') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ''
this.formobj.withRebateTotal = sums[index] += ''
} else {
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ''
this.amount = sums[index] += ''
} else {
sums[index] = ''
}
}
})
return sums
},
}
}
</script>
<style scoped>
.titwu {
font-size: 28px;
text-align: center;
padding: 30px 0 20px 0;
}
.rowStyle {
border-left: 0px;
}
.colOneStyle {
border-right: 0px !important;
border-bottom: 0px !important;
}
</style>

249
anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiYiBanInfo.vue

@ -0,0 +1,249 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<!--标题按钮部分开始-->
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="danger" size="small" @click="openRevoke()">撤回</el-button>
</div>
</div>
<!--标题按钮部分结束-->
<!--Start 新增修改部分-->
<div class="">
<div class="titwu"><span>{{ formobj.withApply }}专项返利预提申请</span></div>
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd">
<el-row class="rowStyle">
<el-col :span="24" class="tleftb colOneStyle">
<div><span style="font-size: 16px">金额单位</span></div>
</el-col>
</el-row>
<el-row class="rowStyle">
<el-col :span="2" class="tleftb colOneStyle">
<span>品牌:</span>
</el-col>
<el-col :span="22" class="colOneStyle">
<el-form-item>
<span>{{ formobj.brandName }}</span>
</el-form-item>
</el-col>
</el-row>
<el-table :key="tableKey" :data="formobj.scmSpecialRebateWiths" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column label="返利类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.rebateTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="台数" align="center">
<template slot-scope="scope">
<span>{{ scope.row.num }}</span>
</template>
</el-table-column>
<el-table-column prop="withRebate" label="预提返利" align="center">
<template slot-scope="scope">
<span>{{ scope.row.withRebate }}</span>
</template>
</el-table-column>
<el-table-column label="明细" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleLook(scope.row)">查看</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="备注" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ scope.row.remarks }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<el-row>
<el-col :span="2" class="tleftb">
<span>备注</span>
</el-col>
<el-col :span="22">
<el-form-item>
<span>{{ formobj.remarks }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<!--End 添加修改部分-->
<zhuanxiangfanliyutiInfo v-show="viewState == 2" ref="divInfo" @doback="resetState"/>
</div>
</template>
<script>
import req from '@/api/specialrebate/specialrebatewithholding'
import zhuanxiangfanliyutiInfo from './relation/zhuanxiangfanliyutiInfo'
export default {
name: 'zhuanxiangfanliyutiYiBanInfo',
components: {
zhuanxiangfanliyutiInfo
},
data() {
return {
viewTitle: '',
index: 0,
tableKey: 0,
viewState: 1,
//
formobj: {},
rules: {},
submitdisabled: false,
//
linkByParameter: {
businessSid: '',
comment: '',
instanceId: '',
taskId: '',
orgSidPath: '',
taskDefKey: '',
userSid: ''
}
}
},
created() {
console.log('url:' + window.location.href)
var one = window.location.href.indexOf('&data') + 6
const data = window.location.href.substr(one) // urlunescape()web,使
const obj = JSON.parse(decodeURIComponent(data))
console.log('iframe页面获取的obj:', obj)
//
this.linkByParameter.businessSid = obj.businessSid
this.linkByParameter.instanceId = obj.instanceId
this.linkByParameter.taskId = obj.taskId
this.linkByParameter.taskDefKey = obj.taskDefKey
this.linkByParameter.orgSidPath = window.sessionStorage.getItem('orgSidPath')
this.linkByParameter.userSid = window.sessionStorage.getItem('userSid')
//
this.showInfo(obj.businessSid)
},
mounted() {
window.parent.postMessage({
cmd: 'returnHeight',
params: {
//
code: 2,
data: 400 + 'px'
}
}, '*')
},
methods: {
showInfo(sid) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.viewTitle = '预提申请详情'
console.log('编辑回显', sid)
req.fetchBySid(sid).then((resp) => {
this.formobj = resp.data
}).catch((e) => {
this.formobj = {}
})
},
handleLook(row) {
this.viewState = 2
this.$refs['divInfo'].showInfo(row)
},
resetState() {
this.viewState = 1
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property === 'withRebate') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ''
} else {
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ''
this.amount = sums[index] += ''
} else {
sums[index] = ''
}
}
})
return sums
},
/** 确认撤回任务 */
openRevoke() {
this.$confirm('是否确认执行撤回操作', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.handleRevoke()
}).catch(() => {
this.$message({
type: 'info',
message: '已取消撤回'
})
})
},
/** 撤回任务 */
handleRevoke() {
req.revokeProcess(this.linkByParameter).then((response) => {
if (response.success) {
this.$notify({
title: '提示',
message: '执行成功',
type: 'success',
duration: 2000
})
this.nodeDialogVisible = false
//
window.parent.postMessage({
cmd: 'returnHeight',
params: {
//
code: 1
}
}, '*')
}
})
}
}
}
</script>
<style scoped>
.titwu {
font-size: 28px;
text-align: center;
padding: 30px 0 20px 0;
}
.rowStyle {
border-left: 0px;
}
.colOneStyle {
border-right: 0px !important;
border-bottom: 0px !important;
}
</style>
Loading…
Cancel
Save