|
@@ -0,0 +1,302 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div class="InvoicedAndSettled" style="width: 99%; margin-top: 0px">
|
|
|
|
|
+ <el-button type="primary" @click="newAdd" size="small">新增</el-button>
|
|
|
|
|
+ <templateTable ref="templateTable" :tableConfig="tableConfig" :data="tableData"
|
|
|
|
|
+ :btnGroup="btnGroup" :formList="formList" @handleSearchList="handleSearchList"
|
|
|
|
|
+ @findPage="findPage" @getList="findPage" :pagination="pageData">
|
|
|
|
|
+ </templateTable>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
|
|
|
|
|
+ <el-form ref="form" :model="formAdd" label-width="130px">
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="项目类型">
|
|
|
|
|
+ <el-select v-model="formAdd.projectId" placeholder="请选择">
|
|
|
|
|
+ <el-option v-for="(item, index) in projectList" :label="item.projectName" :value="item.id" :key="index"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="任务名称">
|
|
|
|
|
+ <el-input v-model="formAdd.taskName" class="inputType" size="small"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="任务描述">
|
|
|
|
|
+ <el-input v-model="formAdd.taskDesc" class="inputType" size="small"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="任务优先级">
|
|
|
|
|
+ <el-input v-model="formAdd.taskFirst" class="inputType" type="number" size="small"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="任务开始时间">
|
|
|
|
|
+ <el-date-picker v-model="formAdd.taskStartTime" size="small" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择任务开始时间" style="width: 100%;"></el-date-picker>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="任务结束时间">
|
|
|
|
|
+ <el-date-picker v-model="formAdd.taskEndTime" size="small" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择任务结束时间" style="width: 100%;"></el-date-picker>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="附件">
|
|
|
|
|
+ <el-upload style="margin-bottom:10px" action="#" class="upload-demo" :limit="1" :auto-upload="false"
|
|
|
|
|
+ :on-change="fillUpload" :on-progress="handleProgress" ref="upload3" :file-list="fileList">
|
|
|
|
|
+ <el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
|
+ </el-upload>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="handleClose">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="addSubmit">确 定</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog title="指派" :visible.sync="dialogVisibleChoice" width="30%" :before-close="handleCloseChoice">
|
|
|
|
|
+ <el-form>
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-select v-model="choiceUser" multiple placeholder="请选择">
|
|
|
|
|
+ <el-option v-for="item in userList" :key="item.userId" :label="item.userName" :value="item.userId"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="handleCloseChoice">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="handleAssign">确 定</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+import templateTable from '@/components/TemplateTable/index.vue'
|
|
|
|
|
+export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ templateTable
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ tableData:[],
|
|
|
|
|
+ tableConfig: {
|
|
|
|
|
+ columns: [
|
|
|
|
|
+ { prop: "taskName", label: "任务名称", type: "text"},
|
|
|
|
|
+ { prop: "taskDesc", label: "任务描述", type: "text" },
|
|
|
|
|
+ { prop: "taskFirst", label: "任务优先级", type: "text" },
|
|
|
|
|
+ { prop: "taskStartTime", label: "任务开始时间", type: "text" },
|
|
|
|
|
+ { prop: "taskEndTime", label: "任务结束时间", type: "text" },
|
|
|
|
|
+ { prop: "createTime", label: "创建时间", type: "text" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ isPaginationShow:true,
|
|
|
|
|
+ loading: true,
|
|
|
|
|
+ tableHeight: 'auto',
|
|
|
|
|
+ operationWidth: '150',
|
|
|
|
|
+ optBtns:[
|
|
|
|
|
+ { type:'primary', label:'新增子任务', click:(row, index) => {return this.newAdd(row)}},
|
|
|
|
|
+ { type:'primary', label:'指派', click:(row, index) => {return this.haldAssign(row)}},
|
|
|
|
|
+ { type:'primary', label:'编辑', click:(row, index) => {return this.haldUpload(row)}},
|
|
|
|
|
+ { type:'primary', label:'删除', click:(row, index) => {return this.haldDelete(row)}},
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ pageData: { pageNum: 1, pageSize: 20 },
|
|
|
|
|
+ btnGroup: [
|
|
|
|
|
+ { name:'新增', click:() => {return this.newAdd()}, },
|
|
|
|
|
+ ],
|
|
|
|
|
+ formList: [
|
|
|
|
|
+ // { label: "任务名称", prop: "taskName", type: "input", },
|
|
|
|
|
+ ],
|
|
|
|
|
+ dialogVisible: false,
|
|
|
|
|
+ formAdd: {},
|
|
|
|
|
+ dialogTitle: '新增',
|
|
|
|
|
+ projectList: [],
|
|
|
|
|
+ fileList: [],
|
|
|
|
|
+ fillData: {},
|
|
|
|
|
+ taskId: '0',
|
|
|
|
|
+ userList: [],
|
|
|
|
|
+ dialogVisibleChoice: false,
|
|
|
|
|
+ choiceUser: [],
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.findPage();
|
|
|
|
|
+ this.getProjectList()
|
|
|
|
|
+ this.getLineList()
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ handleAssign() {
|
|
|
|
|
+ this.$api.task.assignTask({
|
|
|
|
|
+ taskId: this.taskId,
|
|
|
|
|
+ userId: this.choiceUser
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.$message.success(res.mgs)
|
|
|
|
|
+ this.handleCloseChoice()
|
|
|
|
|
+ this.findPage();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(res.mgs)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ haldAssign(row) {
|
|
|
|
|
+ this.dialogVisibleChoice = true
|
|
|
|
|
+ this.taskId = row.id
|
|
|
|
|
+ },
|
|
|
|
|
+ getLineList() {
|
|
|
|
|
+ this.$api.task.getBehindUser().then((res) => {
|
|
|
|
|
+ this.userList = res.data
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ handleCloseChoice() {
|
|
|
|
|
+ this.dialogVisibleChoice = false
|
|
|
|
|
+ },
|
|
|
|
|
+ fillUpload(file, fileList) {
|
|
|
|
|
+ const params = new FormData(); // 声明formData数据类型
|
|
|
|
|
+ params.append("file", file.raw);
|
|
|
|
|
+ this.$api.task.fileUpload(params).then(res => {
|
|
|
|
|
+ if (res.code == "200") {
|
|
|
|
|
+ this.fileList = fileList
|
|
|
|
|
+ this.fillData = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ this.fileList = []
|
|
|
|
|
+ this.$message.error(res.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ handleProgress(event) {
|
|
|
|
|
+ console.log(event)
|
|
|
|
|
+ },
|
|
|
|
|
+ getProjectList() {
|
|
|
|
|
+ this.$api.task.getProjectList().then((res) => {
|
|
|
|
|
+ this.projectList = res.data
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ findPage(data) {
|
|
|
|
|
+ this.$api.task.getTaskPage({...this.pageData, ...data}).then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.tableData = res.data.records
|
|
|
|
|
+ this.pageData.pageNum = res.data.current
|
|
|
|
|
+ this.pageData.pageSize = res.data.size
|
|
|
|
|
+ this.pageData.totalSize = res.data.total
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(res.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.tableConfig.loading = false;
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSearchList(data) {
|
|
|
|
|
+ this.findPage(data);
|
|
|
|
|
+ },
|
|
|
|
|
+ addSubmit() {
|
|
|
|
|
+ let data = {
|
|
|
|
|
+ addTaskVoList: [
|
|
|
|
|
+ {
|
|
|
|
|
+ taskDesc: this.formAdd.taskDesc,
|
|
|
|
|
+ taskEndTime: this.formAdd.taskEndTime,
|
|
|
|
|
+ taskFirst: this.formAdd.taskFirst,
|
|
|
|
|
+ taskName: this.formAdd.taskName,
|
|
|
|
|
+ taskStartTime: this.formAdd.taskStartTime,
|
|
|
|
|
+ annexs: [
|
|
|
|
|
+ this.fillData
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ projectId: this.formAdd.projectId,
|
|
|
|
|
+ taskId: this.taskId || '0'
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.dialogTitle == '新增') {
|
|
|
|
|
+ this.$api.task.addTask(data).then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.$message.success(res.msg)
|
|
|
|
|
+ this.findPage()
|
|
|
|
|
+ this.handleClose()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(res.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$api.task.editTask(this.formAdd).then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.$message.success(res.msg)
|
|
|
|
|
+ this.findPage()
|
|
|
|
|
+ this.handleClose()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(res.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ newAdd(row) {
|
|
|
|
|
+ if (row) {
|
|
|
|
|
+ this.taskId = row.id
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.taskId = '0'
|
|
|
|
|
+ }
|
|
|
|
|
+ this.dialogTitle = '新增'
|
|
|
|
|
+ this.dialogVisible = true
|
|
|
|
|
+ },
|
|
|
|
|
+ haldUpload(row) {
|
|
|
|
|
+ this.dialogTitle = '编辑'
|
|
|
|
|
+ this.dialogVisible = true
|
|
|
|
|
+ this.formAdd = {
|
|
|
|
|
+ taskName: row.taskName,
|
|
|
|
|
+ taskDesc: row.taskDesc,
|
|
|
|
|
+ taskEndTime: row.taskEndTime,
|
|
|
|
|
+ taskFirst: row.taskFirst,
|
|
|
|
|
+ taskStartTime: row.taskStartTime,
|
|
|
|
|
+ id: row.id
|
|
|
|
|
+ }
|
|
|
|
|
+ // this.fillData = row.
|
|
|
|
|
+ // addTaskVoList: [
|
|
|
|
|
+ // {
|
|
|
|
|
+ // taskDesc: this.formAdd.taskDesc,
|
|
|
|
|
+ // taskEndTime: this.formAdd.taskEndTime,
|
|
|
|
|
+ // taskFirst: this.formAdd.taskFirst,
|
|
|
|
|
+ // taskName: this.formAdd.taskName,
|
|
|
|
|
+ // taskStartTime: this.formAdd.taskStartTime,
|
|
|
|
|
+ // annexs: [
|
|
|
|
|
+ // this.fillData
|
|
|
|
|
+ // ]
|
|
|
|
|
+ // }
|
|
|
|
|
+ // ],
|
|
|
|
|
+ },
|
|
|
|
|
+ haldDelete(row) {
|
|
|
|
|
+ this.$confirm('确认是否删除?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ this.$api.task.delTask({
|
|
|
|
|
+ id: row.id
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.$message.success(res.msg)
|
|
|
|
|
+ this.findPage()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.$message.error('已取消删除')
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ handleClose() {
|
|
|
|
|
+ this.dialogVisible = false
|
|
|
|
|
+ this.formAdd = {}
|
|
|
|
|
+ this.fillData = {}
|
|
|
|
|
+ this.fileList = []
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
|
+ .InvoicedAndSettled>>>.el-table__body-wrapper {
|
|
|
|
|
+ overflow-y: auto !important;
|
|
|
|
|
+ height: auto !important;
|
|
|
|
|
+ }
|
|
|
|
|
+</style>
|