Commit 30239df0 by Lin

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

1 parent 6bedddb0
...@@ -363,5 +363,5 @@ export function exportProfit(data) { ...@@ -363,5 +363,5 @@ export function exportProfit(data) {
// 门店毛利额-导入 // 门店毛利额-导入
export function importProfit(data) { export function importProfit(data) {
data.method = `dj.api.script.merchant.profit.record.async.import` data.method = `dj.api.script.merchant.profit.record.async.import`
return request(data) return request(data, "post", ["file"])
} }
\ No newline at end of file \ No newline at end of file
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</el-select> </el-select>
</div> </div>
<div slot="dealMonthHtml"> <div slot="dealMonthHtml">
<el-date-picker v-model="searchForm.dealMonth" <el-date-picker v-model="searchForm.monthYear"
type="month" type="month"
value-format="yyyy-MM" value-format="yyyy-MM"
format="yyyy-MM" format="yyyy-MM"
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
import { Util, deepClone } from "@/common/util" import { Util, deepClone } from "@/common/util"
import inputRange from './components/inputRange' import inputRange from './components/inputRange'
import editDialog from "./components/editDialog" 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 { getList } from "@api/merchant"
import reportTrackFunMixin from '@/mixins/reportTrackFunMixin' import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
export default { export default {
...@@ -164,11 +164,8 @@ ...@@ -164,11 +164,8 @@
return { return {
searchForm: { searchForm: {
storeId: [], storeId: [],
brandChildIds: [], monthYear: "",
brandId: "", profitAmount: [],
dealMonth: "",
dealRate: [],
createTime: "",
businessType: "" businessType: ""
}, },
searchFormSearch: {}, searchFormSearch: {},
...@@ -405,9 +402,7 @@ ...@@ -405,9 +402,7 @@
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
storeId: [], storeId: [],
brandChildIds: [], monthYear: "",
brandId: "",
dealMonth: "",
dealRate: [], dealRate: [],
createTime: "", createTime: "",
businessType: "" businessType: ""
...@@ -456,31 +451,34 @@ ...@@ -456,31 +451,34 @@
handleExport() { handleExport() {
var params = this.searchFormSearch var params = this.searchFormSearch
if (params.merchantIds.length > 0) { // if (params.merchantIds.length > 0) {
params.merchantIds.forEach((item, index) => { // params.merchantIds.forEach((item, index) => {
const merchantId = `merchantIds[${index}]` // const merchantId = `merchantIds[${index}]`
params[merchantId] = item // params[merchantId] = item
}) // })
delete params.merchantIds // delete params.merchantIds
} // }
if (params.brandChildIds.length > 0) { // if (params.brandChildIds.length > 0) {
params.brandChildIds.forEach((item, index) => { // params.brandChildIds.forEach((item, index) => {
const brandChildId = `brandChildIds[${index}]` // const brandChildId = `brandChildIds[${index}]`
params[brandChildId] = item // params[brandChildId] = item
}) // })
delete params.brandChildIds // delete params.brandChildIds
} // }
console.log('AAparamsAA', params);
// 去除为null的值 // 去除为null的值
for (const key in params) { for (const key in params) {
if (params[key] === null || params[key] === '' || params[key].length == 0) { if (params[key] === null || params[key] === '' || params[key].length == 0) {
delete params[key] 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 = [ const list = [
...this.dowloadList, ...this.dowloadList,
{ {
name: '个人交付成交率', name: '门店毛利额',
exportParam: JSON.stringify(params), exportParam: JSON.stringify(params),
status: 'waiting', status: 'waiting',
timeid: new Date().getTime() timeid: new Date().getTime()
...@@ -489,14 +487,14 @@ ...@@ -489,14 +487,14 @@
this.actionSetDownloadList({ list, type: 'dowloadList' }) this.actionSetDownloadList({ list, type: 'dowloadList' })
}, },
// 个人交付成交率导入模版下载 // 门店毛利额导入模版下载
exportTemplate() { exportTemplate() {
var params = {} 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 = [ const list = [
...this.dowloadList, ...this.dowloadList,
{ {
name: '个人交付成交率导入模版', name: '门店毛利额导入模版',
exportParam: JSON.stringify(params), exportParam: JSON.stringify(params),
status: 'waiting', status: 'waiting',
timeid: new Date().getTime() timeid: new Date().getTime()
...@@ -537,7 +535,7 @@ ...@@ -537,7 +535,7 @@
var params = { var params = {
file: this.fileInfo file: this.fileInfo
} }
personalConfigImport(params).then(res => { importProfit(params).then(res => {
if (res) { if (res) {
// 异步处理文件上传 把id传入处理轮询 // 异步处理文件上传 把id传入处理轮询
const list = [...this.updateList, { 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!