添加采购管理页面详情页, 权限修改

This commit is contained in:
zhengw
2026-02-10 14:33:35 +08:00
parent 62b5fceac5
commit 1d247f1049
28 changed files with 616 additions and 34 deletions

View File

@@ -0,0 +1,9 @@
{
"usingComponents": {
"card-plugin": "/pages/components/card-plugin/card-plugin",
"card-item-plugin": "/pages/components/card-item-plugin/card-item-plugin",
"total-bar-plugin": "/pages/components/total-bar-plugin/total-bar-plugin",
"t-cell": "tdesign-miniprogram/cell/cell"
},
"navigationBarTitleText": "转账单详情"
}

View File

@@ -0,0 +1,118 @@
import { OSSBaseUrl } from '@/utils/config';
import { loginStatusPage, post } from '@/utils/https';
import {
cloneLite,
formatFileSize,
getAuthInfo,
getDataSet,
getFileType,
mediaPreview,
toArray,
toObject,
} from '@/utils/util';
const defaultParams = { head_id: '' };
Page({
/**
* 页面的初始数据
*/
data: {
params: cloneLite(defaultParams) as any,
list: [] as any[],
count: 0,
info: {} as any,
files: [] as any,
detail: [] as any,
},
handleLogin(e: any) {
this.setData({ isLogin: e.detail });
if (e.detail) {
this.init();
}
},
init() {
this.setData({ authInfo: getAuthInfo() });
this.getList();
},
getList() {
this.setData({ params: this.data.params });
const temp = cloneLite(this.data.params);
post('ErpFinance/info', temp).then((res: any) => {
const data = toObject(res.data);
const info = toObject(data.info);
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
this.setData({
detail: toArray(info.rows),
info: info,
});
});
post('ErpFinance/fileList', temp).then((res: any) => {
this.setData({
files: toArray(res.data).map((el) => {
el._file_type = getFileType(el.file_name);
el.file_path = `${OSSBaseUrl}${el.file_path}`;
el._file_size = formatFileSize(el.file_size);
return el;
}),
});
});
},
onPreview(e: any) {
const data = getDataSet(e);
const index = data.index;
const item = this.data.files[index];
if (item._file_type != 'file') {
mediaPreview([item.file_path], item.file_path);
}
},
onPreview2() {
const path = `${OSSBaseUrl}${this.data.info.file_name}`;
// console.log(path);
mediaPreview([path], path);
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { head_id } = options;
this.data.params.head_id = head_id;
loginStatusPage(this);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
});

View File

@@ -0,0 +1,37 @@
<page-plugin isAuth="{{authInfo['SF_FINANCE_TRANSFER_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<total-bar-plugin customStyle="flex-direction: column;">
<card-item-plugin label="单据编号" value="{{info.bill_no}}" />
<card-item-plugin label="单据日期" value="{{info.bill_date}}" />
<!-- <card-item-plugin label="往来单位" value="{{info.crm_name}}" /> -->
<card-item-plugin label="付款账户" value="{{info.account_name}}" />
<card-item-plugin label="实付金额" value="{{info.total_amount}}" />
<card-item-plugin label="备注" value="{{info.comments}}" />
</total-bar-plugin>
<!-- <t-cell title="Excel附件" left-icon="file-excel"
custom-style="padding-left:0;padding-right:0;position: sticky;top: 0;" arrow
bind:tap="onPreview2" /> -->
<t-cell title="附件" left-icon="file"
custom-style="padding-left:0;padding-right:0;position: sticky;top: 0;z-index:1"
bordered="{{false}}" />
<view style="border: 1px solid #ddd;border-radius: 8rpx;padding: 8rpx;">
<block wx:for="{{files}}" wx:key="index">
<t-cell title="{{item.file_name}}" hover="{{item._file_type != 'file'}}"
arrow="{{item._file_type != 'file'}}" bind:tap="onPreview" data-index="{{index}}" />
</block>
</view>
<t-cell wx:if="{{ detail.length }}" title="收款账户明细" left-icon="article" note="{{detail.length}}条"
custom-style="padding-left:0;padding-right:0;position: sticky;top: 0;z-index:1"
bordered="{{false}}" />
<card-plugin wx:for="{{ detail }}" wx:key="detail_id" showAll="1">
<view slot="header">{{ item.account_name }}</view>
<view slot="content">
<card-item-plugin label="金额" value="{{item.item_amount}}" />
<card-item-plugin label="备注" value="{{item.comments}}" />
</view>
</card-plugin>
</page-plugin>

View File

@@ -0,0 +1 @@
/* pages/finance/giroDetail/giroDetail.wxss */