schangxiang@126.com
2025-09-19 9be9c3784b2881a3fa25e93ae2033dc2803c0ed0
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
 
<template>
  <div class="page-list-container">
    <!--数据Table-->
    <yrt-data-list :ref="dataListRef" :editor-ref="editorRef" :data-options="dataOptions" :fields.sync="dataListOptions.fields" :buttons="dataListOptions.buttons" :button-click="buttonClick" :data-list-selections.sync="dataListSelections" :auth-nodes="authNodes">
      <template slot="common-column-slot" slot-scope="{row, col}">
        <template v-if="col.prop=='StatusText'">
          <template>
            <el-tag v-if="row[col.prop]=='已审核'" color="#33cc33" style="color:white;border:0">
              {{ row[col.prop] }}
            </el-tag>
            <el-tag v-else color="#ffff99" style="color:#888;">
              {{ row[col.prop] }}
            </el-tag>
          </template>
        </template>
        <template v-else>
          {{ row[col.prop] }}
        </template>
      </template>
    </yrt-data-list>
 
    <!--数据编辑器Editor-->
    <yrt-editor :ref="editorRef" :data-list-ref="dataListRef" v-bind="editorOptions" :data-options="dataOptions" :action.sync="editorOptions.action" :top.sync="editorOptions.top" :visible.sync="editorOptions.config.visible" :detail-button-click="detailButtonClick" :auth-nodes="authNodes">
 
      <!--自定义按钮插槽-->
      <template slot="footer-button-region" slot-scope="{ formData }">
        <!--自定义审核按钮-->
        <el-button type="success" icon="el-icon-yrt-gouxuan1" @click.native="singleAuditing(formData)">审核</el-button>
      </template>
    </yrt-editor>
 
    <!--明细选择器-->
    <shelve-create ref="create-dialog" :visible.sync="shelverVisible" @closed="closesdialog"></shelve-create>
  </div>
</template>
<script>
import baseLayout from "@/components/common/base-layout.vue";
import shelveCreate from "./components/shelve-create.vue";
export default {
  name: "inbound-purchase-create-shelve",
  components: {
    shelveCreate
  },
  mixins: [baseLayout],
  data() {
    return {
      shelverVisible: false
    };
  },
  methods: {
    // 列表页面按钮点击事件
    buttonClick(authNode) {
      switch (authNode) {
        case "auditing":
          // 批量审核
          this.multiAuditing();
          break;
        case "createShelve":
          // 生成上架单
          this.createShelve();
          break;
      }
    },
    // 生成上架单
    createShelve() {
      const enterList_Ids = [];
      const length = this.dataList.dataListSelections.length;
      if (length > 0) {
        this.dataList.dataListSelections.forEach(rows => {
          enterList_Ids.push(rows.enterList_Id);
        });
        this.$refs["create-dialog"].addwhere(enterList_Ids);
      }
 
      this.shelverVisible = true;
    },
    // 子页面返回刷新主页面数据
    closesdialog() {
      const ref = this.dataList;
      ref.loadData();
    }
  }
};
</script>