master
xy 2 years ago
parent 9d88c5f93d
commit 6880fda27d

@ -0,0 +1,152 @@
<template>
<div>
<Modal v-model="isShow" title="流程附件" footer-hide>
<div
class="item"
v-for="item in files"
v-if="item.flow && item.flow_detail"
>
<div class="item__title">
{{ itemTitle(item) }}
</div>
<div class="item__file" v-for="file in item.file_list">
<a :href="file.myurl" target="_blank" :download="file.name">{{
file.name
}}</a>
<el-button
icon="el-icon-download"
circle
size="mini"
@click="down(file.myurl, file.name)"
></el-button>
<el-button
icon="el-icon-search"
circle
size="mini"
@click="open(file.myurl)"
></el-button>
</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 { httpCurl } from "@/api/out";
export default {
data() {
return {
showModal: false,
codeUri: "",
id: "",
isShow: false,
files: [],
};
},
methods: {
setId(id) {
this.id = id;
},
show() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
async getDetail() {
let promiseAll = [
httpCurl({ tbname: "hetong", out_contract_id: this.id }),
httpCurl({ tbname: "caigou", out_caigou_id: this.id }),
httpCurl({ tbname: "pay", out_pay_id: this.id }),
];
const res = await Promise.all(promiseAll);
this.files = res;
console.log(res);
},
open(url) {
this.codeUri = `http://view.ali251.langye.net:8012/onlinePreview?url=${encodeURIComponent(
new Buffer(url).toString("base64")
)}`;
this.showModal = true;
},
down(url, name) {
let a = document.createElement("a");
a.setAttribute("href", url);
a.setAttribute("download", name);
a.setAttribute("target", "_blank");
a.click();
},
},
computed: {
itemTitle() {
return function (item) {
if (item.flow_detail.hasOwnProperty("out_caigou_id")) {
return "采购业务审批流程文件";
}
if (item.flow_detail.hasOwnProperty("out_contract_id")) {
return "合同会签流程文件";
}
if (item.flow_detail.hasOwnProperty("out_pay_id")) {
return "招标审核流程文件";
}
};
},
},
watch: {
isShow(newVal) {
if (newVal) {
this.getDetail();
}
},
},
};
</script>
<style scoped lang="scss">
a:hover {
color: $primaryColor;
text-decoration: underline;
transition: all 0.2s;
}
.item {
&__title {
font-weight: 600;
color: #333;
zoom: 1.1;
padding: 10px 0;
}
&__file {
display: flex;
& > a {
flex: 1;
}
}
}
</style>

@ -470,6 +470,17 @@
</i-button>
</Poptip>
</template>
<Button
class="slot-btns-item"
size="small"
type="primary"
@click="
$refs['oaFiles'].setId(scope.row.id),
($refs['oaFiles'].show())
"
>
流程附件
</Button>
<Button
class="slot-btns-item"
size="small"
@ -1038,6 +1049,8 @@
></contractPaymentRegistration>
<biddingUpload ref="biddingUpload" @refresh="getContracts"></biddingUpload>
<oaFiles ref="oaFiles"></oaFiles>
</div>
</template>
@ -1064,6 +1077,7 @@ import paymentRegistration from "./components/paymentRegistration";
import contractSign from "@/views/contract/components/contractSign";
import contractPaymentRegistration from "@/views/contract/components/contractPaymentRegistration";
import biddingUpload from "./components/biddingUpload.vue";
import oaFiles from './components/oaFiles.vue';
let iframe;
export default {
components: {
@ -1073,6 +1087,7 @@ export default {
contractSign,
contractPaymentRegistration,
biddingUpload,
oaFiles
},
data() {
var planPass = (rule, value, callback) => {
@ -1317,6 +1332,39 @@ export default {
break;
}
},
customFn:row => {
const getDate = (value) => {
if (row.is_substitute) {
return "无";
}
if (row.is_plan === 1) {
return "无";
}
switch (value) {
case 1:
return "待申请";
break;
case 2:
return "流转中";
break;
case 3:
return "已办结";
break;
default:
return "异常";
break;
}
}
return (
<div>
<span>{ getDate(row.purchase_status) }</span>
<br/>
{
(row.purchase_status === 1 || row.is_substitute || row.is_plan === 1) ? '' : <a style="color: #333" on={{['click']:this.toOaDetail}}>查看</a>
}
</div>
)
}
},
{
label: "采购业务审批流程",
@ -1365,7 +1413,9 @@ export default {
<div>
<span>{ getDate(row.purchase_status) }</span>
<br/>
<a href="" style="color: #333">查看</a>
{
(row.purchase_status === 1 || row.is_substitute || row.is_simple) ? '' : <a style="color: #333" on={{['click']:()=>this.toOaDetail('caigou',row)}}>查看</a>
}
</div>
)
}
@ -1423,7 +1473,9 @@ export default {
<div>
<span>{ getDate(row.invite_status) }</span>
<br/>
<a href="" style="color: #333">查看</a>
{
(row.is_substitute || row.is_simple || row.purchase_way?.remark === "false" || row.invite_status === 1) ? '' : <a style="color: #333" on={{['click']:()=>this.toOaDetail('pay',row)}}>查看</a>
}
</div>
)
}
@ -1475,7 +1527,9 @@ export default {
<div>
<span>{ getDate(row.join_status) }</span>
<br/>
<a href="" style="color: #333">查看</a>
{
(row.is_simple || row.join_status === 1) ? '' : <a style="color: #333" on={{['click']:()=>this.toOaDetail('hetong',row)}}>查看</a>
}
</div>
)
}
@ -1919,6 +1973,42 @@ export default {
};
},
methods: {
async toOaDetail (tbname,row) {
let res;
switch (tbname) {
case 'hetong':
res = await httpCurl({
tbname,
out_contract_id: row.id
})
break;
case 'caigou':
res = await httpCurl({
tbname,
out_caigou_id: row.id
})
break;
case 'pay':
res = await httpCurl({
tbname,
out_pay_id: row.id
})
break;
}
console.log(res)
if (res && res.flow?.id) {
window.open(
`http://hjjc-szemcold-test.ali251.langye.net/index.php?s=/flow/edit/id/${res.flow.id}`,
"bidding",
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
)
} else {
this.$message({
type: 'warning',
message: '未查找到该流程'
})
}
},
reset () {
this.select = deepCopy(this.selectCopy)
},
@ -2758,4 +2848,9 @@ export default {
}
}
}
a:hover {
transition: all .2s;
text-decoration: underline;
}
</style>

Loading…
Cancel
Save