<template>
  <div>
    <el-card>
      <el-form :model="inputQuery" label-width="120px">

      </el-form>

      <el-card style="margin: 5px;">
        <el-table :data="detailList" style="width: 100%" border highlight-current-row>
          <el-table-column label="序号" type="index" width="60"></el-table-column>
          <el-table-column label="单据号" prop="orderIdFk"></el-table-column>
          <el-table-column label="UDI码" prop="udiCode"></el-table-column>
          <el-table-column label="标记" prop="mark"></el-table-column>
          <el-table-column label="物资名称" prop="cpmctymc"></el-table-column>
          <el-table-column label="规格型号" prop="ggxh"></el-table-column>
          <el-table-column label="总使用次数" prop="totalCount"></el-table-column>
          <el-table-column label="已使用次数" prop="useCount"></el-table-column>
          <el-table-column label="剩余使用次数" prop="reCount"></el-table-column>
          <el-table-column label="批次号" prop="batchNo"></el-table-column>
          <el-table-column label="生产日期" prop="produceDate"></el-table-column>
          <el-table-column label="失效日期" prop="expireDate"></el-table-column>
          <el-table-column label="创建人" prop="createUserName"></el-table-column>
          <el-table-column label="创建时间" prop="createTime"></el-table-column>
          <el-table-column label="操作" width="120px">
            <template slot-scope="scope">
              <el-button type="text" size="small" @click.native="selected(scope.row)">选入</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-card>

    </el-card>
  </div>
</template>

<script>
import {getLocalJoinByUser} from "@/api/basic/busType";
import {filterSubAll} from "@/api/system/invSubWarehouse";
import {selectCorpList} from "@/api/basic/basicUnitMaintain"
import {addMuti, filterMutiDetailList, updateMuti} from "@/api/inout/orderMuti";

export default {
  name: "ioOrderMutiEditSelectDialog",
  props: {
    closeDialogDelect: {
      type: Function,
      required: true,
    },
    filterQuery: {
      type: Object,
      required: true,
    },
  },
  data() {
    return {
      detailList: [],
      inputQuery: {
        udiCode: null,
        orderIdFk: null,
        mark: null,
        cpmctymc: null,
        ggxh: null,
        totalCount: null,
        useCount: null,
        supId: null,
      },
    }
  },
  methods: {

    selected(row){
      this.closeDialogDelect(row);
    },
    getList() {
      this.inputQuery.mark=""
      filterMutiDetailList(this.inputQuery).then((response) => {
        if (response.code == 20000) {
           this.detailList=response.data;
        } else {
          this.$message.error(response.message);
        }
      })
    },
    submitInv() {
      if (this.formName == 1) {
        addMuti(this.inputQuery).then((response) => {
          if (response.code == 20000) {
            this.closeDialog();
          } else {
            this.$message.error(response.message);
          }

        })
          .catch(() => {
            this.$message.error("添加失败");
          });
      } else {
        updateMuti(this.inputQuery).then((response) => {
          if (response.code == 20000) {
            this.closeDialogDelect();
          } else {
            this.$message.error(response.message);
          }

        })
          .catch(() => {
            this.$message.error("添加失败");
          });
      }
    },

  },
  components: {},
  created() {
    this.inputQuery = this.filterQuery
    this.getList();
  },
}
</script>

<style scoped>

</style>
