Browse Source

1221

master
lc18518571399 9 months ago
parent
commit
1cd847e45f
  1. 21
      api/app/service/exportData.js
  2. 5
      front/src/renderer/src/views/dingdan.vue

21
api/app/service/exportData.js

@ -7,15 +7,26 @@ class ExportDataService extends Service {
let { ctx } = this
let modelLocal = ctx.model[params.model]
let subType = params.subType
let paramsLocal = _.omit(params, ["subType", "url", "model"])
let whereOther = params["$where"]
let paramsLocal = _.omit(params, ["subType", "url", "model", "$where"])
let paramsLocalInfoAgg = { ...paramsLocal, isExit: 1 }
let msgObj = {
exportS6: "成功导出S6订单",
exportxiaoshou: "成功导出销售订单",
}
let ParamsLocalNotDel = { ...paramsLocal, isExit: 1 }
let res = await modelLocal.find(ParamsLocalNotDel).sort({ update_at: -1 })
let count = await modelLocal.find(ParamsLocalNotDel).count()
let returnData = { hasError: false, msg: msgObj[subType], subType, list: res, count }
if (whereOther === "this.zuigaocaigoujia > this.xiaoshoujine") {
paramsLocalInfoAgg["$expr"] = {
"$gt": ["$zuigaocaigoujia", "$xiaoshoujine"]
}
} else if (whereOther === "this.pinmingxuanxiang.length>1") {
paramsLocalInfoAgg["$expr"] = {
"$gt": [{ "$size": "$pinmingxuanxiang" }, 1]
}
}
let res = await modelLocal.aggregate([{
$match: paramsLocalInfoAgg,
}, { $sort: { update_at: -1 } }]).exec()
let returnData = { hasError: false, msg: msgObj[subType], subType, list: res }
return returnData
}
}

5
front/src/renderer/src/views/dingdan.vue

@ -126,6 +126,7 @@ export default {
exportxiaoshou: [],
exportS6: [],
allxiaoshoujine: 0,
clickParams: {},
}
},
methods: {
@ -272,6 +273,7 @@ export default {
//
async searchData(refrash = false) {
let params = {}
this.clickParams = {}
if (refrash) {
console.log(744, this.$refs.dingdanTable)
this.$refs.dingdanTable.clearSelected()
@ -288,6 +290,7 @@ export default {
red: { $where: "this.zuigaocaigoujia > this.xiaoshoujine" },
yellow: { $where: "this.pinmingxuanxiang.length>1" }
}
this.clickParams = params[color]
await this.updateSeach(params[color])
},
//
@ -448,6 +451,7 @@ export default {
subType: "exportxiaoshou",
url: "/api/exportDingdanInfo",
model: "Dingdan",
...this.clickParams
// S6
}
if (this.searchParams.kehubianhao) {
@ -461,6 +465,7 @@ export default {
subType: "exportS6",
url: "/api/exportDingdanInfo",
model: "Dingdan",
...this.clickParams
// S6
}
if (this.searchParams.kehubianhao) {

Loading…
Cancel
Save