telephone-clients 4.0.0-1-5 → 4.0.0-1-6

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.
@@ -0,0 +1,361 @@
1
+ <template>
2
+ <div class="select-overspread repair-bg auto" style="padding-bottom:5px;">
3
+ <validator name="v">
4
+ <!-- 费用 -->
5
+
6
+ <div class="bq-parent" v-if="shutype == 'heng'">
7
+ <blockquote class="blockquote">
8
+ <p>费用<a @click="mute()" style="float:right" href="javascript:void(0)" class="repair-mute-class"><img
9
+ src="../../../assets/novoice.png" width="25px;" alt=""><span
10
+ style="margin-left:10px;color: #304A66">关闭声音</span></a></p>
11
+ </blockquote>
12
+ </div>
13
+ <div class="auto repair-info-content compatible" v-if="materialsumshow">
14
+ <div class="row auto">
15
+ <!--<div class="col-xs-12 col-sm-6 col-md-6 form-input-group mg8" :class="$v.f_cost_person.pattern ? 'has-error' : ''">-->
16
+ <!--<label class="text-justify lb-left" for="f_cost_person">人工费:</label>-->
17
+ <!--<span v-if="show">{{model.f_cost_person}}元</span>-->
18
+ <!--<template v-if="!show">-->
19
+ <!--<input type="text" class="form-control" id="f_cost_person" v-model="model.f_cost_person" v-validate:f_cost_person="{pattern:'/^[+]{0,1}(\\d+)$|^[+]{0,1}(\\d+\\.\\d+)$/'}">-->
20
+ <!--</template>-->
21
+ <!--</div>-->
22
+ <!--<div class="col-xs-12 col-sm-6 col-md-6 form-input-group">-->
23
+ <!--<label class="text-justify lb-left" for="costmatter">材料费:</label>-->
24
+ <!--<span v-if="show">{{model.f_cost_material}}元</span>-->
25
+ <!--<input type="text" class="form-control" id="costmatter" v-model="model.f_cost_material" v-if="!show">-->
26
+ <!--&lt;!&ndash;<button type="button" name="button" class="btn btn-primary" @click="sumshow">明细</button>&ndash;&gt;-->
27
+ <!--</div>-->
28
+ <!--<div class="col-xs-12 col-sm-6 col-md-6 form-input-group">-->
29
+ <!--<label class="text-justify lb-left">操作员:</label>-->
30
+ <!--<span v-if="show" style="font-weight:bold">{{model.f_order_man}}</span>-->
31
+ <!--<input type="text" class="form-control" v-model="model.f_order_man" v-if="!show" :disabled="issee">-->
32
+ <!--</div>-->
33
+ <!--<div class="col-xs-12 col-sm-6 col-md-6 form-input-group">-->
34
+ <!--<label class="text-justify lb-left">派单员:</label>-->
35
+ <!--<span v-if="show" style="font-weight:bold">{{f_single_man}}</span>-->
36
+ <!--<input type="text" class="form-control" v-model="f_single_man" v-if="!show" readonly >-->
37
+ <!--</div>-->
38
+ <!--<div class="col-xs-12 col-sm-12 col-md-12 form-input-group">-->
39
+ <!--<label class="text-justify lb-left">反馈建议:</label>-->
40
+ <!--<span v-if="show" style="font-weight:bold">{{model.f_service_idea}}</span>-->
41
+ <!--<textarea class="form-control" cols="30" rows="4" style="resize: vertical;" v-model="model.f_service_idea" v-if="!show" :disabled="issee"></textarea>-->
42
+ <!--</div>-->
43
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group">
44
+ <label class="text-justify lb-left">备注:</label>
45
+ <span v-if="show" style="font-weight:bold">{{ model.f_remarks }}</span>
46
+ <textarea class="form-control" cols="30" rows="4" style="resize: vertical;" v-model="model.f_remarks"
47
+ v-if="!show" :disabled="issee"></textarea>
48
+ </div>
49
+ </div>
50
+ <div class="form-group col-md-12 col-sm-12 col-xs-12">
51
+ <div class="row">
52
+ <label class="text-left">请对我们的服务做出评价:</label>
53
+ </div>
54
+ <div class="col-xs-4 col-sm-4" v-for="item in radios">
55
+ <input v-model="model.f_client_evaluation" :value="item.label" :checked='item.isChecked'
56
+ @click="check(item.value)" type="radio">{{ item.label }}
57
+ </div>
58
+ </div>
59
+
60
+ <div class="form-group col-md-12 col-sm-12 col-xs-12">
61
+ <label class="text-left font">反馈录音:</label>
62
+ <div class="col-md-12 col-sm-12 col-xs-12">
63
+ <button type="button" name="button" class="btn btn-primary btn-voice" @click="record">
64
+ <img src="../../../assets/录音.png" style="width: 14%;">
65
+ <span v-if="!model.f_recording_path">开始录音</span>
66
+ <span v-if="model.f_recording_path">已录音</span>
67
+ </button>
68
+ &nbsp;&nbsp;&nbsp;&nbsp;<img src="../../../assets/remove.png" style="width: 15px;" :class="style__"
69
+ @click="delAudioFile('f_recording_path', model.f_recording_path)"></img>
70
+ </div>
71
+ </div>
72
+ <div class="row auto">
73
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group">
74
+ <label class="text-justify lb-left">处理前照片</label>
75
+ <img-area :model="model.imgs" :sutitle="处理前照片"></img-area>
76
+ </div>
77
+ </div>
78
+ <div class="row auto" v-if="imgtpe">
79
+ <div class="col-xs-12 col-sm-12 col-md-12 form-input-group" v-for="row in imgstype">
80
+ <label class="text-justify lb-left">{{ row.title }}</label>
81
+ <img-area :model="model.imgs" :sutitle="getsutitle(row.title)" :isxiangce="isxiangce"></img-area>
82
+ </div>
83
+ </div>
84
+ <!-- <div v-if="pdfurl">-->
85
+ <!-- <iframe class="prism-player" :src="pdfurl" width="100%" height="100%"></iframe>-->
86
+ <!-- </div>-->
87
+ <img-area :model="model.imgs" :sutitle="'总体照片'" v-if="!imgtpe" :isxiangce="isxiangce"></img-area>
88
+ <p style="font-size: 15px;font-weight: bold" v-if="model.f_sign_imgid">客户签名:</p>
89
+ <div v-if="!show && signType">
90
+ <Sign :signname="model.f_signname" @input="getSignValue"></Sign>
91
+ </div>
92
+ <div v-if="!show && !signType">
93
+ <new-sign :value="model.f_signname" @input="getSignValue"></new-sign>
94
+ </div>
95
+ <div v-if="show && model.f_sign_imgid">
96
+ <img :src="'rs/file/getfile/' + model.f_sign_imgid" :width="150" :height="200">
97
+ </div>
98
+ </div>
99
+ <material-sum v-if="!materialsumshow" v-on:sumchange="sumchange"
100
+ v-on:back="showchenge" :material="model.material" :f_cost_material="model.f_cost_material"
101
+ :show="show">
102
+ </material-sum>
103
+ </validator>
104
+ </div>
105
+ </template>
106
+
107
+ <script>
108
+ import Vue from 'vue'
109
+ import * as Util from '../../../components/Util'
110
+ // import {HttpResetClass} from "vue-client";
111
+ export default {
112
+ title: '费用',
113
+ props: {
114
+ // 本次维修, 包含照片数组 材料数组
115
+ model: {
116
+ type: Object
117
+ },
118
+ service: {
119
+ type: Object
120
+ },
121
+ show: {
122
+ type: Boolean,
123
+ default: false
124
+ },
125
+ f_single_man: {
126
+ type: Object
127
+ },
128
+ system: '',
129
+ shutype: 'heng',
130
+ issee: ''
131
+ },
132
+ data () {
133
+ return {
134
+ radios: [
135
+ {
136
+ label: '满意',
137
+ value: 0,
138
+ isChecked: false
139
+ },
140
+ {
141
+ label: '基本满意',
142
+ value: 1,
143
+ isChecked: false
144
+ },
145
+ {
146
+ label: '不满意',
147
+ value: 2,
148
+ isChecked: false
149
+ }
150
+ ],
151
+ signType: {
152
+ type: Boolean,
153
+ default: true
154
+ },
155
+ // 拍照时的文件名
156
+ imgurl: 'http://192.168.2.77:8081',
157
+ fileName: '',
158
+ materialsumshow: { // 控制明细组件和费用层的 显示 fasle 明细组建显示
159
+ type: Boolean,
160
+ default: true
161
+ },
162
+ imgtpe: false,
163
+ isxiangce: this.$appdata.getSingleValue('维修-开启相册') ? this.$appdata.getSingleValue('维修-开启相册') : '否',
164
+ image_length: this.$appdata.getSingleValue('维修图片最大数量') ? this.$appdata.getSingleValue('维修图片最大数量') : '99',
165
+ imgstype: []
166
+ }
167
+ },
168
+ methods: {
169
+ check (index) {
170
+ // 先取消所有选中项
171
+ for (let item of this.radios) {
172
+ item.isChecked = false
173
+ }
174
+ //再设置当前点击项选中
175
+ this.model.f_client_evaluation = this.radios[index].label
176
+ // 设置值,以供传递
177
+ this.radios[index].isChecked = true
178
+ },
179
+ amrCallBack (fileName) {
180
+ HostApp.__this__.$set('model.f_recording_path', fileName)
181
+ HostApp.__callback__ = null
182
+ HostApp.__this__ = null
183
+ },
184
+ record () {
185
+ HostApp.__callback__ = this.amrCallBack
186
+ HostApp.__this__ = this
187
+ let fileName
188
+ if (!this.model.f_recording_path) {
189
+ fileName = Util.guid() + '.amr'
190
+ } else {
191
+ fileName = Util.getFileName(this.model.f_recording_path)
192
+ }
193
+ HostApp._open_a_page({
194
+ type: 'boomerang',
195
+ page: 'com.aofeng.hybrid.android.peripheral.AudioClipActivity',
196
+ param: {file: fileName, requestCode: 111, callback: 'javascript:HostApp.__callback__("%s");'}
197
+ })
198
+ },
199
+ getSignValue (fileName) {
200
+ //tag
201
+ //tag
202
+ this.model.f_signname = fileName
203
+ this.model.f_sign_path = this.$androidUtil.getFullFileName(fileName)
204
+ },
205
+ getsutitle (val) {
206
+ return val
207
+ },
208
+ mute () {
209
+ HostApp.mute()
210
+ },
211
+ // 签名回调
212
+ signCallback (prop, fileName) {
213
+ // HostApp.alert('绑定属性:' + prop + ' 文件全路径如file:///storage/sdcard0/safecheck/abc.jpg:' + fullFileName)
214
+ HostApp.__this__.$set('model.f_signname', fileName)
215
+ HostApp.__callback__ = null
216
+ HostApp.__this__ = null
217
+ },
218
+ // 用户签名
219
+ sign () {
220
+ this.delAudioFile('f_signname', this.model.f_signname)
221
+ let prop = 'f_signname'
222
+ let idx = 'aofeng'
223
+ let fileName = Util.guid() + '-valve-' + idx + '-' + prop + '.jpg'
224
+ HostApp.__callback__ = this.signCallback
225
+ HostApp.__this__ = this
226
+ HostApp.getSignature({
227
+ file: fileName,
228
+ requestCode: 111,
229
+ callback: 'javascript:HostApp.__callback__("' + prop + '", "%s");'
230
+ })
231
+ },
232
+ delAudioFile (prop, fileName) {
233
+ if (!fileName) {
234
+ return
235
+ } else {
236
+ HostApp.delfile(fileName)
237
+ this.model[prop] = null
238
+ }
239
+ },
240
+ // 从图片中删除
241
+ remove (row) {
242
+ this.$androidUtil.delfile(row.android_file)
243
+ let pos = this.model.imgs.findIndex((value) => {
244
+ return value === row
245
+ })
246
+ this.model.imgs.splice(pos, 1)
247
+ },
248
+ // fileName: 回传文件名,传入的带安卓路径url
249
+ // prop: 传入的字段名,没做改动
250
+ cameraCallBack (prop, fileName) {
251
+ // 当前this只能通过HostApp.__tis__获取
252
+ let self = this.$androidUtil.getCallBack(this)
253
+ // 添加新图片
254
+ self.model.imgs.push({
255
+ android_file: self.fileName,
256
+ path: fileName
257
+ })
258
+ },
259
+ takePic () {
260
+ let prop = 'repair'
261
+ let idx = 'aofeng'
262
+ this.fileName = Util.guid() + '-valve-' + idx + '-' + prop + '.jpg'
263
+ this.$androidUtil.takePic(this, this.cameraCallBack, this.fileName)
264
+ },
265
+ // 明细组件显示
266
+ sumshow () {
267
+ this.materialsumshow = false
268
+ },
269
+ // 当材料明细发生变化 材料费随之变化
270
+ sumchange (val) {
271
+ this.model.f_cost_material = val
272
+ },
273
+ // 返回 总材料费 关闭材料费详情界面
274
+ showchenge (val) {
275
+ this.materialsumshow = true
276
+ if (!isNaN(val)) {
277
+ this.model.f_cost_material = val
278
+ }
279
+ }
280
+ },
281
+ ready () {
282
+ if (Vue.config.telephone.Outlay.data != undefined) {
283
+ //tag
284
+ //tag)
285
+ if (this.service.f_user_type == '民用') {
286
+ this.imgstype = Object.assign([], JSON.parse(JSON.stringify(Vue.config.telephone.Outlay.data[this.service.f_workorder_type].civil)))
287
+ } else {
288
+ this.imgstype = Object.assign([], JSON.parse(JSON.stringify(Vue.config.telephone.Outlay.data[this.service.f_workorder_type].nocivil)))
289
+ }
290
+ if (this.imgstype.length > 0) {
291
+ this.imgtpe = true
292
+ }
293
+ }
294
+ if (navigator.userAgent.match('iPad') || navigator.userAgent.match('iPhone')) {
295
+ this.signType = false
296
+ }
297
+ if (this.model && this.model.f_single_man) {
298
+ this.model.f_single_man = this.f_single_man
299
+ }
300
+ if (!this.show && this.model) {
301
+ if (Vue.user == undefined) {
302
+ return
303
+ }
304
+ this.model.f_order_man = Vue.user.name
305
+ this.model.f_order_man_id = Vue.user.id
306
+ }
307
+ // if (this.service.f_workorder_type == '置换通气单'){
308
+ // new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/af-telephone/rs/sql/tel_singleTable_OrderBy`, {
309
+ // data: {
310
+ // items: "*",
311
+ // tablename: "t_userinfo",
312
+ // condition: ` f_userinfo_id = '${this.model.baseuserinfo.f_userinfo_id}' and f_is_signature is null`,
313
+ // orderitem: "id"
314
+ // }
315
+ // }, {resolveMsg: null, rejectMsg: null}).then((res) => {
316
+ // if (res.data.length>0){
317
+ // new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/wx/af-telephone/rs/logic/wordToosRept`, {
318
+ // data: {
319
+ // f_userinfo_id: this.model.baseuserinfo.f_userinfo_id,
320
+ // }
321
+ // }, {resolveMsg: null, rejectMsg: null}).then((res2) => {
322
+ // this.pdfurl = res2.data[0].f_visit_url
323
+ // })
324
+ // }
325
+ // })
326
+ // }
327
+ // base64_str = base64.encodeFile(sign_path[0].f_realpath),
328
+ // pdf2_data={
329
+ // f_contract_signature_id:pdf[0].f_contract_signature_id,
330
+ // content: $data:image/png;base64,{base64_str}$,
331
+ // f_userinfo_id: data.model.f_userinfo_id
332
+ // },
333
+ // http1 = $http:/$,
334
+ // pdf2=restTools.post(${http1}/123.178.164.226:8555/wx/af-telephone/rs/logic/pdfToosSignature$,pdf2_data.toString()),
335
+ // log.debug($合同结果=========>{pdf2}$)
336
+ // ),null,
337
+
338
+ //tag
339
+ //tag
340
+ //tag
341
+ },
342
+ watch: {
343
+ 'model.imgs' (val) {
344
+ if (this.model.imgs.length > this.image_length) {
345
+ this.$showMessage('最大可上传3张照片')
346
+ this.model.imgs.splice(0, 1)
347
+ }
348
+ }
349
+ },
350
+ computed: {
351
+ Detail () {
352
+ if (this.model.imgs && this.model.servicerepair.length > 0) {
353
+ let result = this.model.servicerepair.find((row) => {
354
+ return row.f_type === this.repairitem.header
355
+ })
356
+ return result
357
+ }
358
+ }
359
+ }
360
+ }
361
+ </script>