Commit 1e5eaa87 authored by daywrite's avatar daywrite

新建项目

parent 2f874ed0
...@@ -30,5 +30,10 @@ export default { ...@@ -30,5 +30,10 @@ export default {
// ---项目列表--- // ---项目列表---
getTaskGroupList: { getTaskGroupList: {
url: '/vue/task/list-group' url: '/vue/task/list-group'
},
getTaskGroupNew: {
// url: '/vue/task/get-new-group'
url: '/vue/sales-order/get-new'
} }
} }
<template>
<section class="multiple-check-group">
<el-row :gutter="10">
<el-col :span="4" :class="['client-label', 'text-right', {'required': required}]">
<span>{{label}}</span>
</el-col>
<el-col :span="14">
<span v-for="(item, key) in groupOptionsList"
:key="key">
<el-card class="box-card"
:body-style="{ padding: '10px' }"
v-if="item.child.length > 0">
<div slot="header" class="clearfix">
<el-checkbox
:indeterminate="item.isIndeterminate"
v-model="item.checkAll"
@change="(val) => {handleCheckGroupAll(val, item)}">{{item.name}}
</el-checkbox>
</div>
<el-checkbox-group v-model="item.checkItems" @change="(value) => {handleCheckGroupChange(value, item)}">
<el-checkbox v-for="(check, key) in item.child" :label="check.key" :key="key">{{check.name}}</el-checkbox>
</el-checkbox-group>
</el-card>
</span>
</el-col>
<el-col :span="6">
<slot name="formError"></slot>
<span class="tips">{{tips}}</span>
</el-col>
</el-row>
</section>
</template>
<script>
// import itemMixin from '../../lib/singleItemMixin'
export default {
name: 'multiple-check-group',
// mixins: [itemMixin],
props: {
label: {
type: String
},
required: {
type: Boolean
},
tips: {
type: String
},
checkGroupFormItem: Array,
checkGroupOptionsList: Array
},
data () {
return {
groupOptionsList: []
}
},
methods: {
handleCheckGroupAll (val, item) {
item.checkItems = val ? item.child.map(i => i.key) : []
item.isIndeterminate = false
},
handleCheckGroupChange (value, item) {
let checkedCount = value.length
item.checkAll = checkedCount === item.child.length
item.isIndeterminate = checkedCount > 0 && checkedCount < item.child.length
}
},
watch: {
checkGroupOptionsList (val) {
this.groupOptionsList = []
val.forEach(item => {
let checkItems = item.child.map(i => i.key).filter(i => this.checkGroupFormItem.some(ele => ele === i))
this.$set(item, 'isIndeterminate', checkItems.length > 0 && checkItems.length < item.child.length)
this.$set(item, 'checkAll', checkItems.length > 0 && checkItems.length === item.child.length)
this.$set(item, 'checkItems', checkItems)
this.groupOptionsList.push(item)
})
},
groupOptionsList: {
handler (val) {
let conArray = []
val.forEach(item => {
conArray = conArray.concat(item.checkItems)
})
this.$emit('update:item', Array.from(new Set(conArray)))
},
deep: true
}
}
}
</script>
<style>
.multiple-check-group .el-card {
border: 1px solid #5092d2;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
margin-bottom: 20px;
line-height: 20px;
}
.multiple-check-group .el-card .el-card__header {
padding: 10px;
background-color: #649FD7;
}
.multiple-check-group .el-card .el-card__header .el-checkbox__label {
color: #ffffff;
}
</style>
import multipleCheckGroup from './multipleCheckGroup'
export default {
components: {
multipleCheckGroup
}
}
...@@ -58,6 +58,11 @@ export default { ...@@ -58,6 +58,11 @@ export default {
taskGroupArray () { taskGroupArray () {
let ret = this.getArrayByKey('Tasks', 'task_group_id') let ret = this.getArrayByKey('Tasks', 'task_group_id')
return ret && [].concat(ret.value) return ret && [].concat(ret.value)
},
salesOrderRemindReceiversArray () {
let ret = this.getArrayByKey('SalesOrders', 'salesOrderRemindReceivers')
return ret && [].concat(ret.value)
} }
}, },
...@@ -81,6 +86,13 @@ export default { ...@@ -81,6 +86,13 @@ export default {
}) })
}, },
getTaskGroupNew () {
requestAPI(api.getTaskGroupNew)
.then((res) => {
this.retNewArray = res.options
})
},
getTaskTask () { getTaskTask () {
requestAPI(api.getTaskNew) requestAPI(api.getTaskNew)
.then((res) => { .then((res) => {
......
...@@ -39,12 +39,20 @@ ...@@ -39,12 +39,20 @@
v-model.trim="model.title"> v-model.trim="model.title">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="提醒人" prop="remindReceivers" class="ec-clear-left ec-form-item-lg is-required">
<multiple-check-group
:check-group-form-item="model.remindReceivers"
:check-group-options-list="salesOrderRemindReceiversArray"
@update:item="val => {model.remindReceivers = val}">
</multiple-check-group>
</el-form-item>
</el-form> </el-form>
</section> </section>
</template> </template>
<script> <script>
import singleRadio from '../common/singleRadio' import singleRadio from '../common/singleRadio'
import settingMixin from '../common/settingMixin' import settingMixin from '../common/settingMixin'
import operationMixins from '../common/operationMixins'
import depSelect from '../schedule/depSelect' import depSelect from '../schedule/depSelect'
import { import {
requestAPI, requestAPI,
...@@ -53,7 +61,7 @@ import { ...@@ -53,7 +61,7 @@ import {
export default { export default {
name: 'taskForm', name: 'taskForm',
mixins: [settingMixin], mixins: [settingMixin, operationMixins],
props: { props: {
model: Object model: Object
...@@ -96,7 +104,7 @@ export default { ...@@ -96,7 +104,7 @@ export default {
}, },
mounted () { mounted () {
this.initSetting(['getTaskTask']) this.initSetting(['getTaskGroupNew'])
}, },
computed: { computed: {
......
<template> <template>
<section> <section>
<sidePopup ref="sidePopup" title="新建项目清单" :width="40"> <sidePopup ref="sidePopup" title="新建项目清单" :width="50">
<TaskForm <TaskGroupForm
:model="model"> :model="model">
</TaskForm> </TaskGroupForm>
<div class="mt20" style="margin-left: 150px;"> <div class="mt20" style="margin-left: 150px;">
<el-button type="cancel" @click.stop.prevent="handleClose" size="mini">取 消</el-button> <el-button type="cancel" @click.stop.prevent="handleClose" size="mini">取 消</el-button>
<el-button type="confirm" @click.stop.prevent="save" size="mini">确 定</el-button> <el-button type="confirm" @click.stop.prevent="save" size="mini">确 定</el-button>
...@@ -17,12 +17,12 @@ import { ...@@ -17,12 +17,12 @@ import {
api, api,
UTIL UTIL
} from '@/lib/commonMixin' } from '@/lib/commonMixin'
import TaskForm from './taskForm' import TaskGroupForm from './taskGroupForm'
import { setModule } from '@/lib/viewHelper' import { setModule } from '@/lib/viewHelper'
export default { export default {
components: { components: {
TaskForm TaskGroupForm
}, },
data () { data () {
...@@ -34,7 +34,8 @@ export default { ...@@ -34,7 +34,8 @@ export default {
title: '', title: '',
is_important: '', is_important: '',
target_completed_at: '', target_completed_at: '',
description: '' description: '',
remindReceivers: []
} }
} }
}, },
......
...@@ -53,10 +53,10 @@ ...@@ -53,10 +53,10 @@
</leave-message> </leave-message>
</div> </div>
</div> </div>
<ReimModal <TaskGroupModal
ref="reimModal"> ref="taskGroupModal">
<!-- v-click-outside="scheduleClose" --> <!-- v-click-outside="scheduleClose" -->
</ReimModal> </TaskGroupModal>
</section> </section>
</template> </template>
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
import SearchHeader from '../common/searchHeader' import SearchHeader from '../common/searchHeader'
import SearchForm from '../common/SearchForm' import SearchForm from '../common/SearchForm'
import GroupItem from './groupItem' import GroupItem from './groupItem'
import ReimModal from '../reimbursement/reimbursementModal' import TaskGroupModal from '../task_group/taskGroupModal'
import Pagenation from './groupPagenation' import Pagenation from './groupPagenation'
import clickOutside from '@/lib/bind' import clickOutside from '@/lib/bind'
import singleRadioTool from '../common/singleRadioTool' import singleRadioTool from '../common/singleRadioTool'
...@@ -74,7 +74,7 @@ import { ...@@ -74,7 +74,7 @@ import {
api api
} from '@/lib/commonMixin' } from '@/lib/commonMixin'
export default { export default {
name: 'reimbursementHome', name: 'taskGroupHome',
mixins: [SetParams], mixins: [SetParams],
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
SearchHeader, SearchHeader,
SearchForm, SearchForm,
GroupItem, GroupItem,
ReimModal, TaskGroupModal,
Pagenation, Pagenation,
singleRadioTool singleRadioTool
}, },
...@@ -246,16 +246,16 @@ export default { ...@@ -246,16 +246,16 @@ export default {
}, },
scheduleClose () { scheduleClose () {
this.$refs.reimModal && this.$refs.taskGroupModal &&
this.$refs.reimModal.handleClose() this.$refs.taskGroupModal.handleClose()
}, },
addSch () { addSch () {
this.$refs.reimModal.show() this.$refs.taskGroupModal.show()
}, },
editSch (item) { editSch (item) {
this.$refs.reimModal.show(item) this.$refs.taskGroupModal.show(item)
}, },
deleteSch (id) { deleteSch (id) {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<el-col :span="6" :xs="24"> <el-col :span="6" :xs="24">
<span>负责人:</span> <span>负责人:</span>
<span> <span>
<img class="user-avatar rounded-circle" :src="item.headOf.avatar.name">{{ item.headOf.name }} <!-- <img class="user-avatar rounded-circle" :src="item.headOf.avatar.name">{{ item.headOf.name }} -->
</span> </span>
</el-col> </el-col>
<el-col :span="6" :xs="24"> <el-col :span="6" :xs="24">
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<el-col :span="6" :xs="24"> <el-col :span="6" :xs="24">
<span>成员:</span> <span>成员:</span>
<span v-for="sItem in item.taskGroupUserRelationships"> <span v-for="sItem in item.taskGroupUserRelationships">
<img class="user-avatar rounded-circle" :src="item.user.avatar.name">{{ item.user.name }} <!-- <img class="user-avatar rounded-circle" :src="item.user.avatar.name">{{ item.user.name }} -->
</span> </span>
</el-col> </el-col>
<el-col :span="6" :xs="24"> <el-col :span="6" :xs="24">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment