删除按钮

haicang
jwg 3 weeks ago
parent f001558602
commit 6591dd8b71

@ -15,35 +15,93 @@
</div> -->
<div class="ct-md">
<div class="mt5">
申请类型{{getDictDataLabel(DICT_TYPE.BS_BILL_TYPE,itemData.billType) || ''}}
申请类型{{
getDictDataLabel(DICT_TYPE.BS_BILL_TYPE, itemData.billType) ||
''
}}
</div>
<div class="mt5">
申请人{{itemData.nickname}}
</div>
<div class="mt5">
项目名称 {{itemData.projectName}}
</div>
<div class="mt5">
申请部门 {{userInfo.dept.name}}
</div>
<div style="margin-top: 0.3rem;">
申请时间 {{dayjs(itemData.createTime).format('YY/MM/DD HH:ss')}}
<div class="mt5">申请人{{ itemData.nickname }}</div>
<div class="mt5">项目名称 {{ itemData.projectName }}</div>
<div class="mt5">申请部门 {{ userInfo.dept.name }}</div>
<div style="margin-top: 0.3rem">
申请时间
{{ dayjs(itemData.createTime).format('YY/MM/DD HH:ss') }}
</div>
</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 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>
<div class="box-rt">
<!-- {{listType}} -->
<van-icon class="icon-box" v-hasPermi="[listType === 'myNewTrips' ? 'bs:expense-apply:myquery' : 'bs:expense-apply:query']" @click="handleShow(itemData)" name="eye-o" color="#05A9FF" size="25" />
<van-icon
class="icon-box"
v-hasPermi="[
listType === 'myNewTrips'
? 'bs:expense-apply:myquery'
: 'bs:expense-apply:query'
]"
@click="handleShow(itemData)"
name="eye-o"
color="#05A9FF"
size="25"
/>
<!-- <van-icon class="icon-box" v-hasPermi="['bs:expense-apply:create']" v-if="listType !== 'myNewTrips'" @click="handleEdit(itemData.id,itemData.status)" name="edit" :color="!(itemData.status==0 || (itemData.status==3 && userInfo.id ==itemData.creator)) ?'#ccc':''" size="25" />
<van-icon class="icon-box" v-hasPermi="['bs:expense-apply:delete']" v-if="listType !== 'myNewTrips'" @click="handleDel(itemData.id,itemData.status,temData.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:expense-apply:create']" v-if="listType == 'myNewTrips'" @click="handleEdit(itemData)" name="edit" :color="!(itemData.status==0 || (itemData.status==3 && userInfo.id ==itemData.creator)) ?'#ccc':''" size="25" />
<van-icon class="icon-box" v-hasPermi="['bs:expense-apply:mydelete']" v-if="listType == 'myNewTrips'" @click="handleDel(itemData.id,itemData.status,temData.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:expense-apply:create']"
v-if="listType == 'myNewTrips'"
@click="handleEdit(itemData)"
name="edit"
:color="
!(
itemData.status == 0 ||
(itemData.status == 3 && userInfo.id == itemData.creator)
)
? '#ccc'
: ''
"
size="25"
/>
<van-icon
class="icon-box"
v-hasPermi="['bs:expense-apply:mydelete']"
v-if="listType == 'myNewTrips'"
@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"
/>
</div>
</div>
</div>
@ -51,8 +109,8 @@
</template>
<script>
import { handleFilterStatus } from "@/utils/dict";
import { deleteExpenseApply, deleteMyExpenseApply } from "@/api/bs/expenseApply";
import { handleFilterStatus } from '@/utils/dict'
import { deleteExpenseApply, deleteMyExpenseApply } from '@/api/bs/expenseApply'
import dayjs from 'dayjs'
import { Dialog } from 'vant'
export default {
@ -60,13 +118,10 @@ export default {
listType: String,
itemData: {
required: true,
default: () => { }
},
},
components: {
default: () => {}
}
},
components: {},
data() {
return {
jumoStudentId: null
@ -77,13 +132,11 @@ export default {
this.handleUpdataInfo()
}
},
mounted() {
},
mounted() {},
computed: {
userInfo() {
return JSON.parse(window.localStorage.getItem('userInfo') || { dept: {} })
},
}
},
methods: {
handleShow(obj) {
@ -95,7 +148,7 @@ export default {
},
handleEdit(obj) {
const { id, status, billType, creator } = obj
if (!(status==0 || (status ==3 && this.userInfo.id ==creator))) {
if (!(status == 0 || (status == 3 && this.userInfo.id == creator))) {
return
}
this.jumoStudentId = id
@ -104,31 +157,33 @@ export default {
query: { id, type: 'edit', listType: this.listType, billType }
})
},
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(() => {
let api = this.listType === 'myNewTrips' ? deleteMyExpenseApply : deleteExpenseApply
api(id).then(() => {
this.$emit('onAllRefresh')
})
message: '你确定要删除吗?'
}).then(() => {
let api =
this.listType === 'myNewTrips'
? deleteMyExpenseApply
: deleteExpenseApply
api(id).then(() => {
this.$emit('onAllRefresh')
})
})
},
handleFilterStatus,
dayjs,
handleUpdataInfo() {
this.jumoStudentId = null
this.$emit('onUpdataInfo', this.itemData.id)
},
}
}
}
</script>
<style lang="scss" scoped>
@import '@/assets/style/common/newList.scss';
</style>
</style>

Loading…
Cancel
Save