| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent> |
| | | <el-form-item label="施工批次" prop="batch"> |
| | | <el-input |
| | | v-model="queryParams.batch" |
| | |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['oa:constructionBatch:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['oa:constructionBatch:edit']" |
| | | >修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['oa:constructionBatch:remove']" |
| | | >删除</el-button> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="施工批次" align="center" prop="batch" /> |
| | | <el-table-column label="施工周期" align="center" width="180"> |
| | | <el-table-column label="施工批次" align="center" prop="batch" show-overflow-tooltip /> |
| | | <el-table-column label="施工周期" align="center" width="180" show-overflow-tooltip> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') + ' - ' + parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span> |
| | | <span>{{ scope.row.startDate + ' - ' + scope.row.endDate }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="负责人" align="center" prop="userId_dictText" /> |
| | | <el-table-column label="团队成员" align="center" prop="teamMembers" /> |
| | | <el-table-column label="备注" align="center" prop="remarks" /> |
| | | <el-table-column label="负责人" align="center" prop="userId_dictText" show-overflow-tooltip /> |
| | | <el-table-column label="团队成员" align="center" prop="teamMembers" show-overflow-tooltip /> |
| | | <el-table-column label="备注" align="center" prop="remarks" show-overflow-tooltip /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['oa:constructionBatch:edit']" |
| | | >修改</el-button> |
| | | <el-button |
| | | size="mini" |
| | |
| | | class="del-btn" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['oa:constructionBatch:remove']" |
| | | >删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | /> |
| | | |
| | | <!-- 添加或修改施工批次对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false"> |
| | | <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :close-on-click-modal="false"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="施工批次" prop="batch"> |
| | | <el-input v-model="form.batch" maxlength="64" show-word-limit placeholder="请输入施工批次" /> |
| | | </el-form-item> |
| | | <el-form-item label="施工周期" prop="date"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="form.date" |
| | | type="daterange" |
| | | value-format="yyyy-MM-dd" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="截至日期"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="负责人" prop="userId"> |
| | | <el-select v-model="form.userId" filterable placeholder="请选择负责人"> |
| | | <el-select v-model="form.userId" style="width: 100%" filterable placeholder="请选择负责人"> |
| | | <el-option |
| | | v-for="item in userList" |
| | | :key="item.userId" |
| | |
| | | <el-input v-model="form.teamMembers" type="textarea" rows="4" maxlength="64" show-word-limit placeholder="请输入团队成员" /> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remarks"> |
| | | <el-input v-model="form.remarks" type="textarea" rows="6" maxlength="512" show-word-limit placeholder="请输入内容" /> |
| | | <el-input v-model="form.remarks" type="textarea" rows="4" maxlength="512" show-word-limit placeholder="请输入内容" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | |
| | | |
| | | export default { |
| | | name: "ConstructionBatch", |
| | | props: { |
| | | schoolId: { |
| | | type: Number, |
| | | default: undefined |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | // 按钮loading |
| | |
| | | userList: [] |
| | | }; |
| | | }, |
| | | watch: { |
| | | 'schoolId': function () { |
| | | this.getList() |
| | | } |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | |
| | | /** 查询施工批次列表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listConstructionBatch(this.queryParams).then(response => { |
| | | listConstructionBatch(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => { |
| | | this.constructionBatchList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | |
| | | const id = row.id || this.ids |
| | | getConstructionBatch(id).then(response => { |
| | | this.loading = false; |
| | | this.form = response.data; |
| | | this.form.date = [this.form.startDate, this.form.endDate] |
| | | // this.form = response.data; |
| | | const localDate = [response.data.startDate, response.data.endDate]; |
| | | this.form = Object.assign({}, response.data, {date: localDate}) |
| | | this.open = true; |
| | | this.title = "修改施工批次"; |
| | | }); |
| | |
| | | /** 提交按钮 */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | console.log(this.form.date) |
| | | this.form.startDate = this.form.date[0]; |
| | | this.form.endDate = this.form.date[1]; |
| | | if (valid) { |
| | | this.buttonLoading = true; |
| | | this.form.schoolId = this.schoolId; |
| | | if (this.form.id != null) { |
| | | updateConstructionBatch(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |