w
This commit is contained in:
commit
4716effcf7
309 files changed
+153369
No files matched your search
@@ -0,0 +1,506 @@
|
||||
<template>
|
||||
<v-row>
|
||||
<v-col lg=3 class="flex-col">
|
||||
|
||||
<v-row class="flex-grow-0">
|
||||
|
||||
<v-col >
|
||||
|
||||
<v-btn
|
||||
tile
|
||||
color="btns"
|
||||
small
|
||||
block
|
||||
@click="newTask"
|
||||
outlined
|
||||
>
|
||||
<v-icon
|
||||
left
|
||||
x-small
|
||||
>
|
||||
mdi-plus
|
||||
</v-icon>
|
||||
Добавить задачу
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="overflow-auto h-0 ">
|
||||
<v-col class="py-0 ">
|
||||
|
||||
<v-treeview
|
||||
:active.sync="active"
|
||||
:items="newproject.tasks"
|
||||
class="pointer"
|
||||
activatable
|
||||
color="btns"
|
||||
|
||||
transition
|
||||
return-object
|
||||
|
||||
|
||||
>
|
||||
<template v-slot:prepend="{ item }">
|
||||
<v-icon v-if="!item.children">
|
||||
mdi-calendar-edit-outline
|
||||
</v-icon>
|
||||
</template>
|
||||
</v-treeview>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-divider vertical/>
|
||||
<v-col lg=9 class="flex-col">
|
||||
<v-scroll-y-transition mode="out-in">
|
||||
<v-row v-if="active.length==0">
|
||||
<v-col
|
||||
|
||||
class="text-h6 grey--text text-center align-self-center text--lighten-1 font-weight-light"
|
||||
>
|
||||
Задача не выбрана
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row
|
||||
v-else
|
||||
flat
|
||||
>
|
||||
<v-col lg=4 class="flex-col">
|
||||
<v-row class="flex-grow-0">
|
||||
|
||||
<v-col>
|
||||
<v-btn
|
||||
tile
|
||||
color="btns"
|
||||
small
|
||||
block
|
||||
@click="adddwork"
|
||||
outlined
|
||||
>
|
||||
<v-icon
|
||||
left
|
||||
x-small
|
||||
>
|
||||
mdi-plus
|
||||
</v-icon>
|
||||
Добавить работу
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row >
|
||||
<v-col class="py-0 flex-col">
|
||||
<v-row class="overflow-auto h-0 ">
|
||||
<v-col>
|
||||
|
||||
|
||||
<v-treeview
|
||||
:active.sync="activework"
|
||||
:items="active[0].task_work"
|
||||
class="pointer"
|
||||
activatable
|
||||
color="btns"
|
||||
open-on-click
|
||||
transition
|
||||
return-object
|
||||
>
|
||||
<template v-slot:prepend="{ item }">
|
||||
<v-icon v-if="!item.children">
|
||||
mdi-archive-edit
|
||||
</v-icon>
|
||||
</template>
|
||||
</v-treeview>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-divider vertical></v-divider>
|
||||
<v-col class="flex-col">
|
||||
<v-row class="overflow-auto h-0 ">
|
||||
<v-col class="flex-col">
|
||||
<v-row class="flex-grow-0">
|
||||
<v-col>
|
||||
<v-dialog
|
||||
v-model="dialogdelete"
|
||||
persistent
|
||||
max-width="500"
|
||||
>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn
|
||||
tile
|
||||
color="btns"
|
||||
small
|
||||
block
|
||||
|
||||
outlined
|
||||
v-bind="attrs"
|
||||
v-on="on"
|
||||
>
|
||||
<v-icon
|
||||
left
|
||||
x-small
|
||||
>
|
||||
mdi-minus
|
||||
</v-icon>
|
||||
{{activework.length?'Удалить работу':'Удалить задачу'}}
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card>
|
||||
<v-card-title class="text-h5">
|
||||
{{activework.length?activework[0].name:active[0].name}}
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
Вы уверены что хотите удалить {{activework.length?'работу':'задачу'}}?
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<BtnsOut
|
||||
@click="dialogdelete = false"
|
||||
title = "Отмена"
|
||||
:height= 30
|
||||
:width= 120
|
||||
/>
|
||||
|
||||
<BtnsOut
|
||||
:colora="'red accent-4'"
|
||||
@click="deltasksworks"
|
||||
title = "Удалить"
|
||||
:height= 30
|
||||
:width= 120
|
||||
/>
|
||||
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<row-pirow title="Название:"
|
||||
myclass="pt-3"
|
||||
rowclass="px-1">
|
||||
<template #leftcol>
|
||||
<v-textarea
|
||||
v-model="vmodellongname"
|
||||
auto-grow
|
||||
rows=0
|
||||
dense
|
||||
flat
|
||||
class="mt-0 pt-0 pb-2"
|
||||
hide-details
|
||||
/>
|
||||
</template>
|
||||
</row-pirow>
|
||||
<row-pirow title="Короткое название:"
|
||||
myclass="pt-2"
|
||||
rowclass="px-1">
|
||||
<template #leftcol>
|
||||
<v-textarea
|
||||
v-model="vmodelname"
|
||||
auto-grow
|
||||
rows=0
|
||||
dense
|
||||
flat
|
||||
class="mt-0 pt-0 pb-2"
|
||||
hide-details
|
||||
></v-textarea>
|
||||
</template>
|
||||
</row-pirow>
|
||||
<row-pirow title="Период:" myclass="pt-3" rowclass="px-1">
|
||||
<template #leftcol>
|
||||
<v-row class="flex-grow-0">
|
||||
<v-col class="py-0">
|
||||
<v-menu
|
||||
v-model="menudatestart"
|
||||
: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
|
||||
v-model="vmodeldatestart"
|
||||
|
||||
readonly
|
||||
v-bind="attrs"
|
||||
v-on="on"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker
|
||||
v-model="vmodeldatestart"
|
||||
@input="menudatestart = false"
|
||||
></v-date-picker>
|
||||
</v-menu>
|
||||
</v-col>
|
||||
<v-col class="py-0">
|
||||
<v-menu
|
||||
v-model="menudateend"
|
||||
: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
|
||||
v-model="vmodeldateend"
|
||||
|
||||
readonly
|
||||
v-bind="attrs"
|
||||
v-on="on"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker
|
||||
v-model="vmodeldateend"
|
||||
@input="menudateend = false"
|
||||
></v-date-picker>
|
||||
</v-menu>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
</row-pirow>
|
||||
|
||||
<row-pirow title="Сложность проекта:" class="mt-2" rowclass="px-1"
|
||||
|
||||
>
|
||||
<template #leftcol>
|
||||
<v-rating
|
||||
v-model="vmodeldifficult"
|
||||
class=" ml-n3 star"
|
||||
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="Ответсвенный:" rowclass="px-1"
|
||||
class="pt-2">
|
||||
<template #leftcol>
|
||||
<v-autocomplete
|
||||
dense
|
||||
class="inputext pointer mt-n1 iconsh font-weight-medium"
|
||||
v-model="vmodelresponsible"
|
||||
:items="getprojectuniqueusers"
|
||||
hide-no-data
|
||||
|
||||
item-text="text"
|
||||
item-value="id"
|
||||
hide-details
|
||||
item-color="open_icons"
|
||||
color="primaryicons"
|
||||
/>
|
||||
</template>
|
||||
</row-pirow>
|
||||
<row-pirow title="Описание:" rowclass="px-1"
|
||||
class="pt-2"
|
||||
myclass="pt-3">
|
||||
<template #leftcol>
|
||||
<v-textarea
|
||||
v-model="vmodeldescription"
|
||||
auto-grow
|
||||
rows=0
|
||||
dense
|
||||
flat
|
||||
class="mt-0 pt-0 pb-2"
|
||||
hide-details
|
||||
></v-textarea>
|
||||
</template>
|
||||
</row-pirow>
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
|
||||
|
||||
|
||||
</v-scroll-y-transition>
|
||||
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createNamespacedHelpers } from "vuex";
|
||||
const projectstate = createNamespacedHelpers("projectstate");
|
||||
import rowPirow from '@/components/carddetails/pattern/row-pirow.vue';
|
||||
export default {
|
||||
name:'step-four',
|
||||
components: { rowPirow},
|
||||
props:{
|
||||
newproject:{
|
||||
type:Object,
|
||||
default:()=>{}
|
||||
}
|
||||
},
|
||||
data:()=>{
|
||||
return{
|
||||
dialogdelete: false,
|
||||
active: [],
|
||||
activework:[],
|
||||
menudatestart: false,
|
||||
menudateend: false,
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
newTask() {
|
||||
this.newproject.tasks.push({id:-1-this.newproject.tasks.length,longname: "", name:`Новая задача - ${this.newproject.tasks.length+1}`, difficult:3, description: "", datestart: "", dateend: "", responsible: "", status: 1, task_work:[]})
|
||||
},
|
||||
|
||||
|
||||
|
||||
deltasksworks() {
|
||||
// let arr = []
|
||||
// let delarr = []
|
||||
// let selectid = ""
|
||||
if(this.activework.length > 0){
|
||||
this.active[0].task_work.splice(this.active[0].task_work.findIndex(e=>e.id==this.activework[0].id),1)
|
||||
|
||||
}
|
||||
else{
|
||||
this.newproject.tasks.splice(this.newproject.tasks.findIndex(e=>e.id==this.active[0].id),1)
|
||||
this.active[0].task_work=[]
|
||||
}
|
||||
// ?
|
||||
// (
|
||||
// arr = this.selected.task_work,
|
||||
// delarr = this.deletion.delworks,
|
||||
// selectid = this.activework[0]
|
||||
// ) :
|
||||
// (
|
||||
// arr = this.newproject.tasks,
|
||||
// delarr = this.deletion.deltasks,
|
||||
// selectid = this.selected.id
|
||||
// )
|
||||
|
||||
// if (selectid >= 0) {
|
||||
// delarr.push(selectid)
|
||||
// }
|
||||
// let delinx = arr.findIndex(e=>e.id==selectid)
|
||||
// if(arr == this.selected.task_work) {
|
||||
// this.activework = []
|
||||
// }
|
||||
// arr.splice(delinx, 1)
|
||||
this.dialogdelete = false
|
||||
console.log(`this.newproject.tasks`, this.deletion, this.newproject.tasks);
|
||||
},
|
||||
|
||||
|
||||
adddwork() {
|
||||
this.active[0].task_work.push({id: -1-this.active[0].task_work.length, longname: "", name:`Новая работа - ${this.active[0].task_work.length+1}`, description: "", datestart: "", dateend: "", responsible: "", difficult:3})
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
computed:{
|
||||
...projectstate.mapGetters(["getProject", "getprojectuniqueusers"]),
|
||||
|
||||
vmodelname: {
|
||||
get () {
|
||||
return this.activework.length > 0 ?this.activework[0].name:this.active[0].name
|
||||
},
|
||||
set (newval) {
|
||||
if (this.activework.length > 0) {
|
||||
this.activework[0].name = newval
|
||||
}
|
||||
else {
|
||||
this.active[0].name = newval
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
vmodellongname: {
|
||||
get () {
|
||||
return this.activework.length > 0?this.activework[0].longname:this.active[0].longname
|
||||
},
|
||||
set (newval) {
|
||||
if (this.activework.length > 0) {
|
||||
this.activework[0].longname = newval
|
||||
}
|
||||
else {
|
||||
this.active[0].longname = newval
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
vmodeldescription: {
|
||||
get () {
|
||||
return this.activework.length > 0?this.activework[0].description:this.active[0].description
|
||||
},
|
||||
set (newval) {
|
||||
if (this.activework.length > 0) {
|
||||
this.activework[0].description = newval
|
||||
}
|
||||
else {
|
||||
this.active[0].description = newval
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
vmodeldatestart: {
|
||||
get () {
|
||||
return this.activework.length > 0?this.activework[0].datestart:this.active[0].datestart
|
||||
},
|
||||
set (newval) {
|
||||
if (this.activework.length > 0) {
|
||||
this.activework[0].datestart = newval
|
||||
}
|
||||
else {
|
||||
this.active[0].datestart = newval
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
vmodeldateend: {
|
||||
get () {
|
||||
return this.activework.length > 0?this.activework[0].dateend:this.active[0].dateend
|
||||
},
|
||||
set (newval) {
|
||||
if (this.activework.length > 0) {
|
||||
this.activework[0].dateend = newval
|
||||
}
|
||||
else {
|
||||
this.active[0].dateend = newval
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
vmodelresponsible: {
|
||||
get () {
|
||||
return this.activework.length > 0?this.activework[0].responsible:this.active[0].responsible
|
||||
},
|
||||
set (newval) {
|
||||
if (this.activework.length > 0) {
|
||||
this.activework[0].responsible = newval
|
||||
}
|
||||
else {
|
||||
this.active[0].responsible = newval
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
vmodeldifficult: {
|
||||
get () {
|
||||
return this.activework.length > 0?this.activework[0].difficult:this.active[0].difficult
|
||||
},
|
||||
set (newval) {
|
||||
if (this.activework.length > 0) {
|
||||
this.activework[0].difficult = newval
|
||||
}
|
||||
else {
|
||||
this.active[0].difficult = newval
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Reference in new issue
Block a user