Browse Source

Merge branch '20201109_pc_vue_new_branch' of D:\lijianchao\project\z-html\Vue_New with conflicts.

mainqaq 2 years ago
parent
commit
14eb5373c2

+ 1 - 2
config/dev.env.js View File

@@ -8,11 +8,10 @@ module.exports = {
8 8
   ENV_CONFIG: '"dev"',
9 9
   //BASE_API: '"http://new_mobile.xt.api.sgjyun.com"', // //http://api.xt.test.sgjyun.com http://112.74.16.180:9527,////'"http://localhost:9529"',
10 10
   BASE_API: '"http://api.xt.test.sgjyun.com"',
11
-  // BASE_API: '"http://localhost:9529"',
11
+  // BASE_API: '"http://localhost:9531"',
12 12
   SSO_HOST: '"http://testsso.sgjyun.com"',
13 13
   SRCM_HOST: '"http://test1.sgjyun.com"',
14 14
   XT_HOST: '"http://xt.test.sgjyun.com"',
15 15
   MIRCO_MALL_HOST: '"http://mall.test.sgjyun.com"',
16 16
   CDM_HOST: '"http://cdm.test.sgjyun.com"'
17 17
 }
18
-

+ 1 - 1
package.json View File

@@ -92,7 +92,7 @@
92 92
     "babel-preset-stage-2": "6.24.1",
93 93
     "chalk": "2.3.0",
94 94
     "copy-webpack-plugin": "4.3.0",
95
-    "cross-env": "5.1.1",
95
+    "cross-env": "^7.0.3",
96 96
     "crypto-js": "^4.1.1",
97 97
     "css-loader": "0.28.7",
98 98
     "eslint": "4.13.1",

+ 1 - 1
src/App.vue View File

@@ -46,7 +46,7 @@ export default {
46 46
   },
47 47
   watch:{
48 48
   $route(to,from){
49
-    
49
+
50 50
     if(to.path.indexOf('/patients/patient')== -1){
51 51
       window.sessionStorage.removeItem('patientKey')
52 52
     }

+ 40 - 0
src/api/pharmacy.js View File

@@ -64,3 +64,43 @@ export function prescriptiondetails(params) {
64 64
     params: params
65 65
   })
66 66
 }
67
+//获取当天已发药的药品
68
+export function dispensemedicine(params) {
69
+  return request({
70
+    url: '/api/pharmacy/dispensemedicine',
71
+    method: 'get',
72
+    params: params
73
+  })
74
+}
75
+//获取当天待发药的药品
76
+export function waitingmedicine(params) {
77
+  return request({
78
+    url: '/api/pharmacy/waitingmedicine',
79
+    method: 'get',
80
+    params: params
81
+  })
82
+}
83
+//获取当天该药品的所有患者
84
+export function getpatientswithdrugs(params) {
85
+  return request({
86
+    url: '/api/pharmacy/getpatientswithdrugs',
87
+    method: 'get',
88
+    params: params
89
+  })
90
+}
91
+//药品发药按钮点击
92
+export function medicinedeparture(params) {
93
+  return request({
94
+    url: '/api/pharmacy/medicinedeparture',
95
+    method: 'get',
96
+    params: params
97
+  })
98
+}
99
+//获取当前登录账号
100
+export function getcurrentname(params) {
101
+  return request({
102
+    url: '/api/pharmacy/getcurrentname',
103
+    method: 'get',
104
+    params: params
105
+  })
106
+}

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

@@ -165,7 +165,7 @@ var _asy_router_map = [
165 165
   PatientDispensing, // 患者发药模块
166 166
   DrugDispensing, // 药房管理模块
167 167
   DispensingDetails, // 药房管理模块
168
-  // ConsumablesManagement, // 药房管理模块
168
+  //ConsumablesManagement, // 药房管理模块
169 169
   MedicianManagement, // 药房管理模块
170 170
 
171 171
   otherManagement,

+ 2 - 2
src/router/modules/DispensingDetails.js View File

@@ -8,10 +8,10 @@ export default {
8 8
   children: [{
9 9
     path: '/Pharmacy/DispensingDetails',
10 10
     component: () => import('@/xt_pages/Pharmacy/DispensingDetails.vue'),
11
-    name: '发药明细',
11
+    name: '药房管理',
12 12
     meta: {
13 13
       title: '发药明细',
14 14
       noCache: true
15 15
     }
16 16
   },]
17
-}
17
+}

+ 2 - 2
src/router/modules/DrugDispensing.js View File

@@ -8,10 +8,10 @@ export default {
8 8
   children: [{
9 9
     path: '/Pharmacy/DrugDispensing',
10 10
     component: () => import('@/xt_pages/Pharmacy/DrugDispensing.vue'),
11
-    name: '药品发药',
11
+    name: '药房管理',
12 12
     meta: {
13 13
       title: '药品发药',
14 14
       noCache: true
15 15
     }
16 16
   },]
17
-}
17
+}

+ 2 - 2
src/router/modules/PatientDispensing.js View File

@@ -8,7 +8,7 @@ export default {
8 8
   children: [{
9 9
     path: '/Pharmacy/PatientDispensing',
10 10
     component: () => import('@/xt_pages/Pharmacy/PatientDispensing.vue'),
11
-    name: '患者发药',
11
+    name: '药房管理',
12 12
     meta: {
13 13
       title: '患者发药',
14 14
       noCache: true
@@ -23,4 +23,4 @@ export default {
23 23
   //   meta: { title: 'outpatientChargesPrint', noCache: true }
24 24
   // }
25 25
 ]
26
-}
26
+}

+ 2 - 2
src/views/layout/Layout.vue View File

@@ -12,10 +12,10 @@
12 12
           <i class="iconfont icon-s_bingli navIcon"></i>
13 13
           <p>电子病历</p>
14 14
         </div>
15
-         <!-- <div v-if="medicianshow" :class="index == 7 ? 'navOne navActive' : 'navOne'" @click="clickActive(7,'药房管理')">
15
+        <div v-if="medicianshow" :class="index == 7 ? 'navOne navActive' : 'navOne'" @click="clickActive(7,'药房管理')">
16 16
           <i class="iconfont icon-shangcheng-1 navIcon"></i>
17 17
           <p>药房管理</p>
18
-        </div> -->
18
+        </div>
19 19
         <div v-if="touxiShow" :class="index == 2 ? 'navOne navActive' : 'navOne'" @click="clickActive(2,'透析管理')">
20 20
           <i class="iconfont icon-computer_fill navIcon"></i>
21 21
           <p>透析管理</p>

+ 1 - 0
src/xt_pages/DepositManagement/DepositRefund.vue View File

@@ -68,6 +68,7 @@
68 68
             <div style="width: 465px;white-space: nowrap;">
69 69
               <span>日期查询:</span>
70 70
               <el-date-picker
71
+                unlink-panels
71 72
                 v-model="tmp_value1"
72 73
                 type="daterange"
73 74
                 range-separator="至"

+ 1 - 0
src/xt_pages/DepositManagement/Template/DeductionDetails.vue View File

@@ -24,6 +24,7 @@
24 24
           <div style="width: 465px">
25 25
             <span>日期查询:</span>
26 26
             <el-date-picker
27
+              unlink-panels
27 28
               v-model="value1"
28 29
               type="daterange"
29 30
               range-separator="至"

+ 1 - 0
src/xt_pages/DepositManagement/Template/DeductionSummary.vue View File

@@ -24,6 +24,7 @@
24 24
           <div style="width: 465px">
25 25
             <span>日期查询:</span>
26 26
             <el-date-picker
27
+              unlink-panels
27 28
               v-model="value1"
28 29
               type="daterange"
29 30
               range-separator="至"

+ 1 - 0
src/xt_pages/DepositManagement/Template/DepositDetails.vue View File

@@ -31,6 +31,7 @@
31 31
         <div style="width: 550px">
32 32
           <span>日期查询:</span>
33 33
           <el-date-picker
34
+            unlink-panels
34 35
             v-model="value1"
35 36
             type="daterange"
36 37
             range-separator="至"

+ 2 - 1
src/xt_pages/DepositManagement/Template/RechargeDetails.vue View File

@@ -24,6 +24,7 @@
24 24
           <div style="width: 465px">
25 25
             <span>日期查询:</span>
26 26
             <el-date-picker
27
+              unlink-panels
27 28
               v-model="value1"
28 29
               type="daterange"
29 30
               range-separator="至"
@@ -108,7 +109,7 @@
108 109
               审核
109 110
             </el-button>
110 111
             </span>
111
-           
112
+
112 113
             <span v-if="scope.row.trial_status == 1">
113 114
             <el-button
114 115
               size="small"

+ 1 - 0
src/xt_pages/DepositManagement/Template/RechargeSummary.vue View File

@@ -24,6 +24,7 @@
24 24
           <div style="width: 465px">
25 25
             <span>日期查询:</span>
26 26
             <el-date-picker
27
+              unlink-panels
27 28
               v-model="value1"
28 29
               type="daterange"
29 30
               range-separator="至"

+ 204 - 204
src/xt_pages/Pharmacy/DispensingDetails.vue View File

@@ -1,214 +1,214 @@
1 1
 <template><!--发药明细-->
2
-<!--  <div class="main-contain">-->
3
-<!--    <div class="position">-->
4
-<!--      <bread-crumb :crumbs="crumbs"></bread-crumb>-->
5
-<!--    </div>-->
6
-<!--    <div class="app-container">-->
7
-<!--      <div-->
8
-<!--        style="-->
9
-<!--          justify-content: space-between;-->
10
-<!--          margin: 0px 0 12px 0;-->
11
-<!--          display: flex;-->
12
-<!--          align-items: center;-->
13
-<!--        "-->
14
-<!--      >-->
15
-<!--        <div>-->
16
-<!--          <el-input-->
17
-<!--            size="small"-->
18
-<!--            style="width: 200px; margin-left: 10px"-->
19
-<!--            class="filter-item"-->
20
-<!--            v-model="keyword"-->
21
-<!--            placeholder="请输入患者姓名"-->
22
-<!--          ></el-input>-->
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+    </div>
6
+    <div class="app-container">
7
+      <div
8
+        style="
9
+          justify-content: space-between;
10
+          margin: 0px 0 12px 0;
11
+          display: flex;
12
+          align-items: center;
13
+        "
14
+      >
15
+        <div>
16
+          <el-input
17
+            size="small"
18
+            style="width: 200px; margin-left: 10px"
19
+            class="filter-item"
20
+            v-model="keyword"
21
+            placeholder="请输入患者姓名"
22
+          ></el-input>
23 23
 
24
-<!--          <el-date-picker-->
25
-<!--            size="small"-->
26
-<!--            v-model="start_time"-->
27
-<!--            prefix-icon="el-icon-date"-->
28
-<!--            :editable="false"-->
29
-<!--            style="width: 196px"-->
30
-<!--            type="date"-->
31
-<!--            placeholder="选择日期时间"-->
32
-<!--            align="right"-->
33
-<!--            format="yyyy-MM-dd"-->
34
-<!--            value-format="yyyy-MM-dd"-->
35
-<!--            @change="startTimeChange"-->
36
-<!--          ></el-date-picker-->
37
-<!--          >- -->
38
-<!--          <el-date-picker-->
39
-<!--            size="small"-->
40
-<!--            v-model="end_time"-->
41
-<!--            prefix-icon="el-icon-date"-->
42
-<!--            :editable="false"-->
43
-<!--            style="width: 196px"-->
44
-<!--            type="date"-->
45
-<!--            placeholder="选择日期时间"-->
46
-<!--            align="right"-->
47
-<!--            format="yyyy-MM-dd"-->
48
-<!--            value-format="yyyy-MM-dd"-->
49
-<!--            @change="endTimeChange"-->
50
-<!--          ></el-date-picker>-->
24
+          <el-date-picker
25
+            size="small"
26
+            v-model="start_time"
27
+            prefix-icon="el-icon-date"
28
+            :editable="false"
29
+            style="width: 196px"
30
+            type="date"
31
+            placeholder="选择日期时间"
32
+            align="right"
33
+            format="yyyy-MM-dd"
34
+            value-format="yyyy-MM-dd"
35
+            @change="startTimeChange"
36
+          ></el-date-picker
37
+          >-
38
+          <el-date-picker
39
+            size="small"
40
+            v-model="end_time"
41
+            prefix-icon="el-icon-date"
42
+            :editable="false"
43
+            style="width: 196px"
44
+            type="date"
45
+            placeholder="选择日期时间"
46
+            align="right"
47
+            format="yyyy-MM-dd"
48
+            value-format="yyyy-MM-dd"
49
+            @change="endTimeChange"
50
+          ></el-date-picker>
51 51
 
52
-<!--          <el-button-->
53
-<!--            size="small"-->
54
-<!--            class="filter-item"-->
55
-<!--            type="primary"-->
56
-<!--            icon="el-icon-search"-->
57
-<!--            @click="query"-->
58
-<!--            >查询</el-button-->
59
-<!--          >-->
60
-<!--        </div>-->
61
-<!--      </div>-->
62
-<!--      <el-table-->
63
-<!--        :row-style="{ color: '#303133' }"-->
64
-<!--        :header-cell-style="{-->
65
-<!--          backgroundColor: 'rgb(245, 247, 250)',-->
66
-<!--          color: '#606266',-->
67
-<!--        }"-->
68
-<!--        style="width: 1651px"-->
69
-<!--        :data="tableList"-->
70
-<!--        :class="signAndWeighBoxPatients"-->
71
-<!--        border-->
72
-<!--      >-->
73
-<!--        <el-table-column type="index" label="序号" align="center" width="250">-->
74
-<!--        </el-table-column>-->
75
-<!--        <el-table-column label="患者名称" align="center" width="300">-->
76
-<!--          <template slot-scope="scope">-->
77
-<!--            <span>{{scope.row.Name  ? scope.row.Name  : ""}}</span>-->
78
-<!--          </template>-->
79
-<!--        </el-table-column>-->
52
+          <el-button
53
+            size="small"
54
+            class="filter-item"
55
+            type="primary"
56
+            icon="el-icon-search"
57
+            @click="query"
58
+            >查询</el-button
59
+          >
60
+        </div>
61
+      </div>
62
+      <el-table
63
+        :row-style="{ color: '#303133' }"
64
+        :header-cell-style="{
65
+          backgroundColor: 'rgb(245, 247, 250)',
66
+          color: '#606266',
67
+        }"
68
+        style="width: 1651px"
69
+        :data="tableList"
70
+        :class="signAndWeighBoxPatients"
71
+        border
72
+      >
73
+        <el-table-column type="index" label="序号" align="center" width="250">
74
+        </el-table-column>
75
+        <el-table-column label="患者名称" align="center" width="300">
76
+          <template slot-scope="scope">
77
+            <span>{{scope.row.Name  ? scope.row.Name  : ""}}</span>
78
+          </template>
79
+        </el-table-column>
80 80
 
81
-<!--        <el-table-column label="开立医生" align="center" width="300">-->
82
-<!--          <template slot-scope="scope">-->
83
-<!--            <span>{{scope.row.DoctorName  ? scope.row.DoctorName  : ""}}</span>-->
84
-<!--          </template>-->
85
-<!--        </el-table-column>-->
86
-<!--        <el-table-column label="发药时间" align="center" width="400">-->
87
-<!--          <template slot-scope="scope">-->
88
-<!--            <span>{{scope.row.RecordDate  ? scope.row.RecordDate  : ""}}</span>-->
89
-<!--          </template>-->
90
-<!--        </el-table-column>-->
91
-<!--        <el-table-column label="操作" align="center" width="400">-->
92
-<!--          <template slot-scope="scope">-->
93
-<!--            <el-button type="primary" @click="views(scope.row)">查看</el-button>-->
94
-<!--          </template>-->
95
-<!--        </el-table-column>-->
96
-<!--      </el-table>-->
97
-<!--      <el-pagination-->
98
-<!--        @size-change="handleSizeChange"-->
99
-<!--        @current-change="handleCurrentChange"-->
100
-<!--        :page-sizes="[10, 50, 100, 200, 500, 1000]"-->
101
-<!--        :page-size="10"-->
102
-<!--        background-->
103
-<!--        align="right"-->
104
-<!--        style="margin-top: 20px"-->
105
-<!--        layout="total, sizes, prev, pager, next, jumper"-->
106
-<!--        :total="total"-->
107
-<!--      >-->
108
-<!--      </el-pagination>-->
109
-<!--    </div>-->
81
+        <el-table-column label="开立医生" align="center" width="300">
82
+          <template slot-scope="scope">
83
+            <span>{{scope.row.DoctorName  ? scope.row.DoctorName  : ""}}</span>
84
+          </template>
85
+        </el-table-column>
86
+        <el-table-column label="发药时间" align="center" width="400">
87
+          <template slot-scope="scope">
88
+            <span>{{scope.row.RecordDate  ? scope.row.RecordDate  : ""}}</span>
89
+          </template>
90
+        </el-table-column>
91
+        <el-table-column label="操作" align="center" width="400">
92
+          <template slot-scope="scope">
93
+            <el-button type="primary" @click="views(scope.row)">查看</el-button>
94
+          </template>
95
+        </el-table-column>
96
+      </el-table>
97
+      <el-pagination
98
+        @size-change="handleSizeChange"
99
+        @current-change="handleCurrentChange"
100
+        :page-sizes="[10, 50, 100, 200, 500, 1000]"
101
+        :page-size="10"
102
+        background
103
+        align="right"
104
+        style="margin-top: 20px"
105
+        layout="total, sizes, prev, pager, next, jumper"
106
+        :total="total"
107
+      >
108
+      </el-pagination>
109
+    </div>
110 110
 
111
-<!--    <details-print-->
112
-<!--      ref="detailsprint"-->
113
-<!--      :visibility="isVisibility"-->
114
-<!--      :propsTable="propsTable"-->
115
-<!--    >-->
116
-<!--    </details-print>-->
111
+    <details-print
112
+      ref="detailsprint"
113
+      :visibility="isVisibility"
114
+      :propsTable="propsTable"
115
+    >
116
+    </details-print>
117 117
 
118
-<!--  </div>-->
118
+  </div>
119 119
 </template>
120 120
 
121
-<!--<script>-->
122
-<!--import detailsPrint from "./print/details.vue";-->
123
-<!--import BreadCrumb from "@/xt_pages/components/bread-crumb";-->
124
-<!--import {-->
125
-<!--  dispensingdetails,-->
126
-<!--  prescriptiondetails-->
127
-<!--} from "@/api/pharmacy"-->
128
-<!--const moment = require('moment')-->
129
-<!--export default {-->
130
-<!--  components: {-->
131
-<!--    detailsPrint,-->
132
-<!--    BreadCrumb,-->
133
-<!--  },-->
134
-<!--  data() {-->
135
-<!--    return {-->
136
-<!--      crumbs: [-->
137
-<!--        { path: false, name: "发药明细" },-->
138
-<!--        { path: "/Pharmacy/DispensingDetails", name: "发药明细" },-->
139
-<!--      ],-->
140
-<!--      keyword: "",-->
141
-<!--      tableList: [{}],-->
142
-<!--      signAndWeighBoxPatients: "sign-and-weigh-box-patients",-->
143
-<!--      start_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),-->
144
-<!--      end_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),-->
145
-<!--      prescriptionList:[],//处方-->
146
-<!--      stat_order:[],//临时医嘱-->
147
-<!--      total: 0,-->
148
-<!--      page: 1,-->
149
-<!--      limit: 10,-->
150
-<!--    };-->
151
-<!--  },-->
152
-<!--  created() {-->
153
-<!--    this.init();-->
154
-<!--    this.query();-->
155
-<!--  },-->
156
-<!--  methods: {-->
157
-<!--    init(){-->
158
-<!--      this.page = 1;-->
159
-<!--      this.limit = 10;-->
160
-<!--      this.keyword = "";-->
161
-<!--    },-->
162
-<!--    query(){-->
163
-<!--      var params = {-->
164
-<!--        keyword: this.keyword,-->
165
-<!--        start_time: this.start_time,-->
166
-<!--        end_time: this.end_time,-->
167
-<!--        page: 1,-->
168
-<!--        limit: this.limit,-->
169
-<!--      }-->
170
-<!--      dispensingdetails(params).then((res) => {-->
171
-<!--        if (res.data.state == 1){-->
172
-<!--          this.tableList = res.data.data.list;-->
173
-<!--          this.total = res.data.data.total;-->
174
-<!--        }-->
175
-<!--      })-->
176
-<!--    },-->
177
-<!--    search(){-->
178
-<!--      console.log("this.start_time",this.start_time)-->
179
-<!--      console.log("this.end_time",this.end_time)-->
180
-<!--      var params = {-->
181
-<!--        keyword: this.keyword,-->
182
-<!--        start_time: this.start_time,-->
183
-<!--        end_time: this.end_time,-->
184
-<!--        page: this.page,-->
185
-<!--        limit: this.limit,-->
186
-<!--      }-->
187
-<!--      dispensingdetails(params).then((res) => {-->
188
-<!--        if (res.data.state == 1){-->
189
-<!--          this.tableList = res.data.data.list;-->
190
-<!--        }-->
191
-<!--      })-->
192
-<!--    },-->
121
+<script>
122
+import detailsPrint from "./print/details.vue";
123
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
124
+import {
125
+  dispensingdetails,
126
+  prescriptiondetails
127
+} from "@/api/pharmacy"
128
+const moment = require('moment')
129
+export default {
130
+  components: {
131
+    detailsPrint,
132
+    BreadCrumb,
133
+  },
134
+  data() {
135
+    return {
136
+      crumbs: [
137
+        { path: false, name: "药房管理" },
138
+        { path: "/Pharmacy/DispensingDetails", name: "发药明细" },
139
+      ],
140
+      keyword: "",
141
+      tableList: [{}],
142
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
143
+      start_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
144
+      end_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
145
+      prescriptionList:[],//处方
146
+      stat_order:[],//临时医嘱
147
+      total: 0,
148
+      page: 1,
149
+      limit: 10,
150
+    };
151
+  },
152
+  created() {
153
+    this.init();
154
+    this.query();
155
+  },
156
+  methods: {
157
+    init(){
158
+      this.page = 1;
159
+      this.limit = 10;
160
+      this.keyword = "";
161
+    },
162
+    query(){
163
+      var params = {
164
+        keyword: this.keyword,
165
+        start_time: this.start_time,
166
+        end_time: this.end_time,
167
+        page: 1,
168
+        limit: this.limit,
169
+      }
170
+      dispensingdetails(params).then((res) => {
171
+        if (res.data.state == 1){
172
+          this.tableList = res.data.data.list;
173
+          this.total = res.data.data.total;
174
+        }
175
+      })
176
+    },
177
+    search(){
178
+      console.log("this.start_time",this.start_time)
179
+      console.log("this.end_time",this.end_time)
180
+      var params = {
181
+        keyword: this.keyword,
182
+        start_time: this.start_time,
183
+        end_time: this.end_time,
184
+        page: this.page,
185
+        limit: this.limit,
186
+      }
187
+      dispensingdetails(params).then((res) => {
188
+        if (res.data.state == 1){
189
+          this.tableList = res.data.data.list;
190
+        }
191
+      })
192
+    },
193 193
 
194
-<!--    // 查看-->
195
-<!--    views(data) {-->
196
-<!--      console.log("吱吱吱",data)-->
197
-<!--      this.$refs.detailsprint.show();-->
198
-<!--      this.$refs.detailsprint.drugdetails(data);-->
199
-<!--    },-->
200
-<!--    // 页表操作-->
201
-<!--    handleSizeChange(val) {-->
202
-<!--      this.limit = val;-->
203
-<!--      this.search();-->
204
-<!--    },-->
205
-<!--    handleCurrentChange(val) {-->
206
-<!--      this.page = val;-->
207
-<!--      this.search();-->
208
-<!--    },-->
209
-<!--  },-->
210
-<!--};-->
211
-<!--</script>-->
194
+    // 查看
195
+    views(data) {
196
+      console.log("吱吱吱",data)
197
+      this.$refs.detailsprint.show();
198
+      this.$refs.detailsprint.drugdetails(data);
199
+    },
200
+    // 页表操作
201
+    handleSizeChange(val) {
202
+      this.limit = val;
203
+      this.search();
204
+    },
205
+    handleCurrentChange(val) {
206
+      this.page = val;
207
+      this.search();
208
+    },
209
+  },
210
+};
211
+</script>
212 212
 
213
-<!--<style rel="stylesheet/css" lang="scss" scoped>-->
214
-<!--</style>-->
213
+<style rel="stylesheet/css" lang="scss" scoped>
214
+</style>

+ 242 - 168
src/xt_pages/Pharmacy/DrugDispensing.vue View File

@@ -18,13 +18,13 @@
18 18
               format="yyyy-MM-dd"
19 19
               value-format="yyyy-MM-dd"
20 20
               placeholder="选择日期"
21
-              :change="testsss()"
21
+              @change="changeTimes()"
22 22
             >
23 23
             </el-date-picker>
24 24
           </div>
25 25
 
26 26
           <div class="list">
27
-            <el-radio-group v-model="state">
27
+            <el-radio-group v-model="state" @change="lala()">
28 28
               <el-radio :label="1">待发药</el-radio>
29 29
               <el-radio :label="2">已发药</el-radio>
30 30
             </el-radio-group>
@@ -46,29 +46,28 @@
46 46
             </el-button>
47 47
           </div>
48 48
 
49
-          <el-table
50
-            v-if="state == 1"
49
+          <el-table v-if="state == 1"
51 50
             :height="tableHeight"
52
-            :data="tableData"
51
+            :data="waiting_drug"
53 52
             border
54 53
             style="width: 100%"
55 54
             highlight-current-row
56
-            ref="singleTable"
55
+            ref="table01"
57 56
             @current-change="handleCurrentChange"
58 57
           >
59 58
             <el-table-column prop="name" label="名称" width="100">
60 59
                <template slot-scope="scope">
61
-                {{scope.row.drug_name}}
60
+                {{scope.row.name}}
62 61
               </template>
63 62
             </el-table-column>
64 63
             <el-table-column prop="specifications" label="规格" width="100">
65 64
               <template slot-scope="scope">
66
-                {{scope.row.dose}}{{scope.row.dose_unit}}*{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
65
+                {{scope.row.specifications}}
67 66
               </template>
68 67
             </el-table-column>
69 68
             <el-table-column prop="stock" label="库存" width="100">
70 69
                <template slot-scope="scope">
71
-                {{getWarehoseInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
70
+                {{scope.row.stock}}
72 71
               </template>
73 72
             </el-table-column>
74 73
           </el-table>
@@ -76,26 +75,26 @@
76 75
           <el-table
77 76
             v-if="state == 2"
78 77
             :height="tableHeight"
79
-            :data="tableData"
78
+            :data="issued_drug"
80 79
             border
81 80
             style="width: 100%"
82 81
             highlight-current-row
83
-            @current-change="handleSelectionChangeOne"
84
-            ref="singleTable"
82
+            @current-change="handleCurrentChange"
83
+            ref="table02"
85 84
           >
86 85
             <el-table-column prop="name" label="名称" width="100">
87 86
                <template slot-scope="scope">
88
-                {{scope.row.drug_name}}
87
+                {{scope.row.name}}
89 88
               </template>
90 89
             </el-table-column>
91 90
             <el-table-column prop="specifications" label="规格" width="100">
92 91
               <template slot-scope="scope">
93
-                {{scope.row.dose}}{{scope.row.dose_unit}}*{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
92
+                {{scope.row.specifications}}
94 93
               </template>
95 94
             </el-table-column>
96 95
             <el-table-column prop="stock" label="库存" width="100">
97 96
                <template slot-scope="scope">
98
-                {{getWarehoseInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
97
+                {{scope.row.stock}}
99 98
               </template>
100 99
             </el-table-column>
101 100
           </el-table>
@@ -103,121 +102,116 @@
103 102
       </div>
104 103
       <div class="mainRight">
105 104
         <div class="titlelist">
105
+<!--          <el-button type="primary" @click="tt">调试</el-button>-->
106 106
           <el-button type="primary" @click="dispense" v-if="state == 1">发药</el-button>
107 107
           <el-button type="primary" @click="toPrint">打印</el-button>
108
-          <el-button type="primary" @click="toSetting">设置</el-button>
108
+<!--          <el-button @click="tt">调试</el-button>-->
109
+<!--          <el-button type="primary" @click="toSetting">设置</el-button>-->
109 110
         </div>
110 111
         <el-divider></el-divider>
111 112
         <div>
112 113
           <el-table
113 114
             :height="tableHeight"
114
-            :data="tableData_list"
115
+            :data="tableData"
115 116
             border
116 117
             style="width: 1328px"
117 118
             @selection-change="handleSelectionChange"
118 119
              v-if="state == 1"
119 120
           >
120
-            >
121 121
             <el-table-column type="selection" width="55"> </el-table-column>
122 122
             <el-table-column type="index" label="序号" width="120" align="center">
123
-              <template slot-scope="scope">
124
-                {{scope.$index + 1}}
125
-              </template>
126 123
             </el-table-column>
127 124
             <el-table-column prop="name" label="患者名称" width="180" align="center">
128 125
                 <template slot-scope="scope">
129
-                 {{getPatientName(scope.row.patient_id)}}
126
+                 {{scope.row.name}}
130 127
               </template>
131 128
             </el-table-column>
132 129
             <el-table-column prop="name" label="单次用量" width="170" align="center">
133 130
                <template  slot-scope="scope">
134
-                 {{scope.row.single_dose}}
131
+                 {{scope.row.single_dosage}}
135 132
                </template>
136 133
             </el-table-column>
137 134
             <el-table-column prop="name" label="用法" width="160" align="center">
138 135
                <template  slot-scope="scope">
139
-                 {{scope.row.delivery_way}}
136
+                 {{scope.row.usage}}
140 137
                </template>
141 138
             </el-table-column>
142 139
             <el-table-column prop="name" label="频率" width="160" align="center">
143 140
                 <template  slot-scope="scope">
144
-                 {{scope.row.execution_frequency}}
141
+                 {{scope.row.frequency}}
145 142
                </template>
146 143
             </el-table-column>
147 144
             <el-table-column prop="name" label="天数" width="160" align="center">
148 145
                <template  slot-scope="scope">
149
-                 {{scope.row.day}}
146
+                 {{scope.row.days}}
150 147
                </template>
151 148
             </el-table-column>
152 149
             <el-table-column prop="name" label="总量" width="160" align="center">
153 150
                 <template  slot-scope="scope">
154
-                 {{scope.row.prescribing_number}}
151
+                 {{scope.row.total}}
155 152
                </template>
156 153
             </el-table-column>
157 154
             <el-table-column prop="name" label="数据来源" width="162" align="center">
158 155
                 <template  slot-scope="scope">
159
-                 <span v-if="scope.row.type == 1">血透</span>
160
-                 <span v-if="scope.row.type == 2">HIS</span>
156
+                  {{scope.row.data_sources}}
161 157
                </template>
162 158
             </el-table-column>
163 159
           </el-table>
164
-
165
-
166
-            <el-table
160
+        </div>
161
+        <div>
162
+          <el-table
167 163
             :height="tableHeight"
168
-            :data="tableList"
164
+            :data="tableData"
169 165
             border
170 166
             style="width: 1328px"
171 167
             v-if="state == 2"
172 168
           >
173
-            >
174
-            <el-table-column type="selection" width="55"> </el-table-column>
169
+<!--            <el-table-column type="selection" width="55"> </el-table-column>-->
175 170
             <el-table-column type="index" label="序号" width="120" align="center">
176
-              <template slot-scope="scope">
177
-                {{scope.$index + 1}}
178
-              </template>
179 171
             </el-table-column>
180 172
             <el-table-column prop="name" label="患者名称" width="180" align="center">
181 173
                 <template slot-scope="scope">
182
-                 {{getPatientName(scope.row.patient_id)}}
174
+                 {{scope.row.name}}
183 175
               </template>
184 176
             </el-table-column>
185 177
             <el-table-column prop="name" label="单次用量" width="170" align="center">
186 178
                <template  slot-scope="scope">
187
-                 {{scope.row.single_dose}}
179
+                 {{scope.row.single_dosage}}
188 180
                </template>
189 181
             </el-table-column>
190 182
             <el-table-column prop="name" label="用法" width="160" align="center">
191 183
                <template  slot-scope="scope">
192
-                 {{scope.row.delivery_way}}
184
+                 {{scope.row.usage}}
193 185
                </template>
194 186
             </el-table-column>
195 187
             <el-table-column prop="name" label="频率" width="160" align="center">
196 188
                 <template  slot-scope="scope">
197
-                 {{scope.row.execution_frequency}}
189
+                 {{scope.row.frequency}}
198 190
                </template>
199 191
             </el-table-column>
200 192
             <el-table-column prop="name" label="天数" width="160" align="center">
201 193
                <template  slot-scope="scope">
202
-                 {{scope.row.day}}
194
+                 {{scope.row.days}}
203 195
                </template>
204 196
             </el-table-column>
205 197
             <el-table-column prop="name" label="总量" width="160" align="center">
206 198
                 <template  slot-scope="scope">
207
-                 {{scope.row.prescribing_number}}
199
+                 {{scope.row.total}}
208 200
                </template>
209 201
             </el-table-column>
210 202
             <el-table-column prop="name" label="数据来源" width="162" align="center">
211 203
                 <template  slot-scope="scope">
212
-                 <span v-if="scope.row.type == 1">血透</span>
213
-                 <span v-if="scope.row.type == 2">HIS</span>
204
+                  {{scope.row.data_sources}}
214 205
                </template>
215 206
             </el-table-column>
207
+              <el-table-column prop="name" label="领药人" width="160" align="center">
208
+                <template  slot-scope="scope">
209
+                  {{scope.row.people}}
210
+                </template>
211
+              </el-table-column>
216 212
           </el-table>
217
-
218
-
219 213
         </div>
220
-        <div style="margin-top">领料人:
214
+        <div style="margin-top" v-if="state == 1">领药人:
221 215
           <el-select v-model="admin_user_id" placeholder="请选择">
222 216
             <el-option
223 217
               v-for="item in doctorList"
@@ -262,11 +256,13 @@
262 256
 import drugPrint from "./print/drugPrint.vue";
263 257
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
264 258
 import { getTodayAdviceList,getPharmacyBaseDrug,updatePharmacyBaseDrug,SaveSetting,getPharmacyConfig,getUserdDrugList } from "@/api/his/advice";
265
-// import {
266
-//   waitingdrug,
267
-//   issueddrugs,
268
-//   getpharmacycontent
269
-// } from "@/api/pharmacy"
259
+import {
260
+  dispensemedicine,
261
+  waitingmedicine,
262
+  getpatientswithdrugs,
263
+  medicinedeparture,
264
+  getcurrentname
265
+} from "@/api/pharmacy"
270 266
 const moment = require('moment')
271 267
 export default {
272 268
   components: {
@@ -276,7 +272,7 @@ export default {
276 272
   data() {
277 273
     return {
278 274
       crumbs: [
279
-        { path: false, name: "药品发药" },
275
+        { path: false, name: "药房管理" },
280 276
         { path: "/Pharmacy/DrugDispensing", name: "药品发药" },
281 277
       ],
282 278
       tableHeight: 400,
@@ -296,86 +292,194 @@ export default {
296 292
       isVisibility:"",
297 293
       propsTable:"",
298 294
       doctorList:[],
299
-      admin_user_id:this.$store.getters.xt_user.user.id,
295
+      admin_user_id:0,
296
+      waiting_drug:[],//待发药列表
297
+      issued_drug:[],//已发药列表
298
+      currentRow:null,
299
+      tmp:0,
300 300
     };
301 301
   },
302 302
 
303 303
   methods: {
304
-    testsss(){
305
-      console.log("time",this.start_time);
304
+    tt(){
305
+      console.log("this.currentRow",this.currentRow)
306
+      this.$router.go(0)
307
+    },
308
+    async fun3(){
309
+      console.log("fun3")
310
+      this.fun1().then(val => {
311
+        this.fun2();
312
+      })
313
+    },
314
+    async fun4(tps){
315
+      console.log("fun3",tps)
316
+      this.fun1().then(val => {
317
+        console.log("this.issued_drug",this.issued_drug)
318
+        for(let i = 0;i < this.issued_drug.length;i++){
319
+          if(tps == this.issued_drug[i].id){
320
+            this.$refs.table02.setCurrentRow(this.issued_drug[i]);
321
+            this.handleCurrentChange(this.issued_drug[i])
322
+          }
323
+        }
324
+      })
325
+    },
326
+    async fun5(tps){
327
+      console.log("fun3",tps)
328
+      this.fun1().then(val => {
329
+        console.log("this.issued_drug",this.waiting_drug)
330
+        for(let i = 0;i < this.waiting_drug.length;i++){
331
+          if(tps == this.waiting_drug[i].id){
332
+            this.$refs.table01.setCurrentRow(this.waiting_drug[i]);
333
+            this.handleCurrentChange(this.waiting_drug[i])
334
+          }
335
+        }
336
+      })
337
+    },
338
+    changeTimes(){
339
+      // alert("aa")
340
+      // this.getdruglist();
341
+      this.fun3();
306 342
     },
307 343
     //初始化
308 344
     init(){
309
-
345
+      this.state = 1
346
+      this.tableData = null
347
+      this.currentRow = null
348
+    },
349
+    lala(){
350
+      this.currentRow = null
351
+      this.tableData = null
352
+      this.selectedbydefault()
310 353
     },
311 354
      searchAction() {
312
-      this.getlist();
355
+      // this.getlist();
356
+       this.tableData = null
357
+       this.currentRow = null
358
+       this.getdruglist();
313 359
     },
314 360
     // 跳转打印页面
315 361
     toPrint() {
316
-      // this.$router.push({ path: "/Pharmacy/print/patientPrint" });
317
-      this.$refs.drugprint.show();
362
+
363
+      if (this.state == 1 && this.multipleSelection.length == 0){
364
+        this.$message.error("未选择任何数据");
365
+        return
366
+      }
367
+      if (this.state == 2 && this.tableData == null){
368
+          this.$message.error("未选择任何数据");
369
+          return
370
+      }
371
+      this.$refs.drugprint.show(this.tableData,this.currentRow,this.state,this.multipleSelection);
318 372
     },
373
+    //列表选择
319 374
     handleSelectionChange(val) {
320 375
       this.multipleSelection = val;
321 376
     },
322
-    handleSelectionChangeOne(val){
323
-      this.tableList = []
324
-      this.getUserlist(val.id)
377
+    //默认选中
378
+    selectedbydefault(){
379
+      if(this.state == 1 && this.waiting_drug.length > 0){
380
+        this.$refs.table01.setCurrentRow(this.waiting_drug[0]);
381
+        this.handleCurrentChange(this.waiting_drug[0])
382
+      }
383
+      if(this.state == 2 && this.issued_drug.length >0){
384
+        this.$refs.table02.setCurrentRow(this.issued_drug[0]);
385
+        this.handleCurrentChange(this.issued_drug[0])
386
+      }
387
+    },
388
+    //包装selectedbydefault
389
+    fun2(){
390
+      console.log("3333333this.waitmount_data",this.waiting_drug)
391
+      // return new Promise((resolve, reject) => {
392
+      if(this.state == 1 && this.waiting_drug.length > 0){
393
+        this.$refs.table01.setCurrentRow(this.waiting_drug[0]);
394
+        this.handleCurrentChange(this.waiting_drug[0])
395
+      }
396
+      if(this.state == 2 && this.issued_drug.length >0){
397
+        this.$refs.table02.setCurrentRow(this.issued_drug[0]);
398
+        this.handleCurrentChange(this.issued_drug[0])
399
+      }
400
+      // });
325 401
     },
326 402
     // 药品发药
327 403
     dispense() {
328
-      var blood_ids = []
329
-      var his_ids = []
330
-      var bloodStr = ""
331
-      var hisStr = ""
332
-      for(let i=0;i<this.tableData.length;i++){
333
-        if(this.tableData[i].type == 1){
334
-          blood_ids.push(this.tableData[i].id)
335
-        }
336
-        if(this.tableData[i].type == 2){
337
-          his_ids.push(this.tableData[i].id)
338
-        }
404
+      var tps = this.currentRow.id;
405
+      if(this.multipleSelection.length < 1){
406
+        this.$message.error("未选择任何信息")
407
+        return
408
+      }
409
+      var tmp = "";
410
+      console.log("初始值",tmp)
411
+      for (var i=0;i < this.multipleSelection.length;i++){
412
+        tmp = tmp + this.multipleSelection[i].id + ","
339 413
       }
340
-      bloodStr = blood_ids.join(",")
341
-      hisStr =  his_ids.join(",")
342 414
       var params = {
343
-        bloodStr:bloodStr,
344
-        hisStr:hisStr,
345
-        admin_user_id:this.admin_user_id,
415
+        creater: this.admin_user_id,
416
+        ids: tmp,
346 417
       }
347
-      this.$confirm("确定是否对该药品进行发药?", "患者发药", {
348
-        confirmButtonText: "确 定",
349
-        cancelButtonText: "取 消",
350
-        type: "warning",
351
-      }).then(() => {
352
-        updatePharmacyBaseDrug(params).then(response=>{
353
-           if(response.data.state == 1){
354
-           var msg = response.data.data.msg
355
-           var medical =  response.data.data.medical
356
-           if(msg === 1){
357
-             this.$message.success("发药成功!")
358
-           }
359
-           if(msg == 2 || msg ===3){
360
-             this.$message.error("库存不足")
361
-           }
362
-         }
363
-        })
364
-      }).catch(() => {});
418
+      medicinedeparture(params).then((res) => {
419
+        if (res.data.state == 1){
420
+          this.$message.success("操作成功")
421
+          this.getdruglist();
422
+          //刷新列表
423
+          this.handleCurrentChange(this.currentRow);
424
+          this.fun4(tps);
425
+          this.state = 2;
426
+        }else{
427
+          this.$message.error("操作失败:" + res.data.msg)
428
+          //刷新列表
429
+          this.handleCurrentChange(this.currentRow);
430
+          this.fun5(tps);
431
+          this.state = 1;
432
+        }
433
+      })
365 434
     },
366
-
367
-    // 药品退药
368
-    endispense() {
369
-      var params = {};
370
-      this.$confirm("确定是否对该药品进行退药?", "患者退药", {
371
-        confirmButtonText: "确 定",
372
-        cancelButtonText: "取 消",
373
-        type: "warning",
435
+    //获取药品列表
436
+    getdruglist(){
437
+      var params = {
438
+        keyword: this.keywords,
439
+        time: this.start_time,
440
+      }
441
+      waitingmedicine(params).then((res) => {
442
+        if (res.data.state == 1){
443
+          this.waiting_drug = res.data.data.list
444
+        }
445
+      })
446
+      dispensemedicine(params).then((res) => {
447
+        if (res.data.state == 1){
448
+          this.issued_drug = res.data.data.list
449
+        }
374 450
       })
375
-        .then(() => {})
376
-        .catch(() => {});
451
+    },
452
+    async fun1(){
453
+      var params = {
454
+        keyword: this.keywords,
455
+        time: this.start_time,
456
+      }
457
+      await waitingmedicine(params).then((res) => {
458
+        if (res.data.state == 1){
459
+          this.waiting_drug = res.data.data.list
460
+        }
461
+        console.log("fun1lil1111i")
462
+      })
463
+      await dispensemedicine(params).then((res) => {
464
+        if (res.data.state == 1){
465
+          this.issued_drug = res.data.data.list
466
+        }
467
+        console.log("fun122222222")
468
+      })
469
+      console.log("fun1")
377 470
     },
378 471
 
472
+    morencreatename(){
473
+      var param ={}
474
+      getcurrentname(param).then((res) => {
475
+        console.log("res(药)",res)
476
+        if (res.data.state == 1){
477
+          this.admin_user_id = res.data.data.list;
478
+          console.log("this.admin_user_id(药)",this.admin_user_id)
479
+        }
480
+      });
481
+    },
482
+    //获取领药人选项
379 483
     getlist(){
380 484
       var params = {
381 485
         start_time:this.start_time,
@@ -383,76 +487,43 @@ export default {
383 487
       }
384 488
       getTodayAdviceList(params).then(response=>{
385 489
          if(response.data.state == 1){
386
-           var list =  response.data.data.list
387
-           this.$refs.singleTable.setCurrentRow(list[0])
388
-           this.tableData = list
389
-           var doctorlist = response.data.data.doctorlist
390
-           this.doctorList = doctorlist
490
+           this.doctorList = response.data.data.doctorlist
491
+           console.log("this.admin_user_id(药2)",this.admin_user_id)
492
+           // this.admin_user_id = this.doctorList[0].admin_user_id
493
+           // this.admin_user_id = this.tmp
391 494
          }
392 495
       })
393 496
     },
394
-   getWarehoseInfo(arr, max_unit, min_unit, min_number) {
395
-      var total = 0;
396
-      var max_str = "";
397
-      var min_str = "";
398
-      if (arr.length > 0) {
399
-        for (let i = 0; i < arr.length; i++) {
400
-          total += parseInt(arr[i].stock_max_number+ arr[i].stock_min_number);
401
-        }
497
+   //  //获取药品的患者信息
498
+    informationofdrugs(val){
499
+      var params = {
500
+        // patient_id: this.currentRow.
402 501
       }
403
-      if (total < min_number) {
404
-        min_str = total + min_unit;
502
+    },
503
+    handleCurrentChange(val) {
504
+      this.currentRow = val;
505
+      if(this.state == 1){
506
+        this.getdrugsdetails(0)
405 507
       }
406
-      if (total == 0) {
407
-        min_str = "";
408
-        max_str = "";
508
+      if (this.state == 2){
509
+        this.getdrugsdetails(1)
409 510
       }
410
-      if (total >= min_number) {
411
-        if (parseInt(total / min_number) != 0) {
412
-          max_str = parseInt(total / min_number) + max_unit;
413
-        }
414
-        if (total % min_number != 0) {
415
-          min_str = (total % min_number) + min_unit;
416
-        }
417
-      }
418
-      return max_str + min_str;
419
-    },
420
-
421
-    handleCurrentChange(row) {
422
-      this.getPharmacyBaseDrug(row.id)
423 511
     },
424
-    getPharmacyBaseDrug(drug_id){
512
+    getdrugsdetails(val){
425 513
       var params = {
426
-        start_time:this.start_time,
427
-        drug_id:drug_id,
514
+        drug_id:this.currentRow.id,
515
+        is_medicine:val,
516
+        time:this.start_time,
428 517
       }
429
-      getPharmacyBaseDrug(params).then(response=>{
430
-        if(response.data.state == 1){
431
-           var advicelist = response.data.data.advicelist
432
-           for(let i=0;i<advicelist.length;i++){
433
-             advicelist[i].type = 1
434
-             advicelist[i].day = " "
435
-             this.tableData_list.push(advicelist[i])
436
-           }
437
-           var hisAdviceList = response.data.data.hisAdviceList
438
-           for(let i=0;i<hisAdviceList.length;i++){
439
-             hisAdviceList[i].type = 2
440
-             this.tableData_list.push(hisAdviceList[i])
441
-           }
442
-           var patient = response.data.data.patient
443
-           this.patientList = patient
518
+      getpatientswithdrugs(params).then((res) => {
519
+        if (res.data.state == 1){
520
+          this.tableData = res.data.data.list;//列表数据
521
+        }else {
522
+          this.$message.error(res.data.msg);
444 523
         }
445 524
       })
446 525
     },
447
-    getPatientName(id){
448
-       var name = ""
449
-       for(let i=0;i<this.patientList.length;i++){
450
-          if(id == this.patientList[i].id){
451
-             name = this.patientList[i].name
452
-          }
453
-       }
454
-       return name
455
-    },
526
+
456 527
     toSetting(){
457 528
       getPharmacyConfig().then(response=>{
458 529
         if(response.data.state == 1){
@@ -500,7 +571,10 @@ export default {
500 571
   },
501 572
   created() {
502 573
     this.init();
503
-    this.getlist()
574
+    this.morencreatename();
575
+    this.getlist();
576
+    // this.getdruglist();
577
+    this.fun3();
504 578
   },
505 579
 };
506 580
 </script>

+ 360 - 45
src/xt_pages/Pharmacy/PatientDispensing.vue View File

@@ -1,4 +1,4 @@
1
-<template>
1
+<template><!--患者发药-->
2 2
   <div class="main-contain new-main-contain">
3 3
     <div class="position">
4 4
       <!--      <bread-crumb :crumbs='crumbs'></bread-crumb>-->
@@ -13,17 +13,21 @@
13 13
           <div class="list">
14 14
             <el-date-picker
15 15
               style="width: 200px"
16
-              v-model="datepick"
16
+              v-model="start_time"
17 17
               type="date"
18
+              format="yyyy-MM-dd"
19
+              value-format="yyyy-MM-dd"
18 20
               placeholder="选择日期"
21
+              @change="changeTimes()"
19 22
             >
20 23
             </el-date-picker>
21 24
           </div>
22
-
25
+<!--          <el-button @click="testsss">调试1</el-button>-->
26
+<!--          <el-button @click="testsss2">调试2</el-button>-->
23 27
           <div class="list">
24
-            <el-radio-group v-model="state">
25
-              <el-radio :label="1">待发药{{ waitmount }}人</el-radio>
26
-              <el-radio :label="2">已发药{{ alreadmount }}人</el-radio>
28
+            <el-radio-group v-model="state" @change="lala()">
29
+              <el-radio :label="1" >待发药{{ waitmount }}人</el-radio>
30
+              <el-radio :label="2" >已发药{{ alreadmount }}人</el-radio>
27 31
             </el-radio-group>
28 32
           </div>
29 33
           <div class="list">
@@ -33,6 +37,7 @@
33 37
               v-model="keywords"
34 38
               class="filter-item"
35 39
               placeholder="请输入患者名称"
40
+              clearable
36 41
             />
37 42
             <el-button
38 43
               size="small"
@@ -43,15 +48,28 @@
43 48
             </el-button>
44 49
           </div>
45 50
 
46
-          <el-table
47
-            :height="tableHeight"
48
-            :data="tableData"
49
-            border
50
-            style="width: 100%"
51
-          >
52
-            <el-table-column prop="date" label="患者姓名" width="100">
51
+          <el-table :height="tableHeight" ref="table01" :data="waitmount_data" highlight-current-row @current-change="handleCurrentChange" border style="width: 100%" v-if="state == 1">
52
+            <el-table-column prop="date" label="患者姓名" width="100" >
53
+              <template slot-scope="scope">
54
+                <span >{{scope.row.Name ? scope.row.Name : ""}}</span>
55
+              </template>
53 56
             </el-table-column>
54
-            <el-table-column prop="name" label="单据编号" width="100">
57
+            <el-table-column prop="name" label="透析号" width="100">
58
+              <template slot-scope="scope">
59
+                <span>{{scope.row.DialysisNo ? scope.row.DialysisNo : ""}}</span>
60
+              </template>
61
+            </el-table-column>
62
+          </el-table>
63
+          <el-table :height="tableHeight" ref="table02" :data="alreadmount_data" highlight-current-row @current-change="handleCurrentChange" border style="width: 100%" v-if="state == 2">
64
+            <el-table-column prop="date" label="患者姓名" width="100" >
65
+              <template slot-scope="scope" >
66
+                <span>{{scope.row.Name ? scope.row.Name : ""}}</span>
67
+              </template>
68
+            </el-table-column>
69
+            <el-table-column prop="name" label="透析号" width="100">
70
+              <template slot-scope="scope">
71
+                <span>{{scope.row.DialysisNo ? scope.row.DialysisNo : ""}}</span>
72
+              </template>
55 73
             </el-table-column>
56 74
           </el-table>
57 75
         </div>
@@ -65,40 +83,85 @@
65 83
             >退药</el-button
66 84
           >
67 85
           <el-button type="primary" @click="toPrint">打印</el-button>
68
-          <el-button type="primary" v-if="state == 1">设置</el-button>
86
+<!--          <el-button @click="tiaoshi">调试</el-button>-->
87
+          <el-button type="primary" v-if="state == 1" @click="toSetting">设置</el-button>
69 88
         </div>
70 89
         <el-divider></el-divider>
71 90
         <div>
72 91
           <el-table
73 92
             :height="tableHeight"
74
-            :data="tableData_list"
93
+            :data="tableData"
75 94
             border
76 95
             style="width: 100%"
77 96
           >
78 97
             <el-table-column type="index" label="序号" width="120" align="center">
79 98
             </el-table-column>
80
-            <el-table-column prop="name" label="名称" width="220" align="center">
99
+            <el-table-column  label="名称" width="200" align="center">
100
+              <template slot-scope="scope">
101
+                <span>{{scope.row.Name  ? scope.row.Name  : ""}}</span>
102
+              </template>
81 103
             </el-table-column>
82
-            <el-table-column prop="name" label="单次用量" width="170" align="center">
104
+            <el-table-column  label="单次用量" width="150" align="center">
105
+              <template slot-scope="scope">
106
+                <span>{{scope.row.SingleDosage  ? scope.row.SingleDosage  : ""}}</span>
107
+              </template>
83 108
             </el-table-column>
84
-            <el-table-column prop="name" label="用法" width="160" align="center">
109
+            <el-table-column  label="用法" width="160" align="center">
110
+              <template slot-scope="scope">
111
+                <span>{{scope.row.Usage  ? scope.row.Usage  : ""}}</span>
112
+              </template>
85 113
             </el-table-column>
86
-            <el-table-column prop="name" label="频率" width="160" align="center">
114
+            <el-table-column  label="频率" width="160" align="center">
115
+              <template slot-scope="scope">
116
+                <span>{{scope.row.Frequency  ? scope.row.Frequency  : ""}}</span>
117
+              </template>
87 118
             </el-table-column>
88
-            <el-table-column prop="name" label="天数" width="160" align="center">
119
+            <el-table-column  label="天数" width="140" align="center">
120
+              <template slot-scope="scope">
121
+                <span>{{scope.row.Days  ? scope.row.Days  : ""}}</span>
122
+              </template>
89 123
             </el-table-column>
90
-            <el-table-column prop="name" label="总量" width="160" align="center">
124
+            <el-table-column  label="总量" width="140" align="center">
125
+              <template slot-scope="scope">
126
+                <span>{{scope.row.Total  ? scope.row.Total  : ""}}</span>
127
+              </template>
91 128
             </el-table-column>
92
-            <el-table-column prop="name" label="开立医生" width="160" align="center">
129
+            <el-table-column  label="开立医生" width="150" align="center">
130
+              <template slot-scope="scope">
131
+                <span>{{scope.row.Doctor  ? scope.row.Doctor  : ""}}</span>
132
+              </template>
93 133
             </el-table-column>
94
-            <el-table-column prop="name" label="数据来源" width="162" align="center">
134
+            <el-table-column  label="数据来源" width="162" align="center">
135
+              <template slot-scope="scope">
136
+                <span>{{scope.row.DataSources  ? scope.row.DataSources  : ""}}</span>
137
+              </template>
95 138
             </el-table-column>
96
-            <el-table-column prop="name" label="备注" width="170" align="center">
139
+            <el-table-column  label="备注" width="170" align="center">
140
+              <template slot-scope="scope">
141
+                <span>{{scope.row.Remarks  ? scope.row.Remarks  : ""}}</span>
142
+              </template>
97 143
             </el-table-column>
98 144
           </el-table>
99 145
         </div>
100
-        <div style="margin-top: 25px">诊断时间:2022-05-07 19:22:16</div>
146
+<!--        <div v-if="state == 2" style="margin-top: 25px">诊断时间:{{ timedate }}</div>-->
101 147
       </div>
148
+      <el-dialog
149
+        title="设置"
150
+        :visible.sync="dialogVisible"
151
+        width="30%">
152
+        <span>请选择药品是否要通过药房管理出库</span>
153
+        <span>
154
+          <el-radio v-model="is_open" label="1">是</el-radio>
155
+          <el-radio v-model="is_open" label="2">否</el-radio>
156
+        </span>
157
+        <span>
158
+          若选择为是,则通过药房发药的药品都会在发药之后进行出库,否则按原来的方式进行出库管理
159
+        </span>
160
+        <span slot="footer" class="dialog-footer">
161
+          <el-button @click="dialogVisible = false">取 消</el-button>
162
+          <el-button type="primary" @click="SaveSetting">确 定</el-button>
163
+        </span>
164
+      </el-dialog>
102 165
     </div>
103 166
 
104 167
     <patient-print
@@ -113,6 +176,16 @@
113 176
 <script>
114 177
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
115 178
 import patientPrint from "./print/patientPrint.vue";
179
+import { getPharmacyConfig,SaveSetting } from "@/api/his/advice";
180
+import {
181
+  waitingdrug,
182
+  issueddrugs,
183
+  todaynumber,
184
+  getpharmacycontent,
185
+  dispensingmedicine,
186
+  drugwithdrawal
187
+} from "@/api/pharmacy"
188
+const moment = require('moment')
116 189
 export default {
117 190
   components: {
118 191
     BreadCrumb,
@@ -120,60 +193,302 @@ export default {
120 193
   },
121 194
   data() {
122 195
     return {
196
+      patient_id:0,
123 197
       crumbs: [
124
-        { path: false, name: "患者发药" },
198
+        { path: false, name: "药房管理" },
125 199
         { path: "/Pharmacy/patiantDispensing", name: "患者发药" },
126 200
       ],
127 201
       tableHeight: 400,
128
-      datepick: "",
129
-      state: 1,
130
-      waitmount: 0,
131
-      alreadmount: 0,
202
+      start_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
203
+      state: 1,//1待发药,2已发药
204
+      waitmount: 0,//待发药人数
205
+      waitmount_data: [],
206
+      alreadmount: 0,//已发药人数
207
+      alreadmount_data: [],
132 208
       keywords: "",
133 209
       tableData: [],
134 210
       propsTable: [],
135 211
       tableData_list: [],
136 212
       isVisibility: false,
213
+      currentRow:null,
214
+      dialogVisible:false,
215
+      is_open:"2",
137 216
     };
138 217
   },
139 218
   watch: {
140 219
   },
141
-
220
+  created() {
221
+    this.init();
222
+    this.gettodaynumber();
223
+    this.fun3();
224
+    // this.getwaitmount();//fun3
225
+    // this.selectedbydefault();
226
+  },
142 227
   methods: {
228
+    tiaoshi(){
229
+      console.log("this.tableData",this.tableData)
230
+    },
231
+    async fun3(){
232
+      console.log("fun3")
233
+        this.fun1().then(val => {
234
+          this.fun2();
235
+        })
236
+    },
237
+    async fun4(tmp){
238
+      console.log("fun3")
239
+      this.fun1().then(val => {
240
+        console.log("this.alreadmount_data",this.alreadmount_data)
241
+        for (let i = 0;i < this.alreadmount_data.length;i++){
242
+          console.log("tmp = ",tmp)
243
+          if (this.alreadmount_data[i].PatientID == tmp){
244
+            console.log("i = ",i)
245
+            this.$refs.table02.setCurrentRow(this.alreadmount_data[i]);
246
+            this.handleCurrentChange(this.alreadmount_data[i])
247
+          }
248
+        }
249
+      })
250
+    },
251
+    async fun5(tmp){
252
+      console.log("fun3")
253
+      this.fun1().then(val => {
254
+        console.log("this.alreadmount_data",this.waitmount_data)
255
+        for (let i = 0;i < this.waitmount_data.length;i++){
256
+          console.log("tmp = ",tmp)
257
+          if (this.waitmount_data[i].PatientID == tmp){
258
+            console.log("i = ",i)
259
+            this.$refs.table02.setCurrentRow(this.waitmount_data[i]);
260
+            this.handleCurrentChange(this.waitmount_data[i])
261
+          }
262
+        }
263
+      })
264
+    },
265
+
266
+    lala(){
267
+      console.log("this.state!!!!!!",this.state)
268
+      //初始化状态
269
+      this.tableData = null
270
+      this.currentRow = null
271
+      this.selectedbydefault()
272
+    },
273
+    //选中行数
274
+    handleCurrentChange(val) {
275
+      this.currentRow = val;
276
+      console.log("this.currentRow",this.currentRow)
277
+      if(this.state == 1){
278
+        this.getpatientdetails(0)
279
+      }
280
+      if(this.state == 2){
281
+        this.getpatientdetails(1)
282
+      }
283
+    },
284
+    init(){
285
+      // console.log("初始化了")
286
+      this.state = 1
287
+      this.tableData = null
288
+      this.currentRow = null
289
+    },
290
+    testsss(){
291
+     this.state = 1;
292
+    },
293
+    //默认选中的
294
+    selectedbydefault(){
295
+      if(this.state == 1 && this.waitmount_data.length > 0){
296
+        this.$refs.table01.setCurrentRow(this.waitmount_data[0]);
297
+        this.handleCurrentChange(this.waitmount_data[0])
298
+      }
299
+      if(this.state == 2 && this.alreadmount_data.length >0){
300
+        this.$refs.table02.setCurrentRow(this.alreadmount_data[0]);
301
+        this.handleCurrentChange(this.alreadmount_data[0])
302
+      }
303
+    },
304
+    //包装selectedbydefault
305
+    fun2(){
306
+      console.log("3333333this.waitmount_data",this.waitmount_data)
307
+      // return new Promise((resolve, reject) => {
308
+        if(this.state == 1 && this.waitmount_data.length > 0){
309
+          this.$refs.table01.setCurrentRow(this.waitmount_data[0]);
310
+          this.handleCurrentChange(this.waitmount_data[0])
311
+        }
312
+        if(this.state == 2 && this.alreadmount_data.length >0){
313
+          this.$refs.table02.setCurrentRow(this.alreadmount_data[0]);
314
+          this.handleCurrentChange(this.alreadmount_data[0])
315
+        }
316
+      // });
317
+    },
318
+    changeTimes(){
319
+      this.gettodaynumber();
320
+      this.getwaitmount();
321
+      this.fun3();
322
+    },
323
+    //获取当天发药的人数
324
+    gettodaynumber(){
325
+      console.log("aaa")
326
+      var params = {
327
+        time: this.start_time,
328
+      }
329
+      todaynumber(params).then((res) => {
330
+        if (res.data.state == 1){
331
+          this.waitmount = res.data.data.itotal;
332
+          this.alreadmount = res.data.data.wtotal;
333
+        }
334
+      })
335
+      // console.log("2222222")
336
+    },
337
+    //获取发药人列表
338
+    getwaitmount(){
339
+      var params = {
340
+        keyword: this.keywords,
341
+        time: this.start_time,
342
+      }
343
+      waitingdrug(params).then((res) => {
344
+        if (res.data.state == 1){
345
+          this.waitmount_data = res.data.data.list;
346
+        }
347
+      })
348
+      issueddrugs(params).then((res) => {
349
+        if (res.data.state == 1){
350
+          this.alreadmount_data = res.data.data.list;
351
+        }
352
+      })
353
+    },
354
+    //包装getwaitmount
355
+    async fun1(){
356
+      // return new Promise((resolve, reject) => {
357
+        var params = {
358
+          keyword: this.keywords,
359
+          time: this.start_time,
360
+        }
361
+        await waitingdrug(params).then((res) => {
362
+          if (res.data.state == 1){
363
+            this.waitmount_data = res.data.data.list;
364
+            console.log("1111111")
365
+          }
366
+        })
367
+        await issueddrugs(params).then((res) => {
368
+          if (res.data.state == 1){
369
+            this.alreadmount_data = res.data.data.list;
370
+            console.log("1111111s")
371
+          }
372
+        })
373
+        console.log("222222222")
374
+
375
+      // })
376
+    },
377
+    //获取患者信息详情
378
+    getpatientdetails(val){
379
+      var params = {
380
+        patient_id:this.currentRow.PatientID,
381
+        is_medicine: val,
382
+        time:this.start_time,
383
+      }
384
+      getpharmacycontent(params).then((res) => {
385
+        if (res.data.state == 1){
386
+          this.tableData = res.data.data.list;
387
+        }else{
388
+          this.$message.error(res.data.msg);
389
+        }
390
+      })
391
+    },
143 392
     // 跳转打印页面
144 393
     toPrint() {
145
-      // this.$router.push({ path: "/Pharmacy/print/patientPrint" });
146
-      this.$refs.patientprint.show();
394
+      if (this.tableData == null){
395
+        this.$message.error("未选择任何数据");
396
+        return
397
+      }
398
+      this.$refs.patientprint.show(this.tableData,this.currentRow,this.state);
147 399
     },
148 400
 
149 401
     // 搜索患者
150
-    searchAction() {},
402
+    searchAction() {
403
+      this.tableData = null;
404
+      this.getwaitmount();
405
+    },
151 406
 
152 407
     // 药品发药
153 408
     dispense() {
154
-      var params = {};
409
+      var tmp = this.currentRow.PatientID;
410
+      var params = {
411
+        patient_id:this.currentRow.PatientID,
412
+        time:this.start_time,
413
+      };
155 414
       this.$confirm("确定是否对该药品进行发药?", "患者发药", {
156 415
         confirmButtonText: "确 定",
157 416
         cancelButtonText: "取 消",
158 417
         type: "warning",
159
-      })
160
-        .then(() => {})
161
-        .catch(() => {});
418
+      }).then(() => {
419
+        dispensingmedicine(params).then((res) => {
420
+          if(res.data.state == 1){
421
+            this.$message.success('操作成功');
422
+            this.gettodaynumber();
423
+            this.searchAction();
424
+            this.tableData = null;
425
+            this.fun4(tmp);
426
+            this.state = 2;
427
+            // console.log("this.alreadmount_data",this.alreadmount_data)
428
+            // for (let i = 0;i < this.alreadmount_data.length;i++){
429
+            //   console.log("tmp = ",tmp)
430
+            //     if (this.alreadmount_data[i].PatientID == tmp){
431
+            //       console.log("i = ",i)
432
+            //       this.$refs.table02.setCurrentRow(this.alreadmount_data[i]);
433
+            //       this.handleCurrentChange(this.alreadmount_data[i])
434
+            //     }
435
+            // }
436
+          }else {
437
+            this.$message.error(res.data.msg);
438
+          }
439
+        })
440
+      }).catch(() => {});
162 441
     },
163 442
 
443
+    toSetting(){
444
+      getPharmacyConfig().then(response=>{
445
+        if(response.data.state == 1){
446
+          this.dialogVisible = true
447
+          var config = response.data.data.config
448
+          this.is_open = config.is_open.toString()
449
+        }
450
+      })
451
+    },
452
+    SaveSetting(){
453
+      var params = {
454
+        is_open:parseInt(this.is_open),
455
+      }
456
+      SaveSetting(params).then(response=>{
457
+        if(response.data.state == 1){
458
+          var config = response.data.data.config
459
+          this.$message.success("保存成功!")
460
+          this.dialogVisible = false
461
+        }
462
+      })
463
+    },
164 464
     // 药品退药
165 465
     endispense() {
166
-      var params = {};
466
+      var tmp = this.currentRow.PatientID;
467
+      var params = {
468
+        patient_id:this.currentRow.PatientID,
469
+        time:this.start_time,
470
+      };
167 471
       this.$confirm("确定是否对该药品进行退药?", "患者退药", {
168 472
         confirmButtonText: "确 定",
169 473
         cancelButtonText: "取 消",
170 474
         type: "warning",
171
-      })
172
-        .then(() => {})
173
-        .catch(() => {});
475
+      }).then(() => {
476
+        drugwithdrawal(params).then((res) => {
477
+          if(res.data.state == 1){
478
+            this.$message.success('操作成功');
479
+            this.gettodaynumber();
480
+            this.searchAction();
481
+            this.tableData = null;
482
+            this.fun4(tmp);
483
+            this.state = 1;
484
+          }else {
485
+            this.$message.error(res.data.msg);
486
+          }
487
+        })
488
+      }).catch(() => {});
174 489
     },
175 490
   },
176
-  created() {},
491
+
177 492
 };
178 493
 </script>
179 494
 
@@ -213,4 +528,4 @@ export default {
213 528
     justify-content: flex-end;
214 529
   }
215 530
 }
216
-</style>
531
+</style>

+ 102 - 60
src/xt_pages/Pharmacy/print/details.vue View File

@@ -1,13 +1,12 @@
1
-<template>
1
+<template><!--发药明细详情-->
2 2
   <el-dialog
3
-    title="打印"
3
+    title="详情"
4 4
     :visible.sync="visibility"
5 5
     :close-on-click-modal="isClose"
6 6
     :close-on-press-escape="isClose"
7 7
   >
8
-    <el-button type="primary" @click="print" class="print_style"
9
-      >打印</el-button
10
-    >
8
+<!--    <el-button type="primary" @click="print" class="print_style">详情</el-button>-->
9
+<!--    <el-button  @click="lili" >调试</el-button>-->
11 10
     <div id="dialysis-print-box-1" class="dialysis-print-box-1">
12 11
       <!-- <div class="list_title">
13 12
         <div>药品名称:</div>
@@ -15,46 +14,55 @@
15 14
         <div>发药状态:</div>
16 15
         <div v-if="state==2">领药人:</div>
17 16
       </div> -->
18
-      <el-tabs v-model="activeName" @tab-click="handleClick">
19
-        <el-tab-pane label="处方详情" name="first">
20
-          <el-tabs v-model="editableTabsValue" type="card">
21
-            <el-tab-pane
22
-              :key="item.name"
23
-              v-for="(item, index) in editableTabs"
24
-              :label="item.title"
25
-            >
26
-              Rp
27
-              <el-table
17
+      <el-table
28 18
                 style="width: 1020px; margin: 0 auto"
29
-                :data="tableData"
19
+                :data="list"
30 20
                 border
31 21
                 max-height="450"
32 22
                 :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
33 23
               >
34
-                <el-table-column prop="name" label="名称" width="160" align="center">
35
-                </el-table-column>
36
-                 <el-table-column prop="group" label="组" width="100" align="center">
24
+                <el-table-column prop="Drugname" label="名称" width="160" align="center">
25
+                  <template slot-scope="scope">
26
+                    <span>{{scope.row.Drugname  ? scope.row.Drugname  : ""}}</span>
27
+                  </template>
37 28
                 </el-table-column>
38 29
                 <el-table-column prop="SingleDosage" label="单次用量" width="100" align="center">
30
+                  <template slot-scope="scope">
31
+                    <span>{{scope.row.SingleDosage  ? scope.row.SingleDosage  : ""}}</span>
32
+                  </template>
39 33
                </el-table-column>
40
-                <el-table-column prop="use" label="用法" width="120" align="center">
34
+                <el-table-column prop="Usage" label="用法" width="120" align="center">
35
+                  <template slot-scope="scope">
36
+                    <span>{{scope.row.Usage  ? scope.row.Usage  : ""}}</span>
37
+                  </template>
41 38
                 </el-table-column>
42
-                <el-table-column prop="frequency" label="频率" width="120" align="center">
39
+                <el-table-column prop="Frequency" label="频率" width="120" align="center">
40
+                  <template slot-scope="scope">
41
+                    <span>{{scope.row.Frequency  ? scope.row.Frequency  : ""}}</span>
42
+                  </template>
43 43
                 </el-table-column>
44
-                <el-table-column prop="day" label="天数" width="120" align="center">
44
+                <el-table-column prop="Days" label="天数" width="120" align="center">
45
+                  <template slot-scope="scope">
46
+                    <span>{{scope.row.Days  ? scope.row.Days  : ""}}</span>
47
+                  </template>
45 48
                 </el-table-column>
46
-                <el-table-column prop="amount" label="总量" width="90" align="center">
49
+                <el-table-column prop="Total" label="总量" width="90" align="center">
50
+                  <template slot-scope="scope">
51
+                    <span>{{scope.row.Total  ? scope.row.Total  : ""}}</span>
52
+                  </template>
47 53
                 </el-table-column>
48
-                <el-table-column prop="price" label="单价" width="100" align="center">
54
+                <el-table-column prop="UnitPrice" label="单价" width="100" align="center">
55
+                  <template slot-scope="scope">
56
+                    <span>{{scope.row.UnitPrice  ? scope.row.UnitPrice  : ""}}</span>
57
+                  </template>
49 58
                 </el-table-column>
50
-                <el-table-column prop="tips" label="备注" width="120" align="center">
59
+                <el-table-column prop="Remarks" label="备注" width="120" align="center">
60
+                  <template slot-scope="scope">
61
+                    <span>{{scope.row.Remarks  ? scope.row.Remarks  : ""}}</span>
62
+                  </template>
51 63
                 </el-table-column>
52 64
               </el-table>
53
-            </el-tab-pane>
54
-          </el-tabs>
55
-        </el-tab-pane>
56
-        <el-tab-pane label="病历详情" name="second">病历详情</el-tab-pane>
57
-      </el-tabs>
65
+<!--        <el-tab-pane label="病历详情" name="second">病历详情</el-tab-pane>-->
58 66
     </div>
59 67
   </el-dialog>
60 68
 </template>
@@ -62,6 +70,9 @@
62 70
 import Vue from "vue";
63 71
 import print from "print-js";
64 72
 import printutils from "./print.js";
73
+import {
74
+  prescriptiondetails
75
+} from "@/api/pharmacy"
65 76
 
66 77
 export default {
67 78
   data() {
@@ -71,15 +82,11 @@ export default {
71 82
       isClose: false,
72 83
       activeName: "first",
73 84
       editableTabsValue: "2",
74
-      editableTabs: [
75
-        {
76
-          title: "处方1",
77
-        },
78
-        {
79
-          title: "处方2",
80
-        },
81
-      ],
85
+      editableTabs: [],//名字
86
+      // dialysisTabs: [],//名字
87
+      dialysisName:"",
82 88
       tabIndex: 2,
89
+      list:[],
83 90
     };
84 91
   },
85 92
   props: {
@@ -103,8 +110,48 @@ export default {
103 110
         }
104 111
       }
105 112
     },
113
+    init(){
114
+      console.log("初始化中。。。。。。。。。。")
115
+      this.dialysisName = "";
116
+      this.list = [];
117
+      this.editableTabs = [];
118
+    },
106 119
     show: function () {
107 120
       this.visibility = true;
121
+      console.log("this.visibility",this.visibility)
122
+      this.init();
123
+    },
124
+    lili(){
125
+      console.log("this.list",this.list)
126
+      let v = [];
127
+      //key
128
+      for (let k in this.list){
129
+        v.push(k);
130
+        console.log("k",k)
131
+        console.log("v",this.list[k])
132
+        console.log("editableTabs",this.editableTabs)
133
+        for(let i = 0;i < this.list[k].length;i++){
134
+          this.editableTabs.push(this.list[k][i])
135
+        }
136
+      }
137
+
138
+    },
139
+    //发药明细详情
140
+    drugdetails(data){
141
+      console.log("aaaaaaaaaaaaa")
142
+      var params = {
143
+        patient_id: data.PatientID,
144
+        record_date: data.RecordTime,
145
+      }
146
+      prescriptiondetails(params).then((res) => {
147
+        if (res.data.state == 1){
148
+            this.list = res.data.data.list;
149
+            this.lili();
150
+        }else{
151
+          this.$message.error(res.data.msg);
152
+        }
153
+      })
154
+
108 155
     },
109 156
 
110 157
     comfirm: function (formName) {
@@ -124,59 +171,54 @@ export default {
124 171
       Vue.prototype.printJson = printutils.printJson;
125 172
       this.printJson({
126 173
         // title: ``, // 打印出来的标题
127
-        data: this.tableData, // 需要打印的数据
174
+        data: this.list, // 需要打印的数据
128 175
         serial: false, // 是否需要打印序列号
129 176
         fields: [
130 177
           // 需要打印的字段
131 178
 
132
-          "name",
133
-          "group",
179
+          "Drugname",
134 180
           "SingleDosage",
135
-          "use",
136
-          "frequency",
137
-          "day",
138
-          "amount",
139
-          "price",
140
-          "tips",
181
+          "Usage",
182
+          "Frequency",
183
+          "Days",
184
+          "Total",
185
+          "UnitPrice",
186
+          "Remarks",
141 187
         ],
142 188
         properties: [
143 189
           // 需要打印的字段对应的表头名
144 190
 
145 191
           {
146
-            field: "name",
192
+            field: "Drugname",
147 193
             displayName: "名称",
148
-          },
149
-            {
150
-            field: "group",
151
-            displayName: "组",
152 194
           },
153 195
           {
154 196
             field: "SingleDosage",
155
-            displayName: "单用量",
197
+            displayName: "单次用量",
156 198
           },
157 199
           {
158
-            field: "use",
200
+            field: "Usage",
159 201
             displayName: "用法",
160 202
           },
161 203
           {
162
-            field: "frequency",
204
+            field: "Frequency",
163 205
             displayName: "频率",
164 206
           },
165 207
           {
166
-            field: "day",
208
+            field: "Days",
167 209
             displayName: "天数",
168 210
           },
169 211
           {
170
-            field: "amount",
212
+            field: "Total",
171 213
             displayName: "总量",
172 214
           },
173 215
           {
174
-            field: "price",
216
+            field: "UnitPrice",
175 217
             displayName: "单价",
176 218
           },
177
-          
219
+
178 220
           {
179
-            field: "tips",
221
+            field: "Remarks",
180 222
             displayName: "备注",
181 223
           },
182 224
         ],

+ 75 - 27
src/xt_pages/Pharmacy/print/drugPrint.vue View File

@@ -10,10 +10,10 @@
10 10
     >
11 11
     <div id="dialysis-print-box-1" class="dialysis-print-box-1">
12 12
       <div class="list_title">
13
-        <div>药品名称:</div>
14
-        <div>规格:</div>
15
-        <div>发药状态:</div>
16
-        <div v-if="state==2">领药人:</div>
13
+        <div>药品名称:{{name}}</div>
14
+        <div>规格:{{specifications}}</div>
15
+        <div>发药状态:{{state_name}}</div>
16
+<!--        <div v-if="state==2">领药人:</div>-->
17 17
       </div>
18 18
 
19 19
       <el-table
@@ -26,16 +26,44 @@
26 26
         <el-table-column type="index" prop="index" label="序号" width="60">
27 27
         </el-table-column>
28 28
         <el-table-column prop="name" label="患者姓名" width="160">
29
+          <template  slot-scope="scope">
30
+            {{scope.row.name}}
31
+          </template>
29 32
         </el-table-column>
30
-        <el-table-column prop="SingleDosage" label="单次用量" width="120">
33
+        <el-table-column prop="single_dosage" label="单次用量" width="120">
34
+          <template  slot-scope="scope">
35
+            {{scope.row.single_dosage}}
36
+          </template>
37
+        </el-table-column>
38
+        <el-table-column prop="usage" label="用法" width="120">
39
+          <template  slot-scope="scope">
40
+            {{scope.row.usage}}
41
+          </template>
31 42
         </el-table-column>
32
-        <el-table-column prop="use" label="用法" width="120"> </el-table-column>
33 43
         <el-table-column prop="frequency" label="频率" width="120">
44
+          <template  slot-scope="scope">
45
+            {{scope.row.frequency}}
46
+          </template>
47
+        </el-table-column>
48
+        <el-table-column prop="days" label="天数" width="120">
49
+          <template  slot-scope="scope">
50
+            {{scope.row.days}}
51
+          </template>
34 52
         </el-table-column>
35
-        <el-table-column prop="day" label="天数" width="120"> </el-table-column>
36
-        <el-table-column prop="amount" label="总量" width="120">
53
+        <el-table-column prop="total" label="总量" width="120">
54
+          <template  slot-scope="scope">
55
+            {{scope.row.total}}
56
+          </template>
37 57
         </el-table-column>
38
-        <el-table-column prop="tips" label="数据来源" width="120">
58
+        <el-table-column prop="data_sources" label="数据来源" width="120">
59
+          <template  slot-scope="scope">
60
+            {{scope.row.data_sources}}
61
+          </template>
62
+        </el-table-column>
63
+        <el-table-column prop="people" label="领药人" width="120">
64
+          <template  slot-scope="scope">
65
+            {{scope.row.people}}
66
+          </template>
39 67
         </el-table-column>
40 68
       </el-table>
41 69
     </div>
@@ -50,8 +78,11 @@ export default {
50 78
   data() {
51 79
     return {
52 80
       visibility: false,
53
-      tableData: [{}],
54
-      isClose:false
81
+      tableData: [],
82
+      isClose:false,
83
+      name:"",
84
+      specifications:"",
85
+      state_name:"",
55 86
     };
56 87
   },
57 88
   props: {
@@ -79,8 +110,20 @@ export default {
79 110
         }
80 111
       }
81 112
     },
82
-    show: function () {
113
+    show: function (val,data,state,ids) {
83 114
       this.visibility = true;
115
+      this.name = data.name
116
+      this.specifications = data.specifications
117
+      console.log("this.multipleSelection",ids)
118
+      console.log("this.val",val)
119
+      if (state == 1){
120
+        this.state_name = "待发药"
121
+        this.tableData = ids
122
+      }
123
+      if (state == 2){
124
+        this.state_name = "已发药"
125
+        this.tableData = val
126
+      }
84 127
     },
85 128
 
86 129
     comfirm: function (formName) {
@@ -105,9 +148,9 @@ export default {
105 148
       //   });
106 149
       this.printJson({
107 150
         title: `<div style="width: 940px;border-bottom: 1px solid;display: flex;margin: 30px auto;">
108
-        <div style="width: 230px;padding: 10px 0;">药品名称:${1}</div>
109
-        <div style="width: 230px;padding: 10px 0;">规格:${1}</div>
110
-        <div style="width: 230px;padding: 10px 0;">发药状态:${1}</div>
151
+        <div style="width: 230px;padding: 10px 0;">药品名称:${this.name}</div>
152
+        <div style="width: 230px;padding: 10px 0;">规格:${this.specifications}</div>
153
+        <div style="width: 230px;padding: 10px 0;">发药状态:${this.state_name}</div>
111 154
         </div>`, // 打印出来的标题
112 155
         data: this.tableData, // 需要打印的数据
113 156
         serial: true, // 是否需要打印序列号
@@ -115,12 +158,13 @@ export default {
115 158
           // 需要打印的字段
116 159
 
117 160
           "name",
118
-          "SingleDosage",
119
-          "use",
161
+          "single_dosage",
162
+          "usage",
120 163
           "frequency",
121
-          "day",
122
-          "amount",
123
-          "tips",
164
+          "days",
165
+          "total",
166
+          "data_sources",
167
+          "people",
124 168
         ],
125 169
         properties: [
126 170
           // 需要打印的字段对应的表头名
@@ -130,11 +174,11 @@ export default {
130 174
             displayName: "姓名",
131 175
           },
132 176
           {
133
-            field: "SingleDosage",
134
-            displayName: "单用量",
177
+            field: "single_dosage",
178
+            displayName: "单用量",
135 179
           },
136 180
           {
137
-            field: "use",
181
+            field: "usage",
138 182
             displayName: "用法",
139 183
           },
140 184
           {
@@ -142,16 +186,20 @@ export default {
142 186
             displayName: "频率",
143 187
           },
144 188
           {
145
-            field: "day",
189
+            field: "days",
146 190
             displayName: "天数",
147 191
           },
148 192
           {
149
-            field: "amount",
193
+            field: "total",
150 194
             displayName: "总量",
151 195
           },
152 196
           {
153
-            field: "tips",
154
-            displayName: "备注",
197
+            field: "data_sources",
198
+            displayName: "数据来源",
199
+          },
200
+          {
201
+            field: "people",
202
+            displayName: "领药人",
155 203
           },
156 204
         ],
157 205
       });

+ 67 - 26
src/xt_pages/Pharmacy/print/patientPrint.vue View File

@@ -10,10 +10,8 @@
10 10
     >
11 11
     <div id="dialysis-print-box-1" class="dialysis-print-box-1">
12 12
       <div class="list_title">
13
-        <div>患者名称:</div>
14
-        <div>数据来源:</div>
15
-        <div>发药状态:</div>
16
-        <div>领药时间:</div>
13
+        <div>患者名称:{{name}}</div>
14
+        <div>发药状态:{{state}}</div>
17 15
       </div>
18 16
 
19 17
       <el-table
@@ -26,16 +24,44 @@
26 24
         <el-table-column type="index" prop="index" label="序号" width="60">
27 25
         </el-table-column>
28 26
         <el-table-column prop="name" label="名称" width="160">
27
+          <template slot-scope="scope" >
28
+            <span>{{scope.row.Name ? scope.row.Name : ""}}</span>
29
+          </template>
29 30
         </el-table-column>
30 31
         <el-table-column prop="SingleDosage" label="单次用量" width="120">
32
+          <template slot-scope="scope" >
33
+            <span>{{scope.row.SingleDosage ? scope.row.SingleDosage : ""}}</span>
34
+          </template>
35
+        </el-table-column>
36
+        <el-table-column prop="use" label="用法" width="120">
37
+          <template slot-scope="scope" >
38
+            <span>{{scope.row.Usage ? scope.row.Usage : ""}}</span>
39
+          </template>
31 40
         </el-table-column>
32
-        <el-table-column prop="use" label="用法" width="120"> </el-table-column>
33 41
         <el-table-column prop="frequency" label="频率" width="120">
42
+          <template slot-scope="scope" >
43
+            <span>{{scope.row.Frequency ? scope.row.Frequency : ""}}</span>
44
+          </template>
45
+        </el-table-column>
46
+        <el-table-column prop="day" label="天数" width="120">
47
+          <template slot-scope="scope" >
48
+            <span>{{scope.row.Days ? scope.row.Days : ""}}</span>
49
+          </template>
34 50
         </el-table-column>
35
-        <el-table-column prop="day" label="天数" width="120"> </el-table-column>
36 51
         <el-table-column prop="amount" label="总量" width="120">
52
+          <template slot-scope="scope" >
53
+            <span>{{scope.row.Total ? scope.row.Total : ""}}</span>
54
+          </template>
55
+        </el-table-column>
56
+        <el-table-column prop="tips" label="数据来源" width="120">
57
+          <template slot-scope="scope" >
58
+            <span>{{scope.row.DataSources ? scope.row.DataSources : ""}}</span>
59
+          </template>
37 60
         </el-table-column>
38 61
         <el-table-column prop="tips" label="备注" width="120">
62
+          <template slot-scope="scope" >
63
+            <span>{{scope.row.Remarks ? scope.row.Remarks : ""}}</span>
64
+          </template>
39 65
         </el-table-column>
40 66
       </el-table>
41 67
     </div>
@@ -50,8 +76,10 @@ export default {
50 76
   data() {
51 77
     return {
52 78
       visibility: false,
53
-      tableData: [{}],
54
-      isClose:false
79
+      tableData: [],
80
+      isClose:false,
81
+      name:"",
82
+      state:null,
55 83
     };
56 84
   },
57 85
   props: {
@@ -75,8 +103,18 @@ export default {
75 103
         }
76 104
       }
77 105
     },
78
-    show: function () {
106
+    show: function (val,data,state) {
79 107
       this.visibility = true;
108
+      console.log("val",val)
109
+      this.tableData = val
110
+      this.name = data.Name
111
+      if (state == 1){
112
+        this.state = "待发药"
113
+      }
114
+      if (state == 2){
115
+        this.state = "已发药"
116
+      }
117
+
80 118
     },
81 119
 
82 120
     comfirm: function (formName) {
@@ -101,53 +139,56 @@ export default {
101 139
       //   });
102 140
       this.printJson({
103 141
         title: `<div style="width: 940px;border-bottom: 1px solid;display: flex;margin: 30px auto;">
104
-        <div style="width: 230px;padding: 10px 0;">患者名称:${1}</div>
105
-        <div style="width: 230px;padding: 10px 0;">数据来源:${1}</div>
106
-        <div style="width: 230px;padding: 10px 0;">预约状态:${1}</div>
107
-        <div style="width: 230px;padding: 10px 0;">领药时间:${1}</div>
142
+        <div style="width: 230px;padding: 10px 0;">患者名称:${this.name}</div>
143
+        <div style="width: 230px;padding: 10px 0;">发药状态:${this.state}</div>
108 144
         </div>`, // 打印出来的标题
109 145
         data: this.tableData, // 需要打印的数据
110 146
         serial: true, // 是否需要打印序列号
111 147
         fields: [
112 148
           // 需要打印的字段
113 149
 
114
-          "name",
150
+          "Name",
115 151
           "SingleDosage",
116
-          "use",
117
-          "frequency",
118
-          "day",
119
-          "amount",
120
-          "tips",
152
+          "Usage",
153
+          "Frequency",
154
+          "Days",
155
+          "Total",
156
+          "DataSources",
157
+          "Remarks",
121 158
         ],
122 159
         properties: [
123 160
           // 需要打印的字段对应的表头名
124 161
 
125 162
           {
126
-            field: "name",
163
+            field: "Name",
127 164
             displayName: "姓名",
128 165
           },
129 166
           {
130 167
             field: "SingleDosage",
131
-            displayName: "单用量",
168
+            displayName: "单用量",
132 169
           },
133 170
           {
134
-            field: "use",
171
+            field: "Usage",
135 172
             displayName: "用法",
136 173
           },
137 174
           {
138
-            field: "frequency",
175
+            field: "Frequency",
139 176
             displayName: "频率",
140 177
           },
141 178
           {
142
-            field: "day",
179
+            field: "Days",
143 180
             displayName: "天数",
144 181
           },
145 182
           {
146
-            field: "amount",
183
+            field: "Total",
147 184
             displayName: "总量",
148 185
           },
149 186
           {
150
-            field: "tips",
187
+            field: "DataSources",
188
+            displayName: "数据来源",
189
+          },
190
+          {
191
+            field: "Remarks",
151 192
             displayName: "备注",
152 193
           },
153 194
         ],

+ 24 - 10
src/xt_pages/data/components/addDrugs.vue View File

@@ -453,7 +453,7 @@
453 453
                     <el-form-item label="是否统计工作量:" prop="is_statistics_work">
454 454
                         <el-select v-model="form.is_statistics_work" style="width:160px;" placeholder="请选择">
455 455
                             <el-option
456
-                                    v-for="item,index in options"
456
+                                    v-for="(item,index) in options"
457 457
                                     :key="index"
458 458
                                     :label="item.label"
459 459
                                     :value="item.value">
@@ -463,18 +463,18 @@
463 463
                     <el-form-item label="是否收费常用项:" prop="is_charge_use">
464 464
                         <el-select v-model="form.is_charge_use" style="width:160px;" placeholder="请选择">
465 465
                             <el-option
466
-                                    v-for="item,index in options"
466
+                                    v-for="(item,index) in options"
467 467
                                     :key="index"
468 468
                                     :label="item.label"
469 469
                                     :value="item.value">
470 470
                             </el-option>
471 471
                         </el-select>
472 472
                     </el-form-item>
473
-                    <el-form-item label="是否通过药房发药:" prop="">
474
-                        <el-select v-model="form.is_charge_use" style="width:160px;" placeholder="请选择">
473
+                    <el-form-item label="是否通过药房发药:" prop="is_pharmacy">
474
+                        <el-select v-model="form.is_pharmacy" style="width:160px;" placeholder="请选择">
475 475
                             <el-option
476
-                                    v-for="item,index in options"
477
-                                    :key="index"
476
+                                    v-for="item in Pharmacy"
477
+                                    :key="item.value"
478 478
                                     :label="item.label"
479 479
                                     :value="item.value">
480 480
                             </el-option>
@@ -512,13 +512,26 @@
512 512
           { id: 2, name: '特殊护理' },
513 513
           { id: 3, name: '抗凝剂' }
514 514
         ],
515
-        options: [{
515
+        options: [
516
+          {
516 517
           value: '1',
517 518
           label: '是'
518
-        }, {
519
+          },
520
+          {
519 521
           value: '2',
520 522
           label: '否'
521
-        }],
523
+          }
524
+        ],
525
+        Pharmacy: [
526
+          {
527
+            value: 1,
528
+            label: '是'
529
+          },
530
+          {
531
+            value: 0,
532
+            label: '否'
533
+          }
534
+        ],
522 535
         lmt_used_flags: [{
523 536
           id: 0,
524 537
           name: '否'
@@ -608,6 +621,7 @@
608 621
           is_user:"2",
609 622
           sum_count:"",
610 623
           sum_in_count:"",
624
+          is_pharmacy:0,//是否通过药房发药
611 625
         },
612 626
 
613 627
         rules: {
@@ -723,7 +737,6 @@
723 737
         this.form.intro = ''
724 738
       },
725 739
       show(id, obj) {
726
-        console.log("obj3223323232332",obj)
727 740
         this.unitList = []
728 741
         this.packingUnit = []
729 742
         var arr =  getDataConfig('hemodialysis','units')
@@ -932,6 +945,7 @@
932 945
         form['is_user'] = this.form.is_user
933 946
         form['sum_count'] = this.form.sum_count
934 947
         form['sum_in_count'] = this.form.sum_in_count
948
+        form['is_pharmacy'] = this.form.is_pharmacy
935 949
         return form
936 950
       },
937 951
       getlist() {

+ 27 - 4
src/xt_pages/dialysis/details/dialog/DoctorAdviceDialog.vue View File

@@ -223,7 +223,7 @@
223 223
         :cell-class-name="adviceNameShow"
224 224
         :modal-append-to-body="false"
225 225
         highlight-current-row
226
-        
226
+
227 227
       >
228 228
       <!-- @selection-change="handleSelectionChange" -->
229 229
         <!-- <el-table-column type="selection"  width="55"></el-table-column> -->
@@ -553,7 +553,7 @@
553 553
       <div slot="footer" class="dialog-footer" v-show="showAdviceForm">
554 554
         <el-button @click="hideForm">取 消</el-button>
555 555
         <el-button type="primary" v-if="form.id == 0" @click="submitAdvice" :loading="loading">保 存</el-button><!--新增子药保存按钮(选择医嘱名称前)保 存1-->
556
-        <el-button type="primary" v-else @click="submitEditAdvice" :loading="loading">保 存</el-button><!--新增子药保存按钮(选择医嘱名称后)保 存2-->
556
+        <el-button type="primary" v-else @click="submitEditAdvice" :loading="loading">保 存</el-button><!--新增子药保存按钮(编辑医嘱存2-->
557 557
       </div>
558 558
       <!-- 医嘱表单 end -->
559 559
     </el-dialog>
@@ -1113,6 +1113,10 @@
1113 1113
       }
1114 1114
       ,
1115 1115
       openDeleteGroupAdvice(val) {
1116
+        if(this.currentRow.is_medicine == 1){
1117
+          this.$message.error('已发药,不可删除')
1118
+          return
1119
+        }
1116 1120
         if (this.groupSelectRow === null) {
1117 1121
           this.$message.error('未选择要删除的医嘱内容')
1118 1122
           return
@@ -1384,6 +1388,10 @@
1384 1388
       }
1385 1389
       ,
1386 1390
       openNewChildTwo(index, row) {
1391
+        if(this.currentRow.is_medicine == 1){
1392
+          this.$message.error('已发药,不可操作')
1393
+          return
1394
+        }
1387 1395
         this.currentRow = row
1388 1396
         if (this.currentRow == null) {
1389 1397
           this.$message.error('请先选择要新增子药的医嘱!')
@@ -1470,6 +1478,11 @@
1470 1478
       ,
1471 1479
 
1472 1480
       openEdit(index, row) {
1481
+        console.log("lilili",this.currentRow)
1482
+        if(this.currentRow.is_medicine == 1){
1483
+          this.$message.error('已发药不可修改')
1484
+          return
1485
+        }
1473 1486
         if (row.stop_state == 1 || row.execution_state == 1) {
1474 1487
           this.$message.error('所选医嘱已停止或执行')
1475 1488
           return false
@@ -1499,14 +1512,19 @@
1499 1512
           advice_doctor: row.advice_doctor,
1500 1513
           remark: row.remark,
1501 1514
           parent_id: row.parent_id,
1502
-          drug_id:0,
1503
-          way:0,
1515
+          drug_id:row.drug_id,
1516
+          way:row.way,
1504 1517
           drug_name_id:0,
1505 1518
         }
1506 1519
       }
1507 1520
       ,
1508 1521
 
1509 1522
       openEditGroupAdvice() {
1523
+        console.log("thissssss",this.currentRow)
1524
+        if(this.currentRow.is_medicine == 1){
1525
+          this.$message.error('已发药不可修改')
1526
+          return
1527
+        }
1510 1528
         if (this.groupSelectRow === null) {
1511 1529
           this.$message.error('未选择要修改的医嘱内容')
1512 1530
           return
@@ -1783,6 +1801,10 @@
1783 1801
       }
1784 1802
       ,
1785 1803
       openDelete(index, row) {
1804
+        if(this.currentRow.is_medicine == 1){
1805
+          this.$message.error('已发药不可删除')
1806
+          return
1807
+        }
1786 1808
         this.currentRow = row
1787 1809
         this.$confirm('确认删除此条医嘱?', '医嘱删除', {
1788 1810
           confirmButtonText: '确定',
@@ -2131,6 +2153,7 @@
2131 2153
       ,
2132 2154
       getAdviceContent(row, isChild) {
2133 2155
         // alert("来")
2156
+        console.log("this.doctor_advices",this.doctor_advices)
2134 2157
         console.log("row",row)
2135 2158
         console.log("isChild",isChild)
2136 2159
         let tempSingleDoseDesc = ''

+ 34 - 34
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue View File

@@ -42,7 +42,7 @@
42 42
     </div>
43 43
 
44 44
     <div class="app-container" v-loading="loading">
45
-    
45
+
46 46
       <drugs-stock-dialog
47 47
         ref="dialog"
48 48
         :propForm="propForm"
@@ -79,7 +79,7 @@
79 79
         </el-date-picker>
80 80
       </div>
81 81
 
82
-      
82
+
83 83
    <!-- 编辑入库单详情 -->
84 84
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
85 85
         <el-table
@@ -111,7 +111,7 @@
111 111
                     @input="changeDrugName(scope.$index)"
112 112
                     style="width:160px;"
113 113
                     :disabled="disabled"
114
-                   
114
+
115 115
                   >
116 116
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
117 117
                   <template slot-scope="{ item }">
@@ -121,7 +121,7 @@
121 121
               </el-form-item>
122 122
             </template>
123 123
           </el-table-column>
124
-       
124
+
125 125
          <el-table-column align="center" width="140">
126 126
             <template slot="header" slot-scope="scope">
127 127
               <span>药品类型</span>
@@ -133,7 +133,7 @@
133 133
                   :key="index"
134 134
                   :label="option.name"
135 135
                   :value="option.id"
136
-                  
136
+
137 137
                   >
138 138
                 </el-option>
139 139
                </el-select>
@@ -167,8 +167,8 @@
167 167
                 </el-form-item>
168 168
               </template>
169 169
          </el-table-column>
170
-       
171
-                   
170
+
171
+
172 172
          <el-table-column align="center" width="200">
173 173
             <template slot="header" slot-scope="scope">
174 174
               <span>入库数量<span style="color: red">*</span></span>
@@ -225,7 +225,7 @@
225 225
                   v-model="scope.row.retail_price"
226 226
                   :disabled="disabled"
227 227
                 ></el-input>
228
-               
228
+
229 229
               </el-form-item>
230 230
             </template>
231 231
           </el-table-column>
@@ -246,17 +246,17 @@
246 246
                     v-model="scope.row.last_price"
247 247
                     :disabled="disabled"
248 248
                   ></el-input>
249
-                
249
+
250 250
                 </el-form-item>
251 251
               </template>
252 252
           </el-table-column>
253 253
 
254 254
           <el-table-column label="总价(元)" align="center" width="80">
255 255
             <template slot-scope="scope">
256
-              {{ calculate(scope.row.last_price * scope.row.warehousing_count) }} 
256
+              {{ calculate(scope.row.last_price * scope.row.warehousing_count) }}
257 257
             </template>
258 258
           </el-table-column>
259
-    
259
+
260 260
 
261 261
          <el-table-column  width="180" align="center">
262 262
              <template slot="header" slot-scope="scope">
@@ -295,7 +295,7 @@
295 295
             </template>
296 296
           </el-table-column>
297 297
 
298
-             
298
+
299 299
           <el-table-column label="生产厂家" width="140" align="center">
300 300
             <template slot-scope="scope">
301 301
                <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商"  :disabled="disabled">
@@ -309,7 +309,7 @@
309 309
                </el-select>
310 310
             </template>
311 311
           </el-table-column>
312
-       
312
+
313 313
 
314 314
           <el-table-column label="经销商" width="140" align="center">
315 315
             <template slot-scope="scope">
@@ -325,7 +325,7 @@
325 325
             </template>
326 326
           </el-table-column>
327 327
 
328
-          
328
+
329 329
         <el-table-column align="center" width="150" label="批准文号">
330 330
             <template slot-scope="scope">
331 331
               <el-form-item style="padding-top: 20px">
@@ -337,7 +337,7 @@
337 337
               </el-form-item>
338 338
             </template>
339 339
           </el-table-column>
340
- 
340
+
341 341
           <el-table-column label="备注" width="150" align="center">
342 342
             <template slot-scope="scope">
343 343
               <el-input v-model="scope.row.remark" :disabled="disabled"></el-input>
@@ -497,7 +497,7 @@ export default {
497 497
   methods: {
498 498
     comfirm: function(val) {
499 499
       this.$refs.dialog.hide();
500
-   
500
+
501 501
       if (val.selectedGoodInfo.length > 0) {
502 502
         for (let i = val.selectedGoodInfo.length - 1; i >= 0 ; i--) {
503 503
           if (i == 0) {
@@ -578,7 +578,7 @@ export default {
578 578
       return name;
579 579
     },
580 580
     specificationName: function(drug_id) {
581
- 
581
+
582 582
       let name = "";
583 583
       for (let i = 0; i < this.goodInfo.length; i++) {
584 584
         if (this.goodInfo[i].id == drug_id) {
@@ -668,7 +668,7 @@ export default {
668 668
         return "";
669 669
       }
670 670
     },
671
-    
671
+
672 672
     back() {
673 673
       this.$router.go(-1);
674 674
     },
@@ -691,7 +691,7 @@ export default {
691 691
              if(this.recordInfo.recordData[i].dealer == ""){
692 692
                 this.recordInfo.recordData[i].dealer = 0
693 693
              }
694
-             
694
+
695 695
              if(this.recordInfo.recordData[i].manufacturer == ""){
696 696
                this.recordInfo.recordData[i].manufacturer = 0
697 697
              }
@@ -700,7 +700,7 @@ export default {
700 700
              this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].last_price.toString()
701 701
 
702 702
              this.recordInfo.recordData[i].retail_price = this.recordInfo.recordData[i].retail_price.toString()
703
-          
703
+
704 704
             for(let j=0;j<this.manufacturerList.length;j++){
705 705
               if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
706 706
                  this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
@@ -712,7 +712,7 @@ export default {
712 712
                   this.recordInfo.recordData[i].dealer = this.dealerList[z].id
713 713
               }
714 714
             }
715
-            
715
+
716 716
           }
717 717
           const params = {
718 718
             stockIn: this.recordInfo.recordData
@@ -782,13 +782,13 @@ export default {
782 782
           this.$message.error(response.data.msg);
783 783
           return false;
784 784
         } else {
785
-       
785
+
786 786
           var manufacturerList = response.data.data.manufacturerList
787 787
           this.manufacturerList = manufacturerList
788 788
           var dealerList  = response.data.data.dealerList
789
-        
789
+
790 790
           this.dealerList = dealerList
791
-         
791
+
792 792
           for (let i = 0; i < response.data.data.info.length; i++) {
793 793
             response.data.data.info[i].product_date = this.getTime(
794 794
               response.data.data.info[i].product_date,
@@ -803,7 +803,7 @@ export default {
803 803
             response.data.data.info[i].retail_price = response.data.data.info[i].retail_price.toString();
804 804
 
805 805
             response.data.data.info[i].warehousing_count = response.data.data.info[i].warehousing_count.toString();
806
-             
806
+
807 807
             response.data.data.info[i].name = response.data.data.info[i].drug.dose + response.data.data.info[i].drug.dose_unit+"*"+response.data.data.info[i].drug.min_number+ response.data.data.info[i].drug.min_unit+"/"+response.data.data.info[i].drug.max_unit
808 808
 
809 809
             response.data.data.info[i].lot_number = response.data.data.info[i].number
@@ -825,9 +825,9 @@ export default {
825 825
            if(response.data.data.info[i].dealer == 0){
826 826
                response.data.data.info[i].dealer = ""
827 827
             }
828
-          
828
+
829 829
             this.recordInfo.recordData.push(response.data.data.info[i]);
830
-           
830
+
831 831
             for(let j=0;j<manufacturerList.length;j++){
832 832
               if(response.data.data.info[i].manufacturer == manufacturerList[j].id){
833 833
                  response.data.data.info[i].manufacturer = manufacturerList[j].manufacturer_name
@@ -865,7 +865,7 @@ export default {
865 865
           if (response.data.state == 1) {
866 866
              searchArray = response.data.data.list;
867 867
              var list = response.data.data.list
868
-         
868
+
869 869
              this.drugList = list
870 870
              var manufacturerList = response.data.data.manufacturerList
871 871
              this.manufacturerList = manufacturerList
@@ -873,7 +873,7 @@ export default {
873 873
              var dealerList = response.data.data.dealerList
874 874
              this.dealerList = dealerList
875 875
              for(let i=0;i<this.drugList.length;i++){
876
-               
876
+
877 877
                 for(let j=0;j<this.manufacturerList.length;j++){
878 878
                   if(this.drugList[i].manufacturer == this.manufacturerList[j].id){
879 879
                      this.drugList[i].manufacturer = this.manufacturerList[j].manufacturer_name
@@ -885,7 +885,7 @@ export default {
885 885
                   if(this.drugList[i].dealer == this.dealerList[z].id){
886 886
                       this.drugList[i].dealer = this.dealerList[z].dealer_name
887 887
                   }
888
-               
888
+
889 889
                 }
890 890
              }
891 891
              cb(this.drugList)
@@ -915,7 +915,7 @@ export default {
915 915
              }else{
916 916
                this.recordInfo.recordData[i].retail_price = val.min_price
917 917
              }
918
-           
918
+
919 919
              this.recordInfo.recordData[i].manufacturer =  val.manufacturer
920 920
              this.recordInfo.recordData[i].number = val.number
921 921
              this.recordInfo.recordData[i].max_unit = val.max_unit
@@ -925,7 +925,7 @@ export default {
925 925
              }else{
926 926
                this.recordInfo.recordData[i].dealer =  val.dealer
927 927
              }
928
-            
928
+
929 929
            }
930 930
         }
931 931
       },
@@ -985,8 +985,8 @@ export default {
985 985
     },
986 986
   },
987 987
   created() {
988
-   
989
-    this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
988
+
989
+    this.drugTypeList = getDictionaryDataConfig('system','drug_type')
990 990
     this.propForm.goodUnit = this.$store.getters.good_unit;
991 991
     const order_id = this.$route.query.id;
992 992
     this.GetOrderDetail(order_id);

+ 6 - 6
src/xt_pages/stock/drugs/drugsStockDialog/index.vue View File

@@ -122,7 +122,7 @@
122 122
       }
123 123
     },
124 124
     created(){
125
-      console.log("药品类型",this.propForm)
125
+      console.log("药品类型.",this.propForm)
126 126
     },
127 127
     methods: {
128 128
       hide: function() {
@@ -151,7 +151,7 @@
151 151
 
152 152
       },
153 153
       comfirm: function(formName) {
154
-       
154
+
155 155
         this.goodInfoTableData = []
156 156
         this.$emit('dialog-comfirm', this.getValue())
157 157
         this.$refs.multipleTable.clearSelection()
@@ -215,17 +215,17 @@
215 215
       //   for (let i = 0; i < searchArr.length; i++) {
216 216
       //     this.goodInfoTableData.push(searchArr[i])
217 217
       //   }
218
-      // }, 
218
+      // },
219 219
       search:function() {
220 220
        if (this.keywords.length <= 0) {
221 221
           this.$message.error('搜索关键字不能为空')
222
-        } 
223
-        const searchArr = [] 
222
+        }
223
+        const searchArr = []
224 224
         for(let i=0;i<this.propForm.goods.length;i++){
225 225
            if(this.propForm.goods[i].drug_name.indexOf(this.keywords)!=-1){
226 226
               searchArr.push(this.propForm.goods[i])
227 227
            }
228
-        } 
228
+        }
229 229
         this.propForm.goods = []
230 230
         this.propForm.goods.push(...searchArr)
231 231
          console.log("2333333",this.propForm.goods)

+ 6 - 1
src/xt_pages/stock/drugs/query.vue View File

@@ -110,7 +110,7 @@
110 110
           >搜索
111 111
           </el-button> -->
112 112
       </div>
113
-
113
+<!--      <el-button @click="lili()">调试</el-button>-->
114 114
       <el-table
115 115
         :data="tableList"
116 116
         border
@@ -421,6 +421,9 @@ export default {
421 421
   },
422 422
 
423 423
   methods: {
424
+    lili(){
425
+      console.log("调试:this.tanlelist",this.tableList)
426
+    },
424 427
     //获取库存
425 428
     getlist() {
426 429
       const params = {
@@ -1259,6 +1262,7 @@ export default {
1259 1262
       var min_str = "";
1260 1263
       var total = 0;
1261 1264
       var newarr = arr;
1265
+      console.log("这是什sfsdfsf么!!!!!",storehouse_id)
1262 1266
       if (newarr.length > 0) {
1263 1267
         for (let i = 0; i < newarr.length; i++) {
1264 1268
           if (newarr[i].storehouse_id == storehouse_id) {
@@ -1281,6 +1285,7 @@ export default {
1281 1285
           min_str = (total % min_number) + min_unit;
1282 1286
         }
1283 1287
       }
1288
+      console.log("这是什么!!!!!",max_str + min_str)
1284 1289
       return max_str + min_str;
1285 1290
     },
1286 1291
     getOutFlushNight(

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

@@ -1410,7 +1410,7 @@ export default {
1410 1410
       this.nameFormTitle = "添加子药内容";
1411 1411
     },
1412 1412
     openGroupAdvice(isEdit) {
1413
-     
1413
+
1414 1414
       this.isChild = false;
1415 1415
       if (isEdit) {
1416 1416
         if (this.groupSelectRow === null) {

+ 7 - 2
src/xt_pages/user/doctorAdvice.vue View File

@@ -42,6 +42,7 @@
42 42
           icon="el-icon-printer"
43 43
           >打印
44 44
         </el-button>
45
+<!--        <el-button @click=lili()>调试</el-button>-->
45 46
       </div>
46 47
       <div class="cell clearfix">
47 48
         <el-input
@@ -2417,6 +2418,7 @@ export default {
2417 2418
       });
2418 2419
     },
2419 2420
     submitNewAdvice(formName, action) {
2421
+      console.log("kkkthis.adviceForm",this.adviceForm)
2420 2422
       this.$refs[formName].validate(valid => {
2421 2423
         if (valid) {
2422 2424
           let mode = "";
@@ -2437,7 +2439,7 @@ export default {
2437 2439
               var arr = this.adviceForm.advice_name.split("(自备药)")
2438 2440
               this.adviceForm.advice_name = arr[0]
2439 2441
           }
2440
-          console.log("222222",this.adviceForm)
2442
+          console.log("222222???????this.adviceForm",this.adviceForm)
2441 2443
 
2442 2444
           CreateNewDoctorAdvice(this.patientID, this.adviceForm, mode).then(
2443 2445
             response => {
@@ -3129,7 +3131,8 @@ export default {
3129 3131
         execution_frequency: row.execution_frequency,
3130 3132
         advice_doctor: row.advice_doctor,
3131 3133
         remark: "",
3132
-        parent_id: row.parent_id > 0 ? row.parent_id : row.id
3134
+        parent_id: row.parent_id > 0 ? row.parent_id : row.id,
3135
+        drug_id:""
3133 3136
       };
3134 3137
       this.dialogFormVisible = true;
3135 3138
     },
@@ -4650,6 +4653,8 @@ export default {
4650 4653
         this.nameForm.delivery_way = tmp.delivery_way//给药途径
4651 4654
         this.nameForm.execution_frequency = tmp.execution_frequency//执行频率
4652 4655
         this.nameForm.drug_id = tmp.id
4656
+        console.log("isiisisthis.adviceForm",this.adviceForm)
4657
+        this.adviceForm.drug_id = tmp.id
4653 4658
       }
4654 4659
   },
4655 4660
   watch: {