Selaa lähdekoodia

8月2日杨青

杨青 1 vuosi sitten
vanhempi
commit
a492ad3bf2

+ 2 - 2
src/xt_pages/outpatientCharges/invoicePrint.vue Näytä tiedosto

@@ -33,12 +33,12 @@
33 33
       </div>
34 34
     </div>
35 35
 
36
-    <div class="app-container" style="" v-if="org_id == 10217 || org_id == 0">
36
+    <div class="app-container" style="" v-if="org_id == 10217 ">
37 37
       <div class='dialysisPage'>
38 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 ">
41
+    <div class="app-container" style="padding-top:40px;" v-if="org_id == 10375 || org_id == 0">
42 42
       <div class='dialysisPage'>
43 43
         <print-ten :paramsObj="invoiceParams"></print-ten>
44 44
       </div>

+ 224 - 224
src/xt_pages/outpatientCharges/invoiceTemplate/printSix.vue Näytä tiedosto

@@ -1,245 +1,245 @@
1
+
1 2
 <template>
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
-                        <span v-if="item.advice.id == 0">
23
-                            <span v-if="item.project.type == 2"> {{ item.project.project.project_name }}</span>
24
-                            <span v-if="item.project.type == 3">{{ item.project.good_info.good_name }}</span>
25
-                        </span>
26
-                        <span v-else>{{ item.advice.advice_name }}</span>
27
-                    </span>
28
-                    <span style="display:inline-block;width:50px;">
29
-                        <span v-if="item.advice.id == 0">
30
-                            <span v-if="item.project.type == 2">{{ item.project.count }}{{ item.project.unit }}</span>
31
-                            <span v-if="item.project.type == 3">{{ item.project.count }}{{ item.project.unit }}</span>
32
-                        </span>
33
-                        <span v-else>{{ item.advice.prescribing_number }}{{ item.advice.prescribing_number_unit }}</span>
34
-                    </span>
35
-                    <span>
36
-                        <span v-if="item.advice.id == 0">
37
-                            <span v-if="item.project.type == 2">{{ (item.project.count * item.pric).toFixed(2) }}</span>
38
-                            <span v-if="item.project.type == 3">{{ (item.project.count * item.pric).toFixed(2) }}</span>
39
-                        </span>
40
-                        <span v-else>{{ (item.advice.prescribing_number * item.pric).toFixed(2) }}</span>
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>
3
+  <div id='invoice-print' >
4
+    <div v-for='(i,index) in pageArr.length' :key="index" >
5
+      <div :style="{position: 'absolute',top:(0 + (index * 420))  + 'px',left:152+ 'px',}">盐城大丰悦达金骆驼血液透析中心</div>
6
+      <div :style="{position: 'absolute',top:(18 + (index * 420))  + 'px',left:117+ 'px',}">{{ list.order_number }}</div>
7
+      <div >
8
+          <div :style="{position: 'absolute',top:(38 + (index * 420))  + 'px',left:92+ 'px',}">{{ paramsObj.name }}</div>
9
+      </div>
10
+      <div :style="{position: 'absolute',top:(95 + (index * 420))  + 'px',left:76+ 'px',}">
11
+          <div v-if="list.westernMedicineCostTotal">西药 {{ list.westernMedicineCostTotal }}</div>
12
+          <div v-if="list.treatCostTotal">治疗费 {{ list.treatCostTotal }}</div>
13
+          <div v-if="list.bedCostTotal">床位费 {{ list.bedCostTotal }}</div>
14
+          <div v-if="list.chineseTraditionalMedicineCostTotal">中成药 {{ list.chineseTraditionalMedicineCostTotal }}</div>
15
+          <div v-if="list.laboratoryCostTotal">化验费 {{ list.laboratoryCostTotal }}</div>
16
+          <div v-if="list.operationCostTotal">手术费 {{ list.operationCostTotal }}</div>
17
+          <div v-if="list.otherCostTotal">其他费 {{ list.otherCostTotal }}</div>
18
+          <div v-if="list.materialCostTotal">材料费 {{ list.materialCostTotal }}</div>
19
+      </div>
20
+      <div :style="{position: 'absolute',top:(95 + (index * 420))  + 'px',left:270+ 'px'}">
21
+          <div v-for="item in list.order_info.slice(index * 10,(index * 10) + pageArr[index])">
22
+              <span style="display:inline-block;width:200px;">
23
+                  <span v-if="item.advice.id == 0">
24
+                      <span v-if="item.project.type == 2"> {{ item.project.project.project_name }}</span>
25
+                      <span v-if="item.project.type == 3">{{ item.project.good_info.good_name }}</span>
26
+                  </span>
27
+                  <span v-else>{{ item.advice.advice_name }}</span>
28
+              </span>
29
+              <span style="display:inline-block;width:50px;">
30
+                  <span v-if="item.advice.id == 0">
31
+                      <span v-if="item.project.type == 2">{{ item.project.count }}{{ item.project.unit }}</span>
32
+                      <span v-if="item.project.type == 3">{{ item.project.count }}{{ item.project.unit }}</span>
33
+                  </span>
34
+                  <span v-else>{{ item.advice.prescribing_number }}{{ item.advice.prescribing_number_unit }}</span>
35
+              </span>
36
+              <span>
37
+                  <span v-if="item.advice.id == 0">
38
+                      <span v-if="item.project.type == 2">{{ (item.project.count * item.pric).toFixed(2) }}</span>
39
+                      <span v-if="item.project.type == 3">{{ (item.project.count * item.pric).toFixed(2) }}</span>
40
+                  </span>
41
+                  <span v-else>{{ (item.advice.prescribing_number * item.pric).toFixed(2) }}</span>
42
+              </span>
43
+          </div>
44
+      </div>
45
+      <div :style="{position: 'absolute',top:(305 + (index * 420))  + 'px',left:121+ 'px'}">{{ zhongwen }}</div>
46
+      <div :style="{position: 'absolute',top:(305 + (index * 420))  + 'px',left:490+ 'px'}">{{ list.medfee_sumamt }}</div>
47
+      <div v-if="index == pageArr.length - 1" :style="{position: 'absolute',top:(320 + (index * 420))  + 'px',left:110+ 'px',width:100 + '%',fontSize:12+'px'}">
48
+          <div style="display:flex;">
49
+            <div style="width:140px">医疗总费用:{{ list.order.medfee_sumamt }}</div>
50
+            <div style="width:140px">基金支付总额:{{ list.order.fund_pay_sumamt }}</div>
51
+            <div style="width:140px">统筹支出:{{ list.order.hifp_pay }}</div>
52
+            <div style="width:140px">大病支出:{{list.order.hifmi_pay}}</div>
52 53
 
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>
54
+          </div>
55
+          <div style="display:flex;">
56
+            <div style="width:140px">个人账户支付:{{ list.order.acct_pay }}</div>
57
+            <div style="width:140px">现金支出:{{ list.order.psn_cash_pay }}</div>
58
+            <div style="width:140px">本次账户:0</div>
59
+            <div style="width:140px">上次账户:0</div>
60
+          </div>
61
+        <div style="display:flex;">
62
+          <div style="width:140px">账户余额:{{ list.order.balc }}</div>
63
+          <div style="width:140px">其他支出:{{ list.order.oth_pay }}</div>
64
+          <div style="width:140px">大病补充保险支出:0</div>
65
+          <div style="width:140px">民政支出:0</div>
66
+        </div>
67
+        <div style="display:flex;">
68
+          <div style="width:220px">医疗救助基金支出:{{ list.order.maf_pay }}</div>
69
+          <div style="width:280px">企业补充医疗保险基金支出:{{ list.order.hifes_pay }}</div>
70
+        </div>
70 71
 
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>
72
+      </div>
73
+      <div v-if="index != pageArr.length - 1">
74
+          <div :style="{position: 'absolute',top:(390 + (index * 420))  + 'px',left:140+ 'px'}">盐城大丰悦达金骆驼血液透析中心</div>
75
+          <div :style="{position: 'absolute',top:(390 + (index * 420))  + 'px',left:374+ 'px'}">{{ paramsObj.chargeName }}</div>
76
+          <div :style="{position: 'absolute',top:(390 + (index * 420))  + 'px',left:435+ 'px'}">
77
+              <span>{{  paramsObj.setl_time ? paramsObj.setl_time.split(' ')[0].slice(0,4) : getTime(list.date, '{y}-{m}-{d}').slice(0,4) }}</span>
78
+          </div>
79
+          <div :style="{position: 'absolute',top:(390 + (index * 420))  + 'px',left:479+ 'px'}">
80
+              <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(5,7)) : getTime(list.date, '{y}-{m}-{d}').slice(5,7) }}</span>
81
+          </div>
82
+          <div :style="{position: 'absolute',top:(390 + (index * 420))  + 'px',left:500+ 'px'}">
83
+              <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(8,11)) : getTime(list.date, '{y}-{m}-{d}').slice(8,11) }}</span>
84
+          </div>
85
+      </div>
86
+      <div v-if="index == pageArr.length - 1">
87
+        <div :style="{position: 'absolute',top:(390 + (index * 420))  + 'px',left:140+ 'px'}">盐城大丰悦达金骆驼血液透析中心</div>
88
+        <div :style="{position: 'absolute',top:(390 + (index * 420))  + 'px',left:374+ 'px'}">{{ paramsObj.chargeName }}</div>
89
+        <div :style="{position: 'absolute',top:(390 + (index * 420))  + 'px',left:435+ 'px'}">
90
+          <span>{{  paramsObj.setl_time ? paramsObj.setl_time.split(' ')[0].slice(0,4) : getTime(list.date, '{y}-{m}-{d}').slice(0,4) }}</span>
98 91
         </div>
99
-    </div>
92
+        <div :style="{position: 'absolute',top:(390 + (index * 420))  + 'px',left:479+ 'px'}">
93
+          <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(5,7)) : getTime(list.date, '{y}-{m}-{d}').slice(5,7) }}</span>
94
+        </div>
95
+        <div :style="{position: 'absolute',top:(390 + (index * 420))  + 'px',left:500+ 'px'}">
96
+          <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(8,11)) : getTime(list.date, '{y}-{m}-{d}').slice(8,11) }}</span>
97
+        </div>
98
+      </div>
99
+  </div>
100
+  </div>
100 101
 </template>
101 102
 
102
-
103 103
 <script>
104 104
 import { getInvoice } from '@/api/project/project'
105 105
 import { uParseTime } from '@/utils/tools'
106 106
 export default {
107
-    props:{
108
-        paramsObj:Object
109
-    },
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:[],
120
-        }
121
-    },
122
-    created(){
123
-        console.log('paramsObj',this.paramsObj)
124
-        let params = {
125
-            order_id: this.paramsObj.order_id,
126
-            patient_id: this.paramsObj.patient_id,
127
-        }
128
-        this.getInvoice(params)
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
136
-    },
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
-            }
107
+  props:{
108
+      paramsObj:Object
109
+  },
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:[],
120
+      }
121
+  },
122
+  created(){
123
+      console.log('paramsObj',this.paramsObj)
124
+      let params = {
125
+          order_id: this.paramsObj.order_id,
126
+          patient_id: this.paramsObj.patient_id,
127
+      }
128
+      this.getInvoice(params)
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
136
+  },
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 181
 
182
-            var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
183
-            n += "00";
182
+          var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
183
+          n += "00";
184 184
 
185
-            var indexpoint = n.indexOf('.');  // 如果是小数,截取小数点前面的位数
185
+          var indexpoint = n.indexOf('.');  // 如果是小数,截取小数点前面的位数
186 186
 
187
-            if (indexpoint >= 0){
187
+          if (indexpoint >= 0){
188 188
 
189
-                n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2);   // 若为小数,截取需要使用的unit单位
190
-            }
189
+              n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2);   // 若为小数,截取需要使用的unit单位
190
+          }
191 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
-            }
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 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
-            }
227
-        }
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
+          }
228 227
       }
228
+    }
229 229
 
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)
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 239
 
240
-            },
241
-            deep:true
242
-        }
243
-    }
240
+          },
241
+          deep:true
242
+      }
243
+  }
244 244
 }
245 245
 </script>

+ 113 - 101
src/xt_pages/outpatientCharges/invoiceTemplate/printTen.vue Näytä tiedosto

@@ -1,116 +1,128 @@
1 1
 <template>
2 2
   <div id='invoice-print' style="position: relative;">
3
-    <div style="border: 1px solid black;padding: 5px;width:600px;min-height:390px;">
4
-      <div style="display: flex;width: 575px;margin-bottom: 5px; position: absolute; top: 70px;left: 522px;">
3
+    
4
+      <div style="display: flex;width: 575px;margin-bottom: 5px; position: relative;left: 506px;">
5 5
         {{printDate}}
6 6
       </div>
7
-      <div style="display: flex; justify-content: space-between;width: 573px;">
8
-        <div style="position: absolute;top: 85px;">
9
-          <span>{{paramsObj.name}}</span>
10
-          <span></span>
11
-          <span style="margin-left: 60px;" v-if="list.gender == 1">女</span>
12
-          <span style="margin-left: 60px;" v-else-if="list.gender == 2">男</span>
13
-
14
-          <span></span>
7
+      
8
+        <div style="display: flex; justify-content: space-between;width: 573px;border: 1px solid black; position: relative;padding: 5px;">
9
+          <div >
10
+            <span>姓名:{{paramsObj.name}}</span>
11
+            <span style="margin-left: 60px;">性别:</span>
12
+            <span style="" v-if="list.gender == 1">女</span>
13
+            <span style="" v-else-if="list.gender == 2">男</span>
14
+          </div>
15
+          <div>
16
+            <span style="margin-right: 60px;">NO:</span>
17
+          </div>
15 18
         </div>
16
-        <div style="position: absolute;top: 85px;left: 351px;">
17
-          <span style="margin-right: 60px;"></span>
19
+        <div style="display: flex;justify-content: space-around;width: 573px;  padding: 5px;border-left: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;">
20
+          <div>项目</div>
21
+          <div>金额</div>
22
+          <div>项目</div>
23
+          <div>金额</div>
24
+          <div>项目</div>
25
+          <div>金额</div>
18 26
         </div>
19
-      </div>
20
-      <div style="display:flex;justify-content: space-between;">
21
-        <div style="position: absolute;top:120px;left:80px">西药费</div>
22
-        <div style="position: absolute;top:120px;left:171px">{{ list.westernMedicineCostTotal ? list.westernMedicineCostTotal.toFixed(2) : '' }}</div>
23
-        <div style="position: absolute;top:120px;left:262px">检查费</div>
24
-        <div style="position: absolute;top:120px;left:353px">{{ list.checkCostTotal ? list.checkCostTotal.toFixed(2) : '' }}</div>
25
-        <div style="position: absolute;top:120px;left:444px">治疗费</div>
26
-        <div style="position: absolute;top:120px;left:535px">{{ list.treatCostTotal ? list.treatCostTotal.toFixed(2) : '' }}</div>
27
-      </div>
27
+        <div style="border: 1px solid black; border-top: none; width: 573px;min-height: 220px;">
28
+          <div style="display:flex;justify-content: space-around;">
29
+            
30
+            <div style="">西药费</div>
31
+            <div style="">{{ list.westernMedicineCostTotal ? list.westernMedicineCostTotal.toFixed(2) : '' }}</div>
32
+            <div style="">检查费</div>
33
+            <div style="">{{ list.checkCostTotal ? list.checkCostTotal.toFixed(2) : '' }}</div>
34
+            <div style="">治疗费</div>
35
+            <div style="position:  relative;left: 16px;">{{ list.treatCostTotal ? list.treatCostTotal.toFixed(2) : '' }}</div>
36
+          </div>
28 37
 
29
-      <div style="display:flex;justify-content: space-between;">
30
-        <div style="position: absolute;top:140px;left:80px">床位费</div>
31
-        <div style="position: absolute;top:140px;left:171px">{{ list.bedCostTotal ? list.bedCostTotal.toFixed(2) : '' }}</div>
32
-        <div style="position: absolute;top:140px;left:262px">中成药</div>
33
-        <div style="position: absolute;top:140px;left:353px">{{ list.chineseTraditionalMedicineCostTotal ? list.chineseTraditionalMedicineCostTotal.toFixed(2) : '' }}</div>
34
-        <div style="position: absolute;top:140px;left:444px">化验费</div>
35
-        <div style="position: absolute;top:140px;left:535px">{{ list.laboratoryCostTotal ? list.laboratoryCostTotal.toFixed(2) : '' }}</div>
36
-      </div>
38
+          <div style="display:flex;justify-content: space-around;">
39
+           
40
+            <div style="">床位费</div>
41
+            <div style="">{{ list.bedCostTotal ? list.bedCostTotal.toFixed(2) : '' }}</div>
42
+            <div style="position:  relative;left: -15px;">中成药</div>
43
+            <div style="">{{ list.chineseTraditionalMedicineCostTotal ? list.chineseTraditionalMedicineCostTotal.toFixed(2) : '' }}</div>
44
+            <div style="position:  relative;left: -16px;">化验费</div>
45
+            <div style="">{{ list.laboratoryCostTotal ? list.laboratoryCostTotal.toFixed(2) : '' }}</div>
46
+          </div>
37 47
 
38
-      <div style="display:flex;justify-content: space-between;">
39
-        <div style="position: absolute;top:160px;left:80px">手术费</div>
40
-        <div style="position: absolute;top:160px;left:171px">{{ list.operationCostTotal ? list.operationCostTotal.toFixed(2) : '' }}</div>
41
-        <div style="position: absolute;top:160px;left:262px">中成药</div>
42
-        <div style="position: absolute;top:160px;left:353px">{{ list.chineseTraditionalMedicineCostTotal ? list.chineseTraditionalMedicineCostTotal.toFixed(2) : '' }}</div>
43
-        <div style="position: absolute;top:160px;left:444px">其他费</div>
44
-        <div style="position: absolute;top:160px;left:535px">{{ list.otherCostTotal ? list.otherCostTotal.toFixed(2) : '' }}</div>
45
-      </div>
48
+          <div style="display:flex;justify-content: space-around;">
49
+            <div style="">手术费</div>
50
+            <div style="">{{ list.operationCostTotal ? list.operationCostTotal.toFixed(2) : '' }}</div>
51
+            <div style="position:  relative;left: -15px;">中成药</div>
52
+            <div style="">{{ list.chineseTraditionalMedicineCostTotal ? list.chineseTraditionalMedicineCostTotal.toFixed(2) : '' }}</div>
53
+            <div style="position:  relative;left: -16px;">其他费</div>
54
+            <div style="">{{ list.otherCostTotal ? list.otherCostTotal.toFixed(2) : '' }}</div>
55
+          </div>
46 56
 
47
-      <div style="display:flex;justify-content: space-between;">
48
-        <div style="position: absolute;top:180px;left:80px">诊察费</div>
49
-        <div style="position: absolute;top:180px;left:171px">{{ list.zhenChaCostTotal ? list.zhenChaCostTotal.toFixed(2) : '' }}</div>
50
-        <div style="position: absolute;top:180px;left:262px">材料费</div>
51
-        <div style="position: absolute;top:180px;left:353px">{{ list.materialCostTotal ? list.materialCostTotal.toFixed(2) : '' }}</div>
52
-      </div>
53
-
54
-      <div>
55
-        <span>
56
-        <span  style="position: absolute;top:230px;left:120px">
57
-          <span v-if="zhongwen.indexOf('万') > -1 && zhongwen.indexOf('拾') > -1 && zhongwen.indexOf('拾') == 1">
58
-                      {{ zhongwen.substring(0,1) }}
59
-                  </span>
60
-                  <span v-else>零</span>
57
+          <div style="display:flex;justify-content: space-around;">
58
+            <div style="position:  relative;left: -24px;">诊察费</div>
59
+            <div style="position:  relative;left: -75px;">{{ list.zhenChaCostTotal ? list.zhenChaCostTotal.toFixed(2) : '' }}</div>
60
+            <div style="position:  relative;left: -115px;">材料费</div>
61
+            <div style="position:  relative;left: -169px;">{{ list.materialCostTotal ? list.materialCostTotal.toFixed(2) : '' }}</div>
62
+          </div>
63
+        </div>
64
+        <div style="border: 1px solid black;border-top:none;padding: 5px;width: 573px;">
65
+          
66
+          <div style="border-right: 1px solid black;display: inline-block;width: 360px;">
67
+            <span>合计(大写):</span>
68
+            <span  style="">
69
+              <span v-if="zhongwen.indexOf('万') > -1 && zhongwen.indexOf('拾') > -1 && zhongwen.indexOf('拾') == 1">
70
+                          {{ zhongwen.substring(0,1) }}
71
+                      </span>
72
+                      <span v-else>零</span>
61 73
 
62
-        </span>
63
-        <span  style="position: absolute;top:230px;left:140px">
64
-            <span v-if="zhongwen.indexOf('万') > -1">
65
-                      {{ zhongwen.substring(zhongwen.indexOf('万') - 1,zhongwen.indexOf('万')) }}
66
-                  </span>
67
-                  <span v-else>零</span>
74
+            </span>
75
+            <span  style="">
76
+                <span v-if="zhongwen.indexOf('万') > -1">
77
+                          {{ zhongwen.substring(zhongwen.indexOf('万') - 1,zhongwen.indexOf('万')) }}
78
+                      </span>
79
+                      <span v-else>零</span>
68 80
 
69
-        </span>
70
-        <span  style="position: absolute;top:230px;left:160px">
71
-          <span v-if="zhongwen.indexOf('仟') > -1">
72
-                      {{ zhongwen.substring(zhongwen.indexOf('仟') - 1,zhongwen.indexOf('仟')) }}
73
-                  </span>
74
-                  <span v-else>零</span>
81
+            </span>
82
+            <span  style="">
83
+              <span v-if="zhongwen.indexOf('仟') > -1">
84
+                          {{ zhongwen.substring(zhongwen.indexOf('仟') - 1,zhongwen.indexOf('仟')) }}
85
+                      </span>
86
+                      <span v-else>零</span>
75 87
 
76
-        </span>
77
-        <span  style="position: absolute;top:230px;left:180px">
78
-            <span v-if="zhongwen.indexOf('佰') > -1">
79
-                      {{ zhongwen.substring(zhongwen.indexOf('佰') - 1,zhongwen.indexOf('佰')) }}
80
-                  </span>
81
-                  <span v-else>零</span>
88
+            </span>
89
+            <span  style="">
90
+                <span v-if="zhongwen.indexOf('佰') > -1">
91
+                          {{ zhongwen.substring(zhongwen.indexOf('佰') - 1,zhongwen.indexOf('佰')) }}
92
+                      </span>
93
+                      <span v-else>零</span>
82 94
 
83
-        </span>
84
-        <span style="position: absolute;top:230px;left:200px">
85
-            <span v-if="zhongwen.indexOf('拾') > -1">
86
-                      {{zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾')) == '佰' ||  !zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾'))? '壹' : zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾')) }}
87
-                  </span>
88
-                  <span v-else>零</span>
95
+            </span>
96
+            <span style="">
97
+                <span v-if="zhongwen.indexOf('拾') > -1">
98
+                          {{zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾')) == '佰' ||  !zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾'))? '壹' : zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾')) }}
99
+                      </span>
100
+                      <span v-else>零</span>
89 101
 
90
-        </span>
91
-        <span  style="position: absolute;top:230px;left:220px">
92
-            <span v-if="zhongwen.indexOf('元') > -1 && zhongwen.substring(this.zhongwen.indexOf('元') - 1).substring(0,1)!= '拾'">
93
-                      {{ zhongwen.substring(zhongwen.indexOf('元') - 1,zhongwen.indexOf('元')) }}
94
-                  </span>
95
-                  <span v-else>零</span>
96
-        </span>
97
-        <span  style="position: absolute;top:230px;left:240px">
98
-            <span v-if="zhongwen.indexOf('角') > -1">
99
-                      {{ zhongwen.substring(zhongwen.indexOf('角') - 1,zhongwen.indexOf('角')) }}
100
-                  </span>
101
-                  <span v-else>零</span>
102
-        </span>
103
-        <span  style="position: absolute;top:230px;left:260px">
104
-          <span v-if="zhongwen.indexOf('分') > -1">
105
-                      {{ zhongwen.substring(zhongwen.indexOf('分') - 1,zhongwen.indexOf('分')) }}
106
-                  </span>
107
-                  <span v-else>零</span>
108
-        </span>
109
-        </span>
110
-        <span style="position: absolute;top:230px;left:450px">¥:{{totalPrice.toFixed(2)}}</span>
111
-      </div>
112
-
113
-      <div style="border-bottom: 1px solid black;position: absolute;top:250px;left:110;width:573px;font-Size:12px">
102
+            </span>
103
+            <span  style="">
104
+                <span v-if="zhongwen.indexOf('元') > -1 && zhongwen.substring(this.zhongwen.indexOf('元') - 1).substring(0,1)!= '拾'">
105
+                          {{ zhongwen.substring(zhongwen.indexOf('元') - 1,zhongwen.indexOf('元')) }}
106
+                      </span>
107
+                      <span v-else>零</span>
108
+            </span>
109
+            <span  style="">
110
+                <span v-if="zhongwen.indexOf('角') > -1">
111
+                          {{ zhongwen.substring(zhongwen.indexOf('角') - 1,zhongwen.indexOf('角')) }}
112
+                      </span>
113
+                      <span v-else>零</span>
114
+            </span>
115
+            <span  style="">
116
+              <span v-if="zhongwen.indexOf('分') > -1">
117
+                          {{ zhongwen.substring(zhongwen.indexOf('分') - 1,zhongwen.indexOf('分')) }}
118
+                      </span>
119
+                      <span v-else>零</span>
120
+            </span>
121
+          </div>
122
+          <span style="position: relative;top:0px;left:0px">¥:{{totalPrice.toFixed(2)}}</span>
123
+        </div>
124
+      
125
+      <div style="border-bottom: 1px solid black;width:573px;font-Size:12px">
114 126
         <div  style="display:flex;margin: 3px 0px;">
115 127
           <div style="width:140px">医保:门慢统筹:{{list.order.hifp_pay}}</div>
116 128
           <div style="width:140px">大病保险:{{list.order.hifmi_pay}}</div>
@@ -123,7 +135,7 @@
123 135
           <div style="width:140px">个账余额:{{list.order.balc}}</div>
124 136
         </div>
125 137
       </div>
126
-      <div style="position: absolute;top:290px;left:110;width:573px;font-Size:12px">
138
+      <div style="width:573px;font-Size:12px">
127 139
         <div style="display:flex;margin: 3px 0px;">
128 140
           <div style="width:140px">现金支付:{{list.order.psn_cash_pay}}</div>
129 141
           <div style="width:140px">预存扣减:</div>
@@ -134,7 +146,7 @@
134 146
           <div style="width:140px">收款人:{{list.admin_user_name}}</div>
135 147
         </div>
136 148
       </div>
137
-    </div>
149
+   
138 150
   </div>
139 151
 </template>
140 152
 <script>

+ 1 - 1
src/xt_pages/outpatientDoctorStation/treatTemplate/printOne.vue Näytä tiedosto

@@ -40,7 +40,7 @@
40 40
                 <div style="width:100%;">诊断:{{getDiagnosis(item.info.diagnosis)}}</div>
41 41
             </div>
42 42
 
43
-            <div class="prescriptionBox" style="min-height: 425px;">
43
+            <div class="prescriptionBox" style="min-height: 420px;">
44 44
                 <table style="width:100%;text-align:center;line-height:25px;">
45 45
                     <tr>
46 46
                         <td>序号</td>