|
|
|
|
@ -7,7 +7,7 @@
|
|
|
|
|
<div>
|
|
|
|
|
<span style="padding: 0 6px;word-break: keep-all;">创建日期</span>
|
|
|
|
|
<span>
|
|
|
|
|
<DatePicker placeholder="请选择日期" type="daterange" placement="bottom-start" style="width: 180px"></DatePicker>
|
|
|
|
|
<DatePicker placeholder="请选择日期" type="daterange" placement="bottom-start" style="width: 200px" @on-change="datePick"></DatePicker>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@ -15,7 +15,7 @@
|
|
|
|
|
<span style="padding: 0 6px;word-break: keep-all;">
|
|
|
|
|
合同类型
|
|
|
|
|
</span>
|
|
|
|
|
<Select placeholder="请选择类型" v-model="select.type" style="width:120px;">
|
|
|
|
|
<Select placeholder="请选择类型" v-model="select.type" style="width:120px;" clearable>
|
|
|
|
|
<Option v-for="item in [{label:'服务',value:1},{label:'货品',value:2},{label:'工程',value:3}]" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</div>
|
|
|
|
|
@ -24,16 +24,22 @@
|
|
|
|
|
<span style="padding: 0 6px;word-break: keep-all;">
|
|
|
|
|
科室
|
|
|
|
|
</span>
|
|
|
|
|
<Select placeholder="请选择科室" v-model="select.department" style="width:200px;">
|
|
|
|
|
<Option v-for="item in departments" :value="item.id" :key="item.id">{{ item.name }}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
<el-cascader
|
|
|
|
|
placeholder="选择科室"
|
|
|
|
|
size="small"
|
|
|
|
|
:value="select.department"
|
|
|
|
|
style="width: 160px;"
|
|
|
|
|
:options="departments"
|
|
|
|
|
:props="{ checkStrictly: true, label: 'name', value: 'id' }"
|
|
|
|
|
clearable
|
|
|
|
|
@change="e => select.department = e[e.length-1] || ''"/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<span style="padding: 0 6px;word-break: keep-all;">
|
|
|
|
|
采购形式
|
|
|
|
|
</span>
|
|
|
|
|
<Select placeholder="请选择采购形式" v-model="select.purchaseModality" style="width:200px;">
|
|
|
|
|
<Select clearable placeholder="请选择采购形式" v-model="select.purchaseModality" style="width:200px;">
|
|
|
|
|
<Option v-for="item in purchaseType" :value="item.id" :key="item.id">{{ item.value }}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</div>
|
|
|
|
|
@ -42,7 +48,7 @@
|
|
|
|
|
<span style="padding: 0 6px;word-break: keep-all;">
|
|
|
|
|
采购方式
|
|
|
|
|
</span>
|
|
|
|
|
<Select placeholder="请选择采购方式" v-model="select.purchaseMethods" style="width:200px;">
|
|
|
|
|
<Select clearable placeholder="请选择采购方式" v-model="select.purchaseMethods" style="width:200px;">
|
|
|
|
|
<Option v-for="item in purchaseWay" :value="item.id" :key="item.id">{{ item.value }}</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</div>
|
|
|
|
|
@ -54,7 +60,6 @@
|
|
|
|
|
<InputNumber
|
|
|
|
|
placeholder="最小金额"
|
|
|
|
|
:min="0"
|
|
|
|
|
:max="select.priceMax"
|
|
|
|
|
v-model="select.priceMin"
|
|
|
|
|
:formatter="value => `¥${value}`.replace(/B(?=(d{3})+(?!d))/g, ',')"
|
|
|
|
|
:parser="value => value.replace(/$s?|(,*)/g, '')"/>
|
|
|
|
|
@ -62,7 +67,6 @@
|
|
|
|
|
<InputNumber
|
|
|
|
|
placeholder="最大金额"
|
|
|
|
|
:max="Number.MAX_VALUE"
|
|
|
|
|
:min="select.priceMin"
|
|
|
|
|
v-model="select.priceMax"
|
|
|
|
|
:formatter="value => `¥${value}`.replace(/B(?=(d{3})+(?!d))/g, ',')"
|
|
|
|
|
:parser="value => value.replace(/$s?|(,*)/g, '')"/>
|
|
|
|
|
@ -70,17 +74,18 @@
|
|
|
|
|
|
|
|
|
|
<Button type="primary" style="margin-left: 10px" @click="isShowPaymentRegistration = true">付款登记</Button>
|
|
|
|
|
<Button type="primary" style="margin-left: 10px" @click="isShowAdd = true">新增</Button>
|
|
|
|
|
<Button type="primary" style="margin-left: 10px">查询</Button>
|
|
|
|
|
<Button type="primary" style="margin-left: 10px" ghost>重置</Button>
|
|
|
|
|
<Button type="primary" style="margin-left: 10px" @click="getContracts">查询</Button>
|
|
|
|
|
<Button type="primary" style="margin-left: 10px" ghost
|
|
|
|
|
@click=" select = {pageIndex:1,startDate:'',endDate:'',type:'',department:'',purchaseModality:'',purchaseMethods:'',priceMin:null,priceMax:null,status:''}">重置</Button>
|
|
|
|
|
<Button type="primary" style="margin-left: 10px">导出</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</slot>
|
|
|
|
|
</lx-header>
|
|
|
|
|
|
|
|
|
|
<xy-table :table-item="table" :list="[{}]" @detailClick="isShowDetail = true"></xy-table>
|
|
|
|
|
<xy-table :table-item="table" :list="list" @delete="(row)=>deleteContract(row.id)"></xy-table>
|
|
|
|
|
|
|
|
|
|
<div style="display: flex;justify-content: flex-end;">
|
|
|
|
|
<Page :total="20" show-elevator />
|
|
|
|
|
<Page :total="total" show-elevator @on-change="pageChange"/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 合同详情-->
|
|
|
|
|
@ -166,7 +171,7 @@
|
|
|
|
|
</xy-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 新增合同 -->
|
|
|
|
|
<xy-dialog :is-show.sync="isShowAdd" title="新增合同" type="form" :form="form" :rules="rules" @submit="submit">
|
|
|
|
|
<xy-dialog :is-show.sync="isShowAdd" title="新增合同" type="form" :form="form" :rules="rules" @submit="submit" ref="addContract">
|
|
|
|
|
<template v-slot:name>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span="5"><span style="font-weight: 600;padding-right: 4px;color: red;">*</span>项目名称</Col>
|
|
|
|
|
@ -235,8 +240,17 @@
|
|
|
|
|
<template v-if="form.isBudget" v-slot:plan>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span="5"><span style="font-weight: 600;padding-right: 4px;color: red;">*</span>关联预算计划</Col>
|
|
|
|
|
<Col>
|
|
|
|
|
<Input placeholder="请选择关联预算计划" v-model="form.plan" style="width: 300px;" icon="ios-arrow-down" readonly @on-focus="isShowPlan = true,getBudgets()"></Input>
|
|
|
|
|
<Col style="margin: auto 0;">
|
|
|
|
|
<div class="contract-add-plan" style="width: 300px;" @click="isShowPlan = true,getBudgets()">
|
|
|
|
|
<template v-if="form.plan.length > 0">
|
|
|
|
|
<template v-for="item in form.plan">
|
|
|
|
|
<Tag closable color="primary" @on-close="delPlan(item)">{{item.label}}</Tag>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<div class="contract-add-plan-no-plan">请选择关联计划</div>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</template>
|
|
|
|
|
@ -245,23 +259,25 @@
|
|
|
|
|
<!-- 新增表 预算计划 -->
|
|
|
|
|
<xy-dialog :is-show.sync="isShowPlan" title="预算计划" :width="640">
|
|
|
|
|
<template v-slot:normalContent>
|
|
|
|
|
<Input search enter-button="搜 索" placeholder="搜索预算计划.." @on-search="(value)=>(getBudgets({name:value}))"/>
|
|
|
|
|
<Input v-model="planSearch" search enter-button="搜 索" placeholder="搜索预算计划.." @on-search="getBudgets"/>
|
|
|
|
|
|
|
|
|
|
<xy-table :list="plans" :show-index="false" :table-item="planTable" :height="240" style="margin-top: 10px;">
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column label="使用金额" header-align="center">
|
|
|
|
|
<Input />
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<Input :value="scope.row.useMoney ? scope.row.useMoney: scope.row.money" @input="(e)=>scope.row.useMoney = e"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
|
|
|
|
|
<div style="display: flex;justify-content: flex-end;">
|
|
|
|
|
<Page :total="20" show-elevator />
|
|
|
|
|
<Page :total="planTotal" show-elevator @on-change="planPageChange"/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:footerContent>
|
|
|
|
|
<Button type="primary">确定</Button>
|
|
|
|
|
<Button type="primary" @click="isShowPlan = false">确定</Button>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-dialog>
|
|
|
|
|
|
|
|
|
|
@ -348,6 +364,8 @@ import {getContract,addContrant,delContract,detailContract} from "@/api/contract
|
|
|
|
|
import {getparameter} from "@/api/system/dictionary"
|
|
|
|
|
import {listdept} from "@/api/system/department";
|
|
|
|
|
import {getBudget} from "@/api/budget/budget"
|
|
|
|
|
import {parseTime} from "@/utils"
|
|
|
|
|
import {Message} from "element-ui";
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
var planPass = (rule, value, callback) => {
|
|
|
|
|
@ -364,6 +382,7 @@ export default {
|
|
|
|
|
return {
|
|
|
|
|
//搜索
|
|
|
|
|
select:{
|
|
|
|
|
pageIndex:1,
|
|
|
|
|
startDate:"",
|
|
|
|
|
endDate:"",
|
|
|
|
|
type:"",
|
|
|
|
|
@ -378,35 +397,72 @@ export default {
|
|
|
|
|
purchaseWay:[],//购买方式
|
|
|
|
|
moneyWay:[],//资金渠道
|
|
|
|
|
departments:[],//部门科室
|
|
|
|
|
list:[],//数据
|
|
|
|
|
total:0,
|
|
|
|
|
//表格
|
|
|
|
|
table:[
|
|
|
|
|
{
|
|
|
|
|
label:"项目名称",
|
|
|
|
|
width: 160
|
|
|
|
|
width: 160,
|
|
|
|
|
prop:'name'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:"采购形势",
|
|
|
|
|
width: 160
|
|
|
|
|
label:"采购形式",
|
|
|
|
|
width: 160,
|
|
|
|
|
prop:'purchase_type.value'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:"项目类型",
|
|
|
|
|
width: 160
|
|
|
|
|
width: 160,
|
|
|
|
|
prop:'type',
|
|
|
|
|
formatter:(cell,data,value)=>{
|
|
|
|
|
switch (value){
|
|
|
|
|
case 1:
|
|
|
|
|
return "服务"
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
return "货品"
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
return "工程"
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return "未知"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:"采购方式",
|
|
|
|
|
width: 160
|
|
|
|
|
width: 160,
|
|
|
|
|
prop:"purchase_way.value"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:"资金来源",
|
|
|
|
|
width: 160
|
|
|
|
|
width: 160,
|
|
|
|
|
prop:"money_way.value"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:"项目预算(万元)",
|
|
|
|
|
width: 200
|
|
|
|
|
width: 200,
|
|
|
|
|
prop:"plan_price",
|
|
|
|
|
align:'right'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:"合同状态",
|
|
|
|
|
width: 160
|
|
|
|
|
width: 160,
|
|
|
|
|
prop:"status",
|
|
|
|
|
formatter:(cell,data,value)=>{
|
|
|
|
|
switch (value){
|
|
|
|
|
case 1:
|
|
|
|
|
return "待签订"
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
return "已签订"
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return "未知"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:"采购流程",
|
|
|
|
|
@ -431,7 +487,8 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:"创建科室",
|
|
|
|
|
width: 200
|
|
|
|
|
width: 200,
|
|
|
|
|
prop:'carry_department'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:"创建人",
|
|
|
|
|
@ -439,7 +496,11 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:"创建信息",
|
|
|
|
|
width: 200
|
|
|
|
|
width: 200,
|
|
|
|
|
prop:'created_at',
|
|
|
|
|
formatter:(cell,data,value)=>{
|
|
|
|
|
return parseTime(new Date(value))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
@ -519,10 +580,10 @@ export default {
|
|
|
|
|
{
|
|
|
|
|
sortable:false,
|
|
|
|
|
width:36,
|
|
|
|
|
customFn:()=>{
|
|
|
|
|
customFn:(row)=>{
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<Checkbox></Checkbox>
|
|
|
|
|
<Checkbox on={{['on-change']:(e)=>this.selectPlan(e,row)}}></Checkbox>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
@ -566,7 +627,7 @@ export default {
|
|
|
|
|
price:"",
|
|
|
|
|
fundingChannels:"",
|
|
|
|
|
isBudget:true,
|
|
|
|
|
plan:''
|
|
|
|
|
plan:[]
|
|
|
|
|
},
|
|
|
|
|
rules:{
|
|
|
|
|
name:[
|
|
|
|
|
@ -593,13 +654,32 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
isShowPlan:false,//新增中预算计划
|
|
|
|
|
plans:[],//预算数据
|
|
|
|
|
planSearch:'',
|
|
|
|
|
planTotal:0,
|
|
|
|
|
plansPageIndex:1,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
//翻页
|
|
|
|
|
pageChange(e){
|
|
|
|
|
this.select.pageIndex = e
|
|
|
|
|
this.getContracts()
|
|
|
|
|
},
|
|
|
|
|
planPageChange(e){
|
|
|
|
|
this.plansPageIndex = e
|
|
|
|
|
this.getBudgets()
|
|
|
|
|
},
|
|
|
|
|
//日期选择
|
|
|
|
|
datePick(e){
|
|
|
|
|
this.select.startDate = e[0]
|
|
|
|
|
this.select.endDate = e[1]
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//获取预算计划
|
|
|
|
|
async getBudgets(params){
|
|
|
|
|
this.plans = (await getBudget(params ?? {page_size:10,page:this.plansPageIndex})).data
|
|
|
|
|
async getBudgets(){
|
|
|
|
|
let res = await getBudget({name:this.planSearch,page_size:10,page:this.plansPageIndex})
|
|
|
|
|
this.plans = res.data
|
|
|
|
|
this.planTotal = res.total
|
|
|
|
|
},
|
|
|
|
|
//获取资金渠道
|
|
|
|
|
async getMoneyWay(){
|
|
|
|
|
@ -619,15 +699,85 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//获取合同列表
|
|
|
|
|
getContracts(){
|
|
|
|
|
getContract().then((res)=>{
|
|
|
|
|
console.log(res)
|
|
|
|
|
async getContracts(){
|
|
|
|
|
const res = await getContract({
|
|
|
|
|
page_size:10,
|
|
|
|
|
page:this.select.pageIndex,
|
|
|
|
|
start_created_at:this.select.startDate,
|
|
|
|
|
end_created_at:this.select.endDate,
|
|
|
|
|
type:this.select.type,
|
|
|
|
|
department_id:this.select.department,
|
|
|
|
|
purchase_type_id:this.select.purchaseModality,
|
|
|
|
|
purchase_way_id:this.select.purchaseMethods,
|
|
|
|
|
start_plan_price:this.select.priceMin,
|
|
|
|
|
end_plan_price:this.select.priceMax
|
|
|
|
|
})
|
|
|
|
|
console.log(res)
|
|
|
|
|
this.list = res.data
|
|
|
|
|
this.total = res.total
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//新建合同
|
|
|
|
|
//选择计划
|
|
|
|
|
selectPlan(e,row){
|
|
|
|
|
if(e){
|
|
|
|
|
this.form.plan.push({
|
|
|
|
|
label:row.name,
|
|
|
|
|
value:{
|
|
|
|
|
plan_id:row.id,
|
|
|
|
|
use_money:row.useMoney ?? row.money,
|
|
|
|
|
new_money:row.money
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
this.form.plan.map((item,index)=>{
|
|
|
|
|
if(item.value.plan_id === row.id){
|
|
|
|
|
this.form.plan.splice(index,1)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
delPlan(val){
|
|
|
|
|
this.form.plan.map((item,index)=>{
|
|
|
|
|
if(item.value.plan_id === val.value.plan_id){
|
|
|
|
|
this.form.plan.splice(index,1)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
//提交新建
|
|
|
|
|
submit(){
|
|
|
|
|
console.log(this.form)
|
|
|
|
|
addContrant({
|
|
|
|
|
type:this.form.type,
|
|
|
|
|
is_plan:this.form.isBudget,
|
|
|
|
|
purchase_type_id:this.form.methods,
|
|
|
|
|
purchase_way_id:this.form.modality,
|
|
|
|
|
money_way_id:this.form.fundingChannels,
|
|
|
|
|
plan_price:this.form.price,
|
|
|
|
|
name:this.form.name,
|
|
|
|
|
contract_plan_links:this.form.plan.map(item=>{
|
|
|
|
|
return item.value
|
|
|
|
|
})
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
this.isShowAdd = false
|
|
|
|
|
Message({
|
|
|
|
|
type:'success',
|
|
|
|
|
message:'操作成功'
|
|
|
|
|
})
|
|
|
|
|
this.$refs['addContract'].reset()
|
|
|
|
|
this.getContracts()
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//删除合同
|
|
|
|
|
deleteContract(id){
|
|
|
|
|
delContract({id}).then(res=>{
|
|
|
|
|
Message({
|
|
|
|
|
type:'success',
|
|
|
|
|
message:'操作成功'
|
|
|
|
|
})
|
|
|
|
|
this.getContracts()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
@ -653,6 +803,23 @@ export default {
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.contract-add-plan{
|
|
|
|
|
min-height: 30px;
|
|
|
|
|
border: 1px solid #dcdee2;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
align-items: center;
|
|
|
|
|
align-content: center;
|
|
|
|
|
|
|
|
|
|
padding: 0 8px;
|
|
|
|
|
&-no-plan{
|
|
|
|
|
height: 30px;
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
color: #CDD0D5;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.payment-registration{
|
|
|
|
|
|
|
|
|
|
&-row{
|
|
|
|
|
|