合同拆分

master
xy 1 year ago
parent c00d029012
commit f7e66c1cdf

@ -69,3 +69,11 @@ export function resetMoney (params) {
noloading: true
})
}
export function cloneChildren(data) {
return request({
method: 'post',
url: '/api/admin/contract/clone-children',
data
})
}

@ -0,0 +1,105 @@
<template>
<div>
<Modal width="54" v-model="isShow" title="合同拆分" @on-ok="submit">
<div style="margin-bottom: 10px;display: flex;justify-content: space-between;">
<span>新增拆分合同</span>
<el-button type="primary" icon="el-icon-plus" size="small" @click="form.data.push({pid: '',name: row.name,plan_price: row.plan_price})">新增</el-button>
</div>
<div>
<el-form :model="form" ref="dynamicValidateForm" label-width="100px">
<template v-for="(item, index) in form.data">
<div>
<Tag color="primary" style="height: 28px;line-height: 28px;">{{ '合同'+(index+1) }}</Tag>
<el-button size="mini" type="danger" @click.prevent="form.data.splice(index,1)">删除</el-button>
</div>
<el-form-item
label="名称"
:prop="'data['+index+'].name'"
:rules="{required: true, message: '名称不能为空', trigger: 'blur'}"
>
<el-input v-model="item.name"></el-input>
</el-form-item>
<el-form-item
label="计划金额"
:prop="'data['+index+'].plan_price'"
:rules="{required: true, message: '计划金额不能为空', trigger: 'blur'}"
>
<el-input-number :min="0" :precision="2" :controls="false" v-model="item.plan_price"></el-input-number>
</el-form-item>
</template>
</el-form>
</div>
</Modal>
</div>
</template>
<script>
import { cloneChildren, detailContract } from "@/api/contract/contract";
export default {
data() {
return {
id: "",
isShow: false,
nums: 1,
form: {
data: [
]
},
row: {}
};
},
methods: {
setId(id) {
this.id = id;
},
show() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
async getDetail() {
this.row = await detailContract({ id: this.id })
},
submit() {
this.$refs['dynamicValidateForm'].validate(valid => {
if(valid) {
let subData = this.form.data.map(i => ({
...this.row,
...i,
pid: this.id,
id: "",
is_substitute: 1
}))
cloneChildren({
data: subData
}).then(res => {
this.$message.success("操作成功")
this.hide()
this.$emit('refresh')
})
}
})
},
},
computed: {},
watch: {
isShow(newVal) {
if (newVal) {
this.getDetail();
} else {
this.form.data = []
}
},
id(newVal) {
this.getDetail()
}
},
};
</script>
<style scoped lang="scss"></style>

@ -366,6 +366,15 @@
>合同审批
</Button>
</template>
<template v-if="scope.row.FLOWSTATUS['shenpi'].isEnabled()&&!scope.row.pid&&scope.row.is_contract">
<Button
class="slot-btns-item"
size="small"
type="primary"
@click="$refs['splitContract'].setId(scope.row.id),$refs['splitContract'].show()"
>合同拆分
</Button>
</template>
<template v-if="scope.row.FLOWSTATUS['caigou'].isEnabled()">
<Button
class="slot-btns-item"
@ -1144,6 +1153,8 @@
<oaFiles ref="oaFiles"></oaFiles>
<addContractLedger ref="addContractLedger" @refresh="getContracts(false,false,true)"></addContractLedger>
<splitContract ref="splitContract" @refresh="getContracts(false,false,false)"></splitContract>
</div>
</template>
@ -1174,9 +1185,11 @@ import contractPaymentRegistration from "@/views/contract/components/contractPay
import biddingUpload from "./components/biddingUpload.vue";
import oaFiles from './components/oaFiles.vue';
import addContractLedger from '@/views/contract/components/addContractLedger.vue'
import splitContract from '@/views/contract/components/splitContract.vue'
let iframe;
export default {
components: {
splitContract,
addContractLedger,
editor,
detail,
@ -2311,7 +2324,7 @@ export default {
let baseInfo = {
title: row?.name,
执行部门: row?.carry_department,
total: row?.money || row?.plan_price,
total: Number(row?.money) || Number(row?.plan_price),
out_contract_id: row.id,
contract_content: row.content,
yifang: row.supply

Loading…
Cancel
Save