mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-06 17:36:44 +08:00
Merge branch 'zcwy_0827_pingcode817' into dev_master
# Conflicts: # src/components/project/ProjectNumber.vue # src/views/projectcenter/ProjectAdd.vue
This commit is contained in:
46
src/components/project/ProjectNumber.vue
Normal file
46
src/components/project/ProjectNumber.vue
Normal 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>
|
||||||
@@ -147,6 +147,13 @@
|
|||||||
<a-radio :style="radioStyle" :value="0">否</a-radio>
|
<a-radio :style="radioStyle" :value="0">否</a-radio>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</div>
|
</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>
|
||||||
<div class="name name2">
|
<div class="name name2">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
@@ -269,7 +276,7 @@ import * as api2 from "../../api/indexAudit";
|
|||||||
import {validateName} from "@/api/index1";
|
import {validateName} from "@/api/index1";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import {scrollLoad} from "@/api/method";
|
import {scrollLoad} from "@/api/method";
|
||||||
|
import ProjectNumber from "@/components/project/ProjectNumber";
|
||||||
export default {
|
export default {
|
||||||
name: "projectAdd",
|
name: "projectAdd",
|
||||||
components: {
|
components: {
|
||||||
@@ -279,6 +286,7 @@ export default {
|
|||||||
TrainClass,
|
TrainClass,
|
||||||
NameInput,
|
NameInput,
|
||||||
OrgClass,
|
OrgClass,
|
||||||
|
ProjectNumber
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
@@ -334,6 +342,11 @@ export default {
|
|||||||
state.projectInfo.parentName = routers.query.parentName;
|
state.projectInfo.parentName = routers.query.parentName;
|
||||||
state.projectInfo.parentId = routers.query.parentId;
|
state.projectInfo.parentId = routers.query.parentId;
|
||||||
});
|
});
|
||||||
|
watch(()=>state.projectInfo.boeFlag,(val)=>{
|
||||||
|
if(!val){
|
||||||
|
state.projectInfo.numValue = ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
function getProjectInfo() {
|
function getProjectInfo() {
|
||||||
state.projectInfo.parentName = routers.query.parentName;
|
state.projectInfo.parentName = routers.query.parentName;
|
||||||
@@ -489,6 +502,7 @@ export default {
|
|||||||
id: state.projectInfo.id,
|
id: state.projectInfo.id,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
return res.data.data == 1;
|
return res.data.data == 1;
|
||||||
|
}).catch((err) => {
|
||||||
});
|
});
|
||||||
if (offName) {
|
if (offName) {
|
||||||
message.destroy();
|
message.destroy();
|
||||||
@@ -506,6 +520,10 @@ export default {
|
|||||||
path: "/taskpage",
|
path: "/taskpage",
|
||||||
query: { projectId: res.data.data },
|
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 {
|
.filebox {
|
||||||
margin-left: 14px;
|
margin-left: 14px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user