Commit 363162ea by Lin

feat: 区域运营管理接口联调

1 parent 30239df0
......@@ -35,7 +35,7 @@ export function updateRegionUser(data) {
data.method = 'dj.api.smartcarlife.sale.region.updateRegionUser'
return request(data, "post")
}
// 区域运营模块接口
// 区域运营管理人员列表
export function organizationUserList(data) {
data.method = 'dj.api.script.province.organization.list'
......@@ -44,6 +44,6 @@ export function organizationUserList(data) {
// 区域运营管理编辑
export function organizationUserUpdate(data) {
data.method = 'dj.api.script.province.organization.up'
data.method = 'dj.api.script.province.organization.upd'
return request(data, "post")
}
\ No newline at end of file
......@@ -172,7 +172,7 @@ function init() {
// i18n,
render: (h) => {
// data.axios.baseURL =
// 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// 'http://dj.beta.glsx.com.cn/rop-dj-smartcarlife/router'
// data
// console.log(data)
Vue.prototype.baseConfig = baseConfig
......
......@@ -9,7 +9,7 @@
<el-button @click="handleCancel">取消</el-button>
</div>
</div>
<!-- 展示字段不同,因此独立编辑 -->
<div v-if="source === 'regional'" style="padding: 20px" v-loading="$store.state.d2admin.loading.value">
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="250px" default-width="314px" :isBlock="isBlock" :form-ref="editChildRef" :form-obj="editData" :form-data="editFormDataRegional" :form-rules="formRulesRegional">
</glsx-combi-form>
......@@ -23,7 +23,7 @@
<script>
import { deepClone } from "@/common/util"
import { regionUserList, updateRegionUser } from '@api/salesManagement'
import { regionUserList, updateRegionUser, organizationUserUpdate } from '@api/salesManagement'
import { merchantStaffByRoleList } from '@api/index'
export default {
name: "EditOrganize",
......@@ -95,7 +95,7 @@ export default {
isDisabled: true
}, {
label: '区域运营大区经理',
name: 'operateUserId',
name: 'regionalOperationsAreaManager',
type: 'select',
isClear: true,
optionList: [],
......@@ -104,23 +104,22 @@ export default {
optionsName: 'operateUserOpt',
changeAttr: (value, targetItem) => {
console.log(value, targetItem)
this.editData.operateUserId = value
this.dealListDisable()
this.editData.regionalOperationsAreaManager = value
// this.dealListDisable()
}
}, {
label: '区域运营',
name: 'salesList',
name: 'regionalOperations',
type: 'select',
isClear: true,
multiple: true,
optionList: [],
optionId: 'uuid',
optionLabel: 'staffName',
optionsName: 'salesPersonOpt',
changeAttr: (value, targetItem) => {
console.log(value, targetItem)
this.editData.salesList = value
this.dealListDisable()
this.editData.regionalOperations = value
// this.dealListDisable()
}
}
],
......@@ -137,6 +136,10 @@ export default {
this.routeInfo.userList = this.$route.query.userList || []
this.editData.id = this.$route.query.id
this.editData.regionName = this.$route.query.regionName
if(this.$route.query.source == 'regional'){
this.editData.regionalOperationsAreaManager = this.$route.query.regionalOperationsAreaManager
this.editData.regionalOperations = this.$route.query.regionalOperations
}
this.source = this.$route.query.source
this.getregionUserList();
this.getOptionsList("editFormData", false)
......@@ -261,13 +264,30 @@ export default {
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => {
if (valid) {
const params = this.getParams()
console.log(params)
updateRegionUser(params).then(res => {
console.log(res)
this.$message.success("操作成功")
this.handleCancel()
})
if(this.source === 'regional'){
const regionalParams = {
id: this.editData.id,
regionalOperationsAreaManager: this.editData.regionalOperationsAreaManager,
regionalOperations: this.editData.regionalOperations,
areaManagerName: this.findInfo(this.editData.regionalOperationsAreaManager).staffName || '',
regionalOperationsName: this.findInfo(this.editData.regionalOperations).staffName || '',
sessionId: this.getParams().sessionId,
}
console.log("AAregionalParamsAA", regionalParams);
organizationUserUpdate(regionalParams).then(res => {
console.log(res)
this.$message.success("操作成功")
this.handleCancel()
})
}
if(this.source === 'organize'){
const params = this.getParams()
updateRegionUser(params).then(res => {
console.log(res)
this.$message.success("操作成功")
this.handleCancel()
})
}
}
})
},
......
......@@ -20,36 +20,27 @@
<script>
import { busTypeOpt, cooperModeOpt, flowSituateOpt } from '../constant/baseData'
import { regionPage } from '@api/salesManagement'
import { organizationUserList } from '@api/salesManagement'
export default {
name: 'Customer',
data() {
return {
recordInfo: {},
userInfo: this.$store.state.d2admin.user.info,
getListApi: regionPage,
getListApi: organizationUserList,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [{
label: '省份名称',
prop: 'regionName'
prop: 'provinceName'
},{
label: '区域运营大区经理',
prop: 'userList',
formatter: (cellValue) => {
// 人员类型(1.大区经理,2.销售人员)
return (cellValue.userList && cellValue.userList.length) ? (cellValue.userList.filter(item => item.userType == 1).map(item => item.userName).join(',') || '-') : '-'
}
prop: 'areaManagerName',
}, {
label: '区域运营',
prop: 'userList',
addHtml: 'userList',
formatter: (cellValue) => {
// 人员类型(1.大区经理,2.销售人员)
return (cellValue.userList && cellValue.userList.length) ? cellValue.userList.filter(item => item.userType == 2).map(item => item.userName).join(',') || '-' : '-'
}
prop: 'regionalOperationsName',
}, {
label: '创建时间',
prop: 'createdDate',
......@@ -77,7 +68,9 @@
query: {
source: 'regional',
id: row?.id || '',
regionName: row?.regionName || '',
regionName: row?.provinceName || '',
regionalOperationsAreaManager: row?.regionalOperationsAreaManager || '',
regionalOperations: row?.regionalOperations || '',
userList: row?.userList || []
}
})
......
......@@ -451,34 +451,31 @@
handleExport() {
var params = this.searchFormSearch
// if (params.merchantIds.length > 0) {
// params.merchantIds.forEach((item, index) => {
// const merchantId = `merchantIds[${index}]`
// params[merchantId] = item
// })
// delete params.merchantIds
// }
// if (params.brandChildIds.length > 0) {
// params.brandChildIds.forEach((item, index) => {
// const brandChildId = `brandChildIds[${index}]`
// params[brandChildId] = item
// })
// delete params.brandChildIds
// }
console.log('AAparamsAA', params);
if (params.merchantIds.length > 0) {
params.merchantIds.forEach((item, index) => {
const merchantId = `merchantIds[${index}]`
params[merchantId] = item
})
delete params.merchantIds
}
if (params.brandChildIds.length > 0) {
params.brandChildIds.forEach((item, index) => {
const brandChildId = `brandChildIds[${index}]`
params[brandChildId] = item
})
delete params.brandChildIds
}
// 去除为null的值
for (const key in params) {
if (params[key] === null || params[key] === '' || params[key].length == 0) {
delete params[key]
}
}
// params.method = 'dj.api.smartcarlife.employee.delivery.deal.rate.export.async'
params.method = 'dj.api.script.merchant.profit.record.async.export'
params.method = 'dj.api.smartcarlife.employee.delivery.deal.rate.export.async'
const list = [
...this.dowloadList,
{
name: '门店毛利额',
name: '个人交付成交率',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!