添加页面及附件查看

This commit is contained in:
zhengw
2026-02-04 11:42:19 +08:00
parent 1c0e0b265d
commit e10c7bc537
34 changed files with 817 additions and 68 deletions

View File

@@ -0,0 +1,9 @@
{
"usingComponents": {
"t-cell": "tdesign-miniprogram/cell/cell",
"t-icon": "tdesign-miniprogram/icon/icon",
"t-cell-group": "tdesign-miniprogram/cell-group/cell-group",
"t-image": "tdesign-miniprogram/image/image"
},
"navigationBarTitleText": "附件列表"
}

View File

@@ -0,0 +1,125 @@
import { OSSBaseUrl } from '@/utils/config';
import { loginStatus, post } from '@/utils/https';
import {
formatFileSize,
getAuthInfo,
getDataSet,
getFileType,
mediaPreview,
toArray,
} from '@/utils/util';
Page({
/**
* 页面的初始数据
*/
data: {
order_no: '',
head_id: '',
head_id2: '',
list: [] as any[],
fileIcon: { file: 'file', excel: 'file-excel', pdf: 'file-pdf' },
},
handleLogin(e: any) {
this.setData({ isLogin: e.detail });
if (e.detail) {
this.init();
}
},
init() {
this.setData({ authInfo: getAuthInfo() });
this.getList();
},
formatData(data: any) {
const list = toArray(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;
});
this.setData({ list });
},
getList() {
if (this.data.order_no) {
// 销售订单
post('Orders/getOrderFiles', { order_no: this.data.order_no }).then((res: any) => {
this.formatData(res.files);
});
} else if (this.data.head_id) {
// 仓库采购
post('ErpDepot/fileList', { head_id: this.data.head_id }).then((res: any) => {
this.formatData(res.data);
});
} else if (this.data.head_id2) {
// 财务
post('ErpFinance/fileList', { head_id: this.data.head_id2 }).then((res: any) => {
this.formatData(res.data);
});
}
},
onPreview(e: any) {
const data = getDataSet(e);
const index = data.index;
const item = this.data.list[index];
if (item._file_type != 'file') {
mediaPreview([item.file_path], item.file_path);
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { title, order_no = '', head_id = '', head_id2 = '' } = options || {};
if (title) {
wx.setNavigationBarTitle({ title: decodeURIComponent(title) });
}
this.data.order_no = order_no;
this.data.head_id = head_id;
this.data.head_id2 = head_id2;
this.setData({ loading: true });
loginStatus()
.then(() => {
this.setData({ isLogin: true, loading: false });
this.init();
})
.catch((err) => {
this.setData({ isLogin: false, loading: false });
console.log('调用登录状态请求失败', err);
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
});

View File

@@ -0,0 +1,14 @@
<page-plugin isAuth="{{true}}" loading="{{loading}}" is-login="{{isLogin}}"
bind:handleLogin="handleLogin">
<t-cell-group custom-style="margin: 0">
<block wx:for="{{list}}" wx:key="index">
<t-cell title="{{item.file_name}}" image="{{item._file_type == 'image' ? item.file_path: ''}}"
hover="{{item._file_type != 'file'}}" arrow="{{item._file_type != 'file'}}"
description="{{item._file_size}}" bind:tap="onPreview" data-index="{{index}}">
<block wx:if="{{item._file_type != 'image'}}">
<t-icon slot="left-icon" name="{{fileIcon[item._file_type]}}" color="#999" size="96rpx" />
</block>
</t-cell>
</block>
</t-cell-group>
</page-plugin>

View File

@@ -0,0 +1 @@
/* pages/other/viewAttachment/viewAttachment.wxss */

View File

@@ -118,6 +118,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?head_id2=${
item.head_id
}&title=${encodeURIComponent(`${item.bill_no} 附件`)}`,
});
},
/**
* 生命周期函数--监听页面加载
*/

View File

@@ -45,6 +45,8 @@
<view slot="footer" class="card-plugin-footer">
<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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"

View File

@@ -118,6 +118,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?head_id2=${
item.head_id
}&title=${encodeURIComponent(`${item.bill_no} 附件`)}`,
});
},
/**
* 生命周期函数--监听页面加载
*/

View File

@@ -50,6 +50,8 @@
<view slot="footer" class="card-plugin-footer">
<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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"

View File

@@ -118,6 +118,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?head_id2=${
item.head_id
}&title=${encodeURIComponent(`${item.bill_no} 附件`)}`,
});
},
/**
* 生命周期函数--监听页面加载
*/

View File

@@ -50,6 +50,8 @@
<view slot="footer" class="card-plugin-footer">
<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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"

View File

@@ -167,6 +167,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?order_no=${
item.order_no
}&title=${encodeURIComponent(`${item.order_no} 附件`)}`,
});
},
/**
* 生命周期函数--监听页面加载
*/

View File

@@ -82,6 +82,8 @@
bind:tap="onOrderPay" data-index="{{index}}">收付款</t-button>
<t-button wx:if="{{authInfo['SF_ERP_SALE_ORDERS_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
<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}}"

View File

@@ -0,0 +1,15 @@
{
"usingComponents": {
"search-popup": "/pages/components/search-popup/search-popup",
"card-plugin": "/pages/components/card-plugin/card-plugin",
"card-item-plugin": "/pages/components/card-item-plugin/card-item-plugin",
"option-cell-plugin": "/pages/components/option-cell-plugin/option-cell-plugin",
"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",
"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"
},
"navigationBarTitleText": "原料出库"
}

View File

@@ -0,0 +1,181 @@
import { loginStatus, post } from '@/utils/https';
import {
cloneLite,
getAuthInfo,
getDataSet,
showModal,
sleep,
toArray,
toastSuccess,
toNumber,
} from '@/utils/util';
const defaultParams = { curr_page: 1, page_count: 20, head_type: 8 };
Page({
/**
* 页面的初始数据
*/
data: {
params: cloneLite(defaultParams) as any,
list: [] as any[],
count: 0,
states: [
{ value: '', label: '全部' },
{ value: '1', label: '未审核' },
{ value: '2', label: '已审核' },
],
sort: [{ label: '创建日期', value: 'create_date' }],
},
handleLogin(e: any) {
this.setData({ isLogin: e.detail });
if (e.detail) {
this.init();
}
},
init() {
this.setData({ authInfo: getAuthInfo() });
this.getList();
},
searchChange(e: any) {
const key = getDataSet(e).key;
this.data.params[key] = e.detail.value;
this.setData({ params: this.data.params });
},
searchChange2(e: any) {
const key = getDataSet(e).key;
const val = `${e.detail.value || ''}`.trim();
if (val) {
this.data.params[key] = val;
} else {
delete this.data.params[key];
}
this.setData({ params: this.data.params });
},
onOptionChange(e: any) {
const key = getDataSet(e).key;
this.data.params[key] = e.detail.value;
this.setData({ params: this.data.params });
},
datePickerConfirm(e: any) {
const data = getDataSet(e);
this.data.params[data.key] = e.detail.value;
this.setData({ params: this.data.params });
},
searchOk() {
this.getList(1);
},
searchReset() {
this.data.params = cloneLite(defaultParams);
this.getList(1);
},
onSort(e: any) {
this.data.params.order = e.detail.value;
this.setData({ params: this.data.params });
this.getList(1);
},
paginationChange(e: any) {
this.getList(e.detail.curr_page);
},
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('ErpDepot/depotHeadList', temp).then((res: any) => {
const list = toArray(res.data);
if (list.length == 0 && this.data.params.curr_page > 1) {
this.getList(this.data.params.curr_page - 1);
}
this.setData({
count: toNumber(res.count),
list: list,
});
});
},
onOrderDel(e: any) {
const data = getDataSet(e);
const index = data.index;
const item = this.data.list[index];
showModal({ content: `确认删除 ${item.bill_no}?` }).then(() => {
post('ErpDepot/depotHeadDel', { head_id: item.head_id }).then(() => {
toastSuccess('删除成功');
sleep(() => {
this.getList();
}, 1000);
});
});
},
onViewAttachment(e: any) {
const data = getDataSet(e);
const index = data.index;
const item = this.data.list[index];
wx.navigateTo({
url: `/pages/base/viewAttachment/viewAttachment?head_id=${
item.head_id
}&title=${encodeURIComponent(`${item.bill_no} 附件`)}`,
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(_options) {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({ loading: true });
loginStatus()
.then(() => {
this.setData({ isLogin: true, loading: false });
this.init();
})
.catch((err) => {
this.setData({ isLogin: false, loading: false });
console.log('调用登录状态请求失败', err);
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
});

View File

@@ -0,0 +1,53 @@
<page-plugin isAuth="{{authInfo['SF_ERP_OTHER_OUT_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<search-popup placeholder="输入单据编号" bind:change="searchChange" bind:ok="searchOk"
bind:reset="searchReset" value="{{params.bill_no}}" data-key="bill_no">
<view slot="content">
<search-input label="销售单号" value="{{params.rel_bill_no}}" data-key="rel_bill_no"
bind:change="searchChange2" />
<option-cell-plugin title="单据状态" value="{{params.state || ''}}" bind:change="onOptionChange"
mode="radio" options="{{states}}" data-key="state" />
<date-picker-plugin title="单据开始日期" value="{{params.bill_dateL}}" data-key="bill_dateL"
bind:confirm="datePickerConfirm" />
<date-picker-plugin title="单据结束日期" value="{{params.bill_dateU}}" data-key="bill_dateU"
bind:confirm="datePickerConfirm" />
<!-- <date-picker-plugin title="创建开始日期" value="{{params.create_dateL}}" data-key="create_dateL"
bind:confirm="datePickerConfirm" />
<date-picker-plugin title="创建结束日期" value="{{params.create_dateU}}" data-key="create_dateU"
bind:confirm="datePickerConfirm" /> -->
</view>
</search-popup>
<count-plugin count="{{count}}">
<!-- <sort-plugin options="{{sort}}" bind:ok="onSort" value="{{params.order}}" slot="right" /> -->
</count-plugin>
<empty-plugin wx:if="{{list.length == 0}}" />
<card-plugin wx:for="{{ list }}" wx:key="head_id">
<view slot="header">{{ item.bill_no }}</view>
<view slot="content">
<card-item-plugin label="关联销售单" value="{{item.rel_bill_no}}" />
<card-item-plugin label="单据日期" value="{{item.bill_date}}" />
<card-item-plugin label="操作员">
<view slot="value">
{{item.creator_name}}
<text wx:if="{{item.creator_nick_name}}">({{item.creator_nick_name}})</text>
</view>
</card-item-plugin>
<card-item-plugin label="数量" value="{{item.total_quantity}}" />
<card-item-plugin label="状态" value="{{item.state_name}}" />
<card-item-plugin label="备注" value="{{item.comments}}" />
<card-item-plugin label="创建日期" value="{{item.create_date}}" />
</view>
<view slot="footer" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_ERP_OTHER_OUT_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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
total="{{count}}" bind:change="paginationChange" />
</page-plugin>

View File

@@ -0,0 +1,15 @@
{
"usingComponents": {
"search-popup": "/pages/components/search-popup/search-popup",
"card-plugin": "/pages/components/card-plugin/card-plugin",
"card-item-plugin": "/pages/components/card-item-plugin/card-item-plugin",
"option-cell-plugin": "/pages/components/option-cell-plugin/option-cell-plugin",
"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",
"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"
},
"navigationBarTitleText": "调拨出库"
}

View File

@@ -0,0 +1,181 @@
import { loginStatus, post } from '@/utils/https';
import {
cloneLite,
getAuthInfo,
getDataSet,
showModal,
sleep,
toArray,
toastSuccess,
toNumber,
} from '@/utils/util';
const defaultParams = { curr_page: 1, page_count: 20, head_type: 9 };
Page({
/**
* 页面的初始数据
*/
data: {
params: cloneLite(defaultParams) as any,
list: [] as any[],
count: 0,
states: [
{ value: '', label: '全部' },
{ value: '1', label: '未审核' },
{ value: '2', label: '已审核' },
],
sort: [{ label: '创建日期', value: 'create_date' }],
},
handleLogin(e: any) {
this.setData({ isLogin: e.detail });
if (e.detail) {
this.init();
}
},
init() {
this.setData({ authInfo: getAuthInfo() });
this.getList();
},
searchChange(e: any) {
const key = getDataSet(e).key;
this.data.params[key] = e.detail.value;
this.setData({ params: this.data.params });
},
searchChange2(e: any) {
const key = getDataSet(e).key;
const val = `${e.detail.value || ''}`.trim();
if (val) {
this.data.params[key] = val;
} else {
delete this.data.params[key];
}
this.setData({ params: this.data.params });
},
onOptionChange(e: any) {
const key = getDataSet(e).key;
this.data.params[key] = e.detail.value;
this.setData({ params: this.data.params });
},
datePickerConfirm(e: any) {
const data = getDataSet(e);
this.data.params[data.key] = e.detail.value;
this.setData({ params: this.data.params });
},
searchOk() {
this.getList(1);
},
searchReset() {
this.data.params = cloneLite(defaultParams);
this.getList(1);
},
onSort(e: any) {
this.data.params.order = e.detail.value;
this.setData({ params: this.data.params });
this.getList(1);
},
paginationChange(e: any) {
this.getList(e.detail.curr_page);
},
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('ErpDepot/depotHeadList', temp).then((res: any) => {
const list = toArray(res.data);
if (list.length == 0 && this.data.params.curr_page > 1) {
this.getList(this.data.params.curr_page - 1);
}
this.setData({
count: toNumber(res.count),
list: list,
});
});
},
onOrderDel(e: any) {
const data = getDataSet(e);
const index = data.index;
const item = this.data.list[index];
showModal({ content: `确认删除 ${item.bill_no}?` }).then(() => {
post('ErpDepot/depotHeadDel', { head_id: item.head_id }).then(() => {
toastSuccess('删除成功');
sleep(() => {
this.getList();
}, 1000);
});
});
},
onViewAttachment(e: any) {
const data = getDataSet(e);
const index = data.index;
const item = this.data.list[index];
wx.navigateTo({
url: `/pages/base/viewAttachment/viewAttachment?head_id=${
item.head_id
}&title=${encodeURIComponent(`${item.bill_no} 附件`)}`,
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(_options) {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({ loading: true });
loginStatus()
.then(() => {
this.setData({ isLogin: true, loading: false });
this.init();
})
.catch((err) => {
this.setData({ isLogin: false, loading: false });
console.log('调用登录状态请求失败', err);
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
});

View File

@@ -0,0 +1,50 @@
<page-plugin isAuth="{{authInfo['SF_ERP_TRANSFER_OUT_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<search-popup placeholder="输入单据编号" bind:change="searchChange" bind:ok="searchOk"
bind:reset="searchReset" value="{{params.bill_no}}" data-key="bill_no">
<view slot="content">
<!-- <search-input label="销售单号" value="{{params.rel_bill_no}}" data-key="rel_bill_no"
bind:change="searchChange2" />
<option-cell-plugin title="单据状态" value="{{params.state || ''}}" bind:change="onOptionChange"
mode="radio" options="{{states}}" data-key="state" /> -->
<date-picker-plugin title="单据开始日期" value="{{params.bill_dateL}}" data-key="bill_dateL"
bind:confirm="datePickerConfirm" />
<date-picker-plugin title="单据结束日期" value="{{params.bill_dateU}}" data-key="bill_dateU"
bind:confirm="datePickerConfirm" />
<!-- <date-picker-plugin title="创建开始日期" value="{{params.create_dateL}}" data-key="create_dateL"
bind:confirm="datePickerConfirm" />
<date-picker-plugin title="创建结束日期" value="{{params.create_dateU}}" data-key="create_dateU"
bind:confirm="datePickerConfirm" /> -->
</view>
</search-popup>
<count-plugin count="{{count}}">
<!-- <sort-plugin options="{{sort}}" bind:ok="onSort" value="{{params.order}}" slot="right" /> -->
</count-plugin>
<empty-plugin wx:if="{{list.length == 0}}" />
<card-plugin wx:for="{{ list }}" wx:key="head_id">
<view slot="header">{{ item.bill_no }}</view>
<view slot="content">
<card-item-plugin label="单据日期" value="{{item.bill_date}}" />
<card-item-plugin label="操作员">
<view slot="value">
{{item.creator_name}}
<text wx:if="{{item.creator_nick_name}}">({{item.creator_nick_name}})</text>
</view>
</card-item-plugin>
<card-item-plugin label="数量" value="{{item.total_quantity}}" />
<card-item-plugin label="备注" value="{{item.comments}}" />
<card-item-plugin label="创建日期" value="{{item.create_date}}" />
</view>
<view slot="footer" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_ERP_TRANSFER_OUT_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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
total="{{count}}" bind:change="paginationChange" />
</page-plugin>

View File

@@ -113,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?head_id=${
item.head_id
}&title=${encodeURIComponent(`${item.bill_no} 附件`)}`,
});
},
/**
* 生命周期函数--监听页面加载
*/

View File

@@ -50,6 +50,8 @@
<view slot="footer" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_ERP_PURCHASE_BACK_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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"

View File

@@ -108,6 +108,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?head_id=${
item.head_id
}&title=${encodeURIComponent(`${item.bill_no} 附件`)}`,
});
},
/**
* 生命周期函数--监听页面加载
*/

View File

@@ -51,6 +51,8 @@
<view slot="footer" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_ERP_PURCHASE_STORE_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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"

View File

@@ -111,6 +111,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?head_id=${
item.head_id
}&title=${encodeURIComponent(`${item.bill_no} 附件`)}`,
});
},
/**
* 生命周期函数--监听页面加载
*/

View File

@@ -50,6 +50,8 @@
<view slot="footer" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_ERP_PURCHASE_ORDER_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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"

View File

@@ -111,6 +111,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?head_id=${
item.head_id
}&title=${encodeURIComponent(`${item.bill_no} 附件`)}`,
});
},
/**
* 生命周期函数--监听页面加载
*/

View File

@@ -47,6 +47,8 @@
<view slot="footer" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_ERP_PURCHASE_REQUEST_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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"