|
|
@@ -52,6 +52,7 @@
|
|
|
placeholder="实际入库时间"
|
|
|
format="YYYY-MM-DD"
|
|
|
value-format="YYYY-MM-DD"
|
|
|
+ @change="changeStorageTime"
|
|
|
/>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
@@ -177,6 +178,7 @@
|
|
|
placeholder="实际开工时间"
|
|
|
format="YYYY-MM-DD"
|
|
|
value-format="YYYY-MM-DD"
|
|
|
+ @change="changeStartTime"
|
|
|
/>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
@@ -205,6 +207,7 @@
|
|
|
placeholder="实际竣工时间"
|
|
|
format="YYYY-MM-DD"
|
|
|
value-format="YYYY-MM-DD"
|
|
|
+ @change="changeCompletionTime"
|
|
|
/>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
@@ -256,8 +259,25 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ changeStorageTime(res) {
|
|
|
+ if (new Date().getTime() < new Date(res).getTime()) {
|
|
|
+ this.$message.warning('实际入库时间不能大于当前时间!')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeStartTime(res) {
|
|
|
+ if (new Date().getTime() < new Date(res).getTime()) {
|
|
|
+ this.$message.warning('实际开工时间不能大于当前时间!')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeCompletionTime(res) {
|
|
|
+ if (new Date().getTime() < new Date(res).getTime()) {
|
|
|
+ this.$message.warning('实际竣工时间不能大于当前时间!')
|
|
|
+ }
|
|
|
+ },
|
|
|
save() {
|
|
|
- console.log('save')
|
|
|
+ if (this.check()) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$api.project.proUpdate(this.form).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.$message.success(res.msg)
|
|
|
@@ -266,6 +286,51 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ check() {
|
|
|
+ if (new Date().getTime() < new Date(this.form.storage_time).getTime()) {
|
|
|
+ this.$message.error('实际入库时间不能大于当前时间!')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (new Date().getTime() < new Date(this.form.start_time).getTime()) {
|
|
|
+ this.$message.error('实际开工时间不能大于当前时间!')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ new Date().getTime() < new Date(this.form.completion_time).getTime()
|
|
|
+ ) {
|
|
|
+ this.$message.error('实际竣工时间不能大于当前时间!')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (this.form.is_storage == 1) {
|
|
|
+ if (this.form.storage_time == null || this.form.storage_time == '') {
|
|
|
+ this.$message.error('请填写入库时间!')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.form.is_start == 1) {
|
|
|
+ if (this.form.start_time == null || this.form.start_time == '') {
|
|
|
+ this.$message.error('请填写开工时间!')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.form.tags == 1) {
|
|
|
+ //政府投资项目 必须要有可研批复号
|
|
|
+ if (
|
|
|
+ this.form.available_approval_id == '' ||
|
|
|
+ this.form.available_approval_id == null
|
|
|
+ ) {
|
|
|
+ this.$message.error('请填写可研批复号!')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //企业投资项目 必须要有项目代码
|
|
|
+ if (this.form.tags == 2) {
|
|
|
+ if (this.form.project_code == '' || this.form.project_code == null) {
|
|
|
+ this.$message.error('请填写项目代码!')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
change(res) {
|
|
|
this.disabled = res
|
|
|
}
|