kz-ui-base 1.0.45 → 1.0.46
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 +1 -1
- package/views/bd/attribute/index.vue +559 -0
- package/views/bd/collectionAgreement/add.vue +270 -0
- package/views/bd/collectionAgreement/index.vue +176 -0
- package/views/bd/costCenter/components/costCenterModal.vue +141 -0
- package/views/bd/costCenter/index.vue +304 -0
- package/views/bd/currency/index.vue +180 -0
- package/views/bd/customer/components/CustomerEditDialog.vue +274 -0
- package/views/bd/customer/components/customer-info-tab/AddressInfoTab.vue +91 -0
- package/views/bd/customer/components/customer-info-tab/BankInfoTab.vue +94 -0
- package/views/bd/customer/components/customer-info-tab/BaseInfoTab.vue +153 -0
- package/views/bd/customer/components/customer-info-tab/BusinessInfoTab.vue +140 -0
- package/views/bd/customer/components/customer-info-tab/ContactInfoTab.vue +103 -0
- package/views/bd/customer/components/customer-info-tab/SalesmanInfoTab.vue +87 -0
- package/views/bd/customer/index.vue +150 -0
- package/views/bd/customerArea/index.vue +392 -0
- package/views/bd/customerIndustry/index.vue +392 -0
- package/views/bd/customeraddress/index.vue +76 -0
- package/views/bd/customerbank/index.vue +77 -0
- package/views/bd/customercontacts/index.vue +79 -0
- package/views/bd/customersalesman/index.vue +47 -0
- package/views/bd/employee/index.vue +219 -0
- package/views/bd/exchangeRate/index.vue +232 -0
- package/views/bd/item/dialog/itemAttachFileDialog.vue +163 -0
- package/views/bd/item/dialog/itemDetailDialog.vue +1109 -0
- package/views/bd/item/dialog/itemEditDialog.vue +1247 -0
- package/views/bd/item/dialog/itemInsertDialog.vue +1324 -0
- package/views/bd/item/index.vue +535 -0
- package/views/bd/itemCategory/components/detail.vue +492 -0
- package/views/bd/itemCategory/components/modify.vue +1065 -0
- package/views/bd/itemCategory/index.vue +397 -0
- package/views/bd/itemClass/index.vue +445 -0
- package/views/bd/itemList/index.vue +445 -0
- package/views/bd/itemcategorysoattribute/index.vue +56 -0
- package/views/bd/numberingrule/index.vue +191 -0
- package/views/bd/productLine/index.vue +387 -0
- package/views/bd/productusage/index.vue +579 -0
- package/views/bd/productusage/productUsageEditModal.vue +96 -0
- package/views/bd/project/index.vue +145 -0
- package/views/bd/settlementMethod/index.vue +210 -0
- package/views/bd/uom/UomEditDialog.vue +157 -0
- package/views/bd/uom/index.vue +256 -0
- package/views/bd/vendor/components/VendorEditDialog.vue +203 -0
- package/views/bd/vendor/components/vendor-info-tab/ContactInfoTab.vue +74 -0
- package/views/bd/vendor/index.vue +140 -0
- package/views/bd/workGroup/index.vue +651 -0
package/package.json
CHANGED
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app-container">
|
|
3
|
+
<div class="wrapper-container" v-show="showSearch">
|
|
4
|
+
<el-form :model="queryParams" ref="queryForm" :inline="true">
|
|
5
|
+
<el-row>
|
|
6
|
+
<el-col :span="6">
|
|
7
|
+
<el-form-item label="属性编号" prop="attributeNo">
|
|
8
|
+
<el-input
|
|
9
|
+
v-model="queryParams.attributeNo"
|
|
10
|
+
placeholder="请输入属性编号"
|
|
11
|
+
clearable
|
|
12
|
+
size="small"
|
|
13
|
+
@keyup.enter.native="handleQuery"
|
|
14
|
+
/>
|
|
15
|
+
</el-form-item>
|
|
16
|
+
</el-col>
|
|
17
|
+
<el-col :span="6">
|
|
18
|
+
<el-form-item label="属性名称" prop="attributeName">
|
|
19
|
+
<el-input
|
|
20
|
+
v-model="queryParams.attributeName"
|
|
21
|
+
placeholder="请输入属性名称"
|
|
22
|
+
clearable
|
|
23
|
+
size="small"
|
|
24
|
+
@keyup.enter.native="handleQuery"
|
|
25
|
+
/>
|
|
26
|
+
</el-form-item>
|
|
27
|
+
</el-col>
|
|
28
|
+
|
|
29
|
+
<el-col :span="6">
|
|
30
|
+
<el-form-item label="属性类别" prop="attributeTypeCode">
|
|
31
|
+
<dict-select clearable type="attribute_type_code" v-model="queryParams.attributeTypeCode" placeholder="请选择属性类别"></dict-select>
|
|
32
|
+
</el-form-item>
|
|
33
|
+
</el-col>
|
|
34
|
+
|
|
35
|
+
<div style="float: right">
|
|
36
|
+
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
37
|
+
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
38
|
+
</div>
|
|
39
|
+
</el-row>
|
|
40
|
+
</el-form>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="wrapper-container">
|
|
44
|
+
<el-row :gutter="10" class="mb8">
|
|
45
|
+
<el-col :span="1.5">
|
|
46
|
+
<el-button
|
|
47
|
+
type="primary"
|
|
48
|
+
icon="el-icon-plus"
|
|
49
|
+
size="mini"
|
|
50
|
+
@click="handleAdd"
|
|
51
|
+
>新增
|
|
52
|
+
</el-button>
|
|
53
|
+
</el-col>
|
|
54
|
+
<el-col :span="1.5">
|
|
55
|
+
<el-button
|
|
56
|
+
type="success"
|
|
57
|
+
icon="el-icon-edit"
|
|
58
|
+
size="mini"
|
|
59
|
+
:disabled="editButtonDisabled"
|
|
60
|
+
@click="handleUpdate"
|
|
61
|
+
>修改
|
|
62
|
+
</el-button>
|
|
63
|
+
</el-col>
|
|
64
|
+
<el-col :span="1.5">
|
|
65
|
+
<el-button
|
|
66
|
+
type="danger"
|
|
67
|
+
icon="el-icon-delete"
|
|
68
|
+
size="mini"
|
|
69
|
+
@click="handleDelete"
|
|
70
|
+
>删除
|
|
71
|
+
</el-button>
|
|
72
|
+
</el-col>
|
|
73
|
+
<right-toolbar :showSearch.sync="showSearch" :sortVisible="false" @queryTable="getList"/>
|
|
74
|
+
</el-row>
|
|
75
|
+
|
|
76
|
+
<el-table
|
|
77
|
+
ref="table"
|
|
78
|
+
v-loading="loading"
|
|
79
|
+
:height="tableHeight"
|
|
80
|
+
:data="attributeList"
|
|
81
|
+
:border="true"
|
|
82
|
+
default-expand-all
|
|
83
|
+
@selection-change="onSelectionChange"
|
|
84
|
+
:header-cell-style= "{'text-align':'center'}"
|
|
85
|
+
>
|
|
86
|
+
<el-table-column type="selection" width="50" align="center" />
|
|
87
|
+
<el-table-column type="index" label="序号" width="50px" align="center">
|
|
88
|
+
<template scope="scope">
|
|
89
|
+
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
|
90
|
+
</template>
|
|
91
|
+
</el-table-column>
|
|
92
|
+
<el-table-column prop="attributeNo" label="属性编号" min-width="120" align="left"/>
|
|
93
|
+
<el-table-column prop="attributeName" label="属性名称" min-width="120" align="left"/>
|
|
94
|
+
<el-table-column label="录入类型" min-width="120" align="left">
|
|
95
|
+
<template scope="scope">
|
|
96
|
+
{{ getDictLabelByValue('keyin_type_code', scope.row.keyInTypeCode) }}
|
|
97
|
+
</template>
|
|
98
|
+
</el-table-column>
|
|
99
|
+
<el-table-column prop="dictType" label="选项值字典类型" min-width="120" align="left"/>
|
|
100
|
+
<el-table-column prop="attributeTypeCode" label="属性类型" min-width="120" align="left">
|
|
101
|
+
<template scope="scope">
|
|
102
|
+
{{ scope.row.attributeTypeCode!= null && scope.row.attributeTypeCode.length > 0 ? scope.row.attributeTypeCode.split(",").map(x=>getDictLabelByValue('attribute_type_code', x)).join(", "): '' }}
|
|
103
|
+
</template>
|
|
104
|
+
</el-table-column>
|
|
105
|
+
<el-table-column prop="tablefieldName1" label="对照字段名1" min-width="120" align="left"/>
|
|
106
|
+
<el-table-column prop="useSystem1" label="使用系统1" min-width="120" align="left"/>
|
|
107
|
+
<el-table-column prop="tablefieldName2" label="对照字段名2" min-width="120" align="left"/>
|
|
108
|
+
<el-table-column prop="useSystem2" label="使用系统2" min-width="120" align="left"/>
|
|
109
|
+
<el-table-column prop="tablefieldName3" label="对照字段名3" min-width="120" align="left"/>
|
|
110
|
+
<el-table-column prop="useSystem3" label="使用系统3" min-width="120" align="left"/>
|
|
111
|
+
</el-table>
|
|
112
|
+
<pagination
|
|
113
|
+
:total="queryParams.total"
|
|
114
|
+
:page.sync="queryParams.pageNum"
|
|
115
|
+
:limit.sync="queryParams.pageSize"
|
|
116
|
+
@pagination="getList"
|
|
117
|
+
/>
|
|
118
|
+
<div class="table-container-supplement" style="height: 10px;"/>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<!-- 添加或修改属性对话框 -->
|
|
122
|
+
<el-dialog :title="title" :visible.sync="open" width="450px" append-to-body v-dialogDrag v-dialogDragHeight>
|
|
123
|
+
<el-form
|
|
124
|
+
ref="form"
|
|
125
|
+
:model="attribute"
|
|
126
|
+
label-width="120px"
|
|
127
|
+
style="margin-right: 20px"
|
|
128
|
+
:rules="rules">
|
|
129
|
+
<el-row>
|
|
130
|
+
<el-row>
|
|
131
|
+
<el-col :span="24">
|
|
132
|
+
<el-form-item label="属性编号" prop="attributeNo">
|
|
133
|
+
<el-input v-model="attribute.attributeNo" :disabled="attributeNoDisabled"/>
|
|
134
|
+
</el-form-item>
|
|
135
|
+
</el-col>
|
|
136
|
+
<el-col :span="24">
|
|
137
|
+
<el-form-item label="属性名称" prop="attributeName">
|
|
138
|
+
<el-input v-model="attribute.attributeName"/>
|
|
139
|
+
</el-form-item>
|
|
140
|
+
</el-col>
|
|
141
|
+
<el-col :span="24">
|
|
142
|
+
<el-form-item label="录入类型" prop="keyInTypeCode">
|
|
143
|
+
<dict-select v-model="attribute.keyInTypeCode" type="keyin_type_code" false-label="false"
|
|
144
|
+
@change="keyInTypeCodeChange"/>
|
|
145
|
+
</el-form-item>
|
|
146
|
+
</el-col>
|
|
147
|
+
<el-col :span="24">
|
|
148
|
+
<el-form-item label="选项值字典类型" prop="dictType">
|
|
149
|
+
<el-select v-model="attribute.dictType" filterable placeholder="请选择" :disabled="dictTypeDisabled">
|
|
150
|
+
<el-option
|
|
151
|
+
v-for="item in dictOption"
|
|
152
|
+
:key="item.dictType"
|
|
153
|
+
:label="item.label"
|
|
154
|
+
:value="item.dictType">
|
|
155
|
+
</el-option>
|
|
156
|
+
</el-select>
|
|
157
|
+
</el-form-item>
|
|
158
|
+
</el-col>
|
|
159
|
+
<!--小数位数-->
|
|
160
|
+
<el-col :span="24">
|
|
161
|
+
<el-form-item label="小数位数" prop="decimalPlace" v-if="attribute.keyInTypeCode == KEY_IN_TYPE_CODE.INPUT_NUMBER">
|
|
162
|
+
<el-input @input="handleDecimalInput" v-model="attribute.decimalPlace"></el-input>
|
|
163
|
+
</el-form-item>
|
|
164
|
+
</el-col>
|
|
165
|
+
<el-col :span="24">
|
|
166
|
+
<el-form-item label="属性类型" prop="attributeTypeCode">
|
|
167
|
+
<el-select ref="typeSelection" multiple v-model="selectedAttributeTypeCodes" placeholder="请选择">
|
|
168
|
+
<el-option
|
|
169
|
+
v-for="item in attributeTypeOption"
|
|
170
|
+
:key="item.dictValue"
|
|
171
|
+
:label="item.dictLabel"
|
|
172
|
+
:value="item.dictValue">
|
|
173
|
+
</el-option>
|
|
174
|
+
</el-select>
|
|
175
|
+
</el-form-item>
|
|
176
|
+
</el-col>
|
|
177
|
+
<el-col :span="24">
|
|
178
|
+
<el-form-item label="对照字段名1" prop="tablefieldName1">
|
|
179
|
+
<el-input v-model="attribute.tablefieldName1"/>
|
|
180
|
+
</el-form-item>
|
|
181
|
+
</el-col>
|
|
182
|
+
<el-col :span="24">
|
|
183
|
+
<el-form-item label="使用系统1" prop="useSystem1">
|
|
184
|
+
<el-input v-model="attribute.useSystem1"/>
|
|
185
|
+
</el-form-item>
|
|
186
|
+
</el-col>
|
|
187
|
+
<el-col :span="24">
|
|
188
|
+
<el-form-item label="对照字段名2" prop="tablefieldName2">
|
|
189
|
+
<el-input v-model="attribute.tablefieldName2"/>
|
|
190
|
+
</el-form-item>
|
|
191
|
+
</el-col>
|
|
192
|
+
<el-col :span="24">
|
|
193
|
+
<el-form-item label="使用系统2" prop="useSystem2">
|
|
194
|
+
<el-input v-model="attribute.useSystem2"/>
|
|
195
|
+
</el-form-item>
|
|
196
|
+
</el-col>
|
|
197
|
+
<el-col :span="24">
|
|
198
|
+
<el-form-item label="对照字段名3" prop="tablefieldName3">
|
|
199
|
+
<el-input v-model="attribute.tablefieldName3"/>
|
|
200
|
+
</el-form-item>
|
|
201
|
+
</el-col>
|
|
202
|
+
<el-col :span="24">
|
|
203
|
+
<el-form-item label="使用系统3" prop="useSystem3">
|
|
204
|
+
<el-input v-model="attribute.useSystem3"/>
|
|
205
|
+
</el-form-item>
|
|
206
|
+
</el-col>
|
|
207
|
+
</el-row>
|
|
208
|
+
</el-row>
|
|
209
|
+
</el-form>
|
|
210
|
+
<div slot="footer" class="dialog-footer">
|
|
211
|
+
<el-button type="primary" :loading="submitLoading" @click="submitForm">确 定</el-button>
|
|
212
|
+
<el-button @click="cancel">取 消</el-button>
|
|
213
|
+
</div>
|
|
214
|
+
</el-dialog>
|
|
215
|
+
</div>
|
|
216
|
+
</template>
|
|
217
|
+
|
|
218
|
+
<script>
|
|
219
|
+
import { listAttribute, addAttribute, updateAttribute, delAttribute} from "@srcApi/bd/attribute"
|
|
220
|
+
import { optionselect} from "@srcApi/system/dict/type"
|
|
221
|
+
import {KEY_IN_TYPE_CODE} from "@/constant/bd";
|
|
222
|
+
export default {
|
|
223
|
+
name: "AttributeIndex",
|
|
224
|
+
data() {
|
|
225
|
+
return {
|
|
226
|
+
//屏幕高度
|
|
227
|
+
tableHeight : "700",
|
|
228
|
+
// 遮罩层
|
|
229
|
+
loading: true,
|
|
230
|
+
// 提交状态
|
|
231
|
+
submitLoading: false,
|
|
232
|
+
// 显示搜索条件
|
|
233
|
+
showSearch: true,
|
|
234
|
+
// 弹出层标题
|
|
235
|
+
title: "",
|
|
236
|
+
// 是否显示弹出层
|
|
237
|
+
open: false,
|
|
238
|
+
// 查询参数
|
|
239
|
+
queryParams: {
|
|
240
|
+
total: 0,
|
|
241
|
+
pageNum: 1,
|
|
242
|
+
pageSize: 10,
|
|
243
|
+
attributeNo: '',
|
|
244
|
+
attributeName: '',
|
|
245
|
+
attributeTypeCode: ''
|
|
246
|
+
},
|
|
247
|
+
selectedAttributeTypeCodes: [],
|
|
248
|
+
attributeList: [],
|
|
249
|
+
// 表单参数
|
|
250
|
+
attribute: {
|
|
251
|
+
attributeNo: '',
|
|
252
|
+
attributeName: '',
|
|
253
|
+
keyInTypeCode: '',
|
|
254
|
+
dictType: '',
|
|
255
|
+
decimalPlace: '',
|
|
256
|
+
attributeTypeCode: '',
|
|
257
|
+
tablefieldName1: '',
|
|
258
|
+
tablefieldName2: '',
|
|
259
|
+
tablefieldName3: '',
|
|
260
|
+
useSystem1: '',
|
|
261
|
+
useSystem2: '',
|
|
262
|
+
useSystem3: '',
|
|
263
|
+
},
|
|
264
|
+
rules: {},
|
|
265
|
+
multipleSelection: [],
|
|
266
|
+
|
|
267
|
+
// 字典表数据
|
|
268
|
+
dictOption: [],
|
|
269
|
+
attributeTypeOption: [],
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
|
|
273
|
+
mounted() {
|
|
274
|
+
this.$nextTick(function () {
|
|
275
|
+
this.tableHeight = window.innerHeight - this.$refs.table.$el.getBoundingClientRect().top - 80;
|
|
276
|
+
// 监听窗口大小变化
|
|
277
|
+
const that = this;
|
|
278
|
+
window.onresize = function () {
|
|
279
|
+
that.tableHeight = window.innerHeight -that.$refs.table.$el.getBoundingClientRect().top - 80;
|
|
280
|
+
};
|
|
281
|
+
});
|
|
282
|
+
},
|
|
283
|
+
computed: {
|
|
284
|
+
KEY_IN_TYPE_CODE() {
|
|
285
|
+
return KEY_IN_TYPE_CODE
|
|
286
|
+
},
|
|
287
|
+
editButtonDisabled() {
|
|
288
|
+
return this.multipleSelection.length !== 1
|
|
289
|
+
},
|
|
290
|
+
dictTypeDisabled() {
|
|
291
|
+
return this.attribute.keyInTypeCode !== KEY_IN_TYPE_CODE.SELECT_ENUM
|
|
292
|
+
},
|
|
293
|
+
attributeNoDisabled() {
|
|
294
|
+
return !!this.attribute.id
|
|
295
|
+
},
|
|
296
|
+
|
|
297
|
+
},
|
|
298
|
+
created() {
|
|
299
|
+
this.loadDictCache()
|
|
300
|
+
this.getList()
|
|
301
|
+
},
|
|
302
|
+
watch:{
|
|
303
|
+
showSearch(){
|
|
304
|
+
let that = this;
|
|
305
|
+
setTimeout(() => {
|
|
306
|
+
that.tableHeight = window.innerHeight - that.$refs.table.$el.getBoundingClientRect().top - 80;
|
|
307
|
+
}, 0);
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
methods: {
|
|
311
|
+
/** 查询部门列表 */
|
|
312
|
+
getList() {
|
|
313
|
+
this.loading = true
|
|
314
|
+
const pageNum = this.queryParams.pageNum ? this.queryParams.pageNum : 1;
|
|
315
|
+
const pageSize = this.queryParams.pageSize ? this.queryParams.pageSize : 10;
|
|
316
|
+
const orderByColumn = 'attribute_no'
|
|
317
|
+
listAttribute({ op: 'AND', ...this.getSearchParams(), pageNum, pageSize, orderByColumn }).then(response => {
|
|
318
|
+
this.attributeList = response.data
|
|
319
|
+
this.queryParams.total = Number(response.total);
|
|
320
|
+
this.loading = false
|
|
321
|
+
})
|
|
322
|
+
},
|
|
323
|
+
getSearchParams() {
|
|
324
|
+
const searchParams = { rules: [] }
|
|
325
|
+
searchParams.rules = [
|
|
326
|
+
{
|
|
327
|
+
op: 'LI',
|
|
328
|
+
property: 'attributeNo',
|
|
329
|
+
value: this.queryParams.attributeNo
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
op: 'LI',
|
|
333
|
+
property: 'attributeName',
|
|
334
|
+
value: this.queryParams.attributeName
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
op: 'EQ',
|
|
338
|
+
property: 'attributeTypeCode',
|
|
339
|
+
value: this.queryParams.attributeTypeCode
|
|
340
|
+
},
|
|
341
|
+
]
|
|
342
|
+
return searchParams
|
|
343
|
+
},
|
|
344
|
+
// 取消按钮
|
|
345
|
+
cancel() {
|
|
346
|
+
this.open = false
|
|
347
|
+
this.reset()
|
|
348
|
+
},
|
|
349
|
+
|
|
350
|
+
// 表单重置
|
|
351
|
+
reset() {
|
|
352
|
+
this.attribute = {
|
|
353
|
+
attributeNo: '',
|
|
354
|
+
attributeName: '',
|
|
355
|
+
keyInTypeCode: '',
|
|
356
|
+
dictType: '',
|
|
357
|
+
attributeTypeCode: '',
|
|
358
|
+
tablefieldName1: '',
|
|
359
|
+
tablefieldName2: '',
|
|
360
|
+
tablefieldName3: '',
|
|
361
|
+
useSystem1: '',
|
|
362
|
+
useSystem2: '',
|
|
363
|
+
useSystem3: ''
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
/** 搜索按钮操作 */
|
|
367
|
+
handleQuery() {
|
|
368
|
+
this.queryParams.pageNum = 1
|
|
369
|
+
this.getList()
|
|
370
|
+
},
|
|
371
|
+
/** 重置按钮操作 */
|
|
372
|
+
resetQuery() {
|
|
373
|
+
this.resetForm("queryForm")
|
|
374
|
+
this.handleQuery()
|
|
375
|
+
},
|
|
376
|
+
/** 新增按钮操作 */
|
|
377
|
+
handleAdd() {
|
|
378
|
+
this.reset()
|
|
379
|
+
this.$nextTick(() => {
|
|
380
|
+
this.$refs["form"].clearValidate()
|
|
381
|
+
});
|
|
382
|
+
this.$set(this,'selectedAttributeTypeCodes', []);
|
|
383
|
+
this.rules = {
|
|
384
|
+
attributeNo: [{ required: true, message: "属性编号不能为空", trigger: "blur" }],
|
|
385
|
+
attributeName: [{ required: true, message: "属性名称不能为空", trigger: "blur" }],
|
|
386
|
+
decimalPlace: [{ required: true, message: "小数位数不能为空", trigger: "blur" }]
|
|
387
|
+
}
|
|
388
|
+
this.open = true
|
|
389
|
+
this.title = "新增属性"
|
|
390
|
+
},
|
|
391
|
+
/** 修改按钮操作 */
|
|
392
|
+
handleUpdate() {
|
|
393
|
+
if(this.multipleSelection && this.multipleSelection.length === 1) {
|
|
394
|
+
this.reset()
|
|
395
|
+
this.open = true
|
|
396
|
+
this.title = "修改属性"
|
|
397
|
+
const obj = {...this.multipleSelection[0]}
|
|
398
|
+
this.attribute = obj;
|
|
399
|
+
this.$set(this,'selectedAttributeTypeCodes', (obj.attributeTypeCode == null || obj.attributeTypeCode === '') ? [] : obj.attributeTypeCode.split(","));
|
|
400
|
+
this.rules = {
|
|
401
|
+
attributeName: [{ required: true, message: "属性名称不能为空", trigger: "blur" }],
|
|
402
|
+
decimalPlace: [{ required: true, message: "小数位数不能为空", trigger: "blur" }]
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
|
|
407
|
+
/** 删除按钮操作 */
|
|
408
|
+
handleDelete() {
|
|
409
|
+
this.$confirm('是否确认删除选中的属性?', "警告", {
|
|
410
|
+
confirmButtonText: "确定",
|
|
411
|
+
cancelButtonText: "取消",
|
|
412
|
+
type: "warning"
|
|
413
|
+
}).then(() => {
|
|
414
|
+
return delAttribute({attributes: this.multipleSelection})
|
|
415
|
+
}).then(() => {
|
|
416
|
+
this.getList()
|
|
417
|
+
this.msgSuccess("删除成功")
|
|
418
|
+
}).catch(() => {
|
|
419
|
+
})
|
|
420
|
+
},
|
|
421
|
+
|
|
422
|
+
/** 提交按钮 */
|
|
423
|
+
submitForm: function () {
|
|
424
|
+
this.submitLoading = true
|
|
425
|
+
this.$refs["form"].validate(valid => {
|
|
426
|
+
if (valid) {
|
|
427
|
+
if (this.attribute.id) {
|
|
428
|
+
let payload = Object.assign({}, this.attribute);
|
|
429
|
+
|
|
430
|
+
if (this.selectedAttributeTypeCodes != null && this.selectedAttributeTypeCodes.length > 0) {
|
|
431
|
+
payload.attributeTypeCode = this.selectedAttributeTypeCodes.sort().join(",");
|
|
432
|
+
} else {
|
|
433
|
+
payload.attributeTypeCode = "";
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
updateAttribute(payload).then(response => {
|
|
437
|
+
this.msgSuccess("修改成功")
|
|
438
|
+
this.open = false
|
|
439
|
+
this.getList()
|
|
440
|
+
})
|
|
441
|
+
} else {
|
|
442
|
+
let payload = Object.assign({}, this.attribute);
|
|
443
|
+
if (this.selectedAttributeTypeCodes != null && this.selectedAttributeTypeCodes.length > 0) {
|
|
444
|
+
payload.attributeTypeCode = this.selectedAttributeTypeCodes.sort().join(",");
|
|
445
|
+
} else {
|
|
446
|
+
payload.attributeTypeCode = "";
|
|
447
|
+
}
|
|
448
|
+
addAttribute(payload).then(response => {
|
|
449
|
+
this.msgSuccess("新增成功")
|
|
450
|
+
this.open = false
|
|
451
|
+
this.getList()
|
|
452
|
+
})
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
})
|
|
456
|
+
this.submitLoading = false
|
|
457
|
+
},
|
|
458
|
+
|
|
459
|
+
keyInTypeCodeChange(value){
|
|
460
|
+
if(value !== KEY_IN_TYPE_CODE.SELECT_ENUM){
|
|
461
|
+
this.$set(this.attribute,'dictType','');
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
|
|
465
|
+
loadDictCache() {
|
|
466
|
+
optionselect().then(response => {
|
|
467
|
+
for(let i=0;i<response.data.length;i++){
|
|
468
|
+
const sysDictType = response.data[i];
|
|
469
|
+
const dict = {
|
|
470
|
+
label: sysDictType.dictName +" "+ sysDictType.dictType,
|
|
471
|
+
dictType: sysDictType.dictType
|
|
472
|
+
}
|
|
473
|
+
this.dictOption.push(dict)
|
|
474
|
+
}
|
|
475
|
+
})
|
|
476
|
+
|
|
477
|
+
this.getDicts('attribute_type_code').then((response) => {
|
|
478
|
+
this.attributeTypeOption = response.data
|
|
479
|
+
})
|
|
480
|
+
},
|
|
481
|
+
|
|
482
|
+
onSelectionChange(val) {
|
|
483
|
+
this.multipleSelection = val
|
|
484
|
+
},
|
|
485
|
+
|
|
486
|
+
handleDecimalInput(value) {
|
|
487
|
+
const newValue = value.replace(/\D/g, '').replace(/^0+(?=\d)/, '');
|
|
488
|
+
this.attribute.decimalPlace = newValue.slice(0, 2);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
</script>
|
|
493
|
+
<style lang="scss" scoped >
|
|
494
|
+
.span_class {
|
|
495
|
+
display: block;
|
|
496
|
+
width: 5px;
|
|
497
|
+
height: 21px;
|
|
498
|
+
background-color: #409eff;
|
|
499
|
+
position: absolute;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.add-btn {
|
|
503
|
+
display: flex;
|
|
504
|
+
justify-content: center;
|
|
505
|
+
align-items: center;
|
|
506
|
+
width: 100%;
|
|
507
|
+
height: 32px;
|
|
508
|
+
background: #FFFFFF;
|
|
509
|
+
border-radius: 4px;
|
|
510
|
+
border: 1px dashed #D9D9D9;
|
|
511
|
+
cursor: pointer;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.add-btn i {
|
|
515
|
+
font-size: 14px;
|
|
516
|
+
color: rgba(0, 0, 0, 0.65);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.add-btn span {
|
|
520
|
+
height: 22px;
|
|
521
|
+
font-size: 14px;
|
|
522
|
+
font-weight: 400;
|
|
523
|
+
color: rgba(0,0,0,0.65);
|
|
524
|
+
line-height: 22px;
|
|
525
|
+
margin-left: 8px;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
::v-deep label {
|
|
529
|
+
font-weight: 500;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
::v-deep .el-input.is-disabled .el-input__inner {
|
|
533
|
+
color: #606266;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
::v-deep .el-form-item {
|
|
537
|
+
margin-bottom: 16px;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
::v-deep .el-form-item--small.el-form-item {
|
|
541
|
+
margin-bottom: 8px;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
::v-deep .el-dialog__body {
|
|
545
|
+
padding: 24px 24px 0 24px;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
::v-deep .el-dialog__footer {
|
|
549
|
+
text-align: center;
|
|
550
|
+
border-top: 1px solid #ededed;
|
|
551
|
+
padding: 12px 0 12px 0;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
::v-deep .el-dialog__header {
|
|
555
|
+
padding: 16px;
|
|
556
|
+
padding-bottom: 10px;
|
|
557
|
+
border-bottom: 1px solid #ededed;
|
|
558
|
+
}
|
|
559
|
+
</style>
|