master
xy 12 months ago
parent c94e8984b4
commit 7f454398a2

@ -0,0 +1,298 @@
<template>
<div class="page">
<div class="select-container">
<DatePicker
:value="planSelect.year"
placeholder="选择所属年份"
placement="bottom-start"
style="width: 180px;margin-right: 10px;"
type="year"
@on-change="(e) => {
planSelect.year = e
getBudgets()
}"
></DatePicker>
<el-select
placeholder="科室选择"
clearable
size="small"
v-model="planSelect.plan_department_id"
style="width: 180px;margin-right: 10px;"
@change="getBudgets"
>
<el-option
v-for="item in departments"
:label="item.name"
:value="item.id"
:key="item.id"
>
</el-option>
</el-select>
<el-cascader
placeholder="资金类型选择"
:options="planTypes"
:props="{
checkStrictly: false,
label: 'name',
value: 'id',
}"
:value="planSelect.type"
clearable
size="small"
style="width: 220px;margin-right: 10px;"
@change="(e) => {
planSelect.type = e[e.length - 1] || '';
getBudgets();
}"
/>
<Input
v-model="planSelect.name"
search
enter-button="搜 索"
clearable
placeholder="搜索预算计划.."
@on-search="getBudgets"
/>
</div>
<xy-table
:list="plans"
:show-index="false"
:table-item="planTable"
:height="boxHeight"
style="margin-top: 10px"
ref="editorPlanTable"
row-key="id"
border
default-expand-all
@select="planPick"
:tree-props="{ children: 'notChildren', hasChildren: 'hasChildren' }"
>
<template v-slot:btns>
<el-table-column
label="使用金额(元)"
fixed="right"
header-align="center"
width="144"
>
<template slot-scope="scope" v-if="scope.row.pid === 0">
<InputNumber
style="width: 120px"
:min="0"
:precision="2"
:active-change="false"
v-model="scope.row._inputMoney"
:formatter="
(value) => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
"
:parser="(value) => value.replace(/\$\s?|(,*)/g, '')"
></InputNumber>
</template>
</el-table-column>
</template>
</xy-table>
<div style="display: flex; justify-content: flex-end" class="pagination">
<Page
:total="planTotal"
show-elevator
@on-change="
(e) => {
planSelect.page = e;
getBudgets();
}
"
/>
</div>
</div>
</template>
<script>
import { getBudget } from "@/api/budget/budget";
import { listdeptNoAuth } from "@/api/system/department";
import { getparameterTree } from "@/api/system/dictionary";
export default {
data() {
return {
boxHeight: 0,
planTypes: [],
departments: [],
plans: [],
planSelect: {
name: "",
page_size: 20,
page: 1,
is_tree: 1,
year: new Date().getFullYear().toString(),
plan_department_id: "",
type: ""
},
planTable: [
{
sortable: false,
width: 44,
type: "selection",
reserveSelection: true,
fixed: "left",
selectable: (row, index) => {
return row.pid === 0;
},
},
{
label: "科室",
prop: "plan_department.name",
width: 120,
align: "center",
},
{
label: "年份",
prop: "year",
width: 80,
align: "center",
},
{
label: "分类",
prop: "type_detail.value",
width: 120,
},
{
label: "名称",
prop: "name",
minWidth: 180,
align: "left",
},
{
label: "内容",
prop: "content",
minWidth: 200,
align: "left",
},
{
label: "计划金额",
prop: "money",
align: "right",
width: 120,
formatter: (v1, v2, value) => {
return `${(value && parseFloat(value) !== 0) ? value : v1.update_money }`.replace(/\B(?=(\d{3})+(?!\d))/g, ",")
}
},
{
label: "实付金额",
prop: "use_money_total",
width: 120,
align: "right",
formatter: (v1, v2, value) =>
value ? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : "",
},
{
label: "已用金额",
prop: "has_money_total",
width: 120,
align: "right",
formatter: (v1, v2, value) =>
value ? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : "",
},
],
planTotal: 0,
}
},
methods: {
planPick (selection, row) {
if (row.year != new Date().getFullYear()) {
this.$confirm("您选择了非本年预算,是否继续?").catch(_ => {
this.$refs['editorPlanTable'].toggleRowSelection(row)
})
}
},
//
async getBudgets() {
let res = await getBudget(this.planSelect);
res.list.forEach((item) => (item._inputMoney = 0));
this.plans = res.list;
this.planTotal = res.list.total || 0;
},
getDepartment() {
listdeptNoAuth().then((res) => {
this.departments = res;
});
},
async getPlanTypes() {
const res = await getparameterTree({
id: 3
});
const dataHandler = (data) => {
data.forEach(i => {
if (i.hasOwnProperty('detail')) {
i.children = i.detail.map(j => {
j.name = j.value
return j;
})
} else {
dataHandler(i['children'])
}
})
return data;
}
this.planTypes = dataHandler(res?.children) || []
},
getSelections() {
return new Promise((resolve, reject) => {
const selections = this.$refs["editorPlanTable"].getSelection();
if (selections?.length > 0) {
for (let i of selections) {
if (i._inputMoney <= 0) {
this.$message({
type: "warning",
message: `${i.year}${i.name} 使用金额需要大于0`,
});
reject(`${i.year}${i.name} 使用金额需要大于0`)
return;
}
if (i._inputMoney > ((Number(i.money) || Number(i.update_money)) - Number(i.has_money_total))) {
this.$message({
type: "warning",
message: `${i.year}${i.name} 使用金额大于剩余预算!`,
});
reject(`${i.year}${i.name} 使用金额大于剩余预算!`)
return;
}
}
}
resolve(selections.map((i) => ({
plan_id: i.id,
plan_title: i.title,
use_money: i._inputMoney,
new_money: i.money,
})))
})
}
},
computed: {},
mounted() {
this.$nextTick(() => {
this.boxHeight = window.innerHeight - document.querySelector('.select-container')?.getBoundingClientRect()?.height - document.querySelector('.pagination')?.getBoundingClientRect()?.height - 50
console.log(this.boxHeight, 'box')
})
},
created() {
window.$getPlans = this.getSelections
this.getPlanTypes()
this.getDepartment()
this.getBudgets()
}
}
</script>
<style scoped lang="scss">
.page {
padding: 10px;
height: 100%;
}
.select-container {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>

@ -173,7 +173,7 @@ export default {
data={list}
highlight-current-row={highlightCurrentRow}
expand-row-keys={expandRowKeys}
height={height ?? tableHeight}
height={height ? height : tableHeight}
className="v-table"
style={tableStyle}
row-key={rowKey}

@ -42,6 +42,12 @@ export const constantRoutes = [{
hidden: true
},
{
path: '/plan-picker',
component: () => import('@/components/PlanPicker'),
hidden: true
},
{
path: '/',
component: Layout,

@ -499,9 +499,9 @@ export default {
} else {
let rows = this.$refs['xyTable'].getSelection()
const baseInfo = {
"totalAmt": row.reduce((pre, cur) => pre + Number(row.expense??0),0),
"totalAmt": rows.reduce((pre, cur) => pre + Number(row?.expense??0),0),
"chuchaishiyou": rows.map(row => row.title).toString(),
"xiangguanchuchaishenpidan": rows.map(i => row.flow_list.find(i => i.tag === 'chuchai')?.flow_id)?.filter(i => i)?.toString()
"xiangguanchuchaishenpidan": rows.map(row => row.flow_list.find(i => i.tag === 'chuchai')?.flow_id)?.filter(i => i)?.toString()
};
url = `${process.env.VUE_APP_OUT_OLD}/#/flow/create?auth_token=${window.encodeURIComponent(getToken())}&module_name=oa&isSinglePage=1&module_id=78&out_away_id=${rows.map(i => i.id)?.toString()}&default_json=${JSON.stringify(baseInfo)}`;
}

@ -457,7 +457,7 @@
placeholder="请填写一般采购类型"
v-model="form.common_type"
style="width: 100%"
@change="e => form.name = `${e}${$moment().format('YYYY-MM-DD HH:mm')}`"
@change="e => form.name = `${e}${$moment().format('YYYY-MM-DD')}`"
/>
</el-form-item>
<el-form-item prop="name" label="项目名称">
@ -1499,6 +1499,9 @@ export default {
this.form.contract_plan_links = []
}
this.form.is_purchase = (this.flowIds?.find(i => i.id == this.form.flow_mod_id)?.type == 2 ? 1 : 0) || this.form.is_common_purchase;
if (this.form.is_common_purchase) {
this.form.is_contract = 1
}
// this.form.is_contract = this.flowIds?.find(i => i.id == this.form.flow_mod_id)?.type == 2 ? 0 : 1;
if (!this.form.money) {
this.form.money = this.form.plan_price
@ -1741,6 +1744,14 @@ export default {
if (myPurchaseType) {
next(vm => {
vm.myPurchaseType = Number(myPurchaseType)
if (vm.myPurchaseType === 1) {
vm.myPurchaseType = 1
vm.form.is_common_purchase = 0
} else if (vm.myPurchaseType === 2) {
vm.step = 2
vm.myPurchaseType = 2
vm.form.is_common_purchase = 1
}
})
} else {
MessageBox.confirm("请选择类型", "提示", {

@ -1195,7 +1195,7 @@ export default {
customFn:row => {
return (
<div>
<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.caigou.getStatus()) }}>{ this.flowStatus.get(row.FLOWSTATUS.caigou.getStatus()) || '无2' }</span>
<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.caigou.getStatus()) }}>{ this.flowStatus.get(row.FLOWSTATUS.caigou.getStatus()) || '无' }</span>
<br/>
{
(row.FLOWSTATUS.caigou.getStatus() !== 2 && row.FLOWSTATUS.caigou.getStatus() !== -2) ? <a style="color: #333" on={{['click']:()=>this.toOaDetail('caigou',row)}}>查看</a> : ''
@ -1209,12 +1209,9 @@ export default {
width: 145,
prop: "invite_status",
customFn:row => {
if (!row.FLOWSTATUS.zhaobiao.getStatus()) {
return (<span style="color: rgb(140, 140, 140)"></span>);
}
return (
<div>
<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.zhaobiao.getStatus()) }}>{ this.flowStatus.get(row.FLOWSTATUS.zhaobiao.getStatus()) }</span>
<span style={{ 'color': this.flowStatusColor.get(row.FLOWSTATUS.zhaobiao.getStatus()) }}>{ this.flowStatus.get(row.FLOWSTATUS.zhaobiao.getStatus()) || '无' }</span>
<br/>
{
(row.FLOWSTATUS.zhaobiao.getStatus() !== 2 && row.FLOWSTATUS.zhaobiao.getStatus() !== -2) ? <a style="color: #333" on={{['click']:()=>{
@ -2357,10 +2354,10 @@ export default {
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_common_purchase) && !item.is_substitute) {
// \
flowStatus["zhaobiao"].setStatus(item.invite_status ?? 2)
if ((!item.invite_status || item.invite_status === 2) && caigou?.flow_status === 1) {
if ((!item.invite_status || item.invite_status === 2) && (caigou?.flow_status === 1 || common_purchase?.flow_status === 1)) {
//
flowStatus["zhaobiao"].setExecutable(true)
}

@ -129,7 +129,7 @@
>
资产申请
</Button>
<Button v-if="scope.row.flow_id"
<Button v-if="scope.row.flow_list.find(i => i.tag === 'pay') ? scope.row.flow_list.find(i => i.tag === 'pay').flow_status === 1 : false"
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
@ -326,11 +326,12 @@ export default {
},
methods: {
async toOaDetail (row) {
window.open(
`${process.env.VUE_APP_OUT_OLD}/flow/view/${row.flow_id}?auth_token=${this.$store.getters.oa_token}`,
"bidding",
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
)
let url = `${process.env.VUE_APP_OUT_URL}/#/flow/detail?auth_token=${window.encodeURIComponent(getToken())}&isSinglePage=1&flow_id=`
let pay = row.flow_list.find(i => i.tag === 'pay')
//url += `&to=/flow/detail?flow_id=${caigou.id}`
url += pay?.flow_id
this.oaUrl = url
this.isShowOaModal = true
},
async toOutAsset (row) {
@ -386,7 +387,8 @@ export default {
"xiangmuzonge": totalMoney(),
"cishu": payments.length,
"amt": row?.apply_money,
"liezhiqudao": contract?.plans.map(i => i.name)?.toString()
"liezhiqudao": contract?.plans.map(i => i.name)?.toString(),
"contractno": contract?.number
};
let url = `${process.env.VUE_APP_OUT_OLD}/#/flow/create?auth_token=${window.encodeURIComponent(getToken())}&module_name=oa&isSinglePage=1&module_id=75&out_pay_id=${row.id}&default_json=${JSON.stringify(baseInfo)}`;
@ -467,3 +469,13 @@ export default {
</script>
<style scoped lang="scss"></style>
<style lang="scss">
.oa-modal {
.ivu-modal-body {
max-height: calc(100vh - 51px)!important;
padding: 0 !important;
overflow: hidden;
}
}
</style>

Loading…
Cancel
Save