添加组件及页面
This commit is contained in:
@@ -2,7 +2,11 @@
|
||||
"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"
|
||||
"card-item-plugin": "/pages/components/card-item-plugin/card-item-plugin",
|
||||
"t-dialog": "tdesign-miniprogram/dialog/dialog",
|
||||
"t-input": "tdesign-miniprogram/input/input",
|
||||
"pagination-plugin": "/pages/components/pagination-plugin/pagination-plugin",
|
||||
"search-input": "/pages/components/search-input/search-input"
|
||||
},
|
||||
"navigationBarTitleText": "流程管理详情"
|
||||
}
|
||||
|
||||
@@ -1,50 +1,117 @@
|
||||
import { getDataSet } from "@/utils/util";
|
||||
import { loginStatus, post } from '@/utils/https';
|
||||
import { getAuthInfo, getDataSet, toArray, toastSuccess, toNumber } from '@/utils/util';
|
||||
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
params: { curr_page: 1, page_count: 20, state: "1", process_id: "" },
|
||||
list: [
|
||||
{
|
||||
order_no: "XSDD2025112500000043",
|
||||
custom_name: "客户5",
|
||||
custom_address: "",
|
||||
custom_phone: null,
|
||||
custom_order_no: "",
|
||||
goods_name: "浴室柜",
|
||||
info_process_id: 163,
|
||||
produce_info_id: 62,
|
||||
process_code: "ld",
|
||||
state: 1,
|
||||
end_user_address: null,
|
||||
end_user_name: null,
|
||||
end_user_phone: null,
|
||||
},
|
||||
],
|
||||
count: 1,
|
||||
params: { curr_page: 1, page_count: 20, state: '1', process_id: '' } as any,
|
||||
list: [] as any[],
|
||||
count: 0,
|
||||
dialog: {
|
||||
visible: false,
|
||||
content: '',
|
||||
item: {} as any,
|
||||
action: '' as 'end' | 'back',
|
||||
},
|
||||
},
|
||||
handleLogin(e: any) {
|
||||
this.setData({ isLogin: e.detail });
|
||||
if (e.detail) {
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
init() {
|
||||
this.setData({ authInfo: getAuthInfo() });
|
||||
this.getList();
|
||||
},
|
||||
searchChange(e: any) {
|
||||
this.data.params.order_no = e.detail.value;
|
||||
},
|
||||
searchChange2(e: any) {
|
||||
const key = getDataSet(e).key;
|
||||
const val = `${e.detail.value || ''}`.trim();
|
||||
console.log(e);
|
||||
if (val) {
|
||||
this.data.params[key] = val;
|
||||
} else {
|
||||
delete this.data.params[key];
|
||||
}
|
||||
},
|
||||
searchOk() {
|
||||
this.getList(1);
|
||||
},
|
||||
tabChange(e: any) {
|
||||
const state = getDataSet(e).key;
|
||||
this.data.params.state = state;
|
||||
this.page();
|
||||
this.getList();
|
||||
},
|
||||
page(curr: number = 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 });
|
||||
post('CompanyProcessV2/processOrd', this.data.params).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,
|
||||
});
|
||||
});
|
||||
},
|
||||
confirmDialog() {
|
||||
post('ProduceOrder/setProcessV2', {
|
||||
info_process_id: JSON.stringify([this.data.dialog.item.info_process_id]),
|
||||
action: this.data.dialog.action,
|
||||
}).then(() => {
|
||||
this.closeDialog();
|
||||
toastSuccess(this.data.dialog.action == 'end' ? '订单工序完成成功' : '订单工序撤回成功');
|
||||
setTimeout(() => {
|
||||
this.getList(this.data.params.curr_page);
|
||||
}, 1500);
|
||||
});
|
||||
},
|
||||
closeDialog() {
|
||||
this.data.dialog.visible = false;
|
||||
this.setData({ dialog: this.data.dialog });
|
||||
},
|
||||
onEndOrBack(e: any) {
|
||||
const data = getDataSet(e);
|
||||
const index = data.index;
|
||||
const item = this.data.list[index];
|
||||
this.setData({
|
||||
dialog: {
|
||||
visible: true,
|
||||
content: `确认${data.action == 'end' ? '完成' : '撤回'} ${item.order_no} ?`,
|
||||
action: data.action,
|
||||
item,
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
// console.log(options);
|
||||
wx.setNavigationBarTitle({
|
||||
title: decodeURIComponent(options.title || ""),
|
||||
title: decodeURIComponent(options.title || ''),
|
||||
});
|
||||
this.data.params.process_id = `${options.process_id || ""}`;
|
||||
this.page();
|
||||
this.data.params.process_id = `${options.process_id || ''}`;
|
||||
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);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -82,4 +149,3 @@ Page({
|
||||
*/
|
||||
onShareAppMessage() {},
|
||||
});
|
||||
|
||||
|
||||
@@ -1,17 +1,49 @@
|
||||
<search-popup placeholder="输入销售单号" />
|
||||
<view class="tabs">
|
||||
<view class="tabs-item {{ params.state == '1' ? 'active': '' }}" bind:tap="tabChange" data-key="1">待处理</view>
|
||||
<view class="tabs-item {{ params.state == '2' ? 'active': '' }}" bind:tap="tabChange" data-key="2">已处理</view>
|
||||
</view>
|
||||
<block wx:for="{{ list }}" wx:key="info_process_id">
|
||||
<card-plugin>
|
||||
<view slot="header">{{ item.order_no }}</view>
|
||||
<page-plugin isAuth="{{authInfo['SF_ERP_PRODUCT_PROCESS_VIEW']}}" loading="{{loading}}"
|
||||
is-login="{{isLogin}}" bind:handleLogin="handleLogin">
|
||||
<search-popup placeholder="输入销售单号" bind:change="searchChange" bind:ok="searchOk">
|
||||
<view slot="content">
|
||||
<card-item-plugin label="订单编号" value="1哒哒哒哒哒哒多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多多" />
|
||||
<card-item-plugin label="订单编号" value="111111" />
|
||||
<card-item-plugin label="订单编号" value="111111" />
|
||||
<card-item-plugin label="订单编号" value="111111" />
|
||||
<search-input label="自定义单号" data-key="custom_order_no" bind:change="searchChange2" />
|
||||
<search-input label="经销商名称" data-key="custom_name" bind:change="searchChange2" />
|
||||
<search-input label="经销商手机" data-key="custom_phone" bind:change="searchChange2" />
|
||||
<search-input label="经销商地址" data-key="custom_address" bind:change="searchChange2" />
|
||||
<search-input label="客户名称" data-key="end_user_name" bind:change="searchChange2" />
|
||||
<search-input label="客户手机" data-key="end_user_phone" bind:change="searchChange2" />
|
||||
<search-input label="客户地址" data-key="end_user_address" bind:change="searchChange2" />
|
||||
</view>
|
||||
</card-plugin>
|
||||
</block>
|
||||
|
||||
</search-popup>
|
||||
<view class="tabs">
|
||||
<view class="tabs-item {{ params.state == '1' ? 'active': '' }}" bind:tap="tabChange"
|
||||
data-key="1">待处理</view>
|
||||
<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>
|
||||
<pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
|
||||
total="{{count}}" bind:change="paginationChange" />
|
||||
</page-plugin>
|
||||
<t-dialog visible="{{dialog.visible}}" title="系统提示" content="{{dialog.content}}"
|
||||
confirm-btn="{{{ content: '确定', theme: 'primary', variant: 'base'} }}" cancel-btn="取消"
|
||||
bind:confirm="confirmDialog" bind:cancel="closeDialog" />
|
||||
Reference in New Issue
Block a user