123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <template>
- <div class="subPage">
- <div class="system-table-search">
- <div class="flex-h">
- <div class="flex-item flex-h">
- <!-- <el-button size="mini" type="success" @click="addGoodsType">新增商品类型</el-button> -->
- </div>
- <ul>
- <li>
- <!-- <span>选择案场:</span> -->
- <el-select v-model="CaseId" placeholder="请选择">
- <el-option
- key=""
- label="所有案场"
- value="">
- </el-option>
- <el-option
- v-for="item in cases"
- :key="item.CaseId"
- :label="item.CaseName"
- :value="item.CaseId">
- </el-option>
- </el-select>
- </li>
- <li>
- <el-input
- placeholder="请输入用户名"
- v-model="name"
- >
- </el-input>
- </li>
- <li>
- <el-input
- placeholder="请输入手机号"
- v-model="mobile"
- >
- </el-input>
- </li>
- </ul>
- <el-button
- size="mini"
- type="primary" @click="search">搜索</el-button>
- </div>
- <div class="moreFilter"></div>
- </div>
- <div class="system-table-box">
- <el-table
- :data="currentList"
- stripe
- style="width: 100%">
- <el-table-column
- prop="CaseName"
- label="案场">
- </el-table-column>
- <el-table-column
- prop="CustomerName"
- label="用户名">
- </el-table-column>
- <el-table-column
- prop="Phone"
- label="手机号">
- </el-table-column>
- <el-table-column
- prop="Sex"
- label="性别">
- </el-table-column>
- <el-table-column
- label="检测时间">
- <template slot-scope="scope">
- <label>{{toolClass.dateFormat(scope.row.CreateDate)}}</label>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <el-pagination
- @current-change="handleCurrentChange"
- :current-page.sync="postData.page"
- :page-size="postData.pagesize"
- layout="prev, pager, next, jumper"
- :total="total">
- </el-pagination>
- </div>
- </template>
-
- <script>
- import { mapState, createNamespacedHelpers } from 'vuex'
- const { mapState: mapHealthState, mapActions: mapHealthActions } = createNamespacedHelpers('health')
-
- export default {
- name: '',
- data () {
- return {
- total: 0,
- name: '',
- mobile: '',
- postData: { // 表格搜索条件
- caseid: '',
- page: 1, // 当前页码
- pagesize: 10, // 请求数据量
- },
- currentList: []
- }
- },
- mounted () {
- this.$nextTick(function () {
- this.getList()
- })
- },
- computed: {
- ...mapState({
- cases: x => x.app.cases.list,
- defaultCaseId: x => x.app.cases.default
- }),
- ...mapHealthState({
- list: x => x.healthList
- }),
- CaseId: {
- get () {
- return this.postData.caseid || this.defaultCaseId
- },
- set (val) {
- this.postData.caseid = val
- }
- }
- },
- methods: {
- ...mapHealthActions(['getHealthList']),
- search () { // 搜索
- this.postData.page = 1
- this.currentList = []
- this.getList()
- },
- getCaseName (caseid) {
- return (this.cases.filter(x => x.CaseId === caseid)[0] || {}).CaseName
- },
- getList () { // 获取列表
- this.getHealthList({ ...this.postData, caseid: this.CaseId, phone: this.mobile, name: this.name }).then((res) => {
- this.currentList = this.list.list
- this.postData.page = this.list.page
- this.total = this.list.pagenum
- })
- },
- handleCurrentChange (val) { // 跳转到分页
- this.getList()
- }
- }
- }
- </script>
-
- <!-- Add "scoped" attribute to limit CSS to this component only -->
- <style lang="scss" scoped>
- </style>
|