Angular.js(出库查看)

查看就非常简单了,直接贴代码吧。
1、控制器

app.controller("search", ['$scope', 'app_settings', 'SystemParam', '$http', 'Post', 'Get', '$state', '$stateParams',
function ($scope, app_settings, SystemParam, $http, Post, Get, $state, $stateParams) {
    //页面参数
    console.log(SystemParam.dict())
    //页面跳转查询数据
    console.log($stateParams.SearchID)
    var parameters = { 'ids': $stateParams.SearchID };
    var RtnData = Get.get(app_settings.api_host_url + 'api/instock/SingleStock', parameters);

    RtnData.then(function (resultMessage) {
        if (resultMessage.StateCode == "0") {

            $scope.InStockEntity = resultMessage.Data;

        }

    });

}]);

2、对应的html页面。平时很少去看代码的编译规范,对于提行缩进几个格子,何时该打分号没有太多去探究。没事儿的时候就按照自己的喜好将写过的代码整理,贴出来的代码肯定有多处不规范的地方,恩,先贴出来,需要注意的规范在敲代码的过程中自然就学会了。

<style>
    .change.active {
        background-color: #F5F5F5;        
    }
style>
<script>
    console.log("当前页")
    console.log(window.location.href);
    if (window.location.href == window.location.href) {
        console.log("进入判断");
        $("#bread a:eq(1)").css({ 'color': '#3B73AF', 'font-weight': '600', });
    };
    $("#bread").find("a:first").on({
        'mouseover': function () {

            $(this).css({ 'color': '#3B73AF', 'font-weight': '600', });
        },
        'mouseleave': function () {

            $(this).css({ 'color': '#3B73AF', 'font-weight': '400', });
        }
    });
script>
<div class="hbox hbox-auto-lg bg-light m-t-md no-padder container " ng-init="
  app.settings.asideFixed = false;
  app.settings.asideDock = true;
  app.settings.container = false;
  app.hideAside = false;
  app.hideFooter = false;
  " ng-controller="search" style="height: auto;margin-top:0px;">
    
    <div class="container-fluid">

        <div class="col w-xs">
            <p class=""> <h4 class=" text-dark   font-bold  w-xs ">采购入库h4>p>
        div>
        
        <div class="col" style="padding-top:5px;">
            <ol id="bread" class="breadcrumb">
                <li><i class="fa fa-university">i<a href="" ui-sref="app.instock" style="color:#3B73AF">列表a>li>
                <li><i class="fa fa-plus">i<a href="">查看a>li>

            ol>
        div>
        
        
        <div class="bg-light lter wrapper">          
            <div class="hbox m-l">
                <span class="w-xs" >供应商:span>
                <span style="height:34px;">{{InStockEntity.pvName}}span>
                 <span>    span>
                <span class="w-xs" >仓库:span>
                <span style="height:34px;">{{InStockEntity. whName}}span>
            div>
        div>
        <div class="Normal-center col-lg-12   b-light  no-padder ">
            <div class=" r r-2x ">
                <div class=" r r-2x  ">
                    <div class="vbox ">
                        <div class="">
                            <div class="panel panel-default lter m-t col-lg-12 w-full">
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th width="8%" class="text-center ">
                                                <label class="i-checks m-b-none " style="margin-left:-3px"><input type="checkbox" name="post[]" class="group-checkable"><i>i>label>
                                            th>
                                            <th width="32%" class="">商品代码th>
                                            <th width="32&">商品名称th>
                                            <th width="32%">数量th>

                                        tr>
                                    thead>
                                    <tbody ng-repeat="table in InStockEntity.inStockDetails">
                                        <tr class="change" ng-class="{true:'active',false:''}[inStockDetails.focus]" ng-mouseover ="inStockDetails.focus=true" ng-mouseleave ="inStockDetails.focus=false ">
                                            <td width="8%" class="text-center ">
                                                <label class="i-checks m-b-none " style="margin-left:-3px"><input type="checkbox" name="post[]" class="group-checkable"><i>i>label>
                                            td>
                                            <td>{{table.pSKU}}td>
                                            <td>{{table.pName}}td>
                                            <td>{{table.isNum }}td>
                                        tr>
                                    tbody>
                                    <tfoot>
                                        <tr>
                                            <td class="text-center">
                                                <span >总计:span>
                                            td>
                                            <td>td>
                                            <td>td>
                                            <td>
                                                {{InStockEntity.proNum}}
                                            td>
                                        tr>
                                    tfoot>                        
                                table>                      
                            div>
                        div>
                    div>
                div>
            div>
        div>
        <div class="footer">           
            <div class="bg-light lter  col-lg-12  wrapper lter r r-3x ">
                <div class="navbar-right m-r">

                    <button class="btn  btn-info  btn-sm m-l-md ">确  定button>
                    <button class="btn  btn-info  btn-sm m-l-md ">取  消button>
                div>
            div>
        div>
    div>
div>

你可能感兴趣的:(Angular.js项目)