Commit 30239df0 by Lin

feat: 门店毛利额导入导出接口联调

1 parent 6bedddb0
......@@ -363,5 +363,5 @@ export function exportProfit(data) {
// 门店毛利额-导入
export function importProfit(data) {
data.method = `dj.api.script.merchant.profit.record.async.import`
return request(data)
return request(data, "post", ["file"])
}
\ No newline at end of file
......@@ -27,7 +27,7 @@
</el-select>
</div>
<div slot="dealMonthHtml">
<el-date-picker v-model="searchForm.dealMonth"
<el-date-picker v-model="searchForm.monthYear"
type="month"
value-format="yyyy-MM"
format="yyyy-MM"
......@@ -136,7 +136,7 @@
import { Util, deepClone } from "@/common/util"
import inputRange from './components/inputRange'
import editDialog from "./components/editDialog"
import { listProfitPage, personalConfigImport, deleteProfit } from '@api/shopConfig'
import { listProfitPage, importProfit, deleteProfit } from '@api/shopConfig'
import { getList } from "@api/merchant"
import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
export default {
......@@ -164,11 +164,8 @@
return {
searchForm: {
storeId: [],
brandChildIds: [],
brandId: "",
dealMonth: "",
dealRate: [],
createTime: "",
monthYear: "",
profitAmount: [],
businessType: ""
},
searchFormSearch: {},
......@@ -405,9 +402,7 @@
handleReset() {
this.searchForm = {
storeId: [],
brandChildIds: [],
brandId: "",
dealMonth: "",
monthYear: "",
dealRate: [],
createTime: "",
businessType: ""
......@@ -456,31 +451,34 @@
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
}
// 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);
// 去除为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.smartcarlife.employee.delivery.deal.rate.export.async'
params.method = 'dj.api.script.merchant.profit.record.async.export'
const list = [
...this.dowloadList,
{
name: '个人交付成交率',
name: '门店毛利额',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
......@@ -489,14 +487,14 @@
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
// 个人交付成交率导入模版下载
// 门店毛利额导入模版下载
exportTemplate() {
var params = {}
params.method = 'dj.api.smartcarlife.employee.delivery.deal.rate.template.export'
params.method = 'dj.api.script.merchant.profit.record.async.import'
const list = [
...this.dowloadList,
{
name: '个人交付成交率导入模版',
name: '门店毛利额导入模版',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
......@@ -537,7 +535,7 @@
var params = {
file: this.fileInfo
}
personalConfigImport(params).then(res => {
importProfit(params).then(res => {
if (res) {
// 异步处理文件上传 把id传入处理轮询
const list = [...this.updateList, {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!