<style scoped lang="less">
.scrollable {
  /*height: 700px;*/
  overflow-x: hidden;
}

::-webkit-scrollbar {
  width: 7px;
}

::-webkit-scrollbar-thumb {
  opacity: 0.5;
  border-radius: 3.5px;
  background-color: #888888;
}

.from-second-title {
  height: 16px;
  line-height: 16px;
  margin-left: 24px;
  /*margin: 15px 0;*/
  margin-bottom: 15px;
  padding-left: 4px;
  border-left: 2px solid #3477cb;
}

.title {
  font-family: Microsoft YaHei;
  margin-left: 4px;
  font-size: 14px;
  color: #222222;
  letter-spacing: 0;
  text-align: left;
}
</style>
<template>
  <div class="modal_content">
    <Modal
      v-model="modal_visible"
      title="选择单据"
      @on-cancel="handleCancel"
      :closable="true"
      :mask-closable="false"
      :fullscreen="true"
    >
      <gms-bill-form
        :templateName="selectBill"
        :id="billId"
        :type="billId ? 'load' : 'init'"
        v-if="selectBill"
        ref="copyRefs"
      ></gms-bill-form>
      <div slot="footer" style="height: 0"></div>
    </Modal>
  </div>
</template>

<script>
export default {
  data() {
    return {
      billId: "",
      modal_visible: false,
      bill: null,
      data: {},
      selectBill: "",
    };
  },
  created() {},
  mounted() {},
  props: {},
  methods: {
    getNewBillId() {
      let billdefine=this.bill.curForm.content.billdefine;
      GAMS.Util.invokeServer({
        path: "/gms/bill/newed/" + billdefine,
        type: "GET",
        contentType: "application/json",
      })
        .then(
          function (data, textStatus, response) {
            this.$refs.copyRefs.context.bill.getMasterData().setValue('id', data.content.id ? data.content.id : GAMS.Util.newId());
            this.$refs.copyRefs.context.bill.getMasterData().setValue("billCode",data.content.billCode);
            let tableObj = this.$refs.copyRefs.context.bill.getAllSubData();
            for(let i in tableObj){
              tableObj[i].forEach(element => {
                element.setValue('id', '');
              });
            }
            console.log(tableObj);
          }.bind(this)
        )
        .catch((XMLHttpRequest, textStatus, errorThrown) => {});
    },
    handleCancel() {
      this.modal_visible = false;
    },
  },
  watch: {},
};
</script>
