master
xy 2 years ago
parent 74280076b4
commit b777572112

@ -1,10 +1,11 @@
import request from "@/utils/request";
export function getContract(params){
export function getContract(params,noloading = false){
return request({
method:'get',
url:'/api/admin/contract/index',
params
params,
noloading
})
}
@ -48,10 +49,11 @@ export function checkContractName(params){
})
}
export function updateStatus(params){
export function updateStatus(params,noloading = true){
return request({
method:'get',
url:'api/admin/oa/update-contract',
params
params,
noloading
})
}

@ -15,7 +15,7 @@ export function getOutDetail({ tbname,out_caigou_id,out_contract_id,out_pay_id,o
})
}
export function httpCurl({ tbname,out_caigou_id,out_contract_id,out_pay_id,out_zhaobiao_id }) {
export function httpCurl({ tbname,out_caigou_id,out_contract_id,out_pay_id,out_zhaobiao_id },noloading = true) {
return request({
method: 'post',
url: '/api/admin/other/http-curl',
@ -29,6 +29,7 @@ export function httpCurl({ tbname,out_caigou_id,out_contract_id,out_pay_id,out_z
out_pay_id,
out_zhaobiao_id
}
}
},
noloading
})
}

@ -0,0 +1,225 @@
<script>
export default {
props:{
},
data() {
return {
isShowSelector:false,
width:300,
left:0,
}
},
methods: {
initStyle(){
const header = document.querySelector('.v-header').getBoundingClientRect()
this.width = header.width
const select = document.querySelector('.xy-selectors').getBoundingClientRect()
this.left = select.left - header.left
this.$forceUpdate()
},
showSelector(){
this.isShowSelector =! this.isShowSelector
},
renderAdd(){
return (<Button
class="xy-selectors-btn__item"
type='primary'
on={{
['click']:()=>this.$emit('add')
}}>
新增
</Button>)
}
},
mounted() {
this.initStyle()
window.onresize = this.initStyle
},
destroyed() {
window.onresize = null
},
render(h) {
let {isShowSelector,showSelector,$scopedSlots} = this
return (
<div class="xy-selectors">
<div v-show={isShowSelector} style={{'width':'100vw','height':'100vh','position':'fixed','top':0,'left':0,'z-index':1}} on={{['click']:()=>this.isShowSelector = false}}></div>
<Button
icon='md-arrow-dropdown'
ghost={isShowSelector}
class={isShowSelector ? 'xy-selectors-btn__item xy-selectors-btn__select xy-selectors-btn-active__select' : 'xy-selectors-btn__item xy-selectors-btn__select"'}
type='primary'
on={{
['click']:() => showSelector()
}}>
高级搜索
</Button>
<transition
enter-active-class="scale-enter"
leave-to-class="scale-leave">
<div class="xy-selectors-card" style={{'width':`${this.width}px`,'left':`-${this.left}px`}} v-show={isShowSelector}>
<Icon
type="md-close"
size={24}
class="xy-selectors-card__close"
on={{['click']:()=> {
this.isShowSelector = false
}}}/>
<div class="xy-selectors-card-content">
{$scopedSlots?.selected ? $scopedSlots?.selected() : ''}
{$scopedSlots?.default ? $scopedSlots?.default() : ''}
</div>
<div class="xy-selectors-card-btn">
<Button
class="xy-selectors-card-btn__item"
type="primary"
ghost={true}
on={{['click']:()=>{this.$emit('reset')}}}>重置</Button>
<Button
class="xy-selectors-card-btn__item"
type="primary"
on={{['click']:()=>{
this.$emit('search')
this.isShowSelector = false
}}}>搜索</Button>
</div>
</div>
</transition>
</div>
)
}
}
</script>
<style lang="scss">
.xy-selectors{
&__item{
display: flex;
align-items: center;
padding: 8px 20px;
&--name{
width: 100px;
margin-right: 20px;
}
}
}
</style>
<style scoped lang="scss">
@import "../../styles/variables";
.xy-selectors{
position: relative;
&-btn{
//display: flex;
//justify-content: flex-start;
//align-items: center;
&__item{
//margin-right: 10px;
}
&__select{
}
&-active__select{
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
border-bottom: none;
box-shadow: 0 2px 10px 1px $primaryColor;
position: relative;
&::after{
content:'';
height: 12px;
background: linear-gradient(to top,rgba(235,238,244,0.98) 40%,#0000 80%,#0000);
z-index: 5;
position: absolute;
bottom: -4px;
left: 0;
right: 0;
}
}
}
&-card{
//width: 100%;
background: rgba(239,242,250,0.95);
border-radius: 0 4px 4px 4px;
border: $primaryColor solid 1px;
box-shadow: 0 4px 10px 1px $primaryColor;
z-index: 4;
position: absolute;
&__close{
cursor: pointer;
position: absolute;
top: 6px;
right: 14px;
}
&-content{
min-height: 50px;
max-height: 400px;
overflow: scroll;
padding: 36px 0 44px 8px;
&::-webkit-scrollbar-thumb{
background: $primaryColor;
}
}
&-btn{
width: 100%;
display: flex;
justify-content: space-evenly;
background: rgba(239,242,250,0.95);
position: absolute;
bottom: 0;
&__item{
width: 120px;
margin: 10px 0px;
}
}
}
}
.scale-enter{
transform-origin: 0 0%;
animation: scale-enter 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}
@keyframes scale-enter {
from{
transform: scaleY(0);
opacity: 0;
}
to{
transform: scaleY(1);
opacity: 1;
}
}
.scale-leave{
transform-origin: 0 0%;
animation: scale-leave 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}
@keyframes scale-leave {
from{
transform: scaleY(1);
opacity: 1;
}
to{
transform: scaleY(0);
opacity: 0;
}
}
</style>

@ -40,7 +40,8 @@ import xyTable from "@/components/XyTable"
Vue.component('xy-table',xyTable)
import xyDialog from "@/components/XyDialog"
Vue.component('xy-dialog',xyDialog)
import xySelectors from "@/components/XySelectors"
Vue.component('xy-selectors',xySelectors)
Vue.config.productionTip = false
import moment from 'moment'

@ -3,7 +3,7 @@
@import './transition.scss';
@import './element-ui.scss';
@import './sidebar.scss';
$primaryColor: #338de3;
body {
height: 100%;
-moz-osx-font-smoothing: grayscale;

@ -19,7 +19,8 @@
/>
</span>
</div>
<xy-selectors style="margin-left: 10px;" @search="getContracts" @reset="reset">
<div class="select-content">
<div>
<span style="padding: 0 6px; word-break: keep-all"
>服务商/供应商</span
@ -262,6 +263,8 @@
</Option>
</Select>
</div>
</div>
</xy-selectors>
<Button
style="margin-left: 10px"
@ -272,28 +275,6 @@
<Button style="margin-left: 10px" type="primary" @click="getContracts"
>查询</Button
>
<Button
ghost
style="margin-left: 10px"
type="primary"
@click="
select = {
showDatePicker: '',
ageIndex: 1,
startDate: '',
endDate: '',
type: '',
department: '',
purchaseModality: '',
purchaseMethods: '',
priceMin: null,
priceMax: null,
status: '',
}
"
>
重置
</Button>
<Button type="primary" @click="toExport()" style="margin-left: 10px"
>导出</Button
>
@ -1072,7 +1053,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 { parseTime, resetSelect } from "@/utils";
import { deepCopy, parseTime, resetSelect } from '@/utils'
import { Message } from "element-ui";
import { getInfo } from "@/api/user.js";
import { getToken } from "@/utils/auth";
@ -1222,8 +1203,25 @@ export default {
department_id: "",
purchaseModality: "",
purchaseMethods: "",
priceMin: null,
priceMax: null,
status: "",
year: "",
plan_id: "",
outcome_type: 1,
plan_name: "请选择预算计划",
start_plan_price: undefined,
end_plan_price: undefined,
},
selectCopy: {
keyword: "",
showDatePicker: "",
pageIndex: 1,
pageSize: 10,
startDate: "",
endDate: "",
type: "",
department_id: "",
purchaseModality: "",
purchaseMethods: "",
status: "",
year: "",
plan_id: "",
@ -1833,6 +1831,9 @@ export default {
};
},
methods: {
reset () {
this.select = deepCopy(this.selectCopy)
},
toExport() {
this.select.is_export = 1;
this.getContracts(true);
@ -2254,13 +2255,13 @@ export default {
this.getContracts();
},
//
async getContracts(is_export) {
async getContracts(is_export,noloading=false) {
const res = await getContract({
page_size: this.select.pageSize,
page: this.select.pageIndex,
is_auth: 1,
...this.select,
});
},noloading);
let tokens = getToken();
if (is_export && this.select.is_export == 1) {
@ -2576,8 +2577,8 @@ export default {
flow_type: flowTypeMap.get(this.nowContract.tbname),
out_contract_id: this.nowContract.id,
status: getStatus(res.flow?.current_step),
});
await this.getContracts();
},true);
await this.getContracts(false,true);
}
};
},
@ -2652,4 +2653,20 @@ export default {
content: "(元)";
}
}
.select-content {
display: flex;
flex-wrap: wrap;
& > div {
flex-basis: 45%;
margin: 5px;
& > span:nth-child(1) {
display: inline-block;
width: 140px;
}
}
}
</style>

@ -10,6 +10,8 @@
<Input v-model="select.keyword" clearable placeholder="关键字搜索" style="width: 200px" />
</span>
</div>
<xy-selectors style="margin-left: 10px;" @search="getContracts" @reset="reset">
<div class="select-content">
<div>
<span style="padding: 0 6px;word-break: keep-all;">服务商/供应商</span>
<span>
@ -162,6 +164,9 @@
</Option>
</Select>
</div>
</div>
</xy-selectors>
<Button style="margin-left: 10px" type="primary" @click="searchContracts"></Button>
<Button ghost style="margin-left: 10px" type="primary"
@ -403,7 +408,7 @@
getOatoken
} from "@/api/oatoken"
import {
parseTime
parseTime,deepCopy
} from "@/utils"
import {
Message
@ -475,8 +480,29 @@
department_id: "",
purchaseModality: "",
purchaseMethods: "",
priceMin: null,
priceMax: null,
status: "",
year: "",
plan_id: "",
plan_name: "请选择预算计划",
start_plan_price: null,
end_plan_price: null,
assurance_status: 0,
start_assurance_money: null,
end_assurance_money: null,
showDatePickerBao: "",
start_assurance_expire: "",
end_assurance_expire: ""
},
selectCopy: {
keyword: '',
showDatePicker: '',
pageIndex: 1,
startDate: "",
endDate: "",
type: "",
department_id: "",
purchaseModality: "",
purchaseMethods: "",
status: "",
year: "",
plan_id: "",
@ -1011,6 +1037,9 @@
}
},
methods: {
reset () {
this.select = deepCopy(this.selectCopy)
},
searchContracts() {
this.select.pageIndex = 1;
this.getContracts();
@ -1617,4 +1646,20 @@
content: '(元)'
}
}
.select-content {
display: flex;
flex-wrap: wrap;
& > div {
flex-basis: 45%;
margin: 5px;
& > span:nth-child(1) {
display: inline-block;
width: 140px;
}
}
}
</style>

@ -28,7 +28,7 @@ module.exports = {
publicPath: '/admin/',
outputDir: '/Users/liuxiangyu/Work/h-huanjingjiance/app/hjjc-workbench-service/public/admin',
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development',
lintOnSave: false,
productionSourceMap: false,
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save