<template>
    <div class="auto">

            <header slot="modal-header" class="modal-header">
               <center> <h4 class="modal-title" >明细列表</h4></center>
            </header>

            <article slot="modal-body" class="list_area table_sy" >
                <data-grid  :model="model" partial='list' v-ref:grid>
                    <template partial='head'>
                        <tr>
                            <th>序号</th>
                            <th>计费项目</th>
                            <th>品名</th>
                            <th>型号</th>
                            <th>单位</th>
                            <th>单价</th>
                            <th>工程量</th>
                            <th>核价</th>
                        </tr>
                    </template>
                    <template partial='body'>
                        <td style="text-align:center">{{$index+1}}</td>
                        <td style="text-align:center">{{row.f_brand_spec}}</td>
                        <td style="text-align:center">{{row.f_typename}}</td>
                        <td style="text-align:center">{{row.f_typenumber}}</td>
                        <td style="text-align:center">元</td>
                        <td style="text-align:center">{{row.f_unitprice}}</td>
                        <td style="text-align:center">{{row.f_number}}</td>
                        <td style="text-align:center">{{row.f_number*row.f_unitprice}}</td>
                    </template>
                </data-grid>
            </article>

    </div>
</template>
<script>
    /**
     *综合业务
     *表具启用组件
     */
    import { PagedList } from 'vue-client'
    export default {
      title: '明细查看',
      props: ['data', 'queryshow'],
      data () {
        return {
          model: new PagedList('rs/sql/getshowlist', 30)

        }
      },
      ready () {
        let condition = '1=1'
        if (this.data) {
          condition = `id=${this.data.id}`
        }

        this.model.search(condition)
      },
      watch: {
        'data' () {
          console.log('改变了')
          let condition = '1=1'
          if (this.data) {
            condition = `id=${this.data.id}`
          }

          this.model.search(condition)
        }

      },
      methods: {
        clean () {
                // this.wxshow = false
                // this.show = false
          this.$dispatch('caiclean')
        }
      }
    }
</script>

<style>
</style>
