This commit is contained in:
Vitaly committed 2023-09-05 14:00:40 +03:00
commit 4716effcf7
309 files changed
+153369

No files matched your search

@@ -0,0 +1,235 @@
<template>
<div class="pa-3 pt-0 flex-grow-1 flex-col h-0 overflow-auto overflow-x-hidden stepper">
<row-pirow v-for="item in [{title:'Название:',field:'longname'},{title:'Краткое название:',field:'name'}]"
:key="item.field"
:title="item.title"
class="mt-1 "
myclass="pb-2 align-self-center"
>
<template #leftcol>
<v-textarea
v-model="newproject[item.field]"
auto-grow
rows="0"
class="my-0 pt-0 pb-0 textsize"
:error-messages="error('newproject','name')"
>
</v-textarea>
</template>
</row-pirow>
<row-pirow title="Период:"
myclass="pb-0 align-self-center"
>
<template #leftcol>
<Datepiker
:datestartstore="'Projectdatestart'"
:dateendstore="'Projectdateend'"
:min="getProject.datestart"
:max="getProject.dateend"
:minimaxon="[[false, true],[true,false]]"
class="my-0"
/>
</template>
</row-pirow>
<row-pirow title="Сложность проекта:"
myclass="pb-2 align-self-end"
>
<template #leftcol>
<v-rating
v-model="newproject.difficult"
color="warning"
empty-icon="mdi-star-outline"
full-icon="mdi-star"
half-icon="mdi-star-half-full"
hover
length="5"
size="16"
/>
</template>
</row-pirow>
<row-pirow title="Тип:"
myclass="pb-0 align-self-end"
>
<template #leftcol>
<v-autocomplete
dense
class="inputext pointer iconsh "
v-model="newproject.ptype"
:items="$store.getters[`filterslogic/mult/mult_project__type`]"
return-object
item-text="name"
item-value="id"
hide-details
hide-no-data
item-color="open_icons"
color="primaryicons"
/>
</template>
</row-pirow>
<row-pirow title="Сфера организации Проекта:"
myclass="pb-2 align-self-center"
>
<template #leftcol>
<v-textarea
v-model="newproject.info.project_sphere"
auto-grow
rows="0"
class="pt-0 pb-2 textsize"
flat
dense
required
/>
</template>
</row-pirow>
<row-pirow title="Дата утверждения паспорта Проекта:"
myclass="pb-0 align-self-center"
>
<template #leftcol>
<v-menu
v-model="menupassport_last_date"
:close-on-content-click="false"
:nudge-right="40"
transition="scale-transition"
offset-y
min-width="auto"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
type="date-local"
readonly
v-bind="attrs"
placeholder="дд.мм.гггг"
v-on="on"
flat
dense
auto-grow
rows="0"
:value="formatDate(newproject.info.passport_last_date)"
></v-text-field>
</template>
<v-date-picker
v-model="newproject.info.passport_last_date"
@input="menupassport_last_date = false"
placeholder="дд.мм.гггг"
:min='getProject.datestart'
:max='getProject.dateend'
/>
</v-menu>
</template>
</row-pirow>
<row-pirow v-for="(item,indx) in [{title:'Дополнительная информация:', field:'dop_info'},
{title:'Финансовое обеспечение расходных обязательств:',field:'financial_support'},
{title:'Основания для инициализации проекта:', field:'grounds'},
]"
:key="indx"
:title="item.title"
class="mt-1 "
myclass="pb-2 align-self-center"
>
<template #leftcol>
<v-textarea
v-model="newproject.info[item.field]"
auto-grow
rows="0"
class="my-0 pt-0 pb-0 textsize"
>
</v-textarea>
</template>
</row-pirow>
</div>
</template>
<script>
import rowPirow from '@/components/carddetails/pattern/row-pirow.vue';
import uf from '@/utils/universal_functions';
import { required, minLength } from "vuelidate/lib/validators";
import { validationMixin } from "vuelidate";
import { createNamespacedHelpers } from "vuex";
const projectstate = createNamespacedHelpers("projectstate");
export default {
name:"step-one",
props:{
newproject:{
type:Object,
default:()=>{return{ longname: '',
name: '',}}
}
},
components: { rowPirow},
mixins:[uf, validationMixin],
data:()=>{
return{
menupassport_last_date: false,
errortext: {
longname: {
required : 'Поле обязательно для заполнения',
minLength: 'Минимальная длина 4 символа'
},
name: {
required : 'Поле обязательно для заполнения',
},
},
}
},
validations: {
newproject:{
longname: {
required,
minLength: minLength(4)
},
name: {
required,
},
datestart: {
required,
},
dateend: {
required,
},
}
},
computed:{
...projectstate.mapGetters(["getProject", "getprojectuniqueusers"]),
},
methods:{
formatDate (date) {
try {
if (!date) return null
if (date.split('-').length==3){
const [year, month, day] = date.split('-')
return `${day}.${month}.${year}`
}
}
catch{return date}
},
}
}
</script>
<style>
</style>