From 83a3fdba1dfd28d8f892eb9efa828fc98d2df608 Mon Sep 17 00:00:00 2001 From: pengyb <726475269@qq.com> Date: Wed, 21 Aug 2024 20:18:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=8E=A5=E5=8F=A3=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hxy-web/js/wireManager/project/projectList.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/hxy-web/js/wireManager/project/projectList.js b/hxy-web/js/wireManager/project/projectList.js index 4f5973c..7b79d82 100644 --- a/hxy-web/js/wireManager/project/projectList.js +++ b/hxy-web/js/wireManager/project/projectList.js @@ -13,11 +13,11 @@ layui.use(['form','layer','table'], function () { break; case 'edit': console.log('修改',obj) - updateView(obj.data.proId) + updateView(obj.data) break; case 'del': console.log('删除',obj) - delView(obj.data.proId) + delView(obj.data) 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 width = '55%'; $.ajax({ type: 'POST', contentType: "application/json; charset=utf-8", url: PATH_URL + '/lineProject/getProById', - data: JSON.stringify({"proId": id}), + data: JSON.stringify({"proId": value.proId}), success: function (data) { var index = layer.open({ 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 () { $.ajax({ type: 'POST', url: PATH_URL + '/lineProject/delProId', contentType: "application/json; charset=utf-8", - data: JSON.stringify({ "proIds": id }), + data: JSON.stringify({ "proIds": value.proId }), success: function (data) { layer.close(index); if (data.code == 200) {