apply-clients 5.0.35-95 → 5.0.35-98

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.
@@ -12,9 +12,9 @@
12
12
  :edit="true"></material-message>
13
13
  <receive-batch v-if="selectdata.defname == '派工单'" :selectdata="selectdata" v-ref:receivebatch></receive-batch>
14
14
  <project-settlement v-if="selectdata.defname == '工程结算'" :selectdata="selectdata"></project-settlement>
15
- <!-- <installfee :infee="selectdata" :showfee='true' v-if="selectdata.defname == '通气条件确认'"></installfee>-->
15
+ <!-- <installfee :infee="selectdata" :showfee='true' v-if="selectdata.defname == '通气条件确认'"></installfee>-->
16
16
  <buyer-message v-ref:buyermessagev :selectdata="selectdata" :state="1" v-if="selectdata.defname == '收费'" ></buyer-message>
17
- <!-- <installfee :infee="selectdata" v-if="selectdata.defname == '收费'"></installfee>-->
17
+ <!-- <installfee :infee="selectdata" v-if="selectdata.defname == '收费'"></installfee>-->
18
18
  <service-view v-ref:service_show :data="show_data" v-if="showview" :is_show_datacheck="datacheck"></service-view>
19
19
 
20
20
  <modal :show.sync="showbuyerinfo" v-ref:modal backdrop="false">
@@ -63,13 +63,13 @@
63
63
 
64
64
  <apply-accept-bill :show="acceptprint" :bill-url='acceptUrl' v-on:toggle="close" :data='row' :billdata="printData" v-ref:acceptbill @closeaccept="closeAccept"></apply-accept-bill>
65
65
  <!--打印报表html-->
66
- <!-- <div v-show="false">-->
67
- <!-- <div class="row" style="display: flex;justify-content: center;" id='bill-fee'>-->
68
- <!-- {{{bill}}}-->
69
- <!-- </div>-->
70
- <!-- <report-print id='bill-fee' top='15mm' left='5mm' width='90%' height='70%' :showbtn="false" preview="true"-->
71
- <!-- v-ref:reportprint></report-print>-->
72
- <!-- </div>-->
66
+ <!-- <div v-show="false">-->
67
+ <!-- <div class="row" style="display: flex;justify-content: center;" id='bill-fee'>-->
68
+ <!-- {{{bill}}}-->
69
+ <!-- </div>-->
70
+ <!-- <report-print id='bill-fee' top='15mm' left='5mm' width='90%' height='70%' :showbtn="false" preview="true"-->
71
+ <!-- v-ref:reportprint></report-print>-->
72
+ <!-- </div>-->
73
73
  <modal :show.sync="stop_show" v-ref:modal stop_show="false">
74
74
  <header slot="modal-header" class="modal-header">
75
75
  <button type="button" class="close" @click="closeback"><span>&times;</span></button>
@@ -92,12 +92,12 @@
92
92
  <article slot="modal-body" class="modal-body">
93
93
  <div class="from-group">
94
94
  <v-select style="min-width: 80%;"
95
- placeholder='请选择'
96
- :options="applytypes"
97
- :search="false"
98
- v-model="apply_type"
99
- :value.sync="apply_type"
100
- close-on-select>
95
+ placeholder='请选择'
96
+ :options="applytypes"
97
+ :search="false"
98
+ v-model="apply_type"
99
+ :value.sync="apply_type"
100
+ close-on-select>
101
101
  </v-select>
102
102
  </div>
103
103
  </article>
@@ -107,601 +107,595 @@
107
107
  </modal>
108
108
  </template>
109
109
  <script>
110
- import Vue from 'vue'
111
- import {HttpResetClass} from 'vue-client'
112
- import * as Util from '../../../../Util'
113
- // import AppData from 'stores/AppData'
114
- // Date格式化
115
- Date.prototype.Format = function (fmt) {
116
- var o = {
117
- "M+": this.getMonth() + 1, //月份
118
- "d+": this.getDate(), //日
119
- "H+": this.getHours(), //小时
120
- "m+": this.getMinutes(), //分
121
- "s+": this.getSeconds(), //秒
122
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
123
- "S": this.getMilliseconds() //毫秒
124
- };
125
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
126
- for (var k in o)
127
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
128
- return fmt;
129
- }
130
-
131
- export default {
132
- title: '报建流程业务控制层',
133
- props: ['selectdata'],
134
- data() {
135
- return {
136
- acceptprint: false,
137
- acceptUrl: 'rs/report/printReceiptbill',
138
- printData:{
139
- f_user_name: '',
140
- f_address: '',
141
- f_user_phone:'',
142
- f_work_type: '新报装',
143
- f_news:'身份证'
144
- },
145
- data: null, // 数据库数据,json配置文件数据的数据集合
146
- json_datas: null, // Json配置文件集合
147
- showview: false, // 控制显示service-view组件
148
- show_data: null, // 给view层显示的数据
149
- department_search: [], // 当前部门下所有人
150
- contract: null, // 单值表合同编号记录
151
- technologist: [], // 技术人员 角色下的人
152
- price: 0,
153
- xiangmu:'',
154
- xia:'',
155
- cost: 0,
156
- number: 0,
157
- pgd: '',
158
- showbuyerinfo: false, // 新增购货方信息模态框开关
159
- selectsellid: null, //需要打票收费id
160
- buyerinfo: {
161
- id: '',
162
- f_buyer_name: '',
163
- f_buyer_identify: '',
164
- f_buyer_addphone: '',
165
- f_buyer_bank: '',
166
- f_buyer_email: '',
167
- rows: [] // 购货方信息
168
- },
169
- bill: '',
170
- areaall:[],
171
- stop_show:false, // 终止备注开关
172
- apply_show:false, // 转单报建开关
173
- apply_type:'',
174
- applytypes:[{label:"散户报装",value:"报装申请"},{label:"集体报装",value:"集体报装申请"}],// 报建类型
175
- models: {
176
- f_date: Util.toStandardTimeString(),
177
- f_department: this.$login.f.f_parentname,
178
- f_operator: this.$login.f.name,
179
- f_filiale: this.$login.f.f_fengongsi
180
- },
181
- models2:{}
110
+ import Vue from 'vue'
111
+ import {HttpResetClass} from 'vue-client'
112
+ import * as Util from '../../../../Util'
113
+ // import AppData from 'stores/AppData'
114
+ // Date格式化
115
+ Date.prototype.Format = function (fmt) {
116
+ var o = {
117
+ "M+": this.getMonth() + 1, //月份
118
+ "d+": this.getDate(), //日
119
+ "H+": this.getHours(), //小时
120
+ "m+": this.getMinutes(), //分
121
+ "s+": this.getSeconds(), //秒
122
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
123
+ "S": this.getMilliseconds() //毫秒
124
+ };
125
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
126
+ for (var k in o)
127
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
128
+ return fmt;
129
+ }
130
+
131
+ export default {
132
+ title: '报建流程业务控制层',
133
+ props: ['selectdata'],
134
+ data() {
135
+ return {
136
+ acceptprint: false,
137
+ acceptUrl: 'rs/report/printReceiptbill',
138
+ printData:{
139
+ f_user_name: '',
140
+ f_address: '',
141
+ f_user_phone:'',
142
+ f_work_type: '新报装',
143
+ f_news:'身份证'
144
+ },
145
+ data: null, // 数据库数据,json配置文件数据的数据集合
146
+ json_datas: null, // Json配置文件集合
147
+ showview: false, // 控制显示service-view组件
148
+ show_data: null, // 给view层显示的数据
149
+ department_search: [], // 当前部门下所有人
150
+ contract: null, // 单值表合同编号记录
151
+ technologist: [], // 技术人员 角色下的人
152
+ price: 0,
153
+ xiangmu:'',
154
+ xia:'',
155
+ cost: 0,
156
+ number: 0,
157
+ pgd: '',
158
+ showbuyerinfo: false, // 新增购货方信息模态框开关
159
+ selectsellid: null, //需要打票收费id
160
+ buyerinfo: {
161
+ id: '',
162
+ f_buyer_name: '',
163
+ f_buyer_identify: '',
164
+ f_buyer_addphone: '',
165
+ f_buyer_bank: '',
166
+ f_buyer_email: '',
167
+ rows: [] // 购货方信息
168
+ },
169
+ bill: '',
170
+ areaall:[],
171
+ stop_show:false, // 终止备注开关
172
+ apply_show:false, // 转单报建开关
173
+ apply_type:'',
174
+ applytypes:[{label:"散户报装",value:"报装申请"},{label:"集体报装",value:"集体报装申请"}],// 报建类型
175
+ models: {
176
+ f_date: Util.toStandardTimeString(),
177
+ f_department: this.$login.f.f_parentname,
178
+ f_operator: this.$login.f.name,
179
+ f_filiale: this.$login.f.f_fengongsi
180
+ },
181
+ models2:{}
182
+ }
183
+ },
184
+ methods: {
185
+ /*
186
+ ============================================收费临时使用
187
+ */
188
+ // 转到报建
189
+ async addactive(){
190
+ let http = new HttpResetClass()
191
+ let model = this.models2
192
+ let url = 'rs/logic/ApplyProductService'
193
+ let requestData = {
194
+ tables: this.data.tables, model: model
182
195
  }
183
- },
184
- methods: {
185
- /*
186
- ============================================收费临时使用
187
- */
188
- // 转到报建
189
- async addactive(){
190
- this.selectdata.applyid = this.selectdata.id
191
- // this.$resetpost('rs/logic/stopapply', {data: this.selectdata})
192
- console.log(this.apply_type[0])
193
- this.$workflow_vue.start_activity = this.apply_type[0]
194
- let http = new HttpResetClass()
195
- let res = await http.load('POST','rs/logic/ApplyGetProcessID',{data:{filename:this.$workflow_vue.workflow_xmlfilename,start_activity:this.$workflow_vue.start_activity}}, {resolveMsg: null, rejectMsg: '获取流程ID失败,请联系开发人员'})
196
+ requestData.start_activity = '踏勘'
197
+ requestData.loginUser = this.$login.f
198
+ requestData.workflow_xmlfilename = this.$workflow_vue.workflow_xmlfilename
199
+ let res1 = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
200
+ this.selectdata.applyid = this.selectdata.id
201
+ // this.$resetpost('rs/logic/stopapply', {data: this.selectdata})
202
+ console.log(this.apply_type[0])
203
+ this.$workflow_vue.start_activity = this.apply_type[0]
204
+ let res = await http.load('POST','rs/logic/ApplyGetProcessID',{data:{filename:this.$workflow_vue.workflow_xmlfilename,start_activity:this.$workflow_vue.start_activity}}, {resolveMsg: null, rejectMsg: '获取流程ID失败,请联系开发人员'})
205
+ let data = {
206
+ defname: this.$workflow_vue.start_activity,
207
+ f_process_id: res.data.f_process_id,
208
+ f_apply_date: Util.toStandardTimeString(),
209
+ f_product_id: res.data.f_product_id,
210
+ start_activity:this.$workflow_vue.start_activity,
211
+ f_user_type:this.models2.f_user_type,
212
+ f_user_name:this.models2.f_user_name,
213
+ f_phone:this.models2.f_phone,
214
+ f_area:this.models2.f_area,
215
+ f_street:this.models2.f_street,
216
+ f_residential_area:this.models2.f_residential_area,
217
+ f_building:this.models2.f_building,
218
+ f_unit:this.models2.f_unit,
219
+ f_floor:this.models2.f_floor,
220
+ f_room:this.models2.f_room,
221
+ f_address:this.models2.f_address,
222
+ f_idnumber:this.models2.f_social_credit_code,
223
+ f_apply_source:this.models2.f_apply_source,
224
+ f_sub_state:'未完工',
225
+ f_project_number : res1.data.f_apply_num,
226
+ user:this.$login.f
227
+ }
228
+ await http.load('POST','rs/logic/newaddApplyproduct',{data:data}, {resolveMsg: null, rejectMsg: '转发失败,请联系开发人员'})
229
+ var flag = false
230
+ if (this.data.defname == '合同审核') {
231
+ flag = true
232
+ let http = new HttpResetClass()
196
233
  let data = {
197
- defname: this.$workflow_vue.start_activity,
198
- f_process_id: res.data.f_process_id,
199
- f_apply_date: Util.toStandardTimeString(),
200
- f_product_id: res.data.f_product_id,
201
- start_activity:this.$workflow_vue.start_activity,
202
- f_user_type:this.models2.f_user_type,
203
- f_user_name:this.models2.f_user_name,
204
- f_phone:this.models2.f_phone,
205
- f_area:this.models2.f_area,
206
- f_street:this.models2.f_street,
207
- f_residential_area:this.models2.f_residential_area,
208
- f_building:this.models2.f_building,
209
- f_unit:this.models2.f_unit,
210
- f_floor:this.models2.f_floor,
211
- f_room:this.models2.f_room,
212
- f_address:this.models2.f_address,
213
- f_idnumber:this.models2.f_social_credit_code,
214
- f_apply_source:this.models2.f_apply_source,
215
- f_sub_state:'未完工',
216
- f_project_number : this.models2.f_apply_num,
217
- user:this.$login.f
218
- }
219
- await http.load('POST','rs/logic/newaddApplyproduct',{data:data}, {resolveMsg: null, rejectMsg: '转发失败,请联系开发人员'})
220
- var flag = false
221
- if (this.data.defname == '合同审核') {
222
- flag = true
223
- let http = new HttpResetClass()
234
+ tablename: 't_singlevalue',
235
+ condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`
236
+ }
237
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
238
+ resolveMsg: null,
239
+ rejectMsg: "获取合同编号失败"
240
+ })
241
+ if (this.contract != res.data[0].value && !this.selectdata.f_contract_number) {
242
+ this.$showMessage("合同编号已经被使用,请按F5刷新页面后重新登记")
243
+ return
244
+ }
245
+ }
246
+ if (res1.data.code == 200) {
247
+ // flag 为合同编号更新标志
248
+ if (flag) {
249
+ let http = new HttpResetClass()
224
250
  let data = {
225
251
  tablename: 't_singlevalue',
226
- condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`
252
+ condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`,
253
+ value: (Number(this.contract) + 1) + ''
227
254
  }
228
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
255
+ await http.load('POST', 'rs/logic/updatesinglevalue', {data: data}, {
229
256
  resolveMsg: null,
230
- rejectMsg: "获取合同编号失败"
257
+ rejectMsg: "获取合同编号更新失败"
231
258
  })
232
- if (this.contract != res.data[0].value && !this.selectdata.f_contract_number) {
233
- this.$showMessage("合同编号已经被使用,请按F5刷新页面后重新登记")
234
- return
235
- }
236
- }
237
- let model = this.models2
238
- let url = 'rs/logic/ApplyProductService'
239
- let requestData = {
240
- tables: this.data.tables, model: model
241
259
  }
242
- requestData.start_activity = '踏勘'
243
- requestData.loginUser = this.$login.f
244
- requestData.workflow_xmlfilename = this.$workflow_vue.workflow_xmlfilename
245
- console.log('即将发送请求url=>' + url + ',参数=>' + JSON.stringify(requestData))
246
- res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
247
- console.log("service处理完成返回数据:", JSON.stringify(res.data))
248
- if(res.data.msg=="地址重复,请修改后重新提交"){
249
- this.$showMessage(res.data.msg)
250
- }
251
- if (res.data.code == 200) {
252
- // flag 为合同编号更新标志
253
- if (flag) {
254
- let http = new HttpResetClass()
255
- let data = {
256
- tablename: 't_singlevalue',
257
- condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`,
258
- value: (Number(this.contract) + 1) + ''
259
- }
260
- await http.load('POST', 'rs/logic/updatesinglevalue', {data: data}, {
261
- resolveMsg: null,
262
- rejectMsg: "获取合同编号更新失败"
263
- })
264
- }
265
- this.showview = false
266
- // 特殊处理
267
- this.special(model)
268
- this.$dispatch('close')
269
- this.initializtion()
270
- } else {
271
- if (res.data.msg) {
272
- this.$showMessage(res.data.msg)
273
- }
274
- }
275
-
276
- this.apply_show = false
277
- },
278
- // 终止报建
279
- async stopapplys () {
280
- this.models = Object.assign({}, this.selectdata, this.models)
281
- this.models.id = null
282
- this.models.applyid = this.selectdata.id
283
- this.models.f_operat_type = '终止报建'
284
- this.models.f_state = '有效'
285
- this.models.f_describe = this.selectdata.f_user_name + '已终止报建'
286
- let data ={
287
- tablename:'t_project_stop',
288
- parameters:this.models
289
- }
290
- let http = new HttpResetClass()
291
- await http.load('POST','rs/logic/stopapply', {data:this.models},{resolveMsg: null, rejectMsg: "终止失败"})
292
- await http.load('POST','rs/logic/save', {data:data},{resolveMsg: null, rejectMsg: "添加失败"})
293
- this.closeback()
260
+ this.showview = false
261
+ // 特殊处理
262
+ this.special(model)
294
263
  this.$dispatch('close')
295
- },
296
- // 关闭终止备注弹框
297
- closeback() {
298
- this.stop_show = false
299
- },
300
- // 关闭报建弹框
301
- closeapply() {
302
- this.apply_show = false
303
- },
304
- closeAccept () {
305
- this.acceptprint = false
306
- },
307
- close () {
308
- this.acceptprint = false
309
- },
310
- printok () {
311
- this.$dispatch('success')
312
- },
313
- validateBill (val) {
314
- this.validateOk = !val.isOk
315
- this.billData.bill = val.bill
316
- },
317
- async printReceipt(model) {
318
- console.log('打印回单了11111111111111111model', model)
319
- this.acceptprint = true
320
- this.acceptUrl = 'rs/report/printReceiptbill'
321
- this.printData.f_work_type = `'${model.f_work_type}'`
322
- this.printData.f_news = `'${model.f_news}'`
323
- this.printData.f_user_name = `'${model.f_user_name}'`
324
- this.printData.f_address = `'${model.f_address}'`
325
- this.printData.f_user_phone = `'${model.f_phone}'`
326
- },
327
-
328
- async printbill(sellid) {
329
- let result = await this.$resetpost('rs/report/applyCharge_bill', {data: {condition: `c.id = ${sellid}`}}, {
330
- resolveMsg: null,
331
- rejectMsg: "提取数据出错,请重试!"
332
- })
333
- this.bill = result.data
334
- console.log('this.bill', this.bill)
335
- this.$nextTick(() => {
336
- this.$refs.reportprint.print()
337
- })
338
- },
339
- confirmbuyerinfo(args) {
340
- let drawbilldata = {
341
- sellid: this.selectsellid,
342
- buyerid: args.id,
343
- operator: this.$login.f.name
344
- }
345
- this.closebuyerinfo()
346
- this.$resetpost('rs/logic/applyDrawBill', {data: drawbilldata}, {resolveMsg: null, rejectMsg: "开发票失败"})
347
- .then((res) => {
348
- if (res.data.status === 200) {
349
- this.$showAlert('申请开具增值税电子发票成功,请稍后到报建功能中【报建收费】中查看电子发票', 'success', 5000)
350
- /*let n = 0
351
- var id = setInterval(async ()=>{
352
- if(n>=3){
353
- this.$showMessage('电子票延迟,请稍后查看!')
354
- clearInterval(id)
355
- }
356
- if (this.seeeticket(res.data) === 'success'){
357
- clearInterval(id)
358
- this.load()
359
- }
360
- n++
361
- this.$showAlert('电子发票开票中,请稍后...', 'info',3000)
362
- },3000)*/
363
- } else {
364
- this.$showAlert('电子发票开票失败,失败代码为:' + res.data.status, 'warning', 3000)
365
- }
366
- })
367
- },
368
- // 金额转大写
369
- smalltoBIG(n) {
370
- let fraction = ['角', '分'];
371
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
372
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
373
- let head = n < 0 ? '欠' : '';
374
- n = Math.abs(n);
375
-
376
- let s = '';
377
-
378
- for (var i = 0; i < fraction.length; i++) {
379
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
264
+ this.initializtion()
265
+ } else {
266
+ if (res1.data.msg) {
267
+ this.$showMessage(res1.data.msg)
380
268
  }
381
- s = s || '整';
382
- n = Math.floor(n);
269
+ }
270
+ this.apply_show = false
271
+ },
272
+ // 终止报建
273
+ async stopapplys () {
274
+ this.models = Object.assign({}, this.selectdata, this.models)
275
+ this.models.id = null
276
+ this.models.applyid = this.selectdata.id
277
+ this.models.f_operat_type = '终止报建'
278
+ this.models.f_state = '有效'
279
+ this.models.f_describe = this.selectdata.f_user_name + '已终止报建'
280
+ let data ={
281
+ tablename:'t_project_stop',
282
+ parameters:this.models
283
+ }
284
+ let http = new HttpResetClass()
285
+ await http.load('POST','rs/logic/stopapply', {data:this.models},{resolveMsg: null, rejectMsg: "终止失败"})
286
+ await http.load('POST','rs/logic/save', {data:data},{resolveMsg: null, rejectMsg: "添加失败"})
287
+ this.closeback()
288
+ this.$dispatch('close')
289
+ },
290
+ // 关闭终止备注弹框
291
+ closeback() {
292
+ this.stop_show = false
293
+ },
294
+ // 关闭报建弹框
295
+ closeapply() {
296
+ this.apply_show = false
297
+ },
298
+ closeAccept () {
299
+ this.acceptprint = false
300
+ },
301
+ close () {
302
+ this.acceptprint = false
303
+ },
304
+ printok () {
305
+ this.$dispatch('success')
306
+ },
307
+ validateBill (val) {
308
+ this.validateOk = !val.isOk
309
+ this.billData.bill = val.bill
310
+ },
311
+ async printReceipt(model) {
312
+ console.log('打印回单了11111111111111111model', model)
313
+ this.acceptprint = true
314
+ this.acceptUrl = 'rs/report/printReceiptbill'
315
+ this.printData.f_work_type = `'${model.f_work_type}'`
316
+ this.printData.f_news = `'${model.f_news}'`
317
+ this.printData.f_user_name = `'${model.f_user_name}'`
318
+ this.printData.f_address = `'${model.f_address}'`
319
+ this.printData.f_user_phone = `'${model.f_phone}'`
320
+ },
383
321
 
384
- for (var i = 0; i < unit[0].length && n > 0; i++) {
385
- let p = '';
386
- for (var j = 0; j < unit[1].length && n > 0; j++) {
387
- p = digit[n % 10] + unit[1][j] + p;
388
- n = Math.floor(n / 10);
322
+ async printbill(sellid) {
323
+ let result = await this.$resetpost('rs/report/applyCharge_bill', {data: {condition: `c.id = ${sellid}`}}, {
324
+ resolveMsg: null,
325
+ rejectMsg: "提取数据出错,请重试!"
326
+ })
327
+ this.bill = result.data
328
+ console.log('this.bill', this.bill)
329
+ this.$nextTick(() => {
330
+ this.$refs.reportprint.print()
331
+ })
332
+ },
333
+ confirmbuyerinfo(args) {
334
+ let drawbilldata = {
335
+ sellid: this.selectsellid,
336
+ buyerid: args.id,
337
+ operator: this.$login.f.name
338
+ }
339
+ this.closebuyerinfo()
340
+ this.$resetpost('rs/logic/applyDrawBill', {data: drawbilldata}, {resolveMsg: null, rejectMsg: "开发票失败"})
341
+ .then((res) => {
342
+ if (res.data.status === 200) {
343
+ this.$showAlert('申请开具增值税电子发票成功,请稍后到报建功能中【报建收费】中查看电子发票', 'success', 5000)
344
+ /*let n = 0
345
+ var id = setInterval(async ()=>{
346
+ if(n>=3){
347
+ this.$showMessage('电子票延迟,请稍后查看!')
348
+ clearInterval(id)
349
+ }
350
+ if (this.seeeticket(res.data) === 'success'){
351
+ clearInterval(id)
352
+ this.load()
353
+ }
354
+ n++
355
+ this.$showAlert('电子发票开票中,请稍后...', 'info',3000)
356
+ },3000)*/
357
+ } else {
358
+ this.$showAlert('电子发票开票失败,失败代码为:' + res.data.status, 'warning', 3000)
389
359
  }
390
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
360
+ })
361
+ },
362
+ // 金额转大写
363
+ smalltoBIG(n) {
364
+ let fraction = ['角', '分'];
365
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
366
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
367
+ let head = n < 0 ? '欠' : '';
368
+ n = Math.abs(n);
369
+
370
+ let s = '';
371
+
372
+ for (var i = 0; i < fraction.length; i++) {
373
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
374
+ }
375
+ s = s || '整';
376
+ n = Math.floor(n);
377
+
378
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
379
+ let p = '';
380
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
381
+ p = digit[n % 10] + unit[1][j] + p;
382
+ n = Math.floor(n / 10);
391
383
  }
392
- return head + s.replace(/(零.)*零元/, '').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
393
- },
394
- // 关闭模态框
395
- closebuyerinfo() {
396
- this.showbuyerinfo = false
397
- this.selectsellid = null
398
- },
399
- //根据票据流水号查看票据
400
- async seeeticket(val) {
401
- console.log('该票据流水号为:', val.f_fpqqlsh)
402
- var eticketData = await this.$resetpost('rs/sql/querySingleTable', {
384
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
385
+ }
386
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
387
+ },
388
+ // 关闭模态框
389
+ closebuyerinfo() {
390
+ this.showbuyerinfo = false
391
+ this.selectsellid = null
392
+ },
393
+ //根据票据流水号查看票据
394
+ async seeeticket(val) {
395
+ console.log('该票据流水号为:', val.f_fpqqlsh)
396
+ var eticketData = await this.$resetpost('rs/sql/querySingleTable', {
397
+ data: {
398
+ items: 'f_bill_url,f_url_code',
399
+ tablename: 't_eticket',
400
+ condition: `f_serial_number=${val.f_fpqqlsh}`
401
+ }
402
+ }, {resolveMsg: null, rejectMsg: null})
403
+ console.log('eticketData:', eticketData)
404
+ var data = eticketData.data[0]
405
+ if (data.f_bill_url && data.f_bill_url != '') {
406
+ console.log(data)
407
+ var auth = data.f_bill_url.split("/")
408
+ console.log("截取", auth)
409
+ var authCode = auth[auth.length - 1]
410
+ var url = `https://${auth[2]}/ent-views/fpExtract/get_fapiao.html?pwd=${data.f_url_code}&authCode=${authCode}`
411
+ this.$showAlert('开票成功!', 'success', 500)
412
+ window.open(url)
413
+ return 'success'
414
+ }
415
+ return 'fail'
416
+ },
417
+ async loadbuyer() {
418
+ //获取购货方信息
419
+ let querybuyerdata = {
420
+ tablename: 't_buyer_info',
421
+ condition: `f_process_id = '${this.selectdata.f_process_id}' and f_apply_num = '${this.selectdata.f_apply_num}'`
422
+ }
423
+ let buyerinfos = await this.$resetpost('rs/sql/singleTable', {data: querybuyerdata}, {
424
+ resolveMsg: null,
425
+ rejectMsg: '获取购货方信息失败'
426
+ })
427
+ this.buyerinfo.rows = buyerinfos.data
428
+ },
429
+ /*
430
+ ============================================收费临时使用结束
431
+ */
432
+ // AOP后续特殊化处理
433
+ async special(model) {
434
+ if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '分支流程异步处理') {
435
+ // 分支流程异步处理
436
+ let http = new HttpResetClass();
437
+ let res = await http.load('POST', 'rs/logic/branchsyncprocess', {
403
438
  data: {
404
- items: 'f_bill_url,f_url_code',
405
- tablename: 't_eticket',
406
- condition: `f_serial_number=${val.f_fpqqlsh}`
439
+ model: model,
440
+ loginUser: this.$login.f
407
441
  }
408
- }, {resolveMsg: null, rejectMsg: null})
409
- console.log('eticketData:', eticketData)
410
- var data = eticketData.data[0]
411
- if (data.f_bill_url && data.f_bill_url != '') {
412
- console.log(data)
413
- var auth = data.f_bill_url.split("/")
414
- console.log("截取", auth)
415
- var authCode = auth[auth.length - 1]
416
- var url = `https://${auth[2]}/ent-views/fpExtract/get_fapiao.html?pwd=${data.f_url_code}&authCode=${authCode}`
417
- this.$showAlert('开票成功!', 'success', 500)
418
- window.open(url)
419
- return 'success'
420
- }
421
- return 'fail'
422
- },
423
- async loadbuyer() {
424
- //获取购货方信息
425
- let querybuyerdata = {
426
- tablename: 't_buyer_info',
427
- condition: `f_process_id = '${this.selectdata.f_process_id}' and f_apply_num = '${this.selectdata.f_apply_num}'`
428
- }
429
- let buyerinfos = await this.$resetpost('rs/sql/singleTable', {data: querybuyerdata}, {
430
- resolveMsg: null,
431
- rejectMsg: '获取购货方信息失败'
432
- })
433
- this.buyerinfo.rows = buyerinfos.data
434
- },
435
- /*
436
- ============================================收费临时使用结束
437
- */
438
- // AOP后续特殊化处理
439
- async special(model) {
440
- if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '分支流程异步处理') {
441
- // 分支流程异步处理
442
- let http = new HttpResetClass();
443
- let res = await http.load('POST', 'rs/logic/branchsyncprocess', {
444
- data: {
445
- model: model,
446
- loginUser: this.$login.f
447
- }
448
- }, {resolveMsg: null, rejectMsg: '分支流程异步处理保存失败'})
449
- console.log("分支流程异步处理:", JSON.stringify(res.data))
450
- }
442
+ }, {resolveMsg: null, rejectMsg: '分支流程异步处理保存失败'})
443
+ console.log("分支流程异步处理:", JSON.stringify(res.data))
444
+ }
451
445
 
452
- if (this.data.distribute_async && model.button.button_name === '下发') {
453
- // 同流程节点异步处理
454
- let http = new HttpResetClass();
455
- let res = await http.load('POST', 'rs/logic/syncprocess', {
456
- data: {
457
- model: model,
458
- loginUser: this.$login.f
459
- }
460
- }, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
461
- console.log("流程的异步处理:", JSON.stringify(res.data))
462
- }
463
- if (this.data.distribute_async && model.button.button_name === '完成') {
464
- // 强制结束
465
- let http = new HttpResetClass();
466
- let res = await http.load('POST', 'rs/logic/stoprocess', {
467
- data: {
468
- model: model,
469
- loginUser: this.$login.f
470
- }
471
- }, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
472
- console.log("流程的异步处理:", JSON.stringify(res.data))
473
- }
474
- },
475
- // 组件初始化操作
476
- refurbish(val) {
477
- this.selectdata = val
478
- this.json_datas = this.$workflow_vue
479
- console.log("初始化jsonDataS==", this.json_datas)
480
- let sum = 0
481
- let jsonData = {}
482
- if(!this.json_datas||!this.json_datas.activitys||this.json_datas.activitys.length==0){
483
- this.$showMessage("网络故障,请刷新页面")
484
- return
485
- }
486
- for (let i = 0; i < this.json_datas.activitys.length; i++) {
487
- if (this.selectdata.defname == this.json_datas.activitys[i].title) {
488
- jsonData = this.json_datas.activitys[i]
489
- sum++
446
+ if (this.data.distribute_async && model.button.button_name === '下发') {
447
+ // 同流程节点异步处理
448
+ let http = new HttpResetClass();
449
+ let res = await http.load('POST', 'rs/logic/syncprocess', {
450
+ data: {
451
+ model: model,
452
+ loginUser: this.$login.f
490
453
  }
491
- }
492
- for (let j = 0; j < jsonData.fields.length; j++) {
493
- jsonData.fields[j].value = ''
494
- console.log("是否有default属性jsonData.fields[j]", jsonData.fields[j])
495
- if (jsonData.fields[j].default) {
496
- jsonData.fields[j].value = jsonData.fields[j].default
454
+ }, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
455
+ console.log("流程的异步处理:", JSON.stringify(res.data))
456
+ }
457
+ if (this.data.distribute_async && model.button.button_name === '完成') {
458
+ // 强制结束
459
+ let http = new HttpResetClass();
460
+ let res = await http.load('POST', 'rs/logic/stoprocess', {
461
+ data: {
462
+ model: model,
463
+ loginUser: this.$login.f
497
464
  }
465
+ }, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
466
+ console.log("流程的异步处理:", JSON.stringify(res.data))
467
+ }
468
+ },
469
+ // 组件初始化操作
470
+ refurbish(val) {
471
+ this.selectdata = val
472
+ this.json_datas = this.$workflow_vue
473
+ console.log("初始化jsonDataS==", this.json_datas)
474
+ let sum = 0
475
+ let jsonData = {}
476
+ if(!this.json_datas||!this.json_datas.activitys||this.json_datas.activitys.length==0){
477
+ this.$showMessage("网络故障,请刷新页面")
478
+ return
479
+ }
480
+ for (let i = 0; i < this.json_datas.activitys.length; i++) {
481
+ if (this.selectdata.defname == this.json_datas.activitys[i].title) {
482
+ jsonData = this.json_datas.activitys[i]
483
+ sum++
498
484
  }
499
- if (sum == 1) {
500
- console.log("jsonData==", jsonData)
501
- this.data = null
502
- this.data = jsonData
503
- this.initializtion()
504
- } else if (sum == 0) {
505
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
506
- } else {
507
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
508
- }
509
- },
510
- //生成派工单号
511
- createpgd() {
512
- this.pgd = "BJ"
513
- var d = new Date()
514
- this.pgd+=d.getFullYear()
515
- if(d.getMonth() + 1<10){
516
- this.pgd+='0'+(d.getMonth() + 1)
517
- }
518
- else{
519
- this.pgd+=(d.getMonth() + 1)
520
- }
521
- if(d.getDate() <10){
522
- this.pgd+='0'+d.getDate()
523
- }
524
- else{
525
- this.pgd+=d.getDate()
526
- }
527
- if(d.getHours() <10){
528
- this.pgd+='0'+d.getHours()
529
- }
530
- else{
531
- this.pgd+=d.getHours()
532
- }
533
- if(d.getMinutes() <10){
534
- this.pgd+='0'+d.getMinutes()
535
- }
536
- else{
537
- this.pgd+=d.getMinutes()
538
- }
539
- if(d.getSeconds() <10){
540
- this.pgd+='0'+d.getSeconds()
541
- }
542
- else{
543
- this.pgd+=d.getSeconds()
485
+ }
486
+ for (let j = 0; j < jsonData.fields.length; j++) {
487
+ jsonData.fields[j].value = ''
488
+ console.log("是否有default属性jsonData.fields[j]", jsonData.fields[j])
489
+ if (jsonData.fields[j].default) {
490
+ jsonData.fields[j].value = jsonData.fields[j].default
544
491
  }
545
- },
492
+ }
493
+ if (sum == 1) {
494
+ console.log("jsonData==", jsonData)
495
+ this.data = null
496
+ this.data = jsonData
497
+ this.initializtion()
498
+ } else if (sum == 0) {
499
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
500
+ } else {
501
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
502
+ }
503
+ },
504
+ //生成派工单号
505
+ createpgd() {
506
+ this.pgd = "BJ"
507
+ var d = new Date()
508
+ this.pgd+=d.getFullYear()
509
+ if(d.getMonth() + 1<10){
510
+ this.pgd+='0'+(d.getMonth() + 1)
511
+ }
512
+ else{
513
+ this.pgd+=(d.getMonth() + 1)
514
+ }
515
+ if(d.getDate() <10){
516
+ this.pgd+='0'+d.getDate()
517
+ }
518
+ else{
519
+ this.pgd+=d.getDate()
520
+ }
521
+ if(d.getHours() <10){
522
+ this.pgd+='0'+d.getHours()
523
+ }
524
+ else{
525
+ this.pgd+=d.getHours()
526
+ }
527
+ if(d.getMinutes() <10){
528
+ this.pgd+='0'+d.getMinutes()
529
+ }
530
+ else{
531
+ this.pgd+=d.getMinutes()
532
+ }
533
+ if(d.getSeconds() <10){
534
+ this.pgd+='0'+d.getSeconds()
535
+ }
536
+ else{
537
+ this.pgd+=d.getSeconds()
538
+ }
539
+ },
546
540
 
547
541
 
548
542
 
549
- // AOP:进入vue组件前初始化内容
550
- // json配置数据处理 比如下拉框的options
551
- async initializtion() {
552
- console.log("this.data.table", this.data.tables)
553
- this.showview = false
554
- // 有合同号不给合同表里插入数据
555
- for(let i=0;i<this.data.tables.length;i++){
556
- if('t_contract'==this.data.tables[i]&&this.selectdata.f_contract_number){
557
- this.data.tables.splice(i,1)
558
- }
543
+ // AOP:进入vue组件前初始化内容
544
+ // json配置数据处理 比如下拉框的options
545
+ async initializtion() {
546
+ console.log("this.data.table", this.data.tables)
547
+ this.showview = false
548
+ // 有合同号不给合同表里插入数据
549
+ for(let i=0;i<this.data.tables.length;i++){
550
+ if('t_contract'==this.data.tables[i]&&this.selectdata.f_contract_number){
551
+ this.data.tables.splice(i,1)
559
552
  }
560
- // 下发人 options 处理,options初始化
561
- if (this.selectdata.defname.indexOf('派单')>=0&&this.selectdata.actorexpression) {
562
- let http = new HttpResetClass()
563
- http.load('POST', 'rs/search', `{"source":"this.getParentByType($organization$).getChildByName($工程部门$).getChildByName($工程部门负责人$).getChildren()","userid":"${this.$login.f.id}"}`, {
564
- resolveMsg: null,
565
- rejectMsg: null
566
- }).then((res)=>{
567
-
568
-
569
- let jsonString = JSON.stringify(res.data)
570
- let jsonArray = []
571
- if (jsonString.startsWith("{")) {
572
- jsonArray.push(res.data)
573
- res.data = jsonArray
574
- }
575
- this.department_search = res.data
576
- if (this.department_search&&this.showview) {
577
- let array = []
578
- for (let k = 0; k < this.department_search.length; k++) {
579
- array.push({
580
- label: this.department_search[k].name,
581
- value: {id: this.department_search[k].id, name: this.department_search[k].name}
582
- })
553
+ }
554
+ // 下发人 options 处理,options初始化
555
+ if (this.selectdata.defname.indexOf('派单')>=0&&this.selectdata.actorexpression) {
556
+ let http = new HttpResetClass()
557
+ http.load('POST', 'rs/search', `{"source":"this.getParentByType($organization$).getChildByName($工程部门$).getChildByName($工程部门负责人$).getChildren()","userid":"${this.$login.f.id}"}`, {
558
+ resolveMsg: null,
559
+ rejectMsg: null
560
+ }).then((res)=>{
561
+
562
+
563
+ let jsonString = JSON.stringify(res.data)
564
+ let jsonArray = []
565
+ if (jsonString.startsWith("{")) {
566
+ jsonArray.push(res.data)
567
+ res.data = jsonArray
568
+ }
569
+ this.department_search = res.data
570
+ if (this.department_search&&this.showview) {
571
+ let array = []
572
+ for (let k = 0; k < this.department_search.length; k++) {
573
+ array.push({
574
+ label: this.department_search[k].name,
575
+ value: {id: this.department_search[k].id, name: this.department_search[k].name}
576
+ })
577
+ }
578
+ for(let x=0;x<this.data.buttons.length;x++){
579
+ if(this.data&&this.data.buttons[x].button_name=="下发"){
580
+ this.data.buttons[x].button_fields[0].options = array
583
581
  }
584
- for(let x=0;x<this.data.buttons.length;x++){
585
- if(this.data&&this.data.buttons[x].button_name=="下发"){
586
- this.data.buttons[x].button_fields[0].options = array
587
- }
588
- if(this.show_data &&this.show_data.buttons[x].button_name=="下发"){
589
- this.show_data.buttons[x].button_fields[0].options = array
590
- }
582
+ if(this.show_data &&this.show_data.buttons[x].button_name=="下发"){
583
+ this.show_data.buttons[x].button_fields[0].options = array
591
584
  }
592
585
  }
593
- })
594
- }
586
+ }
587
+ })
588
+ }
595
589
 
596
- //debugger
590
+ //debugger
597
591
 
598
- // selectdata 填充 data
599
- this.data = Object.assign({}, this.data, this.selectdata)
600
- // onetomany 数据获取
601
- if (this.data.onetomany) {
602
- console.log('判断是onetomany,this.data.onetomany的数据为=>' + JSON.stringify(this.data.onetomany))
603
- for (let index = 0; index < this.data.onetomany.length; index++) {
604
- let http = new HttpResetClass()
605
- let data = {}
606
- if (this.data.onetomany[index].tables[0] == 't_charge_record') {
607
- data = {
608
- tablename: this.data.onetomany[index].tables[0],
609
- condition: `f_apply_num = '${this.selectdata.f_apply_num}' and f_process_id='${this.selectdata.f_process_id}' and f_charging_status != '作废'`
610
- }
611
- } else {
612
- data = {
613
- tablename: this.data.onetomany[index].tables[0],
614
- condition: `f_process_id='${this.selectdata.f_process_id}'`
615
- }
592
+ // selectdata 填充 data
593
+ this.data = Object.assign({}, this.data, this.selectdata)
594
+ // onetomany 数据获取
595
+ if (this.data.onetomany) {
596
+ console.log('判断是onetomany,this.data.onetomany的数据为=>' + JSON.stringify(this.data.onetomany))
597
+ for (let index = 0; index < this.data.onetomany.length; index++) {
598
+ let http = new HttpResetClass()
599
+ let data = {}
600
+ if (this.data.onetomany[index].tables[0] == 't_charge_record') {
601
+ data = {
602
+ tablename: this.data.onetomany[index].tables[0],
603
+ condition: `f_apply_num = '${this.selectdata.f_apply_num}' and f_process_id='${this.selectdata.f_process_id}' and f_charging_status != '作废'`
616
604
  }
617
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
618
- resolveMsg: null,
619
- rejectMsg: 'onetomany查询失败'
620
- })
621
- // 初始化 onetomany
622
- let rows = []
623
- console.log('查询返回结果res.data=>' + JSON.stringify(res.data))
624
- this.data.onetomany[index].rows = res.data
625
- // console.log(JSON.stringify('this.data.onetomany[index].rows=>' + JSON.stringify(this.data.onetomany[index].rows)))
626
-
627
- // 初始化onetomany中的fields
628
- for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
629
- // 如果配置类型为select,优先从参数列表获取options
630
- if (this.data.onetomany[index].fields[j].type === 'select') {
631
- let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
632
- if (temp && temp.length > 0) {
633
- this.data.onetomany[index].fields[j].options = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
634
- }
605
+ } else {
606
+ data = {
607
+ tablename: this.data.onetomany[index].tables[0],
608
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
609
+ }
610
+ }
611
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
612
+ resolveMsg: null,
613
+ rejectMsg: 'onetomany查询失败'
614
+ })
615
+ // 初始化 onetomany
616
+ let rows = []
617
+ console.log('查询返回结果res.data=>' + JSON.stringify(res.data))
618
+ this.data.onetomany[index].rows = res.data
619
+ // console.log(JSON.stringify('this.data.onetomany[index].rows=>' + JSON.stringify(this.data.onetomany[index].rows)))
620
+
621
+ // 初始化onetomany中的fields
622
+ for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
623
+ // 如果配置类型为select,优先从参数列表获取options
624
+ if (this.data.onetomany[index].fields[j].type === 'select') {
625
+ let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
626
+ if (temp && temp.length > 0) {
627
+ this.data.onetomany[index].fields[j].options = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
635
628
  }
636
629
  }
637
630
  }
638
631
  }
639
- // 初始化 fields
640
- for (let i = 0; i < this.data.fields.length; i++) {
641
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
642
- if (this.selectdata[this.data.fields[i].field]) {
643
- if (String(this.selectdata[this.data.fields[i].field]).startsWith("{")) {
644
- this.data.fields[i].value = JSON.parse(this.selectdata[this.data.fields[i].field])
645
- } else {
646
- this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
647
- }
632
+ }
633
+ // 初始化 fields
634
+ for (let i = 0; i < this.data.fields.length; i++) {
635
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
636
+ if (this.selectdata[this.data.fields[i].field]) {
637
+ if (String(this.selectdata[this.data.fields[i].field]).startsWith("{")) {
638
+ this.data.fields[i].value = JSON.parse(this.selectdata[this.data.fields[i].field])
639
+ } else {
640
+ this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
641
+ }
642
+
643
+ }
644
+ // 如果配置类型为select,优先从参数列表获取options
645
+ if (this.data.fields[i].type === 'select') {
646
+ let temp = Vue.$appdata.getParam(this.data.fields[i].label)
647
+ if (temp && temp.length > 0) {
648
+ this.data.fields[i].options = Vue.$appdata.getParam(this.data.fields[i].label)
649
+ }
650
+ }
648
651
 
652
+ if (this.data.defname === '工程结算') {
653
+ var a = 0
654
+ var b = 0
655
+ var c = 0
656
+ for (let i = 0; i < this.data.fields.length; i++) {
657
+ if (this.data.fields[i].label === '最终核算成本金额') {
658
+ this.data.fields[i].value = (this.cost + this.number)
659
+ a = this.data.fields[i].value
660
+ }
661
+ if (this.data.fields[i].label === '合同总金额') {
662
+ b = this.data.fields[i].value
663
+ }
664
+ if (this.data.fields[i].label === '材料成本金额') {
665
+ this.data.fields[i].value = this.number
666
+ }
667
+ if (this.data.fields[i].label === '其他成本金额') {
668
+ this.data.fields[i].value = this.cost
669
+ }
649
670
  }
650
- // 如果配置类型为select,优先从参数列表获取options
651
- if (this.data.fields[i].type === 'select') {
652
- let temp = Vue.$appdata.getParam(this.data.fields[i].label)
653
- if (temp && temp.length > 0) {
654
- this.data.fields[i].options = Vue.$appdata.getParam(this.data.fields[i].label)
671
+ c = b - a
672
+ for (let i = 0; i < this.data.fields.length; i++) {
673
+ if (this.data.fields[i].label === '工程盈利') {
674
+ this.data.fields[i].value = c
655
675
  }
656
676
  }
677
+ }
678
+ if (this.selectdata.defname.indexOf('派单')>=0) {
679
+ let money=0
657
680
 
658
- if (this.data.defname === '工程结算') {
659
- var a = 0
660
- var b = 0
661
- var c = 0
662
- for (let i = 0; i < this.data.fields.length; i++) {
663
- if (this.data.fields[i].label === '最终核算成本金额') {
664
- this.data.fields[i].value = (this.cost + this.number)
665
- a = this.data.fields[i].value
666
- }
667
- if (this.data.fields[i].label === '合同总金额') {
668
- b = this.data.fields[i].value
669
- }
670
- if (this.data.fields[i].label === '材料成本金额') {
671
- this.data.fields[i].value = this.number
672
- }
673
- if (this.data.fields[i].label === '其他成本金额') {
674
- this.data.fields[i].value = this.cost
675
- }
681
+ for (let i = 0; i < this.data.fields.length; i++) {
682
+ if (this.data.fields[i].label === '派工单号') {
683
+ console.log("给派工单号赋值")
684
+ this.createpgd()
685
+ console.log(this.pgd)
686
+ this.data.fields[i].value = this.pgd
676
687
  }
677
- c = b - a
678
- for (let i = 0; i < this.data.fields.length; i++) {
679
- if (this.data.fields[i].label === '工程盈利') {
680
- this.data.fields[i].value = c
681
- }
688
+ if (this.data.fields[i].label === '合同总金额') {
689
+ console.log('合同总金额===>'+this.data.fields[i].value )
690
+ money=this.data.fields[i].value
691
+ }
692
+ let dealmoney=0;
693
+ if (this.data.fields[i].label == '累计缴费金额') {
694
+ dealmoney=this.data.fields[i].value
695
+ console.log('累计缴费金额===>'+dealmoney )
682
696
  }
683
- }
684
- if (this.selectdata.defname.indexOf('派单')>=0) {
685
- let money=0
686
697
 
687
- for (let i = 0; i < this.data.fields.length; i++) {
688
- if (this.data.fields[i].label === '派工单号') {
689
- console.log("给派工单号赋值")
690
- this.createpgd()
691
- console.log(this.pgd)
692
- this.data.fields[i].value = this.pgd
693
- }
694
- if (this.data.fields[i].label === '合同总金额') {
695
- console.log('合同总金额===>'+this.data.fields[i].value )
696
- money=this.data.fields[i].value
697
- }
698
- let dealmoney=0;
699
- if (this.data.fields[i].label == '累计缴费金额') {
700
- dealmoney=this.data.fields[i].value
701
- console.log('累计缴费金额===>'+dealmoney )
702
- }
703
-
704
- if (this.data.fields[i ].label == '未结总金额') {
698
+ if (this.data.fields[i ].label == '未结总金额') {
705
699
  /// if(money=="" || dealmoney==""){
706
700
  /// money=0;
707
701
  /// dealmoney=0;
@@ -711,1489 +705,1489 @@
711
705
  /// dealmoney=0;
712
706
  /// }
713
707
  ///
714
- let othermoney = money-dealmoney;
715
- console.log('jine'+othermoney)
716
- this.data.fields[i].value=money-dealmoney
717
- console.log('未结总金额'+this.data.fields[i].value )
718
- }
719
- }
720
- }
721
- if(this.data.defname=="派单"){
722
- for (let i = 0; i < this.data.fields.length; i++) {
723
- if (this.data.fields[i].label === '未结总金额') {
724
- this.data.fields[i].value=0
725
- console.log("派单"+this.data.fields[i].value)
726
- }
708
+ let othermoney = money-dealmoney;
709
+ console.log('jine'+othermoney)
710
+ this.data.fields[i].value=money-dealmoney
711
+ console.log('未结总金额'+this.data.fields[i].value )
727
712
  }
728
713
  }
714
+ }
715
+ if(this.data.defname=="派单"){
716
+ for (let i = 0; i < this.data.fields.length; i++) {
717
+ if (this.data.fields[i].label === '未结总金额') {
718
+ this.data.fields[i].value=0
719
+ console.log("派单"+this.data.fields[i].value)
720
+ }
721
+ }
722
+ }
729
723
 
730
724
 
731
- if (this.selectdata.defname ==='报价审核') {
732
- let unaccount=0
733
- for (let i = 0; i < this.data.fields.length; i++) {
734
- if (this.data.fields[i].label === '费用合计') {
735
- console.log("算一下未结算金额")
736
- unaccount=this.data.fields[i].value
737
- }
738
- if (this.data.fields[i].label === '未结总金额') {
739
- this.data.fields[i].value=unaccount
740
- }
741
-
725
+ if (this.selectdata.defname ==='报价审核') {
726
+ let unaccount=0
727
+ for (let i = 0; i < this.data.fields.length; i++) {
728
+ if (this.data.fields[i].label === '费用合计') {
729
+ console.log("算一下未结算金额")
730
+ unaccount=this.data.fields[i].value
731
+ }
732
+ if (this.data.fields[i].label === '未结总金额') {
733
+ this.data.fields[i].value=unaccount
742
734
  }
735
+
743
736
  }
737
+ }
744
738
 
745
739
 
746
- if (this.data.defname === '收费') {
747
- let account_money=0
748
- let total_money=0
749
- let bill_money=0
750
- for (let i = 0; i < this.data.fields.length; i++) {
751
- if (this.data.fields[i].label === '合同金额') {
752
- total_money=this.data.fields[i].value
753
- }
754
- if (this.data.fields[i].label === '累计缴费金额') {
755
- account_money=this.data.fields[i].value
756
- }
757
- if (this.data.fields[i].label === '未结总金额') {
758
- this.data.fields[i].value=total_money-account_money
759
- }
760
- if (this.data.fields[i].label === '累计开票金额') {
761
- bill_money=this.data.fields[i].value
762
- }
763
- if (this.data.fields[i].label === '未开票金额') {
764
- this.data.fields[i].value=total_money-bill_money
740
+ if (this.data.defname === '收费') {
741
+ let account_money=0
742
+ let total_money=0
743
+ let bill_money=0
744
+ for (let i = 0; i < this.data.fields.length; i++) {
745
+ if (this.data.fields[i].label === '合同金额') {
746
+ total_money=this.data.fields[i].value
747
+ }
748
+ if (this.data.fields[i].label === '累计缴费金额') {
749
+ account_money=this.data.fields[i].value
750
+ }
751
+ if (this.data.fields[i].label === '未结总金额') {
752
+ this.data.fields[i].value=total_money-account_money
753
+ }
754
+ if (this.data.fields[i].label === '累计开票金额') {
755
+ bill_money=this.data.fields[i].value
756
+ }
757
+ if (this.data.fields[i].label === '未开票金额') {
758
+ this.data.fields[i].value=total_money-bill_money
765
759
 
766
- }
767
760
  }
768
761
  }
769
- // 特殊处理
770
- //施工环节 如果是个人报建需要提交表具信息
771
- if (this.data.defname === '施工') {
772
- for (let i = 0; i < this.data.fields.length; i++) {
773
- if (this.data.fields[i].label === '气表品牌'
774
- || this.data.fields[i].label === '气表型号'
775
- || this.data.fields[i].label === '气表厂家') {
776
- if (this.data.f_apply_type === '个人报建') {
777
- this.data.fields[i].hidden = false
778
- this.data.fields[i].required = true
779
- }
762
+ }
763
+ // 特殊处理
764
+ //施工环节 如果是个人报建需要提交表具信息
765
+ if (this.data.defname === '施工') {
766
+ for (let i = 0; i < this.data.fields.length; i++) {
767
+ if (this.data.fields[i].label === '气表品牌'
768
+ || this.data.fields[i].label === '气表型号'
769
+ || this.data.fields[i].label === '气表厂家') {
770
+ if (this.data.f_apply_type === '个人报建') {
771
+ this.data.fields[i].hidden = false
772
+ this.data.fields[i].required = true
780
773
  }
781
774
  }
782
775
  }
776
+ }
783
777
 
784
- // 特殊处理
785
- //施工环节 如果是个人报建需要提交表具信息
786
- if (this.data.defname === '安装通气') {
787
- for (let i = 0; i < this.data.fields.length; i++) {
788
- if (this.data.fields[i].label === '气表品牌'
789
- || this.data.fields[i].label === '气表型号'
790
- || this.data.fields[i].label === '气表厂家') {
791
- this.data.fields[i].required = true
792
- this.data.fields[i].hidden = false
793
- if(this.data.f_work_type=='改管'){
794
- this.data.fields[i].required = false
795
- }
796
-
797
- }
798
- if(this.data.fields[i].label === '验收结果'){
799
- this.data.fields[i].required = true
778
+ // 特殊处理
779
+ //施工环节 如果是个人报建需要提交表具信息
780
+ if (this.data.defname === '安装通气') {
781
+ for (let i = 0; i < this.data.fields.length; i++) {
782
+ if (this.data.fields[i].label === '气表品牌'
783
+ || this.data.fields[i].label === '气表型号'
784
+ || this.data.fields[i].label === '气表厂家') {
785
+ this.data.fields[i].required = true
786
+ this.data.fields[i].hidden = false
787
+ if(this.data.f_work_type=='改管'){
788
+ this.data.fields[i].required = false
800
789
  }
801
790
 
802
791
  }
803
- }
804
- if (this.data.defname === '设计报价') {
805
- for (let i = 0; i < this.data.fields.length; i++) {
806
- if (this.data.fields[i].label === '气表品牌'
807
- || this.data.fields[i].label === '气表型号') {
808
- this.data.fields[i].required = true
809
- this.data.fields[i].hidden = false
810
- if(this.data.f_work_type=='改管'){
811
- this.data.fields[i].required = false
812
- }
792
+ if(this.data.fields[i].label === '验收结果'){
793
+ this.data.fields[i].required = true
794
+ }
813
795
 
796
+ }
797
+ }
798
+ if (this.data.defname === '设计报价') {
799
+ for (let i = 0; i < this.data.fields.length; i++) {
800
+ if (this.data.fields[i].label === '气表品牌'
801
+ || this.data.fields[i].label === '气表型号') {
802
+ this.data.fields[i].required = true
803
+ this.data.fields[i].hidden = false
804
+ if(this.data.f_work_type=='改管'){
805
+ this.data.fields[i].required = false
814
806
  }
815
807
 
816
808
  }
809
+
817
810
  }
818
- if (this.data.defname === '现场勘查定价') {
819
- for (let i = 0; i < this.data.fields.length; i++) {
820
- if (this.data.fields[i].label === '勘查结果') {
821
- this.data.fields[i].required = true
822
- }
811
+ }
812
+ if (this.data.defname === '现场勘查定价') {
813
+ for (let i = 0; i < this.data.fields.length; i++) {
814
+ if (this.data.fields[i].label === '勘查结果') {
815
+ this.data.fields[i].required = true
823
816
  }
824
817
  }
825
- //通气环节可以调出施工环节的表信息来修改
826
- if (this.data.defname === '通气') {
827
- for (let i = 0; i < this.data.fields.length; i++) {
828
- if (this.data.fields[i].label === '气表品牌'
829
- || this.data.fields[i].label === '气表型号'
830
- || this.data.fields[i].label === '气表厂家') {
831
- if (this.data.fields[i].value != null && this.data.fields[i].value != '') {
832
- this.data.fields[i].hidden = false
833
- this.data.fields[i].required = true
834
- }
818
+ }
819
+ //通气环节可以调出施工环节的表信息来修改
820
+ if (this.data.defname === '通气') {
821
+ for (let i = 0; i < this.data.fields.length; i++) {
822
+ if (this.data.fields[i].label === '气表品牌'
823
+ || this.data.fields[i].label === '气表型号'
824
+ || this.data.fields[i].label === '气表厂家') {
825
+ if (this.data.fields[i].value != null && this.data.fields[i].value != '') {
826
+ this.data.fields[i].hidden = false
827
+ this.data.fields[i].required = true
835
828
  }
836
829
  }
837
830
  }
838
- let array = this.$login.f.rolesnames.split(',')
839
- if ((this.data.fields[i].label === '技术人员' || array.includes("工程技术部负责人"))&&(this.selectdata.defname=='勘察初设'||this.selectdata.defname=='任务分配'||this.selectdata.defname=='合同信息')) { //{"source":"this.getParentByType($organization$).getChildByName($技术人员$).getChildren()","userid":"296851"}
840
- let http = new HttpResetClass()
841
- let res = await http.load('POST', 'rs/search', `{"source":"this.getParentByType($organization$).getChildByName($工程技术部门$).getChildByName($技术人员$).getChildren()","userid":"${this.$login.f.id}"}`, {
842
- resolveMsg: null,
843
- rejectMsg:null // 'search查询技术人员失败,请联系管理员配置技术人员角色'
844
- })
845
- // console.log("search查询部门下所有人:", JSON.stringify(res.data))
846
- this.technologist = res.data
847
- if (this.technologist) {
848
- let array = []
849
- for (let k = 0; k < this.technologist.length; k++) {
850
- array.push({
851
- label: this.technologist[k].name,
852
- value: {name: this.technologist[k].name, id: this.technologist[k].id}
853
- })
854
- }
855
- if (!array.includes("工程技术部负责人")&&this.data.fields[i].label === '技术人员') {
856
- this.data.fields[i].options = array
857
- }
858
-
831
+ }
832
+ let array = this.$login.f.rolesnames.split(',')
833
+ if ((this.data.fields[i].label === '技术人员' || array.includes("工程技术部负责人"))&&(this.selectdata.defname=='勘察初设'||this.selectdata.defname=='任务分配'||this.selectdata.defname=='合同信息')) { //{"source":"this.getParentByType($organization$).getChildByName($技术人员$).getChildren()","userid":"296851"}
834
+ let http = new HttpResetClass()
835
+ let res = await http.load('POST', 'rs/search', `{"source":"this.getParentByType($organization$).getChildByName($工程技术部门$).getChildByName($技术人员$).getChildren()","userid":"${this.$login.f.id}"}`, {
836
+ resolveMsg: null,
837
+ rejectMsg:null // 'search查询技术人员失败,请联系管理员配置技术人员角色'
838
+ })
839
+ // console.log("search查询部门下所有人:", JSON.stringify(res.data))
840
+ this.technologist = res.data
841
+ if (this.technologist) {
842
+ let array = []
843
+ for (let k = 0; k < this.technologist.length; k++) {
844
+ array.push({
845
+ label: this.technologist[k].name,
846
+ value: {name: this.technologist[k].name, id: this.technologist[k].id}
847
+ })
859
848
  }
860
- }
861
- if (this.data.fields[i].label == '县/区') {
862
- let area = await this.$resetpost('rs/sql/singleTable', {
863
- data: {
864
- // items: 'f_bill_url,f_url_code',
865
- tablename: 't_pcd',
866
- condition: `f_filialeids = '${this.$login.f.f_orgids}'`
867
- }
868
- }, {resolveMsg: null, rejectMsg: null})
869
- let rs = []
870
- for (let i = 0; i < area.data.length; i++) {
871
- let temp = {
872
- label: area.data[i].f_pcd,
873
- value: area.data[i].f_pcd
874
- }
875
- rs.push(temp)
849
+ if (!array.includes("工程技术部负责人")&&this.data.fields[i].label === '技术人员') {
850
+ this.data.fields[i].options = array
876
851
  }
877
- this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
852
+
878
853
  }
879
- if (this.data.defname=='通气'&&this.data.fields[i].label == '小区名称') {
880
- let res = await this.$resetpost('rs/sql/singleTable', {
881
- data: {
882
- tablename: 't_area',
883
- condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_street='${this.data.f_street}'`
884
- }
885
- }, {resolveMsg: null, rejectMsg: null})
886
- let cs = []
887
- for (let i = 0; i < res.data.length; i++) {
888
- let temp = {
889
- label: res.data[i].f_residential_area,
890
- value: res.data[i].f_residential_area
891
- }
892
- cs.push(temp)
854
+ }
855
+ if (this.data.fields[i].label == '县/区') {
856
+ let area = await this.$resetpost('rs/sql/singleTable', {
857
+ data: {
858
+ // items: 'f_bill_url,f_url_code',
859
+ tablename: 't_pcd',
860
+ condition: `f_filialeids = '${this.$login.f.f_orgids}'`
893
861
  }
894
- this.data.fields[i].options = [{label: '全部', value: ''}, ...cs]
895
- }
896
- let gasbrand_id=''
897
- if (this.data.fields[i].label == '气表品牌'||this.data.fields[i].label == '表具') {
898
- let meterbrand = await this.$resetpost('rs/sql/singleTable', {
899
- data: {
900
- items: 'f_meter_brand',
901
- tablename: 't_gasbrand',
902
- condition: `f_filialeids = '${this.$login.f.f_orgids}'`
903
- }
904
- }, {resolveMsg: null, rejectMsg: null})
905
- let rs = []
906
- for (let i = 0; i < meterbrand.data.length; i++) {
907
- let temp = {
908
- label: meterbrand.data[i].f_meter_brand,
909
- value: meterbrand.data[i].f_meter_brand
910
- }
911
- rs.push(temp)
862
+ }, {resolveMsg: null, rejectMsg: null})
863
+ let rs = []
864
+ for (let i = 0; i < area.data.length; i++) {
865
+ let temp = {
866
+ label: area.data[i].f_pcd,
867
+ value: area.data[i].f_pcd
912
868
  }
913
- this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
869
+ rs.push(temp)
914
870
  }
915
- if (this.data.fields[i].label == '气表型号') {
916
- this.data.fields[i].options = [];
871
+ this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
872
+ }
873
+ if (this.data.defname=='通气'&&this.data.fields[i].label == '小区名称') {
874
+ let res = await this.$resetpost('rs/sql/singleTable', {
875
+ data: {
876
+ tablename: 't_area',
877
+ condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_street='${this.data.f_street}'`
878
+ }
879
+ }, {resolveMsg: null, rejectMsg: null})
880
+ let cs = []
881
+ for (let i = 0; i < res.data.length; i++) {
882
+ let temp = {
883
+ label: res.data[i].f_residential_area,
884
+ value: res.data[i].f_residential_area
885
+ }
886
+ cs.push(temp)
917
887
  }
918
- if (this.data.fields[i].label == '气价名称') {
919
- let meterbrand = await this.$resetpost('rs/sql/singleTable', {
920
- data: {
921
- items: 'f_price_name',
922
- tablename: 't_stairprice',
923
- condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_state= '有效' and getdate()>=f_perform_date and getdate()<=f_end_date `
924
- }
925
- }, {resolveMsg: null, rejectMsg: null})
926
- let rs = []
927
- for (let i = 0; i < meterbrand.data.length; i++) {
928
- let temp = {
929
- label: meterbrand.data[i].f_price_name,
930
- value: meterbrand.data[i].f_price_name
931
- }
932
- rs.push(temp)
888
+ this.data.fields[i].options = [{label: '全部', value: ''}, ...cs]
889
+ }
890
+ let gasbrand_id=''
891
+ if (this.data.fields[i].label == '气表品牌'||this.data.fields[i].label == '表具') {
892
+ let meterbrand = await this.$resetpost('rs/sql/singleTable', {
893
+ data: {
894
+ items: 'f_meter_brand',
895
+ tablename: 't_gasbrand',
896
+ condition: `f_filialeids = '${this.$login.f.f_orgids}'`
897
+ }
898
+ }, {resolveMsg: null, rejectMsg: null})
899
+ let rs = []
900
+ for (let i = 0; i < meterbrand.data.length; i++) {
901
+ let temp = {
902
+ label: meterbrand.data[i].f_meter_brand,
903
+ value: meterbrand.data[i].f_meter_brand
933
904
  }
934
- this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
905
+ rs.push(temp)
935
906
  }
936
- if (this.data.fields[i].label == '合同类型') {
937
- this.data.fields[i].value = '主合同'
907
+ this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
908
+ }
909
+ if (this.data.fields[i].label == '气表型号') {
910
+ this.data.fields[i].options = [];
911
+ }
912
+ if (this.data.fields[i].label == '气价名称') {
913
+ let meterbrand = await this.$resetpost('rs/sql/singleTable', {
914
+ data: {
915
+ items: 'f_price_name',
916
+ tablename: 't_stairprice',
917
+ condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_state= '有效' and getdate()>=f_perform_date and getdate()<=f_end_date `
918
+ }
919
+ }, {resolveMsg: null, rejectMsg: null})
920
+ let rs = []
921
+ for (let i = 0; i < meterbrand.data.length; i++) {
922
+ let temp = {
923
+ label: meterbrand.data[i].f_price_name,
924
+ value: meterbrand.data[i].f_price_name
925
+ }
926
+ rs.push(temp)
938
927
  }
939
- if (this.data.fields[i].label == '合同业务办理人') {
940
- if (this.selectdata.f_apply_kefu_employee) {
941
- if (this.selectdata.f_apply_kefu_employee.startsWith("{") && this.selectdata.f_apply_kefu_employee.endsWith("}")) {
942
- let temp = JSON.parse(this.selectdata.f_apply_kefu_employee)
928
+ this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
929
+ }
930
+ if (this.data.fields[i].label == '合同类型') {
931
+ this.data.fields[i].value = '主合同'
932
+ }
933
+ if (this.data.fields[i].label == '合同业务办理人') {
934
+ if (this.selectdata.f_apply_kefu_employee) {
935
+ if (this.selectdata.f_apply_kefu_employee.startsWith("{") && this.selectdata.f_apply_kefu_employee.endsWith("}")) {
936
+ let temp = JSON.parse(this.selectdata.f_apply_kefu_employee)
937
+ this.data.fields[i].value = temp.name
938
+ } else {
939
+ this.data.fields[i].value = this.selectdata.f_apply_kefu_employee
940
+ }
941
+ } else {
942
+ if (this.selectdata.f_survey_name) {
943
+ if (this.selectdata.f_survey_name.startsWith("{") && this.selectdata.f_survey_name.endsWith("}")) {
944
+ let temp = JSON.parse(this.selectdata.f_survey_name)
943
945
  this.data.fields[i].value = temp.name
944
946
  } else {
945
- this.data.fields[i].value = this.selectdata.f_apply_kefu_employee
946
- }
947
- } else {
948
- if (this.selectdata.f_survey_name) {
949
- if (this.selectdata.f_survey_name.startsWith("{") && this.selectdata.f_survey_name.endsWith("}")) {
950
- let temp = JSON.parse(this.selectdata.f_survey_name)
951
- this.data.fields[i].value = temp.name
952
- } else {
953
- this.data.fields[i].value = this.selectdata.f_survey_name
954
- }
947
+ this.data.fields[i].value = this.selectdata.f_survey_name
955
948
  }
956
949
  }
957
950
  }
958
- if (this.data.fields[i].label == '合同编号' && !this.selectdata[this.data.fields[i].field] && this.selectdata.defname == '合同审核') {
959
- if (!this.$appdata.getSingleValue('所属公司编码')) {
960
- this.$showMessage(`请先去参数管理设置: 所属公司编码`)
951
+ }
952
+ if (this.data.fields[i].label == '合同编号' && !this.selectdata[this.data.fields[i].field] && this.selectdata.defname == '合同审核') {
953
+ if (!this.$appdata.getSingleValue('所属公司编码')) {
954
+ this.$showMessage(`请先去参数管理设置: 所属公司编码`)
955
+ }
956
+ if (!this.$appdata.getSingleValue(this.data.fields[i].label)) {
957
+ this.$showMessage(`请先去参数管理设置: ${this.data.fields[i].label}`)
958
+ } else {
959
+ let http = new HttpResetClass()
960
+ //获取购货方信息
961
+ let data = {
962
+ tablename: 't_singlevalue',
963
+ condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`
961
964
  }
962
- if (!this.$appdata.getSingleValue(this.data.fields[i].label)) {
963
- this.$showMessage(`请先去参数管理设置: ${this.data.fields[i].label}`)
964
- } else {
965
- let http = new HttpResetClass()
966
- //获取购货方信息
967
- let data = {
968
- tablename: 't_singlevalue',
969
- condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`
965
+ let res = await http.load('POST','rs/sql/singleTable', {data: data}, {
966
+ resolveMsg: null,
967
+ rejectMsg: '获取合同编号失败'
968
+ }).then((res)=>{
969
+ let temp = res.data[0].value
970
+ this.contract = temp
971
+ while (temp.length < 4) {
972
+ temp = '0' + temp
973
+ }
974
+ let dt = new Date()
975
+ this.data.fields[i].value = this.$appdata.getSingleValue('所属公司编码') + dt.getFullYear() + ((dt.getMonth() + 1) < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth()) + temp
976
+ if(this.showview){
977
+ this.$refs.service_show.data.fields[i].value = this.$appdata.getSingleValue('所属公司编码') + dt.getFullYear() + ((dt.getMonth() + 1) < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth()) + temp
978
+ this.$refs.service_show.update()
970
979
  }
971
- let res = await http.load('POST','rs/sql/singleTable', {data: data}, {
972
- resolveMsg: null,
973
- rejectMsg: '获取合同编号失败'
974
- }).then((res)=>{
975
- let temp = res.data[0].value
976
- this.contract = temp
977
- while (temp.length < 4) {
978
- temp = '0' + temp
979
- }
980
- let dt = new Date()
981
- this.data.fields[i].value = this.$appdata.getSingleValue('所属公司编码') + dt.getFullYear() + ((dt.getMonth() + 1) < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth()) + temp
982
- if(this.showview){
983
- this.$refs.service_show.data.fields[i].value = this.$appdata.getSingleValue('所属公司编码') + dt.getFullYear() + ((dt.getMonth() + 1) < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth()) + temp
984
- this.$refs.service_show.update()
985
- }
986
980
 
987
- })
988
- // this.$refs.service_show.update()
989
- }
990
- }
991
- if(this.data.defname=='通气'){
992
- if (this.data.f_user_type == '非民用' && this.data.fields[i].label == '小区名称'){
993
- this.data.fields[i].hidden = true
994
- this.data.fields[i].required = false
995
- this.data.fields[i+1].hidden = true
996
- this.data.fields[i+1].required = false
997
- this.data.fields[i+2].hidden = true
998
- this.data.fields[i+2].required = false
999
- }
1000
- if (this.data.f_work_type == '改管' && this.data.fields[i].label == '阀门井'){
1001
- this.data.fields[i].hidden = true
1002
- this.data.fields[i].required = false
1003
- this.data.fields[i+1].hidden = true
1004
- this.data.fields[i+1].required = false
1005
- this.data.fields[i+2].hidden = true
1006
- this.data.fields[i+2].required = false
1007
- }
1008
- if (this.data.f_work_type == '改管' && this.data.fields[i].label == '表具'){
1009
- this.data.fields[i].hidden = true
1010
- this.data.fields[i].required = false
1011
- this.data.fields[i+1].hidden = true
1012
- this.data.fields[i+1].required = false
1013
- this.data.fields[i+2].hidden = true
1014
- this.data.fields[i+2].required = false
1015
- }
1016
- }
1017
- }
1018
- // 初始化 buttons_fields
1019
- //debugger
1020
- for (let i = 0; i < this.data.buttons.length; i++) {
1021
- if (this.data.buttons[i].button_fields) {
1022
- for (let j = 0; j < this.data.buttons[i].button_fields.length; j++) {
1023
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
1024
- if (this.selectdata[this.data.buttons[i].button_fields[j].field]) {
1025
- this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
1026
- }
1027
- // 如果配置类型为select,优先从参数列表获取options
1028
- if (this.data.buttons[i].button_fields[j].type === 'select' && this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)) {
1029
- this.data.buttons[i].button_fields[j].options = this.$appdata.getParam(this.data.buttons[i].button_fields[j].label).trim()
1030
- }
1031
- // 下发特殊配置
1032
- if (this.data.buttons[i].button_name === '下发') {
1033
- if (this.data.buttons[i].button_fields.length === 1) {
1034
- // value初始化
1035
- // if(this.department_search){
1036
- if (this.selectdata[this.data.buttons[i].button_fields[0].field]) {
1037
- for (let k = 0; k < this.department_search.length; k++) {
1038
- // 将id转换为name
1039
- if (Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])) {
1040
- this.data.buttons[i].button_fields[0].value = {
1041
- id: this.department_search[k].id,
1042
- name: this.department_search[k].name
1043
- }
981
+ })
982
+ // this.$refs.service_show.update()
983
+ }
984
+ }
985
+ if(this.data.defname=='通气'){
986
+ if (this.data.f_user_type == '非民用' && this.data.fields[i].label == '小区名称'){
987
+ this.data.fields[i].hidden = true
988
+ this.data.fields[i].required = false
989
+ this.data.fields[i+1].hidden = true
990
+ this.data.fields[i+1].required = false
991
+ this.data.fields[i+2].hidden = true
992
+ this.data.fields[i+2].required = false
993
+ }
994
+ if (this.data.f_work_type == '改管' && this.data.fields[i].label == '阀门井'){
995
+ this.data.fields[i].hidden = true
996
+ this.data.fields[i].required = false
997
+ this.data.fields[i+1].hidden = true
998
+ this.data.fields[i+1].required = false
999
+ this.data.fields[i+2].hidden = true
1000
+ this.data.fields[i+2].required = false
1001
+ }
1002
+ if (this.data.f_work_type == '改管' && this.data.fields[i].label == '表具'){
1003
+ this.data.fields[i].hidden = true
1004
+ this.data.fields[i].required = false
1005
+ this.data.fields[i+1].hidden = true
1006
+ this.data.fields[i+1].required = false
1007
+ this.data.fields[i+2].hidden = true
1008
+ this.data.fields[i+2].required = false
1009
+ }
1010
+ }
1011
+ }
1012
+ // 初始化 buttons_fields
1013
+ //debugger
1014
+ for (let i = 0; i < this.data.buttons.length; i++) {
1015
+ if (this.data.buttons[i].button_fields) {
1016
+ for (let j = 0; j < this.data.buttons[i].button_fields.length; j++) {
1017
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
1018
+ if (this.selectdata[this.data.buttons[i].button_fields[j].field]) {
1019
+ this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
1020
+ }
1021
+ // 如果配置类型为select,优先从参数列表获取options
1022
+ if (this.data.buttons[i].button_fields[j].type === 'select' && this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)) {
1023
+ this.data.buttons[i].button_fields[j].options = this.$appdata.getParam(this.data.buttons[i].button_fields[j].label).trim()
1024
+ }
1025
+ // 下发特殊配置
1026
+ if (this.data.buttons[i].button_name === '下发') {
1027
+ if (this.data.buttons[i].button_fields.length === 1) {
1028
+ // value初始化
1029
+ // if(this.department_search){
1030
+ if (this.selectdata[this.data.buttons[i].button_fields[0].field]) {
1031
+ for (let k = 0; k < this.department_search.length; k++) {
1032
+ // 将id转换为name
1033
+ if (Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])) {
1034
+ this.data.buttons[i].button_fields[0].value = {
1035
+ id: this.department_search[k].id,
1036
+ name: this.department_search[k].name
1044
1037
  }
1045
1038
  }
1046
1039
  }
1040
+ }
1047
1041
 
1048
- if (this.department_search) {
1049
- let array = []
1050
- for (let k = 0; k < this.department_search.length; k++) {
1051
- array.push({
1052
- label: this.department_search[k].name,
1053
- value: {id: this.department_search[k].id, name: this.department_search[k].name}
1054
- })
1055
- }
1056
- this.data.buttons[i].button_fields[0].options = array
1042
+ if (this.department_search) {
1043
+ let array = []
1044
+ for (let k = 0; k < this.department_search.length; k++) {
1045
+ array.push({
1046
+ label: this.department_search[k].name,
1047
+ value: {id: this.department_search[k].id, name: this.department_search[k].name}
1048
+ })
1057
1049
  }
1058
- let array = this.$login.f.rolesnames.split(',')
1059
- if (this.selectdata.defname == '任务分配' && array.includes("工程技术部负责人")) {
1060
- let array = []
1061
- for (let k = 0; k < this.technologist.length; k++) {
1062
- array.push({
1063
- label: this.technologist[k].name,
1064
- value: {id: this.technologist[k].id, name: this.technologist[k].name}
1065
- })
1066
- }
1067
- this.data.buttons[i].button_fields[0].options = array
1050
+ this.data.buttons[i].button_fields[0].options = array
1051
+ }
1052
+ let array = this.$login.f.rolesnames.split(',')
1053
+ if (this.selectdata.defname == '任务分配' && array.includes("工程技术部负责人")) {
1054
+ let array = []
1055
+ for (let k = 0; k < this.technologist.length; k++) {
1056
+ array.push({
1057
+ label: this.technologist[k].name,
1058
+ value: {id: this.technologist[k].id, name: this.technologist[k].name}
1059
+ })
1068
1060
  }
1069
- } else {
1070
- this.$showMessage("下发按钮必须满足 当且仅当一个字段")
1061
+ this.data.buttons[i].button_fields[0].options = array
1071
1062
  }
1063
+ } else {
1064
+ this.$showMessage("下发按钮必须满足 当且仅当一个字段")
1072
1065
  }
1073
1066
  }
1074
1067
  }
1075
-
1076
1068
  }
1077
- var count =0;
1078
- let money=0;
1079
- let dealmoney=0;
1080
- for (count = 0; count < this.data.fields.length; count++) {
1081
- if (this.selectdata.defname.indexOf('派单')>=0) {
1082
- if (this.data.fields[count].label === '合同总金额') {
1083
- console.log('合同总金额===>'+this.data.fields[count].value )
1084
- money=this.data.fields[count].value
1085
- }
1086
1069
 
1087
- if (this.data.fields[count].label == '累计缴费金额') {
1088
- dealmoney=this.data.fields[count].value
1089
- console.log('累计缴费金额===>'+dealmoney )
1090
- }
1070
+ }
1071
+ var count =0;
1072
+ let money=0;
1073
+ let dealmoney=0;
1074
+ for (count = 0; count < this.data.fields.length; count++) {
1075
+ if (this.selectdata.defname.indexOf('派单')>=0) {
1076
+ if (this.data.fields[count].label === '合同总金额') {
1077
+ console.log('合同总金额===>'+this.data.fields[count].value )
1078
+ money=this.data.fields[count].value
1079
+ }
1091
1080
 
1092
- if (this.data.fields[count].label == '未结总金额') {
1093
- let othermoney = money-dealmoney;
1094
- console.log('jine'+othermoney)
1095
- this.data.fields[count].value=money-dealmoney
1096
- console.log('未结总金额'+this.data.fields[count].value )
1097
- }
1098
- }
1099
- }
1100
- //debugger
1101
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
1102
- let temp = JSON.parse(JSON.stringify(this.data))
1103
- // let temp = this.data
1104
- // 退回原因展示
1105
- if (this.selectdata.f_back_reason) {
1106
- temp['back_reason'] = this.selectdata.f_back_reason
1107
- }
1108
- this.show_data = temp
1109
- console.log("====="+this.show_data)
1110
- /**
1111
- * 新增需求: 个人报建非民用流程中小区名称需选填
1112
- */
1113
- let j=0;
1114
- if(this.show_data.defname=="现场勘查人员分配" && this.show_data.f_apply_type=="个人报建"){
1115
-
1116
- for (j = 0; j < this.show_data.fields.length; j++) {
1117
- if (this.show_data.fields[j].label == '小区名称') {
1118
- this.show_data.fields[j].required=false
1119
- }
1120
- }
1121
- }
1122
- if (this.show_data.defname === '施工') {
1123
- let http = new HttpResetClass()
1124
- let data = {
1125
- f_process_id: this.show_data.f_process_id,
1126
- defname: this.show_data.defname
1081
+ if (this.data.fields[count].label == '累计缴费金额') {
1082
+ dealmoney=this.data.fields[count].value
1083
+ console.log('累计缴费金额===>'+dealmoney )
1127
1084
  }
1128
- let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1129
- {resolveMsg: null, rejectMsg: null})
1130
1085
 
1131
- // for (let i = 0; i < res.length; i++){
1132
- // this.data.f_project_material += res.data.fusetype + ','
1133
- // }
1134
- res.data.forEach(item =>{
1135
- this.show_data.f_project_material += item.fusetype + ','
1136
- })
1086
+ if (this.data.fields[count].label == '未结总金额') {
1087
+ let othermoney = money-dealmoney;
1088
+ console.log('jine'+othermoney)
1089
+ this.data.fields[count].value=money-dealmoney
1090
+ console.log('未结总金额'+this.data.fields[count].value )
1091
+ }
1137
1092
  }
1138
- // if (this.show_data.defname === '施工验收') {
1139
- // let http = new HttpResetClass()
1140
- // let data = {
1141
- // f_process_id: this.show_data.f_process_id,
1142
- // defname: this.show_data.defname
1143
- // }
1144
- // let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1145
- // {resolveMsg: null, rejectMsg: null})
1146
- // this.show_data.f_iscomplete_information = ''
1147
- // res.data.forEach(item =>{
1148
- // this.show_data.f_iscomplete_information += item.fusetype + ','
1149
- // })
1150
- // for (j = 0; j < this.show_data.fields.length; j++) {
1151
- // if (this.show_data.fields[j].label === '验收已上传文件') {
1152
- // this.show_data.fields[j].value = this.show_data.f_iscomplete_information
1153
- // }
1154
- // }
1093
+ }
1094
+ //debugger
1095
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
1096
+ let temp = JSON.parse(JSON.stringify(this.data))
1097
+ // let temp = this.data
1098
+ // 退回原因展示
1099
+ if (this.selectdata.f_back_reason) {
1100
+ temp['back_reason'] = this.selectdata.f_back_reason
1101
+ }
1102
+ this.show_data = temp
1103
+ console.log("====="+this.show_data)
1104
+ /**
1105
+ * 新增需求: 个人报建非民用流程中小区名称需选填
1106
+ */
1107
+ let j=0;
1108
+ if(this.show_data.defname=="现场勘查人员分配" && this.show_data.f_apply_type=="个人报建"){
1109
+
1110
+ for (j = 0; j < this.show_data.fields.length; j++) {
1111
+ if (this.show_data.fields[j].label == '小区名称') {
1112
+ this.show_data.fields[j].required=false
1113
+ }
1114
+ }
1115
+ }
1116
+ if (this.show_data.defname === '施工') {
1117
+ let http = new HttpResetClass()
1118
+ let data = {
1119
+ f_process_id: this.show_data.f_process_id,
1120
+ defname: this.show_data.defname
1121
+ }
1122
+ let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1123
+ {resolveMsg: null, rejectMsg: null})
1124
+
1125
+ // for (let i = 0; i < res.length; i++){
1126
+ // this.data.f_project_material += res.data.fusetype + ','
1155
1127
  // }
1156
- // 显示组件
1157
- // this.showview = false
1158
- // debugger
1159
- this.$nextTick(()=>{
1160
- this.showview = true
1128
+ res.data.forEach(item =>{
1129
+ this.show_data.f_project_material += item.fusetype + ','
1161
1130
  })
1162
1131
  }
1132
+ // if (this.show_data.defname === '施工验收') {
1133
+ // let http = new HttpResetClass()
1134
+ // let data = {
1135
+ // f_process_id: this.show_data.f_process_id,
1136
+ // defname: this.show_data.defname
1137
+ // }
1138
+ // let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1139
+ // {resolveMsg: null, rejectMsg: null})
1140
+ // this.show_data.f_iscomplete_information = ''
1141
+ // res.data.forEach(item =>{
1142
+ // this.show_data.f_iscomplete_information += item.fusetype + ','
1143
+ // })
1144
+ // for (j = 0; j < this.show_data.fields.length; j++) {
1145
+ // if (this.show_data.fields[j].label === '验收已上传文件') {
1146
+ // this.show_data.fields[j].value = this.show_data.f_iscomplete_information
1147
+ // }
1148
+ // }
1149
+ // }
1150
+ // 显示组件
1151
+ // this.showview = false
1152
+ // debugger
1153
+ this.$nextTick(()=>{
1154
+ this.showview = true
1155
+ })
1163
1156
  }
1164
- ,
1165
- events: {
1166
- 'get-cost'(val) {
1167
- this.cost = val
1157
+ }
1158
+ ,
1159
+ events: {
1160
+ 'get-cost'(val) {
1161
+ this.cost = val
1168
1162
 
1169
- this.initializtion()
1170
- },
1171
- 'checkboxSelectControl'(index,index2){
1172
- console.log("chufa事件control");
1173
- console.log('this.$refs.service_show.data.fields[index]==>:'+JSON.stringify(this.$refs.service_show.data.fields[index]));
1174
- if(this.$refs.service_show.data.fields[index].label=="提交资料"){
1175
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1176
-
1177
- if(this.$refs.service_show.data.fields[i].label=="用户提交资料"){
1178
- //if(this.$refs.service_show.data.fields[index].value == ""){
1179
- console.log("this.$refs.service_show.data.fields[index].items[index2].value==>"+JSON.stringify(this.$refs.service_show.data.fields[index].items[index2]))
1180
- //增加和删除框中的内容
1181
- if(this.$refs.service_show.data.fields[index].items[index2].value == false){
1182
- this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
1183
- this.$refs.service_show.data.fields[index].items[index2].value=true;
1184
- }else{
1185
- let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
1186
- let values =this.$refs.service_show.data.fields[i].value;
1187
- let result = values.split(" ").filter((item)=>{
1188
- return item!=deleteValue;
1189
- }).join(" ")
1190
- console.log(result);
1191
- this.$refs.service_show.data.fields[i].value =result;
1192
- this.$refs.service_show.data.fields[index].items[index2].value=false;
1193
- }
1194
- //}
1195
- }
1196
- }
1163
+ this.initializtion()
1164
+ },
1165
+ 'checkboxSelectControl'(index,index2){
1166
+ console.log("chufa事件control");
1167
+ console.log('this.$refs.service_show.data.fields[index]==>:'+JSON.stringify(this.$refs.service_show.data.fields[index]));
1168
+ if(this.$refs.service_show.data.fields[index].label=="提交资料"){
1169
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1170
+
1171
+ if(this.$refs.service_show.data.fields[i].label=="用户提交资料"){
1172
+ //if(this.$refs.service_show.data.fields[index].value == ""){
1173
+ console.log("this.$refs.service_show.data.fields[index].items[index2].value==>"+JSON.stringify(this.$refs.service_show.data.fields[index].items[index2]))
1174
+ //增加和删除框中的内容
1175
+ if(this.$refs.service_show.data.fields[index].items[index2].value == false){
1176
+ this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
1177
+ this.$refs.service_show.data.fields[index].items[index2].value=true;
1178
+ }else{
1179
+ let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
1180
+ let values =this.$refs.service_show.data.fields[i].value;
1181
+ let result = values.split(" ").filter((item)=>{
1182
+ return item!=deleteValue;
1183
+ }).join(" ")
1184
+ console.log(result);
1185
+ this.$refs.service_show.data.fields[i].value =result;
1186
+ this.$refs.service_show.data.fields[index].items[index2].value=false;
1187
+ }
1188
+ //}
1197
1189
  }
1198
- if(this.$refs.service_show.data.fields[index].label=="施工提交资料"){
1199
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1190
+ }
1191
+ }
1192
+ if(this.$refs.service_show.data.fields[index].label=="施工提交资料"){
1193
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1200
1194
 
1201
- if(this.$refs.service_show.data.fields[i].label=="施工已上传文件"){
1202
- //增加和删除框中的内容
1203
- if(this.$refs.service_show.data.fields[index].items[index2].value == false){
1204
- this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
1205
- this.$refs.service_show.data.fields[index].items[index2].value=true;
1206
- }else{
1207
- let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
1208
- let values =this.$refs.service_show.data.fields[i].value;
1209
- let result = values.split(" ").filter((item)=>{
1210
- return item!=deleteValue;
1211
- }).join(" ")
1212
- this.$refs.service_show.data.fields[i].value =result;
1213
- this.$refs.service_show.data.fields[index].items[index2].value=false;
1214
- }
1215
- //}
1195
+ if(this.$refs.service_show.data.fields[i].label=="施工已上传文件"){
1196
+ //增加和删除框中的内容
1197
+ if(this.$refs.service_show.data.fields[index].items[index2].value == false){
1198
+ this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
1199
+ this.$refs.service_show.data.fields[index].items[index2].value=true;
1200
+ }else{
1201
+ let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
1202
+ let values =this.$refs.service_show.data.fields[i].value;
1203
+ let result = values.split(" ").filter((item)=>{
1204
+ return item!=deleteValue;
1205
+ }).join(" ")
1206
+ this.$refs.service_show.data.fields[i].value =result;
1207
+ this.$refs.service_show.data.fields[index].items[index2].value=false;
1216
1208
  }
1209
+ //}
1217
1210
  }
1218
1211
  }
1219
- if(this.$refs.service_show.data.fields[index].label=="验收提交资料"){
1220
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1212
+ }
1213
+ if(this.$refs.service_show.data.fields[index].label=="验收提交资料"){
1214
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1221
1215
 
1222
- if(this.$refs.service_show.data.fields[i].label=="验收已上传文件"){
1223
- //增加和删除框中的内容
1224
- if(this.$refs.service_show.data.fields[index].items[index2].value == false){
1225
- this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
1226
- this.$refs.service_show.data.fields[index].items[index2].value=true;
1227
- }else{
1228
- let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
1229
- let values =this.$refs.service_show.data.fields[i].value;
1230
- let result = values.split(" ").filter((item)=>{
1231
- return item!=deleteValue;
1232
- }).join(" ")
1233
- this.$refs.service_show.data.fields[i].value =result;
1234
- this.$refs.service_show.data.fields[index].items[index2].value=false;
1235
- }
1236
- //}
1216
+ if(this.$refs.service_show.data.fields[i].label=="验收已上传文件"){
1217
+ //增加和删除框中的内容
1218
+ if(this.$refs.service_show.data.fields[index].items[index2].value == false){
1219
+ this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
1220
+ this.$refs.service_show.data.fields[index].items[index2].value=true;
1221
+ }else{
1222
+ let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
1223
+ let values =this.$refs.service_show.data.fields[i].value;
1224
+ let result = values.split(" ").filter((item)=>{
1225
+ return item!=deleteValue;
1226
+ }).join(" ")
1227
+ this.$refs.service_show.data.fields[i].value =result;
1228
+ this.$refs.service_show.data.fields[index].items[index2].value=false;
1237
1229
  }
1230
+ //}
1238
1231
  }
1239
1232
  }
1240
- },
1241
- 'get-number'(val) {
1242
- this.number = val
1233
+ }
1234
+ },
1235
+ 'get-number'(val) {
1236
+ this.number = val
1243
1237
 
1244
- this.initializtion()
1238
+ this.initializtion()
1239
+ }
1240
+ ,
1241
+ 'get-pgd'(val) {
1242
+ this.pgd = val
1243
+ this.initializtion()
1244
+ }
1245
+ ,
1246
+ // 任意select选中时触发事件,关联性操作
1247
+ async 'select_cascade'(index) {
1248
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1249
+ if (this.$refs.service_show.data.fields[i].label === '工程盈利') {
1250
+ this.$refs.service_show.data.fields[i].value = c
1251
+ }
1245
1252
  }
1246
- ,
1247
- 'get-pgd'(val) {
1248
- this.pgd = val
1249
- this.initializtion()
1253
+
1254
+
1255
+ if (this.$refs.service_show.data.fields[index].label == '施工单位' ||
1256
+ this.$refs.service_show.data.fields[index].label == '检测单位' ||
1257
+ this.$refs.service_show.data.fields[index].label == '监理单位' ||
1258
+ this.$refs.service_show.data.fields[index].label == '土建单位' ||
1259
+ this.$refs.service_show.data.fields[index].label == '设计单位') {
1260
+ this.$refs.service_show.update()
1261
+ return
1250
1262
  }
1251
- ,
1252
- // 任意select选中时触发事件,关联性操作
1253
- async 'select_cascade'(index) {
1263
+ if (
1264
+ this.$refs.service_show.data.fields[index].label === '最终核算成本金额' ||
1265
+ this.$refs.service_show.data.fields[index].label === '合同总金额' ||
1266
+ this.$refs.service_show.data.fields[index].label === '工程盈利'
1267
+ ) {
1268
+
1269
+ var a = 0
1270
+ var b = 0
1271
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1272
+ // 控制设置级联
1273
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1274
+ // xxx xx xxx
1275
+ if (this.$refs.service_show.data.fields[i].label === '最终核算成本金额') {
1276
+ this.$refs.service_show.data.fields[i].value = (this.number + this.cost)
1277
+ a = this.$refs.service_show.data.fields[i].value
1278
+ }
1279
+
1280
+ if (this.$refs.service_show.data.fields[i].label === '合同总金额' && this.$refs.service_show.data.fields[i].value) {
1281
+ b = this.$refs.service_show.data.fields[i].value
1282
+ }
1283
+ }
1284
+ var c = b - a
1285
+ // 数据计算完毕得到工程结余
1254
1286
  for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1255
1287
  if (this.$refs.service_show.data.fields[i].label === '工程盈利') {
1256
1288
  this.$refs.service_show.data.fields[i].value = c
1257
1289
  }
1258
1290
  }
1291
+ }
1292
+ //根据合同预算金额和累计缴费金额计算未结金额
1293
+ if (
1294
+ this.$refs.service_show.data.fields[index].label === '累计缴费金额' ||
1295
+ this.$refs.service_show.data.fields[index].label === '合同总金额') {
1296
+ let cumulativeMoney = 0
1297
+ let unaccountMoney = 0
1298
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1259
1299
 
1260
-
1261
- if (this.$refs.service_show.data.fields[index].label == '施工单位' ||
1262
- this.$refs.service_show.data.fields[index].label == '检测单位' ||
1263
- this.$refs.service_show.data.fields[index].label == '监理单位' ||
1264
- this.$refs.service_show.data.fields[index].label == '土建单位' ||
1265
- this.$refs.service_show.data.fields[index].label == '设计单位') {
1266
- this.$refs.service_show.update()
1267
- return
1268
- }
1269
- if (
1270
- this.$refs.service_show.data.fields[index].label === '最终核算成本金额' ||
1271
- this.$refs.service_show.data.fields[index].label === '合同总金额' ||
1272
- this.$refs.service_show.data.fields[index].label === '工程盈利'
1273
- ) {
1274
-
1275
- var a = 0
1276
- var b = 0
1277
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1278
- // 控制设置级联
1279
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1280
- // xxx xx xxx
1281
- if (this.$refs.service_show.data.fields[i].label === '最终核算成本金额') {
1282
- this.$refs.service_show.data.fields[i].value = (this.number + this.cost)
1283
- a = this.$refs.service_show.data.fields[i].value
1284
- }
1285
-
1286
- if (this.$refs.service_show.data.fields[i].label === '合同总金额' && this.$refs.service_show.data.fields[i].value) {
1287
- b = this.$refs.service_show.data.fields[i].value
1288
- }
1300
+ if (this.$refs.service_show.data.fields[i].label === '合同总金额' && this.$refs.service_show.data.fields[i].value) {
1301
+ cumulativeMoney += parseInt(this.$refs.service_show.data.fields[i].value)
1289
1302
  }
1290
- var c = b - a
1291
- // 数据计算完毕得到工程结余
1292
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1293
- if (this.$refs.service_show.data.fields[i].label === '工程盈利') {
1294
- this.$refs.service_show.data.fields[i].value = c
1295
- }
1303
+ if (this.$refs.service_show.data.fields[i].label === '累计缴费金额' && this.$refs.service_show.data.fields[i].value) {
1304
+ unaccountMoney += parseInt(this.$refs.service_show.data.fields[i].value)
1296
1305
  }
1297
- }
1298
- //根据合同预算金额和累计缴费金额计算未结金额
1299
- if (
1300
- this.$refs.service_show.data.fields[index].label === '累计缴费金额' ||
1301
- this.$refs.service_show.data.fields[index].label === '合同总金额') {
1302
- let cumulativeMoney = 0
1303
- let unaccountMoney = 0
1304
1306
  for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1305
-
1306
- if (this.$refs.service_show.data.fields[i].label === '合同总金额' && this.$refs.service_show.data.fields[i].value) {
1307
- cumulativeMoney += parseInt(this.$refs.service_show.data.fields[i].value)
1308
- }
1309
- if (this.$refs.service_show.data.fields[i].label === '累计缴费金额' && this.$refs.service_show.data.fields[i].value) {
1310
- unaccountMoney += parseInt(this.$refs.service_show.data.fields[i].value)
1311
- }
1312
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1313
- // if (this.$refs.service_show.data.fields[i].label === '未结总金额') {
1314
- // //this.$refs.service_show.data.fields[i].value = cumulativeMoney - unaccountMoney
1315
- // this.$refs.service_show.data.fields[i].value =0;
1316
- //
1317
- // }
1318
- }
1307
+ // if (this.$refs.service_show.data.fields[i].label === '未结总金额') {
1308
+ // //this.$refs.service_show.data.fields[i].value = cumulativeMoney - unaccountMoney
1309
+ // this.$refs.service_show.data.fields[i].value =0;
1310
+ //
1311
+ // }
1319
1312
  }
1320
1313
  }
1314
+ }
1321
1315
 
1322
1316
 
1323
- //根据合同预算金额和累计开票金额计算未开票金额
1317
+ //根据合同预算金额和累计开票金额计算未开票金额
1324
1318
 
1325
1319
 
1326
- if (this.$refs.service_show.data.fields[index].label === '累计开票金额') {
1327
- let residualInvoicing = this.$refs.service_show.data.fields[index].value
1328
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1329
- if (this.$refs.service_show.data.fields[i].label === '未开票金额') {
1330
- this.$refs.service_show.data.fields[i].value = Number(this.selectdata.f_contract_total_money) - Number(residualInvoicing)
1331
- }
1320
+ if (this.$refs.service_show.data.fields[index].label === '累计开票金额') {
1321
+ let residualInvoicing = this.$refs.service_show.data.fields[index].value
1322
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1323
+ if (this.$refs.service_show.data.fields[i].label === '未开票金额') {
1324
+ this.$refs.service_show.data.fields[i].value = Number(this.selectdata.f_contract_total_money) - Number(residualInvoicing)
1332
1325
  }
1333
1326
  }
1334
- //如果资料验收是否通过和工程验收是否通过为否的时候弹出原因填写框
1335
- if (this.$refs.service_show.data.fields[index].label === '资料验收是否通过') {
1336
- let res = this.$refs.service_show.data.fields[index].value
1337
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1338
- if (this.$refs.service_show.data.fields[i].label === '资料验收不通过原因') {
1339
- if (res === '') {
1340
- this.$refs.service_show.data.fields[i].hidden = false
1341
- this.$refs.service_show.data.fields[i].required = true
1342
- } else {
1343
- this.$refs.service_show.data.fields[i].hidden = true
1344
- this.$refs.service_show.data.fields[i].required = false
1345
- }
1327
+ }
1328
+ //如果资料验收是否通过和工程验收是否通过为否的时候弹出原因填写框
1329
+ if (this.$refs.service_show.data.fields[index].label === '资料验收是否通过') {
1330
+ let res = this.$refs.service_show.data.fields[index].value
1331
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1332
+ if (this.$refs.service_show.data.fields[i].label === '资料验收不通过原因') {
1333
+ if (res === '否') {
1334
+ this.$refs.service_show.data.fields[i].hidden = false
1335
+ this.$refs.service_show.data.fields[i].required = true
1336
+ } else {
1337
+ this.$refs.service_show.data.fields[i].hidden = true
1338
+ this.$refs.service_show.data.fields[i].required = false
1346
1339
  }
1347
1340
  }
1348
1341
  }
1349
- if (this.$refs.service_show.data.fields[index].label === '工程验收是否通过') {
1350
- let res = this.$refs.service_show.data.fields[index].value
1351
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1352
- if (this.$refs.service_show.data.fields[i].label === '工程验收不通过原因') {
1353
- if (res === '') {
1354
- this.$refs.service_show.data.fields[i].hidden = false
1355
- this.$refs.service_show.data.fields[i].required = true
1356
- } else {
1357
- this.$refs.service_show.data.fields[i].hidden = true
1358
- this.$refs.service_show.data.fields[i].required = false
1359
- }
1342
+ }
1343
+ if (this.$refs.service_show.data.fields[index].label === '工程验收是否通过') {
1344
+ let res = this.$refs.service_show.data.fields[index].value
1345
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1346
+ if (this.$refs.service_show.data.fields[i].label === '工程验收不通过原因') {
1347
+ if (res === '否') {
1348
+ this.$refs.service_show.data.fields[i].hidden = false
1349
+ this.$refs.service_show.data.fields[i].required = true
1350
+ } else {
1351
+ this.$refs.service_show.data.fields[i].hidden = true
1352
+ this.$refs.service_show.data.fields[i].required = false
1360
1353
  }
1361
1354
  }
1362
1355
  }
1363
- // }
1356
+ }
1357
+ // }
1364
1358
 
1365
- //金额小写得到大写
1366
- if (this.$refs.service_show.showadd_fields && this.$refs.service_show.showadd_fields.length > 0 && this.$refs.service_show.showadd_fields.fields[index].label === '收费金额') {
1367
- if (this.$refs.service_show.showadd_fields[index].value || this.$refs.service_show.showadd_fields.fields[index].value) {
1368
- var re = /^[0-9]+.?[0-9]*/
1369
- let temp = this.$refs.service_show.showadd_fields[index].value
1370
- if (temp == "" || isNaN(temp)) {
1371
- this.$showMessage("请输入纯数字")
1372
- this.$refs.service_show.showadd_fields[index].value = 0
1373
- }
1374
- }
1375
- let temp = this.$refs.service_show.showadd_fields[index]
1376
- let value = temp.value
1377
- // let chargeMoney = this.$refs.service_show.showadd_fields[index].value
1378
- for (let i = 0; i < this.$refs.service_show.showadd_fields.fields.length; i++) {
1379
- if (this.$refs.service_show.showadd_fields.fields[i].label === '金额大写') {
1380
- let te = {
1381
- value: this.smalltoBIG(value)
1382
- }
1383
- this.$refs.service_show.showadd_fields[i] = te
1359
+ //金额小写得到大写
1360
+ if (this.$refs.service_show.showadd_fields && this.$refs.service_show.showadd_fields.length > 0 && this.$refs.service_show.showadd_fields.fields[index].label === '收费金额') {
1361
+ if (this.$refs.service_show.showadd_fields[index].value || this.$refs.service_show.showadd_fields.fields[index].value) {
1362
+ var re = /^[0-9]+.?[0-9]*/
1363
+ let temp = this.$refs.service_show.showadd_fields[index].value
1364
+ if (temp == "" || isNaN(temp)) {
1365
+ this.$showMessage("请输入纯数字")
1366
+ this.$refs.service_show.showadd_fields[index].value = 0
1367
+ }
1368
+ }
1369
+ let temp = this.$refs.service_show.showadd_fields[index]
1370
+ let value = temp.value
1371
+ // let chargeMoney = this.$refs.service_show.showadd_fields[index].value
1372
+ for (let i = 0; i < this.$refs.service_show.showadd_fields.fields.length; i++) {
1373
+ if (this.$refs.service_show.showadd_fields.fields[i].label === '金额大写') {
1374
+ let te = {
1375
+ value: this.smalltoBIG(value)
1384
1376
  }
1377
+ this.$refs.service_show.showadd_fields[i] = te
1385
1378
  }
1386
1379
  }
1380
+ }
1387
1381
 
1388
1382
 
1389
1383
 
1390
- if (this.$refs.service_show.data.fields[index].label === '县/区') {
1391
- let temp = this.$refs.service_show.data.fields[index].value
1392
- console.log('==============================县/区:' + temp)
1393
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1394
- // 控制设置级联
1395
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1396
- if (this.$refs.service_show.data.fields[i].label === '街道名称') {
1397
- this.$refs.service_show.data.fields[i].value = ''
1398
- let street = await this.$resetpost('rs/sql/singleTable', {
1399
- data: {
1400
- tablename: 't_street',
1401
- condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_pcd='${temp}'`
1402
- }
1403
- }, {resolveMsg: null, rejectMsg: null})
1404
- let streetrs = []
1405
- for (let i = 0; i < street.data.length; i++) {
1406
- let temp = {
1407
- label: street.data[i].f_street,
1408
- value: street.data[i].f_street
1409
- }
1410
- streetrs.push(temp)
1384
+ if (this.$refs.service_show.data.fields[index].label === '县/区') {
1385
+ let temp = this.$refs.service_show.data.fields[index].value
1386
+ console.log('==============================县/区:' + temp)
1387
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1388
+ // 控制设置级联
1389
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1390
+ if (this.$refs.service_show.data.fields[i].label === '街道名称') {
1391
+ this.$refs.service_show.data.fields[i].value = ''
1392
+ let street = await this.$resetpost('rs/sql/singleTable', {
1393
+ data: {
1394
+ tablename: 't_street',
1395
+ condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_pcd='${temp}'`
1396
+ }
1397
+ }, {resolveMsg: null, rejectMsg: null})
1398
+ let streetrs = []
1399
+ for (let i = 0; i < street.data.length; i++) {
1400
+ let temp = {
1401
+ label: street.data[i].f_street,
1402
+ value: street.data[i].f_street
1411
1403
  }
1404
+ streetrs.push(temp)
1405
+ }
1412
1406
 
1413
- this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1414
- //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1415
- // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.data.fields[i].options)
1407
+ this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1408
+ //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1409
+ // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.data.fields[i].options)
1416
1410
 
1417
- this.$refs.service_show.update()
1418
- }
1411
+ this.$refs.service_show.update()
1419
1412
  }
1420
1413
  }
1421
- if (this.$refs.service_show.data.fields[index].label === '气表品牌') {
1422
- let temp = this.$refs.service_show.data.fields[index].value
1423
- let meterbrand = await this.$resetpost('rs/sql/singleTable', {
1424
- data: {
1425
- //items: 'f_bill_url,f_url_code',
1426
- tablename: 't_gasbrand',
1427
- condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_meter_brand='${temp}'`
1428
- }
1429
- }, {resolveMsg: null, rejectMsg: null})
1430
- console.log(meterbrand)
1431
- console.log(meterbrand.data)
1432
- let idstring = '('
1433
- idstring += meterbrand.data[0].id
1434
- console.log("idstring第一个" + idstring)
1435
- if (meterbrand.data.length > 1) {
1436
- for (let i = 1; i < meterbrand.data.length; i++) {
1437
- idstring += ',' + meterbrand.data[i].id
1438
- }
1439
- }
1440
- idstring += ')'
1441
- console.log("idstring" + idstring)
1442
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1414
+ }
1415
+ if (this.$refs.service_show.data.fields[index].label === '气表品牌') {
1416
+ let temp = this.$refs.service_show.data.fields[index].value
1417
+ let meterbrand = await this.$resetpost('rs/sql/singleTable', {
1418
+ data: {
1419
+ //items: 'f_bill_url,f_url_code',
1420
+ tablename: 't_gasbrand',
1421
+ condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_meter_brand='${temp}'`
1422
+ }
1423
+ }, {resolveMsg: null, rejectMsg: null})
1424
+ console.log(meterbrand)
1425
+ console.log(meterbrand.data)
1426
+ let idstring = '('
1427
+ idstring += meterbrand.data[0].id
1428
+ console.log("idstring第一个" + idstring)
1429
+ if (meterbrand.data.length > 1) {
1430
+ for (let i = 1; i < meterbrand.data.length; i++) {
1431
+ idstring += ',' + meterbrand.data[i].id
1432
+ }
1433
+ }
1434
+ idstring += ')'
1435
+ console.log("idstring" + idstring)
1436
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1443
1437
 
1444
- if (this.$refs.service_show.data.fields[i].label === '气表型号') {
1445
- this.$refs.service_show.data.fields[i].value = ''
1438
+ if (this.$refs.service_show.data.fields[i].label === '气表型号') {
1439
+ this.$refs.service_show.data.fields[i].value = ''
1446
1440
 
1447
1441
 
1448
- let gasbrand = await this.$resetpost('rs/sql/singleTable', {
1449
- data: {
1450
- tablename: 't_gasmodel',
1451
- condition: ` f_gasbrand_id in ${idstring}`
1452
- }
1453
- }, {resolveMsg: null, rejectMsg: null})
1454
- let brandstr = []
1455
- for (let i = 0; i < gasbrand.data.length; i++) {
1456
- let brand = {
1457
- label: gasbrand.data[i].f_meter_style,
1458
- value: gasbrand.data[i].f_meter_style
1459
- }
1460
- brandstr.push(brand)
1442
+ let gasbrand = await this.$resetpost('rs/sql/singleTable', {
1443
+ data: {
1444
+ tablename: 't_gasmodel',
1445
+ condition: ` f_gasbrand_id in ${idstring}`
1446
+ }
1447
+ }, {resolveMsg: null, rejectMsg: null})
1448
+ let brandstr = []
1449
+ for (let i = 0; i < gasbrand.data.length; i++) {
1450
+ let brand = {
1451
+ label: gasbrand.data[i].f_meter_style,
1452
+ value: gasbrand.data[i].f_meter_style
1461
1453
  }
1454
+ brandstr.push(brand)
1455
+ }
1462
1456
 
1463
- this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...brandstr]
1464
- //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1465
- // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.data.fields[i].options)
1457
+ this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...brandstr]
1458
+ //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1459
+ // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.data.fields[i].options)
1466
1460
 
1467
- this.$refs.service_show.update()
1468
- }
1461
+ this.$refs.service_show.update()
1469
1462
  }
1470
1463
  }
1464
+ }
1471
1465
 
1472
1466
 
1473
- if (this.$refs.service_show.data.fields[index].label === '气表型号') {
1474
- let meterstyle= this.$refs.service_show.data.fields[index].value
1475
- let meterbrand = ''
1476
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1477
- if (this.$refs.service_show.data.fields[i].label === '气表品牌') {
1478
- meterbrand = this.$refs.service_show.data.fields[i].value
1479
- }}
1467
+ if (this.$refs.service_show.data.fields[index].label === '气表型号') {
1468
+ let meterstyle= this.$refs.service_show.data.fields[index].value
1469
+ let meterbrand = ''
1470
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1471
+ if (this.$refs.service_show.data.fields[i].label === '气表品牌') {
1472
+ meterbrand = this.$refs.service_show.data.fields[i].value
1473
+ }}
1480
1474
 
1481
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1475
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1482
1476
 
1483
- if (this.$refs.service_show.data.fields[i].label === '别名') {
1484
- console.log("获取别名")
1485
- this.$refs.service_show.data.fields[i].value = ''
1477
+ if (this.$refs.service_show.data.fields[i].label === '别名') {
1478
+ console.log("获取别名")
1479
+ this.$refs.service_show.data.fields[i].value = ''
1486
1480
 
1487
- let meterbrandalias = await this.$resetpost('rs/sql/getMeterBrand', {
1488
- data: {
1489
- condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_meter_brand='${meterbrand}' and f_meter_style='${meterstyle}'`
1490
- }
1491
- }, {resolveMsg: null, rejectMsg: null})
1481
+ let meterbrandalias = await this.$resetpost('rs/sql/getMeterBrand', {
1482
+ data: {
1483
+ condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_meter_brand='${meterbrand}' and f_meter_style='${meterstyle}'`
1484
+ }
1485
+ }, {resolveMsg: null, rejectMsg: null})
1492
1486
 
1493
- let alias = []
1494
- for (let i = 0; i < meterbrandalias.data.length; i++) {
1495
- let brand = {
1496
- label: meterbrandalias.data[i].f_alias,
1497
- value: meterbrandalias.data[i].f_alias
1498
- }
1499
- alias.push(brand)
1500
- }
1487
+ let alias = []
1488
+ for (let i = 0; i < meterbrandalias.data.length; i++) {
1489
+ let brand = {
1490
+ label: meterbrandalias.data[i].f_alias,
1491
+ value: meterbrandalias.data[i].f_alias
1492
+ }
1493
+ alias.push(brand)
1494
+ }
1501
1495
 
1502
- this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...alias]
1503
- //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1504
- // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.data.fields[i].options)
1496
+ this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...alias]
1497
+ //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1498
+ // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.data.fields[i].options)
1505
1499
 
1506
- this.$refs.service_show.update()
1500
+ this.$refs.service_show.update()
1507
1501
 
1508
- }
1509
1502
  }
1510
-
1511
1503
  }
1512
1504
 
1505
+ }
1513
1506
 
1514
- if (this.$refs.service_show.data.fields[index].label === '证件类型') {
1515
- let temp = this.$refs.service_show.data.fields[index].value
1516
- console.log('==============================证件类型:' + temp)
1517
- if (temp === '身份证') {
1518
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1519
- if (this.$refs.service_show.data.fields[i].label === '证件号码') {
1520
- this.$refs.service_show.data.fields[i].required = true
1521
- }
1507
+
1508
+ if (this.$refs.service_show.data.fields[index].label === '证件类型') {
1509
+ let temp = this.$refs.service_show.data.fields[index].value
1510
+ console.log('==============================证件类型:' + temp)
1511
+ if (temp === '身份证') {
1512
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1513
+ if (this.$refs.service_show.data.fields[i].label === '证件号码') {
1514
+ this.$refs.service_show.data.fields[i].required = true
1522
1515
  }
1523
- } else {
1524
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1525
- if (this.$refs.service_show.data.fields[i].label === '证件号码') {
1526
- this.$refs.service_show.data.fields[i].required = false
1527
- }
1516
+ }
1517
+ } else {
1518
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1519
+ if (this.$refs.service_show.data.fields[i].label === '证件号码') {
1520
+ this.$refs.service_show.data.fields[i].required = false
1528
1521
  }
1529
1522
  }
1530
1523
  }
1524
+ }
1531
1525
 
1532
- if (this.$refs.service_show.data.fields[index].label === '是否设计出图') {
1533
- let temp = this.$refs.service_show.data.fields[index].value
1526
+ if (this.$refs.service_show.data.fields[index].label === '是否设计出图') {
1527
+ let temp = this.$refs.service_show.data.fields[index].value
1534
1528
 
1535
- if (temp === '是') {
1536
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1537
- if (this.$refs.service_show.data.fields[i].label === '设计派工日期' ||
1538
- this.$refs.service_show.data.fields[i].label === '设计人员'
1539
- ) {
1540
- this.$refs.service_show.data.fields[i].required = true
1541
- }
1529
+ if (temp === '是') {
1530
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1531
+ if (this.$refs.service_show.data.fields[i].label === '设计派工日期' ||
1532
+ this.$refs.service_show.data.fields[i].label === '设计人员'
1533
+ ) {
1534
+ this.$refs.service_show.data.fields[i].required = true
1542
1535
  }
1543
- } else {
1544
- console.log("不设计出图,进入else")
1545
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1546
- if (this.$refs.service_show.data.fields[i].label === '设计派工日期' || this.$refs.service_show.data.fields[i].label === '设计人员') {
1536
+ }
1537
+ } else {
1538
+ console.log("不设计出图,进入else")
1539
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1540
+ if (this.$refs.service_show.data.fields[i].label === '设计派工日期' || this.$refs.service_show.data.fields[i].label === '设计人员') {
1547
1541
 
1548
- this.$refs.service_show.data.fields[i].required = false
1549
- }
1542
+ this.$refs.service_show.data.fields[i].required = false
1550
1543
  }
1551
1544
  }
1552
1545
  }
1546
+ }
1553
1547
 
1554
- if (this.$refs.service_show.data.fields[index].label === '派工单号') {
1555
- this.$refs.service_show.data.fields[index].value = this.pgd
1556
- }
1548
+ if (this.$refs.service_show.data.fields[index].label === '派工单号') {
1549
+ this.$refs.service_show.data.fields[index].value = this.pgd
1550
+ }
1557
1551
 
1558
1552
 
1559
- if (this.$refs.service_show.data.fields[index].label === '街道名称') {
1560
- let temp = this.$refs.service_show.data.fields[index].value
1561
- console.log('=============================街道:' + temp)
1562
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1563
- // 控制设置级联
1564
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1565
- if (this.$refs.service_show.data.fields[i].label === '小区名称') {
1566
- this.$refs.service_show.data.fields[i].value = ''
1553
+ if (this.$refs.service_show.data.fields[index].label === '街道名称') {
1554
+ let temp = this.$refs.service_show.data.fields[index].value
1555
+ console.log('=============================街道:' + temp)
1556
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1557
+ // 控制设置级联
1558
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1559
+ if (this.$refs.service_show.data.fields[i].label === '小区名称') {
1560
+ this.$refs.service_show.data.fields[i].value = ''
1567
1561
 
1568
- let area = await this.$resetpost('rs/sql/singleTable', {
1569
- data: {
1570
- tablename: 't_area',
1571
- condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_street='${temp}'`
1572
- }
1573
- }, {resolveMsg: null, rejectMsg: null})
1574
- let arears = []
1575
- this.areaall=area.data;
1576
- for (let i = 0; i < area.data.length; i++) {
1577
- let temp = {
1578
- label: area.data[i].f_residential_area,
1579
- value: area.data[i].f_residential_area
1580
- }
1581
- arears.push(temp)
1562
+ let area = await this.$resetpost('rs/sql/singleTable', {
1563
+ data: {
1564
+ tablename: 't_area',
1565
+ condition: `f_filialeids = '${this.$login.f.f_orgids}' and f_street='${temp}'`
1566
+ }
1567
+ }, {resolveMsg: null, rejectMsg: null})
1568
+ let arears = []
1569
+ this.areaall=area.data;
1570
+ for (let i = 0; i < area.data.length; i++) {
1571
+ let temp = {
1572
+ label: area.data[i].f_residential_area,
1573
+ value: area.data[i].f_residential_area
1582
1574
  }
1583
- this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...arears]
1584
- //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1585
- console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
1575
+ arears.push(temp)
1576
+ }
1577
+ this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...arears]
1578
+ //this.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
1579
+ console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
1586
1580
 
1587
- this.$refs.service_show.update()
1581
+ this.$refs.service_show.update()
1588
1582
 
1589
- }
1590
1583
  }
1591
1584
  }
1585
+ }
1592
1586
 
1593
- if(this.$refs.service_show.data.fields[index].label === '小区名称'){
1594
- for (let i = 0; i < this.areaall.length; i++) {
1595
- console.log("aaaaaaaaaaaa")
1596
- if(this.areaall[i].f_residential_area== this.$refs.service_show.data.fields[index].value){
1597
- console.log("abbbbbbbbb")
1598
- for (let j = 0; j < this.$refs.service_show.data.fields.length; j++) {
1599
- if(this.$refs.service_show.data.fields[j].label === '小区地址'){
1600
- console.log(this.areaall[i].f_area_address)
1601
- this.$refs.service_show.data.fields[j].value=this.areaall[i].f_area_address
1602
- }
1603
- }
1604
- }
1587
+ if(this.$refs.service_show.data.fields[index].label === '小区名称'){
1588
+ for (let i = 0; i < this.areaall.length; i++) {
1589
+ console.log("aaaaaaaaaaaa")
1590
+ if(this.areaall[i].f_residential_area== this.$refs.service_show.data.fields[index].value){
1591
+ console.log("abbbbbbbbb")
1592
+ for (let j = 0; j < this.$refs.service_show.data.fields.length; j++) {
1593
+ if(this.$refs.service_show.data.fields[j].label === '小区地址'){
1594
+ console.log(this.areaall[i].f_area_address)
1595
+ this.$refs.service_show.data.fields[j].value=this.areaall[i].f_area_address
1605
1596
  }
1606
- }
1607
- //控制尾款
1608
- if (
1609
- this.$refs.service_show.data.fields[index].label === '合同金额' ||
1610
- this.$refs.service_show.data.fields[index].label === '首付' ||
1611
- this.$refs.service_show.data.fields[index].label === '进度款' ||
1612
- this.$refs.service_show.data.fields[index].label === '尾款'
1613
- ) {
1614
- console.log('即将计算合同金额')
1615
- var cash = 0
1616
- var downpayments = 0
1617
- var tailmoney = 0
1618
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1619
- // 控制设置级联
1620
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1621
- // xxx xx xxx
1622
- if (this.$refs.service_show.data.fields[i].label === '合同金额' && this.$refs.service_show.data.fields[i].value) {
1623
- cash = this.$refs.service_show.data.fields[i].value
1624
- }
1625
- if (this.$refs.service_show.data.fields[i].label === '首付' && this.$refs.service_show.data.fields[i].value) {
1626
- downpayments = this.$refs.service_show.data.fields[i].value
1627
- }
1628
- if (this.$refs.service_show.data.fields[i].label === '进度款' && this.$refs.service_show.data.fields[i].value) {
1629
- tailmoney = this.$refs.service_show.data.fields[i].value
1630
1597
  }
1631
1598
  }
1632
- var a = cash - downpayments
1633
- // 数据计算完毕得到尾款
1634
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1635
- if (this.$refs.service_show.data.fields[i].label === '尾款') {
1636
- if (cash === downpayments) {
1637
- this.$refs.service_show.data.fields[i].value = 0
1638
- } else {
1639
- this.$refs.service_show.data.fields[i].value = (cash - downpayments - tailmoney)
1640
- console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
1641
- }
1599
+ }
1600
+ }
1601
+ //控制尾款
1602
+ if (
1603
+ this.$refs.service_show.data.fields[index].label === '合同金额' ||
1604
+ this.$refs.service_show.data.fields[index].label === '首付' ||
1605
+ this.$refs.service_show.data.fields[index].label === '进度款' ||
1606
+ this.$refs.service_show.data.fields[index].label === '尾款'
1607
+ ) {
1608
+ console.log('即将计算合同金额')
1609
+ var cash = 0
1610
+ var downpayments = 0
1611
+ var tailmoney = 0
1612
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1613
+ // 控制设置级联
1614
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1615
+ // xxx xx xxx
1616
+ if (this.$refs.service_show.data.fields[i].label === '合同金额' && this.$refs.service_show.data.fields[i].value) {
1617
+ cash = this.$refs.service_show.data.fields[i].value
1618
+ }
1619
+ if (this.$refs.service_show.data.fields[i].label === '首付' && this.$refs.service_show.data.fields[i].value) {
1620
+ downpayments = this.$refs.service_show.data.fields[i].value
1621
+ }
1622
+ if (this.$refs.service_show.data.fields[i].label === '进度款' && this.$refs.service_show.data.fields[i].value) {
1623
+ tailmoney = this.$refs.service_show.data.fields[i].value
1624
+ }
1625
+ }
1626
+ var a = cash - downpayments
1627
+ // 数据计算完毕得到尾款
1628
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1629
+ if (this.$refs.service_show.data.fields[i].label === '尾款') {
1630
+ if (cash === downpayments) {
1631
+ this.$refs.service_show.data.fields[i].value = 0
1632
+ } else {
1633
+ this.$refs.service_show.data.fields[i].value = (cash - downpayments - tailmoney)
1634
+ console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
1642
1635
  }
1643
- if (this.$refs.service_show.data.fields[i].label === '首付') {
1644
- if (a < 0) {
1645
- this.$showMessage("首付款数额过大")
1646
- downpayments = 0
1647
- this.$refs.service_show.data.fields[i].value = 0
1648
- }
1636
+ }
1637
+ if (this.$refs.service_show.data.fields[i].label === '首付') {
1638
+ if (a < 0) {
1639
+ this.$showMessage("首付款数额过大")
1640
+ downpayments = 0
1641
+ this.$refs.service_show.data.fields[i].value = 0
1649
1642
  }
1643
+ }
1650
1644
 
1651
- if (this.$refs.service_show.data.fields[i].label === '进度款') {
1645
+ if (this.$refs.service_show.data.fields[i].label === '进度款') {
1652
1646
 
1653
- if (cash === downpayments) {
1654
- tailmoney = 0
1655
- this.$refs.service_show.data.fields[i].value = 0
1656
- this.$refs.service_show.data.fields[i].readonly = true
1657
- } else {
1658
- this.$refs.service_show.data.fields[i].readonly = false
1659
- tailmoney = this.$refs.service_show.data.fields[i].value
1660
- }
1661
- if (tailmoney > a) {
1662
- this.$showMessage("进度款数额过大")
1663
- tailmoney = 0
1664
- this.$refs.service_show.data.fields[i].value = 0
1665
- }
1647
+ if (cash === downpayments) {
1648
+ tailmoney = 0
1649
+ this.$refs.service_show.data.fields[i].value = 0
1650
+ this.$refs.service_show.data.fields[i].readonly = true
1651
+ } else {
1652
+ this.$refs.service_show.data.fields[i].readonly = false
1653
+ tailmoney = this.$refs.service_show.data.fields[i].value
1654
+ }
1655
+ if (tailmoney > a) {
1656
+ this.$showMessage("进度款数额过大")
1657
+ tailmoney = 0
1658
+ this.$refs.service_show.data.fields[i].value = 0
1666
1659
  }
1667
1660
  }
1668
1661
  }
1662
+ }
1669
1663
 
1670
1664
 
1671
- // 合成地址
1672
- if (
1673
- this.$refs.service_show.data.fields[index].label === '县/区' ||
1674
- this.$refs.service_show.data.fields[index].label === '街道名称' ||
1675
- this.$refs.service_show.data.fields[index].label === '小区名称' ||
1676
- this.$refs.service_show.data.fields[index].label === '楼号' ||
1677
- this.$refs.service_show.data.fields[index].label === '单元号' ||
1678
- this.$refs.service_show.data.fields[index].label === '楼层' ||
1679
- this.$refs.service_show.data.fields[index].label === '门牌号'
1680
- ) {
1681
- console.log('即将合成地址')
1682
- var address = ''
1683
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1684
- // 控制设置级联
1685
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1686
- // xxx xx xxx
1687
- if (this.$refs.service_show.data.fields[i].label === '县/区' && this.$refs.service_show.data.fields[i].value) {
1688
- address += this.$refs.service_show.data.fields[i].value
1689
- }
1690
- if (this.$refs.service_show.data.fields[i].label === '街道名称' && this.$refs.service_show.data.fields[i].value) {
1691
- address += this.$refs.service_show.data.fields[i].value
1692
- }
1693
- if (this.$refs.service_show.data.fields[i].label === '小区名称' && this.$refs.service_show.data.fields[i].value) {
1694
- address += this.$refs.service_show.data.fields[i].value
1695
- }
1696
- if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
1697
- address += this.$refs.service_show.data.fields[i].value
1698
- }
1699
- /* if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
1700
- address += '栋'
1701
- } */
1702
- if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
1703
- address += '-' +this.$refs.service_show.data.fields[i].value
1704
- }
1705
- /* if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
1706
- address += '单元'
1707
- } */
1708
- if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
1709
- address += '-' +this.$refs.service_show.data.fields[i].value
1710
- }
1711
- /* if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
1712
- address += '层'
1713
- } */
1714
- if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
1715
- address += '-' +this.$refs.service_show.data.fields[i].value
1716
- }
1717
- /* if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
1718
- address += '室'
1719
- } */
1720
-
1665
+ // 合成地址
1666
+ if (
1667
+ this.$refs.service_show.data.fields[index].label === '县/区' ||
1668
+ this.$refs.service_show.data.fields[index].label === '街道名称' ||
1669
+ this.$refs.service_show.data.fields[index].label === '小区名称' ||
1670
+ this.$refs.service_show.data.fields[index].label === '楼号' ||
1671
+ this.$refs.service_show.data.fields[index].label === '单元号' ||
1672
+ this.$refs.service_show.data.fields[index].label === '楼层' ||
1673
+ this.$refs.service_show.data.fields[index].label === '门牌号'
1674
+ ) {
1675
+ console.log('即将合成地址')
1676
+ var address = ''
1677
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1678
+ // 控制设置级联
1679
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1680
+ // xxx xx xxx
1681
+ if (this.$refs.service_show.data.fields[i].label === '县/区' && this.$refs.service_show.data.fields[i].value) {
1682
+ address += this.$refs.service_show.data.fields[i].value
1683
+ }
1684
+ if (this.$refs.service_show.data.fields[i].label === '街道名称' && this.$refs.service_show.data.fields[i].value) {
1685
+ address += this.$refs.service_show.data.fields[i].value
1686
+ }
1687
+ if (this.$refs.service_show.data.fields[i].label === '小区名称' && this.$refs.service_show.data.fields[i].value) {
1688
+ address += this.$refs.service_show.data.fields[i].value
1689
+ }
1690
+ if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
1691
+ address += this.$refs.service_show.data.fields[i].value
1692
+ }
1693
+ /* if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
1694
+ address += '栋'
1695
+ } */
1696
+ if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
1697
+ address += '-' +this.$refs.service_show.data.fields[i].value
1698
+ }
1699
+ /* if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
1700
+ address += '单元'
1701
+ } */
1702
+ if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
1703
+ address += '-' +this.$refs.service_show.data.fields[i].value
1704
+ }
1705
+ /* if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
1706
+ address += '层'
1707
+ } */
1708
+ if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
1709
+ address += '-' +this.$refs.service_show.data.fields[i].value
1710
+ }
1711
+ /* if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
1712
+ address += '室'
1713
+ } */
1714
+
1715
+ }
1716
+ console.log('获取到的address=>' + address)
1717
+ // 数据获取完毕时放入地址text
1718
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1719
+ if (this.$refs.service_show.data.fields[i].label === '地址' || this.$refs.service_show.data.fields[i].label === '报装地址') {
1720
+ this.$refs.service_show.data.fields[i].value = address
1721
+ console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
1722
+ }
1723
+ }
1724
+ }
1725
+ // 开户费+材料费+人工费+设备安装费=合计
1726
+ if (
1727
+ this.$refs.service_show.data.fields[index].label === '工程安装费' ||
1728
+ this.$refs.service_show.data.fields[index].label === '材料费' ||
1729
+ this.$refs.service_show.data.fields[index].label === '人工费'
1730
+ ) {
1731
+ console.log('即将合成价格')
1732
+ let a1 = 0
1733
+ let b1 = 0
1734
+ let c1 = 0
1735
+ let fee = 0
1736
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1737
+ // 控制设置级联
1738
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1739
+ // xxx xx xxx
1740
+ if (this.$refs.service_show.data.fields[i].label === '工程安装费' && this.$refs.service_show.data.fields[i].value) {
1741
+ a1 = this.$refs.service_show.data.fields[i].value
1742
+ }
1743
+ if (this.$refs.service_show.data.fields[i].label === '材料费' && this.$refs.service_show.data.fields[i].value) {
1744
+ b1= this.$refs.service_show.data.fields[i].value
1721
1745
  }
1722
- console.log('获取到的address=>' + address)
1746
+ if (this.$refs.service_show.data.fields[i].label === '人工费' && this.$refs.service_show.data.fields[i].value) {
1747
+ c1 = this.$refs.service_show.data.fields[i].value
1748
+ }
1749
+ fee=parseFloat(parseFloat(a1) + parseFloat(b1)+parseFloat(c1)).toFixed(2)
1723
1750
  // 数据获取完毕时放入地址text
1724
1751
  for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1725
- if (this.$refs.service_show.data.fields[i].label === '地址' || this.$refs.service_show.data.fields[i].label === '报装地址') {
1726
- this.$refs.service_show.data.fields[i].value = address
1752
+ if (this.$refs.service_show.data.fields[i].label === '费用合计'||this.$refs.service_show.data.fields[i].label === '未结总金额') {
1753
+ this.$refs.service_show.data.fields[i].value =fee
1727
1754
  console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
1728
1755
  }
1729
1756
  }
1730
1757
  }
1731
- // 开户费+材料费+人工费+设备安装费=合计
1732
- if (
1733
- this.$refs.service_show.data.fields[index].label === '工程安装费' ||
1734
- this.$refs.service_show.data.fields[index].label === '材料费' ||
1735
- this.$refs.service_show.data.fields[index].label === '人工费'
1736
- ) {
1737
- console.log('即将合成价格')
1738
- let a1 = 0
1739
- let b1 = 0
1740
- let c1 = 0
1741
- let fee = 0
1758
+ }
1759
+ if (this.$refs.service_show.data.fields[index].label == '用户类型'){
1760
+ if(this.$refs.service_show.data.fields[index].value == '非民用'){
1742
1761
  for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1743
- // 控制设置级联
1744
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
1745
- // xxx xx xxx
1746
- if (this.$refs.service_show.data.fields[i].label === '工程安装费' && this.$refs.service_show.data.fields[i].value) {
1747
- a1 = this.$refs.service_show.data.fields[i].value
1748
- }
1749
- if (this.$refs.service_show.data.fields[i].label === '材料费' && this.$refs.service_show.data.fields[i].value) {
1750
- b1= this.$refs.service_show.data.fields[i].value
1751
- }
1752
- if (this.$refs.service_show.data.fields[i].label === '人工费' && this.$refs.service_show.data.fields[i].value) {
1753
- c1 = this.$refs.service_show.data.fields[i].value
1754
- }
1755
- fee=parseFloat(parseFloat(a1) + parseFloat(b1)+parseFloat(c1)).toFixed(2)
1756
- // 数据获取完毕时放入地址text
1757
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1758
- if (this.$refs.service_show.data.fields[i].label === '费用合计'||this.$refs.service_show.data.fields[i].label === '未结总金额') {
1759
- this.$refs.service_show.data.fields[i].value =fee
1760
- console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
1761
- }
1762
+ if (this.$refs.service_show.data.fields[i].label === '小区名称') {
1763
+ this.$refs.service_show.data.fields[i].required=false;
1762
1764
  }
1763
1765
  }
1764
- }
1765
- if (this.$refs.service_show.data.fields[index].label == '用户类型'){
1766
- if(this.$refs.service_show.data.fields[index].value == '非民用'){
1767
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1768
- if (this.$refs.service_show.data.fields[i].label === '小区名称') {
1769
- this.$refs.service_show.data.fields[i].required=false;
1770
- }
1771
- }
1772
- }else{
1773
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1774
- if (this.$refs.service_show.data.fields[i].label === '小区名称') {
1775
- this.$refs.service_show.data.fields[i].required=true;
1776
- }
1766
+ }else{
1767
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1768
+ if (this.$refs.service_show.data.fields[i].label === '小区名称') {
1769
+ this.$refs.service_show.data.fields[i].required=true;
1777
1770
  }
1778
1771
  }
1779
1772
  }
1773
+ }
1780
1774
 
1781
- if (this.$refs.service_show.data.fields[index].label === '施工是否完成') {
1782
- let temp = this.$refs.service_show.data.fields[index].value
1783
- console.log('==============================施工是否完成:' + temp)
1784
- if (temp === '是') {
1785
- let f_project_material = ''
1786
- if (this.$refs.service_show.data.defname === '施工') {
1787
- let http = new HttpResetClass()
1788
- let data = {
1789
- f_process_id: this.$refs.service_show.data.f_process_id,
1790
- defname: this.$refs.service_show.data.defname
1791
- }
1792
- let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1793
- {resolveMsg: null, rejectMsg: null})
1794
- res.data.forEach(item =>{
1795
- f_project_material += item.fusetype + ','
1796
- })
1775
+ if (this.$refs.service_show.data.fields[index].label === '施工是否完成') {
1776
+ let temp = this.$refs.service_show.data.fields[index].value
1777
+ console.log('==============================施工是否完成:' + temp)
1778
+ if (temp === '是') {
1779
+ let f_project_material = ''
1780
+ if (this.$refs.service_show.data.defname === '施工') {
1781
+ let http = new HttpResetClass()
1782
+ let data = {
1783
+ f_process_id: this.$refs.service_show.data.f_process_id,
1784
+ defname: this.$refs.service_show.data.defname
1797
1785
  }
1786
+ let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1787
+ {resolveMsg: null, rejectMsg: null})
1788
+ res.data.forEach(item =>{
1789
+ f_project_material += item.fusetype + ','
1790
+ })
1791
+ }
1798
1792
 
1799
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1800
- if (this.$refs.service_show.data.fields[i].label === '施工已上传文件') {
1801
- this.$refs.service_show.data.fields[i].value = f_project_material
1802
- }
1793
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1794
+ if (this.$refs.service_show.data.fields[i].label === '施工已上传文件') {
1795
+ this.$refs.service_show.data.fields[i].value = f_project_material
1803
1796
  }
1804
1797
  }
1805
1798
  }
1799
+ }
1806
1800
 
1807
- if (this.$refs.service_show.data.fields[index].label === '验收是否完成') {
1808
- let temp = this.$refs.service_show.data.fields[index].value
1809
- console.log('==============================验收是否完成:' + temp)
1810
- if (temp === '是') {
1811
- let f_iscomplete_information = ''
1812
- if (this.$refs.service_show.data.defname === '施工验收') {
1813
- let http = new HttpResetClass()
1814
- let data = {
1815
- f_process_id: this.$refs.service_show.data.f_process_id,
1816
- defname: this.$refs.service_show.data.defname
1817
- }
1818
- let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1819
- {resolveMsg: null, rejectMsg: null})
1820
- res.data.forEach(item =>{
1821
- f_iscomplete_information += item.fusetype + ','
1822
- })
1801
+ if (this.$refs.service_show.data.fields[index].label === '验收是否完成') {
1802
+ let temp = this.$refs.service_show.data.fields[index].value
1803
+ console.log('==============================验收是否完成:' + temp)
1804
+ if (temp === '是') {
1805
+ let f_iscomplete_information = ''
1806
+ if (this.$refs.service_show.data.defname === '施工验收') {
1807
+ let http = new HttpResetClass()
1808
+ let data = {
1809
+ f_process_id: this.$refs.service_show.data.f_process_id,
1810
+ defname: this.$refs.service_show.data.defname
1823
1811
  }
1812
+ let res = await http.load('POST', 'rs/sql/getFileNames', {data:data},
1813
+ {resolveMsg: null, rejectMsg: null})
1814
+ res.data.forEach(item =>{
1815
+ f_iscomplete_information += item.fusetype + ','
1816
+ })
1817
+ }
1824
1818
 
1825
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1826
- if (this.$refs.service_show.data.fields[i].label === '验收已上传文件') {
1827
- this.$refs.service_show.data.fields[i].value = f_iscomplete_information
1828
- }
1819
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
1820
+ if (this.$refs.service_show.data.fields[i].label === '验收已上传文件') {
1821
+ this.$refs.service_show.data.fields[i].value = f_iscomplete_information
1829
1822
  }
1830
1823
  }
1831
1824
  }
1825
+ }
1832
1826
 
1833
1827
 
1834
- },
1835
- // onetomany模态框监听事件
1836
- async 'select_cascade_modal'(i,j){
1837
- if(this.data.onetomany[i].tables[0]=='t_apply_construct_balance'){
1838
- if(this.data.onetomany[i].fields[j].label == '第三施工方'){
1839
- for(let k =0;k<this.data.onetomany[i].fields.length;k++){
1840
-
1841
- if(this.data.onetomany[i].fields[k].label.includes('当前累计结算比例')){
1842
- let sum = 0
1843
- for(let p =0;p<this.$refs.service_show.model.rows[i].length;p++){
1844
- if(this.$refs.service_show.model.rows[i][p].f_construct_company == this.$refs.service_show.showadd_fields.fields[j].value){
1845
- sum+=Number(this.$refs.service_show.showadd_fields.fields[k-2].value)
1846
- sum+=Number(this.$refs.service_show.model.rows[i][p].f_balance_scale)
1847
- }
1848
- }
1849
- if(this.$refs.service_show.model.rows[i].length==0){
1850
- sum = Number(this.$refs.service_show.showadd_fields.fields[k-2].value)
1828
+ },
1829
+ // onetomany模态框监听事件
1830
+ async 'select_cascade_modal'(i,j){
1831
+ if(this.data.onetomany[i].tables[0]=='t_apply_construct_balance'){
1832
+ if(this.data.onetomany[i].fields[j].label == '第三施工方'){
1833
+ for(let k =0;k<this.data.onetomany[i].fields.length;k++){
1834
+
1835
+ if(this.data.onetomany[i].fields[k].label.includes('当前累计结算比例')){
1836
+ let sum = 0
1837
+ for(let p =0;p<this.$refs.service_show.model.rows[i].length;p++){
1838
+ if(this.$refs.service_show.model.rows[i][p].f_construct_company == this.$refs.service_show.showadd_fields.fields[j].value){
1839
+ sum+=Number(this.$refs.service_show.showadd_fields.fields[k-2].value)
1840
+ sum+=Number(this.$refs.service_show.model.rows[i][p].f_balance_scale)
1851
1841
  }
1852
- this.$refs.service_show.update_showadd_fields_value(k,sum)
1853
1842
  }
1843
+ if(this.$refs.service_show.model.rows[i].length==0){
1844
+ sum = Number(this.$refs.service_show.showadd_fields.fields[k-2].value)
1845
+ }
1846
+ this.$refs.service_show.update_showadd_fields_value(k,sum)
1854
1847
  }
1855
1848
  }
1856
1849
  }
1857
- },
1858
- async 'onetomanyevent'(datas) {
1859
- // console.log(`onetomany=======>${JSON.stringify(datas)}`)
1860
-
1861
- for (let i = 0; i < datas.rows.length; i++) {
1862
- datas.rows[i]['f_process_id'] = this.selectdata.f_process_id
1863
- datas.rows[i]['f_apply_num'] = this.selectdata.f_apply_num
1864
- datas.rows[i]['f_filiale'] = this.$login.f.f_fengongsi
1865
- datas.rows[i]['f_parentname'] = this.$login.f.f_parentname
1866
- datas.rows[i]['f_operator'] = this.$login.f.name
1867
- }
1868
- let http = new HttpResetClass()
1869
- await http.load('POST', 'rs/logic/saveentity', datas, {resolveMsg: null, rejectMsg: 'search查询部门下所有人失败'})
1870
- }
1871
- ,
1872
- // 获取view层button事件/
1873
- async 'button'(model) {
1874
- console.log("button事件接收参数:", model)
1875
- if (this.data.defname==='踏勘'){
1876
- if (model.button.button_name === '终止'){
1877
- this.stop_show=true
1878
- return
1879
- }
1850
+ }
1851
+ },
1852
+ async 'onetomanyevent'(datas) {
1853
+ // console.log(`onetomany=======>${JSON.stringify(datas)}`)
1854
+
1855
+ for (let i = 0; i < datas.rows.length; i++) {
1856
+ datas.rows[i]['f_process_id'] = this.selectdata.f_process_id
1857
+ datas.rows[i]['f_apply_num'] = this.selectdata.f_apply_num
1858
+ datas.rows[i]['f_filiale'] = this.$login.f.f_fengongsi
1859
+ datas.rows[i]['f_parentname'] = this.$login.f.f_parentname
1860
+ datas.rows[i]['f_operator'] = this.$login.f.name
1861
+ }
1862
+ let http = new HttpResetClass()
1863
+ await http.load('POST', 'rs/logic/saveentity', datas, {resolveMsg: null, rejectMsg: 'search查询部门下所有人失败'})
1864
+ }
1865
+ ,
1866
+ // 获取view层button事件/
1867
+ async 'button'(model) {
1868
+ console.log("button事件接收参数:", model)
1869
+ if (this.data.defname==='踏勘'||this.data.defname==='施工'||this.data.defname==='施工验收'){
1870
+ if (model.button.button_name === '终止'){
1871
+ this.stop_show=true
1872
+ return
1880
1873
  }
1881
- /* if (this.data.defname === '通气转单'){
1882
- if (model.button.button_name === '散户报装'){
1883
- this.addactive('报装申请')
1884
- }
1885
- if (model.button.button_name === '集体报装'){
1886
- this.addactive('集体报装申请')
1887
- }
1888
- setTimeout(() => {
1874
+ }
1875
+ /* if (this.data.defname === '通气转单'){
1876
+ if (model.button.button_name === '散户报装'){
1877
+ this.addactive('报装申请')
1878
+ }
1879
+ if (model.button.button_name === '集体报装'){
1880
+ this.addactive('集体报装申请')
1881
+ }
1882
+ setTimeout(() => {
1889
1883
 
1890
- }, 200)
1891
- }*/
1884
+ }, 200)
1885
+ }*/
1892
1886
 
1893
- // 点击重置按钮就重置数据
1894
- if (model.button.button_name === '重置') {
1895
- this.refurbish()
1896
- return
1887
+ // 点击重置按钮就重置数据
1888
+ if (model.button.button_name === '重置') {
1889
+ this.refurbish()
1890
+ return
1891
+ }
1892
+ if (model.button.button_name === '打印回单') {
1893
+ this.printReceipt(model)
1894
+ return
1895
+ }
1896
+ var operate = ''
1897
+ // 判断当前按钮是否为特殊业务,即子流程提交或者分发
1898
+ if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '子流程提交') {
1899
+ operate = '子流程提交'
1900
+ }
1901
+ if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '合同信息') {
1902
+ model.f_budget_money = model.f_contract_money
1903
+ //未结算总金额=合计
1904
+ model.f_unaccounts_money = model.f_total_cost
1905
+ model.f_cumulative_money = 0
1906
+ model.f_cumulative_invoicing = 0
1907
+ model.f_additional_payment = 0
1908
+ model.f_residual_invoicing = model.f_contract_money
1909
+ }
1910
+ if (model.button.button_name === '下发') {
1911
+ if (model.button && model.button.button_event === '分发') {
1912
+ operate = '分发'
1897
1913
  }
1898
- if (model.button.button_name === '打印回单') {
1899
- this.printReceipt(model)
1900
- return
1914
+ let array = this.$login.f.rolesnames.split(',')
1915
+ if (this.selectdata.defname == '任务分配' && array.includes("工程技术部负责人")) {
1916
+ model.f_survey_name = model.button.button_fields.f_apply_kefu_employee
1901
1917
  }
1902
- var operate = ''
1903
- // 判断当前按钮是否为特殊业务,即子流程提交或者分发
1904
- if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '子流程提交') {
1905
- operate = '子流程提交'
1906
- }
1907
- if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '合同信息') {
1908
- model.f_budget_money = model.f_contract_money
1909
- //未结算总金额=合计
1910
- model.f_unaccounts_money = model.f_total_cost
1911
- model.f_cumulative_money = 0
1912
- model.f_cumulative_invoicing = 0
1913
- model.f_additional_payment = 0
1914
- model.f_residual_invoicing = model.f_contract_money
1915
- }
1916
- if (model.button.button_name === '下发') {
1917
- if (model.button && model.button.button_event === '分发') {
1918
- operate = '分发'
1919
- }
1920
- let array = this.$login.f.rolesnames.split(',')
1921
- if (this.selectdata.defname == '任务分配' && array.includes("工程技术部负责人")) {
1922
- model.f_survey_name = model.button.button_fields.f_apply_kefu_employee
1923
- }
1924
- }
1925
-
1926
- if (model.button.button_name == '提交' && model.button.button_person && model.button.button_person.button_event === '获取之前被下发人' && model.button.button_person.button_person_field) {
1927
- model.button.button_name = '下发'
1928
- model.button.button_fields = {}
1929
- console.log(model.button.button_person.button_person_field)
1930
- console.log(this.selectdata[model.button.button_person.button_person_field])
1931
- console.log(this.selectdata)
1932
- if(this.selectdata[model.button.button_person.button_person_field].startsWith('{')){
1933
- let temp= JSON.parse(this.selectdata[model.button.button_person.button_person_field])
1934
- model.button.button_fields[model.button.button_person.button_person_field] = temp.id
1935
- }else{
1936
- model.button.button_fields[model.button.button_person.button_person_field] = this.selectdata[model.button.button_person.button_person_field]
1937
- }
1938
-
1939
- }
1940
- if (model.button.button_name === '提交') {
1941
- // for (let i = 0; i < this.show_data.fields.length; i++) {
1942
- // if (this.show_data.fields[i].label === '收费项目') {
1943
- // let yuanXiang = this.show_data.fields[i].value
1944
- // if (yuanXiang != '' && yuanXiang != null) {
1945
- // for (let i = 0; i < yuanXiang.length; i++) {
1946
- // this.xia += yuanXiang[i] + '-'
1947
- // }
1948
- // let idx = this.xia.lastIndexOf("-");
1949
- // this.xiangmu = this.xia.substring(0,idx)
1950
- // }
1951
- // model.f_charge_items = this.xiangmu
1952
- // }
1953
- // }
1954
- var flag = false
1955
- if (this.data.defname == '合同审核') {
1956
- flag = true
1957
- let http = new HttpResetClass()
1958
- let data = {
1959
- tablename: 't_singlevalue',
1960
- condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`
1961
- }
1962
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
1963
- resolveMsg: null,
1964
- rejectMsg: "获取合同编号失败"
1965
- })
1966
- if (this.contract != res.data[0].value && !this.selectdata.f_contract_number) {
1967
- this.$showMessage("合同编号已经被使用,请按F5刷新页面后重新登记")
1968
- return
1969
- }
1970
- }
1918
+ }
1971
1919
 
1920
+ if (model.button.button_name == '提交' && model.button.button_person && model.button.button_person.button_event === '获取之前被下发人' && model.button.button_person.button_person_field) {
1921
+ model.button.button_name = '下发'
1922
+ model.button.button_fields = {}
1923
+ console.log(model.button.button_person.button_person_field)
1924
+ console.log(this.selectdata[model.button.button_person.button_person_field])
1925
+ console.log(this.selectdata)
1926
+ if(this.selectdata[model.button.button_person.button_person_field].startsWith('{')){
1927
+ let temp= JSON.parse(this.selectdata[model.button.button_person.button_person_field])
1928
+ model.button.button_fields[model.button.button_person.button_person_field] = temp.id
1929
+ }else{
1930
+ model.button.button_fields[model.button.button_person.button_person_field] = this.selectdata[model.button.button_person.button_person_field]
1972
1931
  }
1973
- console.log('本次点击button执行的操作是=>' + operate)
1974
- model = Object.assign({}, this.selectdata, model)
1975
- model.f_sub_state = '未完工'
1976
- if (this.data.defname === '通气转单' && model.button.button_name === '提交'){
1977
- model.f_sub_state = '完工'
1978
- }
1979
- let http = new HttpResetClass()
1980
- var url
1981
- var requestData = {
1982
- tables: this.data.tables,
1983
- start_activity: this.$workflow_vue.start_activity,
1984
- model: model,
1985
- loginUser: this.$login.f
1986
- }
1987
- if (operate != '') {
1988
- // 特殊操作走特殊logic业务处理
1989
- url = 'rs/logic/SubprocessService'
1990
- requestData = {
1991
- tables: this.data.tables, model: model
1992
- }
1993
- } else if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '分支流程异步合并处理') {
1994
- url = 'rs/logic/branchsyncprocess'
1995
- requestData = {
1996
- tables: this.data.tables, model: model
1997
- }
1998
- } else {
1999
- if(requestData.model.f_stair_price_name === ''|| requestData.model.f_stair_price_name === null|| requestData.model.f_stair_price_name === undefined){
2000
- requestData.model.f_stair_price_name = this.selectdata.f_stair_price_name
1932
+
1933
+ }
1934
+ if (model.button.button_name === '提交') {
1935
+ // for (let i = 0; i < this.show_data.fields.length; i++) {
1936
+ // if (this.show_data.fields[i].label === '收费项目') {
1937
+ // let yuanXiang = this.show_data.fields[i].value
1938
+ // if (yuanXiang != '' && yuanXiang != null) {
1939
+ // for (let i = 0; i < yuanXiang.length; i++) {
1940
+ // this.xia += yuanXiang[i] + '-'
1941
+ // }
1942
+ // let idx = this.xia.lastIndexOf("-");
1943
+ // this.xiangmu = this.xia.substring(0,idx)
1944
+ // }
1945
+ // model.f_charge_items = this.xiangmu
1946
+ // }
1947
+ // }
1948
+ var flag = false
1949
+ if (this.data.defname == '合同审核') {
1950
+ flag = true
1951
+ let http = new HttpResetClass()
1952
+ let data = {
1953
+ tablename: 't_singlevalue',
1954
+ condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`
2001
1955
  }
2002
- console.log("流程下一步",requestData.model.f_stair_price_name)
2003
- // 下发,提交,保存,退回通用业务后台处理logic
2004
- url = 'rs/logic/ApplyProductService'
2005
- requestData = {
2006
- tables: this.data.tables, model: model
1956
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
1957
+ resolveMsg: null,
1958
+ rejectMsg: "获取合同编号失败"
1959
+ })
1960
+ if (this.contract != res.data[0].value && !this.selectdata.f_contract_number) {
1961
+ this.$showMessage("合同编号已经被使用,请按F5刷新页面后重新登记")
1962
+ return
2007
1963
  }
2008
1964
  }
2009
- if (this.data.defname==='踏勘'&&(model.button.button_name === '提交'||model.button.button_name === '通气')){
2010
- this.apply_show=true
2011
- this.models2 = model
2012
- return
1965
+
1966
+ }
1967
+ console.log('本次点击button执行的操作是=>' + operate)
1968
+ model = Object.assign({}, this.selectdata, model)
1969
+ model.f_sub_state = '未完工'
1970
+ if (this.data.defname === '通气转单' && model.button.button_name === '提交'){
1971
+ model.f_sub_state = '完工'
1972
+ }
1973
+ let http = new HttpResetClass()
1974
+ var url
1975
+ var requestData = {
1976
+ tables: this.data.tables,
1977
+ start_activity: this.$workflow_vue.start_activity,
1978
+ model: model,
1979
+ loginUser: this.$login.f
1980
+ }
1981
+ if (operate != '') {
1982
+ // 特殊操作走特殊logic业务处理
1983
+ url = 'rs/logic/SubprocessService'
1984
+ requestData = {
1985
+ tables: this.data.tables, model: model
1986
+ }
1987
+ } else if (model.button.button_name === '提交' && model.button.button_event && model.button.button_event === '分支流程异步合并处理') {
1988
+ url = 'rs/logic/branchsyncprocess'
1989
+ requestData = {
1990
+ tables: this.data.tables, model: model
1991
+ }
1992
+ } else {
1993
+ if(requestData.model.f_stair_price_name === ''|| requestData.model.f_stair_price_name === null|| requestData.model.f_stair_price_name === undefined){
1994
+ requestData.model.f_stair_price_name = this.selectdata.f_stair_price_name
1995
+ }
1996
+ console.log("流程下一步",requestData.model.f_stair_price_name)
1997
+ // 下发,提交,保存,退回通用业务后台处理logic
1998
+ url = 'rs/logic/ApplyProductService'
1999
+ requestData = {
2000
+ tables: this.data.tables, model: model
2013
2001
  }
2002
+ }
2003
+ if (this.data.defname==='踏勘'&&(model.button.button_name === '提交'||model.button.button_name === '通气')){
2004
+ this.apply_show=true
2005
+ this.models2 = model
2006
+ return
2007
+ }
2014
2008
 
2015
- requestData.start_activity = this.$workflow_vue.start_activity
2016
- requestData.loginUser = this.$login.f
2017
- requestData.workflow_xmlfilename = this.$workflow_vue.workflow_xmlfilename
2009
+ requestData.start_activity = this.$workflow_vue.start_activity
2010
+ requestData.loginUser = this.$login.f
2011
+ requestData.workflow_xmlfilename = this.$workflow_vue.workflow_xmlfilename
2018
2012
 
2019
- console.log('即将发送请求url=>' + url + ',参数=>' + JSON.stringify(requestData))
2020
- let res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
2021
- console.log("service处理完成返回数据:", JSON.stringify(res.data))
2022
- if(res.data.msg=="地址重复,请修改后重新提交"){
2023
- this.$showMessage(res.data.msg)
2024
- }
2025
- if (res.data.code == 200) {
2026
- // flag 为合同编号更新标志
2027
- if (flag) {
2028
- let http = new HttpResetClass()
2029
- let data = {
2030
- tablename: 't_singlevalue',
2031
- condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`,
2032
- value: (Number(this.contract) + 1) + ''
2033
- }
2034
- await http.load('POST', 'rs/logic/updatesinglevalue', {data: data}, {
2035
- resolveMsg: null,
2036
- rejectMsg: "获取合同编号更新失败"
2037
- })
2013
+ console.log('即将发送请求url=>' + url + ',参数=>' + JSON.stringify(requestData))
2014
+ let res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
2015
+ console.log("service处理完成返回数据:", JSON.stringify(res.data))
2016
+ if(res.data.msg=="地址重复,请修改后重新提交"){
2017
+ this.$showMessage(res.data.msg)
2018
+ }
2019
+ if (res.data.code == 200) {
2020
+ // flag 为合同编号更新标志
2021
+ if (flag) {
2022
+ let http = new HttpResetClass()
2023
+ let data = {
2024
+ tablename: 't_singlevalue',
2025
+ condition: `name = '合同编号' and f_filialeids = '${this.$login.f.f_orgids}'`,
2026
+ value: (Number(this.contract) + 1) + ''
2038
2027
  }
2039
- this.showview = false
2040
- // 特殊处理
2041
- this.special(model)
2042
- this.$dispatch('close')
2043
- this.initializtion()
2044
- } else {
2045
- if (res.data.msg) {
2046
- this.$showMessage(res.data.msg)
2047
- }
2048
- }
2049
- /*
2050
- if(this.selectdata.defname =='报装申请'|| this.selectdata.defname =='现场勘查'|| this.selectdata.defname =='验收'||this.selectdata.defname =='集体报装申请'||this.selectdata.defname =='现场勘查人员分配'||this.selectdata.defname =='安装通气' ){
2051
- console.log("defname======================================",this.selectdata.defname)
2052
- let http1 = new HttpResetClass();
2053
- let sendtime = null;
2054
- let finishtime = null;
2055
- let f_department = null;
2056
- let f_process_id = null;
2057
- let data1 = {
2058
- f_process_id: this.selectdata.f_process_id,
2059
- defname : this.selectdata.defname
2060
- }
2061
- console.log("res1=======================================",data1)
2062
- await http1.load('POST', 'rs/logic/getTime', {data:data1}).then((res) => {
2063
- console.log("objk===>",res.data)
2064
- sendtime=res.data.getUserid[0].sendtime;
2065
- finishtime=res.data.getUserid[0].finishtime;
2066
- f_department=res.data.resdata[0].name;
2067
- console.log("objk===>")
2028
+ await http.load('POST', 'rs/logic/updatesinglevalue', {data: data}, {
2029
+ resolveMsg: null,
2030
+ rejectMsg: "获取合同编号更新失败"
2068
2031
  })
2069
-
2070
- let data2 = {
2071
- department:f_department,
2072
- resourceCatalog:this.selectdata.defname,
2073
- sqzt:model.f_user_name,
2074
- code:model.f_idnumber,
2075
- sqsj:sendtime,
2076
- slsj:sendtime,
2077
- bjsj:finishtime,
2078
- blcb:0,
2079
- sqclsl:0,
2080
- sqclmc:'',
2081
- gdlsh:'',
2082
- sbdz:model.f_address,
2083
- sldw:'鄂州市安泰天然气有限责任公司',
2084
- sfyj:'',
2085
- gxzq:'',
2086
- type:this.selectdata.defname
2087
- }
2088
- console.log("====================================",data2)
2089
- await http1.load('POST', 'rs/logic/getPost', {data:data2})
2090
- }
2091
- */
2092
- }
2093
- ,
2094
- async 'onetomanydelete'(i, j) {
2095
- let http = new HttpResetClass()
2096
- let data = {
2097
- tables: this.show_data.onetomany[i].tables,
2098
- row: this.$refs.service_show.model.rows[i][j]
2099
2032
  }
2100
- await http.load('POST', 'rs/logic/applyDeleteValue', {data: data}, {
2101
- resolveMsg: null,
2102
- rejectMsg: 'onetomanydelete失败'
2103
- }).then(() => {
2104
- this.$dispatch('selfsearch')
2105
- this.$refs.service_show.model.rows[i].splice(j, 1)
2106
- })
2033
+ this.showview = false
2034
+ // 特殊处理
2035
+ this.special(model)
2036
+ this.$dispatch('close')
2037
+ this.initializtion()
2038
+ } else {
2039
+ if (res.data.msg) {
2040
+ this.$showMessage(res.data.msg)
2041
+ }
2107
2042
  }
2108
- ,
2109
- //获取view层confirm事件
2110
- async 'confirm'(tables, row, showadd_index, j) {
2111
- var _this = this
2112
- for (let i = 0; i < tables.length; i++) {
2113
- let datas = {
2114
- tables: tables,
2115
- row: row
2116
- }
2117
- console.log("看看datas")
2118
- console.log(datas)
2119
- console.log("看看showadd_index")
2120
- console.log(showadd_index)
2121
- datas.row['f_process_id'] = this.selectdata.f_process_id
2122
- datas.row['f_apply_num'] = this.selectdata.f_apply_num
2123
- datas.row['f_filiale'] = this.selectdata.f_filiale
2124
- let http = new HttpResetClass()
2125
- let sellid = ''
2126
- let billtype = datas.row['f_bill_style']
2127
- if (tables[i] == 't_charge_record') {
2128
- await this.loadbuyer()
2129
- if (this.buyerinfo.rows.length < 1 && billtype === '增值税电子发票' && this.$appdata.getSingleValue('默认打印票据') === '是') {
2130
- this.$showAlert('未找到购买方信息,请去报建功能"购买方信息"中完善购买方信息后再收费', 'info', 2000)
2131
- this.$refs.service_show.model.rows[showadd_index].splice(j, 1)
2132
- this.$refs.service_show.initializtion()
2133
- return
2134
- }
2135
- datas.row.f_charging_status = '有效'
2136
- datas.row.f_is_correct = '否'
2137
- datas.row.f_charge_collectors = this.$login.f.name
2138
- datas.row.f_amount_words=this.smalltoBIG(datas.row.f_charge_money)
2139
- await http.load('POST', 'rs/logic/applycharge', datas, {
2140
- resolveMsg: null,
2141
- rejectMsg: '收费保存失败'
2142
- }).then((res) => {
2143
- sellid = JSON.parse(res.data.sellid).id
2144
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
2145
- //
2146
- // if (this.$refs.service_show.data.fields[i].label == '累计缴费金额') {
2147
- // this.$refs.service_show.data.fields[i].value = res.data.f_cumulative_money
2148
- // }
2149
- //
2150
- // if (this.$refs.service_show.data.fields[i].label == '未结总金额') {
2151
- // this.$refs.service_show.data.fields[i].value = res.data.f_unaccounts_money
2152
- // }
2043
+ /*
2044
+ if(this.selectdata.defname =='报装申请'|| this.selectdata.defname =='现场勘查'|| this.selectdata.defname =='验收'||this.selectdata.defname =='集体报装申请'||this.selectdata.defname =='现场勘查人员分配'||this.selectdata.defname =='安装通气' ){
2045
+ console.log("defname======================================",this.selectdata.defname)
2046
+ let http1 = new HttpResetClass();
2047
+ let sendtime = null;
2048
+ let finishtime = null;
2049
+ let f_department = null;
2050
+ let f_process_id = null;
2051
+ let data1 = {
2052
+ f_process_id: this.selectdata.f_process_id,
2053
+ defname : this.selectdata.defname
2054
+ }
2055
+ console.log("res1=======================================",data1)
2056
+ await http1.load('POST', 'rs/logic/getTime', {data:data1}).then((res) => {
2057
+ console.log("objk===>",res.data)
2058
+ sendtime=res.data.getUserid[0].sendtime;
2059
+ finishtime=res.data.getUserid[0].finishtime;
2060
+ f_department=res.data.resdata[0].name;
2061
+ console.log("objk===>")
2062
+ })
2153
2063
 
2064
+ let data2 = {
2065
+ department:f_department,
2066
+ resourceCatalog:this.selectdata.defname,
2067
+ sqzt:model.f_user_name,
2068
+ code:model.f_idnumber,
2069
+ sqsj:sendtime,
2070
+ slsj:sendtime,
2071
+ bjsj:finishtime,
2072
+ blcb:0,
2073
+ sqclsl:0,
2074
+ sqclmc:'',
2075
+ gdlsh:'',
2076
+ sbdz:model.f_address,
2077
+ sldw:'鄂州市安泰天然气有限责任公司',
2078
+ sfyj:'',
2079
+ gxzq:'',
2080
+ type:this.selectdata.defname
2081
+ }
2082
+ console.log("====================================",data2)
2083
+ await http1.load('POST', 'rs/logic/getPost', {data:data2})
2154
2084
  }
2155
- let temp = _this.$refs.service_show.model.rows[showadd_index][j]
2156
- temp.id = sellid
2157
- _this.$refs.service_show.model.rows[showadd_index][j] = temp
2158
- })
2159
- if (this.$appdata.getSingleValue('默认打印票据') && this.$appdata.getSingleValue('默认打印票据') === '是') {
2160
- this.$showMessage('是否打票据', ['confirm', 'cancel']).then((res) => {
2161
- if (res === 'confirm') {
2162
- console.log('打印票据')
2163
- if (billtype === '增值税电子发票') {
2164
- this.selectsellid = sellid
2165
- this.showbuyerinfo = true
2166
- } else {
2167
- this.printbill(sellid)
2168
- }
2169
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
2170
- if (this.$refs.service_show.data.fields[i].label == '累计开票金额') {
2171
- console.log("计算累计开票金额")
2172
- this.$refs.service_show.data.fields[i].value = parseInt(this.$refs.service_show.data.fields[i].value) + this.datas.row.f_cumulative_invoicing
2173
- }
2085
+ */
2086
+ }
2087
+ ,
2088
+ async 'onetomanydelete'(i, j) {
2089
+ let http = new HttpResetClass()
2090
+ let data = {
2091
+ tables: this.show_data.onetomany[i].tables,
2092
+ row: this.$refs.service_show.model.rows[i][j]
2093
+ }
2094
+ await http.load('POST', 'rs/logic/applyDeleteValue', {data: data}, {
2095
+ resolveMsg: null,
2096
+ rejectMsg: 'onetomanydelete失败'
2097
+ }).then(() => {
2098
+ this.$dispatch('selfsearch')
2099
+ this.$refs.service_show.model.rows[i].splice(j, 1)
2100
+ })
2101
+ }
2102
+ ,
2103
+ //获取view层confirm事件
2104
+ async 'confirm'(tables, row, showadd_index, j) {
2105
+ var _this = this
2106
+ for (let i = 0; i < tables.length; i++) {
2107
+ let datas = {
2108
+ tables: tables,
2109
+ row: row
2110
+ }
2111
+ console.log("看看datas")
2112
+ console.log(datas)
2113
+ console.log("看看showadd_index")
2114
+ console.log(showadd_index)
2115
+ datas.row['f_process_id'] = this.selectdata.f_process_id
2116
+ datas.row['f_apply_num'] = this.selectdata.f_apply_num
2117
+ datas.row['f_filiale'] = this.selectdata.f_filiale
2118
+ let http = new HttpResetClass()
2119
+ let sellid = ''
2120
+ let billtype = datas.row['f_bill_style']
2121
+ if (tables[i] == 't_charge_record') {
2122
+ await this.loadbuyer()
2123
+ if (this.buyerinfo.rows.length < 1 && billtype === '增值税电子发票' && this.$appdata.getSingleValue('默认打印票据') === '是') {
2124
+ this.$showAlert('未找到购买方信息,请去报建功能"购买方信息"中完善购买方信息后再收费', 'info', 2000)
2125
+ this.$refs.service_show.model.rows[showadd_index].splice(j, 1)
2126
+ this.$refs.service_show.initializtion()
2127
+ return
2128
+ }
2129
+ datas.row.f_charging_status = '有效'
2130
+ datas.row.f_is_correct = '否'
2131
+ datas.row.f_charge_collectors = this.$login.f.name
2132
+ datas.row.f_amount_words=this.smalltoBIG(datas.row.f_charge_money)
2133
+ await http.load('POST', 'rs/logic/applycharge', datas, {
2134
+ resolveMsg: null,
2135
+ rejectMsg: '收费保存失败'
2136
+ }).then((res) => {
2137
+ sellid = JSON.parse(res.data.sellid).id
2138
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
2139
+ //
2140
+ // if (this.$refs.service_show.data.fields[i].label == '累计缴费金额') {
2141
+ // this.$refs.service_show.data.fields[i].value = res.data.f_cumulative_money
2142
+ // }
2143
+ //
2144
+ // if (this.$refs.service_show.data.fields[i].label == '未结总金额') {
2145
+ // this.$refs.service_show.data.fields[i].value = res.data.f_unaccounts_money
2146
+ // }
2147
+
2148
+ }
2149
+ let temp = _this.$refs.service_show.model.rows[showadd_index][j]
2150
+ temp.id = sellid
2151
+ _this.$refs.service_show.model.rows[showadd_index][j] = temp
2152
+ })
2153
+ if (this.$appdata.getSingleValue('默认打印票据') && this.$appdata.getSingleValue('默认打印票据') === '是') {
2154
+ this.$showMessage('是否打票据', ['confirm', 'cancel']).then((res) => {
2155
+ if (res === 'confirm') {
2156
+ console.log('打印票据')
2157
+ if (billtype === '增值税电子发票') {
2158
+ this.selectsellid = sellid
2159
+ this.showbuyerinfo = true
2160
+ } else {
2161
+ this.printbill(sellid)
2162
+ }
2163
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
2164
+ if (this.$refs.service_show.data.fields[i].label == '累计开票金额') {
2165
+ console.log("计算累计开票金额")
2166
+ this.$refs.service_show.data.fields[i].value = parseInt(this.$refs.service_show.data.fields[i].value) + this.datas.row.f_cumulative_invoicing
2174
2167
  }
2175
2168
  }
2176
- })
2177
- }
2178
- // 刷新列表数据
2179
- console.log("刷新一下")
2180
- this.$dispatch('selfsearch')
2181
- console.log("刷新完成")
2182
- } else {
2183
- await http.load('POST', 'rs/logic/saveentity', datas, {
2184
- resolveMsg: null,
2185
- rejectMsg: 'onetomany保存失败'
2186
- }).then((res) => {
2187
- // 刷新列表数据
2188
- this.$dispatch('selfsearch')
2189
- let temp = _this.$refs.service_show.model.rows[showadd_index][j]
2190
- temp.id = res.data.id
2191
- _this.$refs.service_show.model.rows[showadd_index][j] = temp
2169
+ }
2192
2170
  })
2193
2171
  }
2172
+ // 刷新列表数据
2173
+ console.log("刷新一下")
2174
+ this.$dispatch('selfsearch')
2175
+ console.log("刷新完成")
2176
+ } else {
2177
+ await http.load('POST', 'rs/logic/saveentity', datas, {
2178
+ resolveMsg: null,
2179
+ rejectMsg: 'onetomany保存失败'
2180
+ }).then((res) => {
2181
+ // 刷新列表数据
2182
+ this.$dispatch('selfsearch')
2183
+ let temp = _this.$refs.service_show.model.rows[showadd_index][j]
2184
+ temp.id = res.data.id
2185
+ _this.$refs.service_show.model.rows[showadd_index][j] = temp
2186
+ })
2194
2187
  }
2195
2188
  }
2196
2189
  }
2197
2190
  }
2191
+ }
2198
2192
 
2199
2193
  </script>