前端接口对接

This commit is contained in:
pengyb 2024-08-21 20:18:18 +08:00
parent f6417a0845
commit 83a3fdba1d
1 changed files with 14 additions and 6 deletions

View File

@ -13,11 +13,11 @@ layui.use(['form','layer','table'], function () {
break; break;
case 'edit': case 'edit':
console.log('修改',obj) console.log('修改',obj)
updateView(obj.data.proId) updateView(obj.data)
break; break;
case 'del': case 'del':
console.log('删除',obj) console.log('删除',obj)
delView(obj.data.proId) delView(obj.data)
break; break;
} }
@ -190,14 +190,18 @@ function checkView(vo) {
/** /**
* 修改 * 修改
* */ * */
function updateView(id) { function updateView(value) {
if(value.lineNum > 0){
layer.msg("该工程已绑定人员,无法修改", { icon: 0 })
return;
}
var height = '90%'; var height = '90%';
var width = '55%'; var width = '55%';
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
url: PATH_URL + '/lineProject/getProById', url: PATH_URL + '/lineProject/getProById',
data: JSON.stringify({"proId": id}), data: JSON.stringify({"proId": value.proId}),
success: function (data) { success: function (data) {
var index = layer.open({ var index = layer.open({
title: ['修改', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'], title: ['修改', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
@ -231,13 +235,17 @@ function updateView(id) {
/** /**
* 删除 * 删除
* */ * */
function delView(id) { function delView(value) {
if(value.lineNum > 0){
layer.msg("该工程已绑定人员,无法删除", { icon: 0 })
return;
}
let index = layer.confirm("是否确定删除数据?", function () { let index = layer.confirm("是否确定删除数据?", function () {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: PATH_URL + '/lineProject/delProId', url: PATH_URL + '/lineProject/delProId',
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
data: JSON.stringify({ "proIds": id }), data: JSON.stringify({ "proIds": value.proId }),
success: function (data) { success: function (data) {
layer.close(index); layer.close(index);
if (data.code == 200) { if (data.code == 200) {