合同会签

master
lion 12 months ago
parent b0887c0f34
commit 3ac3f2fe4e

@ -56,16 +56,8 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>合同服务时间 <span style="color: red;font-weight: 600;padding-right: 4px;">*</span>合同服务时间
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-date-picker <el-date-picker v-model="form.time" style="width: 300px;" value-format="yyyy-MM-dd" type="daterange"
v-model="form.time" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="dateRangePick" />
style="width: 300px;"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="dateRangePick"
/>
</div> </div>
</div> </div>
</template> </template>
@ -84,7 +76,8 @@
<div class="xy-table-item-label" style="width: 200px">保函金额 <div class="xy-table-item-label" style="width: 200px">保函金额
</div> </div>
<div class="xy-table-item-content xy-table-item-price"> <div class="xy-table-item-content xy-table-item-price">
<el-input-number v-model="form.assurance_money" :controls="false" :precision="2" placeholder="请输入保函金额" style="width: 300px;" /> <el-input-number v-model="form.assurance_money" :controls="false" :precision="2" placeholder="请输入保函金额"
style="width: 300px;" />
</div> </div>
</div> </div>
</template> </template>
@ -93,7 +86,8 @@
<div class="xy-table-item-label" style="width: 200px">保函有效期 <div class="xy-table-item-label" style="width: 200px">保函有效期
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-date-picker v-model="form.assurance_expire" value-format="yyyy-MM-dd" placeholder="请输入保函有效期" style="width: 300px;" /> <el-date-picker v-model="form.assurance_expire" value-format="yyyy-MM-dd" placeholder="请输入保函有效期"
style="width: 300px;" />
</div> </div>
</div> </div>
</template> </template>
@ -104,13 +98,8 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>质保金 <span style="color: red;font-weight: 600;padding-right: 4px;">*</span>质保金
</div> </div>
<div class="xy-table-item-content xy-table-item-price"> <div class="xy-table-item-content xy-table-item-price">
<el-input-number <el-input-number v-model="form.guaranteeMoney" :precision="2" :controls="false" placeholder="请填写质保金"
v-model="form.guaranteeMoney" style="width: 300px;" />
:precision="2"
:controls="false"
placeholder="请填写质保金"
style="width: 300px;"
/>
</div> </div>
</div> </div>
</template> </template>
@ -120,7 +109,8 @@
是否为延续类项目 是否为延续类项目
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-switch v-model="form.has_continue" active-text="" inactive-text="" :active-value="1" :inactive-value="0" /> <el-switch v-model="form.has_continue" active-text="" inactive-text="" :active-value="1"
:inactive-value="0" />
</div> </div>
</div> </div>
</template> </template>
@ -142,12 +132,8 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>质保期 <span style="color: red;font-weight: 600;padding-right: 4px;">*</span>质保期
</div> </div>
<div class="xy-table-item-content xy-table-item-year"> <div class="xy-table-item-content xy-table-item-year">
<el-input-number <el-input-number v-model="form.guaranteeYear" :controls="false" placeholder="请填写质保期"
v-model="form.guaranteeYear" style="width: 300px;" />
:controls="false"
placeholder="请填写质保期"
style="width: 300px;"
/>
</div> </div>
</div> </div>
</template> </template>
@ -158,27 +144,15 @@
<Button type="primary" style="margin-left: 20px;" @click="isShowAddManyPlan = true">批量添加</Button> <Button type="primary" style="margin-left: 20px;" @click="isShowAddManyPlan = true">批量添加</Button>
</div> </div>
<xy-table <xy-table :list="signList" :table-item="signTable" :show-index="false" :height="240"
:list="signList"
:table-item="signTable"
:show-index="false"
:height="240"
@delete="deleteContractSign" @delete="deleteContractSign"
@editor="(row)=>{$refs['detailContractSign'].planId = row.id;$refs['detailContractSign'].isShow = true}" @editor="(row)=>{$refs['detailContractSign'].planId = row.id;$refs['detailContractSign'].isShow = true}" />
/>
</template> </template>
</xy-dialog> </xy-dialog>
<!-- 新增计划--> <!-- 新增计划-->
<xy-dialog <xy-dialog :is-show.sync="isShowAddPlan" type="form" title="新增计划" :form="planForm" :rules="planRules" :width="48"
:is-show.sync="isShowAddPlan" @submit="submit">
type="form"
title="新增计划"
:form="planForm"
:rules="planRules"
:width="48"
@submit="submit"
>
<template v-slot:date> <template v-slot:date>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
@ -224,11 +198,7 @@
</template> </template>
</xy-dialog> </xy-dialog>
<Modal <Modal v-model="isShowAddManyPlan" title="计划任务" @on-ok="manyCreate">
v-model="isShowAddManyPlan"
title="计划任务"
@on-ok="manyCreate"
>
<div class="many-plan"> <div class="many-plan">
<div class="many-plan-item"> <div class="many-plan-item">
@ -238,17 +208,20 @@
<div class="many-plan-item"> <div class="many-plan-item">
<p>开始日期</p> <p>开始日期</p>
<el-date-picker v-model="manySetting.startMonth" size="mini" value-format="yyyy-MM-dd" @change="planMonthLists" /> <el-date-picker v-model="manySetting.startMonth" size="mini" value-format="yyyy-MM-dd"
@change="planMonthLists" />
</div> </div>
<div class="many-plan-item"> <div class="many-plan-item">
<p>付款月份数</p> <p>付款月份数</p>
<el-input-number v-model="manySetting.lastMonth" :controls="false" size="mini" :precision="0" :min="1" :max="12" @change="planMonthLists" /> <el-input-number v-model="manySetting.lastMonth" :controls="false" size="mini" :precision="0" :min="1"
:max="12" @change="planMonthLists" />
</div> </div>
<div class="many-plan-item"> <div class="many-plan-item">
<p>付款日期</p> <p>付款日期</p>
<el-input-number v-model="manySetting.day" :controls="false" size="mini" :precision="0" :min="1" :max="31" @change="planMonthLists" /> <el-input-number v-model="manySetting.day" :controls="false" size="mini" :precision="0" :min="1" :max="31"
@change="planMonthLists" />
</div> </div>
<div class="many-plan-item"> <div class="many-plan-item">
@ -269,31 +242,33 @@
</template> </template>
<script> <script>
import { MessageBox } from 'element-ui' import {
import { MessageBox
} from 'element-ui'
import {
addContractSign, addContractSign,
getContractSign, getContractSign,
delContractSign, delContractSign,
httpCurl httpCurl
} from '@/api/contractSign/contractSign' } from '@/api/contractSign/contractSign'
import { import {
detailContract, detailContract,
editorContract editorContract
} from '@/api/contract/contract' } from '@/api/contract/contract'
import { import {
Message Message
} from 'element-ui' } from 'element-ui'
import { import {
parseTime, parseTime,
moneyFormatter moneyFormatter
} from '@/utils' } from '@/utils'
import detailContractSign from '@/views/contract/components/detailContractSign' import detailContractSign from '@/views/contract/components/detailContractSign'
import { import {
getOatoken getOatoken
} from '@/api/oatoken' } from '@/api/oatoken'
import axios from 'axios' import axios from 'axios'
export default { export default {
components: { components: {
detailContractSign detailContractSign
}, },
@ -306,14 +281,18 @@ export default {
startMonth: '' startMonth: ''
}, },
manyForm: [], manyForm: [],
manyTable: [ manyTable: [{
{
prop: 'date', prop: 'date',
label: '付款日期', label: '付款日期',
width: 160, width: 160,
customFn: row => { customFn: row => {
return ( return ( <
<el-date-picker style='width: 130px;' vModel={row.date} size='mini' value-format='yyyy-MM-dd'></el-date-picker> el - date - picker style = 'width: 130px;'
vModel = {
row.date
}
size = 'mini'
value - format = 'yyyy-MM-dd' > < /el-date-picker>
) )
} }
}, },
@ -322,23 +301,36 @@ export default {
label: '金额', label: '金额',
width: 180, width: 180,
customFn: row => { customFn: row => {
return ( return ( <
<el-input-number size='mini' vModel={row.money} precision={2} controls={false}></el-input-number> el - input - number size = 'mini'
vModel = {
row.money
}
precision = {
2
}
controls = {
false
} > < /el-input-number>
) )
} }
}, },
{ {
prop: 'operate', prop: 'operate',
label: '操作', label: '操作',
customFn: (row, { $index }) => { customFn: (row, {
return ( $index
<Button type='error' }) => {
size='small' return ( <
on={{ Button type = 'error'
size = 'small'
on = {
{
'click': _ => { 'click': _ => {
this.manyForm.splice($index, 1) this.manyForm.splice($index, 1)
} }
}}>移除</Button> }
} > 移除 < /Button>
) )
} }
} }
@ -359,15 +351,35 @@ export default {
assurance_expire: '' assurance_expire: ''
}, },
rules: { rules: {
number: [{ required: true, message: '必填' }], number: [{
date: [{ required: true, message: '必填' }], required: true,
supply: [{ required: true, message: '必填' }], message: '必填'
carryDepartment: [{ required: true, message: '必填' }], }],
money: [ date: [{
{ required: true, message: '必填' }, required: true,
{ pattern: /^\d+(\.\d+)?$/, message: '必须为数字' } message: '必填'
}],
supply: [{
required: true,
message: '必填'
}],
carryDepartment: [{
required: true,
message: '必填'
}],
money: [{
required: true,
message: '必填'
},
{
pattern: /^\d+(\.\d+)?$/,
message: '必须为数字'
}
], ],
time: [{ required: true, message: '必选' }], time: [{
required: true,
message: '必选'
}],
guaranteeMoney: [], guaranteeMoney: [],
guaranteeYear: [] guaranteeYear: []
}, },
@ -436,8 +448,7 @@ export default {
} }
} }
}, },
computed: { computed: {},
},
watch: { watch: {
async contractId() { async contractId() {
await this.getContractSignList() await this.getContractSignList()
@ -460,13 +471,15 @@ export default {
// //
sign() { sign() {
{/* if (this.signList.length == 0) { {
/* if (this.signList.length == 0) {
Message({ Message({
type: 'error', type: 'error',
message: '该项目未设置付款计划,请设置付款计划后保存' message: '该项目未设置付款计划,请设置付款计划后保存'
}) })
return false return false
} */} } */
}
const signMoneyTotal = this.signList.reduce((pre, cur) => (pre + Number(cur.money || 0)), 0) const signMoneyTotal = this.signList.reduce((pre, cur) => (pre + Number(cur.money || 0)), 0)
if (signMoneyTotal !== Number(this.form.money)) { if (signMoneyTotal !== Number(this.form.money)) {
@ -502,7 +515,23 @@ export default {
this.$emit('signSuccess') this.$emit('signSuccess')
}) })
}, },
//
handleOperationSuccess() {
// 1.
const message = {
type: 'operationCompleted', //
data: {
status: 'success',
result: '合同签署成功',
}
};
// 2.
//
// *
parent.postMessage(message, 'http://192.168.60.18:8001');
// http://192.168.60.99:8080
},
async getContractSignList() { async getContractSignList() {
const res = await getContractSign({ const res = await getContractSign({
contract_id: this.contractId, contract_id: this.contractId,
@ -530,8 +559,14 @@ export default {
this.form.assurance_money = res.assurance_money this.form.assurance_money = res.assurance_money
// //
if (res.contract_type !== 160) { if (res.contract_type !== 160) {
this.rules.guaranteeMoney = [{ required: true, message: '必填' }] this.rules.guaranteeMoney = [{
this.rules.guaranteeYear = [{ required: true, message: '必填' }] required: true,
message: '必填'
}]
this.rules.guaranteeYear = [{
required: true,
message: '必填'
}]
} else { } else {
this.rules.guaranteeMoney = [] this.rules.guaranteeMoney = []
this.rules.guaranteeYear = [] this.rules.guaranteeYear = []
@ -598,7 +633,10 @@ export default {
const url = const url =
`${process.env.VUE_APP_OUT_URL}/admin/flow/view/${this.contract.join_last_flow_id}` `${process.env.VUE_APP_OUT_URL}/admin/flow/view/${this.contract.join_last_flow_id}`
// ?oatoken=${res.oatoken}&get_raw=1 // ?oatoken=${res.oatoken}&get_raw=1
const paras = { oatoken: resToken.oatoken, get_raw: 1 } const paras = {
oatoken: resToken.oatoken,
get_raw: 1
}
const res = await httpCurl(paras, true, '/Api/flowDetail', 'GET', url) const res = await httpCurl(paras, true, '/Api/flowDetail', 'GET', url)
console.log(res) console.log(res)
this.form.money = Number(res.flow['合同金额(元)']) this.form.money = Number(res.flow['合同金额(元)'])
@ -646,7 +684,7 @@ export default {
} }
} }
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@ -655,12 +693,14 @@ export default {
display: flex; display: flex;
margin-bottom: 20px; margin-bottom: 20px;
& > p {
&>p {
flex-basis: 30%; flex-basis: 30%;
flex-shrink: 0; flex-shrink: 0;
} }
} }
} }
.base-info { .base-info {
&-title { &-title {

@ -1569,6 +1569,12 @@ export default {
} }
}).catch(error => { }).catch(error => {
}) })
// oa
if(this.$route.query.oaType==='contractSign'){
let contractId = this.$route.query.contractId
this.$refs['contractSign'].isShow = true
this.$refs['contractSign'].contractId = contractId
}
this.getPurchaseType() this.getPurchaseType()
this.getContracts() this.getContracts()
this.getDepartment(-1) this.getDepartment(-1)

Loading…
Cancel
Save