apply-clients 5.0.35-ezhou-3 → 5.0.35-ezhou-4

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