@ -7,7 +7,8 @@
< div >
< span style = "padding: 0 6px;word-break: keep-all;" > 创建日期 < / span >
< span >
< DatePicker v-model ="select.showDatePicker" clearable placeholder="请选择日期" type="daterange" placement="bottom-start" style="width: 200px" @on-change="datePick" > < / DatePicker >
< DatePicker v -model = " select.showDatePicker " clearable placeholder = "请选择日期" type = "daterange"
placement = "bottom-start" style = "width: 200px" @ on - change = "datePick" > < / DatePicker >
< / span >
< / div >
@ -16,7 +17,7 @@
合同类型
< / span >
< 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 >
< Option v-for ="item in type " :value="item.value" :key="item.value"> {{ item.label }} < / Option >
< / Select >
< / div >
@ -24,14 +25,8 @@
< span style = "padding: 0 6px;word-break: keep-all;" >
科室
< / span >
< el -cascader
placeholder = "选择科室"
size = "small"
: value = "select.department"
style = "width: 160px;"
: options = "departments"
: props = "{ checkStrictly: true, label: 'name', value: 'id' }"
clearable
< 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 >
@ -57,17 +52,9 @@
< span style = "padding: 0 6px;word-break: keep-all;" >
预算金额
< / span >
< InputNumber
style = "width: 100px;"
placeholder = "最小金额"
: min = "0"
v - model = "select.priceMin" / >
< InputNumber style = "width: 100px;" placeholder = "最小金额" :min ="0" v -model = " select.priceMin " / >
< span style = "padding: 0 5px;" > - < / span >
< InputNumber
style = "width: 100px;"
placeholder = "最大金额"
: min = "0"
v - model = "select.priceMax" / >
< InputNumber style = "width: 100px;" placeholder = "最大金额" :min ="0" v -model = " select.priceMax " / >
< / div >
< Button type = "primary" style = "margin-left: 10px" @ click = "isShowAdd = true" > 新增 < / Button >
@ -84,26 +71,31 @@
< el -table -column label = "操作" fixed = "right" width = "200" header -align = " center " >
< template slot -scope = " scope " >
< div class = "slot-btns" >
< Button class = "slot-btns-item" type = "primary" size = "small" @ click = "$refs['paymentRegistration'].isShowPaymentRegistration = true,$refs['paymentRegistration'].getContract(scope.row)" > 付款登记 < / Button >
< Button class = "slot-btns-item" type = "primary" size = "small" @ click = "$refs['contractSign'].isShow = true,$refs['contractSign'].contractId = scope.row.id" > 签订合同 < / Button >
< Button class = "slot-btns-item" type = "primary" size = "small" @click ="test" > 招 标 文 件 审 查 < / Button >
< Button class = "slot-btns-item" type = "primary" size = "small"
@ click = "$refs['paymentRegistration'].isShowPaymentRegistration = true,$refs['paymentRegistration'].getContract(scope.row)" > 付款登记 < / Button >
< template v-if ="scope.row.status === 1" >
< Button class = "slot-btns-item" type = "primary" size = "small"
@ click = "$refs['contractSign'].isShow = true,$refs['contractSign'].contractId = scope.row.id" > 签订合同 < / Button >
< / template >
< Button class = "slot-btns-item" type = "primary" size = "small" > 招标文件审查 < / Button >
< Button class = "slot-btns-item" type = "primary" size = "small" > 附件管理 < / Button >
< Button class = "slot-btns-item" type = "primary" size = "small" > 请示流程 < / Button >
< Button class = "slot-btns-item" type = "primary" size = "small" > 合同会签流程申请 < / Button >
< Button class = "slot-btns-item" type = "primary" size = "small" > 采购流程申请 < / Button >
< Poptip
placement = "bottom"
: transfer = "true"
confirm
title = "确认要删除吗"
< Button class = "slot-btns-item" type = "primary" size = "small" @click ="askProcess(scope.row)" > 请 示 流 程 < / Button >
< template v-if ="scope.row.join_status === 1" >
< Button class = "slot-btns-item" type = "primary" size = "small"
@ click = "signProcess(scope.row)" > 合同会签流程申请 < / Button >
< / template >
< template v-if ="scope.row.purchase_status === 1" >
< Button class = "slot-btns-item" type = "primary" size = "small"
@ click = "buyProcess(scope.row)" > 采购流程申请 < / Button >
< / template >
< Poptip placement = "bottom" :transfer ="true" confirm title = "确认要删除吗"
@ on - ok = "()=>deleteContract(scope.row.id)" >
< i -button
type = "error"
size = "small"
ghost > 删除 < / i - b u t t o n >
< i -button type = "error" size = "small" ghost > 删除 < / i - b u t t o n >
< / Poptip >
< Button class = "slot-btns-item" type = "primary" size = "small" @ click = "$refs['detailContract'].isShowDetail = true,$refs['detailContract'].getDetail(scope.row.id)" > 查看 < / Button >
< Button class = "slot-btns-item" type = "primary" size = "small" @ click = "$refs['editor'].isShowEditor = true,$refs['editor'].getDetail(scope.row.id)" > 编辑 < / Button >
< Button class = "slot-btns-item" type = "primary" size = "small"
@ click = "$refs['detailContract'].isShowDetail = true,$refs['detailContract'].getDetail(scope.row.id)" > 查看 < / Button >
< Button class = "slot-btns-item" type = "primary" size = "small"
@ click = "$refs['editor'].isShowEditor = true,$refs['editor'].getDetail(scope.row.id)" > 编辑 < / Button >
< / div >
< / template >
< / e l - t a b l e - c o l u m n >
@ -115,7 +107,8 @@
< / div >
<!-- 新增合同 -- >
< xy -dialog :is-show.sync ="isShowAdd" title = "新增合同" type = "form" :form ="form" :rules ="rules" @submit ="submit" ref = "addContract" >
< xy -dialog :is-show.sync ="isShowAdd" title = "新增合同" type = "form" :form ="form" :rules ="rules" @submit ="submit"
ref = "addContract" >
< template v -slot : name >
< div class = "xy-table-item" >
< div class = "xy-table-item-label" >
@ -133,7 +126,7 @@
< / div >
< div class = "xy-table-item-content" >
< el -select placeholder = "请选择项目类型" v-model ="form.type" style="width: 300px;" >
< el -option v-for ="item in [{label:'服务',value:1},{label:'货品',value:2},{label:'工程',value:3}] " :label="item.label" :value="item.value"> < / el -option >
< el -option v-for ="item in type " :label="item.label" :value="item.value"> < / el -option >
< / e l - s e l e c t >
< / div >
< / div >
@ -172,6 +165,16 @@
< / div >
< / div >
< / template >
< template v -slot : money >
< div class = "xy-table-item" >
< div class = "xy-table-item-label" >
< span style = "color: red;font-weight: 600;padding-right: 4px;" > * < / span > 合同金额
< / div >
< div class = "xy-table-item-content xy-table-item-price" >
< el -input placeholder = "请填写合同金额" :value ="form.money" style = "width: 300px;" @ input = "e=>form.money = e" / >
< / div >
< / div >
< / template >
< template v -slot : fundingChannels >
< div class = "xy-table-item" >
< div class = "xy-table-item-label" >
@ -184,6 +187,26 @@
< / div >
< / div >
< / template >
< template v -slot : supply >
< div class = "xy-table-item" >
< div class = "xy-table-item-label" >
< span style = "color: red;font-weight: 600;padding-right: 4px;" > * < / span > 供应商
< / div >
< div class = "xy-table-item-content" >
< el -input placeholder = "请填写供应商" v -model = " form.supply " style = "width: 300px;" / >
< / div >
< / div >
< / template >
< template v -slot : carryDepartment >
< div class = "xy-table-item" >
< div class = "xy-table-item-label" >
< span style = "color: red;font-weight: 600;padding-right: 4px;" > * < / span > 执行部门
< / div >
< div class = "xy-table-item-content" >
< el -input placeholder = "请填写执行部门" v -model = " form.carryDepartment " style = "width: 300px;" / >
< / div >
< / div >
< / template >
< template v -slot : isBudget >
< div class = "xy-table-item" >
< div class = "xy-table-item-label" >
@ -224,7 +247,8 @@
< template v -slot : btns >
< el -table -column label = "使用金额" header -align = " center " >
< template slot -scope = " scope " >
< Input : value = "scope.row.useMoney ? scope.row.useMoney: scope.row.money" @ input = "(e)=>scope.row.useMoney = e" / >
< Input : value = "scope.row.useMoney ? scope.row.useMoney: scope.row.money"
@ input = "(e)=>scope.row.useMoney = e" / >
< / template >
< / e l - t a b l e - c o l u m n >
< / template >
@ -241,7 +265,8 @@
< / x y - d i a l o g >
<!-- 编辑 -- >
< editor :is-show-editor.sync ="isShowEditor" :purchase-type ="purchaseType" :purchase-way ="purchaseWay" :money-way ="moneyWay" ref = "editor" @success ="getContracts" > < / editor >
< editor :is-show-editor.sync ="isShowEditor" :purchase-type ="purchaseType" :purchase-way ="purchaseWay"
: money - way = "moneyWay" ref = "editor" @ success = "getContracts" > < / editor >
<!-- 查看 -- >
< detail ref = "detailContract" > < / detail >
@ -255,12 +280,29 @@
< / template >
< script >
import { getContract , addContrant , delContract , detailContract , editorContract } from "@/api/contract/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" ;
import {
getContract ,
addContrant ,
delContract
} from "@/api/contract/contract"
import {
getparameter
} from "@/api/system/dictionary"
import {
listdept
} from "@/api/system/department" ;
import {
getBudget
} from "@/api/budget/budget"
import {
getOatoken
} from "@/api/oatoken"
import {
parseTime
} from "@/utils"
import {
Message
} from "element-ui" ;
import editor from "./components/editorContract"
import detail from "./components/detailContract"
@ -300,6 +342,16 @@ export default {
priceMax : null ,
status : ""
} ,
type : [ {
label : '服务' ,
value : 1
} , {
label : '货品' ,
value : 2
} , {
label : '工程' ,
value : 3
} ] ,
purchaseType : [ ] , / / 购 买 形 式
purchaseWay : [ ] , / / 购 买 方 式
moneyWay : [ ] , / / 资 金 渠 道
@ -307,8 +359,7 @@ export default {
list : [ ] , / / 数 据
total : 0 ,
/ / 表 格
table : [
{
table : [ {
label : "项目名称" ,
width : 160 ,
prop : 'name'
@ -376,8 +427,7 @@ export default {
} ,
{
label : "采购流程" ,
multiHd : [
{
multiHd : [ {
label : "请示流程" ,
width : 200
} ,
@ -415,15 +465,19 @@ export default {
}
] ,
planTable : [
{
planTable : [ {
sortable : false ,
width : 36 ,
customFn : ( row ) => {
return (
< div >
< Checkbox on = { { [ 'on-change' ] : ( e ) => this . selectPlan ( e , row ) } } > < / Checkbox >
< / div >
return ( <
div >
<
Checkbox on = {
{
[ 'on-change' ] : ( e ) => this . selectPlan ( e , row )
}
} > < / C h e c k b o x > <
/ d i v >
)
}
} ,
@ -464,32 +518,53 @@ export default {
methods : "" ,
modality : "" ,
price : "" ,
money : '' ,
fundingChannels : "" ,
supply : '' ,
carryDepartment : "" ,
isBudget : true ,
plan : [ ]
} ,
rules : {
name : [
{ required : true , message : "必填" }
] ,
type : [
{ required : true , message : "必选" }
] ,
methods : [
{ required : true , message : "必选" }
] ,
modality : [
{ required : true , message : "必选" }
] ,
price : [
{ required : true , message : "必填" }
] ,
fundingChannels : [
{ required : true , message : "必填" }
] ,
plan : [
{ validator : planPass }
]
name : [ {
required : true ,
message : "必填"
} ] ,
type : [ {
required : true ,
message : "必选"
} ] ,
methods : [ {
required : true ,
message : "必选"
} ] ,
modality : [ {
required : true ,
message : "必选"
} ] ,
price : [ {
required : true ,
message : "必填"
} ] ,
money : [ {
required : true ,
message : "必填"
} ] ,
fundingChannels : [ {
required : true ,
message : "必填"
} ] ,
supply : [ {
required : true ,
message : "必填"
} ] ,
carryDepartment : [ {
required : true ,
message : "必填"
} ] ,
plan : [ {
validator : planPass
} ]
} ,
isShowPlan : false , / / 新 增 中 预 算 计 划
plans : [ ] , / / 预 算 数 据
@ -501,10 +576,56 @@ export default {
}
} ,
methods : {
test ( ) {
let win = window . open ( 'https://www.baidu.com' , 'baidu' , 'top=100,left=100,width=800,height=400' )
} ,
/ / 采 购 流 程
async buyProcess ( row ) {
console . log ( row )
let baseInfo = {
"项目名称" : row . name ,
"采购形式" : row . purchase _type . value ,
"采购方式" : row . purchase _way . value ,
"项目类型" : this . type . filter ( item => {
return item . value === row . type
} ) [ 0 ] . label ,
"项目预算(万元)" : row . plan _price / 10000 ,
"资金渠道" : row . money _way . value
}
let res = await getOatoken ( )
let url =
` ${ process . env . VUE _APP _OUT _URL } /admin/flow/create/2?oatoken= ${ res . oatoken } &out_contract_id= ${ row . id } &contract_json= ${ JSON . stringify ( baseInfo ) } `
let buyProcess = window . open ( url , 'buyProcess' , 'top=100,left=100,width=1000,height=600' )
} ,
/ / 会 签 流 程
async signProcess ( row ) {
let baseInfo = {
"合同名称" : row . name ,
"执行部门" : row . carry _department ,
"合同金额(万元)" : row . money ,
/ / " 承 包 商 \ \ 供 应 商 " : r o w . s u p p l y
}
let res = await getOatoken ( )
let url =
` ${ process . env . VUE _APP _OUT _URL } /admin/flow/create/3?oatoken= ${ res . oatoken } &out_contract_id= ${ row . id } &contract_json= ${ JSON . stringify ( baseInfo ) } `
let signProcess = window . open ( url , 'signProcess' , 'top=100,left=100,width=1000,height=600' )
} ,
/ / 请 示 流 程
async askProcess ( row ) {
let res = await getOatoken ( )
let url =
` ${ process . env . VUE _APP _OUT _URL } /admin/flow/create/17?oatoken= ${ res . oatoken } &out_contract_id= ${ row . id } `
let askProcess = window . open ( url , 'askProcess' , 'top=100,left=100,width=1000,height=600' )
} ,
/ / 防 抖
debounce ( fn , delay = 500 ) {
let timer = null
return function _debounce ( ) {
if ( timer ) clearTimeout ( timer )
timer = setTimeout ( ( ) => {
fn ( )
} , delay )
}
} ,
/ / 翻 页
pageChange ( e ) {
@ -523,17 +644,25 @@ export default {
/ / 获 取 预 算 计 划
async getBudgets ( ) {
let res = await getBudget ( { name : this . planSearch , page _size : 10 , page : this . plansPageIndex } )
let res = await getBudget ( {
name : this . planSearch ,
page _size : 10 ,
page : this . plansPageIndex
} )
this . plans = res . data
this . planTotal = res . total
} ,
/ / 获 取 资 金 渠 道
async getMoneyWay ( ) {
this . moneyWay = ( await getparameter ( { number : 'money_way' } ) ) . detail
this . moneyWay = ( await getparameter ( {
number : 'money_way'
} ) ) . detail
} ,
/ / 获 取 购 买 方 式
async getPurchaseWay ( ) {
this . purchaseWay = ( await getparameter ( { number : 'purchase_way' } ) ) . detail
this . purchaseWay = ( await getparameter ( {
number : 'purchase_way'
} ) ) . detail
} ,
/ / 获 取 科 室
async getDepartment ( ) {
@ -541,7 +670,9 @@ export default {
} ,
/ / 获 取 购 买 形 式 列 表
async getPurchaseType ( ) {
this . purchaseType = ( await getparameter ( { number : 'purchase_type' } ) ) . detail
this . purchaseType = ( await getparameter ( {
number : 'purchase_type'
} ) ) . detail
} ,
/ / 获 取 合 同 列 表
@ -600,6 +731,9 @@ export default {
money _way _id : this . form . fundingChannels ,
plan _price : this . form . price ,
name : this . form . name ,
supply : this . form . supply ,
carry _department : this . form . carryDepartment ,
money : this . form . money ,
contract _plan _links : this . form . plan . map ( item => {
return item . value
} )
@ -616,7 +750,9 @@ export default {
/ / 删 除 合 同
deleteContract ( id ) {
delContract ( { id } ) . then ( res => {
delContract ( {
id
} ) . then ( res => {
Message ( {
type : 'success' ,
message : '操作成功'
@ -624,7 +760,6 @@ export default {
this . getContracts ( )
} )
} ,
} ,
mounted ( ) {
this . getPurchaseType ( )
@ -645,6 +780,7 @@ export default {
margin - bottom : 6 px ;
}
}
. selectTop {
margin - top : 10 px ;
}
@ -659,6 +795,7 @@ export default {
align - content : center ;
padding : 0 8 px ;
& - no - plan {
height : 30 px ;
line - height : 30 px ;
@ -682,8 +819,10 @@ export default {
. xy - table - item - label {
width : 140 px ;
}
. xy - table - item - price {
position : relative ;
& : : after {
position : absolute ;
right : 0 ;