<template>
  <el-dialog
    title="点位详情"
    append-to-body
    fullscreen
    :visible.sync="dialogVisible"
    @open="open"
    @close="close"
  >
    <el-card class="box-card" shadow="never">
      <div slot="header" class="clearfix">
        <span style="font-weight: bold;font-size: 15px;">点位信息:</span>
        <!--        <el-button style="float: right; padding: 3px 10px;" type="text">操作按钮</el-button>-->
      </div>
      <el-form ref="form" disabled :inline="true" :model="form" :rules="rules" size="mini" label-width="100px">
        <el-form-item label="区域编码">
          <el-input v-model="form.region_code" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="区域名称">
          <el-input v-model="form.region_name" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="点位编码">
          <el-input v-model="form.point_code" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="点位名称">
          <el-input v-model="form.point_name" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="点位类型">
          <el-input v-model="form.point_type_name" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="点位状态">
          <el-input v-model="form.point_status_name" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="载具类型">
          <el-input v-model="form.vehicle_type" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="载具编码">
          <el-input v-model="form.vehicle_code" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="载具数量">
          <el-input v-model="form.vehicle_qty" style="width: 200px;" />
        </el-form-item>

      </el-form>
    </el-card>

    <el-card class="box-card" shadow="always">
      <div slot="header" class="clearfix">
        <span style="font-weight: bold;font-size: 15px;">库存信息:</span>
        <!--        <el-button style="float: right; padding: 3px 10px;" type="text">操作按钮</el-button>-->
      </div>
      <el-form ref="form" disabled :inline="true" :model="groups" :rules="rules" size="mini" label-width="100px">
        <el-form-item label="物料编码">
          <el-input v-model="groups.material_code" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="物料名称">
          <el-input v-model="groups.material_name" style="width: 200px;" />
        </el-form-item>

        <el-form-item label="物料规格">
          <el-input v-model="groups.material_spec" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="物料批次">
          <el-input v-model="groups.pcsn" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="物料数量">
          <el-input v-model="groups.material_qty" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="物料重量">
          <el-input v-model="groups.material_weight" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="设备">
          <el-input v-model="groups.point_name" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="入库时间">
          <el-input v-model="groups.instorage_time" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="静置时间(分)">
          <el-input v-model="groups.standing_time" style="width: 200px;" />
        </el-form-item>
        <el-form-item label="绑定状态">
          <el-input v-model="groups.group_bind_material_status_name" style="width: 200px;" />
        </el-form-item>
      </el-form>
    </el-card>
  </el-dialog>
</template>

<script>
import crudGroupVehicle from '@/views/wms/sch/group/schBaseVehiclematerialgroup'
import { crud } from '@crud/crud'

export default {
  name: 'ViewDialog',
  components: {},
  dicts: ['group_bind_material_status'],
  mixins: [crud()],
  props: {
    dialogShow: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      dialogVisible: false,
      classes3: [],
      parentData: {},
      form: {
        point_code: null,
        point_name: null,
        region_code: null,
        region_name: null,
        point_type: null,
        point_status: null,
        can_material_type: null,
        can_vehicle_type: null,
        vehicle_max_qty: null,
        vehicle_type: null,
        vehicle_code: null,
        vehicle_qty: 0,
        block_num: null,
        row_num: null,
        col_num: null,
        layer_num: null,
        in_order_seq: null,
        out_order_seq: null,
        in_empty_seq: null,
        out_empty_seq: null,
        parent_point_code: null,
        ext_point_code: null,
        ing_task_code: null,
        is_has_workder: 'true',
        workshop_code: null,
        is_auto: 'true',
        remark: null,
        is_used: 'true',
        can_vehicle_types: null
      },
      groups: {
        group_id: null,
        vehicle_code: null,
        material_id: null,
        child_vehicle_code: null,
        source_vehicle_code: null,
        point_code: null,
        point_name: null,
        is_full: true,
        pcsn: null,
        instorage_time: null,
        standing_time: null,
        material_qty: null,
        material_weight: null,
        workorder_code: null,
        group_number: null,
        task_code: null,
        ext_data: null,
        workshop_code: null,
        group_status: null,
        table_name: null,
        group_bind_material_status_name: null,
        table_fk: null,
        table_fk_id: null,
        buss_move_id: null,
        is_first_flow_task: true,
        flow_code: null,
        flow_num: null,
        before_task_code: null,
        next_task_code: null,
        remark: null,
        is_delete: false
      },
      workprocedureList: [],
      tableData: [],
      rules: {}
    }
  },
  watch: {
    dialogShow: {
      handler(newValue) {
        this.dialogVisible = newValue
      }
    }
  },
  methods: {
    open() {

    },
    close() {
      this.$emit('AddChanged')
    },
    setParentData(parentData) {
      if (parentData) {
        console.log(parentData)
        this.dialogVisible = true
        this.form = parentData
        // 根据载具编码获取信息
        const param = {
          vehicle_code: parentData.vehicle_code,
          vehicle_type: parentData.vehicle_type
        }
        crudGroupVehicle.getGroup(param).then(res => {
          this.groups = res
        })
      }
    }
  }
}
</script>

<style scoped>
::v-deep .el-card__header {
  padding: 5px 0 5px 10px;
  background-color: #f8f8f9;
}
::v-deep .el-card__body {
  padding: 10px 0 10px 0;
}
</style>
