Blame view

src/views/sbbwcx/index.vue 5.46 KB
任超 committed
1
<template>
任超 committed
2 3 4
  <!-- 上报报文查询 -->
  <div class="from-clues">
    <!-- 头部搜索 -->
任超 committed
5
    <div class="from-clues-header">
任超 committed
6
      <el-form ref="ruleForm" :model="form" label-width="100px">
任超 committed
7 8
        <el-row class="marginbtm5">
          <el-col :span="6">
田浩浩 committed
9 10 11 12 13
            <el-form-item label="行政区" prop="pcode">
              <el-select v-model="form.pcode" class="width100" clearable placeholder="行政区">
                <el-option v-for="item in xzqOptions" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
任超 committed
14 15
            </el-form-item>
          </el-col>
任超 committed
16
          <el-col :span="6">
田浩浩 committed
17
            <el-form-item label="汇交时间" prop="reportStartTime">
任超 committed
18
              <el-date-picker type="date" class="width100" placeholder="开始日期" :picker-options="pickerOptionsStart"
蔡俊立 committed
19
                clearable v-model="form.reportStartTime" value-format="yyyy-MM-dd"></el-date-picker>
任超 committed
20
              <el-date-picker type="date" class="width100" placeholder="结束日期" :picker-options="pickerOptionsEnd"
蔡俊立 committed
21
                clearable v-model="form.reportEndTime" value-format="yyyy-MM-dd"></el-date-picker>
任超 committed
22 23 24
            </el-form-item>
          </el-col>
          <el-col :span="6">
田浩浩 committed
25 26
            <el-form-item label="汇交状态" prop="state">
              <el-select v-model="form.state" class="width100" clearable placeholder="响应结果">
任超 committed
27 28 29
                <el-option v-for="item in []" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
任超 committed
30 31
            </el-form-item>
          </el-col>
任超 committed
32
        </el-row>
任超 committed
33
        <el-row class="mt-10">
任超 committed
34
          <!-- 操作按钮 -->
任超 committed
35
          <el-col :span="12" class="btnColRight">
任超 committed
36
            <btn nativeType="cz" @click="resetForm('ruleForm')">重置</btn>
任超 committed
37
            <btn nativeType="cx" @click="queryClick">查询</btn>
任超 committed
38 39 40 41
          </el-col>
        </el-row>
      </el-form>
    </div>
任超 committed
42
    <!-- 列表 -->
任超 committed
43
    <div class="from-clues-content">
任超 committed
44 45 46
      <lb-table :page-size="pageData.pageSize" :current-page.sync="pageData.currentPage" :total="tableData.total"
        @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
        :data="tableData.data">
任超 committed
47 48
      </lb-table>
    </div>
任超 committed
49
    <!-- 引入详情组件 -->
任超 committed
50
    <!-- 编辑 -->
蔡俊立 committed
51
    <dataDetails ref="editLog" />
任超 committed
52 53 54
  </div>
</template>
<script>
任超 committed
55 56
// 上报报文查询
// 引入表头数据
田浩浩 committed
57
import data from "./data";
任超 committed
58
// 引入表格混入方法
田浩浩 committed
59
import table from "@/utils/mixin/table";
任超 committed
60
// 引入详情弹框
田浩浩 committed
61
import dataDetails from "@/components/dataDetails/edit-dialog";
任超 committed
62
import { getDataReportPage } from "@/api/sbbwcx.js";
1  
蔡俊立 committed
63

任超 committed
64
export default {
任超 committed
65
  name: "sbbwcx",
任超 committed
66
  mixins: [table],
任超 committed
67
  // 注册组件
任超 committed
68
  components: {
田浩浩 committed
69
    dataDetails,
任超 committed
70
  },
田浩浩 committed
71
  data() {
任超 committed
72
    return {
任超 committed
73
      isShow: false,
任超 committed
74 75 76
      // 开始结束日期限制
      pickerOptionsStart: {
        disabledDate: (time) => {
蔡俊立 committed
77
          if (this.form.reportEndTime) {
任超 committed
78
            return (
蔡俊立 committed
79
              time.getTime() >= new Date(this.form.reportEndTime).getTime()
任超 committed
80 81
            );
          }
田浩浩 committed
82
        },
任超 committed
83 84 85 86
      },
      // 结束日期限制
      pickerOptionsEnd: {
        disabledDate: (time) => {
蔡俊立 committed
87
          if (this.form.reportStartTime) {
任超 committed
88
            return (
蔡俊立 committed
89
              time.getTime() <= new Date(this.form.reportStartTime).getTime()
任超 committed
90 91
            );
          }
田浩浩 committed
92
        },
任超 committed
93
      },
任超 committed
94
      // 头部搜索
任超 committed
95
      form: {
田浩浩 committed
96 97 98 99 100 101
        estatenum: "",
        reportStartTime: "",
        reportEndTime: "",
        ywmc: "",
        state: "",
        pcode: "",
任超 committed
102
      },
任超 committed
103
      // table数据
任超 committed
104
      tableData: {
任超 committed
105
        // 表头数据
田浩浩 committed
106
        columns: [
任超 committed
107
          {
田浩浩 committed
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
            label: "序号",
            type: "index",
            width: "50",
            index: this.indexMethod,
          },
        ]
          .concat(data.columns())
          .concat([
            {
              label: "操作",
              width: "80",
              render: (h, scope) => {
                return (
                  <div>
                    <el-button
                      size="mini"
                      type="primary"
                      onClick={() => {
                        this.handleDetail(scope.row);
                      }}
                    >
                      详情
                    </el-button>
                  </div>
                );
              },
            },
          ]),
1  
蔡俊立 committed
136
        total: 0,
任超 committed
137
        data: [{}],
任超 committed
138 139 140 141
      },
      // 行政区
      xzqOptions: [
        {
田浩浩 committed
142 143
          value: "632321",
          label: "同仁县",
任超 committed
144 145
        },
        {
田浩浩 committed
146 147
          value: "632322",
          label: "尖扎县",
任超 committed
148 149
        },
        {
田浩浩 committed
150 151
          value: "632323",
          label: "泽库县",
任超 committed
152 153
        },
        {
田浩浩 committed
154 155 156 157 158
          value: "632324",
          label: "河南县",
        },
      ],
    };
任超 committed
159 160
  },
  methods: {
任超 committed
161
    // 重置表单
田浩浩 committed
162
    resetForm() {
任超 committed
163 164
      this.$refs.ruleForm.resetFields();
    },
任超 committed
165
    // 初始化数据
田浩浩 committed
166 167
    queryClick() {
      getDataReportPage({ ...this.form, ...this.pageData }).then((res) => {
1  
蔡俊立 committed
168
        if (res.code === 200) {
田浩浩 committed
169
          let { total, records } = res.result;
1  
蔡俊立 committed
170
          this.tableData.total = total;
田浩浩 committed
171
          this.tableData.data = records ? records : [];
1  
蔡俊立 committed
172
        }
田浩浩 committed
173
      });
任超 committed
174
    },
任超 committed
175
    // 多选
田浩浩 committed
176
    handleSelectionChange(val) {},
任超 committed
177
    // 上报
田浩浩 committed
178
    handleEscalation() {},
任超 committed
179
    // 详情
田浩浩 committed
180 181 182 183 184
    handleDetail(row) {
      this.$refs.editLog.isShow(row);
    },
  },
};
任超 committed
185 186
</script>
<style scoped lang="scss">
任超 committed
187
// 引入页面公共样式
任超 committed
188 189 190 191
@import "~@/styles/public.scss";
@import "./index.scss";
</style>