system-clients 3.0.42 → 3.0.43-fanxian

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.
@@ -1,235 +1,237 @@
1
- <template>
2
- <div class="flex">
3
- <p class="bg-info text-center" style="padding: 8px;">
4
- 单值管理
5
- <span class="btn btn-link add-postition" @click="add()">新增</span>
6
- </p>
7
- <div class="auto">
8
- <form class="form-horizontal" style="margin-bottom: 5px;">
9
- <div class="row">
10
- <div class="col-sm-4 form-group">
11
- <label class="font_normal_body">使用公司</label>
12
- <res-select restype='organization'
13
- is-mul="false"
14
- :initresid="curorgid"
15
- @res-select="getorgCur">
16
- </res-select>
17
- </div>
18
- <div class="col-sm-4 form-group">
19
- <label class="font_normal_body">参数名称</label>
20
- <input type="text" class="input_search" style="width: 60%" placeholder='请输入查找的参数名' v-model="conditionModel.paramName" @keyup.enter="filter_query(param, f_orgid_current)">
21
- </div>
22
- <div class="col-sm-4 form-group button-range" style="float:left;">
23
- <button type="button" class="button_search" @click="filter_query(conditionModel.paramName,conditionModel.f_cond_orgid)">查询</button>
24
- </div>
25
- </div>
26
- </form>
27
- </div>
28
- <div class="span">
29
- <partial-view v-ref:single-load>
30
- <data-grid :model="model" v-ref:grid class="list_area table_sy">
31
- <template partial='head'>
32
- <tr>
33
- <th>序号</th>
34
- <th>名称</th>
35
- <th>参数值</th>
36
- <th>所属</th>
37
- <th>操作</th>
38
- </tr>
39
- </template>
40
- <template partial='body'>
41
- <td style="text-align:center">{{$index+1}}</td>
42
- <td style="text-align:center">{{row.name}}</td>
43
- <td style="text-align:center">{{row.value}}</td>
44
- <td style="text-align:center">{{row.orgname ? row.orgname + '专用' : '全局'}}</td>
45
- <td class="flex-around">
46
- <button type="button" name="button" class="btn btn-link"
47
- @click.stop="$parent.$parent.$parent.modifyParam(row)">修改</button>
48
- <button type="button" name="button" class="btn btn-link"
49
- @click.stop="$parent.$parent.$parent.deleteItem(row)">删除</button>
50
- </td>
51
- </template>
52
- </data-grid>
53
- </partial-view>
54
- </div>
55
- <modal v-if="show" :show.sync="show" v-ref:modal backdrop="false">
56
- <header slot="modal-header" class="modal-header">
57
- <button type="button" class="close" @click="close"><span>&times;</span></button>
58
- <h4 class="modal-title">单值配置</h4>
59
- </header>
60
- <article slot="modal-body" class="modal-body">
61
- <form class="form-horizontal">
62
- <div class="row">
63
- <div class="col-sm-6 form-group">
64
- <label class="font_normal_body">单值名称</label>
65
- <input type="text" class="input_search" style="width: 60%" v-model="selectItem.name">
66
- </div>
67
- <div class="col-sm-6 form-group">
68
- <label class="font_normal_body">单值内容</label>
69
- <input type="text" class="input_search" style="width: 60%" v-model="selectItem.value">
70
- </div>
71
- </div>
72
- <div class="row">
73
- <div class="col-sm-6 form-group" v-if="!selectItem.isGlobal">
74
- <label class="font_normal_body">所属公司</label>
75
- <res-select restype='organization'
76
- :initresid="[conditionModel.f_cond_orgid]"
77
- :is-mul="false"
78
- @res-select="getModifyOrg">
79
- </res-select>
80
- </div>
81
- <div class="checkbox col-sm-6 form-group">
82
- <label>
83
- <input type="checkbox" v-model="selectItem.isGlobal" :checked="selectItem.isGlobal">是否全局
84
- </label>
85
- </div>
86
- </div>
87
- </form>
88
-
89
- </article>
90
-
91
- <footer slot="modal-footer" class="modal-footer">
92
- <button v-show="show" type="button" class="button_search button_spacing" @click='confirm'>确认</button>
93
- <button v-show="show" type="button" class="button_clear button_spacing" @click='close'>取消</button>
94
- </footer>
95
- </modal>
96
- </div>
97
- </template>
98
- <script>
99
-
100
- import {HttpResetClass} from 'vue-client'
101
-
102
- export default {
103
- title: '用户操作',
104
- data () {
105
- return {
106
- selectItem: {
107
- name: '',
108
- value: '',
109
- isGlobal: true,
110
- f_filialeids: null
111
- },
112
-
113
- // 查询条件
114
- conditionModel: {
115
- paramName: null,
116
- f_cond_orgid: null
117
- },
118
-
119
- params: null,
120
- model: {
121
- rows: []
122
- },
123
- // 控制单值模态框
124
- show: false,
125
- curorgid: [this.$login.f.orgid]
126
- }
127
- },
128
- ready () {
129
- // this.model.rows = AppData.singleValues
130
- this.loadSingle()
131
- },
132
- watch: {
133
- 'selectItem.isGlobal' (val) {
134
- if (val) {
135
- this.selectItem.f_filialeids = null
136
- }
137
- }
138
- },
139
- methods: {
140
-
141
- loadSingle () {
142
- let param = {
143
- condition: '1=1',
144
- f_filialeid: this.$login.f.orgid
145
- }
146
- this.queryParam(param)
147
- },
148
-
149
- async queryParam (condition) {
150
- this.model.rows = []
151
- let http = new HttpResetClass()
152
- let res = await http.load('POST', 'rs/sql/system_getSingle', {data: condition}, {resolveMsg: null, rejectMsg: '获取参数出错!!'})
153
- this.model.rows = res.data
154
- },
155
-
156
- filter_query (paramName,orgid) {
157
- console.log('过滤查询',paramName, orgid)
158
- let param = {}
159
- if (paramName && orgid) {
160
- param = {
161
- condition: `s.name like '%${paramName}%'`,
162
- f_filialeid: orgid
163
- }
164
- } else if (orgid) {
165
- param = {
166
- condition: '1=1',
167
- f_filialeid: orgid
168
- }
169
- } else if (paramName) {
170
- param = {
171
- condition: `s.name like '%${paramName}%'`,
172
- f_filialeid: this.$login.f.orgid
173
- }
174
- } else {
175
- param = {
176
- condition: '1=1',
177
- f_filialeid: this.$login.f.orgid
178
- }
179
- }
180
- this.queryParam(param)
181
-
182
- },
183
- deleteItem (row) {
184
- this.$showMessage('删除后不可恢复,确认删除吗?', ['confirm', 'cancel']).then((res) => {
185
- if (res === 'confirm') {
186
- this.$resetpost('rs/logic/deleteValue', {tablename: 't_singlevalue', id: row.id}).then((res) => {
187
- this.filter_query(this.conditionModel.paramName, this.conditionModel.f_cond_orgid)
188
- })
189
- }
190
- })
191
- },
192
- add () {
193
- this.show = true
194
- },
195
- modifyParam (row) {
196
- console.log('修改单值', row)
197
- this.selectItem.name = row.name
198
- this.selectItem.id = row.id
199
- this.selectItem.value = row.value
200
- this.selectItem.isGlobal = !row.orgname
201
- this.show = true
202
- },
203
- confirm () {
204
- this.$resetpost('rs/logic/system_saveSingle', this.selectItem).then((res) => {
205
- // 如果没有id,需要在数组中添加
206
- this.filter_query(this.conditionModel.paramName, this.conditionModel.f_cond_orgid)
207
- this.show = false
208
- this.selectItem = {
209
- name: '',
210
- value: '',
211
- isGlobal: true,
212
- f_filialeids: null
213
- }
214
- })
215
- },
216
- getorgCur (val) {
217
- this.conditionModel.f_cond_orgid = val[0]
218
- },
219
- getModifyOrg (val) {
220
- this.selectItem.f_filialeids = val[0]
221
- },
222
- // 关闭模态框
223
- close () {
224
- this.show = false
225
- this.selectItem = {
226
- name: '',
227
- value: '',
228
- isGlobal: true,
229
- f_filialeids: null
230
- }
231
- }
232
- }
233
-
234
- }
235
- </script>
1
+ <template>
2
+ <div class="flex">
3
+ <p class="bg-info text-center" style="padding: 8px;">
4
+ 单值管理
5
+ <span class="btn btn-link add-postition" @click="add()">新增</span>
6
+ </p>
7
+ <div class="auto">
8
+ <form class="form-horizontal" style="margin-bottom: 5px;">
9
+ <div class="row">
10
+ <div class="col-sm-4">
11
+ <label class="font_normal_body">使用公司</label>
12
+ <res-select restype='organization'
13
+ is-mul="false"
14
+ :initresid="curorgid"
15
+ @res-select="getorgCur">
16
+ </res-select>
17
+ </div>
18
+ <div class="col-sm-4">
19
+ <label class="font_normal_body">参数名称</label>
20
+ <input type="text" class="input_search" style="width: 60%" placeholder='请输入查找的参数名' v-model="conditionModel.paramName" @keyup.enter="filter_query(param, f_orgid_current)">
21
+ </div>
22
+ <div class="text-right">
23
+ <button type="button" class="button_search" @click="filter_query(conditionModel.paramName,conditionModel.f_cond_orgid)">查询</button>
24
+ </div>
25
+ </div>
26
+ </form>
27
+ </div>
28
+ <div class="span">
29
+ <partial-view v-ref:single-load>
30
+ <data-grid :model="model" v-ref:grid class="list_area table_sy">
31
+ <template partial='head'>
32
+ <tr>
33
+ <th>序号</th>
34
+ <th>名称</th>
35
+ <th>参数值</th>
36
+ <th>所属</th>
37
+ <th>操作</th>
38
+ </tr>
39
+ </template>
40
+ <template partial='body'>
41
+ <td style="text-align:center">{{$index+1}}</td>
42
+ <td style="text-align:center">{{row.name}}</td>
43
+ <td style="text-align:center">{{row.value}}</td>
44
+ <td style="text-align:center">{{row.orgname ? row.orgname + '专用' : '全局'}}</td>
45
+ <td class="flex-around">
46
+ <button type="button" name="button" class="btn btn-link"
47
+ @click.stop="$parent.$parent.$parent.modifyParam(row)">修改</button>
48
+ <button type="button" name="button" class="btn btn-link"
49
+ @click.stop="$parent.$parent.$parent.deleteItem(row)">删除</button>
50
+ </td>
51
+ </template>
52
+ </data-grid>
53
+ </partial-view>
54
+ </div>
55
+ <modal v-if="show" :show.sync="show" v-ref:modal backdrop="false">
56
+ <header slot="modal-header" class="modal-header">
57
+ <button type="button" class="close" @click="close"><span>&times;</span></button>
58
+ <h4 class="modal-title">单值配置</h4>
59
+ </header>
60
+ <article slot="modal-body" class="modal-body">
61
+ <form class="form-horizontal">
62
+ <div class="form-group">
63
+ <div class="col-sm-6">
64
+ <label class="font_normal_body">单值名称</label>
65
+ <input type="text" class="input_search" style="width: 60%" v-model="selectItem.name">
66
+ </div>
67
+ <div class="col-sm-6">
68
+ <label class="font_normal_body">单值内容</label>
69
+ <input type="text" class="input_search" style="width: 60%" v-model="selectItem.value">
70
+ </div>
71
+ </div>
72
+ <div class="col-sm-6">
73
+ <div class="checkbox">
74
+ <label>
75
+ <input type="checkbox" v-model="selectItem.isGlobal" :checked="selectItem.isGlobal">是否全局
76
+ </label>
77
+ </div>
78
+ </div>
79
+ <div class="form-group" v-if="!selectItem.isGlobal">
80
+ <div class="col-sm-6">
81
+ <label class="font_normal_body">所属公司</label>
82
+ <res-select restype='organization'
83
+ :initresid="[conditionModel.f_cond_orgid]"
84
+ :is-mul="false"
85
+ @res-select="getModifyOrg">
86
+ </res-select>
87
+ </div>
88
+ </div>
89
+ </form>
90
+
91
+ </article>
92
+
93
+ <footer slot="modal-footer" class="modal-footer">
94
+ <button v-show="show" type="button" class="button_search button_spacing" @click='confirm'>确认</button>
95
+ <button v-show="show" type="button" class="button_clear button_spacing" @click='close'>取消</button>
96
+ </footer>
97
+ </modal>
98
+ </div>
99
+ </template>
100
+ <script>
101
+
102
+ import {HttpResetClass} from 'vue-client'
103
+
104
+ export default {
105
+ title: '用户操作',
106
+ data () {
107
+ return {
108
+ selectItem: {
109
+ name: '',
110
+ value: '',
111
+ isGlobal: true,
112
+ f_filialeids: null
113
+ },
114
+
115
+ // 查询条件
116
+ conditionModel: {
117
+ paramName: null,
118
+ f_cond_orgid: null
119
+ },
120
+
121
+ params: null,
122
+ model: {
123
+ rows: []
124
+ },
125
+ // 控制单值模态框
126
+ show: false,
127
+ curorgid: [this.$login.f.orgid]
128
+ }
129
+ },
130
+ ready () {
131
+ // this.model.rows = AppData.singleValues
132
+ this.loadSingle()
133
+ },
134
+ watch: {
135
+ 'selectItem.isGlobal' (val) {
136
+ if (val) {
137
+ this.selectItem.f_filialeids = null
138
+ }
139
+ }
140
+ },
141
+ methods: {
142
+
143
+ loadSingle () {
144
+ let param = {
145
+ condition: '1=1',
146
+ f_filialeid: this.$login.f.orgid
147
+ }
148
+ this.queryParam(param)
149
+ },
150
+
151
+ async queryParam (condition) {
152
+ this.model.rows = []
153
+ let http = new HttpResetClass()
154
+ let res = await http.load('POST', 'rs/sql/system_getSingle', {data: condition}, {resolveMsg: null, rejectMsg: '获取参数出错!!'})
155
+ this.model.rows = res.data
156
+ },
157
+
158
+ filter_query (paramName,orgid) {
159
+ console.log('过滤查询',paramName, orgid)
160
+ let param = {}
161
+ if (paramName && orgid) {
162
+ param = {
163
+ condition: `s.name like '%${paramName}%'`,
164
+ f_filialeid: orgid
165
+ }
166
+ } else if (orgid) {
167
+ param = {
168
+ condition: '1=1',
169
+ f_filialeid: orgid
170
+ }
171
+ } else if (paramName) {
172
+ param = {
173
+ condition: `s.name like '%${paramName}%'`,
174
+ f_filialeid: this.$login.f.orgid
175
+ }
176
+ } else {
177
+ param = {
178
+ condition: '1=1',
179
+ f_filialeid: this.$login.f.orgid
180
+ }
181
+ }
182
+ this.queryParam(param)
183
+
184
+ },
185
+ deleteItem (row) {
186
+ this.$showMessage('删除后不可恢复,确认删除吗?', ['confirm', 'cancel']).then((res) => {
187
+ if (res === 'confirm') {
188
+ this.$resetpost('rs/logic/deleteValue', {tablename: 't_singlevalue', id: row.id}).then((res) => {
189
+ this.filter_query(this.conditionModel.paramName, this.conditionModel.f_cond_orgid)
190
+ })
191
+ }
192
+ })
193
+ },
194
+ add () {
195
+ this.show = true
196
+ },
197
+ modifyParam (row) {
198
+ console.log('修改单值', row)
199
+ this.selectItem.name = row.name
200
+ this.selectItem.id = row.id
201
+ this.selectItem.value = row.value
202
+ this.selectItem.isGlobal = !row.orgname
203
+ this.show = true
204
+ },
205
+ confirm () {
206
+ this.$resetpost('rs/logic/system_saveSingle', this.selectItem).then((res) => {
207
+ // 如果没有id,需要在数组中添加
208
+ this.filter_query(this.conditionModel.paramName, this.conditionModel.f_cond_orgid)
209
+ this.show = false
210
+ this.selectItem = {
211
+ name: '',
212
+ value: '',
213
+ isGlobal: true,
214
+ f_filialeids: null
215
+ }
216
+ })
217
+ },
218
+ getorgCur (val) {
219
+ this.conditionModel.f_cond_orgid = val[0]
220
+ },
221
+ getModifyOrg (val) {
222
+ this.selectItem.f_filialeids = val[0]
223
+ },
224
+ // 关闭模态框
225
+ close () {
226
+ this.show = false
227
+ this.selectItem = {
228
+ name: '',
229
+ value: '',
230
+ isGlobal: true,
231
+ f_filialeids: null
232
+ }
233
+ }
234
+ }
235
+
236
+ }
237
+ </script>