添加页面, 组件, 图标

This commit is contained in:
zhengw
2026-01-30 16:29:23 +08:00
parent 85483c7ca2
commit 3c7d7860b1
48 changed files with 1442 additions and 258 deletions

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",
"search-input": "/pages/components/search-input/search-input",
"t-icon": "tdesign-miniprogram/icon/icon"
},
"navigationBarTitleText": "结算账户"
}

View File

@@ -0,0 +1,183 @@
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 };
Page({
/**
* 页面的初始数据
*/
data: {
params: cloneLite(defaultParams) as any,
list: [] as any[],
count: 0,
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);
post('ErpAccount/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,
});
});
},
onDefault(e: any) {
const data = getDataSet(e);
const index = data.index;
const item = this.data.list[index];
showModal({ content: `确认将 ${item.account_name} 设为默认账户?` }).then(() => {
post('ErpAccount/setDefault', { account_id: item.account_id }).then(() => {
toastSuccess('设置成功');
sleep(() => {
this.getList();
}, 1000);
});
});
},
onState(e: any) {
const data = getDataSet(e);
const index = data.index;
const item = this.data.list[index];
showModal({
content: `确认 ${item.state == 1 ? '禁用' : '启用'} ${item.account_name}账户?`,
}).then(() => {
post('ErpAccount/setState', { account_id: item.account_id }).then(() => {
toastSuccess(`${item.state == 1 ? '禁用' : '启用'}成功`);
sleep(() => {
this.getList();
}, 1000);
});
});
},
onDelete(e: any) {
const data = getDataSet(e);
const index = data.index;
const item = this.data.list[index];
showModal({ content: `确认删除 ${item.account_name} 账户?` }).then(() => {
post('ErpAccount/del', { account_id: item.account_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_ERP_ACCOUNT_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<search-popup placeholder="输入名称" bind:change="searchChange" bind:ok="searchOk"
bind:reset="searchReset" value="{{params.account_name}}" data-key="account_name"
hideMore="{{true}}">
<!-- <view slot="content">
<search-input label="手机号码" value="{{params.crm_phone}}" data-key="crm_phone"
bind:change="searchChange2" />
<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="account_id">
<view slot="header"
style="display: flex;justify-content: space-between;width: 100%;align-items: center;column-gap: 12rpx;">
<view style="word-break: break-all;min-width: 0;">
{{ item.account_name }}
</view>
<view
style="display: flex;align-items: center;column-gap: 8rpx;font-weight: normal;flex-shrink: 0;">
<t-icon wx:if="{{item.if_default == 2}}" name="star" color="#2ba471" />
<text wx:if="{{item.state == 1}}" style="color: #0052d9;">正常</text>
<text wx:elif="{{item.state == 2}}" style="color: #d54941;">禁用</text>
</view>
</view>
<view slot="content">
<card-item-plugin label="期初金额" value="{{item.init_amount}}" />
<card-item-plugin label="当前金额" value="{{item.current_amount}}" />
<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_ACCOUNT_EDIT'] && item.if_default == 1}}" size="small"
theme="primary" bind:tap="onDefault" data-index="{{index}}">
设为默认</t-button>
<t-button wx:if="{{authInfo['SF_ERP_ACCOUNT_EDIT']}}" size="small"
theme="{{item.state == 1 ? 'danger' : 'primary'}}" bind:tap="onState"
data-index="{{index}}">
{{item.state == 1 ? '禁用' : '启用'}}
</t-button>
<t-button wx:if="{{authInfo['SF_ERP_ACCOUNT_DEL']}}" size="small" theme="danger"
bind:tap="onDelete" data-index="{{index}}">删除</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,155 @@
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, crm_type: 1 };
Page({
/**
* 页面的初始数据
*/
data: {
params: cloneLite(defaultParams) as any,
list: [] as any[],
count: 0,
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);
post('ErpCrm/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.crm_name}?` }).then(() => {
post('ErpCrm/del', { crm_id: item.crm_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,37 @@
<page-plugin isAuth="{{authInfo['SF_ERP_CUSTOMER_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<search-popup placeholder="输入经销商名称" bind:change="searchChange" bind:ok="searchOk"
bind:reset="searchReset" value="{{params.crm_name}}" data-key="crm_name">
<view slot="content">
<search-input label="手机号码" value="{{params.crm_phone}}" data-key="crm_phone"
bind:change="searchChange2" />
<!-- <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="crm_id">
<view slot="header">{{ item.crm_name }}</view>
<view slot="content">
<card-item-plugin label="手机号码" value="{{item.crm_phone}}" />
<card-item-plugin label="地址" value="{{item.crm_address}}" />
<card-item-plugin label="开户行" value="{{item.bank_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_CUSTOMER_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</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,155 @@
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, crm_type: 2 };
Page({
/**
* 页面的初始数据
*/
data: {
params: cloneLite(defaultParams) as any,
list: [] as any[],
count: 0,
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);
post('ErpCrm/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.crm_name}?` }).then(() => {
post('ErpCrm/del', { crm_id: item.crm_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,37 @@
<page-plugin isAuth="{{authInfo['SF_ERP_SUPPLIER_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<search-popup placeholder="输入供应商名称" bind:change="searchChange" bind:ok="searchOk"
bind:reset="searchReset" value="{{params.crm_name}}" data-key="crm_name">
<view slot="content">
<search-input label="手机号码" value="{{params.crm_phone}}" data-key="crm_phone"
bind:change="searchChange2" />
<!-- <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="crm_id">
<view slot="header">{{ item.crm_name }}</view>
<view slot="content">
<card-item-plugin label="手机号码" value="{{item.crm_phone}}" />
<card-item-plugin label="地址" value="{{item.crm_address}}" />
<card-item-plugin label="开户行" value="{{item.bank_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_SUPPLIER_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</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

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

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"t-empty": "tdesign-miniprogram/empty/empty"
}
}

View File

@@ -0,0 +1,24 @@
// pages/components/empty-plugin/empty-plugin.ts
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})

View File

@@ -0,0 +1 @@
<t-empty icon="no-result" description="暂无数据" style="margin-top: 24rpx;margin-bottom: 24rpx;" />

View File

@@ -109,7 +109,7 @@ Page({
const data = getDataSet(e);
const index = data.index;
const item = this.data.list[index];
showModal({ content: `确认删除 ${item.bill_no} 订单?` }).then(() => {
showModal({ content: `确认删除 ${item.bill_no}?` }).then(() => {
post('ErpFinance/del', { head_id: item.head_id }).then(() => {
toastSuccess('删除成功');
sleep(() => {

View File

@@ -25,30 +25,27 @@
<!-- <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>
<empty-plugin wx:if="{{list.length == 0}}" />
<card-plugin wx:for="{{ list }}" wx:key="account_log_id">
<view slot="header">{{ item.rel_bill_no }}</view>
<view slot="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>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
total="{{count}}" bind:change="paginationChange" />
</page-plugin>

View File

@@ -109,7 +109,7 @@ Page({
const data = getDataSet(e);
const index = data.index;
const item = this.data.list[index];
showModal({ content: `确认删除 ${item.bill_no} 订单?` }).then(() => {
showModal({ content: `确认删除 ${item.bill_no}?` }).then(() => {
post('ErpFinance/del', { head_id: item.head_id }).then(() => {
toastSuccess('删除成功');
sleep(() => {

View File

@@ -25,31 +25,28 @@
<!-- <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>
<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.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" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_FINANCE_TRANSFER_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
total="{{count}}" bind:change="paginationChange" />
</page-plugin>

View File

@@ -109,7 +109,7 @@ Page({
const data = getDataSet(e);
const index = data.index;
const item = this.data.list[index];
showModal({ content: `确认删除 ${item.bill_no} 订单?` }).then(() => {
showModal({ content: `确认删除 ${item.bill_no}?` }).then(() => {
post('ErpFinance/del', { head_id: item.head_id }).then(() => {
toastSuccess('删除成功');
sleep(() => {

View File

@@ -28,33 +28,30 @@
<!-- <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>
<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.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" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_FINANCE_INCOME_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
total="{{count}}" bind:change="paginationChange" />
</page-plugin>

View File

@@ -109,7 +109,7 @@ Page({
const data = getDataSet(e);
const index = data.index;
const item = this.data.list[index];
showModal({ content: `确认删除 ${item.bill_no} 订单?` }).then(() => {
showModal({ content: `确认删除 ${item.bill_no}?` }).then(() => {
post('ErpFinance/del', { head_id: item.head_id }).then(() => {
toastSuccess('删除成功');
sleep(() => {

View File

@@ -28,33 +28,30 @@
<!-- <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>
<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.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" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_FINANCE_OUTCOME_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
total="{{count}}" bind:change="paginationChange" />
</page-plugin>

View File

@@ -1,30 +1,27 @@
<page-plugin isAuth="{{authInfo['SF_ERP_SALE_ORDERS_VIEW']}}" loading="{{loading}}"
is-login="{{isLogin}}" bind:handleLogin="handleLogin">
<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" style="display: flex;justify-content: space-between;width: 100%;">
<text>{{ item.order_no }}</text>
<view
style="font-weight: normal;min-width: 1.5em;border: 1rpx solid #eee;text-align: center;color: #999;border-radius: 25%;">
{{index + 1}}
</view>
<empty-plugin wx:if="{{list.length == 0}}" />
<card-plugin wx:for="{{ list }}" wx:key="order_no">
<view slot="header" style="display: flex;justify-content: space-between;width: 100%;">
<text>{{ item.order_no }}</text>
<view
style="font-weight: normal;min-width: 1.5em;border: 1rpx solid #eee;text-align: center;color: #999;border-radius: 25%;">
{{index + 1}}
</view>
<view slot="content">
<card-item-plugin label="自定义单号" value="{{item.custom_order_no}}" />
<card-item-plugin label="订单类型" value="{{item.category_name}}" />
<card-item-plugin label="经销商名称" value="{{item.custom_name}}" />
<card-item-plugin label="经销商手机" value="{{item.custom_phone}}" />
<card-item-plugin label="客户名称" value="{{item.end_user_name}}" />
<card-item-plugin label="客户手机" value="{{item.end_user_phone}}" />
<card-item-plugin label="客户地址" value="{{item.end_user_address}}" />
<card-item-plugin label="创建日期" value="{{item.create_date}}" />
</view>
<view slot="footer" style="padding-bottom: 16rpx;">
<t-button size="small" theme="primary" bind:tap="onOrderToTop" data-index="{{index}}">移至顶部
</t-button>
</view>
</card-plugin>
</block>
</view>
<view slot="content">
<card-item-plugin label="自定义单号" value="{{item.custom_order_no}}" />
<card-item-plugin label="订单类型" value="{{item.category_name}}" />
<card-item-plugin label="经销商名称" value="{{item.custom_name}}" />
<card-item-plugin label="经销商手机" value="{{item.custom_phone}}" />
<card-item-plugin label="客户名称" value="{{item.end_user_name}}" />
<card-item-plugin label="客户手机" value="{{item.end_user_phone}}" />
<card-item-plugin label="客户地址" value="{{item.end_user_address}}" />
<card-item-plugin label="创建日期" value="{{item.create_date}}" />
</view>
<view slot="footer" class="card-plugin-footer">
<t-button size="small" theme="primary" bind:tap="onOrderToTop" data-index="{{index}}">移至顶部
</t-button>
</view>
</card-plugin>
</page-plugin>

View File

@@ -58,36 +58,32 @@
<text>¥{{amount.tot_un_payed_amount}}</text>
</view>
</total-bar-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.order_no }}</view>
<view slot="content">
<card-item-plugin label="自定义单号" value="{{item.custom_order_no}}" />
<card-item-plugin label="订单类型" value="{{item.category_name}}" />
<card-item-plugin label="订单阶段" value="{{saleOrderProcessStateObj[item.process_state]}}" />
<card-item-plugin label="经销商名称" value="{{item.custom_name}}" />
<card-item-plugin label="经销商手机" value="{{item.custom_phone}}" />
<!-- <card-item-plugin label="经销商地址" value="{{item.custom_address}}" /> -->
<card-item-plugin label="客户名称" value="{{item.end_user_name}}" />
<card-item-plugin label="客户手机" value="{{item.end_user_phone}}" />
<card-item-plugin label="客户地址" value="{{item.end_user_address}}" />
<card-item-plugin label="单据日期" value="{{item.document_date}}" />
<card-item-plugin label="含税合计" value="{{item.tot_tax_last_money}}" />
<card-item-plugin label="优惠金额" value="{{item.discount_money}}" />
<card-item-plugin label="已收金额" value="{{item.payed_amount}}" />
<card-item-plugin label="未收金额" value="{{item.un_payed_amount}}" />
<card-item-plugin label="创建日期" value="{{item.create_date}}" />
</view>
<view slot="footer" style="padding-bottom: 16rpx;">
<t-button wx:if="{{authInfo['SF_ERP_SALE_ORDERS_PAY']}}" size="small" theme="primary"
bind:tap="onOrderPay" data-index="{{index}}" style="margin-right: 24rpx;">收付款</t-button>
<t-button wx:if="{{authInfo['SF_ERP_SALE_ORDERS_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
</view>
</card-plugin>
</block>
<empty-plugin wx:if="{{list.length == 0}}" />
<card-plugin wx:for="{{ list }}" wx:key="order_no">
<view slot="header">{{ item.order_no }}</view>
<view slot="content">
<card-item-plugin label="自定义单号" value="{{item.custom_order_no}}" />
<card-item-plugin label="订单类型" value="{{item.category_name}}" />
<card-item-plugin label="订单阶段" value="{{saleOrderProcessStateObj[item.process_state]}}" />
<card-item-plugin label="经销商名称" value="{{item.custom_name}}" />
<card-item-plugin label="经销商手机" value="{{item.custom_phone}}" />
<card-item-plugin label="客户名称" value="{{item.end_user_name}}" />
<card-item-plugin label="客户手机" value="{{item.end_user_phone}}" />
<card-item-plugin label="客户地址" value="{{item.end_user_address}}" />
<card-item-plugin label="单据日期" value="{{item.document_date}}" />
<card-item-plugin label="含税合计" value="{{item.tot_tax_last_money}}" />
<card-item-plugin label="优惠金额" value="{{item.discount_money}}" />
<card-item-plugin label="已收金额" value="{{item.payed_amount}}" />
<card-item-plugin label="未收金额" value="{{item.un_payed_amount}}" />
<card-item-plugin label="创建日期" value="{{item.create_date}}" />
</view>
<view slot="footer" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_ERP_SALE_ORDERS_PAY']}}" size="small" theme="primary"
bind:tap="onOrderPay" data-index="{{index}}">收付款</t-button>
<t-button wx:if="{{authInfo['SF_ERP_SALE_ORDERS_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
total="{{count}}" bind:change="paginationChange" />
</page-plugin>

View File

@@ -18,7 +18,6 @@
<search-input label="客户地址" value="{{params.end_user_address}}" data-key="end_user_address"
bind:change="searchChange2" />
</view>
</search-popup>
<view class="tabs">
<view class="tabs-item {{ params.state == '1' ? 'active': '' }}" bind:tap="tabChange"
@@ -26,29 +25,26 @@
<view class="tabs-item {{ params.state == '2' ? 'active': '' }}" bind:tap="tabChange"
data-key="2">已处理</view>
</view>
<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.order_no }}</view>
<view slot="content">
<card-item-plugin label="自定义单号" value="{{item.custom_order_no}}" />
<card-item-plugin label="产品名称" value="{{item.goods_name}}" />
<card-item-plugin label="经销商名称" value="{{item.custom_name}}" />
<card-item-plugin label="经销商手机" value="{{item.custom_phone}}" />
<card-item-plugin label="经销商地址" value="{{item.custom_address}}" />
<card-item-plugin label="客户名称" value="{{item.end_user_name}}" />
<card-item-plugin label="客户手机" value="{{item.end_user_phone}}" />
<card-item-plugin label="客户地址" value="{{item.end_user_address}}" />
</view>
<view slot="footer" style="padding-bottom: 16rpx;">
<t-button size="small" theme="{{params.state == '1' ? 'primary' : 'danger'}}"
data-action="{{params.state == '1' ? 'end' : 'back'}}" bind:tap="onEndOrBack"
data-index="{{index}}">{{params.state == '1' ? '完成' : '撤回'}}
</t-button>
</view>
</card-plugin>
</block>
<empty-plugin wx:if="{{list.length == 0}}" />
<card-plugin wx:for="{{ list }}" wx:key="produce_info_id">
<view slot="header">{{ item.order_no }}</view>
<view slot="content">
<card-item-plugin label="自定义单号" value="{{item.custom_order_no}}" />
<card-item-plugin label="产品名称" value="{{item.goods_name}}" />
<card-item-plugin label="经销商名称" value="{{item.custom_name}}" />
<card-item-plugin label="经销商手机" value="{{item.custom_phone}}" />
<card-item-plugin label="经销商地址" value="{{item.custom_address}}" />
<card-item-plugin label="客户名称" value="{{item.end_user_name}}" />
<card-item-plugin label="客户手机" value="{{item.end_user_phone}}" />
<card-item-plugin label="客户地址" value="{{item.end_user_address}}" />
</view>
<view slot="footer" class="card-plugin-footer">
<t-button size="small" theme="{{params.state == '1' ? 'primary' : 'danger'}}"
data-action="{{params.state == '1' ? 'end' : 'back'}}" bind:tap="onEndOrBack"
data-index="{{index}}">{{params.state == '1' ? '完成' : '撤回'}}
</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,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,166 @@
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: 4 };
Page({
/**
* 页面的初始数据
*/
data: {
params: cloneLite(defaultParams) as any,
list: [] as any[],
count: 0,
payState: [
{ value: '', label: '全部' },
{ value: 1, label: '未结算' },
{ value: 2, label: '部分结算' },
{ value: 3, label: '完成结算' },
{ value: 4, 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.pay_state && temp.pay_state.length) {
temp.pay_state = temp.pay_state.join(',');
} else {
delete temp.pay_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);
});
});
},
/**
* 生命周期函数--监听页面加载
*/
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,57 @@
<page-plugin isAuth="{{authInfo['SF_ERP_PURCHASE_BACK_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.rel_bill_no}}" data-key="rel_bill_no"
bind:change="searchChange2" />
<option-cell-plugin title="结算状态" bind:change="onOptionChange" value="{{params.pay_state}}"
mode="checkbox" options="{{payState}}" 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>
<empty-plugin wx:if="{{list.length == 0}}" />
<card-plugin wx:for="{{ list }}" wx:key="bill_no">
<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" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_ERP_PURCHASE_BACK_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
total="{{count}}" bind:change="paginationChange" />
</page-plugin>

View File

@@ -1,6 +1,6 @@
<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"
<search-popup placeholder="输入单据编" bind:change="searchChange" bind:ok="searchOk"
bind:reset="searchReset" value="{{params.order_no}}" data-key="order_no">
<view slot="content">
@@ -28,34 +28,31 @@
<!-- <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>
<empty-plugin wx:if="{{list.length == 0}}" />
<card-plugin wx:for="{{ list }}" wx:key="bill_no">
<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" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_ERP_PURCHASE_STORE_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
total="{{count}}" bind:change="paginationChange" />
</page-plugin>

View File

@@ -1,6 +1,6 @@
<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"
<search-popup placeholder="输入单据编" bind:change="searchChange" bind:ok="searchOk"
bind:reset="searchReset" value="{{params.bill_no}}" data-key="bill_no">
<view slot="content">
@@ -29,32 +29,29 @@
<!-- <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>
<empty-plugin wx:if="{{list.length == 0}}" />
<card-plugin wx:for="{{ list }}" wx:key="bill_no">
<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" class="card-plugin-footer">
<t-button wx:if="{{authInfo['SF_ERP_PURCHASE_ORDER_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
</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,13 @@
{
"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, head_type: 1 };
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,54 @@
<page-plugin isAuth="{{authInfo['SF_ERP_PURCHASE_REQUEST_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>
<empty-plugin wx:if="{{list.length == 0}}" />
<card-plugin wx:for="{{ list }}" wx:key="bill_no">
<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_PURCHASE_REQUEST_DEL']}}" size="small" theme="danger"
bind:tap="onOrderDel" data-index="{{index}}">删除</t-button>
</view>
</card-plugin>
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
total="{{count}}" bind:change="paginationChange" />
</page-plugin>