zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<template>
    <div>
        <el-dialog
            class="dialogContent"
            title="项目选择"
            :visible.sync="show"
            :close-on-click-modal="false"
            center
            top="45px"
            width="850px">
            <el-form ref="form" :model="form" id="search-form">
                <el-row :gutter="20">
                    <el-col :span="12">
                        <el-form-item label="项目名称" prop="cname">
                            <el-input v-model="form.cname"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="项目城市" prop="citycd">
                            <el-input v-model="form.citycd"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="项目负责人" prop="managername">
                            <el-input v-model="form.managername"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item class="box-search">
                            <el-button @click="restForm('form')" size="mini">重置</el-button>
                            <el-button type="primary" size="mini" @click="handleSearch">搜索</el-button>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <el-table
                :data="tableData"
                v-loading="loading"
                highlight-current-row
                border
                height="300"
                @current-change="handleCheckbox"
                style="width: 100%">
                <!-- <el-table-column label=" " width="40">
                    <template slot-scope="scope">
                        <el-checkbox v-model="scope.row.checked"></el-checkbox>
                    </template>
                </el-table-column> -->
                <el-table-column
                    type="index"
                    label="  ">
                </el-table-column>
                <el-table-column
                    prop="projectid"
                    label="项目编号">
                </el-table-column>
                <el-table-column
                    prop="cname"
                    label="项目名称">
                </el-table-column>
                <el-table-column
                    prop="citycd"
                    label="项目城市">
                </el-table-column>
                <el-table-column
                    prop="managername"
                    label="项目负责人">
                </el-table-column>
            </el-table>
            <pagination
                v-show="total > 0"
                :total="total"
                :page.sync="listQuery.currentPage"
                :limit.sync="listQuery.pageSize"
                @pagination="tableList"
            />
            <span slot="footer" class="dialog-footer">
                <el-button class="blankBtn" @click="show = false" size="mini">返回</el-button>
            <el-button type="primary" size="mini" @click="handleSubmit" :disabled="commitData" class="blueBtn" >确定</el-button>
            <!-- <el-button type="primary" size="mini" @click="handleSubmit" :disabled="commitData"
                class="blueBtn"
                v-no-more-click v-loading="commitData" element-loading-spinner="el-icon-loading"  element-loading-background="rgba(64, 158, 255,.3)" >确定</el-button> -->
        </span>
        </el-dialog>
    </div>
</template>
 
<script>
import Pagination from '@/components/Pagination'
import { qryZYProjectInfo, saveProjectAdmit } from '@/api/area'
export default {
  components: { Pagination },
  props: ['showDialog', 'projectFlag'],
  data: function () {
    return {
      tableData: [],
      // 分页
      total: '0',
      listQuery: {
        currentPage: 1,
        pageSize: 10
      },
      form: {
        cname: '',
        citycd: '',
        managername: ''
      },
      tempForm: {
        projectname: '',
        projectId: '',
        projectcode: ''
            },
            checking: '',
            commitData: false,
            loading: true
    }
  },
  computed: {
    show: {
      get() {
        return this.showDialog
      },
      set() {
        this.$refs['form'].resetFields()
        this.tableList()
        this.$emit('update:showDialog', false)
      }
    }
  },
  created () {
    this.tableList()
  },
  methods: {
    // 重置表单
    restForm (refname) {
      this.$refs[refname].resetFields()
    },
    tableList () {
      // 初始化表格
      let params = Object.assign(this.listQuery, this.form)
      qryZYProjectInfo(params).then(res => {
        if (res.code === '00') {
                    this.tableData = res.result.records
          this.total = res.result.total
          this.tableData.forEach((item, index) => {
                        item.checked = false
                        // this.$set(this.tableData[index], 'checked', false)
                    })
                    this.loading = false
        }
      })
    },
    handleSearch () {
      this.tableList()
    },
    handleCheckbox (row) {
      if (row !== null) {
        this.tableData.forEach((item, index) => {
          if (item.projectid !== row.projectid) {
            this.$set(this.tableData[index], 'checked', false)
            this.$set(this.tableData[index], 'ischecked', false)
          } else {
                        this.$set(this.tableData[index], 'checked', true)
                        this.$set(this.tableData[index], 'ischecked', true)
            this.tempForm.projectname = item.cname
            this.tempForm.projectId = item.projectid
            this.tempForm.projectcode = item.ccode
          }
        })
            }
    },
    handleSubmit () {
            this.commitData = true
            this.loading = true
      let params = {
        projectFlag: this.projectFlag, // 0 - 审批准入 1- 项目立项
        projecttype: '1'// 自营为1 社会化为2
            }
            this.checking = this.tableData.filter(item => item.ischecked === true );    
            Object.assign(params, this.tempForm)
            if (this.checking.length === 1) {
                    saveProjectAdmit(params).then(res => {
                    if (res.code === '00') {
                        this.$message.success('添加成功')
                        let detailsParams = {
                            dataType: res.result.dataType,
                            objectNo: res.result.serialno,
                            objectType: res.result.objectType,
                            projectFlag: res.result.projectFlag,
                            projectType: res.result.projectType,
                            opertion: '01', // 控制提交按钮是否显示 01 显示 02 不显示
                            applyMsg: '01'
                        }
                        this.$store.commit('SET_detailsParams', detailsParams)
                        this.$router.push({ path: '/area/projectManagement/add/projectBasicInformation' })
                    } else {
                        this.loading = false
                        setTimeout(() => {
                            this.commitData = false
                            this.loading = false
                        }, 6000)
                    }
                })
            } else {
                this.loading = false
                this.commitData = false
                this.$message.warning('请选择申请项目')
            }
    }
  }
}
</script>
 
<style lang="stylus" scoped>
  .box-search{
    margin-left 50px
  }
    >>> .el-loading-spinner
        top 30px
.dialogContent
    max-height 800px
    >>> .el-dialog__header
        padding-top 40px
        >>> .el-dialog__title
            font-size 18px
            // font-family PingFangSC-Medium,PingFangSC
            font-weight bold
            color #222222
            line-height 25px
    >>> .el-dialog__body
        padding-bottom 0px
    >>> .el-dialog__footer
        padding-bottom 40px
        padding-top 8px
        .dialog-footer
            .blankBtn
                border-radius 4px
                border 1px solid rgba(204,204,204,1)
                color rgba(85,85,85,1)
            .blueBtn
                margin-left 40px
                background-color rgba(0,129,240,1)
                border-radius 4px
                color rgba(255,255,255,1)
            .blankBtn,.blueBtn
                padding 0
                width 120px
                height 30px
                span
                    font-size 14px
                    height 20px
                    font-weight 400
                    line-height 20px
</style>