<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <div v-if="crud.props.searchToggle">
        <!-- 搜索 -->
        <el-input v-model="query.xingming" clearable placeholder="姓名" style="width: 200px" class="filter-item" @keyup.enter.native="crud.toQuery" />
        <date-range-picker v-model="query.crrq" class="date-item" />
        <rrOperation />
      </div>
      <crudOperation :permission="permission" />
    </div>
    <!--表单组件-->
    <el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="100%" hight="100%">
      <el-form ref="form" :disabled="crud.status.CHECK" :model="form" :rules="rules" size="small" label-width="130px">
        <el-row :gutter="20">
          <el-col :span="8">
            <div class="grid-content bg-purple">
              <el-form-item label="证件类型" prop="zjlx">
                <el-input v-model="form.zjlx" style="width: 370px" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-content bg-purple-light">
              <el-form-item label="证件号码" prop="zjhm">
                <el-input v-model="form.zjhm" style="width: 370px" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-content bg-purple">
              <el-form-item label="状态" prop="status">
                <el-input v-model="form.status" type="textarea" style="width: 370px" />
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <div class="grid-content bg-purple">
              <el-form-item label="姓名" prop="xingming">
                <el-input v-model.number="form.xingming" style="width: 370px;" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="8">
            <el-form-item label="插入日期" prop="crrq">
              <el-input v-model.number="form.crrq" style="width: 370px;" />
            </el-form-item>
            <div class="grid-content bg-purple-light" />
          </el-col>
        </el-row>
        <el-divider content-position="left">返回参数</el-divider>
        <el-row :gutter="20">
          <el-col :span="8">
            <div class="grid-content bg-purple">
              <el-form-item label="开户中心编号" prop="KHZXBH">
                <el-input v-model="form.KHZXBH" style="width: 370px" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-content bg-purple-light">
              <el-form-item label="开户中心名称" prop="KHZXMC">
                <el-input v-model="form.KHZXMC" style="width: 370px" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-content bg-purple">
              <el-form-item label="单位账号" prop="DWZH">
                <el-input v-model="form.DWZH" style="width: 370px" />
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <div class="grid-content bg-purple">
              <el-form-item label="个人账号" prop="GRZH">
                <el-input v-model="form.GRZH" style="width: 370px" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-content bg-purple-light">
              <el-form-item label="个人账户状态" prop="GRZHZT">
                <el-input v-model="form.GRZHZT" style="width: 370px" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-content bg-purple">
              <el-form-item label="数据插入日期" prop="CRRQ">
                <el-input v-model="form.CRRQ" style="width: 370px" />
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <div class="grid-content bg-purple">
              <el-form-item label="报文返回日期" prop="ZXZWRQ">
                <el-input v-model="form.ZXZWRQ" style="width: 370px" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-content bg-purple-light">
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-content bg-purple">
            </div>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer" style="text-align: center">
        <el-button type="primary" size="medium" @click="crud.cancelCU">确认</el-button>
      </div>
    </el-dialog>
    <!--表格渲染-->
    <el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%" @selection-change="crud.selectionChangeHandler">
      <el-table-column v-if="checkPer(['admin','serverDeploy:check'])" label="操作" width="150px" align="center">
        <template slot-scope="scope">
          <Retrieve
            :data="scope.row"
            :queryList="queryList"
            :permission="permission"
          />
        </template>
      </el-table-column>
      <!--            <el-table-column type="selection" width="55" />-->
      <el-table-column prop="zjlx" label="证件类型" />
      <el-table-column prop="zjhm" label="证件号码" />
      <el-table-column prop="status" label="状态" />
      <el-table-column prop="xingming" label="姓名" />
      <el-table-column prop="crrq" label="插入日期" />
    </el-table>
    <!--分页组件-->
    <pagination />
  </div>
</template>

<script>

import { testServerConnect } from '@/api/mnt/connect'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker'
import crudOperation from '@crud/CRUD.operation'
import Retrieve from "@crud/Retrieve";
const defaultForm = { id: null, name: null, ip: null, port: 22, account: 'root', password: null }
export default {
  name: 'Jczlcx',
  components: {Retrieve, pagination, rrOperation, udOperation, DateRangePicker, crudOperation },
  cruds() {
    return CRUD({
      title: '缴存总览详情',
      url: 'api/JczlcxController',
      optShow: {
        add: false,
        edit: false,
        del: false,
        download: false,
        reset: true
      },
    })
  },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  data() {
    return {
      //明细请求参数
      queryList: {
        status:true,
        url:"api/JczlcxController/QueryJczlcxFhmx",
        id:""
      },
      // currView: 'index',
      accountList: [],
      accountMap: {},
      loading: false,
      permission: {},
      // 规则验证
      rules: {
        Demo: [
          { required: true, message: '请输入Demo', trigger: 'blur' }
        ]
      }
    }
  },
  methods: {
    testConnectServer() {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          this.loading = true
          testServerConnect(this.form).then((res) => {
            this.loading = false
            this.$notify({
              title: res ? '连接成功' : '连接失败',
              type: res ? 'success' : 'error',
              duration: 2500
            })
          }).catch(() => {
            this.loading = false
          })
        }
      })
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
  text-align: left;
}
</style>
