Przeglądaj źródła

Merge branch '20201109_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201109_pc_vue_new_branch

csx 3 lat temu
rodzic
commit
a18252b97e

+ 8 - 5
src/xt_pages/data/components/addInspection.vue Wyświetl plik

49
                     <el-select v-model="form.project_detail" filterable placeholder="请选择" @change="changeProject">
49
                     <el-select v-model="form.project_detail" filterable placeholder="请选择" @change="changeProject">
50
                         <el-option
50
                         <el-option
51
                                 v-for="item in projectList"
51
                                 v-for="item in projectList"
52
-                                :key="item.id"
52
+                                :key="item.new_id"
53
                                 :label="item.project_name"
53
                                 :label="item.project_name"
54
-                                :value="item.id">
54
+                                :value="item.new_id">
55
                         </el-option>
55
                         </el-option>
56
                     </el-select>
56
                     </el-select>
57
                 </el-form-item>
57
                 </el-form-item>
257
                 project_name: projectList[i].project_name,
257
                 project_name: projectList[i].project_name,
258
                 unit: projectList[i].unit,
258
                 unit: projectList[i].unit,
259
                 price: projectList[i].price,
259
                 price: projectList[i].price,
260
-                type: 2
260
+                type: 2,
261
+                new_id: Math.floor((Math.random() + Math.floor(Math.random() * 9 + 1)) * Math.pow(10, 10 - 1))
261
               }
262
               }
262
               this.projectList.push(obj)
263
               this.projectList.push(obj)
263
 
264
 
271
                 project_name: goodInfos[i].good_name,
272
                 project_name: goodInfos[i].good_name,
272
                 unit: goodInfos[i].good_unit,
273
                 unit: goodInfos[i].good_unit,
273
                 price: goodInfos[i].retail_price,
274
                 price: goodInfos[i].retail_price,
274
-                type: 3
275
+                type: 3,
276
+                new_id: Math.floor((Math.random() + Math.floor(Math.random() * 9 + 1)) * Math.pow(10, 10 - 1))
277
+
275
               }
278
               }
276
               this.projectList.push(obj)
279
               this.projectList.push(obj)
277
             }
280
             }
309
       addProjectList() {
312
       addProjectList() {
310
         console.log(this.projectList)
313
         console.log(this.projectList)
311
         for (let i = 0; i < this.projectList.length; i++) {
314
         for (let i = 0; i < this.projectList.length; i++) {
312
-          if (this.form.project_detail == this.projectList[i].id) {
315
+          if (this.form.project_detail == this.projectList[i].new_id) {
313
             this.projectList[i].number = this.form.number
316
             this.projectList[i].number = this.form.number
314
             this.projectList[i].number = this.projectList[i].number.toString()
317
             this.projectList[i].number = this.projectList[i].number.toString()
315
             this.tableData.push(this.projectList[i])
318
             this.tableData.push(this.projectList[i])

+ 8 - 4
src/xt_pages/data/components/editInspection.vue Wyświetl plik

50
                                 v-for="item,index in projectList"
50
                                 v-for="item,index in projectList"
51
                                 :key="index"
51
                                 :key="index"
52
                                 :label="item.project_name"
52
                                 :label="item.project_name"
53
-                                :value="item.id">
53
+                                :value="item.new_id">
54
                         </el-option>
54
                         </el-option>
55
                     </el-select>
55
                     </el-select>
56
 
56
 
209
                 unit: projectList[i].unit,
209
                 unit: projectList[i].unit,
210
                 price: projectList[i].price,
210
                 price: projectList[i].price,
211
                 type: 2,
211
                 type: 2,
212
-                m_id: 0
212
+                m_id: 0,
213
+                new_id: Math.floor((Math.random() + Math.floor(Math.random() * 9 + 1)) * Math.pow(10, 10 - 1))
214
+
213
               }
215
               }
214
               this.projectList.push(obj)
216
               this.projectList.push(obj)
215
 
217
 
224
                 unit: goodInfos[i].good_unit,
226
                 unit: goodInfos[i].good_unit,
225
                 price: goodInfos[i].retail_price,
227
                 price: goodInfos[i].retail_price,
226
                 type: 3,
228
                 type: 3,
227
-                m_id: 0
229
+                m_id: 0,
230
+                new_id: Math.floor((Math.random() + Math.floor(Math.random() * 9 + 1)) * Math.pow(10, 10 - 1))
231
+
228
 
232
 
229
               }
233
               }
230
               this.projectList.push(obj)
234
               this.projectList.push(obj)
336
       },
340
       },
337
       addProjectList() {
341
       addProjectList() {
338
         for (let i = 0; i < this.projectList.length; i++) {
342
         for (let i = 0; i < this.projectList.length; i++) {
339
-          if (this.form.project_detail == this.projectList[i].id) {
343
+          if (this.form.project_detail == this.projectList[i].new_id) {
340
             this.projectList[i].number = this.form.number
344
             this.projectList[i].number = this.form.number
341
             this.projectList[i].number = this.projectList[i].number.toString()
345
             this.projectList[i].number = this.projectList[i].number.toString()
342
             this.tableData.push(this.projectList[i])
346
             this.tableData.push(this.projectList[i])