|
@@ -309,6 +309,7 @@ import addEdit from "./components/addEdit.vue";
|
|
|
import { columns } from "./columns";
|
|
|
import { shareWebUrl } from "@/config";
|
|
|
import companyHelper from "@/mixins/companyHelper";
|
|
|
+import dayjs from "dayjs"
|
|
|
import {
|
|
|
xs_order_source_options,
|
|
|
xs_order_type_options,
|
|
@@ -416,7 +417,13 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- // return;
|
|
|
+ const current = dayjs(new Date()).format('YYYY-MM-DD');
|
|
|
+ this.parmValue.start = dayjs(current).subtract(30, 'days').format('YYYY-MM-DD')
|
|
|
+ this.parmValue.end = current
|
|
|
+
|
|
|
+ this.parmValue.start_sendtime = dayjs(current).subtract(30, 'days').format('YYYY-MM-DD')
|
|
|
+ this.parmValue.end_sendtime = current
|
|
|
+
|
|
|
const { back } = this.$route.query;
|
|
|
if (back) {
|
|
|
this.parmValue = JSON.parse(back);
|
|
@@ -570,6 +577,14 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ getDiffDay(date_1, date_2){
|
|
|
+ let totalDays, diffDate
|
|
|
+ let myDate_1 = Date.parse(date_1)
|
|
|
+ let myDate_2 = Date.parse(date_2)
|
|
|
+ diffDate = Math.abs(myDate_1 - myDate_2)
|
|
|
+ totalDays = Math.floor(diffDate / (1000 * 3600 * 24))
|
|
|
+ return totalDays
|
|
|
+ },
|
|
|
restSearch() {
|
|
|
this.customerCode = [];
|
|
|
this.select = "cgdNo";
|
|
@@ -581,6 +596,8 @@ export default {
|
|
|
cgdNo: "",
|
|
|
start: "",
|
|
|
end: "",
|
|
|
+ start_sendtime: "",
|
|
|
+ end_sendtime: "",
|
|
|
// supplierNo: "",
|
|
|
companyNo: "",
|
|
|
good_code: "",
|
|
@@ -592,6 +609,14 @@ export default {
|
|
|
size: 15, // 每页显示条数
|
|
|
use_type: "1"
|
|
|
};
|
|
|
+
|
|
|
+ const current = dayjs(new Date()).format('YYYY-MM-DD');
|
|
|
+ this.parmValue.start = dayjs(current).subtract(30, 'days').format('YYYY-MM-DD')
|
|
|
+ this.parmValue.end = current
|
|
|
+
|
|
|
+ this.parmValue.start_sendtime = dayjs(current).subtract(30, 'days').format('YYYY-MM-DD')
|
|
|
+ this.parmValue.end_sendtime = current
|
|
|
+
|
|
|
// 表格 - 分页
|
|
|
this.pageInfo = {
|
|
|
size: 15,
|
|
@@ -646,6 +671,22 @@ export default {
|
|
|
this.$message.warning("时间区间不完整!");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ if (
|
|
|
+ (this.parmValue[startProp] === "" && this.parmValue[endProp] === "")
|
|
|
+ ) {
|
|
|
+ this.$message.warning("时间区间不能为空!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ const diffDays = this.getDiffDay(this.parmValue[startProp],this.parmValue[endProp]);
|
|
|
+ if(diffDays > 91){
|
|
|
+ this.$message.warning("时间区间不能超过92天!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
this.loading = true;
|
|
|
let model = JSON.parse(JSON.stringify(this.parmValue));
|
|
|
model["customerCode"] = Array.isArray(model["customerCode"])
|
|
@@ -654,7 +695,14 @@ export default {
|
|
|
delete model["customerName"];
|
|
|
model["noRelation"] = true;
|
|
|
model.supplierNo = this.currentCompany;
|
|
|
- // model.noRelation = true
|
|
|
+
|
|
|
+ if( this.timerKey === 'add'){
|
|
|
+ delete model['start_sendtime'];
|
|
|
+ delete model['end_sendtime'];
|
|
|
+ }else{
|
|
|
+ delete model['start'];
|
|
|
+ delete model['end'];
|
|
|
+ }
|
|
|
|
|
|
const res = await asyncRequest.list(model);
|
|
|
|