master
lion 4 months ago
parent b056f0885f
commit 77c1a0f0d0

@ -9,4 +9,6 @@ VUE_APP_PREVIEW=//view.langye.net/preview/onlinePreview
VUE_APP_OUT_OLD=https://cz-hjjc-test.115.langye.net/oa
VUE_APP_OUT_URL=https://cz-hjjc-test.115.langye.net/oa
VUE_APP_DOWNLOAD_API='https://cz-hjjc-test.115.langye.net'
VUE_APP_MODULE_NAME=ht

@ -8,4 +8,6 @@ VUE_APP_PREVIEW=//view.langye.net/preview/onlinePreview
VUE_APP_OUT_OLD = /oa
VUE_APP_OUT_URL = /oa
VUE_APP_DOWNLOAD_API='http://192.167.20.118:8080'
VUE_APP_MODULE_NAME=ht

@ -29,3 +29,12 @@ export function flowStatusConfig() {
noloading: true
})
}
export function downLoadFile(params) {
return request({
url: '/api/download-file',
method: 'get',
params:params,
noloading: true
})
}

@ -31,20 +31,41 @@
<br />单个文件不能超过50M
</div>
</el-upload>
<div style="margin-top:10px">
<div>已上传文件</div>
<div v-for="item in fileListBefore">
<a style="color:blue" :href="item.url" target="_blank" rel="noopener noreferrer">
{{item.name}}
</a>
<span style="cursor: pointer;margin:0 5px" @click="open(item.url)"></span>
<span style="cursor: pointer;margin:0 5px" @click="download(item.id)"></span>
</div>
</div>
</Modal>
<Modal :width="76" transfer v-model="showModal" :footer-hide="true" title="预览">
<template>
<iframe style="width: 100%; height: 57vh" :src="codeUri" border="0"></iframe>
</template>
</Modal>
</div>
</template>
<script>
import { getToken } from "@/utils/auth"
import {downLoadFile} from "@/api/common.js"
import { detailContract, editorContract } from "@/api/contract/contract";
export default {
data() {
return {
id: "",
isShow: false,
showModal:false,
codeUri:'',
action: process.env.VUE_APP_UPLOAD_API,
fileList: [],
fileListBefore:[]
};
},
methods: {
@ -82,7 +103,21 @@ export default {
return false;
}
},
async download(id){
console.log("id",id)
// const res = downLoadFile({
// id:id
// })
let url = `${window.location.origin}/api/download-file?id=${id}&token=${window.encodeURIComponent(getToken())}`
window.open(url,'_blank')
},
open(url){
console.log("url",url)
this.codeUri = `${process.env.VUE_APP_BASE_API}/${process.env.VUE_APP_MODULE_NAME}/#/preview?url=${encodeURIComponent(
new Buffer(url).toString("base64")
)}`;
this.showModal = true;
},
async getDetail() {
const res = await detailContract({
id: this.id,
@ -91,7 +126,13 @@ export default {
this.fileList = res.tender ? res.tender.map(i => ({
url: i.url,
name: i.original_name,
response: i
response: i,
})) : []
this.fileListBefore = res.tender ? res.tender.map(i => ({
url: i.url,
name: i.original_name,
response: i,
id:i.id
})) : []
},
submit() {
@ -110,6 +151,11 @@ export default {
this.getDetail();
}
},
showModal(val){
if(!val){
this.codeUri = ''
}
}
},
};
</script>

@ -11,9 +11,9 @@
<el-button size="small" type="primary" @click="select.page=1,getOaLink()"></el-button>
</div>
<div class="xytable">
<!-- :header-cell-class-name="cellClassName" -->
<xy-table
:header-cell-class-name="cellClassName"
ref="oaTable" :list="oaList" row-key="id" :table-item="table" :height="300"
@select="handleSelectionChange">
<template v-slot:btns>
@ -135,18 +135,18 @@
return
}
if(flowsList.length>1){
this.$message.warning('只能选择一条流程关联')
return
}
let foreign_ids = this.joinIds(this.row.id,flowsList[0].out_contract_id)
console.log("flowsList",foreign_ids)
// if(flowsList.length>1){
// this.$message.warning('')
// return
// }
// let foreign_ids = this.joinIds(this.row.id,flowsList[0].out_contract_id)
let flow_ids = flowsList.map(item=>item.id).join(",")
console.log("flowsList",flow_ids)
// return
oaSave({
foreign_field:'out_contract_id',
foreign_id:foreign_ids,
flow_id:flowsList[0].id
foreign_id:this.row.id,
flow_id:flow_ids
}).then(res=>{
this.$message.success('关联成功')
this.$emit('refresh')
@ -167,11 +167,11 @@
},
handleSelectionChange(selectedRows) {
if (selectedRows.length > 1) {
//
this.$refs.oaTable.clearSelection();
this.$refs.oaTable.toggleRowSelection(selectedRows[selectedRows.length - 1]);
}
// if (selectedRows.length > 1) {
// //
// this.$refs.oaTable.clearSelection();
// this.$refs.oaTable.toggleRowSelection(selectedRows[selectedRows.length - 1]);
// }
// this.$refs.oaTable.clearSelection();
// this.$refs.oaTable.toggleRowSelection(selectedRows);
}

File diff suppressed because it is too large Load Diff

@ -208,7 +208,9 @@
</div>
</template>
<template v-slot:extraFormBottom>
<div v-if="paymentRegistrationForm.plan.length===0">
<!-- v-if="paymentRegistrationForm.plan.length===0" -->
<div >
<div style="margin:5px 0;color:#000;">拟使用预算</div>
<div class="select-container">
<DatePicker
:value="planSelect.year"
@ -218,7 +220,7 @@
type="year"
@on-change="(e) => {
planSelect.year = e
getBudgets(true)
getBudgets('',true)
}"
></DatePicker>
<el-select
@ -227,7 +229,7 @@
size="small"
v-model="planSelect.plan_department_id"
style="width: 180px;margin-right: 10px;"
@change="getBudgets(true)"
@change="getBudgets('',true)"
>
<el-option
v-for="item in departments"
@ -251,7 +253,7 @@
style="width: 220px;margin-right: 10px;"
@change="(e) => {
planSelect.type = e[e.length - 1] || '';
getBudgets(true);
getBudgets('',true);
}"
/>
<Input
@ -260,7 +262,7 @@
enter-button="搜 索"
clearable
placeholder="搜索预算计划.."
@on-search="getBudgets(true)"
@on-search="getBudgets('',true)"
/>
</div>
@ -271,7 +273,7 @@
:table-item="planTable"
:height="300"
style="margin-top: 10px"
ref="editorPlanTable"
ref="planTable"
border
@select="planPick"
key="planTable"
@ -284,8 +286,9 @@
header-align="center"
width="144"
>
<template slot-scope="scope" v-if="scope.row.pid > 0">
<InputNumber
<template slot-scope="scope">
<Input :value="scope.row.use_money" @input="inputMoney($event,scope.row)" />
<!-- <InputNumber
style="width: 120px"
:min="0"
:precision="2"
@ -295,7 +298,7 @@
(value) => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
"
:parser="(value) => value.replace(/\$\s?|(,*)/g, '')"
></InputNumber>
></InputNumber> -->
</template>
</el-table-column>
</template>
@ -304,9 +307,9 @@
<Page :total="planTotal" show-elevator @on-change="pageChange" />
</div>
</div>
<div v-else>
<!-- <div v-else>
<xy-table :list="showPlanList" key="showPlanTable" :show-index="false" :table-item="showPlanTable" :height="200" style="margin-top: 10px"
ref="editorPlanTable1">
ref="planTable1">
<template v-slot:type>
<el-table-column label="分类" width="120" header-align="center">
<template slot-scope="scope">
@ -318,7 +321,7 @@
<div></div>
</template>
</xy-table>
</div>
</div> -->
</template>
</xy-dialog>
@ -698,9 +701,9 @@
this.paymentRegistrationForm.plan = this.contract.plan_link
if(this.contract.plan_link,length>0){
this.showPlanList = this.mergePlanData(this.contract.plan_link,this.contract.plans)
}
// if(this.contract.plan_link,length>0){
// this.showPlanList = this.mergePlanData(this.contract.plan_link,this.contract.plans)
// }
console.log("this.paymentRegistrationForm.plan",this.contract.plan_link,this.showPlanList)
if(this.contract.plan_link.legnth===0){
Message({
@ -713,8 +716,9 @@
if (this.contract.borrows && this.contract.borrows.length > 0) {
this.paymentRegistrationForm.applyMoney =
parseFloat(this.contract.money) - parseFloat(this.contract.borrows[0].money) + parseFloat(this.contract.borrows[0].diff)
}
}
this.getBudgets(this.contract.plans?.map(i => i.pid>0?i.pid:i.id)?.toString())
const res = await getFundLog({
contract_id: this.contract.id,
show_type: 1
@ -729,7 +733,14 @@
}
})
},
inputMoney(e, row) {
row.use_money = e
this.paymentRegistrationForm.plan.forEach(item => {
if (item.plan_id == row.id) {
item.use_money = e
}
})
},
submit() {
let data = {
contract_id: this.contract.id,
@ -747,7 +758,7 @@
};
//
if(this.paymentRegistrationForm.plan.length===0){
let contract_plan_act_links = this.$refs.editorPlanTable.getSelection()
let contract_plan_act_links = this.$refs.planTable.getSelection()
console.log("contract_plan_act_links",contract_plan_act_links)
if(contract_plan_act_links.length<1){
Message({
@ -759,7 +770,7 @@
// 0
let money0 = 0
contract_plan_act_links.map(i=>{
if(parseFloat(i._inputMoney)<=0 || !i._inputMoney){
if(parseFloat(i.use_money)<=0 || !i.use_money){
money0++
}
})
@ -774,7 +785,7 @@
return {
plan_id:item.id,
new_money:this.contract.money,
use_money:item._inputMoney
use_money:item.use_money
}
})
}
@ -833,16 +844,24 @@
return 'allSelect'
}
},
async getBudgets(refresh) {
let res = await getBudget(this.planSelect);
async getBudgets(pid,search) {
if(search){
this.$refs.planTable.clearSelection()
this.paymentRegistrationForm.plan = []
}
let res = await getBudget({
top_pid: 1,
...this.planSelect,
pid
});
this.initInputMoney(res.list.data)
this.plans = res.list.data;
if(refresh){
this.$refs.editorPlanTable.clearSelection()
}
this.planTotal = res.list.total;
this.plans = res.list.data;
this.planTotal = res.list.total;
this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
return item.plan_id
}))
// this.toggleSelection(this.paymentRegistrationForm.plan.map(item => {
// return item.plan_id
// }))
@ -859,7 +878,7 @@
planPick (selection, row) {
if (row.year != new Date().getFullYear()) {
this.$confirm("您选择了非本年预算,是否继续?").catch(_ => {
this.$refs['editorPlanTable'].toggleRowSelection(row)
this.$refs['planTable'].toggleRowSelection(row)
})
}
},
@ -876,26 +895,62 @@
this.paymentRegistrationForm.plan = [];
}
},
toggleSelection(e) {
if (!e) {
return;
}
let plans = this.paymentRegistrationForm.plan.map((item) => {
return item.plan_id;
});
if (plans) {
this.plans
.filter((plan) => {
return plans.includes(plan.id);
})
.map((row) => {
this.$nextTick(() => {
this.$refs["planTable"].toggleRowSelection(row);
});
});
} else {
this.$refs["planTable"].clearSelection();
}
toggleSelection(plans) {
if (plans) {
console.log("this.plans",plans,this.plans,this.paymentRegistrationForm)
let arr = this.plans.filter(plan => {
if (plans.includes(plan.id)) {
plan.use_money = parseFloat(this.paymentRegistrationForm.plan[plans.indexOf(plan.id)].use_money) ==0 ?
this.totalApplyMoney() : this.paymentRegistrationForm.plan[plans.indexOf(plan.id)].use_money
return true
}else if(plans.includes(plan.pid)) {
plan.use_money = parseFloat(this.paymentRegistrationForm.plan[plans.indexOf(plan.pid)].use_money) ==0 ?
this.totalApplyMoney() : this.paymentRegistrationForm.plan[plans.indexOf(plan.pid)].use_money
return true
}else{
plan.use_money = 0
}
// plan.use_money = this.paymentRegistrationForm.applyMoney
})
console.log("arr",arr)
arr.forEach(row => {
console.log("row",row)
this.$refs.planTable.toggleRowSelection(row)
this.paymentRegistrationForm.plan.push({
contract_id: this.contract.id,
plan_id: row.id,
use_money: row.use_money,
new_money: row.money,
label: row.name,
plan:row
})
})
} else {
this.$refs.planTable.clearSelection()
}
// if (!e) {
// return;
// }
// let plans = this.paymentRegistrationForm.plan.map((item) => {
// return item.plan_id;
// });
// if (plans) {
// this.plans
// .filter((plan) => {
// return plans.includes(plan.id);
// })
// .map((row) => {
// this.$nextTick(() => {
// this.$refs["planTable"].toggleRowSelection(row);
// });
// });
// } else {
// this.$refs["planTable"].clearSelection();
// }
},
async getAssetsFlowIds() {
@ -941,7 +996,10 @@
watch: {
isShowPaymentRegistration(newVal) {
if (newVal) {
this.getBudgets();
// this.getBudgets();
}else{
this.paymentRegistrationForm.plan = []
this.$refs.planTable.clearSelection()
}
},
},

@ -650,7 +650,7 @@
签订修改
</Button>
</template>
<Button class="slot-btns-item" size="small" type="primary" @click="printFlow(scope.row)"></Button>
<!-- <Button class="slot-btns-item" size="small" type="primary" @click="printFlow(scope.row)"></Button> -->
</div>
</Poptip>
</div>
@ -784,6 +784,25 @@
<iframe style="width: 100%;height: 100%;border-radius: 0 0 6px 6px;" :src="oaUrl" frameborder="0"></iframe>
</div>
</Modal>
<!-- 打印流程 -->
<Modal
:width="86"
class-name="oa-modal"
title="流程打印"
fullscreen
:mask-closable="false"
v-model="isShowPrintModal"
footer-hide
>
<div style="width: 100%;height: 100%;">
<div v-for="(item,index) in printList">
<span>{{index+1}}{{item.flow_title}}</span>
<span @click="printFlowSigle(item.flow_id)" style="margin-left: 10px;color:blue;cursor: pointer;">打印</span>
</div>
</div>
</Modal>
</div>
</template>
@ -850,6 +869,8 @@ export default {
},
data() {
return {
isShowPrintModal:false,
printList:[],
isShowEdit: false,
isShowOaModal: false,
oaUrl: "",
@ -1313,7 +1334,32 @@ export default {
width: 200,
hidden: !/contractAll/g.test(this.$route.path),
customFn:row => {
const flows = row.contract_flow_links.filter(i => i.custom_model_id === row.flow_mod_id);
return (
flows.length>0?
flows.map((item,index)=>{
return (
<div>
<p style={{'text-align':'left'}} >
<span>
{index+1}
{
item.flow_title
}
</span>
{
row.is_purchase ? "" : (<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.other.getStatus()) }}>[{ this.flowStatus.get(row.FLOWSTATUS.other.getStatus()) ?? '待申请' }]</span>)
}
{
// (!row.is_purchase && row.FLOWSTATUS.other.getStatus() > 1) ? (<a on={{['click']:()=>this.toOaDetail('other',row,item.flow_id)}}></a>) : ""
(this.flowStatus.get(row.FLOWSTATUS.other.getStatus()) ?<a style={{'color':'blue','cursor':'pointer','margin-left':'5px'}} on={{['click']:()=>this.toOaDetail('other',row,item.flow_id)}}>查看</a>:'')
}
</p>
</div>
)
})
:
<div>
<p>
<span>
@ -1326,7 +1372,8 @@ export default {
}
</p>
{
(!row.is_purchase && row.FLOWSTATUS.other.getStatus() > 1) ? (<a on={{['click']:()=>this.toOaDetail('other',row)}}>查看</a>) : ""
// (!row.is_purchase && row.FLOWSTATUS.other.getStatus() > 1) ? (<a on={{['click']:()=>this.toOaDetail('other',row)}}></a>) : ""
}
</div>
)
@ -1766,20 +1813,39 @@ export default {
},
printFlow (row) {
let id;
if (row.purchase_last_flow_id) {
id = row.purchase_last_flow_id;
} else if (row.join_last_flow_id) {
id = row.join_last_flow_id
} else if (row.other_flow_id) {
id = row.other_flow_id
} else {}
if (!id) {
// if (row.purchase_last_flow_id) {
// id = row.purchase_last_flow_id;
// } else if (row.join_last_flow_id) {
// id = row.join_last_flow_id
// } else if (row.other_flow_id) {
// id = row.other_flow_id
// } else {}
if(row.contract_flow_links.length>0){
if(row.contract_flow_links.length===1){
id = row.contract_flow_links[0].flow_id
window.open(`${process.env.VUE_APP_OUT_URL}/flow/print-relate-flow?id=${id}&except_self=0&auth_token=${getToken()}`,"_blank")
}
if(row.contract_flow_links.length>1){
this.printList = row.contract_flow_links
this.isShowPrintModal = true
}
}else{
this.$message.warning("未找到流程");
return
}
window.open(`${process.env.VUE_APP_OUT_URL}/flow/print-relate-flow?id=${id}&except_self=0&auth_token=${this.$store.getters.oa_token}`,"_blank")
// if (!id) {
// this.$message.warning("");
// return
// }
},
printFlowSigle(id){
window.open(`${process.env.VUE_APP_OUT_URL}/flow/print-relate-flow?id=${id}&except_self=0&auth_token=${getToken()}`,"_blank")
},
showIsFramework () {
this.$nextTick(() => {
if (this.$refs['methodInput'].selected.label === '直接发包' && this.form.use_framework_buy) {
@ -1796,7 +1862,7 @@ export default {
this.oaUrl = url
this.isShowOaModal = true
},
async toOaDetail (tbname,row) {
async toOaDetail (tbname,row,id) {
let url = `${process.env.VUE_APP_OUT_URL}/#/flow/detail?auth_token=${window.encodeURIComponent(getToken())}&isSinglePage=1&flow_id=`
switch (tbname) {
case "caigou":
@ -1810,8 +1876,12 @@ export default {
url += contract?.flow_id
break;
case "other":
let other = row.contract_flow_links.find(i => i.custom_model_id == row.flow_mod_id)
url += other[0]?.flow_id
if(id){
url += id
}else{
let other = row.contract_flow_links.find(i => i.custom_model_id == row.flow_mod_id)
url += other[0]?.flow_id
}
break;
default:
url = `${process.env.VUE_APP_OUT_URL}/flow/list/todo`

@ -817,6 +817,7 @@ import {listdeptNoAuth} from "@/api/system/department";
...this.plansSelect,
pid
})
if (res.list.data) {
this.plans = res.list.data.map(i => ({
use_money:0,
@ -873,9 +874,6 @@ import {listdeptNoAuth} from "@/api/system/department";
}
});
this.paymentRegistrationForm.plan = [..._plan, ..._select]
} else {
this.paymentRegistrationForm.plan = []
}
@ -912,7 +910,6 @@ import {listdeptNoAuth} from "@/api/system/department";
arr.forEach(row => {
console.log("row",row)
this.$refs.planTable.toggleRowSelection(row)
this.paymentRegistrationForm.plan.push({
contract_id: this.contract.id,
plan_id: row.id,

@ -73,6 +73,10 @@ export default {
computed: {},
created() {
this.resolveUrl(this.$route.query.url)
},
destroyed() {
this.url = ''
this.type = ''
}
}
</script>

Loading…
Cancel
Save