|
@@ -3,10 +3,15 @@
|
|
|
<!-- 零星物资出厂作业页面 -->
|
|
|
<div class="homeworkPath">
|
|
|
<div class="top">
|
|
|
- <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
|
|
|
- <el-button type="primary" class="btn" @click="onclick">
|
|
|
- <i class="el-icon-search"></i>查询
|
|
|
- </el-button>
|
|
|
+ <span class="text">出厂时间:</span>
|
|
|
+ <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ <span class="text1">至</span>
|
|
|
+ <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ <el-button type="primary" class="btn" @click="onclick">
|
|
|
+ <i class="el-icon-search"></i>查询
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
<dilTable v-bind.sync="option">
|
|
|
</dilTable>
|
|
@@ -15,11 +20,14 @@
|
|
|
|
|
|
<script>
|
|
|
import { getCookie } from "@/utils/util.js";
|
|
|
+import { sjTime } from "@/utils/sharedJsFile";
|
|
|
export default {
|
|
|
name: "homeworkPath",
|
|
|
data() {
|
|
|
return {
|
|
|
input: null,
|
|
|
+ startTime: null,
|
|
|
+ endTime: null,
|
|
|
option: {
|
|
|
// 表格请求数据的地址
|
|
|
requestUrl: "",
|
|
@@ -35,19 +43,25 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
onclick() {
|
|
|
- if(this.input != null){
|
|
|
- if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu" || getCookie("orgCode") == "baoweibu"){
|
|
|
- this.option.requestUrl = "/api/v1/tms/getLeaveFactoryResult?apiId=421&orderType=15&con=" + this.input
|
|
|
+ let startTime = null;
|
|
|
+ let endTime = null;
|
|
|
+ if(this.startTime){
|
|
|
+ startTime = sjTime(this.startTime);
|
|
|
+ }
|
|
|
+ if(this.endTime){
|
|
|
+ endTime = sjTime(this.endTime);
|
|
|
+ }
|
|
|
+ if(startTime && endTime){
|
|
|
+ if(startTime < endTime){
|
|
|
+ this.option.requestUrl = "/api/v1/tms/getLeaveFactoryResult?apiId=421&orderType=15&startTime="+startTime+"&endTime="+endTime+"&i=" +new Date();
|
|
|
}else{
|
|
|
- this.option.requestUrl = "/api/v1/tms/getLeaveFactoryResult?apiId=421&orderType=15&userId=" + getCookie("orgCode") + "&con=" + this.input
|
|
|
- }
|
|
|
+ this.startTime = null;
|
|
|
+ this.endTime = null;
|
|
|
+ this.$message.warning('开始时间要比结束时间早')
|
|
|
+ }
|
|
|
}else{
|
|
|
- this.$message.warning("未输入查询条件")
|
|
|
- if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu" || getCookie("orgCode") == "baoweibu"){
|
|
|
- this.option.requestUrl = "/api/v1/tms/getLeaveFactoryResult?apiId=421&orderType=15"
|
|
|
- }else{
|
|
|
- this.option.requestUrl = "/api/v1/tms/getLeaveFactoryResult?apiId=421&orderType=15&userId=" + getCookie("orgCode")
|
|
|
- }
|
|
|
+ this.option.requestUrl = "/api/v1/tms/getLeaveFactoryResult?apiId=421&orderType=15&startTime="+startTime+"&endTime="+endTime+"&i=" +new Date();
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
},
|