|
|
@@ -14394,7 +14394,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
/**
|
|
|
* 新增采购单
|
|
|
*/
|
|
|
- app.controller('PurcNewOrderCtrl', ['$scope', '$modal', 'toaster', '$filter', 'addtoCart', '$rootScope', 'VendorInfo', 'ngTableParams', 'BaseService', 'Product', 'newPurcOrder', 'cartOperation', 'ShipAddress', 'Vendor', '$http', '$window', 'token', function ($scope, $modal, toaster, $filter, addtoCart, $rootScope, VendorInfo, ngTableParams, BaseService, Product, newPurcOrder, cartOperation, ShipAddress, Vendor, $http, $window, token) {
|
|
|
+ app.controller('PurcNewOrderCtrl', ['$scope', '$modal', 'toaster', '$filter', 'addtoCart', '$rootScope', 'VendorInfo', 'ngTableParams', 'BaseService', 'Product', 'newPurcOrder', 'cartOperation', 'ShipAddress', 'Vendor', '$http', '$window', 'token', 'recentPrice',
|
|
|
+ function ($scope, $modal, toaster, $filter, addtoCart, $rootScope, VendorInfo, ngTableParams, BaseService, Product, newPurcOrder, cartOperation, ShipAddress, Vendor, $http, $window, token, recentPrice) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
// 每次进入时先清除掉rootScope下的venduu
|
|
|
$rootScope.venduu = null;
|
|
|
@@ -14608,19 +14609,29 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
// 选择
|
|
|
$scope.check = function (data) {
|
|
|
- $scope.order.orderItems.push({
|
|
|
- code: data.code,
|
|
|
- title: data.title,
|
|
|
- spec: data.spec,
|
|
|
- unit: data.unit,
|
|
|
- qty: null,
|
|
|
- price: null,
|
|
|
- remark: null,
|
|
|
- delivery: null,
|
|
|
- prid: data.id,
|
|
|
- taxrate: $scope.order.rate,
|
|
|
- prodsource: 'seller'
|
|
|
- });
|
|
|
+ var price = null;
|
|
|
+ var qty = null;
|
|
|
+ var taxRate = null;
|
|
|
+ if (data.id) {
|
|
|
+ recentPrice.agreed({prId: data.id}, {}, function(response) {
|
|
|
+ price = response.price;
|
|
|
+ qty = response.qty;
|
|
|
+ taxRate = response.taxRate;
|
|
|
+ $scope.order.orderItems.push({
|
|
|
+ code: data.code,
|
|
|
+ title: data.title,
|
|
|
+ spec: data.spec,
|
|
|
+ unit: data.unit,
|
|
|
+ qty: qty,
|
|
|
+ price: price,
|
|
|
+ remark: null,
|
|
|
+ delivery: null,
|
|
|
+ prid: data.id,
|
|
|
+ taxrate: taxRate,
|
|
|
+ prodsource: 'seller',
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
// 导入商品信息
|
|
|
@@ -16136,7 +16147,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
/**
|
|
|
* 购物车详情
|
|
|
*/
|
|
|
- app.controller('CartDetailController', ['$scope', 'cartOperation', '$stateParams', 'toaster', '$timeout', 'BaseService', 'ngTableParams', '$filter', 'Product', 'Vendor', 'ShipAddress', '$modal', 'newPurcOrder', 'addtoCart', '$http', 'token', function ($scope, cartOperation, $stateParams, toaster, $timeout, BaseService, ngTableParams, $filter, Product, Vendor, ShipAddress, $modal, newPurcOrder, addtoCart, $http, token) {
|
|
|
+ app.controller('CartDetailController', ['$scope', 'cartOperation', '$stateParams', 'toaster', '$timeout', 'BaseService', 'ngTableParams', '$filter', 'Product', 'Vendor', 'ShipAddress', '$modal', 'newPurcOrder', 'addtoCart', '$http', 'token', 'recentPrice',
|
|
|
+ function ($scope, cartOperation, $stateParams, toaster, $timeout, BaseService, ngTableParams, $filter, Product, Vendor, ShipAddress, $modal, newPurcOrder, addtoCart, $http, token, recentPrice) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
$scope.loading = true;
|
|
|
var loadData = function () {
|
|
|
@@ -16254,18 +16266,29 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
// 选择
|
|
|
$scope.check = function (data) {
|
|
|
- $scope.order.orderItems.push({
|
|
|
- code: data.code,
|
|
|
- title: data.title,
|
|
|
- spec: data.spec,
|
|
|
- unit: data.unit,
|
|
|
- qty: null,
|
|
|
- price: null,
|
|
|
- remark: null,
|
|
|
- delivery: null,
|
|
|
- prid: data.id,
|
|
|
- rate: $scope.order.rate
|
|
|
- });
|
|
|
+ var price = null;
|
|
|
+ var qty = null;
|
|
|
+ var taxRate = null;
|
|
|
+ if (data.id) {
|
|
|
+ recentPrice.agreed({prId: data.id}, {}, function(response) {
|
|
|
+ price = response.price;
|
|
|
+ qty = response.qty;
|
|
|
+ taxRate = response.taxRate;
|
|
|
+ $scope.order.orderItems.push({
|
|
|
+ code: data.code,
|
|
|
+ title: data.title,
|
|
|
+ spec: data.spec,
|
|
|
+ unit: data.unit,
|
|
|
+ qty: qty,
|
|
|
+ price: price,
|
|
|
+ remark: null,
|
|
|
+ delivery: null,
|
|
|
+ prid: data.id,
|
|
|
+ taxrate: taxRate,
|
|
|
+ prodsource: 'seller',
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
// 导入商品信息
|