Commit 1e5eaa87 authored by daywrite's avatar daywrite

新建项目

parent 2f874ed0
......@@ -30,5 +30,10 @@ export default {
// ---项目列表---
getTaskGroupList: {
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 {
taskGroupArray () {
let ret = this.getArrayByKey('Tasks', 'task_group_id')
return ret && [].concat(ret.value)
},
salesOrderRemindReceiversArray () {
let ret = this.getArrayByKey('SalesOrders', 'salesOrderRemindReceivers')
return ret && [].concat(ret.value)
}
},
......@@ -81,6 +86,13 @@ export default {
})
},
getTaskGroupNew () {
requestAPI(api.getTaskGroupNew)
.then((res) => {
this.retNewArray = res.options
})
},
getTaskTask () {
requestAPI(api.getTaskNew)
.then((res) => {
......
......@@ -39,12 +39,20 @@
v-model.trim="model.title">
</el-input>
</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>
</section>
</template>
<script>
import singleRadio from '../common/singleRadio'
import settingMixin from '../common/settingMixin'
import operationMixins from '../common/operationMixins'
import depSelect from '../schedule/depSelect'
import {
requestAPI,
......@@ -53,7 +61,7 @@ import {
export default {
name: 'taskForm',
mixins: [settingMixin],
mixins: [settingMixin, operationMixins],
props: {
model: Object
......@@ -96,7 +104,7 @@ export default {
},
mounted () {
this.initSetting(['getTaskTask'])
this.initSetting(['getTaskGroupNew'])
},
computed: {
......
<template>
<section>
<sidePopup ref="sidePopup" title="新建项目清单" :width="40">
<TaskForm
<sidePopup ref="sidePopup" title="新建项目清单" :width="50">
<TaskGroupForm
:model="model">
</TaskForm>
</TaskGroupForm>
<div class="mt20" style="margin-left: 150px;">
<el-button type="cancel" @click.stop.prevent="handleClose" size="mini">取 消</el-button>
<el-button type="confirm" @click.stop.prevent="save" size="mini">确 定</el-button>
......@@ -17,12 +17,12 @@ import {
api,
UTIL
} from '@/lib/commonMixin'
import TaskForm from './taskForm'
import TaskGroupForm from './taskGroupForm'
import { setModule } from '@/lib/viewHelper'
export default {
components: {
TaskForm
TaskGroupForm
},
data () {
......@@ -34,7 +34,8 @@ export default {
title: '',
is_important: '',
target_completed_at: '',
description: ''
description: '',
remindReceivers: []
}
}
},
......
......@@ -53,10 +53,10 @@
</leave-message>
</div>
</div>
<ReimModal
ref="reimModal">
<TaskGroupModal
ref="taskGroupModal">
<!-- v-click-outside="scheduleClose" -->
</ReimModal>
</TaskGroupModal>
</section>
</template>
......@@ -64,7 +64,7 @@
import SearchHeader from '../common/searchHeader'
import SearchForm from '../common/SearchForm'
import GroupItem from './groupItem'
import ReimModal from '../reimbursement/reimbursementModal'
import TaskGroupModal from '../task_group/taskGroupModal'
import Pagenation from './groupPagenation'
import clickOutside from '@/lib/bind'
import singleRadioTool from '../common/singleRadioTool'
......@@ -74,7 +74,7 @@ import {
api
} from '@/lib/commonMixin'
export default {
name: 'reimbursementHome',
name: 'taskGroupHome',
mixins: [SetParams],
......@@ -82,7 +82,7 @@ export default {
SearchHeader,
SearchForm,
GroupItem,
ReimModal,
TaskGroupModal,
Pagenation,
singleRadioTool
},
......@@ -246,16 +246,16 @@ export default {
},
scheduleClose () {
this.$refs.reimModal &&
this.$refs.reimModal.handleClose()
this.$refs.taskGroupModal &&
this.$refs.taskGroupModal.handleClose()
},
addSch () {
this.$refs.reimModal.show()
this.$refs.taskGroupModal.show()
},
editSch (item) {
this.$refs.reimModal.show(item)
this.$refs.taskGroupModal.show(item)
},
deleteSch (id) {
......
......@@ -28,7 +28,7 @@
<el-col :span="6" :xs="24">
<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>
</el-col>
<el-col :span="6" :xs="24">
......@@ -45,7 +45,7 @@
<el-col :span="6" :xs="24">
<span>成员:</span>
<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>
</el-col>
<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