apply-clients 3.0.4 → 3.0.5-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 (64) hide show
  1. package/index.html +1 -1
  2. package/package.json +4 -3
  3. package/src/App.vue +126 -15
  4. package/src/apply.js +152 -134
  5. package/src/bootstrap/fonts/PingFangSC-Regular.ttf +0 -0
  6. package/src/bootstrap/less/bootstrap.less +1 -2
  7. package/src/bootstrap/less/standard.less +208 -0
  8. package/src/components/Util.js +4 -0
  9. package/src/components/app_apply/FieldExploration.vue +2 -2
  10. package/src/components/app_apply/Ventilation.vue +2 -2
  11. package/src/components/image/doc.jpg +0 -0
  12. package/src/components/image/excel.jpg +0 -0
  13. package/src/components/image/pdf.jpg +0 -0
  14. package/src/components/image//345/233/276/345/261/20212.png +0 -0
  15. package/src/components/image//345/233/276/345/261/20213.png +0 -0
  16. package/src/components/image//345/233/276/345/261/20216.png +0 -0
  17. package/src/components/image//345/244/232/350/276/271/345/275/2422.png +0 -0
  18. package/src/components/image//345/244/232/350/276/271/345/275/2422/346/213/267/350/264/235.png +0 -0
  19. package/src/components/image//346/244/255/345/234/2062.png +0 -0
  20. package/src/components/image//346/244/255/345/234/2065.png +0 -0
  21. package/src/components/image//346/244/255/345/234/2065/346/213/267/350/264/235.png +0 -0
  22. package/src/components/image//346/244/255/345/234/2065/346/213/267/350/264/2352.png +0 -0
  23. package/src/components/image//346/244/255/345/234/2065/346/213/267/350/264/2353.png +0 -0
  24. package/src/components/image//347/273/2044.png +0 -0
  25. package/src/components/image//347/273/2045.png +0 -0
  26. package/src/components/image//347/273/2046.png +0 -0
  27. package/src/components/image//350/257/235/345/212/241/347/273/237/350/256/241/346/225/260/346/215/256/345/261/225/347/244/272.png +0 -0
  28. package/src/components/product/Function/InstallFunction.vue +9 -5
  29. package/src/components/product/Function/InstallInfoSelect.vue +98 -69
  30. package/src/components/product/Function/Service/FunctionServiceControl.vue +47 -4
  31. package/src/components/product/Function/functions/AddContract.vue +161 -139
  32. package/src/components/product/Function/functions/BuyerMessage.vue +285 -137
  33. package/src/components/product/Function/functions/InstallFee.vue +1117 -912
  34. package/src/components/product/MaterialBatchList.vue +109 -0
  35. package/src/components/product/MaterialBatchManage.vue +34 -0
  36. package/src/components/product/Procedures/ProceduresDataGrid.vue +1022 -0
  37. package/src/components/product/Process/ExplorationSelect.vue +213 -73
  38. package/src/components/product/Process/ExplorationUser.vue +94 -39
  39. package/src/components/product/Process/MaterialUseList.vue +159 -0
  40. package/src/components/product/Process/ModifyUserFiles.vue +15 -5
  41. package/src/components/product/Process/ProcessInfo/history_control.vue +35 -6
  42. package/src/components/product/Process/Processes/ApplyUpload.vue +287 -0
  43. package/src/components/product/Process/Processes/CustomerCostPlan.vue +214 -0
  44. package/src/components/product/Process/Processes/CustomerMaterialMessage.vue +499 -210
  45. package/src/components/product/Process/Processes/CustomerRecordMessage.vue +949 -753
  46. package/src/components/product/Process/Processes/ProjectSettlement.vue +535 -24
  47. package/src/components/product/Process/Processes/ReceiveBatch.vue +301 -121
  48. package/src/components/product/Process/Processes/Service/ApplyChangeHistory.vue +105 -0
  49. package/src/components/product/Process/Processes/Service/ApplyChargeSearch.vue +27 -14
  50. package/src/components/product/Process/Processes/Service/ServiceControl.vue +2561 -1104
  51. package/src/components/product/Process/Processes/Upload.vue +532 -0
  52. package/src/components/product/Process/ShowBackReason.vue +1 -1
  53. package/src/components/product/ServiceView.vue +825 -583
  54. package/src/components/product/Statistics/ApplyStatisticsROOT.vue +27 -0
  55. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +212 -23
  56. package/src/components/product/Supervisory/SupervisoryControl.vue +79 -26
  57. package/src/components/product/Supervisory/SupervisoryList.vue +182 -41
  58. package/src/components/product/Supervisory/SupervisoryhCart.vue +4 -2
  59. package/src/components/product/VueUtils/Tree.vue +330 -0
  60. package/src/components/product/VueUtils/rightview/InstallCardList2.vue +29 -38
  61. package/src/stores/ApplyLoadParams.js +1 -1
  62. package/src/stores/PagedListLogic.js +173 -0
  63. package/.npmignore +0 -12
  64. package/yarn.lock +0 -9008
@@ -1,17 +1,17 @@
1
1
  <template>
2
- <div class="auto" style="padding-right:5px;" v-if="templateshow">
2
+ <div class="auto col-sm-12" style="padding-right:5px;" v-if="templateshow">
3
3
  <div class="panel panel-info">
4
- <div class="panel-heading">
5
- <h3 class="panel-title text-center"><span style="cursor: pointer;" class="pull-left">购买方信息</span></h3>
6
- </div>
7
- <div class="col-sm-12" v-for="(i,datagrid) in data.onetomany">
8
- <table v-show="!datagrid.hidden" class="table table-bordered table-striped table-hover">
9
- <tr style="background-color: #00A3F0" >
10
- <th style="border-color: #00A3F0"><font color="white" >序号</font></th>
4
+ <div class="panel-heading" v-if="title_show">
5
+ <h3 class="panel-title text-center"><span style="cursor: pointer;" class="pull-left">{{title}}</span></h3>
6
+ </div>
7
+ <div class="col-sm-12" v-for="(i,datagrid) in data.onetomany">
8
+ <table v-show="!datagrid.hidden" class="table table-bordered table-striped table-hover">
9
+ <tr style="background-color: #00A3F0">
10
+ <th style="border-color: #00A3F0"><font color="white">序号</font></th>
11
11
  <th v-for="labels in datagrid.fields" style="text-align: center;border-color: #00A3F0">
12
12
  <nobr><font color="white">{{labels.label}}</font></nobr>
13
13
  </th>
14
- <th style="text-align: center;border-color: #00A3F0;padding: 0px">
14
+ <th style="text-align: center;border-color: #00A3F0;padding: 0px" v-if="showprint">
15
15
  <button type="button" @click="$dispatch('add',i)" class="btn btn-warning">
16
16
  +
17
17
  </button>
@@ -19,74 +19,123 @@
19
19
  </tr>
20
20
  <tr v-for="(j,row) in model.rows[i]">
21
21
  <td style="text-align: center">{{$index+1}}</td>
22
- <td v-for="key in surBodyData[i]" style="text-align: center">
22
+ <td v-for="key in surBodyData[i]" style="text-align: center">
23
23
  {{row[key]}}
24
24
  </td>
25
25
  <td style="text-align: center">
26
- <a href="#" @click="revise(i,j)">修改</a>
27
- |<a href="#" @click="deleted(i,j)">删除</a>
26
+ <a href="#" @click="revise(i,j)" v-if="showprint">修改</a>
27
+ |<a href="#" @click="deleted(i,j)" v-if="showprint">删除</a>
28
28
  </td>
29
29
  </tr>
30
30
  </table>
31
31
  </div>
32
32
  <!-- onetomany新增模态框 -->
33
-
34
- <modal :show.sync="showadd" v-ref:modal backdrop="false">
35
- <header slot="modal-header" class="modal-header">
36
- <button type="button" class="close" @click="closemodal(modeltitle)"><span>&times;</span></button>
37
- <h4 class="modal-title">{{modeltitle}}</h4>
38
- </header>
39
- <article slot="modal-body" class="modal-body">
40
- <div class="col-sm-12" v-for="(index,showadd_field) in showadd_fields.fields">
41
- <label class="control-label col-sm-3" style="margin-top: 10px" v-if="!showadd_field.hidden">{{showadd_field.label}}:</label>
42
- <div class="col-sm-7">
43
- <!--时间datepicker-->
44
- <div v-if="showadd_field.type=='datepicker'"
45
- :class="[showadd_fields[index].required&&!(showadd_fields.fields[index].value) ? 'has-error' : '']">
46
- <div >
47
- <datepicker
48
- :placeholder="showadd_field.placeholder"
49
- :value.sync="showadd_fields.fields[index].value"
50
- :format="'yyyy-MM-dd HH:mm:ss'"
51
- v-model="showadd_fields.fields[index].value"
52
- :readonly=true
53
- :disabled="showadd_fields.fields[index].disabled"
54
- @blur="check_disable"
55
- :show-reset-button="reset">
56
- </datepicker>
33
+ <div class="auto"
34
+ style="margin-left: 20vw;max-width: 700px;max-hight:500px;z-index:8888;box-shadow: 0px 0px 100px 10px grey;position: fixed;"
35
+ v-if="showadd">
36
+ <div class="auto" style="background-color:white;">
37
+ <div style="padding-top: 15px;padding-left: 15px;padding-right: 15px;border-bottom: 0px solid #e5e5e5;">
38
+ <span><font size="3">{{modeltitle}}</font></span>
39
+ <button type="button;float:right" class="close" @click="closemodal(modeltitle)"><span>&times;</span>
40
+ </button>
41
+ </div>
42
+            
43
+ <div style="padding-top: 15px;border-top: 1px solid #e5e5e5;border-bottom: 1px solid #e5e5e5;">
44
+ <div class="col-sm-12" v-for="(index,showadd_field) in showadd_fields.fields" v-if="refresh_modal">
45
+ <label
46
+ :class="showadd_field.required&&!showadd_fields.fields[index].value?'has-error control-label col-sm-3' : 'control-label col-sm-3'"
47
+ style="margin-top: 10px" v-if="!showadd_field.hidden">{{showadd_field.label}}:</label>
48
+ <div class="col-sm-7">
49
+ <!--时间datepicker-->
50
+ <div v-if="showadd_field.type=='datepicker'"
51
+ :class="[showadd_fields[index].required&&!(showadd_fields.fields[index].value) ? 'has-error' : '']">
52
+ <div>
53
+ <datepicker
54
+ :width="'100%'"
55
+ :placeholder="showadd_field.placeholder"
56
+ :value.sync="showadd_fields.fields[index].value"
57
+ :format="'yyyy-MM-dd HH:mm:ss'"
58
+ v-model="showadd_fields.fields[index].value"
59
+ :readonly=true
60
+ :disabled="showadd_fields.fields[index].disabled"
61
+ @blur="check_disable"
62
+ :show-reset-button="reset">
63
+ </datepicker>
64
+ </div>
57
65
  </div>
66
+ <!--select-->
67
+ <input-select
68
+ @change="select_change_modal(index),disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)"
69
+ v-if="showadd_field.type=='select'"
70
+ :value.sync="showadd_fields.fields[index].value"
71
+ v-model="showadd_fields.fields[index].value"
72
+ :options='showadd_fields.fields[index].options'
73
+ :class="showadd_field.required&&!showadd_fields.fields[index].value?'has-error form-control' : 'form-control'"
74
+ @blur="check_disable_modal,disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)"
75
+ :mouseout="check_disable_modal,disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)">
76
+ </input-select>
77
+ <!-- input -->
78
+ <input :for="showadd_fields.fields[index].value" :type="showadd_field.type"
79
+ @change="select_change_modal(index),check_disable_modal,disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)"
80
+ v-if="(showadd_field.type=='input'||showadd_field.type=='number'||showadd_field.type=='email'||showadd_field.type=='url'||showadd_field.type=='range'||showadd_field.type=='search'||showadd_field.type=='color')&&!showadd_field.hidden"
81
+ v-model="showadd_fields.fields[index].value"
82
+ :value.sync="showadd_fields[index].value"
83
+ @blur="check_disable_modal,disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)"
84
+ class="form-control"
85
+ :mouseout="check_disable_modal,disabled_check_modal(showadd_fields.fields[index].required,showadd_fields.fields[index].value)"/>
86
+ <span
87
+ v-if="showadd_fields.fields[index].error&&showadd_fields.fields[index].error.msg&&showadd_fields.fields[index].error.flag"
88
+ style="color: red">{{showadd_fields.fields[index].error.msg}}</span>
58
89
  </div>
59
- <!--select-->
60
- <input-select @change="select_change(index)" v-if="showadd_field.type=='select'" :value.sync="showadd_fields.fields[index].value"
61
- v-model="showadd_fields.fields[index].value"
62
- :options='showadd_fields.fields[index].options'>
63
- </input-select>
64
- <!-- input -->
65
- <input name="showadd" @change="select_change(index)" v-if="showadd_field.type=='input'&&!showadd_field.hidden" class="form-control" v-model="showadd_fields[index].value" :value.sync="showadd_fields[index].value"/>
66
90
  </div>
91
+          
92
+ </div>
93
+ <div
94
+ style="padding-top: 15px;padding-left: 15px;padding-right: 15px;text-align: right;border-top: 0px solid #e5e5e5;">
95
+ <button :class="disable_button_modal?'btn btn-default':'btn btn-primary'" v-show="showadd"
96
+ :disabled="disable_button_modal" type="button" @click="acknowledge(modeltitle)">
97
+ 确认
98
+ </button>
67
99
  </div>
68
- </article>
69
- <footer slot="modal-footer" style="border-top:none" class="modal-footer">
70
- <button v-show="showadd" type="button" class="btn btn-primary" @click="acknowledge(modeltitle)">确认</button>
71
- </footer>
72
- </modal>
100
+  
101
+ </div>
102
+ </div>
73
103
 
74
104
  </div>
75
- </div>
105
+ </div>
76
106
  </template>
77
107
  <script>
78
108
  import {HttpResetClass} from 'vue-client'
109
+ import Vue from 'vue'
110
+
79
111
  export default {
80
112
  title: '基本信息',
113
+ // props: ['griddata', 'gridtitle', 'selectdata'],
114
+ props: {
115
+ griddata: {
116
+ type: Object,
117
+ default: {}
118
+ },
119
+ selectdata: {
120
+ type: Object,
121
+ default: {}
122
+ },
123
+ showprint: {
124
+ type: Boolean,
125
+ default: true,
126
+ }
127
+ },
81
128
  data() {
82
129
  return {
83
- templateshow:true,
84
- tempid:null,
130
+ templateshow: true,
131
+ title: '',
132
+ title_show: true,
133
+ tempid: null,
85
134
  data: null,
86
- surBodyData:[],
135
+ surBodyData: [],
87
136
  refresh: true, // 控制重新渲染
88
137
  model: {
89
- rows:[],
138
+ rows: [],
90
139
  button: {
91
140
  button_name: null,
92
141
  button_index: null
@@ -99,72 +148,79 @@
99
148
  showadd: false, // onetomany 新增模态框
100
149
  showadd_fields: [], // onetomany 新增模态框的字段配置
101
150
  data: null,
102
- showadd_index:null,
151
+ showadd_index: null,
103
152
  showmodal: false,
104
- modeltitle:null,
105
- disable_button: true
153
+ modeltitle: null,
154
+ refresh_modal: true,
155
+ disable_button_modal: true,
106
156
  }
107
157
  },
108
- props: ['selectdata'],
109
- ready(){
110
- this.data={
158
+ ready() {
159
+ this.title = '购买方信息'
160
+ this.data = {
111
161
  onetomany: [
112
162
  {
113
163
  tables: ["t_buyer_info"],
114
- safedelete:true,
164
+ safedelete: true,
115
165
  hidden: false,
116
166
  fields: [
117
167
  {
118
168
  label: "购货方名称",
119
169
  type: "input",
120
- bootstraped:"col-sm-4",
121
- label_bootstraped:"col-sm-3",
122
- value_bootstraped:"col-sm-9",
170
+ bootstraped: "col-sm-4",
171
+ label_bootstraped: "col-sm-3",
172
+ value_bootstraped: "col-sm-9",
123
173
  field: "f_buyer_name",
124
174
  placeholder: "请输入",
175
+ required: true,
125
176
  readonly: false
126
177
  },
127
178
  {
128
179
  label: "购货方纳税人识别号",
129
180
  type: "input",
130
- bootstraped:"col-sm-4",
131
- label_bootstraped:"col-sm-3",
132
- value_bootstraped:"col-sm-9",
133
- field:"f_buyer_identify",
134
- placeholder:"请输入",
181
+ bootstraped: "col-sm-4",
182
+ label_bootstraped: "col-sm-3",
183
+ value_bootstraped: "col-sm-9",
184
+ field: "f_buyer_identify",
185
+ placeholder: "请输入",
135
186
  readonly: false,
136
- disabled: false
187
+ required: true,
188
+ disabled: false,
189
+ error: {
190
+ flag: false,
191
+ msg: '购货方纳税人识别号必须为15位,18位或者20位'
192
+ }
137
193
  },
138
194
  {
139
195
  label: "购货方地址、电话",
140
- type:"input",
141
- bootstraped:"col-sm-4",
142
- label_bootstraped:"col-sm-3",
143
- value_bootstraped:"col-sm-9",
144
- field:"f_buyer_addphone",
145
- placeholder:"请输入",
196
+ type: "input",
197
+ bootstraped: "col-sm-4",
198
+ label_bootstraped: "col-sm-3",
199
+ value_bootstraped: "col-sm-9",
200
+ field: "f_buyer_addphone",
201
+ placeholder: "请输入",
146
202
  readonly: false,
147
203
  disabled: false
148
204
  },
149
205
  {
150
206
  label: "购货方开户行及账号",
151
- type:"input",
152
- bootstraped:"col-sm-4",
153
- label_bootstraped:"col-sm-3",
154
- value_bootstraped:"col-sm-9",
155
- field:"f_buyer_bank",
156
- placeholder:"请输入",
207
+ type: "input",
208
+ bootstraped: "col-sm-4",
209
+ label_bootstraped: "col-sm-3",
210
+ value_bootstraped: "col-sm-9",
211
+ field: "f_buyer_bank",
212
+ placeholder: "请输入",
157
213
  readonly: false,
158
214
  disabled: false
159
215
  },
160
216
  {
161
217
  label: "购货方电子邮箱",
162
- type:"input",
163
- bootstraped:"col-sm-4",
164
- label_bootstraped:"col-sm-3",
165
- value_bootstraped:"col-sm-9",
166
- field:"f_buyer_email",
167
- placeholder:"请输入",
218
+ type: "email",
219
+ bootstraped: "col-sm-4",
220
+ label_bootstraped: "col-sm-3",
221
+ value_bootstraped: "col-sm-9",
222
+ field: "f_buyer_email",
223
+ placeholder: "请输入",
168
224
  readonly: false,
169
225
  disabled: false
170
226
  }
@@ -175,29 +231,93 @@
175
231
  this.load()
176
232
  },
177
233
  methods: {
178
- // 级联操作预留
179
- select_change(index) {
180
- // this.$dispatch('select_cascade', index)
234
+ // 模态框级联操作预留
235
+ select_change_modal(index) {
236
+ if (this.showadd_fields.fields[index].value) {
237
+ this.showadd_fields[index] = {}
238
+ this.showadd_fields[index].value = this.showadd_fields.fields[index].value
239
+ } else if (this.showadd_fields[index] && this.showadd_fields[index].value) {
240
+ this.showadd_fields.fields[index].value = this.showadd_fields[index].value
241
+ }
242
+ this.refresh_modal = false
243
+ this.$nextTick(() => {
244
+ this.refresh_modal = true
245
+ })
246
+ // this.$dispatch('select_cascade_modal', index)
247
+ if (this.showadd_fields.fields[index].label == '购货方纳税人识别号') {
248
+ if (this.showadd_fields.fields[index].value.length != 15 && this.showadd_fields.fields[index].value.length != 18 && this.showadd_fields.fields[index].value.length != 20) {
249
+ this.showadd_fields.fields[index].error.flag = true
250
+ this.clear_showadd_fields_value(index)
251
+ } else {
252
+ this.showadd_fields.fields[index].error.flag = false
253
+ }
254
+ }
255
+ },
256
+ // 清理
257
+ clear_showadd_fields_value(index) {
258
+ this.showadd_fields.fields[index].value = ''
259
+ this.showadd_fields[index].value = ''
260
+ },
261
+ // 检测模态框按钮的disable
262
+ disabled_check_modal(required, value) {
263
+ if (required && value) {
264
+ this.disable_button_modal = false
265
+
266
+ let fields = this.showadd_fields.fields
267
+ let flag = false
268
+ for (let i = 0; i < fields.length; i++) {
269
+ if (fields[i].type !== 'checkbox' && fields[i].required && !fields[i].value) {
270
+ flag = true
271
+ }
272
+ }
273
+ this.disable_button_modal = flag
274
+ }
275
+ },
276
+ check_disable_modal() {
277
+ let fields = this.showadd_fields.fields
278
+ let flag = false
279
+ for (let i = 0; i < fields.length; i++) {
280
+ if (fields[i].type !== 'checkbox' && fields[i].required && !fields[i].value) {
281
+ flag = true
282
+ }
283
+ }
284
+ let count = 0
285
+ for (let i = 0; i < fields.length; i++) {
286
+ if (fields[i].type !== 'checkbox' && !fields[i].required) {
287
+ count++
288
+ }
289
+ }
290
+ if (count = 0) {
291
+ flag = false
292
+ }
293
+ this.disable_button_modal = flag
181
294
  },
182
295
  // 删除
183
- deleted(i,j){
184
- this.$showMessage("您确定要删除这条记录吗?",['confirm']).then((res)=>{
185
- if(res=='confirm'){
186
- this.onetomanydelete(i,j)
296
+ deleted(i, j) {
297
+ this.$showMessage("您确定要删除这条记录吗?", ['confirm']).then((res) => {
298
+ if (res == 'confirm') {
299
+ this.onetomanydelete(i, j)
187
300
  }
188
301
  })
189
302
  },
190
303
  // 修改
191
- revise(index,index2){
304
+ revise(index, index2) {
305
+ this.showadd_fields = []
192
306
  let templet = new Object()
193
307
  templet = this.data.onetomany[index]
194
308
  for (let j = 0; j < templet.fields.length; j++) {
195
- templet.fields[j].value = this.model.rows[index][index2][templet.fields[j].field]
196
- if(templet.fields[j].type == 'datepicker'){
197
- templet.fields[j].value = new Date().Format("yyyy-MM-dd HH:mm:ss")
309
+ if (templet.fields[j].type == 'input') {
310
+ templet[j] = {}
311
+ templet[j].value = this.model.rows[index][index2][templet.fields[j].field]
312
+ templet.fields[j].value = this.model.rows[index][index2][templet.fields[j].field]
313
+ } else {
314
+ templet.fields[j].value = this.model.rows[index][index2][templet.fields[j].field]
315
+ if (templet.fields[j].type == 'datepicker') {
316
+ templet.fields[j].value = new Date().Format("yyyy-MM-dd HH:mm:ss")
317
+ }
198
318
  }
199
319
  }
200
- this.tempid= this.model.rows[index][index2].id
320
+ this.tempid = this.model.rows[index][index2].id
201
321
  this.modeltitle = '修改'
202
322
  this.showadd_fields = templet
203
323
  this.showadd_index = index
@@ -218,7 +338,7 @@
218
338
  })
219
339
  },
220
340
  //获取view层confirm事件
221
- async confirm(tables, row,showadd_index,j) {
341
+ async confirm(tables, row, showadd_index, j) {
222
342
  var _this = this
223
343
  for (let i = 0; i < tables.length; i++) {
224
344
  let datas = {
@@ -228,7 +348,9 @@
228
348
  datas.row['f_process_id'] = this.selectdata.f_process_id
229
349
  datas.row['f_apply_num'] = this.selectdata.f_apply_num
230
350
  datas.row['f_filiale'] = this.selectdata.f_filiale
231
- datas.row['f_state'] = '有效'
351
+ datas.row['f_operator'] = this.$login.f.name
352
+ datas.row['f_parentname'] = this.$login.f.f_parentname
353
+ datas.row['f_operator_date'] = new Date().Format("yyyy-MM-dd HH:mm:ss")
232
354
  let http = new HttpResetClass()
233
355
  if (tables[i] == 't_charge_record') {
234
356
  await http.load('POST', 'rs/logic/applycharge', datas, {
@@ -259,46 +381,51 @@
259
381
  // 模态框点击确定按钮
260
382
  acknowledge(val) {
261
383
  let temp = {}
262
- if (val == '新增') {
263
- for(let i=0;i<this.showadd_fields.fields.length;i++){
264
- if(this.showadd_fields[i]){
384
+ console.log('点击按钮后的this.showadd_fields.fields=>' + JSON.stringify(this.showadd_fields.fields))
385
+ for (let i = 0; i < this.showadd_fields.fields.length; i++) {
386
+ if (this.showadd_fields.fields[i].value) {
387
+ temp[this.showadd_fields.fields[i].field] = this.showadd_fields.fields[i].value
388
+ } else {
389
+ if(this.showadd_fields[i]&&this.showadd_fields[i].value){
265
390
  temp[this.showadd_fields.fields[i].field] = this.showadd_fields[i].value
266
- }else{
267
- temp[this.showadd_fields.fields[i].field] = this.showadd_fields.fields[i].value
268
391
  }
269
-
270
392
  }
393
+ }
394
+ console.log('点击按钮后搜集到的页面数据temp=>' + JSON.stringify(temp))
395
+ if (val == '新增') {
396
+ console.log('即将新增记录,新增数据=>' + JSON.stringify(temp))
397
+ console.log('this.model.rows[this.showadd_index]=>' + JSON.stringify(this.model.rows[this.showadd_index]))
271
398
  this.model.rows[this.showadd_index].push(temp)
272
- this.confirm(this.data.onetomany[this.showadd_index].tables,temp,this.showadd_index,this.model.rows[this.showadd_index].length-1)
273
- this.showadd_fields = null
274
- this.showadd_index = null
399
+ this.confirm(this.data.onetomany[this.showadd_index].tables, temp, this.showadd_index, this.model.rows[this.showadd_index].length - 1)
275
400
  this.closemodal(val)
276
- } else if(val == '修改'){
277
- for(let j=0;j<this.showadd_fields.fields.length;j++){
278
- if(this.showadd_fields[j]){
279
- temp[this.showadd_fields.fields[j].field] = this.showadd_fields[j].value
280
- }else{
281
- temp[this.showadd_fields.fields[j].field] = this.showadd_fields.fields[j].value
282
- }
283
- }
401
+ } else if (val == '修改') {
284
402
  console.log(`修改信息=======>${JSON.stringify(temp)}`)
285
403
  temp.id = this.tempid
286
- this.confirm(this.data.onetomany[this.showadd_index].tables,temp,this.showadd_index,this.model.rows[this.showadd_index].length-1)
287
- this.showadd_fields = null
288
- this.showadd_index = null
404
+ this.confirm(this.data.onetomany[this.showadd_index].tables, temp, this.showadd_index, this.model.rows[this.showadd_index].length - 1)
289
405
  this.closemodal(val)
290
406
  }
291
407
  },
292
408
  // 关闭模态框
293
409
  closemodal() {
410
+ console.log('进入关闭模态框方法,先清空数据this.showadd_fields,目前数据=>' + JSON.stringify(this.showadd_fields))
411
+ for (let i = 0; i < this.showadd_fields.fields.length; i++) {
412
+ if (this.showadd_fields[i] && this.showadd_fields[i].value) {
413
+ this.showadd_fields[i].value = ''
414
+ }
415
+ if (this.showadd_fields.fields[i] && this.showadd_fields.fields[i].value) {
416
+ this.showadd_fields.fields[i].value = ''
417
+ }
418
+ }
419
+
294
420
  this.showadd_fields = null
295
421
  this.showadd = false
422
+ this.disable_button_modal = true
296
423
  this.modeltitle = null
297
- this.tempid= null
424
+ this.tempid = null
298
425
  },
299
426
  async load() {
300
- let index=0
301
- this.model = Object.assign({}, this.model, this.selectdata)
427
+ let index = 0
428
+ this.model = Object.assign({}, this.model, this.griddata)
302
429
  let http = new HttpResetClass()
303
430
  let data = {
304
431
  tablename: this.data.onetomany[index].tables[0],
@@ -315,7 +442,7 @@
315
442
  console.log(JSON.stringify('this.data.onetomany[index].rows=>' + JSON.stringify(this.data.onetomany[index].rows)))
316
443
 
317
444
  // 初始化onetomany中的fields
318
- for(let j =0;j<this.data.onetomany[index].fields.length;j++){
445
+ for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
319
446
  // 如果配置类型为select,优先从参数列表获取options
320
447
  if (this.data.onetomany[index].fields[j].type === 'select') {
321
448
  let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
@@ -324,18 +451,18 @@
324
451
  }
325
452
  }
326
453
  }
327
- this.model.rows =[]
454
+ this.model.rows = []
328
455
  this.surBodyData = []
329
- if(this.data.onetomany&&this.data.onetomany.length>0){
330
- for(let i = 0; i<this.data.onetomany.length;i++){
456
+ if (this.data.onetomany && this.data.onetomany.length > 0) {
457
+ for (let i = 0; i < this.data.onetomany.length; i++) {
331
458
  let temp = []
332
- for(let j = 0; j < this.data.onetomany[i].fields.length; j++){
459
+ for (let j = 0; j < this.data.onetomany[i].fields.length; j++) {
333
460
  temp.push(this.data.onetomany[i].fields[j].field)
334
461
  }
335
462
  this.surBodyData.push(temp)
336
463
  }
337
- for(let i=0;i<this.data.onetomany.length;i++){
338
- if(this.data.onetomany[i].rows){
464
+ for (let i = 0; i < this.data.onetomany.length; i++) {
465
+ if (this.data.onetomany[i].rows) {
339
466
  this.model.rows.push(this.data.onetomany[i].rows)
340
467
  }
341
468
  }
@@ -347,13 +474,13 @@
347
474
  }
348
475
  },
349
476
  events: {
350
- 'add'(index){
477
+ 'add'(index) {
351
478
  let templet = new Object()
352
479
  templet = this.data.onetomany[index]
353
480
  for (let j = 0; j < templet.fields.length; j++) {
354
481
  templet.fields[j].value = ''
355
- if(templet.fields[j].type == 'datepicker'){
356
- templet.fields[j].value = new Date().Format("yyyy-MM-dd HH:mm:ss")
482
+ if (templet.fields[j].type == 'datepicker') {
483
+ templet.fields[j].value = new Date().Format("yyyy-MM-dd HH:mm:ss")
357
484
  }
358
485
  }
359
486
  this.modeltitle = '新增'
@@ -362,13 +489,34 @@
362
489
  this.showadd = true
363
490
  }
364
491
  },
365
- computed: {
366
-
492
+ computed: {},
493
+ watch: {
494
+ 'selectdata'(){
495
+ this.load()
496
+ },
497
+ deep:true
367
498
  }
368
499
  }
500
+
501
+ // Date格式化
502
+ Date.prototype.Format = function (fmt) {
503
+ var o = {
504
+ "M+": this.getMonth() + 1, //月份
505
+ "d+": this.getDate(), //日
506
+ "H+": this.getHours(), //小时
507
+ "m+": this.getMinutes(), //分
508
+ "s+": this.getSeconds(), //秒
509
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
510
+ "S": this.getMilliseconds() //毫秒
511
+ };
512
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
513
+ for (var k in o)
514
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
515
+ return fmt;
516
+ }
369
517
  </script>
370
518
  <style scoped>
371
- tr{
519
+ tr {
372
520
  height: 34px;
373
521
  }
374
522
  </style>