123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649 |
- angular.module('push')
- .controller('orgInspectCtrl', function ($scope, dataToolsService, $ionicActionSheet, $sce, $ionicPopup, ionicDatePicker, $stateParams, UserService, AccountService, CommentService, UtilService, $timeout, CommonService, ConfigService) {
- $scope.stateParamsValue = $stateParams.value;
- $scope.value = $stateParams.value ? $stateParams.value : 1;
- $scope.params = {};
- $scope.highorginspection = {};
- $scope.threeyearinfo = {};
- $scope.category = {};
- $scope.obtainway = {};
- $scope.basicname = "基本信息";
- $scope.intellecname = "知识产权";
- $scope.balancename = "收支信息";
- $scope.othername = "其他信息";
- $scope.year = new Date().getFullYear();
- $scope.saleflag = true;
- $scope.changesaleflag = function () {
- $scope.saleflag = !$scope.saleflag;
- }
- $scope.assetflag = true;
- $scope.changeasset = function () {
- $scope.assetflag = !$scope.assetflag;
- }
- $scope.researchmoneyflag = true;
- $scope.changeresearchmoney = function () {
- $scope.researchmoneyflag = !$scope.researchmoneyflag;
- }
- $scope.chinaresearchmoneyflag = true;
- $scope.changechinaresearchmoney = function () {
- $scope.chinaresearchmoneyflag = !$scope.chinaresearchmoneyflag;
- }
- $scope.collectway = true;
- $scope.changecollectway = function () {
- $scope.collectway = !$scope.collectway;
- }
- $scope.islogin = ConfigService.islogin;
- if (!$scope.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- $scope.showcategorylist = function () {
- var categorylist = [];
- AccountService.getDomainInfo(0, UserService.node).then(function (res) {
- if (res.code == 3350) {
- // console.log(res);
- angular.forEach(res.data, function (val) {
- categorylist.push({
- text: '<a class="action-sheet-push">' + val.name + '</a>',
- itemkey: val.id,
- itemvalue: val.name, //名字,
- itemcode: val.code
- })
- })
- $ionicActionSheet.show({
- cancelOnStateChange: true,
- cssClass: 'action_s',
- cancelText: '取消',
- buttons: categorylist,
- buttonClicked: function (index) {
- $scope.highorginspection.category = categorylist[index].itemvalue;
- return true;
- }
- });
- } else {
- }
- })
- };
- $scope.showobtainlist = function () {
- var obtainlist = [];
- dataToolsService.getTypeEntryListByTypeName("highorgobtainway").then(function (res) {
- if (res.code == 3350) {
- angular.forEach(res.data, function (val) {
- obtainlist.push({
- text: '<a class="action-sheet-push">' + val.itemkey + '</a>',
- itemkey: val.id,
- itemvalue: val.itemkey, //名字,
- itemcode: val.itemvalue
- })
- })
- $ionicActionSheet.show({
- cancelOnStateChange: true,
- cssClass: 'action_s',
- cancelText: '取消',
- buttons: obtainlist,
- buttonClicked: function (index) {
- $scope.highorginspection.obtainway = obtainlist[index].itemvalue;
- return true;
- }
- });
- }
- })
- };
- var isparticipatestandard = false;
- $scope.watchIsChange = function () {
- if (isparticipatestandard == false) {
- isparticipatestandard = true;
- $scope.highorginspection.isparticipatestandard = true;
- } else {
- isparticipatestandard = false;
- $scope.highorginspection.isparticipatestandard = false;
- }
- };
- $scope.technicaladvanced = 1;
- $scope.changetechnical = function (index) {
- $scope.technicaladvanced = index;
- $scope.highorginspection.technicaladvanced = index;
- }
- $scope.coresupport = 1;
- $scope.changesupportrole = function (index) {
- $scope.coresupport = index;
- $scope.highorginspection.coresupport = index;
- }
- $scope.convertaverage = 1;
- $scope.changetechnicaltransform = function (index) {
- $scope.convertaverage = index;
- $scope.highorginspection.convertaverage = index;
- }
- var otherindevelopfee = false;
- $scope.watchPercentIsChange = function () {
- if (otherindevelopfee == false) {
- otherindevelopfee = true;
- $scope.threeyearinfo.otherindevelopfee = true;
- } else {
- otherindevelopfee = false;
- $scope.threeyearinfo.otherindevelopfee = false;
- }
- };
- $scope.showtaxway1 = function () {
- var taxwaylist = [];
- dataToolsService.getTypeEntryListByTypeName("expropriationmethod").then(function (res) {
- if (res.code == 3350) {
- angular.forEach(res.data, function (val) {
- taxwaylist.push({
- text: '<a class="action-sheet-push">' + val.itemkey + '</a>',
- itemkey: val.id,
- itemvalue: val.itemkey, //名字,
- itemcode: val.itemvalue
- })
- })
- $ionicActionSheet.show({
- cancelOnStateChange: true,
- cssClass: 'action_s',
- cancelText: '取消',
- buttons: taxwaylist,
- buttonClicked: function (index) {
- $scope.threeyearinfo.collectway1 = taxwaylist[index].itemvalue;
- return true;
- }
- });
- }
- })
- };
- $scope.showtaxway2 = function () {
- var taxwaylist = [];
- dataToolsService.getTypeEntryListByTypeName("expropriationmethod").then(function (res) {
- if (res.code == 3350) {
- angular.forEach(res.data, function (val) {
- taxwaylist.push({
- text: '<a class="action-sheet-push">' + val.itemkey + '</a>',
- itemkey: val.id,
- itemvalue: val.itemkey, //名字,
- itemcode: val.itemvalue
- })
- })
- $ionicActionSheet.show({
- cancelOnStateChange: true,
- cssClass: 'action_s',
- cancelText: '取消',
- buttons: taxwaylist,
- buttonClicked: function (index) {
- $scope.threeyearinfo.collectway2 = taxwaylist[index].itemvalue;
- return true;
- }
- });
- }
- })
- };
- $scope.showtaxway3 = function () {
- var taxwaylist = [];
- dataToolsService.getTypeEntryListByTypeName("expropriationmethod").then(function (res) {
- if (res.code == 3350) {
- angular.forEach(res.data, function (val) {
- taxwaylist.push({
- text: '<a class="action-sheet-push">' + val.itemkey + '</a>',
- itemkey: val.id,
- itemvalue: val.itemkey, //名字,
- itemcode: val.itemvalue
- })
- })
- $ionicActionSheet.show({
- cancelOnStateChange: true,
- cssClass: 'action_s',
- cancelText: '取消',
- buttons: taxwaylist,
- buttonClicked: function (index) {
- $scope.threeyearinfo.collectway3 = taxwaylist[index].itemvalue;
- return true;
- }
- });
- }
- })
- };
- $scope.gobackpage = function () {
- if (!$stateParams.value) {
- if ($scope.value != 1) {
- $scope.value--;
- } else {
- $scope.go('tab.activityIndex');
- }
- } else {
- $scope.go('orgInspectList', {isuserlist: false});
- }
- }
- $scope.isRelateUl = false;
- $scope.companylist = [];
- $scope.selectOrgname = function (orgname) {
- if (orgname) {
- $timeout(function () {
- dataToolsService.getOrganizationModelByOrgname(orgname, 0, 0).then(function (response) {
- $scope.companylist = response.data;
- $scope.isRelateUl = true;
- }, function () {
- })
- }, 1000);
- } else {
- $scope.isRelateUl = false;
- $scope.companylist = [];
- }
- }
- $scope.ttt = function (tmptitle) {
- return $sce.trustAsHtml(tmptitle);
- }
- $scope.fatherdata = {};
- $scope.setCompanyName = function (organizationInfo) {
- $scope.organizationInfo = organizationInfo;
- $scope.highorginspection.orgname = organizationInfo.name;
- if (organizationInfo.registrationdate) {
- $scope.highorginspection.registerdate = organizationInfo.registrationdate.split(/\s+/)[0];
- }
- $scope.highorginspection.orgcode = organizationInfo.orgcode;
- $scope.category.value = organizationInfo.categoryid;
- $scope.isRelateUl = false;
- }
- $scope.regex=/^[+-]?\d+(\.\d+)?$/
- $scope.pdregex=/1[3|4|5|7|8|9][0-9]{9}/
- $scope.tpdregex=/^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/
- $scope.goNextPage = function () {
- if ($scope.value != 4) {
- //必填项没有填的话就不可以点击下一步
- if ($scope.value == 1) {
- if (!$scope.highorginspection.orgname || !$scope.highorginspection.registerdate || !$scope.highorginspection.contracttel||!$scope.highorginspection.declaredate) {
- $ionicPopup.alert({
- title: '提示',
- template: '请填写必填项!'
- });
- return;
- }
- if($scope.highorginspection.contracttel!=undefined){
- if(!$scope.pdregex.test($scope.highorginspection.contracttel)||$scope.highorginspection.contracttel.length!=11){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确手机号码!'
- });
- return;
- }
- }
- if($scope.highorginspection.workercount!=undefined){
- if(!$scope.regex.test($scope.highorginspection.workercount)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.highorginspection.technicalcount!=undefined){
- if(!$scope.regex.test($scope.highorginspection.technicalcount)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- }
- //必填项没有填的话就不可以点击下一步
- if ($scope.value == 2) {
- if (!$scope.highorginspection.oneintellectualcount || !$scope.highorginspection.twointellectualcount || !$scope.highorginspection.obtainway) {
- $ionicPopup.alert({
- title: '提示',
- template: '请填写必填项!'
- });
- return;
- }
- if($scope.highorginspection.oneintellectualcount!=undefined){
- console.log( $scope.highorginspection.patentcount)
- if(!$scope.regex.test($scope.highorginspection.oneintellectualcount)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.highorginspection.twointellectualcount!=undefined){
- if(!$scope.regex.test($scope.highorginspection.twointellectualcount)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.highorginspection.patentcount!=undefined){
- if(!$scope.regex.test($scope.highorginspection.patentcount)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.highorginspection.practicalpatentcount!=undefined){
- console.log( $scope.highorginspection.patentcount)
- if(!$scope.regex.test($scope.highorginspection.practicalpatentcount)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.highorginspection.appearancepatentcount!=undefined){
- if(!$scope.regex.test($scope.highorginspection.appearancepatentcount)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- }
- if($scope.value == 3){
- if($scope.threeyearinfo.sale3!=undefined){
- if(!$scope.regex.test($scope.threeyearinfo.sale3)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.threeyearinfo.sale2!=undefined){
- if(!$scope.regex.test($scope.threeyearinfo.sale2)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.threeyearinfo.sale1!=undefined){
- if(!$scope.regex.test($scope.threeyearinfo.sale1)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.threeyearinfo.asset3!=undefined){
- if(!$scope.regex.test($scope.threeyearinfo.sale3)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.threeyearinfo.asset2!=undefined){
- if(!$scope.regex.test($scope.threeyearinfo.asset2)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.threeyearinfo.asset1!=undefined){
- if(!$scope.regex.test($scope.threeyearinfo.asset1)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.threeyearinfo.researchmoney3!=undefined){
- if(!$scope.regex.test($scope.threeyearinfo.researchmoney3)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.threeyearinfo.researchmoney2!=undefined){
- if(!$scope.regex.test($scope.threeyearinfo.researchmoney2)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.threeyearinfo.researchmoney1!=undefined){
- if(!$scope.regex.test($scope.threeyearinfo.researchmoney1)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.threeyearinfo.chinaresearchmoney3!=undefined){
- if(!$scope.regex.test($scope.threeyearinfo.chinaresearchmoney3)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.threeyearinfo.chinaresearchmoney2!=undefined){
- if(!$scope.regex.test($scope.threeyearinfo.chinaresearchmoney2)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.threeyearinfo.chinaresearchmoney1!=undefined){
- if(!$scope.regex.test($scope.threeyearinfo.chinaresearchmoney1)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.threeyearinfo.income!=undefined){
- if(!$scope.regex.test($scope.threeyearinfo.income)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.threeyearinfo.techincome!=undefined){
- if(!$scope.regex.test($scope.threeyearinfo.techincome)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.threeyearinfo.intellectureincome!=undefined){
- if(!$scope.regex.test($scope.threeyearinfo.intellectureincome)){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- }
- $scope.value++;
- } else {
- //表单参数验证
- if (!$scope.highorginspection.orgname || !$scope.highorginspection.registerdate || !$scope.highorginspection.contracttel || !$scope.highorginspection.oneintellectualcount || !$scope.highorginspection.twointellectualcount ||
- !$scope.highorginspection.obtainway) {
- $ionicPopup.alert({
- title: '提示',
- template: '输入数据有误!请检查'
- });
- return;
- }
- if($scope.highorginspection.establishaccountsystem!=undefined){
- if(!$scope.regex.test($scope.highorginspection.establishaccountsystem)||$scope.highorginspection.establishaccountsystem>6){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.highorginspection.universityindustrycooperation!=undefined){
- if(!$scope.regex.test($scope.highorginspection.universityindustrycooperation)||$scope.highorginspection.universityindustrycooperation>6){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.highorginspection.buildinnovationplatform!=undefined){
- if(!$scope.regex.test($scope.highorginspection.buildinnovationplatform)||$scope.highorginspection.buildinnovationplatform>4){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- if($scope.highorginspection.establishrewardsystem!=undefined){
- if(!$scope.regex.test($scope.highorginspection.establishrewardsystem)||$scope.highorginspection.establishrewardsystem>4){
- $ionicPopup.alert({
- title: '提示',
- template: '请填正确数值!'
- });
- return;
- }
- }
- //开始检测
- if (!$scope.highorginspection.technicaladvanced) {
- $scope.highorginspection.technicaladvanced = 1;
- }
- if (!$scope.highorginspection.coresupport) {
- $scope.highorginspection.coresupport = 1;
- }
- if (!$scope.highorginspection.convertaverage) {
- $scope.highorginspection.convertaverage = 1;
- }
- $scope.highorginspection.isparticipatestandard = $scope.highorginspection.isparticipatestandard == true ? 1 : 0;
- $scope.highorginspection.otherindevelopfee = $scope.highorginspection.otherindevelopfee == true ? 1 : 0;
- $scope.highorginspection.data = $scope.threeyearinfo;
- //通过接口发送至后台,用于存入数据库
- $scope.params.data = $scope.highorginspection;
- $scope.params.node = UserService.node;
- $scope.params.userid = UserService.id;
- AccountService.insertHighInspect($scope.params).then(function (res) {
- if (res.code == 3350) {
- $scope.go("orgSelfReport", {
- data: $scope.params,
- scoreConnid: res.data,
- highorginspection: $stateParams.highorginspection,
- registerdate:$scope.highorginspection.registerdate
- });
- }else {
- $ionicPopup.alert({
- title: '提示',
- template: res.message
- });
- }
- })
- }
- }
- // 时间日期
- // 日期选择
- $scope.validedTime = new Date();
- //打开日期选择框
- $scope.openDatePicker = function (obj) {
- var datePickerObj = {
- //选择日期后的回掉
- callback: function (val) {
- if (typeof (val) === 'undefined') {
- } else {
- var date = new Date(val);
- if (date.toLocaleString().charAt(/\s+/) != -1) {
- var temp = date.toLocaleString().replace(/\//g, "-");
- $scope.highorginspection[obj]= temp;
- }
- datePickerObj.inputDate = new Date(val); //更新日期弹框上的日期
- }
- },
- disabledDates: [
- new Date(2016, 2, 16),
- new Date(2015, 3, 16),
- new Date(2015, 4, 16),
- new Date(2015, 5, 16),
- new Date('Wednesday, August 12, 2015'),
- new Date("2016-08-16"),
- new Date(1439676000000)
- ],
- from: new Date(1949, 1, 1),
- to: new Date(2050, 11, 31),
- inputDate: new Date(),
- mondayFirst: true,
- disableWeekdays: [], //设置不能选中
- closeOnSelect: false,
- dateFormat: 'yyyy-MM-dd',
- templateType: 'popup',
- }
- ionicDatePicker.openDatePicker(datePickerObj);
- };
- $scope.choiceToggle = true;
- $scope.changeToggle = function () {
- $scope.choiceToggle = !$scope.choiceToggle;
- }
- if ($stateParams.highorginspection) {
- $scope.highorginspection = $stateParams.highorginspection;
- $scope.threeyearinfo = $scope.highorginspection.data;
- $scope.category.value = $scope.highorginspection.category;
- $scope.obtainway.value = $scope.highorginspection.obtainway;
- $scope.technicaladvanced = $scope.highorginspection.technicaladvanced;
- $scope.coresupport = $scope.highorginspection.coresupport;
- $scope.convertaverage = $scope.highorginspection.convertaverage;
- }
- })
- ;
|