From 76a5c3eb7c087f526c1ab190257d1c335bf67ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <963808678@qq.com> Date: Fri, 22 Sep 2023 17:44:48 +0800 Subject: [PATCH] 9/22 --- src/Views/ApplyJoin/ForJ.vue | 105 +++++++ src/Views/ApplyJoin/Found.vue | 141 +++++++++ src/Views/ApplyJoin/Join.vue | 126 ++++++++ src/Views/ApplyJoin/index.vue | 388 +++++++++++++++++++++++++ src/Views/ApplyJoin/initData.js | 19 ++ src/Views/ApplyJoinOperate/index.vue | 112 +++++++ src/Views/ApplyJoinOperate/initData.js | 19 ++ src/Views/Booking/AddBooking.vue | 89 +++++- src/Views/Booking/index.vue | 71 ++++- src/Views/WebC/index.vue | 16 +- src/Views/workmate/index.vue | 201 +++++++++++++ src/Views/workmate/initData.js | 19 ++ src/api/Index.js | 239 +++++++++++++++ src/components/TableBox.vue | 16 +- src/router/index.js | 12 + 15 files changed, 1550 insertions(+), 23 deletions(-) create mode 100644 src/Views/ApplyJoin/ForJ.vue create mode 100644 src/Views/ApplyJoin/Found.vue create mode 100644 src/Views/ApplyJoin/Join.vue create mode 100644 src/Views/ApplyJoin/index.vue create mode 100644 src/Views/ApplyJoin/initData.js create mode 100644 src/Views/ApplyJoinOperate/index.vue create mode 100644 src/Views/ApplyJoinOperate/initData.js create mode 100644 src/Views/workmate/index.vue create mode 100644 src/Views/workmate/initData.js diff --git a/src/Views/ApplyJoin/ForJ.vue b/src/Views/ApplyJoin/ForJ.vue new file mode 100644 index 0000000..fbdd657 --- /dev/null +++ b/src/Views/ApplyJoin/ForJ.vue @@ -0,0 +1,105 @@ + + + diff --git a/src/Views/ApplyJoin/Found.vue b/src/Views/ApplyJoin/Found.vue new file mode 100644 index 0000000..95fffb8 --- /dev/null +++ b/src/Views/ApplyJoin/Found.vue @@ -0,0 +1,141 @@ + + + diff --git a/src/Views/ApplyJoin/Join.vue b/src/Views/ApplyJoin/Join.vue new file mode 100644 index 0000000..bf087b7 --- /dev/null +++ b/src/Views/ApplyJoin/Join.vue @@ -0,0 +1,126 @@ + + + diff --git a/src/Views/ApplyJoin/index.vue b/src/Views/ApplyJoin/index.vue new file mode 100644 index 0000000..58fb479 --- /dev/null +++ b/src/Views/ApplyJoin/index.vue @@ -0,0 +1,388 @@ + + + diff --git a/src/Views/ApplyJoin/initData.js b/src/Views/ApplyJoin/initData.js new file mode 100644 index 0000000..74f93c2 --- /dev/null +++ b/src/Views/ApplyJoin/initData.js @@ -0,0 +1,19 @@ +let cargoIdData = [ + { + name: "S 普通货", + code: "S", + }, + { + name: "R 冻柜", + code: "R", + }, + { + name: "D 危险品", + code: "D", + }, + { + name: "O 超限箱", + code: "O", + }, +]; +export { cargoIdData }; diff --git a/src/Views/ApplyJoinOperate/index.vue b/src/Views/ApplyJoinOperate/index.vue new file mode 100644 index 0000000..cf2bafa --- /dev/null +++ b/src/Views/ApplyJoinOperate/index.vue @@ -0,0 +1,112 @@ + + + diff --git a/src/Views/ApplyJoinOperate/initData.js b/src/Views/ApplyJoinOperate/initData.js new file mode 100644 index 0000000..74f93c2 --- /dev/null +++ b/src/Views/ApplyJoinOperate/initData.js @@ -0,0 +1,19 @@ +let cargoIdData = [ + { + name: "S 普通货", + code: "S", + }, + { + name: "R 冻柜", + code: "R", + }, + { + name: "D 危险品", + code: "D", + }, + { + name: "O 超限箱", + code: "O", + }, +]; +export { cargoIdData }; diff --git a/src/Views/Booking/AddBooking.vue b/src/Views/Booking/AddBooking.vue index 7beadb9..9edcf82 100644 --- a/src/Views/Booking/AddBooking.vue +++ b/src/Views/Booking/AddBooking.vue @@ -10,12 +10,17 @@ > 复制 - 存为模板 - 状态历史 + + 删除 - + 发送订舱 @@ -496,20 +501,20 @@ 新增 - + @@ -521,8 +526,10 @@ import { onMounted, ref } from "vue"; import { bookingCustomSave, bookingCustomInfo, - Uploader, + bookingCustomUploaderFile, + bookingCustomDownFile, bookingCustomDelete, + bookingCustomSubmit, } from "@/api/Index"; import { useRouter } from "vue-router"; import { ElMessage } from "element-plus"; @@ -538,6 +545,7 @@ export default { console.log("setup"); const store = useStore(); const router = useRouter(); + const fileList = ref([]); const form = ref({ name: "", region: "", @@ -568,6 +576,11 @@ export default { if (query.type == "Edit" || query.type == "Copy") { bookingCustomInfo({ id: query.id }).then((res) => { form.value = { ...res.data }; + fileList.value = []; + res.data.bookingFileList.forEach((item) => { + fileList.value.push({ ...item, name: item.fileName }); + }); + if (query.type == "Copy") { delete form.value.id; } @@ -586,10 +599,16 @@ export default { form.value.ctnList.push({}); }, 100); }; + const ClickSave = () => { console.log(form.value); let ApiData = form.value; - ApiData = { ...ApiData, ...form.value.cargoData }; + // fileList + ApiData = { + ...ApiData, + ...form.value.cargoData, + bookingFileList: fileList.value, + }; bookingCustomSave(ApiData).then((res) => { if (res.code == 200) { console.log(res); @@ -601,14 +620,51 @@ export default { } }); }; - const fileList = ref([]); + const uploadApi = (param) => { let formData = new FormData(); formData.append("file", param.file); - Uploader(formData).then((res) => { + bookingCustomUploaderFile(formData).then((res) => { console.log(res.data); + console.log(fileList.value); + let Data = []; + fileList.value.forEach((item) => { + if (item.name == res.data.fileName) { + item = { ...item, ...res.data }; + console.log(item); + } + Data.push(item); + }); + fileList.value = Data; + console.log(fileList.value); }); }; + const handlePreview = (uploadFile) => { + bookingCustomDownFile({ + fileName: uploadFile.fileName, + filePath: uploadFile.filePath, + }).then((res) => { + console.log(res); + const blob = new Blob([res]); + // for IE + if (window.navigator && window.navigator.msSaveOrOpenBlob) { + const fileName = uploadFile.fileName; + window.navigator.msSaveOrOpenBlob(blob, fileName); + } else { + // for Non-IE (chrome, firefox etc.) + const fileName = uploadFile.fileName; + const elink = document.createElement("a"); + elink.download = fileName; + elink.style.display = "none"; + elink.href = URL.createObjectURL(blob); + document.body.appendChild(elink); + elink.click(); + URL.revokeObjectURL(elink.href); + document.body.removeChild(elink); + } + }); + // console.log(uploadFile); + }; const ClickCopy = () => { delete form.value.id; viweType.value = "Copy"; @@ -625,6 +681,17 @@ export default { } }); }; + const ClicSend = () => { + bookingCustomSubmit({ id: form.value.id }).then((res) => { + if (res.code == 200) { + ElMessage({ + message: "发送成功", + type: "success", + }); + router.push("/Booking"); + } + }); + }; const ChangeCargoId = () => { form.value.cargoData = {}; }; @@ -665,9 +732,11 @@ export default { ClickSave, fileList, uploadApi, + handlePreview, viweType, ClickCopy, ClicDelete, + ClicSend, cargoIdData, ChangeCargoId, ChangecarrierCode, diff --git a/src/Views/Booking/index.vue b/src/Views/Booking/index.vue index 595c212..42bdda3 100644 --- a/src/Views/Booking/index.vue +++ b/src/Views/Booking/index.vue @@ -1,7 +1,7 @@ @@ -23,7 +25,12 @@ import SearchBox from "@/components/SearchBox.vue"; import TableBox from "@/components/TableBox.vue"; import { Plus } from "@element-plus/icons-vue"; -import { bookingCustomList, bookingCustomDelete } from "@/api/Index"; +import { + bookingCustomList, + bookingCustomDelete, + bookingCustomSubmit, + bookingCustomCancelSubmit, +} from "@/api/Index"; import { useRouter } from "vue-router"; import { ref, reactive } from "vue"; import { ElMessage } from "element-plus"; @@ -144,12 +151,19 @@ export default { const ButtonData = [ { text: "新建", type: "primary", icon: Plus, FnName: "ClickAdd" }, { text: "复制", type: "primary", plain: true, FnName: "ClickCopy" }, - { text: "导入", type: "primary", plain: true }, - { text: "模板", type: "primary", plain: true }, + // { text: "导入", type: "primary", plain: true }, + // { text: "模板", type: "primary", plain: true }, { text: "删除", type: "danger", FnName: "ClickDelete" }, - { text: "发送订舱", type: "primary", plain: true }, + { text: "发送订舱", type: "primary", plain: true, FnName: "ClickSend" }, + { + text: "取消发送", + type: "primary", + plain: true, + FnName: "ClickCancelSend", + }, ]; const TableBoxRef = ref(); + const SearchBoxRef = ref(); const router = useRouter(); const ClickAdd = () => { router.push({ @@ -174,7 +188,7 @@ export default { if (e) { bookingCustomDelete({ id: e.id }).then((res) => { if (res.data == 200) { - ClickSearch(); + SearchBoxRef.value.Search(); } }); } else { @@ -183,7 +197,7 @@ export default { table.forEach((item) => { bookingCustomDelete({ id: item.id }).then((res) => { if (res.data == 200) { - ClickSearch(); + SearchBoxRef.value.Search(); } }); }); @@ -212,9 +226,50 @@ export default { }); } }; + const ClickSend = (e) => { + console.log(e); + let table = TableBoxRef.value.$refs.Table.getSelectionRows(); + if (table.length == 1) { + bookingCustomSubmit({ id: table[0].id }).then((res) => { + if (res.code == 200) { + ElMessage({ + message: "发送成功", + type: "success", + }); + SearchBoxRef.value.Search(); + } + }); + } else { + ElMessage({ + message: "请选择一条数据", + type: "warning", + }); + } + }; + const ClickCancelSend = (e) => { + console.log(e); + let table = TableBoxRef.value.$refs.Table.getSelectionRows(); + if (table.length == 1) { + bookingCustomCancelSubmit({ id: table[0].id }).then((res) => { + if (res.code == 200) { + ElMessage({ + message: "取消发送成功", + type: "success", + }); + SearchBoxRef.value.Search(); + } + }); + } else { + ElMessage({ + message: "请选择一条数据", + type: "warning", + }); + } + }; return { SearchBoxData, TableBoxRef, + SearchBoxRef, ClickSearch, SearchOpen, TableData, @@ -224,6 +279,8 @@ export default { ClickAdd, ClickDelete, ClickCopy, + ClickSend, + ClickCancelSend, }; }, }; diff --git a/src/Views/WebC/index.vue b/src/Views/WebC/index.vue index 82b18bb..4bf8c7f 100644 --- a/src/Views/WebC/index.vue +++ b/src/Views/WebC/index.vue @@ -30,10 +30,10 @@ @close="handleClose" router > - + 客户订舱 @@ -46,6 +46,18 @@ 收发通模板 + + + 我的企业 + + + + 同事管理 + + + + 企业审核(运营) + diff --git a/src/Views/workmate/index.vue b/src/Views/workmate/index.vue new file mode 100644 index 0000000..bf086f2 --- /dev/null +++ b/src/Views/workmate/index.vue @@ -0,0 +1,201 @@ + + + diff --git a/src/Views/workmate/initData.js b/src/Views/workmate/initData.js new file mode 100644 index 0000000..74f93c2 --- /dev/null +++ b/src/Views/workmate/initData.js @@ -0,0 +1,19 @@ +let cargoIdData = [ + { + name: "S 普通货", + code: "S", + }, + { + name: "R 冻柜", + code: "R", + }, + { + name: "D 危险品", + code: "D", + }, + { + name: "O 超限箱", + code: "O", + }, +]; +export { cargoIdData }; diff --git a/src/api/Index.js b/src/api/Index.js index f17042b..a5fbfb2 100644 --- a/src/api/Index.js +++ b/src/api/Index.js @@ -65,6 +65,56 @@ const bookingCustomSave = (data) => { }, }); }; +// 发送提交 +const bookingCustomSubmit = (data) => { + return request({ + data: { + url: "/api/bookingAip/bookingCustom/submit", + method: "post", + data, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 取消提交订舱 +const bookingCustomCancelSubmit = (data) => { + return request({ + data: { + url: "/api/bookingAip/bookingCustom/cancelSubmit", + method: "post", + data, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 上传订单附件 +const bookingCustomUploaderFile = (data) => { + return request({ + data: { + url: "/api/bookingAip/bookingCustom/uploaderFile", + method: "post", + data, + headers: { + // Authorization: localStorage.getItem("token"), + "Content-Type": "multipart/form-data", + }, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 获取附件 +const bookingCustomDownFile = (params) => { + return request({ + data: { + url: "/api/bookingAip/bookingCustom/downFile", + method: "get", + params, + responseType: "blob", + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; + // 查询客户订单详情 const bookingCustomInfo = (params) => { return request({ @@ -257,6 +307,176 @@ const cobServiceItemTenantList = (params) => { }, }); }; +// 申请加入企业列表(用于申请人自己查询申请列表) +const applyJoinList = (params) => { + return request({ + data: { + url: "/api/bookingAip/tenant/applyJoinList", + method: "get", + params, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 创建企业 +const tenantRegister = (data) => { + return request({ + data: { + url: "/api/bookingAip/tenant/register", + method: "post", + data, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 上传营业执照 +const tenantUploaderFile = (data) => { + return request({ + data: { + url: "/api/bookingAip/tenant/uploaderFile", + method: "post", + data, + headers: { + // Authorization: localStorage.getItem("token"), + "Content-Type": "multipart/form-data", + }, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 获取营业执照 +const tenantDownFile = (params) => { + return request({ + data: { + url: "/api/bookingAip/tenant/downFile", + method: "get", + params, + responseType: "blob", + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 输入企业名称查询企业详情 +const tenantNameQuery = (params) => { + return request({ + data: { + url: "/api/bookingAip/tenant/nameQuery", + method: "get", + params, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 申请加入企业 +const TenantApplyJoin = (data) => { + return request({ + data: { + url: "/api/bookingAip/tenant/applyJoin", + method: "post", + data, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 查询用户所属的企业 +const tenantUserTenantList = (params) => { + return request({ + data: { + url: "/api/bookingAip/tenant/userTenantList", + method: "get", + params, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 管理员查询员工列表(用于企业管理员查询同事列表) +const tenantAdminUserList = (params) => { + return request({ + data: { + url: "/api/bookingAip/tenant/adminUserList", + method: "get", + params, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 查询待审核企业列表(运营使用) +const tenantWaitAuditTenantList = (params) => { + return request({ + data: { + url: "/api/bookingAip/tenant/waitAuditTenantList", + method: "get", + params, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 审核企业(运营使用) +const TenantAudit = (data) => { + return request({ + data: { + url: "/api/bookingAip/tenant/audit", + method: "post", + data, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 申请加入企业列表(用于企业管理员查询申请列表) +const tenantWaitAdminApplyJoinList = (params) => { + return request({ + data: { + url: "/api/bookingAip/tenant/adminApplyJoinList", + method: "get", + params, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 管理员同意申请 +const TenantAdminAgreeApplyJoin = (data) => { + return request({ + data: { + url: "/api/bookingAip/tenant/adminAgreeApplyJoin", + method: "post", + data, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 管理员驳回申请 +const TenantAdminRejectApplyJoin = (data) => { + return request({ + data: { + url: "/api/bookingAip/tenant/adminRejectApplyJoin", + method: "post", + data, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 管理员移出员工 +const TenantAdminRemoveUser = (data) => { + return request({ + data: { + url: "/api/bookingAip/tenant/adminRemoveUser", + method: "post", + data, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; +// 申请加入企业(撤销),用于申请人自己撤销操作 +const TenantCancelApplyJoin = (data) => { + return request({ + data: { + url: "/api/bookingAip/tenant/cancelApplyJoin", + method: "post", + data, + // headers: { Authorization: localStorage.getItem("token") }, + }, + }); +}; export { UserLogin, @@ -265,6 +485,10 @@ export { UserGetLoginUser, bookingCustomList, bookingCustomSave, + bookingCustomSubmit, + bookingCustomCancelSubmit, + bookingCustomUploaderFile, + bookingCustomDownFile, bookingCustomInfo, Uploader, bookingCustomDelete, @@ -282,4 +506,19 @@ export { Getvessellist, Getpackagelist, cobServiceItemTenantList, + applyJoinList, + tenantRegister, + tenantUploaderFile, + tenantDownFile, + tenantNameQuery, + TenantApplyJoin, + tenantUserTenantList, + tenantAdminUserList, + tenantWaitAuditTenantList, + TenantAudit, + tenantWaitAdminApplyJoinList, + TenantAdminAgreeApplyJoin, + TenantAdminRejectApplyJoin, + TenantAdminRemoveUser, + TenantCancelApplyJoin, }; diff --git a/src/components/TableBox.vue b/src/components/TableBox.vue index 369759e..7f0ca2a 100644 --- a/src/components/TableBox.vue +++ b/src/components/TableBox.vue @@ -13,11 +13,11 @@ {{ item.text }} -
+
{ if (res.code == 200) { - TData.value = res.data.list; - search_data.total = res.data.pagination.total; + if (res.data.list) { + TData.value = res.data.list; + } else { + TData.value = res.data; + } + + if (res.data.pagination) { + search_data.total = res.data.pagination.total; + } + loading.value = false; } }); diff --git a/src/router/index.js b/src/router/index.js index af67e33..60bb134 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -5,6 +5,12 @@ import Booking from "../Views/Booking"; import AddBooking from "../Views/Booking/AddBooking.vue"; import BookingTemplate from "../Views/BookingTemplate"; import BookingOrder from "../Views/BookingOrder"; +import ApplyJoin from "../Views/ApplyJoin"; +import ApplyJoinFound from "../Views/ApplyJoin/Found.vue"; +import ApplyJoinJoin from "../Views/ApplyJoin/Join.vue"; +import ApplyJoinForJ from "../Views/ApplyJoin/ForJ.vue"; +import ApplyJoinOperate from "../Views/ApplyJoinOperate"; +import Workmate from "../Views/workmate"; import About from "../Views/About.vue"; const router = createRouter({ @@ -19,6 +25,12 @@ const router = createRouter({ { path: "/AddBooking", component: AddBooking }, { path: "/BookingTemplate", component: BookingTemplate }, { path: "/BookingOrder", component: BookingOrder }, + { path: "/ApplyJoin", component: ApplyJoin }, + { path: "/ApplyJoinFound", component: ApplyJoinFound }, + { path: "/ApplyJoinJoin", component: ApplyJoinJoin }, + { path: "/ApplyJoinForJ", component: ApplyJoinForJ }, + { path: "/Workmate", component: Workmate }, + { path: "/ApplyJoinOperate", component: ApplyJoinOperate }, ], }, { path: "/login", component: Login },