apply-clients 6.0.4 → 6.0.7

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 (30) hide show
  1. package/build/dev-server.js +2 -2
  2. package/package.json +1 -1
  3. package/src/components/apply/base/rightview/InstallCardList2.vue +3 -2
  4. package/src/components/apply/base/rightview/carddetail/BuildFeeDetail2.vue +1 -1
  5. package/src/components/apply/base/rightview/carddetail/ChangeFeeDetail2.vue +1 -1
  6. package/src/components/apply/base/rightview/carddetail/ReduceFeeDetail2.vue +2 -2
  7. package/src/components/apply/base/rightview/carddetail/StopApplyDetail2.vue +70 -70
  8. package/src/components/build/Install/InstallFee/AddContract.vue +257 -257
  9. package/src/components/build/Install/InstallFee/InstallFee.vue +929 -929
  10. package/src/components/build/Install/InstallFee/PreparationFee.vue +223 -223
  11. package/src/components/build/Install/InstallFee/PrestoreFee.vue +630 -630
  12. package/src/components/build/Install/Process/CustomerBuildingMessage.vue +251 -251
  13. package/src/components/build/Install/Process/CustomerEquipmentMessage.vue +172 -172
  14. package/src/components/build/Install/Process/CustomerFile.vue +423 -423
  15. package/src/components/build/Install/Process/CustomerMaterialMessage.vue +414 -414
  16. package/src/components/build/Install/Process/CustomerRecordMessage.vue +749 -749
  17. package/src/components/build/Install/Process/FeeNormeAndContratSigne.vue +376 -376
  18. package/src/components/build/Install/Process/MeterType.vue +379 -379
  19. package/src/components/build/Install/Process/PlaceControler.vue +304 -304
  20. package/src/components/build/Install/Process/zhongran/ZR_Construction.vue +388 -388
  21. package/src/components/build/Install/Process/zhongran/ZR_CustomerEssentialInfo.vue +416 -415
  22. package/src/components/build/Install/Process/zhongran/ZR_MaterialPlan.vue +259 -259
  23. package/src/components/build/Install/Process/zhongran/ZR_MaterialPlanExamine.vue +243 -243
  24. package/src/components/build/Install/Process/zhongran/ZR_PlaceControler.vue +426 -426
  25. package/src/components/build/Install/Process/zhongran/ZR_TestDesign.vue +441 -441
  26. package/src/components/build/Install/ProcessInfo/ApplyRecordCancel.vue +135 -135
  27. package/src/components/build/Install/bill/BillGZKMakeInfo.vue +58 -58
  28. package/src/components/build/Install/bill/BillQRKMakeInfo.vue +79 -79
  29. package/src/components/build/Install/bill/BillXSDMakeInfo.vue +206 -206
  30. package/src/main.js +25 -25
@@ -1,388 +1,388 @@
1
- <template>
2
- <div class="auto" style="overflow: hidden">
3
- <div class="panel panel-info">
4
- <div class="panel-heading">
5
- <h3 class="panel-title">施工报建</h3>
6
- </div>
7
- </div>
8
- <validator name="v">
9
- <form class="form-horizontal">
10
- <div class="form-group col-sm-11">
11
- <div class="form-group col-sm-4" >
12
- <label for="f_designer" class=" col-sm-6 control-label">工程名称:</label>
13
- <div class="col-sm-6" id="f_project_name">
14
- <input class="form-control" type="text" v-model="model.f_project_name" disabled>
15
- </div>
16
- </div>
17
- <div class="form-group col-sm-4" >
18
- <label for="f_designer" class=" col-sm-6 control-label">用户类型:</label>
19
- <div class="col-sm-6" id="f_apply_type">
20
- <input class="form-control" type="text" v-model="model.f_apply_type" disabled>
21
- </div>
22
- </div>
23
- <div class="form-group col-sm-4" >
24
- <label for="f_designer" class=" col-sm-6 control-label">客户联系人:</label>
25
- <div class="col-sm-6" id="f_customer_contact">
26
- <input class="form-control" type="text" v-model="model.f_customer_contact" disabled>
27
- </div>
28
- </div>
29
- </div>
30
- <div class="form-group col-sm-11">
31
- <div class="form-group col-sm-4" >
32
- <label for="f_designer" class=" col-sm-6 control-label">联系电话:</label>
33
- <div class="col-sm-6" id="f_contact">
34
- <input class="form-control" type="text" v-model="model.f_contact" disabled>
35
- </div>
36
- </div>
37
- <div class="form-group col-sm-4">
38
- <label class=" col-sm-6 control-label">签订合同时间:</label>
39
- <div class="col-sm-6" id="f_contract_time">
40
- <input class="form-control" type="text" v-model="model.f_contract_time" disabled>
41
- </div>
42
- </div>
43
- <div class="form-group col-sm-4">
44
- <label class=" col-sm-6 control-label">合同总金额:</label>
45
- <div class="col-sm-6" id="f_contract_time">
46
- <input class="form-control" type="text" v-model="model.f_contract_money" disabled >
47
- </div>
48
- </div>
49
- </div>
50
- <div class="form-group col-sm-11">
51
- <div class="form-group col-sm-4">
52
- <label class=" col-sm-6 control-label">当前回款金额:</label>
53
- <div class="col-sm-6" id="f_now_backamount">
54
- <input class="form-control" type="number" v-model="model.f_now_backamount"
55
- :readonly="edit ? false : 'readonly'">
56
- </div>
57
- </div>
58
- <div class="form-group col-sm-4">
59
- <label class=" col-sm-6 control-label">回款比例:</label>
60
- <div class="col-sm-6" id="f_repayment_ratio">
61
- <input class="form-control" type="text" v-model="backamount" readonly>
62
- </div>
63
- </div>
64
- <div class="form-group col-sm-4">
65
- <label class=" col-sm-6 control-label">合同总户数:</label>
66
- <div class="col-sm-6" id="f_contract_total_households" :class="[$v.f_contract_total_households.required ? 'formItem-required' : '' ]">
67
- <input class="form-control col-sm-6" type="number" v-model="model.f_contract_total_households" :readonly="edit ? false : 'readonly'" v-validate:f_contract_total_households ='{required: true }'>
68
- </div>
69
- </div>
70
- </div>
71
- <div class="form-group col-sm-11">
72
- <div class="form-group col-sm-4">
73
- <label class=" col-sm-6 control-label">回款户数:</label>
74
- <div class="col-sm-6" id="f_backamount_household" :class="[$v.f_backamount_household.required ? 'formItem-required' : '' ]">
75
- <input class="form-control col-sm-6" type="number" v-model="model.f_backamount_household" :readonly="edit ? false : 'readonly'" v-validate:f_backamount_household ='{required: true }'>
76
- </div>
77
- </div>
78
- <div class="form-group col-sm-4">
79
- <label class=" col-sm-6 control-label">用户详细地址:</label>
80
- <div class="col-sm-6" id="f_usegasren_address">
81
- <input class="form-control" type="text" v-model="model.f_usegasren_address" disabled>
82
- </div>
83
- </div>
84
- </div>
85
- <div class="form-group col-sm-11">
86
- <div class="form-group col-sm-6">
87
- <label for="f_survey_departmen" class=" col-sm-4 control-label">经办部门:</label>
88
- <div class="col-sm-6" id="f_survey_departmen">
89
- <input class="form-control" type="text" v-model="model.f_apply_department" disabled>
90
- </div>
91
- </div>
92
- <div class="form-group col-sm-6">
93
- <label for="f_survey_operator" class="col-sm-6 control-label">经办人:</label>
94
- <div class="col-sm-6" id="f_survey_operator">
95
- <input class="form-control" type="text" v-model="model.f_apply_operator" disabled>
96
- </div>
97
- </div>
98
- </div>
99
- </form>
100
- </validator>
101
- <div class="from-group col-sm-11" v-show="edit">
102
- <center>
103
- <button type="button" @click="confirm()" class="btn btn-primary" style="width:80px; margin-left:40px;">
104
- 保存
105
- </button>
106
- <button type="button" @click="commit()" class="btn btn-primary" style="width:80px; margin-left:40px;" :disabled='!$v.valid'>
107
- 提交
108
- </button>
109
- <button type="button" @click="reset()" class="btn btn-warning" style="width:80px; margin-left:40px;">
110
- 取消
111
- </button>
112
- <button type="button" @click="back()" class="btn btn-warning" style="width:80px; margin-left:50px;">
113
- 退回
114
- </button>
115
-
116
- </center>
117
- </div>
118
- </div>
119
- </template>
120
- <script>
121
- import co from 'co'
122
- import {HttpResetClass} from 'vue-client'
123
- import * as Util from '../../../../Util'
124
- let gen = async function* (self, val) {
125
- let http = new HttpResetClass()
126
- val.f_survey_name = self.employeetemplate // 勘察人员保存
127
- let data ={
128
- tablename:'t_apply',
129
- parameters:val
130
- }
131
- console.log('val::',val)
132
- http.load('POST','rs/logic/save', {data:data}).then((res)=>{
133
- let http2 = new HttpResetClass()
134
- data = {
135
- model: {
136
- f_processid: self.selectdata.f_process_id,
137
- },
138
- loginUser: {
139
- id: self.$login.f.id,
140
- name: self.$login.f.name,
141
- ename: self.$login.f.ename
142
- },
143
- employeetemplate: self.employeetemplate,// 指派勘察人员
144
- subdep: '提交'
145
- }
146
- http2.load('POST',`rs/logic/grantnext`,
147
- {data: data})
148
- .then(() => {
149
- self.reset()
150
- })
151
- })
152
-
153
- }
154
- export default {
155
- title: '施工报建',
156
- data() {
157
- return {
158
- fgastype: this.$appdata.getParam('用气类型'),
159
- fsurveyname : this.$appdata.getParam('勘查人员'),
160
- employees: [], // 部门人员数组
161
- employeetemplate: '', // 选定部门人员
162
- model: {
163
- f_now_backamount:0,
164
- f_filiale: this.$login.f.f_filiale,
165
- f_survey_date: Util.toStandardTimeString(),
166
- f_survey_department: this.$login.f.f_parentname,
167
- f_survey_operator: this.$login.f.name,
168
-
169
- }
170
- }
171
- },
172
- props: ['selectdata','edit'],
173
- ready() {
174
-
175
- this.selectdata.f_gas_type = this.selectdata.f_gas_type ? [this.selectdata.f_gas_type] : this.model.f_gas_type
176
- this.selectdata.f_survey_name = this.selectdata.f_survey_name ? [this.selectdata.f_survey_name] : this.model.f_survey_name
177
- this.model = Object.assign({}, this.model, this.selectdata)
178
- },
179
- watch:{
180
- 'model.f_repayment_ratio'(){
181
- if(isNaN(this.model.f_repayment_ratio)){
182
- this.$showMessage("请检查合同总金额和当前回款是否为数字!")
183
- }
184
- }
185
- },
186
- methods: {
187
- // 保存,并跳转流程
188
- saveorsetvar(self,val){
189
- let http = new HttpResetClass()
190
- val.f_survey_name = self.employeetemplate // 勘察人员保存
191
- let data ={
192
- tablename:'t_apply',
193
- parameters:val
194
- }
195
- console.log('val::',val)
196
- http.load('POST','rs/logic/save', {data:data}).then((res)=>{
197
- let http2 = new HttpResetClass()
198
- data = {
199
- model: {
200
- f_processid: self.selectdata.f_process_id,
201
- },
202
- loginUser: {
203
- id: self.$login.f.id,
204
- name: self.$login.f.name,
205
- ename: self.$login.f.ename
206
- },
207
- employeetemplate: self.employeetemplate,// 指派勘察人员
208
- subdep: '提交'
209
- }
210
- http2.load('POST',`rs/logic/grantnext`,
211
- {data: data})
212
- .then(() => {
213
- self.reset()
214
- })
215
- })
216
- },
217
- // 退回则默认值为已存储的人
218
- toemployees() {
219
- if (this.temploader == '技术组长' && this.model.f_survey_name) {
220
- this.employeetemplate = this.model.f_survey_name
221
- }
222
- },
223
- // 获取部门领导角色
224
- async loademployees() {
225
- let http = new HttpResetClass()
226
- if (this.selectdata.actdefid != '1') {
227
- await http.load('POST','rs/sql/applysingleTable', {
228
- data: {
229
- tablename: 't_actorperson',
230
- condition: " userseq='" + this.$login.f.id + "' order by id desc"
231
- }
232
- }, {resolveMsg: null, rejectMsg: "角色人员是(登陆人)信息查询失败"}, {silent: true})
233
- .then((res) => {
234
- console.log("取得部门领导的角色" + res.data[0].actorid)
235
- if (res.data[0].actorid.startsWith("R") && (res.data[0].actorid.includes("部门负责人") || res.data[0].actorid.includes("部经理")|| res.data[0].actorid.includes("部门领导") || res.data[0].actorid.includes("部负责人") || res.data[0].actorid.includes("部领导")||res.data[0].actorid.includes("组长"))) {
236
- let loaderstr = res.data[0].actorid.substring(2, res.data[0].actorid.length - 1)
237
- this.temploader = loaderstr
238
- // 如果是退回的就用已经保存的人员,保证下发的是同一个人
239
- this.toemployees()
240
- let loademployeestr = null
241
- if (loaderstr.includes("部门")) {
242
- loademployeestr = 'R(' + loaderstr.split("部门")[0] + '部门人员)'
243
- } else if (loaderstr.includes("部")) {
244
- loademployeestr = 'R(' + loaderstr.split("部")[0] + '部人员)'
245
- } else if (loaderstr.includes("组长")) {
246
- loademployeestr = 'R(' + loaderstr.split("组长")[0] + '人员)'
247
- }
248
- console.log(loademployeestr)
249
- let http2 = new HttpResetClass()
250
- http2.load('POST','rs/sql/applysingleTable', {
251
- data: {
252
- tablename: 't_role',
253
- condition: " name='" + loademployeestr.substring(2, loademployeestr.length - 1) + "'"
254
- // condition: " name='" + loaderstr.split("部")[0] + '部人员' + "'"
255
- }
256
- }, {resolveMsg: null, rejectMsg: "角色人员(部门人员)id信息查询失败"}, {silent: true}).then((res) => {
257
- console.log("取得角色人员(部门人员)id" + JSON.stringify(res.data[0].id))
258
- let strid = res.data[0].id
259
- let http3 = new HttpResetClass()
260
- http3.load('POST','rs/sql/applysingleTable', {
261
- data: {
262
- tablename: 't_user',
263
- condition: "roles like '%" + strid + "%'"
264
- }
265
- }, {resolveMsg: null, rejectMsg: "角色人员(部门人员)信息查询失败"}, {silent: true}).then((res) => {
266
- console.log("角色人员(部门人员)信息成功")
267
- for (var i = 0; i < res.data.length; i++) {
268
- this.employees.push({lable: res.data[i].name, value: res.data[i].name})
269
- }
270
- })
271
- })
272
- }
273
- })
274
- }
275
- },
276
- //保存表单信息
277
- confirm() {
278
- let data ={
279
- tablename:'t_apply',
280
- parameters:this.model
281
- }
282
- if (this.verification()){
283
- this.$resetpost('rs/logic/save', {data:data})
284
- .then(() => {
285
- this.reset()
286
- })
287
- }
288
- },
289
- //保存表单信息并下发到下个节点
290
- commit() {
291
- if(this.verification()){
292
-
293
- if(Number(this.model.f_backamount_household) > Number(this.model.f_contract_total_households)){
294
- this.$showMessage("回款户数不能大于儿合同总户数!")
295
- this.model.f_backamount_household = null
296
- }else{
297
- this.saveorsetvar(this, this.model)
298
- // let getGen = gen(this, this.model)
299
- // co(getGen)
300
- }
301
- }
302
- },
303
- //数据校验
304
- verification() {
305
- var isNum = /^(([+]?\d*$)|(^[+]?\d+(\.\d+)?$))/ //非负纯数字
306
- if(!this.model.f_now_backamount) {
307
- this.$showMessage("当前回款金额不能为空!")
308
- return false
309
- }else if(!isNum.test(this.model.f_now_backamount)){
310
- this.$showMessage("当前回款金额格式错误!")
311
- return false
312
- }
313
- if(!this.model.f_contract_total_households) {
314
- this.$showMessage("合同总户数不能为空!")
315
- return false
316
- }else if(!isNum.test(this.model.f_contract_total_households)){
317
- this.$showMessage("合同总户数格式错误!")
318
- return false
319
- }else if(!this.model.f_backamount_household) {
320
- this.$showMessage("回款户数不能为空!")
321
- return false
322
- }else if(!isNum.test(this.model.f_backamount_household)){
323
- this.$showMessage("回款户数格式错误!")
324
- return false
325
- }
326
- return true
327
- },
328
- //取消
329
- reset() {
330
- this.$dispatch('close')
331
- this.$dispatch('selfsearch')
332
- },
333
- //退回上一个流程
334
- back() {
335
- // this.model.f_sub_state = '退回'
336
- this.confirm()
337
- let data = {
338
- model: {
339
- f_processid: this.selectdata.f_process_id,
340
- },
341
- loginUser: {
342
- id: this.$login.f.id,
343
- name: this.$login.f.name,
344
- ename: this.$login.f.ename
345
- },
346
- subdep: '退回'
347
- }
348
- let http = new HttpResetClass()
349
- http.load('POST',`rs/logic/ignitionnext`,
350
- {data: data})
351
- .then(() => {
352
- this.reset()
353
- })
354
- },
355
- setselect() {
356
- this.selectdata.f_gas_type = this.selectdata.f_gas_type ? this.selectdata.f_gas_type : this.model.f_gas_type
357
- this.selectdata.f_survey_name = this.selectdata.f_survey_name ? this.selectdata.f_survey_name : this.model.f_survey_name
358
- this.model = Object.assign({}, this.model, this.selectdata)
359
- this.model.f_survey_date = this.$login.toStandardDateString()
360
- this.model.f_survey_department = this.$login.f.f_parentname
361
- this.model.f_survey_operator = this.$login.f.name
362
- }
363
- },
364
- computed: {
365
- backamount(){
366
-
367
- //回款比例 保留两位小数
368
- if(this.model.f_now_backamount.trim() == '' || this.model.f_contract_money.trim == ''
369
- || this.model.f_now_backamount == null || this.model.f_contract_money == null){
370
- this.model.f_repayment_ratio = '0'
371
- }else{
372
- this.model.f_repayment_ratio = (Number(this.model.f_now_backamount)/Number(this.model.f_contract_money)).toFixed(2)
373
- }
374
- return this.model.f_repayment_ratio
375
- }
376
- }
377
- }
378
- </script>
379
- <style>
380
- .formItem-required::after {
381
- content: '*';
382
- position: absolute;
383
- font-size: 20px;
384
- margin-top: 3.5%;
385
- margin-left: 3%;
386
- color: #d91118;
387
- }
388
- </style>
1
+ <template>
2
+ <div class="auto" style="overflow: hidden">
3
+ <div class="panel panel-info">
4
+ <div class="panel-heading">
5
+ <h3 class="panel-title">施工报建</h3>
6
+ </div>
7
+ </div>
8
+ <validator name="v">
9
+ <form class="form-horizontal">
10
+ <div class="form-group col-sm-11">
11
+ <div class="form-group col-sm-4" >
12
+ <label for="f_designer" class=" col-sm-6 control-label">工程名称:</label>
13
+ <div class="col-sm-6" id="f_project_name">
14
+ <input class="form-control" type="text" v-model="model.f_project_name" disabled>
15
+ </div>
16
+ </div>
17
+ <div class="form-group col-sm-4" >
18
+ <label for="f_designer" class=" col-sm-6 control-label">用户类型:</label>
19
+ <div class="col-sm-6" id="f_apply_type">
20
+ <input class="form-control" type="text" v-model="model.f_apply_type" disabled>
21
+ </div>
22
+ </div>
23
+ <div class="form-group col-sm-4" >
24
+ <label for="f_designer" class=" col-sm-6 control-label">客户联系人:</label>
25
+ <div class="col-sm-6" id="f_customer_contact">
26
+ <input class="form-control" type="text" v-model="model.f_customer_contact" disabled>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ <div class="form-group col-sm-11">
31
+ <div class="form-group col-sm-4" >
32
+ <label for="f_designer" class=" col-sm-6 control-label">联系电话:</label>
33
+ <div class="col-sm-6" id="f_contact">
34
+ <input class="form-control" type="text" v-model="model.f_contact" disabled>
35
+ </div>
36
+ </div>
37
+ <div class="form-group col-sm-4">
38
+ <label class=" col-sm-6 control-label">签订合同时间:</label>
39
+ <div class="col-sm-6" id="f_contract_time">
40
+ <input class="form-control" type="text" v-model="model.f_contract_time" disabled>
41
+ </div>
42
+ </div>
43
+ <div class="form-group col-sm-4">
44
+ <label class=" col-sm-6 control-label">合同总金额:</label>
45
+ <div class="col-sm-6" id="f_contract_time">
46
+ <input class="form-control" type="text" v-model="model.f_contract_money" disabled >
47
+ </div>
48
+ </div>
49
+ </div>
50
+ <div class="form-group col-sm-11">
51
+ <div class="form-group col-sm-4">
52
+ <label class=" col-sm-6 control-label">当前回款金额:</label>
53
+ <div class="col-sm-6" id="f_now_backamount">
54
+ <input class="form-control" type="number" v-model="model.f_now_backamount"
55
+ :readonly="edit ? false : 'readonly'">
56
+ </div>
57
+ </div>
58
+ <div class="form-group col-sm-4">
59
+ <label class=" col-sm-6 control-label">回款比例:</label>
60
+ <div class="col-sm-6" id="f_repayment_ratio">
61
+ <input class="form-control" type="text" v-model="backamount" readonly>
62
+ </div>
63
+ </div>
64
+ <div class="form-group col-sm-4">
65
+ <label class=" col-sm-6 control-label">合同总户数:</label>
66
+ <div class="col-sm-6" id="f_contract_total_households" :class="[$v.f_contract_total_households.required ? 'formItem-required' : '' ]">
67
+ <input class="form-control col-sm-6" type="number" v-model="model.f_contract_total_households" :readonly="edit ? false : 'readonly'" v-validate:f_contract_total_households ='{required: true }'>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ <div class="form-group col-sm-11">
72
+ <div class="form-group col-sm-4">
73
+ <label class=" col-sm-6 control-label">回款户数:</label>
74
+ <div class="col-sm-6" id="f_backamount_household" :class="[$v.f_backamount_household.required ? 'formItem-required' : '' ]">
75
+ <input class="form-control col-sm-6" type="number" v-model="model.f_backamount_household" :readonly="edit ? false : 'readonly'" v-validate:f_backamount_household ='{required: true }'>
76
+ </div>
77
+ </div>
78
+ <div class="form-group col-sm-4">
79
+ <label class=" col-sm-6 control-label">用户详细地址:</label>
80
+ <div class="col-sm-6" id="f_usegasren_address">
81
+ <input class="form-control" type="text" v-model="model.f_usegasren_address" disabled>
82
+ </div>
83
+ </div>
84
+ </div>
85
+ <div class="form-group col-sm-11">
86
+ <div class="form-group col-sm-6">
87
+ <label for="f_survey_departmen" class=" col-sm-4 control-label">经办部门:</label>
88
+ <div class="col-sm-6" id="f_survey_departmen">
89
+ <input class="form-control" type="text" v-model="model.f_apply_department" disabled>
90
+ </div>
91
+ </div>
92
+ <div class="form-group col-sm-6">
93
+ <label for="f_survey_operator" class="col-sm-6 control-label">经办人:</label>
94
+ <div class="col-sm-6" id="f_survey_operator">
95
+ <input class="form-control" type="text" v-model="model.f_apply_operator" disabled>
96
+ </div>
97
+ </div>
98
+ </div>
99
+ </form>
100
+ </validator>
101
+ <div class="from-group col-sm-11" v-show="edit">
102
+ <center>
103
+ <button type="button" @click="confirm()" class="btn btn-primary" style="width:80px; margin-left:40px;">
104
+ 保存
105
+ </button>
106
+ <button type="button" @click="commit()" class="btn btn-primary" style="width:80px; margin-left:40px;" :disabled='!$v.valid'>
107
+ 提交
108
+ </button>
109
+ <button type="button" @click="reset()" class="btn btn-warning" style="width:80px; margin-left:40px;">
110
+ 取消
111
+ </button>
112
+ <button type="button" @click="back()" class="btn btn-warning" style="width:80px; margin-left:50px;">
113
+ 退回
114
+ </button>
115
+
116
+ </center>
117
+ </div>
118
+ </div>
119
+ </template>
120
+ <script>
121
+ import co from 'co'
122
+ import {HttpResetClass} from 'vue-client'
123
+ import * as Util from '../../../../Util'
124
+ let gen = async function* (self, val) {
125
+ let http = new HttpResetClass()
126
+ val.f_survey_name = self.employeetemplate // 勘察人员保存
127
+ let data ={
128
+ tablename:'t_apply',
129
+ parameters:val
130
+ }
131
+ console.log('val::',val)
132
+ http.load('POST','rs/logic/save', {data:data}).then((res)=>{
133
+ let http2 = new HttpResetClass()
134
+ data = {
135
+ model: {
136
+ f_processid: self.selectdata.f_process_id,
137
+ },
138
+ loginUser: {
139
+ id: self.$login.f.id,
140
+ name: self.$login.f.name,
141
+ ename: self.$login.f.ename
142
+ },
143
+ employeetemplate: self.employeetemplate,// 指派勘察人员
144
+ subdep: '提交'
145
+ }
146
+ http2.load('POST',`rs/logic/grantnext`,
147
+ {data: data})
148
+ .then(() => {
149
+ self.reset()
150
+ })
151
+ })
152
+
153
+ }
154
+ export default {
155
+ title: '施工报建',
156
+ data() {
157
+ return {
158
+ fgastype: this.$appdata.getParam('用气类型'),
159
+ fsurveyname : this.$appdata.getParam('勘查人员'),
160
+ employees: [], // 部门人员数组
161
+ employeetemplate: '', // 选定部门人员
162
+ model: {
163
+ f_now_backamount:0,
164
+ f_filiale: this.$login.f.f_filiale,
165
+ f_survey_date: Util.toStandardTimeString(),
166
+ f_survey_department: this.$login.f.f_parentname,
167
+ f_survey_operator: this.$login.f.name,
168
+
169
+ }
170
+ }
171
+ },
172
+ props: ['selectdata','edit'],
173
+ ready() {
174
+
175
+ this.selectdata.f_gas_type = this.selectdata.f_gas_type ? [this.selectdata.f_gas_type] : this.model.f_gas_type
176
+ this.selectdata.f_survey_name = this.selectdata.f_survey_name ? [this.selectdata.f_survey_name] : this.model.f_survey_name
177
+ this.model = Object.assign({}, this.model, this.selectdata)
178
+ },
179
+ watch:{
180
+ 'model.f_repayment_ratio'(){
181
+ if(isNaN(this.model.f_repayment_ratio)){
182
+ this.$showMessage("请检查合同总金额和当前回款是否为数字!")
183
+ }
184
+ }
185
+ },
186
+ methods: {
187
+ // 保存,并跳转流程
188
+ saveorsetvar(self,val){
189
+ let http = new HttpResetClass()
190
+ val.f_survey_name = self.employeetemplate // 勘察人员保存
191
+ let data ={
192
+ tablename:'t_apply',
193
+ parameters:val
194
+ }
195
+ console.log('val::',val)
196
+ http.load('POST','rs/logic/save', {data:data}).then((res)=>{
197
+ let http2 = new HttpResetClass()
198
+ data = {
199
+ model: {
200
+ f_processid: self.selectdata.f_process_id,
201
+ },
202
+ loginUser: {
203
+ id: self.$login.f.id,
204
+ name: self.$login.f.name,
205
+ ename: self.$login.f.ename
206
+ },
207
+ employeetemplate: self.employeetemplate,// 指派勘察人员
208
+ subdep: '提交'
209
+ }
210
+ http2.load('POST',`rs/logic/grantnext`,
211
+ {data: data})
212
+ .then(() => {
213
+ self.reset()
214
+ })
215
+ })
216
+ },
217
+ // 退回则默认值为已存储的人
218
+ toemployees() {
219
+ if (this.temploader == '技术组长' && this.model.f_survey_name) {
220
+ this.employeetemplate = this.model.f_survey_name
221
+ }
222
+ },
223
+ // 获取部门领导角色
224
+ async loademployees() {
225
+ let http = new HttpResetClass()
226
+ if (this.selectdata.actdefid != '1') {
227
+ await http.load('POST','rs/sql/singleTable', {
228
+ data: {
229
+ tablename: 't_actorperson',
230
+ condition: " userseq='" + this.$login.f.id + "' order by id desc"
231
+ }
232
+ }, {resolveMsg: null, rejectMsg: "角色人员是(登陆人)信息查询失败"}, {silent: true})
233
+ .then((res) => {
234
+ console.log("取得部门领导的角色" + res.data[0].actorid)
235
+ if (res.data[0].actorid.startsWith("R") && (res.data[0].actorid.includes("部门负责人") || res.data[0].actorid.includes("部经理")|| res.data[0].actorid.includes("部门领导") || res.data[0].actorid.includes("部负责人") || res.data[0].actorid.includes("部领导")||res.data[0].actorid.includes("组长"))) {
236
+ let loaderstr = res.data[0].actorid.substring(2, res.data[0].actorid.length - 1)
237
+ this.temploader = loaderstr
238
+ // 如果是退回的就用已经保存的人员,保证下发的是同一个人
239
+ this.toemployees()
240
+ let loademployeestr = null
241
+ if (loaderstr.includes("部门")) {
242
+ loademployeestr = 'R(' + loaderstr.split("部门")[0] + '部门人员)'
243
+ } else if (loaderstr.includes("部")) {
244
+ loademployeestr = 'R(' + loaderstr.split("部")[0] + '部人员)'
245
+ } else if (loaderstr.includes("组长")) {
246
+ loademployeestr = 'R(' + loaderstr.split("组长")[0] + '人员)'
247
+ }
248
+ console.log(loademployeestr)
249
+ let http2 = new HttpResetClass()
250
+ http2.load('POST','rs/sql/singleTable', {
251
+ data: {
252
+ tablename: 't_role',
253
+ condition: " name='" + loademployeestr.substring(2, loademployeestr.length - 1) + "'"
254
+ // condition: " name='" + loaderstr.split("部")[0] + '部人员' + "'"
255
+ }
256
+ }, {resolveMsg: null, rejectMsg: "角色人员(部门人员)id信息查询失败"}, {silent: true}).then((res) => {
257
+ console.log("取得角色人员(部门人员)id" + JSON.stringify(res.data[0].id))
258
+ let strid = res.data[0].id
259
+ let http3 = new HttpResetClass()
260
+ http3.load('POST','rs/sql/singleTable', {
261
+ data: {
262
+ tablename: 't_user',
263
+ condition: "roles like '%" + strid + "%'"
264
+ }
265
+ }, {resolveMsg: null, rejectMsg: "角色人员(部门人员)信息查询失败"}, {silent: true}).then((res) => {
266
+ console.log("角色人员(部门人员)信息成功")
267
+ for (var i = 0; i < res.data.length; i++) {
268
+ this.employees.push({lable: res.data[i].name, value: res.data[i].name})
269
+ }
270
+ })
271
+ })
272
+ }
273
+ })
274
+ }
275
+ },
276
+ //保存表单信息
277
+ confirm() {
278
+ let data ={
279
+ tablename:'t_apply',
280
+ parameters:this.model
281
+ }
282
+ if (this.verification()){
283
+ this.$resetpost('rs/logic/save', {data:data})
284
+ .then(() => {
285
+ this.reset()
286
+ })
287
+ }
288
+ },
289
+ //保存表单信息并下发到下个节点
290
+ commit() {
291
+ if(this.verification()){
292
+
293
+ if(Number(this.model.f_backamount_household) > Number(this.model.f_contract_total_households)){
294
+ this.$showMessage("回款户数不能大于儿合同总户数!")
295
+ this.model.f_backamount_household = null
296
+ }else{
297
+ this.saveorsetvar(this, this.model)
298
+ // let getGen = gen(this, this.model)
299
+ // co(getGen)
300
+ }
301
+ }
302
+ },
303
+ //数据校验
304
+ verification() {
305
+ var isNum = /^(([+]?\d*$)|(^[+]?\d+(\.\d+)?$))/ //非负纯数字
306
+ if(!this.model.f_now_backamount) {
307
+ this.$showMessage("当前回款金额不能为空!")
308
+ return false
309
+ }else if(!isNum.test(this.model.f_now_backamount)){
310
+ this.$showMessage("当前回款金额格式错误!")
311
+ return false
312
+ }
313
+ if(!this.model.f_contract_total_households) {
314
+ this.$showMessage("合同总户数不能为空!")
315
+ return false
316
+ }else if(!isNum.test(this.model.f_contract_total_households)){
317
+ this.$showMessage("合同总户数格式错误!")
318
+ return false
319
+ }else if(!this.model.f_backamount_household) {
320
+ this.$showMessage("回款户数不能为空!")
321
+ return false
322
+ }else if(!isNum.test(this.model.f_backamount_household)){
323
+ this.$showMessage("回款户数格式错误!")
324
+ return false
325
+ }
326
+ return true
327
+ },
328
+ //取消
329
+ reset() {
330
+ this.$dispatch('close')
331
+ this.$dispatch('selfsearch')
332
+ },
333
+ //退回上一个流程
334
+ back() {
335
+ // this.model.f_sub_state = '退回'
336
+ this.confirm()
337
+ let data = {
338
+ model: {
339
+ f_processid: this.selectdata.f_process_id,
340
+ },
341
+ loginUser: {
342
+ id: this.$login.f.id,
343
+ name: this.$login.f.name,
344
+ ename: this.$login.f.ename
345
+ },
346
+ subdep: '退回'
347
+ }
348
+ let http = new HttpResetClass()
349
+ http.load('POST',`rs/logic/ignitionnext`,
350
+ {data: data})
351
+ .then(() => {
352
+ this.reset()
353
+ })
354
+ },
355
+ setselect() {
356
+ this.selectdata.f_gas_type = this.selectdata.f_gas_type ? this.selectdata.f_gas_type : this.model.f_gas_type
357
+ this.selectdata.f_survey_name = this.selectdata.f_survey_name ? this.selectdata.f_survey_name : this.model.f_survey_name
358
+ this.model = Object.assign({}, this.model, this.selectdata)
359
+ this.model.f_survey_date = this.$login.toStandardDateString()
360
+ this.model.f_survey_department = this.$login.f.f_parentname
361
+ this.model.f_survey_operator = this.$login.f.name
362
+ }
363
+ },
364
+ computed: {
365
+ backamount(){
366
+
367
+ //回款比例 保留两位小数
368
+ if(this.model.f_now_backamount.trim() == '' || this.model.f_contract_money.trim == ''
369
+ || this.model.f_now_backamount == null || this.model.f_contract_money == null){
370
+ this.model.f_repayment_ratio = '0'
371
+ }else{
372
+ this.model.f_repayment_ratio = (Number(this.model.f_now_backamount)/Number(this.model.f_contract_money)).toFixed(2)
373
+ }
374
+ return this.model.f_repayment_ratio
375
+ }
376
+ }
377
+ }
378
+ </script>
379
+ <style>
380
+ .formItem-required::after {
381
+ content: '*';
382
+ position: absolute;
383
+ font-size: 20px;
384
+ margin-top: 3.5%;
385
+ margin-left: 3%;
386
+ color: #d91118;
387
+ }
388
+ </style>