|
@@ -3,6 +3,7 @@
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
<el-form-item label="报告日期" prop="reportDate">
|
|
|
<el-date-picker clearable size="small" style="width: 200px"
|
|
|
+ @change="handleQuery"
|
|
|
v-model="queryParams.reportDate"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
@@ -10,7 +11,6 @@
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
<el-button
|
|
|
type="info"
|
|
|
icon="el-icon-upload2"
|
|
@@ -1090,7 +1090,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listReport, getReport, delReport, addReport, updateReport, exportReport, importTemplate} from "@/api/production/report";
|
|
|
+import { getReportByReportDate, listReport, getReport, delReport, addReport, updateReport, exportReport, importTemplate} from "@/api/production/report";
|
|
|
import { treeselect } from "@/api/system/dept";
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
@@ -2214,7 +2214,9 @@ export default {
|
|
|
pguAeuTotalLoss: null,
|
|
|
pguAeuLossPercentage: null,
|
|
|
pguAeuFeedLoadPercentage: null
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 日期保留
|
|
|
+ lastSelectedDate: null
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -2228,11 +2230,39 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.clientHeight = document.body.clientHeight -250
|
|
|
})
|
|
|
- // this.getList();
|
|
|
- this.getTreeselect();
|
|
|
- this.loading = false;
|
|
|
+ this.setDateAsToday();
|
|
|
+ this.getReport();
|
|
|
+ this.getTreeselect();
|
|
|
+ this.loading = false;
|
|
|
},
|
|
|
methods: {
|
|
|
+ /** 设置日期 */
|
|
|
+ setDateAsToday() {
|
|
|
+ let today = new Date();
|
|
|
+ let todayString = today.getFullYear()
|
|
|
+ + "-" + (today.getMonth() + 1)
|
|
|
+ + "-" + today.getDate();
|
|
|
+ // this.queryParams.reportDate = todayString;
|
|
|
+ // this.lastSelectedDate = todayString;
|
|
|
+ this.queryParams.reportDate = "2022-8-8";
|
|
|
+ this.lastSelectedDate = "2022-8-8";
|
|
|
+ },
|
|
|
+ /** 查询生产报告 */
|
|
|
+ getReport() {
|
|
|
+ this.loading = true;
|
|
|
+ listReport(this.queryParams).then(response => {
|
|
|
+ if (response.rows.length != 0) {
|
|
|
+ this.lastSelectedDate = this.queryParams.reportDate;
|
|
|
+ this.reportData = response.rows[0];
|
|
|
+ this.loading = false;
|
|
|
+ } else {
|
|
|
+ let str = "未查询到" + this.queryParams.reportDate + "的日报,请修改搜索日期或手动导入数据。";
|
|
|
+ this.queryParams.reportDate = this.lastSelectedDate;
|
|
|
+ this.$message.error(str);
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 查询每日生产报告列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
@@ -2795,8 +2825,7 @@ export default {
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
- this.getList();
|
|
|
+ this.getReport();
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|