|
|
@@ -0,0 +1,99 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" size="small" @click="editBtn">{{$t(`编辑改善方案`)}}</el-button>
|
|
|
+ <el-drawer
|
|
|
+ :title="$t('编辑方案')"
|
|
|
+ :visible.sync="drawerVisible"
|
|
|
+ size="75%"
|
|
|
+ direction="rtl"
|
|
|
+ append-to-body
|
|
|
+ :show-close="false"
|
|
|
+ @close="onClose"
|
|
|
+ >
|
|
|
+ <div class="drawer__panel" style="margin-bottom: 0">
|
|
|
+ <div style="display: flex;justify-content: space-between">
|
|
|
+ <div>{{$t(`方案编制`)}}</div>
|
|
|
+ <el-button type="primary" size="small" @click="addRow">{{$t(`添加行`)}}</el-button>
|
|
|
+ </div>
|
|
|
+ <table-detail :layout="tablecols" :data="list" :opwidth="200" :custom="true" style="margin-top: 10px">
|
|
|
+ <template v-slot:customcol="scope">
|
|
|
+ <div v-if="scope.column.columnname == 'title'">
|
|
|
+ <div v-if="nowRow == scope.column.data.rowindex">
|
|
|
+ <el-input size="small" v-model="scope.column.data[scope.column.columnname]" placeholder="请输入任务名称"></el-input>
|
|
|
+ </div>
|
|
|
+ <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname == 'begdate'">
|
|
|
+ <div v-if="nowRow == scope.column.data.rowindex">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="scope.column.data[scope.column.columnname]"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ size="small"
|
|
|
+ type="date"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
+ <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
|
|
|
+ </div>
|
|
|
+ <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
|
|
|
+ </template>
|
|
|
+ </table-detail>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: "edit",
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ drawerVisible:false,
|
|
|
+ param:{
|
|
|
+ "id": 2026020210235502,
|
|
|
+ "content": {
|
|
|
+ "sa_service_improvementid": this.$route.query.id,
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 99
|
|
|
+ },
|
|
|
+ },
|
|
|
+ tablecols:[],
|
|
|
+ list:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ nowRow:-1
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ editBtn(){
|
|
|
+ this.drawerVisible = true
|
|
|
+ this.param.content.pageNumber = 1
|
|
|
+ this.listData()
|
|
|
+ },
|
|
|
+ async listData(){
|
|
|
+ const res = await this.$api.requested(this.param)
|
|
|
+ this.list = res.data
|
|
|
+ console.log(res.data,'方案列表')
|
|
|
+ },
|
|
|
+ addRow(){
|
|
|
+ this.nowRow = this.list.length + 1
|
|
|
+ this.list.push({
|
|
|
+ rowindex:this.list.length + 1,
|
|
|
+ title:'',
|
|
|
+ begdate:'',
|
|
|
+ enddate:'',
|
|
|
+ measure:'',
|
|
|
+ name:''
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onClose(){}
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.tablecols = this.tool.tabelCol(this.$route.name).improvementPlanEditTable.tablecols
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|