|
@@ -50,6 +50,7 @@
|
|
|
修改
|
|
|
</t-link>
|
|
|
<t-link
|
|
|
+ :disabled="!row.bandSupplier"
|
|
|
theme="primary"
|
|
|
hover="color"
|
|
|
@click="handleBindSupplier(row)"
|
|
@@ -87,6 +88,7 @@
|
|
|
v-model:visible="showBindSupplierDialog"
|
|
|
:curRow="curRow"
|
|
|
@success="bindSupplierSuccess"
|
|
|
+ :options="canBindSupplierList"
|
|
|
>
|
|
|
</BindSupplierDialog>
|
|
|
</div>
|
|
@@ -94,7 +96,7 @@
|
|
|
|
|
|
<script setup name="User">
|
|
|
import { ref } from 'vue';
|
|
|
-import { getUserList, initUserPassword } from '@/api/user';
|
|
|
+import { getUserList, initUserPassword, getSupplierByUser } from '@/api/user';
|
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
|
import AddUserDialog from './add-user-dialog.vue';
|
|
|
import UpdateUserPwdDialog from './update-user-pwd-dialog.vue';
|
|
@@ -107,7 +109,7 @@ const { perm } = usePermission();
|
|
|
const showAddUserDialog = ref(false);
|
|
|
const showUpdateUserPwdDialog = ref(false);
|
|
|
const curRow = ref(null);
|
|
|
-
|
|
|
+const canBindSupplierList = ref([]);
|
|
|
const columns = [
|
|
|
{ colKey: 'loginName', title: '登录名', width: 140 },
|
|
|
{ colKey: 'realName', title: '姓名', minWidth: 90 },
|
|
@@ -144,6 +146,13 @@ const handleEdit = (row) => {
|
|
|
const showBindSupplierDialog = ref(false);
|
|
|
const handleBindSupplier = (row) => {
|
|
|
curRow.value = row;
|
|
|
+ getSupplierByUser({ id: row.id })
|
|
|
+ .then((res) => {
|
|
|
+ canBindSupplierList.value = res;
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ canBindSupplierList.value = [];
|
|
|
+ });
|
|
|
showBindSupplierDialog.value = true;
|
|
|
};
|
|
|
const handleEnable = (row) => {
|
|
@@ -197,6 +206,7 @@ const updatePwdSuccess = () => {
|
|
|
};
|
|
|
|
|
|
const bindSupplierSuccess = () => {
|
|
|
+ showBindSupplierDialog.value = false;
|
|
|
MessagePlugin.success('绑定成功');
|
|
|
};
|
|
|
</script>
|