|
@@ -31,27 +31,51 @@
|
|
|
<project_add :id="this.$route.query.id" :year="this.$route.query.year" @onSuccess="onSuccess"></project_add>
|
|
|
</div>
|
|
|
<tableLayout ref="list" :layout="tablecols" :data="list" :custom="true" height="300">
|
|
|
+<!-- <template v-slot:customcol="scope">
|
|
|
+ <div v-if="scope.column.columnname === 'point'">33333</div>
|
|
|
+ <div v-else ></div>
|
|
|
+ </template>-->
|
|
|
<template v-slot:customcol="scope">
|
|
|
- <el-input size="mini" v-if="(scope.column.columnname === 'target_l' || scope.column.columnname === 'target_h' || scope.column.columnname === 'point') && actindex === scope.column.data.rowindex" v-model="scope.column.data[scope.column.columnname]"></el-input>
|
|
|
+ <el-input size="mini" v-if="(scope.column.columnname === 'target_l' || scope.column.columnname === 'target_h' ) && actindex === scope.column.data.rowindex" v-model="scope.column.data[scope.column.columnname]"></el-input>
|
|
|
+ <div v-else-if="scope.column.columnname === 'point'">
|
|
|
+ <el-date-picker
|
|
|
+ v-if="actindex === scope.column.data.rowindex"
|
|
|
+ v-model="date"
|
|
|
+ type="month"
|
|
|
+ placeholder="选择月"
|
|
|
+ :picker-options="pickerOptions">
|
|
|
+ </el-date-picker>
|
|
|
+ <p v-else>{{scope.column.data.year + '-' + scope.column.data.point}}</p>
|
|
|
+ </div>
|
|
|
<p v-else>{{scope.column.data[scope.column.columnname]}}</p>
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:opreation="scope">
|
|
|
- <el-button type="text" size="mini" class="inline-16" @click="actindex = 1">编辑</el-button>
|
|
|
- <project_del class="inline-16"></project_del>
|
|
|
+ <el-button type="text" size="mini" class="inline-16" @click="edit(scope.data)" v-if="editShow ">编辑</el-button>
|
|
|
+ <el-button type="text" style="color: #e09a1a" size="mini" class="inline-16" v-if="saveShow && actindex === (scope.data.index + 1)" @click="save(scope.data)">保存</el-button>
|
|
|
+ <project_del class="inline-16" v-if="editShow "></project_del>
|
|
|
</template>
|
|
|
</tableLayout>
|
|
|
- <div class="container normal-panel" style="text-align:right">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- small
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :current-page="currentPage"
|
|
|
- :page-sizes="[20, 50, 100, 200]"
|
|
|
- layout="total,sizes, prev, pager, next, jumper"
|
|
|
- :total="total">
|
|
|
- </el-pagination>
|
|
|
+ <div>
|
|
|
+ <div class="container normal-panel" style="text-align:right">
|
|
|
+ <div style="float: left">
|
|
|
+ <label class="search__label">项目总数:</label>
|
|
|
+ {{total}}</div>
|
|
|
+ <div style="float: left;margin-left: 20px">
|
|
|
+ <label class="search__label" style="width: 160px">项目基本目标(万元):</label>{{target_l}}</div>
|
|
|
+ <div style="float: left;margin-left: 20px" ><label class="search__label" style="width: 160px">项目挑战目标(万元):</label>{{target_h}}</div>
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ small
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-sizes="[20, 50, 100, 200]"
|
|
|
+ layout="total,sizes, prev, pager, next, jumper"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
<!-- <targetTable ref="list" class="container normal-panel">
|
|
|
<template v-slot:editTarget="scope">
|
|
@@ -76,13 +100,23 @@ export default {
|
|
|
components:{detail_information,project_add,project_del},
|
|
|
data(){
|
|
|
return {
|
|
|
+ pickerOptions:{
|
|
|
+ disabledDate(time){
|
|
|
+ return (time.getMonth() +1) < (new Date().getMonth() +1)
|
|
|
+ }
|
|
|
+ },
|
|
|
actindex:0,
|
|
|
mainData:{},
|
|
|
mainAreaData:[],
|
|
|
+ editShow:true,
|
|
|
+ saveShow:false,
|
|
|
tablecols:'',
|
|
|
- list:'',
|
|
|
+ target_l:0,
|
|
|
+ target_h:0,
|
|
|
+ list:[],
|
|
|
total:0,
|
|
|
currentPage:0,
|
|
|
+ date:'',
|
|
|
params: {
|
|
|
"id": 20220906104002,
|
|
|
"content": {
|
|
@@ -157,6 +191,12 @@ export default {
|
|
|
this.currentPage = res.pageNumber
|
|
|
console.log("获取项目数据")
|
|
|
console.log(this.list);
|
|
|
+ const total_target_l = []
|
|
|
+ this.list.forEach((i,index)=>{
|
|
|
+ /*total_target_l[index] = i.target_l*/
|
|
|
+ this.target_l = this.target_l + i.target_l
|
|
|
+ this.target_h = this.target_h + i.target_h
|
|
|
+ })
|
|
|
|
|
|
},
|
|
|
onSuccess(){
|
|
@@ -172,6 +212,32 @@ export default {
|
|
|
this.params.content.pageNumber = val
|
|
|
this.listData()
|
|
|
},
|
|
|
+ edit(rowIndex){
|
|
|
+ console.log("输出")
|
|
|
+ console.log(rowIndex)
|
|
|
+ this.actindex = rowIndex.index + 1
|
|
|
+ this.date = rowIndex.year + '-' + rowIndex.point
|
|
|
+ this.saveShow = true
|
|
|
+ this.editShow = false
|
|
|
+ },
|
|
|
+ async save(row){
|
|
|
+ console.log("保存数据")
|
|
|
+ console.log(row)
|
|
|
+ this.saveShow = false
|
|
|
+ this.editShow = true
|
|
|
+ this.actindex = 0
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20220906112602,
|
|
|
+ "content": {
|
|
|
+ "sa_salestargetid": row.sa_salestargetid,
|
|
|
+ "target_l": row.target_l,
|
|
|
+ "target_h": row.target_h
|
|
|
+ },
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
+ this.getprojectTargetList()
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
this.queryMainData(this.$route.query.id)
|