添加采购和仓库订单详情页面

This commit is contained in:
zhengw
2026-02-10 10:47:00 +08:00
parent 81acde261f
commit 62b5fceac5
30 changed files with 787 additions and 22 deletions

View File

@@ -112,6 +112,21 @@
"size": { "type": "String" } "size": { "type": "String" }
} }
}, },
"t-cell": {
"description": "图标",
"attributes": {
"custom-style": { "type": "String" },
"description": { "type": "String" },
"image": { "type": "String" },
"left-icon": { "type": "String" },
"note": { "type": "String" },
"right-icon": { "type": "String" },
"title": { "type": "String" },
"arrow": { "type": "Boolean" },
"bordered": { "type": "Boolean" },
"hover": { "type": "Boolean" }
}
},
"search-input": { "search-input": {
"description": "搜索input", "description": "搜索input",
"attributes": { "attributes": {

View File

@@ -16,11 +16,13 @@
"pages/purchase/buyOrder/buyOrder", "pages/purchase/buyOrder/buyOrder",
"pages/purchase/buyOrderDetail/buyOrderDetail", "pages/purchase/buyOrderDetail/buyOrderDetail",
"pages/purchase/buyInOrder/buyInOrder", "pages/purchase/buyInOrder/buyInOrder",
"pages/purchase/buyInOrderDetail/buyInOrderDetail",
"pages/purchase/backOrder/backOrder",
"pages/purchase/backOrderDetail/backOrderDetail",
"pages/finance/outcome/outcome", "pages/finance/outcome/outcome",
"pages/finance/income/income", "pages/finance/income/income",
"pages/finance/giro/giro", "pages/finance/giro/giro",
"pages/finance/flow/flow", "pages/finance/flow/flow",
"pages/purchase/backOrder/backOrder",
"pages/base/supplier/supplier", "pages/base/supplier/supplier",
"pages/base/customer/customer", "pages/base/customer/customer",
"pages/base/account/account", "pages/base/account/account",
@@ -31,13 +33,15 @@
"pages/logs/loginLog/loginLog", "pages/logs/loginLog/loginLog",
"pages/logs/operateLog/operateLog", "pages/logs/operateLog/operateLog",
"pages/manage/staff/staff", "pages/manage/staff/staff",
"pages/other/transfer/transfer",
"pages/other/goods/goods", "pages/other/goods/goods",
"pages/other/goodsDetail/goodsDetail", "pages/other/goodsDetail/goodsDetail",
"pages/other/batch/batch", "pages/other/batch/batch",
"pages/other/batchDetail/batchDetail", "pages/other/batchDetail/batchDetail",
"pages/base/viewAttachment/viewAttachment", "pages/base/viewAttachment/viewAttachment",
"pages/other/outbound/outbound" "pages/other/outbound/outbound",
"pages/other/outboundDetail/outboundDetail",
"pages/other/transfer/transfer",
"pages/other/transferDetail/transferDetail"
], ],
"window": { "window": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",

View File

@@ -20,7 +20,9 @@
bind:tap="onPreview2" /> bind:tap="onPreview2" />
<t-cell title="附件" left-icon="file" <t-cell title="附件" left-icon="file"
custom-style="padding-left:0;padding-right:0;position: sticky;top: 0;z-index:1" /> 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;"> <view style="border: 1px solid #ddd;border-radius: 8rpx;padding: 8rpx;">
<block wx:for="{{files}}" wx:key="index"> <block wx:for="{{files}}" wx:key="index">
<t-cell title="{{item.file_name}}" hover="{{item._file_type != 'file'}}" <t-cell title="{{item.file_name}}" hover="{{item._file_type != 'file'}}"
@@ -33,7 +35,8 @@
</view> </view>
<t-cell wx:if="{{ detail.length }}" title="订单明细" left-icon="article" note="{{detail.length}}条" <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" /> 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"> <card-plugin wx:for="{{ detail }}" wx:key="detail_id">
<view slot="header">{{ item.goods_name }}</view> <view slot="header">{{ item.goods_name }}</view>
<view slot="content"> <view slot="content">

View File

@@ -1,7 +1,7 @@
<page-plugin isAuth="{{authInfo['SF_ERP_GOODS_BATCH_VIEW']}}" loading="{{loading}}" <page-plugin isAuth="{{authInfo['SF_ERP_GOODS_BATCH_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin"> is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<search-popup placeholder="输入单据编号" bind:change="searchChange" bind:ok="searchOk" <search-popup placeholder="输入单据编号" bind:change="searchChange" bind:ok="searchOk"
bind:reset="searchReset" value="{{params.rel_bill_no}}" data-key="rel_bill_no"> bind:reset="searchReset" value="{{params.rel_bill_no}}" data-key="rel_bill_no" hideMore="1">
</search-popup> </search-popup>
<count-plugin count="{{count}}"> <count-plugin count="{{count}}">

View File

@@ -91,7 +91,14 @@ Page({
}); });
}); });
}, },
onOrderDetail(e: any) {
const data = getDataSet(e);
const index = data.index;
const item = this.data.list[index];
wx.navigateTo({
url: `/pages/other/outboundDetail/outboundDetail?head_id=${item.head_id}`,
});
},
onOrderDel(e: any) { onOrderDel(e: any) {
const data = getDataSet(e); const data = getDataSet(e);
const index = data.index; const index = data.index;

View File

@@ -42,6 +42,8 @@
<card-item-plugin label="创建日期" value="{{item.create_date}}" /> <card-item-plugin label="创建日期" value="{{item.create_date}}" />
</view> </view>
<view slot="footer" class="card-plugin-footer"> <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_ERP_OTHER_OUT_DEL']}}" size="small" theme="danger" <t-button wx:if="{{authInfo['SF_ERP_OTHER_OUT_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button> bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
<t-button wx:if="{{item.total_att}}" size="small" bind:tap="onViewAttachment" <t-button wx:if="{{item.total_att}}" size="small" bind:tap="onViewAttachment"

View File

@@ -0,0 +1,16 @@
{
"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",
"t-cell": "tdesign-miniprogram/cell/cell",
"search-input": "/pages/components/search-input/search-input"
},
"navigationBarTitleText": "原料出库详情"
}

View File

@@ -0,0 +1,113 @@
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('ErpDepot/info', temp).then((res: any) => {
const info = toObject(res.info);
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
this.setData({
files: toArray(res.files).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;
}),
detail: toArray(res.rows),
info: info,
});
});
},
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,40 @@
<page-plugin isAuth="{{authInfo['SF_ERP_PURCHASE_STORE_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.rel_bill_no}}" />
<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="item_id">
<view slot="header">{{ item.goods_name }}</view>
<view slot="content">
<card-item-plugin label="仓库" value="{{item.depot_name}}" />
<card-item-plugin label="编码" value="{{item.goods_code}}" />
<card-item-plugin label="属性" value="{{item.attr_name}}" />
<card-item-plugin label="批号" value="{{item.batch_no}}" />
<card-item-plugin label="数量" value="{{item.item_quantity}}{{item.goods_unit}}" />
<!-- <card-item-plugin label="单位" value="{{item.goods_unit}}" /> -->
<card-item-plugin label="备注" value="{{item.comments}}" />
</view>
</card-plugin>
</page-plugin>

View File

@@ -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/other/transferDetail/transferDetail?head_id=${item.head_id}`,
});
},
onOrderDel(e: any) { onOrderDel(e: any) {
const data = getDataSet(e); const data = getDataSet(e);
const index = data.index; const index = data.index;

View File

@@ -39,6 +39,8 @@
<card-item-plugin label="创建日期" value="{{item.create_date}}" /> <card-item-plugin label="创建日期" value="{{item.create_date}}" />
</view> </view>
<view slot="footer" class="card-plugin-footer"> <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_ERP_TRANSFER_OUT_DEL']}}" size="small" theme="danger" <t-button wx:if="{{authInfo['SF_ERP_TRANSFER_OUT_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button> bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
<t-button wx:if="{{item.total_att}}" size="small" bind:tap="onViewAttachment" <t-button wx:if="{{item.total_att}}" size="small" bind:tap="onViewAttachment"

View File

@@ -0,0 +1,16 @@
{
"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",
"t-cell": "tdesign-miniprogram/cell/cell",
"search-input": "/pages/components/search-input/search-input"
},
"navigationBarTitleText": "调拨出库详情"
}

View File

@@ -0,0 +1,113 @@
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('ErpDepot/info', temp).then((res: any) => {
const info = toObject(res.info);
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
this.setData({
files: toArray(res.files).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;
}),
detail: toArray(res.rows),
info: info,
});
});
},
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,42 @@
<page-plugin isAuth="{{authInfo['SF_ERP_PURCHASE_STORE_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.rel_bill_no}}" /> -->
<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="item_id">
<view slot="header">{{ item.goods_name }}</view>
<view slot="content">
<card-item-plugin label="仓库" value="{{item.depot_name}}" />
<card-item-plugin label="编码" value="{{item.goods_code}}" />
<card-item-plugin label="属性" value="{{item.attr_name}}" />
<card-item-plugin label="调入仓库" value="{{item.to_depot_name}}" />
<card-item-plugin label="数量" value="{{item.item_quantity}}{{item.goods_unit}}" />
<card-item-plugin label="单价" value="{{item.item_price}}" />
<card-item-plugin label="金额" value="{{item.all_price}}" />
<card-item-plugin label="备注" value="{{item.comments}}" />
</view>
</card-plugin>
</page-plugin>

View File

@@ -99,6 +99,14 @@ Page({
}); });
}); });
}, },
onOrderDetail(e: any) {
const data = getDataSet(e);
const index = data.index;
const item = this.data.list[index];
wx.navigateTo({
url: `/pages/purchase/backOrderDetail/backOrderDetail?head_id=${item.head_id}`,
});
},
onViewAttachment(e: any) { onViewAttachment(e: any) {
const data = getDataSet(e); const data = getDataSet(e);
const index = data.index; const index = data.index;

View File

@@ -48,6 +48,8 @@
<card-item-plugin label="创建日期" value="{{item.create_date}}" /> <card-item-plugin label="创建日期" value="{{item.create_date}}" />
</view> </view>
<view slot="footer" class="card-plugin-footer"> <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_ERP_PURCHASE_BACK_DEL']}}" size="small" theme="danger" <t-button wx:if="{{authInfo['SF_ERP_PURCHASE_BACK_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button> bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
<t-button wx:if="{{item.total_att}}" size="small" bind:tap="onViewAttachment" <t-button wx:if="{{item.total_att}}" size="small" bind:tap="onViewAttachment"

View File

@@ -0,0 +1,16 @@
{
"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",
"t-cell": "tdesign-miniprogram/cell/cell",
"search-input": "/pages/components/search-input/search-input"
},
"navigationBarTitleText": "采购退货详情"
}

View File

@@ -0,0 +1,113 @@
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('ErpDepot/info', temp).then((res: any) => {
const info = toObject(res.info);
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
this.setData({
files: toArray(res.files).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;
}),
detail: toArray(res.rows),
info: info,
});
});
},
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,50 @@
<page-plugin isAuth="{{authInfo['SF_ERP_PURCHASE_STORE_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<total-bar-plugin customStyle="flex-direction: column;">
<card-item-plugin label="供应商" value="{{info.crm_name}}" />
<card-item-plugin label="单据编号" value="{{info.bill_no}}" />
<card-item-plugin label="单据日期" value="{{info.bill_date}}" />
<card-item-plugin label="关联单据" value="{{info.rel_bill_no}}" />
<card-item-plugin label="单据金额" value="{{info.total_amount}}" />
<card-item-plugin label="优惠金额" value="{{info.discount_amount}}" />
<card-item-plugin label="结算金额" value="{{info.total_real_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="item_id">
<view slot="header">{{ item.goods_name }}</view>
<view slot="content">
<card-item-plugin label="仓库" value="{{item.depot_name}}" />
<card-item-plugin label="编码" value="{{item.goods_code}}" />
<card-item-plugin label="属性" value="{{item.attr_name}}" />
<card-item-plugin label="批号" value="{{item.batch_no}}" />
<card-item-plugin label="数量" value="{{item.item_quantity}}{{item.goods_unit}}" />
<!-- <card-item-plugin label="单位" value="{{item.goods_unit}}" /> -->
<card-item-plugin label="单价" value="{{item.item_price}}" />
<card-item-plugin label="金额" value="{{item.all_price}}" />
<card-item-plugin label="税率" value="{{item.tax_rate}}%" />
<card-item-plugin label="税额" value="{{item.tax_money}}" />
<card-item-plugin label="价税合计" value="{{item.tax_last_money}}" />
<card-item-plugin label="备注" value="{{item.comments}}" />
</view>
</card-plugin>
</page-plugin>

View File

@@ -95,6 +95,14 @@ Page({
}); });
}); });
}, },
onOrderDetail(e: any) {
const data = getDataSet(e);
const index = data.index;
const item = this.data.list[index];
wx.navigateTo({
url: `/pages/purchase/buyInOrderDetail/buyInOrderDetail?head_id=${item.head_id}`,
});
},
onViewAttachment(e: any) { onViewAttachment(e: any) {
const data = getDataSet(e); const data = getDataSet(e);
const index = data.index; const index = data.index;

View File

@@ -48,6 +48,8 @@
<card-item-plugin label="创建日期" value="{{item.create_date}}" /> <card-item-plugin label="创建日期" value="{{item.create_date}}" />
</view> </view>
<view slot="footer" class="card-plugin-footer"> <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_ERP_PURCHASE_STORE_DEL']}}" size="small" theme="danger" <t-button wx:if="{{authInfo['SF_ERP_PURCHASE_STORE_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button> bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
<t-button wx:if="{{item.total_att}}" size="small" bind:tap="onViewAttachment" <t-button wx:if="{{item.total_att}}" size="small" bind:tap="onViewAttachment"

View File

@@ -0,0 +1,16 @@
{
"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",
"t-cell": "tdesign-miniprogram/cell/cell",
"search-input": "/pages/components/search-input/search-input"
},
"navigationBarTitleText": "采购入库详情"
}

View File

@@ -0,0 +1,113 @@
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('ErpDepot/info', temp).then((res: any) => {
const info = toObject(res.info);
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
this.setData({
files: toArray(res.files).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;
}),
detail: toArray(res.rows),
info: info,
});
});
},
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,49 @@
<page-plugin isAuth="{{authInfo['SF_ERP_PURCHASE_STORE_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<total-bar-plugin customStyle="flex-direction: column;">
<card-item-plugin label="供应商" value="{{info.crm_name}}" />
<card-item-plugin label="单据编号" value="{{info.bill_no}}" />
<card-item-plugin label="单据日期" value="{{info.bill_date}}" />
<card-item-plugin label="关联单据" value="{{info.rel_bill_no}}" />
<card-item-plugin label="单据金额" value="{{info.total_amount}}" />
<card-item-plugin label="优惠金额" value="{{info.discount_amount}}" />
<card-item-plugin label="结算金额" value="{{info.total_real_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="item_id">
<view slot="header">{{ item.goods_name }}</view>
<view slot="content">
<card-item-plugin label="仓库" value="{{item.depot_name}}" />
<card-item-plugin label="编码" value="{{item.goods_code}}" />
<card-item-plugin label="属性" value="{{item.attr_name}}" />
<card-item-plugin label="批号" value="{{item.batch_no}}" />
<card-item-plugin label="数量" value="{{item.item_quantity}}{{item.goods_unit}}" />
<!-- <card-item-plugin label="单位" value="{{item.goods_unit}}" /> -->
<card-item-plugin label="单价" value="{{item.item_price}}" />
<card-item-plugin label="金额" value="{{item.all_price}}" />
<card-item-plugin label="税率" value="{{item.tax_rate}}%" />
<card-item-plugin label="税额" value="{{item.tax_money}}" />
<card-item-plugin label="价税合计" value="{{item.tax_last_money}}" />
<card-item-plugin label="备注" value="{{item.comments}}" />
</view>
</card-plugin>
</page-plugin>

View File

@@ -1,4 +1,4 @@
<page-plugin isAuth="{{authInfo['SF_ERP_SALE_ORDERS_VIEW']}}" loading="{{loading}}" <page-plugin isAuth="{{authInfo['SF_ERP_PURCHASE_ORDER_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin"> is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<total-bar-plugin customStyle="flex-direction: column;"> <total-bar-plugin customStyle="flex-direction: column;">
@@ -6,6 +6,9 @@
<card-item-plugin label="单据编号" value="{{info.bill_no}}" /> <card-item-plugin label="单据编号" value="{{info.bill_no}}" />
<card-item-plugin label="单据日期" value="{{info.bill_date}}" /> <card-item-plugin label="单据日期" value="{{info.bill_date}}" />
<card-item-plugin label="关联单据" value="{{info.rel_bill_no}}" /> <card-item-plugin label="关联单据" value="{{info.rel_bill_no}}" />
<card-item-plugin label="单据金额" value="{{info.total_amount}}" />
<card-item-plugin label="优惠金额" value="{{info.discount_amount}}" />
<card-item-plugin label="结算金额" value="{{info.total_real_amount}}" />
<card-item-plugin label="备注" value="{{info.comments}}" /> <card-item-plugin label="备注" value="{{info.comments}}" />
</total-bar-plugin> </total-bar-plugin>
@@ -14,7 +17,9 @@
bind:tap="onPreview2" /> bind:tap="onPreview2" />
<t-cell title="附件" left-icon="file" <t-cell title="附件" left-icon="file"
custom-style="padding-left:0;padding-right:0;position: sticky;top: 0;z-index:1" /> 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;"> <view style="border: 1px solid #ddd;border-radius: 8rpx;padding: 8rpx;">
<block wx:for="{{files}}" wx:key="index"> <block wx:for="{{files}}" wx:key="index">
<t-cell title="{{item.file_name}}" hover="{{item._file_type != 'file'}}" <t-cell title="{{item.file_name}}" hover="{{item._file_type != 'file'}}"
@@ -23,14 +28,15 @@
</view> </view>
<t-cell wx:if="{{ detail.length }}" title="订单明细" left-icon="article" note="{{detail.length}}条" <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" /> custom-style="padding-left:0;padding-right:0;position: sticky;top: 0;z-index:1"
<card-plugin wx:for="{{ detail }}" wx:key="detail_id"> bordered="{{false}}" />
<card-plugin wx:for="{{ detail }}" wx:key="item_id">
<view slot="header">{{ item.goods_name }}</view> <view slot="header">{{ item.goods_name }}</view>
<view slot="content"> <view slot="content">
<card-item-plugin label="编码" value="{{item.goods_code}}" /> <card-item-plugin label="编码" value="{{item.goods_code}}" />
<card-item-plugin label="属性" value="{{item.attr_name}}" /> <card-item-plugin label="属性" value="{{item.attr_name}}" />
<card-item-plugin label="数量" value="{{item.item_quantity}}" /> <card-item-plugin label="数量" value="{{item.item_quantity}}{{item.goods_unit}}" />
<card-item-plugin label="单位" value="{{item.goods_unit}}" /> <!-- <card-item-plugin label="单位" value="{{item.goods_unit}}" /> -->
<card-item-plugin label="单价" value="{{item.item_price}}" /> <card-item-plugin label="单价" value="{{item.item_price}}" />
<card-item-plugin label="金额" value="{{item.all_price}}" /> <card-item-plugin label="金额" value="{{item.all_price}}" />
<card-item-plugin label="税率" value="{{item.tax_rate}}%" /> <card-item-plugin label="税率" value="{{item.tax_rate}}%" />

View File

@@ -1,4 +1,4 @@
<page-plugin isAuth="{{authInfo['SF_ERP_SALE_ORDERS_VIEW']}}" loading="{{loading}}" <page-plugin isAuth="{{authInfo['SF_ERP_PURCHASE_REQUEST_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin"> is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<total-bar-plugin customStyle="flex-direction: column;"> <total-bar-plugin customStyle="flex-direction: column;">
@@ -12,7 +12,8 @@
bind:tap="onPreview2" /> --> bind:tap="onPreview2" /> -->
<t-cell title="附件" left-icon="file" <t-cell title="附件" left-icon="file"
custom-style="padding-left:0;padding-right:0;position: sticky;top: 0;z-index:1" /> 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;"> <view style="border: 1px solid #ddd;border-radius: 8rpx;padding: 8rpx;">
<block wx:for="{{files}}" wx:key="index"> <block wx:for="{{files}}" wx:key="index">
<t-cell title="{{item.file_name}}" hover="{{item._file_type != 'file'}}" <t-cell title="{{item.file_name}}" hover="{{item._file_type != 'file'}}"
@@ -25,15 +26,16 @@
</view> </view>
<t-cell wx:if="{{ detail.length }}" title="订单明细" left-icon="article" note="{{detail.length}}条" <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" /> custom-style="padding-left:0;padding-right:0;position: sticky;top: 0;z-index:1"
<card-plugin wx:for="{{ detail }}" wx:key="detail_id"> bordered="{{false}}" />
<card-plugin wx:for="{{ detail }}" wx:key="item_id" showAll="1">
<view slot="header">{{ item.goods_name }}</view> <view slot="header">{{ item.goods_name }}</view>
<view slot="content"> <view slot="content">
<card-item-plugin label="编码" value="{{item.goods_code}}" /> <card-item-plugin label="编码" value="{{item.goods_code}}" />
<card-item-plugin label="属性" value="{{item.attr_name}}" /> <card-item-plugin label="属性" value="{{item.attr_name}}" />
<card-item-plugin label="数量" value="{{item.item_quantity}}" /> <card-item-plugin label="数量" value="{{item.item_quantity}}{{item.goods_unit}}" />
<card-item-plugin label="单位" value="{{item.goods_unit}}" /> <!-- <card-item-plugin label="单位" value="{{item.goods_unit}}" /> -->
<card-item-plugin label="备注" value="{{item.comments}}" /> <card-item-plugin wx:if="{{item.comments}}" label="备注" value="{{item.comments}}" />
</view> </view>
</card-plugin> </card-plugin>
</page-plugin> </page-plugin>