|
|
|
@ -3,6 +3,14 @@
|
|
|
|
<template #top>
|
|
|
|
<template #top>
|
|
|
|
<!-- 顶部标签:我要领用 / 领用记录 -->
|
|
|
|
<!-- 顶部标签:我要领用 / 领用记录 -->
|
|
|
|
<view class="tabs">
|
|
|
|
<view class="tabs">
|
|
|
|
|
|
|
|
<view
|
|
|
|
|
|
|
|
class="tab"
|
|
|
|
|
|
|
|
v-if="checkPermi('material_collection_audit')"
|
|
|
|
|
|
|
|
:class="activeTab === 'allList' ? 'active' : ''"
|
|
|
|
|
|
|
|
@click="switchToAllList"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
领用审核
|
|
|
|
|
|
|
|
</view>
|
|
|
|
<view
|
|
|
|
<view
|
|
|
|
class="tab"
|
|
|
|
class="tab"
|
|
|
|
:class="activeTab === 'form' ? 'active' : ''"
|
|
|
|
:class="activeTab === 'form' ? 'active' : ''"
|
|
|
|
@ -114,7 +122,7 @@
|
|
|
|
</uni-popup>
|
|
|
|
</uni-popup>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 列表区域 -->
|
|
|
|
<!-- 列表区域 -->
|
|
|
|
<view class="tab-content" v-show="activeTab === 'list'">
|
|
|
|
<view class="tab-content" v-show="activeTab === 'allList' || activeTab === 'list'">
|
|
|
|
<view
|
|
|
|
<view
|
|
|
|
class="record-card"
|
|
|
|
class="record-card"
|
|
|
|
v-for="item in receiptRecords"
|
|
|
|
v-for="item in receiptRecords"
|
|
|
|
@ -153,18 +161,6 @@
|
|
|
|
{{ item.remark || '—' }}
|
|
|
|
{{ item.remark || '—' }}
|
|
|
|
</text>
|
|
|
|
</text>
|
|
|
|
</view>
|
|
|
|
</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">
|
|
|
|
<view class="row" v-if="item.ckBillCargos && item.ckBillCargos.length > 0">
|
|
|
|
<text class="label">领用物资</text>
|
|
|
|
<text class="label">领用物资</text>
|
|
|
|
<text class="value">
|
|
|
|
<text class="value">
|
|
|
|
@ -175,7 +171,14 @@
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</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-buttons">
|
|
|
|
<view class="action-btn cancel-btn" v-if="item.cancelStatus === '0' && item.billStatus === '0'" @click="cancelBill(item.id)">取消单据</view>
|
|
|
|
<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>
|
|
|
|
<view class="action-btn voucher-btn" v-if="item.auditStatus === '1' && item.billStatus === '0'" @click="viewVoucher(item)">查看凭证</view>
|
|
|
|
@ -210,11 +213,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js';
|
|
|
|
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 {
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
|
|
|
|
checkPermi,
|
|
|
|
activeTab: 'form',
|
|
|
|
activeTab: 'form',
|
|
|
|
receiptForm: {
|
|
|
|
receiptForm: {
|
|
|
|
purpose: '',
|
|
|
|
purpose: '',
|
|
|
|
@ -238,7 +243,9 @@ export default {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onLoad() {
|
|
|
|
onLoad() {
|
|
|
|
if (this.activeTab === 'list') {
|
|
|
|
if (checkPermi('material_collection_audit')) {
|
|
|
|
|
|
|
|
this.activeTab = 'allList';
|
|
|
|
|
|
|
|
} else if (this.activeTab === 'list') {
|
|
|
|
this.refreshList();
|
|
|
|
this.refreshList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
@ -260,9 +267,11 @@ export default {
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
switchToList() {
|
|
|
|
switchToList() {
|
|
|
|
this.activeTab = 'list';
|
|
|
|
this.activeTab = 'list';
|
|
|
|
if (!this.receiptRecords.length) {
|
|
|
|
this.$refs.paging.reload();
|
|
|
|
this.$refs.paging.reload();
|
|
|
|
},
|
|
|
|
}
|
|
|
|
switchToAllList() {
|
|
|
|
|
|
|
|
this.activeTab = 'allList';
|
|
|
|
|
|
|
|
this.$refs.paging.reload();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 获取物资列表
|
|
|
|
// 获取物资列表
|
|
|
|
getMaterialsList() {
|
|
|
|
getMaterialsList() {
|
|
|
|
@ -418,6 +427,87 @@ export default {
|
|
|
|
const statusText = this.getStatusText(item);
|
|
|
|
const statusText = this.getStatusText(item);
|
|
|
|
return this.statusClassMap[statusText] || this.statusClassMap['__default__'];
|
|
|
|
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) {
|
|
|
|
cancelBill(id) {
|
|
|
|
uni.showModal({
|
|
|
|
uni.showModal({
|
|
|
|
@ -482,7 +572,11 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 获取领用记录列表
|
|
|
|
// 获取领用记录列表
|
|
|
|
queryList(pageNo, pageSize) {
|
|
|
|
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) {
|
|
|
|
if (res.code === 200) {
|
|
|
|
const list = res.data.list;
|
|
|
|
const list = res.data.list;
|
|
|
|
// 将请求结果通过complete传给z-paging处理
|
|
|
|
// 将请求结果通过complete传给z-paging处理
|
|
|
|
@ -771,6 +865,16 @@ export default {
|
|
|
|
background-color: #409EFF;
|
|
|
|
background-color: #409EFF;
|
|
|
|
color: #fff;
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.approve-btn {
|
|
|
|
|
|
|
|
background-color: #52C41A;
|
|
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.reject-btn {
|
|
|
|
|
|
|
|
background-color: #FF4D4F;
|
|
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|