|
@@ -38,13 +38,15 @@
|
|
|
<span> {{ relationObj.username }}</span>
|
|
|
</div>
|
|
|
</div> -->
|
|
|
+ <van-field v-model="relationObj.relationUsername" name="password" :label="$t('merchantManage.relationAdmin')"
|
|
|
+ :placeholder="$t('merchantManage.relationAdminPlaceholder')" />
|
|
|
<van-field v-model="adminObj.name" name="password" :label="$t('merchantManage.fullNameLabel')"
|
|
|
:placeholder="$t('merchantManage.fullNamePlaceholder')"
|
|
|
:rules="[{ required: true, message: $t('merchantManage.fullNamePlaceholder') }]" />
|
|
|
- <van-field v-model="adminObj.password" name="password" type="password"
|
|
|
+ <van-field v-model="adminObj.password" name="password" type="password" clearable
|
|
|
:label="$t('merchantManage.passwordLabel')" :placeholder="$t('merchantManage.passwordPlaceholder')" />
|
|
|
<span class="txt3">{{ $t('merchantManage.leavBlanToIndiNoModi') }}</span>
|
|
|
- <van-field v-model="adminObj.checkPassword" name="password" type="password"
|
|
|
+ <van-field v-model="adminObj.checkPassword" name="password" type="password" clearable
|
|
|
:label="$t('merchantManage.confirmPasswordLabel')"
|
|
|
:placeholder="$t('merchantManage.confirmPasswordPlaceholder')" />
|
|
|
<van-field v-model="adminObj.email" name="password" :label="$t('merchantManage.mailbox')"
|
|
@@ -141,7 +143,7 @@
|
|
|
<script>
|
|
|
import { onMounted, ref } from "vue";
|
|
|
import sHeader from "@/components/SimpleHeader";
|
|
|
-import { getAdmin, getAdminMch, updateAdmin, getHuifuMch } from "@/service/merchantManage";
|
|
|
+import { getAdmin, getRelation, getAdminMch, updateAdmin, getHuifuMch, getRelationAdminId } from "@/service/merchantManage";
|
|
|
import { showFailToast, showSuccessToast } from "vant";
|
|
|
import { useRoute } from "vue-router";
|
|
|
import { getLoginUser, styleUrl } from "@/common/js/utils";
|
|
@@ -158,7 +160,7 @@ export default {
|
|
|
const route = useRoute();
|
|
|
const merchantId = ref('');
|
|
|
const adminObj = ref({});
|
|
|
- // const relationObj = ref({});
|
|
|
+ const relationObj = ref({});
|
|
|
const adminMchObj = ref({});
|
|
|
const huifuMchObj = ref({});
|
|
|
const ifForeign = ref('0');
|
|
@@ -169,7 +171,7 @@ export default {
|
|
|
styleUrl('merchantManage');
|
|
|
merchantId.value = route.query.merchantId;
|
|
|
getAdminFun();
|
|
|
- // getRelationFun();
|
|
|
+ getRelationFun();
|
|
|
getAdminMchFun();
|
|
|
getHuifuMchFun();
|
|
|
|
|
@@ -191,18 +193,15 @@ export default {
|
|
|
// else { showFailToast(data.message); }
|
|
|
// console.log('getAdminFun', data);
|
|
|
};
|
|
|
- // const getRelationFun = async () => {
|
|
|
- // console.log('adminId', merchantId.value);
|
|
|
- // const { data } = await getRelation({ adminId: merchantId.value });
|
|
|
- // console.log("relationObj.value", relationObj.value);
|
|
|
- // console.log("relationObj.value.username", relationObj.value.username);
|
|
|
- // if (data.code === "00000") {
|
|
|
- // if (data.data != null) {
|
|
|
- // relationObj.value = data.data;
|
|
|
- // relationObj.value.username = data.data.username;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
+ const getRelationFun = async () => {
|
|
|
+ const { data } = await getRelation({ adminId: merchantId.value });
|
|
|
+ if (data.code === "00000") {
|
|
|
+ if (data.data != null) {
|
|
|
+ relationObj.value = data.data;
|
|
|
+ relationObj.value.relationUsername = data.data.username;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
const getAdminMchFun = async () => {
|
|
|
const { data } = await getAdminMch({ id: merchantId.value });
|
|
|
if (data.code === "00000") {
|
|
@@ -246,10 +245,18 @@ export default {
|
|
|
// console.log('getHuifuMchFun', data);
|
|
|
}
|
|
|
const onSubmit = async () => {
|
|
|
+ // console.log("relationUsername:", relationObj.value.relationUsername);
|
|
|
+ const { result } = await getRelationAdminId({ relationUsername: relationObj.value.relationUsername });
|
|
|
+ if (result.code === "00000") {
|
|
|
+ if (result.data != null) {
|
|
|
+ adminObj.value.relationAdminId = result.data;
|
|
|
+ }
|
|
|
+ }
|
|
|
const params = {
|
|
|
id: adminObj.value.id,
|
|
|
name: adminObj.value.name,
|
|
|
username: adminObj.value.username,
|
|
|
+ relationAdminId: adminObj.value.relationAdminId,
|
|
|
ifForeign: adminObj.value.ifForeign,
|
|
|
phone: adminObj.value.phone,
|
|
|
email: adminObj.value.email,
|
|
@@ -283,7 +290,7 @@ export default {
|
|
|
tabType,
|
|
|
adminType,
|
|
|
adminObj,
|
|
|
- // relationObj,
|
|
|
+ relationObj,
|
|
|
adminMchObj,
|
|
|
huifuMchObj,
|
|
|
onSubmit,
|