Browse Source

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

csx 3 years ago
parent
commit
ee6237fc53
32 changed files with 655 additions and 191 deletions
  1. 31 0
      src/api/supply.js
  2. 4 1
      src/router/modules/supply.js
  3. 1 1
      src/xt_pages/dialysis/components/consumablesDialog.vue
  4. 1 1
      src/xt_pages/dialysis/details/dialog/AssessmentAfterDislysis.vue
  5. 1 1
      src/xt_pages/hospitalStation/summary.vue
  6. 1 1
      src/xt_pages/medicalScheduling/index.vue
  7. 18 9
      src/xt_pages/outpatientCharges/invoiceTemplate/printFour.vue
  8. 1 1
      src/xt_pages/outpatientCharges/statementPrint.vue
  9. 6 1
      src/xt_pages/outpatientDoctorStation/prescriptionTemplatedetail.vue
  10. 1 1
      src/xt_pages/qcd/treatmentControlAnalysis/components/CheckAll.vue
  11. 6 0
      src/xt_pages/role/admin.vue
  12. 8 9
      src/xt_pages/role/components/AdminInfoForm.vue
  13. 6 0
      src/xt_pages/stock/cancelStockOrder.vue
  14. 5 1
      src/xt_pages/stock/drugs/cancelDrugStockOrder.vue
  15. 5 0
      src/xt_pages/stock/drugs/drugBatchNumber.vue
  16. 4 1
      src/xt_pages/stock/drugs/drugQueryPrint.vue
  17. 5 0
      src/xt_pages/stock/drugs/drugStockInOrder.vue
  18. 10 6
      src/xt_pages/stock/drugs/drugStockOutOrder.vue
  19. 1 1
      src/xt_pages/stock/drugs/inventory.vue
  20. 7 2
      src/xt_pages/stock/drugs/query.vue
  21. 1 1
      src/xt_pages/stock/inventory.vue
  22. 6 12
      src/xt_pages/stock/stockBatchNumber.vue
  23. 10 0
      src/xt_pages/stock/stockInOrder.vue
  24. 29 0
      src/xt_pages/stock/stockInOrderAdd.vue
  25. 19 1
      src/xt_pages/stock/stockInOrderEdit.vue
  26. 6 0
      src/xt_pages/stock/stockOutOrder.vue
  27. 2 0
      src/xt_pages/stock/stockPrint.vue
  28. 7 2
      src/xt_pages/stock/stockQuery.vue
  29. 238 88
      src/xt_pages/supply/components/addPurchaseOrder.vue
  30. 144 43
      src/xt_pages/supply/purchaseOrderQuery.vue
  31. 22 4
      src/xt_pages/supply/supplyQuery.vue
  32. 49 3
      src/xt_pages/workforce/components/tableData.vue

+ 31 - 0
src/api/supply.js View File

8
   })
8
   })
9
 }
9
 }
10
 
10
 
11
+export function savePurchaseOrder(data, supplier_name, start_time, end_time, rate_of_concession, discount_amount) {
12
+  return request({
13
+    url: '/api/supply/savepurchaseorder?supplier_name=' + supplier_name + '&start_time=' + start_time + '&end_time=' + end_time + '&rate_of_concession=' + rate_of_concession + '&discount_amount=' + discount_amount,
14
+    method: 'post',
15
+    data: data
16
+  })
17
+}
18
+
19
+export function getAllSupply(params) {
20
+  return request({
21
+    url: '/api/supply/getallsupply',
22
+    method: 'get',
23
+    params: params
24
+  })
25
+}
26
+
27
+export function getAllPurchaseOrderList(params) {
28
+  return request({
29
+    url: '/api/supply/getallpurchaseorderlist',
30
+    method: 'get',
31
+    params: params
32
+  })
33
+}
34
+
35
+export function updatePurchaseOrder(data, supplier_name, start_time, end_time, rate_of_concession, discount_amount, id, number) {
36
+  return request({
37
+    url: '/api/supply/updatepurchaseorder?supplier_name=' + supplier_name + '&start_time=' + start_time + '&end_time=' + end_time + '&rate_of_concession=' + rate_of_concession + '&discount_amount=' + discount_amount + '&id=' + id + '&number=' + number,
38
+    method: 'post',
39
+    data: data
40
+  })
41
+}

+ 4 - 1
src/router/modules/supply.js View File

37
       path: '/purchase/order/add',
37
       path: '/purchase/order/add',
38
       component: () => import('@/xt_pages/supply/components/addPurchaseOrder'),
38
       component: () => import('@/xt_pages/supply/components/addPurchaseOrder'),
39
       name: 'addPurchaseOrder',
39
       name: 'addPurchaseOrder',
40
-      meta: { title: 'addPurchaseOrder', noCache: true }
40
+      meta: { title: 'addPurchaseOrder', noCache: true },
41
+      hidden: true,
42
+      is_menu: false,
43
+      isChild: true
41
     }
44
     }
42
   ]
45
   ]
43
 }
46
 }

+ 1 - 1
src/xt_pages/dialysis/components/consumablesDialog.vue View File

155
                   this.tableData.push(response.data.data.list[i])
155
                   this.tableData.push(response.data.data.list[i])
156
                }
156
                }
157
              }
157
              }
158
-             console.log("表哥22222222222",this.tableData) 
158
+            
159
           })
159
           })
160
        },
160
        },
161
 
161
 

+ 1 - 1
src/xt_pages/dialysis/details/dialog/AssessmentAfterDislysis.vue View File

432
         <el-row :gutter="20"> -->
432
         <el-row :gutter="20"> -->
433
 
433
 
434
         <el-col :span="8" v-if="isShow('实际置换量')">
434
         <el-col :span="8" v-if="isShow('实际置换量')">
435
-          <el-form-item v-if="this.template_id == 20 || this.template_id == 21" label="实际置换量(ml): ">
435
+          <el-form-item v-if="this.template_id == 20 || this.template_id == 21 || this.template_id == 13" label="实际置换量(ml): ">
436
             <el-input v-model="form.actual_displacement"></el-input>
436
             <el-input v-model="form.actual_displacement"></el-input>
437
           </el-form-item>
437
           </el-form-item>
438
           <el-form-item v-else label="实际置换量(L): ">
438
           <el-form-item v-else label="实际置换量(L): ">

+ 1 - 1
src/xt_pages/hospitalStation/summary.vue View File

566
         }
566
         }
567
       },
567
       },
568
       toPrint(row) {
568
       toPrint(row) {
569
-        if (this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10028 || (scope.row.order_status == 2 && $store.getters.xt_user.org_id == 10138)) {
569
+        if (this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10028 || (scope.row.order_status == 2 && $store.getters.xt_user.org_id == 10138) || (scope.row.order_status == 2 && $store.getters.xt_user.org_id == 10278)) {
570
           this.statementVisible9504 = true
570
           this.statementVisible9504 = true
571
           let obj = {
571
           let obj = {
572
             order_id: row.id,
572
             order_id: row.id,

+ 1 - 1
src/xt_pages/medicalScheduling/index.vue View File

956
                     
956
                     
957
                     this.tableData = data
957
                     this.tableData = data
958
 
958
 
959
-                   console.log("表哥3333333333",this.tableData)
959
+              
960
                 }
960
                 }
961
             })
961
             })
962
         },
962
         },

+ 18 - 9
src/xt_pages/outpatientCharges/invoiceTemplate/printFour.vue View File

15
             <div></div>
15
             <div></div>
16
             <div  style="position: absolute;top:70px;left:240px">{{ list.number }}</div>
16
             <div  style="position: absolute;top:70px;left:240px">{{ list.number }}</div>
17
             <div  style="position: absolute;left:470px;top:70px;">
17
             <div  style="position: absolute;left:470px;top:70px;">
18
-                <span>{{ printDate.slice(0,4) }}</span>
18
+                <span>{{  paramsObj.setl_time ? paramsObj.setl_time.split(' ')[0].slice(0,4) : getTime(list.date, '{y}-{m}-{d}').slice(0,4) }}</span>
19
             </div>
19
             </div>
20
             <div  style="position: absolute;left:530px;top:70px;">
20
             <div  style="position: absolute;left:530px;top:70px;">
21
-                <span>{{ parseInt(printDate.slice(5,7)) }}</span>
21
+                <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(5,7)) : getTime(list.date, '{y}-{m}-{d}').slice(5,7) }}</span>
22
             </div>
22
             </div>
23
             <div  style="position: absolute;left:560px;top:70px;">
23
             <div  style="position: absolute;left:560px;top:70px;">
24
-                <span>{{ parseInt(printDate.slice(8,11)) }}</span>
24
+                <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(8,11)) : getTime(list.date, '{y}-{m}-{d}').slice(8,11) }}</span>
25
             </div>
25
             </div>
26
         </div>
26
         </div>
27
         <div style="display:flex;justify-content: space-between;">
27
         <div style="display:flex;justify-content: space-between;">
28
             <div style="position: absolute;top:85px;left:100px;"> {{ paramsObj.name }}</div>
28
             <div style="position: absolute;top:85px;left:100px;"> {{ paramsObj.name }}</div>
29
             <div style="position: absolute;top:85px;left:180px;">√</div>
29
             <div style="position: absolute;top:85px;left:180px;">√</div>
30
             <!-- <div>{{ list.pay_way }}</div> -->
30
             <!-- <div>{{ list.pay_way }}</div> -->
31
-            <div style="position: absolute;top:85px;left:380px;">{{ paramsObj.setl_time.split(' ')[0] }}</div>
32
-            <div style="position: absolute;top:85px;left:530px;">{{ paramsObj.setl_time.split(' ')[0] }}</div>
31
+            <div style="position: absolute;top:85px;left:380px;">{{ printDate }}</div>
32
+            <div style="position: absolute;top:85px;left:530px;">{{ printDate }}</div>
33
         </div>
33
         </div>
34
         <div style="display:flex;justify-content: space-between;">
34
         <div style="display:flex;justify-content: space-between;">
35
             <!-- <div>{{ paramsObj.gend == 1 ? '男' : '女' }}</div> -->
35
             <!-- <div>{{ paramsObj.gend == 1 ? '男' : '女' }}</div> -->
36
             <div v-if="paramsObj.gend == 1" style="position: absolute;top:110px;left:100px;">√</div>
36
             <div v-if="paramsObj.gend == 1" style="position: absolute;top:110px;left:100px;">√</div>
37
             <div v-else style="position: absolute;top:110px;left:140px;">√</div>
37
             <div v-else style="position: absolute;top:110px;left:140px;">√</div>
38
-            <div style="position: absolute;top:110px;left:260px;">{{ (totalPrice - list.psn_cash_money).toFixed(2) }}</div>
39
-            <div style="position: absolute;top:110px;left:420px;">{{ list.psn_cash_money.toFixed(2) }}</div>
38
+            <div style="position: absolute;top:110px;left:260px;">{{ list.number.length <= 13 ? (totalPrice - list.psn_cash_money).toFixed(2) : '0.00' }}</div>
39
+            <div style="position: absolute;top:110px;left:420px;">{{ list.number.length <= 13 ? list.psn_cash_money.toFixed(2) : (totalPrice - list.psn_cash_money).toFixed(2) }}</div>
40
             <div style="position: absolute;top:110px;left:540px;">现金</div>
40
             <div style="position: absolute;top:110px;left:540px;">现金</div>
41
         </div>
41
         </div>
42
         <div style="display:flex;justify-content: space-between;">
42
         <div style="display:flex;justify-content: space-between;">
99
                 </span>
99
                 </span>
100
                 <span v-else>零</span>
100
                 <span v-else>零</span>
101
             </span>
101
             </span>
102
-            <span  style="position: absolute;top:235px;left:280px">
102
+            <span  style="position: absolute;top:235px;left:290px">
103
                 <span v-if="zhongwen.indexOf('佰') > -1">
103
                 <span v-if="zhongwen.indexOf('佰') > -1">
104
                     {{ zhongwen.substring(zhongwen.indexOf('佰') - 1,zhongwen.indexOf('佰')) }}
104
                     {{ zhongwen.substring(zhongwen.indexOf('佰') - 1,zhongwen.indexOf('佰')) }}
105
                 </span>
105
                 </span>
143
 
143
 
144
 <script>
144
 <script>
145
 import { getInvoice } from '@/api/project/project'
145
 import { getInvoice } from '@/api/project/project'
146
+import { uParseTime } from '@/utils/tools'
146
 export default {
147
 export default {
147
     props:{
148
     props:{
148
         paramsObj:Object
149
         paramsObj:Object
231
             this.zhongwen =  str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
232
             this.zhongwen =  str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
232
             console.log(this.zhongwen)
233
             console.log(this.zhongwen)
233
         },
234
         },
234
-
235
+        getTime(value, temp) {
236
+            if (value == 0) {
237
+                return ''
238
+            }
239
+            if (value != undefined) {
240
+                return uParseTime(value, temp)
241
+            }
242
+            return ''
243
+        },
235
     },
244
     },
236
     watch:{
245
     watch:{
237
         paramsObj:{//深度监听,可监听到对象、数组的变化
246
         paramsObj:{//深度监听,可监听到对象、数组的变化

+ 1 - 1
src/xt_pages/outpatientCharges/statementPrint.vue View File

79
       this.print_time = uParseTime(ptime, "{y}-{m}-{d} {h}:{i}");
79
       this.print_time = uParseTime(ptime, "{y}-{m}-{d} {h}:{i}");
80
 
80
 
81
 
81
 
82
-      if(this.$store.getters.xt_user.org_id == 10138 || this.$store.getters.xt_user.org_id == 0 || this.$store.getters.xt_user.org_id == 4){
82
+      if(this.$store.getters.xt_user.org_id == 10138 || this.$store.getters.xt_user.org_id == 0 || this.$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 10278){
83
         setTimeout(() => {
83
         setTimeout(() => {
84
           const style =
84
           const style =
85
           '@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;font-size:16px;}@media print {html {zoom: 47%;}}}';
85
           '@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;font-size:16px;}@media print {html {zoom: 47%;}}}';

+ 6 - 1
src/xt_pages/outpatientDoctorStation/prescriptionTemplatedetail.vue View File

129
                                                 <template slot-scope="scope">{{ scope.row.drug_name }}</template>
129
                                                 <template slot-scope="scope">{{ scope.row.drug_name }}</template>
130
                                             </el-table-column>
130
                                             </el-table-column>
131
                                             <el-table-column label="规格" width="60">
131
                                             <el-table-column label="规格" width="60">
132
-                                                <template slot-scope="scope">{{ scope.row.drug_spec }}</template>
132
+                                                <template slot-scope="scope">
133
+                                                  <!-- {{ scope.row.drug_spec }} -->
134
+                                                   <span
135
+                                                       v-if="scope.row.min_unit != scope.row.dose_unit">{{ scope.row.dose }}{{ scope.row.dose_unit }}&nbsp;* &nbsp;</span>
136
+                                                       {{ scope.row.min_number }}{{ scope.row.min_unit }}/{{ scope.row.max_unit }}
137
+                                                  </template>
133
                                             </el-table-column>
138
                                             </el-table-column>
134
                                             <el-table-column label="单价" width="40">
139
                                             <el-table-column label="单价" width="40">
135
                                                 <template slot-scope="scope">{{ scope.row.retail_price }}</template>
140
                                                 <template slot-scope="scope">{{ scope.row.retail_price }}</template>

+ 1 - 1
src/xt_pages/qcd/treatmentControlAnalysis/components/CheckAll.vue View File

264
               }
264
               }
265
               this.tableData.push({ name: key, data: dd[key]});
265
               this.tableData.push({ name: key, data: dd[key]});
266
             }
266
             }
267
-            console.log("表哥",this.tableData)
267
+       
268
             let projectArr = []
268
             let projectArr = []
269
           
269
           
270
             this.newArr.map(item => {
270
             this.newArr.map(item => {

+ 6 - 0
src/xt_pages/role/admin.vue View File

44
           min-width="160"
44
           min-width="160"
45
           align="center"
45
           align="center"
46
         ></el-table-column>
46
         ></el-table-column>
47
+        <el-table-column label="医保医师编码" prop="doctor_number" min-width="160" align="center">
48
+          <template slot-scope="scope">
49
+            <span v-if="scope.row.doctor_number== 0"></span>
50
+            <span v-if="scope.row.doctor_number!= 0">{{scope.row.doctor_number}}</span>
51
+          </template>
52
+        </el-table-column>
47
         <el-table-column
53
         <el-table-column
48
           label="最后登录IP"
54
           label="最后登录IP"
49
           prop="ip"
55
           prop="ip"

+ 8 - 9
src/xt_pages/role/components/AdminInfoForm.vue View File

68
       </el-form-item>
68
       </el-form-item>
69
     </el-col>
69
     </el-col>
70
    </el-row>
70
    </el-row>
71
+   <el-row :span="24">
72
+      <el-col :span="8">
73
+       <el-form-item label="医保医师编码:">
74
+        <el-input v-model="form.doctor_number"></el-input>
75
+       </el-form-item>
76
+    </el-col>
77
+   </el-row>
71
   
78
   
72
   <div v-show="show">
79
   <div v-show="show">
73
    <el-row :span="24">
80
    <el-row :span="24">
343
 
350
 
344
 
351
 
345
   <el-row :gutter="24">
352
   <el-row :gutter="24">
346
-    <el-col :span="8">
347
-       <el-form-item label="医保医师编码:">
348
-         
349
-        <el-input v-model="form.doctor_number"></el-input>
350
-       </el-form-item>
351
-    </el-col>
353
+   
352
      <el-col :span="8">
354
      <el-col :span="8">
353
        <el-form-item label="门诊大病类别:" label-width="130px">
355
        <el-form-item label="门诊大病类别:" label-width="130px">
354
             <el-select v-model="form.outpatient_illnessCategory" placeholder="门诊大病类别">
356
             <el-select v-model="form.outpatient_illnessCategory" placeholder="门诊大病类别">
1063
         })
1065
         })
1064
       },
1066
       },
1065
       changeRole(arr){
1067
       changeRole(arr){
1066
-        console.log("arr",arr)
1067
-        console.log("roles",this.roles)
1068
         var varName = []
1068
         var varName = []
1069
         for(let i=0;i<this.roles.length;i++){
1069
         for(let i=0;i<this.roles.length;i++){
1070
           for(let j=0;j<arr.length;j++){
1070
           for(let j=0;j<arr.length;j++){
1073
              }
1073
              }
1074
           }
1074
           }
1075
         }
1075
         }
1076
-        console.log("33333",varName)
1077
         this.form.role_type = 1
1076
         this.form.role_type = 1
1078
         var ids = varName.join(";")
1077
         var ids = varName.join(";")
1079
         console.log("valee22222",ids)
1078
         console.log("valee22222",ids)

+ 6 - 0
src/xt_pages/stock/cancelStockOrder.vue View File

186
             </template>
186
             </template>
187
           </el-table-column>
187
           </el-table-column>
188
 
188
 
189
+           <el-table-column label="国家编码" align="center">
190
+            <template slot-scope="scope">
191
+              {{scope.row.GoodInfo.social_security_directory_code}}
192
+            </template>
193
+          </el-table-column>
194
+
189
           <el-table-column label="退库数量" align="center">
195
           <el-table-column label="退库数量" align="center">
190
             <template slot-scope="scope">
196
             <template slot-scope="scope">
191
               {{ scope.row.count}}{{scope.row.GoodInfo.packing_unit}}
197
               {{ scope.row.count}}{{scope.row.GoodInfo.packing_unit}}

+ 5 - 1
src/xt_pages/stock/drugs/cancelDrugStockOrder.vue View File

182
                 {{ scope.row.BaseDrugLib.dose}}{{scope.row.BaseDrugLib.dose_unit}} * {{scope.row.BaseDrugLib.min_number}}{{scope.row.BaseDrugLib.min_unit}} /{{scope.row.BaseDrugLib.max_unit}}
182
                 {{ scope.row.BaseDrugLib.dose}}{{scope.row.BaseDrugLib.dose_unit}} * {{scope.row.BaseDrugLib.min_number}}{{scope.row.BaseDrugLib.min_unit}} /{{scope.row.BaseDrugLib.max_unit}}
183
               </template>
183
               </template>
184
             </el-table-column>
184
             </el-table-column>
185
-          
185
+            <el-table-column label="国家编码" align="center">
186
+              <template slot-scope="scope">
187
+                {{ scope.row.BaseDrugLib.medical_insurance_number}}
188
+              </template>
189
+            </el-table-column>
186
             <el-table-column label="退库数量" align="center">
190
             <el-table-column label="退库数量" align="center">
187
               <template slot-scope="scope">
191
               <template slot-scope="scope">
188
                 {{ scope.row.count}}
192
                 {{ scope.row.count}}

+ 5 - 0
src/xt_pages/stock/drugs/drugBatchNumber.vue View File

79
              {{scope.row.warehousing_count}}{{scope.row.max_unit}}
79
              {{scope.row.warehousing_count}}{{scope.row.max_unit}}
80
            </template>
80
            </template>
81
         </el-table-column>
81
         </el-table-column>
82
+        <el-table-column prop="drug_name" label="零售价" align="center">
83
+           <template slot-scope="scope">
84
+              {{scope.row.retail_price}}
85
+           </template>
86
+        </el-table-column>
82
         <el-table-column prop="drug_name" label="进货单价" align="center">
87
         <el-table-column prop="drug_name" label="进货单价" align="center">
83
            <template slot-scope="scope">
88
            <template slot-scope="scope">
84
               {{scope.row.price}}
89
               {{scope.row.price}}

+ 4 - 1
src/xt_pages/stock/drugs/drugQueryPrint.vue View File

18
               <td style="line-height: 50px" width="100">药品类型</td>
18
               <td style="line-height: 50px" width="100">药品类型</td>
19
               <td style="line-height: 50px" width="150">药品名称</td>
19
               <td style="line-height: 50px" width="150">药品名称</td>
20
               <td style="line-height: 50px" width="150">规格型号&单位</td>
20
               <td style="line-height: 50px" width="150">规格型号&单位</td>
21
+              <td style="line-height: 50px" width="150">国家编码</td>
21
               <td style="line-height: 50px" width="100">进货单价</td>
22
               <td style="line-height: 50px" width="100">进货单价</td>
22
               <td  style="line-height: 50px" width="200">厂家</td>
23
               <td  style="line-height: 50px" width="200">厂家</td>
23
               <td style="line-height: 50px" width="80">入库数量</td>
24
               <td style="line-height: 50px" width="80">入库数量</td>
38
               <td style="line-height: 50px">
39
               <td style="line-height: 50px">
39
                    <span> {{item.dose + item.dose_unit +"*"+item.min_number+item.min_unit+"/"+item.max_unit}}</span>
40
                    <span> {{item.dose + item.dose_unit +"*"+item.min_number+item.min_unit+"/"+item.max_unit}}</span>
40
               </td>
41
               </td>
41
-             
42
+             <td style="line-height: 50px">
43
+                  <span>{{item.medical_insurance_number }}</span>
44
+              </td>
42
               <td style="line-height: 50px">
45
               <td style="line-height: 50px">
43
                   <span>{{item.last_price }}</span>
46
                   <span>{{item.last_price }}</span>
44
               </td>
47
               </td>

+ 5 - 0
src/xt_pages/stock/drugs/drugStockInOrder.vue View File

189
           <template slot-scope="scope">
189
           <template slot-scope="scope">
190
             {{scope.row.drug.dose}}&nbsp;{{scope.row.drug.dose_unit}}*{{scope.row.drug.min_number}}{{scope.row.drug.min_unit}}/{{scope.row.drug.max_unit}}
190
             {{scope.row.drug.dose}}&nbsp;{{scope.row.drug.dose_unit}}*{{scope.row.drug.min_number}}{{scope.row.drug.min_unit}}/{{scope.row.drug.max_unit}}
191
           </template>
191
           </template>
192
+        </el-table-column>
193
+          <el-table-column label="国家编码" align="center">
194
+          <template slot-scope="scope">
195
+            {{scope.row.drug.medical_insurance_number}}
196
+          </template>
192
         </el-table-column>
197
         </el-table-column>
193
         <el-table-column label="批号" align="center">
198
         <el-table-column label="批号" align="center">
194
           <template slot-scope="scope">
199
           <template slot-scope="scope">

+ 10 - 6
src/xt_pages/stock/drugs/drugStockOutOrder.vue View File

211
               {{scope.row.dose}}&nbsp;{{scope.row.dose_unit}}*{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
211
               {{scope.row.dose}}&nbsp;{{scope.row.dose_unit}}*{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
212
             </template>
212
             </template>
213
           </el-table-column>
213
           </el-table-column>
214
-         
214
+          <el-table-column label="国家编码" align="center">
215
+            <template slot-scope="scope">
216
+              {{scope.row.medical_insurance_number}}
217
+            </template>
218
+          </el-table-column>
215
           <el-table-column label="出库数量" align="center">
219
           <el-table-column label="出库数量" align="center">
216
             <template slot-scope="scope">
220
             <template slot-scope="scope">
217
               <!-- <span v-if="scope.row.is_sys ==  0">{{getTotalCount(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span> -->
221
               <!-- <span v-if="scope.row.is_sys ==  0">{{getTotalCount(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span> -->
223
               {{scope.row.price}}
227
               {{scope.row.price}}
224
             </template>
228
             </template>
225
           </el-table-column>
229
           </el-table-column>
226
-          <el-table-column label="拆零零售价" align="center">
230
+          <!-- <el-table-column label="拆零零售价" align="center">
227
             <template slot-scope="scope">
231
             <template slot-scope="scope">
228
-              {{scope.row.min_price}}
232
+              {{scope.row.retail_price}}
229
             </template>
233
             </template>
230
-          </el-table-column>
234
+          </el-table-column> -->
231
           <el-table-column label="总价" align="center">
235
           <el-table-column label="总价" align="center">
232
             <template slot-scope="scope">
236
             <template slot-scope="scope">
233
               <span>{{getAllPriceOne(scope.row.drug_id,scope.row.price,scope.row.min_price).toFixed(2)}}</span>
237
               <span>{{getAllPriceOne(scope.row.drug_id,scope.row.price,scope.row.min_price).toFixed(2)}}</span>
1188
           }
1192
           }
1189
         }
1193
         }
1190
         const tHeader = ['药品名称','药品类型','规格&单位', '批号','出库数量','出货单价','拆零零售价','总价','生产厂家','生产日期','有效日期','经销商','批准文号','备注']
1194
         const tHeader = ['药品名称','药品类型','规格&单位', '批号','出库数量','出货单价','拆零零售价','总价','生产厂家','生产日期','有效日期','经销商','批准文号','备注']
1191
-        const filterVal = ['drug_name','drug_type','unit','batch_number', 'count','price','min_price','total_price','manufacturer','product_date','expiry_date','dealer','number','remark']
1195
+        const filterVal = ['drug_name','drug_type','unit','batch_number', 'count','price','retail_price','total_price','manufacturer','product_date','expiry_date','dealer','number','remark']
1192
 
1196
 
1193
         // console.log("table",this.exportList)
1197
         // console.log("table",this.exportList)
1194
          
1198
          
1212
               total += this.drugFlowList[i].count
1216
               total += this.drugFlowList[i].count
1213
           }
1217
           }
1214
         }
1218
         }
1215
-        all_price = total * min_price
1219
+        all_price = total * price
1216
       
1220
       
1217
         return  all_price
1221
         return  all_price
1218
       },
1222
       },

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

72
              <el-table-column prop="name" label="盘点后数量" width="180"  align="center">
72
              <el-table-column prop="name" label="盘点后数量" width="180"  align="center">
73
                 <template slot-scope="scope">
73
                 <template slot-scope="scope">
74
                   <el-input style="width:50px" v-model="scope.row.last_stock_max_number"></el-input>{{scope.row.max_unit}}
74
                   <el-input style="width:50px" v-model="scope.row.last_stock_max_number"></el-input>{{scope.row.max_unit}}
75
-                 <span v-if="scope.row.XtBaseDrug.max_unit!=scope.row.XtBaseDrug.min_unit"><el-input style="width:50px" v-model="scope.row.last_stock_min_number" :disabled="true"></el-input>{{scope.row.min_unit}}</span> 
75
+                 <span v-if="scope.row.XtBaseDrug.max_unit!=scope.row.XtBaseDrug.min_unit"><el-input style="width:50px" v-model="scope.row.last_stock_min_number"></el-input>{{scope.row.min_unit}}</span> 
76
                  </template> 
76
                  </template> 
77
               </el-table-column>
77
               </el-table-column>
78
 
78
 

+ 7 - 2
src/xt_pages/stock/drugs/query.vue View File

94
            <template slot-scope="scope">
94
            <template slot-scope="scope">
95
              {{scope.row.dose + scope.row.dose_unit +"*"+scope.row.min_number+scope.row.min_unit+"/"+scope.row.max_unit}}
95
              {{scope.row.dose + scope.row.dose_unit +"*"+scope.row.min_number+scope.row.min_unit+"/"+scope.row.max_unit}}
96
            </template>
96
            </template>
97
+        </el-table-column>
98
+        <el-table-column prop="drug_name" label="国家编码" align="center">
99
+           <template slot-scope="scope">
100
+             {{scope.row.medical_insurance_number}}
101
+           </template>
97
         </el-table-column>
102
         </el-table-column>
98
          <el-table-column prop="drug_name" label="进货单价" align="center">
103
          <el-table-column prop="drug_name" label="进货单价" align="center">
99
            <template slot-scope="scope">
104
            <template slot-scope="scope">
482
           }   
487
           }   
483
          }
488
          }
484
          import('@/vendor/Export2Excel').then(excel => {
489
          import('@/vendor/Export2Excel').then(excel => {
485
-         const tHeader = ['序号', '药品类型', '药品名称','规格型号&单位','进货单价','厂家','入库数量','出库数量','剩余库存量']
486
-         const filterVal = ['index', 'drug_type_name', 'drug_name','unit','last_price','manufacturer_name','inCount','outCount','overplusCount']
490
+         const tHeader = ['序号', '药品类型', '药品名称','规格型号&单位','国家编码','进货单价','厂家','入库数量','出库数量','剩余库存量']
491
+         const filterVal = ['index', 'drug_type_name', 'drug_name','unit','medical_insurance_number','last_price','manufacturer_name','inCount','outCount','overplusCount']
487
 
492
 
488
 
493
 
489
          const data = this.formatJson(filterVal, this.tableList)
494
          const data = this.formatJson(filterVal, this.tableList)

+ 1 - 1
src/xt_pages/stock/inventory.vue View File

100
           v-model="form.drug_name"
100
           v-model="form.drug_name"
101
           :fetch-suggestions="querySearchAsync"
101
           :fetch-suggestions="querySearchAsync"
102
           :trigger-on-focus="true"
102
           :trigger-on-focus="true"
103
-          placeholder="请输入药品名称"
103
+          placeholder="请输入耗材名称"
104
           @select="handleSelect"
104
           @select="handleSelect"
105
           style="width:300px;"
105
           style="width:300px;"
106
           v-show="showTableOne"
106
           v-show="showTableOne"

+ 6 - 12
src/xt_pages/stock/stockBatchNumber.vue View File

38
               value-format="yyyy-MM-dd"
38
               value-format="yyyy-MM-dd"
39
               @change="endTimeChange"
39
               @change="endTimeChange"
40
           ></el-date-picker>
40
           ></el-date-picker>
41
-
42
-        <!-- <span>出入库方式:</span>
43
-        <el-select v-model="stock_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
44
-            <el-option
45
-              v-for="(item,index) in stockType"
46
-              :key="index"
47
-              :label="item.name"
48
-              :value="item.id">
49
-            </el-option>
50
-        </el-select> -->
51
-        
52
-        
41
+  
53
       </div>
42
       </div>
54
       
43
       
55
        <el-table
44
        <el-table
93
              <span> {{scope.row.price}}</span>
82
              <span> {{scope.row.price}}</span>
94
            </template>
83
            </template>
95
         </el-table-column>
84
         </el-table-column>
85
+         <el-table-column prop="drug_name" label="零售价" align="center">
86
+           <template slot-scope="scope">
87
+             <span v-if="scope.row.packing_price > 0"> {{scope.row.packing_price}}</span>
88
+           </template>
89
+        </el-table-column>
96
        </el-table>
90
        </el-table>
97
        
91
        
98
       <el-pagination
92
       <el-pagination

+ 10 - 0
src/xt_pages/stock/stockInOrder.vue View File

193
             {{ scope.row.GoodInfo.specification_name}} / {{scope.row.GoodInfo.packing_unit}}
193
             {{ scope.row.GoodInfo.specification_name}} / {{scope.row.GoodInfo.packing_unit}}
194
           </template>
194
           </template>
195
         </el-table-column>
195
         </el-table-column>
196
+        <el-table-column label="国家编码" align="center">
197
+          <template slot-scope="scope">
198
+            {{ scope.row.GoodInfo.social_security_directory_code}}
199
+          </template>
200
+        </el-table-column>
196
         <el-table-column label="批号" align="center">
201
         <el-table-column label="批号" align="center">
197
           <template slot-scope="scope">
202
           <template slot-scope="scope">
198
             {{ scope.row.number}}
203
             {{ scope.row.number}}
203
             {{ scope.row.warehousing_count}}{{scope.row.GoodInfo.packing_unit}}
208
             {{ scope.row.warehousing_count}}{{scope.row.GoodInfo.packing_unit}}
204
           </template>
209
           </template>
205
         </el-table-column>
210
         </el-table-column>
211
+         <!-- <el-table-column label="零售价" align="center">
212
+          <template slot-scope="scope">
213
+            {{ scope.row.packing_price}}
214
+          </template>
215
+        </el-table-column> -->
206
         <el-table-column label="进货价" align="center">
216
         <el-table-column label="进货价" align="center">
207
           <template slot-scope="scope">
217
           <template slot-scope="scope">
208
             {{ scope.row.price}}
218
             {{ scope.row.price}}

+ 29 - 0
src/xt_pages/stock/stockInOrderAdd.vue View File

107
             
107
             
108
             </template>
108
             </template>
109
           </el-table-column>
109
           </el-table-column>
110
+        
111
+          <el-table-column align="center" width="120">
112
+            <template slot="header" slot-scope="scope">
113
+              <span>零售价<span style="color: red">*</span></span>
114
+            </template>
115
+            <template slot-scope="scope">
116
+            
117
+              <el-form-item :prop="'recordData.' + scope.$index + '.packing_price'" :rules='tableRules.packing_price'
118
+                            style="padding-top: 20px">
119
+                <el-input placeholder="请输入单价" type="number" v-model="scope.row.packing_price"></el-input>
120
+              </el-form-item>
110
 
121
 
122
+
123
+            </template>
124
+          </el-table-column>
111
           <el-table-column align="center" width="120">
125
           <el-table-column align="center" width="120">
112
             <template slot="header" slot-scope="scope">
126
             <template slot="header" slot-scope="scope">
113
               <span>进货单价<span style="color: red">*</span></span>
127
               <span>进货单价<span style="color: red">*</span></span>
285
           price: [
299
           price: [
286
             { required: true, message: '单价不能为空', trigger: 'blur' }
300
             { required: true, message: '单价不能为空', trigger: 'blur' }
287
           ],
301
           ],
302
+          packing_price: [
303
+            { required: true, message: '零售价不能为空', trigger: 'blur' }
304
+          ],
288
           warehousing_count: [
305
           warehousing_count: [
289
             { required: true, message: '数量不能为空', trigge: 'blur' }
306
             { required: true, message: '数量不能为空', trigge: 'blur' }
290
           ],
307
           ],
511
         tempObj['specification_name'] = ''
528
         tempObj['specification_name'] = ''
512
         tempObj['name'] = ''
529
         tempObj['name'] = ''
513
         tempObj['license_number'] = ""
530
         tempObj['license_number'] = ""
531
+        tempObj["packing_price"] = ""
514
         this.recordInfo.recordData.push(tempObj)
532
         this.recordInfo.recordData.push(tempObj)
515
       }, handleDelete: function(index, row) {
533
       }, handleDelete: function(index, row) {
516
         if (this.recordInfo.recordData.length <= 1) {
534
         if (this.recordInfo.recordData.length <= 1) {
642
       }
660
       }
643
       ,
661
       ,
644
       submit() {
662
       submit() {
663
+        console.log("res23322332",this.$refs)
645
         this.$refs['tableForm'].validate((valid) => {
664
         this.$refs['tableForm'].validate((valid) => {
646
           if (valid) {
665
           if (valid) {
647
             const array = this.recordInfo.recordData
666
             const array = this.recordInfo.recordData
652
                 return
671
                 return
653
               }
672
               }
654
               array[i].price = array[i].price.toString()
673
               array[i].price = array[i].price.toString()
674
+              array[i].packing_price = array[i].packing_price.toString()
655
             }
675
             }
656
 
676
 
657
             if(this.recordInfo.recordData.length <= 0){
677
             if(this.recordInfo.recordData.length <= 0){
755
         this.currentIndex = val
775
         this.currentIndex = val
756
       },
776
       },
757
       handleSelect(val){
777
       handleSelect(val){
778
+         console.log("val3232232323",val)
758
          for(let i=0;i<this.recordInfo.recordData.length;i++){
779
          for(let i=0;i<this.recordInfo.recordData.length;i++){
759
            if(this.currentIndex == i){
780
            if(this.currentIndex == i){
760
               this.recordInfo.recordData[i].good_type_id = val.id
781
               this.recordInfo.recordData[i].good_type_id = val.id
764
               this.recordInfo.recordData[i].number =  val.number
785
               this.recordInfo.recordData[i].number =  val.number
765
               this.recordInfo.recordData[i].manufacturer = val.manufacturer
786
               this.recordInfo.recordData[i].manufacturer = val.manufacturer
766
               this.recordInfo.recordData[i].remark = val.remark
787
               this.recordInfo.recordData[i].remark = val.remark
788
+           
767
               if(val.buy_price == 0){
789
               if(val.buy_price == 0){
768
                this.recordInfo.recordData[i].price = ""
790
                this.recordInfo.recordData[i].price = ""
769
               }else{
791
               }else{
770
                 this.recordInfo.recordData[i].price = val.buy_price
792
                 this.recordInfo.recordData[i].price = val.buy_price
771
               }
793
               }
794
+
795
+              if(val.packing_price == 0){
796
+               this.recordInfo.recordData[i].packing_price = ""
797
+              }else{
798
+                this.recordInfo.recordData[i].packing_price = val.packing_price
799
+              }
772
               
800
               
773
               this.recordInfo.recordData[i].specification_name = val.specification_name
801
               this.recordInfo.recordData[i].specification_name = val.specification_name
774
               this.recordInfo.recordData[i].good_id = val.id
802
               this.recordInfo.recordData[i].good_id = val.id
811
       tempObj['specification_name'] = ''
839
       tempObj['specification_name'] = ''
812
       tempObj['name'] = ''
840
       tempObj['name'] = ''
813
       tempObj['license_number'] = ''
841
       tempObj['license_number'] = ''
842
+      tempObj['packing_price']= ''
814
       this.recordInfo.recordData.push(tempObj)
843
       this.recordInfo.recordData.push(tempObj)
815
       this.GetConfigInfo()
844
       this.GetConfigInfo()
816
       this.propForm.goodUnit = this.$store.getters.good_unit
845
       this.propForm.goodUnit = this.$store.getters.good_unit

+ 19 - 1
src/xt_pages/stock/stockInOrderEdit.vue View File

122
               </el-form-item>
122
               </el-form-item>
123
             </template>
123
             </template>
124
           </el-table-column>
124
           </el-table-column>
125
+          <el-table-column align="center" width="120">
126
+            <template slot="header" slot-scope="scope">
127
+              <span>零售价<span style="color: red">*</span></span>
128
+            </template>
129
+            <template slot-scope="scope">
130
+            
131
+              <el-form-item :prop="'recordData.' + scope.$index + '.packing_price'" :rules='tableRules.packing_price'
132
+                            style="padding-top: 20px">
133
+                <el-input placeholder="请输入单价" type="number" v-model="scope.row.packing_price"></el-input>
134
+              </el-form-item>
135
+
125
 
136
 
137
+            </template>
138
+          </el-table-column>
126
           <el-table-column align="center" width="120">
139
           <el-table-column align="center" width="120">
127
             <template slot="header" slot-scope="scope">
140
             <template slot="header" slot-scope="scope">
128
-              <span>单价<span style="color: red">*</span></span>
141
+              <span>进货价<span style="color: red">*</span></span>
129
             </template>
142
             </template>
130
             <template slot-scope="scope">
143
             <template slot-scope="scope">
131
               <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
144
               <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
340
       },
353
       },
341
       tableRules: {
354
       tableRules: {
342
         price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
355
         price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
356
+        packing_price: [
357
+          { required: true, message: '零售价不能为空', trigger: 'blur' }
358
+        ],
343
         warehousing_count: [
359
         warehousing_count: [
344
           { required: true, message: "数量不能为空", trigge: "blur" }
360
           { required: true, message: "数量不能为空", trigge: "blur" }
345
         ],
361
         ],
482
       tempObj["dealer"] = "";
498
       tempObj["dealer"] = "";
483
       tempObj["manufacturer"] = "";
499
       tempObj["manufacturer"] = "";
484
       tempObj["license_number"] = ""
500
       tempObj["license_number"] = ""
501
+      tempObj["packing_price"] = ""
485
       this.recordInfo.recordData.push(tempObj);
502
       this.recordInfo.recordData.push(tempObj);
486
     },
503
     },
487
     handleDelete: function(index, row) {
504
     handleDelete: function(index, row) {
608
          
625
          
609
           for(let i=0;i<this.recordInfo.recordData.length;i++){
626
           for(let i=0;i<this.recordInfo.recordData.length;i++){
610
             this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
627
             this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
628
+             this.recordInfo.recordData[i].packing_price = this.recordInfo.recordData[i].packing_price.toString()
611
              if(this.recordInfo.recordData[i].dealer == ""){
629
              if(this.recordInfo.recordData[i].dealer == ""){
612
                 this.recordInfo.recordData[i].dealer = 0
630
                 this.recordInfo.recordData[i].dealer = 0
613
              }
631
              }

+ 6 - 0
src/xt_pages/stock/stockOutOrder.vue View File

191
               {{ scope.row.specification_name}} / {{scope.row.packing_unit}}
191
               {{ scope.row.specification_name}} / {{scope.row.packing_unit}}
192
             </template>
192
             </template>
193
           </el-table-column>
193
           </el-table-column>
194
+
195
+          <el-table-column label="国家编码" align="center">
196
+            <template slot-scope="scope">
197
+              {{ scope.row.social_security_directory_code}}
198
+            </template>
199
+          </el-table-column>
194
          
200
          
195
           <el-table-column label="出库数量" align="center">
201
           <el-table-column label="出库数量" align="center">
196
             <template slot-scope="scope">
202
             <template slot-scope="scope">

+ 2 - 0
src/xt_pages/stock/stockPrint.vue View File

27
                                     <td width="80">耗材类型</td>
27
                                     <td width="80">耗材类型</td>
28
                                     <td width="80">耗材名称</td>
28
                                     <td width="80">耗材名称</td>
29
                                     <td width="80">规格&单位</td>
29
                                     <td width="80">规格&单位</td>
30
+                                    <td width="80">国家编码</td>
30
                                     <td width="80">进货单价</td>
31
                                     <td width="80">进货单价</td>
31
                                     <td width="80">生产商</td>
32
                                     <td width="80">生产商</td>
32
                                     <td width="80">入库数量</td>
33
                                     <td width="80">入库数量</td>
39
                                    <td>{{getGoodType(item.good_type_id)}}</td>
40
                                    <td>{{getGoodType(item.good_type_id)}}</td>
40
                                    <td>{{item.good_name }}</td>
41
                                    <td>{{item.good_name }}</td>
41
                                    <td><span>{{item.specification_name }} / {{item.packing_unit}}</span></td>
42
                                    <td><span>{{item.specification_name }} / {{item.packing_unit}}</span></td>
43
+                                   <td>{{item.social_security_directory_code}}</td>
42
                                    <td>{{item.buy_price}}</td>
44
                                    <td>{{item.buy_price}}</td>
43
                                    <td>{{getManufacture(item.manufacturer)}}</td>
45
                                    <td>{{getManufacture(item.manufacturer)}}</td>
44
                                    <td>
46
                                    <td>

+ 7 - 2
src/xt_pages/stock/stockQuery.vue View File

91
               <span>{{ scope.row.specification_name }} / {{scope.row.packing_unit}}</span>
91
               <span>{{ scope.row.specification_name }} / {{scope.row.packing_unit}}</span>
92
             </template>
92
             </template>
93
          </el-table-column>
93
          </el-table-column>
94
+         <el-table-column label="国家编码" align="center">
95
+            <template slot-scope="scope">
96
+              <span>{{ scope.row.social_security_directory_code}}</span>
97
+            </template>
98
+         </el-table-column>
94
         <el-table-column label="进货单价" align="center">
99
         <el-table-column label="进货单价" align="center">
95
           <template slot-scope="scope">
100
           <template slot-scope="scope">
96
              {{scope.row.buy_price}}
101
              {{scope.row.buy_price}}
353
     exportList(){
358
     exportList(){
354
          import('@/vendor/Export2Excel').then(excel => {
359
          import('@/vendor/Export2Excel').then(excel => {
355
 
360
 
356
-         const tHeader = ['耗材类型', '耗材名称', '规格&单位','进货单价','生产商','入库数量','出库数量','库存剩余量']
357
-         const filterVal = ['type_name', 'good_name', 'unit','buy_price','prodect_name','inCount','outCount','overplus']
361
+         const tHeader = ['耗材类型', '耗材名称', '规格&单位','国家编码','进货单价','生产商','入库数量','出库数量','库存剩余量']
362
+         const filterVal = ['type_name', 'good_name', 'unit','social_security_directory_code','buy_price','prodect_name','inCount','outCount','overplus']
358
 
363
 
359
 
364
 
360
          for(let i=0;i<this.tableList.length;i++){
365
          for(let i=0;i<this.tableList.length;i++){

+ 238 - 88
src/xt_pages/supply/components/addPurchaseOrder.vue View File

3
 <div class="position">
3
 <div class="position">
4
     <bread-crumb :crumbs="crumbs"></bread-crumb>
4
     <bread-crumb :crumbs="crumbs"></bread-crumb>
5
 </div>
5
 </div>
6
-<div class="app-container ">
6
+<div class="app-container"  v-loading="loading">
7
     <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
7
     <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8
     <div>
8
     <div>
9
+        <span style="color:red">*</span><span>供应商:</span>
9
         <el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择"
10
         <el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择"
10
         @change="changeTypeName">
11
         @change="changeTypeName">
11
         <el-option
12
         <el-option
15
             :value="item.id">
16
             :value="item.id">
16
         </el-option>
17
         </el-option>
17
         </el-select>
18
         </el-select>
19
+        <span>单据日期:</span>
18
         <el-date-picker
20
         <el-date-picker
19
         size="small"
21
         size="small"
20
         v-model="start_time"
22
         v-model="start_time"
27
         format="yyyy-MM-dd"
29
         format="yyyy-MM-dd"
28
         value-format="yyyy-MM-dd"
30
         value-format="yyyy-MM-dd"
29
         @change="startTimeChange"
31
         @change="startTimeChange"
30
-        ></el-date-picker>-
32
+        ></el-date-picker>
33
+        <span>交货日期:</span>
31
         <el-date-picker
34
         <el-date-picker
32
             size="small"
35
             size="small"
33
             v-model="end_time"
36
             v-model="end_time"
41
             value-format="yyyy-MM-dd"
44
             value-format="yyyy-MM-dd"
42
             @change="endTimeChange"
45
             @change="endTimeChange"
43
         ></el-date-picker>
46
         ></el-date-picker>
44
-        <el-input
45
-        size="small"
46
-        style="width: 200px;margin-left:10px;"
47
-        class="filter-item"
48
-        v-model.trim="keywords"
49
-        placeholder="耗材名称"
50
-        />
51
-        <el-button
52
-        size="small"
53
-        class="filter-item"
54
-        type="primary"
55
-        icon="el-icon-search"
56
-        @click="search"
57
-        >搜索</el-button
58
-        >
47
+        <span>单据编码:{{number}}</span>
48
+
59
     </div>
49
     </div>
60
     <div>
50
     <div>
61
-        <el-button size="small" type="primary" @click="savePurchaseOrder">保存</el-button>
51
+        <el-button size="small" type="primary" @click="savePurchaseOrder" v-show="showTwo">保存</el-button>
52
+        <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">打印</el-button>
53
+        <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">审核</el-button>
54
+        <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">修改</el-button>
62
     </div>
55
     </div>
63
     </div>
56
     </div>
64
 
57
 
65
-
58
+   <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
66
     <el-table
59
     <el-table
67
     :row-style="{ color: '#303133' }"
60
     :row-style="{ color: '#303133' }"
68
     :header-cell-style="{
61
     :header-cell-style="{
69
         backgroundColor: 'rgb(245, 247, 250)',
62
         backgroundColor: 'rgb(245, 247, 250)',
70
         color: '#606266'
63
         color: '#606266'
71
     }"
64
     }"
72
-    :data="tableList"
65
+    :data="recordInfo.tableList"
73
     :class="signAndWeighBoxPatients"
66
     :class="signAndWeighBoxPatients"
74
     border
67
     border
75
     style="width: 100%"
68
     style="width: 100%"
76
     max-height="450"
69
     max-height="450"
77
     >
70
     >
78
-    <el-table-column label="商品" align="center" width="200px">
71
+    <el-table-column align="center" width="200px">
72
+        <template slot="header" slot-scope="scope">
73
+            <span>商品<span style="color: red">*</span></span>
74
+        </template>
79
         <template slot-scope="scope">
75
         <template slot-scope="scope">
76
+           <el-form-item :prop="'tableList.' + scope.$index + '.name'" :rules='tableRules.name'>
80
             <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)">
77
             <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)">
81
-            <el-option
82
-                v-for="(item,index) in tabList"
83
-                :key="index"
84
-                :label="item.supply_name"
85
-                :value="item">
86
-            </el-option>
87
-            </el-select>
78
+                <el-option
79
+                    v-for="(item,index) in tabList"
80
+                    :key="index"
81
+                    :label="item.supply_name"
82
+                    :value="item">
83
+                </el-option>
84
+             </el-select>
85
+           </el-form-item>
88
         </template>
86
         </template>
89
     </el-table-column>
87
     </el-table-column>
90
-    <el-table-column label="商品类别" align="center" width="150px">
88
+    <el-table-column  align="center" width="150px">
89
+        <template slot="header" slot-scope="scope">
90
+            <span>商品类别</span>
91
+        </template>
91
         <template slot-scope="scope">
92
         <template slot-scope="scope">
92
             <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
93
             <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
93
         </template>
94
         </template>
103
         </template>
104
         </template>
104
     </el-table-column>
105
     </el-table-column>
105
     <el-table-column label="数量" align="center" width="120px">
106
     <el-table-column label="数量" align="center" width="120px">
107
+        <template slot="header" slot-scope="scope">
108
+            <span>数量<span style="color: red">*</span></span>
109
+        </template>
106
         <template slot-scope="scope">
110
         <template slot-scope="scope">
107
-        <el-input v-model="scope.row.supply_count" style="width:80px"></el-input>
111
+          <el-form-item  :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
112
+             <el-input v-model="scope.row.supply_count" style="width:80px"></el-input>
113
+          </el-form-item>
108
         </template>
114
         </template>
109
     </el-table-column>
115
     </el-table-column>
110
 
116
 
119
           {{calculate(scope.row.supply_count * scope.row.supply_price)}}
125
           {{calculate(scope.row.supply_count * scope.row.supply_price)}}
120
         </template>
126
         </template>
121
     </el-table-column>
127
     </el-table-column>
122
-    
128
+
123
     <el-table-column label="生产厂商" align="center" width="200px">
129
     <el-table-column label="生产厂商" align="center" width="200px">
124
         <template slot-scope="scope">
130
         <template slot-scope="scope">
125
         <el-input v-model="scope.row.supply_manufacturer" style="width:160px" :disabled="true"></el-input>
131
         <el-input v-model="scope.row.supply_manufacturer" style="width:160px" :disabled="true"></el-input>
126
         </template>
132
         </template>
127
     </el-table-column>
133
     </el-table-column>
128
-    
134
+
129
 
135
 
130
     <el-table-column label="批准文号" align="center" width="200px">
136
     <el-table-column label="批准文号" align="center" width="200px">
131
         <template slot-scope="scope">
137
         <template slot-scope="scope">
161
         </template>
167
         </template>
162
     </el-table-column>
168
     </el-table-column>
163
   </el-table>
169
   </el-table>
164
-    
170
+</el-form>
171
+   <div style="margin-top:10px">
172
+      合计:{{getAllPrice()}} 元
173
+   </div>
174
+   <div style="margin-top:10px">
175
+        <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
176
+
177
+        <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
178
+
179
+    </div>
165
 </div>
180
 </div>
166
 </div>
181
 </div>
167
 </template>
182
 </template>
168
 
183
 
169
 <script>
184
 <script>
170
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
185
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
171
-
172
-import {getInitOrder} from "@/api/supply"
186
+import {uParseTime } from '@/utils/tools'
187
+import {getInitOrder,savePurchaseOrder,updatePurchaseOrder} from "@/api/supply"
173
 export default {
188
 export default {
174
 name: "addPurchaseOrder",
189
 name: "addPurchaseOrder",
175
 created() {
190
 created() {
193
 data() {
208
 data() {
194
 return {
209
 return {
195
     crumbs: [
210
     crumbs: [
196
-    { path: false, name: "购货订单" },
197
-    { path: "/spply/query", name: "新增购货订单" }
211
+       { path: false, name: "购货订单" },
212
+       { path: "/spply/query", name: "新增购货订单" }
198
     ],
213
     ],
214
+    showTwo:true,
215
+    showOne:false,
216
+    recordInfo: {
217
+      tableList:[],
218
+    },
199
     keywords: "",
219
     keywords: "",
200
     total: 0,
220
     total: 0,
201
     multipleSelection: [],
221
     multipleSelection: [],
208
     goodInfo: [],
228
     goodInfo: [],
209
     org_id:0,
229
     org_id:0,
210
     types:[],
230
     types:[],
211
-    tableList:[],
212
     tyep_name:"",
231
     tyep_name:"",
213
     form:{
232
     form:{
214
     manufacturer_id:"",
233
     manufacturer_id:"",
220
     drugTypeList:[],
239
     drugTypeList:[],
221
     supplier_name:"",
240
     supplier_name:"",
222
     supplyList:[],
241
     supplyList:[],
223
-};
242
+    rate_of_concession:"",
243
+    discount_amount:"",
244
+    start_time:new Date(),
245
+    end_time:new Date(),
246
+    tableRules: {
247
+     name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
248
+     supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
249
+   },
250
+   warehousing_id:0,
251
+   number:"",
252
+   loading:false,
253
+   drugList:[],
254
+   goodList:[],
255
+   id:0,
256
+  };
224
 },
257
 },
225
 methods:{
258
 methods:{
259
+
226
 getInitOrder(){
260
 getInitOrder(){
227
     getInitOrder().then(response=>{
261
     getInitOrder().then(response=>{
228
     if(response.data.state == 1){
262
     if(response.data.state == 1){
234
        for(let i=0;i<drugList.length;i++){
268
        for(let i=0;i<drugList.length;i++){
235
           for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
269
           for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
236
             drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
270
             drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
237
-          }   
271
+          }
238
         for(let j=0;j<this.manufactuerList.length;j++){
272
         for(let j=0;j<this.manufactuerList.length;j++){
239
             if(drugList[i].manufacturer == this.manufactuerList[j].id){
273
             if(drugList[i].manufacturer == this.manufactuerList[j].id){
240
                 drugList[i].manufacturer = this.manufactuerList[j].manufacturer_name
274
                 drugList[i].manufacturer = this.manufactuerList[j].manufacturer_name
241
             }
275
             }
242
-        }  
276
+        }
243
         for(let y=0;y<this.drugTypeList.length;y++){
277
         for(let y=0;y<this.drugTypeList.length;y++){
244
             if(drugList[i].drug_type == this.drugTypeList[y].value){
278
             if(drugList[i].drug_type == this.drugTypeList[y].value){
245
             drugList[i].drug_type = this.drugTypeList[y].name
279
             drugList[i].drug_type = this.drugTypeList[y].name
260
 
294
 
261
         this.tabList.push(drugList[i])
295
         this.tabList.push(drugList[i])
262
         }
296
         }
263
-        
297
+        this.drugList = drugList
264
         var goodList =  response.data.data.goodList
298
         var goodList =  response.data.data.goodList
265
         for(let i=0;i<goodList.length;i++){
299
         for(let i=0;i<goodList.length;i++){
266
         for(let j=0;j<this.manufactuerList.length;j++){
300
         for(let j=0;j<this.manufactuerList.length;j++){
267
             if(goodList[i].manufacturer == this.manufactuerList[j].id){
301
             if(goodList[i].manufacturer == this.manufactuerList[j].id){
268
                 goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
302
                 goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
269
             }
303
             }
270
-        }   
304
+        }
271
         for(let y=0;y<this.goodTypeList.length;y++){
305
         for(let y=0;y<this.goodTypeList.length;y++){
272
             if(goodList[i].good_type_id == this.goodTypeList[y].id){
306
             if(goodList[i].good_type_id == this.goodTypeList[y].id){
273
                 goodList[i].good_type_id = this.goodTypeList[y].type_name
307
                 goodList[i].good_type_id = this.goodTypeList[y].type_name
274
             }
308
             }
275
-        } 
309
+        }
276
         goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
310
         goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
277
         goodList[i].supply_type = goodList[i].good_type_id
311
         goodList[i].supply_type = goodList[i].good_type_id
278
         goodList[i].supply_specification_name =goodList[i].specification_name
312
         goodList[i].supply_specification_name =goodList[i].specification_name
283
         goodList[i].supply_manufacturer = goodList[i].manufacturer
317
         goodList[i].supply_manufacturer = goodList[i].manufacturer
284
         goodList[i].supply_license_number = ""
318
         goodList[i].supply_license_number = ""
285
         goodList[i].supply_remake = ""
319
         goodList[i].supply_remake = ""
286
-        goodList[i].type = 2   
320
+        goodList[i].type = 2
287
         goodList[i].name = goodList[i].good_name
321
         goodList[i].name = goodList[i].good_name
288
 
322
 
289
-        this.tabList.push(goodList[i]) 
323
+        this.tabList.push(goodList[i])
290
         }
324
         }
291
-    }
292
-    })  
325
+        this.goodList = goodList
326
+    } 
327
+    })
293
 },
328
 },
294
 changeGoodName(val){
329
 changeGoodName(val){
295
-    console.log("9媚23323232",val)  
296
-    this.currentIndex = val
330
+  this.currentIndex = val
297
 },
331
 },
298
 changeName(val){
332
 changeName(val){
299
-    console.log("val23322323",val)
300
-    
301
-    for(let i=0;i<this.tableList.length;i++){
333
+    //var obj = {"id":0,"name":"合计","supply_name":"","supply_type":"","supply_specification_name":"","supply_total":"","supply_count":"","supply_price":"","supply_total_price":"","supply_manufacturer":"","supply_license_number":"","supply_remake":"","is_total":2}
334
+   for(let i=0;i<this.recordInfo.tableList.length;i++){
302
     if(this.currentIndex == i){
335
     if(this.currentIndex == i){
303
-        this.tableList[i].id = val.id
304
-        this.tableList[i].type = val.type
305
-        this.tableList[i].name = val.name
306
-        this.tableList[i].supply_name = val.supply_name
307
-        this.tableList[i].supply_type = val.supply_type
308
-        this.tableList[i].supply_specification_name = val.supply_specification_name
309
-        this.tableList[i].supply_total = val.supply_total
310
-        this.tableList[i].supply_count = val.supply_count
311
-        this.tableList[i].supply_price = val.supply_price
312
-        this.tableList[i].supply_total_price = val.supply_total_price
313
-        this.tableList[i].supply_manufacturer = val.supply_manufacturer
314
-        this.tableList[i].supply_license_number = val.supply_license_number
315
-        this.tableList[i].supply_remake = val.supply_remake
316
-    }
336
+        this.recordInfo.tableList[i].id = val.id
337
+        this.recordInfo.tableList[i].type = val.type
338
+        this.recordInfo.tableList[i].name = val.name
339
+        this.recordInfo.tableList[i].supply_name = val.supply_name
340
+        this.recordInfo.tableList[i].supply_type = val.supply_type
341
+        this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name
342
+        this.recordInfo.tableList[i].supply_total = val.supply_total
343
+        if(val.supply_count == NaN){
344
+           this.recordInfo.tableList[i].supply_count = ""
345
+        }else{
346
+          this.recordInfo.tableList[i].supply_count = val.supply_count?val.supply_count:""
347
+        }
348
+
349
+        this.recordInfo.tableList[i].supply_price = val.supply_price?val.supply_price:""
350
+        this.recordInfo.tableList[i].supply_total_price = val.supply_total_price?val.supply_total_price:""
351
+        this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
352
+        this.recordInfo.tableList[i].supply_license_number = val.supply_license_number
353
+        this.recordInfo.tableList[i].supply_remake = val.supply_remake
354
+        this.recordInfo.tableList[i].is_total = val.is_total
355
+     }
317
     }
356
     }
318
-    console.log("表哥332322332232323",this.tableList)
357
+   
358
+
319
 },
359
 },
320
 handleEdit(){
360
 handleEdit(){
321
     const tempObj = {}
361
     const tempObj = {}
324
     tempObj['supply_name'] = ""
364
     tempObj['supply_name'] = ""
325
     tempObj['supply_type'] = ""
365
     tempObj['supply_type'] = ""
326
     tempObj['supply_specification_name'] = ''
366
     tempObj['supply_specification_name'] = ''
327
-    tempObj['supply_total'] = ''
328
-    tempObj['supply_count'] = ''
329
-    tempObj['supply_price'] = ''
330
-    tempObj['supply_total_price'] = ''
367
+    tempObj['supply_total'] = ""
368
+    tempObj['supply_count'] = ""
369
+    tempObj['supply_price'] = ""
370
+    tempObj['supply_total_price'] = ""
331
     tempObj['supply_manufacturer'] = ''
371
     tempObj['supply_manufacturer'] = ''
332
     tempObj['supply_license_number'] = ''
372
     tempObj['supply_license_number'] = ''
333
     tempObj['supply_remake'] = ''
373
     tempObj['supply_remake'] = ''
334
     tempObj['type'] = 0
374
     tempObj['type'] = 0
335
-    this.tableList.push(tempObj)  
375
+    tempObj['is_total'] = 1
376
+    this.recordInfo.tableList.push(tempObj)
336
 },
377
 },
337
 handleDelete: function(index, row) {
378
 handleDelete: function(index, row) {
338
-  if (this.tableList.length <= 1) {
379
+  if (this.recordInfo.tableList.length <= 1) {
339
         this.$message.error('只有一条记录的时候无法删除')
380
         this.$message.error('只有一条记录的时候无法删除')
340
         return
381
         return
341
    } else {
382
    } else {
342
-        this.tableList.splice(index, 1)
383
+        this.recordInfo.tableList.splice(index, 1)
343
    }
384
    }
344
 },
385
 },
386
+
387
+
345
 savePurchaseOrder(){
388
 savePurchaseOrder(){
346
-    console.log("param323322332",this.tableList)
347
-    savePurchaseOrder().then(response=>{
389
+    this.loading = true
390
+    if(this.supplier_name == 0 || this.supplier_name == ""){
391
+       this.$message.error("供应商不能为空!")
392
+       return false
393
+    }
394
+    this.$refs["tableForm"].validate((valid)=>{
395
+      if(valid){
396
+        for(let i=0;i<this.recordInfo.tableList.length;i++){
397
+            this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
398
+            this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
399
+            this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
400
+            for(let j=0;j<this.manufactuerList.length;j++){
401
+                if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
402
+                this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
403
+                }
404
+
405
+            }
406
+        }
407
+        var start = this.getTimes(this.start_time)
408
+        var end = this.getTimes(this.end_time)
409
+         const params = {
410
+            'stockIn': this.recordInfo.tableList
411
+         }
412
+       
413
+        savePurchaseOrder(params,this.supplier_name,start,end,this.rate_of_concession,this.discount_amount).then(response=>{
414
+            if(response.data.state == 1){
415
+                var order =  response.data.data.order
416
+                this.loading = false
417
+                this.$message.success("保存成功!")
418
+                var warehouseInfo = response.data.data.warehouseInfo
419
+                this.number  = warehouseInfo.number
420
+                this.id = warehouseInfo.id
421
+                this.recordInfo.tableList = []
422
+                var orderInfo = response.data.data.orderInfo
423
+                for(let i=0;i<orderInfo.length;i++){
424
+                  orderInfo[i].supply_count = orderInfo[i].count
425
+                  orderInfo[i].supply_price = orderInfo[i].price
426
+                  orderInfo[i].supply_remake = orderInfo[i].remark
427
+                }
428
+                console.log("orderINFO23323232",orderInfo)
429
+                this.recordInfo.tableList = orderInfo
430
+                // for(let i=0;i<orderInfo.length;i++){
431
+                //    orderInfo[i].name = "" 
432
+                //    orderInfo[i].supply_name = ""
433
+                //    orderInfo[i].supply_specification_name = ""
434
+                //   if(orderInfo[i].is_source == 1){
435
+                //     for(let j=0;j<this.drugList.length;j++){
436
+                //        if(orderInfo[i].project_id == this.drugList[j].id){
437
+                //           orderInfo[i].name = this.drugList[j].drug_name
438
+                //        }
439
+                //     }
440
+                //   }
441
+                //   if(orderInfo[i].is_source == 2){
442
+                //     for(let y=0;y<this.goodList.length;y++){
443
+                //        if(orderInfo[i].project_id = this.goodList[y].id){
444
+                //           orderInfo[i].name = this.goodList[y].good_name
445
+                //        }
446
+                //     }
447
+                //   }
448
+                // }
449
+                this.showTwo = false
450
+                this.showOne = true
451
+            }
452
+        })
453
+      }
454
+
455
+   })
348
 
456
 
349
-    })  
350
 },
457
 },
351
 
458
 
459
+
352
 changeTypeName(){
460
 changeTypeName(){
353
 
461
 
354
 },
462
 },
359
 
467
 
360
 },
468
 },
361
 search(){
469
 search(){
362
-    
470
+
363
 },
471
 },
364
 
472
 
365
 getWarehoseInfo(arr,max_unit,min_unit,min_number){
473
 getWarehoseInfo(arr,max_unit,min_unit,min_number){
387
     }
495
     }
388
   }
496
   }
389
  return max_str + min_str
497
  return max_str + min_str
390
- }, 
498
+ },
391
 getTotalStockCount(arr){
499
 getTotalStockCount(arr){
392
   var total_count = 0
500
   var total_count = 0
393
   for(let i=0;i<arr.length;i++){
501
   for(let i=0;i<arr.length;i++){
404
     }
512
     }
405
     return Math.round(parseFloat(val) * 100) / 100;
513
     return Math.round(parseFloat(val) * 100) / 100;
406
   },
514
   },
515
+getTimes(time) {
516
+    if (time === '') {
517
+    return ''
518
+    }
519
+    return uParseTime(time, '{y}-{m}-{d}')
520
+},
521
+ updatePurchaseOrder(){
522
+   this.$refs.validate((valid)=>{
523
+      if(valid){
524
+        for(let i=0;i<this.recordInfo.tableList.length;i++){
525
+           this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
526
+           this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
527
+           this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
528
+           for(let j=0;j<this.manufactuerList.length;j++){
529
+              if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
530
+                this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
531
+              }
532
+           }
533
+        }
534
+        var start = this.getTimes(this.start_time)
535
+        var end = this.getTimes(this.end_time)
536
+         const params = {
537
+            'stockIn': this.recordInfo.tableList
538
+         }
539
+        updatePurchaseOrder(params,this.supplier_name,start,end,this.rate_of_concession,this.discount_amount,this.id,this.number).then(response=>{
540
+           if(response.data.state == 1){
541
+             var warehousingInfo =  response.data.data.warehousingInfo
542
+             this.$message.success("修改成功!")
543
+           }
544
+        })
545
+      } 
546
+   })
547
+ },
548
+ getAllPrice(){
549
+   console.log("表哥2332323223323223",this.recordInfo.tableList)  
550
+   var total_price = 0
551
+   for(let i=0;i<this.recordInfo.tableList.length;i++){
552
+      total_price += (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count)
553
+   }  
554
+   return total_price.toFixed(2)
555
+ }
407
 },
556
 },
408
 created(){
557
 created(){
409
     const tempObj = {}
558
     const tempObj = {}
412
     tempObj['supply_name'] = ""
561
     tempObj['supply_name'] = ""
413
     tempObj['supply_type'] = ""
562
     tempObj['supply_type'] = ""
414
     tempObj['supply_specification_name'] = ''
563
     tempObj['supply_specification_name'] = ''
415
-    tempObj['supply_total'] = ''
416
-    tempObj['supply_count'] = ''
417
-    tempObj['supply_price'] = ''
418
-    tempObj['supply_total_price'] = ''
564
+    tempObj['supply_total'] = ""
565
+    tempObj['supply_count'] = ""
566
+    tempObj['supply_price'] = ""
567
+    tempObj['supply_total_price'] = ""
419
     tempObj['supply_manufacturer'] = ''
568
     tempObj['supply_manufacturer'] = ''
420
     tempObj['supply_license_number'] = ''
569
     tempObj['supply_license_number'] = ''
421
     tempObj['supply_remake'] = ''
570
     tempObj['supply_remake'] = ''
422
     tempObj['type'] = 0
571
     tempObj['type'] = 0
423
-    this.tableList.push(tempObj)  
424
-    this.getInitOrder()  
572
+    tempObj['is_total'] = 1
573
+    this.recordInfo.tableList.push(tempObj)
574
+    this.getInitOrder()
425
 }
575
 }
426
 };
576
 };
427
 </script>
577
 </script>
478
 }
628
 }
479
 .el-table__fixed-right{
629
 .el-table__fixed-right{
480
   width:150px;
630
   width:150px;
481
-  bottom: 20px; 
482
-  height: 200px; 
631
+  bottom: 20px;
632
+  height: 200px;
483
 }
633
 }
484
 </style>
634
 </style>

+ 144 - 43
src/xt_pages/supply/purchaseOrderQuery.vue View File

6
     <div class="app-container ">
6
     <div class="app-container ">
7
       <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
7
       <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8
         <div>
8
         <div>
9
-          <el-select v-model="type_name" style="width:140px;margin-right:10px;" placeholder="请选择"
10
-          @change="changeTypeName">
11
-            <el-option
12
-              v-for="item in types"
13
-              :key="item.id"
14
-              :label="item.type_name"
15
-              :value="item.id">
16
-            </el-option>
17
-          </el-select>
9
+        
18
           <el-date-picker
10
           <el-date-picker
19
             size="small"
11
             size="small"
20
             v-model="start_time"
12
             v-model="start_time"
41
               value-format="yyyy-MM-dd"
33
               value-format="yyyy-MM-dd"
42
               @change="endTimeChange"
34
               @change="endTimeChange"
43
           ></el-date-picker>
35
           ></el-date-picker>
36
+          <span>审核状态:</span>
37
+           <el-select v-model="check_id" style="width:140px;margin-right:10px;" placeholder="请选择"
38
+            @change="changeTypeName">
39
+            <el-option
40
+                v-for="item in checkList"
41
+                :key="item.id"
42
+                :label="item.name"
43
+                :value="item.id">
44
+            </el-option>
45
+          </el-select>
44
           <el-input
46
           <el-input
45
             size="small"
47
             size="small"
46
             style="width: 200px;margin-left:10px;"
48
             style="width: 200px;margin-left:10px;"
47
             class="filter-item"
49
             class="filter-item"
48
             v-model.trim="keywords"
50
             v-model.trim="keywords"
49
-            placeholder="耗材名称"
51
+            placeholder="订单编号或供应商名称"
50
           />
52
           />
51
           <el-button
53
           <el-button
52
             size="small"
54
             size="small"
75
       >
77
       >
76
         <el-table-column label="订单日期" align="center">
78
         <el-table-column label="订单日期" align="center">
77
           <template slot-scope="scope">
79
           <template slot-scope="scope">
78
-            <span></span>
80
+            <span>{{getTimes(scope.row.document_date)}}</span>
79
          </template>
81
          </template>
80
         </el-table-column>
82
         </el-table-column>
81
         <el-table-column label="订单编号" align="center">
83
         <el-table-column label="订单编号" align="center">
82
           <template slot-scope="scope">
84
           <template slot-scope="scope">
83
-          
85
+            <span>{{scope.row.number}}</span>
84
           </template>
86
           </template>
85
         </el-table-column>
87
         </el-table-column>
86
         <el-table-column label="供应商" align="center">
88
         <el-table-column label="供应商" align="center">
87
             <template slot-scope="scope">
89
             <template slot-scope="scope">
88
-              <span></span>
90
+              <span>{{getName(scope.row.supplier_id)}}</span>
89
             </template>
91
             </template>
90
          </el-table-column>
92
          </el-table-column>
91
         <el-table-column label="关联购货订单" align="center">
93
         <el-table-column label="关联购货订单" align="center">
95
         </el-table-column>
97
         </el-table-column>
96
         <el-table-column label="购物金额" align="center">
98
         <el-table-column label="购物金额" align="center">
97
           <template slot-scope="scope">
99
           <template slot-scope="scope">
98
-           
100
+             <span v-if="getAllBuyPrice(scope.row.orderInfo)>0">{{getAllBuyPrice(scope.row.orderInfo)}}</span> 
99
           </template>
101
           </template>
100
         </el-table-column>
102
         </el-table-column>
101
 
103
 
102
        <el-table-column label="数量" align="center">
104
        <el-table-column label="数量" align="center">
103
          <template slot-scope="scope">
105
          <template slot-scope="scope">
104
-           
106
+           {{getAllCount(scope.row.orderInfo)}}
105
          </template>
107
          </template>
106
        </el-table-column>
108
        </el-table-column>
107
 
109
 
108
        <el-table-column label="订单状态" align="center">
110
        <el-table-column label="订单状态" align="center">
109
          <template slot-scope="scope">
111
          <template slot-scope="scope">
110
-         
111
-        
112
+           <span v-if="scope.row.is_check == 2">未审核</span>
113
+           <span v-if="scope.row.is_check == 1">已审核</span>
112
          </template>
114
          </template>
113
        </el-table-column>
115
        </el-table-column>
114
       
116
       
115
         <el-table-column label="交货日期" align="center">
117
         <el-table-column label="交货日期" align="center">
116
          <template slot-scope="scope">
118
          <template slot-scope="scope">
117
-         
119
+           {{getTimes(scope.row.delivery_date)}}
118
          </template>
120
          </template>
119
        </el-table-column>
121
        </el-table-column>
120
         
122
         
121
     
123
     
122
       <el-table-column label="制单人" align="center">
124
       <el-table-column label="制单人" align="center">
123
          <template slot-scope="scope">
125
          <template slot-scope="scope">
124
-       
126
+          {{getDocName(scope.row.creater)}}
125
          </template>
127
          </template>
126
        </el-table-column>
128
        </el-table-column>
127
 
129
 
128
       <el-table-column label="审核人" align="center">
130
       <el-table-column label="审核人" align="center">
129
          <template slot-scope="scope">
131
          <template slot-scope="scope">
130
-       
132
+          {{getDocName(scope.row.checker)}}
131
          </template>
133
          </template>
132
        </el-table-column>
134
        </el-table-column>
133
 
135
 
161
       >
163
       >
162
       </el-pagination>
164
       </el-pagination>
163
 
165
 
164
-       <add-supply ref="addSupply"></add-supply>
165
     </div>
166
     </div>
166
   </div>
167
   </div>
167
 </template>
168
 </template>
168
 
169
 
169
 <script>
170
 <script>
170
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
171
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
171
-import addSupply from "./components/addSupply.vue"
172
 
172
 
173
+import {getAllSupply,getAllPurchaseOrderList} from "@/api/supply"
174
+import {uParseTime } from '@/utils/tools'
173
 export default {
175
 export default {
174
   name: "stockIn",
176
   name: "stockIn",
175
    components: {
177
    components: {
176
-     addSupply
178
+     
177
    },
179
    },
178
-  created() {
179
-    this.org_id =  this.$store.getters.xt_user.org_id
180
-
181
-    var start_time =  window.sessionStorage.getItem('start_time')
182
-    var end_time =  window.sessionStorage.getItem('end_time')
183
-
184
-    if(start_time !=null){
185
-      this.start_time = start_time
186
-    }
187
-    if(end_time!=null){
188
-      this.end_time = end_time
189
-    }
190
-    window.sessionStorage.removeItem('start_time')
191
-    window.sessionStorage.removeItem('end_time')
192
-  },
193
   components: {
180
   components: {
194
     BreadCrumb
181
     BreadCrumb
195
   },
182
   },
204
       multipleSelection: [],
191
       multipleSelection: [],
205
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
192
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
206
       start_time: "",
193
       start_time: "",
207
-      end_time: "",
194
+      end_time:new Date(),
208
       page: 1,
195
       page: 1,
209
       limit: 10,
196
       limit: 10,
210
       goodType: [],
197
       goodType: [],
212
       org_id:0,
199
       org_id:0,
213
       types:[],
200
       types:[],
214
       tableList:[],
201
       tableList:[],
215
-      tyep_name:"",
202
+      type_name:"",
203
+      checkList:[
204
+        {id:0,name:"请选择"},
205
+        {id:1,name:"已审核"},
206
+        {id:2,name:"未审核"},
207
+      ],
208
+      supplyList:[],
209
+      check_id:0,
210
+      doctorList:[],
216
     };
211
     };
217
   },
212
   },
218
   methods:{
213
   methods:{
219
      toAdd(){
214
      toAdd(){
220
-       console.log("res32323232323223",this.$refs)  
221
-       this.$refs.addSupply.show()  
215
+       this.$router.push({path:"/purchase/order/add"})
216
+     },
217
+     changeTypeName(){
218
+
219
+     },
220
+     startTimeChange(){
221
+
222
+     },
223
+     endTimeChange(){
224
+
225
+     },
226
+     search(){
227
+
228
+     },
229
+     handleSizeChange(val){
230
+       this.limit = val
231
+       this.getlist()
232
+     },
233
+     handleCurrentChange(val){
234
+       this.page = val
235
+       this.getlist()
236
+     },
237
+     getAllSupply(){
238
+       getAllSupply().then(response=>{
239
+         if(response.data.state == 1){
240
+            var supplyList = response.data.data.supplyList
241
+            this.doctorList = response.data.data.doctorList
242
+            for(let i=0;i<supplyList.length;i++){
243
+              this.supplyList.push(supplyList[i])
244
+            }
245
+         }
246
+       })
247
+     },
248
+     changeTypeName(){
249
+
250
+     },
251
+     getTimes(time) {
252
+      if (time === '') {
253
+      return ''
254
+      }
255
+      return uParseTime(time, '{y}-{m}-{d}')
256
+     },
257
+     getlist(){
258
+        var params = {
259
+          check_id:this.check_id,
260
+          start_time:this.getTimes(this.start_time),
261
+          end_time:this.getTimes(this.end_time),
262
+          keyword:this.keywords,
263
+          page:this.page,
264
+          limit:this.limit,
265
+        }
266
+       getAllPurchaseOrderList(params).then(response=>{
267
+          if(response.data.state == 1){
268
+            var list = response.data.data.list 
269
+            console.log("list2332232323232",list)
270
+            this.tableList = list
271
+            var total = response.data.data.total
272
+            this.total = total
273
+          }
274
+       })
275
+     },
276
+     getName(id){
277
+       var name = ""
278
+       for(let i=0;i<this.supplyList.length;i++){
279
+         if(id == this.supplyList[i].id){
280
+           name = this.supplyList[i].supplier_name
281
+         }
282
+       }
283
+       return name
284
+     },
285
+     getDocName(id){
286
+      var user_name = ""
287
+      for(let i=0;i<this.doctorList.length;i++){
288
+        if(id == this.doctorList[i].admin_user_id){
289
+          user_name = this.doctorList[i].user_name
290
+        }
291
+      }
292
+      return user_name
293
+     },
294
+     getAllBuyPrice(arr){
295
+       var buy_price = 0
296
+       if(arr!=undefined && arr.length > 0){
297
+          for(let i=0;i<arr.length;i++){
298
+            buy_price += (arr[i].count * arr[i].price)
299
+          }
300
+       }
301
+       return buy_price.toFixed(2)
302
+     },
303
+     getAllCount(arr){
304
+       var count = ""
305
+        if(arr!=undefined && arr.length > 0){
306
+          for(let i=0;i<arr.length;i++){
307
+            count += arr[i].count
308
+          }
309
+       }
310
+       return count
222
      } 
311
      } 
223
-  }
312
+  },
313
+  created() {
314
+    var now = new Date(); //当前日期 
315
+    var nowMonth = now.getMonth(); //当前月 
316
+    var nowYear = now.getFullYear(); //当前年 
317
+    //本月的开始时间
318
+    var monthStartDate = new Date(nowYear, nowMonth, 1); 
319
+    this.start_time = monthStartDate
320
+    this.org_id =  this.$store.getters.xt_user.org_id
321
+    this.getAllSupply()
322
+    this.getlist()
323
+  },
324
+ 
224
 };
325
 };
225
 </script>
326
 </script>
226
 
327
 

+ 22 - 4
src/xt_pages/supply/supplyQuery.vue View File

103
            
103
            
104
          </template>
104
          </template>
105
        </el-table-column>
105
        </el-table-column>
106
-       <el-table-column label="开户银行" align="center" v-if="showOne">
106
+       <el-table-column label="开户银行" align="center">
107
          <template slot-scope="scope">
107
          <template slot-scope="scope">
108
          
108
          
109
           </span>
109
           </span>
111
          </template>
111
          </template>
112
        </el-table-column>
112
        </el-table-column>
113
       
113
       
114
-        <el-table-column label="纳税人识别号" align="center" v-if="showThree">
114
+        <el-table-column label="纳税人识别号" align="center" >
115
          <template slot-scope="scope">
115
          <template slot-scope="scope">
116
          
116
          
117
          </template>
117
          </template>
118
        </el-table-column>
118
        </el-table-column>
119
         
119
         
120
     
120
     
121
-      <el-table-column label="手机" align="center" v-if="showFour">
121
+      <el-table-column label="手机" align="center">
122
          <template slot-scope="scope">
122
          <template slot-scope="scope">
123
        
123
        
124
          </template>
124
          </template>
214
      toAdd(){
214
      toAdd(){
215
        console.log("res32323232323223",this.$refs)  
215
        console.log("res32323232323223",this.$refs)  
216
        this.$refs.addSupply.show()  
216
        this.$refs.addSupply.show()  
217
-     } 
217
+     },
218
+      changeTypeName(){
219
+
220
+     }, 
221
+     startTimeChange(){
222
+
223
+     },
224
+     endTimeChange(){
225
+
226
+     },
227
+     search(){
228
+
229
+     },
230
+     handleSizeChange(){
231
+
232
+     },
233
+     handleCurrentChange(){
234
+       
235
+     }
218
   }
236
   }
219
 };
237
 };
220
 </script>
238
 </script>

+ 49 - 3
src/xt_pages/workforce/components/tableData.vue View File

86
           </template>
86
           </template>
87
         </el-table-column>
87
         </el-table-column>
88
         <el-table-column label="操作" align="center" width="300">
88
         <el-table-column label="操作" align="center" width="300">
89
+          
90
+           <template slot-scope="scope">
91
+            <span v-if="now_time>scope.row.schedule_date">
92
+              <el-button
93
+                size="mini"
94
+                type="primary"
95
+                :disable="true"
96
+              >
97
+                取消排班
98
+              </el-button>
99
+              <el-button
100
+                size="mini"
101
+                type="primary"
102
+                :disable="true"
103
+              >
104
+                调整机号
105
+              </el-button>
106
+              <el-button
107
+                size="mini"
108
+                type="primary"
109
+              :disable="true"
110
+              >
111
+                调整模式
112
+              </el-button>
113
+           </span>
114
+          </template>
115
+         
116
+         
89
           <template slot-scope="scope">
117
           <template slot-scope="scope">
90
-            <el-button
118
+            <span v-if="now_time <=scope.row.schedule_date">
119
+              <el-button
91
               size="mini"
120
               size="mini"
92
               type="primary"
121
               type="primary"
93
               @click="CancelSchedule(scope.row.id)"
122
               @click="CancelSchedule(scope.row.id)"
108
             >
137
             >
109
               调整模式
138
               调整模式
110
             </el-button>
139
             </el-button>
140
+            </span>
141
+           
111
           </template>
142
           </template>
112
         </el-table-column>
143
         </el-table-column>
113
       </el-table>
144
       </el-table>
774
       },
805
       },
775
       zoneIdList:[],
806
       zoneIdList:[],
776
       strArr:"",
807
       strArr:"",
777
-      patient_id_hover:0
808
+      patient_id_hover:0,
809
+      now_time:"",
778
     };
810
     };
779
   },
811
   },
780
 
812
 
2307
   //    this.tableContainHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 160
2339
   //    this.tableContainHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 160
2308
   // },
2340
   // },
2309
   created() {
2341
   created() {
2310
-    
2342
+    var date = new Date()
2343
+    this.time = date
2344
+    var year = date.getFullYear()
2345
+    var month = date.getMonth() + 1
2346
+    if (month < 10) {
2347
+      month = "0" + month
2348
+    }
2349
+    var day = date.getDate()
2350
+    if (day < 10) {
2351
+      day = "0" + day
2352
+    }
2353
+    var nowDate = year + "-" + month + "-" + day
2354
+    var date = new Date(nowDate + " 00:00:00")
2355
+    console.log("date23232323232323",date.getTime()/1000) 
2356
+    this.now_time = date.getTime()/1000
2311
     this.getAllZones()
2357
     this.getAllZones()
2312
  
2358
  
2313
     this.changeScheduleType(1)
2359
     this.changeScheduleType(1)