master
xy 2 years ago
parent b8ecac7511
commit ea11586e08

@ -126,6 +126,27 @@ export function debounce(fn,delay=500){
}, delay) }, delay)
} }
} }
export function throttle (fn, interval) {
let _self = fn, // 保存需要被延迟执行的函数引用
timer, // 定时器
firstTime = true; // 是否是第一次调用
return function () {
const args = arguments;
const _me = this;
if (firstTime) { // 如果是第一次调用不需要延迟
_self.apply(_me, args); // 执行fn函数并且修正此函数中this所运行的上下文指向
return firstTime = false;
}
if (timer) { // 如果定时器还在,说明前一次延迟执行还没有完成
return false;
}
timer = setTimeout(function () { // 延迟一段时间执行
clearTimeout(timer);
timer = null;
_self.apply(_me, args); // 执行fn函数并且修正此函数中this所运行的上下文指向
}, interval || 500);
}
}
//金额分隔 //金额分隔
export function moneyFormatter(money,precision=2){ export function moneyFormatter(money,precision=2){

@ -14,7 +14,6 @@
<div class="xy-table-item-label">标题 </div> <div class="xy-table-item-label">标题 </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-input <el-input
:readonly="isExpense"
v-model="form.title" v-model="form.title"
clearable clearable
placeholder="请输入标题" placeholder="请输入标题"
@ -27,7 +26,7 @@
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label">是否用车 </div> <div class="xy-table-item-label">是否用车 </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-radio-group :disabled="isExpense" style="width: 300px" v-model="form.use_car"> <el-radio-group style="width: 300px" v-model="form.use_car">
<el-radio :label="1"></el-radio> <el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio> <el-radio :label="0"></el-radio>
</el-radio-group> </el-radio-group>
@ -38,7 +37,7 @@
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label">是否室内补助 </div> <div class="xy-table-item-label">是否室内补助 </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-radio-group :disabled="isExpense" style="width: 300px" v-model="form.is_subsidize"> <el-radio-group style="width: 300px" v-model="form.is_subsidize">
<el-radio :label="1"></el-radio> <el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio> <el-radio :label="0"></el-radio>
</el-radio-group> </el-radio-group>
@ -50,7 +49,6 @@
<div class="xy-table-item-label">开始时间 </div> <div class="xy-table-item-label">开始时间 </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-date-picker <el-date-picker
:readonly="isExpense"
v-model="form.start_date" v-model="form.start_date"
placeholder="请选择开始时间" placeholder="请选择开始时间"
style="width: 300px" style="width: 300px"
@ -64,7 +62,6 @@
<div class="xy-table-item-label">开始时间 </div> <div class="xy-table-item-label">开始时间 </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-date-picker <el-date-picker
:readonly="isExpense"
v-model="form.end_date" v-model="form.end_date"
placeholder="请选择开始时间" placeholder="请选择开始时间"
style="width: 300px" style="width: 300px"
@ -77,7 +74,7 @@
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label">用车审核 </div> <div class="xy-table-item-label">用车审核 </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-radio-group :disabled="isExpense" style="width: 300px" v-model="form.use_car_status"> <el-radio-group style="width: 300px" v-model="form.use_car_status">
<el-radio :label="1">待申请</el-radio> <el-radio :label="1">待申请</el-radio>
<el-radio :label="2">流转中</el-radio> <el-radio :label="2">流转中</el-radio>
<el-radio :label="3">已结办</el-radio> <el-radio :label="3">已结办</el-radio>
@ -89,7 +86,7 @@
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label">市内补助审核 </div> <div class="xy-table-item-label">市内补助审核 </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-radio-group :disabled="isExpense" style="width: 300px" v-model="form.subsidize_status"> <el-radio-group style="width: 300px" v-model="form.subsidize_status">
<el-radio :label="1">待申请</el-radio> <el-radio :label="1">待申请</el-radio>
<el-radio :label="2">流转中</el-radio> <el-radio :label="2">流转中</el-radio>
<el-radio :label="3">已结办</el-radio> <el-radio :label="3">已结办</el-radio>
@ -101,7 +98,7 @@
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label">出差审核 </div> <div class="xy-table-item-label">出差审核 </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-radio-group :disabled="isExpense" style="width: 300px" v-model="form.away_status"> <el-radio-group style="width: 300px" v-model="form.away_status">
<el-radio :label="1">待申请</el-radio> <el-radio :label="1">待申请</el-radio>
<el-radio :label="2">流转中</el-radio> <el-radio :label="2">流转中</el-radio>
<el-radio :label="3">已结办</el-radio> <el-radio :label="3">已结办</el-radio>
@ -113,7 +110,7 @@
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label">出差报销审核 </div> <div class="xy-table-item-label">出差报销审核 </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-radio-group :disabled="isExpense" style="width: 300px" v-model="form.expense_status"> <el-radio-group style="width: 300px" v-model="form.expense_status">
<el-radio :label="1">待申请</el-radio> <el-radio :label="1">待申请</el-radio>
<el-radio :label="2">流转中</el-radio> <el-radio :label="2">流转中</el-radio>
<el-radio :label="3">已结办</el-radio> <el-radio :label="3">已结办</el-radio>

@ -255,6 +255,7 @@ export default {
label: "流程状态", label: "流程状态",
multiHd: [ multiHd: [
{ {
width: 100,
label: "用车", label: "用车",
customFn:row => { customFn:row => {
if (!row.FLOWSTATUS.useCar.getExecutable()) { if (!row.FLOWSTATUS.useCar.getExecutable()) {
@ -275,6 +276,7 @@ export default {
} }
}, },
{ {
width: 100,
label: "市内补助", label: "市内补助",
customFn:row => { customFn:row => {
if (!row.FLOWSTATUS.subsidize.getExecutable()) { if (!row.FLOWSTATUS.subsidize.getExecutable()) {
@ -296,6 +298,7 @@ export default {
}, },
{ {
width: 100,
label: "出差审批", label: "出差审批",
customFn:row => { customFn:row => {
return ( return (
@ -313,10 +316,15 @@ export default {
}, },
{ {
label: "出差报销", label: "出差报销",
width: 100,
customFn:row => { customFn:row => {
return ( return (
<div> <div>
<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.expense.getStatus()) }}>{ this.flowStatus.get(row.FLOWSTATUS.expense.getStatus()) || '待申请' }</span> {
((this.$moment().diff(this.$moment(row.end_date),"days") <= 30) || (row.FLOWSTATUS.expense.getStatus() > 1)) ?
(<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.expense.getStatus()) }}>{ this.flowStatus.get(row.FLOWSTATUS.expense.getStatus()) || '待申请' }</span>) :
(<span style="color: red">超时未办理</span>)
}
<br/> <br/>
{ {
(row.FLOWSTATUS.expense.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{ (row.FLOWSTATUS.expense.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
@ -327,6 +335,7 @@ export default {
} }
}, },
{ {
width: 100,
label: "财务审核", label: "财务审核",
customFn:row => { customFn:row => {
return (row.FLOWSTATUS.financial.getStatus() === 2) ? (<span style="color: green;">已确认</span>) : (<span style="color: #666;">待审核</span>) return (row.FLOWSTATUS.financial.getStatus() === 2) ? (<span style="color: green;">已确认</span>) : (<span style="color: #666;">待审核</span>)
@ -466,7 +475,7 @@ export default {
flowStatus.away.setExecutable(true) flowStatus.away.setExecutable(true)
} }
flowStatus.expense.setStatus(item.expense_status) flowStatus.expense.setStatus(item.expense_status)
if ((!item.is_subsidize || item.subsidize_status === 3) && (!item.use_car || item.use_car_status === 3) && item.away_status === 3 && !item.expense_status) { if ((!item.is_subsidize || item.subsidize_status === 3) && (!item.use_car || item.use_car_status === 3) && item.away_status === 3 && !item.expense_status && (this.$moment().diff(this.$moment(item.end_date),"days") <= 30)) {
flowStatus.expense.setExecutable(true) flowStatus.expense.setExecutable(true)
} }
@ -500,7 +509,7 @@ export default {
return function (row) { return function (row) {
return !(row.FLOWSTATUS.useCar.getStatus() > 1 || row.FLOWSTATUS.subsidize.getStatus() > 1 || row.FLOWSTATUS.away.getStatus() > 1 || row.FLOWSTATUS.financial.getStatus() > 1) return !(row.FLOWSTATUS.useCar.getStatus() > 1 || row.FLOWSTATUS.subsidize.getStatus() > 1 || row.FLOWSTATUS.away.getStatus() > 1 || row.FLOWSTATUS.financial.getStatus() > 1)
} }
} },
}, },
created() { created() {
this.window.width = screen.availWidth * 0.95; this.window.width = screen.availWidth * 0.95;

@ -198,6 +198,18 @@
</div> </div>
</div> </div>
</template> </template>
<template v-slot:other_flow_status v-if="adminEdit">
<div class="xy-table-item">
<div class="xy-table-item-label" style="width: 200px">事前流程
</div>
<div class="xy-table-item-content">
<el-select v-model="detail.other_flow_status" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:purchase_status v-if="adminEdit"> <template v-slot:purchase_status v-if="adminEdit">
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="width: 200px">采购流程 <div class="xy-table-item-label" style="width: 200px">采购流程
@ -356,7 +368,8 @@ import { resetSelect } from '@/utils'
groupType: Array, groupType: Array,
purchaseType: Array, purchaseType: Array,
moneyWay: Array, moneyWay: Array,
purchaseWay: Array purchaseWay: Array,
flowIds: Array,
}, },
data() { data() {
var planPass = (rule, value, callback) => { var planPass = (rule, value, callback) => {
@ -430,24 +443,6 @@ import { resetSelect } from '@/utils'
} }
} }
return { return {
flowIds: [
{
id: 5,
name: "办公用品采购"
},
{
id: 12,
name: "物资购置"
},
{
id: 19,
name: "政府采购流转"
},
{
id: 29,
name: "政府小额采购"
}
],
userList: ["ma_sm", "admin", "yu_l","wang_yx","li_f","chen_y"], userList: ["ma_sm", "admin", "yu_l","wang_yx","li_f","chen_y"],
user: null, user: null,
adminEdit: false, adminEdit: false,

@ -446,7 +446,7 @@ export default {
// //
percentPay() { percentPay() {
let total = this.totalMoney(); let total = this.totalMoney();
return ((total / this.contract.money) * 100).toFixed(2) || 0; return ((total / this.contract.money) * 100 || 0).toFixed(2) || 0;
}, },
// //

@ -1438,7 +1438,7 @@ export default {
this.btnLoading = false this.btnLoading = false
//this.step = 3; //this.step = 3;
this.$router.push({ this.$router.push({
path: this.form.is_simple ? '/contract/contractAll' : '/contract/contract/contractList', path: (this.form.is_simple || !this.form.is_purchase) ? '/contract/contractAll' : '/contract/contract/contractList',
query: { query: {
keyword: this.form.name, keyword: this.form.name,
}, },
@ -1609,9 +1609,8 @@ export default {
}, },
computed: { computed: {
isNeedMore () { isNeedMore () {
console.log(this.form.flow_mod_id)
// //
return this.flowIds.find(i => i.id === this.form.flow_mod_id)?.type === 2 return this.flowIds.find(i => i.id === this.form.flow_mod_id)?.name === "政府采购流转" || this.flowIds.find(i => i.id === this.form.flow_mod_id)?.name === "政府小额采购"
}, },
purchaseWayFormat() { purchaseWayFormat() {

@ -380,6 +380,15 @@
>采购流程 >采购流程
</Button> </Button>
</template> </template>
<template v-if="scope.row.FLOWSTATUS['other'].isEnabled()">
<Button
class="slot-btns-item"
size="small"
type="primary"
@click="buyProcess(scope.row)">
{{ otherFlowBtn(scope.row.flow_mod_id) }}
</Button>
</template>
<!-- <template v-if="((scope.row.status === 2) ||--> <!-- <template v-if="((scope.row.status === 2) ||-->
<!-- (!scope.row.is_contract && (scope.row.is_simple)) ||--> <!-- (!scope.row.is_contract && (scope.row.is_simple)) ||-->
<!-- ((scope.row.purchase_way && scope.row.purchase_way.value === '网上商城') && scope.row.purchase_status === 3) ) && scope.row.is_end === 0">--> <!-- ((scope.row.purchase_way && scope.row.purchase_way.value === '网上商城') && scope.row.purchase_status === 3) ) && scope.row.is_end === 0">-->
@ -1136,6 +1145,7 @@
<editor <editor
ref="editor" ref="editor"
:is-show-editor.sync="isShowEditor" :is-show-editor.sync="isShowEditor"
:flow-ids="flowIds"
:group-type="groupType" :group-type="groupType"
:money-way="moneyWay" :money-way="moneyWay"
:purchase-type="purchaseType" :purchase-type="purchaseType"
@ -1180,7 +1190,7 @@ import { getparameter } from "@/api/system/dictionary";
import { listdeptNoAuth } from "@/api/system/department"; import { listdeptNoAuth } from "@/api/system/department";
import { getBudget } from "@/api/budget/budget"; import { getBudget } from "@/api/budget/budget";
import { getOatoken } from "@/api/oatoken"; import { getOatoken } from "@/api/oatoken";
import { deepCopy, parseTime, resetSelect,moneyFormatter } from '@/utils' import { deepCopy, parseTime, resetSelect, moneyFormatter, throttle } from '@/utils'
import { Message } from "element-ui"; import { Message } from "element-ui";
import { getInfo } from "@/api/user.js"; import { getInfo } from "@/api/user.js";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
@ -1381,7 +1391,8 @@ export default {
plan_name: "请选择预算计划", plan_name: "请选择预算计划",
start_plan_price: undefined, start_plan_price: undefined,
end_plan_price: undefined, end_plan_price: undefined,
is_myself: 0 is_myself: 0,
is_purchase: 1,
}, },
selectCopy: { selectCopy: {
keyword: "", keyword: "",
@ -1401,6 +1412,8 @@ export default {
plan_name: "请选择预算计划", plan_name: "请选择预算计划",
start_plan_price: undefined, start_plan_price: undefined,
end_plan_price: undefined, end_plan_price: undefined,
is_myself: 0,
is_purchase: 1,
}, },
type: [ type: [
{ {
@ -1652,10 +1665,19 @@ export default {
customFn:row => { customFn:row => {
return ( return (
<div> <div>
<p>{ <p>
this.flowIds.find(i => i.id === row.flow_mod_id)?.name <span>
}</p> {
<a>查看</a> this.flowIds.find(i => i.id === row.flow_mod_id)?.name
}
</span>
{
row.is_purchase ? "" : (<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.other.getStatus()) }}>[{ this.flowStatus.get(row.FLOWSTATUS.other.getStatus()) }]</span>)
}
</p>
{
row.is_purchase ? "" : (<a on={{['click']:()=>this.toOaDetail('other',row)}}>查看</a>)
}
</div> </div>
) )
} }
@ -2178,6 +2200,9 @@ export default {
case "hetong": case "hetong":
url += row.join_last_flow_id url += row.join_last_flow_id
break; break;
case "other":
url += row.other_flow_id
break;
default: default:
url = `${process.env.VUE_APP_OUT_URL}/admin/flow/list/todo` url = `${process.env.VUE_APP_OUT_URL}/admin/flow/list/todo`
} }
@ -2302,11 +2327,13 @@ export default {
switch (row.flow_mod_id) { switch (row.flow_mod_id) {
case 12: case 12:
baseInfo = { baseInfo = {
"工作名称": row.name || "",
"6583b42c5c29a": row.name, "6583b42c5c29a": row.name,
} }
break; break;
case 5: case 5:
baseInfo = { baseInfo = {
"工作名称": row.name || "",
"65b37c797845d": row.name, "65b37c797845d": row.name,
"65b37c8facfc9": row.content, "65b37c8facfc9": row.content,
} }
@ -2324,6 +2351,10 @@ export default {
"65852a7d0c9b4": this.groupType.find(i => i.id === row.group_type)?.value || "" "65852a7d0c9b4": this.groupType.find(i => i.id === row.group_type)?.value || ""
} }
break; break;
default:
baseInfo = {
"工作名称": row.name || ""
}
} }
// let res = await getOatoken() // let res = await getOatoken()
let url = `${process.env.VUE_APP_OUT_OLD}/flow/create/${row.flow_mod_id}?auth_token=${this.$store.getters.oa_token}&out_contract_id=${ let url = `${process.env.VUE_APP_OUT_OLD}/flow/create/${row.flow_mod_id}?auth_token=${this.$store.getters.oa_token}&out_contract_id=${
@ -2439,7 +2470,7 @@ export default {
); );
}, },
// //
async getFlowIds () { async getFlowIds () {``
let copy = deepCopy(this.flowIds) let copy = deepCopy(this.flowIds)
const res = await getparameter({ const res = await getparameter({
number: "flow_ids" number: "flow_ids"
@ -2504,7 +2535,7 @@ export default {
this.getContracts(); this.getContracts();
}, },
// //
async getContracts(is_export,noloading=false,isopenOa=false) { getContracts: throttle(async function (is_export,noloading=false,isopenOa=false) {
if (/contractLedger/g.test(this.$route.path)) { if (/contractLedger/g.test(this.$route.path)) {
this.select.is_contract = 1 this.select.is_contract = 1
} else { } else {
@ -2558,7 +2589,7 @@ export default {
await this.buyProcess(res.list.data[0]) await this.buyProcess(res.list.data[0])
} }
} }
}, },1000),
// //
// //
@ -2787,7 +2818,7 @@ export default {
return this.status return this.status
} }
isEnabled () { isEnabled () {
return this.executable && this.status === 1 return this.executable && (this.status === 1 || this.status === "")
} }
} }
//012312 //012312
@ -2796,47 +2827,57 @@ export default {
"zhaobiao": new Flow(), "zhaobiao": new Flow(),
"shenpi": new Flow(), "shenpi": new Flow(),
"qianding": new Flow(), "qianding": new Flow(),
"zhifu": new Flow() "zhifu": new Flow(),
"other": new Flow()
} }
if (item.is_simple !== 1 && !item.is_substitute) { if (item.is_purchase) {
// //
if (item.is_simple !== 1 && !item.is_substitute) {
flowStatus["caigou"].setStatus(item.purchase_status) //
if (item.purchase_status === 1) {
// flowStatus["caigou"].setStatus(item.purchase_status)
if (item.is_plan === 1 || (item.is_plan === 0 && item.req_status === 3)) { if (item.purchase_status === 1) {
// //
flowStatus["caigou"].setExecutable(true) if (item.is_plan === 1 || (item.is_plan === 0 && item.req_status === 3)) {
//
flowStatus["caigou"].setExecutable(true)
}
} }
} }
} if (item.purchase_way?.value !== '网上商城' && item.is_contract && item.purchase_way?.remark === 'true' && !item.is_substitute) {
if (item.purchase_way?.value !== '网上商城' && item.is_contract && item.purchase_way?.remark === 'true' && !item.is_substitute) { // \
// \ flowStatus["zhaobiao"].setStatus(item.invite_status)
flowStatus["zhaobiao"].setStatus(item.invite_status) if (item.invite_status === 1 && item.purchase_status === 3) {
if (item.invite_status === 1 && item.purchase_status === 3) { //
// flowStatus["zhaobiao"].setExecutable(true)
flowStatus["zhaobiao"].setExecutable(true) }
} }
} if (item.is_contract && item.purchase_way?.value !== "网上商城") {
if (item.is_contract && item.purchase_way?.value !== "网上商城") { //
// flowStatus["shenpi"].setStatus(item.join_status)
flowStatus["shenpi"].setStatus(item.join_status) if (item.join_status === 1 && (item.invite_status === 3 ||
if (item.join_status === 1 && (item.invite_status === 3 || (item.purchase_way?.remark === 'false' && item.purchase_status === 3))) {
(item.purchase_way?.remark === 'false' && item.purchase_status === 3))) { //
// flowStatus["shenpi"].setExecutable(true)
flowStatus["shenpi"].setExecutable(true) }
} }
} if (item.is_contract && item.purchase_way?.value !== "网上商城" && !item.is_substitute) {
if (item.is_contract && item.purchase_way?.value !== "网上商城" && !item.is_substitute) { flowStatus["qianding"].setStatus(item.status)
flowStatus["qianding"].setStatus(item.status) if (item.join_status === 3 && item.status === 1) {
if (item.join_status === 3 && item.status === 1) { flowStatus["qianding"].setExecutable(true)
flowStatus["qianding"].setExecutable(true) }
}
} else {
//
flowStatus["other"].setStatus(item.other_flow_status)
if (item.other_flow_status === 1 || !item.other_flow_status) {
flowStatus["other"].setExecutable(true)
} }
} }
if (item.is_end === 0) { if (item.is_end === 0) {
flowStatus["zhifu"].setStatus(1) flowStatus["zhifu"].setStatus(1)
// //
if ((!item.is_contract && !item.is_substitute && item.purchase_status === 3) || (item.purchase_way?.value === "网上商城" && item.purchase_status === 3) || if ((item.is_purchase === 0 && item.other_flow_status === 3) || (!item.is_contract && !item.is_substitute && item.purchase_status === 3) || (item.purchase_way?.value === "网上商城" && item.purchase_status === 3) ||
item.status === 2 || item.status === 2 ||
(!item.is_contract && item.is_simple) || (item.is_contract && item.is_substitute && item.join_status === 3)) { (!item.is_contract && item.is_simple) || (item.is_contract && item.is_substitute && item.join_status === 3)) {
// //
@ -2859,6 +2900,12 @@ export default {
} }
}; };
}, },
otherFlowBtn () {
return function (flowModId) {
return this.flowIds.find(i => i.id === flowModId)?.name
}
}
}, },
watch: { watch: {
isShowContractToContracts(val) { isShowContractToContracts(val) {
@ -2916,6 +2963,7 @@ export default {
} }
if (/contractAll/g.test(this.$route.path)) { if (/contractAll/g.test(this.$route.path)) {
this.select.is_simple = ""; this.select.is_simple = "";
this.select.is_purchase = 0;
} }
}, },
destroyed() { destroyed() {

Loading…
Cancel
Save