增加合同审批模块,未完成

main
jwg 7 months ago
parent 9a8000a035
commit 447b83c3e3

@ -7,37 +7,110 @@
<div class="bt">{{}}</div>
</div> -->
<div class="box-cr">
<div class="cr-bt" style="margin-top: 0.6rem;">
<div class="tags" :style="`border: 1px solid ${handleFilterStatus(DICT_TYPE.BS_EXPENSE_APPLY_STATUS,itemData.status).color};color:${handleFilterStatus(DICT_TYPE.BS_EXPENSE_APPLY_STATUS,itemData.status).color}`"> {{handleFilterStatus(DICT_TYPE.BS_EXPENSE_APPLY_STATUS,itemData.status).label}}</div>
<div class="cr-bt" style="margin-top: 0.6rem">
<div
class="tags"
:style="`border: 1px solid ${
handleFilterStatus(
DICT_TYPE.BS_EXPENSE_APPLY_STATUS,
itemData.status
).color
};color:${
handleFilterStatus(
DICT_TYPE.BS_EXPENSE_APPLY_STATUS,
itemData.status
).color
}`"
>
{{
handleFilterStatus(
DICT_TYPE.BS_EXPENSE_APPLY_STATUS,
itemData.status
).label
}}
</div>
</div>
<div class="ct-md">
<div class="mt5" style="color:#333">
合同编号 {{itemData.contractNumber}}
<div class="mt5" style="color: #333">
合同编号 {{ itemData.contractNumber }}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
合同名称{{itemData.contractName}}
<div style="margin-top: 0.3rem; color: #333">
合同名称{{ itemData.contractName }}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
供应商名称{{itemData.supplierName}}
<div style="margin-top: 0.3rem; color: #333">
供应商名称{{ itemData.supplierName }}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
签约人员{{itemData.signatoryName}}
<div style="margin-top: 0.3rem; color: #333">
签约人员{{ itemData.signatoryName }}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
合同金额{{itemData.amount}}
<div style="margin-top: 0.3rem; color: #333">
合同金额{{ itemData.amount }}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
合同起止时间 {{itemData.startTime && dayjs(itemData.startTime).format('YY/MM/DD')}} ~ {{itemData.endTime && dayjs(itemData.endTime).format('YY/MM/DD')}}
<div style="margin-top: 0.3rem; color: #333">
合同起止时间
{{
itemData.startTime &&
dayjs(itemData.startTime).format('YY/MM/DD')
}}
~
{{
itemData.endTime && dayjs(itemData.endTime).format('YY/MM/DD')
}}
</div>
<div style="margin-top: 0.3rem;color:#333 ">
<div class="tags" :style="`border: 1px solid ;color:#05A9FF;width: 6rem;`">{{getDictDataLabel(DICT_TYPE.SR_CT_TYPE,itemData.contractType) || '未知'}} </div>
<div style="margin-top: 0.3rem; color: #333">
<div
class="tags"
:style="`border: 1px solid ;color:#05A9FF;width: 6rem;`"
>
{{
getDictDataLabel(
DICT_TYPE.SR_CT_TYPE,
itemData.contractType
) || '未知'
}}
</div>
</div>
</div>
</div>
<div class="box-rt">
<van-icon class="icon-box" v-hasPermi="['bs:supplier-contract:show']" @click="handleShow(itemData.id)" name="eye-o" color="#05A9FF" size="25" />
<van-icon class="icon-box" v-hasPermi="['bs:supplier-contract:update']" @click="handleEdit(itemData.id, itemData.status, itemData.creator)" name="edit" :color="!(itemData.status==0 || (itemData.status==3 && userInfo.id ==itemData.creator)) ?'#ccc':''" size="25" />
<van-icon class="icon-box" v-hasPermi="['bs:supplier-contract:delete']" @click="handleDel(itemData.id, itemData.status, itemData.creator)" name="delete-o" :color="!(itemData.status==0 || (itemData.status==3 && userInfo.id ==itemData.creator)) ?'#ccc':'#EC3359'" size="25" />
<van-icon
class="icon-box"
v-hasPermi="['bs:supplier-contract:query']"
@click="handleShow(itemData.id)"
name="eye-o"
color="#05A9FF"
size="25"
/>
<van-icon
class="icon-box"
v-hasPermi="['procurement:supplierCt:update']"
@click="handleEdit(itemData.id, itemData.status, itemData.creator)"
name="edit"
:color="
!(
itemData.status == 0 ||
(itemData.status == 3 && userInfo.id == itemData.creator)
)
? '#ccc'
: ''
"
size="25"
/>
<van-icon
class="icon-box"
v-hasPermi="['procurement:supplierCt:del']"
@click="handleDel(itemData.id, itemData.status, itemData.creator)"
name="delete-o"
:color="
!(
itemData.status == 0 ||
(itemData.status == 3 && userInfo.id == itemData.creator)
)
? '#ccc'
: '#EC3359'
"
size="25"
/>
<!-- <van-icon class="icon-box" v-hasPermi="['bs:supplier-contract:delete']" @click="handleMerge(itemData.id, itemData.status, itemData.creator)" name="envelop-o" :color="!(itemData.status==0 || (itemData.status==3 && userInfo.id ==itemData.creator)) ?'#05A9FF':'#ccc'" :size="25" /> -->
</div>
</div>
@ -46,24 +119,21 @@
</template>
<script>
import { getDictDataLabel, handleFilterStatus } from "@/utils/dict";
import { deleteSupplierContract } from '@/api/bs/supplierContract';
import { getDictDataLabel, handleFilterStatus } from '@/utils/dict'
import { deleteSupplierContract } from '@/api/bs/supplierContract'
import dayjs from 'dayjs'
import { Dialog } from 'vant'
export default {
props: {
itemData: {
required: true,
default: () => { }
default: () => {},
},
},
components: {
},
components: {},
data() {
return {
jumoStudentId: null
jumoStudentId: null,
}
},
activated() {
@ -71,9 +141,7 @@ export default {
this.handleUpdataInfo()
}
},
mounted() {
},
mounted() {},
computed: {
userInfo() {
return JSON.parse(window.localStorage.getItem('userInfo') || { dept: {} })
@ -85,29 +153,28 @@ export default {
return
}
},
handleEdit(id, status,creator) {
if (!(status==0 || (status ==3 && this.userInfo.id ==creator)) ) {
handleEdit(id, status, creator) {
if (!(status == 0 || (status == 3 && this.userInfo.id == creator))) {
return
}
this.jumoStudentId = id
this.$router.push({
path: '/supplier',
query: { id, type: 'edit' }
query: { id, type: 'edit' },
})
},
handleDel(id, status,creator) {
if (!(status==0 || (status ==3 && this.userInfo.id ==creator)) ) {
handleDel(id, status, creator) {
if (!(status == 0 || (status == 3 && this.userInfo.id == creator))) {
return
}
Dialog.confirm({
title: '提示',
message: '你确定要删除吗?',
})
.then(() => {
deleteSupplierContract(id).then(() => {
this.$emit('onAllRefresh')
})
}).then(() => {
deleteSupplierContract(id).then(() => {
this.$emit('onAllRefresh')
})
})
},
handleFilterStatus,
getDictDataLabel,
@ -115,7 +182,7 @@ export default {
this.jumoStudentId = id
this.$router.push({
path: '/supplier',
query: { id, type: 'show' }
query: { id, type: 'show' },
})
},
dayjs,
@ -123,7 +190,7 @@ export default {
this.jumoStudentId = null
this.$emit('onUpdataInfo', this.itemData.id)
},
}
},
}
</script>

@ -1,27 +1,51 @@
<template>
<!-- 中标审批列表 -->
<div>
<HeaderFilter :listType="listType" :spList="spList" @onListQuery="handleListQuery" :paramProp="listQuery" />
<RMList :moreLoading.sync="moreLoading" :refreshing.sync="refreshing" :finished.sync="finished" @onLoad="handleLoad" @onRefresh="handleRefresh" isMore :tableList="tableList">
<HeaderFilter
:listType="listType"
:spList="spList"
@onListQuery="handleListQuery"
:paramProp="listQuery"
/>
<RMList
:moreLoading.sync="moreLoading"
:refreshing.sync="refreshing"
:finished.sync="finished"
@onLoad="handleLoad"
@onRefresh="handleRefresh"
isMore
:tableList="tableList"
>
<div>
<MySupplierListCard v-for="(item,index) in tableList" :key="item.id" :itemData="item" :listType="listType" @onUpdataInfo="handleUpdataInfo($event, index)" @onAllRefresh="handleAllRefresh" />
<MySupplierListCard
v-for="(item, index) in tableList"
:key="item.id"
:itemData="item"
:listType="listType"
@onUpdataInfo="handleUpdataInfo($event, index)"
@onAllRefresh="handleAllRefresh"
/>
</div>
</RMList>
<div class="common-bottom-btns" style="bottom:8rem">
<div class="common-bottom-btns" style="bottom: 8rem">
<div class="common-bottom-btn" @click="handleTopPage">
<img src="@/assets/images/icons/top.png" alt="">
<img src="@/assets/images/icons/top.png" alt="" />
<span>回到顶部</span>
</div>
</div>
<div class="common-bottom-btns" v-hasPermi="['bs:supplier-contract:create']" style="bottom:10rem">
<div
class="common-bottom-btns"
v-hasPermi="['bs:supplier-contract:create']"
style="bottom: 10rem"
>
<div class="common-bottom-btn" @click="handleToAdd">
<img src="@/assets/images/icons/add.png" alt="">
<img src="@/assets/images/icons/add.png" alt="" />
<span>添加申请</span>
</div>
</div>
<div class="common-bottom-btns" style="bottom:6rem">
<div class="common-bottom-btns" style="bottom: 6rem">
<div class="common-bottom-btn" @click="handleBack">
<img src="@/assets/images/icons/home.png" alt="">
<img src="@/assets/images/icons/home.png" alt="" />
<span>返回首页</span>
</div>
</div>
@ -30,13 +54,13 @@
<script>
import { getScrollTop } from '@/utils'
import { getSupplierCompanyPage } from "@/api/bs/quotationSheet";
import { getSupplierContractPage } from "@/api/bs/supplierContract";
import { getSupplierCompanyPage } from '@/api/bs/quotationSheet'
import { getSupplierContractPage } from '@/api/bs/supplierContract'
import { mapState } from 'vuex'
import dayjs from 'dayjs'
export default {
props: {
listType: String // EnrollmentOrder: EnrollmentCollection: ShiftRecord: WaitPay:
listType: String, // EnrollmentOrder: EnrollmentCollection: ShiftRecord: WaitPay:
},
components: {
HeaderFilter: () => import('./HeaderFilter.vue'),
@ -60,7 +84,6 @@ export default {
contractName: null,
contractType: null,
supplierName: null,
status: null,
amount: null,
receivedAmount: null,
projectId: null,
@ -81,9 +104,9 @@ export default {
},
computed: {
...mapState({
singlePageSize: state => state.common.setting.singlePageSize,
pageSize: state => state.common.setting.pageSize,
})
singlePageSize: (state) => state.common.setting.singlePageSize,
pageSize: (state) => state.common.setting.pageSize,
}),
},
activated() {
this.handleScrollInit()
@ -113,35 +136,44 @@ export default {
pageNo: 1,
pageSize: this.singlePageSize,
}
getSupplierContractPage(listQuery).then((res) => {
let arr = (res.data && res.data.list || []).filter(item => item.id == id)
resolve(arr)
}).catch((err) => {
reject(err)
})
getSupplierContractPage(listQuery)
.then((res) => {
let arr = ((res.data && res.data.list) || []).filter(
(item) => item.id == id
)
resolve(arr)
})
.catch((err) => {
reject(err)
})
})
},
handleUpdataInfo(id, index) {
this.$loading(true, 'singleReset')
this.handleSetSingle(id).then(arr => {
if (arr.length) {
this.tableList.splice(index, 1, arr[0])
}
this.$loading(false, 'singleReset')
}).catch(() => {
this.$loading(false, 'singleReset')
})
this.handleSetSingle(id)
.then((arr) => {
if (arr.length) {
this.tableList.splice(index, 1, arr[0])
}
this.$loading(false, 'singleReset')
})
.catch(() => {
this.$loading(false, 'singleReset')
})
},
handleListQuery(paramProp) {
this.listQuery = {
...paramProp,
invoiceDate: paramProp.startDate && [dayjs(paramProp.startDate).format('YYYY-MM-DD HH:ss:mm'), dayjs(paramProp.endDate).format('YYYY-MM-DD HH:ss:mm')]
invoiceDate: paramProp.startDate && [
dayjs(paramProp.startDate).format('YYYY-MM-DD HH:ss:mm'),
dayjs(paramProp.endDate).format('YYYY-MM-DD HH:ss:mm'),
],
}
this.finished = false
this.handleRefresh()
},
handleScroll() {
getScrollTop().then(height => {
getScrollTop().then((height) => {
this.height = height
})
},
@ -159,8 +191,8 @@ export default {
this.$router.push({
path: '/supplier',
query: {
type: 'add'
}
type: 'add',
},
})
},
handleAllRefresh() {
@ -191,31 +223,33 @@ export default {
getTableList(val) {
// const { shellIdsLocal, collegeInfoIdLocal, startDate, endDate, keyword, type, method, targets, usePersonId, teacherIds, chargePersonIds } = this.listQuery
const query = {
...this.listQuery
...this.listQuery,
}
this.moreLoading = true
this.$loading(true, 'tableLoading')
getSupplierContractPage(query).then(res => {
let resList = res.data && res.data.list || []
if (['init', 'refresh'].includes(val)) {
this.tableList = resList
this.handleScrollToTop()
} else {
this.tableList = this.tableList.concat(resList)
}
if (resList.length < this.pageSize) {
this.finished = true
}
}).finally(() => {
this.$nextTick(() => {
this.moreLoading = false
this.refreshing = false
this.$loading(false, 'tableLoading')
getSupplierContractPage(query)
.then((res) => {
let resList = (res.data && res.data.list) || []
if (['init', 'refresh'].includes(val)) {
this.tableList = resList
this.handleScrollToTop()
} else {
this.tableList = this.tableList.concat(resList)
}
if (resList.length < this.pageSize) {
this.finished = true
}
})
.finally(() => {
this.$nextTick(() => {
this.moreLoading = false
this.refreshing = false
this.$loading(false, 'tableLoading')
})
// this.$loading(false, `cTableLoading_${this.listType}`)
})
// this.$loading(false, `cTableLoading_${this.listType}`)
})
},
}
},
}
</script>
<style scoped lang="scss">

@ -198,19 +198,21 @@ export default {
},
{
row: [
/* {
{
route: '/mySupplier',
title: '供应商合同审批',
icon: 'friends-o',
show: this.permission_btns.includes('procurement:supplierCt:list')
show: this.permission_btns.includes(
'procurement:supplierCt:list'
),
},
{
route: '/myCustom',
title: '客户合同审批',
icon: 'manager-o',
show: this.permission_btns.includes('bs:customer-contract:query')
show: this.permission_btns.includes('bs:customer-contract:query'),
},
{
/* {
route: '/myBidder',
title: '中标审批',
icon: 'bookmark-o',

Loading…
Cancel
Save