apply-clients 4.0.64 → 4.0.67

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 (26) hide show
  1. package/package.json +1 -1
  2. package/src/apply.js +1 -0
  3. package/src/components/product/Function/InstallInfoSelect.vue +239 -239
  4. package/src/components/product/ImageUpload1.vue +623 -0
  5. package/src/components/product/Process/ExplorationSelect.vue +463 -463
  6. package/src/components/product/Process/Processes/BatchItem.vue +507 -507
  7. package/src/components/product/Statistics/ApplyPaySearch/ApplyCheckBill.vue +1 -1
  8. package/src/components/product/Statistics/ApplyPaySearch/ApplyPaySearch.vue +1 -1
  9. package/src/components/product/Statistics/ApplyPaySearch/MaterialSummary.vue +1 -1
  10. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +17 -1
  11. package/src/components/product/Supervisory/SupervisoryControl.vue +157 -157
  12. package/src/components/product/Supervisory/SupervisoryList.vue +450 -450
  13. package/.gradle/5.2.1/executionHistory/executionHistory.bin +0 -0
  14. package/.gradle/5.2.1/executionHistory/executionHistory.lock +0 -0
  15. package/.gradle/5.2.1/fileChanges/last-build.bin +0 -0
  16. package/.gradle/5.2.1/fileHashes/fileHashes.bin +0 -0
  17. package/.gradle/5.2.1/fileHashes/fileHashes.lock +0 -0
  18. package/.gradle/5.2.1/gc.properties +0 -0
  19. package/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  20. package/.gradle/buildOutputCleanup/cache.properties +0 -2
  21. package/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  22. package/.gradle/vcs-1/gc.properties +0 -0
  23. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  24. package/gradle/wrapper/gradle-wrapper.properties +0 -5
  25. package/gradlew +0 -172
  26. package/gradlew.bat +0 -84
@@ -1,507 +1,507 @@
1
- <template>
2
- <div class="flex" style="height: auto">
3
- <div style="height: auto" class="flex"
4
- v-if="selectdata.defname=='户内安装'||selectdata.defname=='安装审核'||selectdata.defname=='工程验收'">
5
-
6
- <p class="bg-info text-center" style="padding: 8px;font-size: 20px">预算项目表
7
- </p>
8
- <div class="form-inline auto" style="margin-bottom: 5px;">
9
- <criteria-paged :model="batchmodel" :pager="true" v-ref:paged1>
10
- <data-grid :model="$parent.batchmodel" v-ref:grid1 partial='list'>
11
-
12
- <template partial='head'>
13
- <tr>
14
- <th>
15
- <nobr>序号</nobr>
16
- </th>
17
- <th>
18
- <nobr>预算项目</nobr>
19
- </th>
20
- <th>
21
- <nobr>单位</nobr>
22
- </th>
23
- <th>
24
- <nobr>数量</nobr>
25
- </th>
26
- <th>
27
- <nobr>单价</nobr>
28
- </th>
29
- <th>
30
- <nobr>金额</nobr>
31
- </th>
32
- </tr>
33
- </template>
34
- <template partial='body'>
35
- <td style="text-align: center;">{{$index + 1}}</td>
36
- <td style="text-align: center;">{{row.f_batch_name}}</td>
37
- <td style="text-align: center;">{{row.f_unit}}</td>
38
- <td style="text-align: center;">{{row.f_number}}</td>
39
- <td style="text-align: center;">{{row.f_price}}</td>
40
- <td style="text-align: center;">{{row.f_cash}}</td>
41
-
42
- </template>
43
- </data-grid>
44
- </criteria-paged>
45
- </div>
46
- </div>
47
- <div style="height: auto" class="flex">
48
- <p class="bg-info text-center" style="padding: 8px;font-size: 20px" v-if="selectdata.defname=='工商预算审核(技术科科长)'||selectdata.defname=='工商预算审核(分管副总)'||selectdata.defname=='工商预算审核(总经理)'||
49
- selectdata.defname=='工商现场勘查'||selectdata.defname=='民用现场勘查'">预算项目表
50
- </p>
51
- <p class="bg-info text-center" style="padding: 8px;font-size: 20px"
52
- v-if="selectdata.defname=='户内安装'||selectdata.defname=='安装审核'||selectdata.defname=='点火申请'||selectdata.defname=='点火'||selectdata.defname=='收费材料费'||selectdata.defname=='工程验收'">
53
- 结算项目表
54
- </p>
55
- <div class="form-inline auto bg-info"
56
- v-if="selectdata.defname=='工商现场勘查'||selectdata.defname=='民用现场勘查'||selectdata.defname=='户内安装'"
57
- style="float: right">
58
- <div class="form-group" style="float: right" v-if="selectdata.defname=='工商现场勘查'||selectdata.defname=='民用现场勘查'">
59
- <button class="btn btn-success" @click="importemplate()">导入模板</button>
60
- </div>
61
- <div class="form-group" style="float: right"
62
- v-if="selectdata.defname=='户内安装'">
63
- <button class="btn btn-success" @click="importbudget()">从预算导入</button>
64
- </div>
65
- <div class="form-group" style="float: right">
66
- <button class="btn btn-success" @click="modify()">新增</button>
67
- </div>
68
- </div>
69
- <div class="form-inline auto" style="margin-bottom: 5px;">
70
- <criteria-paged :model="model" :pager="true" v-ref:paged>
71
- <data-grid :model="model" v-ref:grid partial='list'>
72
- <template partial='head'>
73
- <tr>
74
- <th>
75
- <nobr>序号</nobr>
76
- </th>
77
- <th v-if="$parent.$parent.$parent.selectdata.defname=='工商预算审核(技术科科长)'||$parent.$parent.$parent.selectdata.defname=='工商预算审核(分管副总)'||$parent.$parent.$parent.selectdata.defname=='工商预算审核(总经理)'||
78
- $parent.$parent.$parent.selectdata.defname=='工商现场勘查'||$parent.$parent.$parent.selectdata.defname=='民用现场勘查'">
79
- <nobr>预算项目</nobr>
80
- </th>
81
- <th
82
- v-if="$parent.$parent.$parent.selectdata.defname=='户内安装'||$parent.$parent.$parent.selectdata.defname=='安装审核'||$parent.$parent.$parent.selectdata.defname=='点火申请'||$parent.$parent.$parent.selectdata.defname=='收费材料费'||$parent.$parent.$parent.selectdata.defname=='工程验收'">
83
- <nobr>结算项目</nobr>
84
- </th>
85
- <th>
86
- <nobr>单位</nobr>
87
- </th>
88
- <th>
89
- <nobr>数量</nobr>
90
- </th>
91
- <th>
92
- <nobr>单价</nobr>
93
- </th>
94
- <th>
95
- <nobr>金额</nobr>
96
- </th>
97
- <th>
98
- <nobr>操作</nobr>
99
- </th>
100
- </tr>
101
- </template>
102
- <template partial='body'>
103
- <td :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'"><font :style="row.f_batch_name.includes('超')?'font-weight:bold;color: blue':''">{{$index + 1}}</font></td>
104
- <td :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'"><font :style="row.f_batch_name.includes('超')?'font-weight:bold;color: blue':''">{{row.f_batch_name}}</font></td>
105
- <td :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'"><font :style="row.f_batch_name.includes('超')?'font-weight:bold;color: blue':''">{{row.f_unit}}</font></td>
106
- <td :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'"><font :style="row.f_batch_name.includes('超')?'font-weight:bold;color: blue':''">{{row.f_number}}</font></td>
107
- <td :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'"><font :style="row.f_batch_name.includes('超')?'font-weight:bold;color: blue':''">{{row.f_price}}</font></td>
108
- <td :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'"><font :style="row.f_batch_name.includes('超')?'font-weight:bold;color: blue':''">{{row.f_cash}}</font></td>
109
- <td :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'">
110
- <div v-if="$parent.$parent.$parent.show" :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'">
111
- <button type="button" name="button" class="btn btn-link"
112
- @click="$parent.$parent.$parent.update(row)">修正
113
- </button>
114
- <button type="button" name="button" class="btn btn-link"
115
- @click="$parent.$parent.$parent.delete(row)">移除
116
- </button>
117
- </div>
118
- </td>
119
- </template>
120
- </data-grid>
121
- </criteria-paged>
122
- </div>
123
- </div>
124
- <modal :show.sync="modifyshow" backdrop="false">
125
- <header slot="modal-header" class="modal-header">
126
- <h4 class="modal-title">新增项目</h4>
127
- </header>
128
- <article slot="modal-body" class="modal-body">
129
- <form class="form-horizontal">
130
- <div class="col-sm-3 form-group form-input-group" style="width: 100%">
131
- <label for="f_batch_name" class="control-label">项目名</label>
132
- <v-select :value.sync="addrow.f_batch_name" v-model="updaterow.f_batch_name"
133
- :options='material' placeholder='请选择' style="width: 50%"
134
- close-on-select>
135
- </v-select>
136
- </div>
137
- <div class="col-sm-3 form-group form-input-group" style="width: 100%">
138
- <label for="f_number" class="control-label">数量</label>
139
- <input type="number" class="form-control" v-model="addrow.f_number"
140
- placeholder='数量'>
141
- </div>
142
- </form>
143
- </article>
144
- <footer slot="modal-footer" class="modal-footer">
145
- <button type="button" class="btn btn-success" @click='modifyConfirm'>确认</button>
146
- <button type="button" class="btn btn-default" @click='modifyclose'>取消</button>
147
- </footer>
148
- </modal>
149
- <modal :show.sync="updateshow" backdrop="false">
150
- <header slot="modal-header" class="modal-header">
151
- <h4 class="modal-title">修改项目名</h4>
152
- </header>
153
- <article slot="modal-body" class="modal-body">
154
- <form class="form-horizontal">
155
- <div class="col-sm-3 form-group form-input-group" style="width: 100%">
156
- <label for="f_batch_name" class="control-label">项目名</label>
157
- <input type="text" readonly class="form-control" v-model="updaterow.f_batch_name"
158
- placeholder='预算项目'>
159
- </div>
160
-
161
- <div class="col-sm-3 form-group form-input-group" style="width: 100%">
162
- <label for="f_number" class="control-label">数量</label>
163
- <input type="text" class="form-control" v-model="updaterow.f_number"
164
- placeholder='数量'>
165
- </div>
166
- </form>
167
- </article>
168
- <footer slot="modal-footer" class="modal-footer">
169
- <button type="button" class="btn btn-success" @click='updateConfirm'>确认</button>
170
- <button type="button" class="btn btn-default" @click='updateclose'>取消</button>
171
- </footer>
172
- </modal>
173
- </div>
174
- </template>
175
- <script>
176
- import {PagedList} from 'vue-client'
177
- import {HttpResetClass} from 'vue-client'
178
-
179
- let insert = async function (self) {
180
- let param = {
181
- f_filiale: self.selectdata.f_filiale,
182
- f_apply_num: self.selectdata.f_apply_num,
183
- f_process_id: self.selectdata.f_process_id,
184
- f_batch_name: self.addrow.f_batch_name[0],
185
- f_unit: self.addrow.f_unit,
186
- f_number: self.addrow.f_number,
187
- f_price: self.addrow.f_price,
188
- f_cash: (self.addrow.f_number * self.addrow.f_price),
189
- f_type: self.type,
190
- f_state: '1'
191
- }
192
- console.log('新增成本项', param)
193
- let http3 = new HttpResetClass()
194
- await http3.load('POST', 'rs/entity/t_batch_item', param).then(() => {
195
- // this.params.rows.splice(index, 1)
196
- console.log('更新成功!')
197
- self.addrow.f_batch_name = []
198
- self.addrow.f_unit = ''
199
- self.addrow.f_number = ''
200
- self.addrow.f_price = ''
201
- self.search()
202
- })
203
- self.search()
204
- self.modifyshow = false
205
- }
206
- let deletecost = async function (self) {
207
- let param = {
208
- id: self.updaterow.id,
209
- f_state: '0'
210
- }
211
- console.log('移除成本项', param)
212
- self.$resetpost('rs/entity/t_batch_item', param).then(() => {
213
- // this.params.rows.splice(index, 1)
214
- console.log('更新成功!')
215
- self.search()
216
- })
217
- self.search()
218
- self.modifyshow = false
219
- }
220
- let update = async function (self) {
221
- let param = {
222
- id: self.updaterow.id,
223
- f_batch_name: self.updaterow.f_batch_name,
224
- f_unit: self.updaterow.f_unit,
225
- f_number: self.updaterow.f_number,
226
- f_price: self.updaterow.f_price,
227
- f_cash: (self.updaterow.f_number * self.updaterow.f_price),
228
- }
229
- console.log('修改成本项', param)
230
- self.$resetpost('rs/entity/t_batch_item', param).then(() => {
231
- // this.params.rows.splice(index, 1)
232
- console.log('更新成功!')
233
- self.updaterow = null
234
- self.search()
235
- })
236
- // self.search()
237
- self.updateshow = false
238
- }
239
- export default {
240
- title: '预算项目',
241
- props: ['selectdata', 'edit'],
242
- data() {
243
- return {
244
- batchmodel: new PagedList('rs/sql/getBatchItem', 20, {orderitem: '`id`'}),
245
- model: new PagedList('rs/sql/getBatchItem', 20, {orderitem: '`id`'}),
246
- number: 0,
247
- yusuan: 0,
248
- numbergongliao: 0,
249
- modifyshow: false,
250
- updateshow: false,
251
- updaterow: null,
252
- addrow: null,
253
- material: [],
254
- type: null,
255
- show: false,
256
- iscash: [
257
- {label: '是', value: '是'},
258
- {label: '否', value: '否'}
259
- ],
260
- }
261
- },
262
- ready() {
263
- this.search()
264
- },
265
- methods: {
266
- async importemplate() { // 材料导入
267
- // :value.sync="addrow.f_batch_name" v-model="updaterow.f_batch_name" v-model="addrow.f_number"
268
- let materialTemplate = []
269
- if(this.$appdata.getSingleValue("材料导入模板")){
270
- materialTemplate = JSON.stringify(this.$appdata.getSingleValue("材料导入模板"))
271
- }else{
272
- materialTemplate = [["燃气表"], ["表接头"], ["DN15镀锌管"], ["DN15弯头*90"], ["DN15外丝直连"], ["DN15三通"], ["铜球阀"], ["单嘴阀"], ["DN25镀锌钢管"]]
273
- }
274
- for (let i = 0; i < materialTemplate.length; i++) {
275
- this.addrow.f_batch_name = materialTemplate[i]
276
- this.$set('updaterow.f_batch_name', materialTemplate[i])
277
- // this.updaterow.f_batch_name =materialTemplate[i]
278
- if (this.addrow.f_batch_name == '表接头') {
279
- this.addrow.f_number = 2
280
- }else if (this.addrow.f_batch_name == 'DN15弯头*90') {
281
- this.addrow.f_number = 3
282
- }else if (this.addrow.f_batch_name == '单嘴阀') {
283
- this.addrow.f_number = 2
284
- }else if (this.addrow.f_batch_name == 'DN25镀锌钢管') {
285
- this.addrow.f_number = 0.3
286
- }else {
287
- this.addrow.f_number = 1
288
- }
289
- // 获取价格
290
- let http = new HttpResetClass()
291
- await http.load('POST', 'rs/logic/getMaterialItem', {data: {condition: `f_name = '${this.addrow.f_batch_name[0]}' and f_use_type='预算/结算项目'`}}, {
292
- resolveMsg: null,
293
- rejectMsg: null
294
- }).then((res) => {
295
- console.log('查询到的选项', res)
296
- this.addrow.f_price = res.data.material[0].f_price
297
- this.addrow.f_unit = res.data.material[0].f_unit
298
- })
299
- let http2 = new HttpResetClass()
300
- await http2.load('POST', 'rs/logic/getMaterialItem', {data: {condition: `f_name = '${this.updaterow.f_batch_name[0]}' and f_use_type='预算/结算项目'`}}, {
301
- resolveMsg: null,
302
- rejectMsg: null
303
- }).then((res) => {
304
- console.log('查询到的选项', res)
305
- this.updaterow.f_price = res.data.material[0].f_price
306
- this.updaterow.f_unit = res.data.material[0].f_unit
307
- })
308
- await this.modifyConfirm()
309
- }
310
- this.search()
311
- },
312
- async importbudget() {
313
- let materialTemplate = this.batchmodel.rows
314
- for (let i = 0; i < materialTemplate.length; i++) {
315
- let temp = []
316
- temp.push(materialTemplate[i].f_batch_name)
317
- this.addrow.f_batch_name = temp
318
- this.$set('updaterow.f_batch_name', temp)
319
- // this.updaterow.f_batch_name =materialTemplate[i]
320
- this.addrow.f_number = materialTemplate[i].f_number
321
- // 获取价格
322
- let http = new HttpResetClass()
323
- await http.load('POST', 'rs/logic/getMaterialItem', {data: {condition: `f_name = '${this.addrow.f_batch_name[0]}' and f_use_type='预算/结算项目'`}}, {
324
- resolveMsg: null,
325
- rejectMsg: null
326
- }).then((res) => {
327
- console.log('查询到的选项', res)
328
- this.addrow.f_price = res.data.material[0].f_price
329
- this.addrow.f_unit = res.data.material[0].f_unit
330
- })
331
- let http2 = new HttpResetClass()
332
- await http2.load('POST', 'rs/logic/getMaterialItem', {data: {condition: `f_name = '${this.updaterow.f_batch_name[0]}' and f_use_type='预算/结算项目'`}}, {
333
- resolveMsg: null,
334
- rejectMsg: null
335
- }).then((res) => {
336
- console.log('查询到的选项', res)
337
- this.updaterow.f_price = res.data.material[0].f_price
338
- this.updaterow.f_unit = res.data.material[0].f_unit
339
- })
340
- await this.modifyConfirm()
341
- }
342
- this.search()
343
- },
344
- getname() {
345
- this.$resetpost('rs/logic/getMaterialItem', {data: {condition: `1=1 and f_use_type='预算/结算项目'`}}, {
346
- resolveMsg: null,
347
- rejectMsg: null
348
- }).then((res) => {
349
- console.log('查询到的选项', res)
350
- let house = []
351
- for (let row of res.data.material) {
352
- house.push({label: row.f_name, value: row.f_name})
353
- }
354
- this.material = house
355
- })
356
- },
357
- search() {
358
- this.show = false
359
-
360
- console.log('执行查询')
361
- if (this.selectdata.defname == '工商预算审核(技术科科长)' || this.selectdata.defname == '工商预算审核(分管副总)' || this.selectdata.defname == '工商预算审核(总经理)' ||
362
- this.selectdata.defname == '工商现场勘查' || this.selectdata.defname == '民用现场勘查') {
363
- console.log('预算')
364
- this.type = '预算'
365
- }
366
- if (this.selectdata.defname == '户内安装' || this.selectdata.defname == '安装审核' || this.selectdata.defname == '点火申请' || this.selectdata.defname == '收费材料费' || this.selectdata.defname == '工程验收'||this.selectdata.defname == '点火') {
367
- console.log('结算')
368
- this.type = '结算'
369
- }
370
- if (this.selectdata.defname == '工商现场勘查' || this.selectdata.defname == '民用现场勘查' || this.selectdata.defname == '户内安装') {
371
- console.log('显示按钮')
372
- this.show = true
373
- }
374
-
375
- let condition = ` f_apply_num = '${this.selectdata.f_apply_num}' and f_type='${this.type}'`
376
- let condition1 = ` f_apply_num = '${this.selectdata.f_apply_num}' and f_type='预算'`
377
- this.model.search(condition)
378
- this.batchmodel.search(condition1)
379
- this.getnumber()
380
- },
381
-
382
- getnumber() {
383
- // 结算
384
- let http = new HttpResetClass()
385
- let condition = ` f_apply_num = '${this.selectdata.f_apply_num}' and f_batch_name like '%超%' and f_type='结算'`
386
- http.load('POST', 'rs/sql/getBatchPrice', {
387
- data: {
388
- condition: condition,
389
- orderitem: `f_price desc`
390
- }
391
- }, {resolveMsg: null, rejectMsg: null}).then((res) => {
392
- if (res.data[0].f_price) {
393
- this.number = res.data[0].f_price
394
- } else {
395
- this.number = 0
396
- }
397
- console.log('11111111111')
398
- })
399
- // 预算yusuan
400
- let condition2 = ` f_apply_num = '${this.selectdata.f_apply_num}' and f_batch_name like '%超%' and f_type='预算'`
401
- let http2 = new HttpResetClass()
402
- http2.load('POST', 'rs/sql/getBatchPrice', {
403
- data: {
404
- condition: condition2,
405
- orderitem: `f_price desc`
406
- }
407
- }, {resolveMsg: null, rejectMsg: null}).then((res) => {
408
- if (res.data[0].f_price) {
409
- this.yusuan = res.data[0].f_price
410
- } else {
411
- this.yusuan = 0
412
- }
413
- console.log('11111111111')
414
- })
415
- },
416
- modify() {
417
- this.getname()
418
- this.modifyshow = true
419
- },
420
- modifyclose() {
421
- this.modifyshow = false
422
- this.addrow.f_batch_name = []
423
- this.addrow.f_unit = ''
424
- this.addrow.f_number = ''
425
- this.addrow.f_price = ''
426
- },
427
- async modifyConfirm() {
428
- if (!this.addrow.f_batch_name) {
429
- this.$showAlert("请输入预算项目", "warning", 1500)
430
- return
431
- }
432
- if (!this.addrow.f_number) {
433
- this.$showAlert("请输入数量", "warning", 1500)
434
- return
435
- }
436
- await insert(this)
437
- },
438
- update(row) {
439
- this.updaterow = row
440
- this.updateshow = true
441
- },
442
- updateclose() {
443
- // this.search()
444
- this.updaterow = null
445
- this.updateshow = false
446
- },
447
- async updateConfirm() {
448
- if (!this.updaterow.f_batch_name) {
449
- this.$showAlert("请输入预算项目", "warning", 1500)
450
- return
451
- }
452
- if (!this.updaterow.f_number) {
453
- this.$showAlert("请输入数量", "warning", 1500)
454
- return
455
- }
456
- await update(this)
457
- // await this.$showMessage(`是否确认修改此预算项`, ['confirm', 'cancel']).then((res) => {
458
- // if (res === 'confirm') {
459
- //
460
- // }
461
- // })
462
- },
463
- delete(row) {
464
- this.updaterow = row
465
- this.$showMessage(`是否确认删除此预算项`, ['confirm', 'cancel']).then((res) => {
466
- if (res === 'confirm') {
467
- deletecost(this)
468
- }
469
- })
470
- }
471
-
472
- },
473
- computed: {},
474
- events: {},
475
- watch: {
476
- 'number'(val) {
477
- this.$dispatch('get-price', val, '结算')
478
- },
479
- 'yusuan'(val) {
480
- this.$dispatch('get-price', val, '预算')
481
- },
482
- 'selectdata'() {
483
- this.search()
484
- },
485
- 'addrow.f_batch_name[0]'(val) {
486
- this.$resetpost('rs/logic/getMaterialItem', {data: {condition: `f_name = '${val}' and f_use_type='预算/结算项目'`}}, {
487
- resolveMsg: null,
488
- rejectMsg: null
489
- }).then((res) => {
490
- console.log('查询到的选项', res)
491
- this.addrow.f_price = res.data.material[0].f_price
492
- this.addrow.f_unit = res.data.material[0].f_unit
493
- })
494
- },
495
- 'updaterow.f_batch_name[0]'(val) {
496
- this.$resetpost('rs/logic/getMaterialItem', {data: {condition: `f_name = '${val}' and f_use_type='预算/结算项目'`}}, {
497
- resolveMsg: null,
498
- rejectMsg: null
499
- }).then((res) => {
500
- console.log('查询到的选项', res)
501
- this.updaterow.f_price = res.data.material[0].f_price
502
- this.updaterow.f_unit = res.data.material[0].f_unit
503
- })
504
- }
505
- }
506
- }
507
- </script>
1
+ <template>
2
+ <div class="flex" style="height: auto">
3
+ <div style="height: auto" class="flex"
4
+ v-if="selectdata.defname=='户内安装'||selectdata.defname=='安装审核'||selectdata.defname=='工程验收'">
5
+
6
+ <p class="bg-info text-center" style="padding: 8px;font-size: 20px">预算项目表
7
+ </p>
8
+ <div class="form-inline auto" style="margin-bottom: 5px;">
9
+ <criteria-paged :model="batchmodel" :pager="true" v-ref:paged1>
10
+ <data-grid :model="$parent.batchmodel" v-ref:grid1 partial='list'>
11
+
12
+ <template partial='head'>
13
+ <tr>
14
+ <th>
15
+ <nobr>序号</nobr>
16
+ </th>
17
+ <th>
18
+ <nobr>预算项目</nobr>
19
+ </th>
20
+ <th>
21
+ <nobr>单位</nobr>
22
+ </th>
23
+ <th>
24
+ <nobr>数量</nobr>
25
+ </th>
26
+ <th>
27
+ <nobr>单价</nobr>
28
+ </th>
29
+ <th>
30
+ <nobr>金额</nobr>
31
+ </th>
32
+ </tr>
33
+ </template>
34
+ <template partial='body'>
35
+ <td style="text-align: center;">{{$index + 1}}</td>
36
+ <td style="text-align: center;">{{row.f_batch_name}}</td>
37
+ <td style="text-align: center;">{{row.f_unit}}</td>
38
+ <td style="text-align: center;">{{row.f_number}}</td>
39
+ <td style="text-align: center;">{{row.f_price}}</td>
40
+ <td style="text-align: center;">{{row.f_cash}}</td>
41
+
42
+ </template>
43
+ </data-grid>
44
+ </criteria-paged>
45
+ </div>
46
+ </div>
47
+ <div style="height: auto" class="flex">
48
+ <p class="bg-info text-center" style="padding: 8px;font-size: 20px" v-if="selectdata.defname=='工商预算审核(技术科科长)'||selectdata.defname=='工商预算审核(分管副总)'||selectdata.defname=='工商预算审核(总经理)'||
49
+ selectdata.defname=='工商现场勘查'||selectdata.defname=='民用现场勘查'">预算项目表
50
+ </p>
51
+ <p class="bg-info text-center" style="padding: 8px;font-size: 20px"
52
+ v-if="selectdata.defname=='户内安装'||selectdata.defname=='安装审核'||selectdata.defname=='点火申请'||selectdata.defname=='点火'||selectdata.defname=='收费材料费'||selectdata.defname=='工程验收'">
53
+ 结算项目表
54
+ </p>
55
+ <div class="form-inline auto bg-info"
56
+ v-if="selectdata.defname=='工商现场勘查'||selectdata.defname=='民用现场勘查'||selectdata.defname=='户内安装'"
57
+ style="float: right">
58
+ <div class="form-group" style="float: right" v-if="selectdata.defname=='工商现场勘查'||selectdata.defname=='民用现场勘查'">
59
+ <button class="btn btn-success" @click="importemplate()">导入模板</button>
60
+ </div>
61
+ <div class="form-group" style="float: right"
62
+ v-if="selectdata.defname=='户内安装'">
63
+ <button class="btn btn-success" @click="importbudget()">从预算导入</button>
64
+ </div>
65
+ <div class="form-group" style="float: right">
66
+ <button class="btn btn-success" @click="modify()">新增</button>
67
+ </div>
68
+ </div>
69
+ <div class="form-inline auto" style="margin-bottom: 5px;">
70
+ <criteria-paged :model="model" :pager="true" v-ref:paged>
71
+ <data-grid :model="model" v-ref:grid partial='list'>
72
+ <template partial='head'>
73
+ <tr>
74
+ <th>
75
+ <nobr>序号</nobr>
76
+ </th>
77
+ <th v-if="$parent.$parent.$parent.selectdata.defname=='工商预算审核(技术科科长)'||$parent.$parent.$parent.selectdata.defname=='工商预算审核(分管副总)'||$parent.$parent.$parent.selectdata.defname=='工商预算审核(总经理)'||
78
+ $parent.$parent.$parent.selectdata.defname=='工商现场勘查'||$parent.$parent.$parent.selectdata.defname=='民用现场勘查'">
79
+ <nobr>预算项目</nobr>
80
+ </th>
81
+ <th
82
+ v-if="$parent.$parent.$parent.selectdata.defname=='户内安装'||$parent.$parent.$parent.selectdata.defname=='安装审核'||$parent.$parent.$parent.selectdata.defname=='点火申请'||$parent.$parent.$parent.selectdata.defname=='收费材料费'||$parent.$parent.$parent.selectdata.defname=='工程验收'">
83
+ <nobr>结算项目</nobr>
84
+ </th>
85
+ <th>
86
+ <nobr>单位</nobr>
87
+ </th>
88
+ <th>
89
+ <nobr>数量</nobr>
90
+ </th>
91
+ <th>
92
+ <nobr>单价</nobr>
93
+ </th>
94
+ <th>
95
+ <nobr>金额</nobr>
96
+ </th>
97
+ <th>
98
+ <nobr>操作</nobr>
99
+ </th>
100
+ </tr>
101
+ </template>
102
+ <template partial='body'>
103
+ <td :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'"><font :style="row.f_batch_name.includes('超')?'font-weight:bold;color: blue':''">{{$index + 1}}</font></td>
104
+ <td :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'"><font :style="row.f_batch_name.includes('超')?'font-weight:bold;color: blue':''">{{row.f_batch_name}}</font></td>
105
+ <td :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'"><font :style="row.f_batch_name.includes('超')?'font-weight:bold;color: blue':''">{{row.f_unit}}</font></td>
106
+ <td :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'"><font :style="row.f_batch_name.includes('超')?'font-weight:bold;color: blue':''">{{row.f_number}}</font></td>
107
+ <td :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'"><font :style="row.f_batch_name.includes('超')?'font-weight:bold;color: blue':''">{{row.f_price}}</font></td>
108
+ <td :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'"><font :style="row.f_batch_name.includes('超')?'font-weight:bold;color: blue':''">{{row.f_cash}}</font></td>
109
+ <td :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'">
110
+ <div v-if="$parent.$parent.$parent.show" :style="row.f_batch_name.includes('超')?'background-color: yellow;text-align: center;':'text-align: center;'">
111
+ <button type="button" name="button" class="btn btn-link"
112
+ @click="$parent.$parent.$parent.update(row)">修正
113
+ </button>
114
+ <button type="button" name="button" class="btn btn-link"
115
+ @click="$parent.$parent.$parent.delete(row)">移除
116
+ </button>
117
+ </div>
118
+ </td>
119
+ </template>
120
+ </data-grid>
121
+ </criteria-paged>
122
+ </div>
123
+ </div>
124
+ <modal :show.sync="modifyshow" backdrop="false">
125
+ <header slot="modal-header" class="modal-header">
126
+ <h4 class="modal-title">新增项目</h4>
127
+ </header>
128
+ <article slot="modal-body" class="modal-body">
129
+ <form class="form-horizontal">
130
+ <div class="col-sm-3 form-group form-input-group" style="width: 100%">
131
+ <label for="f_batch_name" class="control-label">项目名</label>
132
+ <v-select :value.sync="addrow.f_batch_name" v-model="updaterow.f_batch_name"
133
+ :options='material' placeholder='请选择' style="width: 50%"
134
+ close-on-select>
135
+ </v-select>
136
+ </div>
137
+ <div class="col-sm-3 form-group form-input-group" style="width: 100%">
138
+ <label for="f_number" class="control-label">数量</label>
139
+ <input type="number" class="form-control" v-model="addrow.f_number"
140
+ placeholder='数量'>
141
+ </div>
142
+ </form>
143
+ </article>
144
+ <footer slot="modal-footer" class="modal-footer">
145
+ <button type="button" class="btn btn-success" @click='modifyConfirm'>确认</button>
146
+ <button type="button" class="btn btn-default" @click='modifyclose'>取消</button>
147
+ </footer>
148
+ </modal>
149
+ <modal :show.sync="updateshow" backdrop="false">
150
+ <header slot="modal-header" class="modal-header">
151
+ <h4 class="modal-title">修改项目名</h4>
152
+ </header>
153
+ <article slot="modal-body" class="modal-body">
154
+ <form class="form-horizontal">
155
+ <div class="col-sm-3 form-group form-input-group" style="width: 100%">
156
+ <label for="f_batch_name" class="control-label">项目名</label>
157
+ <input type="text" readonly class="form-control" v-model="updaterow.f_batch_name"
158
+ placeholder='预算项目'>
159
+ </div>
160
+
161
+ <div class="col-sm-3 form-group form-input-group" style="width: 100%">
162
+ <label for="f_number" class="control-label">数量</label>
163
+ <input type="text" class="form-control" v-model="updaterow.f_number"
164
+ placeholder='数量'>
165
+ </div>
166
+ </form>
167
+ </article>
168
+ <footer slot="modal-footer" class="modal-footer">
169
+ <button type="button" class="btn btn-success" @click='updateConfirm'>确认</button>
170
+ <button type="button" class="btn btn-default" @click='updateclose'>取消</button>
171
+ </footer>
172
+ </modal>
173
+ </div>
174
+ </template>
175
+ <script>
176
+ import {PagedList} from 'vue-client'
177
+ import {HttpResetClass} from 'vue-client'
178
+
179
+ let insert = async function (self) {
180
+ let param = {
181
+ f_filiale: self.selectdata.f_filiale,
182
+ f_apply_num: self.selectdata.f_apply_num,
183
+ f_process_id: self.selectdata.f_process_id,
184
+ f_batch_name: self.addrow.f_batch_name[0],
185
+ f_unit: self.addrow.f_unit,
186
+ f_number: self.addrow.f_number,
187
+ f_price: self.addrow.f_price,
188
+ f_cash: (self.addrow.f_number * self.addrow.f_price),
189
+ f_type: self.type,
190
+ f_state: '1'
191
+ }
192
+ console.log('新增成本项', param)
193
+ let http3 = new HttpResetClass()
194
+ await http3.load('POST', 'rs/entity/t_batch_item', param).then(() => {
195
+ // this.params.rows.splice(index, 1)
196
+ console.log('更新成功!')
197
+ self.addrow.f_batch_name = []
198
+ self.addrow.f_unit = ''
199
+ self.addrow.f_number = ''
200
+ self.addrow.f_price = ''
201
+ self.search()
202
+ })
203
+ self.search()
204
+ self.modifyshow = false
205
+ }
206
+ let deletecost = async function (self) {
207
+ let param = {
208
+ id: self.updaterow.id,
209
+ f_state: '0'
210
+ }
211
+ console.log('移除成本项', param)
212
+ self.$resetpost('rs/entity/t_batch_item', param).then(() => {
213
+ // this.params.rows.splice(index, 1)
214
+ console.log('更新成功!')
215
+ self.search()
216
+ })
217
+ self.search()
218
+ self.modifyshow = false
219
+ }
220
+ let update = async function (self) {
221
+ let param = {
222
+ id: self.updaterow.id,
223
+ f_batch_name: self.updaterow.f_batch_name,
224
+ f_unit: self.updaterow.f_unit,
225
+ f_number: self.updaterow.f_number,
226
+ f_price: self.updaterow.f_price,
227
+ f_cash: (self.updaterow.f_number * self.updaterow.f_price),
228
+ }
229
+ console.log('修改成本项', param)
230
+ self.$resetpost('rs/entity/t_batch_item', param).then(() => {
231
+ // this.params.rows.splice(index, 1)
232
+ console.log('更新成功!')
233
+ self.updaterow = null
234
+ self.search()
235
+ })
236
+ // self.search()
237
+ self.updateshow = false
238
+ }
239
+ export default {
240
+ title: '预算项目',
241
+ props: ['selectdata', 'edit'],
242
+ data() {
243
+ return {
244
+ batchmodel: new PagedList('rs/sql/getBatchItem', 20, {orderitem: '`id`'}),
245
+ model: new PagedList('rs/sql/getBatchItem', 20, {orderitem: '`id`'}),
246
+ number: 0,
247
+ yusuan: 0,
248
+ numbergongliao: 0,
249
+ modifyshow: false,
250
+ updateshow: false,
251
+ updaterow: null,
252
+ addrow: null,
253
+ material: [],
254
+ type: null,
255
+ show: false,
256
+ iscash: [
257
+ {label: '是', value: '是'},
258
+ {label: '否', value: '否'}
259
+ ],
260
+ }
261
+ },
262
+ ready() {
263
+ this.search()
264
+ },
265
+ methods: {
266
+ async importemplate() { // 材料导入
267
+ // :value.sync="addrow.f_batch_name" v-model="updaterow.f_batch_name" v-model="addrow.f_number"
268
+ let materialTemplate = []
269
+ if(this.$appdata.getSingleValue("材料导入模板")){
270
+ materialTemplate = JSON.stringify(this.$appdata.getSingleValue("材料导入模板"))
271
+ }else{
272
+ materialTemplate = [["燃气表"], ["表接头"], ["DN15镀锌管"], ["DN15弯头*90"], ["DN15外丝直连"], ["DN15三通"], ["铜球阀"], ["单嘴阀"], ["DN25镀锌钢管"]]
273
+ }
274
+ for (let i = 0; i < materialTemplate.length; i++) {
275
+ this.addrow.f_batch_name = materialTemplate[i]
276
+ this.$set('updaterow.f_batch_name', materialTemplate[i])
277
+ // this.updaterow.f_batch_name =materialTemplate[i]
278
+ if (this.addrow.f_batch_name == '表接头') {
279
+ this.addrow.f_number = 2
280
+ }else if (this.addrow.f_batch_name == 'DN15弯头*90') {
281
+ this.addrow.f_number = 3
282
+ }else if (this.addrow.f_batch_name == '单嘴阀') {
283
+ this.addrow.f_number = 2
284
+ }else if (this.addrow.f_batch_name == 'DN25镀锌钢管') {
285
+ this.addrow.f_number = 0.3
286
+ }else {
287
+ this.addrow.f_number = 1
288
+ }
289
+ // 获取价格
290
+ let http = new HttpResetClass()
291
+ await http.load('POST', 'rs/logic/getMaterialItem', {data: {condition: `f_name = '${this.addrow.f_batch_name[0]}' and f_use_type='预算/结算项目'`}}, {
292
+ resolveMsg: null,
293
+ rejectMsg: null
294
+ }).then((res) => {
295
+ console.log('查询到的选项', res)
296
+ this.addrow.f_price = res.data.material[0].f_price
297
+ this.addrow.f_unit = res.data.material[0].f_unit
298
+ })
299
+ let http2 = new HttpResetClass()
300
+ await http2.load('POST', 'rs/logic/getMaterialItem', {data: {condition: `f_name = '${this.updaterow.f_batch_name[0]}' and f_use_type='预算/结算项目'`}}, {
301
+ resolveMsg: null,
302
+ rejectMsg: null
303
+ }).then((res) => {
304
+ console.log('查询到的选项', res)
305
+ this.updaterow.f_price = res.data.material[0].f_price
306
+ this.updaterow.f_unit = res.data.material[0].f_unit
307
+ })
308
+ await this.modifyConfirm()
309
+ }
310
+ this.search()
311
+ },
312
+ async importbudget() {
313
+ let materialTemplate = this.batchmodel.rows
314
+ for (let i = 0; i < materialTemplate.length; i++) {
315
+ let temp = []
316
+ temp.push(materialTemplate[i].f_batch_name)
317
+ this.addrow.f_batch_name = temp
318
+ this.$set('updaterow.f_batch_name', temp)
319
+ // this.updaterow.f_batch_name =materialTemplate[i]
320
+ this.addrow.f_number = materialTemplate[i].f_number
321
+ // 获取价格
322
+ let http = new HttpResetClass()
323
+ await http.load('POST', 'rs/logic/getMaterialItem', {data: {condition: `f_name = '${this.addrow.f_batch_name[0]}' and f_use_type='预算/结算项目'`}}, {
324
+ resolveMsg: null,
325
+ rejectMsg: null
326
+ }).then((res) => {
327
+ console.log('查询到的选项', res)
328
+ this.addrow.f_price = res.data.material[0].f_price
329
+ this.addrow.f_unit = res.data.material[0].f_unit
330
+ })
331
+ let http2 = new HttpResetClass()
332
+ await http2.load('POST', 'rs/logic/getMaterialItem', {data: {condition: `f_name = '${this.updaterow.f_batch_name[0]}' and f_use_type='预算/结算项目'`}}, {
333
+ resolveMsg: null,
334
+ rejectMsg: null
335
+ }).then((res) => {
336
+ console.log('查询到的选项', res)
337
+ this.updaterow.f_price = res.data.material[0].f_price
338
+ this.updaterow.f_unit = res.data.material[0].f_unit
339
+ })
340
+ await this.modifyConfirm()
341
+ }
342
+ this.search()
343
+ },
344
+ getname() {
345
+ this.$resetpost('rs/logic/getMaterialItem', {data: {condition: `1=1 and f_use_type='预算/结算项目'`}}, {
346
+ resolveMsg: null,
347
+ rejectMsg: null
348
+ }).then((res) => {
349
+ console.log('查询到的选项', res)
350
+ let house = []
351
+ for (let row of res.data.material) {
352
+ house.push({label: row.f_name, value: row.f_name})
353
+ }
354
+ this.material = house
355
+ })
356
+ },
357
+ search() {
358
+ this.show = false
359
+
360
+ console.log('执行查询')
361
+ if (this.selectdata.defname == '工商预算审核(技术科科长)' || this.selectdata.defname == '工商预算审核(分管副总)' || this.selectdata.defname == '工商预算审核(总经理)' ||
362
+ this.selectdata.defname == '工商现场勘查' || this.selectdata.defname == '民用现场勘查') {
363
+ console.log('预算')
364
+ this.type = '预算'
365
+ }
366
+ if (this.selectdata.defname == '户内安装' || this.selectdata.defname == '安装审核' || this.selectdata.defname == '点火申请' || this.selectdata.defname == '收费材料费' || this.selectdata.defname == '工程验收'||this.selectdata.defname == '点火') {
367
+ console.log('结算')
368
+ this.type = '结算'
369
+ }
370
+ if (this.selectdata.defname == '工商现场勘查' || this.selectdata.defname == '民用现场勘查' || this.selectdata.defname == '户内安装') {
371
+ console.log('显示按钮')
372
+ this.show = true
373
+ }
374
+
375
+ let condition = ` f_apply_num = '${this.selectdata.f_apply_num}' and f_type='${this.type}'`
376
+ let condition1 = ` f_apply_num = '${this.selectdata.f_apply_num}' and f_type='预算'`
377
+ this.model.search(condition)
378
+ this.batchmodel.search(condition1)
379
+ this.getnumber()
380
+ },
381
+
382
+ getnumber() {
383
+ // 结算
384
+ let http = new HttpResetClass()
385
+ let condition = ` f_apply_num = '${this.selectdata.f_apply_num}' and f_batch_name like '%超%' and f_type='结算'`
386
+ http.load('POST', 'rs/sql/getBatchPrice', {
387
+ data: {
388
+ condition: condition,
389
+ orderitem: `f_price desc`
390
+ }
391
+ }, {resolveMsg: null, rejectMsg: null}).then((res) => {
392
+ if (res.data[0].f_price) {
393
+ this.number = res.data[0].f_price
394
+ } else {
395
+ this.number = 0
396
+ }
397
+ console.log('11111111111')
398
+ })
399
+ // 预算yusuan
400
+ let condition2 = ` f_apply_num = '${this.selectdata.f_apply_num}' and f_batch_name like '%超%' and f_type='预算'`
401
+ let http2 = new HttpResetClass()
402
+ http2.load('POST', 'rs/sql/getBatchPrice', {
403
+ data: {
404
+ condition: condition2,
405
+ orderitem: `f_price desc`
406
+ }
407
+ }, {resolveMsg: null, rejectMsg: null}).then((res) => {
408
+ if (res.data[0].f_price) {
409
+ this.yusuan = res.data[0].f_price
410
+ } else {
411
+ this.yusuan = 0
412
+ }
413
+ console.log('11111111111')
414
+ })
415
+ },
416
+ modify() {
417
+ this.getname()
418
+ this.modifyshow = true
419
+ },
420
+ modifyclose() {
421
+ this.modifyshow = false
422
+ this.addrow.f_batch_name = []
423
+ this.addrow.f_unit = ''
424
+ this.addrow.f_number = ''
425
+ this.addrow.f_price = ''
426
+ },
427
+ async modifyConfirm() {
428
+ if (!this.addrow.f_batch_name) {
429
+ this.$showAlert("请输入预算项目", "warning", 1500)
430
+ return
431
+ }
432
+ if (!this.addrow.f_number) {
433
+ this.$showAlert("请输入数量", "warning", 1500)
434
+ return
435
+ }
436
+ await insert(this)
437
+ },
438
+ update(row) {
439
+ this.updaterow = row
440
+ this.updateshow = true
441
+ },
442
+ updateclose() {
443
+ // this.search()
444
+ this.updaterow = null
445
+ this.updateshow = false
446
+ },
447
+ async updateConfirm() {
448
+ if (!this.updaterow.f_batch_name) {
449
+ this.$showAlert("请输入预算项目", "warning", 1500)
450
+ return
451
+ }
452
+ if (!this.updaterow.f_number) {
453
+ this.$showAlert("请输入数量", "warning", 1500)
454
+ return
455
+ }
456
+ await update(this)
457
+ // await this.$showMessage(`是否确认修改此预算项`, ['confirm', 'cancel']).then((res) => {
458
+ // if (res === 'confirm') {
459
+ //
460
+ // }
461
+ // })
462
+ },
463
+ delete(row) {
464
+ this.updaterow = row
465
+ this.$showMessage(`是否确认删除此预算项`, ['confirm', 'cancel']).then((res) => {
466
+ if (res === 'confirm') {
467
+ deletecost(this)
468
+ }
469
+ })
470
+ }
471
+
472
+ },
473
+ computed: {},
474
+ events: {},
475
+ watch: {
476
+ 'number'(val) {
477
+ this.$dispatch('get-price', val, '结算')
478
+ },
479
+ 'yusuan'(val) {
480
+ this.$dispatch('get-price', val, '预算')
481
+ },
482
+ 'selectdata'() {
483
+ this.search()
484
+ },
485
+ 'addrow.f_batch_name[0]'(val) {
486
+ this.$resetpost('rs/logic/getMaterialItem', {data: {condition: `f_name = '${val}' and f_use_type='预算/结算项目'`}}, {
487
+ resolveMsg: null,
488
+ rejectMsg: null
489
+ }).then((res) => {
490
+ console.log('查询到的选项', res)
491
+ this.addrow.f_price = res.data.material[0].f_price
492
+ this.addrow.f_unit = res.data.material[0].f_unit
493
+ })
494
+ },
495
+ 'updaterow.f_batch_name[0]'(val) {
496
+ this.$resetpost('rs/logic/getMaterialItem', {data: {condition: `f_name = '${val}' and f_use_type='预算/结算项目'`}}, {
497
+ resolveMsg: null,
498
+ rejectMsg: null
499
+ }).then((res) => {
500
+ console.log('查询到的选项', res)
501
+ this.updaterow.f_price = res.data.material[0].f_price
502
+ this.updaterow.f_unit = res.data.material[0].f_unit
503
+ })
504
+ }
505
+ }
506
+ }
507
+ </script>