Bläddra i källkod

Merge branch 'superman' of http://git.shengws.com:3000/zhangbj/xt_vue into superman

zhengchengwu 6 år sedan
förälder
incheckning
5d64092323
31 ändrade filer med 1920 tillägg och 840 borttagningar
  1. 11 20
      src/xt_pages/data/components/table.vue
  2. 9 22
      src/xt_pages/data/components/tableson.vue
  3. 9 20
      src/xt_pages/data/components/templateTable.vue
  4. 55 114
      src/xt_pages/data/druguseTemplate.vue
  5. 1 2
      src/xt_pages/data/index.vue
  6. 5 4
      src/xt_pages/device/components/device_info/device_info_form.vue
  7. 5 5
      src/xt_pages/device/components/device_info/device_info_pane.vue
  8. 599 0
      src/xt_pages/device/components/device_info/edit_device_info_form.vue
  9. 163 132
      src/xt_pages/device/components/device_list.vue
  10. 628 0
      src/xt_pages/device/components/edit_device_dialog.vue
  11. 57 53
      src/xt_pages/device/main.vue
  12. 9 5
      src/xt_pages/stock/Dialog/goodInfoDailog.vue
  13. 9 6
      src/xt_pages/stock/Dialog/goodTypeDialog.vue
  14. 14 9
      src/xt_pages/stock/Dialog/manufacturerOrDealerDialog.vue
  15. 8 5
      src/xt_pages/stock/Dialog/salesReturnDialog.vue
  16. 9 7
      src/xt_pages/stock/Dialog/stockInDialog.vue
  17. 11 6
      src/xt_pages/stock/cancelStockOrderAdd.vue
  18. 13 19
      src/xt_pages/stock/cancelStockOrderEdit.vue
  19. 23 35
      src/xt_pages/stock/config/dealer.vue
  20. 23 35
      src/xt_pages/stock/config/goodInfo.vue
  21. 19 27
      src/xt_pages/stock/config/goodType.vue
  22. 149 216
      src/xt_pages/stock/config/manufacturer.vue
  23. 0 2
      src/xt_pages/stock/otherCancelStockOrder.vue
  24. 14 19
      src/xt_pages/stock/salesReturnEdit.vue
  25. 15 13
      src/xt_pages/stock/salesReturnOrderAdd.vue
  26. 16 12
      src/xt_pages/stock/stockInOrderAdd.vue
  27. 2 3
      src/xt_pages/stock/stockInOrderDetail.vue
  28. 16 16
      src/xt_pages/stock/stockInOrderEdit.vue
  29. 12 12
      src/xt_pages/stock/stockOutOrderAdd.vue
  30. 13 18
      src/xt_pages/stock/stockOutOrderEdit.vue
  31. 3 3
      src/xt_pages/user/components/PatientDetail.vue

+ 11 - 20
src/xt_pages/data/components/table.vue Visa fil

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div class="" style="margin-right:20px;">  
2
+  <div class="" style="margin-right:20px;">
3 3
     <el-table :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :key='tableKey' :data="list" v-loading="listLoading" border fit highlight-current-row @current-change="handleRowChange"
4 4
       >
5 5
       <el-table-column  align="center" label="名称">
@@ -211,16 +211,13 @@ export default {
211 211
             const result = response.data.data.dataconfig
212 212
             // 更新store
213 213
             store.dispatch('updateConfigList',result).then(() => {
214
-           
214
+
215 215
             })
216 216
 
217 217
             this.dialogFormVisible = false
218
-            this.$notify({
219
-              title: '成功',
220
-              message: '创建成功',
221
-              type: 'success',
222
-              duration: 2000
223
-            })
218
+
219
+            this.$message.success("创建成功")
220
+
224 221
           })
225 222
         }
226 223
       })
@@ -248,23 +245,17 @@ export default {
248 245
               }
249 246
             }
250 247
             this.dialogFormVisible = false
251
-            this.$notify({
252
-              title: '成功',
253
-              message: '更新成功',
254
-              type: 'success',
255
-              duration: 2000
256
-            })
248
+
249
+            this.$message.success("更新成功")
250
+
257 251
           })
258 252
         }
259 253
       })
260 254
     },
261 255
     handleDelete(row) {
262
-      this.$notify({
263
-        title: '成功',
264
-        message: '删除成功',
265
-        type: 'success',
266
-        duration: 2000
267
-      })
256
+
257
+      this.$message.success("删除成功")
258
+
268 259
       const index = this.list.indexOf(row)
269 260
       this.list.splice(index, 1)
270 261
     },

+ 9 - 22
src/xt_pages/data/components/tableson.vue Visa fil

@@ -4,7 +4,7 @@
4 4
       <el-button class="filter-item" size="small" :disabled="addState"  @click="handleCreate" type="primary" icon="el-icon-circle-plus-outline">{{$t('table.add')}}</el-button>
5 5
     </div>
6 6
 
7
-    <el-table :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :key='tableKey' :data="list" v-loading="listLoading" border fit highlight-current-row 
7
+    <el-table :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :key='tableKey' :data="list" v-loading="listLoading" border fit highlight-current-row
8 8
       style="width: 100%;min-height:500px;">
9 9
       <el-table-column  align="center" label="名称">
10 10
         <template slot-scope="scope">
@@ -22,7 +22,7 @@
22 22
           <el-button icon="el-icon-delete" v-if="scope.row.status!='deleted'" size="small" type="danger" @click="handleModifyStatus(scope.row,'deleted')">
23 23
           </el-button>
24 24
          </el-tooltip>
25
-         
25
+
26 26
         </template>
27 27
       </el-table-column>
28 28
     </el-table>
@@ -291,16 +291,11 @@ export default {
291 291
             // this.list.unshift(tempval)
292 292
             // 更新store
293 293
             store.dispatch("updateChildConfigList", [result, "create"]).then(() => {
294
-               
294
+
295 295
             });
296 296
 
297 297
             this.dialogFormVisible = false;
298
-            this.$notify({
299
-              title: "成功",
300
-              message: "创建成功",
301
-              type: "success",
302
-              duration: 2000
303
-            });
298
+           this.$message.success("创建成功")
304 299
           });
305 300
         }
306 301
       });
@@ -328,27 +323,19 @@ export default {
328 323
 
329 324
             const result = response.data.data.dataconfig;
330 325
             store.dispatch("updateChildConfigList", [result, "update"]).then(() => {
331
-             
326
+
332 327
             });
333 328
 
334 329
             this.dialogFormVisible = false;
335
-            this.$notify({
336
-              title: "成功",
337
-              message: "更新成功",
338
-              type: "success",
339
-              duration: 2000
340
-            });
330
+
331
+            this.$message.success("更新成功")
332
+
341 333
           });
342 334
         }
343 335
       });
344 336
     },
345 337
     handleDelete(row) {
346
-      this.$notify({
347
-        title: "成功",
348
-        message: "删除成功",
349
-        type: "success",
350
-        duration: 2000
351
-      });
338
+      this.$message.success("删除成功")
352 339
       const index = this.list.indexOf(row);
353 340
       this.list.splice(index, 1);
354 341
     },

+ 9 - 20
src/xt_pages/data/components/templateTable.vue Visa fil

@@ -29,7 +29,7 @@
29 29
             <el-button icon="el-icon-delete" v-if="scope.row.status!='deleted'" size="small" type="danger" @click="handleModifyStatus(scope.row,'deleted')">
30 30
             </el-button>
31 31
           </el-tooltip>
32
-          
32
+
33 33
 
34 34
         </template>
35 35
       </el-table-column>
@@ -258,16 +258,12 @@ export default {
258 258
             const result = response.data.data.dataconfig
259 259
             // 更新store
260 260
             store.dispatch('updateConfigList',result).then(() => {
261
-           
261
+
262 262
             })
263 263
 
264 264
             this.dialogFormVisible = false
265
-            this.$notify({
266
-              title: '成功',
267
-              message: '创建成功',
268
-              type: 'success',
269
-              duration: 2000
270
-            })
265
+
266
+            this.$message.success("创建成功")
271 267
           })
272 268
         }
273 269
       })
@@ -299,23 +295,16 @@ export default {
299 295
               });
300 296
 
301 297
             this.dialogFormVisible = false;
302
-            this.$notify({
303
-              title: "成功",
304
-              message: "更新成功",
305
-              type: "success",
306
-              duration: 2000
307
-            });
298
+
299
+            this.$message.success("更新成功")
308 300
           });
309 301
         }
310 302
       });
311 303
     },
312 304
     handleDelete(row) {
313
-      this.$notify({
314
-        title: '成功',
315
-        message: '删除成功',
316
-        type: 'success',
317
-        duration: 2000
318
-      })
305
+
306
+      this.$message.success("删除成功")
307
+
319 308
       const index = this.list.indexOf(row)
320 309
       this.list.splice(index, 1)
321 310
     },

+ 55 - 114
src/xt_pages/data/druguseTemplate.vue Visa fil

@@ -1203,6 +1203,7 @@
1203 1203
         this.isEdit = false;
1204 1204
         this.parent_id = 0;
1205 1205
         this.isAddChild = false
1206
+        this.templateTableVisible = false
1206 1207
         this.templateFormVisible = true;
1207 1208
 
1208 1209
       }, deleteRecordAction: function () {
@@ -1271,12 +1272,9 @@
1271 1272
             return false;
1272 1273
           } else {
1273 1274
 
1274
-            this.$notify({
1275
-              title: "成功",
1276
-              message: "添加模版成功",
1277
-              type: "success",
1278
-              duration: 2000
1279
-            });
1275
+
1276
+            this.$message.success("添加模版成功")
1277
+
1280 1278
 
1281 1279
             var template = response.data.data.template
1282 1280
             if (template.DoctorAdviceTemplate.length > 0) {
@@ -1318,12 +1316,7 @@
1318 1316
                 this.$message.error(response.data.msg);
1319 1317
                 return false;
1320 1318
               } else {
1321
-                this.$notify({
1322
-                  title: "成功",
1323
-                  message: "医嘱模板已经删除",
1324
-                  type: "success",
1325
-                  duration: 2000
1326
-                });
1319
+                this.$message.success("删除成功")
1327 1320
                 this.drugdics.splice(index, 1);
1328 1321
               }
1329 1322
             });
@@ -1343,12 +1336,8 @@
1343 1336
                 this.$message.error(response.data.msg);
1344 1337
                 return false;
1345 1338
               } else {
1346
-                this.$notify({
1347
-                  title: "成功",
1348
-                  message: "医嘱模板已经删除",
1349
-                  type: "success",
1350
-                  duration: 2000
1351
-                });
1339
+                
1340
+                this.$message.success("删除成功")
1352 1341
 
1353 1342
                 // console.log(this.adviceTemplates.length)
1354 1343
                 // for(let i = 0;i < this.adviceTemplates.length; i++){
@@ -1373,12 +1362,9 @@
1373 1362
                     this.$message.error(response.data.msg);
1374 1363
                     return false;
1375 1364
                   } else {
1376
-                    this.$notify({
1377
-                      title: "成功",
1378
-                      message: "修改成功",
1379
-                      type: "success",
1380
-                      duration: 2000
1381
-                    });
1365
+
1366
+                    this.$message.success("修改成功")
1367
+
1382 1368
                     this.drugdicFormVisible = false;
1383 1369
                     this.resetForm(formName);
1384 1370
                     var drugdic = response.data.data.drugdic;
@@ -1402,12 +1388,9 @@
1402 1388
                   this.$message.error(response.data.msg);
1403 1389
                   return false;
1404 1390
                 } else {
1405
-                  this.$notify({
1406
-                    title: "成功",
1407
-                    message: "添加成功",
1408
-                    type: "success",
1409
-                    duration: 2000
1410
-                  });
1391
+
1392
+                  this.$message.success("添加成功")
1393
+
1411 1394
                   this.drugdicFormVisible = false;
1412 1395
                   this.resetForm(formName);
1413 1396
                   this.drugdics.unshift(response.data.data.drugdic);
@@ -1451,12 +1434,8 @@
1451 1434
                   this.$message.error(response.data.msg);
1452 1435
                   return false;
1453 1436
                 } else {
1454
-                  this.$notify({
1455
-                    title: "成功",
1456
-                    message: "添加成功",
1457
-                    type: "success",
1458
-                    duration: 2000
1459
-                  });
1437
+
1438
+                  this.$message.success("添加成功")
1460 1439
 
1461 1440
                   var spliceIndex = -1;
1462 1441
                   for (let index = this.adviceTemplates.length - 1; ; index--) {
@@ -1564,12 +1543,9 @@
1564 1543
                     this.$message.error(response.data.msg);
1565 1544
                     return false;
1566 1545
                   } else {
1567
-                    this.$notify({
1568
-                      title: "成功",
1569
-                      message: "修改成功",
1570
-                      type: "success",
1571
-                      duration: 2000
1572
-                    });
1546
+
1547
+                    this.$message.success("修改成功")
1548
+
1573 1549
                     this.drugwayFormVisible = false;
1574 1550
                     this.resetForm(formName);
1575 1551
                     var drugway = response.data.data.drugway;
@@ -1587,12 +1563,8 @@
1587 1563
                   this.$message.error(response.data.msg);
1588 1564
                   return false;
1589 1565
                 } else {
1590
-                  this.$notify({
1591
-                    title: "成功",
1592
-                    message: "添加成功",
1593
-                    type: "success",
1594
-                    duration: 2000
1595
-                  });
1566
+
1567
+                  this.$message.success("添加成功")
1596 1568
                   this.drugwayFormVisible = false;
1597 1569
                   this.resetForm(formName);
1598 1570
                   this.drugways.unshift(response.data.data.drugway);
@@ -1615,12 +1587,9 @@
1615 1587
                 this.$message.error(response.data.msg);
1616 1588
                 return false;
1617 1589
               } else {
1618
-                this.$notify({
1619
-                  title: "成功",
1620
-                  message: "给药途径已经删除",
1621
-                  type: "success",
1622
-                  duration: 2000
1623
-                });
1590
+
1591
+                this.$message.success("删除成功")
1592
+
1624 1593
                 this.drugways.splice(index, 1);
1625 1594
               }
1626 1595
             });
@@ -1658,12 +1627,9 @@
1658 1627
                     this.$message.error(response.data.msg);
1659 1628
                     return false;
1660 1629
                   } else {
1661
-                    this.$notify({
1662
-                      title: "成功",
1663
-                      message: "修改成功",
1664
-                      type: "success",
1665
-                      duration: 2000
1666
-                    });
1630
+
1631
+                    this.$message.success("修改成功")
1632
+
1667 1633
                     this.efFormVisible = false;
1668 1634
                     this.resetForm(formName);
1669 1635
                     var ef = response.data.data.ef;
@@ -1683,12 +1649,9 @@
1683 1649
                   this.$message.error(response.data.msg);
1684 1650
                   return false;
1685 1651
                 } else {
1686
-                  this.$notify({
1687
-                    title: "成功",
1688
-                    message: "添加成功",
1689
-                    type: "success",
1690
-                    duration: 2000
1691
-                  });
1652
+
1653
+                  this.$message.error("添加成功");
1654
+
1692 1655
                   this.efFormVisible = false;
1693 1656
                   this.resetForm(formName);
1694 1657
                   this.executionFrequencyOptions.unshift(response.data.data.ef);
@@ -1711,12 +1674,9 @@
1711 1674
                 this.$message.error(response.data.msg);
1712 1675
                 return false;
1713 1676
               } else {
1714
-                this.$notify({
1715
-                  title: "成功",
1716
-                  message: "执行频率已经删除",
1717
-                  type: "success",
1718
-                  duration: 2000
1719
-                });
1677
+
1678
+                this.$message.error("删除成功");
1679
+
1720 1680
                 this.executionFrequencyOptions.splice(index, 1);
1721 1681
               }
1722 1682
             });
@@ -1771,6 +1731,7 @@
1771 1731
         }
1772 1732
         return true;
1773 1733
       }, cancelEditHandle() {
1734
+        this.templateTableVisible = true
1774 1735
         this.templateEditFormVisible = false;
1775 1736
       }, submitEditTemplate(formName) {
1776 1737
         this.$refs[formName].validate(valid => {
@@ -1790,12 +1751,8 @@
1790 1751
                   this.$message.error(response.data.msg);
1791 1752
                   return false;
1792 1753
                 } else {
1793
-                  this.$notify({
1794
-                    title: "成功",
1795
-                    message: "修改成功",
1796
-                    type: "success",
1797
-                    duration: 2000
1798
-                  });
1754
+
1755
+                  this.$message.success("修改成功")
1799 1756
                   this.templateEditFormVisible = false;
1800 1757
                   this.resetForm(formName);
1801 1758
                   var template = response.data.data.template;
@@ -1860,12 +1817,10 @@
1860 1817
               this.$message.error(response.data.msg);
1861 1818
               return false;
1862 1819
             } else {
1863
-              this.$notify({
1864
-                title: "成功",
1865
-                message: "医嘱模板已经删除",
1866
-                type: "success",
1867
-                duration: 2000
1868
-              });
1820
+
1821
+
1822
+              this.$message.success("删除成功")
1823
+
1869 1824
 
1870 1825
               for (let i = 0; i < this.adviceTemplates.length; i++) {
1871 1826
                 console.log(this.adviceTemplates[i].id)
@@ -1939,12 +1894,9 @@
1939 1894
             this.resetForm(formName);
1940 1895
             this.templateFormTwoVisible = false
1941 1896
 
1942
-            this.$notify({
1943
-              title: "成功",
1944
-              message: "添加成功",
1945
-              type: "success",
1946
-              duration: 2000
1947
-            });
1897
+
1898
+            this.$message.success("添加成功")
1899
+
1948 1900
 
1949 1901
             return false;
1950 1902
           }
@@ -1973,12 +1925,10 @@
1973 1925
                   this.$message.error(response.data.msg);
1974 1926
                   return false;
1975 1927
                 } else {
1976
-                  this.$notify({
1977
-                    title: "成功",
1978
-                    message: "修改成功",
1979
-                    type: "success",
1980
-                    duration: 2000
1981
-                  });
1928
+
1929
+                  this.$message.success("修改成功")
1930
+
1931
+
1982 1932
                   this.templateEditFormTwoVisible = false;
1983 1933
                   this.resetForm(formName);
1984 1934
                   var template = response.data.data.template;
@@ -2102,12 +2052,9 @@
2102 2052
               this.$message.error(response.data.msg);
2103 2053
               return false;
2104 2054
             } else {
2105
-              this.$notify({
2106
-                title: "成功",
2107
-                message: "医嘱已经删除",
2108
-                type: "success",
2109
-                duration: 2000
2110
-              });
2055
+
2056
+              this.$message.success("删除成功")
2057
+
2111 2058
 
2112 2059
               if (row.parent_id > 0) { //删除子医嘱
2113 2060
                 this.adviceTemplates.splice(index, 1)
@@ -2162,12 +2109,9 @@
2162 2109
               this.$message.error(response.data.msg);
2163 2110
               return false;
2164 2111
             } else {
2165
-              this.$notify({
2166
-                title: "成功",
2167
-                message: "医嘱已经删除",
2168
-                type: "success",
2169
-                duration: 2000
2170
-              });
2112
+
2113
+              this.$message.success("删除成功")
2114
+
2171 2115
 
2172 2116
               if (row.parent_id > 0) { //删除子医嘱
2173 2117
                 this.adviceTemplates.splice(index, 1)
@@ -2294,12 +2238,9 @@
2294 2238
             this.$message.error(response.data.msg);
2295 2239
             return false;
2296 2240
           } else {
2297
-            this.$notify({
2298
-              title: "成功",
2299
-              message: "修改成功",
2300
-              type: "success",
2301
-              duration: 2000
2302
-            });
2241
+
2242
+            this.$message.success("修改成功")
2243
+
2303 2244
             this.templateTableTwoVisible = false;
2304 2245
 
2305 2246
             for (let i = 0; i < this.adviceTemplates.length; i++) {

+ 1 - 2
src/xt_pages/data/index.vue Visa fil

@@ -2,7 +2,6 @@
2 2
 <div class="main-contain">
3 3
   <div class="position">
4 4
     <bread-crumb :crumbs='crumbs'></bread-crumb>
5
-
6 5
   </div>
7 6
   <div class="app-container">
8 7
     <el-tabs  v-model="activeName" >
@@ -47,7 +46,7 @@ export default {
47 46
   methods: {
48 47
     showCreatedTimes() {
49 48
       this.createdTimes = this.createdTimes + 1
50
-    }
49
+    },
51 50
   }
52 51
 }
53 52
 </script>

+ 5 - 4
src/xt_pages/device/components/device_info/device_info_form.vue Visa fil

@@ -374,7 +374,7 @@ export default {
374 374
         }
375 375
     },
376 376
     created() {
377
-        
377
+
378 378
     },
379 379
     methods: {
380 380
         clear() {
@@ -405,7 +405,8 @@ export default {
405 405
             this.form.reverse_osmosis_mode = ''
406 406
         },
407 407
         set_device_id: function(device_id) {
408
-            if (device_id > 0) {
408
+
409
+          if (device_id > 0) {
409 410
                 this.device_id = device_id
410 411
                 getDeviceBaseInfo(device_id).then(rs => {
411 412
                     var resp = rs.data
@@ -436,7 +437,7 @@ export default {
436 437
                         this.form.working_time = device_info.working_time == 0 ? '' : device_info.working_time
437 438
                         if (this.form.device_type == 1) {
438 439
                             // treatment_mode: []
439
-                            
440
+
440 441
                         } else if (this.form.device_type == 2) {
441 442
                             // reverse_osmosis_mode: ''
442 443
                         }
@@ -445,7 +446,7 @@ export default {
445 446
                         this.$message.error(resp.msg)
446 447
                     }
447 448
                 })
448
-                
449
+
449 450
             } else {
450 451
                 this.clear()
451 452
             }

+ 5 - 5
src/xt_pages/device/components/device_info/device_info_pane.vue Visa fil

@@ -1,8 +1,8 @@
1 1
 <template>
2 2
     <div>
3
-        <div style="padding-top: 10px;">
4
-            <device-info-form ref="device_info_form" :device_numbers="device_numbers" @did_update="did_update_device"></device-info-form>
5
-        </div>
3
+      <div style="padding-top: 10px;">
4
+         <device-info-form ref="device_info_form" :device_numbers="device_numbers" @did_update="did_update_device"></device-info-form>
5
+      </div>
6 6
         <div style="text-align: right; padding-right: 25px; padding-top: 10px; padding-bottom: 10px;">
7 7
             <el-button type="primary" :disabled="$store.getters.xt_user.subscibe.state==3?true:false" @click="modify_submit">保 存</el-button>
8 8
         </div>
@@ -25,7 +25,7 @@ export default {
25 25
     },
26 26
     methods: {
27 27
         set_device_id: function(device_id) {
28
-            this.$refs.device_info_form.set_device_id(device_id)
28
+          this.$refs.device_info_form.set_device_id(device_id)
29 29
         },
30 30
         modify_submit: function() {
31 31
             this.$refs.device_info_form.update_device_submit()
@@ -58,7 +58,7 @@ export default {
58 58
     height: 32px;
59 59
     line-height: 32px;
60 60
     display: block;
61
-    
61
+
62 62
 }
63 63
 .required_span {
64 64
     color: red;

+ 599 - 0
src/xt_pages/device/components/device_info/edit_device_info_form.vue Visa fil

@@ -0,0 +1,599 @@
1
+<template>
2
+  <div class="main">
3
+    <!-- 第一行 -->
4
+    <el-row>
5
+      <el-col :span="8">
6
+        <div class="col_div">
7
+          <el-col :span="layout.first_line_label">
8
+            <span class="col_label_span"><span class="required_span">*&nbsp;</span>序列号:</span>
9
+          </el-col>
10
+          <el-col :span="layout.first_line_content">
11
+            <el-input size="small" v-model="form.serial_number"></el-input>
12
+          </el-col>
13
+        </div>
14
+      </el-col>
15
+      <el-col :span="8">
16
+        <div class="col_div">
17
+          <el-col :span="layout.second_line_label">
18
+            <span class="col_label_span"><span class="required_span">*&nbsp;</span>设备类型:</span>
19
+          </el-col>
20
+          <el-col :span="layout.second_line_content" >
21
+            <el-select v-model="form.device_type" size="small" :disabled="device_id != 0" style="width:100%;">
22
+              <el-option v-for="item in device_types" :key="item.id" :label="item.name" :value="item.id"></el-option>
23
+            </el-select>
24
+          </el-col>
25
+        </div>
26
+      </el-col>
27
+      <el-col :span="8">
28
+        <div class="col_div">
29
+          <el-col :span="layout.third_line_label">
30
+            <span class="col_label_span">床位号:</span>
31
+          </el-col>
32
+          <el-col :span="layout.third_line_content">
33
+            <el-select v-model="form.device_number_id" clearable size="small" style="width:100%;">
34
+              <el-option v-for="item in device_numbers" :key="item.id" :label="item.number" :value="item.id"></el-option>
35
+            </el-select>
36
+          </el-col>
37
+        </div>
38
+      </el-col>
39
+    </el-row>
40
+    <!-- 第二行 -->
41
+    <el-row>
42
+      <el-col :span="8">
43
+        <div class="col_div">
44
+          <el-col :span="layout.first_line_label">
45
+            <span class="col_label_span"><span class="required_span">*&nbsp;</span>设备名称:</span>
46
+          </el-col>
47
+          <el-col :span="layout.first_line_content">
48
+            <el-input size="small" v-model="form.name"></el-input>
49
+          </el-col>
50
+        </div>
51
+      </el-col>
52
+      <el-col :span="8">
53
+        <div class="col_div">
54
+          <el-col :span="layout.second_line_label">
55
+            <span class="col_label_span">生产厂家:</span>
56
+          </el-col>
57
+          <el-col :span="layout.second_line_content">
58
+            <el-input size="small" v-model="form.manufacturer"></el-input>
59
+          </el-col>
60
+        </div>
61
+      </el-col>
62
+      <el-col :span="8">
63
+        <div class="col_div">
64
+          <el-col :span="layout.third_line_label">
65
+            <span class="col_label_span">维修厂家:</span>
66
+          </el-col>
67
+          <el-col :span="layout.third_line_content">
68
+            <el-input size="small" v-model="form.repair_factory"></el-input>
69
+          </el-col>
70
+        </div>
71
+      </el-col>
72
+    </el-row>
73
+    <!-- 第三行 -->
74
+    <el-row>
75
+      <el-col :span="8">
76
+        <div class="col_div">
77
+          <el-col :span="layout.first_line_label">
78
+            <span class="col_label_span">设备型号:</span>
79
+          </el-col>
80
+          <el-col :span="layout.first_line_content">
81
+            <el-input size="small" v-model="form.model"></el-input>
82
+          </el-col>
83
+        </div>
84
+      </el-col>
85
+      <el-col :span="8">
86
+        <div class="col_div">
87
+          <el-col :span="layout.second_line_label">
88
+            <span class="col_label_span">使用科室:</span>
89
+          </el-col>
90
+          <el-col :span="layout.second_line_content">
91
+            <el-input size="small" v-model="form.department"></el-input>
92
+          </el-col>
93
+        </div>
94
+      </el-col>
95
+      <el-col :span="8">
96
+        <div class="col_div">
97
+          <el-col :span="layout.third_line_label">
98
+            <span class="col_label_span">科室编号:</span>
99
+          </el-col>
100
+          <el-col :span="layout.third_line_content">
101
+            <el-input size="small" v-model="form.department_number"></el-input>
102
+          </el-col>
103
+        </div>
104
+      </el-col>
105
+    </el-row>
106
+    <!-- 第四行 -->
107
+    <el-row>
108
+      <el-col :span="8">
109
+        <div class="col_div">
110
+          <el-col :span="layout.first_line_label">
111
+            <span class="col_label_span">购买日期:</span>
112
+          </el-col>
113
+          <el-col :span="layout.first_line_content">
114
+            <el-date-picker v-model="form.purchase_date" type="date" value-format="timestamp" size="small" style="width: 100%;"></el-date-picker>
115
+          </el-col>
116
+        </div>
117
+      </el-col>
118
+      <el-col :span="8">
119
+        <div class="col_div">
120
+          <el-col :span="layout.second_line_label">
121
+            <span class="col_label_span">安装日期:</span>
122
+          </el-col>
123
+          <el-col :span="layout.second_line_content">
124
+            <el-date-picker v-model="form.install_date" type="date" value-format="timestamp" size="small" style="width: 100%;"></el-date-picker>
125
+          </el-col>
126
+        </div>
127
+      </el-col>
128
+      <el-col :span="8">
129
+        <div class="col_div">
130
+          <el-col :span="layout.third_line_label">
131
+            <span class="col_label_span">启用日期:</span>
132
+          </el-col>
133
+          <el-col :span="layout.third_line_content">
134
+            <el-date-picker v-model="form.commissioning_date" value-format="timestamp" type="date" size="small" style="width: 100%;"></el-date-picker>
135
+          </el-col>
136
+        </div>
137
+      </el-col>
138
+    </el-row>
139
+    <!-- 第五行 -->
140
+    <el-row>
141
+      <el-col :span="8">
142
+        <div class="col_div">
143
+          <el-col :span="layout.first_line_label">
144
+            <span class="col_label_span">维修工程师:</span>
145
+          </el-col>
146
+          <el-col :span="layout.first_line_content">
147
+            <el-input size="small" v-model="form.maintainer"></el-input>
148
+          </el-col>
149
+        </div>
150
+      </el-col>
151
+      <el-col :span="8">
152
+        <div class="col_div">
153
+          <el-col :span="layout.second_line_label">
154
+            <span class="col_label_span">联系电话:</span>
155
+          </el-col>
156
+          <el-col :span="layout.second_line_content">
157
+            <el-input size="small" v-model="form.maintenance_call"></el-input>
158
+          </el-col>
159
+        </div>
160
+      </el-col>
161
+      <el-col :span="8">
162
+        <div class="col_div">
163
+          <el-col :span="layout.third_line_label">
164
+            <span class="col_label_span">保修期限:</span>
165
+          </el-col>
166
+          <el-col :span="layout.third_line_content">
167
+            <el-input size="small" v-model="form.warranty_period"></el-input>
168
+          </el-col>
169
+        </div>
170
+      </el-col>
171
+    </el-row>
172
+    <!-- 第六行 -->
173
+    <!-- <el-row>
174
+        <el-col :span="8">
175
+            <div class="col_div">
176
+                <el-col :span="9">
177
+                    <span class="col_label_span">机器状态:</span>
178
+                </el-col>
179
+                <el-col :span="15">
180
+                    <el-select v-model="form.device_status" clearable size="small">
181
+                        <el-option v-for="item in device_states" :key="item.state" :label="item.name" :value="item.state"></el-option>
182
+                    </el-select>
183
+                </el-col>
184
+            </div>
185
+        </el-col>
186
+        <el-col :span="8">
187
+            <div class="col_div">
188
+                <el-col :span="10">
189
+                    <span class="col_label_span">初始使用次数:</span>
190
+                </el-col>
191
+                <el-col :span="14">
192
+                    <el-input v-model="form.initial_use_times" style="width: 100%;"></el-input>
193
+                </el-col>
194
+            </div>
195
+        </el-col>
196
+        <el-col :span="8">
197
+            <div class="col_div">
198
+                <el-col :span="7">
199
+                    <span class="col_label_span">备&nbsp;&nbsp;&nbsp;注:</span>
200
+                </el-col>
201
+                <el-col :span="17">
202
+                    <el-input size="small" v-model="form.mark"></el-input>
203
+                </el-col>
204
+            </div>
205
+        </el-col>
206
+    </el-row> -->
207
+    <!-- 第七行 -->
208
+    <!-- <el-row>
209
+        <el-col :span="7">
210
+            <div class="col_div">
211
+                <el-col :span="8">
212
+                    <span class="col_label_span">报废日期:</span>
213
+                </el-col>
214
+                <el-col :span="16">
215
+                    <el-date-picker v-model="form.retirement_date" type="date" value-format="timestamp" size="small" style="width: 140px;"></el-date-picker>
216
+                </el-col>
217
+            </div>
218
+        </el-col>
219
+        <el-col :span="7">
220
+            <div class="col_div">
221
+                <el-col :span="8">
222
+                    <span class="col_label_span">报废原因:</span>
223
+                </el-col>
224
+                <el-col :span="16">
225
+                    <el-select v-model="form.retirement_reason" clearable size="small">
226
+                        <el-option v-for="item in retirement_reasons" :key="item.id" :label="item.reason" :value="item.reason"></el-option>
227
+                    </el-select>
228
+                </el-col>
229
+            </div>
230
+        </el-col>
231
+        <el-col :span="5">
232
+            <div class="col_div">
233
+                <el-col :span="15">
234
+                    <span class="col_label_span">使用年限(年):</span>
235
+                </el-col>
236
+                <el-col :span="9">
237
+                    <el-input size="small" v-model="form.service_life"></el-input>
238
+                </el-col>
239
+            </div>
240
+        </el-col>
241
+        <el-col :span="5">
242
+            <div class="col_div">
243
+                <el-col :span="14">
244
+                    <span class="col_label_span">工作时长(h):</span>
245
+                </el-col>
246
+                <el-col :span="10">
247
+                    <el-input size="small" v-model="form.working_time"></el-input>
248
+                </el-col>
249
+            </div>
250
+        </el-col>
251
+    </el-row> -->
252
+    <!-- 治疗模式 -->
253
+    <el-row v-show="false && form.device_type === 1">
254
+      <el-col :span="24">
255
+        <div class="col_div">
256
+          <el-col :span="3">
257
+            <div style="padding-left: 5px;">
258
+              <span class="col_label_span" style="line-height: auto; padding-left: 0; text-align: left;">治疗模式:</span>
259
+              <el-checkbox label="全选"></el-checkbox>
260
+            </div>
261
+          </el-col>
262
+          <el-col :span="21">
263
+            <div style="margin-top: 6px;"></div>
264
+            <el-checkbox-group v-model="form.treatment_mode">
265
+              <el-checkbox v-for="item in cure_types" :label="item.id" :key="item.id" :value="item.id">{{ item.name }}</el-checkbox>
266
+            </el-checkbox-group>
267
+          </el-col>
268
+        </div>
269
+      </el-col>
270
+    </el-row>
271
+    <!-- 反渗模式 -->
272
+    <el-row v-show="false && form.device_type === 2">
273
+      <el-col :span="8">
274
+        <div class="col_div">
275
+          <el-col :span="layout.first_line_label">
276
+            <span class="col_label_span">反渗模式:</span>
277
+          </el-col>
278
+          <el-col :span="layout.first_line_content">
279
+            <el-select v-model="form.reverse_osmosis_mode" clearable size="small">
280
+              <el-option v-for="item in reverse_osmosises" :key="item.id" :label="item.name" :value="item.id"></el-option>
281
+            </el-select>
282
+          </el-col>
283
+        </div>
284
+      </el-col>
285
+    </el-row>
286
+  </div>
287
+</template>
288
+
289
+<script>
290
+  import {getDeviceBaseInfo, createDevice, modifyDeviceBaseInfo} from '@/api/device/device'
291
+
292
+  export default {
293
+    name: "EditDeviceInfoForm",
294
+    data() {
295
+      return {
296
+        layout: {
297
+          first_line_label: 8,
298
+          first_line_content: 16,
299
+          second_line_label: 8,
300
+          second_line_content: 16,
301
+          third_line_label: 8,
302
+          third_line_content: 16,
303
+        },
304
+        device_id: 0,
305
+        form: {
306
+          device_type: 1,
307
+          serial_number: '',
308
+          name: '',
309
+          device_number_id: '',
310
+          manufacturer: '',
311
+          repair_factory: '',
312
+          model: '',
313
+          department: '',
314
+          department_number: '',
315
+          purchase_date: '',
316
+          install_date: '',
317
+          commissioning_date: '',
318
+          maintainer: '',
319
+          maintenance_call: '',
320
+          warranty_period: '',
321
+          device_status: '',
322
+          initial_use_times: '',
323
+          mark: '',
324
+          retirement_date: '',
325
+          retirement_reason: '',
326
+          service_life: '',
327
+          working_time: '',
328
+          treatment_mode: [], // 治疗模式
329
+          reverse_osmosis_mode: '', // 反渗模式
330
+        },
331
+        device_types: [
332
+          { id: 1, name: "透析机" },
333
+          // { id: 2, name: "水处理机" },
334
+        ],
335
+        cure_types: [ // 治疗模式
336
+          // { id:1, name: "HD" },
337
+          // { id:2, name: "HDF" },
338
+          // { id:3, name: "HD+HP" },
339
+          // { id:4, name: "HP" },
340
+          // { id:5, name: "HF" },
341
+          // { id:10, name: "HD" },
342
+          // { id:20, name: "HDF" },
343
+          // { id:30, name: "HD+HP" },
344
+          // { id:40, name: "HP" },
345
+          // { id:50, name: "HF" },
346
+          // { id:300, name: "HD+HP" },
347
+        ],
348
+        reverse_osmosises: [ // 反渗模式
349
+          // { id:1, name: "单级反渗" }
350
+        ],
351
+        device_states: [
352
+          { state: 1, name: '使用机' },
353
+          { state: 2, name: '备用机' },
354
+          { state: 3, name: '急诊机' },
355
+          { state: 4, name: '报废机' },
356
+        ],
357
+        retirement_reasons: [
358
+          { id: 1, reason: '报废原因1' },
359
+          { id: 2, reason: '报废原因2' },
360
+          { id: 3, reason: '报废原因3' },
361
+          { id: 4, reason: '报废原因4' },
362
+          { id: 5, reason: '其他' },
363
+        ]
364
+      }
365
+    },
366
+    props: {
367
+      // device_id: {
368
+      //     type: Number,
369
+      //     require: false,
370
+      // },
371
+      device_numbers: {
372
+        type: Array,
373
+        require: true,
374
+      }
375
+    },
376
+    created() {
377
+
378
+    },
379
+    methods: {
380
+      clear() {
381
+        this.device_id = 0
382
+        this.form.device_type = 1
383
+        this.form.serial_number = ''
384
+        this.form.name = ''
385
+        this.form.device_number_id = ''
386
+        this.form.manufacturer = ''
387
+        this.form.repair_factory = ''
388
+        this.form.model = ''
389
+        this.form.department = ''
390
+        this.form.department_number = ''
391
+        this.form.purchase_date = 0
392
+        this.form.install_date = 0
393
+        this.form.commissioning_date = 0
394
+        this.form.maintainer = ''
395
+        this.form.maintenance_call = ''
396
+        this.form.warranty_period = ''
397
+        this.form.device_status = ''
398
+        this.form.initial_use_times = ''
399
+        this.form.mark = ''
400
+        this.form.retirement_date = 0
401
+        this.form.retirement_reason = ''
402
+        this.form.service_life = ''
403
+        this.form.working_time = ''
404
+        this.form.treatment_mode = []
405
+        this.form.reverse_osmosis_mode = ''
406
+      },
407
+      set_device_id: function(device_id) {
408
+        console.log(device_id+"-----")
409
+        if (device_id > 0) {
410
+          this.device_id = device_id
411
+          getDeviceBaseInfo(device_id).then(rs => {
412
+            var resp = rs.data
413
+            if (resp.state === 1) {
414
+              this.form.device_type = resp.data.device_type
415
+              this.form.device_number_id = resp.data.device_number_id == 0 ? '' : resp.data.device_number_id
416
+
417
+              var device_info = resp.data.device_info
418
+              this.form.serial_number = device_info.serial_number
419
+              this.form.name = device_info.name
420
+              this.form.manufacturer = device_info.manufacturer
421
+              this.form.repair_factory = device_info.repair_factory
422
+              this.form.model = device_info.model
423
+              this.form.department = device_info.department
424
+              this.form.department_number = device_info.department_number
425
+              this.form.purchase_date = device_info.purchase_date == 0 ? '' : (device_info.purchase_date * 1000)
426
+              this.form.install_date = device_info.install_date == 0 ? '' : (device_info.install_date * 1000)
427
+              this.form.commissioning_date = device_info.commissioning_date == 0 ? '' : (device_info.commissioning_date * 1000)
428
+              this.form.maintainer = device_info.maintainer
429
+              this.form.maintenance_call = device_info.maintenance_call
430
+              this.form.warranty_period = device_info.warranty_period
431
+              this.form.device_status = device_info.device_status == 0 ? '' : device_info.device_status
432
+              this.form.initial_use_times = device_info.initial_use_times == 0 ? '' : device_info.initial_use_times
433
+              this.form.mark = device_info.mark
434
+              this.form.retirement_date = device_info.retirement_date == 0 ? '' : (device_info.retirement_date * 1000)
435
+              this.form.retirement_reason = device_info.retirement_reason
436
+              this.form.service_life = device_info.service_life == 0 ? '' : device_info.service_life
437
+              this.form.working_time = device_info.working_time == 0 ? '' : device_info.working_time
438
+              if (this.form.device_type == 1) {
439
+                // treatment_mode: []
440
+
441
+              } else if (this.form.device_type == 2) {
442
+                // reverse_osmosis_mode: ''
443
+              }
444
+
445
+            } else {
446
+              this.$message.error(resp.msg)
447
+            }
448
+          })
449
+
450
+        } else {
451
+          this.clear()
452
+        }
453
+      },
454
+      create_device_submit() {
455
+        var checkErr = this._check_submit()
456
+        if (checkErr.length > 0) {
457
+          this.$message.error(checkErr)
458
+          return
459
+        }
460
+
461
+        var params = new Object()
462
+        params.type = this.form.device_type
463
+        params.serial_number = this.form.serial_number
464
+        params.name = this.form.name
465
+        params.device_number_id = this.form.device_number_id
466
+        params.manufacturer = this.form.manufacturer
467
+        params.repair_factory = this.form.repair_factory
468
+        params.model = this.form.model
469
+        params.department = this.form.department
470
+        params.department_number = this.form.department_number
471
+        params.purchase_date = typeof this.form.purchase_date == 'string' ? 0 : (this.form.purchase_date / 1000)
472
+        params.install_date = typeof this.form.install_date == 'string' ? 0 : (this.form.install_date / 1000)
473
+        params.commissioning_date = typeof this.form.commissioning_date == 'string' ? 0 : (this.form.commissioning_date / 1000)
474
+        params.maintainer = this.form.maintainer
475
+        params.maintenance_call = this.form.maintenance_call
476
+        params.warranty_period = this.form.warranty_period
477
+        params.device_status = this.form.device_status
478
+        params.initial_use_times = this.form.initial_use_times
479
+        params.mark = this.form.mark
480
+        params.retirement_date = typeof this.form.retirement_date == 'string' ? 0 : (this.form.retirement_date / 1000)
481
+        params.retirement_reason = this.form.retirement_reason
482
+        params.service_life = this.form.service_life
483
+        params.working_time = this.form.working_time
484
+        // params.treatment_mode = this.form.treatment_mode
485
+        // params.reverse_osmosis_mode = this.form.reverse_osmosis_mode
486
+        createDevice(params).then(rs => {
487
+          var resp = rs.data
488
+          if (resp.state === 1) {
489
+            var device = resp.data.device
490
+            this.$emit('did_create', device)
491
+            this.$message({message: "创建成功", type: "success"})
492
+
493
+          } else {
494
+            this.$message.error(resp.msg)
495
+          }
496
+        })
497
+      },
498
+      update_device_submit() {
499
+        var checkErr = this._check_submit()
500
+        if (checkErr.length > 0) {
501
+          this.$message.error(checkErr)
502
+          return
503
+        }
504
+
505
+        var params = new Object()
506
+        params.device_id = this.device_id
507
+        params.serial_number = this.form.serial_number
508
+        params.name = this.form.name
509
+        params.device_number_id = this.form.device_number_id
510
+        params.manufacturer = this.form.manufacturer
511
+        params.repair_factory = this.form.repair_factory
512
+        params.model = this.form.model
513
+        params.department = this.form.department
514
+        params.department_number = this.form.department_number
515
+        params.purchase_date = typeof this.form.purchase_date == 'string' ? 0 : (this.form.purchase_date / 1000)
516
+        params.install_date = typeof this.form.install_date == 'string' ? 0 : (this.form.install_date / 1000)
517
+        params.commissioning_date = typeof this.form.commissioning_date == 'string' ? 0 : (this.form.commissioning_date / 1000)
518
+        params.maintainer = this.form.maintainer
519
+        params.maintenance_call = this.form.maintenance_call
520
+        params.warranty_period = this.form.warranty_period
521
+        params.device_status = this.form.device_status
522
+        params.initial_use_times = this.form.initial_use_times
523
+        params.mark = this.form.mark
524
+        params.retirement_date = typeof this.form.retirement_date == 'string' ? 0 : (this.form.retirement_date / 1000)
525
+        params.retirement_reason = this.form.retirement_reason
526
+        params.service_life = this.form.service_life
527
+        params.working_time = this.form.working_time
528
+        // params.treatment_mode = this.form.treatment_mode
529
+        // params.reverse_osmosis_mode = this.form.reverse_osmosis_mode
530
+        modifyDeviceBaseInfo(params).then(rs => {
531
+          var resp = rs.data
532
+          if (resp.state === 1) {
533
+            var device = resp.data.device
534
+            this.$emit('did_update', device)
535
+            this.$message({message: "保存成功", type: "success"})
536
+
537
+          } else {
538
+            this.$message.error(resp.msg)
539
+          }
540
+        })
541
+      },
542
+      _check_submit() {
543
+        if (this.form.serial_number.length == 0) {
544
+          return "请填写设备序列号"
545
+        }
546
+        if (this.form.device_type !== 1 && this.form.device_type !== 2) {
547
+          return "请选择设备类型"
548
+        }
549
+        if (this.form.name.length == 0) {
550
+          return "请填写设备名"
551
+        }
552
+        if (this.form.maintenance_call.length > 0) {
553
+          if (/^(0\d{2,3}-?\d{7,8}$)|(1\d{10}$)/.test(this.form.maintenance_call) == false) {
554
+            return "联系电话格式错误"
555
+          }
556
+        }
557
+        return ""
558
+      }
559
+    }
560
+  }
561
+</script>
562
+
563
+<style scoped>
564
+  .main {
565
+    width: 100%;
566
+  }
567
+  .main .el-row {
568
+    /* border-bottom: 1px solid rgb(233, 233, 233); */
569
+    /* padding-left: 5px; */
570
+    padding-right: 5px;
571
+    padding-top: 10px;
572
+    padding-bottom: 10px;
573
+  }
574
+  .col_div {
575
+    width: 100%;
576
+  }
577
+  .col_label_span {
578
+    padding-left: 0px;
579
+    padding-right: 5px;
580
+    font-size: 14px;
581
+    height: 32px;
582
+    line-height: 32px;
583
+    /* display: block; */
584
+    display: inline-block;
585
+    width: 100%;
586
+    text-align: right;
587
+    /* padding-right: 5px; */
588
+  }
589
+  .required_span {
590
+    color: red;
591
+  }
592
+
593
+  .el-checkbox {
594
+    margin-bottom: 5px;
595
+  }
596
+  .el-checkbox+.el-checkbox {
597
+    margin-left: 15px;
598
+  }
599
+</style>

+ 163 - 132
src/xt_pages/device/components/device_list.vue Visa fil

@@ -1,154 +1,182 @@
1 1
 <template>
2
-    <div>
3
-        <el-row>
4
-            <el-col :span="24">
5
-                    <el-button size="small" icon="el-icon-circle-plus-outline" :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary" @click="add_device_action">新增</el-button>
6
-                    <el-button size="small" icon="el-icon-delete" :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="danger" @click="delete_device_action">删除</el-button>
7
-            </el-col>
8
-        </el-row>
2
+  <div>
3
+    <el-row>
4
+      <el-col :span="24">
5
+        <el-table :data="devices" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
6
+                  :highlight-current-row="true">
7
+          <el-table-column label="序列号" prop="serial_number" align="center" header-align="center"></el-table-column>
8
+          <el-table-column label="设备名" prop="name" align="center" header-align="center"></el-table-column>
9
+          <el-table-column label="型号" prop="model" align="center" header-align="center"></el-table-column>
10
+          <el-table-column label="操作" align="center" fixed="right" width="150">
11
+            <template slot-scope="scope">
12
+              <el-tooltip class="item" effect="dark" content="编辑" placement="top">
13
+                <el-button
14
+                  size="small"
15
+                  type="primary"
16
+                  icon="el-icon-edit-outline"
17
+                  @click="handleEdit(scope.$index, scope.row)">
18
+                </el-button>
19
+              </el-tooltip>
20
+              <el-tooltip class="item" effect="dark" content="删除" placement="top">
21
+                <el-button
22
+                  size="small"
23
+                  type="danger"
24
+                  icon="el-icon-delete"
25
+                  @click="delete_device_action(scope.$index, scope.row)">
26
+                </el-button>
27
+              </el-tooltip>
28
+            </template>
29
+          </el-table-column>
30
+        </el-table>
31
+      </el-col>
32
+    </el-row>
9 33
 
10
-        <el-row>
11
-            <el-col :span="24">
12
-                <el-table :data="devices" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :highlight-current-row="true" @row-click="select_row">
13
-                    <el-table-column label="序列号" prop="serial_number" align="center" header-align="center"></el-table-column>
14
-                    <el-table-column label="设备名" prop="name" align="center" header-align="center"></el-table-column>
15
-                    <el-table-column label="型号" prop="model" align="center" header-align="center"></el-table-column>
16
-                </el-table>
17
-            </el-col>
18
-        </el-row>
34
+    <add-device-dialog ref="new_device_dialog" :device_numbers="device_numbers"
35
+                       @did_create_device="didCreateDevice"></add-device-dialog>
36
+    <edit-device-dialog ref="edit_device_dialog" :device_numbers="device_numbers"
37
+                        @did_update="update_device"></edit-device-dialog>
38
+    <partition-dialog ref="new_partition_dialog" :zones="zones" :device_numbers="device_numbers"
39
+                      :groups="groups"></partition-dialog>
40
+  </div>
19 41
 
20
-        <add-device-dialog ref="new_device_dialog" :device_numbers="device_numbers" @did_create_device="didCreateDevice"></add-device-dialog> 
21
-        <partition-dialog ref="new_partition_dialog" :zones="zones" :device_numbers="device_numbers" :groups="groups"></partition-dialog> 
22
-    </div>
23
- 
24 42
 </template>
25 43
 
26 44
 <script>
27
-import AddDeviceDialog from "./add_device_dialog"
28
-import PartitionDialog from "./partition_dialog"
29
-import { getDevices, disableDevice } from '@/api/device/device'
45
+  import AddDeviceDialog from './add_device_dialog'
46
+  import PartitionDialog from './partition_dialog'
47
+  import { disableDevice, getDevices } from '@/api/device/device'
48
+  import EditDeviceDialog from './edit_device_dialog'
30 49
 
31
-export default {
50
+  export default {
32 51
     name: 'DeviceList',
33 52
     components: {
34
-        AddDeviceDialog,
35
-        PartitionDialog,
53
+      EditDeviceDialog,
54
+      AddDeviceDialog,
55
+      PartitionDialog
36 56
     },
37 57
     data() {
38
-        return {
39
-            filter_form: {
40
-                zone: '',
41
-                schedule: '',
42
-                device_type: '',
43
-            },
44
-            schedules: [
45
-                { id:1, name:'上午' },
46
-                { id:2, name:'下午' },
47
-                { id:3, name:'晚上' },
48
-            ],
49
-            device_types: [
50
-                { id:1, name:'透析机' },
51
-                { id:2, name:'水处理机' },
52
-            ],
53
-            devices: [],
58
+      return {
59
+        edit_device_numbers: [],
60
+        filter_form: {
61
+          zone: '',
62
+          schedule: '',
63
+          device_type: ''
64
+        },
65
+        schedules: [
66
+          { id: 1, name: '上午' },
67
+          { id: 2, name: '下午' },
68
+          { id: 3, name: '晚上' }
69
+        ],
70
+        device_types: [
71
+          { id: 1, name: '透析机' },
72
+          { id: 2, name: '水处理机' }
73
+        ],
74
+        devices: [],
54 75
 
55
-            current_select_device: null,
56
-        }
76
+        current_select_device: null
77
+      }
57 78
     },
58 79
     props: {
59
-        zones: {
60
-            type: Array,
61
-            require: true,
62
-        },
63
-        groups: {
64
-            type: Array,
65
-            require: true,
66
-        },
67
-        device_numbers: {
68
-            type: Array,
69
-            require: true,
70
-        },
80
+      zones: {
81
+        type: Array,
82
+        require: true
83
+      },
84
+      groups: {
85
+        type: Array,
86
+        require: true
87
+      },
88
+      device_numbers: {
89
+        type: Array,
90
+        require: true
91
+      }
71 92
     },
72 93
     created() {
73
-        this._get_devices()
94
+      this._get_devices()
74 95
     },
75 96
     methods: {
76
-        add_device_action: function() {
77
-            this.$refs.new_device_dialog.show()
78
-        },
79
-        partition_dialog_action: function() {
80
-            this.$refs.new_partition_dialog.show()
81
-        },
82
-        filter_devices: function() {
83
-            this.$emit("did_select_device", null)
84
-            this._get_devices()
85
-        },
86
-        _get_devices: function() {
87
-            getDevices(this.filter_form.device_type, this.filter_form.zone).then(rs => {
97
+      handleEdit: function(index, row) {
98
+        this.$refs.edit_device_dialog.show()
99
+        this.$refs.edit_device_dialog.set_device_id(row.id)
100
+      },
101
+      add_device_action: function() {
102
+        this.$refs.new_device_dialog.show()
103
+      },
104
+      partition_dialog_action: function() {
105
+        this.$refs.new_partition_dialog.show()
106
+      },
107
+      filter_devices: function() {
108
+        this.$emit('did_select_device', null)
109
+        this._get_devices()
110
+      },
111
+      _get_devices: function() {
112
+        getDevices(this.filter_form.device_type, this.filter_form.zone).then(rs => {
113
+          var resp = rs.data
114
+          if (resp.state === 1) {
115
+            // console.log(resp)
116
+            this.devices.splice(0, this.devices.length)
117
+            this.devices.push(...resp.data.devices)
118
+
119
+          } else {
120
+            this.$message.error(resp.msg)
121
+          }
122
+        })
123
+      }, didCreateDevice: function(newDevice) {
124
+        this.$refs.new_device_dialog.hide()
125
+        this.devices.push(newDevice)
126
+      },
127
+      select_row: function(row, event, column) {
128
+        // console.log(row)
129
+        this.current_select_device = row
130
+        this.$emit('did_select_device', row)
131
+      },
132
+      update_device: function(device) {
133
+        if (device !== undefined) {
134
+          for (let index = 0; index < this.devices.length; index++) {
135
+            const _device = this.devices[index]
136
+            if (_device.id == device.id) {
137
+              _device.name = device.name
138
+              _device.model = device.model
139
+              _device.serial_number = device.serial_number
140
+              _device.device_group_id = device.device_group_id
141
+              _device.device_number = device.device_number
142
+              _device.device_number_id = device.device_number_id
143
+              _device.device_zone_id = device.device_zone_id
144
+              break
145
+            }
146
+          }
147
+        }
148
+        this.$refs.edit_device_dialog.hide()
149
+
150
+      },
151
+      delete_device_action: function(index, row) {
152
+        this.current_select_device = row
153
+        console.log(this.current_select_device)
154
+        if (this.current_select_device != null) {
155
+          this.$confirm('删除后将无法恢复,确定继续删除吗', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' })
156
+            .then(() => {
157
+              disableDevice(this.current_select_device.id).then(rs => {
88 158
                 var resp = rs.data
89
-                if (resp.state === 1) {
90
-                    // console.log(resp)
91
-                    this.devices.splice(0, this.devices.length)
92
-                    this.devices.push(...resp.data.devices)
93
-                    
159
+                if (resp.state == 1) {
160
+                  var index = this.devices.indexOf(this.current_select_device)
161
+                  if (index > -1) {
162
+                    this.devices.splice(index, 1)
163
+                  }
164
+                  this.current_select_device = null
165
+                  this.$emit('did_select_device', null)
166
+
94 167
                 } else {
95
-                    this.$message.error(resp.msg)
168
+                  this.$message.error(resp.msg)
96 169
                 }
170
+              })
97 171
             })
98
-        },
99
-        didCreateDevice: function(newDevice) {
100
-            this.$refs.new_device_dialog.hide()
101
-            this.devices.push(newDevice)
102
-        },
103
-        select_row: function(row, event, column) {
104
-            // console.log(row)
105
-            this.current_select_device = row
106
-            this.$emit("did_select_device", row)
107
-        },
108
-        update_device: function(device) {
109
-            if (device !== undefined) {
110
-                for (let index = 0; index < this.devices.length; index++) {
111
-                    const _device = this.devices[index];
112
-                    if (_device.id == device.id) {
113
-                        _device.name = device.name
114
-                        _device.model = device.model
115
-                        _device.serial_number = device.serial_number
116
-                        _device.device_group_id = device.device_group_id
117
-                        _device.device_number = device.device_number
118
-                        _device.device_number_id = device.device_number_id
119
-                        _device.device_zone_id = device.device_zone_id
120
-                        break
121
-                    }
122
-                }
123
-            }
124
-        },
125
-        delete_device_action: function() {
126
-            if (this.current_select_device != null) {
127
-                this.$confirm("删除后将无法恢复,确定继续删除吗", '提示', {confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning'})
128
-                .then(() => {
129
-                    disableDevice(this.current_select_device.id).then(rs => {
130
-                        var resp = rs.data
131
-                        if (resp.state == 1) {
132
-                            var index = this.devices.indexOf(this.current_select_device)
133
-                            if (index > -1) {
134
-                                this.devices.splice(index, 1)
135
-                            }
136
-                            this.current_select_device = null
137
-                            this.$emit("did_select_device", null)
138
-                            
139
-                        } else {
140
-                            this.$message.error(resp.msg)
141
-                        }
142
-                    })
143
-                })
144
-            }
145
-        },
172
+        }
173
+      }
146 174
     }
147
-}
175
+  }
148 176
 </script>
149 177
 
150 178
 <style scoped>
151
-.header {
179
+  .header {
152 180
     /* background-color: rgb(223, 249, 255); */
153 181
     background-color: rgb(236, 245, 255);
154 182
     border-style: solid;
@@ -157,14 +185,17 @@ export default {
157 185
     border-width: 1px;
158 186
     padding: 20px 20px 0px 20px;
159 187
     margin-bottom: 10px;
160
-}
161
-.el-row {
188
+  }
189
+
190
+  .el-row {
162 191
     margin-bottom: 15px;
163
-}
164
-.el-form-item {
192
+  }
193
+
194
+  .el-form-item {
165 195
     margin-bottom: 5px;
166
-}
167
-.header .item_title {
196
+  }
197
+
198
+  .header .item_title {
168 199
     font-size: 14px;
169
-}
200
+  }
170 201
 </style>

+ 628 - 0
src/xt_pages/device/components/edit_device_dialog.vue Visa fil

@@ -0,0 +1,628 @@
1
+<template>
2
+  <el-dialog title="编辑设备" width="854px" top="15vh" :visible.sync="visible" :before-close="_close">
3
+    <div>
4
+      <div class="main">
5
+        <!-- 第一行 -->
6
+        <el-row>
7
+          <el-col :span="8">
8
+            <div class="col_div">
9
+              <el-col :span="layout.first_line_label">
10
+                <span class="col_label_span"><span class="required_span">*&nbsp;</span>序列号:</span>
11
+              </el-col>
12
+              <el-col :span="layout.first_line_content">
13
+                <el-input size="small" v-model="form.serial_number"></el-input>
14
+              </el-col>
15
+            </div>
16
+          </el-col>
17
+          <el-col :span="8">
18
+            <div class="col_div">
19
+              <el-col :span="layout.second_line_label">
20
+                <span class="col_label_span"><span class="required_span">*&nbsp;</span>设备类型:</span>
21
+              </el-col>
22
+              <el-col :span="layout.second_line_content" >
23
+                <el-select v-model="form.device_type" size="small" :disabled="device_id != 0" style="width:100%;">
24
+                  <el-option v-for="item in device_types" :key="item.id" :label="item.name" :value="item.id"></el-option>
25
+                </el-select>
26
+              </el-col>
27
+            </div>
28
+          </el-col>
29
+          <el-col :span="8">
30
+            <div class="col_div">
31
+              <el-col :span="layout.third_line_label">
32
+                <span class="col_label_span">床位号:</span>
33
+              </el-col>
34
+              <el-col :span="layout.third_line_content">
35
+                <el-select v-model="form.device_number_id" clearable size="small" style="width:100%;">
36
+                  <el-option v-for="item in device_numbers" :key="item.id" :label="item.number" :value="item.id"></el-option>
37
+                </el-select>
38
+              </el-col>
39
+            </div>
40
+          </el-col>
41
+        </el-row>
42
+        <!-- 第二行 -->
43
+        <el-row>
44
+          <el-col :span="8">
45
+            <div class="col_div">
46
+              <el-col :span="layout.first_line_label">
47
+                <span class="col_label_span"><span class="required_span">*&nbsp;</span>设备名称:</span>
48
+              </el-col>
49
+              <el-col :span="layout.first_line_content">
50
+                <el-input size="small" v-model="form.name"></el-input>
51
+              </el-col>
52
+            </div>
53
+          </el-col>
54
+          <el-col :span="8">
55
+            <div class="col_div">
56
+              <el-col :span="layout.second_line_label">
57
+                <span class="col_label_span">生产厂家:</span>
58
+              </el-col>
59
+              <el-col :span="layout.second_line_content">
60
+                <el-input size="small" v-model="form.manufacturer"></el-input>
61
+              </el-col>
62
+            </div>
63
+          </el-col>
64
+          <el-col :span="8">
65
+            <div class="col_div">
66
+              <el-col :span="layout.third_line_label">
67
+                <span class="col_label_span">维修厂家:</span>
68
+              </el-col>
69
+              <el-col :span="layout.third_line_content">
70
+                <el-input size="small" v-model="form.repair_factory"></el-input>
71
+              </el-col>
72
+            </div>
73
+          </el-col>
74
+        </el-row>
75
+        <!-- 第三行 -->
76
+        <el-row>
77
+          <el-col :span="8">
78
+            <div class="col_div">
79
+              <el-col :span="layout.first_line_label">
80
+                <span class="col_label_span">设备型号:</span>
81
+              </el-col>
82
+              <el-col :span="layout.first_line_content">
83
+                <el-input size="small" v-model="form.model"></el-input>
84
+              </el-col>
85
+            </div>
86
+          </el-col>
87
+          <el-col :span="8">
88
+            <div class="col_div">
89
+              <el-col :span="layout.second_line_label">
90
+                <span class="col_label_span">使用科室:</span>
91
+              </el-col>
92
+              <el-col :span="layout.second_line_content">
93
+                <el-input size="small" v-model="form.department"></el-input>
94
+              </el-col>
95
+            </div>
96
+          </el-col>
97
+          <el-col :span="8">
98
+            <div class="col_div">
99
+              <el-col :span="layout.third_line_label">
100
+                <span class="col_label_span">科室编号:</span>
101
+              </el-col>
102
+              <el-col :span="layout.third_line_content">
103
+                <el-input size="small" v-model="form.department_number"></el-input>
104
+              </el-col>
105
+            </div>
106
+          </el-col>
107
+        </el-row>
108
+        <!-- 第四行 -->
109
+        <el-row>
110
+          <el-col :span="8">
111
+            <div class="col_div">
112
+              <el-col :span="layout.first_line_label">
113
+                <span class="col_label_span">购买日期:</span>
114
+              </el-col>
115
+              <el-col :span="layout.first_line_content">
116
+                <el-date-picker v-model="form.purchase_date" type="date" value-format="timestamp" size="small" style="width: 100%;"></el-date-picker>
117
+              </el-col>
118
+            </div>
119
+          </el-col>
120
+          <el-col :span="8">
121
+            <div class="col_div">
122
+              <el-col :span="layout.second_line_label">
123
+                <span class="col_label_span">安装日期:</span>
124
+              </el-col>
125
+              <el-col :span="layout.second_line_content">
126
+                <el-date-picker v-model="form.install_date" type="date" value-format="timestamp" size="small" style="width: 100%;"></el-date-picker>
127
+              </el-col>
128
+            </div>
129
+          </el-col>
130
+          <el-col :span="8">
131
+            <div class="col_div">
132
+              <el-col :span="layout.third_line_label">
133
+                <span class="col_label_span">启用日期:</span>
134
+              </el-col>
135
+              <el-col :span="layout.third_line_content">
136
+                <el-date-picker v-model="form.commissioning_date" value-format="timestamp" type="date" size="small" style="width: 100%;"></el-date-picker>
137
+              </el-col>
138
+            </div>
139
+          </el-col>
140
+        </el-row>
141
+        <!-- 第五行 -->
142
+        <el-row>
143
+          <el-col :span="8">
144
+            <div class="col_div">
145
+              <el-col :span="layout.first_line_label">
146
+                <span class="col_label_span">维修工程师:</span>
147
+              </el-col>
148
+              <el-col :span="layout.first_line_content">
149
+                <el-input size="small" v-model="form.maintainer"></el-input>
150
+              </el-col>
151
+            </div>
152
+          </el-col>
153
+          <el-col :span="8">
154
+            <div class="col_div">
155
+              <el-col :span="layout.second_line_label">
156
+                <span class="col_label_span">联系电话:</span>
157
+              </el-col>
158
+              <el-col :span="layout.second_line_content">
159
+                <el-input size="small" v-model="form.maintenance_call"></el-input>
160
+              </el-col>
161
+            </div>
162
+          </el-col>
163
+          <el-col :span="8">
164
+            <div class="col_div">
165
+              <el-col :span="layout.third_line_label">
166
+                <span class="col_label_span">保修期限:</span>
167
+              </el-col>
168
+              <el-col :span="layout.third_line_content">
169
+                <el-input size="small" v-model="form.warranty_period"></el-input>
170
+              </el-col>
171
+            </div>
172
+          </el-col>
173
+        </el-row>
174
+        <!-- 第六行 -->
175
+        <!-- <el-row>
176
+            <el-col :span="8">
177
+                <div class="col_div">
178
+                    <el-col :span="9">
179
+                        <span class="col_label_span">机器状态:</span>
180
+                    </el-col>
181
+                    <el-col :span="15">
182
+                        <el-select v-model="form.device_status" clearable size="small">
183
+                            <el-option v-for="item in device_states" :key="item.state" :label="item.name" :value="item.state"></el-option>
184
+                        </el-select>
185
+                    </el-col>
186
+                </div>
187
+            </el-col>
188
+            <el-col :span="8">
189
+                <div class="col_div">
190
+                    <el-col :span="10">
191
+                        <span class="col_label_span">初始使用次数:</span>
192
+                    </el-col>
193
+                    <el-col :span="14">
194
+                        <el-input v-model="form.initial_use_times" style="width: 100%;"></el-input>
195
+                    </el-col>
196
+                </div>
197
+            </el-col>
198
+            <el-col :span="8">
199
+                <div class="col_div">
200
+                    <el-col :span="7">
201
+                        <span class="col_label_span">备&nbsp;&nbsp;&nbsp;注:</span>
202
+                    </el-col>
203
+                    <el-col :span="17">
204
+                        <el-input size="small" v-model="form.mark"></el-input>
205
+                    </el-col>
206
+                </div>
207
+            </el-col>
208
+        </el-row> -->
209
+        <!-- 第七行 -->
210
+        <!-- <el-row>
211
+            <el-col :span="7">
212
+                <div class="col_div">
213
+                    <el-col :span="8">
214
+                        <span class="col_label_span">报废日期:</span>
215
+                    </el-col>
216
+                    <el-col :span="16">
217
+                        <el-date-picker v-model="form.retirement_date" type="date" value-format="timestamp" size="small" style="width: 140px;"></el-date-picker>
218
+                    </el-col>
219
+                </div>
220
+            </el-col>
221
+            <el-col :span="7">
222
+                <div class="col_div">
223
+                    <el-col :span="8">
224
+                        <span class="col_label_span">报废原因:</span>
225
+                    </el-col>
226
+                    <el-col :span="16">
227
+                        <el-select v-model="form.retirement_reason" clearable size="small">
228
+                            <el-option v-for="item in retirement_reasons" :key="item.id" :label="item.reason" :value="item.reason"></el-option>
229
+                        </el-select>
230
+                    </el-col>
231
+                </div>
232
+            </el-col>
233
+            <el-col :span="5">
234
+                <div class="col_div">
235
+                    <el-col :span="15">
236
+                        <span class="col_label_span">使用年限(年):</span>
237
+                    </el-col>
238
+                    <el-col :span="9">
239
+                        <el-input size="small" v-model="form.service_life"></el-input>
240
+                    </el-col>
241
+                </div>
242
+            </el-col>
243
+            <el-col :span="5">
244
+                <div class="col_div">
245
+                    <el-col :span="14">
246
+                        <span class="col_label_span">工作时长(h):</span>
247
+                    </el-col>
248
+                    <el-col :span="10">
249
+                        <el-input size="small" v-model="form.working_time"></el-input>
250
+                    </el-col>
251
+                </div>
252
+            </el-col>
253
+        </el-row> -->
254
+        <!-- 治疗模式 -->
255
+        <el-row v-show="false && form.device_type === 1">
256
+          <el-col :span="24">
257
+            <div class="col_div">
258
+              <el-col :span="3">
259
+                <div style="padding-left: 5px;">
260
+                  <span class="col_label_span" style="line-height: auto; padding-left: 0; text-align: left;">治疗模式:</span>
261
+                  <el-checkbox label="全选"></el-checkbox>
262
+                </div>
263
+              </el-col>
264
+              <el-col :span="21">
265
+                <div style="margin-top: 6px;"></div>
266
+                <el-checkbox-group v-model="form.treatment_mode">
267
+                  <el-checkbox v-for="item in cure_types" :label="item.id" :key="item.id" :value="item.id">{{ item.name }}</el-checkbox>
268
+                </el-checkbox-group>
269
+              </el-col>
270
+            </div>
271
+          </el-col>
272
+        </el-row>
273
+        <!-- 反渗模式 -->
274
+        <el-row v-show="false && form.device_type === 2">
275
+          <el-col :span="8">
276
+            <div class="col_div">
277
+              <el-col :span="layout.first_line_label">
278
+                <span class="col_label_span">反渗模式:</span>
279
+              </el-col>
280
+              <el-col :span="layout.first_line_content">
281
+                <el-select v-model="form.reverse_osmosis_mode" clearable size="small">
282
+                  <el-option v-for="item in reverse_osmosises" :key="item.id" :label="item.name" :value="item.id"></el-option>
283
+                </el-select>
284
+              </el-col>
285
+            </div>
286
+          </el-col>
287
+        </el-row>
288
+      </div>
289
+
290
+
291
+
292
+
293
+      <div style="text-align: right; padding-right: 25px; padding-top: 10px; padding-bottom: 10px;">
294
+        <el-button type="primary" :disabled="$store.getters.xt_user.subscibe.state==3?true:false" @click="update_device_submit">保 存</el-button>
295
+      </div>
296
+    </div>
297
+  </el-dialog>
298
+</template>
299
+
300
+<script>
301
+  import DeviceInfoPane from './device_info/device_info_pane'
302
+  import DeviceInfoForm from './device_info/device_info_form'
303
+  import EditDeviceInfoForm from './device_info/edit_device_info_form'
304
+  import {getDeviceBaseInfo, createDevice, modifyDeviceBaseInfo} from '@/api/device/device'
305
+
306
+  export default {
307
+    name: "EditDeviceDialog",
308
+    components: {
309
+      EditDeviceInfoForm,
310
+      DeviceInfoForm,
311
+      DeviceInfoPane
312
+
313
+    },
314
+    data() {
315
+      return {
316
+        visible: false,
317
+        layout: {
318
+          first_line_label: 8,
319
+          first_line_content: 16,
320
+          second_line_label: 8,
321
+          second_line_content: 16,
322
+          third_line_label: 8,
323
+          third_line_content: 16,
324
+        },
325
+        device_id: 0,
326
+        form: {
327
+          device_type: 1,
328
+          serial_number: '',
329
+          name: '',
330
+          device_number_id: '',
331
+          manufacturer: '',
332
+          repair_factory: '',
333
+          model: '',
334
+          department: '',
335
+          department_number: '',
336
+          purchase_date: '',
337
+          install_date: '',
338
+          commissioning_date: '',
339
+          maintainer: '',
340
+          maintenance_call: '',
341
+          warranty_period: '',
342
+          device_status: '',
343
+          initial_use_times: '',
344
+          mark: '',
345
+          retirement_date: '',
346
+          retirement_reason: '',
347
+          service_life: '',
348
+          working_time: '',
349
+          treatment_mode: [], // 治疗模式
350
+          reverse_osmosis_mode: '', // 反渗模式
351
+        },
352
+        device_types: [
353
+          { id: 1, name: "透析机" },
354
+          // { id: 2, name: "水处理机" },
355
+        ],
356
+        cure_types: [ // 治疗模式
357
+          // { id:1, name: "HD" },
358
+          // { id:2, name: "HDF" },
359
+          // { id:3, name: "HD+HP" },
360
+          // { id:4, name: "HP" },
361
+          // { id:5, name: "HF" },
362
+          // { id:10, name: "HD" },
363
+          // { id:20, name: "HDF" },
364
+          // { id:30, name: "HD+HP" },
365
+          // { id:40, name: "HP" },
366
+          // { id:50, name: "HF" },
367
+          // { id:300, name: "HD+HP" },
368
+        ],
369
+        reverse_osmosises: [ // 反渗模式
370
+          // { id:1, name: "单级反渗" }
371
+        ],
372
+        device_states: [
373
+          { state: 1, name: '使用机' },
374
+          { state: 2, name: '备用机' },
375
+          { state: 3, name: '急诊机' },
376
+          { state: 4, name: '报废机' },
377
+        ],
378
+        retirement_reasons: [
379
+          { id: 1, reason: '报废原因1' },
380
+          { id: 2, reason: '报废原因2' },
381
+          { id: 3, reason: '报废原因3' },
382
+          { id: 4, reason: '报废原因4' },
383
+          { id: 5, reason: '其他' },
384
+        ]
385
+      }
386
+    },
387
+    props: {
388
+      device_numbers: {
389
+        type: Array,
390
+        require: true,
391
+      }
392
+    },
393
+    methods: {
394
+      _close: function(done) {
395
+        this.clear()
396
+        done()
397
+      },
398
+      clear: function() {
399
+
400
+      },
401
+      show() {
402
+        this.clear()
403
+        this.visible = true
404
+      },
405
+      hide() {
406
+        this.clear()
407
+        this.visible = false
408
+      },  clear() {
409
+        this.device_id = 0
410
+        this.form.device_type = 1
411
+        this.form.serial_number = ''
412
+        this.form.name = ''
413
+        this.form.device_number_id = ''
414
+        this.form.manufacturer = ''
415
+        this.form.repair_factory = ''
416
+        this.form.model = ''
417
+        this.form.department = ''
418
+        this.form.department_number = ''
419
+        this.form.purchase_date = 0
420
+        this.form.install_date = 0
421
+        this.form.commissioning_date = 0
422
+        this.form.maintainer = ''
423
+        this.form.maintenance_call = ''
424
+        this.form.warranty_period = ''
425
+        this.form.device_status = ''
426
+        this.form.initial_use_times = ''
427
+        this.form.mark = ''
428
+        this.form.retirement_date = 0
429
+        this.form.retirement_reason = ''
430
+        this.form.service_life = ''
431
+        this.form.working_time = ''
432
+        this.form.treatment_mode = []
433
+        this.form.reverse_osmosis_mode = ''
434
+      },
435
+      set_device_id: function(device_id) {
436
+        if (device_id > 0) {
437
+          this.device_id = device_id
438
+          getDeviceBaseInfo(device_id).then(rs => {
439
+            var resp = rs.data
440
+            if (resp.state === 1) {
441
+              this.form.device_type = resp.data.device_type
442
+              this.form.device_number_id = resp.data.device_number_id == 0 ? '' : resp.data.device_number_id
443
+
444
+              var device_info = resp.data.device_info
445
+              this.form.serial_number = device_info.serial_number
446
+              this.form.name = device_info.name
447
+              this.form.manufacturer = device_info.manufacturer
448
+              this.form.repair_factory = device_info.repair_factory
449
+              this.form.model = device_info.model
450
+              this.form.department = device_info.department
451
+              this.form.department_number = device_info.department_number
452
+              this.form.purchase_date = device_info.purchase_date == 0 ? '' : (device_info.purchase_date * 1000)
453
+              this.form.install_date = device_info.install_date == 0 ? '' : (device_info.install_date * 1000)
454
+              this.form.commissioning_date = device_info.commissioning_date == 0 ? '' : (device_info.commissioning_date * 1000)
455
+              this.form.maintainer = device_info.maintainer
456
+              this.form.maintenance_call = device_info.maintenance_call
457
+              this.form.warranty_period = device_info.warranty_period
458
+              this.form.device_status = device_info.device_status == 0 ? '' : device_info.device_status
459
+              this.form.initial_use_times = device_info.initial_use_times == 0 ? '' : device_info.initial_use_times
460
+              this.form.mark = device_info.mark
461
+              this.form.retirement_date = device_info.retirement_date == 0 ? '' : (device_info.retirement_date * 1000)
462
+              this.form.retirement_reason = device_info.retirement_reason
463
+              this.form.service_life = device_info.service_life == 0 ? '' : device_info.service_life
464
+              this.form.working_time = device_info.working_time == 0 ? '' : device_info.working_time
465
+              if (this.form.device_type == 1) {
466
+                // treatment_mode: []
467
+
468
+              } else if (this.form.device_type == 2) {
469
+                // reverse_osmosis_mode: ''
470
+              }
471
+
472
+            } else {
473
+              this.$message.error(resp.msg)
474
+            }
475
+          })
476
+
477
+        } else {
478
+          this.clear()
479
+        }
480
+      },
481
+      create_device_submit() {
482
+        var checkErr = this._check_submit()
483
+        if (checkErr.length > 0) {
484
+          this.$message.error(checkErr)
485
+          return
486
+        }
487
+
488
+        var params = new Object()
489
+        params.type = this.form.device_type
490
+        params.serial_number = this.form.serial_number
491
+        params.name = this.form.name
492
+        params.device_number_id = this.form.device_number_id
493
+        params.manufacturer = this.form.manufacturer
494
+        params.repair_factory = this.form.repair_factory
495
+        params.model = this.form.model
496
+        params.department = this.form.department
497
+        params.department_number = this.form.department_number
498
+        params.purchase_date = typeof this.form.purchase_date == 'string' ? 0 : (this.form.purchase_date / 1000)
499
+        params.install_date = typeof this.form.install_date == 'string' ? 0 : (this.form.install_date / 1000)
500
+        params.commissioning_date = typeof this.form.commissioning_date == 'string' ? 0 : (this.form.commissioning_date / 1000)
501
+        params.maintainer = this.form.maintainer
502
+        params.maintenance_call = this.form.maintenance_call
503
+        params.warranty_period = this.form.warranty_period
504
+        params.device_status = this.form.device_status
505
+        params.initial_use_times = this.form.initial_use_times
506
+        params.mark = this.form.mark
507
+        params.retirement_date = typeof this.form.retirement_date == 'string' ? 0 : (this.form.retirement_date / 1000)
508
+        params.retirement_reason = this.form.retirement_reason
509
+        params.service_life = this.form.service_life
510
+        params.working_time = this.form.working_time
511
+        // params.treatment_mode = this.form.treatment_mode
512
+        // params.reverse_osmosis_mode = this.form.reverse_osmosis_mode
513
+        createDevice(params).then(rs => {
514
+          var resp = rs.data
515
+          if (resp.state === 1) {
516
+            var device = resp.data.device
517
+            this.$emit('did_create', device)
518
+            this.$message({message: "创建成功", type: "success"})
519
+
520
+          } else {
521
+            this.$message.error(resp.msg)
522
+          }
523
+        })
524
+      },
525
+      update_device_submit() {
526
+        var checkErr = this._check_submit()
527
+        if (checkErr.length > 0) {
528
+          this.$message.error(checkErr)
529
+          return
530
+        }
531
+
532
+        var params = new Object()
533
+        params.device_id = this.device_id
534
+        params.serial_number = this.form.serial_number
535
+        params.name = this.form.name
536
+        params.device_number_id = this.form.device_number_id
537
+        params.manufacturer = this.form.manufacturer
538
+        params.repair_factory = this.form.repair_factory
539
+        params.model = this.form.model
540
+        params.department = this.form.department
541
+        params.department_number = this.form.department_number
542
+        params.purchase_date = typeof this.form.purchase_date == 'string' ? 0 : (this.form.purchase_date / 1000)
543
+        params.install_date = typeof this.form.install_date == 'string' ? 0 : (this.form.install_date / 1000)
544
+        params.commissioning_date = typeof this.form.commissioning_date == 'string' ? 0 : (this.form.commissioning_date / 1000)
545
+        params.maintainer = this.form.maintainer
546
+        params.maintenance_call = this.form.maintenance_call
547
+        params.warranty_period = this.form.warranty_period
548
+        params.device_status = this.form.device_status
549
+        params.initial_use_times = this.form.initial_use_times
550
+        params.mark = this.form.mark
551
+        params.retirement_date = typeof this.form.retirement_date == 'string' ? 0 : (this.form.retirement_date / 1000)
552
+        params.retirement_reason = this.form.retirement_reason
553
+        params.service_life = this.form.service_life
554
+        params.working_time = this.form.working_time
555
+        // params.treatment_mode = this.form.treatment_mode
556
+        // params.reverse_osmosis_mode = this.form.reverse_osmosis_mode
557
+        modifyDeviceBaseInfo(params).then(rs => {
558
+          var resp = rs.data
559
+          if (resp.state === 1) {
560
+            var device = resp.data.device
561
+            this.$emit('did_update', device)
562
+            this.$message({message: "保存成功", type: "success"})
563
+
564
+          } else {
565
+            this.$message.error(resp.msg)
566
+          }
567
+        })
568
+      },
569
+      _check_submit() {
570
+        if (this.form.serial_number.length == 0) {
571
+          return "请填写设备序列号"
572
+        }
573
+        if (this.form.device_type !== 1 && this.form.device_type !== 2) {
574
+          return "请选择设备类型"
575
+        }
576
+        if (this.form.name.length == 0) {
577
+          return "请填写设备名"
578
+        }
579
+        if (this.form.maintenance_call.length > 0) {
580
+          if (/^(0\d{2,3}-?\d{7,8}$)|(1\d{10}$)/.test(this.form.maintenance_call) == false) {
581
+            return "联系电话格式错误"
582
+          }
583
+        }
584
+        return ""
585
+      }
586
+
587
+    }
588
+  }
589
+
590
+</script>
591
+
592
+<style scoped>
593
+  .main {
594
+    width: 100%;
595
+  }
596
+  .main .el-row {
597
+    /* border-bottom: 1px solid rgb(233, 233, 233); */
598
+    /* padding-left: 5px; */
599
+    padding-right: 5px;
600
+    padding-top: 10px;
601
+    padding-bottom: 10px;
602
+  }
603
+  .col_div {
604
+    width: 100%;
605
+  }
606
+  .col_label_span {
607
+    padding-left: 0px;
608
+    padding-right: 5px;
609
+    font-size: 14px;
610
+    height: 32px;
611
+    line-height: 32px;
612
+    /* display: block; */
613
+    display: inline-block;
614
+    width: 100%;
615
+    text-align: right;
616
+    /* padding-right: 5px; */
617
+  }
618
+  .required_span {
619
+    color: red;
620
+  }
621
+
622
+  .el-checkbox {
623
+    margin-bottom: 5px;
624
+  }
625
+  .el-checkbox+.el-checkbox {
626
+    margin-left: 15px;
627
+  }
628
+</style>

+ 57 - 53
src/xt_pages/device/main.vue Visa fil

@@ -1,73 +1,77 @@
1 1
 <template>
2
-<div class="main-contain">
3
-     <div class="position">
4
-       <bread-crumb :crumbs='crumbs'></bread-crumb>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+      <el-button size="small" icon="el-icon-circle-plus-outline"
6
+                 :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary"
7
+                 @click="add_device_action">新增
8
+      </el-button>
5 9
 
6
-     </div>
10
+
11
+    </div>
7 12
     <div class="app-container">
8
-        <el-row :gutter="15">
9
-            <el-col :span="7">
10
-                <device-list ref="device_list" :zones="zones" :groups="groups" :device_numbers="device_numbers" @did_select_device="did_select_device"></device-list>
11
-            </el-col>
12
-            <el-col :span="17">
13
-                <device-detail ref="device_detail" :device_numbers="device_numbers" @did_update_device="did_update_device"></device-detail>
14
-            </el-col>
15
-        </el-row>
13
+      <device-list ref="device_list" :zones="zones" :groups="groups" :device_numbers="device_numbers"
14
+                   @did_select_device="did_select_device"></device-list>
15
+      <!--<el-col :span="17">-->
16
+      <!--<device-detail ref="device_detail" :device_numbers="device_numbers" @did_update_device="did_update_device"></device-detail>-->
17
+      <!--</el-col>-->
16 18
     </div>
17
-</div>
19
+  </div>
18 20
 
19 21
 </template>
20 22
 
21 23
 <script>
22
-import DeviceList from './components/device_list'
23
-import DeviceDetail from './components/device_detail'
24
-import {getDeviceInitData} from '@/api/device/device'
25
-import BreadCrumb from "@/xt_pages/components/bread-crumb";
24
+  import DeviceList from './components/device_list'
25
+  import DeviceDetail from './components/device_detail'
26
+  import { getDeviceInitData } from '@/api/device/device'
27
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
26 28
 
27
-export default {
28
-    name: "DeviceManage",
29
+  export default {
30
+    name: 'DeviceManage',
29 31
     components: {
30
-        DeviceList,
31
-        DeviceDetail,
32
-        BreadCrumb
32
+      DeviceList,
33
+      DeviceDetail,
34
+      BreadCrumb
33 35
     },
34 36
     data() {
35
-        return {
36
-          crumbs: [
37
-            { path: false, name: '设备管理' },
38
-            { path: '/device/main', name: '透析机管理' },
39
-          ],
40
-            zones: [],
41
-            groups: [],
42
-            device_numbers: [],
43
-        }
37
+      return {
38
+        crumbs: [
39
+          { path: false, name: '设备管理' },
40
+          { path: '/device/main', name: '透析机管理' }
41
+        ],
42
+        zones: [],
43
+        groups: [],
44
+        device_numbers: []
45
+      }
44 46
     },
45 47
     created() {
46
-        getDeviceInitData().then(rs => {
47
-            var resp = rs.data
48
-            if (resp.state === 1) {
49
-                // console.log(resp)
50
-                this.zones.push(...resp.data.zones)
51
-                this.groups.push(...resp.data.groups)
52
-                this.device_numbers.push(...resp.data.numbers)
48
+      getDeviceInitData().then(rs => {
49
+        var resp = rs.data
50
+        if (resp.state === 1) {
51
+          // console.log(resp)
52
+          this.zones.push(...resp.data.zones)
53
+          this.groups.push(...resp.data.groups)
54
+          this.device_numbers.push(...resp.data.numbers)
53 55
 
54
-            } else {
55
-                this.$message.error(resp.msg)
56
-            }
57
-        })
56
+        } else {
57
+          this.$message.error(resp.msg)
58
+        }
59
+      })
58 60
     },
59 61
     methods: {
60
-        did_select_device: function(device) {
61
-            if (device) {
62
-                this.$refs.device_detail.set_device(device.id, device.device_type)
63
-            } else {
64
-                this.$refs.device_detail.set_device(0, 1)
65
-            }
66
-
67
-        },
68
-        did_update_device: function(device) {
69
-            this.$refs.device_list.update_device(device)
62
+      did_select_device: function(device) {
63
+        if (device) {
64
+          this.$refs.device_detail.set_device(device.id, device.device_type)
65
+        } else {
66
+          this.$refs.device_detail.set_device(0, 1)
70 67
         }
68
+
69
+      },
70
+      did_update_device: function(device) {
71
+        this.$refs.device_list.update_device(device)
72
+      }, add_device_action: function() {
73
+        this.$refs.device_list.add_device_action()
74
+      }
71 75
     }
72
-}
76
+  }
73 77
 </script>

+ 9 - 5
src/xt_pages/stock/Dialog/goodInfoDailog.vue Visa fil

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <el-dialog width="854px" :title="titles" :visible.sync="visibility" :show-close="isClose" :close-on-click-modal="isClose"
2
+  <el-dialog width="854px" :title="titles" :visible.sync="visibility" :close-on-click-modal="isClose"
3 3
              :close-on-press-escape="isClose">
4 4
 
5 5
     <el-form class="demo-form-inline"
@@ -130,6 +130,7 @@
130 130
         good_unit: '',
131 131
         isClose: false,
132 132
         size: 11,
133
+        visibility:false,
133 134
         form: {
134 135
           good_id: '',
135 136
           specification_name: '',
@@ -155,10 +156,7 @@
155 156
       }
156 157
     },
157 158
     props: {
158
-      visibility: {
159
-        type: Boolean,
160
-        default: false
161
-      },
159
+
162 160
       titles: {
163 161
         type: String,
164 162
         default: ''
@@ -174,6 +172,12 @@
174 172
 
175 173
     },
176 174
     methods: {
175
+      show:function(){
176
+        this.visibility = true
177
+
178
+      },hide:function(){
179
+        this.visibility = false
180
+      },
177 181
       cancle: function(formName) {
178 182
         this.$emit('dialog-cancle', this.getValue())
179 183
       },

+ 9 - 6
src/xt_pages/stock/Dialog/goodTypeDialog.vue Visa fil

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <el-dialog width="430px" :title="titles" :visible.sync="visibility" :show-close="isClose" :close-on-click-modal="isClose"
2
+  <el-dialog width="430px" :title="titles" :visible.sync="visibility"  :close-on-click-modal="isClose"
3 3
              :close-on-press-escape="isClose">
4 4
     <el-form :rules="rules" ref="formValue" :model="formValue" label-width="80px">
5 5
       <el-row>
@@ -17,7 +17,7 @@
17 17
           </el-form-item>
18 18
         </el-col>
19 19
       </el-row>
20
-      
20
+
21 21
 
22 22
     </el-form>
23 23
 
@@ -37,6 +37,7 @@ export default {
37 37
   name: "goodTypeDialog",
38 38
   data() {
39 39
     return {
40
+      visibility:false,
40 41
       isClose: false,
41 42
       labelPosition: 'right',
42 43
       resetForm: {
@@ -51,10 +52,6 @@ export default {
51 52
     };
52 53
   },
53 54
   props: {
54
-    visibility: {
55
-      type: Boolean,
56
-      default: false
57
-    },
58 55
     titles: {
59 56
       type: String,
60 57
       default: ""
@@ -68,6 +65,12 @@ export default {
68 65
     }
69 66
   },
70 67
   methods: {
68
+    show:function(){
69
+      this.visibility = true
70
+
71
+    },hide:function(){
72
+      this.visibility = false
73
+    },
71 74
     cancle: function(formName) {
72 75
       this.$emit("dialog-cancle");
73 76
       this.$refs[formName].resetFields();

+ 14 - 9
src/xt_pages/stock/Dialog/manufacturerOrDealerDialog.vue Visa fil

@@ -1,6 +1,6 @@
1 1
 <template>
2
-  <el-dialog width="854px" :title="titles" :visible.sync="visibility" :show-close="isClose" :close-on-click-modal="isClose"
3
-             :close-on-press-escape="isClose">  
2
+  <el-dialog width="854px" :title="titles" :visible.sync="visibility" :close-on-click-modal="isClose"
3
+             :close-on-press-escape="isClose" >
4 4
 
5 5
     <el-form :model="formValue" :rules="rules" ref="formValue" class="demo-form-inline"
6 6
              :label-position="labelPosition"
@@ -32,7 +32,7 @@
32 32
     </el-row>
33 33
 
34 34
 
35
-    <el-row>    
35
+    <el-row>
36 36
       <el-col :span="8">
37 37
         <el-form-item label="联系地址">
38 38
           <el-input  v-model="formValue.contact_address"></el-input>
@@ -51,7 +51,7 @@
51 51
         </el-form-item>
52 52
       </el-col>
53 53
     </el-row>
54
-    
54
+
55 55
       <el-col>
56 56
         <el-form-item label="备注">
57 57
           <el-input  type="textarea" :row="5" v-model="formValue.remark"
@@ -85,6 +85,7 @@
85 85
 
86 86
 
87 87
       return {
88
+        visibility:false,
88 89
         labelPosition: 'right',
89 90
         isClose: false,
90 91
         form: {
@@ -120,10 +121,7 @@
120 121
       }
121 122
     },
122 123
     props: {
123
-      visibility: {
124
-        type: Boolean,
125
-        default: false
126
-      },
124
+
127 125
       titles: {
128 126
         type: String,
129 127
         default: "",
@@ -143,7 +141,14 @@
143 141
       }
144 142
     },
145 143
     methods: {
144
+      show:function(){
145
+        this.visibility = true
146
+
147
+      },hide:function(){
148
+        this.visibility = false
149
+      },
146 150
       cancle: function (formName) {
151
+        console.log("11111")
147 152
         this.$emit('dialog-cancle', this.getValue());
148 153
         this.$refs['formValue'].resetFields();
149 154
       },
@@ -165,7 +170,7 @@
165 170
         form['type'] = this.type
166 171
         form['isCreated'] = this.isCreated
167 172
         return form
168
-      },
173
+      }
169 174
     },
170 175
 
171 176
   }

+ 8 - 5
src/xt_pages/stock/Dialog/salesReturnDialog.vue Visa fil

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <el-dialog :title="propForm.title" :visible.sync="visibility" :show-close="isClose" :close-on-click-modal="isClose"
2
+  <el-dialog title="选择商品" :visible.sync="visibility"  :close-on-click-modal="isClose"
3 3
              :close-on-press-escape="isClose">
4 4
 
5 5
     <div class="filter-container">
@@ -70,6 +70,7 @@
70 70
     name: 'salesReturnDialog',
71 71
     data() {
72 72
       return {
73
+        visibility:false,
73 74
         goodInfo: [],
74 75
         goodInfoTableData: [],
75 76
         keywords: '',
@@ -82,13 +83,15 @@
82 83
       propForm: {
83 84
         type: Object
84 85
       },
85
-      visibility: {
86
-        type: Boolean,
87
-        default: false
88
-      }
89 86
 
90 87
     },
91 88
     methods: {
89
+      hide:function(){
90
+        this.visibility = false
91
+      },
92
+      show:function(){
93
+        this.visibility = true
94
+      },
92 95
       goodTypeTableChange: function(currentRow, oldCurrentRow) {
93 96
         this.currentGoodTypeId = currentRow.id
94 97
 

+ 9 - 7
src/xt_pages/stock/Dialog/stockInDialog.vue Visa fil

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <el-dialog :title="propForm.title" :visible.sync="visibility" :show-close="isClose" :close-on-click-modal="isClose"
2
+  <el-dialog title="选择商品" :visible.sync="visibility" :close-on-click-modal="isClose"
3 3
              :close-on-press-escape="isClose">
4 4
 
5 5
     <div class="filter-container">
@@ -77,20 +77,22 @@
77 77
         keywords: '',
78 78
         multipleSelection: [],
79 79
         currentGoodTypeId: 0,
80
-        isClose: false
80
+        isClose: false,
81
+        visibility: false,
81 82
       }
82 83
     },
83 84
     props: {
84 85
       propForm: {
85 86
         type: Object
86 87
       },
87
-      visibility: {
88
-        type: Boolean,
89
-        default: false
90
-      }
91
-
92 88
     },
93 89
     methods: {
90
+      hide:function(){
91
+        this.visibility = false
92
+      },
93
+      show:function(){
94
+        this.visibility = true
95
+      },
94 96
       goodTypeTableChange: function(currentRow, oldCurrentRow) {
95 97
         this.currentGoodTypeId = currentRow.id
96 98
         const params = {

+ 11 - 6
src/xt_pages/stock/cancelStockOrderAdd.vue Visa fil

@@ -10,7 +10,7 @@
10 10
 
11 11
   <div class="app-container">
12 12
 
13
-    <sales-return-dialog :propForm="propForm"
13
+    <sales-return-dialog ref="dialog" :propForm="propForm"
14 14
                          :visibility="isVisibility"
15 15
                          v-on:dialog-comfirm="comfirm"
16 16
                          v-on:dialog-cancle="cancle"></sales-return-dialog>
@@ -26,7 +26,7 @@
26 26
                           value-format="yyyy-MM-dd"></el-date-picker>
27 27
         </div>
28 28
         <div class="cell clearfix">
29
-          <label class="title"><span class="name">厂商</span> : </label>
29
+          <label class="title"><span class="name">厂商<span style="color: red;margin-left: -15px">*</span></span> : </label>
30 30
           <el-select  v-model="form.manufacturer" clearable  placeholder="请选择厂商" @change="changeManufacturer()">
31 31
             <el-option
32 32
               v-for="(option, index) in manufacturer"
@@ -183,7 +183,7 @@
183 183
     },
184 184
     methods: {
185 185
       comfirm: function(val) {
186
-        this.isVisibility = false
186
+        this.$refs.dialog.hide()
187 187
         if (val.selectedGoodInfo.length > 0) {
188 188
           for (let i = val.selectedGoodInfo.length - 1; ;i--) {
189 189
             if (i == 0) {
@@ -194,14 +194,19 @@
194 194
               tempForm['good_type_id'] = val.goodTypeId
195 195
               tempForm['good_id'] = val.selectedGoodInfo[i].id
196 196
               tempForm['return_count'] = ''
197
-              this.recordInfo.recordData.push(tempForm)
197
+              // this.recordInfo.recordData.push(tempForm)
198
+              this.recordInfo.recordData.splice(this.currentIndex+1, 0, tempForm);
199
+
200
+
201
+
198 202
             }
199 203
           }
200 204
         }
201 205
 
202 206
         this.currentIndex = -1
203 207
       }, cancle: function() {
204
-        this.isVisibility = false
208
+        this.$refs.dialog.hide()
209
+
205 210
       }, GetConfigInfo: function() {
206 211
         const params = {
207 212
           type: this.$route.query.type
@@ -292,7 +297,7 @@
292 297
           this.$message.error('请先选择厂商')
293 298
           return
294 299
         } else {
295
-          this.isVisibility = true
300
+          this.$refs.dialog.show()
296 301
           console.log(this.form.manufacturer)
297 302
           for (let i = 0; i < this.propForm.goodInfo.length; i++) {
298 303
             if (this.propForm.goodInfo[i].manufacturer == this.form.manufacturer) {

+ 13 - 19
src/xt_pages/stock/cancelStockOrderEdit.vue Visa fil

@@ -8,7 +8,7 @@
8 8
       </div>
9 9
     </div>
10 10
     <div class="app-container">
11
-      <sales-return-dialog :propForm="propForm"
11
+      <sales-return-dialog ref="dialog" :propForm="propForm"
12 12
                            :visibility="isVisibility"
13 13
                            v-on:dialog-comfirm="comfirm"
14 14
                            v-on:dialog-cancle="cancle"></sales-return-dialog>
@@ -166,7 +166,8 @@
166 166
     },
167 167
     methods: {
168 168
       comfirm: function(val) {
169
-        this.isVisibility = false
169
+        this.$refs.dialog.hide()
170
+
170 171
         if (val.selectedGoodInfo.length > 0) {
171 172
           for (let i = val.selectedGoodInfo.length - 1; ; i--) {
172 173
             if (i == 0) {
@@ -178,14 +179,16 @@
178 179
               tempForm['good_type_id'] = val.goodTypeId
179 180
               tempForm['good_id'] = val.selectedGoodInfo[i].id
180 181
               tempForm['count'] = ''
181
-              this.recordInfo.recordData.push(tempForm)
182
+              this.recordInfo.recordData.splice(this.currentIndex+1, 0, tempForm);
183
+
182 184
             }
183 185
           }
184 186
         }
185 187
 
186 188
         this.currentIndex = -1
187 189
       }, cancle: function() {
188
-        this.isVisibility = false
190
+        this.$refs.dialog.hide()
191
+
189 192
       }, GetConfigInfo: function() {
190 193
         const params = {
191 194
           type: this.$route.query.type
@@ -252,12 +255,8 @@
252 255
                 this.$message.error(response.data.msg)
253 256
                 return false
254 257
               } else {
255
-                this.$notify({
256
-                  title: '成功',
257
-                  message: '删除成功',
258
-                  type: 'success',
259
-                  duration: 2000
260
-                })
258
+
259
+                this.$message.success("删除成功")
261 260
                 this.recordInfo.recordData.splice(index, 1)
262 261
               }
263 262
             })
@@ -272,9 +271,6 @@
272 271
         }
273 272
       }, showDialog(index, row) {
274 273
         this.currentIndex = index
275
-
276
-        this.isVisibility = true
277
-        console.log(this.form.manufacturer)
278 274
         for (let i = 0; i < this.propForm.goodInfo.length; i++) {
279 275
           if (this.propForm.goodInfo[i].manufacturer == this.form.manufacturer) {
280 276
             this.propForm.goodType.push(this.propForm.goodInfo[i].GoodsType)
@@ -285,6 +281,7 @@
285 281
           obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
286 282
           return cur
287 283
         }, [])
284
+        this.$refs.dialog.show()
288 285
       }, back() {
289 286
         this.$router.go(-1)
290 287
       }, submit() {
@@ -310,12 +307,9 @@
310 307
                 this.$message.error(response.data.msg)
311 308
                 return false
312 309
               } else {
313
-                this.$notify({
314
-                  title: '成功',
315
-                  message: '退库成功',
316
-                  type: 'success',
317
-                  duration: 2000
318
-                })
310
+
311
+                this.$message.success('退库成功')
312
+
319 313
                 this.$router.back(-1)
320 314
               }
321 315
             })

+ 23 - 35
src/xt_pages/stock/config/dealer.vue Visa fil

@@ -2,7 +2,7 @@
2 2
 
3 3
   <div class=" sign-and-weigh-box" style="background: white">
4 4
 
5
-    <manufacturer-or-dealer-dialog :titles="dealerDialog.titles" :formValue="dealerDialog.formValue"
5
+    <manufacturer-or-dealer-dialog ref="dialog" :titles="dealerDialog.titles" :formValue="dealerDialog.formValue"
6 6
                                    :visibility="dealerDialog.isVisibility"
7 7
                                    :type="dealerDialog.type" :isCreated="dealerDialog.isCreated"
8 8
                                    v-on:dialog-comfirm="manufacturerDialogComfirm"
@@ -20,35 +20,34 @@
20 20
 
21 21
         <!--<el-button style="float:right;margin-bottom: 10px" type="primary" @click="showDialog">新增经销商</el-button>-->
22 22
 
23
-        <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" :data="dealerData" :class="signAndWeighBoxPatients" style="width: 100%" border
23
+        <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" :data="dealerData"  style="width: 100%" border
24 24
                   v-loading="loading"
25 25
         >
26 26
 
27
-          <el-table-column type="index" label="序号" min-width="20" align="center"></el-table-column>
28
-          <el-table-column label="经销商编码" min-width="30" align="center">
27
+          <el-table-column label="经销商编码"  align="center">
29 28
             <template slot-scope="scope">
30 29
               {{scope.row.dealer_code}}
31 30
             </template>
32 31
           </el-table-column>
33
-          <el-table-column label="经销商名称" min-width="30" align="center">
32
+          <el-table-column label="经销商名称" align="center">
34 33
             <template slot-scope="scope">
35 34
               {{scope.row.dealer_name}}
36 35
 
37 36
             </template>
38 37
           </el-table-column>
39
-          <el-table-column label="联系人" min-width="30" align="center">
38
+          <el-table-column label="联系人" align="center">
40 39
             <template slot-scope="scope">
41 40
               {{scope.row.contact}}
42 41
 
43 42
             </template>
44 43
           </el-table-column>
45
-          <el-table-column label="联系人电话" min-width="30" align="center">
44
+          <el-table-column label="联系人电话"  align="center">
46 45
             <template slot-scope="scope">
47 46
               {{scope.row.contact_phone}}
48 47
 
49 48
             </template>
50 49
           </el-table-column>
51
-          <el-table-column label="联系地址" min-width="70" align="center">
50
+          <el-table-column label="联系地址"  align="center">
52 51
             <template slot-scope="scope">
53 52
               {{scope.row.contact_address}}
54 53
             </template>
@@ -72,11 +71,6 @@
72 71
                 </el-button>
73 72
               </el-tooltip>
74 73
 
75
-              <!--<el-button-->
76
-                <!--size="mini"-->
77
-                <!--type="primary"-->
78
-                <!--@click="showDetails(scope.$index, scope.row)">查看详情-->
79
-              <!--</el-button>-->
80 74
             </template>
81 75
           </el-table-column>
82 76
 
@@ -186,7 +180,8 @@
186 180
             this.dealerDialog.formValue.contact_address = response.data.data.dealer.contact_address
187 181
             this.dealerDialog.formValue.remark = response.data.data.dealer.remark
188 182
             this.dealerDialog.isCreated = 2
189
-            this.dealerDialog.isVisibility = true
183
+            this.$refs.dialog.show()
184
+
190 185
             this.dealer_code = response.data.data.dealer.dealer_code
191 186
 
192 187
           }
@@ -211,12 +206,8 @@
211 206
               return false;
212 207
             } else {
213 208
               this.dealerData.splice(index, 1);
214
-              this.$notify({
215
-                title: "成功",
216
-                message: "经销商信息已经删除",
217
-                type: "success",
218
-                duration: 2000
219
-              });
209
+
210
+              this.$message.success("删除成功")
220 211
             }
221 212
           });
222 213
         }).catch(() => {
@@ -246,7 +237,8 @@
246 237
         });
247 238
       },
248 239
       manufacturerDialogComfirm: function (val) {
249
-        this.dealerDialog.isVisibility = false
240
+        this.$refs.dialog.hide()
241
+
250 242
 
251 243
         if (val.isCreated == 2) { //修改
252 244
           let params = {
@@ -273,12 +265,9 @@
273 265
               this.dealerData[this.editIndex].contact_address = response.data.data.dealer.contact_address
274 266
               this.dealerData[this.editIndex].remark = response.data.data.dealer.remark
275 267
               this.dealerData[this.editIndex].dealer_code = response.data.data.dealer.dealer_code
276
-              this.$notify({
277
-                title: "成功",
278
-                message: "修改成功",
279
-                type: "success",
280
-                duration: 2000
281
-              });
268
+
269
+              this.$message.success("修改成功")
270
+
282 271
 
283 272
             }
284 273
           });
@@ -290,12 +279,9 @@
290 279
               return false;
291 280
             } else {
292 281
               this.dealerData.unshift(response.data.data.dealer)
293
-              this.$notify({
294
-                title: "成功",
295
-                message: "新增成功",
296
-                type: "success",
297
-                duration: 2000
298
-              });
282
+
283
+              this.$message.success("新增成功")
284
+
299 285
 
300 286
             }
301 287
           });
@@ -305,12 +291,14 @@
305 291
 
306 292
       },
307 293
       manufacturerDialogCancle: function () {
308
-        this.dealerDialog.isVisibility = false
294
+        this.$refs.dialog.hide()
295
+
309 296
       },
310 297
       showDialog: function () {
311 298
         // this.manufacturerDialog.formValue = {}
312 299
         this.dealerDialog.formValue = Object.assign({}, this.dealerDialog.resetForm)
313
-        this.dealerDialog.isVisibility = true
300
+        this.$refs.dialog.show()
301
+
314 302
         this.dealerDialog.isCreated = 1
315 303
 
316 304
       }, handleSizeChange(val) {

+ 23 - 35
src/xt_pages/stock/config/goodInfo.vue Visa fil

@@ -3,7 +3,7 @@
3 3
   <div class=" sign-and-weigh-box" style="background: white">
4 4
 
5 5
 
6
-    <good-info-dailog :titles="goodInfo.goodInfoDialog.goodInfoTitle" :formValue="goodInfo.goodInfoDialog.formValue"
6
+    <good-info-dailog ref="dialog" :titles="goodInfo.goodInfoDialog.goodInfoTitle" :formValue="goodInfo.goodInfoDialog.formValue"
7 7
                       :visibility="goodInfo.goodInfoDialog.isVisibility"
8 8
                       :isCreated="goodInfo.goodInfoDialog.isCreated" v-on:dialog-comfirm="goodInfoDialogComfirm"
9 9
                       v-on:dialog-cancle="goodInfoDialogCancle"></good-info-dailog>
@@ -17,43 +17,43 @@
17 17
           <el-button size="small" icon="el-icon-circle-plus-outline" style="float: right;margin-bottom: 15px" type="primary" @click="showInfoDialog">新增</el-button>
18 18
         </div>
19 19
 
20
-        <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" :data="goodInfo.goodInfoData" :class="signAndWeighBoxPatients" style="width: 100%" border
20
+        <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" :data="goodInfo.goodInfoData"  style="width: 100%" border
21 21
                   v-loading="goodInfo.loading"
22 22
         >
23
-          <el-table-column label="商品编码" min-width="30" align="center">
23
+          <el-table-column label="商品编码"  align="center">
24 24
             <template slot-scope="scope">
25 25
               {{scope.row.good_code}}
26 26
             </template>
27 27
           </el-table-column>
28
-          <el-table-column label="规格名称" min-width="30" align="center">
28
+          <el-table-column label="规格名称"  align="center">
29 29
             <template slot-scope="scope">
30 30
               {{scope.row.specification_name}}
31 31
 
32 32
             </template>
33 33
           </el-table-column>
34 34
 
35
-          <el-table-column label="进价" min-width="30" align="center">
35
+          <el-table-column label="进价"  align="center">
36 36
             <template slot-scope="scope">
37 37
               {{scope.row.buy_price}}
38 38
 
39 39
             </template>
40 40
           </el-table-column>
41
-          <el-table-column label="出货价" min-width="30" align="center">
41
+          <el-table-column label="出货价"  align="center">
42 42
             <template slot-scope="scope">
43 43
               {{scope.row.sell_price}}
44 44
             </template>
45 45
           </el-table-column>
46
-          <el-table-column label="有效期预警" min-width="30" align="center">
46
+          <el-table-column label="有效期预警"  align="center">
47 47
             <template slot-scope="scope">
48 48
               {{scope.row.expiry_date_warn_day_count}}
49 49
             </template>
50 50
           </el-table-column>
51
-          <el-table-column label="库存预警" min-width="30" align="center">
51
+          <el-table-column label="库存预警" align="center">
52 52
             <template slot-scope="scope">
53 53
               {{scope.row.stock_warn_count}}
54 54
             </template>
55 55
           </el-table-column>
56
-          <el-table-column label="操作" align="center" min-width="100">
56
+          <el-table-column label="操作" align="center" >
57 57
             <template slot-scope="scope">
58 58
               <el-tooltip class="item" effect="dark" content="编辑" placement="top">
59 59
                 <el-button
@@ -72,11 +72,6 @@
72 72
                 </el-button>
73 73
               </el-tooltip>
74 74
 
75
-              <!--<el-button-->
76
-                <!--size="mini"-->
77
-                <!--type="primary"-->
78
-                <!--@click="showGoodInfoDetails(scope.$index, scope.row)">详情-->
79
-              <!--</el-button>-->
80 75
             </template>
81 76
           </el-table-column>
82 77
 
@@ -216,9 +211,10 @@
216 211
             this.goodInfo.goodInfoDialog.formValue.is_reuse = response.data.data.goodInfo.is_reuse.toString()
217 212
             this.goodInfo.goodInfoDialog.formValue.remark = response.data.data.goodInfo.remark
218 213
             this.goodInfo.goodInfoDialog.isCreated = 2
219
-            this.goodInfo.goodInfoDialog.isVisibility = true
220 214
             this.goodInfo.good_code = response.data.data.goodInfo.good_code
221 215
             this.goodInfo.goodInfoDialog.formValue.good_id =response.data.data.goodInfo.good_type_id
216
+            this.$refs.dialog.show()
217
+
222 218
           }
223 219
         });
224 220
 
@@ -242,12 +238,7 @@
242 238
               return false;
243 239
             } else {
244 240
               this.goodInfo.goodInfoData.splice(index, 1);
245
-              this.$notify({
246
-                title: "成功",
247
-                message: "商品信息已经删除",
248
-                type: "success",
249
-                duration: 2000
250
-              });
241
+              this.$message.success("删除成功")
251 242
             }
252 243
           });
253 244
         }).catch(() => {
@@ -327,7 +318,8 @@
327 318
         });
328 319
 
329 320
       }, goodInfoDialogComfirm: function (val) {
330
-        this.goodInfo.goodInfoDialog.isVisibility = false
321
+        this.$refs.dialog.hide()
322
+
331 323
         if (val.isCreated == 2) { //修改
332 324
           val['id'] = this.goodInfo.editGoodId
333 325
           val['good_code'] = this.goodInfo.good_code
@@ -343,12 +335,9 @@
343 335
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].sell_price = response.data.data.goodInfo.sell_price.toString()
344 336
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].expiry_date_warn_day_count = response.data.data.goodInfo.expiry_date_warn_day_count.toString()
345 337
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].stock_warn_count = response.data.data.goodInfo.stock_warn_count.toString()
346
-              this.$notify({
347
-                title: "成功",
348
-                message: "修改成功",
349
-                type: "success",
350
-                duration: 2000
351
-              });
338
+
339
+              this.$message.success("修改成功")
340
+
352 341
 
353 342
             }
354 343
           });
@@ -360,12 +349,9 @@
360 349
               return false;
361 350
             } else {
362 351
               this.goodInfo.goodInfoData.unshift(response.data.data.goodInfo)
363
-              this.$notify({
364
-                title: "成功",
365
-                message: "新增成功",
366
-                type: "success",
367
-                duration: 2000
368
-              });
352
+
353
+              this.$message.success("新增成功")
354
+
369 355
 
370 356
             }
371 357
           });
@@ -374,9 +360,11 @@
374 360
 
375 361
       },
376 362
       goodInfoDialogCancle: function () {
377
-        this.goodInfo.goodInfoDialog.isVisibility = false
363
+        this.$refs.dialog.hide()
364
+
378 365
 
379 366
       }, showInfoDialog: function () {
367
+        this.$refs.dialog.show()
380 368
         this.getAllDealer()
381 369
         this.getAllManufacturer()
382 370
         this.goodInfo.goodInfoDialog.formValue.goodType = []

+ 19 - 27
src/xt_pages/stock/config/goodType.vue Visa fil

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
 
3 3
   <div class=" sign-and-weigh-box" style="background: white">
4
-    <good-type-dialog :titles="goodType.goodTypeDialog.goodTypeTitle" :formValue="goodType.goodTypeDialog.formValue"
4
+    <good-type-dialog ref="dialog" :titles="goodType.goodTypeDialog.goodTypeTitle" :formValue="goodType.goodTypeDialog.formValue"
5 5
                       :visibility="goodType.goodTypeDialog.isVisibility"
6 6
                       :isCreated="goodType.goodTypeDialog.isCreated" v-on:dialog-comfirm="goodTypeDialogComfirm"
7 7
                       v-on:dialog-cancle="goodTypeDialogCancle"></good-type-dialog>
@@ -18,23 +18,23 @@
18 18
 
19 19
         <div style="margin-bottom: 10px;">
20 20
         </div>
21
-        <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" :data="goodType.goodTypeData" :class="signAndWeighBoxPatients" style="width: 100%" border
21
+        <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" :data="goodType.goodTypeData"  style="width: 100%" border
22 22
                   highlight-current-row
23 23
                   @row-click="onRowClick"
24 24
                   :row-class-name="tableRowClassName"
25 25
                   v-loading="goodType.loading"
26 26
         >
27
-          <el-table-column label="类型编码" min-width="30" align="center">
27
+          <el-table-column label="类型编码" align="center">
28 28
             <template slot-scope="scope">
29 29
               {{scope.row.type_code}}
30 30
             </template>
31 31
           </el-table-column>
32
-          <el-table-column label="类型名称" min-width="30" align="center">
32
+          <el-table-column label="类型名称" align="center">
33 33
             <template slot-scope="scope">
34 34
               {{scope.row.type_name}}
35 35
             </template>
36 36
           </el-table-column>
37
-          <el-table-column label="操作" align="center" min-width="70">
37
+          <el-table-column label="操作" align="center" >
38 38
             <template slot-scope="scope">
39 39
               <el-tooltip class="item" effect="dark" content="编辑" placement="top">
40 40
                 <el-button
@@ -208,7 +208,7 @@
208 208
             this.goodType.goodTypeDialog.formValue.remark = response.data.data.goodType.remark
209 209
             this.goodType.goodTypeDialog.formValue.type_name = response.data.data.goodType.type_name
210 210
             this.goodType.goodTypeDialog.isCreated = 2
211
-            this.goodType.goodTypeDialog.isVisibility = true
211
+            this.$refs.dialog.show()
212 212
             this.goodType.type_code = response.data.data.goodType.type_code
213 213
 
214 214
           }
@@ -233,12 +233,8 @@
233 233
             } else {
234 234
               this.goodType.goodTypeData.splice(index, 1);
235 235
               this.goodType.tableCurrentIndex = -1
236
-              this.$notify({
237
-                title: "成功",
238
-                message: "商品类型已经删除",
239
-                type: "success",
240
-                duration: 2000
241
-              });
236
+
237
+              this.$message.success("删除成功")
242 238
             }
243 239
           });
244 240
         }).catch(() => {
@@ -265,7 +261,7 @@
265 261
 
266 262
 
267 263
       goodTypeDialogComfirm: function (val) {
268
-        this.goodType.goodTypeDialog.isVisibility = false
264
+        this.$refs.dialog.hide()
269 265
 
270 266
         if (val.isCreated == 2) { //修改
271 267
           let params = {
@@ -283,12 +279,9 @@
283 279
             } else {
284 280
               this.goodType.goodTypeData[this.goodType.editTypeIndex].type_name = response.data.data.goodTypes.type_name
285 281
               this.goodType.goodTypeData[this.goodType.editTypeIndex].remark = response.data.data.goodTypes.remark
286
-              this.$notify({
287
-                title: "成功",
288
-                message: "修改成功",
289
-                type: "success",
290
-                duration: 2000
291
-              });
282
+
283
+              this.$message.success("修改成功")
284
+
292 285
 
293 286
             }
294 287
           });
@@ -300,12 +293,9 @@
300 293
               return false;
301 294
             } else {
302 295
               this.goodType.goodTypeData.unshift(response.data.data.goodTypes)
303
-              this.$notify({
304
-                title: "成功",
305
-                message: "新增成功",
306
-                type: "success",
307
-                duration: 2000
308
-              });
296
+
297
+              this.$message.success("新增成功")
298
+
309 299
 
310 300
             }
311 301
           });
@@ -314,11 +304,13 @@
314 304
 
315 305
       },
316 306
       goodTypeDialogCancle: function () {
317
-        this.goodType.goodTypeDialog.isVisibility = false
307
+        this.$refs.dialog.hide()
308
+
318 309
 
319 310
 
320 311
       }, showDialog: function () {
321
-        this.goodType.goodTypeDialog.isVisibility = true
312
+        this.$refs.dialog.show()
313
+
322 314
 
323 315
       }, getList() {
324 316
         this.goodType.loading = true

+ 149 - 216
src/xt_pages/stock/config/manufacturer.vue Visa fil

@@ -1,97 +1,97 @@
1 1
 <template>
2
-<div class="main-contain">
3
-  <div class=" sign-and-weigh-box" style="background: white">
4
-
5
-    <manufacturer-or-dealer-dialog :titles="manufacturerDialog.titles" :formValue="manufacturerDialog.formValue"
6
-                                   :visibility="manufacturerDialog.isVisibility"
7
-                                   :type="manufacturerDialog.type" :isCreated="manufacturerDialog.isCreated"
8
-                                   v-on:dialog-comfirm="manufacturerDialogComfirm"
9
-                                   v-on:dialog-cancle="manufacturerDialogCancle"></manufacturer-or-dealer-dialog>
10
-
11
-    <el-row>
12
-      <el-col>
13
-
14
-        <div>
15
-          <el-button size="small" icon="el-icon-circle-plus-outline" style="float: right;margin-bottom: 15px" type="primary" @click="showDialog">新增</el-button>
16
-        </div>
17
-
18
-        <!--<div class="dataTitle"></div>-->
19
-
20
-        <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" :data="manufacturerData" :class="signAndWeighBoxPatients" style="width: 100%" border
21
-                  v-loading="loading"
22
-        >
23
-          <el-table-column type="index" label="序号" min-width="20" align="center"></el-table-column>
24
-          <el-table-column label="厂家编码" min-width="30" align="center">
25
-            <template slot-scope="scope">
26
-              {{scope.row.manufacturer_code}}
27
-            </template>
28
-          </el-table-column>
29
-          <el-table-column label="厂家名称" min-width="30" align="center">
30
-            <template slot-scope="scope">
31
-              {{scope.row.manufacturer_name}}
32
-
33
-            </template>
34
-          </el-table-column>
35
-          <el-table-column label="联系人" min-width="30" align="center">
36
-            <template slot-scope="scope">
37
-              {{scope.row.contact}}
38
-
39
-            </template>
40
-          </el-table-column>
41
-          <el-table-column label="联系人电话" min-width="30" align="center">
42
-            <template slot-scope="scope">
43
-              {{scope.row.contact_phone}}
44
-
45
-            </template>
46
-          </el-table-column>
47
-          <el-table-column label="联系地址" min-width="70" align="center">
48
-            <template slot-scope="scope">
49
-              {{scope.row.contact_address}}
50
-            </template>
51
-          </el-table-column>
52
-          <el-table-column label="操作" align="center">
53
-            <template slot-scope="scope">
54
-              <el-tooltip class="item" effect="dark" content="编辑" placement="top">
55
-                <el-button
56
-                  size="small"
57
-                  type="primary"
58
-                  icon="el-icon-edit-outline"
59
-                  @click="handleEdit(scope.$index, scope.row)">
60
-                </el-button>
61
-              </el-tooltip>
62
-              <el-tooltip class="item" effect="dark" content="删除" placement="top">
63
-                <el-button
64
-                  size="small"
65
-                  type="danger"
66
-                  icon="el-icon-delete"
67
-                  @click="handleDelete(scope.$index, scope.row)">
68
-                </el-button>
69
-              </el-tooltip>
70
-              <!--<el-button-->
2
+  <div class="main-contain">
3
+    <div class=" sign-and-weigh-box" style="background: white">
4
+
5
+      <manufacturer-or-dealer-dialog ref="dialog" :titles="manufacturerDialog.titles" :formValue="manufacturerDialog.formValue"
6
+                                     :visibility="manufacturerDialog.isVisibility"
7
+                                     :type="manufacturerDialog.type" :isCreated="manufacturerDialog.isCreated"
8
+                                     v-on:dialog-comfirm="manufacturerDialogComfirm"
9
+                                     v-on:dialog-cancle="manufacturerDialogCancle"></manufacturer-or-dealer-dialog>
10
+
11
+      <el-row :gutter="15">
12
+        <el-col>
13
+
14
+          <div>
15
+            <el-button size="small" icon="el-icon-circle-plus-outline" style="float: right;margin-bottom: 15px"
16
+                       type="primary" @click="showDialog">新增
17
+            </el-button>
18
+          </div>
19
+
20
+
21
+          <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" :data="manufacturerData"
22
+                    style="width: 100%" border
23
+                    v-loading="loading"
24
+          >
25
+            <el-table-column label="厂家编码" align="center">
26
+              <template slot-scope="scope">
27
+                {{scope.row.manufacturer_code}}
28
+              </template>
29
+            </el-table-column>
30
+            <el-table-column label="厂家名称" align="center">
31
+              <template slot-scope="scope">
32
+                {{scope.row.manufacturer_name}}
33
+
34
+              </template>
35
+            </el-table-column>
36
+            <el-table-column label="联系人" align="center">
37
+              <template slot-scope="scope">
38
+                {{scope.row.contact}}
39
+
40
+              </template>
41
+            </el-table-column>
42
+            <el-table-column label="联系人电话" align="center">
43
+              <template slot-scope="scope">
44
+                {{scope.row.contact_phone}}
45
+
46
+              </template>
47
+            </el-table-column>
48
+            <el-table-column label="联系地址" align="center">
49
+              <template slot-scope="scope">
50
+                {{scope.row.contact_address}}
51
+              </template>
52
+            </el-table-column>
53
+            <el-table-column label="操作" align="center">
54
+              <template slot-scope="scope">
55
+                <el-tooltip class="item" effect="dark" content="编辑" placement="top">
56
+                  <el-button
57
+                    size="small"
58
+                    type="primary"
59
+                    icon="el-icon-edit-outline"
60
+                    @click="handleEdit(scope.$index, scope.row)">
61
+                  </el-button>
62
+                </el-tooltip>
63
+                <el-tooltip class="item" effect="dark" content="删除" placement="top">
64
+                  <el-button
65
+                    size="small"
66
+                    type="danger"
67
+                    icon="el-icon-delete"
68
+                    @click="handleDelete(scope.$index, scope.row)">
69
+                  </el-button>
70
+                </el-tooltip>
71
+                <!--<el-button-->
71 72
                 <!--size="mini"-->
72 73
                 <!--type="primary"-->
73 74
                 <!--@click="showDetails(scope.$index, scope.row)">查看详情-->
74
-              <!--</el-button>-->
75
-            </template>
76
-          </el-table-column>
77
-        </el-table>
78
-
79
-        <el-pagination
80
-          @size-change="handleSizeChange"
81
-          @current-change="handleCurrentChange"
82
-          :page-sizes="[7]"
83
-          :page-size="7"
84
-          background
85
-          align="right"
86
-          style="margin-top:20px;"
87
-          layout="total, sizes, prev, pager, next, jumper"
88
-          :total="total">
89
-        </el-pagination>
90
-
91
-      </el-col>
92
-    </el-row>
75
+                <!--</el-button>-->
76
+              </template>
77
+            </el-table-column>
78
+          </el-table>
79
+
80
+          <el-pagination
81
+            @size-change="handleSizeChange"
82
+            @current-change="handleCurrentChange"
83
+            :page-sizes="[7]"
84
+            :page-size="7"
85
+            background
86
+            align="right"
87
+            style="margin-top:20px;"
88
+            layout="total, sizes, prev, pager, next, jumper"
89
+            :total="total">
90
+          </el-pagination>
91
+          </el-col>
92
+      </el-row>
93
+    </div>
93 94
   </div>
94
-</div>
95 95
 
96 96
 </template>
97 97
 
@@ -99,17 +99,17 @@
99 99
   import manufacturerOrDealerDialog from '../Dialog/manufacturerOrDealerDialog'
100 100
   import {
101 101
     createManufacturer,
102
-    modifyManufacturer,
103
-    getManufacturerList,
104 102
     deleteManufacturer,
105
-    GetManufacturer
106
-  } from "@/api/stock";
103
+    GetManufacturer,
104
+    getManufacturerList,
105
+    modifyManufacturer
106
+  } from '@/api/stock'
107 107
 
108 108
   export default {
109 109
     components: {
110
-      manufacturerOrDealerDialog,
110
+      manufacturerOrDealerDialog
111 111
     },
112
-    name: "manufacturer",
112
+    name: 'manufacturer',
113 113
     data() {
114 114
       return {
115 115
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
@@ -120,11 +120,11 @@
120 120
 
121 121
         page: 1,
122 122
         limit: 7,
123
-        loading:false,
123
+        loading: false,
124 124
 
125 125
         manufacturer_code: '',
126 126
         editId: '',
127
-        editIndex:'',
127
+        editIndex: '',
128 128
         manufacturerDialog: {
129 129
           titles: '新增厂家',
130 130
           isVisibility: false,
@@ -138,7 +138,7 @@
138 138
             platform_number: '',
139 139
             email: '',
140 140
             contact_address: '',
141
-            remark: '',
141
+            remark: ''
142 142
           },
143 143
           resetForm: {
144 144
             manufacturer_name: '',
@@ -148,15 +148,14 @@
148 148
             platform_number: '',
149 149
             email: '',
150 150
             contact_address: '',
151
-            remark: '',
152
-          },
151
+            remark: ''
152
+          }
153 153
         }
154 154
 
155
-
156
-      };
155
+      }
157 156
     },
158 157
     methods: {
159
-      handleEdit: function (index, row) {
158
+      handleEdit: function(index, row) {
160 159
         this.editId = row.id
161 160
         this.editIndex = index
162 161
         let params = {
@@ -164,8 +163,8 @@
164 163
         }
165 164
         GetManufacturer(params).then(response => {
166 165
           if (response.data.state == 0) {
167
-            this.$message.error(response.data.msg);
168
-            return false;
166
+            this.$message.error(response.data.msg)
167
+            return false
169 168
           } else {
170 169
             this.manufacturerDialog.formValue.manufacturer_name = response.data.data.manufacturer.manufacturer_name
171 170
             this.manufacturerDialog.formValue.contact = response.data.data.manufacturer.contact
@@ -175,15 +174,14 @@
175 174
             this.manufacturerDialog.formValue.contact_address = response.data.data.manufacturer.contact_address
176 175
             this.manufacturerDialog.formValue.remark = response.data.data.manufacturer.remark
177 176
             this.manufacturerDialog.isCreated = 2
178
-            this.manufacturerDialog.isVisibility = true
177
+            this.$refs.dialog.show()
179 178
             this.manufacturer_code = response.data.data.manufacturer.manufacturer_code
180 179
 
181 180
           }
182
-        });
181
+        })
183 182
 
184 183
       },
185
-      handleDelete: function (index, row) {
186
-
184
+      handleDelete: function(index, row) {
187 185
 
188 186
         this.$confirm('确认删除这条厂家信息?', '删除厂家信息', {
189 187
           confirmButtonText: '确定',
@@ -196,31 +194,25 @@
196 194
 
197 195
           deleteManufacturer(params).then(response => {
198 196
             if (response.data.state == 0) {
199
-              this.$message.error(response.data.msg);
200
-              return false;
197
+              this.$message.error(response.data.msg)
198
+              return false
201 199
             } else {
202
-              this.manufacturerData.splice(index, 1);
203
-              this.$notify({
204
-                title: "成功",
205
-                message: "厂家已经删除",
206
-                type: "success",
207
-                duration: 2000
208
-              });
200
+              this.manufacturerData.splice(index, 1)
201
+              this.$message.success("厂家已经删除")
209 202
             }
210
-          });
203
+          })
211 204
         }).catch(() => {
212
-        });
213
-
205
+        })
214 206
 
215 207
       },
216
-      showDetails: function (index, row) {
208
+      showDetails: function(index, row) {
217 209
         let params = {
218 210
           id: row.id
219 211
         }
220 212
         GetManufacturer(params).then(response => {
221 213
           if (response.data.state == 0) {
222
-            this.$message.error(response.data.msg);
223
-            return false;
214
+            this.$message.error(response.data.msg)
215
+            return false
224 216
           } else {
225 217
             this.manufacturerDialog.formValue.manufacturer_name = response.data.data.manufacturer.manufacturer_name
226 218
             this.manufacturerDialog.formValue.contact = response.data.data.manufacturer.contact
@@ -232,11 +224,11 @@
232 224
             this.manufacturerDialog.isCreated = 3
233 225
             this.manufacturerDialog.isVisibility = true
234 226
           }
235
-        });
227
+        })
236 228
       },
237
-      manufacturerDialogComfirm: function (val) {
238
-        this.manufacturerDialog.isVisibility = false
239
-
229
+      manufacturerDialogComfirm: function(val) {
230
+        // this.manufacturerDialog.isVisibility = false
231
+        this.$refs.dialog.hide()
240 232
         if (val.isCreated == 2) { //修改
241 233
           let params = {
242 234
             'manufacturer_name': val.manufacturer_name,
@@ -251,8 +243,8 @@
251 243
           }
252 244
           modifyManufacturer(params).then(response => {
253 245
             if (response.data.state == 0) {
254
-              this.$message.error(response.data.msg);
255
-              return false;
246
+              this.$message.error(response.data.msg)
247
+              return false
256 248
             } else {
257 249
               this.manufacturerData[this.editIndex].manufacturer_name = response.data.data.manufacturer.manufacturer_name
258 250
               this.manufacturerData[this.editIndex].contact = response.data.data.manufacturer.contact
@@ -262,62 +254,57 @@
262 254
               this.manufacturerData[this.editIndex].contact_address = response.data.data.manufacturer.contact_address
263 255
               this.manufacturerData[this.editIndex].remark = response.data.data.manufacturer.remark
264 256
               this.manufacturerData[this.editIndex].manufacturer_code = response.data.data.manufacturer.manufacturer_code
265
-              this.$notify({
266
-                title: "成功",
267
-                message: "修改成功",
268
-                type: "success",
269
-                duration: 2000
270
-              });
257
+
258
+
259
+              this.$message.success("修改成功")
260
+
271 261
 
272 262
             }
273
-          });
263
+          })
274 264
 
275 265
         } else if (val.isCreated == 1) { //新增
276 266
           createManufacturer(val).then(response => {
277 267
             if (response.data.state == 0) {
278
-              this.$message.error(response.data.msg);
279
-              return false;
268
+              this.$message.error(response.data.msg)
269
+              return false
280 270
             } else {
281 271
               this.manufacturerData.unshift(response.data.data.manufacturer)
282
-              this.$notify({
283
-                title: "成功",
284
-                message: "新增成功",
285
-                type: "success",
286
-                duration: 2000
287
-              });
272
+
273
+              this.$message.success("新增成功")
274
+
288 275
 
289 276
             }
290
-          });
277
+          })
291 278
 
292 279
         }
293 280
 
294
-
295 281
       },
296
-      manufacturerDialogCancle: function () {
297
-        this.manufacturerDialog.isVisibility = false
282
+      manufacturerDialogCancle: function() {
283
+        this.$refs.dialog.hide()
284
+
298 285
       },
299
-      showDialog: function () {
286
+      showDialog: function() {
300 287
         this.manufacturerDialog.formValue = Object.assign({}, this.manufacturerDialog.resetForm)
301
-        this.manufacturerDialog.isVisibility = true
288
+        this.$refs.dialog.show()
302 289
         this.manufacturerDialog.isCreated = 1
303 290
 
304 291
       }, handleSizeChange(val) {
305
-        this.limit = val;
306
-        this.getList();
292
+        this.limit = val
293
+        this.getList()
307 294
       }, handleCurrentChange(val) {
308
-        this.page = val;
309
-        this.getList();
310
-      },getList(){
295
+        this.page = val
296
+        this.getList()
297
+      }, getList() {
311 298
         let params = {
312
-          'page':this.page,
313
-          'limit':this.limit
299
+          'page': this.page,
300
+          'limit': this.limit
314 301
         }
315 302
         this.loading = true
316 303
         getManufacturerList(params).then(response => {
317 304
           if (response.data.state == 0) {
318 305
             this.loading = false
319
-            this.$message.error(response.data.msg);
320
-            return false;
306
+            this.$message.error(response.data.msg)
307
+            return false
321 308
           } else {
322 309
             this.loading = false
323 310
             this.total = response.data.data.total
@@ -326,7 +313,7 @@
326 313
               this.manufacturerData.push(response.data.data.manufacturer[i])
327 314
             }
328 315
           }
329
-        });
316
+        })
330 317
 
331 318
       }
332 319
     },
@@ -334,62 +321,8 @@
334 321
       this.getList()
335 322
 
336 323
     }
337
-  };
338
-</script>
339
-
340
-<style rel="stylesheet/css" lang="scss" scoped>
341
-  .information {
342
-    border: 1px #dcdfe6 solid;
343
-    padding: 30px 20px 30px 20px;
344
-
345
-    .border {
346
-      border-bottom: 1px #dcdfe6 solid;
347
-      margin: 0px 0 20px 0;
348
-    }
349
-  }
350
-
351
-  .title {
352
-    height: 44px;
353
-    line-height: 44px;
354
-    padding: 0 0 0 10px;
355
-    margin: 0 0 10px 0;
356
-    // border-radius: 4px 4px 0 0;
357
-  }
358
-
359
-  .edit_separater {
360
-    border-top: 1px solid rgb(233, 233, 233);
361
-    margin-top: 15px;
362
-    margin-bottom: 15px;
363 324
   }
325
+</script>
364 326
 
365
-</style>
366 327
 
367
-<style>
368
-  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
369
-    font-size: 12px;
370
-  }
371 328
 
372
-  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
373
-    background: #6fb5fa;
374
-  }
375
-
376
-  .dataTitle {
377
-    color: #409eff;
378
-    font-size: 16px;
379
-    border-bottom: 1px #409eff solid;
380
-    height: 36px;
381
-    line-height: 30px;
382
-    margin: 0 0 15px 0;
383
-    position: relative;
384
-    padding: 0 0 6px 15px;
385
-  &::before {
386
-     position: absolute;
387
-     left: 0;
388
-     bottom: 10px;
389
-     content: "";
390
-     width: 2px;
391
-     height: 20px;
392
-     background: #409eff;
393
-   }
394
-  }
395
-</style>

+ 0 - 2
src/xt_pages/stock/otherCancelStockOrder.vue Visa fil

@@ -33,7 +33,6 @@
33 33
 
34 34
       </div>
35 35
 
36
-      <el-row :gutter="12" style="margin-top: 10px">
37 36
         <el-table
38 37
           :data="cancelStockDate"
39 38
           :class="signAndWeighBoxPatients"
@@ -115,7 +114,6 @@
115 114
           :total="total">
116 115
         </el-pagination>
117 116
 
118
-      </el-row>
119 117
     </div>
120 118
   </div>
121 119
 </template>

+ 14 - 19
src/xt_pages/stock/salesReturnEdit.vue Visa fil

@@ -10,7 +10,7 @@
10 10
 
11 11
   <div class="app-container">
12 12
 
13
-    <sales-return-dialog :propForm="propForm"
13
+    <sales-return-dialog ref="dialog" :propForm="propForm"
14 14
                      :visibility="isVisibility"
15 15
                      v-on:dialog-comfirm="comfirm"
16 16
                      v-on:dialog-cancle="cancle"></sales-return-dialog>
@@ -172,7 +172,8 @@
172 172
     },
173 173
     methods: {
174 174
       comfirm: function(val) {
175
-        this.isVisibility = false
175
+        this.$refs.dialog.hide()
176
+
176 177
         if (val.selectedGoodInfo.length > 0) {
177 178
           for (let i = val.selectedGoodInfo.length - 1; ; i--) {
178 179
             if (i == 0) {
@@ -184,14 +185,17 @@
184 185
               tempForm['good_type_id'] = val.goodTypeId
185 186
               tempForm['good_id'] = val.selectedGoodInfo[i].id
186 187
               tempForm['count'] = ''
187
-              this.recordInfo.recordData.push(tempForm)
188
+              this.recordInfo.recordData.splice(this.currentIndex+1, 0, tempForm);
189
+
188 190
             }
189 191
           }
190 192
         }
191 193
 
192 194
         this.currentIndex = -1
193 195
       }, cancle: function() {
194
-        this.isVisibility = false
196
+
197
+        this.$refs.dialog.hide()
198
+
195 199
       }, GetConfigInfo: function() {
196 200
         const params = {
197 201
           type: this.$route.query.type
@@ -264,12 +268,8 @@
264 268
                 this.$message.error(response.data.msg)
265 269
                 return false
266 270
               } else {
267
-                this.$notify({
268
-                  title: '成功',
269
-                  message: '删除成功',
270
-                  type: 'success',
271
-                  duration: 2000
272
-                })
271
+
272
+                this.$message.success("删除成功")
273 273
                 this.recordInfo.recordData.splice(index, 1)
274 274
               }
275 275
             })
@@ -284,9 +284,7 @@
284 284
         }
285 285
       }, showDialog(index, row) {
286 286
         this.currentIndex = index
287
-
288
-        this.isVisibility = true
289
-        console.log(this.form.manufacturer)
287
+        this.$refs.dialog.show()
290 288
         for (let i = 0; i < this.propForm.goodInfo.length; i++) {
291 289
           if (this.propForm.goodInfo[i].manufacturer == this.form.manufacturer) {
292 290
             this.propForm.goodType.push(this.propForm.goodInfo[i].GoodsType)
@@ -322,12 +320,9 @@
322 320
                 this.$message.error(response.data.msg)
323 321
                 return false
324 322
               } else {
325
-                this.$notify({
326
-                  title: '成功',
327
-                  message: '退货成功',
328
-                  type: 'success',
329
-                  duration: 2000
330
-                })
323
+
324
+                this.$message.success('退货成功')
325
+
331 326
                 this.$router.back(-1)
332 327
               }
333 328
             })

+ 15 - 13
src/xt_pages/stock/salesReturnOrderAdd.vue Visa fil

@@ -9,7 +9,7 @@
9 9
     </div>
10 10
 
11 11
     <div class="app-container">
12
-      <sales-return-dialog :propForm="propForm"
12
+      <sales-return-dialog ref="dialog" :propForm="propForm"
13 13
                            :visibility="isVisibility"
14 14
                            v-on:dialog-comfirm="comfirm"
15 15
                            v-on:dialog-cancle="cancle"></sales-return-dialog>
@@ -22,7 +22,8 @@
22 22
 
23 23
 
24 24
       <div class="cell clearfix">
25
-        <label class="title"><span class="name">厂商</span> : </label>
25
+        <label class="title"><span class="name">厂商<span style="color: red;margin-left: -15px">*</span></span> : </label>
26
+
26 27
         <el-select v-model="form.manufacturer" clearable placeholder="请选择厂商" @change="changeManufacturer()">
27 28
           <el-option
28 29
             v-for="(option, index) in manufacturer"
@@ -191,7 +192,8 @@
191 192
     },
192 193
     methods: {
193 194
       comfirm: function(val) {
194
-        this.isVisibility = false
195
+        this.$refs.dialog.hide()
196
+
195 197
         if (val.selectedGoodInfo.length > 0) {
196 198
           for (let i = val.selectedGoodInfo.length - 1; ; i--) {
197 199
             if (i == 0) {
@@ -203,14 +205,17 @@
203 205
               tempForm['good_id'] = val.selectedGoodInfo[i].id
204 206
               tempForm['return_count'] = ''
205 207
               tempForm['price'] = ''
206
-              this.recordInfo.recordData.push(tempForm)
208
+              this.recordInfo.recordData.splice(this.currentIndex+1, 0, tempForm);
209
+
207 210
             }
208 211
           }
209 212
         }
210 213
 
211 214
         this.currentIndex = -1
212 215
       }, cancle: function() {
213
-        this.isVisibility = false
216
+
217
+        this.$refs.dialog.hide()
218
+
214 219
       }, GetConfigInfo: function() {
215 220
         const params = {
216 221
           type: this.type
@@ -303,8 +308,8 @@
303 308
           this.$message.error('请先选择厂商')
304 309
           return
305 310
         } else {
306
-          this.isVisibility = true
307
-          console.log(this.form.manufacturer)
311
+          this.$refs.dialog.show()
312
+
308 313
           for (let i = 0; i < this.propForm.goodInfo.length; i++) {
309 314
             if (this.propForm.goodInfo[i].manufacturer == this.form.manufacturer) {
310 315
               this.propForm.goodType.push(this.propForm.goodInfo[i].GoodsType)
@@ -346,12 +351,9 @@
346 351
                 this.$message.error(response.data.msg)
347 352
                 return false
348 353
               } else {
349
-                this.$notify({
350
-                  title: '成功',
351
-                  message: '退货成功',
352
-                  type: 'success',
353
-                  duration: 2000
354
-                })
354
+
355
+                this.$message.success('退货成功')
356
+
355 357
                 this.recordInfo.recordData = []
356 358
                 this.$router.back(-1)
357 359
               }

+ 16 - 12
src/xt_pages/stock/stockInOrderAdd.vue Visa fil

@@ -10,7 +10,7 @@
10 10
     </div>
11 11
     <div class="app-container">
12 12
 
13
-      <stock-in-dialog :propForm="propForm"
13
+      <stock-in-dialog ref="dialog" :propForm="propForm"
14 14
                        :visibility="isVisibility"
15 15
                        v-on:dialog-comfirm="comfirm"
16 16
                        v-on:dialog-cancle="cancle"></stock-in-dialog>
@@ -22,7 +22,8 @@
22 22
       </div>
23 23
 
24 24
       <div class="cell clearfix">
25
-        <label class="title"><span class="name">厂商</span> : </label>
25
+        <label class="title"><span class="name">厂商<span style="color: red;margin-left: -15px">*</span></span> : </label>
26
+
26 27
         <el-select  v-model="form.manufacturer" clearable  placeholder="请选择厂商" @change="changeManufacturer()" >
27 28
           <el-option
28 29
             v-for="(option, index) in manufacturer"
@@ -338,7 +339,7 @@
338 339
         this.propForm.isCreated = 1
339 340
         this.isVisibility = true
340 341
       }, comfirm: function(val) {
341
-        this.isVisibility = false
342
+        this.$refs.dialog.hide()
342 343
         if (val.selectedGoodInfo.length > 0) {
343 344
           for (let i = val.selectedGoodInfo.length - 1; ; i--) {
344 345
             if (i == 0) {
@@ -356,14 +357,17 @@
356 357
               tempForm['remark'] = ''
357 358
               tempForm['dealer'] = ''
358 359
               tempForm['manufacturer'] = ''
359
-              this.recordInfo.recordData.push(tempForm)
360
+              // this.recordInfo.recordData.add(tempForm,this.currentIndex + i)
361
+              // this.recordInfo.recordData.push(tempForm)
362
+              this.recordInfo.recordData.splice(this.currentIndex+1, 0, tempForm);
360 363
             }
361 364
           }
362 365
         }
363 366
 
364 367
         this.currentIndex = -1
365 368
       }, cancle: function() {
366
-        this.isVisibility = false
369
+        this.$refs.dialog.hide()
370
+
367 371
       }, GetAllGoodType: function() {
368 372
         GetAllGoodType().then(response => {
369 373
           if (response.data.state == 0) {
@@ -463,7 +467,8 @@
463 467
           this.$message.error('请先选择厂商')
464 468
           return
465 469
         } else {
466
-          this.isVisibility = true
470
+
471
+          // this.isVisibility = true
467 472
           const params = {
468 473
             id: this.form.manufacturer
469 474
           }
@@ -485,6 +490,8 @@
485 490
                   obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
486 491
                   return cur
487 492
                 }, []) // 设置cur默认类型为数组,并且初始值为空的数组
493
+                this.$refs.dialog.show()
494
+
488 495
               }
489 496
             }
490 497
           })
@@ -543,12 +550,9 @@
543 550
                 this.$message.error(response.data.msg)
544 551
                 return false
545 552
               } else {
546
-                this.$notify({
547
-                  title: '成功',
548
-                  message: '入库成功',
549
-                  type: 'success',
550
-                  duration: 2000
551
-                })
553
+
554
+                this.$message.success('入库成功')
555
+
552 556
                 this.$router.back(-1)
553 557
               }
554 558
             })

+ 2 - 3
src/xt_pages/stock/stockInOrderDetail.vue Visa fil

@@ -79,13 +79,12 @@
79 79
           </template>
80 80
         </el-table-column>
81 81
         <el-table-column label="生产日期" min-width="40" align="center">
82
-          <template slot-scope="scope">
82
+          <template v-if="scope.row.product_date != 0" slot-scope="scope">
83 83
             {{scope.row.product_date | parseTime('{y}-{m}-{d}')}}
84
-
85 84
           </template>
86 85
         </el-table-column>
87 86
         <el-table-column label="有效日期" min-width="40" align="center">
88
-          <template slot-scope="scope">
87
+          <template v-if="scope.row.product_date != 0" slot-scope="scope">
89 88
             {{ scope.row.expiry_date | parseTime('{y}-{m}-{d}')}}
90 89
           </template>
91 90
         </el-table-column>

+ 16 - 16
src/xt_pages/stock/stockInOrderEdit.vue Visa fil

@@ -10,7 +10,7 @@
10 10
 
11 11
   <div class="app-container">
12 12
 
13
-    <stock-in-dialog :propForm="propForm"
13
+    <stock-in-dialog ref="dialog" :propForm="propForm"
14 14
                      :visibility="isVisibility"
15 15
                      v-on:dialog-comfirm="comfirm"
16 16
                      v-on:dialog-cancle="cancle"></stock-in-dialog>
@@ -259,7 +259,8 @@ export default {
259 259
     methods: {
260 260
 
261 261
       comfirm: function(val) {
262
-        this.isVisibility = false
262
+        this.$refs.dialog.hide()
263
+
263 264
         if (val.selectedGoodInfo.length > 0) {
264 265
           for (let i = val.selectedGoodInfo.length - 1; ;i--) {
265 266
             if (i == 0) {
@@ -278,14 +279,16 @@ export default {
278 279
               tempForm['remark'] = ''
279 280
               tempForm['dealer'] = ''
280 281
               tempForm['manufacturer'] = ''
281
-              this.recordInfo.recordData.push(tempForm)
282
+              this.recordInfo.recordData.splice(this.currentIndex+1, 0, tempForm);
283
+
282 284
             }
283 285
           }
284 286
         }
285 287
 
286 288
         this.currentIndex = -1
287 289
       }, cancle: function() {
288
-        this.isVisibility = false
290
+        this.$refs.dialog.hide()
291
+
289 292
       }, GetConfigInfo: function() {
290 293
         GetAllConfig().then(response => {
291 294
           if (response.data.state == 0) {
@@ -345,12 +348,10 @@ export default {
345 348
                 this.$message.error(response.data.msg)
346 349
                 return false
347 350
               } else {
348
-                this.$notify({
349
-                  title: '成功',
350
-                  message: '删除成功',
351
-                  type: 'success',
352
-                  duration: 2000
353
-                })
351
+
352
+                this.$message.success("删除成功")
353
+
354
+
354 355
                 this.recordInfo.recordData.splice(index, 1)
355 356
               }
356 357
             })
@@ -396,6 +397,8 @@ export default {
396 397
                   obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
397 398
                   return cur
398 399
                 }, []) // 设置cur默认类型为数组,并且初始值为空的数组
400
+                this.$refs.dialog.show()
401
+
399 402
               }
400 403
             }
401 404
           })
@@ -425,12 +428,9 @@ export default {
425 428
                 this.$message.error(response.data.msg)
426 429
                 return false
427 430
               } else {
428
-                this.$notify({
429
-                  title: '成功',
430
-                  message: '入库成功',
431
-                  type: 'success',
432
-                  duration: 2000
433
-                })
431
+
432
+                this.$message.success("入库成功")
433
+
434 434
                 this.$router.back(-1)
435 435
               }
436 436
             })

+ 12 - 12
src/xt_pages/stock/stockOutOrderAdd.vue Visa fil

@@ -11,7 +11,7 @@
11 11
 
12 12
   <div class="app-container">
13 13
 
14
-    <sales-return-dialog :propForm="propForm"
14
+    <sales-return-dialog ref="dialog" :propForm="propForm"
15 15
                          :visibility="isVisibility"
16 16
                          v-on:dialog-comfirm="comfirm"
17 17
                          v-on:dialog-cancle="cancle"></sales-return-dialog>
@@ -25,7 +25,8 @@
25 25
 
26 26
 
27 27
     <div class="cell clearfix">
28
-      <label class="title"><span class="name">厂商</span> : </label>
28
+      <label class="title"><span class="name">厂商<span style="color: red;margin-left: -15px">*</span></span> : </label>
29
+
29 30
       <el-select  v-model="form.manufacturer" clearable  placeholder="请选择厂商"  @change="changeManufacturer()">
30 31
         <el-option
31 32
           v-for="(option, index) in manufacturer"
@@ -210,7 +211,8 @@
210 211
     },
211 212
     methods: {
212 213
       comfirm: function(val) {
213
-        this.isVisibility = false
214
+        this.$refs.dialog.hide()
215
+
214 216
         if (val.selectedGoodInfo.length > 0) {
215 217
           for (let i = val.selectedGoodInfo.length - 1; ;i--) {
216 218
             if (i == 0) {
@@ -223,15 +225,16 @@
223 225
               tempForm['count'] = ''
224 226
               tempForm['price'] = ''
225 227
               tempForm['remark'] = ''
228
+              this.recordInfo.recordData.splice(this.currentIndex+1, 0, tempForm);
226 229
 
227
-              this.recordInfo.recordData.push(tempForm)
228 230
             }
229 231
           }
230 232
         }
231 233
 
232 234
         this.currentIndex = -1
233 235
       }, cancle: function() {
234
-        this.isVisibility = false
236
+        this.$refs.dialog.hide()
237
+
235 238
       }, GetConfigInfo: function() {
236 239
         const params = {
237 240
           type: this.$route.query.type
@@ -326,7 +329,8 @@
326 329
           this.$message.error('请先选择厂商')
327 330
           return
328 331
         } else {
329
-          this.isVisibility = true
332
+          this.$refs.dialog.show()
333
+
330 334
           console.log(this.form.manufacturer)
331 335
           for (let i = 0; i < this.propForm.goodInfo.length; i++) {
332 336
             if (this.propForm.goodInfo[i].manufacturer == this.form.manufacturer) {
@@ -371,12 +375,8 @@
371 375
                 this.$message.error(response.data.msg)
372 376
                 return false
373 377
               } else {
374
-                this.$notify({
375
-                  title: '成功',
376
-                  message: '退货成功',
377
-                  type: 'success',
378
-                  duration: 2000
379
-                })
378
+
379
+                this.$message.success("退货成功")
380 380
                 this.recordInfo.recordData = []
381 381
                 this.$router.back(-1)
382 382
               }

+ 13 - 18
src/xt_pages/stock/stockOutOrderEdit.vue Visa fil

@@ -10,7 +10,7 @@
10 10
 
11 11
   <div class="app-container">
12 12
 
13
-    <sales-return-dialog :propForm="propForm"
13
+    <sales-return-dialog  ref="dialog"  :propForm="propForm"
14 14
                      :visibility="isVisibility"
15 15
                      v-on:dialog-comfirm="comfirm"
16 16
                      v-on:dialog-cancle="cancle"></sales-return-dialog>
@@ -193,7 +193,8 @@
193 193
     },
194 194
     methods: {
195 195
       comfirm: function(val) {
196
-        this.isVisibility = false
196
+        this.$refs.dialog.hide()
197
+
197 198
         if (val.selectedGoodInfo.length > 0) {
198 199
           for (let i = val.selectedGoodInfo.length - 1; ; i--) {
199 200
             if (i == 0) {
@@ -207,15 +208,15 @@
207 208
               tempForm['count'] = ''
208 209
               tempForm['price'] = ''
209 210
               tempForm['remark'] = ''
211
+              this.recordInfo.recordData.splice(this.currentIndex+1, 0, tempForm);
210 212
 
211
-              this.recordInfo.recordData.push(tempForm)
212 213
             }
213 214
           }
214 215
         }
215 216
 
216 217
         this.currentIndex = -1
217 218
       }, cancle: function() {
218
-        this.isVisibility = false
219
+        this.$refs.dialog.hide()
219 220
       }, GetConfigInfo: function() {
220 221
         const params = {
221 222
           type: this.$route.query.type
@@ -284,12 +285,9 @@
284 285
                 this.$message.error(response.data.msg)
285 286
                 return false
286 287
               } else {
287
-                this.$notify({
288
-                  title: '成功',
289
-                  message: '删除成功',
290
-                  type: 'success',
291
-                  duration: 2000
292
-                })
288
+
289
+                this.$message.success("删除成功")
290
+
293 291
                 this.recordInfo.recordData.splice(index, 1)
294 292
               }
295 293
             })
@@ -305,8 +303,7 @@
305 303
       }, showDialog(index, row) {
306 304
         this.currentIndex = index
307 305
 
308
-        this.isVisibility = true
309
-        console.log(this.form.manufacturer)
306
+
310 307
         for (let i = 0; i < this.propForm.goodInfo.length; i++) {
311 308
           if (this.propForm.goodInfo[i].manufacturer == this.form.manufacturer) {
312 309
             this.propForm.goodType.push(this.propForm.goodInfo[i].GoodsType)
@@ -317,6 +314,8 @@
317 314
           obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
318 315
           return cur
319 316
         }, [])
317
+        this.$refs.dialog.show()
318
+
320 319
       }, back() {
321 320
         this.$router.go(-1)
322 321
       }, submit() {
@@ -342,12 +341,8 @@
342 341
                 this.$message.error(response.data.msg)
343 342
                 return false
344 343
               } else {
345
-                this.$notify({
346
-                  title: '成功',
347
-                  message: '退货成功',
348
-                  type: 'success',
349
-                  duration: 2000
350
-                })
344
+
345
+                this.$message.success("退货成功")
351 346
                 this.$router.back(-1)
352 347
               }
353 348
             })

+ 3 - 3
src/xt_pages/user/components/PatientDetail.vue Visa fil

@@ -61,7 +61,7 @@
61 61
                 </el-radio-group>
62 62
               </el-form-item>
63 63
             </el-col>
64
-            <el-col :span="8" style="height:59px;"> 
64
+            <el-col :span="8" style="height:59px;">
65 65
               <el-form-item label="治疗状态(转归) : " class="is-required" prop="lapseto"  >
66 66
                 <el-radio-group v-model="form.lapseto">
67 67
                   <el-radio v-for="item in lapsetoOptions" :key="item.value" :label="item.value" :value="item.value" disabled>{{item.label}}</el-radio>
@@ -235,7 +235,7 @@
235 235
             </el-checkbox-group>
236 236
           </el-form-item>
237 237
         </el-col>
238
-       
238
+
239 239
         <el-col :span="24">
240 240
           <el-form-item label="诊断 : " prop="diagnose">
241 241
             <!-- <textarea v-model="form.diagnose" class="textarea" disabled></textarea> -->
@@ -300,7 +300,7 @@
300 300
       <div id="print-info-box" >
301 301
         <div class="print_main_content">
302 302
             <div class="order_title">
303
-                方济医院血液透析门诊病历
303
+               {{orgname}} 血液透析门诊病历
304 304
             </div>
305 305
             <div>
306 306
                 <table>