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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<template>
  <div :ref="'settings'" class="settings-sub-container">
    <el-form ref="form" v-model="formData" label-width="350px">
      <h2 class="sub-title">库存操作设置</h2>
      <el-form-item label="库存补货单分拣时不区分货主,跨货主分拣">
        <el-switch :active-value="1" :inactive-value="0" v-model="formData.storage_crossConsignor"></el-switch>
      </el-form-item>
      <h2 class="sub-title">调拨操作设置</h2>
      <el-form-item label="调入RSL锁定库存">
        <el-switch :active-value="1" :inactive-value="0" v-model="formData.in_updateProductInfo"></el-switch>
      </el-form-item>
      <el-form-item label="RSL入库完成解锁库存">
        <el-switch :active-value="1" :inactive-value="0" v-model="formData.storage_unLockAfterFinish"></el-switch>
      </el-form-item>
      <el-form-item class="form-footer">
        <el-button type="primary" @click="onSave">保存</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
 
<script>
export default {
  name: "settings-consignor",
 
  components: {},
  data() {
    return {
      type_Id: 585, // 通用参数类别ID,不可修改
      // 编辑数据对象
      formData: {
        Storage_ReplenishmentCrossConsignor: 0,
        Storage_LockAfterFinish: 0,
        storage_unLockAfterFinish: 0
      },
      // 接口数据
      valueList: []
    };
  },
  mounted() {
    this.loadParam();
  },
  methods: {
    handleClose(tag) {},
 
    // 加载数据
    loadParam() {
      var keys = Object.keys(this.formData).join(",");
      var url = "/api/sys/param/getConfig";
      var params = {
        openNodeApi: true,
        type_Id: this.type_Id,
        keys: keys
      };
      var callback = res => {
        this.common.showMsg(res);
        this.valueList = res.data;
 
        // 获得参数值列表,将数字转换为对象
        res.data.forEach(item => {
          var value03 = item.value03;
          if (this.common.isNumber(item.value03)) {
            value03 = parseInt(item.value03);
          }
          this.$set(this.formData, item.value02, value03);
        });
      };
      var target = this.$refs["settings"];
      this.common.ajax(url, params, callback, target);
    },
    // 保存数据
    onSave() {
      Object.keys(this.formData).forEach(key => {
        var item = this.valueList.find(item => {
          return item.value02 === key;
        });
        if (item) {
          item.value03 = this.formData[key];
        } else {
          this.valueList.push({
            type_Id: this.type_Id,
            value02: key,
            value03: this.formData[key]
          });
        }
      });
 
      var url = "/api/sys/param/saveParams";
      var params = {
        openNodeApi: true,
        type_Id: this.type_Id,
        valueList: this.valueList
      };
      var target = this.$refs["settings"];
      this.common.ajax(
        url,
        params,
        res => {
          this.common.showMsg(res);
        },
        target
      );
    }
  }
};
</script>
 
<style lang="scss" scoped>
.settings-sub-container {
  /deep/ .sub-title {
    font-size: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ebeef5;
    padding-top: 20px;
    margin-bottom: 10px;
  }
  /deep/ .el-form-item__label {
    font-weight: normal;
  }
  .remark {
    color: #888;
  }
  /deep/ .el-form-item {
    margin-bottom: 0px;
  }
  .form-footer {
    margin-top: 30px;
  }
}
</style>