Browse Source

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

XMLWAN 4 years ago
parent
commit
241311b7b5

+ 21 - 1
src/api/schedule_template/patient.js View File

@@ -30,4 +30,24 @@ export function updateSchedules(template_id, add_schs, del_schs, change_schs) {
30 30
     method: 'post',
31 31
     params: params,
32 32
   })
33
-}
33
+}
34
+
35
+export function getTemplateScheduleSearchResult(params) {
36
+  return request({
37
+    url: '/api/schedule_template/search',
38
+    method: 'Get',
39
+    params: params
40
+  })
41
+}
42
+
43
+
44
+export function cancelScheduleTemplate(params) {
45
+  return request({
46
+    url: '/api/schedule_template/cancel',
47
+    method: 'Post',
48
+    params: params
49
+  })
50
+}
51
+
52
+
53
+

+ 1 - 1
src/router/index.js View File

@@ -101,7 +101,7 @@ var _constant_router_map = [{
101 101
 var _asy_router_map = [
102 102
   patient,
103 103
   workforce,
104
-  medicalScheduling,
104
+  // medicalScheduling,
105 105
   weight_sign,
106 106
   dialysis,
107 107
   stock,

+ 153 - 0
src/xt_pages/data/components/dialysisComputer.vue View File

@@ -0,0 +1,153 @@
1
+<template>
2
+  <div class="">
3
+    <el-table
4
+      :row-style="{ color: '#303133' }"
5
+      :header-cell-style="{
6
+        backgroundColor: 'rgb(245, 247, 250)',
7
+        color: '#606266'
8
+      }"
9
+      :data="dialysis_computer_data"
10
+      border
11
+      fit
12
+      highlight-current-row
13
+      style="width: 100%;min-height:500px;"
14
+    >
15
+      <el-table-column align="center" label="字段名">
16
+        <template slot-scope="scope">
17
+          <span>{{ scope.row.filed_name_cn }}</span>
18
+        </template>
19
+      </el-table-column>
20
+      <el-table-column align="center" label="字段">
21
+        <template slot-scope="scope">
22
+          <span>{{ scope.row.filed_name }}</span>
23
+        </template>
24
+      </el-table-column>
25
+
26
+      <el-table-column align="center" label="是否显示">
27
+        <template slot-scope="scope">
28
+          <span v-if="scope.row.is_show == 1">是</span>
29
+          <span v-if="scope.row.is_show == 2">否</span>
30
+        </template>
31
+      </el-table-column>
32
+
33
+      <el-table-column label="操作" align="center">
34
+        <template slot-scope="scope">
35
+          <el-tooltip
36
+            class="item"
37
+            effect="dark"
38
+            content="不展示"
39
+            placement="top"
40
+            v-if="scope.row.is_show == 1"
41
+          >
42
+            <el-button
43
+              size="small"
44
+              type="danger"
45
+              icon="el-icon-remove-outline"
46
+              @click="handleHide(scope.$index, scope.row)"
47
+            >
48
+            </el-button>
49
+          </el-tooltip>
50
+
51
+          <el-tooltip
52
+            class="item"
53
+            effect="dark"
54
+            content="展示"
55
+            placement="top"
56
+            v-if="scope.row.is_show == 2"
57
+          >
58
+            <el-button
59
+              size="small"
60
+              type="primary"
61
+              icon="el-icon-view"
62
+              @click="handleShow(scope.$index, scope.row)"
63
+            >
64
+            </el-button>
65
+          </el-tooltip>
66
+        </template>
67
+      </el-table-column>
68
+    </el-table>
69
+  </div>
70
+</template>
71
+
72
+<script>
73
+  import { updateFieldIsShow } from "@/api/data";
74
+  import store from "@/store";
75
+
76
+  export default {
77
+    name: "dialysisComputer",
78
+
79
+    props: {
80
+      dialysis_computer_data: {
81
+        type: Array
82
+      }
83
+    },
84
+    methods: {
85
+      handleHide: function(index, row) {
86
+        this.$confirm("是否将该字段设为不可见?", "提示", {
87
+          confirmButtonText: "确 定",
88
+          cancelButtonText: "取 消",
89
+          type: "warning"
90
+        })
91
+          .then(() => {
92
+            updateFieldIsShow(row.id, 2).then(response => {
93
+              if (response.data.state == 1) {
94
+                let params = {
95
+                  id: response.data.data.id,
96
+                  is_show: response.data.data.is_show
97
+                };
98
+                store.dispatch("updateFiledConfigList", params).then(() => {});
99
+                this.$emit("change", params);
100
+              }
101
+            });
102
+            this.$message({
103
+              type: "success",
104
+              message: "设置成功!"
105
+            });
106
+          })
107
+          .catch(() => {});
108
+      },
109
+      handleShow: function(index, row) {
110
+        this.$confirm("是否将该字段设为可见?", "提示", {
111
+          confirmButtonText: "确 定",
112
+          cancelButtonText: "取 消",
113
+          type: "warning"
114
+        })
115
+          .then(() => {
116
+            updateFieldIsShow(row.id, 1).then(response => {
117
+              if (response.data.state == 1) {
118
+                let params = {
119
+                  id: response.data.data.id,
120
+                  is_show: response.data.data.is_show
121
+                };
122
+                store.dispatch("updateFiledConfigList", params).then(() => {});
123
+                this.$emit("change", params);
124
+              }
125
+            });
126
+            this.$message({
127
+              type: "success",
128
+              message: "设置成功!"
129
+            });
130
+          })
131
+          .catch(() => {});
132
+      }
133
+    },
134
+    watch: {
135
+
136
+    },
137
+  };
138
+</script>
139
+
140
+<style scoped></style>
141
+<style>
142
+  .el-table td,
143
+  .el-table th.is-leaf,
144
+  .el-table--border,
145
+  .el-table--group {
146
+    border-color: #d0d3da;
147
+  }
148
+  .el-table--border::after,
149
+  .el-table--group::after,
150
+  .el-table::before {
151
+    background-color: #d0d3da;
152
+  }
153
+</style>

+ 17 - 1
src/xt_pages/data/showConfig.vue View File

@@ -24,6 +24,12 @@
24 24
               @change="changeBeforeData"
25 25
             ></dialysis-before>
26 26
           </el-tab-pane>
27
+          <el-tab-pane label="透析上机">
28
+            <dialysis-computer
29
+              :dialysis_monitor_data="dialysis_computer_data"
30
+              @change="changeComputerData"
31
+            ></dialysis-computer>
32
+          </el-tab-pane>
27 33
           <el-tab-pane label="透析监测">
28 34
             <dialysis-monitor
29 35
               :dialysis_monitor_data="dialysis_monitor_data"
@@ -42,6 +48,7 @@
42 48
               @change="changeSummaryData"
43 49
             ></dialysis-summary>
44 50
           </el-tab-pane>
51
+
45 52
         </el-tabs>
46 53
       </div>
47 54
     </div>
@@ -58,10 +65,12 @@ import ReceiveTreatmentAsses from "./components/receiveTreatmentAsses";
58 65
 import DialysisSummary from "./components/dialysisSummary";
59 66
 import { getFiledConfigList } from "@/utils/data_config"; // getConfigList from sessionStorage
60 67
 import store from "@/store";
68
+import DialysisComputer from './components/dialysisComputer'
61 69
 
62 70
 export default {
63 71
   name: "showConfig",
64 72
   components: {
73
+    DialysisComputer,
65 74
     ReceiveTreatmentAsses,
66 75
     DialysisMonitor,
67 76
     DialysisBefore,
@@ -82,7 +91,8 @@ export default {
82 91
       dialysis_before_data: [],
83 92
       dialysis_monitor_data: [],
84 93
       dialysis_after_data: [],
85
-      dialysis_summary_data: []
94
+      dialysis_summary_data: [],
95
+      dialysis_computer_data:[],
86 96
     };
87 97
   },
88 98
   methods: {
@@ -109,6 +119,12 @@ export default {
109 119
           this.dialysis_before_data[i].is_show = object.is_show;
110 120
         }
111 121
       }
122
+    },changeComputerData:function(object){
123
+      for (let i = 0; i < this.dialysis_computer_data.length; i++) {
124
+        if (this.dialysis_computer_data[i].id == object.id) {
125
+          this.dialysis_computer_data[i].is_show = object.is_show;
126
+        }
127
+      }
112 128
     },
113 129
     changeMonitorData: function(object) {
114 130
       for (let i = 0; i < this.dialysis_monitor_data.length; i++) {

File diff suppressed because it is too large
+ 585 - 352
src/xt_pages/medicalScheduling/index.vue


+ 94 - 28
src/xt_pages/medicalScheduling/medical_print.vue View File

@@ -14,6 +14,9 @@
14 14
                     <div class="order_title_panl">
15 15
                         <span class="main_title">{{ $store.getters.xt_user.org.org_name }}医护排班表</span>
16 16
                     </div>
17
+                    <div style="text-align:right;margin-bottom:20px;font-size: 18px;">
18
+                      打印时间:{{ getNowFormatDate() }}
19
+                    </div>
17 20
                     <div class="table_panel">
18 21
                         <table class="table">
19 22
                             <thead>
@@ -29,15 +32,15 @@
29 32
                                 </tr>
30 33
                             </thead>
31 34
                             <tbody>
32
-                                <tr v-for='item in 6'>
33
-                                    <td>张三</td>
34
-                                    <td>张三</td>
35
-                                    <td>张三</td>
36
-                                    <td>张三</td>
37
-                                    <td>张三</td>
38
-                                    <td>张三</td>
39
-                                    <td>张三</td>
40
-                                    <td>张三</td>
35
+                                <tr v-for='(item,index) in tableData' :key="index">
36
+                                    <td>{{ item.user_name }}</td>
37
+                                    <td>{{ getClass(item.user_name,1) }}</td>
38
+                                    <td>{{ getClass(item.user_name,2) }}</td>
39
+                                    <td>{{ getClass(item.user_name,3) }}</td>
40
+                                    <td>{{ getClass(item.user_name,4) }}</td>
41
+                                    <td>{{ getClass(item.user_name,5) }}</td>
42
+                                    <td>{{ getClass(item.user_name,6) }}</td>
43
+                                    <td>{{ getClass(item.user_name,7) }}</td>
41 44
                                 </tr>
42 45
                             </tbody>
43 46
                         </table>
@@ -64,29 +67,33 @@ export default {
64 67
           ],
65 68
           start_time:"",
66 69
           end_time:"",
70
+
71
+          doctorlist:[],
72
+          tableData:[]
67 73
         }
68 74
     },
69 75
     methods:{
70
-        printAction: function() {
71
-            const style = '@media print { .print_main_content { background-color: white; width:960px;  margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 20px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 18px; padding: 10px 5px; } .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
76
+      printAction: function() {
77
+          const style = '@media print { .print_main_content { background-color: white; width:960px;  margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 20px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 18px; padding: 10px 5px; } .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
72 78
 
73
-            printJS({
74
-            printable: 'print_content',
75
-            type: 'html',
76
-            documentTitle: '  ',
77
-            style: style,
78
-            scanStyles: false
79
-            })
80
-        },
81
-        getDoctorList(){
82
-          getDoctorList().then(response=>{
83
-             var list =  response.data.data.list
84
-             console.log("医护列表",list)
85
-              this.getStaffScheduleList()
79
+          printJS({
80
+          printable: 'print_content',
81
+          type: 'html',
82
+          documentTitle: '  ',
83
+          style: style,
84
+          scanStyles: false
86 85
           })
87
-        },
88
-        //获取本周的所有排班列表
89
-       getStaffScheduleList(){
86
+      },
87
+      getDoctorList(){
88
+        getDoctorList().then(response=>{
89
+          var list =  response.data.data.list
90
+          console.log("医护列表",list)
91
+          this.doctorlist = list
92
+          this.getStaffScheduleList()
93
+        })
94
+      },
95
+      //获取本周的所有排班列表
96
+      getStaffScheduleList(){
90 97
           const params = {
91 98
             start_time:this.start_time,
92 99
             end_time:this.end_time,
@@ -95,9 +102,68 @@ export default {
95 102
             if(response.data.state == 1){
96 103
               var staffList = response.data.data.staffList
97 104
               console.log("staffList",staffList)
105
+
106
+              let tempArr = [], newArr = []
107
+              for (let i = 0; i < staffList.length; i++) {
108
+                if(tempArr.indexOf(staffList[i].user_name) === -1) {
109
+                  newArr.push({
110
+                    user_name: staffList[i].user_name,
111
+                    admin_user_id:staffList[i].admin_user_id,
112
+                    list: [{class_name:staffList[i].class_name,schedule_week:staffList[i].schedule_week}]
113
+                  })
114
+                  tempArr.push(staffList[i].user_name);
115
+                } else {
116
+                  for (let j = 0; j < newArr.length; j++) {
117
+                    if (newArr[j].user_name == staffList[i].user_name) {
118
+                      newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week})
119
+                    }
120
+                  }
121
+                }
122
+              }
123
+              let arr = [...newArr]
124
+              this.doctorlist.map((item,index) => {
125
+                if(!(arr[index] && item.admin_user_id == arr[index].admin_user_id)){
126
+                  arr.splice(index,0,{user_name:item.user_name,admin_user_id: item.admin_user_id,list: []})
127
+                }
128
+              })
129
+              console.log(arr)
130
+              this.tableData = arr
131
+              
98 132
             }
99 133
          })
100
-       }
134
+      },
135
+      getClass(name,index){
136
+        if(name != undefined){
137
+          let newClass = '';
138
+          this.tableData.map(item => {
139
+            if(item.user_name == name){
140
+              if(item.list){
141
+                item.list.map(it => {
142
+                  if(it.schedule_week == index){
143
+                    newClass = it.class_name
144
+                  }
145
+                })
146
+              } 
147
+            }
148
+          })
149
+          return newClass
150
+        }
151
+      },
152
+      getNowFormatDate() {
153
+        var date = new Date();
154
+        var seperator1 = "-";
155
+        var year = date.getFullYear();
156
+        var month = date.getMonth() + 1;
157
+        var strDate = date.getDate();
158
+        if (month >= 1 && month <= 9) {
159
+            month = "0" + month;
160
+        }
161
+        if (strDate >= 0 && strDate <= 9) {
162
+            strDate = "0" + strDate;
163
+        }
164
+        var currentdate = year + seperator1 + month + seperator1 + strDate;
165
+        return currentdate;
166
+      }
101 167
     },
102 168
     created(){
103 169
       var starttime =  this.$route.query.starttime

+ 0 - 1
src/xt_pages/user/components/PatientForm.vue View File

@@ -1388,7 +1388,6 @@ export default {
1388 1388
         return false;
1389 1389
       }
1390 1390
       this.form.user_sys_before_count =  this.form.user_sys_before_count.toString()
1391
-      this.form.avatar =this.form.avatar.
1392 1391
       this.$refs[formName].validate(valid => {
1393 1392
         if (valid) {
1394 1393
           this.formSubmit = false;

File diff suppressed because it is too large
+ 729 - 539
src/xt_pages/workforce/components/template_table.vue


+ 49 - 2
src/xt_pages/workforce/template.vue View File

@@ -119,13 +119,13 @@
119 119
         <el-tab-pane name="first" :disabled="template_mode.mode == 0">
120 120
           <span slot="label"> 第一周 </span>
121 121
           <template-table :editable="true" :device_numbers="device_numbers" :template="first_template"
122
-                          :patients="patients"></template-table>
122
+                          :patients="patients" @cancel_sch="refresh"></template-table>
123 123
         </el-tab-pane>
124 124
 
125 125
         <el-tab-pane name="second" :disabled="template_mode.mode != 2">
126 126
           <span slot="label"> 第二周 </span>
127 127
           <template-table :editable="true" :device_numbers="device_numbers" :template="second_template"
128
-                          :patients="patients"></template-table>
128
+                          :patients="patients" @cancel_sch="refresh"></template-table>
129 129
         </el-tab-pane>
130 130
       </el-tabs>
131 131
 
@@ -180,9 +180,11 @@
180 180
         patients: [],
181 181
 
182 182
         first_template: {
183
+          id: 1,
183 184
           items: []
184 185
         },
185 186
         second_template: {
187
+          id: 2,
186 188
           items: []
187 189
         },
188 190
         this_week_schedules: {
@@ -238,6 +240,51 @@
238 240
       })
239 241
     },
240 242
     methods: {
243
+      refresh(){
244
+        getTemplateInitData().then(rs => {
245
+          var resp = rs.data
246
+          if (resp.state == 1) {
247
+            var mode = resp.data.template_mode
248
+            var device_numbers = resp.data.device_numbers
249
+            var templates = resp.data.templates
250
+            var patients = resp.data.patients
251
+            var schedules = resp.data.schedules
252
+
253
+            this.template_mode = mode
254
+            this.origin_mode = mode.mode
255
+            this.device_numbers = device_numbers
256
+            console.log(this.device_numbers)
257
+            this.patients = patients
258
+
259
+            this.first_template = templates[0]
260
+            this.second_template = templates[1]
261
+
262
+            var fakeTemplateItems = []
263
+            for (let index = 0; index < schedules.length; index++) {
264
+              const schedule = schedules[index]
265
+              var item = {}
266
+              this.$set(item, 'id', schedule.id)
267
+              this.$set(item, 'template_id', 0)
268
+              this.$set(item, 'device_number_id', schedule.bed_id)
269
+              this.$set(item, 'treat_mode', schedule.mode_id)
270
+              this.$set(item, 'weekday', schedule.schedule_week)
271
+              this.$set(item, 'time_type', schedule.schedule_type)
272
+              var patient = {}
273
+              this.$set(patient, 'id', schedule.patient_id)
274
+              this.$set(patient, 'name', schedule.patient)
275
+              this.$set(item, 'patient', patient)
276
+
277
+              fakeTemplateItems.push(item)
278
+            }
279
+            this.this_week_schedules.items = fakeTemplateItems
280
+
281
+          } else {
282
+            this.$message(resp.msg)
283
+          }
284
+        })
285
+
286
+
287
+      },
241 288
       generateTxt:function(log) {
242 289
         var content = ''
243 290
         var errlog =  log.err_logs