<template>
    <!-- 新购绑定页面 -->
    <div class="app-container">
        <PageHeader
          v-if="isShowComponent !== 'Index'"
          :pageContent="pageContent"
          @goBack="goBack"
        />
        <!-- 列表 -->
        <TableModel
          :formLabel="formLabel"
          :columnsList="columnsList"
          :request-api="queryPurchaseBindDetailsApi"
          :sendParams="sendParams"
          ref="tableRef"
          v-if="isShowComponent === 'Index'"
        >


        <template slot="handle" slot-scope="{ data }">
           <el-button
               type="primary"
               size="mini"
               @click="handleEditData(data)"
            >绑定</el-button>
        </template>

           <template slot="purchaseNum" slot-scope="{ data }">
                     {{ data.purchaseNum / 1000 }}
           </template>

          <template slot="checkNum" slot-scope="{ data }">
                    {{data.checkNum / 1000}}
          </template>

           <template slot="bindNum" slot-scope="{ data }">
                    {{data.bindNum / 1000}}
           </template>

      </TableModel>

    </div>
</template>

<script>
import PageHeader from '@/components/pageHeader'
import { columnsList, dialogConfig, formLabel } from '../config-bind-list'
import { commonMixin } from '../../mixins/common'

import {
  queryPurchaseBindDetailsApi
} from '@/api/purchase/binding'

export default {
    name: 'arrivalBindingManage',
    mixins: [commonMixin], // 混入公共方法和数据
    components: {  PageHeader },
    props:{
      sendParams: {
        type: Object,
        default: () => null,
      }
    },
    created() {
      console.log(this.sendParams,'this.sendParams')
    },
    methods: {
      queryPurchaseBindDetailsApi,
      goBack() {
        this.isShowComponent = 'Index'
      }

    },
    data() {
        return {
            formLabel,
            columnsList,
            dialogConfig,
            isShowComponent: 'Index',
            pageContent: '新购绑定物资列表',
            sendData: undefined
        }
    },
}
</script>
