gcs-ui-lib 1.2.39 → 1.2.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gcs-ui-lib",
3
- "version": "1.2.39",
3
+ "version": "1.2.41",
4
4
  "private": false,
5
5
  "main": "./lib/gcs-ui-lib.common.js",
6
6
  "scripts": {
@@ -6,7 +6,7 @@
6
6
  class="m-b-s"
7
7
  :content="$l('补填规则检测')"
8
8
  />
9
- <el-form class="label-width-8em description-b-s" :label-width="'8em'">
9
+ <el-form class="label-width-8em description-b-s" :label-width="'14em'">
10
10
  <el-form-item :label="$l('数据来源')" prop="description">
11
11
  <el-radio-group v-model="searchData.radio" @change="handleRadio">
12
12
  <el-radio :label="'SelectEntries'">{{ $l("选择流水") }}</el-radio>
@@ -11,7 +11,7 @@
11
11
  children: 'children',
12
12
  label: nodeName,
13
13
  value: nodeKey,
14
- disabled: (data) => !Number(data.activeFlag || 0),
14
+ disabled: 'disabled',
15
15
  }"
16
16
  >
17
17
  </CLSelectTree>
@@ -19,7 +19,7 @@
19
19
  </template>
20
20
 
21
21
  <script>
22
- import {getCashflow, getPaymentCategory, getRecUnit} from "@/api/common";
22
+ import {getPaymentCategory} from "@/api/common";
23
23
  import {SelectTree} from "n20-common-lib";
24
24
 
25
25
  export default {
@@ -65,19 +65,7 @@ export default {
65
65
  url: getPaymentCategory,
66
66
  nodeKey: "paymentCategoryNo",
67
67
  nodeName: "paymentCategoryName",
68
- },
69
- {
70
- type: "cashflow",
71
- url: getCashflow,
72
- nodeKey: "flowNo",
73
- nodeName: "flowName",
74
- },
75
- {
76
- type: "unit",
77
- url: getRecUnit,
78
- nodeKey: "unitNo",
79
- nodeName: "unitName",
80
- },
68
+ }
81
69
  ],
82
70
  };
83
71
  },
@@ -117,9 +105,6 @@ export default {
117
105
  },
118
106
  },
119
107
  computed: {
120
- showOptName() {
121
- return this.type == "cashflow" ? "idAndName" : this.nodeName;
122
- },
123
108
  inputValue: {
124
109
  get() {
125
110
  return this.value;
@@ -131,19 +116,10 @@ export default {
131
116
  },
132
117
  methods: {
133
118
  treeChange(val, obj = {}) {
134
- let data = {};
135
- if (this.type === "cashflow") {
136
- data = {
137
- flowNo: obj[this.nodeKey] || "",
138
- flowName: obj[this.nodeName] || "",
139
- };
140
- } else {
141
- data = {
142
- conProp: obj[this.nodeKey] || "",
143
- conPropName: obj[this.nodeName] || "",
144
- };
145
- }
146
- console.log(data, "data");
119
+ const data = {
120
+ conProp: obj[this.nodeKey] || "",
121
+ conPropName: obj[this.nodeName] || "",
122
+ };
147
123
  this.$emit("change", data);
148
124
  },
149
125
  treeFind(tree, value, type) {
@@ -177,43 +153,16 @@ export default {
177
153
  },
178
154
  //请求数据
179
155
  async getData() {
180
- let params = {};
181
- if (this.type == "cashflow") {
182
- params = {
183
- flowDir: this.settingSource == '2' ? "out" : "in",
184
- // inputMethod: "INPUT",
185
- resultType: 1,
186
- showFlag: 1,
187
- };
188
- } else if (this.type == "paymentCategory") {
189
- params = {
190
- activeFlag: 1,
191
- directionList: [this.settingSource == '1' ? 1 : 0, 2].join(','),
192
- resultType: 2,
193
- };
194
- } else {
195
- params = {
196
- resultType: 1,
197
- };
198
- }
199
- let res = await this.Api(params);
200
- res = this.tranData(res);
201
- this.type == "cashflow" && this.handleData(res);
202
- this.treeData = res;
203
- },
204
- tranData(res) {
205
- const eachItem = (parent, list) => {
206
- list.forEach((item) => {
207
- item["idAndName"] = item[this.nodeKey] + " " + item[this.nodeName];
208
- if (item.children && item.children.length) {
209
- eachItem(item, item.children);
210
- }
211
- });
156
+ const directions = [this.settingSource == '1' ? 1 : 0, 2];
157
+ const params = {
158
+ activeFlag: 1,
159
+ directionList: directions.join(),
160
+ resultType: 2,
212
161
  };
213
- if (res) {
214
- eachItem(null, res);
215
- }
216
- return res;
162
+ const data = await getPaymentCategory(params);
163
+ this.handlePaymentCategoryDataData(data, directions);
164
+ console.log(data, 'data')
165
+ this.treeData = data;
217
166
  },
218
167
 
219
168
  onSelectCashFlowNode(data) {
@@ -221,19 +170,6 @@ export default {
221
170
  this.filterText = data[this.nodeName];
222
171
  // this.emitlabel(data);
223
172
  },
224
- onSelectCashFlowNodeOnlyLast(data) {
225
- if (
226
- data.inputMethod == "INPUT" &&
227
- (data.children == null || data.children.length == 0)
228
- ) {
229
- this.showPopoverFlag = false;
230
- this.filterText = data[this.nodeName];
231
- } else {
232
- return this.$message.warning(
233
- "只能选择填报方式为“录入项”,且为最末级的现金流"
234
- );
235
- }
236
- },
237
173
  //根据编号回显名称
238
174
  findNameByNo(data, value) {
239
175
  let newItem = {};
@@ -253,18 +189,11 @@ export default {
253
189
  };
254
190
  },
255
191
  //给每个对象加disabled属性
256
- handleData(arr) {
192
+ handlePaymentCategoryDataData(arr, directions = []) {
257
193
  arr?.forEach((it) => {
258
- if (
259
- it.inputMethod == "INPUT" &&
260
- (it.children == null || it.children.length == 0)
261
- ) {
262
- it.disabled = false;
263
- } else {
264
- it.disabled = true;
265
- }
194
+ it.disabled = !directions.includes(it.direction);
266
195
  if (Array.isArray(it.children) && it.children.length > 0) {
267
- this.handleData(it.children);
196
+ this.handlePaymentCategoryDataData(it.children, directions);
268
197
  }
269
198
  });
270
199
  },