添加页面

This commit is contained in:
zhengw
2026-01-29 17:46:14 +08:00
parent df67413bf8
commit 85483c7ca2
44 changed files with 1606 additions and 94 deletions

View File

@@ -9,14 +9,14 @@
display: none;
}
.footer>view {
.footer > view {
border-top: 1rpx solid #ddd;
padding: 16rpx 0 0 24rpx;
display: flex;
width: 100%;
}
.footer>view:empty {
.footer > view:empty {
display: none;
}

View File

@@ -6,6 +6,7 @@ Component({
properties: {
label: null,
placeholder: null,
value: null,
},
/**

View File

@@ -1,2 +1,2 @@
<t-input label="{{label||''}}" placeholder="{{placeholder || label || '' }}" bind:change="onChange"
bind:clear="onClear" clearable />
bind:clear="onClear" clearable value="{{value || ''}}" />

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,171 @@
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: 5 };
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('ErpAccount/flow', 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('ErpFinance/del', { head_id: item.head_id }).then(() => {
toastSuccess('删除成功');
sleep(() => {
this.getList();
}, 1000);
});
});
},
/**
* 生命周期函数--监听页面加载
*/
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,54 @@
<page-plugin isAuth="{{authInfo['SF_FINANCE_TRANSFER_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<search-popup placeholder="输入单据编号" bind:change="searchChange" bind:ok="searchOk"
bind:reset="searchReset" value="{{params.rel_bill_no}}" data-key="rel_bill_no">
<view slot="content">
<!-- <search-input label="付款账户" value="{{params.account_name}}" data-key="account_name"
bind:change="searchChange2" /> -->
<!-- <option-cell-plugin title="单据状态" value="{{params.state || ''}}" bind:change="onOptionChange"
mode="radio" options="{{states}}" data-key="state" /> -->
<date-picker-plugin title="交易开始日期" value="{{params.pay_dateL}}" data-key="pay_dateL"
bind:confirm="datePickerConfirm" />
<date-picker-plugin title="交易结束日期" value="{{params.pay_dateU}}" data-key="pay_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>
<t-empty wx:if="{{list.length == 0}}" icon="info-circle-filled" description="暂无数据"
style="margin-bottom: 24rpx;" />
<block wx:for="{{ list }}" wx:key="info_process_id">
<card-plugin>
<view slot="header">{{ item.rel_bill_no }}</view>
<view slot="content">
<card-item-plugin label="业务类型" value="{{item.type}}" />
<card-item-plugin label="账户" value="{{item.account_name}}" />
<card-item-plugin label="收支类型" value="{{item.pay_type}}" />
<card-item-plugin label="变更金额" value="{{item.amount}}" />
<card-item-plugin label="变更前" value="{{item.before}}" />
<card-item-plugin label="剩余金额" value="{{item.after}}" />
<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.comments}}" />
<card-item-plugin label="交易时间" value="{{item.pay_date}}" />
<card-item-plugin label="创建日期" value="{{item.create_date}}" />
</view>
</card-plugin>
</block>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
total="{{count}}" bind:change="paginationChange" />
</page-plugin>

View File

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

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,171 @@
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: 5 };
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('ErpFinance/list', temp).then((res: any) => {
const list = toArray(res.data?.list);
if (list.length == 0 && this.data.params.curr_page > 1) {
this.getList(this.data.params.curr_page - 1);
}
this.setData({
count: toNumber(res.data?.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('ErpFinance/del', { head_id: item.head_id }).then(() => {
toastSuccess('删除成功');
sleep(() => {
this.getList();
}, 1000);
});
});
},
/**
* 生命周期函数--监听页面加载
*/
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,55 @@
<page-plugin isAuth="{{authInfo['SF_FINANCE_TRANSFER_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.account_name}}" data-key="account_name"
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>
<t-empty wx:if="{{list.length == 0}}" icon="info-circle-filled" description="暂无数据"
style="margin-bottom: 24rpx;" />
<block wx:for="{{ list }}" wx:key="info_process_id">
<card-plugin>
<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.account_name}}" />
<card-item-plugin label="实付金额" value="{{item.total_amount}}" />
<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" style="padding-bottom: 16rpx;">
<t-button wx:if="{{authInfo['SF_FINANCE_TRANSFER_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
</view>
</card-plugin>
</block>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
total="{{count}}" bind:change="paginationChange" />
</page-plugin>

View File

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

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,171 @@
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: 1 };
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('ErpFinance/list', temp).then((res: any) => {
const list = toArray(res.data?.list);
if (list.length == 0 && this.data.params.curr_page > 1) {
this.getList(this.data.params.curr_page - 1);
}
this.setData({
count: toNumber(res.data?.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('ErpFinance/del', { head_id: item.head_id }).then(() => {
toastSuccess('删除成功');
sleep(() => {
this.getList();
}, 1000);
});
});
},
/**
* 生命周期函数--监听页面加载
*/
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,60 @@
<page-plugin isAuth="{{authInfo['SF_FINANCE_INCOME_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" />
<search-input label="收入账户" value="{{params.account_name}}" data-key="account_name"
bind:change="searchChange2" />
<search-input label="往来单位" value="{{params.crm_name}}" data-key="crm_name"
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>
<t-empty wx:if="{{list.length == 0}}" icon="info-circle-filled" description="暂无数据"
style="margin-bottom: 24rpx;" />
<block wx:for="{{ list }}" wx:key="info_process_id">
<card-plugin>
<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.crm_name}}" />
<card-item-plugin label="收入账户" value="{{item.account_name}}" />
<card-item-plugin label="收入金额" value="{{item.total_amount}}" />
<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" style="padding-bottom: 16rpx;">
<t-button wx:if="{{authInfo['SF_FINANCE_INCOME_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
</view>
</card-plugin>
</block>
<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,171 @@
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: 2 };
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('ErpFinance/list', temp).then((res: any) => {
const list = toArray(res.data?.list);
if (list.length == 0 && this.data.params.curr_page > 1) {
this.getList(this.data.params.curr_page - 1);
}
this.setData({
count: toNumber(res.data?.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('ErpFinance/del', { head_id: item.head_id }).then(() => {
toastSuccess('删除成功');
sleep(() => {
this.getList();
}, 1000);
});
});
},
/**
* 生命周期函数--监听页面加载
*/
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,60 @@
<page-plugin isAuth="{{authInfo['SF_FINANCE_OUTCOME_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" />
<search-input label="收入账户" value="{{params.account_name}}" data-key="account_name"
bind:change="searchChange2" />
<search-input label="往来单位" value="{{params.crm_name}}" data-key="crm_name"
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>
<t-empty wx:if="{{list.length == 0}}" icon="info-circle-filled" description="暂无数据"
style="margin-bottom: 24rpx;" />
<block wx:for="{{ list }}" wx:key="info_process_id">
<card-plugin>
<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.crm_name}}" />
<card-item-plugin label="收入账户" value="{{item.account_name}}" />
<card-item-plugin label="收入金额" value="{{item.total_amount}}" />
<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" style="padding-bottom: 16rpx;">
<t-button wx:if="{{authInfo['SF_FINANCE_OUTCOME_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
</view>
</card-plugin>
</block>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
total="{{count}}" bind:change="paginationChange" />
</page-plugin>

View File

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

View File

@@ -99,7 +99,7 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
onLoad(_options) {
// console.log(options);
this.setData({ loading: true });

View File

@@ -3,18 +3,13 @@
"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",
"t-input": "tdesign-miniprogram/input/input",
"pagination-plugin": "/pages/components/pagination-plugin/pagination-plugin",
"search-input": "/pages/components/search-input/search-input",
"t-cell": "tdesign-miniprogram/cell/cell",
"t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
"t-checkbox-group": "tdesign-miniprogram/checkbox-group/checkbox-group",
"t-radio": "tdesign-miniprogram/radio/radio",
"t-radio-group": "tdesign-miniprogram/radio-group/radio-group"
"search-input": "/pages/components/search-input/search-input"
},
"navigationBarTitleText": "销售订单"
}

View File

@@ -65,7 +65,8 @@ Page({
this.getOrderStep();
},
searchChange(e: any) {
this.data.params.order_no = e.detail.value;
const key = getDataSet(e).key;
this.data.params[key] = e.detail.value;
this.setData({ params: this.data.params });
},
searchChange2(e: any) {
@@ -76,17 +77,11 @@ Page({
} else {
delete this.data.params[key];
}
},
onOrderStepChange(e: any) {
this.data.params.order_step = e.detail.value;
this.setData({ params: this.data.params });
},
onProcessStateChange(e: any) {
this.data.params.process_state = e.detail.value;
this.setData({ params: this.data.params });
},
onPayedStateChange(e: any) {
this.data.params.payed_state = e.detail.value;
onOptionChange(e: any) {
const key = getDataSet(e).key;
this.data.params[key] = e.detail.value;
this.setData({ params: this.data.params });
},
datePickerConfirm(e: any) {
@@ -106,25 +101,25 @@ Page({
this.setData({ params: this.data.params });
this.getList(1);
},
tabChange(e: any) {
const state = getDataSet(e).key;
this.data.params.state = state;
this.getList();
},
paginationChange(e: any) {
this.getList(e.detail.curr_page);
},
getOrderStep() {
post('OrderStep/list').then((res: any) => {
this.setData({ orderStep: toArray(res.data) });
this.setData({
orderStep: toArray(res.data).map((el) => ({
label: el.order_step_name,
value: el.order_step_id,
})),
});
});
},
getList(curr: number = 1) {
this.data.params.curr_page = curr;
this.setData({ params: this.data.params });
const temp = JSON.parse(JSON.stringify(this.data.params));
const temp = cloneLite(this.data.params);
if (temp.order_step && temp.order_step.length) {
temp.order_step = JSON.stringify(temp.order_step);
temp.order_step = temp.order_step.join(',');
} else {
delete temp.order_step;
}
@@ -175,7 +170,7 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
onLoad(_options) {},
/**
* 生命周期函数--监听页面初次渲染完成

View File

@@ -1,47 +1,31 @@
<page-plugin isAuth="{{authInfo['SF_ERP_SALE_ORDERS_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<search-popup placeholder="输入销售单号" bind:change="searchChange" bind:ok="searchOk"
bind:reset="searchReset" value="{{params.order_no}}">
bind:reset="searchReset" value="{{params.order_no}}" data-key="order_no">
<view slot="content">
<search-input label="自定义单号" data-key="custom_order_no" bind:change="searchChange2" />
<search-input label="经销商名称" data-key="custom_name" bind:change="searchChange2" />
<search-input label="经销商手机" data-key="custom_phone" bind:change="searchChange2" />
<!-- <search-input label="经销商地址" data-key="custom_address" bind:change="searchChange2" /> -->
<search-input label="客户名称" data-key="end_user_name" bind:change="searchChange2" />
<search-input label="客户手机" data-key="end_user_phone" bind:change="searchChange2" />
<search-input label="客户地址" data-key="end_user_address" bind:change="searchChange2" />
<t-cell title="订单阶段">
<t-checkbox-group slot="note" bind:change="onOrderStepChange" value="{{params.order_step}}">
<block wx:for="{{orderStep}}" wx:key="index">
<t-checkbox icon="rectangle" borderless="{{true}}" block="{{false}}"
value="{{item.order_step_id}}" style="margin-right: 16rpx;">
{{item.order_step_name}}
</t-checkbox>
</block>
</t-checkbox-group>
</t-cell>
<t-cell title="生产状态">
<t-checkbox-group slot="note" bind:change="onProcessStateChange"
value="{{params.process_state}}">
<block wx:for="{{saleOrderProcessStateOption}}" wx:key="index">
<t-checkbox icon="rectangle" borderless="{{true}}" block="{{false}}"
value="{{item.value}}" style="margin-right: 16rpx;">
{{item.label}}
</t-checkbox>
</block>
</t-checkbox-group>
</t-cell>
<t-cell title="收款状态">
<t-radio-group slot="note" bind:change="onPayedStateChange"
value="{{params.payed_state || ''}}">
<block wx:for="{{payedStateOption}}" wx:key="index">
<t-radio borderless="{{true}}" block="{{false}}" value="{{item.value}}"
style="margin-right: 16rpx;">
{{item.label}}
</t-radio>
</block>
</t-radio-group>
</t-cell>
<search-input label="自定义单号" value="{{params.custom_order_no}}" data-key="custom_order_no"
bind:change="searchChange2" />
<search-input label="经销商名称" value="{{params.custom_name}}" data-key="custom_name"
bind:change="searchChange2" />
<search-input label="经销商手机" value="{{params.custom_phone}}" data-key="custom_phone"
bind:change="searchChange2" />
<search-input label="客户名称" value="{{params.end_user_name}}" data-key="end_user_name"
bind:change="searchChange2" />
<search-input label="客户手机" value="{{params.end_user_phone}}" data-key="end_user_phone"
bind:change="searchChange2" />
<search-input label="客户地址" value="{{params.end_user_address}}" data-key="end_user_address"
bind:change="searchChange2" />
<option-cell-plugin title="订单阶段" value="{{params.order_step}}" bind:change="onOptionChange"
mode="checkbox" options="{{orderStep}}" data-key="order_step" />
<option-cell-plugin title="生产状态" value="{{params.process_state}}" bind:change="onOptionChange"
mode="checkbox" data-key="process_state" options="{{saleOrderProcessStateOption}}" />
<option-cell-plugin title="收款状态" value="{{params.payed_state || ''}}"
bind:change="onOptionChange" mode="radio" options="{{payedStateOption}}"
data-key="payed_state" />
<date-picker-plugin title="单据开始日期" value="{{params.document_dateL}}" data-key="document_dateL"
bind:confirm="datePickerConfirm" />
<date-picker-plugin title="单据结束日期" value="{{params.document_dateU}}" data-key="document_dateU"

View File

@@ -1,4 +1 @@
view.t-cell__title-text {
white-space: nowrap;
flex-shrink: 0;
}

View File

@@ -7,6 +7,7 @@ Page({
*/
data: {
process: [] as any[],
isFirstEnter: true,
},
navDetail(e: any) {
const index = getDataSet(e).index.split(',');
@@ -14,7 +15,7 @@ Page({
const cProcess = pProcess.child[index[1]];
const { p_process_name, process_name, process_id } = cProcess;
const title = encodeURIComponent(`${p_process_name} - ${process_name}`);
this.data.isFirstEnter = false;
wx.navigateTo({
url: `/pages/produce/processManageDetail/processManageDetail?process_id=${process_id}&title=${title}`,
});
@@ -58,7 +59,11 @@ Page({
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
onShow() {
if (!this.data.isFirstEnter) {
this.getList();
}
},
/**
* 生命周期函数--监听页面隐藏

View File

@@ -1,25 +1,35 @@
.process-box {
border: 1rpx solid #ddd;
margin-bottom: 24rpx;
border-radius: 8rpx;
}
.process-child-box {
display: flex;
flex-wrap: wrap;
align-items: center;
column-gap: 32rpx;
row-gap: 32rpx;
margin-bottom: 32rpx;
padding: 32rpx 16rpx 24rpx;
}
.p_process_name {
font-size: 1.125em;
font-weight: bold;
margin-bottom: 24rpx;
padding: 16rpx;
border-bottom: 1rpx solid #ddd;
}
.process-child-item-box {
position: relative;
border: 1rpx solid #ddd;
padding: 16rpx;
padding: 12rpx 16rpx;
border-radius: 8rpx;
}
.process-child-item-box:active {
background: #eee;
}
.process-child-item-num {
position: absolute;
top: 0;

View File

@@ -1,12 +1,14 @@
import { loginStatus, post } from '@/utils/https';
import { getAuthInfo, getDataSet, toArray, toastSuccess, toNumber } from '@/utils/util';
import { cloneLite, getAuthInfo, getDataSet, toArray, toastSuccess, toNumber } from '@/utils/util';
const defaultParams = { curr_page: 1, page_count: 20, state: '1', process_id: '' };
Page({
/**
* 页面的初始数据
*/
data: {
params: { curr_page: 1, page_count: 20, state: '1', process_id: '' } as any,
params: cloneLite(defaultParams) as any,
list: [] as any[],
count: 0,
dialog: {
@@ -27,25 +29,31 @@ Page({
this.getList();
},
searchChange(e: any) {
this.data.params.order_no = e.detail.value;
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();
console.log(e);
if (val) {
this.data.params[key] = val;
} else {
delete this.data.params[key];
}
this.setData({ params: this.data.params });
},
searchOk() {
this.getList(1);
},
searchReset() {
this.data.params = cloneLite(defaultParams);
this.getList(1);
},
tabChange(e: any) {
const state = getDataSet(e).key;
this.data.params.state = state;
this.getList();
this.getList(1);
},
paginationChange(e: any) {
this.getList(e.detail.curr_page);

View File

@@ -1,14 +1,22 @@
<page-plugin isAuth="{{authInfo['SF_ERP_PRODUCT_PROCESS_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<search-popup placeholder="输入销售单号" bind:change="searchChange" bind:ok="searchOk">
<search-popup placeholder="输入销售单号" value="{{params.order_no}}" data-key="order_no"
bind:change="searchChange" bind:ok="searchOk" bind:reset="searchReset">
<view slot="content">
<search-input label="自定义单号" data-key="custom_order_no" bind:change="searchChange2" />
<search-input label="经销商名称" data-key="custom_name" bind:change="searchChange2" />
<search-input label="经销商手机" data-key="custom_phone" bind:change="searchChange2" />
<search-input label="经销商地址" data-key="custom_address" bind:change="searchChange2" />
<search-input label="客户名称" data-key="end_user_name" bind:change="searchChange2" />
<search-input label="客户手机" data-key="end_user_phone" bind:change="searchChange2" />
<search-input label="客户地址" data-key="end_user_address" bind:change="searchChange2" />
<search-input label="自定义单号" value="{{params.custom_order_no}}" data-key="custom_order_no"
bind:change="searchChange2" />
<search-input label="经销商名称" value="{{params.custom_name}}" data-key="custom_name"
bind:change="searchChange2" />
<search-input label="经销商手机" value="{{params.custom_phone}}" data-key="custom_phone"
bind:change="searchChange2" />
<search-input label="经销商地址" value="{{params.custom_address}}" data-key="custom_address"
bind:change="searchChange2" />
<search-input label="客户名称" value="{{params.end_user_name}}" data-key="end_user_name"
bind:change="searchChange2" />
<search-input label="客户手机" value="{{params.end_user_phone}}" data-key="end_user_phone"
bind:change="searchChange2" />
<search-input label="客户地址" value="{{params.end_user_address}}" data-key="end_user_address"
bind:change="searchChange2" />
</view>
</search-popup>

View File

@@ -0,0 +1,14 @@
{
"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",
"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",
"pagination-plugin": "/pages/components/pagination-plugin/pagination-plugin",
"search-input": "/pages/components/search-input/search-input",
"option-cell-plugin": "/pages/components/option-cell-plugin/option-cell-plugin"
},
"navigationBarTitleText": "采购入库"
}

View File

@@ -0,0 +1,161 @@
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: 3 };
Page({
/**
* 页面的初始数据
*/
data: {
params: cloneLite(defaultParams) as any,
list: [] as any[],
count: 0,
sort: [{ label: '创建日期', value: 'create_date' }],
payState: [
{ value: '', label: '全部' },
{ value: 1, label: '未结算' },
{ value: 2, label: '部分结算' },
{ value: 3, label: '完成结算' },
{ value: 4, label: '无需结算' },
],
},
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);
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);
});
});
},
/**
* 生命周期函数--监听页面加载
*/
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,61 @@
<page-plugin isAuth="{{authInfo['SF_ERP_PURCHASE_STORE_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<search-popup placeholder="输入单据编码" bind:change="searchChange" bind:ok="searchOk"
bind:reset="searchReset" value="{{params.order_no}}" data-key="order_no">
<view slot="content">
<search-input label="供应商名称" value="{{params.crm_name}}" data-key="crm_name"
bind:change="searchChange2" />
<search-input label="关联单据" value="{{params.rel_bill_no}}" data-key="rel_bill_no"
bind:change="searchChange2" />
<option-cell-plugin title="结算状态" bind:change="onOptionChange"
value="{{params.pay_state || ''}}" options="{{payState}}" mode="radio"
data-key="pay_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>
<t-empty wx:if="{{list.length == 0}}" icon="info-circle-filled" description="暂无数据"
style="margin-bottom: 24rpx;" />
<block wx:for="{{ list }}" wx:key="info_process_id">
<card-plugin>
<view slot="header">{{ item.bill_no }}</view>
<view slot="content">
<card-item-plugin label="供应商名称" value="{{item.crm_name}}" />
<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.discount_amount}}" />
<card-item-plugin label="结算金额" value="{{item.total_real_amount}}" />
<card-item-plugin label="已结算金额" value="{{item.finish_amount}}" />
<card-item-plugin label="未结算金额" value="{{item.unsettled_amount}}" />
<card-item-plugin label="备注" value="{{item.comments}}" />
<card-item-plugin label="创建日期" value="{{item.create_date}}" />
</view>
<view slot="footer" style="padding-bottom: 16rpx;">
<t-button wx:if="{{authInfo['SF_ERP_PURCHASE_STORE_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
</view>
</card-plugin>
</block>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
total="{{count}}" bind:change="paginationChange" />
</page-plugin>

View File

@@ -0,0 +1,14 @@
{
"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",
"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",
"pagination-plugin": "/pages/components/pagination-plugin/pagination-plugin",
"search-input": "/pages/components/search-input/search-input",
"option-cell-plugin": "/pages/components/option-cell-plugin/option-cell-plugin"
},
"navigationBarTitleText": "采购订单"
}

View File

@@ -0,0 +1,164 @@
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, states: [1, 4], head_type: 2 };
Page({
/**
* 页面的初始数据
*/
data: {
params: cloneLite(defaultParams) as any,
list: [] as any[],
count: 0,
states: [
{ value: 1, label: '未入库' },
{ value: 4, label: '部分入库' },
{ value: 3, 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.states && temp.states.length) {
temp.states = temp.states.join(',');
} else {
delete temp.states;
}
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);
});
});
},
/**
* 生命周期函数--监听页面加载
*/
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,60 @@
<page-plugin isAuth="{{authInfo['SF_ERP_PURCHASE_ORDER_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.crm_name}}" data-key="crm_name"
bind:change="searchChange2" />
<search-input label="结算账户" value="{{params.account_name}}" data-key="account_name"
bind:change="searchChange2" />
<search-input label="关联单据" value="{{params.rel_bill_no}}" data-key="rel_bill_no"
bind:change="searchChange2" />
<option-cell-plugin title="单据状态" bind:change="onOptionChange" value="{{params.states}}"
mode="checkbox" options="{{states}}" data-key="states" />
<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>
<t-empty wx:if="{{list.length == 0}}" icon="info-circle-filled" description="暂无数据"
style="margin-bottom: 24rpx;" />
<block wx:for="{{ list }}" wx:key="info_process_id">
<card-plugin>
<view slot="header">{{ item.bill_no }}</view>
<view slot="content">
<card-item-plugin label="供应商名称" value="{{item.crm_name}}" />
<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.total_amount}}" />
<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" style="padding-bottom: 16rpx;">
<t-button wx:if="{{authInfo['SF_ERP_PURCHASE_ORDER_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
</view>
</card-plugin>
</block>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
total="{{count}}" bind:change="paginationChange" />
</page-plugin>