fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
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
<template>
  <el-dialog :visible.sync="isShow" :title="title" width="800px" :modal-append-to-body="false"
             :close-on-click-modal="false">
    <div class="commodityInfo-style">
      <list-condition-template ref="table" :tableData="tableData" :isShowPage="false">
        <template slot="columns">
          <el-table-column label="商品主编码" prop="spuNum" width="150px" show-overflow-tooltip>
          </el-table-column>
          <el-table-column label="商品名称" prop="spuName" min-width="150px" show-overflow-tooltip>
          </el-table-column>
          <el-table-column label="规格型号" prop="spec" width="100px" show-overflow-tooltip>
          </el-table-column>
          <el-table-column label="单位" prop="unit" width="100px" show-overflow-tooltip>
          </el-table-column>
          <el-table-column label="调拨数量" prop="transferStock" width="100px" show-overflow-tooltip>
          </el-table-column>
        </template>
      </list-condition-template>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button size="mini" @click="isShow = false">关闭</el-button>
    </div>
  </el-dialog>
</template>
 
<script>
export default {
  name: "commodityInfoDialog",
  props: {
    dialogVisible: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      isShow: false,
      tableData: [],
    }
  },
  watch: {
    /**
     * 监控外部显示变量变化
     * 传递到dialog组件
     */
    dialogVisible: function (newShow, oldShow) {
      this.isShow = newShow
    },
    /**
     * 监控内部显示属性变化
     * 传递到外部调用变量
     */
    isShow: function (newDialogShow, oldDialogShow) {
      this.$emit('update:dialogVisible', newDialogShow)
      if (!newDialogShow) {
        this.initData();
      }
    }
  },
  methods: {
    lookInventoryGoods(data) {
      this.tableData = data;
    },
    initData() {
      this.tableData = [];
    }
  }
}
</script>
 
<style lang="scss">
.commodityInfo-style {
  .main-b-style {
    padding: 0 !important;
  }
}
</style>