|
|
@@ -0,0 +1,486 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-form ref="formEvaluation" :model="entityListData" label-width="0px" :rules="rules">
|
|
|
+
|
|
|
+ <el-table highlight-current-row :data="entityListData.entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
|
|
|
+ <el-table-column
|
|
|
+ property="SequenceNo"
|
|
|
+ label="序号"
|
|
|
+ header-align="center"
|
|
|
+ width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.LevelCode==1" style="font-weight: bold">{{scope.row.SequenceNo}}</span>
|
|
|
+ <span v-else>{{scope.row.SequenceNo}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ property="Content"
|
|
|
+ header-align="center"
|
|
|
+ label="评价内容">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.LevelCode==1" style="font-weight: bold">{{scope.row.Content}}</span>
|
|
|
+ <span v-else>{{scope.row.Content}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ property="NormalScore"
|
|
|
+ label="标准分值"
|
|
|
+ header-align="center"
|
|
|
+ width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.LevelCode==1" style="font-weight: bold">{{scope.row.NormalScore}}</span>
|
|
|
+ <span v-else-if="scope.row.NormalScore==0" style="font-weight: bold"></span>
|
|
|
+ <span v-else>{{scope.row.NormalScore}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ property="Reason"
|
|
|
+ label="不合格原因"
|
|
|
+ header-align="center"
|
|
|
+ width="160"
|
|
|
+ align="center">
|
|
|
+ <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}`">
|
|
|
+ <el-alert
|
|
|
+ title=""
|
|
|
+ description="确认要删除吗?"
|
|
|
+ type="warning"
|
|
|
+ :closable="false">
|
|
|
+ </el-alert>
|
|
|
+ <br/>
|
|
|
+ <div style="text-align: right; margin: 0">
|
|
|
+ <el-button type="primary" size="mini" @click="deleteEntity(scope.row,scope.$index)">删除</el-button>
|
|
|
+ </div>
|
|
|
+ <el-button slot="reference" type="text" style="margin-left:3px" icon="el-icon-delete" size="small" >删除</el-button>
|
|
|
+ </el-popover>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="" style="display: flex;align-items: center;justify-content: flex-end;margin: 18px 0;">
|
|
|
+ <div>标准总分:{{standardNum}}分</div>
|
|
|
+ <div style="margin-left: 18px;margin-right: 140px;">实得总分:{{getNumFun()}}分</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <!-- <div style="display: flex;justify-content: flex-end; margin: 20px 0;">
|
|
|
+ <el-button type="primary" size="mini" @click="activeName = '1'">上一步<i class="el-icon-arrow-right el-icon--right"></i></el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="activeName = '3'">下一步<i class="el-icon-arrow-right el-icon--right"></i></el-button>
|
|
|
+ </div> -->
|
|
|
+
|
|
|
+ <!-- <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> -->
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ title="编辑"
|
|
|
+ :visible.sync="dialogBoolean"
|
|
|
+ width="60%"
|
|
|
+ >
|
|
|
+ <el-form ref="advancedsearchForm" label-width="110px" class="advancedsearchFormClass">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="评价内容">
|
|
|
+ <el-input type="textarea" placeholder="请输入" v-model="textareaValue" ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="标准分值">
|
|
|
+ <el-input type="textarea" placeholder="请输入" v-model="textareaValue" ></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>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+ import { mapGetters } from 'vuex';
|
|
|
+ import api from '@/api/oilcontract/contract'
|
|
|
+ // import api from '@/api/oilcontract/contractEvaluationItems';
|
|
|
+
|
|
|
+ export default {
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ authUser: 'authUser'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ name: 'oilcontractevaluationitems',
|
|
|
+ props: {
|
|
|
+ // 评价id
|
|
|
+ evaluateId: {
|
|
|
+ type: null,
|
|
|
+ default:'',
|
|
|
+ },
|
|
|
+ // 类型 0 二级部门创建 1 专业处创建
|
|
|
+ category: {
|
|
|
+ type: null,
|
|
|
+ default:'',
|
|
|
+ },
|
|
|
+ //项目类型
|
|
|
+ ContractClass: {
|
|
|
+ type: null,
|
|
|
+ default:'',
|
|
|
+ },
|
|
|
+ //是否禁用
|
|
|
+ disabledForm: {
|
|
|
+ type: null,
|
|
|
+ default:false,
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ scoreFun:function(){
|
|
|
+ return function(type,k){
|
|
|
+ var num = 0;
|
|
|
+ var list = this.entityListData.entityList
|
|
|
+ for(var index = 0 ; index < list.length ; index++){
|
|
|
+ var code = Number(list[index].LevelCode)
|
|
|
+ if(type == list[index].typeStatus&&code==2){
|
|
|
+ num = num + Number(list[index].Score)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.entityListData.entityList[k].Score != String(num)){
|
|
|
+ // this.getNum = this.getNum + Number(num)
|
|
|
+ this.entityListData.entityList[k].Score = String(num)
|
|
|
+ }
|
|
|
+ return num
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getNumFun:function(){
|
|
|
+ return function(){
|
|
|
+ var num = 0;
|
|
|
+ var list = this.entityListData.entityList
|
|
|
+ for(var index = 0 ; index < list.length ; index++){
|
|
|
+ var code = Number(list[index].LevelCode)
|
|
|
+ if(list[index].LevelCode == 1){
|
|
|
+ num = num + Number(list[index].Score)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return num
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ var validatePass = (rule, value, callback) => {
|
|
|
+ var num = Number(value)
|
|
|
+ if (num == ''&&num != 0) {
|
|
|
+ this.fractionBoolean = false
|
|
|
+ callback(new Error('请输入分值'));
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // if (num > Number(this.branchNum)) {
|
|
|
+ // this.fractionBoolean = false
|
|
|
+ // callback(new Error('不能大于规定的分值'));
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ if ( num < 0) {
|
|
|
+ this.fractionBoolean = false
|
|
|
+ callback(new Error('不能为负数'));
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.fractionBoolean = true
|
|
|
+ callback();
|
|
|
+ };
|
|
|
+ return {
|
|
|
+ fractionBoolean:true,
|
|
|
+ dialogVisibleCom: false,
|
|
|
+ loading: false,
|
|
|
+ UnitOrgOptions: [],
|
|
|
+ textareaValue:'',//不合格原因
|
|
|
+ dialogBoolean:false,
|
|
|
+ rules:{
|
|
|
+ relation: [
|
|
|
+ { validator: validatePass, trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ dialogVisible: false,
|
|
|
+ //列表数据
|
|
|
+ entityListData:{
|
|
|
+ entityList:[],
|
|
|
+ },
|
|
|
+
|
|
|
+ //分页参数
|
|
|
+ size: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ currentItemCount: 0,
|
|
|
+ //列表排序
|
|
|
+ Column: {
|
|
|
+ Order: '',
|
|
|
+ Prop: ''
|
|
|
+ },
|
|
|
+ //查询时间new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()
|
|
|
+ CreateOn: [],
|
|
|
+ //查询项
|
|
|
+ searchFormReset: {},
|
|
|
+ searchForm: {
|
|
|
+ Id: '',
|
|
|
+ ContractId: '',
|
|
|
+ ParentId: '',
|
|
|
+ SequenceNo: '',
|
|
|
+ Content: '',
|
|
|
+ NormalScore: '',
|
|
|
+ Score: '',
|
|
|
+ LevelCode: '',
|
|
|
+ Remark: '',
|
|
|
+ ModifiedOn: '',
|
|
|
+ ModifiedUserId: '',
|
|
|
+ ModifiedBy: '',
|
|
|
+
|
|
|
+ },
|
|
|
+ auditform: {
|
|
|
+ FirstAuditName: '',
|
|
|
+ SecondAudit: '',
|
|
|
+ ThirdAudit: '',
|
|
|
+ CertId: '',
|
|
|
+ AuditRemark: '',
|
|
|
+ TypeCode: '03'
|
|
|
+ },
|
|
|
+ entityListItemIndex:'',
|
|
|
+ standardNum:0,//标准分数
|
|
|
+ getNum:0,//实得总分
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ //数据列表
|
|
|
+ // 判断是编辑状态还是新增状态
|
|
|
+ if(this.evaluateId==0){
|
|
|
+ this.initDatas();
|
|
|
+ }else{
|
|
|
+ this.editDatas();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //this.getDictOptions()
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //初始数据
|
|
|
+ initDatas() {
|
|
|
+ // 普通的传1,条件评价穿2
|
|
|
+ var data = {
|
|
|
+ Category:1,
|
|
|
+ }
|
|
|
+ this.standardNum = 0
|
|
|
+ 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].Score = '0'
|
|
|
+ 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].Score = data[index].Son[k].NormalScore
|
|
|
+ list.push(data[index].Son[k])
|
|
|
+ // parseInt(data[index].Son[k].NormalScore)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.entityListData.entityList = list
|
|
|
+ console.log('处理完的数据',list)
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //编辑初始数据
|
|
|
+ editDatas() {
|
|
|
+ var data = {
|
|
|
+ ContentReviewId:this.evaluateId,
|
|
|
+ Category:this.category,
|
|
|
+ Type:1,
|
|
|
+ }
|
|
|
+ this.standardNum = 0
|
|
|
+ api.contractEvaluationTree(data,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].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].Score = data[index].Son[k].Score==undefined||data[index].Son[k].Score==''?'0':data[index].Son[k].Score
|
|
|
+ list.push(data[index].Son[k])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.entityListData.entityList = list
|
|
|
+ console.log('处理完的数据',list)
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 弹窗
|
|
|
+ onDialogVisible(item,index){
|
|
|
+ console.log(item)
|
|
|
+ this.entityListItemIndex = index
|
|
|
+ this.textareaValue = item.Remark
|
|
|
+ this.dialogBoolean = true
|
|
|
+ },
|
|
|
+ //确认编辑内容
|
|
|
+ onTrueDialog(){
|
|
|
+ this.entityListData.entityList[this.entityListItemIndex].Remark = this.textareaValue
|
|
|
+ this.dialogBoolean = false
|
|
|
+ },
|
|
|
+ // 分数校验
|
|
|
+ onInputFen(index,fen){
|
|
|
+ this.branchNum = fen
|
|
|
+ // this.entityListData.entityList[index].Score = fen
|
|
|
+ },
|
|
|
+
|
|
|
+ getDictOptions() {
|
|
|
+ api.getDictList(this.$axios).then(res => {
|
|
|
+ //this.dictOptions.customerList = res.data.items['customerList']
|
|
|
+ //this.dictOptions.projectList = res.data.items['projectList']
|
|
|
+
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ searchCommand(command) {
|
|
|
+ if (command == 'search') {
|
|
|
+ this.dialogVisible = true
|
|
|
+ } else if (command == 'clear') {
|
|
|
+ this.clearSearch()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //列表排序功能
|
|
|
+ orderby(column) {
|
|
|
+ if (column.order == 'ascending') {
|
|
|
+ this.Column.Order = 'asc'
|
|
|
+ } else if (column.order == 'descending') {
|
|
|
+ this.Column.Order = 'desc'
|
|
|
+ }
|
|
|
+ this.Column.Prop = column.prop
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+ clearSearch() {
|
|
|
+ Object.assign(this.searchForm, this.searchFormReset);
|
|
|
+ //this.searchForm = this.searchFormReset;
|
|
|
+ this.CreateOn = ''
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+ handleSearch() {
|
|
|
+ this.currentPage = 1;
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.initDatas();
|
|
|
+ },
|
|
|
+ handleCurrentChange(value) {
|
|
|
+ this.currentPage = value
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+ handleSizeChange(value) {
|
|
|
+ this.size = value
|
|
|
+ this.currentPage = 1
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+ deleteEntity(row) {
|
|
|
+ row.deleteConfirmFlag = false;
|
|
|
+ api.deleteEntity(row.Id, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.initDatas();
|
|
|
+ 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 === '') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '5000-01-01T23:59:59+08:00') {
|
|
|
+ return '永久'
|
|
|
+ } else {
|
|
|
+ val = val.replace('T', ' ')
|
|
|
+ return val.substring(0, 10)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ formatDateTime(date) {
|
|
|
+ var y = date.getFullYear();
|
|
|
+ var m = date.getMonth() + 1;
|
|
|
+ m = m < 10 ? ('0' + m) : m;
|
|
|
+ var d = date.getDate();
|
|
|
+ d = d < 10 ? ('0' + d) : d;
|
|
|
+ var h = date.getHours();
|
|
|
+ var minute = date.getMinutes();
|
|
|
+ minute = minute < 10 ? ('0' + minute) : minute;
|
|
|
+ return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
|
|
|
+ },
|
|
|
+ orgunitChange (val) {
|
|
|
+ let deptid = val
|
|
|
+ let auditstepcode = 'SUB_OFFICE_JF'
|
|
|
+ api.getAuditerByDept(deptid, auditstepcode, this.$axios).then(res => {
|
|
|
+ this.orgauditOptions = res.data.item
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getDictOptions () {
|
|
|
+ let params = {
|
|
|
+ status: this.formData.Status,
|
|
|
+ majorAduit: this.formData.ThirdAudit
|
|
|
+ }
|
|
|
+ api.getDictListByStatus(params, this.$axios).then(res => {
|
|
|
+ this.dictData = res.data.items
|
|
|
+ this.organizeOption = res.data.items['Organizes']
|
|
|
+ this.orgtreelist = window.toolfun_gettreejson(res.data.items['ProOrgList'], 'id', 'pId', 'id,name')
|
|
|
+ this.UnitOrgOptions = res.data.items['UnitOrgList']
|
|
|
+ this.UnitOrg = res.data.items['Register'].CheckUnitId
|
|
|
+ this.allorgunitOptions = res.data.items['Allunitorglist']
|
|
|
+ this.orgunitChange(this.UnitOrg)
|
|
|
+ /* this.UnitRelationOptions = res.data.items['UnitRelation']
|
|
|
+ this.getCityList(res.data.items['GaodeMapChinaAreas'])
|
|
|
+ this.CompanyTypeOptions = res.data.items['CompanyType'] */
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+ .el-pagination {
|
|
|
+ margin: 1rem 0 2rem;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+</style>
|