|
|
@@ -1,5 +1,3 @@
|
|
|
-
|
|
|
-
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-breadcrumb class="heading">
|
|
|
@@ -14,21 +12,31 @@
|
|
|
<i class="icon icon-table2"></i> 编辑 - 承包商合同
|
|
|
</span>
|
|
|
<span style="float: right;">
|
|
|
- <el-button type="primary" size="mini" style="margin-left: 8px" v-if="formData.Id!=0" @click="exportExcel">导出</el-button>
|
|
|
- <el-button type="primary" size="mini" style="margin-left: 8px" v-if="formData.Status=='7'&&auditBtn" @click="commonAuditClick(7)">企管法规处审批</el-button>
|
|
|
- <el-button type="primary" size="mini" style="margin-left: 8px" v-if="formData.Status=='4'&&auditBtn" @click="commonAuditClick(4)">专业处室审核</el-button>
|
|
|
- <el-button type="primary" size="mini" style="margin-left: 8px" v-if="formData.Status=='3'&&auditBtn" @click="commonAuditClick(3)">专业处室分办</el-button>
|
|
|
- <el-button type="primary" size="mini" style="margin-left: 8px" v-if="formData.Status=='2'&&auditBtn" @click="commonAuditClick(2)">复审</el-button>
|
|
|
- <el-button type="primary" size="mini" style="margin-left: 8px" v-if="formData.Status=='1'&&auditBtn" @click="commonAuditClick(1)">初审</el-button>
|
|
|
- <el-button type="primary" size="mini" style="margin-left: 8px" v-if="Number(formData.Status)<=0&&formData.Id!=0&&checkBUtton" @click="commonAuditClick(0)">提交审核</el-button>
|
|
|
-
|
|
|
- <!-- <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick(7)">企管法规处</el-button>
|
|
|
- <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick(4)">专业处室审核</el-button>
|
|
|
- <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick(3)">专业科室接收</el-button>
|
|
|
- <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick(2)">复审</el-button>
|
|
|
- <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick(1)">提交审核</el-button> -->
|
|
|
-
|
|
|
- <el-button type="primary" size="mini" v-if="(Number(formData.Status)<=0&&saveButton)||(formData.Status=='4'&&auditBtn)" @click="onSeaveBigAdd">保存</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left: 8px" v-if="formData.Id!=0"
|
|
|
+ @click="exportExcel">导出</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left: 8px" v-if="formData.Status=='7'&&auditBtn"
|
|
|
+ @click="commonAuditClick(7)">企管法规处审批</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left: 8px" v-if="formData.Status=='4'&&auditBtn"
|
|
|
+ @click="commonAuditClick(4)">专业处室审核</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left: 8px" v-if="formData.Status=='3'&&auditBtn"
|
|
|
+ @click="commonAuditClick(3)">专业处室分办</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left: 8px" v-if="formData.Status=='2'&&auditBtn"
|
|
|
+ @click="commonAuditClick(2)">复审</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left: 8px" v-if="formData.Status=='1'&&auditBtn"
|
|
|
+ @click="commonAuditClick(1)">初审</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left: 8px"
|
|
|
+ v-if="Number(formData.Status)<=0&&formData.Id!=0&&checkBUtton"
|
|
|
+ @click="commonAuditClick(0)">提交审核</el-button>
|
|
|
+
|
|
|
+ <!-- <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick(7)">企管法规处</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick(4)">专业处室审核</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick(3)">专业科室接收</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick(2)">复审</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left: 8px" @click="commonAuditClick(1)">提交审核</el-button> -->
|
|
|
+
|
|
|
+ <el-button type="primary" size="mini"
|
|
|
+ v-if="(Number(formData.Status)<=0&&saveButton)||(formData.Status=='4'&&auditBtn)"
|
|
|
+ @click="onSeaveBigAdd">保存</el-button>
|
|
|
<el-button @click="onBack" type="primary" size="mini" style="margin-left: 8px">返回</el-button>
|
|
|
</span>
|
|
|
</div>
|
|
|
@@ -45,37 +53,43 @@
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="承包商名称">
|
|
|
- <el-select ref="SupplierSelect" v-model="contractData.SupplierName" :disabled="true" placeholder="请选择" style="width: 100%" ></el-select>
|
|
|
+ <el-select ref="SupplierSelect" v-model="contractData.SupplierName" :disabled="true"
|
|
|
+ placeholder="请选择" style="width: 100%"></el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="承包项目名称">
|
|
|
- <el-input :disabled="disabled" v-model="contractData.ProjectName" placeholder="请输入" style="width: 100%"></el-input>
|
|
|
+ <el-input :disabled="disabled" v-model="contractData.ProjectName" placeholder="请输入"
|
|
|
+ style="width: 100%"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="工程地点" >
|
|
|
- <el-input :disabled="disabled" v-model="contractData.ProjectPlace" placeholder="请输入" style="width: 100%"></el-input>
|
|
|
+ <el-form-item label="工程地点">
|
|
|
+ <el-input :disabled="disabled" v-model="contractData.ProjectPlace" placeholder="请输入"
|
|
|
+ style="width: 100%"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="合同编号">
|
|
|
- <el-input :disabled="disabled" v-model="contractData.ContractNo" placeholder="请输入" style="width: 100%"></el-input>
|
|
|
+ <el-input :disabled="disabled" v-model="contractData.ContractNo" placeholder="请输入"
|
|
|
+ style="width: 100%"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="项目负责人" >
|
|
|
- <el-input :disabled="disabled" v-model="contractData.ProjectOwner" placeholder="请输入" style="width: 100%"></el-input>
|
|
|
+ <el-form-item label="项目负责人">
|
|
|
+ <el-input :disabled="disabled" v-model="contractData.ProjectOwner" placeholder="请输入"
|
|
|
+ style="width: 100%"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="项目类别">
|
|
|
- <el-select :disabled="disabled" v-model="contractData.ProjectType" placeholder="请选择" style="width: 100%">
|
|
|
+ <el-form-item label="项目类别">
|
|
|
+ <el-select :disabled="disabled" v-model="contractData.ProjectType" placeholder="请选择"
|
|
|
+ style="width: 100%">
|
|
|
<el-option key="1" label="咨询" value="1"></el-option>
|
|
|
<el-option key="2" label="勘探" value="2"></el-option>
|
|
|
<el-option key="3" label="设计" value="3"></el-option>
|
|
|
@@ -85,9 +99,10 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="是否分包">
|
|
|
+ <el-form-item label="是否分包">
|
|
|
<!-- SubPackage -->
|
|
|
- <el-select :disabled="disabled" placeholder="请选择" v-model="contractData.SubPackage" style="width: 100%">
|
|
|
+ <el-select :disabled="disabled" placeholder="请选择" v-model="contractData.SubPackage"
|
|
|
+ style="width: 100%">
|
|
|
<el-option :key="1" label="是" :value="1"></el-option>
|
|
|
<el-option :key="0" label="否" :value="0"></el-option>
|
|
|
</el-select>
|
|
|
@@ -98,18 +113,27 @@
|
|
|
|
|
|
</el-card>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="业绩评价" name="2" >
|
|
|
- <evaluation-list ref="evaluation_list_one" :evaluateId="formData.Id" category="0" :ContractClass="contractData.ContractClass" :disabledForm="auditBtnBoolean"></evaluation-list>
|
|
|
+ <el-tab-pane label="业绩评价" name="2">
|
|
|
+ <evaluation-list ref="evaluation_list_one" :evaluateId="formData.Id" category="0"
|
|
|
+ :ContractClass="contractData.ContractClass"
|
|
|
+ :disabledForm="auditBtnBoolean"></evaluation-list>
|
|
|
</el-tab-pane>
|
|
|
<!-- v-if="formData.Status=='4'||Number(formData.Status)>4" -->
|
|
|
<el-tab-pane label="基本条件评价" name="4" v-if="contractData.ContractClass=='02'">
|
|
|
- <base-list ref="evaluation_listType_one" :evaluateId="formData.Id" category="0" :ContractClass="contractData.ContractClass" :disabledForm="auditBtnBoolean"></base-list>
|
|
|
+ <base-list ref="evaluation_listType_one" :evaluateId="formData.Id" category="0"
|
|
|
+ :ContractClass="contractData.ContractClass" :disabledForm="auditBtnBoolean"></base-list>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="专业处室业绩评价" name="3" v-if="departmentBoolean||Number(formData.Status)>4||Number(formData.Status)<0">
|
|
|
- <evaluation-list ref="evaluation_list_two" :evaluateId="formData.Id" category="1" :ContractClass="contractData.ContractClass" :disabledForm="auditBtnBooleanZhuan"></evaluation-list>
|
|
|
+ <el-tab-pane label="专业处室业绩评价" name="3"
|
|
|
+ v-if="departmentBoolean||Number(formData.Status)>4||Number(formData.Status)<0">
|
|
|
+ <evaluation-list ref="evaluation_list_two" :evaluateId="formData.Id" category="1"
|
|
|
+ :ContractClass="contractData.ContractClass"
|
|
|
+ :disabledForm="auditBtnBooleanZhuan"></evaluation-list>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane v-if="(departmentBoolean||Number(formData.Status)>4||Number(formData.Status)<0)&&contractData.ContractClass=='02'" label="专业处室基本条件评价" name="5">
|
|
|
- <base-list ref="evaluation_listType_two" :evaluateId="formData.Id" category="1" :ContractClass="contractData.ContractClass" :disabledForm="auditBtnBooleanZhuan"></base-list>
|
|
|
+ <el-tab-pane
|
|
|
+ v-if="(departmentBoolean||Number(formData.Status)>4||Number(formData.Status)<0)&&contractData.ContractClass=='02'"
|
|
|
+ label="专业处室基本条件评价" name="5">
|
|
|
+ <base-list ref="evaluation_listType_two" :evaluateId="formData.Id" category="1"
|
|
|
+ :ContractClass="contractData.ContractClass" :disabledForm="auditBtnBooleanZhuan"></base-list>
|
|
|
</el-tab-pane>
|
|
|
|
|
|
<el-tab-pane label="审批流程" name="6" :disabled="formData.Status==0">
|
|
|
@@ -128,512 +152,509 @@
|
|
|
</el-tabs>
|
|
|
</el-card>
|
|
|
|
|
|
- <submitPopup ref="submitpopup" :eveId="formData.Id" :formData="formData" @refreshPage="refreshPage"></submitPopup>
|
|
|
-
|
|
|
-
|
|
|
+ <submit-popup ref="submitpopup" :eveId="formData.Id" :formData="formData" @refreshPage="refreshPage"></submit-popup>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {
|
|
|
- mapGetters
|
|
|
- } from 'vuex'
|
|
|
- import api from '@/api/oilcontract/contract'
|
|
|
- import evaluationList from './evaluationlist'
|
|
|
- import baseList from './baselist'
|
|
|
- import WfHistory from '@/components/workflow/wfhistory.vue'
|
|
|
- import apiSupplier from '@/api/oilsupplier/supplier'
|
|
|
- import apiCert from '@/api/oilsupplier/suppliercert'
|
|
|
- import permissionApi from '@/api/oilcontract/permission';
|
|
|
- export default {
|
|
|
- computed: {
|
|
|
- ...mapGetters({
|
|
|
- authUser: 'authUser'
|
|
|
- })
|
|
|
- },
|
|
|
- name: 'oilcontractEdit',
|
|
|
- components: {
|
|
|
- evaluationList,
|
|
|
- WfHistory,
|
|
|
- baseList,
|
|
|
- },
|
|
|
+import {
|
|
|
+ mapGetters
|
|
|
+} from 'vuex'
|
|
|
+import api from '@/api/oilcontract/contract'
|
|
|
+import evaluationList from './evaluationlist'
|
|
|
+import baseList from './baselist'
|
|
|
+import WfHistory from '@/components/workflow/wfhistory.vue'
|
|
|
+import apiCert from '@/api/oilsupplier/suppliercert'
|
|
|
+import permissionApi from '@/api/oilcontract/permission'
|
|
|
+import submitPopup from '@/components/oilcontract/submitPopup.vue'
|
|
|
+
|
|
|
+export default {
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ authUser: 'authUser'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ name: 'oilcontractEdit',
|
|
|
+ components: {
|
|
|
+ evaluationList,
|
|
|
+ WfHistory,
|
|
|
+ baseList,
|
|
|
+ submitPopup
|
|
|
+ },
|
|
|
+
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ IsFinal: 0,
|
|
|
+
|
|
|
+ routeData: {},//上一页面传过来的值
|
|
|
+ routeDataType: '',//上一页面传过来的type
|
|
|
+
|
|
|
+ dialogVisibleCom: false,
|
|
|
+ disabled: true,//禁用
|
|
|
+ // 业绩评价
|
|
|
+ performance: {
|
|
|
+ disabled: false,//禁用
|
|
|
+ },
|
|
|
+ // 专业处室业绩评价
|
|
|
+ departmentPerformance: {
|
|
|
+ disabled: false,//禁用
|
|
|
+ },
|
|
|
+ // 审批流程
|
|
|
+ approvalProcess: {
|
|
|
+ disabled: true,//禁用
|
|
|
+ },
|
|
|
|
|
|
- data() {
|
|
|
- return {
|
|
|
- IsFinal:0,
|
|
|
-
|
|
|
- routeData:{},//上一页面传过来的值
|
|
|
- routeDataType:'',//上一页面传过来的type
|
|
|
-
|
|
|
- dialogVisibleCom:false,
|
|
|
- disabled:true,//禁用
|
|
|
- // 业绩评价
|
|
|
- performance: {
|
|
|
- disabled:false,//禁用
|
|
|
- },
|
|
|
- // 专业处室业绩评价
|
|
|
- departmentPerformance:{
|
|
|
- disabled:false,//禁用
|
|
|
- },
|
|
|
- // 审批流程
|
|
|
- approvalProcess:{
|
|
|
- disabled:true,//禁用
|
|
|
- },
|
|
|
-
|
|
|
- entrydetail: {
|
|
|
- process: '',
|
|
|
- business: '',
|
|
|
- instance: ''
|
|
|
- },
|
|
|
- activeName: '1',
|
|
|
- serviceId: '',
|
|
|
- formData: {
|
|
|
- Id: '',
|
|
|
- },
|
|
|
- auditstepcode:'',
|
|
|
- contractData:{},//合同信息
|
|
|
- //下拉选择项
|
|
|
- //wellNoOptions: [],
|
|
|
- //supervisersOptions: [],
|
|
|
- evaluation_list:[],
|
|
|
- evaluation_list_department:[],
|
|
|
- auditBtn:false,
|
|
|
- auditBtnBoolean:true,
|
|
|
- auditBtnBooleanZhuan:true,
|
|
|
-
|
|
|
- departmentBoolean:false,
|
|
|
- checkBUtton:false,//提交审核按钮
|
|
|
- saveButton:false,//保存按钮
|
|
|
+ entrydetail: {
|
|
|
+ process: '',
|
|
|
+ business: '',
|
|
|
+ instance: ''
|
|
|
+ },
|
|
|
+ activeName: '1',
|
|
|
+ serviceId: '',
|
|
|
+ formData: {
|
|
|
+ Id: 0
|
|
|
+ },
|
|
|
+ auditstepcode: '',
|
|
|
+ contractData: {},//合同信息
|
|
|
+ //下拉选择项
|
|
|
+ //wellNoOptions: [],
|
|
|
+ //supervisersOptions: [],
|
|
|
+ evaluation_list: [],
|
|
|
+ evaluation_list_department: [],
|
|
|
+ auditBtn: false,
|
|
|
+ auditBtnBoolean: true,
|
|
|
+ auditBtnBooleanZhuan: true,
|
|
|
+
|
|
|
+ departmentBoolean: false,
|
|
|
+ checkBUtton: false,//提交审核按钮
|
|
|
+ saveButton: false,//保存按钮
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ // this.routeData = this.$route.query.item
|
|
|
+ this.routeDataType = this.$route.query.type
|
|
|
+
|
|
|
+ console.log('跳转数据', this.routeData)
|
|
|
+ this.serviceId = this.$route.params.opera;
|
|
|
+ // this.getDictOptions();
|
|
|
+
|
|
|
+ this.IsFinal = this.$route.query.IsFinal;
|
|
|
+
|
|
|
+ if (this.IsFinal == undefined || this.IsFinal == "") this.IsFinal = 0;
|
|
|
+
|
|
|
+ if (this.serviceId != 'add' && this.serviceId > 0) {
|
|
|
+ this.formData.Id = parseInt(this.serviceId);
|
|
|
+ // this.initDatas();
|
|
|
+ this.refreshPage()
|
|
|
+ } else {
|
|
|
+ this.formData.Id = 0;
|
|
|
+ this.formData.Status = 0
|
|
|
+ this.approvalProcess.disabled = true
|
|
|
+ this.contractData = this.$route.query.item
|
|
|
+ }
|
|
|
+ this.statusFun()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ exportExcel() {
|
|
|
+ api.docexportEle(this.formData.Id, this.$axios)
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ // this.$message({
|
|
|
+ // type: 'success'
|
|
|
+ // message: res.data.message
|
|
|
+ // })
|
|
|
+ let docurl = res.data.item
|
|
|
+ // 内网服务器专用
|
|
|
+ if (process.client && docurl.indexOf('upfile') === 0) {
|
|
|
+ const myDomain = window.location.host
|
|
|
+ location.href = 'http://' + myDomain + '/' + docurl
|
|
|
+ } else {
|
|
|
+ location.href = 'http://' + docurl
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
},
|
|
|
- created() {
|
|
|
- // this.routeData = this.$route.query.item
|
|
|
- this.routeDataType = this.$route.query.type
|
|
|
-
|
|
|
- console.log('跳转数据',this.routeData)
|
|
|
- this.serviceId = this.$route.params.opera;
|
|
|
- // this.getDictOptions();
|
|
|
-
|
|
|
- this.IsFinal = this.$route.query.IsFinal;
|
|
|
-
|
|
|
- if(this.IsFinal==undefined || this.IsFinal == "") this.IsFinal = 0;
|
|
|
-
|
|
|
- if(this.serviceId != 'add' && this.serviceId>0) {
|
|
|
- this.formData.Id = this.serviceId;
|
|
|
- // this.initDatas();
|
|
|
- this.refreshPage()
|
|
|
- } else {
|
|
|
- this.formData.Id = 0;
|
|
|
- this.formData.Status = 0
|
|
|
- this.approvalProcess.disabled = true
|
|
|
- this.contractData = this.$route.query.item
|
|
|
+ //状态判断
|
|
|
+ statusFun() {
|
|
|
+ var data = {
|
|
|
+ percode: 'oil_contract.Review.Department',
|
|
|
}
|
|
|
- this.statusFun()
|
|
|
- },
|
|
|
- methods: {
|
|
|
- exportExcel () {
|
|
|
- api.docexportEle(this.formData.Id, this.$axios)
|
|
|
- .then(res => {
|
|
|
- // response
|
|
|
- if (res.data.code === 0) {
|
|
|
- // this.$message({
|
|
|
- // type: 'success'
|
|
|
- // message: res.data.message
|
|
|
- // })
|
|
|
- let docurl = res.data.item
|
|
|
- // 内网服务器专用
|
|
|
- if (process.client && docurl.indexOf('upfile') === 0) {
|
|
|
- const myDomain = window.location.host
|
|
|
- location.href = 'http://' + myDomain + '/' + docurl
|
|
|
- } else {
|
|
|
- location.href = 'http://' + docurl
|
|
|
- }
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
- //状态判断
|
|
|
- statusFun(){
|
|
|
- var data = {
|
|
|
- percode:'oil_contract.Review.Department',
|
|
|
+ permissionApi.permissionIsauth(data, this.$axios).then(res => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ if (res.data.message == '有权限') {
|
|
|
+ this.departmentBoolean = true
|
|
|
+ }
|
|
|
}
|
|
|
- permissionApi.permissionIsauth(data, this.$axios).then(res => {
|
|
|
- if(res.data.code==0){
|
|
|
- if(res.data.message=='有权限'){
|
|
|
- this.departmentBoolean = true
|
|
|
- }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ var data = {percode: 'oil_contract.Review.Check',}
|
|
|
+ permissionApi.permissionIsauth(data, this.$axios).then(res => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ if (res.data.message == '有权限') {
|
|
|
+ this.checkBUtton = true
|
|
|
}
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- var data = {percode:'oil_contract.Review.Check',}
|
|
|
- permissionApi.permissionIsauth(data, this.$axios).then(res => {
|
|
|
- if(res.data.code==0){
|
|
|
- if(res.data.message=='有权限'){
|
|
|
- this.checkBUtton = true
|
|
|
- }
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ var data = {percode: 'oil_contract.Review.Save',}
|
|
|
+ permissionApi.permissionIsauth(data, this.$axios).then(res => {
|
|
|
+ console.log('权限', res.data)
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ if (res.data.message == '有权限') {
|
|
|
+ this.saveButton = true
|
|
|
}
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ //刷新数据接口
|
|
|
+ refreshPage() {
|
|
|
+ //拿id查审核流程
|
|
|
+ this.showIdDatas(this.formData.Id)
|
|
|
+
|
|
|
+ },
|
|
|
+ //拿id查审核流程
|
|
|
+ showIdDatas(id) {
|
|
|
+ api.getEntityAndCert(id, this.$axios).then(res => {
|
|
|
+ console.log('拿id查编辑数据', res)
|
|
|
+ this.entrydetail.business = ''
|
|
|
+ var data = res.data
|
|
|
+ this.formData = res.data
|
|
|
+ this.entrydetail.business = id
|
|
|
+ this.entrydetail.instance = data.WorkflowId
|
|
|
+ this.entrydetail.process = data.ProcessKey
|
|
|
+ api.getEntity(data.ContractId, this.$axios).then(res => {
|
|
|
+ console.log('拿id查编辑数据合同数据', res)
|
|
|
+ this.contractData = res.data
|
|
|
+ // this.onSelectType(this.formData.ContractClass)
|
|
|
+ this.isAccess()
|
|
|
}).catch(err => {
|
|
|
console.error(err)
|
|
|
- })
|
|
|
- var data = {percode:'oil_contract.Review.Save',}
|
|
|
- permissionApi.permissionIsauth(data, this.$axios).then(res => {
|
|
|
- console.log('权限',res.data)
|
|
|
- if(res.data.code==0){
|
|
|
- if(res.data.message=='有权限'){
|
|
|
- this.saveButton = true
|
|
|
- }
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
+ });
|
|
|
+ if (data.Status != 0) {
|
|
|
+ this.approvalProcess.disabled = false
|
|
|
+ } else {
|
|
|
+ this.approvalProcess.disabled = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
console.error(err)
|
|
|
})
|
|
|
-
|
|
|
- },
|
|
|
- //刷新数据接口
|
|
|
- refreshPage(){
|
|
|
- //拿id查审核流程
|
|
|
- this.showIdDatas(this.formData.Id)
|
|
|
-
|
|
|
- },
|
|
|
- //拿id查审核流程
|
|
|
- showIdDatas(id){
|
|
|
- api.getEntityAndCert(id, this.$axios).then(res => {
|
|
|
- console.log('拿id查编辑数据',res)
|
|
|
- this.entrydetail.business = ''
|
|
|
- var data = res.data
|
|
|
- this.formData = res.data
|
|
|
- this.entrydetail.business = id
|
|
|
- this.entrydetail.instance = data.WorkflowId
|
|
|
- this.entrydetail.process = data.ProcessKey
|
|
|
- api.getEntity(data.ContractId, this.$axios).then(res => {
|
|
|
- console.log('拿id查编辑数据合同数据',res)
|
|
|
- this.contractData = res.data
|
|
|
- // this.onSelectType(this.formData.ContractClass)
|
|
|
- this.isAccess()
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
- });
|
|
|
- if(data.Status!=0){
|
|
|
- this.approvalProcess.disabled = false
|
|
|
- }else{
|
|
|
- this.approvalProcess.disabled = true
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
- // 审核
|
|
|
- commonAuditClick(index){
|
|
|
- var index = Number(index)
|
|
|
- switch(index){
|
|
|
- // 提交审核
|
|
|
- case 0:
|
|
|
- this.$refs.submitpopup.dialogVisibleCom = true
|
|
|
- break;
|
|
|
- // 初审
|
|
|
- case 1:
|
|
|
- this.$refs.submitpopup.dialogCommonAuditMakeSureVisible = true
|
|
|
- break;
|
|
|
- // 复审
|
|
|
- case 2:
|
|
|
- this.$refs.submitpopup.dialogCommonAuditMakeSureVisible = true
|
|
|
+ },
|
|
|
+ // 审核
|
|
|
+ commonAuditClick (index) {
|
|
|
+ index = Number(index)
|
|
|
+ console.log(index, 'index')
|
|
|
+ switch (index) {
|
|
|
+ // 提交审核
|
|
|
+ case 0:
|
|
|
+ this.$refs['submitpopup'].dialogVisibleCom = true
|
|
|
+ console.log(this.$refs['submitpopup'].dialogVisibleCom, this.$refs.submitpopup.dialogVisibleCom, 'dialogVisibleCom')
|
|
|
+ break
|
|
|
+ // 初审
|
|
|
+ case 1:
|
|
|
+ this.$refs.submitpopup.dialogCommonAuditMakeSureVisible = true
|
|
|
+ break
|
|
|
+ // 复审
|
|
|
+ case 2:
|
|
|
+ this.$refs.submitpopup.dialogCommonAuditMakeSureVisible = true
|
|
|
break;
|
|
|
- // 专业科室接收
|
|
|
- case 3:
|
|
|
- this.$refs.submitpopup.auditOrgChange()
|
|
|
- this.$refs.submitpopup.dialogBusinessOfficeSeparateAuditVisible = true
|
|
|
+ // 专业科室接收
|
|
|
+ case 3:
|
|
|
+ this.$refs.submitpopup.auditOrgChange()
|
|
|
+ this.$refs.submitpopup.dialogBusinessOfficeSeparateAuditVisible = true
|
|
|
break;
|
|
|
- // 专业处室审核
|
|
|
- case 4:
|
|
|
- this.$refs.submitpopup.dialogCommonAuditMakeSureVisible = true
|
|
|
+ // 专业处室审核
|
|
|
+ case 4:
|
|
|
+ this.$refs.submitpopup.dialogCommonAuditMakeSureVisible = true
|
|
|
break;
|
|
|
- // 企管法规处
|
|
|
- case 7:
|
|
|
- this.$refs.submitpopup.dialogCommonAuditMakeSureVisible = true
|
|
|
+ // 企管法规处
|
|
|
+ case 7:
|
|
|
+ this.$refs.submitpopup.dialogCommonAuditMakeSureVisible = true
|
|
|
break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 保存评价
|
|
|
+ onSeaveBigAdd() {
|
|
|
+ if (this.formData.Status != '4') {// 普通二级用户评价evaluation_listType_one
|
|
|
+ this.evaluation_list = this.$refs.evaluation_list_one.entityListData.entityList
|
|
|
+ if (this.contractData.ContractClass == '02') {
|
|
|
+ this.evaluation_list = this.evaluation_list.concat(this.$refs.evaluation_listType_one.entityListData.entityList)
|
|
|
}
|
|
|
- },
|
|
|
-
|
|
|
- //提交评价
|
|
|
- onSubmitBigAdd(){
|
|
|
- this.$refs.submitpopup.dialogVisibleCom = true
|
|
|
- },
|
|
|
- //保存评价
|
|
|
- onSeaveBigAdd(){
|
|
|
- if(this.formData.Status!='4'){//普通二级用户评价evaluation_listType_one
|
|
|
- this.evaluation_list = this.$refs.evaluation_list_one.entityListData.entityList
|
|
|
- if(this.contractData.ContractClass=='02'){
|
|
|
- this.evaluation_list = this.evaluation_list.concat(this.$refs.evaluation_listType_one.entityListData.entityList)
|
|
|
- }
|
|
|
- // 获取第一列评价格式
|
|
|
- var list = this.evaluation_list
|
|
|
- console.log('1111111111111111111111111111111111111111111')
|
|
|
- for(var i = 0; i < list.length ; i++){
|
|
|
- if(Number(list[i].Score) > Number(list[i].NormalScore)){
|
|
|
- this.$message.error('业绩评价填写的分数不能大于标准分值');
|
|
|
- return
|
|
|
- }
|
|
|
+ // 获取第一列评价格式
|
|
|
+ var list = this.evaluation_list
|
|
|
+ console.log('1111111111111111111111111111111111111111111')
|
|
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
+ if (Number(list[i].Score) > Number(list[i].NormalScore)) {
|
|
|
+ this.$message.error('业绩评价填写的分数不能大于标准分值');
|
|
|
+ return
|
|
|
}
|
|
|
- this.$refs.evaluation_list_one.$refs.formEvaluation.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- if(this.formData.Id == 0||this.formData.Id == undefined||this.formData.Id == null){
|
|
|
- this.addEvaluate()
|
|
|
- }else{
|
|
|
- this.updateEvaluate()
|
|
|
- }
|
|
|
+ }
|
|
|
+ this.$refs.evaluation_list_one.$refs.formEvaluation.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.formData.Id == 0 || this.formData.Id == undefined || this.formData.Id == null) {
|
|
|
+ this.addEvaluate()
|
|
|
} else {
|
|
|
- this.$message.error('业绩评价填写的分数有误');
|
|
|
- }
|
|
|
- })
|
|
|
- }else{//专业处室评价
|
|
|
- this.evaluation_list = this.$refs.evaluation_list_two.entityListData.entityList
|
|
|
- var list = this.evaluation_list
|
|
|
- console.log('2222222222222222222222222222222')
|
|
|
- for(var i = 0; i < list.length ; i++){
|
|
|
- if(Number(list[i].Score) > Number(list[i].NormalScore)){
|
|
|
- this.$message.error('业绩评价填写的分数不能大于标准分值');
|
|
|
- return
|
|
|
+ this.updateEvaluate()
|
|
|
}
|
|
|
+ } else {
|
|
|
+ this.$message.error('业绩评价填写的分数有误');
|
|
|
}
|
|
|
- if(this.contractData.ContractClass=='02'){
|
|
|
- this.evaluation_list = this.evaluation_list.concat(this.$refs.evaluation_listType_two.entityListData.entityList)
|
|
|
+ })
|
|
|
+ } else {//专业处室评价
|
|
|
+ this.evaluation_list = this.$refs.evaluation_list_two.entityListData.entityList
|
|
|
+ var list = this.evaluation_list
|
|
|
+ console.log('2222222222222222222222222222222')
|
|
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
+ if (Number(list[i].Score) > Number(list[i].NormalScore)) {
|
|
|
+ this.$message.error('业绩评价填写的分数不能大于标准分值');
|
|
|
+ return
|
|
|
}
|
|
|
- // 获取第一列评价格式c
|
|
|
- this.$refs.evaluation_list_one.$refs.formEvaluation.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- this.majorEvaluate()
|
|
|
- } else {
|
|
|
- this.$message.error('业绩评价填写的分数有误');
|
|
|
- }
|
|
|
- })
|
|
|
}
|
|
|
- },
|
|
|
- //专业处室评价
|
|
|
- majorEvaluate(){
|
|
|
- // var formData = this.evaluation_list
|
|
|
- var data = {
|
|
|
- Items:this.evaluation_list,
|
|
|
- }
|
|
|
- api.saveSecEvaluation(this.formData.Id,data, this.$axios).then(res => {
|
|
|
- console.log('新增',res)
|
|
|
- if(res.data.code==0){
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
- });
|
|
|
- this.refreshPage();
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
- });
|
|
|
-
|
|
|
- },
|
|
|
- //新增评价
|
|
|
- addEvaluate(){
|
|
|
- var formData = {
|
|
|
- ContractId:this.contractData.Id,
|
|
|
- Items:this.evaluation_list,
|
|
|
- IsFinal:Number(this.IsFinal) , //是否履行,最终
|
|
|
+ if (this.contractData.ContractClass == '02') {
|
|
|
+ this.evaluation_list = this.evaluation_list.concat(this.$refs.evaluation_listType_two.entityListData.entityList)
|
|
|
}
|
|
|
- api.addContractEvaluate(formData, this.$axios).then(res => {
|
|
|
- console.log('新增',res)
|
|
|
- if(res.data.code==0){
|
|
|
- this.formData.Id = res.data.item
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
- });
|
|
|
- this.refreshPage();
|
|
|
+ // 获取第一列评价格式c
|
|
|
+ this.$refs.evaluation_list_one.$refs.formEvaluation.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.majorEvaluate()
|
|
|
+ } else {
|
|
|
+ this.$message.error('业绩评价填写的分数有误');
|
|
|
}
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
- });
|
|
|
- },
|
|
|
- //编辑评价
|
|
|
- updateEvaluate(){
|
|
|
- var formData = {
|
|
|
- ContractId:this.contractData.Id,
|
|
|
- Items:this.evaluation_list,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //专业处室评价
|
|
|
+ majorEvaluate() {
|
|
|
+ // var formData = this.evaluation_list
|
|
|
+ var data = {
|
|
|
+ Items: this.evaluation_list,
|
|
|
+ }
|
|
|
+ api.saveSecEvaluation(this.formData.Id, data, this.$axios).then(res => {
|
|
|
+ console.log('新增', res)
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ this.refreshPage();
|
|
|
}
|
|
|
- api.updateContractEvaluate(this.formData.Id,formData, this.$axios).then(res => {
|
|
|
- console.log('编辑',res)
|
|
|
- if(res.data.code==0){
|
|
|
- // this.formData.Id = res.data.item
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
- });
|
|
|
- this.refreshPage();
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
- });
|
|
|
- },
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ });
|
|
|
|
|
|
-
|
|
|
- getAuditStepCodeByStatus () {
|
|
|
- if (this.formData.Status === '1') {
|
|
|
- this.auditstepcode = 'FIRST_TRIAL'
|
|
|
- } else if (this.formData.Status === '2') {
|
|
|
- this.auditstepcode = 'SECOND_TRIAL'
|
|
|
- } else if (this.formData.Status === '3') {
|
|
|
- this.auditstepcode = 'PROF_RECE'
|
|
|
- } else if (this.formData.Status === '4') {
|
|
|
- this.auditstepcode = 'PROF_AUDIT'
|
|
|
- } else if (this.formData.Status === '5') {
|
|
|
- this.auditstepcode = 'PROF_REGULATION'
|
|
|
- } else if (this.formData.Status === '6') {
|
|
|
- this.auditstepcode = 'PAYING_FEE'
|
|
|
- } else if (this.formData.Status === '7') {
|
|
|
- this.auditstepcode = 'PROF_REGULATION_STORAGE'
|
|
|
- } else if (this.formData.Status === '10') {
|
|
|
- this.auditstepcode = 'SUB_OFFICE_WZ'
|
|
|
- }
|
|
|
- },
|
|
|
- isAccess () {
|
|
|
- this.getAuditStepCodeByStatus()
|
|
|
- let params = {
|
|
|
- id: this.formData.Id,
|
|
|
- auditstepcode: this.auditstepcode,
|
|
|
- processkey: this.formData.ProcessKey
|
|
|
+ },
|
|
|
+ //新增评价
|
|
|
+ addEvaluate() {
|
|
|
+ var formData = {
|
|
|
+ ContractId: this.contractData.Id,
|
|
|
+ Items: this.evaluation_list,
|
|
|
+ IsFinal: Number(this.IsFinal), //是否履行,最终
|
|
|
+ }
|
|
|
+ api.addContractEvaluate(formData, this.$axios).then(res => {
|
|
|
+ console.log('新增', res)
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.formData.Id = res.data.item
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ this.refreshPage();
|
|
|
}
|
|
|
- console.log('params', params)
|
|
|
- apiCert.isAccess(params, this.$axios).then(res => {
|
|
|
- this.auditBtn = res.data
|
|
|
- if(this.formData.Status=='4'&&res.data){
|
|
|
- this.auditBtnBooleanZhuan = true
|
|
|
- }else{
|
|
|
- this.auditBtnBooleanZhuan = false
|
|
|
- }
|
|
|
- if(Number(this.formData.Status)<=0){
|
|
|
- this.auditBtnBoolean = true
|
|
|
- }else{
|
|
|
- this.auditBtnBoolean = false
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- //点击下一步
|
|
|
- onSubmit_contract(){
|
|
|
- this.activeName = '2'
|
|
|
- },
|
|
|
-
|
|
|
- initDatas() {
|
|
|
- if(this.formData.Id) {
|
|
|
- api.getEntity(this.formData.Id, this.$axios).then(res => {
|
|
|
- this.formData = res.data;
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //编辑评价
|
|
|
+ updateEvaluate() {
|
|
|
+ var formData = {
|
|
|
+ ContractId: this.contractData.Id,
|
|
|
+ Items: this.evaluation_list,
|
|
|
+ }
|
|
|
+ api.updateContractEvaluate(this.formData.Id, formData, this.$axios).then(res => {
|
|
|
+ console.log('编辑', res)
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ // this.formData.Id = res.data.item
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
});
|
|
|
+ this.refreshPage();
|
|
|
}
|
|
|
- },
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- // getDictOptions() {
|
|
|
- // api.getDictList(this.$axios).then(res => {
|
|
|
- // //this.wellNoOptions = res.data.items['WellNo']
|
|
|
- // //this.supervisersOptions = res.data.items['Supervisers']
|
|
|
- // }).catch(err => {
|
|
|
- // console.error(err)
|
|
|
- // })
|
|
|
- // },
|
|
|
-
|
|
|
- //保存信息
|
|
|
- saveEntity() {
|
|
|
- this.$refs['EntityForm'].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- //this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
|
|
|
|
|
|
- if (!this.formData.Id) {
|
|
|
- this.addEntity();
|
|
|
- } else {
|
|
|
- this.updateEntity();
|
|
|
- }
|
|
|
+ getAuditStepCodeByStatus() {
|
|
|
+ if (this.formData.Status === '1') {
|
|
|
+ this.auditstepcode = 'FIRST_TRIAL'
|
|
|
+ } else if (this.formData.Status === '2') {
|
|
|
+ this.auditstepcode = 'SECOND_TRIAL'
|
|
|
+ } else if (this.formData.Status === '3') {
|
|
|
+ this.auditstepcode = 'PROF_RECE'
|
|
|
+ } else if (this.formData.Status === '4') {
|
|
|
+ this.auditstepcode = 'PROF_AUDIT'
|
|
|
+ } else if (this.formData.Status === '5') {
|
|
|
+ this.auditstepcode = 'PROF_REGULATION'
|
|
|
+ } else if (this.formData.Status === '6') {
|
|
|
+ this.auditstepcode = 'PAYING_FEE'
|
|
|
+ } else if (this.formData.Status === '7') {
|
|
|
+ this.auditstepcode = 'PROF_REGULATION_STORAGE'
|
|
|
+ } else if (this.formData.Status === '10') {
|
|
|
+ this.auditstepcode = 'SUB_OFFICE_WZ'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ isAccess() {
|
|
|
+ this.getAuditStepCodeByStatus()
|
|
|
+ let params = {
|
|
|
+ id: this.formData.Id,
|
|
|
+ auditstepcode: this.auditstepcode,
|
|
|
+ processkey: this.formData.ProcessKey
|
|
|
+ }
|
|
|
+ console.log('params', params)
|
|
|
+ apiCert.isAccess(params, this.$axios).then(res => {
|
|
|
+ this.auditBtn = res.data
|
|
|
+ if (this.formData.Status == '4' && res.data) {
|
|
|
+ this.auditBtnBooleanZhuan = true
|
|
|
+ } else {
|
|
|
+ this.auditBtnBooleanZhuan = false
|
|
|
+ }
|
|
|
+ if (Number(this.formData.Status) <= 0) {
|
|
|
+ this.auditBtnBoolean = true
|
|
|
+ } else {
|
|
|
+ this.auditBtnBoolean = false
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
- } else {
|
|
|
- return false
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
|
|
|
- addEntity() {
|
|
|
- api.addEntity(this.formData, this.$axios).then(res => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- //保存成功后,初始化数据,变成修改
|
|
|
- this.formData.Id = res.data.item;
|
|
|
- this.initDatas();
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
- });
|
|
|
+ //点击下一步
|
|
|
+ onSubmit_contract() {
|
|
|
+ this.activeName = '2'
|
|
|
+ },
|
|
|
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: res.data.message
|
|
|
- });
|
|
|
- }
|
|
|
+ initDatas() {
|
|
|
+ if (this.formData.Id) {
|
|
|
+ api.getEntity(this.formData.Id, this.$axios).then(res => {
|
|
|
+ this.formData = res.data;
|
|
|
}).catch(err => {
|
|
|
console.error(err)
|
|
|
});
|
|
|
- },
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- updateEntity() {
|
|
|
- api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- //保存成功后,初始化数据,变成修改
|
|
|
- this.initDatas();
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
- });
|
|
|
+ // getDictOptions() {
|
|
|
+ // api.getDictList(this.$axios).then(res => {
|
|
|
+ // //this.wellNoOptions = res.data.items['WellNo']
|
|
|
+ // //this.supervisersOptions = res.data.items['Supervisers']
|
|
|
+ // }).catch(err => {
|
|
|
+ // console.error(err)
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+
|
|
|
+ //保存信息
|
|
|
+ saveEntity() {
|
|
|
+ this.$refs['EntityForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ //this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
|
|
|
+
|
|
|
+ if (!this.formData.Id) {
|
|
|
+ this.addEntity();
|
|
|
} else {
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: res.data.message
|
|
|
- });
|
|
|
+ this.updateEntity();
|
|
|
}
|
|
|
- }).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)
|
|
|
+ return false
|
|
|
}
|
|
|
- },
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
- 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;
|
|
|
- },
|
|
|
- onBack(){
|
|
|
- this.$router.go(-1)
|
|
|
+ addEntity() {
|
|
|
+ api.addEntity(this.formData, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ //保存成功后,初始化数据,变成修改
|
|
|
+ this.formData.Id = res.data.item;
|
|
|
+ this.initDatas();
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ updateEntity() {
|
|
|
+ api.updateEntity(this.formData.Id, this.formData, 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;
|
|
|
+ },
|
|
|
+ onBack() {
|
|
|
+ this.$router.go(-1)
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
|
|
|
</script>
|
|
|
|