|
@@ -25,8 +25,21 @@
|
|
|
<template #table-header="{}">
|
|
|
<div style="width: 100%">
|
|
|
<el-row style="padding: 0 0 0 80px">
|
|
|
- <el-col :span="4" style="width: 375px; display: flex; align-items: center">
|
|
|
- <p style="margin-right: 10px">添加时间:</p>
|
|
|
+ <el-col :span="4" style="width: 405px; display: flex; align-items: center">
|
|
|
+ <!-- <p style="margin-right: 10px">添加时间:</p> -->
|
|
|
+ <el-dropdown>
|
|
|
+ <el-button size="mini" style="margin-right:10px">
|
|
|
+ {{timerMaps[timerKey].label}}<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item v-for="key in Object.keys(timerMaps)" :key="key">
|
|
|
+ <p @click="setTimerKey(key)">
|
|
|
+ {{timerMaps[key].label}}
|
|
|
+ </p>
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+
|
|
|
<period-date-picker
|
|
|
:type="1"
|
|
|
:start="parmValue.start"
|
|
@@ -36,7 +49,8 @@
|
|
|
@timeReturned="handleTime"
|
|
|
/>
|
|
|
</el-col>
|
|
|
- <el-col :span="4" style="width: 375px; display: flex; align-items: center">
|
|
|
+
|
|
|
+ <!-- <el-col :span="4" style="width: 375px; display: flex; align-items: center">
|
|
|
<p style="margin-right: 10px">发货时间:</p>
|
|
|
<period-date-picker
|
|
|
:type="1"
|
|
@@ -46,7 +60,7 @@
|
|
|
:size="searchSize"
|
|
|
@timeReturned="handleTime($event, true)"
|
|
|
/>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
|
|
|
<el-col :span="4" style="width: 230px; padding: 0px 0 0 10px">
|
|
|
<search-customer
|
|
@@ -300,6 +314,19 @@ export default {
|
|
|
customerCode: [], //客户公司code
|
|
|
fileUrl: urlConfig.baseURL,
|
|
|
changeList: [],
|
|
|
+ timerKey: "add",
|
|
|
+ timerMaps:{
|
|
|
+ add:{
|
|
|
+ start:'start',
|
|
|
+ end: 'end',
|
|
|
+ label:'添加时间'
|
|
|
+ },
|
|
|
+ send:{
|
|
|
+ start:'start_sendtime',
|
|
|
+ end: 'end_sendtime',
|
|
|
+ label:'发货时间'
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
// post_ownOptions: [
|
|
|
// { id: "1", label: "客户承担" },
|
|
@@ -321,6 +348,7 @@ export default {
|
|
|
isDetail: false,
|
|
|
modelId: 0,
|
|
|
parmValue: {
|
|
|
+ timerInner: "添加时间",
|
|
|
order_type: "",
|
|
|
orderCode: "",
|
|
|
apply_name: "", //申请人名称
|
|
@@ -389,6 +417,10 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ setTimerKey(key){
|
|
|
+ this.timerKey = key
|
|
|
+ this.searchList();
|
|
|
+ },
|
|
|
handleShare(outCode) {
|
|
|
const url = shareWebUrl + outCode;
|
|
|
|
|
@@ -567,18 +599,24 @@ export default {
|
|
|
},
|
|
|
// 列表搜索
|
|
|
async searchList() {
|
|
|
+ console.log(this.timerKey)
|
|
|
+
|
|
|
+ const {start:startProp,end:endProp} = this.timerMaps[this.timerKey]
|
|
|
+
|
|
|
if (
|
|
|
- (this.parmValue.start !== "" && this.parmValue.end === "") ||
|
|
|
- (this.parmValue.start === "" && this.parmValue.end !== "")
|
|
|
+ (this.parmValue[startProp] !== "" && this.parmValue[endProp] === "") ||
|
|
|
+ (this.parmValue[startProp] === "" && this.parmValue[endProp] !== "")
|
|
|
) {
|
|
|
this.$message.warning("时间区间不完整!");
|
|
|
return;
|
|
|
}
|
|
|
this.loading = true;
|
|
|
- let model = JSON.parse(JSON.stringify(this.parmValue));
|
|
|
+ let {start,end,...rest} = JSON.parse(JSON.stringify(this.parmValue));
|
|
|
|
|
|
const res = await asyncRequest.list({
|
|
|
- ...model,
|
|
|
+ ...rest,
|
|
|
+ [startProp]:start,
|
|
|
+ [endProp]:end,
|
|
|
needRela: true
|
|
|
});
|
|
|
|
|
@@ -634,21 +672,18 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 时间选择事件
|
|
|
- async handleTime(e, isSend) {
|
|
|
- const startProp = isSend ? "start_sendtime" : "start";
|
|
|
- const endProp = isSend ? "end_sendtime" : "end";
|
|
|
-
|
|
|
+ async handleTime(e) {
|
|
|
if (e.startTime !== "") {
|
|
|
- this.parmValue[startProp] = e.startTime;
|
|
|
+ this.parmValue.start = e.startTime;
|
|
|
} else {
|
|
|
- this.parmValue[startProp] = "";
|
|
|
+ this.parmValue.start = "";
|
|
|
}
|
|
|
if (e.endTime !== "") {
|
|
|
- this.parmValue[endProp] = e.endTime;
|
|
|
+ this.parmValue.end = e.endTime;
|
|
|
} else {
|
|
|
- this.parmValue[endProp] = "";
|
|
|
+ this.parmValue.end = "";
|
|
|
}
|
|
|
- if (this.parmValue[startProp] !== "" && this.parmValue[endProp] !== "") {
|
|
|
+ if (this.parmValue.start !== "" && this.parmValue.end !== "") {
|
|
|
this.pageInfo.curr = 1;
|
|
|
this.parmValue.page = 1;
|
|
|
await this.searchList();
|