safecheck-client 3.0.34-39 → 3.0.34-42
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/src/components/android/QRCode/QRCodeBinding.vue +300 -247
- package/src/components/android/QRCode/QRCodePage.vue +212 -208
- package/src/filiale/tongchuan/android/Select.vue +421 -0
- package/src/filiale/tongchuan/android.js +21 -20
- package/src/filiale/tongchuan/utils/EventListener.js +29 -0
- package/src/filiale/tongchuan/utils/coerceBoolean.js +7 -0
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "safecheck-client",
|
3
3
|
"//": "主分支版本别乱升,测试包的版本直接发包(建议使用1.XX.XX-XXX格式作为测试包,不要频繁升级第三位版本号),别提交版本号。切了分支切记把主分支版本升了,保证主分支始终是最高版本!!!!!",
|
4
|
-
"version": "3.0.34-
|
4
|
+
"version": "3.0.34-42",
|
5
5
|
"description": "安检模块 前端组件",
|
6
6
|
"author": "丁新 <417755458@qq.com>",
|
7
7
|
"license": "ISC",
|
@@ -1,247 +1,300 @@
|
|
1
|
-
<template>
|
2
|
-
<div style="height: 100%">
|
3
|
-
<div class="panel auto">
|
4
|
-
<div class="panel-body ">
|
5
|
-
<div class="row auto" style="margin: 5px 0">
|
6
|
-
<label class="righttxt">负责人姓名:</label>
|
7
|
-
<input v-model="bindingData.f_head_name" class="form-control rightipt" type="text"/>
|
8
|
-
</div>
|
9
|
-
</div>
|
10
|
-
</div>
|
11
|
-
<div class="panel auto">
|
12
|
-
<div class="panel-body ">
|
13
|
-
<div class="row auto" style="margin: 5px 0">
|
14
|
-
<label class="righttxt">负责人职务:</label>
|
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
|
-
this.$
|
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
|
-
|
152
|
-
|
153
|
-
this
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
}
|
177
|
-
}
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
}
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
}
|
218
|
-
|
219
|
-
.
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
}
|
226
|
-
|
227
|
-
.
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
1
|
+
<template>
|
2
|
+
<div style="height: 100%">
|
3
|
+
<div class="panel auto">
|
4
|
+
<div class="panel-body ">
|
5
|
+
<div class="row auto" style="margin: 5px 0">
|
6
|
+
<label class="righttxt" style="width: 30%;">负责人姓名:</label>
|
7
|
+
<input v-model="bindingData.f_head_name" class="form-control rightipt" type="text"/>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
<div class="panel auto">
|
12
|
+
<div class="panel-body ">
|
13
|
+
<div class="row auto" style="margin: 5px 0">
|
14
|
+
<label class="righttxt" style="width: 30%;">负责人职务:</label>
|
15
|
+
<v-select v-model="bindingData.f_head_post" :options='headPostTypes' :value.sync="bindingData.f_head_post" :width="'60%'"
|
16
|
+
class="input-font" clear-button close-on-select placeholder='类型' style="margin-left: 5%;"
|
17
|
+
value-single></v-select>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
<div class="panel auto">
|
22
|
+
<div class="panel-body ">
|
23
|
+
<div class="row auto" style="margin: 5px 0">
|
24
|
+
<label class="righttxt" style="width: 30%;">负责人电话:</label>
|
25
|
+
<input v-model="bindingData.f_head_phone" class="form-control rightipt" type="text"/>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
<div class="panel auto">
|
30
|
+
<div class="panel-body ">
|
31
|
+
<div class="row auto" style="margin: 5px 0">
|
32
|
+
<label class="righttxt" style="width: 30%;">绑定类型:</label>
|
33
|
+
<v-select v-model="bindingData.f_type" :options='types' :value.sync="bindingData.f_type" :width="'60%'"
|
34
|
+
class="input-font" clear-button close-on-select placeholder='类型' style="margin-left: 5%;"
|
35
|
+
value-single></v-select>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
<div v-if="bindingData.f_type == '小区'" class="panel auto">
|
40
|
+
<div class="panel-body ">
|
41
|
+
<div class="row auto" style="margin: 5px 0">
|
42
|
+
<label class="righttxt" style="width: 30%;">小区名称:</label>
|
43
|
+
<v-select v-model="bindingData.f_user_name" :options='residentialAreas' :value.sync="bindingData.f_user_name" :width="'60%'"
|
44
|
+
class="input-font" clear-button close-on-select placeholder='小区名称'
|
45
|
+
style="margin-left: 5%;" value-single></v-select>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
<div v-if="bindingData.f_type === '用户'" class="panel auto">
|
50
|
+
<div class="panel-body ">
|
51
|
+
<div class="row auto" style="margin: 5px 0">
|
52
|
+
<label class="righttxt" style="width: 30%;">用户编号:</label>
|
53
|
+
<input v-model="bindingData.f_userinfo_code" class="form-control rightipt" type="text"/>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
</div>
|
57
|
+
<div v-if="bindingData.f_type == '用户'" class="panel auto">
|
58
|
+
<div class="panel-body ">
|
59
|
+
<div class="row auto" style="margin: 5px 0">
|
60
|
+
<label class="righttxt" style="width: 30%;">用户名称:</label>
|
61
|
+
<v-select v-model="bindingData.f_userinfo" :options='userNames' :value.sync="bindingData.f_userinfo" :width="'60%'"
|
62
|
+
class="input-font" clear-button close-on-select placeholder='用户名称' @select-search="refreshUser"
|
63
|
+
style="margin-left: 5%;" menu-mode="align-button" @click="initUser"
|
64
|
+
value-single></v-select>
|
65
|
+
</div>
|
66
|
+
</div>
|
67
|
+
</div>
|
68
|
+
<div class="panel auto">
|
69
|
+
<div class="panel-body">
|
70
|
+
<label class="row auto text-left col-md-4 col-xs-4">备注</label>
|
71
|
+
<div class="col-md-12 col-sm-12 col-xs-12">
|
72
|
+
<textarea v-model="bindingData.f_comments" class="form-control"></textarea>
|
73
|
+
</div>
|
74
|
+
</div>
|
75
|
+
</div>
|
76
|
+
<div class="panel auto">
|
77
|
+
<div class="panel-body ">
|
78
|
+
<div class="row auto" style="margin: 5px 0">
|
79
|
+
<label class="righttxt">图片:</label>
|
80
|
+
<div class="col-xs-6" style="height: 160px;width:160px;overflow: scroll;top: 1px">
|
81
|
+
<img-self v-if="bindingData.f_head_pic" :src="bindingData.f_head_pic" width="140" height="140"></img-self>
|
82
|
+
<button v-if="!bindingData.f_head_pic" type="button" name="button" class="btn btn-primary" @click="takePictures('com.aofeng.hybrid.android.peripheral.CameraActivity')">拍照</button>
|
83
|
+
<button v-if="!bindingData.f_head_pic" type="button" name="button" class="btn btn-primary" @click="takePictures('com.aofeng.hybrid.android.peripheral.ActionMultiplePickActivity')">相册</button>
|
84
|
+
</div>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
</div>
|
88
|
+
<div class="panel auto">
|
89
|
+
<div class="panel-body">
|
90
|
+
<div style="display: flex;justify-content: center;">
|
91
|
+
<button class="col-sm-3 btn btn-primary" @click="binding()">绑定</button>
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
</div>
|
96
|
+
</template>
|
97
|
+
|
98
|
+
<script>
|
99
|
+
import {HttpResetClass} from 'vue-client'
|
100
|
+
import * as Util from '../../Util'
|
101
|
+
|
102
|
+
|
103
|
+
export default {
|
104
|
+
title: '二维码绑定',
|
105
|
+
data() {
|
106
|
+
return {
|
107
|
+
bindingData: {},
|
108
|
+
residentialAreas: [{label: '请选择', value: ''}],
|
109
|
+
userNames: [{label: '请选择', value: ''}],
|
110
|
+
headPostTypes:[{label: '请选择', value: ''} ,...this.$appdata.getParam('负责人职务')],
|
111
|
+
types: [{label: '请选择', value: ''}, {label: '小区', value: '小区'}, {label: '用户', value: '用户'}]
|
112
|
+
}
|
113
|
+
},
|
114
|
+
props: {
|
115
|
+
row: {
|
116
|
+
type: Object
|
117
|
+
}
|
118
|
+
},
|
119
|
+
methods: {
|
120
|
+
async fetchUsers(condition) {
|
121
|
+
try {
|
122
|
+
const response = await new HttpResetClass().load('post', `${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {
|
123
|
+
data: {
|
124
|
+
items: 'ui.f_user_name,ui.f_userinfo_id,ui.f_userinfo_code',
|
125
|
+
tablename: 't_userinfo ui LEFT JOIN t_userfiles uf on ui.f_userinfo_id = uf.f_userinfo_id',
|
126
|
+
condition: condition,
|
127
|
+
orderitem: '1'
|
128
|
+
}
|
129
|
+
});
|
130
|
+
return response.data;
|
131
|
+
} catch (error) {
|
132
|
+
return [];
|
133
|
+
}
|
134
|
+
},
|
135
|
+
async initUser() {
|
136
|
+
if (!this.bindingData.f_userinfo_code) return;
|
137
|
+
const baseCondition = `1=1 and f_user_name is not null and uf.f_user_type = '非民用' and uf.f_table_state in ('正常','停用')`;
|
138
|
+
const condition = `${baseCondition} and ui.f_userinfo_code like '${this.bindingData.f_userinfo_code}%'`;
|
139
|
+
const users = await this.fetchUsers(condition);
|
140
|
+
users.forEach(item => {
|
141
|
+
if (!this.userNames.some(user => user.value.f_userinfo_id === item.f_userinfo_id)) {
|
142
|
+
this.userNames.push({ label: `${item.f_user_name}:${item.f_userinfo_code}`, value: item })
|
143
|
+
}
|
144
|
+
})
|
145
|
+
},
|
146
|
+
async refreshUser(val) {
|
147
|
+
let condition = `1=1 and f_user_name is not null and uf.f_user_type = '非民用' and uf.f_table_state in ('正常','停用') and ui.f_user_name like '${val}%'`;
|
148
|
+
if (this.bindingData.f_userinfo_code) {
|
149
|
+
condition += ` and ui.f_userinfo_code like '${this.bindingData.f_userinfo_code}%'`;
|
150
|
+
}
|
151
|
+
const users = await this.fetchUsers(condition);
|
152
|
+
users.forEach(item => {
|
153
|
+
if (!this.userNames.some(user => user.value.f_userinfo_id === item.f_userinfo_id)) {
|
154
|
+
this.userNames.push({ label: `${item.f_user_name}:${item.f_userinfo_code}`, value: item })
|
155
|
+
}
|
156
|
+
})
|
157
|
+
},
|
158
|
+
|
159
|
+
cameraCallBack(prop,fileName) {
|
160
|
+
this.$set('bindingData.f_head_pic',fileName)
|
161
|
+
},
|
162
|
+
takePictures(page){
|
163
|
+
HostApp.__callback__ = this.cameraCallBack
|
164
|
+
HostApp.__this__ = this
|
165
|
+
let prop = 'QRCode'
|
166
|
+
this.fileName = Util.guid() +'.jpg'
|
167
|
+
HostApp._open_a_page({
|
168
|
+
type: 'boomerang',
|
169
|
+
page: page,
|
170
|
+
param: {
|
171
|
+
file: this.fileName,
|
172
|
+
requestCode: 111,
|
173
|
+
callback: 'javascript:HostApp.__callback__("' + prop + '", "%s");',
|
174
|
+
watermark: ''
|
175
|
+
}
|
176
|
+
})
|
177
|
+
},
|
178
|
+
async binding() {
|
179
|
+
let tableImages = []
|
180
|
+
if (!this.row.f_head_pic){
|
181
|
+
tableImages.push({
|
182
|
+
path:this.bindingData.f_head_pic
|
183
|
+
})
|
184
|
+
}
|
185
|
+
let data = {
|
186
|
+
tableImages: tableImages
|
187
|
+
}
|
188
|
+
HostApp.__this__ = this
|
189
|
+
HostApp.logicWithHint({
|
190
|
+
'logic': 'imagesUploadAndroid', 'callback': 'javascript: HostApp.__this__.commitCallBack()',
|
191
|
+
'data': data, 'backresult': 1
|
192
|
+
})
|
193
|
+
},
|
194
|
+
async commitCallBack(jo) {
|
195
|
+
if (jo.state == 'ok') {
|
196
|
+
const res = JSON.parse(jo.result)
|
197
|
+
let sql = ''
|
198
|
+
if (res.images && res.images.length > 0){
|
199
|
+
sql = `update t_qr_code set f_head_name = '${this.bindingData.f_head_name}',f_head_post = '${this.bindingData.f_head_post}',f_head_phone = '${this.bindingData.f_head_phone}',f_type = '${this.bindingData.f_type}',f_user_name = '${this.bindingData.f_user_name}',f_userinfo_id = '${this.bindingData.f_userinfo_id}',f_comments = '${this.bindingData.f_comments}',f_head_pic='${res.images[0].imgfileName}' where id = '${this.bindingData.id}'`
|
200
|
+
}else {
|
201
|
+
sql = `update t_qr_code set f_head_name = '${this.bindingData.f_head_name}',f_head_post = '${this.bindingData.f_head_post}',f_head_phone = '${this.bindingData.f_head_phone}',f_type = '${this.bindingData.f_type}',f_user_name = '${this.bindingData.f_user_name}',f_userinfo_id = '${this.bindingData.f_userinfo_id}',f_comments = '${this.bindingData.f_comments}' where id = '${this.bindingData.id}'`
|
202
|
+
}
|
203
|
+
new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/runSQL`, {data: {sql: sql}}).then(res=>{
|
204
|
+
this.$showMessage('绑定成功')
|
205
|
+
this.$dispatch('confirm')
|
206
|
+
}).catch(e=>{
|
207
|
+
this.$showMessage('绑定失败')
|
208
|
+
})
|
209
|
+
}else {
|
210
|
+
this.$showMessage('图片上传失败')
|
211
|
+
}
|
212
|
+
},
|
213
|
+
},
|
214
|
+
async ready() {
|
215
|
+
this.bindingData = JSON.parse(JSON.stringify(this.row))
|
216
|
+
if(this.bindingData.f_head_pic){
|
217
|
+
this.bindingData.f_head_pic = `${this.$androidUtil.getProxyUrl()}/rs/image/file/${this.bindingData.f_head_pic}`
|
218
|
+
}
|
219
|
+
let residentialArea = await new HttpResetClass().load('post', `${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {
|
220
|
+
data: {
|
221
|
+
items: 'f_residential_area,id',
|
222
|
+
tablename: 't_area',
|
223
|
+
condition: `1=1 and f_residential_area is not null`,
|
224
|
+
orderitem: '1'
|
225
|
+
}
|
226
|
+
})
|
227
|
+
residentialArea.data.forEach(item => {
|
228
|
+
this.residentialAreas.push({label: item.f_residential_area, value: `${item.f_residential_area}:${item.id}`});
|
229
|
+
})
|
230
|
+
const users = await this.fetchUsers(`1=1 and f_user_name is not null and uf.f_user_type = '非民用' and uf.f_table_state in ('正常','停用')`)
|
231
|
+
users.forEach(item => {
|
232
|
+
this.userNames.push({ label: `${item.f_user_name}:${item.f_userinfo_code}`, value: item })
|
233
|
+
})
|
234
|
+
}
|
235
|
+
}
|
236
|
+
</script>
|
237
|
+
<style lang="less" scoped>
|
238
|
+
.butt3 {
|
239
|
+
float: right;
|
240
|
+
width: 12px;
|
241
|
+
margin: 1% 2% 0 0;
|
242
|
+
}
|
243
|
+
|
244
|
+
.rightipt {
|
245
|
+
width: 60%;
|
246
|
+
float: left;
|
247
|
+
margin-left: 5%;
|
248
|
+
}
|
249
|
+
|
250
|
+
.righttxt {
|
251
|
+
border: none;
|
252
|
+
margin-left: 5px;
|
253
|
+
/*border-left: 5px solid #A2C2EB;*/
|
254
|
+
float: left;
|
255
|
+
width: 25%;
|
256
|
+
margin-bottom: 3px;
|
257
|
+
text-align: left;
|
258
|
+
word-wrap: break-word;
|
259
|
+
white-space: normal;
|
260
|
+
}
|
261
|
+
|
262
|
+
.spanboder {
|
263
|
+
border-bottom: 2px solid #499edf;
|
264
|
+
padding-bottom: 8px
|
265
|
+
}
|
266
|
+
|
267
|
+
#upuserinfo_sel /deep/ ul {
|
268
|
+
width: 100% !important;
|
269
|
+
left: 0 !important;
|
270
|
+
}
|
271
|
+
|
272
|
+
.btn-photo {
|
273
|
+
border: 0;
|
274
|
+
border-radius: 7px;
|
275
|
+
background-color: #7dc1f4;
|
276
|
+
font: 15px PingFang-SC-Bold;
|
277
|
+
height: 20%;
|
278
|
+
}
|
279
|
+
|
280
|
+
.panel-self {
|
281
|
+
border-radius: 10px;
|
282
|
+
border: 1px solid #499EDF;
|
283
|
+
background-color: #F8F8F8;
|
284
|
+
}
|
285
|
+
|
286
|
+
.div-photo {
|
287
|
+
width: auto;
|
288
|
+
height: auto;
|
289
|
+
/* margin-top: 10px; */
|
290
|
+
position: absolute;
|
291
|
+
bottom: 10px;
|
292
|
+
right: 10px;
|
293
|
+
}
|
294
|
+
</style>
|
295
|
+
<style lang="less">
|
296
|
+
#upuserinfo_sel ul {
|
297
|
+
width: 100% !important;
|
298
|
+
left: 0 !important;
|
299
|
+
}
|
300
|
+
</style>
|