Просмотр исходного кода

优化采购申请purchaseApply-detail

mrzcc лет назад: 6
Родитель
Сommit
4d836642a3

+ 40 - 62
WebService/src/main/resources/components/purchaseApplyPackage/purchaseApply-detail/purchaseApplyDetail.html

@@ -1,48 +1,34 @@
-
-<div id="component" class="wrapper wrapper-content animated fadeInRight ecommerce">
+<div id="component">
     <div class="row">
         <div class="col-lg-12">
             <div class="ibox ">
                 <div class="ibox-title">
-                    <h5>查询条件</h5>
+                    <h5>申请信息</h5>
                     <div class="ibox-tools" style="top:10px;">
 
                     </div>
                 </div>
                 <div class="ibox-content">
                     <div class="row">
-                        <div class="col-sm-4">
-                            <div class="form-group">
-                                <input type="text" placeholder="审核状态" disabled
-                                       v-model="purchaseApplyManageInfo.conditions.applyOrderId" class=" form-control">
-                            </div>
+                        <div class="col-md-3">
+                            <h5>审核状态:</h5>
+                            <i class="fa fa-search">:</i><span>{{purchaseApplyDetailInfo.stateName}}</span>
                         </div>
-
-
-                        <div class="col-sm-4">
-                            <div class="form-group">
-                                <input type="text" placeholder="申请人" disabled
-                                       v-model="purchaseApplyManageInfo.conditions.applyOrderId" class=" form-control">
-                            </div>
+                        <div class="col-md-3">
+                            <h5>申请人:</h5>
+                            <i class="fa fa-user">:</i><span>{{purchaseApplyDetailInfo.userName}}</span>
                         </div>
-
-                        <div class="col-sm-4">
-                            <div class="form-group">
-                                <input type="text" placeholder="申请时间" disabled
-                                       v-model="purchaseApplyManageInfo.conditions.applyOrderId" class=" form-control">
-                            </div>
+                        <div class="col-md-3">
+                            <h5>申请时间:</h5>
+                            <i class="fa fa-clock-o">:</i><span>{{purchaseApplyDetailInfo.createTime}}</span>
                         </div>
                     </div>
+                    <hr style="border-top:1px dashed #987cb9;" width="100%" color="#987cb9" size=1>
                     <div class="row">
-                        <div class="col-sm-12">
-                            <div class="form-group">
-                                <textarea placeholder="申请说明" disabled v-model="purchaseApplyManageInfo.conditions.applyOrderId"
-                                          type="text" placeholder="申请说明" class="form-control">
-
-                                </textarea>
-                            </div>
+                        <div class="col-md-12">
+                            <h5>申请说明:</h5>
+                            <i class="fa fa-pencil">:</i> <span>{{purchaseApplyDetailInfo.description}}</span>
                         </div>
-
                     </div>
                 </div>
             </div>
@@ -52,7 +38,7 @@
         <div class="col-lg-12">
             <div class="ibox">
                 <div class="ibox-title">
-                    <h5>采购申请信息</h5>
+                    <h5>申请物资</h5>
                 </div>
                 <div class="ibox-content">
 
@@ -61,41 +47,33 @@
                     >
                         <thead>
                         <tr>
-                            <th class="text-center">订单号</th>
-                            <th class="text-center">审批状态</th>
-                            <th class="text-center">申请人</th>
-                            <th class="text-center">申请时间</th>
-                            <th class="text-center">物品名称</th>
-                            <th class="text-center">总计价格</th>
-<!--                            <th class="text-center">操作</th>-->
+                            <th class="text-center">物资</th>
+                            <th class="text-center">物资编码</th>
+                            <th class="text-center">单价</th>
+                            <th class="text-center">库存</th>
+                            <th class="text-center">采购数量</th>
+                            <th class="text-center">操作</th>
                         </tr>
                         </thead>
                         <tbody>
-                        <tr v-for="purchaseApply in purchaseApplyManageInfo.purchaseApplys">
-                            <td class="text-center">{{purchaseApply.applyOrderId}}</td>
-                            <td class="text-center">{{purchaseApply.state}}</td>
-                            <td class="text-center">{{purchaseApply.entryPerson}}</td>
-                            <td class="text-center">{{purchaseApply.createTime}}</td>
-                            <td class="text-center">{{purchaseApply.resourceNames}}</td>
-                            <td class="text-center">{{purchaseApply.totalPrice}}</td>
-<!--                            <td class="text-center">-->
-<!--                                <div class="btn-group">-->
-<!--                                    <button class="btn-white btn btn-xs"-->
-<!--                                            v-on:click="_openEditPurchaseApplyModel(purchaseApply)">查看-->
-<!--                                    </button>-->
-<!--                                </div>-->
-<!--                                &lt;!&ndash;                                <div class="btn-group">&ndash;&gt;-->
-<!--                                &lt;!&ndash;                                    <button class="btn-white btn btn-xs"&ndash;&gt;-->
-<!--                                &lt;!&ndash;                                            v-on:click="_openEditPurchaseApplyModel(purchaseApply)">修改&ndash;&gt;-->
-<!--                                &lt;!&ndash;                                    </button>&ndash;&gt;-->
-<!--                                &lt;!&ndash;                                </div>&ndash;&gt;-->
-<!--                                <div class="btn-group">-->
-<!--                                    <button class="btn-white btn btn-xs"-->
-<!--                                            v-on:click="_openDeletePurchaseApplyModel(purchaseApply)">取消-->
-<!--                                    </button>-->
-<!--                                </div>-->
-<!--                            </td>-->
-
+                        <tr v-for="resourceStore in purchaseApplyDetailInfo.purchaseApplyDetailVo">
+                            <td class="text-center">{{resourceStore.resName}}</td>
+                            <td class="text-center">{{resourceStore.resCode}}</td>
+                            <td class="text-center">{{resourceStore.price}}</td>
+                            <td class="text-center">{{resourceStore.stock}}</td>
+                            <td class="text-center">{{resourceStore.quantity}}</td>
+                            <td class="text-center">
+                                <div class="btn-group">
+                                    <button class="btn-white btn btn-xs"
+                                            v-on:click="_openEditPurchaseApplyDetailModel(resourceStore)">编辑
+                                    </button>
+                                </div>
+                                <div class="btn-group">
+                                    <button class="btn-white btn btn-xs"
+                                            v-on:click="_openDeletePurchaseApplyDetailModel(resourceStore)">删除
+                                    </button>
+                                </div>
+                            </td>
                         </tr>
                         </tbody>
                         <tfoot>

+ 28 - 57
WebService/src/main/resources/components/purchaseApplyPackage/purchaseApply-detail/purchaseApplyDetail.js

@@ -3,44 +3,40 @@
  **/
 (function(vc){
     var DEFAULT_PAGE = 1;
-    var DEFAULT_ROWS = 10;
+    var DEFAULT_ROWS = 1;
     vc.extends({
         data:{
-            purchaseApplyManageInfo:{
-                purchaseApplys:[],
-                total:0,
-                records:1,
-                moreCondition:false,
-                applyOrderId:'',
-                states:'',
-                conditions:{
+            purchaseApplyDetailInfo:{
+                    resourceNames:'',
                     state:'',
+                    totalPrice:'',
                     applyOrderId:'',
-                }
+                    description:'',
+                    createTime:'',
+                    userName:'',
+                    stateName:'',
+                    purchaseApplyDetailVo:[]
             }
         },
         _initMethod:function(){
-            vc.component._listPurchaseApplys(DEFAULT_PAGE, DEFAULT_ROWS);
-            // vc.getDict('purchase_apply',"state",function(_data){
-            //     vc.component.purchaseApplyManageInfo.states = _data;
-            // });
+            var _applyOrderId = vc.getParam('applyOrderId');
+            if(!vc.notNull(_applyOrderId)){
+                return ;
+            }
+            vc.component.purchaseApplyDetailInfo.applyOrderId = _applyOrderId;
+            vc.component._listPurchaseApply(DEFAULT_PAGE, DEFAULT_ROWS);
         },
         _initEvent:function(){
 
-            vc.on('purchaseApplyManage','listPurchaseApply',function(_param){
-                vc.component._listPurchaseApplys(DEFAULT_PAGE, DEFAULT_ROWS);
-            });
-            vc.on('pagination','page_event',function(_currentPage){
-                vc.component._listPurchaseApplys(_currentPage,DEFAULT_ROWS);
-            });
         },
         methods:{
-            _listPurchaseApplys:function(_page, _rows){
-
-                vc.component.purchaseApplyManageInfo.conditions.page = _page;
-                vc.component.purchaseApplyManageInfo.conditions.row = _rows;
+            _listPurchaseApply:function(_page, _rows){
                 var param = {
-                    params:vc.component.purchaseApplyManageInfo.conditions
+                    params:{
+                        page:_page,
+                        row:_rows,
+                        applyOrderId:vc.component.purchaseApplyDetailInfo.applyOrderId
+                    }
                 };
 
                 //发送get请求
@@ -48,46 +44,21 @@
                     'list',
                     param,
                     function(json,res){
-                        var _purchaseApplyManageInfo=JSON.parse(json);
-                        vc.component.purchaseApplyManageInfo.total = _purchaseApplyManageInfo.total;
-                        vc.component.purchaseApplyManageInfo.records = _purchaseApplyManageInfo.records;
-                        vc.component.purchaseApplyManageInfo.purchaseApplys = _purchaseApplyManageInfo.purchaseApplys;
-                        vc.emit('pagination','init',{
-                            total:vc.component.purchaseApplyManageInfo.records,
-                            currentPage:_page
-                        });
+                        var _purchaseApplyDetailInfo=JSON.parse(json);
+
+                        var _purchaseApply = _purchaseApplyDetailInfo.purchaseApplys;
+                        vc.component.purchaseApplyDetailInfo = _purchaseApply[0];
                     },function(errInfo,error){
                         console.log('请求失败处理');
                     }
                 );
             },
-            _openAddPurchaseApplyModal:function(){
-                //vc.emit('addPurchaseApply','openAddPurchaseApplyModal',{});
-                vc.jumpToPage("/flow/addPurchaseApplyStepFlow");
-            },
-            // _openAddComplaintModal: function () {
-            //     //vc.emit('addComplaint', 'openAddComplaintModal', {});
-            //     vc.jumpToPage("/flow/addComplaintStepFlow")
-            // },
-            _openEditPurchaseApplyModel:function(_purchaseApply){
-                //vc.emit('editPurchaseApply','openEditPurchaseApplyModal',_purchaseApply);
-                vc.jumpToPage("/flow/purchaseApplyDetailFlow");
-            },
-            _openDeletePurchaseApplyModel:function(_purchaseApply){
-                vc.emit('deletePurchaseApply','openDeletePurchaseApplyModal',_purchaseApply);
-            },
-            _queryPurchaseApplyMethod:function(){
-                vc.component._listPurchaseApplys(DEFAULT_PAGE, DEFAULT_ROWS);
+            _openEditPurchaseApplyDetailModel:function (resourceStore) {
 
             },
-            _moreCondition:function(){
-                if(vc.component.purchaseApplyManageInfo.moreCondition){
-                    vc.component.purchaseApplyManageInfo.moreCondition = false;
-                }else{
-                    vc.component.purchaseApplyManageInfo.moreCondition = true;
-                }
-            }
+            _openDeletePurchaseApplyDetailModel:function (resourceStore) {
 
+            }
 
         }
     });