|
@@ -31,7 +31,7 @@
|
|
|
<el-date-picker
|
|
|
v-model="searchForm.month"
|
|
|
value-format="yyyy-MM"
|
|
|
- type="month"
|
|
|
+ type="monthrange"
|
|
|
placeholder="请选择月"
|
|
|
>
|
|
|
</el-date-picker>
|
|
@@ -156,6 +156,7 @@ import { getInspectionItem, resetInspectionItem } from "../api";
|
|
|
import { permission } from "@/utils/directivePage";
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
import dayjs from "dayjs";
|
|
|
+import { getTimes } from "@/utils";
|
|
|
export default {
|
|
|
components: { pagination },
|
|
|
data() {
|
|
@@ -163,7 +164,7 @@ export default {
|
|
|
searchForm: {
|
|
|
userId: "",
|
|
|
organId: "",
|
|
|
- month: "",
|
|
|
+ month: [],
|
|
|
searchType:''
|
|
|
},
|
|
|
handleForm: {
|
|
@@ -186,6 +187,9 @@ export default {
|
|
|
if (query.organId) {
|
|
|
this.searchForm.organId = query.organId
|
|
|
}
|
|
|
+ if( query.start&&query.end){
|
|
|
+ this.searchForm.month = [query.start,query.end]
|
|
|
+ }
|
|
|
this.$store.dispatch("setBranchs");
|
|
|
this.getList();
|
|
|
},
|
|
@@ -202,13 +206,17 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
async getList() {
|
|
|
+ let { month, ...rest } = this.searchForm;
|
|
|
+ let params = {
|
|
|
+ ...rest,
|
|
|
+ page: this.rules.page,
|
|
|
+ rows: this.rules.limit,
|
|
|
+ ...getTimes(month, ["startTime", "endTime"],"YYYY-MM"),
|
|
|
+ searchType: this.$route.query.searchType,
|
|
|
+ };
|
|
|
try {
|
|
|
- const res = await getInspectionItem({
|
|
|
- ...this.searchForm,
|
|
|
- page: this.rules.page,
|
|
|
- rows: this.rules.limit,
|
|
|
- searchType: this.$route.query.searchType,
|
|
|
- });
|
|
|
+ const res = await getInspectionItem(params
|
|
|
+ );
|
|
|
this.tableList = res.data.rows;
|
|
|
this.rules.total = res.data.total;
|
|
|
} catch (e) {
|