bill-form.vue 1.56 KB
Newer Older
wangcong committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
<template>
  <Modal class-name="file-modal" v-model="modalShow"
    :mask-closable="false"
    :fullscreen="true" 
    :title="title">
    <div style="overflow: auto">
      <gms-bill-form
        :templateName="billtemplate"
        :id="billId"
        type="load"
        state="readOnly"
        v-if="init"
      ></gms-bill-form>
    </div>
    <div slot="footer">
      <Button @click="modalShow = false">关闭</Button>
      <Button @click="updateBatch" type="primary">已阅</Button>
    </div>
  </Modal>
</template>
<script>
export default {
  props: {
    title: {
      type: String,
      default: "单据详情"
    },
    billDefine: {
      type: String,
      default: ""
    },
    billId: {
      type: String,
      default: ""
    },
    id: {
      type: String,
      default: ""
    },
    billtemplate:{
      type: String,
      default: ""
    }
  },
  computed: {},
  filters: {},
  watch: {
    id: {
      handler(newVal, oldVal) {
        this.modalShow = newVal?true:false;
        this.init = false;
        this.$nextTick(() => {
          this.init = true;
        });
      },
    },
  },
  data() {
    return {
      modalShow:false,
      init:false,
    };
  },
  methods: {
    updateBatch(){
      let arr=[
        { 
          billDefine:this.billDefine,
          id:this.id,
          readState:1// 0 是未阅  1 是已阅读
        }
      ]
      this.$emit("updateBatch",arr);
      this.modalShow = false;
      this.init = false;
    }
  },
};
</script>
<style lang="less" scoped>
.table {
  .pageClass {
    margin: 10px;
  }
}
</style>