|
@@ -36,7 +36,7 @@
|
|
<!-- 日期表 -->
|
|
<!-- 日期表 -->
|
|
<div class="dataForm" style="margin-right: 20px">
|
|
<div class="dataForm" style="margin-right: 20px">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
- v-model="value1"
|
|
|
|
|
|
+ v-model="search_date"
|
|
type="daterange"
|
|
type="daterange"
|
|
range-separator="——"
|
|
range-separator="——"
|
|
start-placeholder="开始日期"
|
|
start-placeholder="开始日期"
|
|
@@ -46,7 +46,7 @@
|
|
</div>
|
|
</div>
|
|
<!-- 按钮 -->
|
|
<!-- 按钮 -->
|
|
<el-button
|
|
<el-button
|
|
- @click="searchBtn"
|
|
|
|
|
|
+ @click="searchBtn(company_ids, search_date)"
|
|
style="background-color: rgb(40, 155, 209); color: black"
|
|
style="background-color: rgb(40, 155, 209); color: black"
|
|
>搜索</el-button
|
|
>搜索</el-button
|
|
>
|
|
>
|
|
@@ -77,20 +77,20 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="索赔收入">
|
|
<el-table-column label="索赔收入">
|
|
- <el-table-column prop="spll" label="索赔领料"> </el-table-column>
|
|
|
|
<el-table-column prop="spgs" label="索赔工时"> </el-table-column>
|
|
<el-table-column prop="spgs" label="索赔工时"> </el-table-column>
|
|
|
|
+ <el-table-column prop="spll" label="索赔领料"> </el-table-column>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="定保收入">
|
|
<el-table-column label="定保收入">
|
|
<el-table-column prop="dbgs" label="定保工时"> </el-table-column>
|
|
<el-table-column prop="dbgs" label="定保工时"> </el-table-column>
|
|
<el-table-column prop="dbll" label="定保领料"> </el-table-column>
|
|
<el-table-column prop="dbll" label="定保领料"> </el-table-column>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="一般维修收入">
|
|
<el-table-column label="一般维修收入">
|
|
- <el-table-column prop="ybwxll" label="外修领料"> </el-table-column>
|
|
|
|
- <el-table-column prop="ybwxgs" label="外修工时"> </el-table-column>
|
|
|
|
|
|
+ <el-table-column prop="ybwxgs" label="维修工时"> </el-table-column>
|
|
|
|
+ <el-table-column prop="ybwxll" label="维修领料"> </el-table-column>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="钣喷收入">
|
|
<el-table-column label="钣喷收入">
|
|
- <el-table-column prop="bpll" label="钣喷材料"> </el-table-column>
|
|
|
|
<el-table-column prop="bpgs" label="钣喷工时"> </el-table-column>
|
|
<el-table-column prop="bpgs" label="钣喷工时"> </el-table-column>
|
|
|
|
+ <el-table-column prop="bpll" label="钣喷材料"> </el-table-column>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="jpsr" label="精品"> </el-table-column>
|
|
<el-table-column prop="jpsr" label="精品"> </el-table-column>
|
|
<el-table-column prop="qtsr" label="其他收入"> </el-table-column>
|
|
<el-table-column prop="qtsr" label="其他收入"> </el-table-column>
|
|
@@ -103,6 +103,9 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import axios from "axios";
|
|
import axios from "axios";
|
|
|
|
+import { cztjtabledataInfo } from "../../servuces/prove";
|
|
|
|
+import { nowdaterange } from "../../servuces/getnowtime";
|
|
|
|
+import { column } from "../../store/tuozhuai";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -111,58 +114,59 @@ export default {
|
|
value: "",
|
|
value: "",
|
|
//表格各类属性
|
|
//表格各类属性
|
|
tableData: [],
|
|
tableData: [],
|
|
|
|
+ tableDatahj: [],
|
|
//下拉框内属性
|
|
//下拉框内属性
|
|
options: [],
|
|
options: [],
|
|
- //日期表属性
|
|
|
|
- pickerOptions: {
|
|
|
|
- shortcuts: [
|
|
|
|
- {
|
|
|
|
- text: "最近一个月",
|
|
|
|
- onClick(picker) {
|
|
|
|
- const end = new Date();
|
|
|
|
- const start = new Date();
|
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
|
- picker.$emit("pick", [start, end]);
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- value1: ["2023-08-01", "2023-08-03"],
|
|
|
|
|
|
+ search_date: '',
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ created () {
|
|
|
|
+ const data = sessionStorage.getItem('company_data');
|
|
|
|
+ if (data) {
|
|
|
|
+ this.options = JSON.parse(data)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
mounted() {
|
|
mounted() {
|
|
|
|
+ column(this);
|
|
this.updateTime(); //时间
|
|
this.updateTime(); //时间
|
|
- this.getTableDate(); //开始获取表格
|
|
|
|
- this.getSelectDate(); //下拉框接口数据
|
|
|
|
|
|
+ this.getTableData(); //开始获取表格
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
// 在组件销毁前清除定时器,避免内存泄漏
|
|
// 在组件销毁前清除定时器,避免内存泄漏
|
|
clearInterval(this.timer);
|
|
clearInterval(this.timer);
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- //表格接口数据
|
|
|
|
- getTableDate() {
|
|
|
|
- axios
|
|
|
|
- .get("http://192.168.2.55:8022/plugins/lhyt/shsr_detail", {
|
|
|
|
- params: {
|
|
|
|
- company_ids: this.company_ids.join(),
|
|
|
|
- date_begin: this.value1[0],
|
|
|
|
- date_end: this.value1[1],
|
|
|
|
- },
|
|
|
|
- })
|
|
|
|
- .then((res) => {
|
|
|
|
- console.log("--------", res.data.rows);
|
|
|
|
- this.tableData = res.data.rows;
|
|
|
|
- });
|
|
|
|
|
|
+ getTableData () {
|
|
|
|
+ this.search_date = nowdaterange;
|
|
|
|
+ cztjtabledataInfo({ "company_ids": '', "date_begin": nowdaterange[0], 'date_end': nowdaterange[1] }).then(res => {
|
|
|
|
+ this.tableData = res.rows;
|
|
|
|
+ this.tableDatahj = res.footer
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- //下拉框数据
|
|
|
|
- getSelectDate() {
|
|
|
|
- axios
|
|
|
|
- .get("http://192.168.2.55:8022/plugins/lhyt/get_companies")
|
|
|
|
- .then((ret) => {
|
|
|
|
- console.log(ret);
|
|
|
|
- this.options = ret.data.data;
|
|
|
|
|
|
+ //查询
|
|
|
|
+ searchBtn(value, value1) {
|
|
|
|
+ const company_ids = value.join(',');
|
|
|
|
+ if (value1) {
|
|
|
|
+ const strvaluezh = value1.map(item => {
|
|
|
|
+ const date = new Date(item);
|
|
|
|
+ // 获取年份和月份
|
|
|
|
+ const year = date.getFullYear();
|
|
|
|
+ const month = date.getMonth() + 1; // 月份从0开始,需要加1
|
|
|
|
+ const day = date.getDate();
|
|
|
|
+ // 将年份和月份拼接成所需形式的字符串
|
|
|
|
+ return `${year}-${month}-${day}`;
|
|
|
|
+ });
|
|
|
|
+ cztjtabledataInfo({ "company_ids": company_ids, "date_begin": strvaluezh[0], 'date_end': strvaluezh[1] }).then(res => {
|
|
|
|
+ this.tableData = res.rows;
|
|
|
|
+ this.tableDatahj = res.footer
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ cztjtabledataInfo({"company_ids": company_ids, "date_begin": '', 'date_end': ''}).then(res => {
|
|
|
|
+ this.tableData = res.rows;
|
|
|
|
+ this.tableDatahj = res.footer;
|
|
});
|
|
});
|
|
|
|
+ }
|
|
},
|
|
},
|
|
//更新时间
|
|
//更新时间
|
|
updateTime() {
|
|
updateTime() {
|
|
@@ -183,26 +187,6 @@ export default {
|
|
const seconds = String(now.getSeconds()).padStart(2, "0");
|
|
const seconds = String(now.getSeconds()).padStart(2, "0");
|
|
return `${year}.${month}.${day} ${hours}:${minutes}:${seconds}`;
|
|
return `${year}.${month}.${day} ${hours}:${minutes}:${seconds}`;
|
|
},
|
|
},
|
|
- resetDateFilter() {
|
|
|
|
- this.$refs.filterTable.clearFilter("date");
|
|
|
|
- },
|
|
|
|
- clearFilter() {
|
|
|
|
- this.$refs.filterTable.clearFilter();
|
|
|
|
- },
|
|
|
|
- formatter(row, column) {
|
|
|
|
- return row.address;
|
|
|
|
- },
|
|
|
|
- filterTag(value, row) {
|
|
|
|
- return row.tag === value;
|
|
|
|
- },
|
|
|
|
- filterHandler(value, row, column) {
|
|
|
|
- const property = column["property"];
|
|
|
|
- return row[property] === value;
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- searchBtn() {
|
|
|
|
- this.getTableDate()
|
|
|
|
- },
|
|
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|