| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- $(function () {
- });
- /*
- 参数解释:
- title 标题
- url 请求的url
- id 需要操作的数据id
- w 弹出层宽度(缺省调默认值)
- h 弹出层高度(缺省调默认值)
- */
- /*管理员-增加*/
- function contract_dialog(title, url, w, h) {
- var index = layer_show(title, pagePath+url, w, h);
- layer.full(index);
- }
- //管理员-删除
- function contract_del(url) {
- layer.confirm('确认要删除吗?', function () {
- //此处请求后台程序,下方是成功后的前台处理……
- $.ajax({
- type: "delete",
- dataType: "json",
- url: pagePath+url,
- data: {
- "timestamp": new Date().getTime(),
- },
- success: function (result) {
- if (result.success) {
- smileMessage(result.message);
- setTime();
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- });
- }
- function contract_archive(url) {
- getSelectedItem();
- var ids = [];
- if(null != item_selected_arr){
- ids = getIdsFromItemArr(item_selected_arr);
- }
- var objIndex = [];
- var obj = $("input[name='id']:checked");
- if (obj.length == 0) {
- errorMessage("请选择合同");
- return false;
- }
- //使用中合同不能归档
- var canArchive = true;
- obj.each(function (index, item) {
- if($(this).attr("status")=="0"){
- canArchive = false;
- return false;
- }
- /*ids.push(item.value);*/
- objIndex.push(item.id);
- });
- if(!canArchive){
- sadMessage("使用中合同不能归档,请重新选择!");
- return false;
- }
- layer.confirm('确认要归档吗?', function (index) {
- //此处请求后台程序,下方是成功后的前台处理……
- $.ajax({
- type: "PUT",
- dataType: "json",
- url: pagePath+url,
- data: {
- "timestamp": new Date().getTime(),
- "ids": ids
- },
- success: function (result) {
- if (result.success) {
- setTime();
- smileMessage(result.message)
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- });
- }
|