|
@@ -12,6 +12,13 @@
|
|
|
import { ref, onMounted, computed, watch } from 'vue';
|
|
|
import { request } from '@/utils/request.js';
|
|
|
|
|
|
+const API_TYPE1_IDS = [
|
|
|
+ 'region_coordinator_id_1',
|
|
|
+ 'engineer_users_id_1',
|
|
|
+ 'project_manager_id_1',
|
|
|
+ 'region_manager_id_1',
|
|
|
+];
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
config: { type: Object },
|
|
|
modelValue: { type: [String, Array] },
|
|
@@ -27,8 +34,10 @@ const isMultiple = computed(() => {
|
|
|
const options = ref([]);
|
|
|
const getOptionsApi = () => {
|
|
|
let dataGrid = props.config?.dataGrid;
|
|
|
- if (props.config?.formId === 'engineer_users_id_1') {
|
|
|
+ if (API_TYPE1_IDS.includes(props.config?.formId)) {
|
|
|
+ // if (props.config?.formId === '') {
|
|
|
dataGrid = dataGrid.replace('#{id}', props.sop?.crmDetailId);
|
|
|
+ console.log('dataGrid', dataGrid);
|
|
|
}
|
|
|
return request({
|
|
|
url: dataGrid,
|
|
@@ -49,7 +58,7 @@ const getOptions = async () => {
|
|
|
const data = await getOptionsApi();
|
|
|
console.log('data', data);
|
|
|
options.value = data || [];
|
|
|
- if (props.config?.formId === 'engineer_users_id_1') {
|
|
|
+ if (API_TYPE1_IDS.includes(props.config?.formId)) {
|
|
|
options.value = options.value.map((item) => {
|
|
|
return {
|
|
|
label: `${item.name}(${item.archivesRoleName})_${item.supplierName}_${item.mobileNumber}`,
|