添加采购管理页面详情页, 权限修改
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
"date-picker-plugin": "/pages/components/date-picker-plugin/date-picker-plugin",
|
||||
"sort-plugin": "/pages/components/sort-plugin/sort-plugin",
|
||||
"count-plugin": "/pages/components/count-plugin/count-plugin",
|
||||
"select-plugin": "/pages/components/select-plugin/select-plugin",
|
||||
"total-bar-plugin": "/pages/components/total-bar-plugin/total-bar-plugin",
|
||||
"pagination-plugin": "/pages/components/pagination-plugin/pagination-plugin",
|
||||
"search-input": "/pages/components/search-input/search-input"
|
||||
|
||||
@@ -20,12 +20,15 @@ Page({
|
||||
data: {
|
||||
params: cloneLite(defaultParams) as any,
|
||||
list: [] as any[],
|
||||
accounts: [] as any[],
|
||||
crms: [] as any[],
|
||||
count: 0,
|
||||
states: [
|
||||
payType: [
|
||||
{ value: '', label: '全部' },
|
||||
{ value: '1', label: '未审核' },
|
||||
{ value: '2', label: '已审核' },
|
||||
{ value: '1', label: '收入' },
|
||||
{ value: '2', label: '支出' },
|
||||
],
|
||||
payTypeObj: { 1: '收入', 2: '支出' },
|
||||
sort: [{ label: '创建日期', value: 'create_date' }],
|
||||
},
|
||||
handleLogin(e: any) {
|
||||
@@ -37,6 +40,7 @@ Page({
|
||||
init() {
|
||||
this.setData({ authInfo: getAuthInfo() });
|
||||
this.getList();
|
||||
this.getData();
|
||||
},
|
||||
searchChange(e: any) {
|
||||
const key = getDataSet(e).key;
|
||||
@@ -63,21 +67,26 @@ Page({
|
||||
paginationChange(e: any) {
|
||||
this.getList(e.detail.curr_page);
|
||||
},
|
||||
getData() {
|
||||
post('ErpAccount/ajaxList', { state: 1 }).then((res: any) => {
|
||||
const list = toArray(res.data?.list).map((el) => ({
|
||||
label: el.account_name,
|
||||
value: el.account_id,
|
||||
}));
|
||||
this.setData({ accounts: list });
|
||||
});
|
||||
post('ErpCrm/ajaxList').then((res: any) => {
|
||||
const list = toArray(res.data?.list).map((el) => ({
|
||||
label: el.crm_name,
|
||||
value: el.crm_id,
|
||||
}));
|
||||
this.setData({ crms: list });
|
||||
});
|
||||
},
|
||||
getList(curr: number = 1) {
|
||||
this.data.params.curr_page = curr;
|
||||
this.setData({ params: this.data.params });
|
||||
const temp = cloneLite(this.data.params);
|
||||
if (temp.order_step && temp.order_step.length) {
|
||||
temp.order_step = temp.order_step.join(',');
|
||||
} else {
|
||||
delete temp.order_step;
|
||||
}
|
||||
|
||||
if (temp.process_state && temp.process_state.length) {
|
||||
temp.process_state = temp.process_state.join(',');
|
||||
} else {
|
||||
delete temp.process_state;
|
||||
}
|
||||
|
||||
post('ErpAccount/flow', temp).then((res: any) => {
|
||||
const list = toArray(res.data);
|
||||
@@ -104,6 +113,16 @@ Page({
|
||||
});
|
||||
});
|
||||
},
|
||||
onViewAttachment(e: any) {
|
||||
const data = getDataSet(e);
|
||||
const index = data.index;
|
||||
const item = this.data.list[index];
|
||||
wx.navigateTo({
|
||||
url: `/pages/base/viewAttachment/viewAttachment?rel_account_log_id=${
|
||||
item.rel_account_log_id || ''
|
||||
}&rel_bill_no=${item.rel_bill_no}&title=${encodeURIComponent(`${item.rel_bill_no} 附件`)}`,
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
|
||||
@@ -1,23 +1,29 @@
|
||||
<page-plugin isAuth="{{authInfo['SF_FINANCE_TRANSFER_VIEW']}}" loading="{{loading}}"
|
||||
<page-plugin isAuth="{{authInfo['SF_FINANCE_FLOW_VIEW']}}" loading="{{loading}}"
|
||||
is-login="{{isLogin}}" bind:handleLogin="handleLogin">
|
||||
<search-popup placeholder="输入单据编号" bind:change="searchChange" bind:ok="searchOk"
|
||||
bind:reset="searchReset" value="{{params.rel_bill_no}}" data-key="rel_bill_no">
|
||||
<view slot="content">
|
||||
|
||||
<!-- <search-input label="付款账户" value="{{params.account_name}}" data-key="account_name"
|
||||
bind:change="searchChange" /> -->
|
||||
<search-input label="业务类型" value="{{params.type}}" data-key="type"
|
||||
bind:change="searchChange" />
|
||||
|
||||
<!-- <option-cell-plugin title="单据状态" value="{{params.state || ''}}" bind:change="searchChange"
|
||||
mode="radio" options="{{states}}" data-key="state" /> -->
|
||||
<option-cell-plugin title="收支类型" value="{{params.pay_type || ''}}" bind:change="searchChange"
|
||||
mode="radio" options="{{payType}}" data-key="pay_type" />
|
||||
|
||||
<select-plugin title="账户" options="{{accounts}}" value="{{params.account_id}}"
|
||||
bind:change="searchChange" data-key="account_id" />
|
||||
|
||||
<select-plugin title="往来单位" options="{{crms}}" value="{{params.crm_id}}"
|
||||
bind:change="searchChange" data-key="crm_id" />
|
||||
|
||||
<date-picker-plugin title="交易开始日期" value="{{params.pay_dateL}}" data-key="pay_dateL"
|
||||
bind:confirm="searchChange" />
|
||||
<date-picker-plugin title="交易结束日期" value="{{params.pay_dateU}}" data-key="pay_dateU"
|
||||
bind:confirm="searchChange" />
|
||||
<!-- <date-picker-plugin title="创建开始日期" value="{{params.create_dateL}}" data-key="create_dateL"
|
||||
<date-picker-plugin title="创建开始日期" value="{{params.create_dateL}}" data-key="create_dateL"
|
||||
bind:confirm="searchChange" />
|
||||
<date-picker-plugin title="创建结束日期" value="{{params.create_dateU}}" data-key="create_dateU"
|
||||
bind:confirm="searchChange" /> -->
|
||||
bind:confirm="searchChange" />
|
||||
</view>
|
||||
</search-popup>
|
||||
|
||||
@@ -27,11 +33,14 @@
|
||||
|
||||
<empty-plugin wx:if="{{list.length == 0}}" />
|
||||
<card-plugin wx:for="{{ list }}" wx:key="account_log_id">
|
||||
<view slot="header">{{ item.rel_bill_no }}</view>
|
||||
<view slot="header" style="display: flex;justify-content: space-between;width: 100%;">
|
||||
<view>{{ item.rel_bill_no }}</view>
|
||||
<view style="font-weight: normal;">{{item.type}}</view>
|
||||
</view>
|
||||
<view slot="content">
|
||||
<card-item-plugin label="业务类型" value="{{item.type}}" />
|
||||
<!-- <card-item-plugin label="业务类型" value="{{item.type}}" /> -->
|
||||
<card-item-plugin label="账户" value="{{item.account_name}}" />
|
||||
<card-item-plugin label="收支类型" value="{{item.pay_type}}" />
|
||||
<card-item-plugin label="收支类型" value="{{payTypeObj[item.pay_type]}}" />
|
||||
<card-item-plugin label="变更金额" value="{{item.amount}}" />
|
||||
<card-item-plugin label="变更前" value="{{item.before}}" />
|
||||
<card-item-plugin label="剩余金额" value="{{item.after}}" />
|
||||
@@ -45,6 +54,10 @@
|
||||
<card-item-plugin label="交易时间" value="{{item.pay_date}}" />
|
||||
<card-item-plugin label="创建日期" value="{{item.create_date}}" />
|
||||
</view>
|
||||
<view slot="footer" class="card-plugin-footer">
|
||||
<t-button wx:if="{{item.file_cnt}}" size="small" bind:tap="onViewAttachment"
|
||||
data-index="{{index}}">附件({{item.file_cnt}})</t-button>
|
||||
</view>
|
||||
</card-plugin>
|
||||
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
|
||||
total="{{count}}" bind:change="paginationChange" />
|
||||
|
||||
@@ -90,7 +90,14 @@ Page({
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onOrderDetail(e: any) {
|
||||
const data = getDataSet(e);
|
||||
const index = data.index;
|
||||
const item = this.data.list[index];
|
||||
wx.navigateTo({
|
||||
url: `/pages/finance/giroDetail/giroDetail?head_id=${item.head_id}`,
|
||||
});
|
||||
},
|
||||
onOrderDel(e: any) {
|
||||
const data = getDataSet(e);
|
||||
const index = data.index;
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
<card-item-plugin label="创建日期" value="{{item.create_date}}" />
|
||||
</view>
|
||||
<view slot="footer" class="card-plugin-footer">
|
||||
<t-button size="small" theme="primary" bind:tap="onOrderDetail" data-index="{{index}}">详情
|
||||
</t-button>
|
||||
<t-button wx:if="{{authInfo['SF_FINANCE_TRANSFER_DEL']}}" size="small" theme="danger"
|
||||
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
|
||||
<t-button wx:if="{{item.total_att}}" size="small" bind:tap="onViewAttachment"
|
||||
|
||||
9
miniprogram/pages/finance/giroDetail/giroDetail.json
Normal file
9
miniprogram/pages/finance/giroDetail/giroDetail.json
Normal 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": "转账单详情"
|
||||
}
|
||||
118
miniprogram/pages/finance/giroDetail/giroDetail.ts
Normal file
118
miniprogram/pages/finance/giroDetail/giroDetail.ts
Normal 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() {},
|
||||
});
|
||||
37
miniprogram/pages/finance/giroDetail/giroDetail.wxml
Normal file
37
miniprogram/pages/finance/giroDetail/giroDetail.wxml
Normal 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>
|
||||
1
miniprogram/pages/finance/giroDetail/giroDetail.wxss
Normal file
1
miniprogram/pages/finance/giroDetail/giroDetail.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* pages/finance/giroDetail/giroDetail.wxss */
|
||||
@@ -90,7 +90,14 @@ Page({
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onOrderDetail(e: any) {
|
||||
const data = getDataSet(e);
|
||||
const index = data.index;
|
||||
const item = this.data.list[index];
|
||||
wx.navigateTo({
|
||||
url: `/pages/finance/incomeDetail/incomeDetail?head_id=${item.head_id}`,
|
||||
});
|
||||
},
|
||||
onOrderDel(e: any) {
|
||||
const data = getDataSet(e);
|
||||
const index = data.index;
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
<card-item-plugin label="创建日期" value="{{item.create_date}}" />
|
||||
</view>
|
||||
<view slot="footer" class="card-plugin-footer">
|
||||
<t-button size="small" theme="primary" bind:tap="onOrderDetail" data-index="{{index}}">详情
|
||||
</t-button>
|
||||
<t-button wx:if="{{authInfo['SF_FINANCE_INCOME_DEL']}}" size="small" theme="danger"
|
||||
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
|
||||
<t-button wx:if="{{item.total_att}}" size="small" bind:tap="onViewAttachment"
|
||||
|
||||
9
miniprogram/pages/finance/incomeDetail/incomeDetail.json
Normal file
9
miniprogram/pages/finance/incomeDetail/incomeDetail.json
Normal 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": "收入单详情"
|
||||
}
|
||||
118
miniprogram/pages/finance/incomeDetail/incomeDetail.ts
Normal file
118
miniprogram/pages/finance/incomeDetail/incomeDetail.ts
Normal 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() {},
|
||||
});
|
||||
37
miniprogram/pages/finance/incomeDetail/incomeDetail.wxml
Normal file
37
miniprogram/pages/finance/incomeDetail/incomeDetail.wxml
Normal file
@@ -0,0 +1,37 @@
|
||||
<page-plugin isAuth="{{authInfo['SF_FINANCE_INCOME_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.finance_item_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>
|
||||
@@ -90,7 +90,14 @@ Page({
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onOrderDetail(e: any) {
|
||||
const data = getDataSet(e);
|
||||
const index = data.index;
|
||||
const item = this.data.list[index];
|
||||
wx.navigateTo({
|
||||
url: `/pages/finance/outcomeDetail/outcomeDetail?head_id=${item.head_id}`,
|
||||
});
|
||||
},
|
||||
onOrderDel(e: any) {
|
||||
const data = getDataSet(e);
|
||||
const index = data.index;
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
<card-item-plugin label="创建日期" value="{{item.create_date}}" />
|
||||
</view>
|
||||
<view slot="footer" class="card-plugin-footer">
|
||||
<t-button size="small" theme="primary" bind:tap="onOrderDetail" data-index="{{index}}">详情
|
||||
</t-button>
|
||||
<t-button wx:if="{{authInfo['SF_FINANCE_OUTCOME_DEL']}}" size="small" theme="danger"
|
||||
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
|
||||
<t-button wx:if="{{item.total_att}}" size="small" bind:tap="onViewAttachment"
|
||||
|
||||
@@ -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": "支出单详情"
|
||||
}
|
||||
118
miniprogram/pages/finance/outcomeDetail/outcomeDetail.ts
Normal file
118
miniprogram/pages/finance/outcomeDetail/outcomeDetail.ts
Normal 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() {},
|
||||
});
|
||||
37
miniprogram/pages/finance/outcomeDetail/outcomeDetail.wxml
Normal file
37
miniprogram/pages/finance/outcomeDetail/outcomeDetail.wxml
Normal file
@@ -0,0 +1,37 @@
|
||||
<page-plugin isAuth="{{authInfo['SF_FINANCE_OUTCOME_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.finance_item_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>
|
||||
Reference in New Issue
Block a user