添加页面及附件查看

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

@@ -26,7 +26,10 @@
"pages/manage/my/my", "pages/manage/my/my",
"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/base/viewAttachment/viewAttachment",
"pages/other/outbound/outbound"
], ],
"window": { "window": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="64" height="64" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M608 960c-4.88 0-9.78-1.11-14.31-3.38A32 32 0 0 1 576 928v-96H416c-17.67 0-32-14.33-32-32V672c0-17.67 14.33-32 32-32h160v-96a32 32 0 0 1 51.2-25.6l256 192c8.06 6.04 12.8 15.53 12.8 25.6s-4.74 19.56-12.8 25.6l-256 192c-5.65 4.23-12.4 6.4-19.2 6.4zM448 768h160c17.67 0 32 14.33 32 32v64l170.67-128L640 608v64c0 17.67-14.33 32-32 32H448v64zM927.98 448c-6.81 0-13.67-2.16-19.49-6.64L512 136.37 115.51 441.36c-14.01 10.78-34.1 8.16-44.88-5.85-10.78-14.01-8.15-34.1 5.85-44.87l416-320c11.5-8.85 27.52-8.85 39.02 0l416 320c14.01 10.78 16.63 30.87 5.85 44.87-6.29 8.19-15.78 12.49-25.37 12.49zM344 720h-60c-5.52 0-10-4.48-10-10v-60c0-5.52 4.48-10 10-10h60c5.52 0 10 4.48 10 10v60c0 5.52-4.48 10-10 10zM344 592h-60c-5.52 0-10-4.48-10-10v-60c0-5.52 4.48-10 10-10h60c5.52 0 10 4.48 10 10v60c0 5.52-4.48 10-10 10z" fill="#165dff"></path><path d="M344 464h-60c-5.52 0-10-4.48-10-10v-60c0-5.52 4.48-10 10-10h60c5.52 0 10 4.48 10 10v60c0 5.52-4.48 10-10 10zM474.5 592h-60c-5.52 0-10-4.48-10-10v-60c0-5.52 4.48-10 10-10h60c5.52 0 10 4.48 10 10v60c0 5.52-4.48 10-10 10zM474.5 464h-60c-5.52 0-10-4.48-10-10v-60c0-5.52 4.48-10 10-10h60c5.52 0 10 4.48 10 10v60c0 5.52-4.48 10-10 10zM605 464h-60c-5.52 0-10-4.48-10-10v-60c0-5.52 4.48-10 10-10h60c5.52 0 10 4.48 10 10v60c0 5.52-4.48 10-10 10z" fill="#165dff"></path><path d="M491 960H192c-17.67 0-32-14.33-32-32V343c0-17.67 14.33-32 32-32s32 14.33 32 32v553h267c17.67 0 32 14.33 32 32s-14.33 32-32 32z" fill="#165dff"></path><path d="M832 574c-17.67 0-32-14.33-32-32V343c0-17.67 14.33-32 32-32s32 14.33 32 32v199c0 17.67-14.33 32-32 32z" fill="#165dff"></path></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="64" height="64" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M128 64a64 64 0 0 0-64 64v768a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V128a64 64 0 0 0-64-64H128z m0-64h768a128 128 0 0 1 128 128v768a128 128 0 0 1-128 128H128A128 128 0 0 1 0 896V128A128 128 0 0 1 128 0z" fill="#165dff"></path><path d="M258.56 550.208a32 32 0 1 0 0 64H777.6a32 32 0 0 0 0-64H258.56z" fill="#165dff"></path><path d="M802.88 601.856a32 32 0 1 0-50.496-39.296L638.592 708.864a32 32 0 0 0 50.56 39.296L802.88 601.856zM777.6 467.904a32 32 0 0 0 0-64H258.56a32 32 0 1 0 0 64H777.6z" fill="#165dff"></path><path d="M233.28 416.256a32 32 0 0 0 50.56 39.296l113.728-146.304a32 32 0 1 0-50.56-39.232l-113.664 146.24z" fill="#165dff"></path></svg>

After

Width:  |  Height:  |  Size: 941 B

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"> <view slot="footer" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_FINANCE_TRANSFER_DEL']}}" size="small" theme="danger" <t-button wx:if="{{authInfo['SF_FINANCE_TRANSFER_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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view> </view>
</card-plugin> </card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}" <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"> <view slot="footer" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_FINANCE_INCOME_DEL']}}" size="small" theme="danger" <t-button wx:if="{{authInfo['SF_FINANCE_INCOME_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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view> </view>
</card-plugin> </card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}" <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"> <view slot="footer" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_FINANCE_OUTCOME_DEL']}}" size="small" theme="danger" <t-button wx:if="{{authInfo['SF_FINANCE_OUTCOME_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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view> </view>
</card-plugin> </card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}" <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> bind:tap="onOrderPay" data-index="{{index}}">收付款</t-button>
<t-button wx:if="{{authInfo['SF_ERP_SALE_ORDERS_DEL']}}" size="small" theme="danger" <t-button wx:if="{{authInfo['SF_ERP_SALE_ORDERS_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.file_cnt}}" size="small" bind:tap="onViewAttachment"
data-index="{{index}}">附件({{item.file_cnt}})</t-button>
</view> </view>
</card-plugin> </card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}" <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"> <view slot="footer" class="card-plugin-footer">
<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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view> </view>
</card-plugin> </card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}" <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"> <view slot="footer" class="card-plugin-footer">
<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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view> </view>
</card-plugin> </card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}" <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"> <view slot="footer" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_ERP_PURCHASE_ORDER_DEL']}}" size="small" theme="danger" <t-button wx:if="{{authInfo['SF_ERP_PURCHASE_ORDER_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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view> </view>
</card-plugin> </card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}" <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"> <view slot="footer" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_ERP_PURCHASE_REQUEST_DEL']}}" size="small" theme="danger" <t-button wx:if="{{authInfo['SF_ERP_PURCHASE_REQUEST_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"
data-index="{{index}}">附件({{item.total_att}})</t-button>
</view> </view>
</card-plugin> </card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}" <pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"

View File

@@ -3,6 +3,7 @@
* Added By YangXB 2021.11.24 * Added By YangXB 2021.11.24
*/ */
export const servicePhone = '4000-5858-22'; export const servicePhone = '4000-5858-22';
export const OSSBaseUrl = 'https://cdn.fzcfkj.com/';
export const colors = { export const colors = {
primary: '#0052d9', primary: '#0052d9',

View File

@@ -1,5 +1,7 @@
import { colors } from './config';
/** 首页菜单 */ /** 首页菜单 */
const iconColor = '#0052D9'; const iconColor = colors.primary;
export const menuConfig = [ export const menuConfig = [
{ {
title: '订单管理', title: '订单管理',
@@ -67,31 +69,32 @@ export const menuConfig = [
}, },
], ],
}, },
{
title: '仓库管理',
icon: 'home',
iconColor: iconColor,
children: [
{
title: '原料出库',
url: '/pages/other/outbound/outbound',
auth: 'SF_ERP_OTHER_OUT_VIEW',
},
{
title: '调拨出库',
url: '/pages/other/transfer/transfer',
auth: 'SF_ERP_TRANSFER_OUT_VIEW',
},
],
},
{ {
title: '财务管理', title: '财务管理',
icon: 'currency-exchange', icon: 'currency-exchange',
iconColor: iconColor, iconColor: iconColor,
children: [ children: [
{ { title: '收入单', url: '/pages/finance/income/income', auth: 'SF_FINANCE_INCOME_VIEW' },
title: '收入单', { title: '支出单', url: '/pages/finance/outcome/outcome', auth: 'SF_FINANCE_OUTCOME_VIEW' },
url: '/pages/finance/income/income', { title: '转账单', url: '/pages/finance/giro/giro', auth: 'SF_FINANCE_TRANSFER_VIEW' },
auth: 'SF_FINANCE_INCOME_VIEW', { title: '资金明细', url: '/pages/finance/flow/flow', auth: 'SF_FINANCE_FLOW_VIEW' },
},
{
title: '支出单',
url: '/pages/finance/outcome/outcome',
auth: 'SF_FINANCE_OUTCOME_VIEW',
},
{
title: '转账单',
url: '/pages/finance/giro/giro',
auth: 'SF_FINANCE_TRANSFER_VIEW',
},
{
title: '资金明细',
url: '/pages/finance/flow/flow',
auth: 'SF_FINANCE_FLOW_VIEW',
},
], ],
}, },
{ {
@@ -99,21 +102,9 @@ export const menuConfig = [
icon: 'grid-view', icon: 'grid-view',
iconColor: iconColor, iconColor: iconColor,
children: [ children: [
{ { title: '供应商', url: '/pages/base/supplier/supplier', auth: 'SF_ERP_SUPPLIER_VIEW' },
title: '供应商', { title: '经销商', url: '/pages/base/customer/customer', auth: 'SF_ERP_CUSTOMER_VIEW' },
url: '/pages/base/supplier/supplier', { title: '结算账户', url: '/pages/base/account/account', auth: 'SF_ERP_ACCOUNT_VIEW' },
auth: 'SF_ERP_SUPPLIER_VIEW',
},
{
title: '经销商',
url: '/pages/base/customer/customer',
auth: 'SF_ERP_CUSTOMER_VIEW',
},
{
title: '结算账户',
url: '/pages/base/account/account',
auth: 'SF_ERP_ACCOUNT_VIEW',
},
], ],
}, },
{ {
@@ -121,43 +112,19 @@ export const menuConfig = [
icon: 'usergroup', icon: 'usergroup',
iconColor: iconColor, iconColor: iconColor,
children: [ children: [
{ { title: '组织架构', url: '/pages/manage/department/department', auth: 'SF_ERP_DEPART_VIEW' },
title: '组织架构', { title: '岗位角色', url: '/pages/manage/group/group', auth: 'SF_ERP_GROUP_VIEW' },
url: '/pages/manage/department/department', { title: '员工管理', url: '/pages/manage/staff/staff', auth: 'SF_ERP_STAFF_VIEW' },
auth: 'SF_ERP_DEPART_VIEW', { title: '我的权限', url: '/pages/manage/my/my', auth: 'SF_MY_RIGHT_VIEW' },
},
{
title: '岗位角色',
url: '/pages/manage/group/group',
auth: 'SF_ERP_GROUP_VIEW',
},
{
title: '员工管理',
url: '/pages/manage/staff/staff',
auth: 'SF_ERP_STAFF_VIEW',
},
{
title: '我的权限',
url: '/pages/manage/my/my',
auth: 'SF_MY_RIGHT_VIEW',
},
], ],
}, },
{ {
title: '日志查看', title: '日志查看',
icon: 'catalog', icon: 'assignment',
iconColor: iconColor, iconColor: iconColor,
children: [ children: [
{ { title: '登录日志', url: '/pages/logs/loginLog/loginLog', auth: 'SF_ERP_LOG_VIEW' },
title: '登录日志', { title: '操作日志', url: '/pages/logs/operateLog/operateLog', auth: 'SF_ERP_LOG_VIEW' },
url: '/pages/logs/loginLog/loginLog',
auth: 'SF_ERP_LOG_VIEW',
},
{
title: '操作日志',
url: '/pages/logs/operateLog/operateLog',
auth: 'SF_ERP_LOG_VIEW',
},
], ],
}, },
]; ];

View File

@@ -136,6 +136,29 @@ export const isImageFile = (path: string) => {
return /\.(jpe?g|png|gif|svg|webp|bmp)$/i.test(path); return /\.(jpe?g|png|gif|svg|webp|bmp)$/i.test(path);
}; };
export const isPDFFile = (path: string) => {
return /\.(pdf)$/i.test(path);
};
/** 判断是不是Excel */
export const isExcelFile = (path: string) => {
return /\.(xlsx|xls)$/i.test(path);
};
/** 获取文件类型 */
export const getFileType = (path: string): 'file' | 'image' | 'excel' | 'pdf' => {
if (typeof path == 'string') {
if (isExcelFile(path)) {
return 'excel';
} else if (isImageFile(path)) {
return 'image';
} else if (isPDFFile(path)) {
return 'pdf';
}
}
return 'file';
};
/** 滚动到顶部 */ /** 滚动到顶部 */
export const scrollToTop = () => { export const scrollToTop = () => {
wx.pageScrollTo({ scrollTop: 0 }); wx.pageScrollTo({ scrollTop: 0 });
@@ -347,3 +370,16 @@ export const sleep = (callback?: () => void, ms = 300): Promise<boolean> => {
}; };
export const cloneLite = (data: any) => JSON.parse(JSON.stringify(data)); export const cloneLite = (data: any) => JSON.parse(JSON.stringify(data));
/** 转换文件大小 */
export const formatFileSize = (fileSize: any): string => {
const file_size = toNumber(fileSize);
if (file_size == 0) {
return '0B';
}
const unitArr = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
let index = 0;
index = Math.floor(Math.log(file_size) / Math.log(1024));
const size = file_size / 1024 ** index;
return size.toFixed(0) + unitArr[index];
};