123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368 |
- /**
- * 理货许可管理
- *
- */
- $.namespace("lhsq.detail");
- lhsq.detail.selData = null;
- lhsq.detail.szdData = null;
- lhsq.detail.gk = null;
- lhsq.detail.gq = null;
- lhsq.detail.path = null;
- lhsq.detail.taskKey=null;
- lhsq.detail.init = function() {
-
- }
- function showRy() {
- $('#selectrydiv').fadeIn(100);
- $('#selectry2div').slideDown(0);
- }
- function showYj() {
- $('#selectyjdiv').fadeIn(100);
- $('#selectyj2div').slideDown(0);
- }
- //返回
- lhsq.detail.back = function() {
- location.href=$.app+'/lhsq/main';
- }
- vae=function(a,b){
- if(isEmpty(a.val())){
- ts(b+"不能为空",a);
- return false;
- }
- return true;
- };
- //保存
- lhsq.detail.save = function() {
- $(".btn").attr("disabled",true);
- $.ajax({
- url : $.app + "/lhsq/save",
- data : $("#addform").serialize(),
- type : "post",
- dataType : "json",
- success : function(data) {// ajax返回的数据
- if (data.success) {
- $.alert({
- title : '提示',
- content : '操作成功',
- confirm : function() {
- location.href=$.app+'/lhsq/main';
- }
- });
- } else {
- $.alert({
- title : '提示',
- content : data.message,
- confirm : function() {
- $(".btn").attr("disabled",false);
- }
- });
- }
- }
- });
- }
- //保存
- lhsq.detail.saveTb = function() {
- $(".btn").attr("disabled",true);
- $.ajax({
- url : $.app + "/lhsq/saveTb",
- data : $("#addform").serialize(),
- type : "post",
- dataType : "json",
- success : function(data) {// ajax返回的数据
- if (data.success) {
- $.alert({
- title : '提示',
- content : '操作成功',
- confirm : function() {
- location.href=$.app+'/lhsq/main';
- }
- });
- } else {
- $.alert({
- title : '提示',
- content : data.message,
- confirm : function() {
- $(".btn").attr("disabled",false);
- }
- });
- }
- }
- });
- }
- //保存
- lhsq.detail.submit = function() {
- if (isEmpty($('#userids').val())) {
- $.alert({
- title : '提示',
- content : "请选择人员办理!!!",
- confirm : function() {
- $(".btn").attr("disabled", false);
- }
- });
- return false;
- }
- $(".btn").attr("disabled",true);
- $.ajax({
- url : $.app + "/lhsq/submit",
- data : $("#addform").serialize(),
- type : "post",
- dataType : "json",
- success : function(data) {// ajax返回的数据
- if (data.success) {
- $.alert({
- title : '提示',
- content : '操作成功',
- confirm : function() {
- location.href=$.app+'/lhsq/main';
- }
- });
- } else {
- $.alert({
- title : '提示',
- content : data.message,
- confirm : function() {
- $(".btn").attr("disabled",false);
- }
- });
- }
- }
- });
- }
- lhsq.detail.delData=function(data){
- $.confirm({
- title: '确认框',
- content: '确认删除吗',
- confirm: function(){
- $.post($.app + "/lhsq/delete", {
- id : data
- }, function(data) {
- if (data.success) {
- $.alert({
- title: '提示',
- content: '删除成功',
- confirm: function(){
- location.href=$.app+'/lhsq/main';
- }
- });
- } else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
- $(".btn").attr("disabled",false);
- }
- });
- }
- }, "json");
- },
- cancel: function(){
- }
- });
- }
- //返回
- lhsq.detail.back = function(){
-
- location.href=$.app+'/lhsq/main';
-
- }
- // 保存附件
- lhsq.detail.submitFile = function(id){
- $('#addform').form('submit', {
- url :$.app + '/lhsq/saveFile',
- onSubmit : function() {
- },
- success : function(data, status) {
- var file = $('#fjid'+id);
- file.after(file.clone().val(""));
- file.remove();
- if (data) {
- data = data.replace("<audio controls=\"controls\" style=\"display: none;\"></audio>","");
- data = $.parseJSON(data);
- }
- if (data.success) {
- var accContect = data.attrs.acc.fjmc;
- var fjid = data.attrs.acc.fjid;
- var accid = data.attrs.acc.id;
- var str = "<tr align='center'>";
- str =str +"<td style='width:40%'>"+ "<input value='"
- + accid
- + "' name='accid' type='hidden'>"
- + "<a class='main_title' href='/jsjy/accessory/download?id="
- + fjid + "'> " + accContect + "</a>" +"</td>";
-
- str =str+"<td style='width:15%'>"+ '<a class="btn btn-default btn-xs" href="#" onclick="lhsq.detail.delFj(\''
- + accid
- + '\','
- + '$(this)'
- + ')">删除</a>' +"</td></tr>";
- $('#tableId').append(str);
- }
- else {
- $.messager.showError(data.message);
- }
- }
- });
- }
-
- // 删除accid 附件关联ID,id 是第几行附件
- lhsq.detail.delFj = function(accid,tr){
- $.confirm({
- title: '确认框',
- content: '确认删除吗',
- confirm: function(){
- $.post($.app + "/lhsq/delFj", {
- ids : accid
- }, function(data) {
- if (data.success) {
- $(tr).parent().parent().remove();
- } else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
- }
- });
- }
- }, "json");
- },
- cancel: function(){
- }
- });
- }
- function addtr(){
- var str = "<tr align='center'>";
- str+="<td><input type='text' class='form-control' name='gdmc'></td>";
- str+="<td><input type='text' class='form-control' name='zcd'></td>";
- str+="<td><input type='text' class='form-control' name='tzgb'></td>";
- str+="<td><button onclick='deltr(this)'>删除</button></td>";
- str+="</tr>"
-
- var val = new Array();
- var i=0;
- $('#tID input:text').each(function(){
- val[i++]=$(this).val();
- });
- val[i++]="";
- val[i++]="";
- val[i++]="";
- i=0;
- $('#tID').html($('#tID').html()+str);
- $('#tID input:text').each(function(){
- $(this).val(val[i++]);
- });
- }
- function deltr(tr){
- $(tr).parent().parent().remove();
- }
- lhsq.detail.audit=function(auditpass,id){
- if (auditpass == "Y" && lhsq.detail.taskKey != 'ldpz') {
- if (isEmpty($('#userids').val())) {
- $.alert({
- title : '提示',
- content : "请选择人员办理!!!",
- confirm : function() {
- $(".btn").attr("disabled", false);
- }
- });
- return false;
- }
- }
-
-
- var shyj = $('#yj').val();
-
- var audit;
- if(auditpass=="Y"){
- audit=true;
- }else{
- audit=false;
- }
- $.post($.app + "/lhsq/audit", {
- id:id,
- shyj:shyj,
- flag:audit,
- userids:$('#userids').val()
- }, function(data) {
- if (data.success) {
-
- $.alert({
- title: '提示',
- content: '操作成功',
- confirm: function(){
- location.href=$.app+'/lhsq/main';
- }
- });
-
- }else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
-
- }, "json");
- }
- lhsq.detail.submitAudit=function(){
- if (isEmpty($('#userids').val())) {
- $.alert({
- title : '提示',
- content : "请选择人员办理!!!",
- confirm : function() {
- $(".btn").attr("disabled", false);
- }
- });
- return false;
- }
- $.ajax({
- url:$.app + "/lhsq/submitAudit",
- data:$("#addform").serialize(),
- type:"post",
- dataType:"json",
- success:function(data){// ajax返回的数据
- if (data.success) {
- $.alert({
- title: '提示',
- content: '操作成功',
- confirm: function(){
- location.href=$.app+'/lhsq/main';
- }
- });
- }else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
- }
- });
- }
|