From 3c7d7860b146ffc3dbee942901f3b633fb3a5b48 Mon Sep 17 00:00:00 2001
From: zhengw <247276359@qq.com>
Date: Fri, 30 Jan 2026 16:29:23 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B5=E9=9D=A2,=20?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6,=20=E5=9B=BE=E6=A0=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
miniprogram/app.json | 9 +-
miniprogram/app.wxss | 15 ++
miniprogram/assets/icons/供应商.svg | 1 +
miniprogram/assets/icons/经销商.svg | 1 +
miniprogram/assets/icons/结算账户.svg | 1 +
miniprogram/assets/icons/请购订单.svg | 1 +
miniprogram/assets/icons/采购入库.svg | 2 +-
miniprogram/assets/icons/采购订单.svg | 2 +-
miniprogram/assets/icons/采购退货.svg | 1 +
miniprogram/pages/base/account/account.json | 16 ++
miniprogram/pages/base/account/account.ts | 183 ++++++++++++++++++
miniprogram/pages/base/account/account.wxml | 55 ++++++
miniprogram/pages/base/account/account.wxss | 0
miniprogram/pages/base/customer/customer.json | 15 ++
miniprogram/pages/base/customer/customer.ts | 155 +++++++++++++++
miniprogram/pages/base/customer/customer.wxml | 37 ++++
miniprogram/pages/base/customer/customer.wxss | 0
miniprogram/pages/base/supplier/supplier.json | 15 ++
miniprogram/pages/base/supplier/supplier.ts | 155 +++++++++++++++
miniprogram/pages/base/supplier/supplier.wxml | 37 ++++
miniprogram/pages/base/supplier/supplier.wxss | 0
.../components/card-plugin/card-plugin.wxss | 11 --
.../components/empty-plugin/empty-plugin.json | 6 +
.../components/empty-plugin/empty-plugin.ts | 24 +++
.../components/empty-plugin/empty-plugin.wxml | 1 +
.../components/empty-plugin/empty-plugin.wxss | 0
miniprogram/pages/finance/flow/flow.ts | 2 +-
miniprogram/pages/finance/flow/flow.wxml | 45 ++---
miniprogram/pages/finance/giro/giro.ts | 2 +-
miniprogram/pages/finance/giro/giro.wxml | 47 +++--
miniprogram/pages/finance/income/income.ts | 2 +-
miniprogram/pages/finance/income/income.wxml | 51 +++--
miniprogram/pages/finance/outcome/outcome.ts | 2 +-
.../pages/finance/outcome/outcome.wxml | 51 +++--
.../pages/orders/orderSort/orderSort.wxml | 49 +++--
.../pages/orders/ordersList/ordersList.wxml | 56 +++---
.../processManageDetail.wxml | 44 ++---
.../pages/purchase/backOrder/backOrder.json | 14 ++
.../pages/purchase/backOrder/backOrder.ts | 166 ++++++++++++++++
.../pages/purchase/backOrder/backOrder.wxml | 57 ++++++
.../pages/purchase/backOrder/backOrder.wxss | 0
.../pages/purchase/buyInOrder/buyInOrder.wxml | 55 +++---
.../pages/purchase/buyOrder/buyOrder.wxml | 51 +++--
.../purchase/requestOrder/requestOrder.json | 13 ++
.../purchase/requestOrder/requestOrder.ts | 164 ++++++++++++++++
.../purchase/requestOrder/requestOrder.wxml | 54 ++++++
.../purchase/requestOrder/requestOrder.wxss | 0
miniprogram/utils/menuConfig.ts | 32 +++
48 files changed, 1442 insertions(+), 258 deletions(-)
create mode 100644 miniprogram/assets/icons/供应商.svg
create mode 100644 miniprogram/assets/icons/经销商.svg
create mode 100644 miniprogram/assets/icons/结算账户.svg
create mode 100644 miniprogram/assets/icons/请购订单.svg
create mode 100644 miniprogram/assets/icons/采购退货.svg
create mode 100644 miniprogram/pages/base/account/account.json
create mode 100644 miniprogram/pages/base/account/account.ts
create mode 100644 miniprogram/pages/base/account/account.wxml
create mode 100644 miniprogram/pages/base/account/account.wxss
create mode 100644 miniprogram/pages/base/customer/customer.json
create mode 100644 miniprogram/pages/base/customer/customer.ts
create mode 100644 miniprogram/pages/base/customer/customer.wxml
create mode 100644 miniprogram/pages/base/customer/customer.wxss
create mode 100644 miniprogram/pages/base/supplier/supplier.json
create mode 100644 miniprogram/pages/base/supplier/supplier.ts
create mode 100644 miniprogram/pages/base/supplier/supplier.wxml
create mode 100644 miniprogram/pages/base/supplier/supplier.wxss
create mode 100644 miniprogram/pages/components/empty-plugin/empty-plugin.json
create mode 100644 miniprogram/pages/components/empty-plugin/empty-plugin.ts
create mode 100644 miniprogram/pages/components/empty-plugin/empty-plugin.wxml
create mode 100644 miniprogram/pages/components/empty-plugin/empty-plugin.wxss
create mode 100644 miniprogram/pages/purchase/backOrder/backOrder.json
create mode 100644 miniprogram/pages/purchase/backOrder/backOrder.ts
create mode 100644 miniprogram/pages/purchase/backOrder/backOrder.wxml
create mode 100644 miniprogram/pages/purchase/backOrder/backOrder.wxss
create mode 100644 miniprogram/pages/purchase/requestOrder/requestOrder.json
create mode 100644 miniprogram/pages/purchase/requestOrder/requestOrder.ts
create mode 100644 miniprogram/pages/purchase/requestOrder/requestOrder.wxml
create mode 100644 miniprogram/pages/purchase/requestOrder/requestOrder.wxss
diff --git a/miniprogram/app.json b/miniprogram/app.json
index 4045648..a987251 100644
--- a/miniprogram/app.json
+++ b/miniprogram/app.json
@@ -14,7 +14,12 @@
"pages/finance/outcome/outcome",
"pages/finance/income/income",
"pages/finance/giro/giro",
- "pages/finance/flow/flow"
+ "pages/finance/flow/flow",
+ "pages/purchase/requestOrder/requestOrder",
+ "pages/purchase/backOrder/backOrder",
+ "pages/base/supplier/supplier",
+ "pages/base/customer/customer",
+ "pages/base/account/account"
],
"window": {
"navigationBarTextStyle": "black",
@@ -26,7 +31,7 @@
"usingComponents": {
"page-plugin": "pages/components/page-plugin/page-plugin",
"t-button": "tdesign-miniprogram/button/button",
- "t-empty": "tdesign-miniprogram/empty/empty"
+ "empty-plugin": "pages/components/empty-plugin/empty-plugin"
},
"resolveAlias": {
"@/*": "/*"
diff --git a/miniprogram/app.wxss b/miniprogram/app.wxss
index 2337e05..1b91060 100644
--- a/miniprogram/app.wxss
+++ b/miniprogram/app.wxss
@@ -22,3 +22,18 @@ view.t-cell__title-text {
white-space: nowrap;
flex-shrink: 0;
}
+
+.card-plugin-footer {
+ border-top: 1rpx solid #ddd;
+ padding: 16rpx 24rpx;
+ display: flex;
+ width: 100%;
+ box-sizing: border-box;
+ flex-wrap: wrap;
+ column-gap: 16rpx;
+ row-gap: 16rpx;
+}
+
+.card-plugin-footer:empty {
+ display: none;
+}
diff --git a/miniprogram/assets/icons/供应商.svg b/miniprogram/assets/icons/供应商.svg
new file mode 100644
index 0000000..d755aee
--- /dev/null
+++ b/miniprogram/assets/icons/供应商.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/assets/icons/经销商.svg b/miniprogram/assets/icons/经销商.svg
new file mode 100644
index 0000000..eaabb1e
--- /dev/null
+++ b/miniprogram/assets/icons/经销商.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/assets/icons/结算账户.svg b/miniprogram/assets/icons/结算账户.svg
new file mode 100644
index 0000000..dd69233
--- /dev/null
+++ b/miniprogram/assets/icons/结算账户.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/assets/icons/请购订单.svg b/miniprogram/assets/icons/请购订单.svg
new file mode 100644
index 0000000..7beebf9
--- /dev/null
+++ b/miniprogram/assets/icons/请购订单.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/assets/icons/采购入库.svg b/miniprogram/assets/icons/采购入库.svg
index 060e5c2..c4a69a4 100644
--- a/miniprogram/assets/icons/采购入库.svg
+++ b/miniprogram/assets/icons/采购入库.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/miniprogram/assets/icons/采购订单.svg b/miniprogram/assets/icons/采购订单.svg
index 850073f..ae30049 100644
--- a/miniprogram/assets/icons/采购订单.svg
+++ b/miniprogram/assets/icons/采购订单.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/miniprogram/assets/icons/采购退货.svg b/miniprogram/assets/icons/采购退货.svg
new file mode 100644
index 0000000..e7fd557
--- /dev/null
+++ b/miniprogram/assets/icons/采购退货.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/pages/base/account/account.json b/miniprogram/pages/base/account/account.json
new file mode 100644
index 0000000..47c0e04
--- /dev/null
+++ b/miniprogram/pages/base/account/account.json
@@ -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": "结算账户"
+}
\ No newline at end of file
diff --git a/miniprogram/pages/base/account/account.ts b/miniprogram/pages/base/account/account.ts
new file mode 100644
index 0000000..9979791
--- /dev/null
+++ b/miniprogram/pages/base/account/account.ts
@@ -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() {},
+});
diff --git a/miniprogram/pages/base/account/account.wxml b/miniprogram/pages/base/account/account.wxml
new file mode 100644
index 0000000..4856c96
--- /dev/null
+++ b/miniprogram/pages/base/account/account.wxml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.account_name }}
+
+
+
+ 正常
+ 禁用
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/base/account/account.wxss b/miniprogram/pages/base/account/account.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram/pages/base/customer/customer.json b/miniprogram/pages/base/customer/customer.json
new file mode 100644
index 0000000..b47336d
--- /dev/null
+++ b/miniprogram/pages/base/customer/customer.json
@@ -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": "经销商"
+}
\ No newline at end of file
diff --git a/miniprogram/pages/base/customer/customer.ts b/miniprogram/pages/base/customer/customer.ts
new file mode 100644
index 0000000..3b20766
--- /dev/null
+++ b/miniprogram/pages/base/customer/customer.ts
@@ -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() {},
+});
diff --git a/miniprogram/pages/base/customer/customer.wxml b/miniprogram/pages/base/customer/customer.wxml
new file mode 100644
index 0000000..621cbf9
--- /dev/null
+++ b/miniprogram/pages/base/customer/customer.wxml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.crm_name }}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/base/customer/customer.wxss b/miniprogram/pages/base/customer/customer.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram/pages/base/supplier/supplier.json b/miniprogram/pages/base/supplier/supplier.json
new file mode 100644
index 0000000..f4f59ee
--- /dev/null
+++ b/miniprogram/pages/base/supplier/supplier.json
@@ -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": "供应商"
+}
\ No newline at end of file
diff --git a/miniprogram/pages/base/supplier/supplier.ts b/miniprogram/pages/base/supplier/supplier.ts
new file mode 100644
index 0000000..9405900
--- /dev/null
+++ b/miniprogram/pages/base/supplier/supplier.ts
@@ -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() {},
+});
diff --git a/miniprogram/pages/base/supplier/supplier.wxml b/miniprogram/pages/base/supplier/supplier.wxml
new file mode 100644
index 0000000..f72f19b
--- /dev/null
+++ b/miniprogram/pages/base/supplier/supplier.wxml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.crm_name }}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/base/supplier/supplier.wxss b/miniprogram/pages/base/supplier/supplier.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram/pages/components/card-plugin/card-plugin.wxss b/miniprogram/pages/components/card-plugin/card-plugin.wxss
index 203d58c..c551c01 100644
--- a/miniprogram/pages/components/card-plugin/card-plugin.wxss
+++ b/miniprogram/pages/components/card-plugin/card-plugin.wxss
@@ -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;
diff --git a/miniprogram/pages/components/empty-plugin/empty-plugin.json b/miniprogram/pages/components/empty-plugin/empty-plugin.json
new file mode 100644
index 0000000..e21f663
--- /dev/null
+++ b/miniprogram/pages/components/empty-plugin/empty-plugin.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-empty": "tdesign-miniprogram/empty/empty"
+ }
+}
\ No newline at end of file
diff --git a/miniprogram/pages/components/empty-plugin/empty-plugin.ts b/miniprogram/pages/components/empty-plugin/empty-plugin.ts
new file mode 100644
index 0000000..c4be81b
--- /dev/null
+++ b/miniprogram/pages/components/empty-plugin/empty-plugin.ts
@@ -0,0 +1,24 @@
+// pages/components/empty-plugin/empty-plugin.ts
+Component({
+
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+
+ }
+})
\ No newline at end of file
diff --git a/miniprogram/pages/components/empty-plugin/empty-plugin.wxml b/miniprogram/pages/components/empty-plugin/empty-plugin.wxml
new file mode 100644
index 0000000..e08a716
--- /dev/null
+++ b/miniprogram/pages/components/empty-plugin/empty-plugin.wxml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/miniprogram/pages/components/empty-plugin/empty-plugin.wxss b/miniprogram/pages/components/empty-plugin/empty-plugin.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram/pages/finance/flow/flow.ts b/miniprogram/pages/finance/flow/flow.ts
index d3602ee..327934c 100644
--- a/miniprogram/pages/finance/flow/flow.ts
+++ b/miniprogram/pages/finance/flow/flow.ts
@@ -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(() => {
diff --git a/miniprogram/pages/finance/flow/flow.wxml b/miniprogram/pages/finance/flow/flow.wxml
index 816e197..b004b6d 100644
--- a/miniprogram/pages/finance/flow/flow.wxml
+++ b/miniprogram/pages/finance/flow/flow.wxml
@@ -25,30 +25,27 @@
-
-
-
- {{ item.rel_bill_no }}
-
-
-
-
-
-
-
-
-
- {{item.creator_name}}
- ({{item.creator_nick_name}})
-
-
-
-
-
-
-
-
+
+
+ {{ item.rel_bill_no }}
+
+
+
+
+
+
+
+
+
+ {{item.creator_name}}
+ ({{item.creator_nick_name}})
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/finance/giro/giro.ts b/miniprogram/pages/finance/giro/giro.ts
index 494b5fc..aa5ae2c 100644
--- a/miniprogram/pages/finance/giro/giro.ts
+++ b/miniprogram/pages/finance/giro/giro.ts
@@ -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(() => {
diff --git a/miniprogram/pages/finance/giro/giro.wxml b/miniprogram/pages/finance/giro/giro.wxml
index ff2c876..ab161d2 100644
--- a/miniprogram/pages/finance/giro/giro.wxml
+++ b/miniprogram/pages/finance/giro/giro.wxml
@@ -25,31 +25,28 @@
-
-
-
- {{ item.bill_no }}
-
-
-
-
- {{item.creator_name}}
- ({{item.creator_nick_name}})
-
-
-
-
-
-
-
-
-
- 删除
-
-
-
+
+
+ {{ item.bill_no }}
+
+
+
+
+ {{item.creator_name}}
+ ({{item.creator_nick_name}})
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/finance/income/income.ts b/miniprogram/pages/finance/income/income.ts
index a2f4ed9..a33960a 100644
--- a/miniprogram/pages/finance/income/income.ts
+++ b/miniprogram/pages/finance/income/income.ts
@@ -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(() => {
diff --git a/miniprogram/pages/finance/income/income.wxml b/miniprogram/pages/finance/income/income.wxml
index 9bac301..2a5b2c9 100644
--- a/miniprogram/pages/finance/income/income.wxml
+++ b/miniprogram/pages/finance/income/income.wxml
@@ -28,33 +28,30 @@
-
-
-
- {{ item.bill_no }}
-
-
-
-
-
- {{item.creator_name}}
- ({{item.creator_nick_name}})
-
-
-
-
-
-
-
-
-
-
- 删除
-
-
-
+
+
+ {{ item.bill_no }}
+
+
+
+
+
+ {{item.creator_name}}
+ ({{item.creator_nick_name}})
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/finance/outcome/outcome.ts b/miniprogram/pages/finance/outcome/outcome.ts
index 138e889..d1591fc 100644
--- a/miniprogram/pages/finance/outcome/outcome.ts
+++ b/miniprogram/pages/finance/outcome/outcome.ts
@@ -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(() => {
diff --git a/miniprogram/pages/finance/outcome/outcome.wxml b/miniprogram/pages/finance/outcome/outcome.wxml
index 28f64c3..f15fd1e 100644
--- a/miniprogram/pages/finance/outcome/outcome.wxml
+++ b/miniprogram/pages/finance/outcome/outcome.wxml
@@ -28,33 +28,30 @@
-
-
-
- {{ item.bill_no }}
-
-
-
-
-
- {{item.creator_name}}
- ({{item.creator_nick_name}})
-
-
-
-
-
-
-
-
-
-
- 删除
-
-
-
+
+
+ {{ item.bill_no }}
+
+
+
+
+
+ {{item.creator_name}}
+ ({{item.creator_nick_name}})
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/orders/orderSort/orderSort.wxml b/miniprogram/pages/orders/orderSort/orderSort.wxml
index 2c68011..394cf21 100644
--- a/miniprogram/pages/orders/orderSort/orderSort.wxml
+++ b/miniprogram/pages/orders/orderSort/orderSort.wxml
@@ -1,30 +1,27 @@
-
-
-
-
- {{ item.order_no }}
-
- {{index + 1}}
-
+
+
+
+ {{ item.order_no }}
+
+ {{index + 1}}
-
-
-
-
-
-
-
-
-
-
-
- 移至顶部
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/orders/ordersList/ordersList.wxml b/miniprogram/pages/orders/ordersList/ordersList.wxml
index ef92871..becad12 100644
--- a/miniprogram/pages/orders/ordersList/ordersList.wxml
+++ b/miniprogram/pages/orders/ordersList/ordersList.wxml
@@ -58,36 +58,32 @@
¥{{amount.tot_un_payed_amount}}
-
-
-
- {{ item.order_no }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 收付款
- 删除
-
-
-
+
+
+ {{ item.order_no }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/produce/processManageDetail/processManageDetail.wxml b/miniprogram/pages/produce/processManageDetail/processManageDetail.wxml
index 5fdfe29..d52f5e1 100644
--- a/miniprogram/pages/produce/processManageDetail/processManageDetail.wxml
+++ b/miniprogram/pages/produce/processManageDetail/processManageDetail.wxml
@@ -18,7 +18,6 @@
-
已处理
-
-
-
- {{ item.order_no }}
-
-
-
-
-
-
-
-
-
-
-
- {{params.state == '1' ? '完成' : '撤回'}}
-
-
-
-
+
+
+ {{ item.order_no }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/miniprogram/pages/purchase/backOrder/backOrder.json b/miniprogram/pages/purchase/backOrder/backOrder.json
new file mode 100644
index 0000000..21babb6
--- /dev/null
+++ b/miniprogram/pages/purchase/backOrder/backOrder.json
@@ -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": "采购退货"
+}
\ No newline at end of file
diff --git a/miniprogram/pages/purchase/backOrder/backOrder.ts b/miniprogram/pages/purchase/backOrder/backOrder.ts
new file mode 100644
index 0000000..f4b86a3
--- /dev/null
+++ b/miniprogram/pages/purchase/backOrder/backOrder.ts
@@ -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() {},
+});
diff --git a/miniprogram/pages/purchase/backOrder/backOrder.wxml b/miniprogram/pages/purchase/backOrder/backOrder.wxml
new file mode 100644
index 0000000..d6ae4d4
--- /dev/null
+++ b/miniprogram/pages/purchase/backOrder/backOrder.wxml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.bill_no }}
+
+
+
+
+
+ {{item.creator_name}}
+ ({{item.creator_nick_name}})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/purchase/backOrder/backOrder.wxss b/miniprogram/pages/purchase/backOrder/backOrder.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram/pages/purchase/buyInOrder/buyInOrder.wxml b/miniprogram/pages/purchase/buyInOrder/buyInOrder.wxml
index 2fc89bb..3725549 100644
--- a/miniprogram/pages/purchase/buyInOrder/buyInOrder.wxml
+++ b/miniprogram/pages/purchase/buyInOrder/buyInOrder.wxml
@@ -1,6 +1,6 @@
-
@@ -28,34 +28,31 @@
-
-
-
- {{ item.bill_no }}
-
-
-
-
-
- {{item.creator_name}}
- ({{item.creator_nick_name}})
-
-
-
-
-
-
-
-
-
-
-
- 删除
-
-
-
+
+
+ {{ item.bill_no }}
+
+
+
+
+
+ {{item.creator_name}}
+ ({{item.creator_nick_name}})
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/purchase/buyOrder/buyOrder.wxml b/miniprogram/pages/purchase/buyOrder/buyOrder.wxml
index d37546b..86a5840 100644
--- a/miniprogram/pages/purchase/buyOrder/buyOrder.wxml
+++ b/miniprogram/pages/purchase/buyOrder/buyOrder.wxml
@@ -1,6 +1,6 @@
-
@@ -29,32 +29,29 @@
-
-
-
- {{ item.bill_no }}
-
-
-
-
-
- {{item.creator_name}}
- ({{item.creator_nick_name}})
-
-
-
-
-
-
-
-
-
- 删除
-
-
-
+
+
+ {{ item.bill_no }}
+
+
+
+
+
+ {{item.creator_name}}
+ ({{item.creator_nick_name}})
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/purchase/requestOrder/requestOrder.json b/miniprogram/pages/purchase/requestOrder/requestOrder.json
new file mode 100644
index 0000000..b205022
--- /dev/null
+++ b/miniprogram/pages/purchase/requestOrder/requestOrder.json
@@ -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": "请购订单"
+}
\ No newline at end of file
diff --git a/miniprogram/pages/purchase/requestOrder/requestOrder.ts b/miniprogram/pages/purchase/requestOrder/requestOrder.ts
new file mode 100644
index 0000000..0f5f730
--- /dev/null
+++ b/miniprogram/pages/purchase/requestOrder/requestOrder.ts
@@ -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() {},
+});
diff --git a/miniprogram/pages/purchase/requestOrder/requestOrder.wxml b/miniprogram/pages/purchase/requestOrder/requestOrder.wxml
new file mode 100644
index 0000000..bdb70b4
--- /dev/null
+++ b/miniprogram/pages/purchase/requestOrder/requestOrder.wxml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.bill_no }}
+
+
+
+
+ {{item.creator_name}}
+ ({{item.creator_nick_name}})
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/miniprogram/pages/purchase/requestOrder/requestOrder.wxss b/miniprogram/pages/purchase/requestOrder/requestOrder.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/miniprogram/utils/menuConfig.ts b/miniprogram/utils/menuConfig.ts
index faaca8d..1b39a9d 100644
--- a/miniprogram/utils/menuConfig.ts
+++ b/miniprogram/utils/menuConfig.ts
@@ -45,6 +45,11 @@ export const menuConfig = [
icon: 'cart-add',
iconColor: iconColor,
children: [
+ {
+ title: '请购订单',
+ url: '/pages/purchase/requestOrder/requestOrder',
+ auth: 'SF_ERP_PURCHASE_REQUEST_VIEW',
+ },
{
title: '采购订单',
url: '/pages/purchase/buyOrder/buyOrder',
@@ -55,6 +60,11 @@ export const menuConfig = [
url: '/pages/purchase/buyInOrder/buyInOrder',
auth: 'SF_ERP_PURCHASE_STORE_VIEW',
},
+ {
+ title: '采购退货',
+ url: '/pages/purchase/backOrder/backOrder',
+ auth: 'SF_ERP_PURCHASE_BACK_VIEW',
+ },
],
},
{
@@ -84,4 +94,26 @@ export const menuConfig = [
},
],
},
+ {
+ title: '基础资料',
+ icon: 'grid-view',
+ iconColor: iconColor,
+ children: [
+ {
+ title: '供应商',
+ url: '/pages/base/supplier/supplier',
+ auth: 'SF_ERP_SUPPLIER_VIEW',
+ },
+ {
+ title: '经销商',
+ url: '/pages/base/customer/customer',
+ auth: 'SF_ERP_CUSTOMER_VIEW',
+ },
+ {
+ title: '结算账户',
+ url: '/pages/base/account/account',
+ auth: 'SF_ERP_ACCOUNT_VIEW',
+ },
+ ],
+ },
];