master
xy 2 years ago
parent 5e2a9dd00e
commit b8ecac7511

@ -199,7 +199,7 @@ export default {
>
</el-table-column>
{
tableItem.map((item, index) => {
tableItem.filter(i => !i.hidden).map((item, index) => {
//
if (item.customFn) {
return (

@ -2,7 +2,7 @@
<div :class="classObj" class="app-wrapper">
<!-- 最顶部导航栏-->
<div class="top-head-bar" v-if="!$store.state.app.isInIframe">
<div class="top-head-bar" v-if="(!$store.state.app.isInIframe && !$store.state.app.isInElectron) && isShowTopBar">
<div class="top-head-bar__logo">
<img style="height: 20px" src="../assets/logo.png" alt="logo" />
</div>
@ -57,7 +57,7 @@
<sidebar class="sidebar-container" />
<div class="main-container">
<iframe style="width: 100%;height: 100%;" ref="bookIframe" :src="iframeUrl"
<iframe ref="bookIframe" :src="iframeUrl"
>你的浏览器不支持该iframe</iframe
>
</div>
@ -83,7 +83,7 @@
<navbar />
</div>
<el-scrollbar style="height: 100%">
<app-main />
<app-main :is-show-top-bar="isShowTopBar"/>
</el-scrollbar>
</div>
</template>
@ -98,6 +98,10 @@ import { Navbar, Sidebar, AppMain } from "./components";
import ResizeMixin from "./mixin/ResizeHandler";
import worker from "./components/worker/index.vue";
import axios from "axios";
window.$isShowTopBar = true;
window.hideTopBar = () => {
window.$isShowTopBar = false
}
export default {
name: "Layout",
components: {
@ -109,6 +113,7 @@ export default {
mixins: [ResizeMixin],
data() {
return {
isShowTopBar: window.$isShowTopBar,
isIframe: false,
active: 0,
bookUrl: process.env.VUE_APP_OUT_Book,
@ -164,6 +169,13 @@ export default {
this.$router.push(item.path);
},
},
created() {
window.routerTo = {};
for (let key in this.$store.state.permission.rootMenu) {
let item = this.$store.state.permission.rootMenu[key]
window.routerTo[item.path] = () => this.$router.push(item.path)
}
},
mounted() {
},
watch: {
@ -384,7 +396,7 @@ div:has(iframe) {
overflow: hidden;
}
iframe {
height: 100%;
height: calc(100vh - #{$topbarHeight});
width: calc(100% + 12px);
border: none;
@ -395,3 +407,20 @@ iframe {
}
</style>
<style lang="scss">
.app-wrapper:not(:has(.top-head-bar)) {
.app-view-container {
padding-top: 0!important;
}
.main-container {
top: 0!important;
}
.sidebar-container {
top: 0!important;
}
.app-view-container iframe {
height: 100vh;
}
}
</style>

@ -22,7 +22,6 @@ router.beforeEach(async (to, from, next) => {
// start progress bar
NProgress.start()
store.commit('app/SET_ISINIFRAME')
console.log('iframe',store.state.app.isInIframe)
// set page title
document.title = getPageTitle(to.meta.title)
@ -54,12 +53,7 @@ router.beforeEach(async (to, from, next) => {
if (hasToken) {
if (to.path === '/login') {
// if is logged in, redirect to the home page
await store.dispatch('user/resetToken')
next(to.fullPath)
// next({
// path: '/'
// })
next({ path: '/' })
NProgress.done()
} else {
// determine whether the user has obtained his permission roles through getInfo

@ -14,6 +14,7 @@
<div class="xy-table-item-label">标题 </div>
<div class="xy-table-item-content">
<el-input
:readonly="isExpense"
v-model="form.title"
clearable
placeholder="请输入标题"
@ -26,7 +27,7 @@
<div class="xy-table-item">
<div class="xy-table-item-label">是否用车 </div>
<div class="xy-table-item-content">
<el-radio-group style="width: 300px" v-model="form.use_car">
<el-radio-group :disabled="isExpense" style="width: 300px" v-model="form.use_car">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
@ -37,7 +38,7 @@
<div class="xy-table-item">
<div class="xy-table-item-label">是否室内补助 </div>
<div class="xy-table-item-content">
<el-radio-group style="width: 300px" v-model="form.is_subsidize">
<el-radio-group :disabled="isExpense" style="width: 300px" v-model="form.is_subsidize">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
@ -49,6 +50,7 @@
<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"
@ -62,6 +64,7 @@
<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"
@ -74,7 +77,7 @@
<div class="xy-table-item">
<div class="xy-table-item-label">用车审核 </div>
<div class="xy-table-item-content">
<el-radio-group style="width: 300px" v-model="form.use_car_status">
<el-radio-group :disabled="isExpense" 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>
@ -86,7 +89,7 @@
<div class="xy-table-item">
<div class="xy-table-item-label">市内补助审核 </div>
<div class="xy-table-item-content">
<el-radio-group style="width: 300px" v-model="form.subsidize_status">
<el-radio-group :disabled="isExpense" 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>
@ -98,7 +101,19 @@
<div class="xy-table-item">
<div class="xy-table-item-label">出差审核 </div>
<div class="xy-table-item-content">
<el-radio-group style="width: 300px" v-model="form.away_status">
<el-radio-group :disabled="isExpense" 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>
</el-radio-group>
</div>
</div>
</template>
<template v-slot:expense_status v-if="$store.state.user.min_allow_level === 0">
<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 :label="1">待申请</el-radio>
<el-radio :label="2">流转中</el-radio>
<el-radio :label="3">已结办</el-radio>
@ -113,7 +128,9 @@
<script>
import { show, save } from "@/api/away";
export default {
props: {},
props: {
window: Object,
},
data() {
return {
isShow: false,
@ -128,8 +145,10 @@ export default {
end_date: "",
use_car_status: "",
subsidize_status: "",
expense_status: "",
away_status: "",
financial_status: ""
financial_status: "",
expense: 0,
},
rules: {
title: [
@ -239,12 +258,14 @@ export default {
});
}
save(this.form).then((res) => {
this.$message({
type: "success",
message: this.type === "add" ? "新增出差" : "编辑出差" + "成功",
});
this.isShow = false;
this.$emit("refresh");
});
},
},
@ -257,6 +278,7 @@ export default {
} else {
this.id = "";
this.type = "";
this.isExpense = false;
this.init();
this.$refs["dialog"].clearValidate();
delete this.form.id;

@ -125,9 +125,18 @@
>出差审核
</Button>
</template>
<template v-if="row.FLOWSTATUS.expense.isEnabled()">
<Button
style="margin: 2px;"
size="small"
type="primary"
@click="goExpense(row)"
>出差报销
</Button>
</template>
</template>
<template v-else #default="{ row }">
<template v-if="row.FLOWSTATUS.financial.getExecutable()">
<template v-if="row.FLOWSTATUS.expense.getStatus() === 3">
<Button
v-if="row.FLOWSTATUS.financial.getStatus() === 2"
style="margin: 2px;"
@ -301,6 +310,27 @@ export default {
)
}
},
{
label: "出差报销",
customFn:row => {
return (
<div>
<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.expense.getStatus()) }}>{ this.flowStatus.get(row.FLOWSTATUS.expense.getStatus()) || '待申请' }</span>
<br/>
{
(row.FLOWSTATUS.expense.getStatus() > 1) ? <a style="color: #333" on={{['click']:()=>{
}}}>查看</a> : ''
}
</div>
)
}
},
{
label: "财务审核",
customFn:row => {
return (row.FLOWSTATUS.financial.getStatus() === 2) ? (<span style="color: green;">已确认</span>) : (<span style="color: #666;">待审核</span>)
}
}
]
},
@ -367,6 +397,20 @@ export default {
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
);
},
goExpense (row) {
const baseInfo = {
"flow_title": row.title,
"totalAmt": row.expense,
};
let url = `${process.env.VUE_APP_OUT_OLD}/flow/create/26?auth_token=${this.$store.getters.oa_token}&out_away_id=${
row.id
}&default_json=${JSON.stringify(baseInfo)}`;
window.open(
url,
"buyProcess",
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
);
},
async getList (isFirst) {
class Flow {
@ -402,6 +446,7 @@ export default {
"useCar": new Flow(),
"subsidize": new Flow(),
"away": new Flow(),
"expense": new Flow(),
"financial": new Flow()
}
if (item.use_car) {
@ -420,14 +465,17 @@ export default {
if (item.away_status === 1 || item.away_status === null) {
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) {
flowStatus.expense.setExecutable(true)
}
flowStatus.financial.setStatus(item.financial_status)
if ((!item.is_subsidize || item.subsidize_status === 3) && (!item.use_car || item.use_car_status === 3) && item.away_status === 3) {
if (item.expense_status === 3) {
flowStatus.financial.setExecutable(true)
}
item.FLOWSTATUS = flowStatus;
});
console.log(this.list)
},
async deleteAway (id) {

@ -189,7 +189,8 @@ export default {
//join_status: 3,
invite_status: 3,
outcome_type: 1,
files: []
files: [],
is_substitute: 1
},
fileLists: [],
rules: {
@ -258,7 +259,7 @@ export default {
invite_status: 3,
outcome_type: 1,
files: [],
is_purchase: 0
is_substitute: 1
}
this.$refs["dialog"].clearValidate();
},

@ -185,6 +185,19 @@
<!-- </div>-->
<!-- </div>-->
<!-- </template>-->
<template v-slot:join_status>
<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.group_type" placeholder="请选择">
<el-option v-for="item in groupType" :key="item.id" :label="item.value" :value="item.id">
</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">采购流程
@ -340,6 +353,7 @@ import {
import { resetSelect } from '@/utils'
export default {
props: {
groupType: Array,
purchaseType: Array,
moneyWay: Array,
purchaseWay: Array
@ -751,6 +765,7 @@ import { resetSelect } from '@/utils'
invite_status: res.invite_status,
supply:res?.supply,
type: res.type,
group_type: res.group_type,
methods: res.purchase_type_id,
modality: res.purchase_way_id,
fundingChannels: res.money_way_id?.split(',')?.map(item => {
@ -791,6 +806,7 @@ import { resetSelect } from '@/utils'
is_contract: this.detail?.is_contract,
supply:this.detail?.supply,
purchase_type_id: this.detail.methods,
group_type: this.detail.group_type,
purchase_way_id: this.detail.modality,
money_way_id: this.detail.fundingChannels.toString(),
plan_price: this.detail.price,

@ -196,6 +196,16 @@
<span style="flex: 1; text-align: right">无需采购流程如水电邮寄费等</span>
</el-form-item>
<el-form-item prop="is_trade" label="是否为工会项目">
<el-switch
v-model="form.is_trade"
active-text="是"
inactive-text="否"
:active-value="1"
:inactive-value="0"
/>
</el-form-item>
<el-form-item prop="flow_mod_id" label="事前流程">
<el-select v-model="form.flow_mod_id" style="width: 100%">
<el-option v-for="item in flowIds" :key="item.id" :value="item.id" :label="item.name"></el-option>
@ -227,7 +237,7 @@
</el-form-item>
</template>
<template v-else>
<el-form-item prop="type" label="项目类型">
<el-form-item prop="type" label="项目类型" v-if="isNeedMore">
<el-select
clearable
placeholder="请选择项目类型"
@ -242,7 +252,7 @@
</el-select>
</el-form-item>
<el-form-item prop="purchase_type_id" label="采购形式">
<el-form-item prop="purchase_type_id" label="采购形式" v-if="isNeedMore">
<el-select
ref="purchaseTypeInput"
clearable
@ -258,7 +268,7 @@
</el-select>
</el-form-item>
<el-form-item prop="purchase_way_id" label="采购方式">
<el-form-item prop="purchase_way_id" label="采购方式" v-if="isNeedMore">
<el-select
clearable
placeholder="请选择采购方式"
@ -273,7 +283,7 @@
</el-select>
</el-form-item>
<el-form-item prop="group_type" label="组织形式">
<el-form-item prop="group_type" label="组织形式" v-if="isNeedMore">
<el-select
clearable
placeholder="请选择组织形式"
@ -288,7 +298,7 @@
</el-select>
</el-form-item>
<el-form-item prop="money_way_id" label="资金渠道">
<el-form-item prop="money_way_id" label="资金渠道" v-if="isNeedMore">
<el-select
multiple
size="small"
@ -314,7 +324,7 @@
</el-select>
</el-form-item>
<el-form-item prop="plan_price" label="采购预算价(元)">
<el-form-item prop="plan_price" label="预算价(元)">
<InputNumber
style="width: 100%"
:min="0"
@ -847,6 +857,7 @@ import { getBudget } from "@/api/budget/budget";
import { getInfo } from "@/api/user.js";
import { listdeptNoAuth } from '@/api/system/department'
import {deepCopy} from "@/utils";
export default {
data() {
return {
@ -854,31 +865,38 @@ export default {
flowIds: [
{
id: 5,
name: "办公用品采购"
name: "办公用品采购",
type: 1 //
},
{
id: 12,
name: "物资购置"
name: "物资购置",
type: 1
},
{
id: 19,
name: "政府采购流转"
name: "政府采购流转",
type: 2
},
{
id: 29,
name: "政府小额采购"
name: "政府小额采购",
type: 2
},
{
id: 22,
name: "公务接待"
name: "公务接待",
type: 1
},
{
id: 23,
name: "会议费用"
name: "会议费用",
type: 1
},
{
id: 28,
name: "培训费"
name: "培训费",
type: 1
}
],
@ -923,7 +941,8 @@ export default {
content: "",
contract_to_contracts: [],
outcome_type: 1,
is_purchase: 1
is_purchase: 1,
is_trade: 0
},
planTypes: [],
departments: [],
@ -953,182 +972,182 @@ export default {
label: "已办结",
},
],
// rules: {
// name: [
// {
// required: true,
// message: "",
// trigger: "blur",
// },
// {
// validator: async (rule, value, callback) => {
// if (!this.hasValue(value)) {
// callback(new Error(""));
// } else {
// const { msg } = await checkContractName({ name: value });
// if (msg === "") {
// callback();
// } else {
// callback(new Error(msg));
// }
// }
// },
// trigger: "blur",
// },
// ],
// supply: [
// {
// validator: (rule, value, callback) => {
// if (this.form.is_simple) {
// if (!this.hasValue(value)) {
// callback(new Error(""));
// } else {
// callback();
// }
// } else {
// callback();
// }
// },
// trigger: "change",
// },
// ],
// type: [
// {
// validator: (rule, value, callback) => {
// if (!this.form.is_simple) {
// if (!this.hasValue(value)) {
// callback(new Error(""));
// } else {
// callback();
// }
// } else {
// callback();
// }
// },
// trigger: "change",
// },
// ],
// purchase_type_id: [
// {
// validator: (rule, value, callback) => {
// if (!this.form.is_simple) {
// if (!this.hasValue(value)) {
// callback(new Error(""));
// } else {
// callback();
// }
// } else {
// callback();
// }
// },
// trigger: "change",
// },
// ],
// purchase_way_id: [
// {
// validator: (rule, value, callback) => {
// if (!this.form.is_simple) {
// if (!this.hasValue(value)) {
// callback(new Error(""));
// } else {
// callback();
// }
// } else {
// callback();
// }
// },
// trigger: "change",
// },
// ],
// money: [
// {
// validator: (rule, value, callback) => {
// if (this.form.is_simple) {
// if (!this.hasValue(value)) {
// callback(new Error(""));
// } else {
// if (/^\d+(\.\d+)?$/.test(value)) {
// callback();
// } else {
// callback(new Error(""));
// }
// }
// } else {
// callback();
// }
// },
// trigger: "blur",
// },
// ],
// plan_money: [
// {
// validator: (rule, value, callback) => {
// if (!this.form.is_simple) {
// if (!this.hasValue(value)) {
// callback(new Error(""));
// } else {
// if (/^\d+(\.\d+)?$/.test(value)) {
// callback();
// } else {
// callback(new Error(""));
// }
// }
// } else {
// callback();
// }
// },
// trigger: "blur",
// },
// ],
// money_way_id: [
// {
// validator: (rule, value, callback) => {
// if (!this.form.is_simple) {
// if (!this.hasValue(value)) {
// callback(new Error(""));
// } else {
// callback();
// }
// } else {
// callback();
// }
// },
// trigger: "change",
// },
// ],
// contract_plan_links: [
// {
// validator: (rule, value, callback) => {
// if (this.form.is_plan) {
// if (this.form.contract_plan_links.length === 0) {
// return callback(new Error(""));
// } else {
// callback();
// }
// } else {
// callback();
// }
// },
// trigger: "change",
// },
// ],
// contract_to_contracts: [
// {
// validator: (rule, value, callback) => {
// if (this.form.use_framework_buy) {
// if (this.form.contract_to_contracts.length === 0) {
// return callback(new Error(""));
// } else {
// callback();
// }
// } else {
// callback();
// }
// },
// trigger: "change",
// },
// ],
// },
rules: {
name: [
{
required: true,
message: "必填",
trigger: "blur",
},
{
validator: async (rule, value, callback) => {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
const { msg } = await checkContractName({ name: value });
if (msg === "未重名") {
callback();
} else {
callback(new Error(msg));
}
}
},
trigger: "blur",
},
],
supply: [
{
validator: (rule, value, callback) => {
if (this.form.is_simple) {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
callback();
}
} else {
callback();
}
},
trigger: "change",
},
],
type: [
{
validator: (rule, value, callback) => {
if (!this.form.is_simple || !this.isNeedMore) {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
callback();
}
} else {
callback();
}
},
trigger: "change",
},
],
purchase_type_id: [
{
validator: (rule, value, callback) => {
if (!this.form.is_simple || !this.isNeedMore) {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
callback();
}
} else {
callback();
}
},
trigger: "change",
},
],
purchase_way_id: [
{
validator: (rule, value, callback) => {
if (!this.form.is_simple || !this.isNeedMore) {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
callback();
}
} else {
callback();
}
},
trigger: "change",
},
],
money: [
{
validator: (rule, value, callback) => {
if (this.form.is_simple) {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
if (/^\d+(\.\d+)?$/.test(value)) {
callback();
} else {
callback(new Error("必须为数字"));
}
}
} else {
callback();
}
},
trigger: "blur",
},
],
plan_money: [
{
validator: (rule, value, callback) => {
if (!this.form.is_simple) {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
if (/^\d+(\.\d+)?$/.test(value)) {
callback();
} else {
callback(new Error("必须为数字"));
}
}
} else {
callback();
}
},
trigger: "blur",
},
],
money_way_id: [
{
validator: (rule, value, callback) => {
if (!this.form.is_simple) {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
callback();
}
} else {
callback();
}
},
trigger: "change",
},
],
contract_plan_links: [
{
validator: (rule, value, callback) => {
if (this.form.is_plan) {
if (this.form.contract_plan_links.length === 0) {
return callback(new Error("必选"));
} else {
callback();
}
} else {
callback();
}
},
trigger: "change",
},
],
contract_to_contracts: [
{
validator: (rule, value, callback) => {
if (this.form.use_framework_buy) {
if (this.form.contract_to_contracts.length === 0) {
return callback(new Error("必选"));
} else {
callback();
}
} else {
callback();
}
},
trigger: "change",
},
],
},
plans: [],
planSelect: {
name: "",
@ -1313,6 +1332,25 @@ export default {
})
)?.detail || [];
},
//
async getFlowIds () {
let copy = deepCopy(this.flowIds)
const res = await getparameter({
number: "flow_ids"
})
try {
this.flowIds = res?.detail?.map(i => {
let data = JSON.parse(i.remark)
return {
name: i.value,
...data
}
})
}catch (e) {
this.flowIds = copy
}
console.log(this.flowIds)
},
getDepartment() {
listdeptNoAuth().then((res) => {
@ -1394,6 +1432,7 @@ export default {
} else {
this.form.contract_plan_links = []
}
this.form.is_purchase = this.flowIds.find(i => i.id == this.form.flow_mod_id)?.type == 2 ? 1 : 0;
if (this.type === 'add') {
addContrant(this.form,true).then(res => {
this.btnLoading = false
@ -1439,21 +1478,36 @@ export default {
},
async buyProcess(row) {
let baseInfo = {
title: row?.name,
iszhengfucaigou:
(row.purchase_type?.value === "政府采购") ? "政府采购" : "否",
out_caigou_id: row.id,
type: this.types.find((item) => {
return item.value === row.type;
})?.label,
yusuan: row?.plan_price?.toString(),
zijinlaiyuan: row.money_way_detail?.value,
zijinlaiyuanjuti: row?.plans.reduce((pre,cur,index)=>(index === 0 ? (`${cur?.year}${cur?.name}`) : (pre+`,【${cur?.year}${cur?.name}`)),"")
};
let url = `${process.env.VUE_APP_OUT_OLD}?s=/flow/add/modid/8&auth_token=${this.$store.getters.oa_token}&out_caigou_id=${
let baseInfo = {}
switch (row.flow_mod_id) {
case 12:
baseInfo = {
"6583b42c5c29a": row.name,
}
break;
case 5:
baseInfo = {
"65b37c797845d": row.name,
"65b37c8facfc9": row.content,
}
break;
case 29:
case 19:
baseInfo = {
"65852a58c7bad": row.name,
"65852ae259b09": this.purchaseWay.find(i => i.id === row.purchase_way_id)?.value,
"65852ba4697e7": row?.plans.reduce((pre,cur,index)=>(index === 0 ? cur?.name : pre+cur?.name+""),""),
"65852bd7afd2f": row.plan_price,
"65852bc914b8d": row.plan_price,
"65852c08d98f5": row.content,
}
break;
}
// 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=${
row.id
}&contract_json=${JSON.stringify(baseInfo)}`;
}&default_json=${JSON.stringify(baseInfo)}`;
console.log('url',url)
window.open(
url,
"buyProcess",
@ -1511,7 +1565,8 @@ export default {
content: "",
contract_to_contracts: [],
outcome_type: 1,
is_purchase: 1
is_purchase: 1,
is_trade: 0
};
this.$refs["form"].clearValidate();
@ -1553,6 +1608,12 @@ 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
},
purchaseWayFormat() {
return function () {
if (!this.form.purchase_type_id) {
@ -1592,236 +1653,6 @@ export default {
let temp = this.form.contract_to_contracts;
return this.$refs["contractToContractsTable"]?.getSelection() || []
},
rules() {
return this.isLedger ? {
name: [
{
required: true,
message: "必填",
trigger: "blur",
},
{
validator: async (rule, value, callback) => {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
const { msg } = await checkContractName({ name: value });
if (msg === "未重名") {
callback();
} else {
callback(new Error(msg));
}
}
},
trigger: "blur",
},
],
supply: [
{
validator: (rule, value, callback) => {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
callback();
}
},
trigger: "change",
},
],
money: [
{
validator: (rule, value, callback) => {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
if (/^\d+(\.\d+)?$/.test(value)) {
callback();
} else {
callback(new Error("必须为数字"));
}
}
},
trigger: "blur",
}
]
} : {
name: [
{
required: true,
message: "必填",
trigger: "blur",
},
{
validator: async (rule, value, callback) => {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
const { msg } = await checkContractName({ name: value });
if (msg === "未重名") {
callback();
} else {
callback(new Error(msg));
}
}
},
trigger: "blur",
},
],
supply: [
{
validator: (rule, value, callback) => {
if (this.form.is_simple) {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
callback();
}
} else {
callback();
}
},
trigger: "change",
},
],
type: [
{
validator: (rule, value, callback) => {
if (!this.form.is_simple) {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
callback();
}
} else {
callback();
}
},
trigger: "change",
},
],
purchase_type_id: [
{
validator: (rule, value, callback) => {
if (!this.form.is_simple) {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
callback();
}
} else {
callback();
}
},
trigger: "change",
},
],
purchase_way_id: [
{
validator: (rule, value, callback) => {
if (!this.form.is_simple) {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
callback();
}
} else {
callback();
}
},
trigger: "change",
},
],
money: [
{
validator: (rule, value, callback) => {
if (this.form.is_simple) {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
if (/^\d+(\.\d+)?$/.test(value)) {
callback();
} else {
callback(new Error("必须为数字"));
}
}
} else {
callback();
}
},
trigger: "blur",
},
],
plan_money: [
{
validator: (rule, value, callback) => {
if (!this.form.is_simple) {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
if (/^\d+(\.\d+)?$/.test(value)) {
callback();
} else {
callback(new Error("必须为数字"));
}
}
} else {
callback();
}
},
trigger: "blur",
},
],
money_way_id: [
{
validator: (rule, value, callback) => {
if (!this.form.is_simple) {
if (!this.hasValue(value)) {
callback(new Error("必填"));
} else {
callback();
}
} else {
callback();
}
},
trigger: "change",
},
],
contract_plan_links: [
{
validator: (rule, value, callback) => {
if (this.form.is_plan) {
if (this.form.contract_plan_links.length === 0) {
return callback(new Error("必选"));
} else {
callback();
}
} else {
callback();
}
},
trigger: "change",
},
],
contract_to_contracts: [
{
validator: (rule, value, callback) => {
if (this.form.use_framework_buy) {
if (this.form.contract_to_contracts.length === 0) {
return callback(new Error("必选"));
} else {
callback();
}
} else {
callback();
}
},
trigger: "change",
},
],
}
}
},
created() {
this.window.width = screen.availWidth * 0.95;
@ -1835,6 +1666,7 @@ export default {
this.getMoneyWay();
this.getPurchaseType();
this.getPurchaseWay();
this.getFlowIds();
this.boxheight = document.documentElement.clientHeight - 400;
},
watch: {

@ -1136,6 +1136,7 @@
<editor
ref="editor"
:is-show-editor.sync="isShowEditor"
:group-type="groupType"
:money-way="moneyWay"
:purchase-type="purchaseType"
:purchase-way="purchaseWay"
@ -1292,23 +1293,44 @@ export default {
};
return {
//
flowIds: [
{
id: 5,
name: "办公用品采购"
name: "办公用品采购",
type: 1 //
},
{
id: 12,
name: "物资购置"
name: "物资购置",
type: 1
},
{
id: 19,
name: "政府采购流转"
name: "政府采购流转",
type: 2
},
{
id: 29,
name: "政府小额采购"
name: "政府小额采购",
type: 2
},
{
id: 22,
name: "公务接待",
type: 1
},
{
id: 23,
name: "会议费用",
type: 1
},
{
id: 28,
name: "培训费",
type: 1
}
],
isShowIsFramework: true,
userList: ["ma_sm", "admin", "yu_l","wang_yx","li_f","chen_y"],
@ -1394,6 +1416,7 @@ export default {
value: 3,
},
],
groupType: [],//
purchaseType: [], //
purchaseWay: [], //
moneyWay: [], //
@ -1621,6 +1644,22 @@ export default {
}
}
},
{
label: "事前流程",
prop: "flow_mod_id",
width: 200,
hidden: !/contractAll/g.test(this.$route.path),
customFn:row => {
return (
<div>
<p>{
this.flowIds.find(i => i.id === row.flow_mod_id)?.name
}</p>
<a>查看</a>
</div>
)
}
},
{
label: "采购流程",
multiHd: [
@ -2275,12 +2314,14 @@ export default {
case 29:
case 19:
baseInfo = {
"65852a58c7bad": row.name,
"65852ae259b09": this.purchaseWay.find(i => i.id === row.purchase_way_id)?.value,
"65852ba4697e7": row?.plans.reduce((pre,cur,index)=>(index === 0 ? cur?.name : pre+cur?.name+""),""),
"65852bd7afd2f": row.plan_price,
"65852bc914b8d": row.plan_price,
"65852c08d98f5": row.content,
"工作名称": row.name || "",
"65852a58c7bad": row.name || "",
"65852ae259b09": this.purchaseWay.find(i => i.id === row.purchase_way_id)?.value || "",
"65852ba4697e7": row?.plans.reduce((pre,cur,index)=>(index === 0 ? cur?.name : pre+cur?.name+""),"") || "",
"65852bd7afd2f": row.plan_price || "",
"65852bc914b8d": row.plan_price || "",
"65852c08d98f5": row.content || "",
"65852a7d0c9b4": this.groupType.find(i => i.id === row.group_type)?.value || ""
}
break;
}
@ -2397,6 +2438,25 @@ export default {
1
);
},
//
async getFlowIds () {
let copy = deepCopy(this.flowIds)
const res = await getparameter({
number: "flow_ids"
})
try {
this.flowIds = res?.detail?.map(i => {
let data = JSON.parse(i.remark)
return {
name: i.value,
...data
}
})
}catch (e) {
this.flowIds = copy
}
console.log(this.flowIds)
},
//
async getMoneyWay() {
this.moneyWay = (
@ -2421,6 +2481,15 @@ export default {
async getDepartment() {
this.departments = await listdeptNoAuth();
},
//
async getGroupType() {
this.groupType =
(
await getparameter({
number: "group_type",
})
)?.detail || [];
},
//
async getPurchaseType() {
this.purchaseType = (
@ -2730,7 +2799,7 @@ export default {
"zhifu": new Flow()
}
if (item.is_simple !== 1 && !item.is_substitute) {
//
//
flowStatus["caigou"].setStatus(item.purchase_status)
if (item.purchase_status === 1) {
@ -2741,8 +2810,8 @@ export default {
}
}
}
if (item.purchase_way?.value !== '网上商城' && item.is_contract && !item.is_substitute && item.purchase_way?.remark === '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) {
//
@ -2753,13 +2822,12 @@ export default {
//
flowStatus["shenpi"].setStatus(item.join_status)
if (item.join_status === 1 && (item.invite_status === 3 ||
(item.purchase_way?.remark === 'false' && item.purchase_status === 3) ||
item.is_substitute)) {
//
(item.purchase_way?.remark === 'false' && item.purchase_status === 3))) {
//
flowStatus["shenpi"].setExecutable(true)
}
}
if (item.is_contract && item.purchase_way?.value !== "网上商城" && !/contractLedger/g.test(this.$route.path)) {
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)
@ -2768,9 +2836,9 @@ export default {
if (item.is_end === 0) {
flowStatus["zhifu"].setStatus(1)
//
if ((item.purchase_way?.value === "网上商城" && item.purchase_status === 3) ||
if ((!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_simple) || (item.is_contract && item.is_substitute && item.join_status === 3)) {
//
flowStatus["zhifu"].setExecutable(true)
}
@ -2823,11 +2891,7 @@ export default {
}
})
.catch((error) => {});
this.getPurchaseType();
this.select.is_myself = this.$route.path.split('_')[1] ? Number(this.$route.path.split('_')[1]) : 0
this.getDepartment();
this.getPurchaseWay();
this.getMoneyWay();
this.getContracts();
//
window.onfocus = async () => {
@ -2835,7 +2899,13 @@ export default {
};
},
created() {
this.getPurchaseType();
this.getDepartment();
this.getPurchaseWay();
this.getMoneyWay();
this.getGroupType();
this.getBudgets();
this.getFlowIds();
this.select.is_simple = 0;
this.select.keyword = this.$route.query.keyword || "";
this.select.is_myself = this.$route.path.split('_')[1] ? Number(this.$route.path.split('_')[1]) : 0;

Loading…
Cancel
Save