apply-clients 3.4.84 → 3.4.85

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.
@@ -12,7 +12,6 @@ var ldap = 'http://221.193.244.147:8400'
12
12
  var applyinstall = 'http://221.193.244.147:8400'
13
13
 
14
14
  var proxyTable = {
15
-
16
15
  '/rs/logic/getSaleInitData': {
17
16
  target: ldap
18
17
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apply-clients",
3
- "version": "3.4.84",
3
+ "version": "3.4.85",
4
4
  "description": "报建前端模块",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -0,0 +1,393 @@
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()">添加
15
+ </button>
16
+ </th>
17
+ </tr>
18
+ </template>
19
+ <template partial='body'>
20
+ <tr>
21
+ <td style="text-align: center;">
22
+ <nobr>{{$index+1}}</nobr>
23
+ </td>
24
+ <td style="text-align: center;">
25
+ <nobr>{{row.f_material_name}}</nobr>
26
+ </td>
27
+ <td style="text-align: center;">
28
+ <nobr>{{row.f_material_style}}</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_number}}</nobr>
35
+ </td>
36
+ <td style="text-align: center;">
37
+ <nobr>{{row.f_material_price}}</nobr>
38
+ </td>
39
+ <td style="text-align: center;">
40
+ <nobr>{{row.f_material_type}}</nobr>
41
+ </td>
42
+ <td style="text-align: center;">
43
+ <button type="button" class="button_search button_spacing"
44
+ @click="$parent.$parent.updateMaterial($index,row)">修改
45
+ </button>
46
+ <button type="button" class="button_delete button_spacing" @click="$parent.$parent.deleteMaterial(row)">删除
47
+ </button>
48
+ </td>
49
+ </tr>
50
+ </template>
51
+ </data-grid>
52
+ <modal v-if="showMaterialModal" :show.sync="showMaterialModal" v-ref:modal :large="true"
53
+ :backdrop="false" :title="title">
54
+ <header slot="modal-header" class="modal-header">
55
+ <button type="button" class="close" @click="closeMaterials"><span>&times;</span></button>
56
+ <h4 class="modal-title">{{title}}</h4>
57
+ </header>
58
+ <article slot="modal-body" class="modal-body clearfix">
59
+ <div v-for="(i,item) in materials" class="form-group col-sm-12 panel panel-info">
60
+ <div class="panel-heading head col-sm-12" style="background-color: #e8f4ff;margin-bottom: 10px">
61
+ <div class="col-sm-6 text-left">材料{{$index+1}}信息</div>
62
+ <div class="col-sm-6 text-right">
63
+ <button
64
+ class="button_delete button_spacing"
65
+ @click.prevent="deleteDevicesinfo(i)"
66
+ v-if="title === '新增'"
67
+ >删除
68
+ </button>
69
+ </div>
70
+ </div>
71
+ <div class="form-group col-sm-6">
72
+ <label class="col-sm-4 control-label">选择材料:</label>
73
+ <div class="col-sm-8">
74
+ <input-select
75
+ class="select select_list"
76
+ :value.sync="item.material"
77
+ v-model="item.material"
78
+ :options="meterialOptions"
79
+ :disable="mark === 1"
80
+ @change="modifyOtherValue(i)"
81
+ :valueSingle="true"></input-select>
82
+ </div>
83
+ </div>
84
+ <div class="form-group col-sm-6" :class="[item.f_material_name ? '' : 'has-error']">
85
+ <label class="col-sm-4 control-label">材料名称:</label>
86
+ <div class="col-sm-8">
87
+ <input class="form-control input_view" style="" type="text"
88
+ placeholder="材料名称"
89
+ v-model="item.f_material_name"
90
+ :value="item.f_material_name"
91
+ />
92
+ </div>
93
+ </div>
94
+ <div class="form-group col-sm-6" :class="[item.f_material_style ? '' : 'has-error']">
95
+ <label class="col-sm-4 control-label">材料型号:</label>
96
+ <div class="col-sm-8">
97
+ <input class="form-control input_view" style="" type="text"
98
+ placeholder="材料型号"
99
+ v-model="item.f_material_style"
100
+ :value="item.f_material_style"
101
+ />
102
+ </div>
103
+ </div>
104
+ <div class="form-group col-sm-6" :class="[item.f_material_unit ? '' : 'has-error']">
105
+ <label class="col-sm-4 control-label">材料单位:</label>
106
+ <div class="col-sm-8">
107
+ <input class="form-control input_view" style="" type="text"
108
+ placeholder="材料单位"
109
+ v-model="item.f_material_unit"
110
+ :value="item.f_material_unit"
111
+ />
112
+ </div>
113
+ </div>
114
+ <div class="form-group col-sm-6" :class="[item.f_material_number ? '' : 'has-error']">
115
+ <label class="col-sm-4 control-label">材料数量:</label>
116
+ <div class="col-sm-8">
117
+ <input class="form-control input_view" style="" type="number"
118
+ placeholder="设备数量"
119
+ v-model="item.f_material_number"
120
+ :value="item.f_material_number"
121
+ />
122
+ </div>
123
+ </div>
124
+ <div class="form-group col-sm-6">
125
+ <label class="col-sm-4 control-label">材料价格:</label>
126
+ <div class="col-sm-8">
127
+ <input class="form-control input_view" style="" type="text"
128
+ placeholder="材料价格"
129
+ v-model="item.f_material_price"
130
+ :value="item.f_material_price"
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
+
138
+ </div>
139
+ </div>
140
+ <div class="form-group col-sm-6">
141
+ <label class="col-sm-4 control-label"></label>
142
+ <div class="col-sm-8">
143
+
144
+ </div>
145
+ </div>
146
+ <div class="form-group col-sm-6">
147
+ <label class="col-sm-4 control-label"></label>
148
+ <div class="col-sm-8">
149
+
150
+ </div>
151
+ </div>
152
+ <div class="form-group col-sm-6">
153
+ <label class="col-sm-4 control-label"></label>
154
+ <div class="col-sm-8">
155
+
156
+ </div>
157
+ </div>
158
+ <div class="form-group col-sm-6">
159
+ <label class="col-sm-4 control-label"></label>
160
+ <div class="col-sm-8">
161
+
162
+ </div>
163
+ </div>
164
+ <div class="form-group col-sm-6">
165
+ <label class="col-sm-4 control-label"></label>
166
+ <div class="col-sm-8">
167
+
168
+ </div>
169
+ </div>
170
+ <div class="form-group col-sm-6">
171
+ <label class="col-sm-4 control-label"></label>
172
+ <div class="col-sm-8">
173
+
174
+ </div>
175
+ </div>
176
+ </div>
177
+ </article>
178
+ <footer slot="modal-footer" class="modal-footer">
179
+ <template v-if="mark !== 1">
180
+ <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="pushMaterial()">添加材料</button>
181
+ <button type="button" class="btn btn-primary" v-if="title==='新增'" @click="addMaterial()"
182
+ :disabled="!$v.valid">确认添加
183
+ </button>
184
+ <button type="button" class="btn btn-primary" v-if="title==='修改'" @click="updateConfirm()"
185
+ :disabled="!$v.valid">确认修改
186
+ </button>
187
+ </template>
188
+ </footer>
189
+ </modal>
190
+ </div>
191
+ </template>
192
+
193
+ <script>
194
+ import Vue from 'vue'
195
+ import {HttpResetClass} from 'vue-client'
196
+
197
+ export default {
198
+ name: 'addMaterialScience',
199
+ props: {
200
+ selectdata: {
201
+ type: Object
202
+ }
203
+ },
204
+ data() {
205
+ return {
206
+ onetomany: {
207
+ rows: []
208
+ },
209
+ title: '新增',
210
+ showMaterialModal: false,
211
+ materials: [
212
+ {
213
+ material: '',
214
+ f_material_name: '',
215
+ f_material_style: '',
216
+ f_material_unit: '',
217
+ f_material_number: '',
218
+ f_material_price:''
219
+ }
220
+ ],
221
+ meterialOptions: [],
222
+ row: {},
223
+ bjqChecklag:[],
224
+ fmaterialname:{},
225
+ isShow:[false]
226
+ }
227
+ },
228
+ ready() {
229
+ this.getOnetoManyData()
230
+ },
231
+ methods: {
232
+ async getOnetoManyData () {
233
+ let http = new HttpResetClass()
234
+ let data = {
235
+ tablename: `t_material_apply`,
236
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
237
+ }
238
+ let res = await http.load(
239
+ 'POST',
240
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable?aaa=123`,
241
+ {data: data},
242
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
243
+ )
244
+ this.onetomany.rows = res.data
245
+ },
246
+ async openMaterialModal() {
247
+ this.getMateralNames()
248
+ this.title = '新增'
249
+ this.materials = [
250
+ {
251
+ material: '',
252
+ f_material_name: '',
253
+ f_material_style: '',
254
+ f_material_unit: '',
255
+ f_material_number: '',
256
+ f_material_price:''
257
+ }
258
+ ],
259
+ this.showMaterialModal = true
260
+ this.isShow = [false]
261
+ },
262
+ deleteDevicesinfo(index) {
263
+ this.materials.splice(index, 1)
264
+ this.isShow.splice(index, 1)
265
+ },
266
+ pushMaterial() {
267
+ this.materials.push({
268
+ material: '',
269
+ f_material_name: '',
270
+ f_material_style: '',
271
+ f_material_unit: '',
272
+ f_material_number: '',
273
+ f_material_price:''
274
+ })
275
+ this.isShow.push(false)
276
+ },
277
+ // 获取模态框材料
278
+ async getMateralNames() {
279
+ let data = {
280
+ condition: `1=1`
281
+ }
282
+ let http = new HttpResetClass()
283
+ let res = await http.load(
284
+ 'POST',
285
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getStockMaterial`,
286
+ {data: data},
287
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
288
+ )
289
+
290
+ this.meterialOptions = res.data.map(item => {
291
+ return {
292
+ 'label': `${item.f_material_name}--${item.f_material_style}`,
293
+ 'value': item
294
+ }
295
+ })
296
+ },
297
+ modifyOtherValue(index) {
298
+ console.log("进来了", index)
299
+ console.log("dddd", this.materials[index].material)
300
+ let material = this.materials[index].material
301
+ this.materials[index].f_material_name = material.f_material_name
302
+ this.materials[index].f_material_style = material.f_material_style
303
+ this.materials[index].f_material_unit = material.f_material_unit
304
+ this.materials[index].f_material_number = material.f_material_number
305
+ this.materials[index].f_material_price = material.f_material_price
306
+ if (material.f_material_name === "报警器-汉威") {
307
+ this.isShow[index] = true
308
+ } else {
309
+ this.isShow[index] = false
310
+ }
311
+ this.isShow.splice(0, 1, this.isShow[0])
312
+ },
313
+ // 新增材料
314
+ async addMaterial() {
315
+ this.title = '新增'
316
+ let data = {
317
+ f_process_id: this.selectdata.f_process_id,
318
+ f_operator_id: Vue.user.id,
319
+ f_operator: Vue.user.name,
320
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
321
+ f_orgid: Vue.user.orgid,
322
+ f_orgname: Vue.user.orgs,
323
+ materials: this.materials
324
+ }
325
+ let http = new HttpResetClass()
326
+ let res = await http.load(
327
+ 'POST',
328
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/saveMaterials`,
329
+ data
330
+ )
331
+ this.closeMaterials()
332
+ },
333
+ async deleteMaterial(row) {
334
+ debugger
335
+ var show1 = window.confirm('您确定要删除这条记录吗?')
336
+ if(show1 != true){
337
+ this.closeMaterials()
338
+ }else{
339
+ let http = new HttpResetClass()
340
+ let res = await http.load(
341
+ 'POST',
342
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/deleteMaterial`,
343
+ {data: row},
344
+ {resolveMsg: null, rejectMsg: '材料删除失败!!!'}
345
+ )
346
+ this.closeMaterials()
347
+ }
348
+ }
349
+ ,
350
+ async updateMaterial(index, row) {
351
+ this.title = '修改'
352
+ this.row = row
353
+ this.getMateralNames()
354
+ this.materials = [
355
+ {
356
+ material: '',
357
+ f_material_name: row.f_material_name,
358
+ f_material_style: row.f_material_style,
359
+ f_material_unit: row.f_material_unit,
360
+ f_material_number: row.f_material_number,
361
+ f_material_price: row.f_material_price
362
+ }
363
+ ]
364
+ this.showMaterialModal = true
365
+ },
366
+ async updateConfirm() {
367
+ let data = this.row
368
+ data.f_material_name = this.materials[0].f_material_name
369
+ data.f_material_style = this.materials[0].f_material_style
370
+ data.f_material_unit = this.materials[0].f_material_unit
371
+ data.f_material_number = this.materials[0].f_material_number
372
+ data.f_material_price = this.materials[0].f_material_price
373
+
374
+ let http = new HttpResetClass()
375
+ let res = await http.load(
376
+ 'POST',
377
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/t_material_apply`,
378
+ data
379
+ )
380
+ this.closeMaterials()
381
+ },
382
+ closeMaterials() {
383
+ this.getOnetoManyData()
384
+ this.showMaterialModal = false
385
+ }
386
+ }
387
+ }
388
+
389
+ </script>
390
+
391
+ <style scoped>
392
+
393
+ </style>