Commit 1c12a9fa authored by tianhongyang's avatar tianhongyang

merge

parent 7a145e5f
<template> <template>
<el-dialog title="填写实际成本" :visible="comDialogStatus" class="add-actual-cost-container"> <el-dialog title="填写实际成本" :visible="comDialogStatus" class="add-actual-cost-container" @close="dialogClose">
<div class="dialog-content-inner">
<!-- 成本年份 -->
<div class="cost-year-container">
<span>成本年份</span>
<el-date-picker v-model="time" type="month" placeholder="请选择所需要添加的成本月份" format="yyyy年MM月" value-format="yyyy-MM" class="project-record-date"
@change="timeChange" :picker-options="pickerOptions"></el-date-picker>
</div>
</div>
<!-- 底部按钮 -->
<div class="dialog-content-footer">
<div class="cancel-or-ok">
<el-button size="medium" @click="cancel" class="cancel-select-year">取消</el-button>
<el-button type="primary" size="medium" @click="ok" class="ok-select-year">确定</el-button>
</div>
</div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import dayjs from "dayjs";
export default { export default {
name: "AddActualCost", name: "AddActualCost",
props: { props: {
dialogStatus: { dialogStatus: {
type: Boolean, type: Boolean,
default: false default: false
},
projectCreateTime: {
type: String,
default: ""
} }
}, },
model: { model: {
...@@ -23,7 +44,11 @@ export default { ...@@ -23,7 +44,11 @@ export default {
}, },
data() { data() {
return { return {
comDialogStatus: this.dialogStatus comDialogStatus: this.dialogStatus,
time: "",
pickerOptions: {
disabledDate: this.disabledDateHandler
}
}; };
}, },
//可访问data属性 //可访问data属性
...@@ -36,7 +61,44 @@ export default { ...@@ -36,7 +61,44 @@ export default {
}, },
//方法集 //方法集
methods: { methods: {
// 时间选择变化
timeChange(time) {
// console.log(time);
},
cancel() {
this.comDialogStatus = false;
},
ok() {
if (!this.time) {
return this.$message.error("请选择成本年份");
}
// 发布事件
this.$emit("timeSelect", dayjs(this.time).format("YYYYMM"));
this.comDialogStatus = false;
},
reset() {
this.time = "";
},
dialogClose() {
this.$emit("dialogStatusChange", false);
this.reset();
},
disabledDateHandler(optionTime) {
// 选项年月
const _optionTime = dayjs(optionTime).format("YYYYMM");
// 当前项目年月
const _thresholdTime = dayjs(this.projectCreateTime).format("YYYYMM");
// 当前项目年
const _thresholdYear = _thresholdTime.slice(0, 4);
// 当前项目月份 补0
const _thresholdMonth = _thresholdTime.slice(4);
// 是否小于当前项目年月 或 大于 当前项目年月 往后推五年
const lastYearMonth = parseInt(`${parseInt(_thresholdYear) + 5}${_thresholdMonth}`);;
if (parseInt(_optionTime) < parseInt(_thresholdTime) || parseInt(_optionTime) > lastYearMonth) {
return true;
}
return false;
}
}, },
} }
</script> </script>
...@@ -58,6 +120,7 @@ export default { ...@@ -58,6 +120,7 @@ export default {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid #eeeeee; border-bottom: 1px solid #eeeeee;
box-sizing: border-box;
.el-dialog__title { .el-dialog__title {
font-size: 16px; font-size: 16px;
...@@ -78,9 +141,84 @@ export default { ...@@ -78,9 +141,84 @@ export default {
.el-dialog__body { .el-dialog__body {
padding: 0px; padding: 0px;
box-sizing: border-box;
.dialog-content-inner {
min-height: 120px; min-height: 120px;
padding: 24px 20px; padding: 24px 20px;
}
.cost-year-container {
display: flex;
align-items: center;
& > span {
color: rgba(35, 35, 35, 0.8);
font-size: 14px;
margin-right: 16px;
white-space: nowrap;
}
.project-record-date {
width: 100%;
.el-input__inner {
height: 30px;
line-height: 30px;
padding: 0px 12px;
border-radius: 2px;
border-color: #dcdfe6;
font-size: 14px;
color: #232323;
font-weight: 350;
}
.el-input__suffix {
right: 12px;
.el-input__icon {
line-height: 30px;
width: auto;
}
}
.el-input__prefix {
display: none;
}
}
}
.dialog-content-footer {
height: 64px;
padding: 0px 20px;
display: flex;
justify-content: flex-end;
align-items: center;
border-top: 1px solid #eeeeee;
box-sizing: border-box; box-sizing: border-box;
.cancel-or-ok {
display: flex;
height: 100%;
align-items: center;
.el-button {
padding: 0px 16px;
display: flex;
align-items: center;
justify-content: center;
height: 32px;
font-size: 14px;
&.cancel-select-year {
color: rgba(35, 35, 35, 0.8);
border: 1px solid #dcdfe6;
background: #fff;
}
&.ok-select-year {
background: #0081ff;
border-color: #0081ff;
}
}
}
}
} }
} }
} }
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
<div class="right-table-list-container"> <div class="right-table-list-container">
<div class="project-table-list-header"> <div class="project-table-list-header">
<div class="project-table-list-haeder-left"> <div class="project-table-list-haeder-left">
<!-- <el-date-picker v-model="recordDate" type="month" placeholder="选择月" format="yyyy年MM月" value-format="yyyy-MM"
class="project-record-date" @change="timeChange"></el-date-picker> -->
<el-select v-model="recordDate" placeholder="请选择年月" class="project-month-select-options" clearable @change="monthChange"> <el-select v-model="recordDate" placeholder="请选择年月" class="project-month-select-options" clearable @change="monthChange">
<el-option v-for="item in monthList" :key="item.value" :label="item.label" :value="item.value"> <el-option v-for="item in monthList" :key="item.value" :label="item.label" :value="item.value">
</el-option> </el-option>
...@@ -28,7 +26,8 @@ ...@@ -28,7 +26,8 @@
<!-- 实体工程材料单位换算 --> <!-- 实体工程材料单位换算 -->
<el-button type="primary" size="medium" class="unit-conversion-btn" v-if="currentParentName.indexOf('实体工程材料') != -1">单位换算</el-button> <el-button type="primary" size="medium" class="unit-conversion-btn" v-if="currentParentName.indexOf('实体工程材料') != -1">单位换算</el-button>
<!-- 填写实际成本 --> <!-- 填写实际成本 -->
<el-button type="primary" size="medium" class="actual-cost-btn" v-else @click="fillActualCost">填写实际成本</el-button> <el-button type="primary" size="medium" class="actual-cost-btn" v-else
@click="fillActualCost">{{addActualCostEditStatus ? '保存成本' : '填写实际成本'}}</el-button>
<!-- 表头设置组件 --> <!-- 表头设置组件 -->
<dsk-table-header-setting :settingList="formColum" @settingChange="settingChange"></dsk-table-header-setting> <dsk-table-header-setting :settingList="formColum" @settingChange="settingChange"></dsk-table-header-setting>
</div> </div>
...@@ -50,7 +49,7 @@ ...@@ -50,7 +49,7 @@
</div> </div>
<!-- 填写实际成本触发 --> <!-- 填写实际成本触发 -->
<add-actual-cost v-model="showAddActualCost"></add-actual-cost> <add-actual-cost v-model="showAddActualCost" :project-create-time="projectDetailInfo.createTime" @timeSelect="timeSelect"></add-actual-cost>
</div> </div>
</template> </template>
...@@ -178,7 +177,11 @@ export default { ...@@ -178,7 +177,11 @@ export default {
tableDataList: [], tableDataList: [],
statisticsParentName: ["劳务分包工程", "专业分包工程"], statisticsParentName: ["劳务分包工程", "专业分包工程"],
// 填写实际成本弹窗 // 填写实际成本弹窗
showAddActualCost: false showAddActualCost: false,
// 填写实际成本 编辑状态
addActualCostEditStatus: false,
// 当前选择的成本年份
selectActualCostTime: ""
}; };
}, },
//可访问data属性 //可访问data属性
...@@ -345,6 +348,7 @@ export default { ...@@ -345,6 +348,7 @@ export default {
} }
}, },
monthChange(month) { monthChange(month) {
this.resetEditStatus();
// 当前月 // 当前月
const _now = dayjs(new Date().valueOf()).format("YYYYMM"); const _now = dayjs(new Date().valueOf()).format("YYYYMM");
// 请求列表参数 // 请求列表参数
...@@ -364,6 +368,7 @@ export default { ...@@ -364,6 +368,7 @@ export default {
this.getFeedSummaryList(params); this.getFeedSummaryList(params);
}, },
menuSelect(currentId, currentTemp) { menuSelect(currentId, currentTemp) {
this.resetEditStatus();
this.currentNodeName = currentId; this.currentNodeName = currentId;
const parentName = currentTemp.parent ? this.getCurrentType(currentTemp.parent) : currentId; const parentName = currentTemp.parent ? this.getCurrentType(currentTemp.parent) : currentId;
if (parentName) this.currentParentName = parentName; if (parentName) this.currentParentName = parentName;
...@@ -379,10 +384,6 @@ export default { ...@@ -379,10 +384,6 @@ export default {
return this.getCurrentType(parent.parent); return this.getCurrentType(parent.parent);
} }
}, },
// 时间选择变化
timeChange(time) {
console.log(time);
},
// 表头设置变化 // 表头设置变化
async settingChange(use) { async settingChange(use) {
try { try {
...@@ -394,6 +395,28 @@ export default { ...@@ -394,6 +395,28 @@ export default {
// 填写或修改新的 成本月份 // 填写或修改新的 成本月份
fillActualCost() { fillActualCost() {
this.showAddActualCost = true; this.showAddActualCost = true;
},
resetEditStatus() {
this.addActualCostEditStatus = false;
this.selectActualCostTime = "";
},
async timeSelect(selectTime) {
// 编辑状态
this.addActualCostEditStatus = true;
this.selectActualCostTime = selectTime;
// 判断是否包含 选择的年月 包含则修改 未包含则新增
const findReslut = this.originMonthList.includes(selectTime);
// 包含所选月
if (findReslut) {
this.recordDate = selectTime;
const params = this.createRequestConditions();
params["recordDate"] = selectTime;
// 获取选中月数据
await this.getFeedSummaryList(params);
} else {
// 不包含当前所选月 新增数据
}
} }
}, },
} }
...@@ -430,29 +453,6 @@ export default { ...@@ -430,29 +453,6 @@ export default {
.project-table-list-haeder-left { .project-table-list-haeder-left {
display: flex; display: flex;
align-items: center; align-items: center;
.project-record-date {
width: 140px;
.el-input__inner {
height: 32px;
line-height: 32px;
padding: 0px 12px;
border-radius: 2px;
border-color: #dcdfe6;
font-size: 14px;
color: #232323;
font-weight: 350;
}
.el-input__suffix {
right: 12px;
.el-input__icon {
line-height: 32px;
width: auto;
}
}
.el-input__prefix {
display: none;
}
}
.project-month-select-options { .project-month-select-options {
width: 140px; width: 140px;
.el-input__inner { .el-input__inner {
......
...@@ -193,8 +193,8 @@ export default { ...@@ -193,8 +193,8 @@ export default {
const detail = await getProjectDetailApi(projectId); const detail = await getProjectDetailApi(projectId);
if (detail.code == 200 && detail.data) { if (detail.code == 200 && detail.data) {
if (detail.data.id) detail.data["projectId"] = detail.data.id; if (detail.data.id) detail.data["projectId"] = detail.data.id;
// detail.data["projectId"] = "1754425038355890177"; detail.data["projectId"] = "1754425038355890177";
// detail.data["cbStage"] = 0; detail.data["cbStage"] = 0;
this.detailInfo = detail.data; this.detailInfo = detail.data;
} }
} catch (error) { } catch (error) {
......
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