merge
This commit is contained in:
@@ -168,6 +168,14 @@ export const queryProductionLineApi = (params: any) => {
|
||||
export const queryProjectPdtApi = (params: any) => {
|
||||
return get(`${PREFIX}node/queryProjectPdt`, params);
|
||||
};
|
||||
/**
|
||||
* queryType: 区分人员状态的标识,为空:代表查询所有状态的人员,0:存在, 1:删除 , 2:冻结
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export const queryProjectMemberApi = (params: any) => {
|
||||
return get(`${PREFIX}node/queryProjectMember`, params);
|
||||
};
|
||||
|
||||
export const queryProjectBatchApi = (params: any) => {
|
||||
return get(`${PREFIX}node/queryProjectBatch`, params);
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
showIndex
|
||||
tableName="PDT_INFO_LYRIC"
|
||||
ref="tableRef"
|
||||
:params="{ projectId: nodeId }"
|
||||
:api="queryProjectPdtApi"
|
||||
:params="params"
|
||||
:api="queryProjectMemberApi"
|
||||
>
|
||||
</BaseTable>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { watch } from 'vue';
|
||||
import { computed, watch } from 'vue';
|
||||
import BaseTable from '@/components/common/table/baseTable.vue';
|
||||
import { queryProjectPdtApi } from '@/api/project/node';
|
||||
import { queryProjectMemberApi } from '@/api/project/node';
|
||||
|
||||
const props = defineProps({
|
||||
nodeId: {
|
||||
@@ -21,6 +21,12 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const params = computed(() => {
|
||||
return {
|
||||
projectId: props.nodeId,
|
||||
};
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.nodeId,
|
||||
() => {},
|
||||
|
||||
@@ -74,10 +74,11 @@ const deptOptions = ref<any[]>([]);
|
||||
const getListDept = async () => {
|
||||
const res: any = await listDeptApi({ current: 1, size: 999 });
|
||||
if (res.code === 200) {
|
||||
deptOptions.value = res.data.data.map((item: { deptName: any; userId: any }) => {
|
||||
deptOptions.value = res.data.data.map((item: any) => {
|
||||
return {
|
||||
label: item.deptName,
|
||||
value: String(item.userId),
|
||||
userName: item.userResp.nickname,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,12 +18,6 @@
|
||||
<el-form-item label="审批模板:" prop="approve">
|
||||
<ApproveList v-model="approveForm.approve" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="更新模式:" v-if="operationType !== FLOW_OPERATION_TYPE.UPGRADE">
|
||||
<el-radio-group v-model="approveForm.updateMode">
|
||||
<el-radio value="update" size="large">更新草稿</el-radio>
|
||||
<el-radio value="upgrade" size="large">升版草稿</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="升级方式:" v-if="approveForm.updateMode === 'upgrade'">
|
||||
<el-radio-group v-model="approveForm.versionType">
|
||||
<el-radio value="1" size="large">大版本</el-radio>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<el-option
|
||||
v-for="item in deptOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:label="item.label + '(' + item.userName + ')'"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
@@ -90,7 +90,6 @@ import { getMemberListIds } from '@/utils/task';
|
||||
import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant';
|
||||
import { syncDemandList } from '../taskPage';
|
||||
import { getChildrenNodeListApi } from '@/api/project/node';
|
||||
import type { Options } from '@/types';
|
||||
import { listDeptApi } from '@/api/system/departMent';
|
||||
import { uploadBigFile } from '@/utils/file';
|
||||
// import emitter from '@/utils/eventBus';
|
||||
@@ -104,7 +103,7 @@ defineProps({
|
||||
default: () => [],
|
||||
},
|
||||
deptOptions: {
|
||||
type: Array<Options>,
|
||||
type: Array<any>,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
@@ -440,6 +439,8 @@ const oldAttachments = ref<any[]>([]);
|
||||
|
||||
const formHideKeys = ref<any[]>(['materialNo']);
|
||||
|
||||
const currentProjectUndertaker = ref('');
|
||||
|
||||
const changeFun = async (val: any, type: string) => {
|
||||
const formData = tableFormRef.value.getFormDataFun();
|
||||
// editFormInfo.value = { ...formData };
|
||||
@@ -451,19 +452,15 @@ const changeFun = async (val: any, type: string) => {
|
||||
nodeType = NODE_TYPE.PHASE;
|
||||
nextKey = 'phaseId';
|
||||
nodeId = val.data.projectId;
|
||||
let pMemberId = '';
|
||||
currentProjectUndertaker.value = '';
|
||||
for (let index = 0; index < val.val.extras.length; index++) {
|
||||
if (val.val.extras[index]?.propertyName === 'projectUndertaker') {
|
||||
const deptList = await listDeptApi({ current: 1, size: 999 });
|
||||
const dept = deptList.data.data.find((item: any) => {
|
||||
return item.deptName === val.val.extras[index].propertyValue;
|
||||
});
|
||||
if (dept) {
|
||||
pMemberId = dept.userId;
|
||||
}
|
||||
currentProjectUndertaker.value = val.val.extras[index].propertyValue;
|
||||
}
|
||||
}
|
||||
formData.pMemberList = pMemberId;
|
||||
if (formData.simType) {
|
||||
formData.pMemberList = await disposeDeptMember();
|
||||
}
|
||||
}
|
||||
if (nodeId) {
|
||||
const optionList = await getPhaseList(nodeType, nodeId);
|
||||
@@ -535,6 +532,12 @@ const changeFun = async (val: any, type: string) => {
|
||||
}
|
||||
editFormInfo.value = { ...formData };
|
||||
}
|
||||
if (val.key === 'simType') {
|
||||
if (formData.projectId) {
|
||||
formData.pMemberList = await disposeDeptMember();
|
||||
}
|
||||
}
|
||||
|
||||
if (val.key === 'isMoldMaking') {
|
||||
if (val.val?.value === 'Y') {
|
||||
formHideKeys.value = [];
|
||||
@@ -545,6 +548,31 @@ const changeFun = async (val: any, type: string) => {
|
||||
emits('changeForm', { val, type });
|
||||
};
|
||||
|
||||
const deptList = ref<any[]>([]);
|
||||
const disposeDeptMember = async () => {
|
||||
let pMemberId = '';
|
||||
if (deptList.value.length === 0) {
|
||||
const res = await listDeptApi({ current: 1, size: 999 });
|
||||
deptList.value = res.data.data;
|
||||
}
|
||||
const matchingDeptList = deptList.value.filter((item: any) => {
|
||||
return item.deptName.indexOf(currentProjectUndertaker.value) !== -1;
|
||||
});
|
||||
if (matchingDeptList.length > 0) {
|
||||
if (matchingDeptList.length === 1) {
|
||||
pMemberId = matchingDeptList[0].userId;
|
||||
} else {
|
||||
const machDept = matchingDeptList.find((item: any) => {
|
||||
return item.deptName.indexOf(editFormInfo.value.simType) !== -1;
|
||||
});
|
||||
if (machDept) {
|
||||
pMemberId = machDept.userId;
|
||||
}
|
||||
}
|
||||
}
|
||||
return pMemberId;
|
||||
};
|
||||
|
||||
const setWorkSpaceValue = (extras: any, workspace: string, workspaceName: string) => {
|
||||
return extras.map((item: any) => {
|
||||
if (item.propertyName === NODE_TYPE.WORKSPACE) {
|
||||
|
||||
Reference in New Issue
Block a user