|
@@ -243,7 +243,7 @@
|
|
|
>
|
|
|
</div>
|
|
|
|
|
|
- <div style="float: right" v-if="powers.includes('087') && !isSupertube">
|
|
|
+ <div style="float: right" v-if="powers.includes('087')">
|
|
|
<el-button type="primary" size="mini" @click="handleExport"
|
|
|
>发货工单导出</el-button
|
|
|
>
|
|
@@ -476,6 +476,14 @@ export default {
|
|
|
}
|
|
|
this.searchList();
|
|
|
},
|
|
|
+ getDiffDay(date_1, date_2) {
|
|
|
+ let totalDays, diffDate
|
|
|
+ const myDate_1 = Date.parse(date_1)
|
|
|
+ const myDate_2 = Date.parse(date_2)
|
|
|
+ diffDate = Math.abs(myDate_1 - myDate_2)
|
|
|
+ totalDays = Math.floor(diffDate / (1000 * 3600 * 24))
|
|
|
+ return totalDays // 相差的天数
|
|
|
+ },
|
|
|
handleExport() {
|
|
|
if (!this.loading) {
|
|
|
this.loading = true;
|
|
@@ -486,6 +494,25 @@ export default {
|
|
|
delete model['customer_name']
|
|
|
delete model['select']
|
|
|
delete model['use_type']
|
|
|
+ const { start, end, status } = this.parmValue;
|
|
|
+
|
|
|
+ if(!start || !end){
|
|
|
+ this.$message.error("请选择时间范围");
|
|
|
+ this.loading = false;
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.getDiffDay(start,end) > 7){
|
|
|
+ this.$message.error("时间范围不能超过7天");
|
|
|
+ this.loading = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!status){
|
|
|
+ this.$message.error("请选择状态");
|
|
|
+ this.loading = false;
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
axios({
|
|
|
method: "post",
|