Browse Source

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

see999 3 years ago
parent
commit
16c69ef0f1
32 changed files with 2960 additions and 294 deletions
  1. 40 1
      src/api/supply.js
  2. 1 0
      src/lang/zh.js
  3. 35 0
      src/router/modules/supply.js
  4. 9 0
      src/xt_pages/data/components/addDrugs.vue
  5. 3 3
      src/xt_pages/data/components/addProject.vue
  6. 29 14
      src/xt_pages/data/components/consumables.vue
  7. 29 16
      src/xt_pages/data/components/drugs.vue
  8. 3 3
      src/xt_pages/dialysis/template/DialysisPrintOrderTen.vue
  9. 5 2
      src/xt_pages/hospitalStation/chargeDetailManagement.vue
  10. 13 0
      src/xt_pages/hospitalStation/components/ChargePrescriptionTable.vue
  11. 23 2
      src/xt_pages/hospitalStation/index.vue
  12. 11 0
      src/xt_pages/outpatientCharges/components/prescriptionTable.vue
  13. 64 0
      src/xt_pages/outpatientCharges/components/registerDialog.vue
  14. 10 3
      src/xt_pages/outpatientCharges/outpatientChargesManagement.vue
  15. 6 3
      src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue
  16. 69 24
      src/xt_pages/outpatientDoctorStation/doctorDesk.vue
  17. 9 1
      src/xt_pages/stock/Dialog/goodInfoDailog.vue
  18. 34 49
      src/xt_pages/stock/drugs/components/drugOutDetail.vue
  19. 5 0
      src/xt_pages/stock/drugs/drugBatchNumber.vue
  20. 10 1
      src/xt_pages/stock/drugs/drugStockFlow.vue
  21. 52 50
      src/xt_pages/stock/drugs/drugStockInOrderEdit.vue
  22. 5 3
      src/xt_pages/stock/drugs/drugStockOutOrder.vue
  23. 6 12
      src/xt_pages/stock/stockBatchNumber.vue
  24. 2 2
      src/xt_pages/stock/stockInOrder.vue
  25. 1 0
      src/xt_pages/stock/stockInOrderAdd.vue
  26. 688 0
      src/xt_pages/supply/components/addGoodOrder.vue
  27. 235 40
      src/xt_pages/supply/components/addPurchaseOrder.vue
  28. 710 0
      src/xt_pages/supply/components/editPurchaseOrder.vue
  29. 292 0
      src/xt_pages/supply/components/purchaseOrderPrint.vue
  30. 387 0
      src/xt_pages/supply/goodOrderQuery.vue
  31. 138 47
      src/xt_pages/supply/purchaseOrderQuery.vue
  32. 36 18
      src/xt_pages/supply/supplyQuery.vue

+ 40 - 1
src/api/supply.js View File

9
 }
9
 }
10
 
10
 
11
 export function savePurchaseOrder(data, supplier_name, start_time, end_time, rate_of_concession, discount_amount) {
11
 export function savePurchaseOrder(data, supplier_name, start_time, end_time, rate_of_concession, discount_amount) {
12
-  console.log('data32323323232', data)
13
   return request({
12
   return request({
14
     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,
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,
15
     method: 'post',
14
     method: 'post',
16
     data: data
15
     data: data
17
   })
16
   })
18
 }
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
+}
42
+
43
+export function checkPurchaseOrder(id, params) {
44
+  return request({
45
+    url: '/api/supply/checkpurchaseorder?id=' + id,
46
+    method: 'Get',
47
+    params: params
48
+  })
49
+}
50
+
51
+export function getPurchaseOrderDetail(id, params) {
52
+  return request({
53
+    url: '/api/supply/getpurchaseorderdetail?id=' + id,
54
+    method: 'get',
55
+    params: params
56
+  })
57
+}

+ 1 - 0
src/lang/zh.js View File

138
     stockQuery: '库存查询',
138
     stockQuery: '库存查询',
139
     supplyQuery: '供应商管理',
139
     supplyQuery: '供应商管理',
140
     purchaseOrderQuery: '购货订单',
140
     purchaseOrderQuery: '购货订单',
141
+    goodOrderQuery: '购货单',
141
     addPurchaseOrder: '新增购货订单',
142
     addPurchaseOrder: '新增购货订单',
142
     workforce_template: '排班模板设置',
143
     workforce_template: '排班模板设置',
143
     statistics: '统计分析',
144
     statistics: '统计分析',

+ 35 - 0
src/router/modules/supply.js View File

41
       hidden: true,
41
       hidden: true,
42
       is_menu: false,
42
       is_menu: false,
43
       isChild: true
43
       isChild: true
44
+    },
45
+    {
46
+      path: '/purchase/order/edit',
47
+      component: () => import('@/xt_pages/supply/components/editPurchaseOrder'),
48
+      name: 'editPurchaseOrder',
49
+      meta: { title: 'editPurchaseOrder', noCache: true },
50
+      hidden: true,
51
+      is_menu: false,
52
+      isChild: true
53
+    },
54
+    {
55
+      path: '/purchase/order/print',
56
+      component: () => import('@/xt_pages/supply/components/purchaseOrderPrint'),
57
+      name: 'purchaseOrderPrint',
58
+      meta: { title: 'purchaseOrderPrint', noCache: true },
59
+      hidden: true,
60
+      is_menu: false,
61
+      isChild: true
62
+    },
63
+
64
+    {
65
+      path: 'good/order/query',
66
+      component: () => import('@/xt_pages/supply/goodOrderQuery'),
67
+      name: 'goodOrderQuery',
68
+      meta: { title: 'goodOrderQuery', noCache: true }
69
+    },
70
+    {
71
+      path: '/good/order/add',
72
+      component: () => import('@/xt_pages/supply/components/addGoodOrder'),
73
+      name: 'addGoodOrder',
74
+      meta: { title: 'addGoodOrder', noCache: true },
75
+      hidden: true,
76
+      is_menu: false,
77
+      isChild: true
44
     }
78
     }
79
+
45
   ]
80
   ]
46
 }
81
 }

+ 9 - 0
src/xt_pages/data/components/addDrugs.vue View File

267
                             <el-input v-model="form.medical_insurance_number" style="width:160px;" placeholder=""
267
                             <el-input v-model="form.medical_insurance_number" style="width:160px;" placeholder=""
268
                                       maxlength="30"></el-input>
268
                                       maxlength="30"></el-input>
269
                         </el-form-item>
269
                         </el-form-item>
270
+                      <el-form-item label="省编码 : " prop="provinces_code">
271
+                        <el-input v-model="form.provinces_code" style="width:160px;" placeholder=""
272
+                                  maxlength="30"></el-input>
273
+                      </el-form-item>
270
                         <el-form-item label="生产厂商 : " prop="manufacturer">
274
                         <el-form-item label="生产厂商 : " prop="manufacturer">
271
 
275
 
272
                             <el-select v-model="form.manufacturer" style="width:160px;" filterable placeholder="请选择">
276
                             <el-select v-model="form.manufacturer" style="width:160px;" filterable placeholder="请选择">
543
           drug_dose: '',//药品剂量
547
           drug_dose: '',//药品剂量
544
           drug_dose_unit: '',
548
           drug_dose_unit: '',
545
           medical_insurance_number: '',//医保编号
549
           medical_insurance_number: '',//医保编号
550
+          provinces_code:"",//省编码
546
           manufacturer: '', //生产产商
551
           manufacturer: '', //生产产商
547
           pharmacology_category: '',//药理分类
552
           pharmacology_category: '',//药理分类
548
           statistics_category: '',//统计分类
553
           statistics_category: '',//统计分类
851
         form['drug_dose'] = this.form.drug_dose
856
         form['drug_dose'] = this.form.drug_dose
852
         form['drug_dose_unit'] = this.form.drug_dose_unit
857
         form['drug_dose_unit'] = this.form.drug_dose_unit
853
         form['medical_insurance_number'] = this.form.medical_insurance_number
858
         form['medical_insurance_number'] = this.form.medical_insurance_number
859
+        form['provinces_code'] = this.form.provinces_code
860
+
861
+
862
+
854
         form['manufacturer'] = this.form.manufacturer
863
         form['manufacturer'] = this.form.manufacturer
855
         form['pharmacology_category'] = this.form.pharmacology_category
864
         form['pharmacology_category'] = this.form.pharmacology_category
856
         form['statistics_category'] = this.form.statistics_category
865
         form['statistics_category'] = this.form.statistics_category

+ 3 - 3
src/xt_pages/data/components/addProject.vue View File

230
                             :value="item.value">
230
                             :value="item.value">
231
                             </el-option>
231
                             </el-option>
232
                         </el-select>
232
                         </el-select>
233
-                    </el-form-item>       
233
+                    </el-form-item>
234
                 </el-form>
234
                 </el-form>
235
             </el-tab-pane>
235
             </el-tab-pane>
236
         </el-tabs>
236
         </el-tabs>
259
             form:{
259
             form:{
260
               project_name:"",
260
               project_name:"",
261
               pinyin:"",
261
               pinyin:"",
262
-              wubi:"", 
263
-              price:"", 
262
+              wubi:"",
263
+              price:"",
264
               unit:"",
264
               unit:"",
265
               cost_classify:"",
265
               cost_classify:"",
266
               executive_section:"",
266
               executive_section:"",

+ 29 - 14
src/xt_pages/data/components/consumables.vue View File

307
               good_unit:'',
307
               good_unit:'',
308
               retail_price:'',
308
               retail_price:'',
309
               medical_insurance_number:'',
309
               medical_insurance_number:'',
310
+              provinces_code:'',
311
+
310
               is_special_diseases:'',
312
               is_special_diseases:'',
311
               is_record:'',
313
               is_record:'',
312
               statistics_category:'',
314
               statistics_category:'',
598
             this.goodInfo.goodInfoDialog.formValue.medical_insurance_number =
600
             this.goodInfo.goodInfoDialog.formValue.medical_insurance_number =
599
               response.data.data.goodInfo.medical_insurance_number;
601
               response.data.data.goodInfo.medical_insurance_number;
600
 
602
 
603
+            this.goodInfo.goodInfoDialog.formValue.provinces_code =
604
+                response.data.data.goodInfo.provinces_code;
605
+
601
 
606
 
602
             if (response.data.data.goodInfo.is_special_diseases <= 0) {
607
             if (response.data.data.goodInfo.is_special_diseases <= 0) {
603
               this.goodInfo.goodInfoDialog.formValue.is_special_diseases = ''
608
               this.goodInfo.goodInfoDialog.formValue.is_special_diseases = ''
810
         })
815
         })
811
       },
816
       },
812
       goodInfoDialogComfirm: function(val) {
817
       goodInfoDialogComfirm: function(val) {
813
-        
818
+
814
         if (val.isCreated == 2) {
819
         if (val.isCreated == 2) {
815
           //修改
820
           //修改
816
           val['id'] = this.goodInfo.editGoodId;
821
           val['id'] = this.goodInfo.editGoodId;
958
             this.$message.error(response.data.msg);
963
             this.$message.error(response.data.msg);
959
             return false
964
             return false
960
           } else {
965
           } else {
961
-           
966
+
962
             for(let i=0;i<response.data.data.goodType.length;i++){
967
             for(let i=0;i<response.data.data.goodType.length;i++){
963
               this.goodTypeList.push(response.data.data.goodType[i])
968
               this.goodTypeList.push(response.data.data.goodType[i])
964
             }
969
             }
965
- 
970
+
966
             for (let i = 0; i < response.data.data.goodType.length; i++) {
971
             for (let i = 0; i < response.data.data.goodType.length; i++) {
967
               if (response.data.data.goodType[i].type == 1) {
972
               if (response.data.data.goodType[i].type == 1) {
968
                 response.data.data.goodType[i].type_name = response.data.data.goodType[i].type_name + '(系统设定)'
973
                 response.data.data.goodType[i].type_name = response.data.data.goodType[i].type_name + '(系统设定)'
1036
         this.goodInfo.goodInfoDialog.formValue.medical_insurance_level = '';
1041
         this.goodInfo.goodInfoDialog.formValue.medical_insurance_level = '';
1037
         this.goodInfo.goodInfoDialog.formValue.retail_price = '';
1042
         this.goodInfo.goodInfoDialog.formValue.retail_price = '';
1038
         this.goodInfo.goodInfoDialog.formValue.medical_insurance_number = '';
1043
         this.goodInfo.goodInfoDialog.formValue.medical_insurance_number = '';
1044
+        this.goodInfo.goodInfoDialog.formValue.provinces_code = '';
1045
+
1039
         this.goodInfo.goodInfoDialog.formValue.is_special_diseases = '';
1046
         this.goodInfo.goodInfoDialog.formValue.is_special_diseases = '';
1040
         this.goodInfo.goodInfoDialog.formValue.is_record = '';
1047
         this.goodInfo.goodInfoDialog.formValue.is_record = '';
1041
         this.goodInfo.goodInfoDialog.formValue.statistics_category = '';
1048
         this.goodInfo.goodInfoDialog.formValue.statistics_category = '';
1300
               }
1307
               }
1301
            }
1308
            }
1302
 
1309
 
1310
+           if (results[i]['省编码'] === undefined) {
1311
+             obj['provinces_code'] = ''
1312
+           } else {
1313
+             if (key == '省编码') {
1314
+               obj['provinces_code'] = results[i][key].replace(/\s/g,"")
1315
+             }
1316
+           }
1317
+
1303
           if (results[i]['是否特病目录'] === undefined) {
1318
           if (results[i]['是否特病目录'] === undefined) {
1304
                 obj['is_special_diseases'] = ''
1319
                 obj['is_special_diseases'] = ''
1305
               } else {
1320
               } else {
1498
        getInitializtion().then(response=>{
1513
        getInitializtion().then(response=>{
1499
          if(response.data.state == 1){
1514
          if(response.data.state == 1){
1500
            var goodKindList = response.data.data.goodKindList;
1515
            var goodKindList = response.data.data.goodKindList;
1501
-           
1516
+
1502
            this.goodKindList = goodKindList
1517
            this.goodKindList = goodKindList
1503
            var medicalInsuranceLevelList =  response.data.data.medicalInsuranceLevelList
1518
            var medicalInsuranceLevelList =  response.data.data.medicalInsuranceLevelList
1504
            console.log("医保等级",medicalInsuranceLevelList)
1519
            console.log("医保等级",medicalInsuranceLevelList)
1509
       exportList(){
1524
       exportList(){
1510
         import('@/vendor/Export2Excel').then(excel => {
1525
         import('@/vendor/Export2Excel').then(excel => {
1511
          console.log("this.table",this.goodInfo.goodInfoDialog.formValue.goodType)
1526
          console.log("this.table",this.goodInfo.goodInfoDialog.formValue.goodType)
1512
-         
1527
+
1513
          for(let i=0;i<this.goodInfo.goodInfoData.length;i++){
1528
          for(let i=0;i<this.goodInfo.goodInfoData.length;i++){
1514
            for(let j=0;j<this.goodKindList.length;j++){
1529
            for(let j=0;j<this.goodKindList.length;j++){
1515
               if(this.goodInfo.goodInfoData[i].good_kind == this.goodKindList[j].value){
1530
               if(this.goodInfo.goodInfoData[i].good_kind == this.goodKindList[j].value){
1518
            }
1533
            }
1519
            for(let z=0;z<this.goodInfo.goodInfoDialog.formValue.goodType.length;z++){
1534
            for(let z=0;z<this.goodInfo.goodInfoDialog.formValue.goodType.length;z++){
1520
               if(this.goodInfo.goodInfoData[i].good_type_id == this.goodInfo.goodInfoDialog.formValue.goodType[z].id){
1535
               if(this.goodInfo.goodInfoData[i].good_type_id == this.goodInfo.goodInfoDialog.formValue.goodType[z].id){
1521
-                
1536
+
1522
                  this.goodInfo.goodInfoData[i].good_type_name = this.goodInfo.goodInfoDialog.formValue.goodType[z].type_name
1537
                  this.goodInfo.goodInfoData[i].good_type_name = this.goodInfo.goodInfoDialog.formValue.goodType[z].type_name
1523
               }
1538
               }
1524
            }
1539
            }
1534
                 this.goodInfo.goodInfoData[i].manufacturer_name =  this.manufacturers[s].manufacturer_name
1549
                 this.goodInfo.goodInfoData[i].manufacturer_name =  this.manufacturers[s].manufacturer_name
1535
              }
1550
              }
1536
            }
1551
            }
1537
-          
1552
+
1538
           for(let a=0;a<this.dealers.length;a++){
1553
           for(let a=0;a<this.dealers.length;a++){
1539
              if(this.dealers[a].id == this.goodInfo.goodInfoData[i].dealer){
1554
              if(this.dealers[a].id == this.goodInfo.goodInfoData[i].dealer){
1540
-                 this.goodInfo.goodInfoData[i].dealer_name = this.dealers[a].dealer_name 
1541
-             } 
1555
+                 this.goodInfo.goodInfoData[i].dealer_name = this.dealers[a].dealer_name
1556
+             }
1542
           }
1557
           }
1543
          }
1558
          }
1544
          console.log("hhhadhh233323232",this.goodInfo.goodInfoData)
1559
          console.log("hhhadhh233323232",this.goodInfo.goodInfoData)
1545
-       
1560
+
1546
          const tHeader = ['耗材名称','耗材种类','耗材类型','医保等级','规格型号','生产厂商','单位','零价','库存警戒','经销商','最新进价','医保编码','社保目录编码']
1561
          const tHeader = ['耗材名称','耗材种类','耗材类型','医保等级','规格型号','生产厂商','单位','零价','库存警戒','经销商','最新进价','医保编码','社保目录编码']
1547
-         const filterVal = ['good_name', 'good_kind_name','good_type_name','medical_insurance_level_name','specification_name','manufacturer_name','packing_unit','packing_price','stock_warn_count','dealer_name','buy_price','medical_insurance_number','social_security_directory_code'] 
1548
-         
1562
+         const filterVal = ['good_name', 'good_kind_name','good_type_name','medical_insurance_level_name','specification_name','manufacturer_name','packing_unit','packing_price','stock_warn_count','dealer_name','buy_price','medical_insurance_number','social_security_directory_code']
1563
+
1549
          const data = this.formatJson(filterVal,this.goodInfo.goodInfoData)
1564
          const data = this.formatJson(filterVal,this.goodInfo.goodInfoData)
1550
-     
1565
+
1551
          excel.export_json_to_excel({
1566
          excel.export_json_to_excel({
1552
            header: tHeader,
1567
            header: tHeader,
1553
            data,
1568
            data,
1554
            filename: '耗材信息'
1569
            filename: '耗材信息'
1555
          })
1570
          })
1556
           this.downloadLoading = false
1571
           this.downloadLoading = false
1557
-    
1572
+
1558
         })
1573
         })
1559
        },
1574
        },
1560
        formatJson(filterVal, jsonData) {
1575
        formatJson(filterVal, jsonData) {

+ 29 - 16
src/xt_pages/data/components/drugs.vue View File

96
           </div>
96
           </div>
97
         </template>
97
         </template>
98
       </el-table-column>
98
       </el-table-column>
99
-  
99
+
100
       <el-table-column prop="date" label="进货价" width="100" align="center">
100
       <el-table-column prop="date" label="进货价" width="100" align="center">
101
         <template slot-scope="scope">
101
         <template slot-scope="scope">
102
           <div>{{scope.row.last_price}}</div>
102
           <div>{{scope.row.last_price}}</div>
103
         </template>
103
         </template>
104
       </el-table-column>
104
       </el-table-column>
105
-     
105
+
106
       <el-table-column label="拆零零售价" width="100" align="center">
106
       <el-table-column label="拆零零售价" width="100" align="center">
107
         <template slot-scope="scope">
107
         <template slot-scope="scope">
108
           <div>{{scope.row.min_price}}</div>
108
           <div>{{scope.row.min_price}}</div>
296
           drug_dose: '',//药品剂量
296
           drug_dose: '',//药品剂量
297
           drug_dose_unit: '',
297
           drug_dose_unit: '',
298
           medical_insurance_number: '',//医保编号
298
           medical_insurance_number: '',//医保编号
299
+          provinces_code:'',//省编码
299
           manufacturer: '', //生产产商
300
           manufacturer: '', //生产产商
300
           pharmacology_category: '',//药理分类
301
           pharmacology_category: '',//药理分类
301
           statistics_category: '',//统计分类
302
           statistics_category: '',//统计分类
349
           drug_dose: '',//药品剂量
350
           drug_dose: '',//药品剂量
350
           drug_dose_unit: '',
351
           drug_dose_unit: '',
351
           medical_insurance_number: '',//医保编号
352
           medical_insurance_number: '',//医保编号
353
+          provinces_code:"",
352
           manufacturer: '', //生产产商
354
           manufacturer: '', //生产产商
353
           pharmacology_category: '',//药理分类
355
           pharmacology_category: '',//药理分类
354
           statistics_category: '',//统计分类
356
           statistics_category: '',//统计分类
705
                  this.formValue.drug_classify = ""
707
                  this.formValue.drug_classify = ""
706
               }
708
               }
707
 
709
 
708
-              
710
+
709
 
711
 
710
               this.$refs.addDrugs.show(id, this.formValue)
712
               this.$refs.addDrugs.show(id, this.formValue)
711
 
713
 
970
            console.log("isHasMinUnit",isHasMinUnit)
972
            console.log("isHasMinUnit",isHasMinUnit)
971
           var isHasPackingUnit = header.includes('*包装单位')
973
           var isHasPackingUnit = header.includes('*包装单位')
972
           console.log("isHasPackingUnit",isHasPackingUnit)
974
           console.log("isHasPackingUnit",isHasPackingUnit)
973
-        
975
+
974
           var isHasDrugType =  header.includes('*药品类型');
976
           var isHasDrugType =  header.includes('*药品类型');
975
           console.log("isHasDrugType",isHasDrugType)
977
           console.log("isHasDrugType",isHasDrugType)
976
           var isHasDrugStockLimit =  header.includes('*库存警戒');
978
           var isHasDrugStockLimit =  header.includes('*库存警戒');
979
           console.log("isHasDrugOriginPlace",isHasDrugOriginPlace)
981
           console.log("isHasDrugOriginPlace",isHasDrugOriginPlace)
980
           var isHasDrugDosageForm = header.includes('*药品剂型');
982
           var isHasDrugDosageForm = header.includes('*药品剂型');
981
           console.log("isHasDrugDosageForm",isHasDrugDosageForm)
983
           console.log("isHasDrugDosageForm",isHasDrugDosageForm)
982
-         
984
+
983
           var isHasRetailPrice = header.includes('*拆零零售价');
985
           var isHasRetailPrice = header.includes('*拆零零售价');
984
           console.log("isHasRetailPrice",isHasRetailPrice)
986
           console.log("isHasRetailPrice",isHasRetailPrice)
985
           var isHasPackingPrice= header.includes('*包装零售价');
987
           var isHasPackingPrice= header.includes('*包装零售价');
986
           console.log("isHasLastPrice",isHasPackingPrice)
988
           console.log("isHasLastPrice",isHasPackingPrice)
987
           var isHasLastPrice = header.includes('*进货价');
989
           var isHasLastPrice = header.includes('*进货价');
988
           console.log("进货价",isHasLastPrice)
990
           console.log("进货价",isHasLastPrice)
989
-          
991
+
990
           var isHasDrugClassifye = header.includes('*药物分类');
992
           var isHasDrugClassifye = header.includes('*药物分类');
991
          console.log("isHasDrugClassifye",isHasDrugClassifye)
993
          console.log("isHasDrugClassifye",isHasDrugClassifye)
992
          var isHasManufacturer = header.includes('*生产厂商');
994
          var isHasManufacturer = header.includes('*生产厂商');
997
          console.log("isDrugDoseUnit",isDrugDoseUnit)
999
          console.log("isDrugDoseUnit",isDrugDoseUnit)
998
           if (!(isHasDrugName  && isHasDosage && isHasMaxUnit && isHasUnval && isHasMinUnit && isHasPackingUnit && isHasDrugType &&  isHasDrugStockLimit && isHasDrugOriginPlace &&
1000
           if (!(isHasDrugName  && isHasDosage && isHasMaxUnit && isHasUnval && isHasMinUnit && isHasPackingUnit && isHasDrugType &&  isHasDrugStockLimit && isHasDrugOriginPlace &&
999
           isHasDrugDosageForm &&  isHasRetailPrice && isHasPackingPrice && isHasLastPrice && isHasDrugClassifye && isHasManufacturer && isHasDrugDose && isDrugDoseUnit)) {
1001
           isHasDrugDosageForm &&  isHasRetailPrice && isHasPackingPrice && isHasLastPrice && isHasDrugClassifye && isHasManufacturer && isHasDrugDose && isDrugDoseUnit)) {
1000
-           
1002
+
1001
             this.dialogVisible = true;
1003
             this.dialogVisible = true;
1002
             return
1004
             return
1003
           }
1005
           }
1037
            }
1039
            }
1038
 
1040
 
1039
 
1041
 
1040
-  
1042
+
1041
           if (results[i]['*拆零'] === undefined) {
1043
           if (results[i]['*拆零'] === undefined) {
1042
                 obj['min_number'] = ''
1044
                 obj['min_number'] = ''
1043
               } else {
1045
               } else {
1251
               }
1253
               }
1252
            }
1254
            }
1253
 
1255
 
1256
+           if (results[i]['省编码'] === undefined) {
1257
+             obj['provinces_code'] = ''
1258
+           } else {
1259
+             if (key == '省编码') {
1260
+               obj['provinces_code'] = results[i][key].replace(/\s/g,"")
1261
+             }
1262
+           }
1263
+
1264
+
1265
+
1266
+
1254
             if (results[i]['药理分类'] === undefined) {
1267
             if (results[i]['药理分类'] === undefined) {
1255
                 obj['pharmacology_category'] = ''
1268
                 obj['pharmacology_category'] = ''
1256
               } else {
1269
               } else {
1415
           'drugs':tableData
1428
           'drugs':tableData
1416
         };
1429
         };
1417
         console.log("params222222222",params)
1430
         console.log("params222222222",params)
1418
-        
1431
+
1419
         postDrugInformation(params).then(response=>{
1432
         postDrugInformation(params).then(response=>{
1420
            if(response.data.state == 1){
1433
            if(response.data.state == 1){
1421
              var msg =  response.data.data.msg;
1434
              var msg =  response.data.data.msg;
1485
 
1498
 
1486
       exportList(){
1499
       exportList(){
1487
          import('@/vendor/Export2Excel').then(excel => {
1500
          import('@/vendor/Export2Excel').then(excel => {
1488
-         
1489
-        
1501
+
1502
+
1490
          console.log("this.table",this.list)
1503
          console.log("this.table",this.list)
1491
 
1504
 
1492
          for(let i=0;i<this.list.length;i++){
1505
          for(let i=0;i<this.list.length;i++){
1493
           for(let j=0;j<this.drugCategoryList.length;j++){
1506
           for(let j=0;j<this.drugCategoryList.length;j++){
1494
               if(this.list[i].drug_category == this.drugCategoryList[j].value){
1507
               if(this.list[i].drug_category == this.drugCategoryList[j].value){
1495
                  this.list[i].drug_category_name = this.drugCategoryList[j].name
1508
                  this.list[i].drug_category_name = this.drugCategoryList[j].name
1496
-              }  
1509
+              }
1497
           }
1510
           }
1498
            for(let z=0;z<this.drugDosageFormList.length;z++){
1511
            for(let z=0;z<this.drugDosageFormList.length;z++){
1499
               if(this.list[i].drug_dosage_form == this.drugDosageFormList[z].value){
1512
               if(this.list[i].drug_dosage_form == this.drugDosageFormList[z].value){
1525
          }
1538
          }
1526
 
1539
 
1527
          const tHeader = ['药品名称','药品规格','剂量','剂量单位','拆零','拆零单位','包装单位','药品类型','库存警戒','产地','药品剂型','拆零零售价','包装零售价','进货价','药物分类','默认单次用量','默认单次用量单位','生产厂商','经销商','医保编码','社保目录编码']
1540
          const tHeader = ['药品名称','药品规格','剂量','剂量单位','拆零','拆零单位','包装单位','药品类型','库存警戒','产地','药品剂型','拆零零售价','包装零售价','进货价','药物分类','默认单次用量','默认单次用量单位','生产厂商','经销商','医保编码','社保目录编码']
1528
-         const filterVal = ['drug_name', 'specification_name','dose','dose_unit','min_number','min_unit','max_unit','drug_category_name','drug_stock_limit','drug_origin_place','drug_dosage_form_name','min_price','retail_price','last_price','drug_classify_name','drug_dose','drug_dose_unit_name','manufacturer_name','dealer_name','medical_insurance_number','social_security_directory_code'] 
1529
-         
1541
+         const filterVal = ['drug_name', 'specification_name','dose','dose_unit','min_number','min_unit','max_unit','drug_category_name','drug_stock_limit','drug_origin_place','drug_dosage_form_name','min_price','retail_price','last_price','drug_classify_name','drug_dose','drug_dose_unit_name','manufacturer_name','dealer_name','medical_insurance_number','social_security_directory_code']
1542
+
1530
          const data = this.formatJson(filterVal,this.list)
1543
          const data = this.formatJson(filterVal,this.list)
1531
-     
1544
+
1532
          excel.export_json_to_excel({
1545
          excel.export_json_to_excel({
1533
            header: tHeader,
1546
            header: tHeader,
1534
            data,
1547
            data,
1535
            filename: '药品信息'
1548
            filename: '药品信息'
1536
          })
1549
          })
1537
           this.downloadLoading = false
1550
           this.downloadLoading = false
1538
-    
1551
+
1539
         })
1552
         })
1540
        },
1553
        },
1541
        formatJson(filterVal, jsonData) {
1554
        formatJson(filterVal, jsonData) {

+ 3 - 3
src/xt_pages/dialysis/template/DialysisPrintOrderTen.vue View File

640
                 </td> -->
640
                 </td> -->
641
                         <!-- <td width="10%" v-if="(advice.children && advice.children.length > 0 || advice.parent_id > 0) && advice.isShow == 2" ></td> -->
641
                         <!-- <td width="10%" v-if="(advice.children && advice.children.length > 0 || advice.parent_id > 0) && advice.isShow == 2" ></td> -->
642
                         <td height="32px">
642
                         <td height="32px">
643
-                          <img v-if="advice.id > 0" style="height:20px;" src="https://images.shengws.com/FgnRnBcx1BgULJ1dn7VKzeBPEvtm" alt="" srcset="" />
643
+                          <!-- <img v-if="advice.id > 0" style="height:20px;" src="https://images.shengws.com/FgnRnBcx1BgULJ1dn7VKzeBPEvtm" alt="" srcset="" /> -->
644
                           <span v-if="setAdminUserES(advice.advice_doctor) == ''">{{ getAdminUser(advice.advice_doctor) }}</span>
644
                           <span v-if="setAdminUserES(advice.advice_doctor) == ''">{{ getAdminUser(advice.advice_doctor) }}</span>
645
                           <img style="height:20px;" :src="setAdminUserES(advice.advice_doctor)" alt="" srcset="" v-else />
645
                           <img style="height:20px;" :src="setAdminUserES(advice.advice_doctor)" alt="" srcset="" v-else />
646
                         </td>
646
                         </td>
1014
                     <div class="inline_block" style="flex:1;">
1014
                     <div class="inline_block" style="flex:1;">
1015
                       治疗医生:
1015
                       治疗医生:
1016
                       <div class="under_line" style="width: 80px">
1016
                       <div class="under_line" style="width: 80px">
1017
-                        <img style="height:20px;" src="https://images.shengws.com/FgnRnBcx1BgULJ1dn7VKzeBPEvtm" alt="" srcset="" />
1018
-                        <!--<img style="height:20px;" src="https://images.shengws.com/FgnRnBcx1BgULJ1dn7VKzeBPEvtm" alt="" srcset="">-->
1017
+                        <!-- <img style="height:20px;" src="https://images.shengws.com/FgnRnBcx1BgULJ1dn7VKzeBPEvtm" alt="" srcset="" /> -->
1018
+                       
1019
                         <span v-if="setAdminUserES(prescription.prescription_doctor) == ''">{{ getAdminUser(prescription.prescription_doctor) }}</span>
1019
                         <span v-if="setAdminUserES(prescription.prescription_doctor) == ''">{{ getAdminUser(prescription.prescription_doctor) }}</span>
1020
                         <img style="height:20px;" :src="setAdminUserES(prescription.prescription_doctor)" alt="" srcset="" v-else />
1020
                         <img style="height:20px;" :src="setAdminUserES(prescription.prescription_doctor)" alt="" srcset="" v-else />
1021
                       </div>
1021
                       </div>

+ 5 - 2
src/xt_pages/hospitalStation/chargeDetailManagement.vue View File

1149
                 fulamt_ownpay_amt: prescription.advices[b].order_info.fulamt_ownpay_amt,
1149
                 fulamt_ownpay_amt: prescription.advices[b].order_info.fulamt_ownpay_amt,
1150
                 overlmt_amt: prescription.advices[b].order_info.overlmt_amt,
1150
                 overlmt_amt: prescription.advices[b].order_info.overlmt_amt,
1151
                 preselfpay_amt: prescription.advices[b].order_info.preselfpay_amt,
1151
                 preselfpay_amt: prescription.advices[b].order_info.preselfpay_amt,
1152
-                inscp_scp_amt: prescription.advices[b].order_info.inscp_scp_amt
1152
+                inscp_scp_amt: prescription.advices[b].order_info.inscp_scp_amt,
1153
+                execution_state: prescription.advices[b].execution_state,
1153
 
1154
 
1154
               }
1155
               }
1155
               tempAdvice.push(obj)
1156
               tempAdvice.push(obj)
1175
                 fulamt_ownpay_amt: prescription.project[b].order_info.fulamt_ownpay_amt,
1176
                 fulamt_ownpay_amt: prescription.project[b].order_info.fulamt_ownpay_amt,
1176
                 overlmt_amt: prescription.project[b].order_info.overlmt_amt,
1177
                 overlmt_amt: prescription.project[b].order_info.overlmt_amt,
1177
                 preselfpay_amt: prescription.project[b].order_info.preselfpay_amt,
1178
                 preselfpay_amt: prescription.project[b].order_info.preselfpay_amt,
1178
-                inscp_scp_amt: prescription.project[b].order_info.inscp_scp_amt
1179
+                inscp_scp_amt: prescription.project[b].order_info.inscp_scp_amt,
1180
+                execution_state: prescription.project[b].execution_state,
1181
+
1179
 
1182
 
1180
               }
1183
               }
1181
 
1184
 

+ 13 - 0
src/xt_pages/hospitalStation/components/ChargePrescriptionTable.vue View File

48
       </el-table-column>
48
       </el-table-column>
49
 
49
 
50
 
50
 
51
+      <el-table-column align="center" prop="name" width="60" label="执行状态">
52
+        <template slot-scope="scope">
53
+          <div> {{scope.row.execution_state == 1?'已执行':'未执行'}}</div>
54
+        </template>
55
+      </el-table-column>
56
+
57
+
51
 
58
 
52
       <el-table-column align="center" prop="name" width="60" label="医保编码">
59
       <el-table-column align="center" prop="name" width="60" label="医保编码">
53
         <template slot-scope="scope">
60
         <template slot-scope="scope">
170
         </template>
177
         </template>
171
       </el-table-column>
178
       </el-table-column>
172
 
179
 
180
+      <el-table-column align="center" prop="name" width="60" label="执行状态">
181
+        <template slot-scope="scope">
182
+          <div> {{scope.row.execution_state == 1?'已执行':'未执行'}}</div>
183
+        </template>
184
+      </el-table-column>
185
+
173
 
186
 
174
 
187
 
175
 
188
 

+ 23 - 2
src/xt_pages/hospitalStation/index.vue View File

73
                         </el-select>
73
                         </el-select>
74
                     </el-form-item>
74
                     </el-form-item>
75
 
75
 
76
+                  <el-form-item label="参保地:">
77
+                    <el-select v-model="form.insuplc_admdvs" placeholder="请选择" style="width:100%;">
78
+                      <el-option
79
+                          v-for="item in InsuplcAdmdvs"
80
+                          :key="item.value"
81
+                          :label="item.label"
82
+                          :value="item.value">
83
+                      </el-option>
84
+                    </el-select>
85
+                  </el-form-item>
86
+
76
                     <!--<el-form-item class="specialFormItem" label="医保卡号:">-->
87
                     <!--<el-form-item class="specialFormItem" label="医保卡号:">-->
77
                     <!--<div style="display:flex;">-->
88
                     <!--<div style="display:flex;">-->
78
                     <!--<el-input v-model="form.medicalInsuranceCard"></el-input>-->
89
                     <!--<el-input v-model="form.medicalInsuranceCard"></el-input>-->
277
           phone: '',
288
           phone: '',
278
           id_card_type: 2,
289
           id_card_type: 2,
279
           med_type: '',
290
           med_type: '',
280
-          settlement_value: 1
291
+          settlement_value: 1,
292
+          insuplc_admdvs:''
281
 
293
 
282
         },
294
         },
283
 
295
 
442
                 }).then(() => {
454
                 }).then(() => {
443
 
455
 
444
 
456
 
457
+
445
                 }).catch(() => {
458
                 }).catch(() => {
446
                 })
459
                 })
447
               } else {
460
               } else {
448
                 // console.log(parseNumber(response.data.data.info.output.insuinfo.psn_type))
461
                 // console.log(parseNumber(response.data.data.info.output.insuinfo.psn_type))
449
                 // console.log(parseNumber(response.data.data.insutype))
462
                 // console.log(parseNumber(response.data.data.insutype))
463
+                for(let i =0; i < response.data.data.info.output.insuinfo.length; i++){
464
+                  that.InsuplcAdmdvs.push({
465
+                    value:response.data.data.info.output.insuinfo[i].insuplc_admdvs,
466
+                    label:response.data.data.info.output.insuinfo[i].insuplc_admdvs,
467
+                  })
468
+
469
+                }
450
 
470
 
451
                 that.form.psn_type = parseInt(response.data.data.info.output.insuinfo[0].psn_type)
471
                 that.form.psn_type = parseInt(response.data.data.info.output.insuinfo[0].psn_type)
452
                 that.form.social_type = parseInt(response.data.data.insutype)
472
                 that.form.social_type = parseInt(response.data.data.insutype)
693
               start_time: this.form.start_time,
713
               start_time: this.form.start_time,
694
               social_type: this.form.social_type,
714
               social_type: this.form.social_type,
695
               psn_type: this.form.psn_type,
715
               psn_type: this.form.psn_type,
696
-              balance_accounts_type: this.form.settlement_value
716
+              balance_accounts_type: this.form.settlement_value,
717
+              insuplc_admdvs: this.form.insuplc_admdvs
697
 
718
 
698
             }
719
             }
699
             params['record_time'] = this.record_date
720
             params['record_time'] = this.record_date

+ 11 - 0
src/xt_pages/outpatientCharges/components/prescriptionTable.vue View File

47
         </template>
47
         </template>
48
       </el-table-column>
48
       </el-table-column>
49
 
49
 
50
+      <el-table-column align="center" prop="name" width="60" label="执行状态">
51
+        <template slot-scope="scope">
52
+          <div> {{scope.row.execution_state == 1 ? '已执行':'未执行'}}</div>
53
+        </template>
54
+      </el-table-column>
55
+
50
 
56
 
51
       <el-table-column align="center" prop="name" width="120" label="医保编码">
57
       <el-table-column align="center" prop="name" width="120" label="医保编码">
52
         <template slot-scope="scope">
58
         <template slot-scope="scope">
150
         <template slot-scope="scope">{{scope.row.price}}元</template>
156
         <template slot-scope="scope">{{scope.row.price}}元</template>
151
       </el-table-column>
157
       </el-table-column>
152
 
158
 
159
+      <el-table-column align="center" prop="name" width="60" label="执行状态">
160
+        <template slot-scope="scope">
161
+          <div> {{scope.row.execution_state == 1 ? '已执行':'未执行'}}</div>
162
+        </template>
163
+      </el-table-column>
153
 
164
 
154
 
165
 
155
       <el-table-column align="center" prop="name" width="120" label="医保编码">
166
       <el-table-column align="center" prop="name" width="120" label="医保编码">

+ 64 - 0
src/xt_pages/outpatientCharges/components/registerDialog.vue View File

110
       <!--</el-select>-->
110
       <!--</el-select>-->
111
       <!--</el-form-item>-->
111
       <!--</el-form-item>-->
112
 
112
 
113
+      <el-form-item label="参保地:">
114
+        <el-select v-model="form.insuplc_admdvs" placeholder="请选择" style="width:100%;">
115
+          <el-option
116
+              v-for="item in InsuplcAdmdvs"
117
+              :key="item.value"
118
+              :label="item.label"
119
+              :value="item.value">
120
+          </el-option>
121
+        </el-select>
122
+      </el-form-item>
123
+
124
+
113
 
125
 
114
       <el-form-item label="结算类型:">
126
       <el-form-item label="结算类型:">
115
         <el-select v-model="form.settlement_value" placeholder="请选择" style="width:100%;">
127
         <el-select v-model="form.settlement_value" placeholder="请选择" style="width:100%;">
247
 
259
 
248
         form: {
260
         form: {
249
           id: '',
261
           id: '',
262
+          insuplc_admdvs:'',
250
           settlement_value: 1,
263
           settlement_value: 1,
251
           medical_insurance_card: '',
264
           medical_insurance_card: '',
252
           name: '',
265
           name: '',
288
           { value: 7, label: '合同' },
301
           { value: 7, label: '合同' },
289
           {value: 8, label: '医保自费'},
302
           {value: 8, label: '医保自费'},
290
 
303
 
304
+        ],InsuplcAdmdvs:[
291
         ],
305
         ],
292
         sex: [{
306
         sex: [{
293
           value: 1,
307
           value: 1,
544
           '-' +
558
           '-' +
545
           birth.substr(6, 2)
559
           birth.substr(6, 2)
546
         this.form.age = jsGetAge(births, '-')
560
         this.form.age = jsGetAge(births, '-')
561
+
562
+
563
+
564
+        var that = this
565
+        let params={
566
+          id_card_no: this.form.id_card,
567
+          admin_user_id:this.$store.getters.xt_user.user.id,
568
+
569
+        }
570
+        axios.get('http://127.0.0.1:9532/zh/api/patient/info', {
571
+          params: params,
572
+          headers: {
573
+            'Permission': 5
574
+          }
575
+        })
576
+            .then(function(response) {
577
+              if (response.data.state == 0) {
578
+                that.$message.error(response.data.msg)
579
+                that.loadingone = false
580
+                return false
581
+              } else {
582
+                that.loadingone = false
583
+                if (response.data.data.failed_code == -10) {
584
+                  // that.$message.error(response.data.data.msg)
585
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
586
+                    confirmButtonText: '确 定',
587
+                    type: 'warning'
588
+                  }).then(() => {
589
+
590
+                  }).catch(() => {
591
+                  })
592
+                } else {
593
+                  for(let i =0; i < response.data.data.info.output.insuinfo.length; i++){
594
+                    that.InsuplcAdmdvs.push({
595
+                      value:response.data.data.info.output.insuinfo[i].insuplc_admdvs,
596
+                      label:response.data.data.info.output.insuinfo[i].insuplc_admdvs,
597
+                    })
598
+
599
+                  }
600
+
601
+
602
+                  that.form.social_type = parseInt(response.data.data.insutype)
603
+                }
604
+              }
605
+            })
606
+            .catch(function(error) {
607
+
608
+            })
609
+
547
       },
610
       },
548
       querySearchAsync(keyword, cb) {
611
       querySearchAsync(keyword, cb) {
549
         let key = ''
612
         let key = ''
630
         this.form.cost = ''
693
         this.form.cost = ''
631
         this.form.phone = ''
694
         this.form.phone = ''
632
         this.form.social_type = ''
695
         this.form.social_type = ''
696
+        this.form.insuplc_admdvs =''
633
 
697
 
634
         this.form.p_type = 14
698
         this.form.p_type = 14
635
         this.form.sick_type = this.sick[0].id
699
         this.form.sick_type = this.sick[0].id

+ 10 - 3
src/xt_pages/outpatientCharges/outpatientChargesManagement.vue View File

1232
                 prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
1232
                 prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
1233
                 medical_insurance_number: prescription.advices[b].med_list_codg,
1233
                 medical_insurance_number: prescription.advices[b].med_list_codg,
1234
 
1234
 
1235
+
1235
                 code: prescription.advices[b].drug.medical_insurance_number,
1236
                 code: prescription.advices[b].drug.medical_insurance_number,
1236
                 spec: spec,
1237
                 spec: spec,
1237
                 det_item_fee_sumamt: prescription.advices[b].order_info.det_item_fee_sumamt,
1238
                 det_item_fee_sumamt: prescription.advices[b].order_info.det_item_fee_sumamt,
1239
                 fulamt_ownpay_amt: prescription.advices[b].order_info.fulamt_ownpay_amt,
1240
                 fulamt_ownpay_amt: prescription.advices[b].order_info.fulamt_ownpay_amt,
1240
                 overlmt_amt: prescription.advices[b].order_info.overlmt_amt,
1241
                 overlmt_amt: prescription.advices[b].order_info.overlmt_amt,
1241
                 preselfpay_amt: prescription.advices[b].order_info.preselfpay_amt,
1242
                 preselfpay_amt: prescription.advices[b].order_info.preselfpay_amt,
1242
-                inscp_scp_amt: prescription.advices[b].order_info.inscp_scp_amt
1243
+                inscp_scp_amt: prescription.advices[b].order_info.inscp_scp_amt,
1244
+                execution_state: prescription.advices[b].execution_state,
1243
 
1245
 
1244
               }
1246
               }
1245
               tempAdvice.push(obj)
1247
               tempAdvice.push(obj)
1267
                 fulamt_ownpay_amt: prescription.project[b].order_info.fulamt_ownpay_amt,
1269
                 fulamt_ownpay_amt: prescription.project[b].order_info.fulamt_ownpay_amt,
1268
                 overlmt_amt: prescription.project[b].order_info.overlmt_amt,
1270
                 overlmt_amt: prescription.project[b].order_info.overlmt_amt,
1269
                 preselfpay_amt: prescription.project[b].order_info.preselfpay_amt,
1271
                 preselfpay_amt: prescription.project[b].order_info.preselfpay_amt,
1270
-                inscp_scp_amt: prescription.project[b].order_info.inscp_scp_amt
1272
+                inscp_scp_amt: prescription.project[b].order_info.inscp_scp_amt,
1273
+
1274
+                execution_state: prescription.project[b].execution_state,
1275
+
1271
 
1276
 
1272
               }
1277
               }
1273
 
1278
 
3611
                       fulamt_ownpay_amt: prescription.advices[b].order_info.fulamt_ownpay_amt,
3616
                       fulamt_ownpay_amt: prescription.advices[b].order_info.fulamt_ownpay_amt,
3612
                       overlmt_amt: prescription.advices[b].order_info.overlmt_amt,
3617
                       overlmt_amt: prescription.advices[b].order_info.overlmt_amt,
3613
                       preselfpay_amt: prescription.advices[b].order_info.preselfpay_amt,
3618
                       preselfpay_amt: prescription.advices[b].order_info.preselfpay_amt,
3614
-                      inscp_scp_amt: prescription.advices[b].order_info.inscp_scp_amt
3619
+                      inscp_scp_amt: prescription.advices[b].order_info.inscp_scp_amt,
3620
+                      execution_state:prescription.advices[b].execution_state,
3615
 
3621
 
3616
                     }
3622
                     }
3617
                     tempAdvice.push(obj)
3623
                     tempAdvice.push(obj)
3634
                       // medical_code: prescription.project[b].project.medical_code,
3640
                       // medical_code: prescription.project[b].project.medical_code,
3635
                       unit: prescription.project[b].unit,
3641
                       unit: prescription.project[b].unit,
3636
                       type: prescription.project[b].type,
3642
                       type: prescription.project[b].type,
3643
+                      execution_state:prescription.project[b].execution_state,
3637
 
3644
 
3638
                       det_item_fee_sumamt: prescription.project[b].order_info.det_item_fee_sumamt,
3645
                       det_item_fee_sumamt: prescription.project[b].order_info.det_item_fee_sumamt,
3639
                       fulamt_ownpay_amt: prescription.project[b].order_info.fulamt_ownpay_amt,
3646
                       fulamt_ownpay_amt: prescription.project[b].order_info.fulamt_ownpay_amt,

+ 6 - 3
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue View File

2296
                   this.prescriptions[i].addition[b].count = this.prescriptions[i].addition[b].count.toString()
2296
                   this.prescriptions[i].addition[b].count = this.prescriptions[i].addition[b].count.toString()
2297
                 }
2297
                 }
2298
               }
2298
               }
2299
-            
2299
+
2300
               let data = {
2300
               let data = {
2301
                 'prescriptions': this.prescriptions
2301
                 'prescriptions': this.prescriptions
2302
               }
2302
               }
2864
                   medical_insurance_number: temp[b].medical_insurance_number,
2864
                   medical_insurance_number: temp[b].medical_insurance_number,
2865
                   drug: temp[b],
2865
                   drug: temp[b],
2866
                   groupno: index + temp_index,
2866
                   groupno: index + temp_index,
2867
-                  hosp_appr_flag: '1'
2867
+                  hosp_appr_flag: '1',
2868
+                  execution_state:2,
2868
                 }
2869
                 }
2869
 
2870
 
2870
                 if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
2871
                 if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
2893
                   remark: '',
2894
                   remark: '',
2894
                   medical_code: temp2[b].medical_code,
2895
                   medical_code: temp2[b].medical_code,
2895
                   unit: temp2[b].unit,
2896
                   unit: temp2[b].unit,
2896
-                  type: temp2[b].type
2897
+                  type: temp2[b].type,
2898
+                  execution_state:2,
2899
+
2897
                 }
2900
                 }
2898
 
2901
 
2899
                 if (temp2[b].type == 2){
2902
                 if (temp2[b].type == 2){

+ 69 - 24
src/xt_pages/outpatientDoctorStation/doctorDesk.vue View File

983
             // price = price + project_month_prescriptions.project[a].price
983
             // price = price + project_month_prescriptions.project[a].price
984
             obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
984
             obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
985
 
985
 
986
+
987
+
988
+
986
           }
989
           }
987
         }
990
         }
988
         obj['total'] = count
991
         obj['total'] = count
1445
                   id: prescription.advices[b].drug_id,
1448
                   id: prescription.advices[b].drug_id,
1446
                   drug: prescription.advices[b].drug,
1449
                   drug: prescription.advices[b].drug,
1447
                   groupno: prescription.advices[b].groupno,
1450
                   groupno: prescription.advices[b].groupno,
1448
-                  hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
1451
+                  hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString(),
1452
+                  execution_state: prescription.advices[b].execution_state,
1449
 
1453
 
1450
                 }
1454
                 }
1451
                 tempAdvice.push(obj)
1455
                 tempAdvice.push(obj)
1467
                   remark: prescription.project[b].remark,
1471
                   remark: prescription.project[b].remark,
1468
                   medical_code: prescription.project[b].project.medical_code,
1472
                   medical_code: prescription.project[b].project.medical_code,
1469
                   unit: prescription.project[b].project.unit,
1473
                   unit: prescription.project[b].project.unit,
1470
-                  type: prescription.project[b].type
1474
+                  type: prescription.project[b].type,
1475
+                  execution_state: prescription.project[b].execution_state,
1476
+
1471
 
1477
 
1472
                 }
1478
                 }
1473
 
1479
 
1575
                     id: prescription.advices[b].drug_id,
1581
                     id: prescription.advices[b].drug_id,
1576
                     drug: prescription.advices[b].drug,
1582
                     drug: prescription.advices[b].drug,
1577
                     groupno: prescription.advices[b].groupno,
1583
                     groupno: prescription.advices[b].groupno,
1578
-                    hosp_appr_flag: '1'
1584
+                    hosp_appr_flag: '1',
1585
+                    execution_state: 2,
1586
+
1579
 
1587
 
1580
                   }
1588
                   }
1581
 
1589
 
1620
                     remark: prescription.project[b].remark,
1628
                     remark: prescription.project[b].remark,
1621
                     medical_code: prescription.project[b].project.medical_code,
1629
                     medical_code: prescription.project[b].project.medical_code,
1622
                     unit: prescription.project[b].project.unit,
1630
                     unit: prescription.project[b].project.unit,
1623
-                    type: prescription.project[b].type
1631
+                    type: prescription.project[b].type,
1632
+                    execution_state: 2,
1624
 
1633
 
1625
                   }
1634
                   }
1626
 
1635
 
1845
                         id: prescription.advices[b].drug_id,
1854
                         id: prescription.advices[b].drug_id,
1846
                         drug: prescription.advices[b].drug,
1855
                         drug: prescription.advices[b].drug,
1847
                         groupno: prescription.advices[b].groupno,
1856
                         groupno: prescription.advices[b].groupno,
1848
-                        hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
1857
+                        hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString(),
1858
+                        execution_state: prescription.advices[b].execution_state,
1859
+
1849
 
1860
 
1850
                       }
1861
                       }
1851
                       tempAdvice.push(obj)
1862
                       tempAdvice.push(obj)
1867
                         remark: prescription.project[b].remark,
1878
                         remark: prescription.project[b].remark,
1868
                         medical_code: prescription.project[b].project.medical_code,
1879
                         medical_code: prescription.project[b].project.medical_code,
1869
                         unit: prescription.project[b].project.unit,
1880
                         unit: prescription.project[b].project.unit,
1870
-                        type: prescription.project[b].type
1881
+                        type: prescription.project[b].type,
1882
+                        execution_state: prescription.project[b].execution_state,
1871
                       }
1883
                       }
1872
 
1884
 
1873
                       if (prescription.project[b].type == 2) {
1885
                       if (prescription.project[b].type == 2) {
1977
                           drug: prescription.advices[b].drug,
1989
                           drug: prescription.advices[b].drug,
1978
                           groupno: prescription.advices[b].groupno,
1990
                           groupno: prescription.advices[b].groupno,
1979
 
1991
 
1980
-                          hosp_appr_flag: '1'
1992
+                          hosp_appr_flag: '1',
1993
+                          execution_state: 2,
1994
+
1981
 
1995
 
1982
                         }
1996
                         }
1983
                         console.log('看看数据1:')
1997
                         console.log('看看数据1:')
2021
                           remark: prescription.project[b].remark,
2035
                           remark: prescription.project[b].remark,
2022
                           medical_code: prescription.project[b].project.medical_code,
2036
                           medical_code: prescription.project[b].project.medical_code,
2023
                           unit: prescription.project[b].project.unit,
2037
                           unit: prescription.project[b].project.unit,
2024
-                          type: prescription.project[b].type
2038
+                          type: prescription.project[b].type,
2039
+                          execution_state: 2,
2025
 
2040
 
2026
                         }
2041
                         }
2027
 
2042
 
2344
                         id: prescription.advices[b].drug_id,
2359
                         id: prescription.advices[b].drug_id,
2345
                         drug: prescription.advices[b].drug,
2360
                         drug: prescription.advices[b].drug,
2346
                         groupno: prescription.advices[b].groupno,
2361
                         groupno: prescription.advices[b].groupno,
2347
-                        hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
2362
+                        hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString(),
2363
+                        execution_state: prescription.advices[b].execution_state,
2348
 
2364
 
2349
                       }
2365
                       }
2350
                       tempAdvice.push(obj)
2366
                       tempAdvice.push(obj)
2365
                         remark: prescription.project[b].remark,
2381
                         remark: prescription.project[b].remark,
2366
                         medical_code: prescription.project[b].project.medical_code,
2382
                         medical_code: prescription.project[b].project.medical_code,
2367
                         unit: prescription.project[b].project.unit,
2383
                         unit: prescription.project[b].project.unit,
2368
-                        type: prescription.project[b].type
2384
+                        type: prescription.project[b].type,
2385
+                        execution_state: prescription.project[b].execution_state,
2386
+
2369
                       }
2387
                       }
2370
 
2388
 
2371
                       if (prescription.project[b].type == 2) {
2389
                       if (prescription.project[b].type == 2) {
2469
                           drug: prescription.advices[b].drug,
2487
                           drug: prescription.advices[b].drug,
2470
                           groupno: prescription.advices[b].groupno,
2488
                           groupno: prescription.advices[b].groupno,
2471
 
2489
 
2472
-                          hosp_appr_flag: '1'
2490
+                          hosp_appr_flag: '1',
2491
+                          execution_state: 2,
2492
+
2473
 
2493
 
2474
                         }
2494
                         }
2475
                         console.log('看看数据2:')
2495
                         console.log('看看数据2:')
2511
                           remark: prescription.project[b].remark,
2531
                           remark: prescription.project[b].remark,
2512
                           medical_code: prescription.project[b].project.medical_code,
2532
                           medical_code: prescription.project[b].project.medical_code,
2513
                           unit: prescription.project[b].project.unit,
2533
                           unit: prescription.project[b].project.unit,
2514
-                          type: prescription.project[b].type
2534
+                          type: prescription.project[b].type,
2535
+                          execution_state: 2,
2536
+
2515
                         }
2537
                         }
2516
 
2538
 
2517
                         if (prescription.project[b].type == 2) {
2539
                         if (prescription.project[b].type == 2) {
2823
                       id: prescription.advices[b].drug_id,
2845
                       id: prescription.advices[b].drug_id,
2824
                       drug: prescription.advices[b].drug,
2846
                       drug: prescription.advices[b].drug,
2825
                       groupno: prescription.advices[b].groupno,
2847
                       groupno: prescription.advices[b].groupno,
2826
-                      hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
2848
+                      hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString(),
2849
+                      execution_state: prescription.advices[b].execution_state
2850
+
2827
 
2851
 
2828
                     }
2852
                     }
2829
                     tempAdvice.push(obj)
2853
                     tempAdvice.push(obj)
2844
                       remark: prescription.project[b].remark,
2868
                       remark: prescription.project[b].remark,
2845
                       medical_code: prescription.project[b].project.medical_code,
2869
                       medical_code: prescription.project[b].project.medical_code,
2846
                       unit: prescription.project[b].project.unit,
2870
                       unit: prescription.project[b].project.unit,
2847
-                      type: prescription.project[b].type
2871
+                      type: prescription.project[b].type,
2872
+                      execution_state: prescription.project[b].execution_state
2873
+
2848
                     }
2874
                     }
2849
 
2875
 
2850
                     if (prescription.project[b].type == 2) {
2876
                     if (prescription.project[b].type == 2) {
2948
                         drug: prescription.advices[b].drug,
2974
                         drug: prescription.advices[b].drug,
2949
                         groupno: prescription.advices[b].groupno,
2975
                         groupno: prescription.advices[b].groupno,
2950
 
2976
 
2951
-                        hosp_appr_flag: '1'
2977
+                        hosp_appr_flag: '1',
2978
+                        execution_state: 2
2979
+
2952
 
2980
 
2953
                       }
2981
                       }
2954
                       console.log('看看数据3:')
2982
                       console.log('看看数据3:')
2990
                         remark: prescription.project[b].remark,
3018
                         remark: prescription.project[b].remark,
2991
                         medical_code: prescription.project[b].project.medical_code,
3019
                         medical_code: prescription.project[b].project.medical_code,
2992
                         unit: prescription.project[b].project.unit,
3020
                         unit: prescription.project[b].project.unit,
2993
-                        type: prescription.project[b].type
3021
+                        type: prescription.project[b].type,
3022
+                        execution_state: 2
3023
+
2994
                       }
3024
                       }
2995
 
3025
 
2996
                       if (prescription.project[b].type == 2) {
3026
                       if (prescription.project[b].type == 2) {
3362
                         id: prescription.advices[b].drug_id,
3392
                         id: prescription.advices[b].drug_id,
3363
                         drug: prescription.advices[b].drug,
3393
                         drug: prescription.advices[b].drug,
3364
                         groupno: prescription.advices[b].groupno,
3394
                         groupno: prescription.advices[b].groupno,
3365
-                        hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
3395
+                        hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString(),
3396
+                        execution_state: prescription.advices[b].execution_state
3397
+
3366
 
3398
 
3367
                       }
3399
                       }
3368
                       tempAdvice.push(obj)
3400
                       tempAdvice.push(obj)
3383
                         remark: prescription.project[b].remark,
3415
                         remark: prescription.project[b].remark,
3384
                         medical_code: prescription.project[b].project.medical_code,
3416
                         medical_code: prescription.project[b].project.medical_code,
3385
                         unit: prescription.project[b].project.unit,
3417
                         unit: prescription.project[b].project.unit,
3386
-                        type: prescription.project[b].type
3418
+                        type: prescription.project[b].type,
3419
+                        execution_state: prescription.project[b].execution_state
3420
+
3387
                       }
3421
                       }
3388
 
3422
 
3389
                       if (prescription.project[b].type == 2) {
3423
                       if (prescription.project[b].type == 2) {
3494
                           drug: prescription.advices[b].drug,
3528
                           drug: prescription.advices[b].drug,
3495
                           groupno: prescription.advices[b].groupno,
3529
                           groupno: prescription.advices[b].groupno,
3496
 
3530
 
3497
-                          hosp_appr_flag: '1'
3531
+                          hosp_appr_flag: '1',
3532
+                          execution_state: 2,
3533
+
3498
 
3534
 
3499
                         }
3535
                         }
3500
                         console.log('看看数据4:')
3536
                         console.log('看看数据4:')
3536
                           remark: prescription.project[b].remark,
3572
                           remark: prescription.project[b].remark,
3537
                           medical_code: prescription.project[b].project.medical_code,
3573
                           medical_code: prescription.project[b].project.medical_code,
3538
                           unit: prescription.project[b].project.unit,
3574
                           unit: prescription.project[b].project.unit,
3539
-                          type: prescription.project[b].type
3575
+                          type: prescription.project[b].type,
3576
+                          execution_state: 2,
3540
                         }
3577
                         }
3541
 
3578
 
3542
                         if (prescription.project[b].type == 2) {
3579
                         if (prescription.project[b].type == 2) {
3931
                         id: prescription.advices[b].drug_id,
3968
                         id: prescription.advices[b].drug_id,
3932
                         drug: prescription.advices[b].drug,
3969
                         drug: prescription.advices[b].drug,
3933
                         groupno: prescription.advices[b].groupno,
3970
                         groupno: prescription.advices[b].groupno,
3934
-                        hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
3971
+                        hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString(),
3972
+                        execution_state: prescription.advices[b].execution_state
3973
+
3935
 
3974
 
3936
                       }
3975
                       }
3937
                       tempAdvice.push(obj)
3976
                       tempAdvice.push(obj)
3953
                         remark: prescription.project[b].remark,
3992
                         remark: prescription.project[b].remark,
3954
                         medical_code: prescription.project[b].project.medical_code,
3993
                         medical_code: prescription.project[b].project.medical_code,
3955
                         unit: prescription.project[b].project.unit,
3994
                         unit: prescription.project[b].project.unit,
3956
-                        type: prescription.project[b].type
3995
+                        type: prescription.project[b].type,
3996
+                        execution_state: prescription.project[b].execution_state
3997
+
3957
                       }
3998
                       }
3958
 
3999
 
3959
                       if (prescription.project[b].type == 2) {
4000
                       if (prescription.project[b].type == 2) {
4064
                           drug: prescription.advices[b].drug,
4105
                           drug: prescription.advices[b].drug,
4065
                           groupno: prescription.advices[b].groupno,
4106
                           groupno: prescription.advices[b].groupno,
4066
 
4107
 
4067
-                          hosp_appr_flag: '1'
4108
+                          hosp_appr_flag: '1',
4109
+                          execution_state: 2
4110
+
4068
 
4111
 
4069
                         }
4112
                         }
4070
                         console.log('看看数据5:')
4113
                         console.log('看看数据5:')
4107
                           remark: prescription.project[b].remark,
4150
                           remark: prescription.project[b].remark,
4108
                           medical_code: prescription.project[b].project.medical_code,
4151
                           medical_code: prescription.project[b].project.medical_code,
4109
                           unit: prescription.project[b].project.unit,
4152
                           unit: prescription.project[b].project.unit,
4110
-                          type: prescription.project[b].type
4153
+                          type: prescription.project[b].type,
4154
+                          execution_state: 2
4155
+
4111
                         }
4156
                         }
4112
 
4157
 
4113
                         if (prescription.project[b].type == 2) {
4158
                         if (prescription.project[b].type == 2) {

+ 9 - 1
src/xt_pages/stock/Dialog/goodInfoDailog.vue View File

108
             </el-form-item>
108
             </el-form-item>
109
             <el-form-item label="医保编码 : " prop="medical_insurance_number">
109
             <el-form-item label="医保编码 : " prop="medical_insurance_number">
110
               <el-input v-model="form.medical_insurance_number" style="width:160px;" placeholder=""
110
               <el-input v-model="form.medical_insurance_number" style="width:160px;" placeholder=""
111
-                        maxlength="30"></el-input>
111
+                        ></el-input>
112
+            </el-form-item>
113
+            <el-form-item label="省编码 : " prop="provinces_code">
114
+              <el-input v-model="form.provinces_code" style="width:160px;" placeholder=""
115
+                        ></el-input>
112
             </el-form-item>
116
             </el-form-item>
113
             <el-form-item label="是否特病目录:" prop="is_special_diseases">
117
             <el-form-item label="是否特病目录:" prop="is_special_diseases">
114
               <el-select v-model="form.is_special_diseases" style="width:160px;" placeholder="请选择">
118
               <el-select v-model="form.is_special_diseases" style="width:160px;" placeholder="请选择">
342
           good_unit: '',
346
           good_unit: '',
343
           retail_price: '',
347
           retail_price: '',
344
           medical_insurance_number: '',
348
           medical_insurance_number: '',
349
+          provinces_code:'',
345
           is_special_diseases: '',
350
           is_special_diseases: '',
346
           is_record: '',
351
           is_record: '',
347
           statistics_category: '',
352
           statistics_category: '',
475
               good_unit: '',
480
               good_unit: '',
476
               retail_price: '',
481
               retail_price: '',
477
               medical_insurance_number: '',
482
               medical_insurance_number: '',
483
+            provinces_code:'',
478
               is_special_diseases: '',
484
               is_special_diseases: '',
479
               is_record: '',
485
               is_record: '',
480
               statistics_category: '',
486
               statistics_category: '',
559
         form['manufacturer'] = this.form.manufacturer
565
         form['manufacturer'] = this.form.manufacturer
560
         form['retail_price'] = this.form.retail_price
566
         form['retail_price'] = this.form.retail_price
561
         form['medical_insurance_number'] = this.form.medical_insurance_number
567
         form['medical_insurance_number'] = this.form.medical_insurance_number
568
+        form['provinces_code'] = this.form.provinces_code
569
+
562
         form['is_special_diseases'] = this.form.is_special_diseases
570
         form['is_special_diseases'] = this.form.is_special_diseases
563
         form['is_record'] = this.form.is_record
571
         form['is_record'] = this.form.is_record
564
         form['statistics_category'] = this.form.statistics_category
572
         form['statistics_category'] = this.form.statistics_category

+ 34 - 49
src/xt_pages/stock/drugs/components/drugOutDetail.vue View File

71
       </div>
71
       </div>
72
     </div>
72
     </div>
73
 
73
 
74
-    
75
-
76
-    <!-- <div class="cell clearfix">
77
-      <label class="title"><span class="name">单据类型</span> : </label>
78
-      <el-select
79
-        size="small"
80
-        v-model="order_type"
81
-        clearable
82
-        placeholder="单据类型"
83
-        @change="changeType"
84
-      >
85
-        <el-option
86
-          v-for="item in orderTypeArr"
87
-          :key="item.value"
88
-          :label="item.label"
89
-          :value="item.value"
90
-        >
91
-        </el-option>
92
-      </el-select>
93
-    </div> -->
94
-
95
-    <!-- <div class="cell clearfix">
96
-      <label class="title"><span class="name">其它</span> : </label>
97
-      <el-select
98
-        size="small"
99
-        v-model="manufacturer_id"
100
-        clearable
101
-        placeholder="厂商"
102
-        @change="changeManufacturer"
103
-      >
104
-        <el-option
105
-          v-for="item in manufacturer"
106
-          :key="item.id"
107
-          :label="item.manufacturer_name"
108
-          :value="item.id"
109
-        >
110
-        </el-option>
111
-      </el-select>
112
-    </div> -->
113
-
74
+  
114
     <el-row :gutter="12" style="margin-top: 10px">
75
     <el-row :gutter="12" style="margin-top: 10px">
115
       <el-table
76
       <el-table
116
         :data="tableData"
77
         :data="tableData"
166
         </el-table-column>
127
         </el-table-column>
167
         <el-table-column label="出货价" align="center">
128
         <el-table-column label="出货价" align="center">
168
           <template slot-scope="scope">
129
           <template slot-scope="scope">
169
-           <span v-if="org_id == 9919 || org_id == 9671">{{scope.row.last_price}} </span> 
170
-           <span v-else>{{scope.row.price}}</span>
130
+           <span v-if="org_id == 9919">{{scope.row.last_price}} </span> 
131
+           <span v-else>
132
+             <span v-if="scope.row.price >0"> {{scope.row.price}}</span>
133
+            <span v-if="scope.row.price  == 0"> {{getPrice(scope.row.drug_id)}}</span>
134
+           </span>
171
           </template>
135
           </template>
172
         </el-table-column>
136
         </el-table-column>
173
         <el-table-column label="数量" align="center">
137
         <el-table-column label="数量" align="center">
177
         </el-table-column>
141
         </el-table-column>
178
         <el-table-column label="总价" align="center">
142
         <el-table-column label="总价" align="center">
179
           <template slot-scope="scope">
143
           <template slot-scope="scope">
180
-            
181
-            {{scope.row.total_price}}
144
+           <span v-if="org_id == 9919">{{(scope.row.last_price * scope.row.count).toFixed(2)}} </span> 
145
+           <span v-else>
146
+             <span v-if="scope.row.price >0">{{(scope.row.last_price * scope.row.count).toFixed(2)}}</span>
147
+             <span v-if="scope.row.price  == 0">{{(getPrice(scope.row.drug_id)* scope.row.count).toFixed(2)}}</span>
148
+           </span>
149
+            <!-- {{scope.row.total_price}} -->
182
           </template>
150
           </template>
183
         </el-table-column>
151
         </el-table-column>
184
       </el-table>
152
       </el-table>
424
           for(let i=0;i<order.length;i++){
392
           for(let i=0;i<order.length;i++){
425
              order[i].specification_name  = order[i].dose + order[i].dose_unit + "*" + order[i].min_number +  order[i].min_unit + "/" + order[i].max_unit
393
              order[i].specification_name  = order[i].dose + order[i].dose_unit + "*" + order[i].min_number +  order[i].min_unit + "/" + order[i].max_unit
426
              order[i].is_total = 0
394
              order[i].is_total = 0
427
-             if(this.org_id == 9919 || this.org_id == 9671){
395
+             if(this.org_id == 9919){
428
                order[i].total_price = order[i].count * order[i].last_price
396
                order[i].total_price = order[i].count * order[i].last_price
429
                total_price += order[i].count * order[i].last_price
397
                total_price += order[i].count * order[i].last_price
430
              }else{
398
              }else{
431
-                order[i].total_price = order[i].count * order[i].price
432
-                total_price += order[i].count * order[i].price
399
+               if(order[i].price > 0){
400
+                 order[i].total_price = order[i].count * order[i].price
401
+                 total_price += order[i].count * order[i].price
402
+               }
403
+               if(order[i].price ==0 ){
404
+                  order[i].total_price = order[i].count * this.getPrice(order[i].drug_id)
405
+                  total_price += order[i].count * this.getPrice(order[i].drug_id)
406
+                  order[i].price = this.getPrice(order[i].drug_id)
407
+               } 
408
+               
433
              }
409
              }
434
             
410
             
435
           }
411
           }
451
            let objInfo = {}
427
            let objInfo = {}
452
           order.forEach((item,index)=>{
428
           order.forEach((item,index)=>{
453
              let { drug_id } = item
429
              let { drug_id } = item
454
-             if(this.org_id == 9671 || this.org_id == 9919){
430
+             if( this.org_id == 9919){
455
               if(!objInfo[drug_id]){
431
               if(!objInfo[drug_id]){
456
                 objInfo[drug_id] = {
432
                 objInfo[drug_id] = {
457
                   drug_id,
433
                   drug_id,
540
           this.tablePrint[i].index = i+1
516
           this.tablePrint[i].index = i+1
541
         }
517
         }
542
         for(let i=0;i<this.tablePrint.length;i++){
518
         for(let i=0;i<this.tablePrint.length;i++){
543
-           if(this.org_id == 9671 || this.org_id == 9919 ){
519
+           if(this.org_id == 9919 ){
544
            
520
            
545
              this.tablePrint[i].count = this.getCountSix(this.tablePrint[i].drug_id,this.tablePrint[i].child)
521
              this.tablePrint[i].count = this.getCountSix(this.tablePrint[i].drug_id,this.tablePrint[i].child)
546
              this.tablePrint[i].total_price = this.getCountSenven(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].price)
522
              this.tablePrint[i].total_price = this.getCountSenven(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].price)
795
           }
771
           }
796
         }
772
         }
797
         return name
773
         return name
774
+      },
775
+      getPrice(drug_id){
776
+        var price = ""
777
+        for(let i=0;i<this.drugList.length;i++){
778
+          if(drug_id == this.drugList[i].id){
779
+             price = this.drugList[i].min_price
780
+          }
781
+        }
782
+        return price
798
       } 
783
       } 
799
   }
784
   }
800
 };
785
 };

+ 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}}

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

109
        
109
        
110
         <el-table-column prop="drug_name" label="单价" align="center">
110
         <el-table-column prop="drug_name" label="单价" align="center">
111
            <template slot-scope="scope">
111
            <template slot-scope="scope">
112
-              <span>{{scope.row.price}}</span>
112
+              <span v-if="scope.row.price >0">{{scope.row.price}}</span>
113
+              <span v-if="scope.row.price == 0">{{getPrice(scope.row.drug_id)}}</span>
113
            </template>
114
            </template>
114
         </el-table-column>
115
         </el-table-column>
115
          <el-table-column prop="drug_name" label="有效期" align="center">
116
          <el-table-column prop="drug_name" label="有效期" align="center">
268
             this.total = total
269
             this.total = total
269
             var manufacturerList = response.data.data.manufacturerList
270
             var manufacturerList = response.data.data.manufacturerList
270
             this.manufacturerList = manufacturerList
271
             this.manufacturerList = manufacturerList
272
+            this.drug =  response.data.data.drug
271
          
273
          
272
            }
274
            }
273
          })  
275
          })  
518
            name = this.drug.drug_name
520
            name = this.drug.drug_name
519
         }
521
         }
520
         return name
522
         return name
523
+     },
524
+     getPrice(id){
525
+       var min_price = 0 
526
+       if(id == this.drug.id){
527
+         min_price = this.drug.min_price
528
+       }
529
+       return min_price
521
      }
530
      }
522
     }
531
     }
523
   }
532
   }

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

593
         return "";
593
         return "";
594
       }
594
       }
595
     },
595
     },
596
-    showDialog(index, row) {
597
-      this.currentIndex = index;
598
-      const loading = this.$loading({
599
-        lock: true,
600
-        text: "Loading",
601
-        spinner: "el-icon-loading",
602
-        background: "rgba(0, 0, 0, 0.7)"
603
-      });
604
-
605
-      const params = {
606
-        manufacturer_id: this.form.manufacturer,
607
-        dealer_id: this.form.dealer
608
-      };
609
-      GetAllDrugInfoByID(params).then(response => {
610
-        if (response.data.state == 0) {
611
-          this.$message.error(response.data.msg);
612
-          return false;
613
-        } else {
614
-          if (response.data.data.drugs.length <= 0) {
615
-            this.$message.error("该厂商或经销商没有药品信息");
616
-            loading.close();
617
-
618
-            return;
619
-          }
620
-          this.$refs.dialog.show();
621
-          for (let i = 0; i < response.data.data.drugs.length; i++) {
622
-            this.propForm.goods.push(
623
-              response.data.data.drugs[i]
624
-            );
625
-          }
626
-          const obj = {};
627
-          this.propForm.goods = this.propForm.goods.reduce(
628
-            (cur, next) => {
629
-              obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
630
-              return cur;
631
-            },
632
-            []
633
-          ); // 设置cur默认类型为数组,并且初始值为空的数组
634
-        }
635
-
636
-        for (let i = 0; i < this.propForm.goods.length; i++) {
637
-          for (let a = 0; a < this.propForm.goods[i].drug_specs.length; a++) {
638
-            var respObj = this.propForm.goods[i].drug_specs[a];
639
-            respObj["isSelected"] = false;
640
-          }
641
-        }
642
-        loading.close();
643
-      });
644
-    },
596
+    // showDialog(index, row) {
597
+    //   this.currentIndex = index;
598
+    //   const loading = this.$loading({
599
+    //     lock: true,
600
+    //     text: "Loading",
601
+    //     spinner: "el-icon-loading",
602
+    //     background: "rgba(0, 0, 0, 0.7)"
603
+    //   });
604
+
605
+    //   const params = {
606
+    //     manufacturer_id: this.form.manufacturer,
607
+    //     dealer_id: this.form.dealer
608
+    //   };
609
+    //   GetAllDrugInfoByID(params).then(response => {
610
+    //     if (response.data.state == 0) {
611
+    //       this.$message.error(response.data.msg);
612
+    //       return false;
613
+    //     } else {
614
+    //       if (response.data.data.drugs.length <= 0) {
615
+    //         this.$message.error("该厂商或经销商没有药品信息");
616
+    //         loading.close();
617
+
618
+    //         return;
619
+    //       }
620
+    //       this.$refs.dialog.show();
621
+    //       for (let i = 0; i < response.data.data.drugs.length; i++) {
622
+    //         this.propForm.goods.push(
623
+    //           response.data.data.drugs[i]
624
+    //         );
625
+    //       }
626
+    //       const obj = {};
627
+    //       this.propForm.goods = this.propForm.goods.reduce(
628
+    //         (cur, next) => {
629
+    //           obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
630
+    //           return cur;
631
+    //         },
632
+    //         []
633
+    //       ); // 设置cur默认类型为数组,并且初始值为空的数组
634
+    //     }
635
+
636
+    //     for (let i = 0; i < this.propForm.goods.length; i++) {
637
+    //       for (let a = 0; a < this.propForm.goods[i].drug_specs.length; a++) {
638
+    //         var respObj = this.propForm.goods[i].drug_specs[a];
639
+    //         respObj["isSelected"] = false;
640
+    //       }
641
+    //     }
642
+    //     loading.close();
643
+    //   });
644
+    // },
645
     back() {
645
     back() {
646
       this.$router.go(-1);
646
       this.$router.go(-1);
647
     },
647
     },
712
       });
712
       });
713
     },
713
     },
714
     GetOrderDetail: function(order_id) {
714
     GetOrderDetail: function(order_id) {
715
+      this.listLoading = true
715
       const params = {
716
       const params = {
716
         id: order_id
717
         id: order_id
717
       };
718
       };
789
             this.warehouse.warehousing_time,
790
             this.warehouse.warehousing_time,
790
             "{y}-{m}-{d}"
791
             "{y}-{m}-{d}"
791
           );
792
           );
793
+          this.listLoading = false
792
         }
794
         }
793
       });
795
       });
794
     },
796
     },
877
   created() {
879
   created() {
878
    
880
    
879
     this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
881
     this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
880
-    this.GetConfigInfo();
882
+    //this.GetConfigInfo();
881
     this.propForm.goodUnit = this.$store.getters.good_unit;
883
     this.propForm.goodUnit = this.$store.getters.good_unit;
882
     const order_id = this.$route.query.id;
884
     const order_id = this.$route.query.id;
883
     this.GetOrderDetail(order_id);
885
     this.GetOrderDetail(order_id);

+ 5 - 3
src/xt_pages/stock/drugs/drugStockOutOrder.vue View File

224
           </el-table-column>
224
           </el-table-column>
225
           <el-table-column label="出货单价" align="center">
225
           <el-table-column label="出货单价" align="center">
226
             <template slot-scope="scope">
226
             <template slot-scope="scope">
227
-              {{scope.row.price}}
227
+              <span v-if="scope.row.price > 0"> {{scope.row.price}}</span>
228
+              <span v-if="scope.row.price == 0"> {{scope.row.retail_price}}</span>
228
             </template>
229
             </template>
229
           </el-table-column>
230
           </el-table-column>
230
           <!-- <el-table-column label="拆零零售价" align="center">
231
           <!-- <el-table-column label="拆零零售价" align="center">
234
           </el-table-column> -->
235
           </el-table-column> -->
235
           <el-table-column label="总价" align="center">
236
           <el-table-column label="总价" align="center">
236
             <template slot-scope="scope">
237
             <template slot-scope="scope">
237
-              <span>{{getAllPriceOne(scope.row.drug_id,scope.row.price,scope.row.min_price).toFixed(2)}}</span>
238
+              <span v-if="scope.row.price > 0">{{getAllPriceOne(scope.row.drug_id,scope.row.price,scope.row.min_price).toFixed(2)}}</span>
239
+              <span v-if="scope.row.price == 0">{{getAllPriceOne(scope.row.drug_id,scope.row.retail_price,scope.row.min_price).toFixed(2)}}</span>
238
             </template>
240
             </template>
239
           </el-table-column>
241
           </el-table-column>
240
           <el-table-column label="生产厂家" align="center">
242
           <el-table-column label="生产厂家" align="center">
916
           this.tableShow = true
918
           this.tableShow = true
917
           this.tableList = []
919
           this.tableList = []
918
           var list =  response.data.data.list
920
           var list =  response.data.data.list
919
-     
921
+         
920
          this.manufacturerList = response.data.data.manufacturerList
922
          this.manufacturerList = response.data.data.manufacturerList
921
          this.dealerList = response.data.data.dealerList
923
          this.dealerList = response.data.data.dealerList
922
          var drugFlowList = response.data.data.drugFlowList
924
          var drugFlowList = response.data.data.drugFlowList

+ 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

+ 2 - 2
src/xt_pages/stock/stockInOrder.vue View File

208
             {{ scope.row.warehousing_count}}{{scope.row.GoodInfo.packing_unit}}
208
             {{ scope.row.warehousing_count}}{{scope.row.GoodInfo.packing_unit}}
209
           </template>
209
           </template>
210
         </el-table-column>
210
         </el-table-column>
211
-         <el-table-column label="零售价" align="center">
211
+         <!-- <el-table-column label="零售价" align="center">
212
           <template slot-scope="scope">
212
           <template slot-scope="scope">
213
             {{ scope.row.packing_price}}
213
             {{ scope.row.packing_price}}
214
           </template>
214
           </template>
215
-        </el-table-column>
215
+        </el-table-column> -->
216
         <el-table-column label="进货价" align="center">
216
         <el-table-column label="进货价" align="center">
217
           <template slot-scope="scope">
217
           <template slot-scope="scope">
218
             {{ scope.row.price}}
218
             {{ scope.row.price}}

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

660
       }
660
       }
661
       ,
661
       ,
662
       submit() {
662
       submit() {
663
+        console.log("res23322332",this.$refs)
663
         this.$refs['tableForm'].validate((valid) => {
664
         this.$refs['tableForm'].validate((valid) => {
664
           if (valid) {
665
           if (valid) {
665
             const array = this.recordInfo.recordData
666
             const array = this.recordInfo.recordData

+ 688 - 0
src/xt_pages/supply/components/addGoodOrder.vue View File

1
+<template>
2
+<div class="main-contain">
3
+<div class="position">
4
+    <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+</div>
6
+<div class="app-container"  v-loading="loading">
7
+    <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8
+    <div>
9
+        <span style="color:red">*</span><span>供应商:</span>
10
+        <el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择"
11
+        @change="changeTypeName">
12
+        <el-option
13
+            v-for="item in supplyList"
14
+            :key="item.id"
15
+            :label="item.supplier_name"
16
+            :value="item.id">
17
+        </el-option>
18
+        </el-select>
19
+        <span>单据日期:</span>
20
+        <el-date-picker
21
+        size="small"
22
+        v-model="start_time"
23
+        prefix-icon="el-icon-date"
24
+        :editable="false"
25
+        style="width: 196px;"
26
+        type="date"
27
+        placeholder="选择日期时间"
28
+        align="right"
29
+        format="yyyy-MM-dd"
30
+        value-format="yyyy-MM-dd"
31
+        @change="startTimeChange"
32
+        ></el-date-picker>
33
+        <span>交货日期:</span>
34
+        <el-date-picker
35
+            size="small"
36
+            v-model="end_time"
37
+            prefix-icon="el-icon-date"
38
+            :editable="false"
39
+            style="width: 196px;"
40
+            type="date"
41
+            placeholder="选择日期时间"
42
+            align="right"
43
+            format="yyyy-MM-dd"
44
+            value-format="yyyy-MM-dd"
45
+            @change="endTimeChange"
46
+        ></el-date-picker>
47
+        <span>单据编码:{{number}}</span>
48
+
49
+    </div>
50
+    <div>
51
+        <el-button size="small" type="primary" @click="toAdd">生成购货单</el-button>
52
+        <el-button size="small" type="primary" @click="updatePurchaseOrder">修改</el-button>
53
+        <el-button size="small" type="primary" @click="toPrint">打印</el-button>
54
+        <el-button size="small" type="primary" v-if="is_check == 2" @click="checkPurchaseOrder">审核</el-button>
55
+        <el-button size="small" type="primary" v-if="is_check == 1" @click="checkPurchaseOrder">反审核</el-button>
56
+       
57
+    </div>
58
+    </div>
59
+
60
+   <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
61
+    <el-table
62
+    :row-style="{ color: '#303133' }"
63
+    :header-cell-style="{
64
+        backgroundColor: 'rgb(245, 247, 250)',
65
+        color: '#606266'
66
+    }"
67
+    :data="recordInfo.tableList"
68
+    :class="signAndWeighBoxPatients"
69
+    border
70
+    style="width: 100%"
71
+    max-height="450"
72
+    >
73
+    <el-table-column align="center" width="200px">
74
+        <template slot="header" slot-scope="scope">
75
+            <span>商品<span style="color: red">*</span></span>
76
+        </template>
77
+        <template slot-scope="scope">
78
+           <el-form-item :prop="'tableList.' + scope.$index + '.name'" :rules='tableRules.name'>
79
+            <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)" :disabled="disabled">
80
+                <el-option
81
+                    v-for="(item,index) in tabList"
82
+                    :key="index"
83
+                    :label="item.supply_name"
84
+                    :value="item">
85
+                </el-option>
86
+             </el-select>
87
+           </el-form-item>
88
+        </template>
89
+    </el-table-column>
90
+    <el-table-column  align="center" width="150px">
91
+        <template slot="header" slot-scope="scope">
92
+            <span>商品类别</span>
93
+        </template>
94
+        <template slot-scope="scope">
95
+            <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
96
+        </template>
97
+    </el-table-column>
98
+    <el-table-column label="规格&单位" align="center" width="200px">
99
+        <template slot-scope="scope">
100
+            <el-input v-model="scope.row.supply_specification_name" style="width:150px" :disabled="true"></el-input>
101
+        </template>
102
+    </el-table-column>
103
+     <el-table-column label="单位" align="center" width="120px">
104
+        <template slot="header" slot-scope="scope">
105
+            <span>单位<span style="color: red">*</span></span>
106
+        </template>
107
+        <template slot-scope="scope">
108
+          <el-form-item :prop="'tableList.' + scope.$index + '.supply_unit'" :rules='tableRules.supply_unit'>
109
+            <el-select v-model="scope.row.supply_unit" style="width:100px;" filterable placeholder="请选择"  :disabled="disabled">
110
+                    <el-option
111
+                        v-for="(item,index) in scope.row.unitList"
112
+                        :key="index"
113
+                        :label="item.name"
114
+                        :value="item.name">
115
+                    </el-option>
116
+             </el-select>
117
+          </el-form-item>  
118
+        </template>
119
+    </el-table-column>
120
+    <el-table-column label="可用库存" align="center" width="130px">
121
+        <template slot-scope="scope">
122
+            <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
123
+        </template>
124
+    </el-table-column>
125
+    <el-table-column label="数量" align="center" width="120px">
126
+        <template slot="header" slot-scope="scope">
127
+            <span>数量<span style="color: red">*</span></span>
128
+        </template>
129
+        <template slot-scope="scope">
130
+          <el-form-item  :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
131
+             <el-input v-model="scope.row.supply_count" style="width:80px" :disabled="disabled"></el-input>
132
+          </el-form-item>
133
+        </template>
134
+    </el-table-column>
135
+
136
+    <el-table-column label="购货单价" align="center" width="120px">
137
+        <template slot-scope="scope">
138
+        <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
139
+        </template>
140
+    </el-table-column>
141
+
142
+    <el-table-column label="购货金额" align="center" width="120px">
143
+        <template slot-scope="scope">
144
+          {{calculate(scope.row.supply_count * scope.row.supply_price)}}
145
+        </template>
146
+    </el-table-column>
147
+
148
+    <el-table-column label="生产厂商" align="center" width="200px">
149
+        <template slot-scope="scope">
150
+        <el-input v-model="scope.row.supply_manufacturer" style="width:160px" :disabled="true"></el-input>
151
+        </template>
152
+    </el-table-column>
153
+
154
+
155
+    <el-table-column label="批准文号" align="center" width="200px">
156
+        <template slot-scope="scope">
157
+        <el-input v-model="scope.row.supply_license_number" style="width:160px" :disabled="disabled"></el-input>
158
+        </template>
159
+    </el-table-column>
160
+
161
+    <el-table-column label="备注" align="center" width="200px">
162
+        <template slot-scope="scope">
163
+        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
164
+        </template>
165
+    </el-table-column>
166
+
167
+    <el-table-column label="操作" align="center" width="150px" fixed="right" >
168
+        <template slot-scope="scope">
169
+        <el-tooltip class="item" effect="dark" content="新增" placement="top" >
170
+            <el-button
171
+                size="mini"
172
+                type="primary"
173
+                icon="el-icon-circle-plus-outline"
174
+                @click="handleEdit(scope.$index, scope.row)">
175
+            </el-button>
176
+       </el-tooltip>
177
+       <el-tooltip class="item" effect="dark" content="删除" placement="top">
178
+            <el-button
179
+                size="mini"
180
+                type="danger"
181
+                icon="el-icon-delete"
182
+                @click="handleDelete(scope.$index, scope.row)">
183
+            </el-button>
184
+        </el-tooltip>
185
+
186
+        </template>
187
+    </el-table-column>
188
+  </el-table>
189
+</el-form>
190
+   <div style="margin-top:10px">
191
+      合计:{{getAllPrice()}} 元
192
+   </div>
193
+   <div style="margin-top:10px">
194
+        <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
195
+
196
+        <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
197
+
198
+    </div>
199
+</div>
200
+
201
+  <!-- <el-dialog
202
+  title="提示"
203
+  :visible.sync="dialogVisible"
204
+  width="30%"
205
+  :before-close="handleClose">
206
+  <span>这是一段信息</span>
207
+  <span slot="footer" class="dialog-footer">
208
+    <el-button @click="dialogVisible = false">取 消</el-button>
209
+    <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
210
+  </span>
211
+  </el-dialog> -->
212
+</div>
213
+</template>
214
+
215
+<script>
216
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
217
+import {uParseTime } from '@/utils/tools'
218
+import {getInitOrder,updatePurchaseOrder,checkPurchaseOrder,getPurchaseOrderDetail} from "@/api/supply"
219
+export default {
220
+name: "addPurchaseOrder",
221
+components: {
222
+BreadCrumb
223
+},
224
+data() {
225
+return {
226
+    crumbs: [
227
+       { path: false, name: "购货单" },
228
+       { path: "/spply/query", name: "新增购货单" }
229
+    ],
230
+    showTwo:true,
231
+    showOne:false,
232
+    recordInfo: {
233
+      tableList:[],
234
+    },
235
+    keywords: "",
236
+    total: 0,
237
+    multipleSelection: [],
238
+    signAndWeighBoxPatients: "sign-and-weigh-box-patients",
239
+    start_time: "",
240
+    end_time: "",
241
+    page: 1,
242
+    limit: 10,
243
+    goodType: [],
244
+    goodInfo: [],
245
+    org_id:0,
246
+    types:[],
247
+    tyep_name:"",
248
+    form:{
249
+    manufacturer_id:"",
250
+    },
251
+    tabList:[],
252
+    manufactuerList:[],
253
+    currentIndex: 0,
254
+    goodTypeList:[],
255
+    drugTypeList:[],
256
+    supplier_name:"",
257
+    supplyList:[],
258
+    rate_of_concession:"",
259
+    discount_amount:"",
260
+    start_time:new Date(),
261
+    end_time:new Date(),
262
+    tableRules: {
263
+     name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
264
+     supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
265
+   },
266
+   warehousing_id:0,
267
+   number:"",
268
+   loading:false,
269
+   drugList:[],
270
+   goodList:[],
271
+   id:0,
272
+   disabled:false,
273
+   is_check:0,
274
+   dialogVisible:false,
275
+  };
276
+},
277
+methods:{
278
+
279
+getInitOrder(){
280
+    getInitOrder().then(response=>{
281
+    if(response.data.state == 1){
282
+        var drugList = response.data.data.drugList
283
+        this.manufactuerList = response.data.data.manufactuerList
284
+        this.goodTypeList = response.data.data.goodTypeList
285
+        this.drugTypeList = response.data.data.drugTypeList
286
+        this.supplyList = response.data.data.supplyList
287
+       for(let i=0;i<drugList.length;i++){
288
+          for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
289
+            drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
290
+          }
291
+        for(let j=0;j<this.manufactuerList.length;j++){
292
+            if(drugList[i].manufacturer == this.manufactuerList[j].id){
293
+                drugList[i].manufacturer = this.manufactuerList[j].manufacturer_name
294
+            }
295
+        }
296
+        for(let y=0;y<this.drugTypeList.length;y++){
297
+            if(drugList[i].drug_type == this.drugTypeList[y].value){
298
+            drugList[i].drug_type = this.drugTypeList[y].name
299
+            }
300
+        }
301
+        drugList[i].supply_name =  drugList[i].drug_name + " " + drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit + " " + drugList[i].manufacturer
302
+        drugList[i].supply_type = drugList[i].drug_type
303
+        drugList[i].supply_specification_name = drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit
304
+        drugList[i].supply_total = this.getWarehoseInfo(drugList[i].drug_warehouse_info,drugList[i].max_unit,drugList[i].min_unit,drugList[i].min_number)
305
+        drugList[i].supply_count = ""
306
+        drugList[i].supply_total_price = ""
307
+        drugList[i].supply_manufacturer=  drugList[i].manufacturer
308
+        drugList[i].supply_license_number= drugList[i].number
309
+        drugList[i].supply_remake = ""
310
+        drugList[i].type = 1
311
+        drugList[i].supply_price = drugList[i].last_price
312
+        drugList[i].name = drugList[i].drug_name
313
+        drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
314
+        drugList[i].supply_unit = drugList[i].max_unit 
315
+        for(let j=0;j<drugList[i].unitList.length;j++){
316
+           drugList[i].unitList[0].name = drugList[i].max_unit
317
+           drugList[i].unitList[1].name = drugList[i].min_unit
318
+        }
319
+        this.tabList.push(drugList[i])
320
+        }
321
+        this.drugList = drugList
322
+        var goodList =  response.data.data.goodList
323
+        for(let i=0;i<goodList.length;i++){
324
+        for(let j=0;j<this.manufactuerList.length;j++){
325
+            if(goodList[i].manufacturer == this.manufactuerList[j].id){
326
+                goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
327
+            }
328
+        }
329
+        for(let y=0;y<this.goodTypeList.length;y++){
330
+            if(goodList[i].good_type_id == this.goodTypeList[y].id){
331
+                goodList[i].good_type_id = this.goodTypeList[y].type_name
332
+            }
333
+        }
334
+        goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
335
+        goodList[i].supply_type = goodList[i].good_type_id
336
+        goodList[i].supply_specification_name =goodList[i].specification_name
337
+        goodList[i].supply_price = goodList[i].buy_price
338
+        goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info)
339
+        goodList[i].supply_count = ""
340
+        goodList[i].supply_total_price = ""
341
+        goodList[i].supply_manufacturer = goodList[i].manufacturer
342
+        goodList[i].supply_license_number = ""
343
+        goodList[i].supply_remake = ""
344
+        goodList[i].type = 2
345
+        goodList[i].name = goodList[i].good_name
346
+        goodList[i].unitList =  [{id:1,name:""},{id:2,name:""}]
347
+        goodList[i].supply_unit = goodList[i].packing_unit
348
+        for(let j=0;j<goodList[i].unitList.length;j++){
349
+           goodList[i].unitList[0].name = goodList[i].packing_unit 
350
+        }
351
+        this.tabList.push(goodList[i])
352
+        }
353
+        this.goodList = goodList
354
+    } 
355
+    })
356
+},
357
+changeGoodName(val){
358
+  this.currentIndex = val
359
+},
360
+changeName(val){
361
+    //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}
362
+   for(let i=0;i<this.recordInfo.tableList.length;i++){
363
+    if(this.currentIndex == i){
364
+        this.recordInfo.tableList[i].project_id = val.id
365
+        this.recordInfo.tableList[i].type = val.type
366
+        this.recordInfo.tableList[i].name = val.name
367
+        this.recordInfo.tableList[i].supply_name = val.supply_name
368
+        this.recordInfo.tableList[i].supply_type = val.supply_type
369
+        this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name
370
+        this.recordInfo.tableList[i].supply_total = val.supply_total
371
+        if(val.supply_count == NaN){
372
+           this.recordInfo.tableList[i].supply_count = ""
373
+        }else{
374
+          this.recordInfo.tableList[i].supply_count = val.supply_count?val.supply_count:""
375
+        }
376
+
377
+        this.recordInfo.tableList[i].supply_price = val.supply_price?val.supply_price:""
378
+        this.recordInfo.tableList[i].supply_total_price = val.supply_total_price?val.supply_total_price:""
379
+        this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
380
+        this.recordInfo.tableList[i].supply_license_number = val.supply_license_number
381
+        this.recordInfo.tableList[i].supply_remake = val.supply_remake
382
+        this.recordInfo.tableList[i].is_total = val.is_total
383
+        this.recordInfo.tableList[i].supply_unit = val.supply_unit
384
+        this.recordInfo.tableList[i].unitList = val.unitList
385
+     }
386
+    }
387
+   
388
+
389
+},
390
+handleEdit(){
391
+    const tempObj = {}
392
+    tempObj["id"] = 0
393
+    tempObj["name"] = ""
394
+    tempObj['supply_name'] = ""
395
+    tempObj['supply_type'] = ""
396
+    tempObj['supply_specification_name'] = ''
397
+    tempObj['supply_total'] = ""
398
+    tempObj['supply_count'] = ""
399
+    tempObj['supply_price'] = ""
400
+    tempObj['supply_total_price'] = ""
401
+    tempObj['supply_manufacturer'] = ''
402
+    tempObj['supply_license_number'] = ''
403
+    tempObj['supply_remake'] = ''
404
+    tempObj['type'] = 0
405
+    tempObj['is_total'] = 1
406
+    tempObj["project_id"] = 0
407
+    tempObj["supply_unit"] = ""
408
+    this.recordInfo.tableList.push(tempObj)
409
+},
410
+handleDelete: function(index, row) {
411
+  if (this.recordInfo.tableList.length <= 1) {
412
+        this.$message.error('只有一条记录的时候无法删除')
413
+        return
414
+   } else {
415
+        this.recordInfo.tableList.splice(index, 1)
416
+   }
417
+},
418
+
419
+changeTypeName(){
420
+
421
+},
422
+startTimeChange(){
423
+
424
+},
425
+endTimeChange(){
426
+
427
+},
428
+search(){
429
+
430
+},
431
+
432
+getWarehoseInfo(arr,max_unit,min_unit,min_number){
433
+    var total = 0
434
+    var max_str=  ""
435
+    var min_str = ""
436
+    if (arr.length > 0) {
437
+      for(let i=0;i<arr.length;i++){
438
+        total += parseInt(arr[i].stock_max_number)
439
+      }
440
+    }
441
+    if (total < min_number){
442
+        min_str = total + min_unit
443
+    }
444
+    if (total == 0) {
445
+        min_str = ""
446
+        max_str = ""
447
+    }
448
+   if (total >=min_number) {
449
+    if(parseInt(total/min_number)!=0){
450
+        max_str = parseInt(total/min_number) + max_unit
451
+    }
452
+    if(total%min_number!=0){
453
+       min_str = total%min_number + min_unit
454
+    }
455
+  }
456
+ return max_str + min_str
457
+ },
458
+getTotalStockCount(arr){
459
+  var total_count = 0
460
+  for(let i=0;i<arr.length;i++){
461
+    total_count += arr[i].stock_count
462
+  }
463
+  return total_count
464
+},
465
+calculate: function(val) {
466
+    if (isNaN(val)) {
467
+        return "";
468
+    }
469
+    if (val == 0) {
470
+        return "";
471
+    }
472
+    return Math.round(parseFloat(val) * 100) / 100;
473
+  },
474
+getTimes(time) {
475
+    if (time === '') {
476
+    return ''
477
+    }
478
+    return uParseTime(time, '{y}-{m}-{d}')
479
+},
480
+ updatePurchaseOrder(){
481
+   this.loading = true 
482
+    if(this.supplier_name == 0 || this.supplier_name == ""){
483
+        this.$message.error("供应商不能为空!")
484
+        this.loading = false
485
+        return false
486
+    }
487
+   this.$refs["tableForm"].validate((valid)=>{
488
+      if(valid){
489
+        for(let i=0;i<this.recordInfo.tableList.length;i++){
490
+           this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
491
+           this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
492
+           this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
493
+           this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
494
+            this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
495
+           for(let j=0;j<this.manufactuerList.length;j++){
496
+              if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
497
+                this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
498
+              }
499
+           }
500
+        }
501
+        var start = this.getTimes(this.start_time)
502
+        var end = this.getTimes(this.end_time)
503
+        const params = {
504
+        'stockIn': this.recordInfo.tableList
505
+        }
506
+        console.log("param23232332",params)  
507
+       
508
+        updatePurchaseOrder(params,this.supplier_name,start,end,this.rate_of_concession,this.discount_amount,this.id,this.number).then(response=>{
509
+           if(response.data.state == 1){
510
+            this.loading = false
511
+             var warehousingInfo =  response.data.data.warehousingInfo
512
+             this.$message.success("修改成功!")
513
+           }
514
+        })
515
+      } 
516
+   })
517
+ },
518
+ getAllPrice(){
519
+   var total_price = 0
520
+   for(let i=0;i<this.recordInfo.tableList.length;i++){
521
+      total_price += (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count)
522
+   }  
523
+   return total_price.toFixed(2)
524
+ },
525
+ checkPurchaseOrder(id,index){
526
+   this.$confirm('是否审核?', {
527
+    confirmButtonText: '确 定',
528
+    cancelButtonText: '取 消',
529
+    type: 'warning'
530
+    }).then(() => { 
531
+    checkPurchaseOrder(this.id).then(response => {
532
+        if (response.data.state == 1) {
533
+          var info = response.data.data.info
534
+          this.disabled = true
535
+          this.$message.success("审核成功!")
536
+          this.getPurchaseOrderDetail()
537
+        } 
538
+     })
539
+    })
540
+    .catch(() => {
541
+    }) 
542
+  },
543
+  getPurchaseOrderDetail(){
544
+      console.log("处方233223232323322323232323")
545
+      var id = this.$route.query.id
546
+    getPurchaseOrderDetail(id).then(response=>{
547
+      if(response.data.state == 1){
548
+        var info = response.data.data.info
549
+        this.is_check = info.is_check
550
+        this.number = info.number
551
+        this.id = info.id
552
+        this.supplier_name = info.supplier_id
553
+        this.rate_of_concession = info.rate_of_concession
554
+        this.discount_amount = info.discount_amount
555
+        var orderInfo = response.data.data.orderInfo
556
+        if(info.is_check == 2){
557
+           this.disabled = false
558
+        }
559
+        if(info.is_check == 1){
560
+           this.disabled = true
561
+        }
562
+        console.log("drugli323322332",this.drugList)
563
+        var drugList = response.data.data.baseList
564
+        var goodList = response.data.data.goodList
565
+        for(let i=0;i<orderInfo.length;i++){
566
+            orderInfo[i].supply_count = orderInfo[i].count
567
+            orderInfo[i].supply_price = orderInfo[i].price
568
+            orderInfo[i].supply_remake = orderInfo[i].remark
569
+            orderInfo[i].type = orderInfo[i].is_source
570
+            orderInfo[i].project_id = orderInfo[i].project_id
571
+            orderInfo[i].supply_unit = orderInfo[i].supply_unit
572
+           if(orderInfo[i].is_source == 1){
573
+            for(let j=0;j<drugList.length;j++){
574
+                if(orderInfo[i].project_id == drugList[j].id){
575
+                  orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
576
+                  orderInfo[i].unitList[0].name = drugList[j].max_unit
577
+                  orderInfo[i].unitList[1].name = drugList[j].min_unit
578
+                }
579
+             }  
580
+            } 
581
+          if(orderInfo[i].is_source == 2){
582
+            for(let j=0;j<goodList.length;j++){
583
+                if(orderInfo[i].project_id == goodList[j].id){
584
+                    orderInfo[i].unitList = [{id:1,name:""}]
585
+                    orderInfo[i].unitList[0].name = goodList[j].packing_unit
586
+                }
587
+            }  
588
+          } 
589
+        }
590
+        console.log("orderINFO23323232",orderInfo)
591
+        this.recordInfo.tableList = orderInfo
592
+      }
593
+    })  
594
+  },
595
+  toPrint(){
596
+     var id = this.$route.query.id
597
+     this.$router.push({path:"/purchase/order/print?&id="+id})  
598
+  },
599
+  toAdd(){
600
+    var id = this.$route.query.id
601
+    if(this.is_check == 2){
602
+      this.$message.error("该采购订单未审核,不能生成采购数据!")
603
+      return false
604
+    }
605
+    this.$router.push({path:"/purchase/order/add?id="+id})
606
+  }
607
+},
608
+created(){
609
+    const tempObj = {}
610
+    tempObj["id"] = 0
611
+    tempObj["name"] = ""
612
+    tempObj['supply_name'] = ""
613
+    tempObj['supply_type'] = ""
614
+    tempObj['supply_specification_name'] = ''
615
+    tempObj['supply_total'] = ""
616
+    tempObj['supply_count'] = ""
617
+    tempObj['supply_price'] = ""
618
+    tempObj['supply_total_price'] = ""
619
+    tempObj['supply_manufacturer'] = ''
620
+    tempObj['supply_license_number'] = ''
621
+    tempObj['supply_remake'] = ''
622
+    tempObj['type'] = 0
623
+    tempObj['is_total'] = 1
624
+    tempObj["project_id"] = 0
625
+    tempObj["supply_unit"] = ""
626
+    this.recordInfo.tableList.push(tempObj)
627
+    this.getInitOrder()
628
+    this.getPurchaseOrderDetail()
629
+}
630
+};
631
+</script>
632
+
633
+<style rel="stylesheet/css" lang="scss" scoped>
634
+.information {
635
+border: 1px #dcdfe6 solid;
636
+padding: 30px 20px 30px 20px;
637
+
638
+.border {
639
+border-bottom: 1px #dcdfe6 solid;
640
+margin: 0px 0 20px 0;
641
+}
642
+}
643
+
644
+.title {
645
+background: #409eff;
646
+height: 44px;
647
+line-height: 44px;
648
+padding: 0 0 0 10px;
649
+color: #fff;
650
+margin: 0 0 10px 0;
651
+}
652
+
653
+.edit_separater {
654
+border-top: 1px solid rgb(233, 233, 233);
655
+margin-top: 15px;
656
+margin-bottom: 15px;
657
+}
658
+</style>
659
+
660
+<style>
661
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
662
+font-size: 12px;
663
+}
664
+
665
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
666
+background: #6fb5fa;
667
+}
668
+
669
+.count {
670
+color: #bd2c00;
671
+}
672
+.el-table td,
673
+.el-table th.is-leaf,
674
+.el-table--border,
675
+.el-table--group {
676
+border-color: #d0d3da;
677
+}
678
+.el-table--border::after,
679
+.el-table--group::after,
680
+.el-table::before {
681
+background-color: #d0d3da;
682
+}
683
+.el-table__fixed-right{
684
+  width:150px;
685
+  bottom: 20px;
686
+  height: 100%;
687
+}
688
+</style>

+ 235 - 40
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
         <span style="color:red">*</span><span>供应商:</span>
44
             value-format="yyyy-MM-dd"
44
             value-format="yyyy-MM-dd"
45
             @change="endTimeChange"
45
             @change="endTimeChange"
46
         ></el-date-picker>
46
         ></el-date-picker>
47
-        <span>单据编码:</span>
47
+        <span>单据编码:{{number}}</span>
48
 
48
 
49
     </div>
49
     </div>
50
     <div>
50
     <div>
51
         <el-button size="small" type="primary" @click="savePurchaseOrder" v-show="showTwo">保存</el-button>
51
         <el-button size="small" type="primary" @click="savePurchaseOrder" v-show="showTwo">保存</el-button>
52
+        <el-button size="small" type="primary" @click="toPrint()" v-show="showOne">打印</el-button>
53
+        <el-button size="small" type="primary" @click="checkPurchaseOrder" v-show="showOne">审核</el-button>
52
         <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>
53
     </div>
55
     </div>
54
     </div>
56
     </div>
71
             <span>商品<span style="color: red">*</span></span>
73
             <span>商品<span style="color: red">*</span></span>
72
         </template>
74
         </template>
73
         <template slot-scope="scope">
75
         <template slot-scope="scope">
74
-           <el-form-item required prop="name">
75
-            <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)">
76
+           <el-form-item :prop="'tableList.' + scope.$index + '.name'" :rules='tableRules.name'>
77
+            <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)" :disabled="disabled">
76
                 <el-option
78
                 <el-option
77
                     v-for="(item,index) in tabList"
79
                     v-for="(item,index) in tabList"
78
                     :key="index"
80
                     :key="index"
95
         <template slot-scope="scope">
97
         <template slot-scope="scope">
96
             <el-input v-model="scope.row.supply_specification_name" style="width:150px" :disabled="true"></el-input>
98
             <el-input v-model="scope.row.supply_specification_name" style="width:150px" :disabled="true"></el-input>
97
         </template>
99
         </template>
98
-        </el-table-column>
100
+    </el-table-column>
101
+     <el-table-column label="单位" align="center" width="120px">
102
+        <template slot="header" slot-scope="scope">
103
+            <span>单位<span style="color: red">*</span></span>
104
+        </template>
105
+        <template slot-scope="scope">
106
+          <el-form-item :prop="'tableList.' + scope.$index + '.supply_unit'" :rules='tableRules.supply_unit'>
107
+            <el-select v-model="scope.row.supply_unit" style="width:100px;" filterable placeholder="请选择"  :disabled="disabled">
108
+                    <el-option
109
+                        v-for="(item,index) in scope.row.unitList"
110
+                        :key="index"
111
+                        :label="item.name"
112
+                        :value="item.name">
113
+                    </el-option>
114
+             </el-select>
115
+          </el-form-item>  
116
+        </template>
117
+    </el-table-column>
99
     <el-table-column label="可用库存" align="center" width="130px">
118
     <el-table-column label="可用库存" align="center" width="130px">
100
         <template slot-scope="scope">
119
         <template slot-scope="scope">
101
             <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
120
             <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
106
             <span>数量<span style="color: red">*</span></span>
125
             <span>数量<span style="color: red">*</span></span>
107
         </template>
126
         </template>
108
         <template slot-scope="scope">
127
         <template slot-scope="scope">
109
-          <el-form-item :rules="tableRules.supply_count" required prop="supply_count">
110
-          <el-input v-model="scope.row.supply_count" style="width:80px"></el-input>
128
+          <el-form-item  :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
129
+             <el-input v-model="scope.row.supply_count" style="width:80px" :disabled="disabled"></el-input>
111
           </el-form-item>
130
           </el-form-item>
112
         </template>
131
         </template>
113
     </el-table-column>
132
     </el-table-column>
114
 
133
 
134
+   
135
+
115
     <el-table-column label="购货单价" align="center" width="120px">
136
     <el-table-column label="购货单价" align="center" width="120px">
116
         <template slot-scope="scope">
137
         <template slot-scope="scope">
117
-        <el-input v-model="scope.row.supply_price" style="width:80px"></el-input>
138
+        <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
118
         </template>
139
         </template>
119
     </el-table-column>
140
     </el-table-column>
120
 
141
 
133
 
154
 
134
     <el-table-column label="批准文号" align="center" width="200px">
155
     <el-table-column label="批准文号" align="center" width="200px">
135
         <template slot-scope="scope">
156
         <template slot-scope="scope">
136
-        <el-input v-model="scope.row.supply_license_number" style="width:160px"></el-input>
157
+        <el-input v-model="scope.row.supply_license_number" style="width:160px" :disabled="disabled"></el-input>
137
         </template>
158
         </template>
138
     </el-table-column>
159
     </el-table-column>
139
 
160
 
140
     <el-table-column label="备注" align="center" width="200px">
161
     <el-table-column label="备注" align="center" width="200px">
141
         <template slot-scope="scope">
162
         <template slot-scope="scope">
142
-        <el-input v-model="scope.row.supply_remake" style="width:160px"></el-input>
163
+        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
143
         </template>
164
         </template>
144
     </el-table-column>
165
     </el-table-column>
145
 
166
 
166
     </el-table-column>
187
     </el-table-column>
167
   </el-table>
188
   </el-table>
168
 </el-form>
189
 </el-form>
190
+   <div style="margin-top:10px">
191
+      合计:{{getAllPrice()}} 元
192
+   </div>
169
    <div style="margin-top:10px">
193
    <div style="margin-top:10px">
170
         <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
194
         <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
171
 
195
 
178
 
202
 
179
 <script>
203
 <script>
180
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
204
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
181
-
182
-import {getInitOrder,savePurchaseOrder} from "@/api/supply"
205
+import {uParseTime } from '@/utils/tools'
206
+import {getInitOrder,savePurchaseOrder,updatePurchaseOrder,checkPurchaseOrder} from "@/api/supply"
207
+import {getDataConfig } from '@/utils/data'
183
 export default {
208
 export default {
184
 name: "addPurchaseOrder",
209
 name: "addPurchaseOrder",
185
 created() {
210
 created() {
241
     tableRules: {
266
     tableRules: {
242
      name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
267
      name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
243
      supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
268
      supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
244
- },
245
-};
269
+     supply_unit:[{required:true,message: '单位不能为空', trigger: 'blur'}]
270
+   },
271
+   warehousing_id:0,
272
+   number:"",
273
+   loading:false,
274
+   drugList:[],
275
+   goodList:[],
276
+   id:0,
277
+   disabled:false,
278
+   unitList:[
279
+     {id:1,name:""},
280
+     {id:2,name:""}
281
+   ],
282
+   goodList:[
283
+     {id:1,name:""},
284
+   ],
285
+  };
246
 },
286
 },
247
 methods:{
287
 methods:{
248
 
288
 
250
     getInitOrder().then(response=>{
290
     getInitOrder().then(response=>{
251
     if(response.data.state == 1){
291
     if(response.data.state == 1){
252
         var drugList = response.data.data.drugList
292
         var drugList = response.data.data.drugList
293
+        
253
         this.manufactuerList = response.data.data.manufactuerList
294
         this.manufactuerList = response.data.data.manufactuerList
254
         this.goodTypeList = response.data.data.goodTypeList
295
         this.goodTypeList = response.data.data.goodTypeList
255
         this.drugTypeList = response.data.data.drugTypeList
296
         this.drugTypeList = response.data.data.drugTypeList
256
         this.supplyList = response.data.data.supplyList
297
         this.supplyList = response.data.data.supplyList
257
        for(let i=0;i<drugList.length;i++){
298
        for(let i=0;i<drugList.length;i++){
299
+          
258
           for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
300
           for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
259
             drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
301
             drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
260
           }
302
           }
278
         drugList[i].supply_license_number= drugList[i].number
320
         drugList[i].supply_license_number= drugList[i].number
279
         drugList[i].supply_remake = ""
321
         drugList[i].supply_remake = ""
280
         drugList[i].type = 1
322
         drugList[i].type = 1
281
-        drugList[i].supply_price = ""
323
+        drugList[i].supply_price = drugList[i].last_price
282
         drugList[i].name = drugList[i].drug_name
324
         drugList[i].name = drugList[i].drug_name
283
-
325
+        drugList[i].supply_unit = drugList[i].max_unit
326
+        drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
327
+        for(let j=0;j<drugList[i].unitList.length;j++){
328
+           drugList[i].unitList[0].name = drugList[i].max_unit
329
+           drugList[i].unitList[1].name = drugList[i].min_unit
330
+        }
284
         this.tabList.push(drugList[i])
331
         this.tabList.push(drugList[i])
285
         }
332
         }
286
-
333
+        this.drugList = drugList
287
         var goodList =  response.data.data.goodList
334
         var goodList =  response.data.data.goodList
335
+       
288
         for(let i=0;i<goodList.length;i++){
336
         for(let i=0;i<goodList.length;i++){
337
+       
289
         for(let j=0;j<this.manufactuerList.length;j++){
338
         for(let j=0;j<this.manufactuerList.length;j++){
290
             if(goodList[i].manufacturer == this.manufactuerList[j].id){
339
             if(goodList[i].manufacturer == this.manufactuerList[j].id){
291
                 goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
340
                 goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
299
         goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
348
         goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
300
         goodList[i].supply_type = goodList[i].good_type_id
349
         goodList[i].supply_type = goodList[i].good_type_id
301
         goodList[i].supply_specification_name =goodList[i].specification_name
350
         goodList[i].supply_specification_name =goodList[i].specification_name
302
-        goodList[i].supply_price = ""
351
+        goodList[i].supply_price = goodList[i].buy_price
303
         goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info)
352
         goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info)
304
         goodList[i].supply_count = ""
353
         goodList[i].supply_count = ""
305
         goodList[i].supply_total_price = ""
354
         goodList[i].supply_total_price = ""
308
         goodList[i].supply_remake = ""
357
         goodList[i].supply_remake = ""
309
         goodList[i].type = 2
358
         goodList[i].type = 2
310
         goodList[i].name = goodList[i].good_name
359
         goodList[i].name = goodList[i].good_name
311
-
360
+        goodList[i].supply_unit = goodList[i].packing_unit
361
+        goodList[i].unitList =  [{id:1,name:""},{id:2,name:""}]
362
+        for(let j=0;j<goodList[i].unitList.length;j++){
363
+           goodList[i].unitList[0].name = goodList[i].packing_unit 
364
+        }
312
         this.tabList.push(goodList[i])
365
         this.tabList.push(goodList[i])
313
         }
366
         }
314
-    }
367
+        this.goodList = goodList
368
+    } 
315
     })
369
     })
316
 },
370
 },
317
 changeGoodName(val){
371
 changeGoodName(val){
318
   this.currentIndex = val
372
   this.currentIndex = val
319
 },
373
 },
320
 changeName(val){
374
 changeName(val){
321
-
375
+   console.log("val3233232322332",val)
322
    for(let i=0;i<this.recordInfo.tableList.length;i++){
376
    for(let i=0;i<this.recordInfo.tableList.length;i++){
323
     if(this.currentIndex == i){
377
     if(this.currentIndex == i){
324
-        this.recordInfo.tableList[i].id = val.id
378
+        this.recordInfo.tableList[i].project_id = val.id
325
         this.recordInfo.tableList[i].type = val.type
379
         this.recordInfo.tableList[i].type = val.type
326
         this.recordInfo.tableList[i].name = val.name
380
         this.recordInfo.tableList[i].name = val.name
327
         this.recordInfo.tableList[i].supply_name = val.supply_name
381
         this.recordInfo.tableList[i].supply_name = val.supply_name
328
         this.recordInfo.tableList[i].supply_type = val.supply_type
382
         this.recordInfo.tableList[i].supply_type = val.supply_type
329
         this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name
383
         this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name
330
         this.recordInfo.tableList[i].supply_total = val.supply_total
384
         this.recordInfo.tableList[i].supply_total = val.supply_total
385
+        
331
         if(val.supply_count == NaN){
386
         if(val.supply_count == NaN){
332
            this.recordInfo.tableList[i].supply_count = ""
387
            this.recordInfo.tableList[i].supply_count = ""
333
         }else{
388
         }else{
339
         this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
394
         this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
340
         this.recordInfo.tableList[i].supply_license_number = val.supply_license_number
395
         this.recordInfo.tableList[i].supply_license_number = val.supply_license_number
341
         this.recordInfo.tableList[i].supply_remake = val.supply_remake
396
         this.recordInfo.tableList[i].supply_remake = val.supply_remake
397
+        this.recordInfo.tableList[i].is_total = val.is_total
398
+        this.recordInfo.tableList[i].supply_unit = val.supply_unit
399
+        this.recordInfo.tableList[i].unitList = val.unitList
342
      }
400
      }
343
     }
401
     }
402
+   
344
 
403
 
345
 },
404
 },
346
 handleEdit(){
405
 handleEdit(){
347
     const tempObj = {}
406
     const tempObj = {}
348
-    tempObj["id"] = ""
407
+    tempObj["id"] = 0
349
     tempObj["name"] = ""
408
     tempObj["name"] = ""
350
     tempObj['supply_name'] = ""
409
     tempObj['supply_name'] = ""
351
     tempObj['supply_type'] = ""
410
     tempObj['supply_type'] = ""
358
     tempObj['supply_license_number'] = ''
417
     tempObj['supply_license_number'] = ''
359
     tempObj['supply_remake'] = ''
418
     tempObj['supply_remake'] = ''
360
     tempObj['type'] = 0
419
     tempObj['type'] = 0
420
+    tempObj['is_total'] = 1
421
+    tempObj["project_id"] = 0
422
+    tempObj["supply_unit"] = ""
361
     this.recordInfo.tableList.push(tempObj)
423
     this.recordInfo.tableList.push(tempObj)
362
 },
424
 },
363
 handleDelete: function(index, row) {
425
 handleDelete: function(index, row) {
371
 
433
 
372
 
434
 
373
 savePurchaseOrder(){
435
 savePurchaseOrder(){
374
-   // console.log("tablelsit323232",this.recordInfo.tableList)
375
-   console.log("hhh232323",this.$refs)
436
+    this.loading = true
437
+    if(this.supplier_name == 0 || this.supplier_name == ""){
438
+       this.$message.error("供应商不能为空!")
439
+       this.loading = false
440
+       return false
441
+    }
376
     this.$refs["tableForm"].validate((valid)=>{
442
     this.$refs["tableForm"].validate((valid)=>{
377
       if(valid){
443
       if(valid){
378
-        var params = {
379
-        supplier_name:this.supplier_name,
380
-        start_time:this.start_time,
381
-        end_time:this.end_time,
382
-        rate_of_concession:this.rate_of_concession,
383
-        discount_amount:this.discount_amount,
384
-        }
385
-        console.log("partam2332232332",params)
386
-        console.log("tablelsit323232",this.recordInfo.tableList)
387
         for(let i=0;i<this.recordInfo.tableList.length;i++){
444
         for(let i=0;i<this.recordInfo.tableList.length;i++){
388
             this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
445
             this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
446
+            this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
447
+            this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
448
+            this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
449
+            this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
389
             for(let j=0;j<this.manufactuerList.length;j++){
450
             for(let j=0;j<this.manufactuerList.length;j++){
390
                 if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
451
                 if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
391
                 this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
452
                 this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
393
 
454
 
394
             }
455
             }
395
         }
456
         }
396
-        return
397
-        savePurchaseOrder(this.recordInfo.tableList,this.supplier_name,this.start_time,this.end_time,this.rate_of_concession,this.discount_amount).then(response=>{
457
+        var start = this.getTimes(this.start_time)
458
+        var end = this.getTimes(this.end_time)
459
+         const params = {
460
+            'stockIn': this.recordInfo.tableList
461
+         }
462
+       
463
+        savePurchaseOrder(params,this.supplier_name,start,end,this.rate_of_concession,this.discount_amount).then(response=>{
398
             if(response.data.state == 1){
464
             if(response.data.state == 1){
399
                 var order =  response.data.data.order
465
                 var order =  response.data.data.order
466
+                this.loading = false
400
                 this.$message.success("保存成功!")
467
                 this.$message.success("保存成功!")
468
+                var warehouseInfo = response.data.data.warehouseInfo
469
+                this.number  = warehouseInfo.number
470
+                this.id = warehouseInfo.id
471
+                this.recordInfo.tableList = []
472
+                var orderInfo = response.data.data.orderInfo
473
+                for(let i=0;i<orderInfo.length;i++){
474
+                   if(orderInfo[i].is_source == 1){
475
+                    for(let j=0;j<this.drugList.length;j++){
476
+                       if(orderInfo[i].project_id == this.drugList[j].id){
477
+                          orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
478
+                          orderInfo[i].unitList[0].name = this.drugList[j].max_unit
479
+                          orderInfo[i].unitList[1].name = this.drugList[j].min_unit
480
+                       }
481
+                    }  
482
+                   } 
483
+                  if(orderInfo[i].is_source == 2){
484
+                    for(let j=0;j<this.goodList.length;j++){
485
+                       if(orderInfo[i].project_id == this.goodList[j].id){
486
+                          orderInfo[i].unitList = [{id:1,name:""}]
487
+                          orderInfo[i].unitList[0].name = this.goodList[j].packing_unit
488
+                       }
489
+                    }  
490
+                   } 
491
+                  orderInfo[i].supply_count = orderInfo[i].count
492
+                  orderInfo[i].supply_price = orderInfo[i].price
493
+                  orderInfo[i].supply_remake = orderInfo[i].remark
494
+                  orderInfo[i].type = orderInfo[i].is_source
495
+                  orderInfo[i].project_id = orderInfo[i].project_id
496
+                  orderInfo[i].supply_unit = orderInfo[i].supply_unit
497
+                }
498
+                console.log("orderINFO23323232",orderInfo)
499
+                this.recordInfo.tableList = orderInfo
500
+                // for(let i=0;i<orderInfo.length;i++){
501
+                //    orderInfo[i].name = "" 
502
+                //    orderInfo[i].supply_name = ""
503
+                //    orderInfo[i].supply_specification_name = ""
504
+                //   if(orderInfo[i].is_source == 1){
505
+                //     for(let j=0;j<this.drugList.length;j++){
506
+                //        if(orderInfo[i].project_id == this.drugList[j].id){
507
+                //           orderInfo[i].name = this.drugList[j].drug_name
508
+                //        }
509
+                //     }
510
+                //   }
511
+                //   if(orderInfo[i].is_source == 2){
512
+                //     for(let y=0;y<this.goodList.length;y++){
513
+                //        if(orderInfo[i].project_id = this.goodList[y].id){
514
+                //           orderInfo[i].name = this.goodList[y].good_name
515
+                //        }
516
+                //     }
517
+                //   }
518
+                // }
401
                 this.showTwo = false
519
                 this.showTwo = false
402
                 this.showOne = true
520
                 this.showOne = true
403
             }
521
             }
408
 
526
 
409
 },
527
 },
410
 
528
 
529
+
411
 changeTypeName(){
530
 changeTypeName(){
412
 
531
 
413
 },
532
 },
463
     }
582
     }
464
     return Math.round(parseFloat(val) * 100) / 100;
583
     return Math.round(parseFloat(val) * 100) / 100;
465
   },
584
   },
585
+getTimes(time) {
586
+    if (time === '') {
587
+    return ''
588
+    }
589
+    return uParseTime(time, '{y}-{m}-{d}')
590
+},
466
  updatePurchaseOrder(){
591
  updatePurchaseOrder(){
467
-
468
- }
592
+   this.loading = true 
593
+    if(this.supplier_name == 0 || this.supplier_name == ""){
594
+        this.$message.error("供应商不能为空!")
595
+        this.loading = false
596
+        return false
597
+    }
598
+   this.$refs["tableForm"].validate((valid)=>{
599
+      if(valid){
600
+        for(let i=0;i<this.recordInfo.tableList.length;i++){
601
+           this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
602
+           this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
603
+           this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
604
+           this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
605
+            this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
606
+           for(let j=0;j<this.manufactuerList.length;j++){
607
+              if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
608
+                this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
609
+              }
610
+           }
611
+        }
612
+        var start = this.getTimes(this.start_time)
613
+        var end = this.getTimes(this.end_time)
614
+        const params = {
615
+        'stockIn': this.recordInfo.tableList
616
+        }
617
+        console.log("params23232233223",params)
618
+        
619
+        updatePurchaseOrder(params,this.supplier_name,start,end,this.rate_of_concession,this.discount_amount,this.id,this.number).then(response=>{
620
+           if(response.data.state == 1){
621
+            this.loading = false
622
+             var warehousingInfo =  response.data.data.warehousingInfo
623
+             this.$message.success("修改成功!")
624
+           }
625
+        })
626
+      } 
627
+   })
628
+ },
629
+ getAllPrice(){
630
+   var total_price = 0
631
+   for(let i=0;i<this.recordInfo.tableList.length;i++){
632
+      total_price += (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count)
633
+   }  
634
+   return total_price.toFixed(2)
635
+ },
636
+ checkPurchaseOrder(id,index){
637
+   this.$confirm('是否审核?', {
638
+    confirmButtonText: '确 定',
639
+    cancelButtonText: '取 消',
640
+    type: 'warning'
641
+    }).then(() => {
642
+    console.log("id232233232323223",this.id)    
643
+    checkPurchaseOrder(this.id).then(response => {
644
+        if (response.data.state == 1) {
645
+          var info = response.data.data.info
646
+          this.disabled = true
647
+          this.$message.success("审核成功!")
648
+        } 
649
+     })
650
+    })
651
+    .catch(() => {
652
+    }) 
653
+  },
654
+  toPrint(){
655
+     var id = this.id
656
+     this.$router.push({path:"/purchase/order/print?&id="+id})  
657
+  },
658
+  getDataConfig(module, filed_name){
659
+    return getDataConfig(module, filed_name)
660
+  },
469
 },
661
 },
470
 created(){
662
 created(){
471
     const tempObj = {}
663
     const tempObj = {}
472
-    tempObj["id"] = ""
664
+    tempObj["id"] = 0
473
     tempObj["name"] = ""
665
     tempObj["name"] = ""
474
     tempObj['supply_name'] = ""
666
     tempObj['supply_name'] = ""
475
     tempObj['supply_type'] = ""
667
     tempObj['supply_type'] = ""
482
     tempObj['supply_license_number'] = ''
674
     tempObj['supply_license_number'] = ''
483
     tempObj['supply_remake'] = ''
675
     tempObj['supply_remake'] = ''
484
     tempObj['type'] = 0
676
     tempObj['type'] = 0
677
+    tempObj['is_total'] = 1
678
+    tempObj["project_id"] = 0
679
+    tempObj["supply_unit"] = ""
485
     this.recordInfo.tableList.push(tempObj)
680
     this.recordInfo.tableList.push(tempObj)
486
     this.getInitOrder()
681
     this.getInitOrder()
487
 }
682
 }
541
 .el-table__fixed-right{
736
 .el-table__fixed-right{
542
   width:150px;
737
   width:150px;
543
   bottom: 20px;
738
   bottom: 20px;
544
-  height: 200px;
739
+  height: 100%;
545
 }
740
 }
546
 </style>
741
 </style>

+ 710 - 0
src/xt_pages/supply/components/editPurchaseOrder.vue View File

1
+<template>
2
+<div class="main-contain">
3
+<div class="position">
4
+    <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+</div>
6
+<div class="app-container"  v-loading="loading">
7
+    <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8
+    <div>
9
+        <span style="color:red">*</span><span>供应商:</span>
10
+        <el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择"
11
+        @change="changeTypeName">
12
+        <el-option
13
+            v-for="item in supplyList"
14
+            :key="item.id"
15
+            :label="item.supplier_name"
16
+            :value="item.id">
17
+        </el-option>
18
+        </el-select>
19
+        <span>单据日期:</span>
20
+        <el-date-picker
21
+        size="small"
22
+        v-model="start_time"
23
+        prefix-icon="el-icon-date"
24
+        :editable="false"
25
+        style="width: 196px;"
26
+        type="date"
27
+        placeholder="选择日期时间"
28
+        align="right"
29
+        format="yyyy-MM-dd"
30
+        value-format="yyyy-MM-dd"
31
+        @change="startTimeChange"
32
+        ></el-date-picker>
33
+        <span>交货日期:</span>
34
+        <el-date-picker
35
+            size="small"
36
+            v-model="end_time"
37
+            prefix-icon="el-icon-date"
38
+            :editable="false"
39
+            style="width: 196px;"
40
+            type="date"
41
+            placeholder="选择日期时间"
42
+            align="right"
43
+            format="yyyy-MM-dd"
44
+            value-format="yyyy-MM-dd"
45
+            @change="endTimeChange"
46
+        ></el-date-picker>
47
+        <span>单据编码:{{number}}</span>
48
+
49
+    </div>
50
+    <div>
51
+        <el-button size="small" type="primary" @click="toAdd">生成购货单</el-button>
52
+        <el-button size="small" type="primary" @click="updatePurchaseOrder">修改</el-button>
53
+        <el-button size="small" type="primary" @click="toPrint">打印</el-button>
54
+        <el-button size="small" type="primary" v-if="is_check == 2" @click="checkPurchaseOrder">审核</el-button>
55
+        <el-button size="small" type="primary" v-if="is_check == 1" @click="checkPurchaseOrder">反审核</el-button>
56
+       
57
+    </div>
58
+    </div>
59
+
60
+   <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
61
+    <el-table
62
+    :row-style="{ color: '#303133' }"
63
+    :header-cell-style="{
64
+        backgroundColor: 'rgb(245, 247, 250)',
65
+        color: '#606266'
66
+    }"
67
+    :data="recordInfo.tableList"
68
+    :class="signAndWeighBoxPatients"
69
+    border
70
+    style="width: 100%"
71
+    max-height="450"
72
+    >
73
+    <el-table-column align="center" width="200px">
74
+        <template slot="header" slot-scope="scope">
75
+            <span>商品<span style="color: red">*</span></span>
76
+        </template>
77
+        <template slot-scope="scope">
78
+           <el-form-item :prop="'tableList.' + scope.$index + '.name'" :rules='tableRules.name'>
79
+            <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)" :disabled="disabled">
80
+                <el-option
81
+                    v-for="(item,index) in tabList"
82
+                    :key="index"
83
+                    :label="item.supply_name"
84
+                    :value="item">
85
+                </el-option>
86
+             </el-select>
87
+           </el-form-item>
88
+        </template>
89
+    </el-table-column>
90
+    <el-table-column  align="center" width="150px">
91
+        <template slot="header" slot-scope="scope">
92
+            <span>商品类别</span>
93
+        </template>
94
+        <template slot-scope="scope">
95
+            <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
96
+        </template>
97
+    </el-table-column>
98
+    <el-table-column label="规格&单位" align="center" width="200px">
99
+        <template slot-scope="scope">
100
+            <el-input v-model="scope.row.supply_specification_name" style="width:150px" :disabled="true"></el-input>
101
+        </template>
102
+    </el-table-column>
103
+     <el-table-column label="单位" align="center" width="120px">
104
+        <template slot="header" slot-scope="scope">
105
+            <span>单位<span style="color: red">*</span></span>
106
+        </template>
107
+        <template slot-scope="scope">
108
+          <el-form-item :prop="'tableList.' + scope.$index + '.supply_unit'" :rules='tableRules.supply_unit'>
109
+            <el-select v-model="scope.row.supply_unit" style="width:100px;" filterable placeholder="请选择"  :disabled="disabled">
110
+                    <el-option
111
+                        v-for="(item,index) in scope.row.unitList"
112
+                        :key="index"
113
+                        :label="item.name"
114
+                        :value="item.name">
115
+                    </el-option>
116
+             </el-select>
117
+          </el-form-item>  
118
+        </template>
119
+    </el-table-column>
120
+    <el-table-column label="批号" align="center" width="130px">
121
+        <template slot-scope="scope">
122
+            <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
123
+        </template>
124
+    </el-table-column>
125
+    <el-table-column label="有效日期" align="center" width="130px">
126
+        <template slot-scope="scope">
127
+            <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
128
+        </template>
129
+    </el-table-column>
130
+    <el-table-column label="可用库存" align="center" width="130px">
131
+        <template slot-scope="scope">
132
+            <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
133
+        </template>
134
+    </el-table-column>
135
+    <el-table-column label="数量" align="center" width="120px">
136
+        <template slot="header" slot-scope="scope">
137
+            <span>数量<span style="color: red">*</span></span>
138
+        </template>
139
+        <template slot-scope="scope">
140
+          <el-form-item  :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
141
+             <el-input v-model="scope.row.supply_count" style="width:80px" :disabled="disabled"></el-input>
142
+          </el-form-item>
143
+        </template>
144
+    </el-table-column>
145
+
146
+    <el-table-column label="购货单价" align="center" width="120px">
147
+        <template slot-scope="scope">
148
+        <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
149
+        </template>
150
+    </el-table-column>
151
+
152
+    <el-table-column label="购货金额" align="center" width="120px">
153
+        <template slot-scope="scope">
154
+          {{calculate(scope.row.supply_count * scope.row.supply_price)}}
155
+        </template>
156
+    </el-table-column>
157
+
158
+    <el-table-column label="生产日期" align="center" width="200px">
159
+        <template slot-scope="scope">
160
+        <el-input v-model="scope.row.supply_manufacturer" style="width:160px" :disabled="true"></el-input>
161
+        </template>
162
+    </el-table-column>
163
+    <el-table-column label="生产厂家" align="center" width="200px">
164
+        <template slot-scope="scope">
165
+        <el-input v-model="scope.row.supply_manufacturer" style="width:160px" :disabled="true"></el-input>
166
+        </template>
167
+    </el-table-column>
168
+
169
+
170
+    <el-table-column label="批准文号" align="center" width="200px">
171
+        <template slot-scope="scope">
172
+        <el-input v-model="scope.row.supply_license_number" style="width:160px" :disabled="disabled"></el-input>
173
+        </template>
174
+    </el-table-column>
175
+    <el-table-column label="关联采购订单号" align="center" width="200px">
176
+        <template slot-scope="scope">
177
+        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
178
+        </template>
179
+    </el-table-column>
180
+    <el-table-column label="备注" align="center" width="200px">
181
+        <template slot-scope="scope">
182
+        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
183
+        </template>
184
+    </el-table-column>
185
+
186
+    <el-table-column label="操作" align="center" width="150px" fixed="right" >
187
+        <template slot-scope="scope">
188
+        <el-tooltip class="item" effect="dark" content="新增" placement="top" >
189
+            <el-button
190
+                size="mini"
191
+                type="primary"
192
+                icon="el-icon-circle-plus-outline"
193
+                @click="handleEdit(scope.$index, scope.row)">
194
+            </el-button>
195
+       </el-tooltip>
196
+       <el-tooltip class="item" effect="dark" content="删除" placement="top">
197
+            <el-button
198
+                size="mini"
199
+                type="danger"
200
+                icon="el-icon-delete"
201
+                @click="handleDelete(scope.$index, scope.row)">
202
+            </el-button>
203
+        </el-tooltip>
204
+
205
+        </template>
206
+    </el-table-column>
207
+  </el-table>
208
+</el-form>
209
+   <div style="margin-top:10px">
210
+      合计:{{getAllPrice()}} 元
211
+   </div>
212
+   <div style="margin-top:10px">
213
+        <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
214
+
215
+        <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
216
+
217
+        <span>本次付款:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
218
+
219
+        <span>本次欠款:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
220
+
221
+    </div>
222
+</div>
223
+
224
+  <!-- <el-dialog
225
+  title="提示"
226
+  :visible.sync="dialogVisible"
227
+  width="30%"
228
+  :before-close="handleClose">
229
+  <span>这是一段信息</span>
230
+  <span slot="footer" class="dialog-footer">
231
+    <el-button @click="dialogVisible = false">取 消</el-button>
232
+    <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
233
+  </span>
234
+  </el-dialog> -->
235
+</div>
236
+</template>
237
+
238
+<script>
239
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
240
+import {uParseTime } from '@/utils/tools'
241
+import {getInitOrder,updatePurchaseOrder,checkPurchaseOrder,getPurchaseOrderDetail} from "@/api/supply"
242
+export default {
243
+name: "addPurchaseOrder",
244
+components: {
245
+BreadCrumb
246
+},
247
+data() {
248
+return {
249
+    crumbs: [
250
+       { path: false, name: "购货订单" },
251
+       { path: "/spply/query", name: "编辑购货订单" }
252
+    ],
253
+    showTwo:true,
254
+    showOne:false,
255
+    recordInfo: {
256
+      tableList:[],
257
+    },
258
+    keywords: "",
259
+    total: 0,
260
+    multipleSelection: [],
261
+    signAndWeighBoxPatients: "sign-and-weigh-box-patients",
262
+    start_time: "",
263
+    end_time: "",
264
+    page: 1,
265
+    limit: 10,
266
+    goodType: [],
267
+    goodInfo: [],
268
+    org_id:0,
269
+    types:[],
270
+    tyep_name:"",
271
+    form:{
272
+    manufacturer_id:"",
273
+    },
274
+    tabList:[],
275
+    manufactuerList:[],
276
+    currentIndex: 0,
277
+    goodTypeList:[],
278
+    drugTypeList:[],
279
+    supplier_name:"",
280
+    supplyList:[],
281
+    rate_of_concession:"",
282
+    discount_amount:"",
283
+    start_time:new Date(),
284
+    end_time:new Date(),
285
+    tableRules: {
286
+     name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
287
+     supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
288
+   },
289
+   warehousing_id:0,
290
+   number:"",
291
+   loading:false,
292
+   drugList:[],
293
+   goodList:[],
294
+   id:0,
295
+   disabled:false,
296
+   is_check:0,
297
+   dialogVisible:false,
298
+  };
299
+},
300
+methods:{
301
+
302
+getInitOrder(){
303
+    getInitOrder().then(response=>{
304
+    if(response.data.state == 1){
305
+        var drugList = response.data.data.drugList
306
+        this.manufactuerList = response.data.data.manufactuerList
307
+        this.goodTypeList = response.data.data.goodTypeList
308
+        this.drugTypeList = response.data.data.drugTypeList
309
+        this.supplyList = response.data.data.supplyList
310
+       for(let i=0;i<drugList.length;i++){
311
+          for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
312
+            drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
313
+          }
314
+        for(let j=0;j<this.manufactuerList.length;j++){
315
+            if(drugList[i].manufacturer == this.manufactuerList[j].id){
316
+                drugList[i].manufacturer = this.manufactuerList[j].manufacturer_name
317
+            }
318
+        }
319
+        for(let y=0;y<this.drugTypeList.length;y++){
320
+            if(drugList[i].drug_type == this.drugTypeList[y].value){
321
+            drugList[i].drug_type = this.drugTypeList[y].name
322
+            }
323
+        }
324
+        drugList[i].supply_name =  drugList[i].drug_name + " " + drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit + " " + drugList[i].manufacturer
325
+        drugList[i].supply_type = drugList[i].drug_type
326
+        drugList[i].supply_specification_name = drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit
327
+        drugList[i].supply_total = this.getWarehoseInfo(drugList[i].drug_warehouse_info,drugList[i].max_unit,drugList[i].min_unit,drugList[i].min_number)
328
+        drugList[i].supply_count = ""
329
+        drugList[i].supply_total_price = ""
330
+        drugList[i].supply_manufacturer=  drugList[i].manufacturer
331
+        drugList[i].supply_license_number= drugList[i].number
332
+        drugList[i].supply_remake = ""
333
+        drugList[i].type = 1
334
+        drugList[i].supply_price = drugList[i].last_price
335
+        drugList[i].name = drugList[i].drug_name
336
+        drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
337
+        drugList[i].supply_unit = drugList[i].max_unit 
338
+        for(let j=0;j<drugList[i].unitList.length;j++){
339
+           drugList[i].unitList[0].name = drugList[i].max_unit
340
+           drugList[i].unitList[1].name = drugList[i].min_unit
341
+        }
342
+        this.tabList.push(drugList[i])
343
+        }
344
+        this.drugList = drugList
345
+        var goodList =  response.data.data.goodList
346
+        for(let i=0;i<goodList.length;i++){
347
+        for(let j=0;j<this.manufactuerList.length;j++){
348
+            if(goodList[i].manufacturer == this.manufactuerList[j].id){
349
+                goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
350
+            }
351
+        }
352
+        for(let y=0;y<this.goodTypeList.length;y++){
353
+            if(goodList[i].good_type_id == this.goodTypeList[y].id){
354
+                goodList[i].good_type_id = this.goodTypeList[y].type_name
355
+            }
356
+        }
357
+        goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
358
+        goodList[i].supply_type = goodList[i].good_type_id
359
+        goodList[i].supply_specification_name =goodList[i].specification_name
360
+        goodList[i].supply_price = goodList[i].buy_price
361
+        goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info)
362
+        goodList[i].supply_count = ""
363
+        goodList[i].supply_total_price = ""
364
+        goodList[i].supply_manufacturer = goodList[i].manufacturer
365
+        goodList[i].supply_license_number = ""
366
+        goodList[i].supply_remake = ""
367
+        goodList[i].type = 2
368
+        goodList[i].name = goodList[i].good_name
369
+        goodList[i].unitList =  [{id:1,name:""},{id:2,name:""}]
370
+        goodList[i].supply_unit = goodList[i].packing_unit
371
+        for(let j=0;j<goodList[i].unitList.length;j++){
372
+           goodList[i].unitList[0].name = goodList[i].packing_unit 
373
+        }
374
+        this.tabList.push(goodList[i])
375
+        }
376
+        this.goodList = goodList
377
+    } 
378
+    })
379
+},
380
+changeGoodName(val){
381
+  this.currentIndex = val
382
+},
383
+changeName(val){
384
+    //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}
385
+   for(let i=0;i<this.recordInfo.tableList.length;i++){
386
+    if(this.currentIndex == i){
387
+        this.recordInfo.tableList[i].project_id = val.id
388
+        this.recordInfo.tableList[i].type = val.type
389
+        this.recordInfo.tableList[i].name = val.name
390
+        this.recordInfo.tableList[i].supply_name = val.supply_name
391
+        this.recordInfo.tableList[i].supply_type = val.supply_type
392
+        this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name
393
+        this.recordInfo.tableList[i].supply_total = val.supply_total
394
+        if(val.supply_count == NaN){
395
+           this.recordInfo.tableList[i].supply_count = ""
396
+        }else{
397
+          this.recordInfo.tableList[i].supply_count = val.supply_count?val.supply_count:""
398
+        }
399
+
400
+        this.recordInfo.tableList[i].supply_price = val.supply_price?val.supply_price:""
401
+        this.recordInfo.tableList[i].supply_total_price = val.supply_total_price?val.supply_total_price:""
402
+        this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
403
+        this.recordInfo.tableList[i].supply_license_number = val.supply_license_number
404
+        this.recordInfo.tableList[i].supply_remake = val.supply_remake
405
+        this.recordInfo.tableList[i].is_total = val.is_total
406
+        this.recordInfo.tableList[i].supply_unit = val.supply_unit
407
+        this.recordInfo.tableList[i].unitList = val.unitList
408
+     }
409
+    }
410
+   
411
+
412
+},
413
+handleEdit(){
414
+    const tempObj = {}
415
+    tempObj["id"] = 0
416
+    tempObj["name"] = ""
417
+    tempObj['supply_name'] = ""
418
+    tempObj['supply_type'] = ""
419
+    tempObj['supply_specification_name'] = ''
420
+    tempObj['supply_total'] = ""
421
+    tempObj['supply_count'] = ""
422
+    tempObj['supply_price'] = ""
423
+    tempObj['supply_total_price'] = ""
424
+    tempObj['supply_manufacturer'] = ''
425
+    tempObj['supply_license_number'] = ''
426
+    tempObj['supply_remake'] = ''
427
+    tempObj['type'] = 0
428
+    tempObj['is_total'] = 1
429
+    tempObj["project_id"] = 0
430
+    tempObj["supply_unit"] = ""
431
+    this.recordInfo.tableList.push(tempObj)
432
+},
433
+handleDelete: function(index, row) {
434
+  if (this.recordInfo.tableList.length <= 1) {
435
+        this.$message.error('只有一条记录的时候无法删除')
436
+        return
437
+   } else {
438
+        this.recordInfo.tableList.splice(index, 1)
439
+   }
440
+},
441
+
442
+changeTypeName(){
443
+
444
+},
445
+startTimeChange(){
446
+
447
+},
448
+endTimeChange(){
449
+
450
+},
451
+search(){
452
+
453
+},
454
+
455
+getWarehoseInfo(arr,max_unit,min_unit,min_number){
456
+    var total = 0
457
+    var max_str=  ""
458
+    var min_str = ""
459
+    if (arr.length > 0) {
460
+      for(let i=0;i<arr.length;i++){
461
+        total += parseInt(arr[i].stock_max_number)
462
+      }
463
+    }
464
+    if (total < min_number){
465
+        min_str = total + min_unit
466
+    }
467
+    if (total == 0) {
468
+        min_str = ""
469
+        max_str = ""
470
+    }
471
+   if (total >=min_number) {
472
+    if(parseInt(total/min_number)!=0){
473
+        max_str = parseInt(total/min_number) + max_unit
474
+    }
475
+    if(total%min_number!=0){
476
+       min_str = total%min_number + min_unit
477
+    }
478
+  }
479
+ return max_str + min_str
480
+ },
481
+getTotalStockCount(arr){
482
+  var total_count = 0
483
+  for(let i=0;i<arr.length;i++){
484
+    total_count += arr[i].stock_count
485
+  }
486
+  return total_count
487
+},
488
+calculate: function(val) {
489
+    if (isNaN(val)) {
490
+        return "";
491
+    }
492
+    if (val == 0) {
493
+        return "";
494
+    }
495
+    return Math.round(parseFloat(val) * 100) / 100;
496
+  },
497
+getTimes(time) {
498
+    if (time === '') {
499
+    return ''
500
+    }
501
+    return uParseTime(time, '{y}-{m}-{d}')
502
+},
503
+ updatePurchaseOrder(){
504
+   this.loading = true 
505
+    if(this.supplier_name == 0 || this.supplier_name == ""){
506
+        this.$message.error("供应商不能为空!")
507
+        this.loading = false
508
+        return false
509
+    }
510
+   this.$refs["tableForm"].validate((valid)=>{
511
+      if(valid){
512
+        for(let i=0;i<this.recordInfo.tableList.length;i++){
513
+           this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
514
+           this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
515
+           this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
516
+           this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
517
+            this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
518
+           for(let j=0;j<this.manufactuerList.length;j++){
519
+              if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
520
+                this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
521
+              }
522
+           }
523
+        }
524
+        var start = this.getTimes(this.start_time)
525
+        var end = this.getTimes(this.end_time)
526
+        const params = {
527
+        'stockIn': this.recordInfo.tableList
528
+        }
529
+        console.log("param23232332",params)  
530
+       
531
+        updatePurchaseOrder(params,this.supplier_name,start,end,this.rate_of_concession,this.discount_amount,this.id,this.number).then(response=>{
532
+           if(response.data.state == 1){
533
+            this.loading = false
534
+             var warehousingInfo =  response.data.data.warehousingInfo
535
+             this.$message.success("修改成功!")
536
+           }
537
+        })
538
+      } 
539
+   })
540
+ },
541
+ getAllPrice(){
542
+   var total_price = 0
543
+   for(let i=0;i<this.recordInfo.tableList.length;i++){
544
+      total_price += (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count)
545
+   }  
546
+   return total_price.toFixed(2)
547
+ },
548
+ checkPurchaseOrder(id,index){
549
+   this.$confirm('是否审核?', {
550
+    confirmButtonText: '确 定',
551
+    cancelButtonText: '取 消',
552
+    type: 'warning'
553
+    }).then(() => { 
554
+    checkPurchaseOrder(this.id).then(response => {
555
+        if (response.data.state == 1) {
556
+          var info = response.data.data.info
557
+          this.disabled = true
558
+          this.$message.success("审核成功!")
559
+          this.getPurchaseOrderDetail()
560
+        } 
561
+     })
562
+    })
563
+    .catch(() => {
564
+    }) 
565
+  },
566
+  getPurchaseOrderDetail(){
567
+      var id = this.$route.query.id
568
+    getPurchaseOrderDetail(id).then(response=>{
569
+      if(response.data.state == 1){
570
+        var info = response.data.data.info
571
+        this.is_check = info.is_check
572
+        this.number = info.number
573
+        this.id = info.id
574
+        this.supplier_name = info.supplier_id
575
+        this.rate_of_concession = info.rate_of_concession
576
+        this.discount_amount = info.discount_amount
577
+        var orderInfo = response.data.data.orderInfo
578
+        if(info.is_check == 2){
579
+           this.disabled = false
580
+        }
581
+        if(info.is_check == 1){
582
+           this.disabled = true
583
+        }
584
+        console.log("drugli323322332",this.drugList)
585
+        var drugList = response.data.data.baseList
586
+        var goodList = response.data.data.goodList
587
+        for(let i=0;i<orderInfo.length;i++){
588
+            orderInfo[i].supply_count = orderInfo[i].count
589
+            orderInfo[i].supply_price = orderInfo[i].price
590
+            orderInfo[i].supply_remake = orderInfo[i].remark
591
+            orderInfo[i].type = orderInfo[i].is_source
592
+            orderInfo[i].project_id = orderInfo[i].project_id
593
+            orderInfo[i].supply_unit = orderInfo[i].supply_unit
594
+           if(orderInfo[i].is_source == 1){
595
+            for(let j=0;j<drugList.length;j++){
596
+                if(orderInfo[i].project_id == drugList[j].id){
597
+                  orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
598
+                  orderInfo[i].unitList[0].name = drugList[j].max_unit
599
+                  orderInfo[i].unitList[1].name = drugList[j].min_unit
600
+                }
601
+             }  
602
+            } 
603
+          if(orderInfo[i].is_source == 2){
604
+            for(let j=0;j<goodList.length;j++){
605
+                if(orderInfo[i].project_id == goodList[j].id){
606
+                    orderInfo[i].unitList = [{id:1,name:""}]
607
+                    orderInfo[i].unitList[0].name = goodList[j].packing_unit
608
+                }
609
+            }  
610
+          } 
611
+        }
612
+        console.log("orderINFO23323232",orderInfo)
613
+        this.recordInfo.tableList = orderInfo
614
+      }
615
+    })  
616
+  },
617
+  toPrint(){
618
+     var id = this.$route.query.id
619
+     this.$router.push({path:"/purchase/order/print?&id="+id})  
620
+  },
621
+  toAdd(){
622
+    var id = this.$route.query.id
623
+    if(this.is_check == 2){
624
+      this.$message.error("该采购订单未审核,不能生成采购数据!")
625
+      return false
626
+    }
627
+    this.$router.push({path:"/good/order/add?id="+id})
628
+  }
629
+},
630
+created(){
631
+    const tempObj = {}
632
+    tempObj["id"] = 0
633
+    tempObj["name"] = ""
634
+    tempObj['supply_name'] = ""
635
+    tempObj['supply_type'] = ""
636
+    tempObj['supply_specification_name'] = ''
637
+    tempObj['supply_total'] = ""
638
+    tempObj['supply_count'] = ""
639
+    tempObj['supply_price'] = ""
640
+    tempObj['supply_total_price'] = ""
641
+    tempObj['supply_manufacturer'] = ''
642
+    tempObj['supply_license_number'] = ''
643
+    tempObj['supply_remake'] = ''
644
+    tempObj['type'] = 0
645
+    tempObj['is_total'] = 1
646
+    tempObj["project_id"] = 0
647
+    tempObj["supply_unit"] = ""
648
+    this.recordInfo.tableList.push(tempObj)
649
+    this.getInitOrder()
650
+    this.getPurchaseOrderDetail()
651
+}
652
+};
653
+</script>
654
+
655
+<style rel="stylesheet/css" lang="scss" scoped>
656
+.information {
657
+border: 1px #dcdfe6 solid;
658
+padding: 30px 20px 30px 20px;
659
+
660
+.border {
661
+border-bottom: 1px #dcdfe6 solid;
662
+margin: 0px 0 20px 0;
663
+}
664
+}
665
+
666
+.title {
667
+background: #409eff;
668
+height: 44px;
669
+line-height: 44px;
670
+padding: 0 0 0 10px;
671
+color: #fff;
672
+margin: 0 0 10px 0;
673
+}
674
+
675
+.edit_separater {
676
+border-top: 1px solid rgb(233, 233, 233);
677
+margin-top: 15px;
678
+margin-bottom: 15px;
679
+}
680
+</style>
681
+
682
+<style>
683
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
684
+font-size: 12px;
685
+}
686
+
687
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
688
+background: #6fb5fa;
689
+}
690
+
691
+.count {
692
+color: #bd2c00;
693
+}
694
+.el-table td,
695
+.el-table th.is-leaf,
696
+.el-table--border,
697
+.el-table--group {
698
+border-color: #d0d3da;
699
+}
700
+.el-table--border::after,
701
+.el-table--group::after,
702
+.el-table::before {
703
+background-color: #d0d3da;
704
+}
705
+.el-table__fixed-right{
706
+  width:150px;
707
+  bottom: 20px;
708
+  height: 100%;
709
+}
710
+</style>

+ 292 - 0
src/xt_pages/supply/components/purchaseOrderPrint.vue View File

1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+        <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+        <el-row style="float:right;">
6
+            <el-col :span="24">
7
+            <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
8
+            </el-col>
9
+        </el-row>
10
+        </div>
11
+        <div class="app-container" style="background-color: white;">
12
+            <div id="print_content">
13
+                <div class="print_main_content">
14
+                    <div class="order_title_panl">
15
+                        <div style="font-size:22px;font-weight:bold;">{{ orgName }}</div>
16
+                        <span style="font-weight:500;font-size:18px;">购货单</span>
17
+                    </div>
18
+                    <div style="display:flex;justify-content: space-between;">
19
+                      <div style="text-align:left;margin-bottom:1px;font-size: 18px;">
20
+                        供应商:{{getSupplyName(supplier_id)}}
21
+                      </div>
22
+                      <div style="margin-bottom:1px;font-size: 18px;">
23
+                        单据日期:{{rate_of_concession}}
24
+                      </div>
25
+                      <div style="margin-bottom:1px;font-size: 18px;">
26
+                        单据编号:{{number}}
27
+                      </div>
28
+                      <div style="margin-bottom:1px;font-size: 18px;">
29
+                        币别:RMB
30
+                      </div>
31
+                    </div>
32
+                    
33
+                    <div class="table_panel">
34
+                        <table class="table">
35
+                            <thead>
36
+                                <tr>
37
+                                    <td style="line-height:18px;" width="80">序号</td>
38
+                                    <td style="line-height:18px;" width="80">商品</td>
39
+                                    <td style="line-height:18px;" width="80">单位</td>
40
+                                    <td style="line-height:18px;" width="80">数量</td>
41
+                                    <td style="line-height:18px;" width="80">购货单价</td>
42
+                                    <td style="line-height:18px;" width="80">折扣率</td>
43
+                                    <td style="line-height:18px;" width="80">折扣额</td> 
44
+                                    <td style="line-height:18px;" width="60">购物金额</td>
45
+                                    <td style="line-height:18px;" width="80">仓库</td>
46
+                                </tr>
47
+                            </thead>
48
+                            <tbody>
49
+                                <tr v-for='(item,index) in tableList' :key="index">
50
+                                    <td style="line-height:18px;"><span>{{index+ 1}}</span></td>
51
+                                    <td style="line-height:18px;"><span>{{item.name}}</span></td>
52
+                                    <td style="line-height:18px;"><span>{{item.supply_unit}}</span></td>
53
+                                    <td style="line-height:18px;"><span>{{item.count}}</span></td>
54
+                                    <td style="line-height:18px;"><span>{{item.price}}</span></td>
55
+                                    <td style="line-height:18px;"><span>{{rate_of_concession}}</span></td>
56
+                                    <td style="line-height:18px;"><span>{{discount_amount}}</span></td>
57
+                                    <td style="line-height:18px;"><span>{{(item.count * item.price).toFixed(2)}}</span></td>
58
+                                    <td style="line-height:18px;"><span></span></td>
59
+                                </tr>
60
+                                <tr>
61
+                                  <td>合计</td>
62
+                                  <td colspan="12" style="text-align:right;"></td>
63
+                               </tr>
64
+                            </tbody>
65
+                        </table>
66
+
67
+                        <div style="margin-top:1px;">
68
+                            <div style="width:100px;">折扣额:</div><div style="width:100px;"></div>
69
+                            <div style="width:100px;">折扣金额:</div><div style="width:100px;"><span></span></div>
70
+                            <div style="width:100px;">本次付款:</div><div style="width:100px;"><span></span></div>
71
+                            <div style="width:100px;">本次欠款:</div><div style="width:100px;"></div>
72
+                       </div>
73
+                        <div style="margin-top:1px;">
74
+                            <div style="width:100px;">备注</div><div style="width:100px;"></div>
75
+                       </div>
76
+                       <div style="margin-top:1px;">
77
+                            <div style="width:100px;">制单人:</div><div style="width:100px;"></div>
78
+                            <div style="width:100px;">收货人签字:</div><div style="width:100px;"><span></span></div>
79
+                            <div style="width:100px;">供应商签字:</div><div style="width:100px;"><span></span></div>
80
+                       </div>
81
+                    </div>
82
+                </div>
83
+            </div>
84
+        </div>
85
+    </div>
86
+</template>
87
+
88
+<script>
89
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
90
+
91
+import { fetchAllAdminUsers } from "@/api/doctor";
92
+import {getPurchaseOrderDetail} from "@/api/supply"
93
+import print from 'print-js'
94
+const moment = require('moment')
95
+import { uParseTime } from '@/utils/tools'
96
+export default {
97
+    components:{
98
+        BreadCrumb
99
+    },
100
+    data(){
101
+        return{
102
+          crumbs: [
103
+            { path: false, name: '库存管理' },
104
+            { path: false, name: '耗材管理' },
105
+            { path: false, name: '入库单打印' },
106
+          ],
107
+            isEdit: 0,
108
+            checked: false,
109
+            signAndWeighBoxPatients: "sign-and-weigh-box-patients", 
110
+            time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
111
+            orgName:'',
112
+            orgId:'',
113
+            adminUserOptions:[],
114
+            tableList:[],
115
+            number:"",
116
+            id:"",
117
+            supplier_id:"",
118
+            rate_of_concession:"",
119
+            discount_amount:"",
120
+            supplyList:[],
121
+            document_date:"",
122
+        }
123
+    },
124
+    methods:{
125
+      printAction: function() {
126
+          const style = '@media print { .print_main_content { background-color: white; width:960px;  margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 14px; padding: 1px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 12px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
127
+          printJS({
128
+          printable: 'print_content',
129
+          type: 'html',
130
+          documentTitle: '  ',
131
+          style: style,
132
+          scanStyles: false
133
+          })
134
+      },
135
+
136
+      getTime(val) {
137
+         if(val < 0){
138
+           return ""
139
+         }
140
+         if(val == ""){
141
+          return ""
142
+         }else {
143
+          return uParseTime(val, '{y}-{m}-{d}')
144
+         }
145
+      },
146
+      fetchAllAdminUsers() {
147
+        fetchAllAdminUsers().then(response => {
148
+          if (response.data.state == 1) {
149
+            this.adminUserOptions = response.data.data.users
150
+
151
+          }
152
+        })
153
+      },
154
+      getXuserName(id) {
155
+        if (id <= 0) {
156
+          return "";
157
+        }
158
+        var name = "";
159
+        if (
160
+          this.adminUserOptions == null ||
161
+          typeof this.adminUserOptions.length === "undefined"
162
+        ) {
163
+          return name;
164
+        }
165
+        var leng = this.adminUserOptions.length;
166
+        if (leng == 0) {
167
+          return name;
168
+        }
169
+        for (let index = 0; index < leng; index++) {
170
+          if (this.adminUserOptions[index].id == id) {
171
+            name = this.adminUserOptions[index].name;
172
+            break;
173
+          }
174
+        }
175
+        return name;
176
+      },
177
+      getPurchaseOrderDetail(){
178
+        var id = this.$route.query.id
179
+        getPurchaseOrderDetail(id).then(response=>{
180
+        if(response.data.state == 1){
181
+            var info = response.data.data.info
182
+            this.is_check = info.is_check
183
+            this.number = info.number
184
+            this.id = info.id
185
+            this.supplier_id = info.supplier_id
186
+            this.rate_of_concession = info.rate_of_concession
187
+            this.discount_amount = info.discount_amount
188
+            this.document_date = info.document_date
189
+            var orderInfo = response.data.data.orderInfo
190
+            var supplyList = response.data.data.supplyList
191
+            this.supplyList = supplyList
192
+            for(let i=0;i<orderInfo.length;i++){
193
+                orderInfo[i].supply_count = orderInfo[i].count
194
+                orderInfo[i].supply_price = orderInfo[i].price
195
+                orderInfo[i].supply_remake = orderInfo[i].remark
196
+                orderInfo[i].type = orderInfo[i].is_source
197
+                orderInfo[i].project_id = orderInfo[i].project_id
198
+            }
199
+            console.log("orderINFO23323232",orderInfo)
200
+            this.tableList = orderInfo
201
+        }
202
+      })  
203
+    },
204
+    getSupplyName(id){
205
+      var name = ""
206
+      for(let i=0;i<this.supplyList.length;i++){
207
+        if(id == this.supplyList[i].id){
208
+          name = this.supplyList[i].supplier_name
209
+        }
210
+      }
211
+      return name
212
+    },
213
+    },
214
+    created(){
215
+      this.orgName = this.$store.getters.xt_user.org.org_name;
216
+      this.orgId = this.$store.getters.xt_user.org.id;
217
+      this.fetchAllAdminUsers()
218
+      this.getPurchaseOrderDetail()
219
+    
220
+    }
221
+}
222
+</script>
223
+
224
+
225
+<style rel="stylesheet/scss" lang="scss" scoped>
226
+.print_main_content {
227
+  background-color: white;
228
+  max-width: 1500px;
229
+  margin: 0 auto;
230
+  padding: 0 0 20px 0;
231
+
232
+  .order_title_panl {
233
+    text-align: center;
234
+
235
+    .main_title {
236
+      font-size: 18px;
237
+      line-height: 40px;
238
+      font-weight: 500;
239
+    }
240
+  }
241
+  .table_panel {
242
+    .table {
243
+      width: 100%;
244
+      border: 1px solid;
245
+      border-collapse: collapse;
246
+      padding: 2px;
247
+      
248
+
249
+      thead {
250
+        tr {
251
+          td {
252
+            border: 1px solid;
253
+            text-align: center;
254
+            font-size: 18px;
255
+            padding: 1px 5px;
256
+          }
257
+        }
258
+      }
259
+      tbody {
260
+        tr {
261
+          td {
262
+            border: 1px solid;
263
+            text-align: center;
264
+            font-size: 18px;
265
+            padding: 10px 5px;
266
+            white-space: pre-line;
267
+            .proj {
268
+              padding: 5px 0;
269
+              text-align: left;
270
+
271
+              .proj_title {
272
+                font-size: 16px;
273
+                font-weight: 500;
274
+                line-height: 25px;
275
+              }
276
+
277
+              .proj_item {
278
+                font-size: 15px;
279
+                line-height: 20px;
280
+
281
+                .zone_name {
282
+                  font-weight: 500;
283
+                }
284
+              }
285
+            }
286
+          }
287
+        }
288
+      }
289
+    }
290
+  }
291
+}
292
+</style>

+ 387 - 0
src/xt_pages/supply/goodOrderQuery.vue View File

1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+    </div>
6
+    <div class="app-container ">
7
+      <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8
+        <div>
9
+        
10
+          <el-date-picker
11
+            size="small"
12
+            v-model="start_time"
13
+            prefix-icon="el-icon-date"
14
+            :editable="false"
15
+            style="width: 196px;"
16
+            type="date"
17
+            placeholder="选择日期时间"
18
+            align="right"
19
+            format="yyyy-MM-dd"
20
+            value-format="yyyy-MM-dd"
21
+            @change="startTimeChange"
22
+           ></el-date-picker>-
23
+            <el-date-picker
24
+              size="small"
25
+              v-model="end_time"
26
+              prefix-icon="el-icon-date"
27
+              :editable="false"
28
+              style="width: 196px;"
29
+              type="date"
30
+              placeholder="选择日期时间"
31
+              align="right"
32
+              format="yyyy-MM-dd"
33
+              value-format="yyyy-MM-dd"
34
+              @change="endTimeChange"
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>
46
+          <el-input
47
+            size="small"
48
+            style="width: 200px;margin-left:10px;"
49
+            class="filter-item"
50
+            v-model.trim="keywords"
51
+            placeholder="订单编号或供应商名称"
52
+          />
53
+          <el-button
54
+            size="small"
55
+            class="filter-item"
56
+            type="primary"
57
+            icon="el-icon-search"
58
+            @click="search"
59
+            >搜索</el-button
60
+          >
61
+        </div>
62
+        <div>
63
+          <el-button size="small" type="primary" @click="toAdd">新增</el-button>
64
+        </div>
65
+      </div>
66
+
67
+
68
+       <el-table
69
+        :row-style="{ color: '#303133' }"
70
+        :header-cell-style="{
71
+          backgroundColor: 'rgb(245, 247, 250)',
72
+          color: '#606266'
73
+        }"
74
+        :data="tableList"
75
+        :class="signAndWeighBoxPatients"
76
+        border
77
+      >
78
+        <el-table-column label="单据日期" align="center">
79
+          <template slot-scope="scope">
80
+            <span>{{getTimes(scope.row.document_date)}}</span>
81
+         </template>
82
+        </el-table-column>
83
+        <el-table-column label="单据编号" align="center">
84
+          <template slot-scope="scope">
85
+            <span>{{scope.row.number}}</span>
86
+          </template>
87
+        </el-table-column>
88
+        <el-table-column label="供应商" align="center">
89
+            <template slot-scope="scope">
90
+              <span>{{getName(scope.row.supplier_id)}}</span>
91
+            </template>
92
+         </el-table-column>
93
+        <el-table-column label="关联购货订单号" align="center" width="200">
94
+          <template slot-scope="scope">
95
+            
96
+          </template>
97
+        </el-table-column>
98
+        <el-table-column label="购货金额" align="center">
99
+          <template slot-scope="scope">
100
+             <span v-if="getAllBuyPrice(scope.row.orderInfo)>0">{{getAllBuyPrice(scope.row.orderInfo)}}</span> 
101
+          </template>
102
+        </el-table-column>
103
+        <el-table-column label="优惠后金额" align="center">
104
+         <template slot-scope="scope">
105
+           {{getAllCount(scope.row.orderInfo)}}
106
+         </template>
107
+       </el-table-column>
108
+        <el-table-column label="已付款" align="center">
109
+         <template slot-scope="scope">
110
+           {{getAllCount(scope.row.orderInfo)}}
111
+         </template>
112
+       </el-table-column>
113
+       <el-table-column label="数量" align="center">
114
+         <template slot-scope="scope">
115
+           {{getAllCount(scope.row.orderInfo)}}
116
+         </template>
117
+       </el-table-column>
118
+
119
+       <el-table-column label="订单状态" align="center">
120
+         <template slot-scope="scope">
121
+           <span v-if="scope.row.is_check == 2">未审核</span>
122
+           <span v-if="scope.row.is_check == 1">已审核</span>
123
+         </template>
124
+       </el-table-column>
125
+      
126
+          
127
+      <el-table-column label="制单人" align="center">
128
+         <template slot-scope="scope">
129
+          {{getDocName(scope.row.creater)}}
130
+         </template>
131
+       </el-table-column>
132
+
133
+      <el-table-column label="审核人" align="center">
134
+         <template slot-scope="scope">
135
+          {{getDocName(scope.row.checker)}}
136
+         </template>
137
+       </el-table-column>
138
+
139
+       <el-table-column label="操作" align="center" width="260px">
140
+          <template slot-scope="scope">
141
+              <el-button
142
+                icon="el-icon-edit-outline"
143
+                size="small"
144
+                type="primary"
145
+                @click="toClick(scope.row.id)"
146
+              >编辑
147
+              </el-button>
148
+              <el-button
149
+                icon="el-icon-delete"
150
+                size="small"
151
+                type="danger"
152
+                @click="toClickOne(scope.row)"
153
+              >删除
154
+              </el-button>
155
+          </template>
156
+        </el-table-column>
157
+      </el-table>
158
+      <el-pagination
159
+        @size-change="handleSizeChange"
160
+        @current-change="handleCurrentChange"
161
+        :page-sizes="[10, 50, 100,200,500,1000]"
162
+        :page-size="10"
163
+        background
164
+        align="right"
165
+        style="margin-top:20px;"
166
+        layout="total, sizes, prev, pager, next, jumper"
167
+        :total="total"
168
+      >
169
+      </el-pagination>
170
+
171
+    </div>
172
+  </div>
173
+</template>
174
+
175
+<script>
176
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
177
+
178
+import {getAllSupply,getAllPurchaseOrderList} from "@/api/supply"
179
+import {uParseTime } from '@/utils/tools'
180
+export default {
181
+  name: "stockIn",
182
+   components: {
183
+     
184
+   },
185
+  components: {
186
+    BreadCrumb
187
+  },
188
+  data() {
189
+    return {
190
+      crumbs: [
191
+        { path: false, name: "采购管理" },
192
+        { path: "/spply/query", name: "购货单" }
193
+      ],
194
+      keywords: "",
195
+      total: 0,
196
+      multipleSelection: [],
197
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
198
+      start_time: "",
199
+      end_time:new Date(),
200
+      page: 1,
201
+      limit: 10,
202
+      goodType: [],
203
+      goodInfo: [],
204
+      org_id:0,
205
+      types:[],
206
+      tableList:[],
207
+      type_name:"",
208
+      checkList:[
209
+        {id:0,name:"请选择"},
210
+        {id:1,name:"已审核"},
211
+        {id:2,name:"未审核"},
212
+      ],
213
+      supplyList:[],
214
+      check_id:0,
215
+      doctorList:[],
216
+    };
217
+  },
218
+  methods:{
219
+     toAdd(){
220
+       this.$router.push({path:"/purchase/order/add"})
221
+     },
222
+     changeTypeName(){
223
+
224
+     },
225
+     startTimeChange(){
226
+
227
+     },
228
+     endTimeChange(){
229
+
230
+     },
231
+     search(){
232
+
233
+     },
234
+     handleSizeChange(val){
235
+       this.limit = val
236
+       this.getlist()
237
+     },
238
+     handleCurrentChange(val){
239
+       this.page = val
240
+       this.getlist()
241
+     },
242
+     getAllSupply(){
243
+       getAllSupply().then(response=>{
244
+         if(response.data.state == 1){
245
+            var supplyList = response.data.data.supplyList
246
+            this.doctorList = response.data.data.doctorList
247
+            for(let i=0;i<supplyList.length;i++){
248
+              this.supplyList.push(supplyList[i])
249
+            }
250
+         }
251
+       })
252
+     },
253
+     changeTypeName(){
254
+
255
+     },
256
+     getTimes(time) {
257
+      if (time === '') {
258
+      return ''
259
+      }
260
+      return uParseTime(time, '{y}-{m}-{d}')
261
+     },
262
+     getlist(){
263
+        var params = {
264
+          check_id:this.check_id,
265
+          start_time:this.getTimes(this.start_time),
266
+          end_time:this.getTimes(this.end_time),
267
+          keyword:this.keywords,
268
+          page:this.page,
269
+          limit:this.limit,
270
+        }
271
+       getAllPurchaseOrderList(params).then(response=>{
272
+          if(response.data.state == 1){
273
+            var list = response.data.data.list 
274
+            console.log("list2332232323232",list)
275
+            this.tableList = list
276
+            var total = response.data.data.total
277
+            this.total = total
278
+          }
279
+       })
280
+     },
281
+     getName(id){
282
+       var name = ""
283
+       for(let i=0;i<this.supplyList.length;i++){
284
+         if(id == this.supplyList[i].id){
285
+           name = this.supplyList[i].supplier_name
286
+         }
287
+       }
288
+       return name
289
+     },
290
+     getDocName(id){
291
+      var user_name = ""
292
+      for(let i=0;i<this.doctorList.length;i++){
293
+        if(id == this.doctorList[i].admin_user_id){
294
+          user_name = this.doctorList[i].user_name
295
+        }
296
+      }
297
+      return user_name
298
+     },
299
+     getAllBuyPrice(arr){
300
+       var buy_price = 0
301
+       if(arr!=undefined && arr.length > 0){
302
+          for(let i=0;i<arr.length;i++){
303
+            buy_price += (arr[i].count * arr[i].price)
304
+          }
305
+       }
306
+       return buy_price.toFixed(2)
307
+     },
308
+     getAllCount(arr){
309
+       var count = ""
310
+        if(arr!=undefined && arr.length > 0){
311
+          for(let i=0;i<arr.length;i++){
312
+            count += arr[i].count
313
+          }
314
+       }
315
+       return count
316
+     },
317
+     toClick(id){
318
+       this.$router.push({path:"/purchase/order/edit?id="+id})
319
+     }
320
+  },
321
+  created() {
322
+    var now = new Date(); //当前日期 
323
+    var nowMonth = now.getMonth(); //当前月 
324
+    var nowYear = now.getFullYear(); //当前年 
325
+    //本月的开始时间
326
+    var monthStartDate = new Date(nowYear, nowMonth, 1); 
327
+    this.start_time = monthStartDate
328
+    this.org_id =  this.$store.getters.xt_user.org_id
329
+    this.getAllSupply()
330
+    this.getlist()
331
+  },
332
+ 
333
+};
334
+</script>
335
+
336
+<style rel="stylesheet/css" lang="scss" scoped>
337
+.information {
338
+  border: 1px #dcdfe6 solid;
339
+  padding: 30px 20px 30px 20px;
340
+
341
+  .border {
342
+    border-bottom: 1px #dcdfe6 solid;
343
+    margin: 0px 0 20px 0;
344
+  }
345
+}
346
+
347
+.title {
348
+  background: #409eff;
349
+  height: 44px;
350
+  line-height: 44px;
351
+  padding: 0 0 0 10px;
352
+  color: #fff;
353
+  margin: 0 0 10px 0;
354
+}
355
+
356
+.edit_separater {
357
+  border-top: 1px solid rgb(233, 233, 233);
358
+  margin-top: 15px;
359
+  margin-bottom: 15px;
360
+}
361
+</style>
362
+
363
+<style>
364
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
365
+  font-size: 12px;
366
+}
367
+
368
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
369
+  background: #6fb5fa;
370
+}
371
+
372
+.count {
373
+  color: #bd2c00;
374
+}
375
+.el-table td,
376
+.el-table th.is-leaf,
377
+.el-table--border,
378
+.el-table--group {
379
+  border-color: #d0d3da;
380
+}
381
+.el-table--border::after,
382
+.el-table--group::after,
383
+.el-table::before {
384
+  background-color: #d0d3da;
385
+}
386
+
387
+</style>

+ 138 - 47
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
 
134
        <el-table-column label="操作" align="center" width="260px">
136
        <el-table-column label="操作" align="center" width="260px">
135
           <template slot-scope="scope">
137
           <template slot-scope="scope">
136
               <el-button
138
               <el-button
139
+                icon="el-icon-edit-outline"
137
                 size="small"
140
                 size="small"
138
                 type="primary"
141
                 type="primary"
139
-                @click="toClick(scope.row)"
140
-              >库存流水
142
+                @click="toClick(scope.row.id)"
143
+              >编辑
141
               </el-button>
144
               </el-button>
142
               <el-button
145
               <el-button
146
+                icon="el-icon-delete"
143
                 size="small"
147
                 size="small"
144
-                type="primary"
148
+                type="danger"
145
                 @click="toClickOne(scope.row)"
149
                 @click="toClickOne(scope.row)"
146
-              >批次
150
+              >删除
147
               </el-button>
151
               </el-button>
148
           </template>
152
           </template>
149
         </el-table-column>
153
         </el-table-column>
168
 <script>
172
 <script>
169
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
173
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
170
 
174
 
171
-
175
+import {getAllSupply,getAllPurchaseOrderList} from "@/api/supply"
176
+import {uParseTime } from '@/utils/tools'
172
 export default {
177
 export default {
173
   name: "stockIn",
178
   name: "stockIn",
174
    components: {
179
    components: {
175
      
180
      
176
    },
181
    },
177
-  created() {
178
-    this.org_id =  this.$store.getters.xt_user.org_id
179
-
180
-    var start_time =  window.sessionStorage.getItem('start_time')
181
-    var end_time =  window.sessionStorage.getItem('end_time')
182
-
183
-    if(start_time !=null){
184
-      this.start_time = start_time
185
-    }
186
-    if(end_time!=null){
187
-      this.end_time = end_time
188
-    }
189
-    window.sessionStorage.removeItem('start_time')
190
-    window.sessionStorage.removeItem('end_time')
191
-  },
192
   components: {
182
   components: {
193
     BreadCrumb
183
     BreadCrumb
194
   },
184
   },
196
     return {
186
     return {
197
       crumbs: [
187
       crumbs: [
198
         { path: false, name: "采购管理" },
188
         { path: false, name: "采购管理" },
199
-        { path: "/spply/query", name: "供应商管理" }
189
+        { path: "/spply/query", name: "购货订单" }
200
       ],
190
       ],
201
       keywords: "",
191
       keywords: "",
202
       total: 0,
192
       total: 0,
203
       multipleSelection: [],
193
       multipleSelection: [],
204
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
194
       signAndWeighBoxPatients: "sign-and-weigh-box-patients",
205
       start_time: "",
195
       start_time: "",
206
-      end_time: "",
196
+      end_time:new Date(),
207
       page: 1,
197
       page: 1,
208
       limit: 10,
198
       limit: 10,
209
       goodType: [],
199
       goodType: [],
212
       types:[],
202
       types:[],
213
       tableList:[],
203
       tableList:[],
214
       type_name:"",
204
       type_name:"",
205
+      checkList:[
206
+        {id:0,name:"请选择"},
207
+        {id:1,name:"已审核"},
208
+        {id:2,name:"未审核"},
209
+      ],
210
+      supplyList:[],
211
+      check_id:0,
212
+      doctorList:[],
215
     };
213
     };
216
   },
214
   },
217
   methods:{
215
   methods:{
230
      search(){
228
      search(){
231
 
229
 
232
      },
230
      },
233
-     handleSizeChange(){
234
-
231
+     handleSizeChange(val){
232
+       this.limit = val
233
+       this.getlist()
235
      },
234
      },
236
-     handleCurrentChange(){
235
+     handleCurrentChange(val){
236
+       this.page = val
237
+       this.getlist()
238
+     },
239
+     getAllSupply(){
240
+       getAllSupply().then(response=>{
241
+         if(response.data.state == 1){
242
+            var supplyList = response.data.data.supplyList
243
+            this.doctorList = response.data.data.doctorList
244
+            for(let i=0;i<supplyList.length;i++){
245
+              this.supplyList.push(supplyList[i])
246
+            }
247
+         }
248
+       })
249
+     },
250
+     changeTypeName(){
237
 
251
 
238
-     } 
239
-  }
252
+     },
253
+     getTimes(time) {
254
+      if (time === '') {
255
+      return ''
256
+      }
257
+      return uParseTime(time, '{y}-{m}-{d}')
258
+     },
259
+     getlist(){
260
+        var params = {
261
+          check_id:this.check_id,
262
+          start_time:this.getTimes(this.start_time),
263
+          end_time:this.getTimes(this.end_time),
264
+          keyword:this.keywords,
265
+          page:this.page,
266
+          limit:this.limit,
267
+        }
268
+       getAllPurchaseOrderList(params).then(response=>{
269
+          if(response.data.state == 1){
270
+            var list = response.data.data.list 
271
+            console.log("list2332232323232",list)
272
+            this.tableList = list
273
+            var total = response.data.data.total
274
+            this.total = total
275
+          }
276
+       })
277
+     },
278
+     getName(id){
279
+       var name = ""
280
+       for(let i=0;i<this.supplyList.length;i++){
281
+         if(id == this.supplyList[i].id){
282
+           name = this.supplyList[i].supplier_name
283
+         }
284
+       }
285
+       return name
286
+     },
287
+     getDocName(id){
288
+      var user_name = ""
289
+      for(let i=0;i<this.doctorList.length;i++){
290
+        if(id == this.doctorList[i].admin_user_id){
291
+          user_name = this.doctorList[i].user_name
292
+        }
293
+      }
294
+      return user_name
295
+     },
296
+     getAllBuyPrice(arr){
297
+       var buy_price = 0
298
+       if(arr!=undefined && arr.length > 0){
299
+          for(let i=0;i<arr.length;i++){
300
+            buy_price += (arr[i].count * arr[i].price)
301
+          }
302
+       }
303
+       return buy_price.toFixed(2)
304
+     },
305
+     getAllCount(arr){
306
+       var count = ""
307
+        if(arr!=undefined && arr.length > 0){
308
+          for(let i=0;i<arr.length;i++){
309
+            count += arr[i].count
310
+          }
311
+       }
312
+       return count
313
+     },
314
+     toClick(id){
315
+       this.$router.push({path:"/purchase/order/edit?id="+id})
316
+     }
317
+  },
318
+  created() {
319
+    var now = new Date(); //当前日期 
320
+    var nowMonth = now.getMonth(); //当前月 
321
+    var nowYear = now.getFullYear(); //当前年 
322
+    //本月的开始时间
323
+    var monthStartDate = new Date(nowYear, nowMonth, 1); 
324
+    this.start_time = monthStartDate
325
+    this.org_id =  this.$store.getters.xt_user.org_id
326
+    this.getAllSupply()
327
+    this.getlist()
328
+  },
329
+ 
240
 };
330
 };
241
 </script>
331
 </script>
242
 
332
 
290
 .el-table::before {
380
 .el-table::before {
291
   background-color: #d0d3da;
381
   background-color: #d0d3da;
292
 }
382
 }
383
+
293
 </style>
384
 </style>

+ 36 - 18
src/xt_pages/supply/supplyQuery.vue View File

80
         </el-table-column>
80
         </el-table-column>
81
         <el-table-column label="供应商编码" align="center">
81
         <el-table-column label="供应商编码" align="center">
82
           <template slot-scope="scope">
82
           <template slot-scope="scope">
83
-          
83
+
84
           </template>
84
           </template>
85
         </el-table-column>
85
         </el-table-column>
86
         <el-table-column label="供应商名称" align="center">
86
         <el-table-column label="供应商名称" align="center">
90
          </el-table-column>
90
          </el-table-column>
91
         <el-table-column label="首要联系人" align="center">
91
         <el-table-column label="首要联系人" align="center">
92
           <template slot-scope="scope">
92
           <template slot-scope="scope">
93
-            
93
+
94
           </template>
94
           </template>
95
         </el-table-column>
95
         </el-table-column>
96
         <el-table-column label="增值税税率(%)" align="center">
96
         <el-table-column label="增值税税率(%)" align="center">
97
           <template slot-scope="scope">
97
           <template slot-scope="scope">
98
-           
98
+
99
           </template>
99
           </template>
100
         </el-table-column>
100
         </el-table-column>
101
        <el-table-column label="银行账号" align="center">
101
        <el-table-column label="银行账号" align="center">
102
          <template slot-scope="scope">
102
          <template slot-scope="scope">
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>
110
-        
110
+
111
          </template>
111
          </template>
112
        </el-table-column>
112
        </el-table-column>
113
-      
114
-        <el-table-column label="纳税人识别号" align="center" v-if="showThree">
113
+
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
-        
120
-    
121
-      <el-table-column label="手机" align="center" v-if="showFour">
119
+
120
+
121
+      <el-table-column label="手机" align="center">
122
          <template slot-scope="scope">
122
          <template slot-scope="scope">
123
-       
123
+
124
          </template>
124
          </template>
125
        </el-table-column>
125
        </el-table-column>
126
 
126
 
127
-    
127
+
128
 
128
 
129
        <el-table-column label="操作" align="center" width="260px">
129
        <el-table-column label="操作" align="center" width="260px">
130
           <template slot-scope="scope">
130
           <template slot-scope="scope">
212
   },
212
   },
213
   methods:{
213
   methods:{
214
      toAdd(){
214
      toAdd(){
215
-       console.log("res32323232323223",this.$refs)  
216
-       this.$refs.addSupply.show()  
217
-     } 
215
+       // console.log("res32323232323223",this.$refs)
216
+       this.$refs.addSupply.show()
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>