master
271556543@qq.com 3 years ago
parent ca82ba207e
commit a6c8b1e168

@ -2,7 +2,7 @@
ENV = 'development'
# base api
VUE_APP_BASE_API = 'http://hdcontract.ali251.langye.net'
VUE_APP_BASE_API = http://192.168.60.99:9003/
#VUE_APP_OUT_URL = http://suzhouhedaooa.langye.net
VUE_APP_OUT_URL = http://192.168.60.18:2021

@ -39,7 +39,7 @@
</slot>
</lx-header>
<xy-table :table-item="table" :list="list" @delete="deleteTable" @editor="showEditor" :show-summary="true" :summary-method="summary">
<xy-table ref="xyTable" :table-item="table" :list="list" @delete="deleteTable" @editor="showEditor" :show-summary="true" :summary-method="summary">
</xy-table>
@ -334,6 +334,9 @@ export default {
methods: {
//
summary(param){
this.$nextTick(()=>{
this.$refs['xyTable'].$children[0].doLayout()
})
const { columns, data } = param
const sums = []
columns.map((column,index) => {

@ -38,7 +38,7 @@
</slot>
</lx-header>
<xy-table :table-item="table" :list="list" :show-summary="true" :summary-method="summary">
<xy-table ref="xyTable" :table-item="table" :list="list" :show-summary="true" :summary-method="summary">
<template v-slot:btns><div></div></template>
</xy-table>
@ -165,6 +165,9 @@ export default {
methods: {
//
summary(param){
this.$nextTick(()=>{
this.$refs['xyTable'].$children[0].doLayout()
})
const { columns, data } = param
const sums = []
columns.map((column,index) => {

@ -336,8 +336,8 @@ export default {
}
},
mounted() {
this.window.width = screen.availWidth * 0.8
this.window.height = screen.availHeight * 0.8
this.window.width = screen.availWidth * 0.95
this.window.height = screen.availHeight * 0.95
this.window.top = (window.screen.height - 30 - this.window.height)/2
this.window.left = (window.screen.width - 10 - this.window.width)/2
}

@ -32,7 +32,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>实际支付金额
</div>
<div class="xy-table-item-content xy-table-item-price">
<el-input clearable placeholder="请填写实际支付金额" v-model="form.act_money" style="width: 300px;"/>
<el-input disabled clearable placeholder="请填写实际支付金额" v-model="form.act_money" style="width: 300px;"/>
</div>
</div>
</template>

@ -29,11 +29,11 @@
<div style="grid-area: tb6-4"></div>
<div style="grid-area: tb7-1" class="print-table1-grid-center">D</div>
<div style="grid-area: tb7-2" class="print-table1-grid-center">本期扣款</div>
<div style="grid-area: tb7-3" class="print-table1-grid-center">{{priceFormat(registration.act_money)}}</div>
<div style="grid-area: tb7-3" class="print-table1-grid-center">{{priceFormat(registration.discount_money)}}</div>
<div style="grid-area: tb7-4"></div>
<div style="grid-area: tb8-1" class="print-table1-grid-center">E</div>
<div style="grid-area: tb8-2" class="print-table1-grid-center">本期应付款</div>
<div style="grid-area: tb8-3" class="print-table1-grid-center">{{priceFormat(registration.discount_money)}}</div>
<div style="grid-area: tb8-3" class="print-table1-grid-center">{{priceFormat(registration.apply_money)}}</div>
<div style="grid-area: tb8-4;padding-left: 0.6vw;display: block;">
<div style="display: flex;align-items: center;">
<div><span v-if="registration.type == '进度款'"></span></div>

@ -95,7 +95,7 @@
</slot>
</lx-header>
<xy-table :table-item="table" :list="list" @editor="" @delete="(row)=>deleteContract(row.id)" @cellClick="showPaymentPlan" :cell-style="cellStyle" :show-summary="true" :summary-method="summary">
<xy-table ref="xyTable" :table-item="table" :list="list" @editor="" @delete="(row)=>deleteContract(row.id)" @cellClick="showPaymentPlan" :cell-style="cellStyle" :show-summary="true" :summary-method="summary">
<template v-slot:btns>
<el-table-column label="操作" fixed="right" width="200" header-align="center">
<template slot-scope="scope">
@ -107,18 +107,18 @@
<Button class="slot-btns-item" type="primary" size="small" @click="$refs['contractSign'].isShow = true,$refs['contractSign'].contractId = scope.row.id">签订合同</Button>
</template>
<template v-if="scope.row.invite_status === 1 && scope.row.purchase_status === 3">
<Button class="slot-btns-item" type="primary" size="small" @click="bidding(scope.row)"></Button>
<Button class="slot-btns-item" type="primary" size="small" @click="bidding(scope.row)"></Button>
</template>
<!-- <Button class="slot-btns-item" type="primary" size="small">附件管理</Button>-->
<template v-if="scope.row.req_status === 1 && scope.row.is_plan === 0">
<Button class="slot-btns-item" type="primary" size="small" @click="askProcess(scope.row)"></Button>
</template>
<template v-if="scope.row.join_status === 1 && scope.row.invite_status === 3">
<Button class="slot-btns-item" type="primary" size="small" @click="signProcess(scope.row)"></Button>
<Button class="slot-btns-item" type="primary" size="small" @click="signProcess(scope.row)"></Button>
</template>
<template
v-if="scope.row.purchase_status === 1 && ((scope.row.req_status === 3 && scope.row.is_plan === 0)||scope.row.is_plan === 1)">
<Button class="slot-btns-item" type="primary" size="small" @click="buyProcess(scope.row)"></Button>
<Button class="slot-btns-item" type="primary" size="small" @click="buyProcess(scope.row)"></Button>
</template>
<Poptip transfer placement="bottom">
@ -396,76 +396,6 @@ export default {
}
}
},
{
label:"采购方式",
width: 120,
prop:"purchase_way.value"
},
{
label:"资金来源",
width: 120,
customFn:(row)=>{
{
return row.money_way_detail.map(item => {
return (<div>{item.value}</div>)
})
}
}
},
{
label:'已付金额',
prop:'fund_log_total',
width:180,
align:'right',
formatter:(cell,data,value)=>{
if(!value){
return '0.00'
}
return value
}
},
{
label:"合同预算价(万元)",
width: 200,
prop:"plan_price",
align:'right',
formatter:(v1,v2,value)=>{
return value.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
}
},
{
label:'合同签订价(万元)',
width: 200,
prop:'money',
align:'right'
},
{
label:"合同状态",
width: 120,
prop:"status",
formatter:(cell,data,value)=>{
switch (value){
case 1:
return "待签订"
break;
case 2:
return "已签订"
break;
default:
return "未知"
}
}
},
{
label:'付款计划',
prop:'sign_plan_count',
width: 120,
formatter:(cell,data,value)=>{
if(value == 0) return '暂无'
return value + '期'
}
},
{
label:"采购流程",
multiHd:[
@ -558,6 +488,76 @@ export default {
}
]
},
{
label:"采购方式",
width: 120,
prop:"purchase_way.value"
},
{
label:"资金来源",
width: 120,
customFn:(row)=>{
{
return row.money_way_detail.map(item => {
return (<div>{item.value}</div>)
})
}
}
},
{
label:'已付金额',
prop:'fund_log_total',
width:180,
align:'right',
formatter:(cell,data,value)=>{
if(!value){
return '0.00'
}
return value
}
},
{
label:"合同预算价(万元)",
width: 200,
prop:"plan_price",
align:'right',
formatter:(v1,v2,value)=>{
return value.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
}
},
{
label:'合同签订价(万元)',
width: 200,
prop:'money',
align:'right'
},
{
label:"合同状态",
width: 120,
prop:"status",
formatter:(cell,data,value)=>{
switch (value){
case 1:
return "待签订"
break;
case 2:
return "已签订"
break;
default:
return "未知"
}
}
},
{
label:'付款计划',
prop:'sign_plan_count',
width: 120,
formatter:(cell,data,value)=>{
if(value == 0) return '暂无'
return value + '期'
}
},
{
label:"业务科室",
width: 140,
@ -679,6 +679,9 @@ export default {
},
//
summary(param){
this.$nextTick(()=>{
this.$refs['xyTable'].$children[0].doLayout()
})
const { columns, data } = param
const sums = []
columns.map((column,index) => {
@ -712,7 +715,7 @@ export default {
},
cellStyle({row, column, rowIndex, columnIndex}){
if(columnIndex === 11){
if(column.property === 'req_status'){
if(row.is_plan === 1){
return {'color':'rgb(140,140,140)'}
}
@ -730,7 +733,7 @@ export default {
return {'color':'rgb(220,185,126)'}
}
}
if(columnIndex === 12){
if(column.property === 'purchase_status'){
switch (row.purchase_status){
case 1:
return {'color':'rgb(96,109,241)'}
@ -745,7 +748,7 @@ export default {
return {'color':'rgb(220,185,126)'}
}
}
if(columnIndex === 13){
if(column.property === 'invite_status'){
switch (row.invite_status){
case 1:
return {'color':'rgb(96,109,241)'}
@ -760,7 +763,7 @@ export default {
return {'color':'rgb(220,185,126)'}
}
}
if(columnIndex === 14){
if(column.property === 'join_status'){
switch (row.join_status){
case 1:
return {'color':'rgb(96,109,241)'}
@ -897,7 +900,8 @@ export default {
purchase_way_id:this.select.purchaseMethods,
start_plan_price:this.select.priceMin,
end_plan_price:this.select.priceMax,
status:this.select.status
status:this.select.status,
is_auth:1
})
this.list = res.list.data
this.total = res.list.total
@ -990,8 +994,8 @@ export default {
},
},
mounted() {
this.window.width = screen.availWidth * 0.8
this.window.height = screen.availHeight * 0.8
this.window.width = screen.availWidth * 0.95
this.window.height = screen.availHeight * 0.95
this.window.top = (window.screen.height - 30 - this.window.height)/2
this.window.left = (window.screen.width - 10 - this.window.width)/2

@ -0,0 +1,895 @@
<template>
<div style="padding: 0 20px;" ref="contractList">
<lx-header icon="md-apps" text="合同列表" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div class="selects">
<div>
<span style="padding: 0 6px;word-break: keep-all;">关键字</span>
<span>
<Input v-model="select.keyword" clearable placeholder="关键字搜索" style="width: 200px"/>
</span>
</div>
<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>
</span>
</div>
<div>
<span style="padding: 0 6px;word-break: keep-all;">
项目类型
</span>
<Select placeholder="请选择项目类型" v-model="select.type" style="width:140px;" clearable>
<Option v-for="item in type" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select>
</div>
<div>
<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
@change="e => select.department = e[e.length-1] || ''"/>
</div>
<div>
<span style="padding: 0 6px;word-break: keep-all;">
采购形式
</span>
<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>
<div>
<span style="padding: 0 6px;word-break: keep-all;">
采购方式
</span>
<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>
<div>
<span style="padding: 0 6px;word-break: keep-all;">
预算金额
</span>
<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"/>
</div>
<div>
<span style="padding: 0 6px;word-break: keep-all;">
状态
</span>
<Select clearable placeholder="请选择合同状态" v-model="select.status" style="width:200px;">
<Option v-for="item in [{label:'待签订',value:1},{label:'已签订',value:2}]" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select>
</div>
<Button type="primary" style="margin-left: 10px" @click="getContracts"></Button>
<Button type="primary" style="margin-left: 10px" ghost
@click=" select = {showDatePicker:'',ageIndex: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 ref="xyTable" :table-item="table" :list="list" @editor="" @delete="(row)=>deleteContract(row.id)" @cellClick="showPaymentPlan" :cell-style="cellStyle" :show-summary="true" :summary-method="summary">
<template v-slot:btns>
<el-table-column label="操作" fixed="right" width="100" header-align="center" align="center">
<template slot-scope="scope">
<div class="slot-btns">
<Button class="slot-btns-item" type="primary" size="small" @click="$refs['detailContract'].getDetail(scope.row.id),$refs['detailContract'].isShowDetail = true">查看</Button>
</div>
</template>
</el-table-column>
</template>
</xy-table>
<div style="display: flex;justify-content: flex-end;">
<Page :total="total" show-elevator @on-change="pageChange"/>
</div>
<!-- 查看-->
<detail ref="detailContract"></detail>
<!-- 查看付款计划-->
<contractPaymentRegistration ref="contractPaymentRegistration"></contractPaymentRegistration>
</div>
</template>
<script>
import {getContract,addContrant,delContract} from "@/api/contract/contract"
import {getparameter} from "@/api/system/dictionary"
import {listdeptNoAuth} 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"
import paymentRegistration from "./components/paymentRegistration";
import contractSign from "@/views/contract/components/contractSign";
import contractPaymentRegistration from "@/views/contract/components/contractPaymentRegistration";
import {login} from "@/api/user";
export default {
components:{
editor,
detail,
paymentRegistration,
contractSign,
contractPaymentRegistration
},
data() {
var planPass = (rule, value, callback) => {
if(this.form.isBudget){
if(this.form.plan.length === 0){
return callback(new Error('必选'))
}else{
callback()
}
}else{
callback()
}
}
return {
window:{
width:0,
height:0,
top:0,
left:0
},
//
select:{
keyword:'',
showDatePicker:'',
pageIndex:1,
startDate:"",
endDate:"",
type:"",
department:"",
purchaseModality:"",
purchaseMethods:"",
priceMin:null,
priceMax:null,
status:""
},
type:[{label:'服务',value:1},{label:'货物',value:2},{label:'工程',value:3}],
purchaseType: [],//
purchaseWay:[],//
moneyWay:[],//
departments:[],//
list:[],//
total:0,
//
table:[
{
label:"项目名称",
width: 150,
prop:'name',
fixed:'left',
align:'left'
},
{
label:"采购形式",
width: 120,
prop:'purchase_type.value'
},
{
label:"项目类型",
width: 120,
prop:'type',
formatter:(cell,data,value)=>{
switch (value){
case 1:
return "服务"
break;
case 2:
return "货物"
break;
case 3:
return "工程"
break;
default:
return "未知"
}
}
},
{
label:"采购流程",
multiHd:[
{
label:"请示流程",
width: 140,
prop:'req_status',
formatter:(cell,data,value)=>{
if(cell.is_plan === 1){
return '无'
}
switch (value){
case 1:
return "待申请"
break;
case 2:
return "流转中"
break;
case 3:
return "已办结"
break;
default:
return "异常"
break;
}
}
},
{
label:"采购业务审批流程",
width: 158,
prop:'purchase_status',
formatter:(cell,data,value)=>{
switch (value){
case 1:
return "待申请"
break;
case 2:
return "流转中"
break;
case 3:
return "已办结"
break;
default:
return "异常"
break;
}
}
},
{
label:"招标审核流程",
width: 145,
prop:'invite_status',
formatter:(cell,data,value)=>{
switch (value){
case 1:
return "待申请"
break;
case 2:
return "流转中"
break;
case 3:
return "已办结"
break;
default:
return "异常"
break;
}
}
},
{
label:"合同会签流程",
width: 145,
prop:'join_status',
formatter:(cell,data,value)=>{
switch (value){
case 1:
return "待申请"
break;
case 2:
return "流转中"
break;
case 3:
return "已办结"
break;
default:
return "异常"
break;
}
}
}
]
},
{
label:"采购方式",
width: 120,
prop:"purchase_way.value"
},
{
label:"资金来源",
width: 120,
customFn:(row)=>{
{
return row.money_way_detail.map(item => {
return (<div>{item.value}</div>)
})
}
}
},
{
label:'已付金额',
prop:'fund_log_total',
width:180,
align:'right',
formatter:(cell,data,value)=>{
if(!value){
return '0.00'
}
return value
}
},
{
label:"合同预算价(万元)",
width: 200,
prop:"plan_price",
align:'right',
formatter:(v1,v2,value)=>{
return value.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
}
},
{
label:'合同签订价(万元)',
width: 200,
prop:'money',
align:'right'
},
{
label:"合同状态",
width: 120,
prop:"status",
formatter:(cell,data,value)=>{
switch (value){
case 1:
return "待签订"
break;
case 2:
return "已签订"
break;
default:
return "未知"
}
}
},
{
label:'付款计划',
prop:'sign_plan_count',
width: 120,
formatter:(cell,data,value)=>{
if(value == 0) return '暂无'
return value + '期'
}
},
{
label:"业务科室",
width: 140,
prop:'department.name'
},
{
label:"经办人",
width: 140,
prop:'admin.name'
},
{
label:"创建日期",
width: 160,
prop:'created_at',
formatter:(cell,data,value)=>{
return parseTime(new Date(value),"{y}-{m}-{d}")
}
}
],
//
tableTotal:{
fundLogTotal:0,
moneyTotal:0,
planPriceTotal:0
},
planTable:[
{
width: 36,
sortable: false,
type:'selection'
},
{
label:"分类",
prop:'type',
formatter:(cell,data,value)=>{
switch (value){
case 1:
return "部门预算"
break;
case 2:
return "水务计划"
break;
default:
return "未知"
}
}
},
{
label:"名称",
prop:'name',
align:'left'
},
{
label:"计划金额",
prop:'money',
align:'right'
}
],
//
isShowAdd:false,
form:{
name:"",
type:"",
methods:"",
modality:"",
price:"",
fundingChannels:[],
isBudget:true,
plan:[]
},
rules:{
name:[
{required:true,message:"必填"}
],
type:[
{required:true,message:"必选"}
],
methods:[
{required:true,message:"必选"}
],
modality:[
{required:true,message:"必选"}
],
price:[
{required:true,message:"必填"},
{pattern:/^\d+(\.\d+)?$/, message: '必须为数字'}
],
fundingChannels:[
{required:true,message:"必填"}
],
plan:[
{validator:planPass, trigger: 'change'}
]
},
isShowPlan:false,//
plans:[],//
planSearch:'',
planTotal:0,
plansPageIndex:1,
isShowEditor:false,
}
},
methods: {
//
planInput(e,row){
if(e <= (Number(row.money) - Number(row.use_money_total))){
row.useMoney = e
}else{
Message({
type:'warning',
message:'使用金额大于剩余预算'
})
row.useMoney = 0
}
},
//
summary(param){
this.$nextTick(()=>{
this.$refs['xyTable'].$children[0].doLayout()
})
const { columns, data } = param
const sums = []
columns.map((column,index) => {
if(index === 0){
sums[index] = '总计'
return
}
if(column.property === 'fund_log_total'){
sums[index] = this.tableTotal.fundLogTotal
return
}
if(column.property === 'plan_price'){
sums[index] = this.tableTotal.planPriceTotal
return
}
if(column.property === 'money'){
sums[index] = this.tableTotal.moneyTotal
return
}
// const values = data.map(item => Number(item[column.property]));
// if (!values.every(value => isNaN(value)) && (column.property === 'money' || column.property === 'plan_price'|| column.property === 'fund_log_total')) {
//
// sums[index] = sums[index].toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
// } else {
// sums[index] = '';
// }
})
return sums
},
cellStyle({row, column, rowIndex, columnIndex}){
if(column.property === 'req_status'){
if(row.is_plan === 1){
return {'color':'rgb(140,140,140)'}
}
switch (row.req_status){
case 1:
return {'color':'rgb(96,109,241)'}
break;
case 2:
return {'color':'rgb(219,122,122)'}
break;
case 3:
return {'color':'rgb(147,201,134)'}
break;
default:
return {'color':'rgb(220,185,126)'}
}
}
if(column.property === 'purchase_status'){
switch (row.purchase_status){
case 1:
return {'color':'rgb(96,109,241)'}
break;
case 2:
return {'color':'rgb(219,122,122)'}
break;
case 3:
return {'color':'rgb(147,201,134)'}
break;
default:
return {'color':'rgb(220,185,126)'}
}
}
if(column.property === 'invite_status'){
switch (row.invite_status){
case 1:
return {'color':'rgb(96,109,241)'}
break;
case 2:
return {'color':'rgb(219,122,122)'}
break;
case 3:
return {'color':'rgb(147,201,134)'}
break;
default:
return {'color':'rgb(220,185,126)'}
}
}
if(column.property === 'join_status'){
switch (row.join_status){
case 1:
return {'color':'rgb(96,109,241)'}
break;
case 2:
return {'color':'rgb(219,122,122)'}
break;
case 3:
return {'color':'rgb(147,201,134)'}
break;
default:
return {'color':'rgb(220,185,126)'}
}
}
},
//
showPaymentPlan(row, column, cell){
//console.log(column)
if(column.property === 'sign_plan_count'){
this.$refs['contractPaymentRegistration'].getSignPlan(row.id)
this.$refs['contractPaymentRegistration'].isShow = true
}
if(column.property === 'fund_log_total'){
this.$router.push(`/contract/paymentRegistrationList?contractId=${row.id}`)
}
},
//
async bidding(row){
let baseInfo = {
"项目名称":row?.name,
"项目预算(万元)":row?.plan_price
}
let res = await getOatoken()
let url =`${process.env.VUE_APP_OUT_URL}/admin/flow/create/27?oatoken=${res.oatoken}&out_contract_id=${row.id}&contract_json=${JSON.stringify(baseInfo)}`
let bidding = window.open(url,'bidding',`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`)
},
//
async buyProcess(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,
"资金渠道":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=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`)
},
//
async signProcess(row){
let baseInfo = {
"合同名称":row?.name,
"执行部门":row?.carry_department,
"合同金额(万元)":row?.money,
//"\\":row.supply
}
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=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`)
},
//
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=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`)
},
//
debounce(fn,delay=500){
let timer = null
return function _debounce() {
if (timer) clearTimeout(timer)
timer = setTimeout(() => {
fn()
}, delay)
}
},
//
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(){
let res = await getBudget({name:this.planSearch,page_size:10,page:this.plansPageIndex})
this.plans = res.list.data
this.planTotal = res.list.total
},
//
async getMoneyWay(){
this.moneyWay = (await getparameter({number:'money_way'})).detail
},
//
async getPurchaseWay(){
this.purchaseWay = (await getparameter({number:'purchase_way'})).detail
},
//
async getDepartment(){
this.departments = await listdeptNoAuth()
},
//
async getPurchaseType(){
this.purchaseType = (await getparameter({number:'purchase_type'})).detail
},
//
async getContracts(){
const res = await getContract({
keyword:this.select.keyword,
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,
status:this.select.status
})
this.list = res.list.data
this.total = res.list.total
this.tableTotal.fundLogTotal = res.fund_log_total
this.tableTotal.moneyTotal = Number(res.money_total).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
this.tableTotal.planPriceTotal = Number(res.plan_price_total).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
},
//
//
async showPlan(){
this.isShowPlan = true
await this.getBudgets()
this.toggleSelection(this.form.plan.map(item => {
return item.value.plan_id
}))
},
//
selectPlan(sel,row){
if(sel){
//console.log(sel,row)
this.form.plan = sel.map(item => {
return {
label:item.name,
value:{
plan_id:item.id,
use_money:item.useMoney,
new_money:item.money
}
}
})
}else{
this.form.plan = []
}
},
//
toggleSelection(plans) {
if (plans && plans.length > 0) {
this.plans.filter(plan => {
return plans.includes(plan.id)
}).map(row => {
this.$refs.planTable.toggleRowSelection(row)
})
} else {
this.$refs.planTable.clearSelection()
}
},
delPlan(val){
this.form.plan.map((item,index)=>{
if(item.value.plan_id === val.value.plan_id){
this.form.plan.splice(index,1)
}
})
},
//
submit(){
addContrant({
type:this.form.type,
is_plan:this.form.isBudget ? 1 : 0,
purchase_type_id:this.form.methods,
purchase_way_id:this.form.modality,
money_way_id:`${this.form.fundingChannels.toString()}`,
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.$refs['planTable'].clearSelection()
this.getContracts()
})
},
//
deleteContract(id){
delContract({id}).then(res=>{
Message({
type:'success',
message:'操作成功'
})
this.getContracts()
})
},
},
mounted() {
this.window.width = screen.availWidth * 0.95
this.window.height = screen.availHeight * 0.95
this.window.top = (window.screen.height - 30 - this.window.height)/2
this.window.left = (window.screen.width - 10 - this.window.width)/2
this.getPurchaseType()
this.getContracts()
this.getDepartment()
this.getPurchaseWay()
this.getMoneyWay()
//
window.onfocus = () => {
this.getContracts()
}
},
destroyed() {
window.onfocus = null
}
}
</script>
<style scoped lang="scss">
.selects{
display: flex;
flex-wrap: wrap;
&>div{
margin-bottom: 6px;
}
}
.selectTop{
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;
}
}
.slot-btns{
display: flex;
flex-wrap: wrap;
align-content: center;
justify-content: flex-start;
&-item{
margin: 0 6px 4px 0;
}
}
.xy-table-item-label{
width: 140px;
}
.xy-table-item-price{
position: relative;
&::after{
position: absolute;
right: 0;
top: 0;
content:'(万元)'
}
}
</style>

@ -61,7 +61,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>本期扣款金额
</div>
<div class="xy-table-item-content xy-table-item-price">
<el-input readonly clearable placeholder="请填写扣款金额" v-model="paymentRegistrationForm.deductionMoney" style="width: 300px;"/>
<el-input readonly clearable placeholder="请填写扣款金额" v-model="paymentRegistrationForm.discountMoney" style="width: 300px;"/>
</div>
</div>
</template>
@ -259,6 +259,7 @@ export default {
this.paymentRegistrationForm.deductionMoney = res.apply_money
this.paymentRegistrationForm.applyMoney = res.apply_money
this.paymentRegistrationForm.plan = res.plan_link
this.paymentRegistrationForm.discountMoney = res.discount_money
await this.getContract(res.contract)
},

@ -46,8 +46,8 @@ module.exports = {
//before: require('./mock/mock-server.js')
proxy: {
[process.env.VUE_APP_BASE_API]: {
target: 'http://hdcontract.ali251.langye.net',
//target: 'http://192.168.60.99:9003/',
//target: 'http://hdcontract.ali251.langye.net',
target: 'http://192.168.60.99:9003/',
changeOrigin: true, //配置跨域
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save