|
|
@@ -1,5 +1,8 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
+ <span style="float: right;">
|
|
|
+ <el-button type="primary" size="mini" style="margin: 0px 0px 10px;" @click="addListButton">添加</el-button>
|
|
|
+ </span>
|
|
|
<el-table highlight-current-row :data="entityListData.entityList" border height="calc(100vh - 243px)" style="width: 100%">
|
|
|
<el-table-column
|
|
|
property="SequenceNo"
|
|
|
@@ -18,7 +21,7 @@
|
|
|
label="操作"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
- width="100">
|
|
|
+ width="150">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button slot="reference" type="text" icon="el-icon-edit" size="small" @click="onDialogVisible(scope.row,scope.$index)">编辑</el-button>
|
|
|
<el-popover placement="top" title="提示" :ref="'popover-' + `${scope.$index}`">
|
|
|
@@ -37,8 +40,8 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
<el-dialog
|
|
|
title="编辑"
|
|
|
:visible.sync="dialogBoolean"
|
|
|
@@ -46,26 +49,28 @@
|
|
|
>
|
|
|
<el-form ref="advancedsearchForm" :model="formData" :rules="rulesEve" label-width="110px" class="advancedsearchFormClass">
|
|
|
<el-row>
|
|
|
-
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="序号" prop="SequenceNo">
|
|
|
+ <el-input placeholder="请输入" type="number" min="0" v-model="formData.SequenceNo" ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="评价项目" prop="Content">
|
|
|
<el-input type="textarea" placeholder="请输入" v-model="formData.Content" ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
-
|
|
|
-
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogBoolean = false" size="small" >取 消</el-button>
|
|
|
<el-button type="primary" @click="onTrueDialog" size="small">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
<!-- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
:page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
|
|
|
</el-pagination> -->
|
|
|
@@ -75,6 +80,7 @@
|
|
|
import { mapGetters } from 'vuex';
|
|
|
// import api from '@/api/oilcontract/contractEvaluationItems';
|
|
|
import api from '@/api/oilcontract/contract'
|
|
|
+ import apiItems from '@/api/oilcontract/evaluationItems';
|
|
|
|
|
|
export default {
|
|
|
computed: {
|
|
|
@@ -108,11 +114,20 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- dialogVisible: false,
|
|
|
+ dialogBoolean: false,
|
|
|
+ rulesEve:{
|
|
|
+ SequenceNo: [
|
|
|
+ { required: true, message: '请输入序号', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ Content: [
|
|
|
+ { required: true, message: '请输入评价内容', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ },
|
|
|
//列表数据
|
|
|
entityListData:{
|
|
|
entityList: [],
|
|
|
},
|
|
|
+
|
|
|
//分页参数
|
|
|
size: 10,
|
|
|
currentPage: 1,
|
|
|
@@ -126,77 +141,98 @@
|
|
|
CreateOn: [],
|
|
|
//查询项
|
|
|
searchFormReset: {},
|
|
|
+ formData:{
|
|
|
+ Content:'',
|
|
|
+ SequenceNo:'',
|
|
|
+ },
|
|
|
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- //查询条件初始值备份
|
|
|
- Object.assign(this.searchFormReset, this.searchForm);
|
|
|
- //查询列表
|
|
|
//this.initDatas();
|
|
|
//this.getDictOptions()
|
|
|
-
|
|
|
- // 判断是编辑状态还是新增状态
|
|
|
- if(this.evaluateId==0){
|
|
|
- this.initDatas();
|
|
|
- }else{
|
|
|
- this.editDatas();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+ this.editDatas();
|
|
|
},
|
|
|
methods: {
|
|
|
- initDatas() {
|
|
|
- var data = {
|
|
|
- Category:2,
|
|
|
+ //添加数据
|
|
|
+ addListButton(){
|
|
|
+ var formData = {
|
|
|
+ Content:'',
|
|
|
}
|
|
|
- api.evaluationItemsOnelist(data,this.ContractClass,this.$axios).then(res => {
|
|
|
- console.log('上级节点内容',res)
|
|
|
- var data = res.data.items
|
|
|
- var list = []
|
|
|
- for(var index = 0 ; index < data.length ; index++){
|
|
|
- data[index].typeStatus = index
|
|
|
- data[index].Value = 1
|
|
|
- data[index].Score = '0'
|
|
|
- // this.$set(data[index],'NormalScore','0')
|
|
|
- list.push(data[index])
|
|
|
-
|
|
|
- if(data[index].Son!=null&&data[index].Son!=undefined){
|
|
|
- for(var k = 0 ; k < data[index].Son.length ; k++){
|
|
|
- data[index].Son[k].typeStatus = index
|
|
|
- data[index].Son[k].Value = 1
|
|
|
- data[index].Son[k].Score = '0'
|
|
|
- // data[index].Son[k].NormalScore = '0'
|
|
|
- list.push(data[index].Son[k])
|
|
|
+ this.formData = formData
|
|
|
+ this.dialogBoolean = true
|
|
|
+ },
|
|
|
+ //点击编辑按钮
|
|
|
+ onDialogVisible(item,index){
|
|
|
+ this.formData = item
|
|
|
+ this.dialogBoolean = true
|
|
|
+ },
|
|
|
+ //确认编辑内容
|
|
|
+ onTrueDialog(){
|
|
|
+ console.log(this.formData)
|
|
|
+ this.$refs['advancedsearchForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if(this.formData.Id!=0&&this.formData.Id!=''&&this.formData.Id!=undefined){
|
|
|
+ apiItems.updateContractEvaluate(this.formData.Id,this.formData,this.$axios).then(res => {
|
|
|
+ if(res.data.code==0){
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.editDatas()
|
|
|
+ this.dialogBoolean = false
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ // }
|
|
|
+ }else{
|
|
|
+ this.formData.Category = 2
|
|
|
+ this.formData.LevelCode = 1
|
|
|
+ this.formData.Type = '02'
|
|
|
+ this.formData.NormalScore = '1'
|
|
|
+ this.formData.ParentId = 0
|
|
|
+ apiItems.addContractEvaluate(this.formData,this.$axios).then(res => {
|
|
|
+ if(res.data.code==0){
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.editDatas()
|
|
|
+ this.dialogBoolean = false
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
}
|
|
|
- }
|
|
|
}
|
|
|
- this.entityListData.entityList = list
|
|
|
- console.log('处理完的数据',list)
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
})
|
|
|
-
|
|
|
},
|
|
|
//初始数据
|
|
|
editDatas() {
|
|
|
- var data = {
|
|
|
- ContentReviewId:this.evaluateId,
|
|
|
- Category:this.category,
|
|
|
- Type:2,
|
|
|
- }
|
|
|
- api.contractEvaluationTree(data,this.$axios).then(res => {
|
|
|
- console.log('编辑后的内容aaaaaaaaaaaaaaaaa',res)
|
|
|
+ apiItems.evaluationItemsOnelist('02',2, this.$axios).then(res => {
|
|
|
+ console.log('编辑后的内容',res)
|
|
|
var data = res.data.items
|
|
|
var list = []
|
|
|
for(var index = 0 ; index < data.length ; index++){
|
|
|
data[index].typeStatus = index
|
|
|
- data[index].Value = data[index].Value==undefined||data[index].Value==''?'0':data[index].Value
|
|
|
+ data[index].Score = data[index].Score==undefined||data[index].Score==''?'0':data[index].Score
|
|
|
list.push(data[index])
|
|
|
+ this.standardNum = this.standardNum + parseInt(data[index].NormalScore)
|
|
|
if(data[index].Son!=null&&data[index].Son!=undefined){
|
|
|
for(var k = 0 ; k < data[index].Son.length ; k++){
|
|
|
data[index].Son[k].typeStatus = index
|
|
|
- data[index].Son[k].Value = data[index].Son[k].Value==undefined||data[index].Son[k].Value==''?'0':data[index].Value
|
|
|
+ data[index].Son[k].Score = data[index].Son[k].Score==undefined||data[index].Son[k].Score==''?'0':data[index].Son[k].Score
|
|
|
list.push(data[index].Son[k])
|
|
|
}
|
|
|
}
|
|
|
@@ -207,10 +243,26 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
+ deleteEntity(row,index) {
|
|
|
+ this.$refs['popover-' + `${index}`].doClose()
|
|
|
+ apiItems.deleteEntity(row.Id, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.editDatas();
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
jstimehandle(val) {
|
|
|
if (val === '') {
|