| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367 |
- <template>
- <wt-card
- title="其他信息"
- class="mt-10"
- :edit-btn="true"
- @change="change"
- @save="save"
- >
- <el-form class="mt-20" :disabled="disabled">
- <div class="body_title">入库信息</div>
- <!-- 入库信息 -->
- <div class="flex flex-justify-center">
- <el-form-item class="full-width flex-child-average">
- <div class="flex flex-center full-width item">
- <span class="title">是否入库:</span>
- <div class="full-width">
- <el-select
- v-model="form.is_storage"
- placeholder="是否入库"
- class="full-width"
- >
- <el-option
- v-for="item in yesOrNo"
- :key="item.label"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </div>
- </div>
- </el-form-item>
- <el-form-item class="full-width flex-child-average">
- <div class="flex flex-center full-width item">
- <span class="title">计划入库时间:</span>
- <el-date-picker
- v-model="form.plan_storage_time"
- type="date"
- style="width: 100%"
- placeholder="计划入库时间"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- />
- </div>
- </el-form-item>
- <el-form-item class="full-width flex-child-average">
- <div class="flex flex-center full-width item">
- <span class="title">实际入库时间:</span>
- <el-date-picker
- v-model="form.storage_time"
- type="date"
- style="width: 100%"
- placeholder="实际入库时间"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- @change="changeStorageTime"
- />
- </div>
- </el-form-item>
- </div>
- <div class="flex flex-justify-center">
- <el-form-item class="full-width flex-child-average">
- <div class="flex flex-center full-width item">
- <span class="title">项目代码:</span>
- <el-input v-model="form.project_code"></el-input>
- </div>
- </el-form-item>
- <el-form-item class="full-width flex-child-average">
- <div class="flex flex-center full-width item">
- <span class="title">监管平台代码:</span>
- <el-input v-model="form.regulatory_platform_code"></el-input>
- </div>
- </el-form-item>
- <el-form-item class="full-width flex-child-average">
- <div class="flex flex-center full-width item">
- <span class="title">是否纳入省重点项目:</span>
- <div class="full-width">
- <el-select
- v-model="form.is_provincial_key"
- placeholder="是否纳入省重点项目"
- class="full-width"
- >
- <el-option
- v-for="item in yesOrNo"
- :key="item.label"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </div>
- </div>
- </el-form-item>
- </div>
- <div class="flex flex-justify-center">
- <el-form-item class="full-width flex-child-average">
- <div class="flex flex-center full-width item">
- <span class="title">可研批复号:</span>
- <el-input v-model="form.available_approval_id"></el-input>
- </div>
- </el-form-item>
- <el-form-item class="full-width flex-child-average">
- <div class="flex flex-center full-width item">
- <span class="title">可研批复时间:</span>
- <el-date-picker
- v-model="form.available_approval_date"
- type="date"
- style="width: 100%"
- placeholder="可研批复时间"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- />
- </div>
- </el-form-item>
- <el-form-item class="full-width flex-child-average">
- <div class="flex flex-center full-width item">
- <span class="title">是否纳入省集中开工:</span>
- <div class="full-width">
- <el-select
- v-model="form.is_provincial_level_construction"
- placeholder="是否纳入省集中开工"
- class="full-width"
- >
- <el-option
- v-for="item in yesOrNo"
- :key="item.label"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </div>
- </div>
- </el-form-item>
- </div>
- <!-- 开工信息 -->
- <div class="body_title start">开工信息</div>
- <div class="flex flex-justify-center">
- <el-form-item class="full-width flex-child-average">
- <div class="flex flex-center full-width item">
- <span class="title">是否开工:</span>
- <div class="full-width">
- <el-select
- v-model="form.is_start"
- placeholder="是否开工"
- class="full-width"
- >
- <el-option
- v-for="item in yesOrNo"
- :key="item.label"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </div>
- </div>
- </el-form-item>
- <el-form-item class="full-width flex-child-average">
- <div class="flex flex-center full-width item">
- <span class="title">计划开工时间:</span>
- <el-date-picker
- v-model="form.plan_commencement_time"
- type="date"
- style="width: 100%"
- placeholder="计划开工时间"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- />
- </div>
- </el-form-item>
- <el-form-item class="full-width flex-child-average">
- <div class="flex flex-center full-width item">
- <span class="title">实际开工时间:</span>
- <el-date-picker
- v-model="form.start_time"
- type="date"
- style="width: 100%"
- placeholder="实际开工时间"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- @change="changeStartTime"
- />
- </div>
- </el-form-item>
- </div>
- <div class="flex flex-justify-center">
- <el-form-item class="full-width flex-child-average">
- <div class="flex flex-center full-width item">
- <span class="title">计划竣工时间:</span>
- <el-date-picker
- v-model="form.plan_completion_time"
- type="date"
- style="width: 100%"
- placeholder="计划竣工时间"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- />
- </div>
- </el-form-item>
- <el-form-item class="full-width flex-child-average">
- <div class="flex flex-center full-width item">
- <span class="title">实际竣工时间:</span>
- <el-date-picker
- v-model="form.completion_time"
- type="date"
- style="width: 100%"
- placeholder="实际竣工时间"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- @change="changeCompletionTime"
- />
- </div>
- </el-form-item>
- <el-form-item class="full-width flex-child-average">
- <div class="flex flex-center full-width item"></div>
- </el-form-item>
- </div>
- </el-form>
- </wt-card>
- </template>
- <script>
- import wtCard from '@/components/wt-card/index.vue'
- export default {
- components: {
- wtCard
- },
- props: {
- info: {
- type: Object,
- default: () => {
- return {}
- }
- }
- },
- watch: {
- info: {
- handler(val) {
- this.form = val
- },
- immediate: true
- }
- },
- data() {
- return {
- yesOrNo: [
- {
- label: '否',
- value: 0
- },
- {
- label: '是',
- value: 1
- }
- ],
- disabled: true,
- form: {}
- }
- },
- 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() {
- if (this.check()) {
- return
- }
- this.$api.project.proUpdate(this.form).then(res => {
- if (res.code === 200) {
- this.$message.success(res.msg)
- } else {
- this.$message.error(res.msg)
- }
- })
- },
- 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
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .body_title {
- margin-left: 5%;
- margin-bottom: 10px;
- width: 90%;
- text-align: left;
- }
- .start {
- margin-top: 20px;
- }
- .title {
- width: 240px;
- padding-right: 10px;
- text-align: right;
- }
- .title-textarea {
- width: 85px;
- text-align: left;
- }
- .item {
- width: 90%;
- }
- </style>
|