<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <!--如果想在工具栏加入更多按钮，可以使用插槽方式， slot = 'left' or 'right'-->
      <crudOperation :permission="permission" />
      <!--表单组件-->
      <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
        <el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
          <el-form-item label="物料标志">
            <el-input v-model="form.material_id" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="物料编码">
            <el-input v-model="form.material_code" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="物料名称 ">
            <el-input v-model="form.material_name" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="产品编号">
            <el-input v-model="form.product_code" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="A长边">
            <el-input v-model="form.AlongSide" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="B短边">
            <el-input v-model="form.BshortSide" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="H梯形高">
            <el-input v-model="form.Htrapezoidal" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="W厚度">
            <el-input v-model="form.Wthickness" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="当前垛盘数">
            <el-input v-model="form.tray_qty" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="垛盘高度">
            <el-input v-model="form.tray_high" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="垛型类别">
            <el-input v-model="form.crib_category" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码垛X1行">
            <el-input v-model="form.palletX1_line" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码垛Y1列">
            <el-input v-model="form.palletY1_row" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码垛A1角度">
            <el-input v-model="form.palletA1_angle" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码垛X2行">
            <el-input v-model="form.palletX2_line" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码垛Y2列">
            <el-input v-model="form.palletY2_row" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码垛A2角度">
            <el-input v-model="form.palletA2_angle" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码垛X3行">
            <el-input v-model="form.palletX3_line" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码垛Y3列">
            <el-input v-model="form.palletY3_row" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码垛A3角度">
            <el-input v-model="form.palletA3_angle" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压垛X1行">
            <el-input v-model="form.pressCribX1_line" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压垛Y1列">
            <el-input v-model="form.pressCribY1_row" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压垛A1角度">
            <el-input v-model="form.pressCribA1_angle" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压垛X2行">
            <el-input v-model="form.pressCribX2_line" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压垛Y2列">
            <el-input v-model="form.pressCribY2_row" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压垛A2角度">
            <el-input v-model="form.pressCribA2_angle" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压垛X3行">
            <el-input v-model="form.pressCribX3_line" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压垛Y3列">
            <el-input v-model="form.pressCribY3_row" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压垛A3角度">
            <el-input v-model="form.pressCribA3_angle" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="Z轴偏移">
            <el-input v-model="form.Zoffset" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码垛层数">
            <el-input v-model="form.pallet_layerQty" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压垛层数">
            <el-input v-model="form.pressCrib_layerQty" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码层X1间隔">
            <el-input v-model="form.codeLayerX1_interval" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码层Y1间隔">
            <el-input v-model="form.codeLayerY1_interval" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码层X2间隔">
            <el-input v-model="form.codeLayerX2_interval" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码层Y2间隔">
            <el-input v-model="form.codeLayerY2_interval" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码层X3间隔">
            <el-input v-model="form.codeLayerX3_interval" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码层Y3间隔">
            <el-input v-model="form.codeLayerY3_interval" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码层X1偏移">
            <el-input v-model="form.codeLayerX1_offset" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码层Y1偏移">
            <el-input v-model="form.codeLayerY1_offset" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码层X2偏移">
            <el-input v-model="form.codeLayerX2_offset" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码层Y2偏移">
            <el-input v-model="form.codeLayerY2_offset" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码层X3偏移">
            <el-input v-model="form.codeLayerX3_offset" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="码层Y3偏移">
            <el-input v-model="form.codeLayerY3_offset" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压层X1间隔">
            <el-input v-model="form.pressLayerX1_interval" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压层Y1间隔">
            <el-input v-model="form.pressLayerY1_interval" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压层X2间隔">
            <el-input v-model="form.pressLayerX2_interval" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压层Y2间隔">
            <el-input v-model="form.pressLayerY2_interval" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压层X3间隔">
            <el-input v-model="form.pressLayerX3_interval" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压层Y3间隔">
            <el-input v-model="form.pressLayerY3_interval" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压层X1偏移">
            <el-input v-model="form.pressLayerX1_offset" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压层Y1偏移">
            <el-input v-model="form.pressLayerY1_offset" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压层X2偏移">
            <el-input v-model="form.pressLayerX2_offset" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压层Y2偏移">
            <el-input v-model="form.pressLayerY2_offset" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压层X3偏移">
            <el-input v-model="form.pressLayerX3_offset" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="压层Y3偏移">
            <el-input v-model="form.pressLayerY3_offset" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="1#垛总数">
            <el-input v-model="form.one_cribTotal" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="2#垛总数">
            <el-input v-model="form.two_cribTotal" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="1#垛当前数">
            <el-input v-model="form.one_qty" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="2#垛当前数">
            <el-input v-model="form.two_qty" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="工具坐标">
            <el-input v-model="form.tool_coordinate" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="组盘人">
            <el-input v-model="form.create_id" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="组盘人姓名">
            <el-input v-model="form.create_name" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="组盘时间">
            <el-input v-model="form.create_time" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="修改人">
            <el-input v-model="form.update_optid" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="修改人姓名">
            <el-input v-model="form.update_optname" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="修改时间">
            <el-input v-model="form.update_time" style="width: 370px;" />
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button type="text" @click="crud.cancelCU">取消</el-button>
          <el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
        </div>
      </el-dialog>
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column prop="material_id" label="物料标志" />
        <el-table-column prop="material_code" label="物料编码" />
        <el-table-column prop="material_name" label="物料名称 " />
        <el-table-column prop="product_code" label="产品编号" />
        <el-table-column prop="AlongSide" label="A长边" />
        <el-table-column prop="BshortSide" label="B短边" />
        <el-table-column prop="Htrapezoidal" label="H梯形高" />
        <el-table-column prop="Wthickness" label="W厚度" />
        <el-table-column prop="tray_qty" label="当前垛盘数" />
        <el-table-column prop="tray_high" label="垛盘高度" />
        <el-table-column prop="crib_category" label="垛型类别" />
        <el-table-column prop="palletX1_line" label="码垛X1行" />
        <el-table-column prop="palletY1_row" label="码垛Y1列" />
        <el-table-column prop="palletA1_angle" label="码垛A1角度" />
        <el-table-column prop="palletX2_line" label="码垛X2行" />
        <el-table-column prop="palletY2_row" label="码垛Y2列" />
        <el-table-column prop="palletA2_angle" label="码垛A2角度" />
        <el-table-column prop="palletX3_line" label="码垛X3行" />
        <el-table-column prop="palletY3_row" label="码垛Y3列" />
        <el-table-column prop="palletA3_angle" label="码垛A3角度" />
        <el-table-column prop="pressCribX1_line" label="压垛X1行" />
        <el-table-column prop="pressCribY1_row" label="压垛Y1列" />
        <el-table-column prop="pressCribA1_angle" label="压垛A1角度" />
        <el-table-column prop="pressCribX2_line" label="压垛X2行" />
        <el-table-column prop="pressCribY2_row" label="压垛Y2列" />
        <el-table-column prop="pressCribA2_angle" label="压垛A2角度" />
        <el-table-column prop="pressCribX3_line" label="压垛X3行" />
        <el-table-column prop="pressCribY3_row" label="压垛Y3列" />
        <el-table-column prop="pressCribA3_angle" label="压垛A3角度" />
        <el-table-column prop="Zoffset" label="Z轴偏移" />
        <el-table-column prop="pallet_layerQty" label="码垛层数" />
        <el-table-column prop="pressCrib_layerQty" label="压垛层数" />
        <el-table-column prop="codeLayerX1_interval" label="码层X1间隔" />
        <el-table-column prop="codeLayerY1_interval" label="码层Y1间隔" />
        <el-table-column prop="codeLayerX2_interval" label="码层X2间隔" />
        <el-table-column prop="codeLayerY2_interval" label="码层Y2间隔" />
        <el-table-column prop="codeLayerX3_interval" label="码层X3间隔" />
        <el-table-column prop="codeLayerY3_interval" label="码层Y3间隔" />
        <el-table-column prop="codeLayerX1_offset" label="码层X1偏移" />
        <el-table-column prop="codeLayerY1_offset" label="码层Y1偏移" />
        <el-table-column prop="codeLayerX2_offset" label="码层X2偏移" />
        <el-table-column prop="codeLayerY2_offset" label="码层Y2偏移" />
        <el-table-column prop="codeLayerX3_offset" label="码层X3偏移" />
        <el-table-column prop="codeLayerY3_offset" label="码层Y3偏移" />
        <el-table-column prop="pressLayerX1_interval" label="压层X1间隔" />
        <el-table-column prop="pressLayerY1_interval" label="压层Y1间隔" />
        <el-table-column prop="pressLayerX2_interval" label="压层X2间隔" />
        <el-table-column prop="pressLayerY2_interval" label="压层Y2间隔" />
        <el-table-column prop="pressLayerX3_interval" label="压层X3间隔" />
        <el-table-column prop="pressLayerY3_interval" label="压层Y3间隔" />
        <el-table-column prop="pressLayerX1_offset" label="压层X1偏移" />
        <el-table-column prop="pressLayerY1_offset" label="压层Y1偏移" />
        <el-table-column prop="pressLayerX2_offset" label="压层X2偏移" />
        <el-table-column prop="pressLayerY2_offset" label="压层Y2偏移" />
        <el-table-column prop="pressLayerX3_offset" label="压层X3偏移" />
        <el-table-column prop="pressLayerY3_offset" label="压层Y3偏移" />
        <el-table-column prop="one_cribTotal" label="1#垛总数" />
        <el-table-column prop="two_cribTotal" label="2#垛总数" />
        <el-table-column prop="one_qty" label="1#垛当前数" />
        <el-table-column prop="two_qty" label="2#垛当前数" />
        <el-table-column prop="tool_coordinate" label="工具坐标" />
        <el-table-column prop="create_id" label="组盘人" />
        <el-table-column prop="create_name" label="组盘人姓名" />
        <el-table-column prop="create_time" label="组盘时间" />
        <el-table-column prop="update_optid" label="修改人" />
        <el-table-column prop="update_optname" label="修改人姓名" />
        <el-table-column prop="update_time" label="修改时间" />
        <el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
          <template slot-scope="scope">
            <udOperation
              :data="scope.row"
              :permission="permission"
            />
          </template>
        </el-table-column>
      </el-table>
      <!--分页组件-->
      <pagination />
    </div>
  </div>
</template>

<script>
import crudCribbinginfo from '@/api/cribbinginfo'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'

const defaultForm = { info_id: null, material_id: null, material_code: null, material_name: null, material_spec: null, product_code: null, AlongSide: null, BshortSide: null, Htrapezoidal: null, Wthickness: null, tray_qty: null, tray_high: null, crib_category: null, palletX1_line: null, palletY1_row: null, palletA1_angle: null, palletX2_line: null, palletY2_row: null, palletA2_angle: null, palletX3_line: null, palletY3_row: null, palletA3_angle: null, pressCribX1_line: null, pressCribY1_row: null, pressCribA1_angle: null, pressCribX2_line: null, pressCribY2_row: null, pressCribA2_angle: null, pressCribX3_line: null, pressCribY3_row: null, pressCribA3_angle: null, Zoffset: null, pallet_layerQty: null, pressCrib_layerQty: null, codeLayerX1_interval: null, codeLayerY1_interval: null, codeLayerX2_interval: null, codeLayerY2_interval: null, codeLayerX3_interval: null, codeLayerY3_interval: null, codeLayerX1_offset: null, codeLayerY1_offset: null, codeLayerX2_offset: null, codeLayerY2_offset: null, codeLayerX3_offset: null, codeLayerY3_offset: null, pressLayerX1_interval: null, pressLayerY1_interval: null, pressLayerX2_interval: null, pressLayerY2_interval: null, pressLayerX3_interval: null, pressLayerY3_interval: null, pressLayerX1_offset: null, pressLayerY1_offset: null, pressLayerX2_offset: null, pressLayerY2_offset: null, pressLayerX3_offset: null, pressLayerY3_offset: null, one_cribTotal: null, two_cribTotal: null, one_qty: null, two_qty: null, tool_coordinate: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null }
export default {
  name: 'Cribbinginfo',
  components: { pagination, crudOperation, rrOperation, udOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '基础垛形参数', url: 'api/cribbinginfo', idField: 'info_id', sort: 'info_id,desc', crudMethod: { ...crudCribbinginfo }})
  },
  data() {
    return {
      permission: {
      },
      rules: {
      }    }
  },
  methods: {
    // 钩子：在获取表格数据之前执行，false 则代表不获取数据
    [CRUD.HOOK.beforeRefresh]() {
      return true
    }
  }
}
</script>

<style scoped>

</style>
