BoxDelegate,$rootScope,$http,$ionicPopup,faHuoService,$timeout,$window,loading,tool) {
//产品下的类型
名称及规格的选择弹窗设置
$scope.settings = {
theme: 'mobiscroll',lang: 'zh',display: 'center',cancelText: '取消',setText: '确定',onBeforeClose: function(event,inst) {
if(event.button == "set") {
$scope.startdate = event.valueText;//
获取选择日期
console.log($scope.startdate)
} else if(event.button == "cancel") {
console.log("取消")
}
}
};
//
增加
$scope.masters= [{'chanpinType':'产品类型','chanpinName':'产品
名称','guige':'规格','danwei':'单位','num':'
数量','price':'单价(元)','total':'总价','checked':'true',//选中切换
'updown':'true',//下拉
内容显示切换
'up':'true'//箭头上下切换
}];
$scope.add = function() {
$scope.cope={'chanpinType':'产品类型',//下拉
内容显示切换
'up':'true' //箭头上下切换
};
var bb = angular.copy($scope.cope);
$scope.masters.push(bb)
console.log($scope.masters)
};
//
删除
$scope.delete = function() {
var arr = [];
angular.forEach($scope.masters,function(item,index){
if(!item.checked){
arr.push(item);
}
})
//console.log(arr)
$scope.masters = arr;
};
//切换箭头的上下指向这里写
代码片
$scope.upOrdown = function(rowNumber){
console.log($scope.masters[rowNumber].updown)
$scope.masters[rowNumber].up = !$scope.masters[rowNumber].up;
$scope.masters[rowNumber].updown=!$scope.masters[rowNumber].updown;
};
//某一行选中
$scope.selectorOne = function(rowNumber) {
console.log($scope.masters[rowNumber].checked)
$scope.masters[rowNumber].checked = !$scope.masters[rowNumber].checked;
};
})