|
|
@@ -13,7 +13,7 @@
|
|
|
>
|
|
|
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
|
|
</el-input>
|
|
|
- <el-button>查询</el-button>
|
|
|
+ <el-button @click="inquire">查询</el-button>
|
|
|
<div class="paydate">
|
|
|
<span class="demonstration">支付时间</span>
|
|
|
<el-date-picker
|
|
|
@@ -55,7 +55,7 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
- <div class="export">导出订单</div>
|
|
|
+ <div class="export" @click="exportExcel">导出订单</div>
|
|
|
</div>
|
|
|
<div class="inform-table">
|
|
|
<el-table
|
|
|
@@ -64,6 +64,7 @@
|
|
|
height="576"
|
|
|
style="width: 1550px"
|
|
|
stripe
|
|
|
+ class="Devicetable"
|
|
|
:cell-style="rowbg"
|
|
|
:header-cell-style="{
|
|
|
color: ' rgba(0, 0, 0, 1)',
|
|
|
@@ -338,13 +339,16 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import FileSaver from "file-saver";
|
|
|
+import * as XLSX from "xlsx";
|
|
|
+
|
|
|
export default {
|
|
|
name: "Inform",
|
|
|
data() {
|
|
|
return {
|
|
|
// 显示的数据
|
|
|
data: [],
|
|
|
-
|
|
|
+ Tdata: [],
|
|
|
// 总数据
|
|
|
tableData: [
|
|
|
{
|
|
|
@@ -359,7 +363,7 @@ export default {
|
|
|
pay: "2022.07.02 08:50:50",
|
|
|
},
|
|
|
{
|
|
|
- orderNum: "116161656",
|
|
|
+ orderNum: "216161656",
|
|
|
state: "入住",
|
|
|
room: "17栋1单元2层04房",
|
|
|
electricity: "2.09",
|
|
|
@@ -370,7 +374,7 @@ export default {
|
|
|
pay: "2022.07.02 08:50:50",
|
|
|
},
|
|
|
{
|
|
|
- orderNum: "116161656",
|
|
|
+ orderNum: "316161656",
|
|
|
state: "已入",
|
|
|
room: "17栋1单元2层04房",
|
|
|
electricity: "2.09",
|
|
|
@@ -381,7 +385,7 @@ export default {
|
|
|
pay: "2022.07.02 08:50:50",
|
|
|
},
|
|
|
{
|
|
|
- orderNum: "116161656",
|
|
|
+ orderNum: "416161656",
|
|
|
state: "已住",
|
|
|
room: "17栋1单元2层04房",
|
|
|
electricity: "2.09",
|
|
|
@@ -392,7 +396,7 @@ export default {
|
|
|
pay: "2022.07.02 08:50:50",
|
|
|
},
|
|
|
{
|
|
|
- orderNum: "116161656",
|
|
|
+ orderNum: "516161656",
|
|
|
state: "已入住",
|
|
|
room: "17栋1单元2层04房",
|
|
|
electricity: "2.09",
|
|
|
@@ -403,7 +407,7 @@ export default {
|
|
|
pay: "2022.07.02 08:50:50",
|
|
|
},
|
|
|
{
|
|
|
- orderNum: "116161656",
|
|
|
+ orderNum: "616161656",
|
|
|
state: "已入住",
|
|
|
room: "17栋1单元2层04房",
|
|
|
electricity: "2.09",
|
|
|
@@ -414,7 +418,7 @@ export default {
|
|
|
pay: "2022.07.02 08:50:50",
|
|
|
},
|
|
|
{
|
|
|
- orderNum: "116161656",
|
|
|
+ orderNum: "716161656",
|
|
|
state: "已入住",
|
|
|
room: "17栋1单元2层04房",
|
|
|
electricity: "2.09",
|
|
|
@@ -425,7 +429,7 @@ export default {
|
|
|
pay: "2022.07.02 08:50:50",
|
|
|
},
|
|
|
{
|
|
|
- orderNum: "116161656",
|
|
|
+ orderNum: "816161656",
|
|
|
state: "已入住",
|
|
|
room: "17栋1单元2层04房",
|
|
|
electricity: "2.09",
|
|
|
@@ -436,7 +440,7 @@ export default {
|
|
|
pay: "2022.07.02 08:50:50",
|
|
|
},
|
|
|
{
|
|
|
- orderNum: "116161656",
|
|
|
+ orderNum: "916161656",
|
|
|
state: "入",
|
|
|
room: "17栋1单元2层04房",
|
|
|
electricity: "2.09",
|
|
|
@@ -447,7 +451,7 @@ export default {
|
|
|
pay: "2022.07.02 08:50:50",
|
|
|
},
|
|
|
{
|
|
|
- orderNum: "116161656",
|
|
|
+ orderNum: "106161656",
|
|
|
state: "住",
|
|
|
room: "17栋1单元2层04房",
|
|
|
electricity: "2.09",
|
|
|
@@ -504,9 +508,35 @@ export default {
|
|
|
document.getElementsByClassName(
|
|
|
"el-pagination__jump"
|
|
|
)[0].childNodes[0].nodeValue = "跳转到";
|
|
|
+
|
|
|
this.handleCurrentChange(this.currentPage);
|
|
|
+ this.Tdata = this.tableData;
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 导出表格
|
|
|
+ exportExcel() {
|
|
|
+ var xlsxParam = { raw: true };
|
|
|
+ /* generate workbook object from table */
|
|
|
+ var wb = XLSX.utils.table_to_book(
|
|
|
+ document.querySelector(".inform-table")
|
|
|
+ );
|
|
|
+ /* get binary string as output */
|
|
|
+ var wbout = XLSX.write(wb, {
|
|
|
+ bookType: "xlsx",
|
|
|
+ bookSST: true,
|
|
|
+ type: "array",
|
|
|
+ });
|
|
|
+ try {
|
|
|
+ FileSaver.saveAs(
|
|
|
+ new Blob([wbout], { type: "application/octet-stream" }),
|
|
|
+ "订单管理.xlsx"
|
|
|
+ );
|
|
|
+ } catch (e) {
|
|
|
+ if (typeof console !== "undefined") console.log(e, wbout);
|
|
|
+ }
|
|
|
+ return wbout;
|
|
|
+ },
|
|
|
+
|
|
|
allRead($event, index) {
|
|
|
this.className = this.className.map((item) => (item = ""));
|
|
|
this.className[index] = "active";
|
|
|
@@ -539,9 +569,15 @@ export default {
|
|
|
this.$confirm("确认删除?")
|
|
|
.then((res) => {
|
|
|
if (res == "confirm") {
|
|
|
- this.tableData.splice((this.currentPage - 1) * 8 + index, 1);
|
|
|
+ let data = this.tableData.filter((item) => {
|
|
|
+ return item.orderNum !== row.orderNum;
|
|
|
+ });
|
|
|
+ this.tableData = data;
|
|
|
+ this.Tdata = this.Tdata.filter((item) => {
|
|
|
+ return item.orderNum !== row.orderNum;
|
|
|
+ });
|
|
|
}
|
|
|
- console.log(this.currentPage);
|
|
|
+ // console.log(this.currentPage);
|
|
|
if (this.data.length <= 1) {
|
|
|
this.currentPage = this.currentPage - 1;
|
|
|
}
|
|
|
@@ -551,6 +587,22 @@ export default {
|
|
|
console.log(res);
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ inquire() {
|
|
|
+ if (this.value == false) {
|
|
|
+ this.tableData = this.Tdata;
|
|
|
+ } else {
|
|
|
+ let quireData = this.tableData.filter((item) => {
|
|
|
+ if (item.orderNum.includes(this.value)) {
|
|
|
+ return item.orderNum;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.tableData = quireData;
|
|
|
+ }
|
|
|
+ this.currentPage = 1;
|
|
|
+ this.handleCurrentChange(this.currentPage);
|
|
|
+ },
|
|
|
+
|
|
|
handleClose(done) {
|
|
|
this.dialogVisible = false;
|
|
|
},
|