Merge branch 'zcwy_0827_pingcode817' into dev_master

# Conflicts:
#	src/components/project/ProjectNumber.vue
#	src/views/projectcenter/ProjectAdd.vue
This commit is contained in:
nisen
2024-09-24 17:41:06 +08:00
2 changed files with 79 additions and 1 deletions

View File

@@ -0,0 +1,46 @@
<template>
<a-select
:getPopupContainer="
(triggerNode) => {
return triggerNode.parentNode || document.body;
}
"
v-model:value="numValue"
style="width: 100%;"
placeholder="请选择项目编号"
:options="options"
showSearch
allowClear
@change="handleChange"
>
</a-select>
</template>
<script setup>
import {computed, defineEmits, defineProps, onMounted, ref, watch} from 'vue';
import { useStore } from "vuex";
const props = defineProps({
value: String,
})
const emit = defineEmits(['update:value'])
const store = useStore();
const numValue = computed(()=>store.state.project_number.find(item=>item.value == props.value)?.name || null)
const handleChange = (value,option)=>{
emit('update:value',value || '')
}
onMounted(() => {
// console.log(store.state.project_number,'store.state.project_number')
});
const options = computed(()=>store.state.project_number.map(e => {
return{
value: e.value,
label: ' 【 ' + e.value + ' 】 ' + e.name
}
}))
</script>
<style lang="scss" scoped>
::v-deep .ant-select-selector{
border-radius: 8px !important;
}
</style>

View File

@@ -147,6 +147,13 @@
<a-radio :style="radioStyle" :value="0"></a-radio>
</a-radio-group>
</div>
<div class="num" v-if="projectInfo.boeFlag === 1">
<div class="num_text">项目编号</div>
<div class="num_input">
<!-- <a-input style="border-radius: 8px;" show-count allowClear maxlength="30" v-model:value="projectInfo.numValue" placeholder="请输入项目编号" /> -->
<ProjectNumber v-model:value="projectInfo.numValue"></ProjectNumber>
</div>
</div>
</div>
<div class="name name2">
<div class="namebox">
@@ -269,7 +276,7 @@ import * as api2 from "../../api/indexAudit";
import {validateName} from "@/api/index1";
import dayjs from "dayjs";
import {scrollLoad} from "@/api/method";
import ProjectNumber from "@/components/project/ProjectNumber";
export default {
name: "projectAdd",
components: {
@@ -279,6 +286,7 @@ export default {
TrainClass,
NameInput,
OrgClass,
ProjectNumber
},
setup() {
const store = useStore();
@@ -334,6 +342,11 @@ export default {
state.projectInfo.parentName = routers.query.parentName;
state.projectInfo.parentId = routers.query.parentId;
});
watch(()=>state.projectInfo.boeFlag,(val)=>{
if(!val){
state.projectInfo.numValue = ''
}
})
function getProjectInfo() {
state.projectInfo.parentName = routers.query.parentName;
@@ -489,6 +502,7 @@ export default {
id: state.projectInfo.id,
}).then((res) => {
return res.data.data == 1;
}).catch((err) => {
});
if (offName) {
message.destroy();
@@ -506,6 +520,10 @@ export default {
path: "/taskpage",
query: { projectId: res.data.data },
});
}).catch((err) => {
state.loading = false;
message.destroy();
message.error('创建项目失败,请重新创建');
});
};
@@ -772,6 +790,20 @@ export default {
}
}
.num{
display: flex;
justify-content: center;
align-items: center;
.num_text{
color: #6f6f6f;
font-size: 14px;
// margin-right: 7px;
}
.num_input{
width: 184px;
}
}
.filebox {
margin-left: 14px;
flex: 1;