Преглед изворни кода

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

csx пре 3 година
родитељ
комит
a18252b97e

+ 8 - 5
src/xt_pages/data/components/addInspection.vue Прегледај датотеку

@@ -49,9 +49,9 @@
49 49
                     <el-select v-model="form.project_detail" filterable placeholder="请选择" @change="changeProject">
50 50
                         <el-option
51 51
                                 v-for="item in projectList"
52
-                                :key="item.id"
52
+                                :key="item.new_id"
53 53
                                 :label="item.project_name"
54
-                                :value="item.id">
54
+                                :value="item.new_id">
55 55
                         </el-option>
56 56
                     </el-select>
57 57
                 </el-form-item>
@@ -257,7 +257,8 @@
257 257
                 project_name: projectList[i].project_name,
258 258
                 unit: projectList[i].unit,
259 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 263
               this.projectList.push(obj)
263 264
 
@@ -271,7 +272,9 @@
271 272
                 project_name: goodInfos[i].good_name,
272 273
                 unit: goodInfos[i].good_unit,
273 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 279
               this.projectList.push(obj)
277 280
             }
@@ -309,7 +312,7 @@
309 312
       addProjectList() {
310 313
         console.log(this.projectList)
311 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 316
             this.projectList[i].number = this.form.number
314 317
             this.projectList[i].number = this.projectList[i].number.toString()
315 318
             this.tableData.push(this.projectList[i])

+ 8 - 4
src/xt_pages/data/components/editInspection.vue Прегледај датотеку

@@ -50,7 +50,7 @@
50 50
                                 v-for="item,index in projectList"
51 51
                                 :key="index"
52 52
                                 :label="item.project_name"
53
-                                :value="item.id">
53
+                                :value="item.new_id">
54 54
                         </el-option>
55 55
                     </el-select>
56 56
 
@@ -209,7 +209,9 @@
209 209
                 unit: projectList[i].unit,
210 210
                 price: projectList[i].price,
211 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 216
               this.projectList.push(obj)
215 217
 
@@ -224,7 +226,9 @@
224 226
                 unit: goodInfos[i].good_unit,
225 227
                 price: goodInfos[i].retail_price,
226 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 234
               this.projectList.push(obj)
@@ -336,7 +340,7 @@
336 340
       },
337 341
       addProjectList() {
338 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 344
             this.projectList[i].number = this.form.number
341 345
             this.projectList[i].number = this.projectList[i].number.toString()
342 346
             this.tableData.push(this.projectList[i])