|
@@ -8,6 +8,7 @@ import { h, onMounted, ref } from 'vue';
|
|
|
|
|
|
|
|
import { Page, useVbenModal } from '@vben/common-ui';
|
|
import { Page, useVbenModal } from '@vben/common-ui';
|
|
|
import { MdiCheckboxMultipleMarked, MdiDetail } from '@vben/icons';
|
|
import { MdiCheckboxMultipleMarked, MdiDetail } from '@vben/icons';
|
|
|
|
|
+import { useUserStore } from '@vben/stores';
|
|
|
|
|
|
|
|
// import { ElMessage, ElMessageBox, ElTag } from 'element-plus';
|
|
// import { ElMessage, ElMessageBox, ElTag } from 'element-plus';
|
|
|
import { ElTag } from 'element-plus';
|
|
import { ElTag } from 'element-plus';
|
|
@@ -22,6 +23,7 @@ import OrdersAuditForm from './audit-form.vue';
|
|
|
import OrdersForm from './form.vue';
|
|
import OrdersForm from './form.vue';
|
|
|
|
|
|
|
|
const dealerOptions = ref<Array<{ label: string; value: string }>>([]);
|
|
const dealerOptions = ref<Array<{ label: string; value: string }>>([]);
|
|
|
|
|
+const userStore = useUserStore();
|
|
|
|
|
|
|
|
const fetchDealerOptions = async () => {
|
|
const fetchDealerOptions = async () => {
|
|
|
try {
|
|
try {
|
|
@@ -76,11 +78,17 @@ const formOptions: VbenFormProps = {
|
|
|
component: 'Select',
|
|
component: 'Select',
|
|
|
fieldName: 'ordersuserid1',
|
|
fieldName: 'ordersuserid1',
|
|
|
label: '经销商',
|
|
label: '经销商',
|
|
|
|
|
+ // 如果是代理商,设置默认值为当前用户的workeruserid
|
|
|
|
|
+ defaultValue: userStore.isDLS
|
|
|
|
|
+ ? userStore.userInfo?.workeruserid
|
|
|
|
|
+ : undefined,
|
|
|
componentProps: {
|
|
componentProps: {
|
|
|
options: dealerOptions,
|
|
options: dealerOptions,
|
|
|
placeholder: $t('ui.placeholder.select'),
|
|
placeholder: $t('ui.placeholder.select'),
|
|
|
allowClear: true,
|
|
allowClear: true,
|
|
|
filterable: true,
|
|
filterable: true,
|
|
|
|
|
+ // 如果是代理商,禁用该字段
|
|
|
|
|
+ disabled: userStore.isDLS,
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -305,6 +313,7 @@ function handleAudit(row: any) {
|
|
|
effect="dark"
|
|
effect="dark"
|
|
|
content="审核"
|
|
content="审核"
|
|
|
placement="top"
|
|
placement="top"
|
|
|
|
|
+ v-if="!userStore.isDLS"
|
|
|
>
|
|
>
|
|
|
<el-button
|
|
<el-button
|
|
|
round
|
|
round
|