master
xy 2 years ago
parent b8ecac7511
commit ea11586e08

@ -126,6 +126,27 @@ export function debounce(fn,delay=500){
}, 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){

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

@ -255,6 +255,7 @@ export default {
label: "流程状态",
multiHd: [
{
width: 100,
label: "用车",
customFn:row => {
if (!row.FLOWSTATUS.useCar.getExecutable()) {
@ -275,6 +276,7 @@ export default {
}
},
{
width: 100,
label: "市内补助",
customFn:row => {
if (!row.FLOWSTATUS.subsidize.getExecutable()) {
@ -296,6 +298,7 @@ export default {
},
{
width: 100,
label: "出差审批",
customFn:row => {
return (
@ -313,10 +316,15 @@ export default {
},
{
label: "出差报销",
width: 100,
customFn:row => {
return (
<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/>
{
(row.FLOWSTATUS.expense.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
@ -327,6 +335,7 @@ export default {
}
},
{
width: 100,
label: "财务审核",
customFn:row => {
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.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)
}
@ -500,7 +509,7 @@ export default {
return function (row) {
return !(row.FLOWSTATUS.useCar.getStatus() > 1 || row.FLOWSTATUS.subsidize.getStatus() > 1 || row.FLOWSTATUS.away.getStatus() > 1 || row.FLOWSTATUS.financial.getStatus() > 1)
}
}
},
},
created() {
this.window.width = screen.availWidth * 0.95;

@ -198,6 +198,18 @@
</div>
</div>
</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">
<div class="xy-table-item">
<div class="xy-table-item-label" style="width: 200px">采购流程
@ -356,7 +368,8 @@ import { resetSelect } from '@/utils'
groupType: Array,
purchaseType: Array,
moneyWay: Array,
purchaseWay: Array
purchaseWay: Array,
flowIds: Array,
},
data() {
var planPass = (rule, value, callback) => {
@ -430,24 +443,6 @@ import { resetSelect } from '@/utils'
}
}
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"],
user: null,
adminEdit: false,

@ -446,7 +446,7 @@ export default {
//
percentPay() {
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.step = 3;
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: {
keyword: this.form.name,
},
@ -1609,9 +1609,8 @@ export default {
},
computed: {
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() {

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

Loading…
Cancel
Save