|
@@ -26,22 +26,32 @@
|
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
|
:dic="changeTypeList"
|
|
:dic="changeTypeList"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
- :disabled="disabled"
|
|
|
|
|
|
|
+ :disabled="disabled || !selProject.id"
|
|
|
></avue-select>
|
|
></avue-select>
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
<tr>
|
|
|
<td class="doc-label">变更前</td>
|
|
<td class="doc-label">变更前</td>
|
|
|
- <td class="doc-input">
|
|
|
|
|
- <span v-if="!disabled">{{ selProject[formData.zdmc == 'xmfzr' ? 'xmfzrxm' : formData.zdmc] }}</span>
|
|
|
|
|
- <span>{{ formData.bgqdz }}</span>
|
|
|
|
|
|
|
+ <td class="doc-input" style="padding: 0;">
|
|
|
|
|
+ <!-- 项目预算 -->
|
|
|
|
|
+ <template v-if="formData.zdmc === 'xmyszemx'">
|
|
|
|
|
+ <div style="height: 31px; line-height: 31px; border-bottom: 1px solid #000;">总计:{{ selProject.xmysze }}万元</div>
|
|
|
|
|
+ <div class="year-list">
|
|
|
|
|
+ <div class="year-list-item" v-for="item of oldXmyszemxList" :key="item.year">
|
|
|
|
|
+ <div class="year" >{{ item.year }}</div>
|
|
|
|
|
+ <div class="year-input"> {{ item.amount }} </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <span v-else>{{ getChangeBeforeVal }}</span>
|
|
|
</td>
|
|
</td>
|
|
|
<td class="doc-label">变更后</td>
|
|
<td class="doc-label">变更后</td>
|
|
|
<td class="doc-input">
|
|
<td class="doc-input">
|
|
|
<el-input v-if="formData.zdmc === 'xmmc'" placeholder="请输入项目名称" v-model="formData.bghdz" :disabled="disabled" />
|
|
<el-input v-if="formData.zdmc === 'xmmc'" placeholder="请输入项目名称" v-model="formData.bghdz" :disabled="disabled" />
|
|
|
|
|
+ <!-- 项目结束时间 -->
|
|
|
<el-date-picker
|
|
<el-date-picker
|
|
|
- v-if="'xmkssj,xmjssj'.indexOf(formData.zdmc) > -1"
|
|
|
|
|
|
|
+ v-if="'xmjssj'.indexOf(formData.zdmc) > -1"
|
|
|
v-model="formData.bghdz"
|
|
v-model="formData.bghdz"
|
|
|
format="yyyy年MM月dd日"
|
|
format="yyyy年MM月dd日"
|
|
|
value-format="yyyy-MM-dd"
|
|
value-format="yyyy-MM-dd"
|
|
@@ -49,6 +59,7 @@
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
:disabled="disabled"
|
|
:disabled="disabled"
|
|
|
></el-date-picker>
|
|
></el-date-picker>
|
|
|
|
|
+ <!-- 项目负责人 -->
|
|
|
<avue-select
|
|
<avue-select
|
|
|
v-if="formData.zdmc === 'xmfzr'"
|
|
v-if="formData.zdmc === 'xmfzr'"
|
|
|
v-model="formData.bghdz"
|
|
v-model="formData.bghdz"
|
|
@@ -57,6 +68,33 @@
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
:disabled="disabled"
|
|
:disabled="disabled"
|
|
|
></avue-select>
|
|
></avue-select>
|
|
|
|
|
+ <!-- 项目状态 -->
|
|
|
|
|
+ <avue-select
|
|
|
|
|
+ v-if="formData.zdmc === 'status'"
|
|
|
|
|
+ v-model="formData.bghdz"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ :dic="projectStateList"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :disabled="disabled"
|
|
|
|
|
+ ></avue-select>
|
|
|
|
|
+ <!-- 所属二级单位 -->
|
|
|
|
|
+ <second-unit-cascader
|
|
|
|
|
+ v-if="formData.zdmc === 'xmsqdwid'"
|
|
|
|
|
+ v-model="formData.bghdz"
|
|
|
|
|
+ :disabled="disabled"
|
|
|
|
|
+ :yearAndMonth="currProjectYear"
|
|
|
|
|
+ style="width: 100%;"
|
|
|
|
|
+ />
|
|
|
|
|
+ <!-- 项目预算明细 -->
|
|
|
|
|
+ <div v-if="formData.zdmc === 'xmyszemx'" class="year-list">
|
|
|
|
|
+ <div style="height: 31px; line-height: 31px; border-bottom: 1px solid #000;">总计:{{ newXmysTotal }}万元</div>
|
|
|
|
|
+ <div class="year-list-item" v-for="item of newXmyszemxList" :key="item.year">
|
|
|
|
|
+ <div class="year" >{{ item.year }}</div>
|
|
|
|
|
+ <div class="year-input">
|
|
|
|
|
+ <input v-model="item.amount" type="number" style="padding: 0 6px;" :disabled="disabled" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
|
|
|
|
@@ -110,7 +148,6 @@
|
|
|
</table>
|
|
</table>
|
|
|
|
|
|
|
|
<div v-if="!disabled" class="btn-wrap" style="text-align: center; margin-top: 30px;">
|
|
<div v-if="!disabled" class="btn-wrap" style="text-align: center; margin-top: 30px;">
|
|
|
- <el-button style="width: 160px;" @click="handleResetBtn">重置</el-button>
|
|
|
|
|
<el-button type="primary" style="width: 160px;" @click="handleSaveBtn">保存</el-button>
|
|
<el-button type="primary" style="width: 160px;" @click="handleSaveBtn">保存</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -122,6 +159,8 @@ import { getList as getTechnicanRosterList } from "@/api/basicResource/technicia
|
|
|
import { save } from "@/api/projectManage/change";
|
|
import { save } from "@/api/projectManage/change";
|
|
|
import moment from "moment";
|
|
import moment from "moment";
|
|
|
import projectSelect from "@/components/project-select";
|
|
import projectSelect from "@/components/project-select";
|
|
|
|
|
+import secondUnitCascader from "@/components/second-unit-cascader";
|
|
|
|
|
+import Decimal from "decimal.js";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
props: {
|
|
props: {
|
|
@@ -133,7 +172,8 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
components: {
|
|
components: {
|
|
|
- projectSelect
|
|
|
|
|
|
|
+ projectSelect,
|
|
|
|
|
+ secondUnitCascader
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -141,22 +181,70 @@ export default {
|
|
|
formData: {
|
|
formData: {
|
|
|
attachment: []
|
|
attachment: []
|
|
|
},
|
|
},
|
|
|
|
|
+ // 变更类型
|
|
|
changeTypeList: [],
|
|
changeTypeList: [],
|
|
|
|
|
+
|
|
|
|
|
+ // 项目状态
|
|
|
|
|
+ projectStateList: [],
|
|
|
|
|
+
|
|
|
loading: false,
|
|
loading: false,
|
|
|
selProject: {},
|
|
selProject: {},
|
|
|
|
|
|
|
|
|
|
+ // 项目负责人列表
|
|
|
fzrList: [],
|
|
fzrList: [],
|
|
|
|
|
+
|
|
|
|
|
+ // 变更前预算明细
|
|
|
|
|
+ oldXmyszemxList: [],
|
|
|
|
|
+ // 变更后预算明细
|
|
|
|
|
+ newXmyszemxList: []
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
"formData.zdmc"(newVal) {
|
|
"formData.zdmc"(newVal) {
|
|
|
if (newVal == 'xmfzr') {
|
|
if (newVal == 'xmfzr') {
|
|
|
this.getTechnicanRosterListFunc(moment(this.selProject.xmkssj).format('yyyyMM'));
|
|
this.getTechnicanRosterListFunc(moment(this.selProject.xmkssj).format('yyyyMM'));
|
|
|
|
|
+ } else if (newVal == 'xmyszemx') {
|
|
|
|
|
+ this.oldXmyszemxList = JSON.parse(this.selProject.xmyszemx);
|
|
|
|
|
+ this.newXmyszemxList = JSON.parse(this.selProject.xmyszemx);
|
|
|
|
|
+ // JSON.parse(data.xmyszemx).forEach(item => {
|
|
|
|
|
+ // this.formData[item.year.toString()] = item.amount;
|
|
|
|
|
+ // });
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ // 当前项目所属年份
|
|
|
|
|
+ currProjectYear() {
|
|
|
|
|
+ return this.selProject.xmkssj ? moment(this.selProject.xmkssj).format('YYYY') : '';
|
|
|
|
|
+ },
|
|
|
|
|
+ yearList() {
|
|
|
|
|
+ return this.selProject && this.selProject.xmyszemx ? JSON.parse(this.selProject.xmyszemx) : [];
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取变更前的值
|
|
|
|
|
+ getChangeBeforeVal() {
|
|
|
|
|
+ if (this.formData.zdmc === 'xmfzr') {
|
|
|
|
|
+ return this.selProject.xmfzrxm;
|
|
|
|
|
+ } else if (this.formData.zdmc === 'xmsqdwid') {
|
|
|
|
|
+ return this.selProject.xmsqdw;
|
|
|
|
|
+ } else if (this.formData.zdmc === 'status') {
|
|
|
|
|
+ let _currStatusObj = this.projectStateList.find(item => item.value == this.selProject.status);
|
|
|
|
|
+ return _currStatusObj ? _currStatusObj.label: '';
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return this.selProject[this.formData.zdmc];
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // 变更后的预算总值
|
|
|
|
|
+ newXmysTotal() {
|
|
|
|
|
+ let total = new Decimal(0);
|
|
|
|
|
+ this.newXmyszemxList.forEach(item => {
|
|
|
|
|
+ total = total.add(new Decimal(item.amount || 0));
|
|
|
|
|
+ });
|
|
|
|
|
+ return total;
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.getDictList("xm_biangeng_field", "changeTypeList");
|
|
this.getDictList("xm_biangeng_field", "changeTypeList");
|
|
|
|
|
+ this.getDictList("project_state", "projectStateList");
|
|
|
this.currProjectId = this.projectId;
|
|
this.currProjectId = this.projectId;
|
|
|
|
|
|
|
|
this.formData = {
|
|
this.formData = {
|
|
@@ -183,6 +271,9 @@ export default {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ formatProjectStatus() {
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
handleProjectChange(data) {
|
|
handleProjectChange(data) {
|
|
|
this.selProject = data;
|
|
this.selProject = data;
|
|
|
},
|
|
},
|
|
@@ -196,10 +287,22 @@ export default {
|
|
|
errorText = '请输入变更原因';
|
|
errorText = '请输入变更原因';
|
|
|
} else if (!this.formData.bgsxsj) {
|
|
} else if (!this.formData.bgsxsj) {
|
|
|
errorText = '请选择变更生效时间';
|
|
errorText = '请选择变更生效时间';
|
|
|
- } else if (!this.formData.bghdz) {
|
|
|
|
|
- errorText = '请输入变更后的值';
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (this.formData.zdmc == 'xmyszemx') {
|
|
|
|
|
+ for (let i=0; i<this.newXmyszemxList.length; i++) {
|
|
|
|
|
+ let _item = this.newXmyszemxList[i];
|
|
|
|
|
+ if (_item.amount === null || _item.amount === undefined || _item.amount === '') {
|
|
|
|
|
+ errorText = `请填写${_item.year}年的预算`;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (!this.formData.bghdz || (this.formData.bghdz instanceof Array && !this.formData.bghdz.length)) {
|
|
|
|
|
+ errorText = '变更后的值不能为空!';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return errorText;
|
|
return errorText;
|
|
|
},
|
|
},
|
|
|
handleResetBtn() {
|
|
handleResetBtn() {
|
|
@@ -216,9 +319,16 @@ export default {
|
|
|
...this.formData,
|
|
...this.formData,
|
|
|
bgqdz: this.selProject[this.formData.zdmc],
|
|
bgqdz: this.selProject[this.formData.zdmc],
|
|
|
attachment: JSON.stringify(this.formData.attachment),
|
|
attachment: JSON.stringify(this.formData.attachment),
|
|
|
- xmId: this.currProjectId
|
|
|
|
|
|
|
+ xmId: this.currProjectId,
|
|
|
|
|
+ zdmc: this.formData.zdmc.toUpperCase()
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ if (this.formData.zdmc === 'xmyszemx') {
|
|
|
|
|
+ params.bghdz = JSON.stringify(this.newXmyszemxList);
|
|
|
|
|
+ } else if (this.formData.zdmc === 'xmsqdwid') {
|
|
|
|
|
+ params.bghdz = params.bghdz[params.bghdz.length - 1];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
this.saveData(params);
|
|
this.saveData(params);
|
|
|
},
|
|
},
|
|
|
saveData(params) {
|
|
saveData(params) {
|
|
@@ -273,4 +383,27 @@ table {
|
|
|
tr td {
|
|
tr td {
|
|
|
border: 1px solid #333;
|
|
border: 1px solid #333;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+.year-list {
|
|
|
|
|
+ &-item {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ height: 32px;
|
|
|
|
|
+ line-height: 32px;
|
|
|
|
|
+ border-bottom: 1px solid #333;
|
|
|
|
|
+ &:last-child {
|
|
|
|
|
+ border-bottom: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ .year {
|
|
|
|
|
+ width: 65px;
|
|
|
|
|
+ border-right: 1px solid #333;
|
|
|
|
|
+ }
|
|
|
|
|
+ .year-input {
|
|
|
|
|
+ padding-left: 12px;
|
|
|
|
|
+ input {
|
|
|
|
|
+ border: none;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|