telephone-clients 3.0.76 → 3.0.78

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,627 +1,890 @@
1
1
  <template>
2
- <div style="height: auto">
3
- <div style="height: auto;width: 100%" v-show="showQrCode">
4
- <div partial>
5
- <div class="" align="center">
6
- <div class="" ><img src="../../../assets/scanCode.png">请扫描下方二维码进行付款</div>
7
- <div class="row app-row">
8
- <div class="col-xs-4">
9
- <label class="font text-left">订单编号:</label>
10
- </div>
11
- <div class="col-xs-8">
12
- <input type="text" class ="search_input input-font" v-model="order.body.outTradeNo" />
13
- </div>
14
- </div>
15
- <div class="row app-row">
16
- <div class="col-xs-4">
17
- <label class="font text-left">订单状态:</label>
18
- </div>
19
- <div class="col-xs-8">
20
- <input type="text" class ="search_input input-font" v-model="orderstatus.msg" />
21
- </div>
22
- </div>
23
- <!--<div @click="callBack('支付成功')">返回</div>-->
24
- </div>
25
- <div class="" align="center" >
26
- <div class="QR-code" v-if="payType=='二维码支付'">
27
- <img src="../../../assets/qrcode_no.png" v-show="isTimeout" style="width: 266px;height: 266px" />
28
- <div id="qrcode" style="margin-top: 25px;width: 266px;height: 266px"></div>
29
- </div>
30
- </div>
31
- </div>
2
+ <material-one v-for="(i, item) in material " :index="$index" :item="item"
3
+ :materialnameandcode="materialnameandcode"
4
+ :typenumbers="materialtypenumber"></material-one>
5
+ <div style="padding: 10px;display: flex;justify-content: space-around;">
6
+ <button type="button" class="btn btn-primary" @click="addUserFile">添加</button>
7
+ </div>
8
+ <div class="y-form-item">
9
+ <label class="text-justify lb-left" style="width: 100px;">材料清单</label>
10
+ <img-area :model="materialImges" :sutitle="getsutitle('')" style="margin-left: 5%"></img-area>
11
+ </div>
12
+ <div class="y-form">
13
+ <label class="text-justify lb-left" style="width: 100px">收款</label>
14
+ <div class="y-form-item">
15
+ <label>合计金额</label>
16
+ <input type="number" class="form-control y-form-item-input" v-model="payNumber" :value.sync="payNumber">
17
+ </div>
18
+ <div class="y-form-item">
19
+ <label>收款方式</label>
20
+ <v-select
21
+ :width="'70%'"
22
+ :value.sync="payType"
23
+ v-model="payType"
24
+ :options='payTypes'
25
+ placeholder='请选择'
26
+ close-on-select
27
+ :value-single="true"
28
+ ></v-select>
32
29
  </div>
33
- <div style="height: auto;width: 100%" v-show="!showQrCode">
34
- <div v-for="(i, item) in material " class="y-form" style="border-bottom: 1px dashed grey;">
35
- <div class="y-form-head">
36
- <span style="text-align: center">材料{{ $index + 1 }}信息</span>
37
- <button
38
- style="float: right"
39
- class="button_delete button_spacing"
40
- v-if="i>0 && !item.f_process_id"
41
- @click.prevent="deleteUserFile(i)"
42
- >删除
43
- </button>
44
- </div>
45
- <div class="y-form-item">
46
- <label>材料名称</label>
47
- <v-select
48
- :width="'70%'"
49
- :value.sync="item.f_material_name"
50
- v-model="item.f_material_name"
51
- :options='materialnameandcode'
52
- placeholder='请选择'
53
- close-on-select
54
- :value-single="true"
55
- ></v-select>
56
- </div>
57
- <div class="y-form-item">
58
- <label>型号</label>
59
- <v-select
60
- :width="'70%'"
61
- :value.sync="item.f_typenumber"
62
- v-model="item.f_typenumber"
63
- :options='materialtypenumber'
64
- placeholder='请选择'
65
- close-on-select
66
- :value-single="true"
67
- ></v-select>
68
- </div>
69
- <div class="y-form-item">
70
- <label>单价(元)</label>
71
- <input type="number" class="form-control y-form-item-input" v-model="item.f_material_price"
72
- @change="getChangePayNumber"
73
- :readOnly="item.f_process_id && item.f_state != '未收费' ? true : false">
74
- </div>
75
- <div class="y-form-item">
76
- <label>数量</label>
77
- <input type="number" class="form-control y-form-item-input" v-model="item.f_material_number"
78
- @change="getChangePayNumber"
79
- :readOnly="item.f_process_id && item.f_state != '未收费' ? true : false">
80
- </div>
81
- </div>
82
- <div style="padding: 10px;display: flex;justify-content: space-around;border-bottom: 1px dashed grey;">
83
- <button type="button" class="btn btn-primary" @click="addUserFile">添加</button>
84
- </div>
85
- <div class="y-form-item">
86
- <label class="text-justify lb-left" style="width: 100px;">材料清单</label>
87
- <img-area :model="materialImges" :sutitle="getsutitle('')" style="margin-left: 5%"></img-area>
88
- </div>
89
- <div class="y-form">
90
- <label class="text-justify lb-left" style="width: 100px">收款</label>
91
- <div class="y-form-item">
92
- <label>合计金额</label>
93
- <input type="number" class="form-control y-form-item-input" v-model="payNumber" :value.sync="payNumber">
94
- </div>
95
- <div class="y-form-item">
96
- <label>收款方式</label>
97
- <v-select
98
- :width="'70%'"
99
- :value.sync="payType"
100
- v-model="payType"
101
- :options='payTypes'
102
- placeholder='请选择'
103
- close-on-select
104
- :value-single="true"
105
- ></v-select>
106
- </div>
107
- <!-- <div class="y-form-item" v-if="payType=='二维码支付'">-->
108
- <!-- <div id="qrcode" class="qrcode" v-ref:qrcode></div>-->
109
- <!-- </div>-->
110
- </div>
111
- <div style="padding: 10px;display: flex;justify-content: space-around;">
112
- <button type="button" name="button" class="btn btn-primary" @click="beforeSaveCharge">缴费</button>
113
- <!-- <button type="button" class="btn btn-primary" @click="saveUserFile">保存</button>-->
114
- </div>
30
+ <div class="y-form-item" v-if="payType=='二维码支付'">
31
+ <div id="qrcode" class="qrcode" v-ref:qrcode></div>
115
32
  </div>
116
33
  </div>
34
+ <div style="padding: 10px;display: flex;justify-content: space-around;">
35
+ <button type="button" name="button" class="btn btn-primary btn-sm" style="float: right;margin-right:10px;" @click="openQrCode()">缴费</button>
36
+ <button type="button" class="btn btn-primary" @click="saveUserFile">保存</button>
37
+ </div>
117
38
 
118
39
  </template>
119
40
 
120
41
  <script>
121
- import Vue from 'vue'
122
- import {HttpResetClass} from 'vue-client'
123
- import QRCode from 'qrcodejs2'
124
- import {isEmpty} from '../../../components/Util'
125
-
126
- export default {
127
- title: '材料添加',
128
- props: {
129
- selectdata: {
130
- type: Object
131
- }
132
- },
133
- data() {
134
- return {
135
- materialname:[],
136
- timer1:null,
137
- materialTYPE:[],
138
- materialnameandcode:[],
139
- materialtypenumber:[],
140
- category: {},
141
- isTimeout: true,
142
- //支付方式
143
- payType: '',
144
- //支付总额
145
- payNumber: 0,
146
- newPayNumber: 0,
147
- //支付方式选择框
148
- payTypes: [{label: '现金支付', value: '现金支付'}, {label: '二维码支付', value: '二维码支付'}],
149
- materialImges: [],
150
- showFile: false,
151
- material: [],
152
- positions: this.$appdata.getParam('品名及规格'), // 获取材料名称
153
- charge: {
154
- payment_terms: [{f_payment_term: '', f_charge_money: '', f_amount_words: '', f_payment_method: ''}]
155
- }, // 收费内容
156
- showCharge: false, // 收费显示
157
- timeLeft: 300, // 收费时间
158
- title1: '', // 二维码标题
159
- showQrCode: false, // 二维码显示
160
- order: {}, // 订单信息
161
- orderstatus:{},
162
- f_cost_sum: 0 // 总收费
163
- }
164
- },
165
- ready() {
166
- this.search()
167
- this.getmaterial()
168
- this.getmaterialTYPE()
169
- },
170
- methods: {
171
- beforeSaveCharge(){
172
- console.log("977666")
173
- for (let index = 0; index < this.material.length; index++) {
174
- const item = this.material[index]
175
- if(!item.f_material_name){
176
- this.$showMessage(`请选择材料${index+1}的材料名称`)
177
- return;
178
- }
179
- if(!item.f_typenumber){
180
- this.$showMessage(`请选择材料${index+1}的型号`)
181
- return;
182
- }
183
- if(!item.f_material_price){
184
- this.$showMessage(`请填写材料${index+1}的单价`)
185
- return;
186
- }
187
- if(!item.f_material_number){
188
- this.$showMessage(`请填写材料${index+1}的数量`)
189
- return;
42
+ import Vue from 'vue'
43
+ import {HttpResetClass} from 'vue-client'
44
+ import QRCode from 'qrcodejs2'
45
+ import {isEmpty} from '../../../components/Util'
46
+ export default {
47
+ title: '材料添加',
48
+ props: {
49
+ selectdata: {
50
+ type: Object
51
+ }
52
+ },
53
+ data() {
54
+ return {
55
+ materialname:[],
56
+ materialTYPE:[],
57
+ materialnameandcode:[],
58
+ materialtypenumber:[],
59
+ category: {},
60
+ //支付方式
61
+ payType: '',
62
+ //支付总额
63
+ payNumber: 0,
64
+ newPayNumber: 0,
65
+
66
+
67
+ //支付方式选择框
68
+ payTypes: [{label: '现金', value: '现金'}, {label: '二维码支付', value: '二维码支付'}],
69
+ materialImges: [],
70
+ showFile: false,
71
+ material: [],
72
+ positions: this.$appdata.getParam('品名及规格'), // 获取材料名称
73
+ charge: {
74
+ payment_terms: [{f_payment_term: '', f_charge_money: '', f_amount_words: '', f_payment_method: ''}]
75
+ }, // 收费内容
76
+ showCharge: false, // 收费显示
77
+ timeLeft: 300, // 收费时间
78
+ title1: '', // 二维码标题
79
+ showQrCode: false, // 二维码显示
80
+ order: {}, // 订单信息
81
+ f_cost_sum: 0 // 总收费
82
+ }
83
+ },
84
+ ready() {
85
+
86
+ this.search()
87
+ this.getAllMaterial()
88
+ // this.getmaterial()
89
+ // this.getmaterialTYPE()
90
+
91
+ },
92
+ methods: {
93
+ getAllMaterial(){
94
+ new HttpResetClass().load('POST',this.$androidUtil.getProxyUrl() +`/rs/sql/tel_singleTable_OrderBy?pageNo=1&pageSize=99999`, {data: {
95
+ items: '*',
96
+ tablename: 't_material_info',
97
+ condition: `1=1`,
98
+ orderitem: 'id desc'
99
+ }},{resolveMsg:null,rejectMsg:null}).then(res=>{
100
+ const typeNames= res.data.filter((item)=>item.type === '分类')
101
+ const materialNames = res.data.filter((item)=>item.type === '品名')
102
+ this.materialtypenumber = res.data.filter((item)=>item.type === '型号')
103
+ this.materialnameandcode = materialNames.map((item)=>{
104
+ const typeName = typeNames.filter((res)=>{
105
+ return res.id==item.parent_id
106
+ })
107
+ return {
108
+ label:`[${typeName[0].name}]${item.name}`,
109
+ value:{
110
+ typeName,
111
+ materialName:item
112
+ }
190
113
  }
114
+ })
115
+ }).catch((e)=>{
116
+ console.log("933",e)
117
+ })
118
+ },
119
+ getallfee(){
120
+
121
+ },
122
+ /* startTimer() {
123
+ // 定义定时器
124
+ this.intervalId = setInterval(() => {
125
+ let val1 = ''
126
+ let http = new HttpResetClass()
127
+ val1 ={
128
+ "service": "nativePay",
129
+ "tradeNo":"DC3334837685251513349100734"
130
+ }
131
+ // 发送请求
132
+ http.load('POST', `${this.$androidUtil.getProxyUrl()}/bank/rs/logic/BC_10003`, {data: val1}, {resolveMsg: null, rejectMsg: null}).then((res) => {
133
+
134
+ this.status = res.data
135
+ })
136
+ // 更新计数器
137
+ // this.count++
138
+ }, 1000) // 每秒执行一次
139
+ if(this.status.status=='200') {
140
+ this.stopTimer()
141
+ this.cole
142
+ this.$showMessage('交易成功')
143
+
144
+ this.showqrcode=false
145
+
146
+ }
147
+ },*/
148
+ stopTimer() {
149
+ // 在组件销毁前清除定时器
150
+ clearInterval(this.intervalId)
151
+ this.intervalId = null
152
+ },
153
+ /* getzhifu (){
154
+ // 获取接单人数组
155
+ let val = ''
156
+ let http = new HttpResetClass()
157
+ val ={
158
+ "service": "nativePay",
159
+ "body":"燃气费",
160
+ "detail":"燃气费",
161
+ "totalAmount":"1",
162
+ "authcode" :"123456",
163
+ "tradeType": "alipay_native",
164
+ "notifyurl":""
165
+ }
166
+ http.load('POST', `${this.$androidUtil.getProxyUrl()}/bank/rs/logic/BC_10001`, {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
167
+
168
+ this.wurl = res.data
169
+ })
170
+
171
+ this.showQrCode=true
172
+ this.$nextTick(()=> {
173
+ this.qrcode()
174
+ })
175
+ this.startTimer()
176
+ console.log("this.wurl",this.wurl)
177
+
178
+
179
+ },*/
180
+ getChangePayNumber() {
181
+
182
+ this.payNumber = 0
183
+ for (let i = 0; i < this.material.length; i++) {
184
+ this.material[i].f_fee= this.material[i].f_material_price*this.material[i].f_material_number
185
+ this.payNumber += Number(this.material[i].f_fee)
186
+ }
187
+ },
188
+ getsutitle(val) {
189
+ return val
190
+ },
191
+ loadOptions(index) {
192
+ // const data = {
193
+ // tablename: 't_material_info',
194
+ // condition: "1 = 1 and code = '" + this.material[index].f_material_code + "'"
195
+ // }
196
+ // this.$resetpost(this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data}, {
197
+ // resolveMsg: null,
198
+ // rejectMsg: '获取数据失败'
199
+ // }).then((res) => {
200
+ // for (let material of res.data) {
201
+ // switch (material.type) {
202
+ // case '分类' :
203
+ // this.$set('material[' + index + '].f_typename', material.name)
204
+ // break
205
+ // case '品名' :
206
+ // this.$set('material[' + index + '].f_material_name', material.name)
207
+ // break
208
+ // case '型号' :
209
+ // this.$set('material[' + index + '].f_typenumber', material.name)
210
+ // this.$set('material[' + index + '].unit', material.unit)
211
+ // this.$set('material[' + index + '].f_material_price', material.price)
212
+ // break
213
+ // }
214
+ // }
215
+ // this.$set('material', JSON.parse(JSON.stringify(this.material)))
216
+ // })
217
+ const data = {
218
+ code: this.material[index].f_material_code
219
+ }
220
+ this.$resetpost(this.$androidUtil.getProxyUrl() + '/rs/sql/getMaterialByCode', {data}, {
221
+ resolveMsg: null,
222
+ rejectMsg: '获取数据失败'
223
+ }).then((res) => {
224
+ for (let material of res.data) {
225
+ this.$set('material[' + index + '].f_typename', material.f_typename)
226
+ this.$set('material[' + index + '].f_material_name', material.f_material_name)
227
+ this.$set('material[' + index + '].f_typenumber', material.f_typenumber)
228
+ this.$set('material[' + index + '].unit', material.unit)
229
+ this.$set('material[' + index + '].f_material_price', material.f_material_price)
191
230
  }
192
- if(this.materialImges.length===0){
193
- this.$showMessage(`至少有一张材料照片`)
194
- return;
195
- }
196
- if(!this.payType){
197
- this.$showMessage(`请选择缴费方式`)
198
- return;
199
- }
200
- if(this.payType==='现金支付'){
201
- this.saveChargeRecord()
202
- }else{
203
- this.openQrCode()
231
+ this.$set('material', JSON.parse(JSON.stringify(this.material)))
232
+ })
233
+
234
+ },
235
+ // 删除未保存的材料信息
236
+ async deleteUserFile(index) {
237
+ this.material.splice(index, 1)
238
+ },
239
+ // 追加材料信息
240
+ addUserFile() {
241
+ this.material.push({
242
+ unit:"",
243
+ f_material_price:""
244
+ })
245
+ },
246
+ getmaterialTYPE(){
247
+ let http = new HttpResetClass()
248
+ let data = {
249
+ tablename: 't_material_service',
250
+ condition: `1=1`
251
+ }
252
+ http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
253
+ resolveMsg: null,
254
+ rejectMsg: '获取数据失败'
255
+ }).then(res => {
256
+ console.log("XXX",res.data.length)
257
+ for (let i = 0; i < res.data.length; i++){
258
+
259
+ this.materialTYPE.push({
260
+ label: res.data[i].f_typenumber,
261
+ value: res.data[i].f_typenumber})
262
+ }if (this.materialTYPE.length <= 0) {
263
+ this.materialTYPE = [{}]
204
264
  }
205
- },
206
- saveChargeRecord(){
207
- this.saveUserFile()
208
- },
209
- getChangePayNumber() {
210
- this.payNumber = 0
211
- for (let i = 0; i < this.material.length; i++) {
212
- this.material[i].f_fee= this.material[i].f_material_price*this.material[i].f_material_number
213
- this.payNumber += Number(this.material[i].f_fee)
265
+ this.materialtypenumber = Array.from(new Set(this.materialTYPE.map(item => item.label)))
266
+ .map(label => {
267
+ return this.materialTYPE.find(item => item.label === label);
268
+ })
269
+ console.log("XXX",this.materialtypenumber)
270
+ })
271
+ return this.materialtypenumber
272
+ },
273
+ getmaterial(){
274
+ let http = new HttpResetClass()
275
+ let data = {
276
+ tablename: 't_material_service',
277
+ condition: `1=1`
278
+ }
279
+ http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
280
+ resolveMsg: null,
281
+ rejectMsg: '获取数据失败'
282
+ }).then(res => {
283
+ console.log("XXX",res.data.length)
284
+ for (var i = 0; i < res.data.length; i++) {
285
+
286
+ this.materialname.push({
287
+ label: '['+res.data[i].f_material_code +']'+res.data[i].f_material_name,
288
+ value: res.data[i].f_material_name}
289
+ )
290
+ }if (this.materialname.length<= 0) {
291
+ this.materialname = [{}]
214
292
  }
215
- },
216
- getsutitle(val) {
217
- return val
218
- },
219
- // 删除未保存的材料信息
220
- deleteUserFile(index) {
221
- this.material.splice(index, 1)
222
- },
223
- // 追加材料信息
224
- addUserFile() {
225
- this.material.push({})
226
- },
227
- getmaterialTYPE(){
228
- let http = new HttpResetClass()
229
- let data = {
230
- tablename: 't_material_service',
231
- condition: `1=1`
293
+ this.materialnameandcode = Array.from(new Set(this.materialname.map(item => item.label)))
294
+ .map(label => {
295
+ return this.materialname.find(item => item.label === label);
296
+ })
297
+ this.materialname = this.materialname.map(item => {
298
+ item.label = item.label.replace(/null/g, "空")
299
+ return item;
300
+ });
301
+ console.log("XXX",this.materialnameandcode)
302
+ })
303
+ return this.materialnameandcode
304
+ },
305
+ search() {
306
+ let http = new HttpResetClass()
307
+ let data = {
308
+ tablename: 't_material_service',
309
+ condition: `f_process_id = '${this.selectdata.f_process_id}'`
310
+ }
311
+ http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
312
+ resolveMsg: null,
313
+ rejectMsg: '获取数据失败'
314
+ }).then(res => {
315
+ this.material = res.data
316
+ if (this.material.length <= 0) {
317
+ this.addUserFile()
318
+ } else {
319
+ this.getAllMaterialImg()
320
+ this.getChangePayNumber()
232
321
  }
233
- http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
234
- resolveMsg: null,
235
- rejectMsg: null
236
- }).then(res => {
237
- console.log("XXX",res.data.length)
238
- for (var i = 0; i < res.data.length; i++){
239
-
240
- this.materialTYPE.push({
241
- label: res.data[i].f_typenumber,
242
- value: res.data[i].f_typenumber})
243
- }if (this.materialTYPE.length <= 0) {
244
- this.materialTYPE = [{}]
322
+ })
323
+
324
+
325
+
326
+ },
327
+ getAllMaterialImg() {
328
+ let http = new HttpResetClass()
329
+ let data = {
330
+ tablename: 't_material_img',
331
+ condition: `f_process_id = '${this.selectdata.f_process_id}'`
332
+ }
333
+ http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
334
+ resolveMsg: null,
335
+ rejectMsg: '获取数据失败'
336
+ }).then(result => {
337
+ let tempArr = []
338
+ let tempArrary = []
339
+ result = result.data
340
+ for (let i = 0; i < result.length; i++) {
341
+
342
+ if (!tempArr.includes(result[i].f_path)) {
343
+ let temp = {}
344
+ temp.id = result[i].id
345
+ temp.android_file = result[i].f_path
346
+ temp.imgpath = ''
347
+ temp.path = 'http://newimg/storage/emulated/0/Download/safecheck/' + result[i].f_path
348
+ tempArr.push(result[i].f_path)
349
+ tempArrary.push(temp)
245
350
  }
246
- this.materialtypenumber = Array.from(new Set(this.materialTYPE.map(item => item.label)))
247
- .map(label => {
248
- return this.materialTYPE.find(item => item.label === label);
249
- })
250
- console.log("XXX",this.materialtypenumber)
251
- })
252
- return this.materialtypenumber
253
- },
254
- getmaterial(){
255
- let http = new HttpResetClass()
256
- let data = {
257
- tablename: 't_material_service',
258
- condition: `1=1`
259
351
  }
260
- http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
261
- resolveMsg: null,
262
- rejectMsg: null
263
- }).then(res => {
264
- console.log("XXX",res.data.length)
265
- for (var i = 0; i < res.data.length; i++) {
266
-
267
- this.materialname.push({
268
- label: '['+res.data[i].f_material_code +']'+res.data[i].f_material_name,
269
- value: res.data[i].f_material_name}
270
- )
271
- }if (this.materialname.length<= 0) {
272
- this.materialname = [{}]
273
- }
274
- this.materialnameandcode = Array.from(new Set(this.materialname.map(item => item.label)))
275
- .map(label => {
276
- return this.materialname.find(item => item.label === label);
277
- })
278
- this.materialname = this.materialname.map(item => {
279
- item.label = item.label.replace(/null/g, "空")
280
- return item;
281
- });
282
- console.log("XXX",this.materialnameandcode)
283
- })
284
- return this.materialnameandcode
285
- },
286
- search() {
287
- let http = new HttpResetClass()
288
- let data = {
289
- tablename: 't_material_service',
290
- condition: `f_process_id = '${this.selectdata.f_process_id}'`
352
+ this.materialImges = tempArrary
353
+ })
354
+ },
355
+ // 获取品名规格
356
+ setTypename(i, val) {
357
+ let ac = this.$appdata.getParam(val)
358
+ this.$set('material[' + i + '].typeNameList', ac)
359
+ this.$set('material[' + i + '].typeNumberList', [])
360
+ this.$set('material[' + i + '].f_typenumber', null)
361
+ this.$set('material[' + i + '].f_material_price', 0)
362
+ },
363
+ // 获取类型
364
+ setTypenumber(i, val) {
365
+ let ac = this.$appdata.getParam(val)
366
+ this.$set('material[' + i + '].typeNumberList', ac)
367
+ this.$set('material[' + i + '].f_material_price', 0)
368
+ },
369
+ // 获取单价
370
+ setmaterialprice(i, val) {
371
+ var num
372
+ if (val == null) {
373
+ num = 0
374
+ }
375
+ num = this.$appdata.getSingleValue(val)
376
+ this.$set('material[' + i + '].f_material_price', num)
377
+ },
378
+ // 金额计算
379
+ smallnum(val, val1) {
380
+ let num = Number(val) * Number(val1)
381
+ return num
382
+ },
383
+ getCheckMessage() {
384
+ let tempArr = this.material
385
+ if (!tempArr.length > 0) {
386
+ return '请选择材料后上传'
387
+ }
388
+ for (let i = 0; i < tempArr.length; i++) {
389
+ if (tempArr[i].f_process_id) {
390
+ continue
291
391
  }
292
- http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
293
- resolveMsg: null,
294
- rejectMsg: null
295
- }).then(res => {
296
- this.material = res.data
297
- if (this.material.length <= 0) {
298
- this.material = [{}]
299
- } else {
300
- this.getAllMaterialImg()
301
- this.getChangePayNumber()
302
- }
303
- })
304
- },
305
- getAllMaterialImg() {
306
- let http = new HttpResetClass()
307
- let data = {
308
- tablename: 't_material_img',
309
- condition: `f_process_id = '${this.selectdata.f_process_id}'`
392
+
393
+ if (!tempArr[i].f_material_price) {
394
+ return '请输入材料单价'
310
395
  }
311
- http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
312
- resolveMsg: null,
313
- rejectMsg: null
314
- }).then(result => {
315
- let tempArr = []
316
- let tempArrary = []
317
- result = result.data
318
- for (let i = 0; i < result.length; i++) {
319
- if (!tempArr.includes(result[i].f_path)) {
320
- let temp = {}
321
- temp.id = result[i].id
322
- temp.android_file = result[i].f_path
323
- temp.imgpath = ''
324
- temp.path = 'http://newimg/storage/emulated/0/Download/safecheck/' + result[i].f_path
325
- tempArr.push(result[i].f_path)
326
- tempArrary.push(temp)
327
- }
328
- }
329
- this.materialImges = tempArrary
330
- })
331
- },
332
- // 金额计算
333
- getCheckMessage() {
334
- let tempArr = this.material
335
- if (!tempArr.length > 0) {
336
- return '请选择材料后上传'
396
+ if (!tempArr[i].f_material_number) {
397
+ return '请输入材料数量'
337
398
  }
338
- for (let i = 0; i < tempArr.length; i++) {
339
- if (tempArr[i].f_process_id) {
340
- continue
341
- }
399
+ }
400
+ if (this.materialImges.length == 0) {
401
+ return '材料清单需拍照'
402
+ }
403
+ return null
342
404
 
343
- if (!tempArr[i].f_material_price) {
344
- return '请输入材料单价'
405
+ },
406
+ async saveUserFile1() {
407
+ let message = this.getCheckMessage()
408
+ if (message) {
409
+ this.$showMessage(message)
410
+ return
411
+ }
412
+ let imgs = []
413
+ for (let i = 0; i < this.materialImges.length; i++) {
414
+ let it = {}
415
+ if (this.materialImges[i].id) {
416
+ it = {
417
+ f_path: this.materialImges[i].path,
418
+ id: this.materialImges[i].id,
419
+ f_process_id: this.selectdata.f_process_id
345
420
  }
346
- if (!tempArr[i].f_material_number) {
347
- return '请输入材料数量'
421
+ } else {
422
+ it = {
423
+ f_path: this.materialImges[i].path,
424
+ f_process_id: this.selectdata.f_process_id
348
425
  }
349
426
  }
350
- if (this.materialImges.length == 0) {
351
- return '材料清单需拍照'
427
+ imgs.push(it)
428
+ }
429
+ for (let i = 0; i < this.material.length; i++) {
430
+ this.material[i].f_process_id = this.selectdata.f_process_id
431
+ if (isEmpty(this.material[i].f_state)) {
432
+ this.material[i].f_state = '未收费'
352
433
  }
353
- return null
354
-
355
- },
356
- async saveUserFile() {
357
- let imgs = []
358
- for (let i = 0; i < this.materialImges.length; i++) {
359
- let it = {}
360
- if (this.materialImges[i].id) {
361
- it = {
362
- f_path: this.materialImges[i].path,
363
- id: this.materialImges[i].id,
364
- f_process_id: this.selectdata.f_process_id
365
- }
366
- } else {
367
- it = {
368
- f_path: this.materialImges[i].path,
369
- f_process_id: this.selectdata.f_process_id
370
- }
434
+ }
435
+ let data = {
436
+ model: this.material,
437
+ imgs: imgs,
438
+ f_process_id: this.selectdata.f_process_id
439
+ }
440
+ HostApp.__this__ = this
441
+ HostApp.logicWithHint({
442
+ // logic别名,key必须为logic
443
+ 'logic': 'saveMaterialServiceAndroid',
444
+ // 回调执行方法名,key必须为callback
445
+ 'callback': 'javascript:HostApp.__this__.uploadCallback1()',
446
+ // logic执行需要的业务参数
447
+ 'data': data,
448
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
449
+ // 执行回调方法传入key为backresult
450
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
451
+ 'backresult': 1
452
+ })
453
+ },
454
+ uploadCallback1(result) {
455
+
456
+ if (result.state == 'ok' && JSON.parse(result.result).code == 200) {
457
+ this.$showMessage('材料保存成功!!!')
458
+ } else {
459
+ this.$showMessage(JSON.parse(result.result).msg)
460
+ }
461
+ },
462
+ async saveUserFile() {
463
+ let message = this.getCheckMessage()
464
+ if (message) {
465
+ this.$showMessage(message)
466
+ return
467
+ }
468
+ let imgs = []
469
+ for (let i = 0; i < this.materialImges.length; i++) {
470
+ let it = {}
471
+ if (this.materialImges[i].id) {
472
+ it = {
473
+ f_path: this.materialImges[i].path,
474
+ id: this.materialImges[i].id,
475
+ f_process_id: this.selectdata.f_process_id
371
476
  }
372
- imgs.push(it)
373
- }
374
- for (let i = 0; i < this.material.length; i++) {
375
- this.material[i].f_process_id = this.selectdata.f_process_id
376
- if (isEmpty(this.material[i].f_state)) {
377
- this.material[i].f_state = '已收费'
477
+ } else {
478
+ it = {
479
+ f_path: this.materialImges[i].path,
480
+ f_process_id: this.selectdata.f_process_id
378
481
  }
379
482
  }
380
- let data = {
381
- model: this.material,
382
- imgs: imgs,
383
- f_process_id: this.selectdata.f_process_id
384
- }
385
- HostApp.__this__ = this
386
- HostApp.logicWithHint({
387
- // logic别名,key必须为logic
388
- 'logic': 'saveMaterialServiceAndroid',
389
- // 回调执行方法名,key必须为callback
390
- 'callback': 'javascript:HostApp.__this__.uploadCallback()',
391
- // logic执行需要的业务参数
392
- 'data': data,
393
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
394
- // 执行回调方法传入key为backresult
395
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
396
- 'backresult': 1
397
- })
398
- },
399
- uploadCallback(result) {
400
- if (result.state == 'ok' && JSON.parse(result.result).code == 200) {
401
- this.$showMessage('材料保存成功!!!')
402
- this.$dispatch('confirm')
403
- } else {
404
- this.$showMessage(JSON.parse(result.result).msg)
483
+ imgs.push(it)
484
+ }
485
+ for (let i = 0; i < this.material.length; i++) {
486
+ this.material[i].f_process_id = this.selectdata.f_process_id
487
+ if (isEmpty(this.material[i].f_state)) {
488
+ this.material[i].f_state = '未收费'
405
489
  }
406
- },
407
- // 打开二维码
408
- openQrCode() {
409
- // 下订单
410
- let http = new HttpResetClass()
411
- const val ={
412
- "body":"燃气费",
413
- "detail":"燃气费",
414
- "totalAmount":(this.payNumber * 100).toString()
490
+ }
491
+ let data = {
492
+ model: this.material,
493
+ imgs: imgs,
494
+ f_process_id: this.selectdata.f_process_id
495
+ }
496
+ HostApp.__this__ = this
497
+ HostApp.logicWithHint({
498
+ // logic别名,key必须为logic
499
+ 'logic': 'saveMaterialServiceAndroid',
500
+ // 回调执行方法名,key必须为callback
501
+ 'callback': 'javascript:HostApp.__this__.uploadCallback()',
502
+ // logic执行需要的业务参数
503
+ 'data': data,
504
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
505
+ // 执行回调方法传入key为backresult
506
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
507
+ 'backresult': 1
508
+ })
509
+ },
510
+ uploadCallback(result) {
511
+
512
+ if (result.state == 'ok' && JSON.parse(result.result).code == 200) {
513
+ this.$showMessage('材料保存成功!!!')
514
+ } else {
515
+ this.$showMessage(JSON.parse(result.result).msg)
516
+ }
517
+ },
518
+ // 关闭对话框
519
+ closeModal() {
520
+ this.showCharge = false
521
+ this.charge = {
522
+ payment_terms: [{
523
+ f_payment_term: '',
524
+ f_charge_money: '',
525
+ f_amount_words: '',
526
+ f_payment_method: this.charge.f_payment_method
527
+ }]
528
+ }
529
+ },
530
+ // 金额转大写
531
+ handleInput(index) {
532
+ // 通过正则过滤小数点后两位
533
+ console.log('-----------------------')
534
+ this.charge.payment_terms[index].f_charge_money = (this.charge.payment_terms[index].f_charge_money.match(/^\d*(\.?\d{0,2})/g)[0]) || null
535
+ this.charge.payment_terms[index].f_amount_words = this.smalltoBIG(this.charge.payment_terms[index].f_charge_money)
536
+ },
537
+ // 金额转大写
538
+ smalltoBIG(n) {
539
+ let fraction = ['角', '分'];
540
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
541
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
542
+ let head = n < 0 ? '欠' : '';
543
+ n = Math.abs(n);
544
+
545
+ let s = '';
546
+
547
+ for (var i = 0; i < fraction.length; i++) {
548
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
549
+ }
550
+ s = s || '整';
551
+ n = Math.floor(n);
552
+
553
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
554
+ let p = '';
555
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
556
+ p = digit[n % 10] + unit[1][j] + p;
557
+ n = Math.floor(n / 10);
415
558
  }
416
- http.load('POST', `${this.$androidUtil.getProxyUrl()}/bank/rs/logic/BC_10001`,{data: val}, {resolveMsg: null,rejectMsg: null}).then(
417
- (res) => {
418
- if(res.data.status===200){
419
- console.log("调用结果",res.data,res.data.body.url)
420
- this.order = res.data
421
- this.isTimeout = false
422
- console.log(this.order)
423
- this.$nextTick(()=>{
424
- this.qrcode(res.data.body.url)
425
- })
426
- this.showQrCode = true
427
- if (this.order.body.outTradeNo) {
428
- this.timer1 = window.setInterval (this.getOrderInformation,3000)
429
- }
430
- }else{
431
- this.$showMessage('调用扫码失败!')
432
- }
433
- }
434
- )
435
- },
436
- qrcode(url) {
437
- new QRCode('qrcode', {
438
- text: url, // 设置二维码内容或跳转地址
439
- width: 266, // 设置宽度,单位像素
440
- height: 266, // 设置高度,单位像素
441
- correctLevel: QRCode.CorrectLevel.L //容错率,L/M/Hs
442
- })
443
- },
444
- // 获取订单信息
445
- async getOrderInformation() {
446
- // 查询订单信息
447
- console.log('查询订单信息!!!')
448
- let http = new HttpResetClass()
449
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/bank/rs/logic/BC_10003`, {
450
- data: {
451
- "outTradeNo":this.order.body.outTradeNo
559
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
560
+ }
561
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
562
+ },
563
+ moneyChange(index) {
564
+ console.log(`当前下标----${index}`)
565
+ if (isEmpty(this.charge.payment_terms[index].f_charge_money) || Number(this.charge.payment_terms[index].f_charge_money) === 0) {
566
+ this.$showMessage('单笔收费不能为0元!!!', 'warning', 3000)
567
+ this.charge.payment_terms[index].f_charge_money = null
568
+ return
569
+ }
570
+
571
+ },
572
+ async TimeQrCode(){ this.qrcodeTimer = setTimeout(() => {
573
+ // 关闭二维码
574
+ this.clearQrCode()
575
+ // 将定时器清除
576
+ this.qrcodeTimer = null;
577
+ clearInterval(this.orderInterval)
578
+ }, 60 * 1000)
579
+
580
+ },
581
+ // 打开二维码
582
+ async openQrCode() {
583
+ /* let http = new HttpResetClass()*/
584
+ /* for (let row = 0; row < this.charge.payment_terms.length; row++) {
585
+ console.log(this.charge.payment_terms[row])
586
+ if (isEmpty(this.charge.payment_terms[row].f_payment_term)) {
587
+ this.$showMessage('请选择收费项目!!!', 'warning', 3000)
588
+ return
589
+ } else if (isEmpty(this.charge.payment_terms[row].f_charge_money)) {
590
+ this.$showMessage('请输入收费金额!!!', 'warning', 3000)
591
+ return
452
592
  }
453
- }, {
454
- resolveMsg: null,
455
- rejectMsg: null
456
- })
457
- // 支付成功
458
- this.orderstatus = res.data
459
- if (res.data.status =='200') {
460
-
461
593
  }
462
- },
463
- async saveother() {
464
- let http = new HttpResetClass()
465
- let data1 = {
466
- tablename: 't_material_service',
467
- condition: `f_process_id = '${this.selectdata.f_process_id}' and f_state = '未收费'`
594
+ if (this.charge.f_payment_method !== '微信支付' && this.charge.f_payment_method !== '支付宝支付') {
595
+ this.saveother()
596
+ this.$showMessage('缴费成功!')
597
+ this.update()
598
+ this.showCharge = false
599
+ return
468
600
  }
469
- let res1 = await http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data1}, {
470
- resolveMsg: null,
471
- rejectMsg: null
472
- })
473
- let data = {
474
- tablename: 't_userfiles',
475
- condition: `f_userinfo_id = '${this.selectdata.model.f_userinfo_id}'`
601
+ if (this.charge.f_payment_method == '微信支付') {
602
+ this.title1 = '微信'
476
603
  }
477
- let res = await http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
478
- resolveMsg: null,
479
- rejectMsg: null
480
- })
481
- let otherdetails = []
482
- for (let i = 0; i < res1.data.length; i++) {
483
- otherdetails.push(
484
- {
485
- "f_brand_spec": [res1.data[i].f_material_name],
486
- "f_unitprice": res1.data[i].f_material_price,
487
- "f_typename": [res1.data[i].f_typename],
488
- "f_typenumber": [res1.data[i].f_typenumber],
489
- "f_number": res1.data[i].f_material_number
490
- }
491
- )
604
+ if (this.charge.f_payment_method == '支付宝支付') {
605
+ this.title1 = '支付宝'
492
606
  }
607
+ this.showCharge = false*/
608
+ // 接口金额 单位为:分
609
+ /* let data = {
610
+ money: this.accMul(this.getTotalAmount(), 1) + '',
611
+ attach: {
612
+ "f_user": Vue.user.id,
613
+ "f_user_name": Vue.user.name
614
+ },
615
+ orderType: '工单收费',
616
+ userfilesid: '',
617
+ flag: 'JsApiWeiNan',
618
+ openid: '',
619
+ filiale: 'weinanchengtou'
620
+ }*/
621
+ // 下订单
622
+ let val = ''
623
+ let http = new HttpResetClass()
624
+ console.log("totalAmount1",this.payNumber)
625
+ console.log("totalAmount2",this.payNumber * 100)
626
+ this.newPayNumber = (this.payNumber * 100).toString()
627
+ console.log("totalAmount3",this.newPayNumber)
628
+ val ={
629
+ "body":"燃气费",
630
+ "detail":"燃气费",
631
+ "totalAmount":this.newPayNumber
632
+ }
633
+ await http.load('POST', `${this.$androidUtil.getProxyUrl()}/bank/rs/logic/BC_10001`,{data: val}, {resolveMsg: null,rejectMsg: '订单生成失败!!!'}).then(
634
+ async (res) => {
493
635
 
494
- console.log("查询的用户信息", otherdetails)
495
- let data2 = {
496
- "record_userinfo": this.selectdata.model.f_userinfo_id,
497
- "f_userfiles_id": res.data[0].f_userfiles_id,
498
- "f_user_id": res.data[0].f_user_id,
499
- "f_user_name": this.selectdata.model.f_user_name,
500
- "f_address": this.selectdata.model.f_address,
501
- "f_user_type": this.selectdata.model.f_user_type,
502
- "f_gasproperties": "",
503
- "f_collection": this.f_cost_sum,
504
- "f_comments": "",
505
- "f_payment": this.charge.f_payment_method,
506
- "f_voucher_number": "",
507
- "f_bill_style": "普通收据",
508
- "f_userinfo_id": this.selectdata.model.f_userinfo_id,
509
- "f_service_person": Vue.user.name,
510
- "f_operat_type": "其他收费",
511
- "f_describe": "",
512
- "f_state": "有效",
513
- "f_operator": Vue.user.name,
514
- "f_operatorid": Vue.user.id,
515
- "f_orgid": Vue.user.orgid,
516
- "f_orgname": Vue.user.orgs,
517
- "f_depid": Vue.user.depids,
518
- "f_depname": Vue.user.f_department_name,
519
- "t_userfees": "",
520
- "f_fee_type": "其他费用",
521
- "f_fee_time": "12",
522
- "otherdetail": otherdetails
523
- }
524
- let res2 = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/sale_othercharge_logic`, {data: data2}, {
525
- resolveMsg: null,
526
- rejectMsg: null
527
- })
528
- },
529
- async shoufei() {
530
- let http = new HttpResetClass()
531
- let data = {
532
- tablename: 't_material_service',
533
- condition: `f_process_id = '${this.selectdata.f_process_id}' and f_state = '未收费'`
534
- }
535
- let res = await http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
536
- resolveMsg: null,
537
- rejectMsg: null
538
- })
539
- if (res.data.length <= 0) {
540
- this.$showMessage('请先添加未收费的材料!!!')
541
- return
542
- }
543
- this.f_cost_sum = 0
544
- for (let i = 0; i < res.data.length; i++) {
545
- this.f_cost_sum += Number(res.data[i].f_fee)
636
+ this.order = res.data
637
+ this.showQrCode = true
638
+ console.log("XXX",this.order.body.url)
639
+ this.$nextTick(() => {
640
+ this.qrcode()
641
+ })
642
+ /* // 剩余支付时间
643
+ this.paymentInterval = setInterval(() => {
644
+ this.timeLeft = this.timeLeft - 1
645
+ }, 1000)*/
646
+
647
+ // 3秒查询一次订单支付信息
648
+ this.orderInterval = setInterval(() => {
649
+ this.getOrderInformation()
650
+ }, 3000)
546
651
  }
547
- this.showCharge = true
548
- this.charge.payment_terms[0].f_charge_money = this.f_cost_sum
549
- },
550
- accMul(arg1, arg2) {
551
- let m = 0, s1 = arg1.toString(), s2 = arg2.toString();
552
- try {
553
- m += s1.split(".")[1].length
554
- } catch (e) {
652
+ )
653
+ },
654
+ getTotalAmount() {
655
+ let money = 0
656
+ this.charge.payment_terms.forEach((row) => {
657
+ money = Math.floor((Number(money) + Number(row.f_charge_money)) * 100) / 100
658
+ })
659
+ return money
660
+ },
661
+ getPaymentTerm() {
662
+ let term = ''
663
+ this.charge.payment_terms.forEach((row) => {
664
+ term += `${row.f_payment_term} `
665
+ })
666
+ return term
667
+ },
668
+ closeQRCode() {
669
+ clearTimeout(this.paymentInterval)
670
+ clearTimeout(this.orderInterval)
671
+ this.timeLeft = 300
672
+ this.closeOrder()
673
+ // 清除二维码
674
+ this.clearQrCode()
675
+ this.showQrCode = false
676
+ },
677
+ clearQrCode() {
678
+ document.getElementById('qrcode').innerHTML = ''
679
+ },
680
+ /* async closeOrder() {
681
+ let data = {
682
+ "flag": "JsApiWeiNan",
683
+ "f_filiale": "weinanchengtou",
684
+ "f_out_trade_no": this.order.f_out_trade_no,// 商户单号
685
+ "isClose": "是",
686
+ "f_sys_trace": this.order.f_sys_trace // 交易流水号
687
+ }
688
+ let http = new HttpResetClass()
689
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/wx/rs/pay/microPayOrderStatus`, data, {
690
+ resolveMsg: null,
691
+ rejectMsg: '关闭失败!!!'
692
+ })
693
+ },*/
694
+ qrcode() {
695
+ let qrcode = new QRCode('qrcode', {
696
+ text: this.order.body.url, // 设置二维码内容或跳转地址
697
+ width: 200, // 设置宽度,单位像素
698
+ height: 200, // 设置高度,单位像素
699
+ correctLevel: QRCode.CorrectLevel.L //容错率,L/M/Hs
700
+ })
701
+ },
702
+ // 获取订单信息
703
+ async getOrderInformation() {
704
+ // 查询订单信息
705
+ console.log('查询订单信息!!!')
706
+ let http = new HttpResetClass()
707
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/bank/rs/logic/BC_10003`, {
708
+ data: {
709
+ "outTradeNo":this.order.body.outTradeNo
555
710
  }
556
- try {
557
- m += s2.split(".")[1].length
558
- } catch (e) {
711
+ }, {
712
+ resolveMsg: null,
713
+ rejectMsg: '订单查询失败!!!'
714
+ })
715
+ // 支付成功
716
+ this.TimeQrCode()
717
+ if (res.data.status =='200') {
718
+ clearTimeout(this.paymentInterval)
719
+ clearTimeout(this.orderInterval)
720
+ this.timeLeft = 300
721
+ // 修改支付状态
722
+
723
+ this.$showMessage('支付成功!!!')
724
+ /*this.update()*/
725
+ // 清除二维码
726
+ this.saveUserFile1()
727
+ this.saveother()
728
+ this.clearQrCode()
729
+
730
+ this.showQrCode = false
731
+ clearInterval(this.orderInterval)
732
+ }
733
+ if (res.data.status =='503'|| res.data.status =='504'|| res.data.status =='505'){
734
+ this.$showMessage('订单未完成!!!')
735
+ this.clearQrCode()
736
+ }
737
+ if (res.data.status =='506'){
738
+ this.$showMessage('支付失败!')
739
+ this.clearQrCode()
740
+ }
741
+
742
+ },
743
+ async update() {
744
+ let http = new HttpResetClass()
745
+ for (let i = 0; i < this.material.length; i++) {
746
+ if (this.material[i].f_state == '未收费') {
747
+ this.material[i].f_state = '已收费'
559
748
  }
560
- return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
561
- },
749
+ }
750
+ let data = {
751
+ model: this.material
752
+ }
753
+ let res = await http.load('post', this.$androidUtil.getProxyUrl() + '/rs/logic/saveweinanmaterial', {data: data}, {
754
+ resolveMsg: null,
755
+ rejectMsg: '保存失败'
756
+ })
757
+ this.search()
758
+ },
759
+ async saveother() {
760
+ let http = new HttpResetClass()
761
+ let data1 = {
762
+ tablename: 't_material_service',
763
+ condition: `f_process_id = '${this.selectdata.f_process_id}' and f_state = '未收费'`
764
+ }
765
+ let res1 = await http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data1}, {
766
+ resolveMsg: null,
767
+ rejectMsg: '获取数据失败'
768
+ })
769
+ let data = {
770
+ tablename: 't_userfiles',
771
+ condition: `f_userinfo_id = '${this.selectdata.model.f_userinfo_id}'`
772
+ }
773
+ let res = await http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
774
+ resolveMsg: null,
775
+ rejectMsg: '获取数据失败'
776
+ })
777
+ let otherdetails = []
778
+ for (let i = 0; i < res1.data.length; i++) {
779
+ otherdetails.push(
780
+ {
781
+ "f_brand_spec": [res1.data[i].f_material_name],
782
+ "f_unitprice": res1.data[i].f_material_price,
783
+ "f_typename": [res1.data[i].f_typename],
784
+ "f_typenumber": [res1.data[i].f_typenumber],
785
+ "f_number": res1.data[i].f_material_number
786
+ }
787
+ )
788
+ }
789
+
790
+ console.log("查询的用户信息", otherdetails)
791
+ let data2 = {
792
+ "record_userinfo": this.selectdata.model.f_userinfo_id,
793
+ "f_userfiles_id": res.data[0].f_userfiles_id,
794
+ "f_user_id": res.data[0].f_user_id,
795
+ "f_user_name": this.selectdata.model.f_user_name,
796
+ "f_address": this.selectdata.model.f_address,
797
+ "f_user_type": this.selectdata.model.f_user_type,
798
+ "f_gasproperties": "",
799
+ "f_collection": this.f_cost_sum,
800
+ "f_comments": "",
801
+ "f_payment": this.charge.f_payment_method,
802
+ "f_voucher_number": "",
803
+ "f_bill_style": "普通收据",
804
+ "f_userinfo_id": this.selectdata.model.f_userinfo_id,
805
+ "f_service_person": Vue.user.name,
806
+ "f_operat_type": "其他收费",
807
+ "f_describe": "",
808
+ "f_state": "有效",
809
+ "f_operator": Vue.user.name,
810
+ "f_operatorid": Vue.user.id,
811
+ "f_orgid": Vue.user.orgid,
812
+ "f_orgname": Vue.user.orgs,
813
+ "f_depid": Vue.user.depids,
814
+ "f_depname": Vue.user.f_department_name,
815
+ "t_userfees": "",
816
+ "f_fee_type": "其他费用",
817
+ "f_fee_time": "12",
818
+ "otherdetail": otherdetails
819
+ }
820
+ let res2 = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/sale_othercharge_logic`, {data: data2}, {
821
+ resolveMsg: null,
822
+ rejectMsg: '保存数据失败'
823
+ })
562
824
  },
563
- destroyed () {
564
- // 停止计时器
565
- //tag
566
- window.clearInterval(this.timer1)
825
+ async shoufei() {
826
+ let http = new HttpResetClass()
827
+ let data = {
828
+ tablename: 't_material_service',
829
+ condition: `f_process_id = '${this.selectdata.f_process_id}' and f_state = '未收费'`
830
+ }
831
+ let res = await http.load('post', this.$androidUtil.getProxyUrl() + '/rs/sql/tel_singleTable', {data: data}, {
832
+ resolveMsg: null,
833
+ rejectMsg: '获取数据失败'
834
+ })
835
+ if (res.data.length <= 0) {
836
+ this.$showMessage('请先添加未收费的材料!!!')
837
+ return
838
+ }
839
+ this.f_cost_sum = 0
840
+ for (let i = 0; i < res.data.length; i++) {
841
+ this.f_cost_sum += Number(res.data[i].f_fee)
842
+ }
843
+ this.showCharge = true
844
+ this.charge.payment_terms[0].f_charge_money = this.f_cost_sum
567
845
  },
568
- events: {},
569
- computed: {
570
- paymentMethod() {
571
- return this.$appdata.getParam("付款方式")
572
- },
573
- paymentTerm() {
574
- return this.$appdata.getParam("收费项目")
846
+ accMul(arg1, arg2) {
847
+ let m = 0, s1 = arg1.toString(), s2 = arg2.toString();
848
+ try {
849
+ m += s1.split(".")[1].length
850
+ } catch (e) {
575
851
  }
852
+ try {
853
+ m += s2.split(".")[1].length
854
+ } catch (e) {
855
+ }
856
+ return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
857
+ },
858
+ },
859
+ events: {},
860
+ computed: {
861
+ paymentMethod() {
862
+ return this.$appdata.getParam("付款方式")
576
863
  },
577
- watch: {}
578
- }
864
+ paymentTerm() {
865
+ return this.$appdata.getParam("收费项目")
866
+ }
867
+ },
868
+ watch: {}
869
+ }
579
870
  </script>
580
871
  <style lang="less" scoped>
581
- .head-but {
582
- margin-left: 5px;
583
- height: 34px;
584
- /*background-color: #6aa6e2;*/
585
- border-radius: 4px;
586
- font-family: PingFang;
587
- color: #ffffff;
588
- }
589
-
590
- /*清除model中的浮动*/
591
- .clearfix:after, .clearfix:before {
592
- display: table;
593
- }
594
-
595
- .clearfix:after {
596
- clear: both;
597
- }
598
-
599
- .y-form {
600
- display: flex;
601
- flex-flow: column;
602
- gap: 10px;
603
- padding: 10px 5px;
604
-
605
- .y-form-head {
606
- background-color: #e8f4ff;
607
- display: flex;
608
- padding: 10px 20px;
609
- align-items: center;
610
- justify-content: space-between;
611
- }
872
+ .head-but {
873
+ margin-left: 5px;
874
+ height: 34px;
875
+ /*background-color: #6aa6e2;*/
876
+ border-radius: 4px;
877
+ font-family: PingFang;
878
+ color: #ffffff;
879
+ }
612
880
 
613
- .y-form-item {
614
- display: flex;
615
- gap: 10px;
881
+ /*清除model中的浮动*/
882
+ .clearfix:after, .clearfix:before {
883
+ display: table;
884
+ }
616
885
 
617
- label {
618
- width: 30%;
619
- text-align: right;
620
- }
886
+ .clearfix:after {
887
+ clear: both;
888
+ }
621
889
 
622
- .y-form-item-input {
623
- width: 70%;
624
- }
625
- }
626
- }
627
890
  </style>