fix: 物资领用添加审核

main
wx-jincw 1 week ago
parent 3081b11b7f
commit 84c61d92e2

@ -181,6 +181,33 @@ export function cancelBill(id) {
);
}
// 审核单据通过
export function auditBill(id) {
return request.get(
`autogencode/ckbill/auditBill/${id}`,
{},
{ useAdminUrl: true }
);
}
// 驳回单据
export function rejectBill(id) {
return request.get(
`autogencode/ckbill/rejectBill/${id}`,
{},
{ useAdminUrl: true }
);
}
// 撤销审核
export function cancelAuditBill(id) {
return request.get(
`autogencode/ckbill/cancelAuditBill/${id}`,
{},
{ useAdminUrl: true }
);
}
// 部门树
export function getDeptTree() {
return request.get(

@ -20,7 +20,7 @@
</view>
<view class="form-item">
<text class="label">反馈图片</text>
<text class="label">处理图片</text>
<view class="upload-section">
<view class="upload-list">
<view
@ -67,7 +67,7 @@ export default {
open(item) {
this.currentItem = item;
this.form.handlerReslut = item.handlerReslut || '';
this.images = item.beforeProcessFiles && item.beforeProcessFiles.length ? [...item.beforeProcessFiles] : [];
this.images = item.afterProcessFiles && item.afterProcessFiles.length ? [...item.afterProcessFiles] : [];
this.$refs.popup.open();
},
close() {

@ -3,6 +3,14 @@
<template #top>
<!-- 顶部标签我要领用 / 领用记录 -->
<view class="tabs">
<view
class="tab"
v-if="checkPermi('material_collection_audit')"
:class="activeTab === 'allList' ? 'active' : ''"
@click="switchToAllList"
>
领用审核
</view>
<view
class="tab"
:class="activeTab === 'form' ? 'active' : ''"
@ -114,7 +122,7 @@
</uni-popup>
<!-- 列表区域 -->
<view class="tab-content" v-show="activeTab === 'list'">
<view class="tab-content" v-show="activeTab === 'allList' || activeTab === 'list'">
<view
class="record-card"
v-for="item in receiptRecords"
@ -153,18 +161,6 @@
{{ item.remark || '—' }}
</text>
</view>
<!-- <view class="row">
<text class="label">领用部门</text>
<text class="value">
{{ item.ckBillCargos && item.ckBillCargos.length > 0 ? (item.ckBillCargos[0].receiveDeptName || '—') : '—' }}
</text>
</view>
<view class="row">
<text class="label">领用人</text>
<text class="value">
{{ item.ckBillCargos && item.ckBillCargos.length > 0 ? (item.ckBillCargos[0].receiverName || '—') : '—' }}
</text>
</view> -->
<view class="row" v-if="item.ckBillCargos && item.ckBillCargos.length > 0">
<text class="label">领用物资</text>
<text class="value">
@ -175,7 +171,14 @@
</view>
</view>
<view class="card-footer">
<view class="card-footer" v-if="activeTab === 'allList'">
<view class="action-buttons" v-if="item.cancelStatus === '0' && item.billStatus === '0'">
<view class="action-btn approve-btn" v-if="item.auditStatus === '0'" @click="approveBill(item.id)"></view>
<view class="action-btn reject-btn" v-if="item.auditStatus === '0'" @click="handleRejectBill(item.id)"></view>
<view class="action-btn cancel-btn" v-if="item.auditStatus === '1'" @click="cancelAudit(item.id)"></view>
</view>
</view>
<view class="card-footer" v-else>
<view class="action-buttons">
<view class="action-btn cancel-btn" v-if="item.cancelStatus === '0' && item.billStatus === '0'" @click="cancelBill(item.id)"></view>
<view class="action-btn voucher-btn" v-if="item.auditStatus === '1' && item.billStatus === '0'" @click="viewVoucher(item)"></view>
@ -210,11 +213,13 @@
<script>
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js';
import { listCkstock, quickOutBill, stockPageList, cancelBill } from '@/api/property.js';
import { listCkstock, quickOutBill, stockPageList, cancelBill, auditBill, rejectBill, cancelAuditBill } from '@/api/property.js';
import { checkPermi } from '@/utils/auth/permission.js';
export default {
data() {
return {
checkPermi,
activeTab: 'form',
receiptForm: {
purpose: '',
@ -238,7 +243,9 @@ export default {
};
},
onLoad() {
if (this.activeTab === 'list') {
if (checkPermi('material_collection_audit')) {
this.activeTab = 'allList';
} else if (this.activeTab === 'list') {
this.refreshList();
}
},
@ -260,9 +267,11 @@ export default {
methods: {
switchToList() {
this.activeTab = 'list';
if (!this.receiptRecords.length) {
this.$refs.paging.reload();
}
this.$refs.paging.reload();
},
switchToAllList() {
this.activeTab = 'allList';
this.$refs.paging.reload();
},
//
getMaterialsList() {
@ -418,6 +427,87 @@ export default {
const statusText = this.getStatusText(item);
return this.statusClassMap[statusText] || this.statusClassMap['__default__'];
},
//
approveBill(id) {
uni.showModal({
title: '审核确认',
content: '确定要审核通过此单据吗?',
confirmText: '确定',
cancelText: '取消',
success: (res) => {
if (res.confirm) {
auditBill(id).then(response => {
if (response.code === 200) {
uni.showToast({
title: '审核通过成功',
icon: 'success'
});
this.$refs.paging.reload();
} else {
uni.showToast({
title: response.message || '审核通过失败',
icon: 'none'
});
}
});
}
}
});
},
//
handleRejectBill(id) {
uni.showModal({
title: '驳回确认',
content: '确定要驳回此单据吗?',
confirmText: '确定',
cancelText: '取消',
success: (res) => {
if (res.confirm) {
rejectBill(id).then(response => {
if (response.code === 200) {
uni.showToast({
title: '单据已驳回',
icon: 'success'
});
this.$refs.paging.reload();
} else {
uni.showToast({
title: response.message || '驳回失败',
icon: 'none'
});
}
});
}
}
});
},
//
cancelAudit(id) {
uni.showModal({
title: '撤销确认',
content: '确定要撤销此单据的审核吗?',
confirmText: '确定',
cancelText: '取消',
success: (res) => {
if (res.confirm) {
cancelAuditBill(id).then(response => {
if (response.code === 200) {
uni.showToast({
title: '撤销审核成功',
icon: 'success'
});
this.$refs.paging.reload();
} else {
uni.showToast({
title: response.message || '撤销审核失败',
icon: 'none'
});
}
});
}
}
});
},
//
cancelBill(id) {
uni.showModal({
@ -482,7 +572,11 @@ export default {
},
//
queryList(pageNo, pageSize) {
stockPageList({ page: pageNo, limit: pageSize, billType: 2 }).then(res => {
const params = { page: pageNo, limit: pageSize, billType: 2 };
if (this.activeTab === 'allList') {
params.uid = '';
}
stockPageList(params).then(res => {
if (res.code === 200) {
const list = res.data.list;
// completez-paging
@ -771,6 +865,16 @@ export default {
background-color: #409EFF;
color: #fff;
}
.approve-btn {
background-color: #52C41A;
color: #fff;
}
.reject-btn {
background-color: #FF4D4F;
color: #fff;
}
}
}
}

Loading…
Cancel
Save