Commit bd976fd9 authored by 王鑫's avatar 王鑫

feat: 项目成本表添加项目状态

parent c5122f12
...@@ -22,6 +22,31 @@ ...@@ -22,6 +22,31 @@
<a-range-picker @change="onChange" /> <a-range-picker @change="onChange" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="6">
<a-form-item
label="项目状态"
:labelCol="{ span: 8 }"
:wrapperCol="{ span: 16 }"
>
<a-select style="width: 150px" @change="onStatusChange">
<a-select-option value="unfinished">
未完成
</a-select-option>
<a-select-option value="wait">
未开始
</a-select-option>
<a-select-option value="doing">
进行中
</a-select-option>
<a-select-option value="suspended">
已挂起
</a-select-option>
<a-select-option value="closed">
已关闭
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row> </a-row>
</div> </div>
</a-form> </a-form>
...@@ -46,6 +71,9 @@ ...@@ -46,6 +71,9 @@
</a-button-group> </a-button-group>
</div> </div>
</div> </div>
<div slot="projectStatus" slot-scope="text">
<a-tag :color="colorMap[text]">{{text}}</a-tag>
</div>
</a-table> </a-table>
</div> </div>
</a-card> </a-card>
...@@ -57,6 +85,13 @@ import { formatDate } from "@/util/util"; ...@@ -57,6 +85,13 @@ import { formatDate } from "@/util/util";
const dataSource = []; const dataSource = [];
const columns = [ const columns = [
{ title: "名称", dataIndex: "name", align: "left" }, { title: "名称", dataIndex: "name", align: "left" },
{
title: "项目状态",
width: 130,
dataIndex: "projectStatus",
align: "center",
scopedSlots: { customRender: 'projectStatus' },
},
{ {
title: "最早登记时间", title: "最早登记时间",
width: 130, width: 130,
...@@ -87,6 +122,7 @@ export default { ...@@ -87,6 +122,7 @@ export default {
isFirstLoad: true, isFirstLoad: true,
query: { query: {
projectName: "", projectName: "",
projectStatus:"",
beginDate: null, beginDate: null,
endDate: null, endDate: null,
}, },
...@@ -95,6 +131,12 @@ export default { ...@@ -95,6 +131,12 @@ export default {
loading: false, loading: false,
columns: columns, columns: columns,
dataSource: dataSource, dataSource: dataSource,
colorMap :{
"未开始": "cyan",
"进行中": "green",
"已挂起": "orange",
"已关闭": "red",
}
}; };
}, },
methods: { methods: {
...@@ -104,6 +146,10 @@ export default { ...@@ -104,6 +146,10 @@ export default {
this.query.endDate = dateString[1]; this.query.endDate = dateString[1];
} }
}, },
onStatusChange(value){
console.log(value)
this.query.projectStatus = value;
},
search() { search() {
this.loadData(); this.loadData();
}, },
......
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