删除按钮

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 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 class="mt5">
申请部门 {{userInfo.dept.name}}
</div>
<div style="margin-top: 0.3rem;">
申请时间 {{dayjs(itemData.createTime).format('YY/MM/DD HH:ss')}}
</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 {
@ -61,12 +119,9 @@ export default {
itemData: {
required: true,
default: () => {}
}
},
},
components: {
},
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) {
@ -110,10 +163,12 @@ export default {
}
Dialog.confirm({
title: '提示',
message: '你确定要删除吗?',
})
.then(() => {
let api = this.listType === 'myNewTrips' ? deleteMyExpenseApply : deleteExpenseApply
message: '你确定要删除吗?'
}).then(() => {
let api =
this.listType === 'myNewTrips'
? deleteMyExpenseApply
: deleteExpenseApply
api(id).then(() => {
this.$emit('onAllRefresh')
})
@ -124,7 +179,7 @@ export default {
handleUpdataInfo() {
this.jumoStudentId = null
this.$emit('onUpdataInfo', this.itemData.id)
},
}
}
}
</script>

Loading…
Cancel
Save