hospitalTrmedwv-controller.js 7.09 KB
var express = require('express');
var router = express.Router();

var client = require('../client');
var api = require('./api').url;



// //取得入库收货列表
// router.get('/searchList', function(req, res, next) {
//   client.get(api.hospital_warehouse, { parameters: req.query}, function (data) { res.send(data); }, req.session);
// });
 
// //取得入库收货详细
// router.get('/searchListDetail/:id', function(req, res, next) {
//   client.get(api.hospital_warehousedetail, { path: { id: req.params.id }}, function (data) { res.send(data); }, req.session);
// });
// //取得入库收货商品列表
// router.get('/distrbutorwarehouseGoodsList', function(req, res, next) {
//   client.get(api.hospital_distrbutorwarehouseGoodsList, { parameters: req.query}, function (data) { res.send(data); }, req.session);
// });
// //  供应商
// router.get('/supplierList', function(req, res, next) {
//   client.get(api.hospital_supplierList, { parameters: req.query}, function (data) { res.send(data); }, req.session);
// });
//  //  单据类型
// router.get('/billTypeList', function(req, res, next) {
//   client.get(api.hospital_getDistributorBillCategory, { parameters: req.query}, function (data) { res.send(data); }, req.session);
// });
 

//获取医院入库列表
router.get('/listTrmedwv', function(req, res, next) {
  client.get(api.hospital_listTrmedwv, { parameters: req.query}, function (data) { res.send(data); }, req.session);
});

//获取医院入库详细
router.get('/trmedwv/:id', function(req, res, next) {
  client.get(api.hospital_trmedwv, { path: { id: req.params.id }}, function (data) { res.send(data); }, req.session);
});

//导出医院入库详细
router.get('/exportXml', function(req, res, next) {  
  client.post(api.hospital_exportXml, { data: req.query }, function (data) {
  	
  	//res.set('Content-Type', 'application/octet-stream');
  	res.set('Content-Type', 'application/x-download');
    res.set("Content-Disposition", "attachment;  filename=" + Math.random().toString(32).substr(2)+'.xml');
    res.send(data); 
    

  }, req.session);
});
router.get('/xml',function(req,res){
	res.send(fs.readFile('a.xml'))
    
})

//取得医院入库商品列表
router.get('/listTrmedwvdetailes', function(req, res, next) {
  client.get(api.hospital_listTrmedwvdetailes, { parameters: req.query}, function (data) { res.send(data); }, req.session);
});
// 单据类型
router.get('/listMfhdept', function(req, res, next) {
  client.get(api.hospital_listMfhdeptes, { parameters: req.query}, function (data) { res.send(data); }, req.session);
});

 
router.get('/listMfhdept', function(req, res, next) {
  client.get(api.hospital_listMfhdeptes, { parameters: req.query}, function (data) { res.send(data); }, req.session);
});

// 1-5 赵志杰 医院入库单明细查询

router.post('/getwvdetailes', function(req, res, next) {
  client.post(api.hospital_trmedwv_getwvdetailes, { data: req.body }, function (data) { res.send(data); }, req.session);
});
 
// 签收 1-5 赵志杰
router.post('/saveMvOrderDetailForOne', function(req, res, next) {
  client.post(api.hospital_trmedwv_saveMvOrderDetailForOne, { data: req.body }, function (data) { res.send(data); }, req.session);
});

// 一键签收完成 
router.post('/saveMvOrderDetailForMore', function(req, res, next) {
  client.post(api.hospital_trmedwv_saveMvOrderDetailForMore, { data: req.body }, function (data) { res.send(data); }, req.session);
});

// 检测签收完成 1-5 赵志杰
router.post('/checkMvOrder', function(req, res, next) {
  client.post(api.hospital_trmedwv_checkMvOrder, { data: req.body }, function (data) { res.send(data); }, req.session);
});

// 签收确定 1-5 赵志杰
router.post('/saveMvOrder', function(req, res, next) {
  client.post(api.hospital_trmedwv_saveMvOrder, { data: req.body }, function (data) { res.send(data); }, req.session);
});

// 上传采购计划

// router.get('/listTrmedJhsc', function(req, res, next) {
//   client.get(api.hospital_trmedwv_listTrmedJhsc, { parameters: req.query}, function (data) { res.send(data); }, req.session);
// });

router.post('/listTrmedJhsc', function(req, res, next) {
  client.post(api.hospital_trmedwv_listTrmedJhsc, { data: req.body }, function (data) { res.send(data); }, req.session);
});



router.get('/ChangeWvToTrmedJhsc', function(req, res, next) {
  client.get(api.hospital_trmedwv_ChangeWvToTrmedJhsc, { parameters: req.query}, function (data) { res.send(data); }, req.session);
});

// 医院入库转采购计划上传明细列表
router.get('/listTrmedJhscdetail', function(req, res, next) {
  client.get(api.hospital_trmedwv_listTrmedJhscdetail, { parameters: req.query}, function (data) { res.send(data); }, req.session);
});

router.get('/findTrmedJhscBybillno', function(req, res, next) {
  client.get(api.hospital_trmedwv_findTrmedJhscBybillno, { parameters: req.query}, function (data) { res.send(data); }, req.session);
});
 
 router.post('/changeTrmedJhscDetail', function(req, res, next) {
  client.post(api.hospital_trmedwv_changeTrmedJhscDetail, { data: req.body }, function (data) { res.send(data); }, req.session);
});
 

 // 上传采购计划异常  查询
 
router.post('/findJhscByScData', function(req, res, next) {
  client.post(api.hospital_trmedwv_findJhscByScData, { data: req.body }, function (data) { res.send(data); }, req.session);
});

// 上传采购计划异常 导出
router.post('/exportJhscByScData', function(req, res, next) {
  client.post(api.hospital_trmedwv_exportJhscByScData, { data: req.body }, function (data) { res.send(data); }, req.session);
});


router.post('/findSupplierByMed', function(req, res, next) {
  client.post(api.hospital_trmedwv_findSupplierByMed, { data: req.body }, function (data) { res.send(data); }, req.session);
});
 
router.get('/uploadMedJhsc',function(req,res,next){
      client.get(api.hospital_trmedwv_uploadMedJhsc+req.query.billnos, {parameters:req.query }, function (data) {   
        res.send(data); 
      }, req.session);
});

/*出库审核start*/
//出库审核-列表
router.post('/getTrvariationdoList', function(req, res, next) {
    client.post(api.hospital_trvariationdo_getTrvariationdoList, { data: req.body }, function (data) { res.send(data); }, req.session);
});
//出库审核-审核
router.post('/auditTravriationdo', function(req, res, next) {
    client.post(api.hospital_trvariationdo_auditTravriationdo, { data: req.body }, function (data) { res.send(data); }, req.session);
});
//出库审核-驳回
router.post('/rejectTrvariationdo', function(req, res, next) {
    client.post(api.hospital_trvariationdo_rejectTrvariationdo, { data: req.body }, function (data) { res.send(data); }, req.session);
});
//出库审核-详细页面头部
router.get('/getTrvariationdo/:guid', function(req, res, next) {
    client.get(api.hospital_trvariationdo_getTrvariationdo, { path: { guid: req.params.guid }}, function (data) { res.send(data); }, req.session);
});
//出库审核-详细页面列表
router.post('/getTrvariationdoDetailList', function(req, res, next) {
    client.post(api.hospital_trvariationdo_getTrvariationdoDetailList, { data: req.body }, function (data) { res.send(data); }, req.session);
});
/*出库审核end*/

 

module.exports = router;