Kaynağa Gözat

7月31日杨青

杨青 1 yıl önce
ebeveyn
işleme
c139641b89

+ 5 - 5
src/xt_pages/outpatientCharges/invoicePrint.vue Dosyayı Görüntüle

@@ -10,7 +10,7 @@
10 10
         type="primary"
11 11
       >打印</el-button>
12 12
     </template>
13
-    <div class="app-container" style="padding-top:40px;" v-if="org_id != 10217 && org_id != 0 && org_id != 10485">
13
+    <div class="app-container" style="padding-top:40px;" v-if="org_id != 10217 && org_id != 0 && org_id != 10485 && org_id != 10375"><!---->
14 14
         <div class='dialysisPage'>
15 15
           <div v-if="org_id != 10106 && org_id != 10215 && org_id != 4 && org_id != 10188 && org_id != 10217 && org_id != 0 && org_id != 10387&& org_id != 10210 && org_id != 10387" >
16 16
             <printOne v-if="org_id != 10088 " :paramsObj="invoiceParams"></printOne>
@@ -19,7 +19,7 @@
19 19
           <printTwo v-if="org_id == 10106" :paramsObj="invoiceParams"></printTwo>
20 20
           <printFour v-if="org_id == 10215 || org_id == 4 " :paramsObj="invoiceParams"></printFour>
21 21
           <printFive v-if="org_id == 10188 " :paramsObj="invoiceParams"></printFive>
22
-          <printSix v-if="org_id == 10217  || org_id == 0" :paramsObj="invoiceParams"></printSix>
22
+          <!-- <printSix v-if="org_id == 10217  " :paramsObj="invoiceParams"></printSix> -->
23 23
 <!--          <printEight v-if="org_id == 10387 || org_id == 0" :paramsObj="invoiceParams"></printEight>-->
24 24
           <print-eight v-if="org_id == 10387" :paramsObj="invoiceParams"></print-eight>
25 25
           <PrintNight v-if="org_id == 10210" :paramsObj="invoiceParams"></PrintNight>
@@ -33,12 +33,12 @@
33 33
       </div>
34 34
     </div>
35 35
 
36
-    <div class="app-container" style="" v-if="org_id == 10217">
36
+    <div class="app-container" style="" v-if="org_id == 10217 || org_id == 0">
37 37
       <div class='dialysisPage'>
38
-        <printSix v-if="org_id == 10217  " :paramsObj="invoiceParams"></printSix>
38
+        <printSix :paramsObj="invoiceParams"></printSix>
39 39
       </div>
40 40
     </div>
41
-    <div class="app-container" style="padding-top:40px;" v-if="org_id == 10375 ||org_id == 0">
41
+    <div class="app-container" style="padding-top:40px;" v-if="org_id == 10375 ">
42 42
       <div class='dialysisPage'>
43 43
         <print-ten :paramsObj="invoiceParams"></print-ten>
44 44
       </div>

+ 204 - 445
src/xt_pages/outpatientCharges/invoiceTemplate/printSix.vue Dosyayı Görüntüle

@@ -1,100 +1,102 @@
1 1
 <template>
2
-  <div id='invoice-print'>
3
-    <div v-for='(i,index) in pageArr.length' :key="index" >
4
-      <div :style="{position: 'absolute',top:(30 + (index * 415))  + 'px',left:200+ 'px',}">盐城大丰悦达金骆驼血液透析中心</div>
5
-      <div :style="{position: 'absolute',top:(70 + (index * 415))  + 'px',left:150+ 'px',}">{{ list.order_number }}</div>
6
-      <div style="display:flex;justify-content: space-between;">
7
-        <div :style="{position: 'absolute',top:(100 + (index * 415))  + 'px',left:100+ 'px',}">{{ paramsObj.name }}</div>
8
-      </div>
9
-      <div :style="{position: 'absolute',top:(190 + (index * 415))  + 'px',left:120+ 'px',}">
10
-        <div v-if="list.westernMedicineCostTotal">西药 {{ list.westernMedicineCostTotal }}</div>
11
-        <div v-if="list.treatCostTotal">治疗费 {{ list.treatCostTotal }}</div>
12
-        <div v-if="list.bedCostTotal">床位费 {{ list.bedCostTotal }}</div>
13
-        <div v-if="list.chineseTraditionalMedicineCostTotal">中成药 {{ list.chineseTraditionalMedicineCostTotal }}</div>
14
-        <div v-if="list.laboratoryCostTotal">化验费 {{ list.laboratoryCostTotal }}</div>
15
-        <div v-if="list.operationCostTotal">手术费 {{ list.operationCostTotal }}</div>
16
-        <div v-if="list.otherCostTotal">其他费 {{ list.otherCostTotal }}</div>
17
-        <div v-if="list.materialCostTotal">材料费 {{ list.materialCostTotal }}</div>
18
-      </div>
19
-      <div :style="{position: 'absolute',top:(190 + (index * 420))  + 'px',left:300+ 'px'}">
20
-        <div v-for="item in list.order_info.slice(index * 10,(index * 10) + pageArr[index])">
21
-                    <span style="display:inline-block;width:300px;">
2
+    <div id='invoice-print' >
3
+        <div v-for='(i,index) in pageArr.length' :key="index" style="position: relative;">
4
+            <div :style="{position: 'absolute',top:(38 + (index * 380))  + 'px',left:152+ 'px',}">盐城大丰悦达金骆驼血液透析中心</div>
5
+            <div :style="{position: 'absolute',top:(76 + (index * 380))  + 'px',left:117+ 'px',}">{{ list.order_number }}</div>
6
+            <div >
7
+                <div :style="{position: 'absolute',top:(95 + (index * 380))  + 'px',left:92+ 'px',}">{{ paramsObj.name }}</div>
8
+            </div>
9
+            <div :style="{position: 'absolute',top:(140 + (index * 380))  + 'px',left:76+ 'px',}">
10
+                <div v-if="list.westernMedicineCostTotal">西药 {{ list.westernMedicineCostTotal }}</div>
11
+                <div v-if="list.treatCostTotal">治疗费 {{ list.treatCostTotal }}</div>
12
+                <div v-if="list.bedCostTotal">床位费 {{ list.bedCostTotal }}</div>
13
+                <div v-if="list.chineseTraditionalMedicineCostTotal">中成药 {{ list.chineseTraditionalMedicineCostTotal }}</div>
14
+                <div v-if="list.laboratoryCostTotal">化验费 {{ list.laboratoryCostTotal }}</div>
15
+                <div v-if="list.operationCostTotal">手术费 {{ list.operationCostTotal }}</div>
16
+                <div v-if="list.otherCostTotal">其他费 {{ list.otherCostTotal }}</div>
17
+                <div v-if="list.materialCostTotal">材料费 {{ list.materialCostTotal }}</div>
18
+            </div>
19
+            <div :style="{position: 'absolute',top:(140 + (index * 380))  + 'px',left:247+ 'px'}">
20
+                <div v-for="item in list.order_info.slice(index * 10,(index * 10) + pageArr[index])">
21
+                    <span style="display:inline-block;width:200px;">
22 22
                         <span v-if="item.advice.id == 0">
23 23
                             <span v-if="item.project.type == 2"> {{ item.project.project.project_name }}</span>
24 24
                             <span v-if="item.project.type == 3">{{ item.project.good_info.good_name }}</span>
25 25
                         </span>
26 26
                         <span v-else>{{ item.advice.advice_name }}</span>
27 27
                     </span>
28
-          <span style="display:inline-block;width:50px;">
28
+                    <span style="display:inline-block;width:50px;">
29 29
                         <span v-if="item.advice.id == 0">
30 30
                             <span v-if="item.project.type == 2">{{ item.project.count }}{{ item.project.unit }}</span>
31 31
                             <span v-if="item.project.type == 3">{{ item.project.count }}{{ item.project.unit }}</span>
32 32
                         </span>
33 33
                         <span v-else>{{ item.advice.prescribing_number }}{{ item.advice.prescribing_number_unit }}</span>
34 34
                     </span>
35
-          <span>
35
+                    <span>
36 36
                         <span v-if="item.advice.id == 0">
37 37
                             <span v-if="item.project.type == 2">{{ (item.project.count * item.pric).toFixed(2) }}</span>
38 38
                             <span v-if="item.project.type == 3">{{ (item.project.count * item.pric).toFixed(2) }}</span>
39 39
                         </span>
40 40
                         <span v-else>{{ (item.advice.prescribing_number * item.pric).toFixed(2) }}</span>
41 41
                     </span>
42
+                </div>
43
+            </div>
44
+            <div :style="{position: 'absolute',top:(285 + (index * 380))  + 'px',left:121+ 'px'}">{{ zhongwen }}</div>
45
+            <div :style="{position: 'absolute',top:(285 + (index * 380))  + 'px',left:391+ 'px'}">{{ list.medfee_sumamt }}</div>
46
+            <div v-if="index == pageArr.length - 1" :style="{position: 'absolute',top:(304 + (index * 380))  + 'px',left:110+ 'px',width:100 + '%',fontSize:12+'px'}">
47
+                <div style="display:flex;">
48
+                  <div style="width:140px">医疗总费用:{{ list.order.medfee_sumamt }}</div>
49
+                  <div style="width:140px">基金支付总额:{{ list.order.fund_pay_sumamt }}</div>
50
+                  <div style="width:140px">统筹支出:{{ list.order.hifp_pay }}</div>
51
+                  <div style="width:140px">大病支出:{{list.order.hifmi_pay}}</div>
52
+
53
+                </div>
54
+                <div style="display:flex;">
55
+                  <div style="width:140px">个人账户支付:{{ list.order.acct_pay }}</div>
56
+                  <div style="width:140px">现金支出:{{ list.order.psn_cash_pay }}</div>
57
+                  <div style="width:140px">本次账户:0</div>
58
+                  <div style="width:140px">上次账户:0</div>
59
+                </div>
60
+              <div style="display:flex;">
61
+                <div style="width:140px">账户余额:{{ list.order.balc }}</div>
62
+                <div style="width:140px">其他支出:{{ list.order.oth_pay }}</div>
63
+                <div style="width:140px">大病补充保险支出:0</div>
64
+                <div style="width:140px">民政支出:0</div>
65
+              </div>
66
+              <div style="display:flex;">
67
+                <div style="width:220px">医疗救助基金支出:{{ list.order.maf_pay }}</div>
68
+                <div style="width:280px">企业补充医疗保险基金支出:{{ list.order.hifes_pay }}</div>
69
+              </div>
70
+
71
+            </div>
72
+            <div v-if="index != pageArr.length - 1">
73
+                <div :style="{position: 'absolute',top:(361 + (index * 380))  + 'px',left:140+ 'px'}">盐城大丰悦达金骆驼血液透析中心</div>
74
+                <div :style="{position: 'absolute',top:(361 + (index * 380))  + 'px',left:374+ 'px'}">{{ paramsObj.chargeName }}</div>
75
+                <div :style="{position: 'absolute',top:(361 + (index * 380))  + 'px',left:435+ 'px'}">
76
+                    <span>{{  paramsObj.setl_time ? paramsObj.setl_time.split(' ')[0].slice(0,4) : getTime(list.date, '{y}-{m}-{d}').slice(0,4) }}</span>
77
+                </div>
78
+                <div :style="{position: 'absolute',top:(361 + (index * 380))  + 'px',left:479+ 'px'}">
79
+                    <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(5,7)) : getTime(list.date, '{y}-{m}-{d}').slice(5,7) }}</span>
80
+                </div>
81
+                <div :style="{position: 'absolute',top:(361 + (index * 380))  + 'px',left:500+ 'px'}">
82
+                    <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(8,11)) : getTime(list.date, '{y}-{m}-{d}').slice(8,11) }}</span>
83
+                </div>
84
+            </div>
85
+            <div v-if="index == pageArr.length - 1">
86
+              <div :style="{position: 'absolute',top:(361 + (index * 380))  + 'px',left:140+ 'px'}">盐城大丰悦达金骆驼血液透析中心</div>
87
+              <div :style="{position: 'absolute',top:(361 + (index * 380))  + 'px',left:374+ 'px'}">{{ paramsObj.chargeName }}</div>
88
+              <div :style="{position: 'absolute',top:(361 + (index * 380))  + 'px',left:435+ 'px'}">
89
+                <span>{{  paramsObj.setl_time ? paramsObj.setl_time.split(' ')[0].slice(0,4) : getTime(list.date, '{y}-{m}-{d}').slice(0,4) }}</span>
90
+              </div>
91
+              <div :style="{position: 'absolute',top:(361 + (index * 380))  + 'px',left:479+ 'px'}">
92
+                <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(5,7)) : getTime(list.date, '{y}-{m}-{d}').slice(5,7) }}</span>
93
+              </div>
94
+              <div :style="{position: 'absolute',top:(361 + (index * 380))  + 'px',left:500+ 'px'}">
95
+                <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(8,11)) : getTime(list.date, '{y}-{m}-{d}').slice(8,11) }}</span>
96
+              </div>
97
+            </div>
42 98
         </div>
43
-      </div>
44
-      <div :style="{position: 'absolute',top:(350 + (index * 415))  + 'px',left:130+ 'px'}">{{ zhongwen }}</div>
45
-      <div :style="{position: 'absolute',top:(350 + (index * 415))  + 'px',left:480+ 'px'}">{{ list.medfee_sumamt }}</div>
46
-      <div v-if="index == pageArr.length - 1" :style="{position: 'absolute',top:(370 + (index * 415))  + 'px',left:110+ 'px',width:100 + '%',fontSize:12+'px'}">
47
-        <div style="display:flex;">
48
-          <div style="width:140px">医疗总费用:{{ list.order.medfee_sumamt }}</div>
49
-          <div style="width:140px">基金支付总额:{{ list.order.fund_pay_sumamt }}</div>
50
-          <div style="width:140px">统筹支出:{{ list.order.hifp_pay }}</div>
51
-          <div style="width:140px">大病支出:{{list.order.hifmi_pay}}</div>
52
-          <div style="width:140px">个人账户支付:{{ list.order.acct_pay }}</div>
53
-          <div style="width:140px">现金支出:{{ list.order.psn_cash_pay }}</div>
54
-          <div style="width:220px">医疗救助基金支出:{{ list.order.maf_pay }}</div>
55
-
56
-        </div>
57
-        <div style="display:flex;">
58
-          <div style="width:140px">本次账户:0</div>
59
-          <div style="width:140px">上次账户:0</div>
60
-          <div style="width:140px">账户余额:{{ list.order.balc }}</div>
61
-          <div style="width:140px">其他支出:{{ list.order.oth_pay }}</div>
62
-          <div style="width:140px">大病补充保险支出:0</div>
63
-          <div style="width:140px">民政支出:0</div>
64
-          <div style="width:280px">企业补充医疗保险基金支出:{{ list.order.hifes_pay }}</div>
65
-        </div>
66
-
67
-      </div>
68
-      <div v-if="index != pageArr.length - 1">
69
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:140+ 'px'}">盐城大丰悦达金骆驼血液透析中心</div>
70
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:410+ 'px'}">{{ paramsObj.chargeName }}</div>
71
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:550+ 'px'}">
72
-          <span>{{  paramsObj.setl_time ? paramsObj.setl_time.split(' ')[0].slice(0,4) : getTime(list.date, '{y}-{m}-{d}').slice(0,4) }}</span>
73
-        </div>
74
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:610+ 'px'}">
75
-          <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(5,7)) : getTime(list.date, '{y}-{m}-{d}').slice(5,7) }}</span>
76
-        </div>
77
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:650+ 'px'}">
78
-          <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(8,11)) : getTime(list.date, '{y}-{m}-{d}').slice(8,11) }}</span>
79
-        </div>
80
-      </div>
81
-
82
-      <div v-if="index == pageArr.length - 1">
83
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:140+ 'px'}">盐城大丰悦达金骆驼血液透析中心</div>
84
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:410+ 'px'}">{{ paramsObj.chargeName }}</div>
85
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:550+ 'px'}">
86
-          <span>{{  paramsObj.setl_time ? paramsObj.setl_time.split(' ')[0].slice(0,4) : getTime(list.date, '{y}-{m}-{d}').slice(0,4) }}</span>
87
-        </div>
88
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:610+ 'px'}">
89
-          <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(5,7)) : getTime(list.date, '{y}-{m}-{d}').slice(5,7) }}</span>
90
-        </div>
91
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:650+ 'px'}">
92
-          <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(8,11)) : getTime(list.date, '{y}-{m}-{d}').slice(8,11) }}</span>
93
-        </div>
94
-      </div>
95
-
96 99
     </div>
97
-  </div>
98 100
 </template>
99 101
 
100 102
 
@@ -102,385 +104,142 @@
102 104
 import { getInvoice } from '@/api/project/project'
103 105
 import { uParseTime } from '@/utils/tools'
104 106
 export default {
105
-  props:{
106
-    paramsObj:Object
107
-  },
108
-  data(){
109
-    return{
110
-      list:{},
111
-      printDate:'',
112
-      zhongwen:'',
113
-      totalPrice:0.0,
114
-      org_id:'',
115
-      org_name:'',
116
-      page:1,
117
-      pageArr:[],
118
-    }
119
-  },
120
-  created(){
121
-    console.log('paramsObj',this.paramsObj)
122
-    let params = {
123
-      order_id: this.paramsObj.order_id,
124
-      patient_id: this.paramsObj.patient_id,
125
-    }
126
-    this.getInvoice(params)
127
-    // var data = new Date();
128
-    // var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
129
-    // var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
130
-    // this.printDate = data.getFullYear() + "-" + month + "-" + date;
131
-    // this.smalltoBIG(982732.21)
132
-    this.org_id = this.$store.getters.xt_user.org_id
133
-    this.org_name = this.$store.getters.xt_user.org.org_name
134
-  },
135
-  methods:{
136
-    getInvoice(params){
137
-      getInvoice(params).then((res) => {
138
-        // console.log('res',res)
139
-        this.list = res.data.data
140
-        // console.log(this.list,'表单内容打印记得注释')
141
-        this.totalPrice = this.list.westernMedicineCostTotal + this.list.checkCostTotal + this.list.treatCostTotal + this.list.bedCostTotal + this.list.chineseTraditionalMedicineCostTotal +
142
-          this.list.laboratoryCostTotal + this.list.operationCostTotal + this.list.otherCostTotal + this.list.materialCostTotal
143
-        this.smalltoBIG(this.list.medfee_sumamt)
144
-        var data = new Date(res.data.data.date * 1000);
145
-        var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
146
-        var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
147
-        this.printDate = data.getFullYear() + "-" + month + "-" + date;
148
-        this.pageArr = []
149
-        this.getPage()
150
-        this.pageArr.push(9)
151
-        console.log('pageArr',this.pageArr.length)
152
-      })
153
-    },
154
-    smalltoBIG(n) {
155
-      // let fraction = ['角', '分'];
156
-      // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
157
-      // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
158
-      // let head = price < 0 ? '欠' : '';
159
-      // price = Math.abs(price);
160
-      // let upper = '';
161
-      // for (let i = 0; i < fraction.length; i++) {
162
-      // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
163
-      // }
164
-      // upper = upper || '整';
165
-      // price = Math.floor(price);
166
-      // for (let i = 0; i < unit[0].length && price > 0; i++) {
167
-      // let p = '';
168
-      // for (let j = 0; j < unit[1].length && price > 0; j++) {
169
-      //     p = digit[price % 10] + unit[1][j] + p;
170
-      //     price = Math.floor(price / 10);
171
-      // }
172
-      // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
173
-      // }
174
-      // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
175
-      // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
176
-      if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
177
-        return "数据非法";  //判断数据是否大于0
178
-      }
179
-
180
-      var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
181
-      n += "00";
182
-
183
-      var indexpoint = n.indexOf('.');  // 如果是小数,截取小数点前面的位数
184
-
185
-      if (indexpoint >= 0){
186
-
187
-        n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2);   // 若为小数,截取需要使用的unit单位
188
-      }
189
-
190
-      unit = unit.substr(unit.length - n.length);  // 若为整数,截取需要使用的unit单位
191
-      for (var i=0; i < n.length; i++){
192
-        str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i);  //遍历转化为大写的数字
193
-      }
194
-      console.log("str",str)
195
-      if(str == '零元零角零分'){
196
-        this.zhongwen = '零'
197
-      }else{
198
-        this.zhongwen =  str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
199
-      }
200
-
201
-      console.log(this.zhongwen)
107
+    props:{
108
+        paramsObj:Object
202 109
     },
203
-    getTime(value, temp) {
204
-      if (value == 0) {
205
-        return ''
206
-      }
207
-      if (value != undefined) {
208
-        return uParseTime(value, temp)
209
-      }
210
-      return ''
211
-    },
212
-    getPage(){
213
-      if(this.list.order_info.length <= 9){
214
-        this.page = 1
215
-        this.pageArr.push(this.list.order_info.length)
216
-      }else if(this.list.order_info.length > 9){
217
-        this.page = parseInt(this.list.order_info.length / 9)
218
-        let num = this.list.order_info.length % 9
219
-        for (var i=0;i<this.page;i++){
220
-          this.pageArr.push(9)
221
-        }
222
-        if(num != 0){
223
-          this.pageArr.push(num)
110
+    data(){
111
+        return{
112
+            list:{},
113
+            printDate:'',
114
+            zhongwen:'',
115
+            totalPrice:0.0,
116
+            org_id:'',
117
+            org_name:'',
118
+            page:1,
119
+            pageArr:[],
224 120
         }
225
-      }
226
-    }
227
-
228
-  },
229
-  watch:{
230
-    paramsObj:{//深度监听,可监听到对象、数组的变化
231
-      handler(val, oldVal){
121
+    },
122
+    created(){
123
+        console.log('paramsObj',this.paramsObj)
232 124
         let params = {
233
-          order_id: val.order_id,
234
-          patient_id: val.patient_id,
125
+            order_id: this.paramsObj.order_id,
126
+            patient_id: this.paramsObj.patient_id,
235 127
         }
236 128
         this.getInvoice(params)
237
-
238
-      },
239
-      deep:true
240
-    }
241
-  }
242
-}
243
-</script>
244
-<template>
245
-  <div id='invoice-print'>
246
-    <div v-for='(i,index) in pageArr.length' :key="index" >
247
-      <div :style="{position: 'absolute',top:(30 + (index * 415))  + 'px',left:200+ 'px',}">盐城大丰悦达金骆驼血液透析中心</div>
248
-      <div :style="{position: 'absolute',top:(70 + (index * 415))  + 'px',left:150+ 'px',}">{{ list.order_number }}</div>
249
-      <div style="display:flex;justify-content: space-between;">
250
-        <div :style="{position: 'absolute',top:(100 + (index * 415))  + 'px',left:100+ 'px',}">{{ paramsObj.name }}</div>
251
-      </div>
252
-      <div :style="{position: 'absolute',top:(190 + (index * 415))  + 'px',left:120+ 'px',}">
253
-        <div v-if="list.westernMedicineCostTotal">西药 {{ list.westernMedicineCostTotal }}</div>
254
-        <div v-if="list.treatCostTotal">治疗费 {{ list.treatCostTotal }}</div>
255
-        <div v-if="list.bedCostTotal">床位费 {{ list.bedCostTotal }}</div>
256
-        <div v-if="list.chineseTraditionalMedicineCostTotal">中成药 {{ list.chineseTraditionalMedicineCostTotal }}</div>
257
-        <div v-if="list.laboratoryCostTotal">化验费 {{ list.laboratoryCostTotal }}</div>
258
-        <div v-if="list.operationCostTotal">手术费 {{ list.operationCostTotal }}</div>
259
-        <div v-if="list.otherCostTotal">其他费 {{ list.otherCostTotal }}</div>
260
-        <div v-if="list.materialCostTotal">材料费 {{ list.materialCostTotal }}</div>
261
-      </div>
262
-      <div :style="{position: 'absolute',top:(190 + (index * 420))  + 'px',left:300+ 'px'}">
263
-        <div v-for="item in list.order_info.slice(index * 10,(index * 10) + pageArr[index])">
264
-                    <span style="display:inline-block;width:300px;">
265
-                        <span v-if="item.advice.id == 0">
266
-                            <span v-if="item.project.type == 2"> {{ item.project.project.project_name }}</span>
267
-                            <span v-if="item.project.type == 3">{{ item.project.good_info.good_name }}</span>
268
-                        </span>
269
-                        <span v-else>{{ item.advice.advice_name }}</span>
270
-                    </span>
271
-          <span style="display:inline-block;width:50px;">
272
-                        <span v-if="item.advice.id == 0">
273
-                            <span v-if="item.project.type == 2">{{ item.project.count }}{{ item.project.unit }}</span>
274
-                            <span v-if="item.project.type == 3">{{ item.project.count }}{{ item.project.unit }}</span>
275
-                        </span>
276
-                        <span v-else>{{ item.advice.prescribing_number }}{{ item.advice.prescribing_number_unit }}</span>
277
-                    </span>
278
-          <span>
279
-                        <span v-if="item.advice.id == 0">
280
-                            <span v-if="item.project.type == 2">{{ (item.project.count * item.pric).toFixed(2) }}</span>
281
-                            <span v-if="item.project.type == 3">{{ (item.project.count * item.pric).toFixed(2) }}</span>
282
-                        </span>
283
-                        <span v-else>{{ (item.advice.prescribing_number * item.pric).toFixed(2) }}</span>
284
-                    </span>
285
-        </div>
286
-      </div>
287
-      <div :style="{position: 'absolute',top:(350 + (index * 415))  + 'px',left:130+ 'px'}">{{ zhongwen }}</div>
288
-      <div :style="{position: 'absolute',top:(350 + (index * 415))  + 'px',left:480+ 'px'}">{{ list.medfee_sumamt }}</div>
289
-      <div v-if="index == pageArr.length - 1" :style="{position: 'absolute',top:(370 + (index * 415))  + 'px',left:110+ 'px',width:100 + '%',fontSize:12+'px'}">
290
-        <div style="display:flex;">
291
-          <div style="width:140px">医疗总费用:{{ list.order.medfee_sumamt }}</div>
292
-          <div style="width:140px">基金支付总额:{{ list.order.fund_pay_sumamt }}</div>
293
-          <div style="width:140px">统筹支出:{{ list.order.hifp_pay }}</div>
294
-          <div style="width:140px">大病支出:{{list.order.hifmi_pay}}</div>
295
-          <div style="width:140px">个人账户支付:{{ list.order.acct_pay }}</div>
296
-          <div style="width:140px">现金支出:{{ list.order.psn_cash_pay }}</div>
297
-          <div style="width:220px">医疗救助基金支出:{{ list.order.maf_pay }}</div>
298
-
299
-        </div>
300
-        <div style="display:flex;">
301
-          <div style="width:140px">本次账户:0</div>
302
-          <div style="width:140px">上次账户:0</div>
303
-          <div style="width:140px">账户余额:{{ list.order.balc }}</div>
304
-          <div style="width:140px">其他支出:{{ list.order.oth_pay }}</div>
305
-          <div style="width:140px">大病补充保险支出:0</div>
306
-          <div style="width:140px">民政支出:0</div>
307
-          <div style="width:280px">企业补充医疗保险基金支出:{{ list.order.hifes_pay }}</div>
308
-        </div>
309
-
310
-      </div>
311
-      <div v-if="index != pageArr.length - 1">
312
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:140+ 'px'}">盐城大丰悦达金骆驼血液透析中心</div>
313
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:410+ 'px'}">{{ paramsObj.chargeName }}</div>
314
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:550+ 'px'}">
315
-          <span>{{  paramsObj.setl_time ? paramsObj.setl_time.split(' ')[0].slice(0,4) : getTime(list.date, '{y}-{m}-{d}').slice(0,4) }}</span>
316
-        </div>
317
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:610+ 'px'}">
318
-          <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(5,7)) : getTime(list.date, '{y}-{m}-{d}').slice(5,7) }}</span>
319
-        </div>
320
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:650+ 'px'}">
321
-          <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(8,11)) : getTime(list.date, '{y}-{m}-{d}').slice(8,11) }}</span>
322
-        </div>
323
-      </div>
324
-
325
-      <div v-if="index == pageArr.length - 1">
326
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:140+ 'px'}">盐城大丰悦达金骆驼血液透析中心</div>
327
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:410+ 'px'}">{{ paramsObj.chargeName }}</div>
328
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:550+ 'px'}">
329
-          <span>{{  paramsObj.setl_time ? paramsObj.setl_time.split(' ')[0].slice(0,4) : getTime(list.date, '{y}-{m}-{d}').slice(0,4) }}</span>
330
-        </div>
331
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:610+ 'px'}">
332
-          <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(5,7)) : getTime(list.date, '{y}-{m}-{d}').slice(5,7) }}</span>
333
-        </div>
334
-        <div :style="{position: 'absolute',top:(400 + (index * 415))  + 'px',left:650+ 'px'}">
335
-          <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(8,11)) : getTime(list.date, '{y}-{m}-{d}').slice(8,11) }}</span>
336
-        </div>
337
-      </div>
338
-
339
-    </div>
340
-  </div>
341
-</template>
342
-
343
-
344
-<script>
345
-import { getInvoice } from '@/api/project/project'
346
-import { uParseTime } from '@/utils/tools'
347
-export default {
348
-  props:{
349
-    paramsObj:Object
350
-  },
351
-  data(){
352
-    return{
353
-      list:{},
354
-      printDate:'',
355
-      zhongwen:'',
356
-      totalPrice:0.0,
357
-      org_id:'',
358
-      org_name:'',
359
-      page:1,
360
-      pageArr:[],
361
-    }
362
-  },
363
-  created(){
364
-    console.log('paramsObj',this.paramsObj)
365
-    let params = {
366
-      order_id: this.paramsObj.order_id,
367
-      patient_id: this.paramsObj.patient_id,
368
-    }
369
-    this.getInvoice(params)
370
-    // var data = new Date();
371
-    // var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
372
-    // var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
373
-    // this.printDate = data.getFullYear() + "-" + month + "-" + date;
374
-    // this.smalltoBIG(982732.21)
375
-    this.org_id = this.$store.getters.xt_user.org_id
376
-    this.org_name = this.$store.getters.xt_user.org.org_name
377
-  },
378
-  methods:{
379
-    getInvoice(params){
380
-      getInvoice(params).then((res) => {
381
-        // console.log('res',res)
382
-        this.list = res.data.data
383
-        // console.log(this.list,'表单内容打印记得注释')
384
-        this.totalPrice = this.list.westernMedicineCostTotal + this.list.checkCostTotal + this.list.treatCostTotal + this.list.bedCostTotal + this.list.chineseTraditionalMedicineCostTotal +
385
-          this.list.laboratoryCostTotal + this.list.operationCostTotal + this.list.otherCostTotal + this.list.materialCostTotal
386
-        this.smalltoBIG(this.list.medfee_sumamt)
387
-        var data = new Date(res.data.data.date * 1000);
388
-        var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
389
-        var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
390
-        this.printDate = data.getFullYear() + "-" + month + "-" + date;
391
-        this.pageArr = []
392
-        this.getPage()
393
-        this.pageArr.push(9)
394
-        console.log('pageArr',this.pageArr.length)
395
-      })
396
-    },
397
-    smalltoBIG(n) {
398
-      // let fraction = ['角', '分'];
399
-      // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
400
-      // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
401
-      // let head = price < 0 ? '欠' : '';
402
-      // price = Math.abs(price);
403
-      // let upper = '';
404
-      // for (let i = 0; i < fraction.length; i++) {
405
-      // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
406
-      // }
407
-      // upper = upper || '整';
408
-      // price = Math.floor(price);
409
-      // for (let i = 0; i < unit[0].length && price > 0; i++) {
410
-      // let p = '';
411
-      // for (let j = 0; j < unit[1].length && price > 0; j++) {
412
-      //     p = digit[price % 10] + unit[1][j] + p;
413
-      //     price = Math.floor(price / 10);
414
-      // }
415
-      // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
416
-      // }
417
-      // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
418
-      // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
419
-      if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
420
-        return "数据非法";  //判断数据是否大于0
421
-      }
422
-
423
-      var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
424
-      n += "00";
425
-
426
-      var indexpoint = n.indexOf('.');  // 如果是小数,截取小数点前面的位数
427
-
428
-      if (indexpoint >= 0){
429
-
430
-        n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2);   // 若为小数,截取需要使用的unit单位
431
-      }
432
-
433
-      unit = unit.substr(unit.length - n.length);  // 若为整数,截取需要使用的unit单位
434
-      for (var i=0; i < n.length; i++){
435
-        str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i);  //遍历转化为大写的数字
436
-      }
437
-      console.log("str",str)
438
-      if(str == '零元零角零分'){
439
-        this.zhongwen = '零'
440
-      }else{
441
-        this.zhongwen =  str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
442
-      }
443
-
444
-      console.log(this.zhongwen)
445
-    },
446
-    getTime(value, temp) {
447
-      if (value == 0) {
448
-        return ''
449
-      }
450
-      if (value != undefined) {
451
-        return uParseTime(value, temp)
452
-      }
453
-      return ''
129
+        // var data = new Date();
130
+        // var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
131
+        // var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
132
+        // this.printDate = data.getFullYear() + "-" + month + "-" + date;
133
+        // this.smalltoBIG(982732.21)
134
+        this.org_id = this.$store.getters.xt_user.org_id
135
+        this.org_name = this.$store.getters.xt_user.org.org_name
454 136
     },
455
-    getPage(){
456
-      if(this.list.order_info.length <= 9){
457
-        this.page = 1
458
-        this.pageArr.push(this.list.order_info.length)
459
-      }else if(this.list.order_info.length > 9){
460
-        this.page = parseInt(this.list.order_info.length / 9)
461
-        let num = this.list.order_info.length % 9
462
-        for (var i=0;i<this.page;i++){
463
-          this.pageArr.push(9)
464
-        }
465
-        if(num != 0){
466
-          this.pageArr.push(num)
137
+    methods:{
138
+        getInvoice(params){
139
+            getInvoice(params).then((res) => {
140
+                // console.log('res',res)
141
+                this.list = res.data.data
142
+                // console.log(this.list,'表单内容打印记得注释')
143
+                this.totalPrice = this.list.westernMedicineCostTotal + this.list.checkCostTotal + this.list.treatCostTotal + this.list.bedCostTotal + this.list.chineseTraditionalMedicineCostTotal +
144
+                                    this.list.laboratoryCostTotal + this.list.operationCostTotal + this.list.otherCostTotal + this.list.materialCostTotal
145
+                this.smalltoBIG(this.list.medfee_sumamt)
146
+                var data = new Date(res.data.data.date * 1000);
147
+                var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
148
+                var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
149
+                this.printDate = data.getFullYear() + "-" + month + "-" + date;
150
+                this.pageArr = []
151
+                this.getPage()
152
+                this.pageArr.push(10)
153
+                console.log('pageArr',this.pageArr.length)
154
+            })
155
+        },
156
+        smalltoBIG(n) {
157
+            // let fraction = ['角', '分'];
158
+            // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
159
+            // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
160
+            // let head = price < 0 ? '欠' : '';
161
+            // price = Math.abs(price);
162
+            // let upper = '';
163
+            // for (let i = 0; i < fraction.length; i++) {
164
+            // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
165
+            // }
166
+            // upper = upper || '整';
167
+            // price = Math.floor(price);
168
+            // for (let i = 0; i < unit[0].length && price > 0; i++) {
169
+            // let p = '';
170
+            // for (let j = 0; j < unit[1].length && price > 0; j++) {
171
+            //     p = digit[price % 10] + unit[1][j] + p;
172
+            //     price = Math.floor(price / 10);
173
+            // }
174
+            // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
175
+            // }
176
+            // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
177
+            // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
178
+            if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
179
+                return "数据非法";  //判断数据是否大于0
180
+            }
181
+
182
+            var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
183
+            n += "00";
184
+
185
+            var indexpoint = n.indexOf('.');  // 如果是小数,截取小数点前面的位数
186
+
187
+            if (indexpoint >= 0){
188
+
189
+                n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2);   // 若为小数,截取需要使用的unit单位
190
+            }
191
+
192
+            unit = unit.substr(unit.length - n.length);  // 若为整数,截取需要使用的unit单位
193
+            for (var i=0; i < n.length; i++){
194
+                str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i);  //遍历转化为大写的数字
195
+            }
196
+            console.log("str",str)
197
+            if(str == '零元零角零分'){
198
+                this.zhongwen = '零'
199
+            }else{
200
+                this.zhongwen =  str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
201
+            }
202
+
203
+            console.log(this.zhongwen)
204
+        },
205
+        getTime(value, temp) {
206
+            if (value == 0) {
207
+                return ''
208
+            }
209
+            if (value != undefined) {
210
+                return uParseTime(value, temp)
211
+            }
212
+            return ''
213
+        },
214
+        getPage(){
215
+        if(this.list.order_info.length <= 10){
216
+            this.page = 1
217
+            this.pageArr.push(this.list.order_info.length)
218
+        }else if(this.list.order_info.length > 10){
219
+            this.page = parseInt(this.list.order_info.length / 10)
220
+            let num = this.list.order_info.length % 10
221
+            for (var i=0;i<this.page;i++){
222
+                this.pageArr.push(10)
223
+            }
224
+            if(num != 0){
225
+                this.pageArr.push(num)
226
+            }
467 227
         }
468 228
       }
469
-    }
470 229
 
471
-  },
472
-  watch:{
473
-    paramsObj:{//深度监听,可监听到对象、数组的变化
474
-      handler(val, oldVal){
475
-        let params = {
476
-          order_id: val.order_id,
477
-          patient_id: val.patient_id,
230
+    },
231
+    watch:{
232
+        paramsObj:{//深度监听,可监听到对象、数组的变化
233
+            handler(val, oldVal){
234
+                let params = {
235
+                    order_id: val.order_id,
236
+                    patient_id: val.patient_id,
237
+                }
238
+                this.getInvoice(params)
239
+
240
+            },
241
+            deep:true
478 242
         }
479
-        this.getInvoice(params)
480
-
481
-      },
482
-      deep:true
483 243
     }
484
-  }
485 244
 }
486 245
 </script>

+ 17 - 9
src/xt_pages/outpatientDoctorStation/template/prinSeven.vue Dosyayı Görüntüle

@@ -287,7 +287,7 @@
287 287
             <p>
288 288
               金额:{{
289 289
                 getTotalOne(item.id).toFixed(2)
290
-                  ? getTotalOne(item.id).toFixed(2)
290
+                  ? getTotalOne(item.id).toFixed(2) 
291 291
                   : 0
292 292
               }}元
293 293
             </p>
@@ -511,8 +511,10 @@ export default{
511 511
       return name;
512 512
     },
513 513
     getTotalOne(id) {
514
+      console.log('999999999',id);
514 515
       var total = 0;
515 516
       var addtotal = 0;
517
+      var zimuyao = 0;
516 518
       for (let i = 0; i < this.prescriptions.length; i++) {
517 519
         if (id == this.prescriptions[i].id) {
518 520
           if (this.prescriptions[i].project != null) {
@@ -520,7 +522,7 @@ export default{
520 522
               total =
521 523
                 total +
522 524
                 this.prescriptions[i].project[a].price *
523
-                  this.prescriptions[i].project[a].count;
525
+                  this.prescriptions[i].project[a].count ;
524 526
             }
525 527
           }
526 528
 
@@ -533,7 +535,7 @@ export default{
533 535
               addtotal =
534 536
                 addtotal +
535 537
                 this.prescriptions[i].additionalcharge[a].price *
536
-                  this.prescriptions[i].additionalcharge[a].count;
538
+                  this.prescriptions[i].additionalcharge[a].count ;
537 539
             }
538 540
           }
539 541
           addtotal = Math.floor(addtotal * 100) / 100;
@@ -546,11 +548,17 @@ export default{
546 548
             for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
547 549
               total =
548 550
                 total +
549
-                this.prescriptions[i].advices[a].price *
550
-                  this.prescriptions[i].advices[a].prescribing_number;
551
+                (this.prescriptions[i].advices[a].price *
552
+                  this.prescriptions[i].advices[a].prescribing_number) ;
553
+            }
554
+          }
555
+          if(this.prescriptions[i].arr[0] != null){
556
+            for(let b=0;b<this.prescriptions[i].arr[0].length;b++){
557
+              zimuyao = zimuyao +
558
+              this.prescriptions[i].arr[b][0].price *
559
+              this.prescriptions[i].arr[b][0].prescribing_number
551 560
             }
552 561
           }
553
-
554 562
           if (this.prescriptions[i].additionalcharge != null) {
555 563
             for (
556 564
               let a = 0;
@@ -559,15 +567,15 @@ export default{
559 567
             ) {
560 568
               addtotal =
561 569
                 addtotal +
562
-                this.prescriptions[i].additionalcharge[a].price *
563
-                  this.prescriptions[i].additionalcharge[a].count;
570
+                (this.prescriptions[i].additionalcharge[a].price *
571
+                  this.prescriptions[i].additionalcharge[a].count );
564 572
             }
565 573
           }
566 574
           addtotal = Math.floor(addtotal * 100) / 100;
567 575
         }
568 576
       }
569 577
 
570
-      return total + addtotal;
578
+      return total + addtotal + zimuyao ;
571 579
     },
572 580
 
573 581
     getProjectName(id) {

+ 6 - 3
src/xt_pages/outpatientDoctorStation/treatPrint.vue Dosyayı Görüntüle

@@ -16,8 +16,9 @@
16 16
         <!-- 此下条为本地开发下页面 -->
17 17
         <!-- <printTwo v-if="org_id == 4" v-bind:childResponse="childResponse" :advicePrint="advicePrint" :ids="ids" :patient="patient" :hisPatient="hisPatient" :patient_id="patient_id" :record_date="record_date" :prescription_id="prescription_id"></printTwo> -->
18 18
         <!-- org_id != 10138 && org_id != 10278 && org_id !=4&& org_id !=0 -->
19
-        <printOne v-if="org_id != 10138 && org_id != 10278 && org_id !=4" v-bind:childResponse="childResponse" :advicePrint="advicePrint" :ids="ids" :patient="patient" :hisPatient="hisPatient" :patient_id="patient_id" :record_date="record_date" :prescription_id="prescription_id"></printOne>
20
-        <printTwo v-else v-bind:childResponse="childResponse" :advicePrint="advicePrint" :ids="ids" :patient="patient" :hisPatient="hisPatient" :patient_id="patient_id" :record_date="record_date" :prescription_id="prescription_id" :newHisPatient="newHisPatient"></printTwo>
19
+        <printOne v-if="org_id != 10138 && org_id != 10278 && org_id !=4 && org_id != 10375 " v-bind:childResponse="childResponse" :advicePrint="advicePrint" :ids="ids" :patient="patient" :hisPatient="hisPatient" :patient_id="patient_id" :record_date="record_date" :prescription_id="prescription_id"></printOne>
20
+        <printThree v-if=" org_id == 10375" v-bind:childResponse="childResponse" :advicePrint="advicePrint" :ids="ids" :patient="patient" :hisPatient="hisPatient" :patient_id="patient_id" :record_date="record_date" :prescription_id="prescription_id"></printThree>
21
+        <printTwo v-if="org_id == 10138 || org_id == 10278 || org_id ==4" v-bind:childResponse="childResponse" :advicePrint="advicePrint" :ids="ids" :patient="patient" :hisPatient="hisPatient" :patient_id="patient_id" :record_date="record_date" :prescription_id="prescription_id" :newHisPatient="newHisPatient"></printTwo>
21 22
       </div>
22 23
   </div>
23 24
 </template>
@@ -34,13 +35,15 @@ import BreadCrumb from "@/xt_pages/components/bread-crumb";
34 35
 import print from "print-js";
35 36
 import printOne from "./treatTemplate/printOne"
36 37
 import printTwo from "./treatTemplate/printTwo"
38
+import printThree from "./treatTemplate/printThree.vue"
37 39
 import { getAllDoctorList,getAllHisPatientList,getPrescriptionPrint } from "@/api/project/project"
38 40
 export default {
39 41
   name: "dialysisPrintOrder",
40 42
   components: {
41 43
     BreadCrumb,
42 44
     printOne,
43
-    printTwo
45
+    printTwo,
46
+    printThree
44 47
   },
45 48
   props:{
46 49
     paramsObj:Object,

+ 3 - 2
src/xt_pages/outpatientDoctorStation/treatTemplate/printOne.vue Dosyayı Görüntüle

@@ -2,7 +2,7 @@
2 2
     <div id='prescriptionPrint'>
3 3
         <div id='prescription-print' class="prescription-print" v-for="(item,index) in advicePrint" :key="index">
4 4
 
5
-            <div style="display:flex;justify-content: space-between;font-weight:bold;align-items:center;">
5
+            <div style="display:flex;justify-content: space-between;font-weight:bold;align-items:center;" >
6 6
                 <div style="width:200px;display:flex;justify-content: space-between;font-weight:bold;">
7 7
                     <span>费别</span>
8 8
                     <span>自费</span>
@@ -10,7 +10,8 @@
10 10
                     <span>保险</span>
11 11
                     <span>其他</span>
12 12
                 </div>
13
-                <div>就诊日期:{{getTime(item.ctime,'{y}-{m}-{d}')}}</div>
13
+                <div v-if="org_id == 10460">就诊日期:{{getTime(item.pre_time,'{y}-{m}-{d}')}}</div>
14
+                <div v-else>就诊日期:{{getTime(item.ctime,'{y}-{m}-{d}')}}</div>
14 15
             </div>
15 16
 
16 17
             <div class="printTitle">{{orgname}}</div>

+ 531 - 0
src/xt_pages/outpatientDoctorStation/treatTemplate/printThree.vue Dosyayı Görüntüle

@@ -0,0 +1,531 @@
1
+<template>
2
+  <div id='prescriptionPrint'>
3
+      <div id='prescription-print' class="prescription-print" v-for="(item,index) in advicePrint" :key="index">
4
+
5
+          <div class="printTitle">{{orgname}}</div>
6
+          <div class="printTitle">处方、治疗单</div>
7
+          <div style="display:flex;justify-content: space-between;font-weight:bold;align-items:center;" >
8
+              <div style="width:200px;display:flex;justify-content: space-between;font-weight:bold;">
9
+                  <span>费别</span>
10
+                  <span>自费</span>
11
+                  <span>公费</span>
12
+                  <span>保险</span>
13
+                  <span>其他</span>
14
+              </div>
15
+              <div >就诊日期:{{getTime(item.ctime,'{y}-{m}-{d}')}}</div>
16
+          </div>
17
+<!-- class="infoTitle" -->
18
+          <div style="display: flex; margin-top: 10px; line-height: 24px;padding: 0 10px;">
19
+              <div style="width: 300px;">门诊编号:</div>
20
+              <!-- <div style="width: 300px;">电脑号:</div> -->
21
+          </div>
22
+
23
+          <div class="infoMain">
24
+              <div style="margin-bottom: 10px;width:25%">姓名:{{item.patient.name}}</div>
25
+              <div style="margin-bottom: 10px;width:25%">性别:
26
+                  <span v-if="item.patient.gender == 1">男</span>
27
+                  <span v-if="item.patient.gender == 2">女</span>
28
+              </div>
29
+              <div style="margin-bottom: 10px;width:25%">年龄:
30
+                  <span>{{getAge(item.patient)?getAge(item.patient):""}}岁</span>
31
+              </div>
32
+              <div style="margin-bottom: 10px;width:25%">参保类型:{{hisPatient.social_type?hisPatient.social_type:''}}
33
+              </div>
34
+              <div style="margin-bottom: 10px;width:50%;">联系电话:{{item.patient.phone}}</div>
35
+              <div style="width:50%;">地址:{{ item.patient.home_address }}
36
+                <!-- {{item.patient.unit_address}} -->
37
+              </div>
38
+              <div style="width:100%;">诊断:{{getDiagnosis(item.info.diagnosis)}}</div>
39
+          </div>
40
+
41
+          <div class="prescriptionBox" style="min-height: 425px;">
42
+              <table style="width:100%;text-align:center;line-height:25px;">
43
+                  <tr>
44
+                      <td>序号</td>
45
+                      <td>项目名称</td>
46
+                      <td>数量</td>
47
+                      <td>单位</td>
48
+                      <td>单价</td>
49
+                      <td>部位</td>
50
+                      <td>备注</td>
51
+                      <td>天数</td>
52
+                  </tr>
53
+                  <tr v-for="(it,index) in item.project" :key="index">
54
+                      <td>{{index+1}}</td>
55
+                      <td>{{it.type == 2 ? it.project.project_name : it.good_info.good_name}}</td>
56
+                      <td>{{it.count}}</td>
57
+                      <td>{{getUnit(it.unit)}}</td>
58
+                      <td>{{it.price.toFixed(2)}}</td>
59
+                      <td></td>
60
+                      <td>{{it.remark}}</td>
61
+                      <td>{{it.day}}</td>
62
+
63
+                  </tr>
64
+
65
+                  <tr v-for="(it,index) in item.advices" :key="index">
66
+                      <td>{{index+1}}</td>
67
+                      <td>{{it.advice_name?it.advice_name:''}}</td>
68
+                      <td>{{it.single_dose?it.single_dose:''}}</td>
69
+                      <td>{{it.single_dose_unit?it.single_dose_unit:''}}</td>
70
+                      <td>{{it.price.toFixed(2)}}</td>
71
+                      <td></td>
72
+                      <td>{{it.remark}}</td>
73
+                      <td>{{it.day}}</td>
74
+
75
+                  </tr>
76
+              </table>
77
+          </div>
78
+
79
+          <div style="display: flex; margin-top: 10px; line-height: 24px;padding: 0 10px;">
80
+              <div style="width: 300px;">开单医生:{{item.doctor?item.doctor:''}}</div>
81
+              <div style="width: 300px;">签章:</div>
82
+              <div style="width: 300px;">费用:{{getTotalOne(item.id).toFixed(2)?getTotalOne(item.id).toFixed(2):''}}元</div>
83
+          </div>
84
+
85
+          <table style="width:100%;text-align:center;line-height:25px;border-collapse: collapse;" border="1">
86
+              <tr>
87
+                  <td style="width:16%;">治疗时间</td>
88
+                  <td style="width:16%;"></td>
89
+                  <td style="width:16%;"></td>
90
+                  <td style="width:16%;"></td>
91
+                  <td style="width:16%;"></td>
92
+                  <td style="width:16%;"></td>
93
+              </tr>
94
+              <tr>
95
+                  <td style="width:16%;">医生签字</td>
96
+                  <td style="width:16%;"></td>
97
+                  <td style="width:16%;"></td>
98
+                  <td style="width:16%;"></td>
99
+                  <td style="width:16%;"></td>
100
+                  <td style="width:16%;"></td>
101
+              </tr>
102
+              <!-- <tr>
103
+                  <td style="width:16px;">患者签字</td>
104
+                  <td style="width:16px;"></td>
105
+                  <td style="width:16px;"></td>
106
+                  <td style="width:16px;"></td>
107
+                  <td style="width:16px;"></td>
108
+                  <td style="width:16px;"></td>
109
+              </tr> -->
110
+          </table>
111
+      </div>
112
+
113
+
114
+      <!-- <div id='prescriptionPrint'>
115
+
116
+          <div v-for="(item,index) in advicePrint" :key="index">
117
+              <div id='prescription-print' class="prescription-print" style="page-break-after: always;">
118
+                  <div style="display:flex;justify-content: space-between;font-weight:bold;">
119
+                      <div style="width:200px;display:flex;justify-content: space-between;font-weight:bold;">
120
+                          <span>费别</span>
121
+                          <span>自费</span>
122
+                          <span>公费</span>
123
+                          <span>保险</span>
124
+                          <span>其他</span>
125
+                      </div>
126
+                      <div>就诊日期:{{getTime(item.ctime)}}</div>
127
+                  </div>
128
+
129
+                  <div class="printTitle">血液透析中心</div>
130
+
131
+                  <div class="printTitle">处方、治疗单</div>
132
+
133
+                  <div class="infoTitle">
134
+                      <div>门诊编号:</div>
135
+                      <div>电脑号:</div>
136
+                  </div>
137
+
138
+                  <div class="infoMain">
139
+                      <div style="margin-bottom: 10px;width:25%">姓名:{{item.patient.name}}</div>
140
+                      <div style="margin-bottom: 10px;width:25%">性别:
141
+                          <span v-if="item.patient.gender == 1">男</span>
142
+                          <span v-if="item.patient.gender == 2">女</span>
143
+                      </div>
144
+                      <div style="margin-bottom: 10px;width:25%">年龄:
145
+                          <span>{{item.patient.age}}</span>
146
+                      </div>
147
+                      <div style="margin-bottom: 10px;width:25%">参保类型:</div>
148
+                      <div style="margin-bottom: 10px;width:50%;">联系电话:{{item.patient.phone}}</div>
149
+                      <div style="width:50%;">地址:{{item.patient.unit_address}}</div>
150
+                      <div style="width:100%;">诊断:{{item.patient.diagnose}}</div>
151
+                  </div>
152
+
153
+                  <div class="prescriptionBox">
154
+                      <table style="width:100%;text-align:center;line-height:25px;">
155
+                          <tr>
156
+                              <td>序号</td>
157
+                              <td>项目名称</td>
158
+                              <td>数量</td>
159
+                              <td>单位</td>
160
+                              <td>单价</td>
161
+                              <td>部位</td>
162
+                              <td>备注</td>
163
+                              <td>天数</td>
164
+                          </tr>
165
+                          <tr v-for="(it,index) in item.project" :key="index">
166
+                              <td>{{index+1}}</td>
167
+                              <td>{{getProjectName(it.project_id)}}</td>
168
+                              <td>{{it.single_dose}}</td>
169
+                              <td>{{getUnit(it.unit)}}</td>
170
+                              <td>{{it.price}}</td>
171
+                              <td></td>
172
+                              <td>{{it.remark}}</td>
173
+                              <td>{{it.day}}</td>
174
+
175
+                          </tr>
176
+                      </table>
177
+                  </div>
178
+                  <div class="infoTitle">
179
+                      <div>开单医生:{{getDoctor(item.doctor)?getDoctor(item.doctor):""}}</div>
180
+                      <div>签章:</div>
181
+                  </div>
182
+                  <div class="actionBar">
183
+                      <div>执行医生:{{getDoctor(item.doctor)?getDoctor(item.doctor):""}}</div>
184
+                      <div>费用:</div>
185
+                  </div>
186
+                  <table style="width:100%;text-align:center;line-height:25px;border-collapse: collapse;" border="1">
187
+                      <tr>
188
+                          <td style="width:16%;">治疗时间</td>
189
+                          <td style="width:16%;"></td>
190
+                          <td style="width:16%;"></td>
191
+                          <td style="width:16%;"></td>
192
+                          <td style="width:16%;"></td>
193
+                          <td style="width:16%;"></td>
194
+                      </tr>
195
+                      <tr>
196
+                          <td style="width:16%;">医生签字</td>
197
+                          <td style="width:16%;"></td>
198
+                          <td style="width:16%;"></td>
199
+                          <td style="width:16%;"></td>
200
+                          <td style="width:16%;"></td>
201
+                          <td style="width:16%;"></td>
202
+                      </tr>
203
+                      <tr>
204
+                          <td style="width:16px;">患者签字</td>
205
+                          <td style="width:16px;"></td>
206
+                          <td style="width:16px;"></td>
207
+                          <td style="width:16px;"></td>
208
+                          <td style="width:16px;"></td>
209
+                          <td style="width:16px;"></td>
210
+                      </tr>
211
+                  </table>
212
+              </div>
213
+
214
+          </div>
215
+
216
+      </div> -->
217
+  </div>
218
+</template>
219
+<script>
220
+import { jsGetAge, uParseTime } from '@/utils/tools'
221
+import { getAllDoctorList, getPrescriptionPrint } from '@/api/project/project'
222
+import { getInitData } from '@/api/his/his'
223
+
224
+export default {
225
+  props: {
226
+    patient_id: Number,
227
+    record_date: String,
228
+    prescription_id: Number,
229
+    ids: String
230
+  },
231
+  data() {
232
+    return {
233
+      doctorList: [],
234
+      advicePrint: {},
235
+      patient: {},
236
+      tableData: [],
237
+      prescriptionInfo: [],
238
+      projectList: [],
239
+      prescriptions: [],
240
+      settlement:
241
+        [
242
+          { value: 1, label: '医保' },
243
+          { value: 2, label: '自费' },
244
+          { value: 3, label: '公费' },
245
+          { value: 4, label: '农保' },
246
+          { value: 5, label: '会员' },
247
+          { value: 6, label: '职工' },
248
+          { value: 7, label: '合同' },
249
+          { value: 8, label: '医保自费' }
250
+
251
+        ],
252
+      hisPatient: {},
253
+      diagnoses: []
254
+    }
255
+  },
256
+  methods: {
257
+    getAge(patient){
258
+      var thisLen = patient.id_card_no.length
259
+      var birth = ''
260
+      if (thisLen == 15) {
261
+        birth = '19' + patient.id_card_no.substr(6, 6)
262
+      } else {
263
+        birth = patient.id_card_no.substr(6, 8)
264
+      }
265
+      var births =
266
+        birth.substr(0, 4) +
267
+        '-' +
268
+        birth.substr(4, 2) +
269
+        '-' +
270
+        birth.substr(6, 2)
271
+      return jsGetAge(births, '-')
272
+
273
+    },
274
+    printThisPage() {
275
+      var ptime = Math.round(new Date().getTime() / 1000)
276
+      this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
277
+
278
+      const style =
279
+        '@media print {.printTitle{font-size: 22px;text-align: center;font-weight: bold;}.infoTitle{display: flex;margin-top:10px;line-height: 1px;padding:0 10px;}.infoTitle p{width: 200px;}.otherInfo{display: flex;margin-top:10px;padding:0 10px;}.otherInfo span{display:inline-block;}.recordTitle{display: flex;margin-top:10px;line-height: 24px;padding:0 10px;border-bottom: 2px solid #000;}.recordTitle p{width: 200px;}}'
280
+      printJS({
281
+        printable: 'prescription-print',
282
+        type: 'html',
283
+        style: style,
284
+        scanStyles: false
285
+      })
286
+    },
287
+    getAllDoctorList() {
288
+      getAllDoctorList().then(response => {
289
+        if (response.data.state == 1) {
290
+          var doctor = response.data.data.doctor
291
+
292
+          this.doctorList = doctor
293
+        }
294
+      })
295
+    },
296
+
297
+    getDoctor(id) {
298
+      var name = ''
299
+      for (let i = 0; i < this.doctorList.length; i++) {
300
+        if (id == this.doctorList[i].admin_user_id) {
301
+          name = this.doctorList[i].user_name
302
+        }
303
+      }
304
+      return name
305
+    },
306
+    getTime(value, temp) {
307
+      if (value != undefined) {
308
+        return uParseTime(value, temp)
309
+      }
310
+      return ''
311
+    },
312
+    getPrescriptionPrint() {
313
+      var params = {
314
+        patient_id: this.patient_id,
315
+        record_date: this.record_date,
316
+        prescription_id: this.prescription_id,
317
+        ids: this.ids,
318
+        p_type:2,
319
+      }
320
+      console.log('999999', params)
321
+      getPrescriptionPrint(params).then(response => {
322
+        if (response.data.state == 1) {
323
+          var advicePrint = response.data.data.advicePrint
324
+          console.log('adviceprint', advicePrint)
325
+          this.advicePrint = advicePrint
326
+          this.prescriptions = advicePrint
327
+          var projectlist = response.data.data.projectlist
328
+          console.log('所有项目列表', projectlist)
329
+          this.projectList = projectlist
330
+          this.hisPatient = response.data.data.hisPatient
331
+          this.advicePrint.map((item) => {
332
+            console.log(item.project.length);
333
+            if (item.project.length > 0) {
334
+              for (var i = item.project.length - 1; i >= 0; i--) {
335
+                if (item.project[i].type == 2) {
336
+                  if (item.project[i].project.cost_classify == 3) {
337
+                    console.log("!1111111")
338
+                    item.project.splice(i, 1);
339
+                  }
340
+                }
341
+              }
342
+            }
343
+          });
344
+
345
+        }
346
+      })
347
+    },
348
+    getProjectName(id) {
349
+      var project_name = ''
350
+      for (let i = 0; i < this.projectList.length; i++) {
351
+        if (id == this.projectList[i].id) {
352
+          project_name = this.projectList[i].project_name
353
+        }
354
+      }
355
+      return project_name
356
+    },
357
+    getUnit(id) {
358
+      var unit = ''
359
+      for (let i = 0; i < this.projectList.length; i++) {
360
+        if (id == this.projectList[i].id) {
361
+          unit = this.projectList[i].unit
362
+        }
363
+      }
364
+      return unit
365
+    },
366
+
367
+    getTotalOne(id) {
368
+
369
+      var total = 0
370
+      var addtotal = 0
371
+      for (let i = 0; i < this.prescriptions.length; i++) {
372
+        if (id == this.prescriptions[i].id) {
373
+          if (this.prescriptions[i].project != null) {
374
+            for (let a = 0; a < this.prescriptions[i].project.length; a++) {
375
+              total = total + this.prescriptions[i].project[a].price * this.prescriptions[i].project[a].count
376
+            }
377
+          }
378
+
379
+          if (this.prescriptions[i].additionalcharge != null) {
380
+            for (let a = 0; a < this.prescriptions[i].additionalcharge.length; a++) {
381
+              addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
382
+            }
383
+          }
384
+          addtotal = Math.floor(addtotal * 100) / 100
385
+        }
386
+
387
+      }
388
+
389
+      for (let i = 0; i < this.prescriptions.length; i++) {
390
+        if (id == this.prescriptions[i].id) {
391
+          if (this.prescriptions[i].advices != null) {
392
+            for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
393
+              total = total + this.prescriptions[i].advices[a].price * this.prescriptions[i].advices[a].prescribing_number
394
+            }
395
+          }
396
+
397
+          if (this.prescriptions[i].additionalcharge != null) {
398
+            for (let a = 0; a < this.prescriptions[i].additionalcharge.length; a++) {
399
+              addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
400
+            }
401
+          }
402
+          addtotal = Math.floor(addtotal * 100) / 100
403
+        }
404
+      }
405
+
406
+      return total + addtotal
407
+    },
408
+    getInitData() {
409
+      getInitData().then(response => {
410
+        if (response.data.state == 1) {
411
+          this.diagnoses = response.data.data.diagnose
412
+          console.log('争端', this.diagnoses)
413
+        }
414
+      })
415
+    },
416
+    getDiagnosis(id) {
417
+      let arr = id.split(",");
418
+      var name = "";
419
+      for (let i = 0; i < this.diagnoses.length; i++) {
420
+        if (arr.indexOf(String(this.diagnoses[i].id)) > -1) {
421
+          name += this.diagnoses[i].class_name + " ";
422
+        }
423
+      }
424
+      return name
425
+    }
426
+  },
427
+  created() {
428
+    this.getInitData()
429
+    this.getAllDoctorList()
430
+    this.getPrescriptionPrint()
431
+    var xtuser = this.$store.getters.xt_user
432
+    this.orgname = xtuser.org.org_name
433
+
434
+  },
435
+  watch: {
436
+    patient_id: function(val) {
437
+      console.log('101000010101010', this.patient_id, this.record_date, this.prescription_id)
438
+      //    this.getPrescriptionPrint()
439
+    },
440
+    ids: function(val) {
441
+      this.ids = val
442
+      console.log('this.idsids', this.ids)
443
+      this.getPrescriptionPrint()
444
+    }
445
+  }
446
+}
447
+</script>
448
+
449
+
450
+<style lang="scss" scoped>
451
+  .prescription-print {
452
+      -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
453
+      -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
454
+      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
455
+      margin-bottom: 20px;
456
+      padding: 20px 10px;
457
+  }
458
+
459
+  .prescription-print {
460
+      font-size: 14px;
461
+  }
462
+
463
+  .printTitle {
464
+      font-size: 18px;
465
+      text-align: center;
466
+      font-weight: bold;
467
+      margin-top: 10px;
468
+  }
469
+
470
+  .infoTitle {
471
+      display: flex;
472
+      // border-bottom: 2px solid #000;
473
+      margin-top: 10px;
474
+      line-height: 24px;
475
+      padding: 0 10px;
476
+  }
477
+
478
+  .infoTitle div {
479
+      width: 300px;
480
+  }
481
+
482
+  .infoMain {
483
+      display: flex;
484
+      flex-wrap: wrap;
485
+      border-bottom: 2px solid #000;
486
+      padding: 0 10px;
487
+  }
488
+
489
+  .infoMain div {
490
+      width: 50%;
491
+      line-height: 24px;
492
+  }
493
+
494
+  .prescriptionBox {
495
+      padding: 0 10px;
496
+      
497
+  }
498
+
499
+  .Rp {
500
+      font-size: 22px;
501
+      font-weight: bold;
502
+  }
503
+
504
+  .drugsBox {
505
+      padding-left: 40px;
506
+      margin-bottom: 10px;
507
+  }
508
+
509
+  .drugsBox p {
510
+      line-height: 30px;
511
+  }
512
+
513
+  .drugsOne {
514
+      line-height: 24px;
515
+  }
516
+
517
+  .drugsOne span {
518
+      margin-right: 20px;
519
+  }
520
+
521
+  .actionBar {
522
+      display: flex;
523
+      justify-content: space-between;
524
+      line-height: 24px;
525
+      padding: 0 10px;
526
+  }
527
+
528
+  .actionBar div {
529
+      width: 150px;
530
+  }
531
+</style>