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 { ctx } = this
let modelLocal = ctx.model[params.model] let modelLocal = ctx.model[params.model]
let subType = params.subType 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 = { let msgObj = {
exportS6: "成功导出S6订单", exportS6: "成功导出S6订单",
exportxiaoshou: "成功导出销售订单", exportxiaoshou: "成功导出销售订单",
} }
let ParamsLocalNotDel = { ...paramsLocal, isExit: 1 } if (whereOther === "this.zuigaocaigoujia > this.xiaoshoujine") {
let res = await modelLocal.find(ParamsLocalNotDel).sort({ update_at: -1 }) paramsLocalInfoAgg["$expr"] = {
let count = await modelLocal.find(ParamsLocalNotDel).count() "$gt": ["$zuigaocaigoujia", "$xiaoshoujine"]
let returnData = { hasError: false, msg: msgObj[subType], subType, list: res, count } }
} 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 return returnData
} }
} }

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

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

Loading…
Cancel
Save