apply-clients 3.4.26 → 3.4.28

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apply-clients",
3
- "version": "3.4.26",
3
+ "version": "3.4.28",
4
4
  "description": "报建前端模块",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -118,6 +118,7 @@
118
118
  placeholder="设备数量"
119
119
  v-model="item.f_material_number"
120
120
  :value="item.f_material_number"
121
+ @change="sumMaterialmoney(i)"
121
122
  />
122
123
  </div>
123
124
  </div>
@@ -231,6 +232,10 @@
231
232
  this.getOnetoManyData()
232
233
  },
233
234
  methods: {
235
+ sumMaterialmoney(index){
236
+ this.materials[index].f_material_money = this.materials[index].f_material_price * this.materials[index].f_material_number
237
+ console.log('打印',this.materials[index].f_material_money)
238
+ },
234
239
  async getOnetoManyData () {
235
240
  let http = new HttpResetClass()
236
241
  let data = {
@@ -293,7 +298,7 @@
293
298
 
294
299
  this.meterialOptions = res.data.map(item => {
295
300
  return {
296
- 'label': `${item.f_material_name}--${item.f_material_unit}--${item.f_material_price}`,
301
+ 'label': `${item.f_material_name}`,
297
302
  'value': item
298
303
  }
299
304
  })
@@ -1,462 +1,468 @@
1
- <template>
2
- <div>
3
- <data-grid :model="onetomany" class="list_area table_sy">
4
- <template partial='head'>
5
- <tr>
6
- <th class="textNoLineBreak">序号</th>
7
- <th class="textNoLineBreak">材料名称</th>
8
- <th class="textNoLineBreak">材料单位</th>
9
- <th class="textNoLineBreak">材料单价</th>
10
- <th class="textNoLineBreak">材料数量</th>
11
- <th class="textNoLineBreak">材料金额</th>
12
- <th class="textNoLineBreak">材料备注</th>
13
- <th class="textNoLineBreak">
14
- <button class="button_new button_spacing" type="button" @click="$parent.$parent.openMaterialModal()">添加</button>
15
- <button type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
16
- @click="$parent.$parent.showFile = !$parent.$parent.showFile">导入</button>
17
- <a type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
18
- href="/apply/download/excel/材料明细.xlsx" download>模板下载</a>
19
- </th>
20
- </tr>
21
- </template>
22
- <template partial='body'>
23
- <tr>
24
- <td style="text-align: center;">
25
- <nobr>{{$index+1}}</nobr>
26
- </td>
27
- <td style="text-align: center;">
28
- <nobr>{{row.f_material_name}}</nobr>
29
- </td>
30
- <td style="text-align: center;">
31
- <nobr>{{row.f_material_unit}}</nobr>
32
- </td>
33
- <td style="text-align: center;">
34
- <nobr>{{row.f_material_price}}</nobr>
35
- </td>
36
- <td style="text-align: center;">
37
- <nobr>{{row.f_material_number}}</nobr>
38
- </td>
39
- <td style="text-align: center;">
40
- <nobr>{{row.f_material_money}}</nobr>
41
- </td>
42
- <td style="text-align: center;">
43
- <nobr>{{row.f_material_remarks}}</nobr>
44
- </td>
45
- <td style="text-align: center;">
46
- <button type="button" class="button_search button_spacing" @click="$parent.$parent.updateMaterial($index,row)">修改</button>
47
- <button type="button" class="button_delete button_spacing" @click="$parent.$parent.deleteMaterial(row)">删除</button>
48
- </td>
49
- </tr>
50
- </template>
51
- </data-grid>
52
- <modal v-if="showFile" :show.sync="showFile" v-ref:modal :backdrop="false" title="选择文件">
53
- <header slot="modal-header" class="modal-header">
54
- <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
55
- <h4 class="modal-title">选择文件</h4>
56
- </header>
57
- <article slot="modal-body" class="modal-body">
58
- <div class="form-group">
59
- <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" v-ref:file></file-upload>
60
- </div>
61
- </article>
62
- <footer slot="modal-footer" class="modal-footer"></footer>
63
- </modal>
64
- <modal v-if="showMaterialModal" :show.sync="showMaterialModal" v-ref:modal :large="true"
65
- :backdrop="false" :title="title">
66
- <header slot="modal-header" class="modal-header">
67
- <button type="button" class="close" @click="closeMaterials"><span>&times;</span></button>
68
- <h4 class="modal-title">{{title}}</h4>
69
- </header>
70
- <article slot="modal-body" class="modal-body clearfix">
71
- <div v-for="(i,item) in materials" class="form-group col-sm-12 panel panel-info">
72
- <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff;margin-bottom: 10px">
73
- <div class="col-sm-6 text-left">材料{{$index+1}}信息</div>
74
- <div class="col-sm-6 text-right"><button
75
- class="button_delete button_spacing"
76
- @click.prevent="deleteDevicesinfo(i)"
77
- v-if="title === '新增'"
78
- >删除</button></div>
79
- </div>
80
- <div class="form-group col-sm-6">
81
- <label class="col-sm-4 control-label">选择材料:</label>
82
- <div class="col-sm-8">
83
- <input-select
84
- class="select select_list"
85
- :value.sync="item.material"
86
- v-model="item.material"
87
- :options="meterialOptions"
88
- :disable="mark === 1"
89
- @change="modifyOtherValue(i)"
90
- :valueSingle="true"></input-select>
91
- </div>
92
- </div>
93
- <div class="form-group col-sm-6" :class="[item.f_material_name ? '' : 'has-error']">
94
- <label class="col-sm-4 control-label">材料名称:</label>
95
- <div class="col-sm-8">
96
- <input class="form-control input_view" style="" type="text"
97
- placeholder="材料名称"
98
- v-model="item.f_material_name"
99
- :value="item.f_material_name"
100
- />
101
- </div>
102
- </div>
103
- <div class="form-group col-sm-6" :class="[item.f_material_unit ? '' : 'has-error']">
104
- <label class="col-sm-4 control-label">材料单位:</label>
105
- <div class="col-sm-8">
106
- <input class="form-control input_view" style="" type="text"
107
- placeholder="材料单位"
108
- v-model="item.f_material_unit"
109
- :value="item.f_material_unit"
110
- />
111
- </div>
112
- </div>
113
- <div class="form-group col-sm-6" :class="[item.f_material_price ? '' : 'has-error']">
114
- <label class="col-sm-4 control-label">材料单价:</label>
115
- <div class="col-sm-8">
116
- <input class="form-control input_view" style="" type="text"
117
- placeholder="材料单价"
118
- v-model="item.f_material_price"
119
- :value="item.f_material_price"
120
- />
121
- </div>
122
- </div>
123
- <div class="form-group col-sm-6" :class="[item.f_material_number ? '' : 'has-error']">
124
- <label class="col-sm-4 control-label">材料数量:</label>
125
- <div class="col-sm-8">
126
- <input class="form-control input_view" style="" type="number"
127
- placeholder="设备数量"
128
- v-model="item.f_material_number"
129
- :value="item.f_material_number"
130
- />
131
- </div>
132
- </div>
133
- <div class="form-group col-sm-6">
134
- <label class="col-sm-4 control-label">材料金额:</label>
135
- <div class="col-sm-8">
136
- <input class="form-control input_view" style="" type="text"
137
- placeholder="材料金额"
138
- v-model="item.f_material_money"
139
- :value="item.f_material_money"
140
- />
141
- </div>
142
- </div>
143
- <div class="form-group col-sm-6">
144
- <label class="col-sm-4 control-label">材料备注:</label>
145
- <div class="col-sm-8">
146
- <input class="form-control input_view" style=""
147
- placeholder="材料备注"
148
- v-model="item.f_material_remarks"
149
- :value.sync="item.f_material_remarks"
150
- />
151
- </div>
152
- </div>
153
- </div>
154
-
155
- </article>
156
- <footer slot="modal-footer" class="modal-footer">
157
- <template v-if="mark !== 1">
158
- <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="pushMaterial()">添加材料</button>
159
- <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="addMaterial()" :disabled="!$v.valid">确认添加</button>
160
- <button type="button" class="btn btn-primary" v-if="title==='修改'" @click="updateConfirm()" :disabled="!$v.valid">确认修改</button>
161
- </template>
162
- </footer>
163
- </modal>
164
- <apply-eticke-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></apply-eticke-print>
165
-
166
- </div>
167
- </template>
168
-
169
- <script>
170
- import {HttpResetClass} from 'vue-client'
171
- import Vue from "vue";
172
- export default {
173
- name: 'addMaterialScience',
174
- props: {
175
- selectdata: {
176
- type: Object
177
- },
178
- mark: {
179
- type: Number,
180
- default: 0
181
- }
182
- },
183
- data () {
184
- return {
185
- showFile: false,
186
- onetomany: {
187
- rows: []
188
- },
189
- title:'新增',
190
- showMaterialModal:false,
191
- eticket_show:false,
192
- materials:[
193
- {
194
- material:'',
195
- f_material_name:'',
196
- f_material_unit:'',
197
- f_material_price:'',
198
- f_material_number:'',
199
- f_material_money:'',
200
- f_material_remarks:''
201
- }
202
- ],
203
- meterialOptions:[],
204
- row:{},
205
- bjqChecklag:[]
206
- }
207
- },
208
- ready(){
209
- this.getOnetoManyData()
210
- },
211
- methods: {
212
- async getOnetoManyData () {
213
- let data = {
214
- tablename: `t_material_detail`,
215
- condition: `f_process_id='${this.selectdata.f_process_id}'`
216
- }
217
- let res = await this.$resetpost(
218
- 'rs/sql/singleTable',
219
- {data: data},
220
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
221
- )
222
- this.onetomany.rows = res.data
223
- },
224
- async openMaterialModal () {
225
- this.getMateralNames()
226
- this.title = '新增'
227
- this.materials = [
228
- {
229
- material:'',
230
- f_material_name:'',
231
- f_material_unit:'',
232
- f_material_price:'',
233
- f_material_number:'',
234
- f_material_money:'',
235
- f_material_remarks:''
236
- }
237
- ],
238
- this.showMaterialModal = true
239
- },
240
- closeFile() {
241
- this.showWork = false
242
- this.showFile = false
243
- // 将选的文件清空
244
- this.$refs.file.$el.querySelector('input').value = ''
245
- this.search()
246
- },
247
- deleteDevicesinfo (index) {
248
- this.materials.splice(index, 1)
249
- },
250
- pushMaterial () {
251
- this.materials.push({
252
- material:'',
253
- f_material_name:'',
254
- f_material_unit:'',
255
- f_material_price:'',
256
- f_material_number:'',
257
- f_material_money:'',
258
- f_material_remarks:''
259
- })
260
- },
261
- // 获取模态框材料
262
- async getMateralNames () {
263
- let data = {
264
- condition: `1=1`
265
- }
266
- let http = new HttpResetClass()
267
- let res = await http.load(
268
- 'POST',
269
- `rs/sql/getStockMaterial`,
270
- {data: data},
271
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
272
- )
273
-
274
- this.meterialOptions = res.data.map(item => {
275
- return {
276
- 'label': `${item.f_material_name}--${item.f_material_unit}--${item.f_material_price}`,
277
- 'value': item
278
- }
279
- })
280
- },
281
- modifyOtherValue (index){
282
- console.log("进来了",index)
283
- console.log("dddd",this.materials[index].material)
284
- let material = this.materials[index].material
285
- this.materials[index].f_material_name = material.f_material_name
286
- this.materials[index].f_material_unit = material.f_material_unit
287
- this.materials[index].f_material_price = material.f_material_price
288
- this.materials[index].f_material_number = material.f_material_number
289
- this.materials[index].f_material_money = material.f_material_money
290
- },
291
- // 新增材料
292
- async addMaterial () {
293
- console.log("登录信息:",this.$login.f)
294
- this.title = '新增'
295
- let data = {
296
- selectdata:this.selectdata,
297
- f_process_id : this.selectdata.f_process_id,
298
- f_operator_id: this.$login.f.id,
299
- f_operator: this.$login.f.name,
300
- f_department_name:this.$login.f.f_department_name,
301
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
302
- f_orgid: this.$login.f.orgid,
303
- f_orgname: this.$login.f.orgs,
304
- materials:this.materials
305
- }
306
- //报警器流程 设备编号检验
307
- await this.bjqCheck()
308
- console.log("这是bjqChecklag数据:",this.bjqChecklag)
309
- if (this.bjqChecklag.length > 0){
310
- return
311
- }
312
- let res = await this.$resetpost(
313
- `rs/logic/saveMaterials`,
314
- data
315
- )
316
- debugger
317
- // if(res.data == 200){
318
- // let money = 0;
319
- // for(var i=0;i<this.materials.length; i++){
320
- // money +=this.materials[i].f_material_money
321
- // }
322
- // this.selectdata.f_contract_money += money
323
- // console.log('打印this.materials.f_contract_money',money)
324
- // let contractbu={
325
- // f_contract_money:money,
326
- // f_contract_type:'材料合同'
327
- // }
328
- // let data ={
329
- // contract:contractbu,
330
- // selectdata: this.selectdata,
331
- // user: this.$login.f,
332
- // }
333
- // let http1 = new HttpResetClass()
334
- // let res = await http1.load(
335
- // 'POST',
336
- // `rs/logic/saveReplenishContract`,
337
- // {data: data},
338
- // {resolveMsg: null, rejectMsg: '补充协议成功!!!'}
339
- // )
340
- // }
341
- this.closeMaterials()
342
- },
343
- async deleteMaterial (row) {
344
- var show1 = window.confirm('您确定要删除这条记录吗?')
345
- if(show1 != true){
346
- this.closeMaterials()
347
- }else{
348
- debugger
349
- let http = new HttpResetClass()
350
- let res = await http.load(
351
- 'POST',
352
- `rs/logic/deleteMaterial`,
353
- {data: row},
354
- {resolveMsg: null, rejectMsg: '材料删除失败!!!'}
355
- )
356
- this.closeMaterials()
357
- }
358
-
359
- },
360
- async updateMaterial (index,row) {
361
- this.title = '修改'
362
- this.row = row
363
- this.getMateralNames()
364
- this.materials = [
365
- {
366
- material:'',
367
- f_material_name:row.f_material_name,
368
- f_material_unit:row.f_material_unit,
369
- f_material_price:row.f_material_price,
370
- f_material_number:row.f_material_number,
371
- f_material_money:row.f_material_money,
372
- f_material_remarks: row.f_material_remarks
373
- }
374
- ]
375
- this.showMaterialModal = true
376
- },
377
- async updateConfirm () {
378
- let data = this.row
379
- data.f_material_name = this.materials[0].f_material_name
380
- data.f_material_unit = this.materials[0].f_material_unit
381
- data.f_material_price = this.materials[0].f_material_price
382
- data.f_material_number = this.materials[0].f_material_number
383
- data.f_material_money = this.materials[0].f_material_money
384
- data.f_material_remarks = this.materials[0].f_material_remarks
385
- //报警器流程 设备编号检验
386
- await this.bjqCheck()
387
- if (this.bjqChecklag.length > 0){
388
- return
389
- }
390
- let res = await this.$resetpost(
391
- `rs/entity/t_material_detail`,
392
- data
393
- )
394
- this.closeMaterials()
395
- },
396
- sycronizedCode(index,val){
397
- console.log("看看:",index,val)
398
- this.materials[index].f_material_code = val
399
- },
400
- closeMaterials () {
401
- this.getOnetoManyData()
402
- this.showMaterialModal = false
403
- },
404
- async bjqCheck(){
405
- //报警器设备型号校验
406
- this.bjqChecklag = [] //初始化
407
- if (this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建'){
408
- let bjqinfo = {
409
- f_material_name : "",
410
- f_bjq_sid: ""
411
- }
412
- for (const bjqinfoElement of this.materials) {
413
- bjqinfo.f_bjq_sid = bjqinfoElement.f_bjq_sid
414
- bjqinfo.f_material_name = bjqinfoElement.f_material_name
415
- if (bjqinfo.f_material_name.substr(0,3) === '报警器'){
416
- let http = new HttpResetClass()
417
- let res = await http.load(
418
- 'POST',
419
- // `/rs/logic/bjqcheck`,
420
- `ncc/rs/logic/bjqcheck`,
421
- bjqinfo
422
- )
423
- if (res.data.code != 200){
424
- this.bjqChecklag.push(res.data.code)
425
- // this.$showMessage(res.data.msg)
426
- Vue.showAlert(res.data.msg, 'danger', 6000)
427
- return
428
- }
429
- }
430
- }
431
- }
432
- }
433
- },
434
- events: {
435
- 'beforeFileUpload' (file) {
436
- this.showWork = true
437
- },
438
- async 'onFileUpload'(file, result) {
439
- let data = {
440
- selectdata: this.selectdata,
441
- filepath: result.f_downloadpath,
442
- user: this.$login.f
443
- }
444
- try {
445
- let res = await this.$resetpost(`rs/logic/importMaterial`, {data: data}, {
446
- resolveMsg: null,
447
- rejectMsg: '导入失败!!!',
448
- silent: true
449
- }, 0)
450
- } catch (e) {
451
- this.closeFile()
452
- }
453
- this.$dispatch('breakControl', this.selectdata)
454
- }
455
- },
456
- }
457
-
458
- </script>
459
-
460
- <style scoped>
461
-
462
- </style>
1
+ <template>
2
+ <div>
3
+ <data-grid :model="onetomany" class="list_area table_sy">
4
+ <template partial='head'>
5
+ <tr>
6
+ <th class="textNoLineBreak">序号</th>
7
+ <th class="textNoLineBreak">材料名称</th>
8
+ <th class="textNoLineBreak">材料单位</th>
9
+ <th class="textNoLineBreak">材料单价</th>
10
+ <th class="textNoLineBreak">材料数量</th>
11
+ <th class="textNoLineBreak">材料金额</th>
12
+ <th class="textNoLineBreak">材料备注</th>
13
+ <th class="textNoLineBreak">
14
+ <button class="button_new button_spacing" type="button" @click="$parent.$parent.openMaterialModal()">添加</button>
15
+ <button type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
16
+ @click="$parent.$parent.showFile = !$parent.$parent.showFile">导入</button>
17
+ <a type="button" class="btn btn-info head-but" v-if="$parent.$parent.mark === 0"
18
+ href="/apply/download/excel/材料明细.xlsx" download>模板下载</a>
19
+ </th>
20
+ </tr>
21
+ </template>
22
+ <template partial='body'>
23
+ <tr>
24
+ <td style="text-align: center;">
25
+ <nobr>{{$index+1}}</nobr>
26
+ </td>
27
+ <td style="text-align: center;">
28
+ <nobr>{{row.f_material_name}}</nobr>
29
+ </td>
30
+ <td style="text-align: center;">
31
+ <nobr>{{row.f_material_unit}}</nobr>
32
+ </td>
33
+ <td style="text-align: center;">
34
+ <nobr>{{row.f_material_price}}</nobr>
35
+ </td>
36
+ <td style="text-align: center;">
37
+ <nobr>{{row.f_material_number}}</nobr>
38
+ </td>
39
+ <td style="text-align: center;">
40
+ <nobr>{{row.f_material_money}}</nobr>
41
+ </td>
42
+ <td style="text-align: center;">
43
+ <nobr>{{row.f_material_remarks}}</nobr>
44
+ </td>
45
+ <td style="text-align: center;">
46
+ <button type="button" class="button_search button_spacing" @click="$parent.$parent.updateMaterial($index,row)">修改</button>
47
+ <button type="button" class="button_delete button_spacing" @click="$parent.$parent.deleteMaterial(row)">删除</button>
48
+ </td>
49
+ </tr>
50
+ </template>
51
+ </data-grid>
52
+ <modal v-if="showFile" :show.sync="showFile" v-ref:modal :backdrop="false" title="选择文件">
53
+ <header slot="modal-header" class="modal-header">
54
+ <button type="button" class="close" @click="closeFile"><span>&times;</span></button>
55
+ <h4 class="modal-title">选择文件</h4>
56
+ </header>
57
+ <article slot="modal-body" class="modal-body">
58
+ <div class="form-group">
59
+ <file-upload class="my-file-uploader" name="useraddressUploadFile" action="rs/file/uploadFile" tagname="确定" v-ref:file></file-upload>
60
+ </div>
61
+ </article>
62
+ <footer slot="modal-footer" class="modal-footer"></footer>
63
+ </modal>
64
+ <modal v-if="showMaterialModal" :show.sync="showMaterialModal" v-ref:modal :large="true"
65
+ :backdrop="false" :title="title">
66
+ <header slot="modal-header" class="modal-header">
67
+ <button type="button" class="close" @click="closeMaterials"><span>&times;</span></button>
68
+ <h4 class="modal-title">{{title}}</h4>
69
+ </header>
70
+ <article slot="modal-body" class="modal-body clearfix">
71
+ <div v-for="(i,item) in materials" class="form-group col-sm-12 panel panel-info">
72
+ <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff;margin-bottom: 10px">
73
+ <div class="col-sm-6 text-left">材料{{$index+1}}信息</div>
74
+ <div class="col-sm-6 text-right"><button
75
+ class="button_delete button_spacing"
76
+ @click.prevent="deleteDevicesinfo(i)"
77
+ v-if="title === '新增'"
78
+ >删除</button></div>
79
+ </div>
80
+ <div class="form-group col-sm-6">
81
+ <label class="col-sm-4 control-label">选择材料:</label>
82
+ <div class="col-sm-8">
83
+ <input-select
84
+ class="select select_list"
85
+ :value.sync="item.material"
86
+ v-model="item.material"
87
+ :options="meterialOptions"
88
+ :disable="mark === 1"
89
+ @change="modifyOtherValue(i)"
90
+ :valueSingle="true"></input-select>
91
+ </div>
92
+ </div>
93
+ <div class="form-group col-sm-6" :class="[item.f_material_name ? '' : 'has-error']">
94
+ <label class="col-sm-4 control-label">材料名称:</label>
95
+ <div class="col-sm-8">
96
+ <input class="form-control input_view" style="" type="text"
97
+ placeholder="材料名称"
98
+ v-model="item.f_material_name"
99
+ :value="item.f_material_name"
100
+ />
101
+ </div>
102
+ </div>
103
+ <div class="form-group col-sm-6" :class="[item.f_material_unit ? '' : 'has-error']">
104
+ <label class="col-sm-4 control-label">材料单位:</label>
105
+ <div class="col-sm-8">
106
+ <input class="form-control input_view" style="" type="text"
107
+ placeholder="材料单位"
108
+ v-model="item.f_material_unit"
109
+ :value="item.f_material_unit"
110
+ />
111
+ </div>
112
+ </div>
113
+ <div class="form-group col-sm-6" :class="[item.f_material_price ? '' : 'has-error']">
114
+ <label class="col-sm-4 control-label">材料单价:</label>
115
+ <div class="col-sm-8">
116
+ <input class="form-control input_view" style="" type="text"
117
+ placeholder="材料单价"
118
+ v-model="item.f_material_price"
119
+ :value="item.f_material_price"
120
+ />
121
+ </div>
122
+ </div>
123
+ <div class="form-group col-sm-6" :class="[item.f_material_number ? '' : 'has-error']">
124
+ <label class="col-sm-4 control-label">材料数量:</label>
125
+ <div class="col-sm-8">
126
+ <input class="form-control input_view" style="" type="number"
127
+ placeholder="设备数量"
128
+ v-model="item.f_material_number"
129
+ :value="item.f_material_number"
130
+ @change="sumMaterialmoney(i)"
131
+ />
132
+ </div>
133
+ </div>
134
+ <div class="form-group col-sm-6">
135
+ <label class="col-sm-4 control-label">材料金额:</label>
136
+ <div class="col-sm-8">
137
+ <input class="form-control input_view" style="" type="text"
138
+ placeholder="材料金额"
139
+ v-model="item.f_material_money"
140
+ :value="item.f_material_money"
141
+ />
142
+ </div>
143
+ </div>
144
+ <div class="form-group col-sm-6">
145
+ <label class="col-sm-4 control-label">材料备注:</label>
146
+ <div class="col-sm-8">
147
+ <input class="form-control input_view" style=""
148
+ placeholder="材料备注"
149
+ v-model="item.f_material_remarks"
150
+ :value.sync="item.f_material_remarks"
151
+ />
152
+ </div>
153
+ </div>
154
+ </div>
155
+
156
+ </article>
157
+ <footer slot="modal-footer" class="modal-footer">
158
+ <template v-if="mark !== 1">
159
+ <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="pushMaterial()">添加材料</button>
160
+ <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="addMaterial()" :disabled="!$v.valid">确认添加</button>
161
+ <button type="button" class="btn btn-primary" v-if="title==='修改'" @click="updateConfirm()" :disabled="!$v.valid">确认修改</button>
162
+ </template>
163
+ </footer>
164
+ </modal>
165
+ <apply-eticke-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></apply-eticke-print>
166
+
167
+ </div>
168
+ </template>
169
+
170
+ <script>
171
+ import {HttpResetClass} from 'vue-client'
172
+ import Vue from "vue";
173
+ export default {
174
+ name: 'addMaterialScience',
175
+ props: {
176
+ selectdata: {
177
+ type: Object
178
+ },
179
+ mark: {
180
+ type: Number,
181
+ default: 0
182
+ }
183
+ },
184
+ data () {
185
+ return {
186
+ showFile: false,
187
+ onetomany: {
188
+ rows: []
189
+ },
190
+ title:'新增',
191
+ showMaterialModal:false,
192
+ eticket_show:false,
193
+ materials:[
194
+ {
195
+ material:'',
196
+ f_material_name:'',
197
+ f_material_unit:'',
198
+ f_material_price:'',
199
+ f_material_number:'',
200
+ f_material_money:'',
201
+ f_material_remarks:''
202
+ }
203
+ ],
204
+ meterialOptions:[],
205
+ row:{},
206
+ bjqChecklag:[]
207
+ }
208
+ },
209
+ ready(){
210
+ this.getOnetoManyData()
211
+ },
212
+ methods: {
213
+ sumMaterialmoney(index){
214
+ debugger
215
+ this.materials[index].f_material_money = this.materials[index].f_material_price * this.materials[index].f_material_number
216
+ console.log('打印',this.materials[index].f_material_money)
217
+ },
218
+ async getOnetoManyData () {
219
+ let data = {
220
+ tablename: `t_material_detail`,
221
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
222
+ }
223
+ let res = await this.$resetpost(
224
+ 'rs/sql/singleTable',
225
+ {data: data},
226
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
227
+ )
228
+ this.onetomany.rows = res.data
229
+ },
230
+ async openMaterialModal () {
231
+ this.getMateralNames()
232
+ this.title = '新增'
233
+ this.materials = [
234
+ {
235
+ material:'',
236
+ f_material_name:'',
237
+ f_material_unit:'',
238
+ f_material_price:'',
239
+ f_material_number:'',
240
+ f_material_money:'',
241
+ f_material_remarks:''
242
+ }
243
+ ],
244
+ this.showMaterialModal = true
245
+ },
246
+ closeFile() {
247
+ this.showWork = false
248
+ this.showFile = false
249
+ // 将选的文件清空
250
+ this.$refs.file.$el.querySelector('input').value = ''
251
+ this.search()
252
+ },
253
+ deleteDevicesinfo (index) {
254
+ this.materials.splice(index, 1)
255
+ },
256
+ pushMaterial () {
257
+ this.materials.push({
258
+ material:'',
259
+ f_material_name:'',
260
+ f_material_unit:'',
261
+ f_material_price:'',
262
+ f_material_number:'',
263
+ f_material_money:'',
264
+ f_material_remarks:''
265
+ })
266
+ },
267
+ // 获取模态框材料
268
+ async getMateralNames () {
269
+ let data = {
270
+ condition: `1=1`
271
+ }
272
+ let http = new HttpResetClass()
273
+ let res = await http.load(
274
+ 'POST',
275
+ `rs/sql/getStockMaterial`,
276
+ {data: data},
277
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
278
+ )
279
+
280
+ this.meterialOptions = res.data.map(item => {
281
+ return {
282
+ 'label': `${item.f_material_name}`,
283
+ 'value': item
284
+ }
285
+ })
286
+ },
287
+ modifyOtherValue (index){
288
+ console.log("进来了",index)
289
+ console.log("dddd",this.materials[index].material)
290
+ let material = this.materials[index].material
291
+ this.materials[index].f_material_name = material.f_material_name
292
+ this.materials[index].f_material_unit = material.f_material_unit
293
+ this.materials[index].f_material_price = material.f_material_price
294
+ this.materials[index].f_material_number = material.f_material_number
295
+ this.materials[index].f_material_money = material.f_material_money
296
+ },
297
+ // 新增材料
298
+ async addMaterial () {
299
+ console.log("登录信息:",this.$login.f)
300
+ this.title = '新增'
301
+ let data = {
302
+ selectdata:this.selectdata,
303
+ f_process_id : this.selectdata.f_process_id,
304
+ f_operator_id: this.$login.f.id,
305
+ f_operator: this.$login.f.name,
306
+ f_department_name:this.$login.f.f_department_name,
307
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
308
+ f_orgid: this.$login.f.orgid,
309
+ f_orgname: this.$login.f.orgs,
310
+ materials:this.materials
311
+ }
312
+ //报警器流程 设备编号检验
313
+ await this.bjqCheck()
314
+ console.log("这是bjqChecklag数据:",this.bjqChecklag)
315
+ if (this.bjqChecklag.length > 0){
316
+ return
317
+ }
318
+ let res = await this.$resetpost(
319
+ `rs/logic/saveMaterials`,
320
+ data
321
+ )
322
+ debugger
323
+ // if(res.data == 200){
324
+ // let money = 0;
325
+ // for(var i=0;i<this.materials.length; i++){
326
+ // money +=this.materials[i].f_material_money
327
+ // }
328
+ // this.selectdata.f_contract_money += money
329
+ // console.log('打印this.materials.f_contract_money',money)
330
+ // let contractbu={
331
+ // f_contract_money:money,
332
+ // f_contract_type:'材料合同'
333
+ // }
334
+ // let data ={
335
+ // contract:contractbu,
336
+ // selectdata: this.selectdata,
337
+ // user: this.$login.f,
338
+ // }
339
+ // let http1 = new HttpResetClass()
340
+ // let res = await http1.load(
341
+ // 'POST',
342
+ // `rs/logic/saveReplenishContract`,
343
+ // {data: data},
344
+ // {resolveMsg: null, rejectMsg: '补充协议成功!!!'}
345
+ // )
346
+ // }
347
+ this.closeMaterials()
348
+ },
349
+ async deleteMaterial (row) {
350
+ var show1 = window.confirm('您确定要删除这条记录吗?')
351
+ if(show1 != true){
352
+ this.closeMaterials()
353
+ }else{
354
+ debugger
355
+ let http = new HttpResetClass()
356
+ let res = await http.load(
357
+ 'POST',
358
+ `rs/logic/deleteMaterial`,
359
+ {data: row},
360
+ {resolveMsg: null, rejectMsg: '材料删除失败!!!'}
361
+ )
362
+ this.closeMaterials()
363
+ }
364
+
365
+ },
366
+ async updateMaterial (index,row) {
367
+ this.title = '修改'
368
+ this.row = row
369
+ this.getMateralNames()
370
+ this.materials = [
371
+ {
372
+ material:'',
373
+ f_material_name:row.f_material_name,
374
+ f_material_unit:row.f_material_unit,
375
+ f_material_price:row.f_material_price,
376
+ f_material_number:row.f_material_number,
377
+ f_material_money:row.f_material_money,
378
+ f_material_remarks: row.f_material_remarks
379
+ }
380
+ ]
381
+ this.showMaterialModal = true
382
+ },
383
+ async updateConfirm () {
384
+ let data = this.row
385
+ data.f_material_name = this.materials[0].f_material_name
386
+ data.f_material_unit = this.materials[0].f_material_unit
387
+ data.f_material_price = this.materials[0].f_material_price
388
+ data.f_material_number = this.materials[0].f_material_number
389
+ data.f_material_money = this.materials[0].f_material_money
390
+ data.f_material_remarks = this.materials[0].f_material_remarks
391
+ //报警器流程 设备编号检验
392
+ await this.bjqCheck()
393
+ if (this.bjqChecklag.length > 0){
394
+ return
395
+ }
396
+ let res = await this.$resetpost(
397
+ `rs/entity/t_material_detail`,
398
+ data
399
+ )
400
+ this.closeMaterials()
401
+ },
402
+ sycronizedCode(index,val){
403
+ console.log("看看:",index,val)
404
+ this.materials[index].f_material_code = val
405
+ },
406
+ closeMaterials () {
407
+ this.getOnetoManyData()
408
+ this.showMaterialModal = false
409
+ },
410
+ async bjqCheck(){
411
+ //报警器设备型号校验
412
+ this.bjqChecklag = [] //初始化
413
+ if (this.selectdata.f_apply_type === '报警器报建' || this.selectdata.f_apply_type === '工商业报警器报建'){
414
+ let bjqinfo = {
415
+ f_material_name : "",
416
+ f_bjq_sid: ""
417
+ }
418
+ for (const bjqinfoElement of this.materials) {
419
+ bjqinfo.f_bjq_sid = bjqinfoElement.f_bjq_sid
420
+ bjqinfo.f_material_name = bjqinfoElement.f_material_name
421
+ if (bjqinfo.f_material_name.substr(0,3) === '报警器'){
422
+ let http = new HttpResetClass()
423
+ let res = await http.load(
424
+ 'POST',
425
+ // `/rs/logic/bjqcheck`,
426
+ `ncc/rs/logic/bjqcheck`,
427
+ bjqinfo
428
+ )
429
+ if (res.data.code != 200){
430
+ this.bjqChecklag.push(res.data.code)
431
+ // this.$showMessage(res.data.msg)
432
+ Vue.showAlert(res.data.msg, 'danger', 6000)
433
+ return
434
+ }
435
+ }
436
+ }
437
+ }
438
+ }
439
+ },
440
+ events: {
441
+ 'beforeFileUpload' (file) {
442
+ this.showWork = true
443
+ },
444
+ async 'onFileUpload'(file, result) {
445
+ let data = {
446
+ selectdata: this.selectdata,
447
+ filepath: result.f_downloadpath,
448
+ user: this.$login.f
449
+ }
450
+ try {
451
+ let res = await this.$resetpost(`rs/logic/importMaterial`, {data: data}, {
452
+ resolveMsg: null,
453
+ rejectMsg: '导入失败!!!',
454
+ silent: true
455
+ }, 0)
456
+ } catch (e) {
457
+ this.closeFile()
458
+ }
459
+ this.$dispatch('breakControl', this.selectdata)
460
+ }
461
+ },
462
+ }
463
+
464
+ </script>
465
+
466
+ <style scoped>
467
+
468
+ </style>
package/src/main.js CHANGED
@@ -8,7 +8,7 @@ import {material} from 'material-client'
8
8
 
9
9
  import apply from './apply'
10
10
 
11
- import applyAndroid from './applyAndroid'
11
+ // import applyAndroid from './applyAndroid'
12
12
 
13
13
  all()
14
14
  apply('guangxi')