xy 2 years ago
parent 95f2e1ba8a
commit 47b49c9bd9

@ -15,11 +15,12 @@ export function listdept() {
})
}
export function listdeptNoAuth(params = {show_tree:1}){
export function listdeptNoAuth(params = {show_tree:1},noloading){
return request({
url:'/api/admin/other/admin-department-list',
method:'get',
params
params,
noloading: true
})
}

@ -8,6 +8,43 @@
<div style="padding: 20px">
<div v-show="step === 1">
<div style="display: flex;justify-content: space-between;align-items: center;">
<DatePicker
:value="planSelect.year"
placeholder="选择所属年份"
placement="bottom"
style="width: 180px;margin-right: 10px;"
type="year"
@on-change="(e) => (planSelect.year = e)"
></DatePicker>
<el-select
placeholder="科室选择"
clearable
size="small"
v-model="planSelect.plan_department_id"
style="width: 180px;margin-right: 10px;"
>
<el-option
v-for="item in departments"
:label="item.name"
:value="item.id"
:key="item.id"
>
</el-option>
</el-select>
<el-cascader
:options="planTypes"
:props="{
checkStrictly: false,
label: 'name',
value: 'id',
}"
:value="planSelect.type"
clearable
size="small"
style="width: 180px;margin-right: 10px;"
@change="(e) => (planSelect.type = e[e.length - 1] || '')"
/>
<Input
v-model="planSelect.name"
search
@ -16,6 +53,7 @@
placeholder="搜索预算计划.."
@on-search="getBudgets"
/>
</div>
<xy-table
:list="plans"
@ -211,7 +249,7 @@
style="width: 100%"
>
<el-option
v-for="item in purchaseWay"
v-for="item in purchaseWayFormat()"
:label="item.value"
:value="item.id"
></el-option>
@ -761,7 +799,7 @@
</template>
<script>
import { getparameter } from "@/api/system/dictionary";
import { getparameter, getparameterTree } from '@/api/system/dictionary'
import {
addContrant,
editorContract,
@ -772,9 +810,16 @@ import {
import { getBudget } from "@/api/budget/budget";
import { getInfo } from "@/api/user.js";
import { listdeptNoAuth } from '@/api/system/department'
export default {
data() {
return {
window: {
width: 0,
height: 0,
top: 0,
left: 0,
},
btnLoading: false,
type: "add",
contractId: "",
@ -808,6 +853,8 @@ export default {
content: "",
contract_to_contracts: [],
},
planTypes: [],
departments: [],
purchaseType: [],
moneyWay: [],
purchaseWay: [],
@ -1015,6 +1062,9 @@ export default {
page_size: 20,
page: 1,
is_tree: 1,
year: "",
plan_department_id: "",
type: ""
},
planTable: [
{
@ -1166,6 +1216,30 @@ export default {
})
)?.detail || [];
},
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) || []
},
forwardStep() {
if (this.step > 1) {
@ -1213,6 +1287,7 @@ export default {
});
}
} else if (this.step === 2) {
//submit
this.$refs["form"].validate((valid) => {
if (valid) {
this.btnLoading = true
@ -1223,6 +1298,25 @@ export default {
addContrant(this.form,true).then(res => {
this.btnLoading = false
this.step = 3;
getContract({
page: 1,
page_size: 1,
sort_name: "created_at"
},true).then(res => {
const openData = res.list.data[0]
if (openData) {
if (
openData.is_simple !== 1 &&
openData.purchase_status === 1 &&
((openData.req_status === 3 && openData.is_plan === 0) ||
openData.is_plan === 1) &&
!openData.is_substitute
) {
this.buyProcess(openData)
}
}
})
}).catch(_ => this.btnLoading = false)
}
if (this.type === 'edit') {
@ -1239,6 +1333,29 @@ 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?.name : pre+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=${
row.id
}&contract_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 getBudgets() {
let res = await getBudget(this.planSelect);
@ -1347,10 +1464,21 @@ export default {
content: res?.content,
contract_to_contracts: [],
}
console.log(this.form)
}
},
computed: {
purchaseWayFormat() {
return function () {
if (!this.form.purchase_type_id) {
return this.purchaseWay;
} else {
let temp = this.purchaseType.find((i) => i.id === this.form.purchase_type_id);
let arr = temp?.remark?.split(",")?.map((i) => Number(i));
return this.purchaseWay.filter((i) => arr.indexOf(i.id) !== -1);
}
};
},
isLedger () {
return this.$route.query.isLedger;
},
@ -1610,6 +1738,12 @@ export default {
}
},
created() {
this.window.width = screen.availWidth * 0.95;
this.window.height = screen.availHeight * 0.95;
this.window.top = (window.screen.height - 30 - this.window.height) / 2;
this.window.left = (window.screen.width - 10 - this.window.width) / 2;
this.getPlanTypes();
this.getDepartment();
this.getBudgets();
this.getMoneyWay();
this.getPurchaseType();

Loading…
Cancel
Save