BUG优化

电子运单 添加详情 删除判断
客户管理的新增运单存在的联系人无法删除
地点管理的新增运单存在的联系人无法删除
dev
xiepeng 2024-05-08 17:58:00 +08:00
parent 3fbef6ce57
commit 0ed592689f
6 changed files with 149 additions and 47 deletions

View File

@ -170,7 +170,7 @@ const fnSubmit = async () => {
await addSafetyCustomerView(formData);
ElMessage.success("添加成功");
router.push("/electronic_waybill_management/customer_management");
router.back();
//
data.form.TRANSPORTATIONCOMPANY = "";
data.form.CUSTOMERTYPE = "";

View File

@ -89,7 +89,13 @@
<el-button
v-if="index !== 0"
type="danger"
@click="removeContact(index, contact.CUSTOMERCONTACT_ID)"
@click="
removeContact(
index,
contact.CUSTOMERCONTACT_ID,
contact.CONTACT
)
"
>
删除
<!-- 添加的删除文字 -->
@ -107,7 +113,7 @@
<script setup>
import { reactive, ref } from "vue";
import useFormValidate from "@/assets/js/useFormValidate.js";
import { ElMessage } from "element-plus";
import { ElMessage, ElMessageBox } from "element-plus";
import {
getTrafficCustomerSelectView,
editSafetyCustomerInfo,
@ -164,11 +170,19 @@ const addContact = () => {
});
};
//
const removeContact = async (index, CUSTOMERCONTACT_ID) => {
const removeContact = async (index, CUSTOMERCONTACT_ID, CONTACT) => {
await ElMessageBox.confirm(`确定要删除联系人 ` + CONTACT + ` 吗?`, {
type: "warning",
});
if (index > 0) {
//
data.form.contacts.splice(index, 1);
await deleteContactInfo({ CUSTOMERCONTACT_ID });
const result = await deleteContactInfo({ CUSTOMERCONTACT_ID });
if (result.pd) {
ElMessage.warning("此联系人已在运单中存在,无法删除");
} else {
data.form.contacts.splice(index, 1);
ElMessage.success("删除成功");
}
}
};

View File

@ -108,8 +108,14 @@ const deleteItem = async (value) => {
await ElMessageBox.confirm(`确定要删除吗?`, {
type: "warning",
});
await deleteSafetyCustomerView({ CUSTOMERMANAGEMENT_ID: value });
ElMessage.success("删除成功");
const result = await deleteSafetyCustomerView({
CUSTOMERMANAGEMENT_ID: value,
});
if (result.pd) {
ElMessage.warning("当前客户下的联系人已被运单使用,无法删除");
} else {
ElMessage.success("删除成功");
}
fnGetData();
};
</script>

View File

@ -106,8 +106,14 @@ const deleteItem = async (value) => {
await ElMessageBox.confirm(`确定要删除吗?`, {
type: "warning",
});
await deleteSafetyLocationView({ LOCATIONMANAGEMENT_ID: value });
ElMessage.success("删除成功");
const result = await deleteSafetyLocationView({
LOCATIONMANAGEMENT_ID: value,
});
if (result.pd) {
ElMessage.warning("此地点已被运单使用,无法删除");
} else {
ElMessage.success("删除成功");
}
fnGetData();
};
</script>

View File

@ -58,7 +58,7 @@
</template>
</el-table-column>
<el-table-column prop="TRANSPORTVEHICLE" label="运输车辆" width="80" />
<el-table-column prop="NAME" label="从业人员" width="100" />
<el-table-column prop="NAME" label="从业人员" width="70" />
<el-table-column prop="CLIENT_NAME" label="委托方"> </el-table-column>
<el-table-column prop="CONFIRMER_NAME" label="确认方">
</el-table-column>
@ -67,8 +67,21 @@
</el-table-column>
<el-table-column prop="SHIPPINGDATE" label="承运日期" width="180">
</el-table-column>
<el-table-column label="操作" width="120">
<el-table-column label="操作" width="150">
<template #default="{ row }">
<el-button
type="primary"
text
link
@click="
router.push({
path: '/electronic_waybill_management/waybill_registration/view',
query: { WAYBILLREGISTRATION_ID: row.WAYBILLREGISTRATION_ID },
})
"
>
查看
</el-button>
<el-button
type="primary"
text
@ -83,6 +96,7 @@
修改
</el-button>
<el-button
v-if="row.WAYBILLSTATUS !== '1'"
type="danger"
text
link
@ -103,13 +117,6 @@
>
添加
</el-button>
<el-button
v-if="buttonJurisdiction.del"
type="danger"
@click="fnBatchDelete"
>
批量删除
</el-button>
</template>
</layout-table>
</layout-card>
@ -122,25 +129,16 @@ import useListData from "@/assets/js/useListData.js";
import { onMounted, ref } from "vue";
import { layoutFnGetNotificationsClassification } from "@/request/safety_production_related.js";
import {
dateteSecurityAllWaybillre,
deleteSafetyWaybillreView,
getSecurityWaybillreList,
} from "@/request/waybill_registration.js";
import { ElMessageBox, ElMessage } from "element-plus";
import { debounce } from "throttle-debounce";
import useButtonJurisdiction from "@/assets/js/useButtonJurisdiction.js";
import { useRouter } from "vue-router";
const router = useRouter();
const buttonJurisdiction = await useButtonJurisdiction("riskunit");
const tableRef = ref(null);
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
useListData(getSecurityWaybillreList);
const fnResetPaginationTransfer = () => {
fnResetPagination({
DEPTIDS: searchForm.value.DEPTIDS?.join(","),
});
};
//
const deleteItem = async (value) => {
await ElMessageBox.confirm(`确定要删除吗?`, {
@ -150,25 +148,6 @@ const deleteItem = async (value) => {
ElMessage.success("删除成功");
fnGetData();
};
const fnBatchDelete = debounce(
1000,
async () => {
// eslint-disable-next-line no-undef
const selectionData = tableRef.value.getSelectionRows();
if (selectionData.length === 0) {
ElMessage.warning("请选中要删除的项");
return;
}
await ElMessageBox.confirm("确定要删除选中的数据吗?", { type: "warning" });
const DATA_IDS = selectionData
.map((item) => item.WAYBILLREGISTRATION_ID)
.join(",");
await dateteSecurityAllWaybillre({ DATA_IDS });
ElMessage.success("删除成功");
fnResetPaginationTransfer();
},
{ atBegin: true }
);
const relatedClassificationList = ref(null);
onMounted(async () => {

View File

@ -0,0 +1,97 @@
<template>
<layout-card>
<div id="printContent">
<table class="archive_print_table">
<el-divider content-position="left">承运信息</el-divider>
<el-descriptions border>
<el-descriptions-item label="部门">
{{ data.info.DEPARTMENTNAME }}
</el-descriptions-item>
<el-descriptions-item label="调度人">
{{ data.nameList.join() }}
</el-descriptions-item>
<el-descriptions-item label="运单编号">
{{ data.info.WAYBILLNUMBER }}
</el-descriptions-item>
<el-descriptions-item label="承运日期">
{{ data.info.SHIPPINGDATE }}
</el-descriptions-item>
<el-descriptions-item label="运输车辆">
{{ data.info.TRANSPORTVEHICLE }}
</el-descriptions-item>
<el-descriptions-item label="从业人员">
{{ data.info.NAME }}
</el-descriptions-item>
<el-descriptions-item label="货运挂车">
{{ data.info.TRUCKCART }}
</el-descriptions-item>
</el-descriptions>
<el-divider content-position="left">客户信息</el-divider>
<el-descriptions border>
<el-descriptions-item label="委托方">
{{ data.info.CLIENT_NAME }}
</el-descriptions-item>
<el-descriptions-item label="联系人">
{{ data.info.ENTRUSTPERSON }}
</el-descriptions-item>
<el-descriptions-item label="联系电话">
{{ data.info.CLIENTCONTACTPHONE }}
</el-descriptions-item>
<el-descriptions-item label="确认方">
{{ data.info.CONFIRMER_NAME }}
</el-descriptions-item>
<el-descriptions-item label="联系人">
{{ data.info.CONFIRMPERSON }}
</el-descriptions-item>
<el-descriptions-item label="联系电话">
{{ data.info.CONFIRMINGPHONE }}
</el-descriptions-item>
</el-descriptions>
<el-divider content-position="left">地点信息</el-divider>
<el-descriptions border>
<el-descriptions-item label="起运地点">
{{ data.info.ORIGIN_NAME }}
</el-descriptions-item>
<el-descriptions-item label="起运地址">
{{ data.info.SHIPPINGADDRESS }}
</el-descriptions-item>
<el-descriptions-item label="行政区域">
{{ data.info.STARTADMINISTRATIVEAREA }}
</el-descriptions-item>
<el-descriptions-item label="目的地点">
{{ data.info.DESTINATION_NAME }}
</el-descriptions-item>
<el-descriptions-item label="目的地址">
{{ data.info.DESTINATIONADDRESS }}
</el-descriptions-item>
<el-descriptions-item label="行政区域">
{{ data.info.ENDDMINISTRATIVEAREA }}
</el-descriptions-item>
</el-descriptions>
</table>
</div>
</layout-card>
</template>
<script setup>
import { reactive } from "vue";
import { useRoute } from "vue-router";
import { getSafetyWaybillreInfo } from "@/request/waybill_registration.js";
const route = useRoute();
const { WAYBILLREGISTRATION_ID } = route.query;
const data = reactive({
info: {},
nameList: [],
});
const fnGetData = async () => {
const resData = await getSafetyWaybillreInfo({ WAYBILLREGISTRATION_ID });
data.info = resData.pd;
resData.pd.names.forEach((item) => {
data.nameList.push(item.NAME);
});
};
fnGetData();
</script>
<style scoped lang="scss"></style>