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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<template>
  <div :ref="'settings'" class="settings-sub-container">
    <el-form ref="form" v-model="formData" label-width="350px">
      <h2 class="sub-title">API接口参数配置</h2>
      <el-form-item label="接受出库单时自动审核成功">
        <el-switch :active-value="1" :inactive-value="0" v-model="formData.api_autoCheck"></el-switch>
      </el-form-item>
      <el-form-item label="接受出库单时禁止自动分拣">
        <el-switch :active-value="1" :inactive-value="0" v-model="formData.api_noAutoSorting"></el-switch>
      </el-form-item>
      <el-form-item label="接受预到货单时状态为在途中">
        <el-switch :active-value="1" :inactive-value="0" v-model="formData.api_purchaseOrderStatusZaiTu"></el-switch>
      </el-form-item>
      <el-form-item label="出库单状态为“冻结中”删除订单">
        <el-switch :active-value="1" :inactive-value="0" v-model="formData.api_sale_order_dongJie_del"></el-switch>
      </el-form-item>
      <el-form-item label="冻结订单时删除占位">
        <el-switch :active-value="1" :inactive-value="0" v-model="formData.api_sale_order_dongJie_delPlaceHolder"></el-switch>
      </el-form-item>
 
      <h2 class="sub-title">推送到ERP接口参数设置</h2>
      <el-form-item label="ERP接口域名" class="margin-bottom-10">
        <el-input v-model="formData.api_erp_domain" class="w-300"></el-input>
      </el-form-item>
      <el-form-item label="ERP接口公司编号" class="margin-bottom-10">
        <el-input v-model="formData.api_erp_company" class="w-300"></el-input>
      </el-form-item>
      <el-form-item label="ERP接口账号" class="margin-bottom-10">
        <el-input v-model="formData.api_erp_account" class="w-300"></el-input>
      </el-form-item>
      <el-form-item label="ERP接口Token" class="margin-bottom-10">
        <el-input v-model="formData.api_erp_token" class="w-300"></el-input>
      </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: {
        api_autoCheck: 0,
        api_noAutoSorting: 0,
        api_purchaseOrderStatusZaiTu: 0,
        api_sale_order_dongJie_del: 0,
        api_sale_order_dongJie_delPlaceHolder: 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>