Browse Source

Merge branch '20200710_pc_vue_new_branch' into 20200916_pc_vue_new_branch

csx 4 years ago
parent
commit
eaf503c328

+ 133 - 0
src/xt_pages/data/components/additionDialog.vue View File

@@ -0,0 +1,133 @@
1
+<template>
2
+  <el-dialog width="854px" :title="titles" :visible.sync="visibility" :close-on-click-modal="isClose"
3
+             :close-on-press-escape="isClose">
4
+
5
+    <el-form :model="formValue" :rules="rules" ref="formValue" class="demo-form-inline"
6
+             :label-position="labelPosition"
7
+             label-width="100px">
8
+
9
+      <el-row>
10
+        <el-col :span="8">
11
+          <el-form-item label="费用名称" prop="name">
12
+            <el-input v-model="formValue.name"></el-input>
13
+          </el-form-item>
14
+        </el-col>
15
+
16
+
17
+        <el-col :span="8">
18
+          <el-form-item label="国家编码" prop="code">
19
+            <el-input v-model="formValue.code"></el-input>
20
+          </el-form-item>
21
+        </el-col>
22
+
23
+
24
+        <el-col :span="8">
25
+          <el-form-item label="费用" >
26
+            <el-input type="number" v-model="formValue.price"></el-input>
27
+          </el-form-item>
28
+        </el-col>
29
+
30
+      </el-row>
31
+
32
+    </el-form>
33
+
34
+    <span slot="footer" class="dialog-footer">
35
+    <el-button v-if="isCreated == 3" @click="cancle('formValue')">取 消</el-button>
36
+    <el-button v-if="isCreated != 3 " @click="cancle('formValue')">取 消</el-button>
37
+    <el-button v-if="isCreated != 3" type="primary" @click="comfirm('formValue')">保 存</el-button>
38
+  </span>
39
+  </el-dialog>
40
+
41
+</template>
42
+
43
+<script>
44
+  export default {
45
+    name: 'diagnosisDialog',
46
+
47
+    data() {
48
+
49
+      return {
50
+        visibility: false,
51
+        labelPosition: 'right',
52
+        isClose: false,
53
+        form: {
54
+          name: '',
55
+          code: '',
56
+          price: '',
57
+
58
+        },
59
+        resetForm: {
60
+          name: '',
61
+          code: '',
62
+          price: '',
63
+          wubi: ''
64
+        },
65
+        rules: {
66
+          name: [
67
+            { required: true, message: '请输入费用名称', trigger: 'blur' }
68
+          ],
69
+          code: [
70
+            { required: true, message: '请输入国家编码', trigger: 'blur' }
71
+          ]
72
+
73
+        }
74
+      }
75
+    },
76
+    props: {
77
+
78
+      titles: {
79
+        type: String,
80
+        default: ''
81
+      },
82
+      formValue: {
83
+        type: Object
84
+      },
85
+      type: {
86
+        type: Number,
87
+        default: 1
88
+
89
+      },
90
+      isCreated: {
91
+        type: Number,
92
+        default: 1
93
+
94
+      }
95
+    },
96
+    methods: {
97
+      show: function() {
98
+        this.visibility = true
99
+
100
+      }, hide: function() {
101
+        this.visibility = false
102
+      },
103
+      cancle: function(formName) {
104
+        this.$emit('dialog-cancle', this.getValue())
105
+        this.$refs['formValue'].resetFields()
106
+      },
107
+      comfirm: function(formName) {
108
+        this.$refs['formValue'].validate((valid) => {
109
+          if (valid) {
110
+            let value = {}
111
+            value = this.getValue()
112
+            this.$emit('dialog-comfirm', value)
113
+            this.form = Object.assign({}, this.resetForm)
114
+
115
+          }
116
+        })
117
+      },
118
+      getValue: function() {
119
+        let form = {}
120
+        form = this.formValue
121
+        form['title'] = this.titles
122
+        form['type'] = this.type
123
+        form['isCreated'] = this.isCreated
124
+        return form
125
+      }
126
+    }
127
+
128
+  }
129
+</script>
130
+
131
+<style scoped>
132
+
133
+</style>

+ 345 - 0
src/xt_pages/data/components/addtion.vue View File

@@ -0,0 +1,345 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class=" sign-and-weigh-box" style="background: white">
4
+      <!--<manufacturer-or-dealer-dialog-->
5
+      <!--ref="dialog"-->
6
+      <!--:titles="manufacturerDialog.titles"-->
7
+      <!--:formValue="manufacturerDialog.formValue"-->
8
+      <!--:visibility="manufacturerDialog.isVisibility"-->
9
+      <!--:type="manufacturerDialog.type"-->
10
+      <!--:isCreated="manufacturerDialog.isCreated"-->
11
+      <!--v-on:dialog-comfirm="manufacturerDialogComfirm"-->
12
+      <!--v-on:dialog-cancle="manufacturerDialogCancle"-->
13
+      <!--&gt;</manufacturer-or-dealer-dialog>-->
14
+      <addition-dialog
15
+        ref="dialog"
16
+        :titles="Dialog.titles"
17
+        :formValue="Dialog.formValue"
18
+        :visibility="Dialog.isVisibility"
19
+        :type="Dialog.type"
20
+        :isCreated="Dialog.isCreated"
21
+        v-on:dialog-comfirm="dialogComfirm"
22
+        v-on:dialog-cancle="dialogCancle"
23
+
24
+      ></addition-dialog>
25
+
26
+
27
+      <el-row :gutter="15">
28
+        <el-col>
29
+          <div>
30
+            <el-button
31
+              size="small"
32
+              icon="el-icon-circle-plus-outline"
33
+              style="float: right;margin-bottom: 15px"
34
+              type="primary"
35
+              @click="showDialog"
36
+            >新增
37
+            </el-button>
38
+          </div>
39
+
40
+          <el-table
41
+            :row-style="{ color: '#303133' }"
42
+            :header-cell-style="{
43
+              backgroundColor: 'rgb(245, 247, 250)',
44
+              color: '#606266'
45
+            }"
46
+            :data="manufacturerData"
47
+            style="width: 100%"
48
+            border
49
+            v-loading="loading"
50
+          >
51
+            <el-table-column label="国家编码" align="center">
52
+              <template slot-scope="scope">
53
+                {{ scope.row.code }}
54
+              </template>
55
+            </el-table-column>
56
+
57
+
58
+
59
+            <el-table-column label="费用名称" align="center">
60
+              <template slot-scope="scope">
61
+                {{ scope.row.name }}
62
+              </template>
63
+            </el-table-column>
64
+
65
+
66
+            <el-table-column label="金额" align="center">
67
+              <template slot-scope="scope">
68
+                {{ scope.row.price }}元
69
+              </template>
70
+            </el-table-column>
71
+
72
+
73
+
74
+            <el-table-column label="操作" align="center">
75
+              <template slot-scope="scope">
76
+                <el-tooltip
77
+                  class="item"
78
+                  effect="dark"
79
+                  content="编辑"
80
+                  placement="top"
81
+                >
82
+                  <el-button
83
+                    size="small"
84
+                    type="primary"
85
+                    icon="el-icon-edit-outline"
86
+                    @click="handleEdit(scope.$index, scope.row)"
87
+                  >
88
+                  </el-button>
89
+                </el-tooltip>
90
+                <el-tooltip
91
+                  class="item"
92
+                  effect="dark"
93
+                  content="删除"
94
+                  placement="top"
95
+                >
96
+                  <el-button
97
+                    size="small"
98
+                    type="danger"
99
+                    icon="el-icon-delete"
100
+                    @click="handleDelete(scope.$index, scope.row)"
101
+                  >
102
+                  </el-button>
103
+                </el-tooltip>
104
+
105
+              </template>
106
+            </el-table-column>
107
+          </el-table>
108
+
109
+          <el-pagination
110
+            @size-change="handleSizeChange"
111
+            @current-change="handleCurrentChange"
112
+            :page-sizes="[10, 50, 100]"
113
+            :page-size="10"
114
+            background
115
+            align="right"
116
+            style="margin-top:20px;"
117
+            layout="total, sizes, prev, pager, next, jumper"
118
+            :total="total"
119
+          >
120
+          </el-pagination>
121
+        </el-col>
122
+      </el-row>
123
+    </div>
124
+  </div>
125
+</template>
126
+
127
+<script>
128
+  import {
129
+    createAddition,
130
+    modifyAddition,
131
+    getAdditionList,
132
+    deleteAddition,
133
+    GetAddition
134
+  } from '@/api/data'
135
+  import AdditionDialog from './additionDialog'
136
+
137
+  export default {
138
+    components: {
139
+      AdditionDialog,
140
+    },
141
+    name: 'addtion',
142
+    data() {
143
+      return {
144
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
145
+        manufacturerData: [],
146
+        total: 0,
147
+        pageTotal: 0,
148
+        pageSelect: 0,
149
+
150
+        page: 1,
151
+        limit: 10,
152
+        loading: false,
153
+
154
+        manufacturer_code: '',
155
+        editId: '',
156
+        editIndex: '',
157
+        Dialog: {
158
+          titles: '新增',
159
+          isVisibility: false,
160
+          isCreated: 1, //1.创建 2.编辑 3.查看详情
161
+          formValue: {
162
+            name: '',
163
+            code: '',
164
+            price: '',
165
+
166
+          },
167
+          resetForm: {
168
+            name: '',
169
+            code: '',
170
+            price: '',
171
+          }
172
+        }
173
+      }
174
+    },
175
+    methods: {
176
+      handleEdit: function(index, row) {
177
+        this.editId = row.id
178
+        this.editIndex = index
179
+        let params = {
180
+          id: row.id
181
+        }
182
+        GetAddition(params).then(response => {
183
+          if (response.data.state == 0) {
184
+            this.$message.error(response.data.msg)
185
+            return false
186
+          } else {
187
+            this.Dialog.formValue.class_name =
188
+              response.data.data.addition.name
189
+            this.Dialog.formValue.content_code =
190
+              response.data.data.addition.code
191
+            this.Dialog.formValue.price =
192
+              response.data.data.addition.price
193
+
194
+            this.Dialog.isCreated = 2
195
+            this.$refs.dialog.show()
196
+
197
+          }
198
+        })
199
+      },
200
+      handleDelete: function(index, row) {
201
+        this.$confirm('确认删除这条记录?', '删除记录', {
202
+          confirmButtonText: '确定',
203
+          cancelButtonText: '取消',
204
+          type: 'warning'
205
+        })
206
+          .then(() => {
207
+            let params = {
208
+              id: row.id
209
+            }
210
+            deleteAddition(params).then(response => {
211
+              if (response.data.state == 0) {
212
+                this.$message.error(response.data.msg)
213
+                return false
214
+              } else {
215
+                this.manufacturerData.splice(index, 1)
216
+                this.$message.success('厂家已经删除')
217
+              }
218
+            })
219
+          })
220
+          .catch(() => {
221
+          })
222
+      },
223
+      showDetails: function(index, row) {
224
+        let params = {
225
+          id: row.id
226
+        }
227
+        GetAddition(params).then(response => {
228
+          if (response.data.state == 0) {
229
+            this.$message.error(response.data.msg)
230
+            return false
231
+          } else {
232
+            this.Dialog.formValue.name =
233
+              response.data.data.addition.name
234
+            this.Dialog.formValue.code =
235
+              response.data.data.addition.code
236
+            this.Dialog.formValue.price =
237
+              response.data.data.addition.price
238
+
239
+
240
+            this.Dialog.isCreated = 3
241
+            this.Dialog.isVisibility = true
242
+          }
243
+        })
244
+      },
245
+      dialogComfirm: function(val) {
246
+        // this.manufacturerDialog.isVisibility = false
247
+        this.$refs.dialog.hide()
248
+        if (val.isCreated == 2) {
249
+          //修改
250
+          let params = {
251
+            name: val.name,
252
+            code: val.code,
253
+            price: val.price,
254
+            id: this.editId,
255
+
256
+          }
257
+          modifyAddition(params).then(response => {
258
+            if (response.data.state == 0) {
259
+              this.$message.error(response.data.msg)
260
+              return false
261
+            } else {
262
+              this.manufacturerData[this.editIndex].name =
263
+                response.data.data.addition.name
264
+              this.manufacturerData[this.editIndex].code =
265
+                response.data.data.addition.code
266
+              this.manufacturerData[this.editIndex].price =
267
+                response.data.data.addition.price
268
+              this.$message.success('修改成功')
269
+            }
270
+          })
271
+        } else if (val.isCreated == 1) {
272
+          //新增
273
+          createAddition(val).then(response => {
274
+            if (response.data.state == 0) {
275
+              this.$message.error(response.data.msg)
276
+              return false
277
+            } else {
278
+              this.manufacturerData.unshift(response.data.data.addition)
279
+
280
+              this.$message.success('新增成功')
281
+            }
282
+          })
283
+        }
284
+      },
285
+      dialogCancle: function() {
286
+        this.$refs.dialog.hide()
287
+      },
288
+      showDialog: function() {
289
+        this.Dialog.formValue = Object.assign(
290
+          {},
291
+          this.Dialog.resetForm
292
+        )
293
+        this.$refs.dialog.show()
294
+        this.Dialog.isCreated = 1
295
+      },
296
+      handleSizeChange(val) {
297
+        this.limit = val
298
+        this.getList()
299
+      },
300
+      handleCurrentChange(val) {
301
+        this.page = val
302
+        this.getList()
303
+      },
304
+      getList() {
305
+        let params = {
306
+          page: this.page,
307
+          limit: this.limit
308
+        }
309
+        this.loading = true
310
+        getAdditionList(params).then(response => {
311
+          if (response.data.state == 0) {
312
+            this.loading = false
313
+            this.$message.error(response.data.msg)
314
+            return false
315
+          } else {
316
+            this.loading = false
317
+            this.total = response.data.data.total
318
+            this.manufacturerData = []
319
+            for (let i = 0; i < response.data.data.addition.length; i++) {
320
+              this.manufacturerData.push(response.data.data.addition[i])
321
+            }
322
+          }
323
+        })
324
+      }
325
+    },
326
+    created() {
327
+      this.getList()
328
+    }
329
+  }
330
+</script>
331
+
332
+<style lang="scss">
333
+  .el-table td,
334
+  .el-table th.is-leaf,
335
+  .el-table--border,
336
+  .el-table--group {
337
+    border-color: #d0d3da;
338
+  }
339
+
340
+  .el-table--border::after,
341
+  .el-table--group::after,
342
+  .el-table::before {
343
+    background-color: #d0d3da;
344
+  }
345
+</style>

+ 12 - 9
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue View File

@@ -429,8 +429,10 @@
429 429
             }
430 430
           }
431 431
         }
432
-        for (let i = 0; i < this.addtions_charge.length; i++){
433
-          total = total +  this.addtions_charge[i].price
432
+        if(this.addtions_charge != null) {
433
+          for (let i = 0; i < this.addtions_charge.length; i++) {
434
+            total = total + this.addtions_charge[i].price
435
+          }
434 436
         }
435 437
         return Math.floor(total * 100) / 100
436 438
       },
@@ -503,23 +505,24 @@
503 505
             }
504 506
 
505 507
             if (info.user_type == 2 || info.user_type == 1) {
508
+
509
+
510
+              this.doctorValue = info.admin_user_id
511
+
512
+
506 513
               if (info.department_id == 0) {
507
-                console.log('33333')
508 514
 
509 515
                 if (this.department.length > 0) {
510
-                  console.log('6666666666')
511
-
512 516
                   this.departmentValue = this.department[0].id
513 517
                 } else {
514
-                  console.log('7777777777')
515
-
516 518
                   this.departmentValue = ''
517 519
                 }
518 520
               } else {
519
-                console.log('5555555')
520
-
521 521
                 this.departmentValue = info.department_id
522 522
               }
523
+            }else{
524
+              this.doctorValue = this.doctors[0].admin_user_id
525
+
523 526
             }
524 527
 
525 528
           }