|
@@ -17,6 +17,8 @@
|
|
|
<div class="show-input">{{ contactName }}</div>
|
|
<div class="show-input">{{ contactName }}</div>
|
|
|
<div class="normal-label">联系人手机号</div>
|
|
<div class="normal-label">联系人手机号</div>
|
|
|
<div class="show-input">{{ contactPhone }}</div>
|
|
<div class="show-input">{{ contactPhone }}</div>
|
|
|
|
|
+ <div class="normal-label">联系人邮箱</div>
|
|
|
|
|
+ <div class="show-input">{{ contactEmail }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="df aic mt20">
|
|
<div class="df aic mt20">
|
|
|
<div class="normal-label">过期时间</div>
|
|
<div class="normal-label">过期时间</div>
|
|
@@ -28,12 +30,10 @@
|
|
|
value-format="YYYY/MM/DD"
|
|
value-format="YYYY/MM/DD"
|
|
|
placeholder="过期时间"
|
|
placeholder="过期时间"
|
|
|
:disabled="!expiredTimeEditable"
|
|
:disabled="!expiredTimeEditable"
|
|
|
- size="small"
|
|
|
|
|
></el-date-picker>
|
|
></el-date-picker>
|
|
|
<el-button
|
|
<el-button
|
|
|
v-if="!expiredTimeEditable"
|
|
v-if="!expiredTimeEditable"
|
|
|
@click="editExpiredTime"
|
|
@click="editExpiredTime"
|
|
|
- size="mini"
|
|
|
|
|
type="primary"
|
|
type="primary"
|
|
|
>
|
|
>
|
|
|
修改
|
|
修改
|
|
@@ -41,16 +41,11 @@
|
|
|
<el-button
|
|
<el-button
|
|
|
v-if="expiredTimeEditable"
|
|
v-if="expiredTimeEditable"
|
|
|
@click="submitExpiredTime"
|
|
@click="submitExpiredTime"
|
|
|
- size="mini"
|
|
|
|
|
type="primary"
|
|
type="primary"
|
|
|
>
|
|
>
|
|
|
提交
|
|
提交
|
|
|
</el-button>
|
|
</el-button>
|
|
|
- <el-button
|
|
|
|
|
- v-if="expiredTimeEditable"
|
|
|
|
|
- @click="cancelExpiredTime"
|
|
|
|
|
- size="mini"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-button v-if="expiredTimeEditable" @click="cancelExpiredTime">
|
|
|
取消
|
|
取消
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -66,13 +61,19 @@
|
|
|
clearable
|
|
clearable
|
|
|
style="height: 32px; width: 330px; line-height: 32px"
|
|
style="height: 32px; width: 330px; line-height: 32px"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
- <div class="seach-btn" @click="getAgencySubAccountList(1)">查询</div>
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ class="ml20"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="getAgencySubAccountList(1)"
|
|
|
|
|
+ >
|
|
|
|
|
+ 查询
|
|
|
|
|
+ </el-button>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="cargo-owner-add" @click="dialogFormVisible = true">
|
|
|
|
|
|
|
+ <el-button class="ml20" type="primary" @click="dialogFormVisible = true">
|
|
|
添加代理子账户
|
|
添加代理子账户
|
|
|
- </div>
|
|
|
|
|
|
|
+ </el-button>
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
- title="添加代理子账户"
|
|
|
|
|
|
|
+ :title="ruleForm.id ? '编辑代理子账户' : '添加代理子账户'"
|
|
|
v-model="dialogFormVisible"
|
|
v-model="dialogFormVisible"
|
|
|
@closed="resetForm"
|
|
@closed="resetForm"
|
|
|
>
|
|
>
|
|
@@ -80,7 +81,7 @@
|
|
|
<el-form
|
|
<el-form
|
|
|
:model="ruleForm"
|
|
:model="ruleForm"
|
|
|
:rules="rules"
|
|
:rules="rules"
|
|
|
- ref="form"
|
|
|
|
|
|
|
+ ref="ruleFormRef"
|
|
|
label-width="110px"
|
|
label-width="110px"
|
|
|
label-position="left"
|
|
label-position="left"
|
|
|
>
|
|
>
|
|
@@ -90,20 +91,26 @@
|
|
|
v-model="ruleForm.userName"
|
|
v-model="ruleForm.userName"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item prop="phone" label="手机号">
|
|
|
|
|
|
|
+ <el-form-item prop="phone" label="手机号" v-if="!ruleForm.id">
|
|
|
<el-input
|
|
<el-input
|
|
|
style="width: 280px"
|
|
style="width: 280px"
|
|
|
v-model="ruleForm.phone"
|
|
v-model="ruleForm.phone"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item prop="password" label="密码">
|
|
|
|
|
|
|
+ <el-form-item prop="email" label="邮箱">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ style="width: 280px"
|
|
|
|
|
+ v-model="ruleForm.email"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item prop="password" label="密码" v-if="!ruleForm.id">
|
|
|
<el-input
|
|
<el-input
|
|
|
style="width: 280px"
|
|
style="width: 280px"
|
|
|
v-model="ruleForm.password"
|
|
v-model="ruleForm.password"
|
|
|
placeholder="(不填自动生成)"
|
|
placeholder="(不填自动生成)"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item prop="isAdmin" label="管理员">
|
|
|
|
|
|
|
+ <el-form-item prop="isAdmin" label="管理员" v-if="!ruleForm.id">
|
|
|
<el-select v-model="ruleForm.isAdmin" placeholder="是否管理员">
|
|
<el-select v-model="ruleForm.isAdmin" placeholder="是否管理员">
|
|
|
<el-option label="否" value="0" />
|
|
<el-option label="否" value="0" />
|
|
|
<el-option label="是" value="1" />
|
|
<el-option label="是" value="1" />
|
|
@@ -114,9 +121,20 @@
|
|
|
<template v-slot:footer>
|
|
<template v-slot:footer>
|
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
|
<el-button @click="resetForm">取 消</el-button>
|
|
<el-button @click="resetForm">取 消</el-button>
|
|
|
- <el-button type="primary" @click="addAgencySubAccount(ruleForm)">
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="!ruleForm.id"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="addAgencySubAccount(ruleForm)"
|
|
|
|
|
+ >
|
|
|
确 定
|
|
确 定
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-else
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="editAgencySubAccount(ruleForm)"
|
|
|
|
|
+ >
|
|
|
|
|
+ 修改
|
|
|
|
|
+ </el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -142,8 +160,8 @@
|
|
|
align="center"
|
|
align="center"
|
|
|
></el-table-column>
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
- prop="password"
|
|
|
|
|
- label="密码"
|
|
|
|
|
|
|
+ prop="email"
|
|
|
|
|
+ label="邮箱"
|
|
|
min-width="160"
|
|
min-width="160"
|
|
|
align="center"
|
|
align="center"
|
|
|
></el-table-column>
|
|
></el-table-column>
|
|
@@ -168,6 +186,13 @@
|
|
|
{{ scope.row.roleName || "暂无职位" }}
|
|
{{ scope.row.roleName || "暂无职位" }}
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column label="操作" min-width="160" align="center">
|
|
|
|
|
+ <template v-slot="scope">
|
|
|
|
|
+ <el-button type="primary" size="small" @click="showEdit(scope.row)">
|
|
|
|
|
+ 编辑
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
<div style="width: 100%; text-align: right; margin-top: 43px">
|
|
<div style="width: 100%; text-align: right; margin-top: 43px">
|
|
|
<el-pagination
|
|
<el-pagination
|
|
@@ -191,13 +216,17 @@
|
|
|
clearable
|
|
clearable
|
|
|
style="width: 330px"
|
|
style="width: 330px"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
- <div class="seach-btn" @click="getCargoOwnerCompanyByAgencyCompany(1)">
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ class="ml20"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="getCargoOwnerCompanyByAgencyCompany(1)"
|
|
|
|
|
+ >
|
|
|
查询
|
|
查询
|
|
|
- </div>
|
|
|
|
|
|
|
+ </el-button>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="cargo-owner-add" @click="dialogFormVisible2 = true">
|
|
|
|
|
|
|
+ <el-button class="ml20" type="primary" @click="dialogFormVisible2 = true">
|
|
|
关联货主公司
|
|
关联货主公司
|
|
|
- </div>
|
|
|
|
|
|
|
+ </el-button>
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
title="关联货主公司"
|
|
title="关联货主公司"
|
|
|
v-model="dialogFormVisible2"
|
|
v-model="dialogFormVisible2"
|
|
@@ -258,6 +287,12 @@
|
|
|
min-width="160"
|
|
min-width="160"
|
|
|
align="center"
|
|
align="center"
|
|
|
></el-table-column>
|
|
></el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="contactEmail"
|
|
|
|
|
+ label="联系人邮箱"
|
|
|
|
|
+ min-width="160"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="copId"
|
|
prop="copId"
|
|
|
label="操作"
|
|
label="操作"
|
|
@@ -289,7 +324,12 @@
|
|
|
</template>
|
|
</template>
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import { ref, h, reactive, toRefs, onMounted } from "vue";
|
|
import { ref, h, reactive, toRefs, onMounted } from "vue";
|
|
|
-import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ ElNotification,
|
|
|
|
|
+ ElMessageBox,
|
|
|
|
|
+ ElMessage,
|
|
|
|
|
+ ElLoading,
|
|
|
|
|
+} from "element-plus";
|
|
|
import store from "../../store";
|
|
import store from "../../store";
|
|
|
import router from "../../router";
|
|
import router from "../../router";
|
|
|
import { useRoute } from "vue-router";
|
|
import { useRoute } from "vue-router";
|
|
@@ -298,16 +338,17 @@ import { subTimeStr } from "../../utils/utils";
|
|
|
|
|
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
let dialogFormVisible = ref(false);
|
|
let dialogFormVisible = ref(false);
|
|
|
-let form = ref(null);
|
|
|
|
|
|
|
+let ruleFormRef = ref(null);
|
|
|
let ruleForm = ref({
|
|
let ruleForm = ref({
|
|
|
userName: "",
|
|
userName: "",
|
|
|
phone: "",
|
|
phone: "",
|
|
|
|
|
+ email: "",
|
|
|
password: "",
|
|
password: "",
|
|
|
isAdmin: "",
|
|
isAdmin: "",
|
|
|
});
|
|
});
|
|
|
async function resetForm() {
|
|
async function resetForm() {
|
|
|
dialogFormVisible.value = false;
|
|
dialogFormVisible.value = false;
|
|
|
- form.value.resetFields();
|
|
|
|
|
|
|
+ ruleForm.value = {};
|
|
|
}
|
|
}
|
|
|
const rules = ref({
|
|
const rules = ref({
|
|
|
userName: [
|
|
userName: [
|
|
@@ -317,19 +358,26 @@ const rules = ref({
|
|
|
{ required: true, message: "请填写手机号", trigger: "blur" },
|
|
{ required: true, message: "请填写手机号", trigger: "blur" },
|
|
|
{ min: 11, max: 11, message: "请正确填写手机号", trigger: "blur" },
|
|
{ min: 11, max: 11, message: "请正确填写手机号", trigger: "blur" },
|
|
|
],
|
|
],
|
|
|
|
|
+ email: [{ required: true, message: "请填写邮箱", trigger: "blur" }],
|
|
|
});
|
|
});
|
|
|
async function addAgencySubAccount() {
|
|
async function addAgencySubAccount() {
|
|
|
- form.value.validate(async (valid) => {
|
|
|
|
|
|
|
+ ruleFormRef.value.validate(async (valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
- let { userName, phone, password, isAdmin } = ruleForm.value;
|
|
|
|
|
|
|
+ let { userName, phone, email, password, isAdmin } = ruleForm.value;
|
|
|
|
|
+ const loading = ElLoading.service({
|
|
|
|
|
+ lock: true,
|
|
|
|
|
+ text: "正在提交...",
|
|
|
|
|
+ background: "rgba(0, 0, 0, 0.7)",
|
|
|
|
|
+ });
|
|
|
let res = await api.addAgencySubAccount({
|
|
let res = await api.addAgencySubAccount({
|
|
|
proxyId: route.query.id,
|
|
proxyId: route.query.id,
|
|
|
userName,
|
|
userName,
|
|
|
phone,
|
|
phone,
|
|
|
|
|
+ email,
|
|
|
password,
|
|
password,
|
|
|
isAdmin,
|
|
isAdmin,
|
|
|
});
|
|
});
|
|
|
- console.log(res);
|
|
|
|
|
|
|
+ loading.close();
|
|
|
if (res.data.status == 0) {
|
|
if (res.data.status == 0) {
|
|
|
ElNotification.success({
|
|
ElNotification.success({
|
|
|
title: "添加成功",
|
|
title: "添加成功",
|
|
@@ -351,6 +399,44 @@ async function addAgencySubAccount() {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+function editAgencySubAccount() {
|
|
|
|
|
+ ruleFormRef.value.validate(async (valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ let { id: proxyLoginAccountId, userName, email } = ruleForm.value;
|
|
|
|
|
+ const loading = ElLoading.service({
|
|
|
|
|
+ lock: true,
|
|
|
|
|
+ text: "正在提交...",
|
|
|
|
|
+ background: "rgba(0, 0, 0, 0.7)",
|
|
|
|
|
+ });
|
|
|
|
|
+ let res = await api.editAgencySubAccount({
|
|
|
|
|
+ proxyId: route.query.id,
|
|
|
|
|
+ proxyLoginAccountId,
|
|
|
|
|
+ userName,
|
|
|
|
|
+ email,
|
|
|
|
|
+ });
|
|
|
|
|
+ loading.close();
|
|
|
|
|
+ if (res.data.status == 0) {
|
|
|
|
|
+ ElNotification.success({
|
|
|
|
|
+ title: "修改成功",
|
|
|
|
|
+ duration: 0,
|
|
|
|
|
+ message: `${userName}:${res.data.msg}`,
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ });
|
|
|
|
|
+ resetForm();
|
|
|
|
|
+ getAgencySubAccountList();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElNotification.error({
|
|
|
|
|
+ title: "失败",
|
|
|
|
|
+ duration: 3000,
|
|
|
|
|
+ message: res.data.msg,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
let currentPage = ref(1);
|
|
let currentPage = ref(1);
|
|
|
let term = ref("");
|
|
let term = ref("");
|
|
|
let tableData = ref([]);
|
|
let tableData = ref([]);
|
|
@@ -379,6 +465,7 @@ function pageChange(e) {
|
|
|
let proxyName = ref();
|
|
let proxyName = ref();
|
|
|
let contactName = ref();
|
|
let contactName = ref();
|
|
|
let contactPhone = ref();
|
|
let contactPhone = ref();
|
|
|
|
|
+let contactEmail = ref();
|
|
|
async function getAgencyCompanyDetail() {
|
|
async function getAgencyCompanyDetail() {
|
|
|
let res = await api.getAgencyCompanyDetail({
|
|
let res = await api.getAgencyCompanyDetail({
|
|
|
proxyId: route.query.id,
|
|
proxyId: route.query.id,
|
|
@@ -387,6 +474,7 @@ async function getAgencyCompanyDetail() {
|
|
|
proxyName.value = res.data.result.proxyName;
|
|
proxyName.value = res.data.result.proxyName;
|
|
|
contactName.value = res.data.result.contactName;
|
|
contactName.value = res.data.result.contactName;
|
|
|
contactPhone.value = res.data.result.contactPhone;
|
|
contactPhone.value = res.data.result.contactPhone;
|
|
|
|
|
+ contactEmail.value = res.data.result.contactEmail;
|
|
|
expiredTime.value = res.data.result.expiredTime;
|
|
expiredTime.value = res.data.result.expiredTime;
|
|
|
} else {
|
|
} else {
|
|
|
console.log(res);
|
|
console.log(res);
|
|
@@ -523,6 +611,13 @@ function cancelExpiredTime() {
|
|
|
expiredTimeEditable.value = false;
|
|
expiredTimeEditable.value = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+function showEdit(row) {
|
|
|
|
|
+ dialogFormVisible.value = true;
|
|
|
|
|
+ ruleForm.value = {
|
|
|
|
|
+ ...row,
|
|
|
|
|
+ };
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
getAgencyCompanyDetail();
|
|
getAgencyCompanyDetail();
|
|
|
getCargoOwnerCompanyByAgencyCompany();
|
|
getCargoOwnerCompanyByAgencyCompany();
|