Commit 611a85d0 authored by cx49085's avatar cx49085
Browse files

增加合同的接口调试

parent 7ec49759
......@@ -8,7 +8,7 @@
<div class="container">
<el-form>
<el-descriptions :column="3" border class="contract-description-form">
<el-descriptions-item label="母合同名称" :span="3" v-if="formData.contractNature === '2'">
<el-descriptions-item label="母合同名称" :span="3" v-if="parseInt(formData.contractNature) === 2">
<el-select v-model="formData.contractParent" :style="{ width: '100%' }" placeholder="请选择母合同名称">
<el-option v-for="(item, index) in contractParentList" :key="item.contractId"
:value="item.contractId" :label="item.name"></el-option>
......@@ -157,7 +157,7 @@ export default {
contarctRemarks: ' ',
contractStartTime: '',
contractFirstParty: '',
contractMoney: 0,
contractMoney: "0",
contractNumber: '',
contractPaetyb: '',
contractEndTime: '',
......@@ -203,14 +203,11 @@ export default {
if (this.$route.path.indexOf('/editContract') >= 0 && contractId) {
this.isEdit = true;
this.getContractDetail(contractId)
// getCon
// 添加
} else if (this.$route.path.indexOf('/addContract') >= 0 && this.$route.query.checkedContractNature !== undefined) {
this.isEdit = false;
if (this.$route.query.checkedContractNature.toString() === '2') {
this.getParentContractList() //获取母合同列表
} else {
}
} else {
this.$router.back()
......@@ -243,19 +240,19 @@ export default {
companyId: this.companyId || this.$store.getters.companyId,
...this.formData
}
const toNumberKeys = ['contractNature','contractParent','contractMoney']
toNumberKeys.forEach(key => {
params[key] = Number(params[key])
})
// const toNumberKeys = ['contractNature','contractParent','contractMoney']
// toNumberKeys.forEach(key => {
// params[key] = Number(params[key])
// })
!this.formData.contarctRemarks && (params.contarctRemarks = ' ')
if (!this.isEdit) {
addContract(params).then(res => {
if (res.success) {
this.$message.success("成功添加合同")
this.addContractFile(res.id)
// setTimeout(() => {
// this.$router.push({path: '/contractList'})
// }, 1500);
this.addContractFile(res.data)
setTimeout(() => {
this.$router.push({path: '/contractList'})
}, 1000);
} else {
this.$message.warning("添加合同失败")
}
......@@ -266,8 +263,8 @@ export default {
if (res.success) {
this.$message.success("成功修改合同")
setTimeout(() => {
// this.$router.push({path: '/contractList'})
}, 1500);
this.$router.push({path: '/contractList'})
}, 1000);
} else {
this.$message.warning("添加修改失败")
}
......@@ -354,7 +351,7 @@ export default {
delete requiredParams.contractParent //非母合同
}
for (const key in requiredParams) {
if(!requiredParams[key]){
if(!requiredParams[key] && requiredParams[key] !== 0){
result.push(key)
}
}
......
......@@ -2,7 +2,7 @@
<div class="main">
<div class="header">
<el-form :inline="true" :model="contractQuery">
<el-form-item>
<!-- <el-form-item>
<el-select v-model="type" placeholder="合同类别">
<el-option
v-for="item in typeList"
......@@ -31,10 +31,10 @@
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="qurey()">查询</el-button>
<el-button type="primary" icon="el-icon-refresh-right" @click="reset()">重置</el-button>
<!-- <el-button type="primary" icon="el-icon-search" @click="qurey()">查询</el-button>
<el-button type="primary" icon="el-icon-refresh-right" @click="reset()">重置</el-button> -->
<el-button type="success" icon="el-icon-circle-plus-outline" @click="dialogTableVisible = true">添加合同</el-button>
</el-form-item>
</el-form>
......@@ -52,15 +52,16 @@
<!-- <el-table-column prop="companyName" label="状态"/> -->
<el-table-column prop="contractNumber" label="合同编号" width="120px"/>
<el-table-column prop="contractName" label="合同名称" width="200px"/>
<el-table-column label="合同类" >
<el-table-column label="合同类" >
<template slot-scope="scope">
<!-- {{Object.values(contractTypeList.find(item => item.id === scope.row.typeId)).toString()}} -->
{{ contractTypeList.find(item => item.id === scope.row.typeId) && contractTypeList.find(item => item.id = scope.row.typeId).name}}
<!-- {{Object.values(contractTypeList.find(item => item.id === scope.row.typeId))}} -->
{{ contractTypeList.find(item => item.id === scope.row.typeId) && contractTypeList.find(item => item.id === scope.row.typeId).name}}
</template>
</el-table-column>
<el-table-column prop="contractNature" label="合同性质">
<template slot-scope="scope">
{{ contractNatures[scope.row.typeId] }}
{{ contractNatures[scope.row.contractNature] }}
</template>
</el-table-column>
<el-table-column prop="contractMoney" label="合同金额/元"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment