|
@@ -17,34 +17,22 @@
|
|
|
|
|
|
<el-table :data="list" style="width: 100%;margin-bottom: 20px;margin-top: 20px;" row-key="id" lazy>
|
|
|
<el-table-column label="序号" prop="id" sortable align="center" min-width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.id }}</span>
|
|
|
- </template>
|
|
|
+ <template slot-scope="scope">{{ scope.row.id }}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="项目名称" min-width="200px" align="center">
|
|
|
- <template v-slot="scope">
|
|
|
- <el-tooltip content="点击进入详情页面" placement="top"><el-tag class="tag" @click="projectShowData(scope.row.id, scope.row)">{{ scope.row.name }}</el-tag></el-tooltip>
|
|
|
- </template>
|
|
|
+ <template v-slot="scope"><el-tag style="cursor: pointer;" @click="projectShowData(scope.row.id, scope.row)">{{ scope.row.name }}</el-tag></template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="状态" min-width="80px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tag type="success"><span>{{ scope.row.statusString }}</span></el-tag>
|
|
|
- </template>
|
|
|
+ <template slot-scope="scope"><el-tag type="success">{{ scope.row.statusString }}</el-tag></template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="创建时间" min-width="200px" align="center">
|
|
|
- <template slot-scope="{row}">
|
|
|
- <span>{{ row.createTime }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="上线时间" min-width="200px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.allOnlineTime }}</span>
|
|
|
- </template>
|
|
|
+ <template slot-scope="{row}">{{ row.createTime }}</template>
|
|
|
</el-table-column>
|
|
|
+ <!-- <el-table-column label="上线时间" min-width="200px" align="center">
|
|
|
+ <template slot-scope="scope">{{ scope.row.allOnlineTime }}</template>
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column v-if="statusproject" label="进展" min-width="200px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.stageString }}</span>
|
|
|
- </template>
|
|
|
+ <template slot-scope="scope">{{ scope.row.stageString }}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" min-width="250px" class-name="small-padding fixed-width" fixed="right">
|
|
|
<template slot-scope="{row}">
|
|
@@ -53,25 +41,19 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <el-pagination
|
|
|
- :current-page="curIndex"
|
|
|
- :page-sizes="[5, 10, 20]"
|
|
|
- :page-size="pageSize"
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="total"
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- />
|
|
|
+ <el-pagination :current-page="curIndex" :page-sizes="[5, 10, 20]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
|
|
+
|
|
|
+ <!----------------------------- 项目新增 ------------------------------>
|
|
|
|
|
|
- <el-dialog :title="titleName" width="80%" :visible.sync="dialogFormVisible" @close="closeDialog">
|
|
|
- <el-form ref="serviceDataForms" :model="form" :rules="serviceDataRules" style="width:93%;">
|
|
|
+ <el-dialog title="项目新增" width="80%" :visible.sync="dialogFormVisible" @close="closeDialog">
|
|
|
+ <el-form ref="form" :model="form" :rules="serviceDataRules" style="width:93%;">
|
|
|
<el-form-item label="项目名称" prop="name" :label-width="formLabelWidths">
|
|
|
<el-input v-model="form.name" autocomplete="off" placeholder="项目名称" />
|
|
|
</el-form-item>
|
|
|
<div style="display: flex;">
|
|
|
<div style="flex:1;">
|
|
|
- <el-form-item label="业务线" prop="bizIdString" :label-width="formLabelWidths">
|
|
|
- <el-select v-model="form.bizIdString" placeholder="业务线">
|
|
|
+ <el-form-item label="业务线" prop="bizId" :label-width="formLabelWidths">
|
|
|
+ <el-select v-model="form.bizId" placeholder="业务线">
|
|
|
<el-option v-for="item in bizOptions" :key="item.value" :label="item.name" :value="item.name" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -202,59 +184,61 @@
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="dialogFormVisible = true, titleName === '新增'?createCode(form):updateData(form)">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="dialogFormVisible = true, createCode(form)">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog :title="titleName" width="80%" :visible.sync="dialogFormVisible1" @close="closeDialog">
|
|
|
- <el-form ref="serviceDataForms" :model="form" :rules="serviceDataRules" style="width:93%;">
|
|
|
+ <!----------------------------- 项目编辑 ------------------------------>
|
|
|
+
|
|
|
+ <el-dialog title="项目编辑" width="80%" :visible.sync="dialogFormVisible1" @close="closeDialog">
|
|
|
+ <el-form ref="formQuery" :model="formQuery" :rules="serviceDataRules" style="width:93%;">
|
|
|
<el-form-item label="项目名称" prop="name" :label-width="formLabelWidths">
|
|
|
- <el-input v-model="form.name" autocomplete="off" placeholder="项目名称" />
|
|
|
+ <el-input v-model="formQuery.name" autocomplete="off" placeholder="项目名称" />
|
|
|
</el-form-item>
|
|
|
<div style="display: flex;">
|
|
|
<div style="flex:1;">
|
|
|
- <el-form-item label="业务线" prop="bizIdString" :label-width="formLabelWidths">
|
|
|
- <el-select v-model="form.bizIdString" placeholder="业务线">
|
|
|
+ <el-form-item label="业务线" prop="bizId" :label-width="formLabelWidths">
|
|
|
+ <el-select v-model="formQuery.bizId" placeholder="业务线">
|
|
|
<el-option v-for="item in bizOptions" :key="item.value" :label="item.name" :value="item.name" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="状态" prop="statusString" :label-width="formLabelWidths">
|
|
|
- <el-select v-model="form.statusString" placeholder="状态">
|
|
|
+ <el-select v-model="formQuery.statusString" placeholder="状态">
|
|
|
<el-option v-for="item in statusOptionss" :key="item.value" :label="item.name" :value="item.name" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="平台类型" prop="platForm" :label-width="formLabelWidths">
|
|
|
- <el-select v-model="form.platForm" placeholder="平台类型">
|
|
|
+ <el-select v-model="formQuery.platForm" placeholder="平台类型">
|
|
|
<el-option v-for="item in platFormString" :key="item.code" :label="item.name" :value="item.code" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div style="flex:1;">
|
|
|
<el-form-item label="优先级" prop="priorityString" :label-width="formLabelWidths">
|
|
|
- <el-select v-model="form.priorityString" placeholder="优先级">
|
|
|
+ <el-select v-model="formQuery.priorityString" placeholder="优先级">
|
|
|
<el-option v-for="item in priorityStrings" :key="item.value" :label="item.name" :value="item.name" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="进展" prop="stageString" :label-width="formLabelWidths">
|
|
|
- <el-select v-model="form.stageString" placeholder="进展">
|
|
|
+ <el-select v-model="formQuery.stageString" placeholder="进展">
|
|
|
<el-option v-for="item in stageStrings" :key="item.value" :label="item.name" :value="item.name" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div style="flex:1;">
|
|
|
<el-form-item label="PM" prop="pm" :label-width="formLabelWidths">
|
|
|
- <el-input v-model="form.pm" autocomplete="off" />
|
|
|
+ <el-input v-model="formQuery.pm" autocomplete="off" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="版本" :label-width="formLabelWidths">
|
|
|
- <el-input v-model="form.version" autocomplete="off" />
|
|
|
+ <el-input v-model="formQuery.version" autocomplete="off" />
|
|
|
</el-form-item>
|
|
|
<el-form-item v-show="false" label="创建人" :label-width="formLabelWidths">
|
|
|
- <el-input v-model="form.creater" autocomplete="off" />
|
|
|
+ <el-input v-model="formQuery.creater" autocomplete="off" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-form-item label="需求文档" :label-width="formLabelWidths">
|
|
|
- <el-input v-model="form.mrdUrl" autocomplete="off" />
|
|
|
+ <el-input v-model="formQuery.mrdUrl" autocomplete="off" />
|
|
|
</el-form-item>
|
|
|
<el-button type="primary" round size="mini" icon="el-icon-arrow-down" style="cursor: pointer;" @click="show2 = !show2">详细添加</el-button>
|
|
|
<transition name="el-zoom-in-top">
|
|
@@ -262,18 +246,18 @@
|
|
|
<div style="display: flex;">
|
|
|
<div style="flex;1;">
|
|
|
<el-form-item label="UE " :label-width="formLabelWidths">
|
|
|
- <el-input v-model="form.ue" style="width:220px;" autocomplete="off" />
|
|
|
+ <el-input v-model="formQuery.ue" style="width:220px;" autocomplete="off" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="UI " :label-width="formLabelWidths">
|
|
|
- <el-input v-model="form.ui" style="width:220px;" autocomplete="off" />
|
|
|
+ <el-input v-model="formQuery.ui" style="width:220px;" autocomplete="off" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div style="flex:1;margin-left:135px;">
|
|
|
<el-form-item label="RD " :label-width="formLabelWidths">
|
|
|
- <el-input v-model="form.rd" style="width:220px;" autocomplete="off" />
|
|
|
+ <el-input v-model="formQuery.rd" style="width:220px;" autocomplete="off" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="QA " :label-width="formLabelWidths">
|
|
|
- <el-input v-model="form.qa" style="width:220px;" autocomplete="off" />
|
|
|
+ <el-input v-model="formQuery.qa" style="width:220px;" autocomplete="off" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -285,16 +269,16 @@
|
|
|
</transition>
|
|
|
<div style="display: flex; padding-top:30px; width: 100%;">
|
|
|
<el-form-item label="备注" style="flex:1;" label-width="180px">
|
|
|
- <el-input v-model="form.remarks" type="textarea" :rows="4" placeholder="备注" />
|
|
|
+ <el-input v-model="formQuery.remarks" type="textarea" :rows="4" placeholder="备注" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="描述" style="flex:1;" label-width="130px">
|
|
|
- <el-input v-model="form.description" type="textarea" :rows="4" placeholder="请输入内容" />
|
|
|
+ <el-input v-model="formQuery.description" type="textarea" :rows="4" placeholder="请输入内容" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogFormVisible1 = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="dialogFormVisible1 = true, titleName === '新增'?createCode(form):updateData(form)">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="dialogFormVisible1 = true, updateData(formQuery)">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -308,11 +292,11 @@ export default {
|
|
|
name: 'Projects',
|
|
|
data() {
|
|
|
return {
|
|
|
+ show: false,
|
|
|
list: [],
|
|
|
show2: false,
|
|
|
test: false,
|
|
|
time: false,
|
|
|
- titleName: '',
|
|
|
formLabelWidths: '160px',
|
|
|
formLabelWidth: '150px',
|
|
|
curIndex: 1, // 初始页
|
|
@@ -339,6 +323,7 @@ export default {
|
|
|
bizJson: '',
|
|
|
deleteCode: '',
|
|
|
userData: '',
|
|
|
+ formQuery: {},
|
|
|
pickerOptions: {
|
|
|
disabledDate(time) {
|
|
|
return time.getTime() > Date.now()
|
|
@@ -373,7 +358,7 @@ export default {
|
|
|
notest: [{ required: true, message: '是否免测不能为空', trigger: 'change' }],
|
|
|
type: [{ required: true, message: '平台类型不能为空', trigger: 'change' }],
|
|
|
name: [{ required: true, message: '项目名称不能为空', trigger: 'change' }],
|
|
|
- bizIdString: [{ required: true, message: '业务线不能为空', trigger: 'change' }],
|
|
|
+ bizId: [{ required: true, message: '业务线不能为空', trigger: 'change' }],
|
|
|
statusString: [{ required: true, message: '状态不能为空', trigger: 'change' }],
|
|
|
priorityString: [{ required: true, message: '优先级不能为空', trigger: 'change' }],
|
|
|
stageString: [{ required: true, message: '进展不能为空', trigger: 'change' }],
|
|
@@ -398,10 +383,32 @@ export default {
|
|
|
pageSize: this.pageSize,
|
|
|
curIndex: this.curIndex
|
|
|
}
|
|
|
- projectInit(this.queryListData).then(response => {
|
|
|
- this.list = response.data
|
|
|
- this.total = this.list.length
|
|
|
- this.platFormString = response.query.platformTypeEnumList
|
|
|
+ projectInit(this.queryListData).then(res => {
|
|
|
+ if (res.data === null) {
|
|
|
+ this.list = []
|
|
|
+ this.total = 0
|
|
|
+ } else {
|
|
|
+ this.list = res.data
|
|
|
+ this.total = this.list.length
|
|
|
+ }
|
|
|
+ this.platFormString = res.query.platformTypeEnumList
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // dialog返回数据
|
|
|
+ createdData(data) {
|
|
|
+ this.bizData = data
|
|
|
+ typeof (this.timeInfo) === 'string' ? this.bizData.timeInfo = this.timeInfo : ''
|
|
|
+ this.userData = { ename: this.userInformation, name: this.userNames }
|
|
|
+ this.objData = { projectInfo: this.bizData, user: this.userData }
|
|
|
+ addProject(this.objData).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.getList()
|
|
|
+ this.successFun(response.msg)
|
|
|
+ this.show = false
|
|
|
+ } else {
|
|
|
+ this.errorFun(response.msg)
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -412,12 +419,11 @@ export default {
|
|
|
this.timeInfo.customConfig.onchange = (html) => { this.timeInfo = html }
|
|
|
},
|
|
|
|
|
|
- // 新建项目
|
|
|
+ // 点击新建项目
|
|
|
changeaddData() {
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs['serviceDataForms'].clearValidate()
|
|
|
+ this.$refs['form'].clearValidate()
|
|
|
})
|
|
|
- this.titleName = '新增'
|
|
|
|
|
|
setTimeout(() => {
|
|
|
this.testInfo.customConfig.uploadImgServer = '/upload-img' // 上传图片到服务器
|
|
@@ -441,10 +447,12 @@ export default {
|
|
|
this.form = {}
|
|
|
},
|
|
|
|
|
|
+ // 新建项目
|
|
|
createCode(vel) {
|
|
|
- this.$refs['serviceDataForms'].validate((valid) => {
|
|
|
+ this.$refs['form'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.bizData = vel
|
|
|
+ console.log(this.bizData)
|
|
|
typeof (this.timeInfo) === 'string' ? this.bizData.timeInfo = this.timeInfo : ''
|
|
|
for (var a of this.statusOptionss) {
|
|
|
vel.statusString === a.name ? this.bizData.status = a.value : ''
|
|
@@ -455,18 +463,20 @@ export default {
|
|
|
for (var f of this.stageStrings) {
|
|
|
vel.stageString === f.name ? this.bizData.stage = f.value : ''
|
|
|
}
|
|
|
- this.bizData.bizId = this.bizJson
|
|
|
+ for (var e of this.bizOptions) {
|
|
|
+ vel.bizId === e.name ? this.bizData.bizId = e.value : ''
|
|
|
+ }
|
|
|
} else {
|
|
|
console.log('error submit!!')
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
- this.userData = { id: '', ename: this.userInformation, name: this.userNames }
|
|
|
+ this.userData = { ename: this.userInformation, name: this.userNames }
|
|
|
this.objData = { projectInfo: this.bizData, user: this.userData }
|
|
|
addProject(this.objData).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
this.getList()
|
|
|
- this.successFun()
|
|
|
+ this.successFun(response.msg)
|
|
|
this.dialogFormVisible = false
|
|
|
} else {
|
|
|
this.errorFun(response.msg)
|
|
@@ -475,6 +485,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ // 关闭dialog回掉
|
|
|
closeDialog() {
|
|
|
this.testInfo = new E('#testInfo')
|
|
|
this.timeInfo = new E('#timeInfo')
|
|
@@ -485,12 +496,14 @@ export default {
|
|
|
|
|
|
// 项目编辑
|
|
|
changeData(vel) {
|
|
|
- this.titleName = '编辑'
|
|
|
for (var a of this.list) {
|
|
|
if (a.id === vel.id) {
|
|
|
- this.form = a
|
|
|
+ this.formQuery = a
|
|
|
}
|
|
|
}
|
|
|
+ for (var e of this.bizOptions) {
|
|
|
+ this.formQuery.bizId === e.value ? this.formQuery.bizId = e.name : ''
|
|
|
+ }
|
|
|
for (var b of this.platFormString) {
|
|
|
b.code === this.projectData.platForm ? this.projectData.platForm = b.name : ''
|
|
|
}
|
|
@@ -504,10 +517,11 @@ export default {
|
|
|
this.timeInfo.customConfig.menus = ['bold', 'foreColor', 'italic', 'underline', 'list', 'justify', 'table']
|
|
|
this.timeInfo.customConfig.onchange = (html) => { this.timeInfo = html }
|
|
|
this.timeInfo.create()
|
|
|
- this.timeInfo.txt.html(this.form.timeInfo)
|
|
|
+ this.timeInfo.txt.html(this.formQuery.timeInfo)
|
|
|
}, 100)
|
|
|
},
|
|
|
|
|
|
+ // 项目编辑提交
|
|
|
updateData(vel) {
|
|
|
this.bizData = vel
|
|
|
typeof (this.timeInfo) === 'string' ? this.bizData.timeInfo = this.timeInfo : ''
|
|
@@ -518,7 +532,7 @@ export default {
|
|
|
vel.priorityString === s.name ? this.bizData.priority = s.value : ''
|
|
|
}
|
|
|
for (var d of this.bizOptions) {
|
|
|
- vel.bizIdString === d.name ? this.bizData.bizId = d.value : ''
|
|
|
+ vel.bizId === d.name ? this.bizData.bizId = d.value : ''
|
|
|
}
|
|
|
for (var f of this.stageStrings) {
|
|
|
vel.stageString === f.name ? this.bizData.stage = f.value : ''
|
|
@@ -530,9 +544,9 @@ export default {
|
|
|
} else {
|
|
|
this.bizData.id = vel.id
|
|
|
}
|
|
|
- this.bizData.status = vel.status
|
|
|
- this.bizData.priority = vel.priority
|
|
|
- this.bizData.stage = vel.stage
|
|
|
+ // this.bizData.status = vel.status
|
|
|
+ // this.bizData.priority = vel.priority
|
|
|
+ // this.bizData.stage = vel.stage
|
|
|
this.userData = { id: '', ename: this.userInformation, name: this.userNames }
|
|
|
this.objData = { projectInfo: this.bizData, user: this.userData }
|
|
|
updateProject(this.objData).then(response => {
|
|
@@ -573,7 +587,6 @@ export default {
|
|
|
deleteProject(e, this.userData).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
this.getList()
|
|
|
- this.successFun()
|
|
|
} else {
|
|
|
this.errorFun(response.msg)
|
|
|
}
|
|
@@ -629,7 +642,4 @@ export default {
|
|
|
border: 2px solid #ccc;
|
|
|
height: auto;
|
|
|
}
|
|
|
- .tag {
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
</style>
|