diff --git a/common/js/api/inventoryManagement.js b/common/js/api/inventoryManagement.js
new file mode 100644
index 0000000..756a7f9
--- /dev/null
+++ b/common/js/api/inventoryManagement.js
@@ -0,0 +1,36 @@
+import request from "../request.js";
+
+export const getInventoryManagement = (params) => {
+ return request({
+ url: "/inventory_management",
+ method: "get",
+ params,
+ });
+};
+export const addInventoryManagement = (data) => {
+ return request({
+ url: "/inventory_management",
+ method: "post",
+ data,
+ });
+};
+
+export const getInventoryManagementById = (id) => {
+ return request({
+ url: `/inventory_management/${id}`,
+ method: "get",
+ });
+};
+export const deleteInventoryManagement = (id) => {
+ return request({
+ url: `/inventory_management/${id}`,
+ method: "delete",
+ });
+};
+export const updateInventoryManagement = (data) => {
+ return request({
+ url: `/inventory_management/${data.id}`,
+ method: "put",
+ data,
+ });
+};
diff --git a/common/js/api/projectBaseInfo.js b/common/js/api/projectBaseInfo.js
new file mode 100644
index 0000000..3c4f5cf
--- /dev/null
+++ b/common/js/api/projectBaseInfo.js
@@ -0,0 +1,36 @@
+import request from "../request.js";
+
+export const getProjectBaseInfo = (params) => {
+ return request({
+ url: "/project_base_info",
+ method: "get",
+ params,
+ });
+};
+export const addProjectBaseInfo = (data) => {
+ return request({
+ url: "/project_base_info",
+ method: "post",
+ data,
+ });
+};
+
+export const getProjectBaseInfoById = (id) => {
+ return request({
+ url: `/project_base_info/${id}`,
+ method: "get",
+ });
+};
+export const deleteProjectBaseInfo = (id) => {
+ return request({
+ url: `/project_base_info/${id}`,
+ method: "delete",
+ });
+};
+export const updateProjectBaseInfo = (data) => {
+ return request({
+ url: `/project_base_info/${data.id}`,
+ method: "put",
+ data,
+ });
+};
diff --git a/common/js/api/projectCompany.js b/common/js/api/projectCompany.js
index fde34cd..9cf305f 100644
--- a/common/js/api/projectCompany.js
+++ b/common/js/api/projectCompany.js
@@ -27,3 +27,10 @@ export const deleteProjectCompany = (id) => {
method: "delete",
});
};
+export const updateProjectCompany = (data) => {
+ return request({
+ url: `/project_company/${data.id}`,
+ method: "put",
+ data,
+ });
+};
diff --git a/inventory_management/index.html b/inventory_management/index.html
new file mode 100644
index 0000000..de942f3
--- /dev/null
+++ b/inventory_management/index.html
@@ -0,0 +1,423 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 项目基础信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+ 新增
+ 修改
+ 删除
+
+
+ 导入
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{row.id }}
+
+
+
+ 编辑
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/project_base_info/index.html b/project_base_info/index.html
new file mode 100644
index 0000000..3cd303d
--- /dev/null
+++ b/project_base_info/index.html
@@ -0,0 +1,470 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 项目基础信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+ 新增
+ 修改
+ 删除
+
+
+ 导入
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/project_company/index.html b/project_company/index.html
index 379cf16..c26ba50 100644
--- a/project_company/index.html
+++ b/project_company/index.html
@@ -60,7 +60,7 @@
>
-
+
修改
- 删除
+
+ 导入
+ 导出
+
-
+
@@ -258,6 +272,7 @@
addProjectCompany,
getProjectCompanyById,
deleteProjectCompany,
+ updateProjectCompany,
} from "/common/js/api/projectCompany.js";
const app = createApp({
@@ -366,36 +381,14 @@
const submitForm = async () => {
await formRef.value.validate();
if (form.value.id) {
- fetch(`http://localhost:8000/organizational/${form.value.id}`, {
- method: "PUT",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify(form.value),
- })
- .then((resp) => resp.json())
- .then(() => {
- cancel();
- getList();
- });
+ await updateProjectCompany(form.value);
+ cancel();
+ getList();
} else {
await addProjectCompany(form.value);
cancel();
getList();
ElMessage.success("新增成功");
- // fetch(`http://localhost:8000/organizational`, {
- // method: "POST",
- // headers: {
- // "Content-Type": "application/json",
- // },
- // body: JSON.stringify(form.value),
- // })
- // .then((resp) => resp.json())
- // .then(() => {
- // cancel();
- // getList();
- // ElMessage.success("新增成功");
- // });
}
};
const getList = async () => {
@@ -409,13 +402,9 @@
getList();
};
const switchStatus = async (row) => {
- const orgData = _.cloneDeep(row);
- console.log(orgData.status);
+ const companyData = _.cloneDeep(row);
try {
- await axios.put(
- `http://localhost:8000/organizational/${orgData.id}`,
- orgData
- );
+ await updateProjectCompany(companyData);
getList();
console.log("更改状态成功");
} catch (error) {
@@ -423,6 +412,17 @@
console.log("更改状态失败");
}
};
+ const selectedIds = ref([]);
+ const handleSelectionChange = (val) => {
+ selectedIds.value = val.map((item) => item.id);
+ };
+ const batchDelete = async () => {
+ await deleteProjectCompany(selectedIds.value.join(","));
+ ElMessage.success(
+ `批量删除了id为${selectedIds.value.join(",")}的数据项`
+ );
+ getList();
+ };
getList();
return {
cancel,
@@ -446,6 +446,9 @@
handleSizeChange,
handleCurrentChange,
switchStatus,
+ handleSelectionChange,
+ selectedIds,
+ batchDelete,
};
},
});