333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
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
<template>
  <div ref="container" 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" :quick-search-fields="quickSearchFields" :right-width="755" :load-data-before="loadDataBefore" :is-init-load="false">
    </yrt-data-list>
 
    <!--数据编辑器Editor-->
    <yrt-editor :ref="editorRef" :data-list-ref="dataListRef" v-bind="editorOptions" :data-options="dataOptions" :action.sync="editorOptions.action" :visible.sync="editorOptions.config.visible" :detail-button-click="detailButtonClick" :auth-nodes="authNodes"></yrt-editor>
  </div>
</template>
 
<script>
import baseLayout from "@/components/common/base-layout.vue";
var moment = require("moment");
 
export default {
  name: "xstat-storageday",
  components: {},
  mixins: [baseLayout],
  data() {
    return {
      quickSearchFields: [
        {
          label: "出入库时间",
          prop: "storageDay",
          type: "input",
          dataType: "datetime",
          value: []
        }
      ]
    };
  },
  activated() {
    // SaaS模块权限
    this.common.hasSaaSAuth("库存统计", this.$refs.container);
  },
  methods: {
    loadDataBefore(params, searchFields) {
      var dateRange = this.quickSearchFields[0];
      if (dateRange.value.length < 2) {
        this.$message.error("请选择出入库时间时间范围");
        return false;
      }
      var storage = searchFields.find(item => {
        return item.prop === "storageName";
      });
      if (!storage || !storage.value) {
        this.$message.error("请选择仓库名称");
        return false;
      }
      this.common.headers = {
        dateFrom: moment.utc(dateRange.value[0]).format("YYYY-MM-DD"),
        dateTo: moment.utc(dateRange.value[1]).format("YYYY-MM-DD HH:mm:ss"),
        storageId: storage.value
      };
      return true;
    }
  }
};
</script>