wangcz 7 anni fa
parent
commit
5967f5c372

+ 0 - 5
src/main/webapp/resources/js/common/query/seekPurchase.js

@@ -110,11 +110,6 @@ define([ 'ngResource' ], function() {
             deleteBom: {
                 url: 'seek/bom/delete',
                 method: 'DELETE'
-            },
-            // 新增物料信息
-            addEaterialObj: {
-                url: 'seek/bom/detail/add',
-                method: 'POST'
             }
 		});
 }])

+ 12 - 49
src/main/webapp/resources/js/usercenter/controllers/forstore/bomListDetailCtrl.js

@@ -49,9 +49,6 @@ define(['app/app'], function(app) {
         $scope.editBom = false;
         // 是否编辑询价
         $scope.editSeek = false;
-        // 是否新增物料
-        $scope.addNew = false;
-        $scope.newMateriel = [];
         // bom数据
         $scope.bomData = {};
         // 求购参数
@@ -171,28 +168,6 @@ define(['app/app'], function(app) {
                             })
                         }
                     }
-                } else {
-                    // 批量验证
-                    for (var i = 0; i < $scope.newMateriel.length; i++) {
-                        if (!$scope.checkAllProduct($scope.newMateriel[i])) {
-                            return;
-                        }
-                    }
-                    angular.forEach($scope.newMateriel, function(val){
-                        val.bomId = $scope.bomData.id
-                    })
-                    seekPurchase.addEaterialObj(null, $scope.newMateriel, function (data) {
-                        if (data.success) {
-                            toaster.pop('success', '新增物料成功');
-                            $scope.addNewMateriel(false);
-                            loadData();
-                            $scope.newMateriel = []
-                        } else {
-                            toaster.pop('error', data.message);
-                        }
-                    }, function (err) {
-                        toaster.pop('error', err.data);
-                    })
                 }
             } else {
                 if ($scope.editBom) {
@@ -201,10 +176,6 @@ define(['app/app'], function(app) {
                 } else if($scope.editSeek){
                     // 取消发布求购
                     $scope.setEditSeek(false);
-                } else {
-                    // 取消新增物料
-                    $scope.addNewMateriel(false);
-                    $scope.newMateriel = [];
                 }
             }
         }
@@ -215,10 +186,6 @@ define(['app/app'], function(app) {
                 toaster.pop('info', '请先保存求购信息');
                 return;
             }
-            if (editBom && $scope.addNew) {
-                toaster.pop('info', '请先保存新增物料');
-                return;
-            }
             // 编辑中临时数据
             $scope.tmpEditBom = angular.copy($scope.bomData);
             // 最少选中一个
@@ -242,10 +209,6 @@ define(['app/app'], function(app) {
                 toaster.pop('info', '请先保存BOM修改');
                 return;
             }
-            if (editSeek && $scope.addNew) {
-                toaster.pop('info', '请先保存新增物料');
-                return;
-            }
             if ($scope.editSeek) {
                 $scope.seekObj.endTime = '';
                 $scope.seekObj.count = '';
@@ -258,24 +221,24 @@ define(['app/app'], function(app) {
         };
 
         // 新增单条物料信息
-        $scope.addNewMateriel = function (addNew) {
-            if (addNew && $scope.editSeek) {
-                toaster.pop('info', '请先保存求购信息');
-                return;
-            }
-            if (addNew && $scope.editBom) {
-                toaster.pop('info', '请先保存BOM修改');
-                return;
-            }
-            $scope.newMateriel.push({
+        $scope.addNewMateriel = function () {
+            console.log($scope.bomData.seekPurchaseByBatchs)
+            $scope.bomData.seekPurchaseByBatchs.unshift({
+                bomId: $scope.bomData.id,
                 brand: '',
                 kind: '',
                 code: '',
                 spec: '',
+                $checked: false,
+                showSimilarCodeList: false,
+                showSimilarBrandList: false,
+                isInCodeList: false,
+                isInBrandList: false,
                 amount: 0
             });
-            $scope.setAllCheck(false);
-            $scope.addNew = addNew;
+            $scope.tmpEditBom = angular.copy($scope.bomData);
+            $scope.setAllCheck(true);
+            console.log($scope.bomData.seekPurchaseByBatchs, $scope.tmpEditBom.seekPurchaseByBatchs)
         };
 
         // 打开日期选择框

+ 2 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_storageCtrl.js

@@ -572,6 +572,7 @@ define([ 'app/app' ], function(app) {
             Goods.getByEnterpriseId({invoiceId: type.invoiceid}, null, function(data) {
                 if(data.code === 1) {
                     toaster.pop("success", "信息保存成功");
+                    getLoadStorageData();
                 }
             }, function(response) {
                 toaster.pop('error', '错误', response.data);
@@ -620,7 +621,7 @@ define([ 'app/app' ], function(app) {
                 // TODO huxz 跳转到订单管理页面
                 if (res.success) {
                     toaster.pop("success", "信息", "发货成功");
-                    // $state.go('vendor_order');
+                    getLoadStorageData();
                 } else {
                     toaster.pop("error", res.message);
                 }

+ 1 - 3
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_upload_ctrl.js

@@ -51,10 +51,8 @@ define([ 'app/app' ], function(app) {
         //批量发布的类型
         $scope.batch.sellType = null;
 
-
-        $scope.ignorelmport = 0;
 		$scope.switchImport = function (type) {
-			$scope.ignorelmport = type;
+			$scope.ignoreImport = type;
 		};
 
         //翻页的信息

+ 21 - 82
src/main/webapp/resources/view/usercenter/forstore/bomListDetail.html

@@ -205,6 +205,21 @@
     .com-check-box{
         cursor:pointer;
     }
+    .content-clear{
+        position:absolute;
+        right:0;
+        bottom:0;
+        width:20px;
+        height:20px;
+        border-top: 15px solid transparent;
+        border-right: 15px solid #f5f5f5;
+        border-bottom: 20px solid #f5f5f5;
+        border-left: 20px solid transparent;
+        cursor:pointer;
+    }
+    .content-clear i{
+        color:#333;
+    }
 </style>
 <div class="user_right fr bom-list-detail">
     <a class="back" href="user#/seekPurchase?type=bomManage&bomTab=bomList">&lt;返回BOM列表</a>
@@ -214,8 +229,8 @@
         <button class="operate-btn" ng-click="setEditBom(true)">编辑BOM</button>
         <button class="operate-btn" ng-click="deleteProduct()">删除物料</button>
         <button class="operate-btn" ng-click="deleteBom()">删除本BOM</button>
-        <button class="operate-btn" ng-click="addNewMateriel(true)">新增物料</button>
-        <div class="fr" ng-show="editBom || editSeek || addNew">
+        <button class="operate-btn" ng-click="addNewMateriel()" ng-if="editBom">新增物料</button>
+        <div class="fr" ng-show="editBom || editSeek">
             <button class="sure-btn" ng-click="sure(true)">确认</button>
             <button class="sure-btn cancel-btn" ng-click="sure(false)">取消</button>
         </div>
@@ -269,85 +284,6 @@
             </tr>
         </thead>
         <tbody>
-            <tr ng-if="addNew" ng-repeat="(key, item) in newMateriel">
-                <td>
-                    <label class="com-check-box" ng-click="newMateriel.splice(key, 1);" ng-if="key !== 0">
-                        <span class="fa fa-close"></span>
-                    </label>
-                </td>
-                <td class="base-info">
-                    <div class="content-line">
-                        <div class="inline-block title">
-                            <i class="must">*</i>品牌:
-                        </div>
-                        <div class="inline-block" ng-class="{'similar-wrap': item.showSimilarBrandList}" title="{{item.brand}}">
-                            <input ng-model="item.brand"
-                                   ng-change="onBrandChange(item)"
-                                   ng-blur="checkBrand(item)"
-                                   type="text">
-                            <ul class="similar-list"
-                                ng-show="item.showSimilarBrandList"
-                                ng-mouseenter="item.isInBrandList = true;"
-                                ng-mouseleave="item.isInBrandList = false">
-                                <li ng-repeat="sBrand in similarBrand" ng-bind="sBrand.nameEn" title="{{sBrand.nameEn}}" ng-click="setBrand(item, sBrand.nameEn)"></li>
-                            </ul>
-                        </div>
-                    </div>
-                    <div class="content-line">
-                        <div class="inline-block title">
-                            <i class="must">*</i>物料名称:
-                        </div>
-                        <div class="inline-block" title="{{item.kind}}">
-                            <input ng-model="item.kind"
-                                   ng-change="onKindChange(item)"
-                                   ng-blur="checkKind(item)"
-                                   type="text">
-                        </div>
-                    </div>
-                </td>
-                <td class="base-info">
-                    <div class="content-line">
-                        <div class="inline-block title">
-                            <i class="must">*</i>型号:
-                        </div>
-                        <div class="inline-block" ng-class="{'similar-wrap': item.showSimilarCodeList}" title="{{item.code}}">
-                            <input ng-model="item.code"
-                                   ng-change="onCodeChange(item)"
-                                   ng-blur="checkCode(item)"
-                                   type="text">
-                            <ul class="similar-list"
-                                ng-show="item.showSimilarCodeList"
-                                ng-mouseenter="item.isInCodeList = true;"
-                                ng-mouseleave="item.isInCodeList = false">
-                                <li ng-repeat="sCode in similarCode" ng-bind="sCode.code" title="{{sCode.code}}" ng-click="setCode(item, sCode.code)"></li>
-                            </ul>
-                        </div>
-                    </div>
-                    <div class="content-line">
-                        <div class="inline-block title">
-                            规格:
-                        </div>
-                        <div class="inline-block" title="{{item.spec}}">
-                            <input ng-model="item.spec"
-                                   ng-change="onSpecChange(item)"
-                                   ng-blur="checkSpec(item)"
-                                   type="text">
-                        </div>
-                    </div>
-                </td>
-                <td class="base-info pcs-line">
-                    <div class="content-line">
-                        <div class="inline-block title">
-                            单位用量:
-                        </div>
-                        <div class="inline-block" title="{{item.amount}}">
-                            <input ng-model="item.amount"
-                                   ng-change="onAmountChange(item)"
-                                   type="text">
-                        </div>
-                    </div>
-                </td>
-            </tr>
             <tr ng-repeat="detail in bomData.seekPurchaseByBatchs track by $index">
                 <td>
                     <label class="com-check-box">
@@ -423,7 +359,10 @@
                         </div>
                     </div>
                 </td>
-                <td class="base-info pcs-line">
+                <td class="base-info pcs-line" style="position:relative;">
+                    <div class="content-clear" ng-if="!detail.id" ng-click="tmpEditBom.seekPurchaseByBatchs.splice($index, 1);bomData.seekPurchaseByBatchs.splice($index, 1)">
+                        <i class="fa fa-close"></i>
+                    </div>
                     <div class="content-line">
                         <div class="inline-block title">
                             单位用量:

+ 3 - 2
src/main/webapp/resources/view/vendor/forstore/vendor_storage.html

@@ -1373,7 +1373,8 @@
                 <tbody ng-if="handleItem === 2" ng-repeat="item in storageList" ng-class="{'toggle-mode': item.seleted}">
                 <tr>
                     <td>系统自动生成</td>
-                    <td><span ng-bind="item.purchaseid" title="{{item.purchaseid}}"></span></td>
+                    <td ng-if="storage_tab === 'outBound'"><span ng-bind="item.purchaseid || '-'" title="{{item.purchaseid}}"></span></td>
+                    <td ng-if="storage_tab === 'inBound'"><span ng-bind="item.invoiceid || '-'" title="{{item.invoiceid}}"></span></td>
                     <td><span ng-bind="item.buyentername || item.buyerentername || item.buyername" title="{{item.buyentername || item.buyerentername || item.buyername}}"></span></td>
                     <td ng-bind="storage_tab === 'outBound' ? '销售出库' : '采购入库'">腌肉入库</td>
                     <td><span ng-bind="item.sellername" title="{{item.sellername}}"></span></td>
@@ -1412,7 +1413,7 @@
                 <tr ng-if="item.seleted && storage_tab === 'inBound' && item.logistics">
                     <td colspan="7" style="background:#f5f5f5;">
                         <div class="logistics-info">
-                            <span style="margin-right:150px;">所属订单:<span ng-bind="item.associateOrderid || '-'"></span></span>
+                            <span style="margin-right:150px;">所属订单:<span ng-bind="item.associateOrderid || item.orid || '-'"></span></span>
                             <span>物流公司 :&nbsp;</span>
                             <span class="input-ul" ng-bind="item.logistics.companyName"></span>
                             <span style="margin-left:100px;">物流单号 :&nbsp;</span>