| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302 |
- <template>
- <u-popup :show="show" @close="openList" @open="openList" mode="right" customStyle="width: 100vw;">
- <view class="order_list">
- <u-navbar class="nav-bar" title="开单记录" :autoBack="false" :placeholder="true" v-hideNav
- @leftClick="hideList"></u-navbar>
- <view class="search_form">
- <u-search placeholder="请输入品牌名称" v-model="searchInfo.dictLabel" :showCancel="true" @custom="searchOrderList"></u-search>
- <view @click="openSearchModal">
- <u-icon name="grid" size="20" color="#666666"></u-icon>
- </view>
- </view>
- <!-- 筛选 -->
- <u-popup mode="bottom" :round="10" :show="searchShow" closeable @close="closeSearchModal">
- <u-form class="search_pop" labelPosition="left" :model="searchInfo" ref="uForm">
- <u-form-item label="时间范围" labelWidth="70" @click="openTimePicker">
- <Cell :val="searchInfo.time" :isDelete="true" :border="true" @handleClear="clear('time')"></Cell>
- <jtimePickerPopup :isShowShortTimeList="true" shortTimeTitle="快捷时间" :shortTimeList="shortTimeList"
- :isShowSeletTimeTitle="true" seletTimeTitle="时间选择" cancelText="取消" confirmText="确认"
- :endSelectMonth="-1" :endSelectDay="-1" beginTimePlaceHolder='开始时间' endTimePlaceHolder="结束时间"
- :isDateTypeRange="true" :isShowSelectedTimeEcho="true" @confirm="getSelectTime" :defaultSelect="0"
- ref="jtimePickerPopupRef">
- </jtimePickerPopup>
- </u-form-item>
- <u-form-item label="开单人" @click="openRecyclePersonPicker" labelWidth="70">
- <Cell :val="searchInfo.recyclePerson" :isDelete="true" :border="true" @handleClear="clear('recyclePerson')"></Cell>
- <PersonPicker ref="recyclePersonPickerRef" title="请选择开单人" @selectPerson="handleSelectRecyclePerson"></PersonPicker>
- </u-form-item>
- <u-form-item label="物品分类" labelWidth="70">
- <TabSelect :tabList="typeList" :echoInfo="searchInfo.type" :colNum="4" mode="multiple" labelKey="dictLabel" valueKey="dictValue" @tabChange="handleTabChangeType"></TabSelect>
- </u-form-item>
- </u-form>
- <view class="btns">
- <u-button text="重置" @click="resetForm"></u-button>
- <u-button type="primary" text="确定" @click="submitSearch"></u-button>
- </view>
- </u-popup>
- <!-- 删除二次确认 -->
- <u-modal :show="deleteShow" title="确认要删除该订单吗?" :showCancelButton="true" @confirm="confirmDelete" @cancel="cancelDelete"></u-modal>
- <!-- 编辑弹窗 -->
- <OrderListEdit ref="orderListEditRef" title="编辑" :orderInfo="curInfo" @confirm="confirmEdit"></OrderListEdit>
- <scroll-view class="list_wrap" scroll-y @scrolltolower="loadMore" enable-back-to-top>
- <view class="order_item" v-for="(item, index) in orderList" :key="index">
- <u-swipe-action>
- <u-swipe-action-item :options="swipeOptions" @click="(e) => handleSwipeClick(e, item)">
- <view class="order_col_1">
- <view class="order_info title">品牌:{{ item.dictLabel || '-' }}</view>
- </view>
- <view class="order_col_2">
- <view class="order_info">付款方式:{{ payTypeFormatter(item.payType) || '-' }}</view>
- <view class="order_info">开单人:{{ item.recyclePerson || '-' }}</view>
- <view class="order_info">开单数量:{{ item.quantity || '-' }}</view>
- <view class="order_info">开单日期:{{ orderDateFormatter(item.orderDate) || '-' }}</view>
- <view class="order_info">订单类型:{{ orderTypeFormatter(item.orderType) || '-' }}</view>
- <view class="order_info">商品分类:{{ typeFormatter(item.type) || '-' }}</view>
- <view class="order_info money">成交金额:{{ item.dealPrice || '-' }}元</view>
- <view class="order_info money">实收总计:{{ item.amountReceived || '-' }}元</view>
- </view>
- <view class="order_col_1">
- <view class="order_info">开单备注:{{ item.orderRemark || '-' }}</view>
- <view class="order_info">收货地址:{{ item.address || '-' }}</view>
- <view class="order_info">售后保障配置:{{ afterSaleTabFormatter(item.afterSaleTab) || '-' }}</view>
- <view class="order_info scroll_img">支付凭证图片:
- <ImgsRowScroll v-if="item.payTypeProofPicFileList.length > 0" imgMode="aspectFill"
- :totalWidth="400" :images="item.payTypeProofPicFileList" :previewEnabled="true"
- :imageWidth="150" :imageHeight="150"></ImgsRowScroll>
- <text v-else>暂无图片</text>
- </view>
- </view>
- </u-swipe-action-item>
- </u-swipe-action>
- </view>
- <u-empty v-if="orderList.length === 0" mode="search"></u-empty>
- </scroll-view>
- </view>
- </u-popup>
- </template>
- <script>
- import ImgsRowScroll from '@/components/imgs-row-scroll/index.vue'
- import { afterSaleTabList,paymentTabList,shortTimeList } from '../../js/public.js'
- import jtimePickerPopup from '@/uni_modules/jtime-picker-popup/components/JTimePicker/JTimePicker.vue';
- import Cell from '@/components/custom-cell/index.vue'
- import PersonPicker from '@/components/person-picker/index.vue'
- import TabSelect from '@/components/custom-tab-select/index.vue'
- import OrderListEdit from './edit.vue'
- export default {
- name: 'OrderList',
- components: {
- ImgsRowScroll,
- jtimePickerPopup,
- Cell,
- PersonPicker,
- TabSelect,
- OrderListEdit,
- },
- data() {
- return {
- show: false,
- orderList: [],
- searchInfo: {
- pageNum: 1,
- pageSize: 10,
- dictLabel: '',
- time: '',
- startTime: '',
- endTime: '',
- recyclePerson: '',
- recyclePersonId: '',
- type:[]
- },
- total: 0,
- orderTypeList: [],
- typeList: [],
- searchShow: false,
- deleteShow: false,
- shortTimeList: shortTimeList,
- swipeOptions: [
- {
- text: '编辑',
- style: {
- backgroundColor: '#409eff'
- }
- },
- {
- text: '删除',
- style: {
- backgroundColor: '#f56c6c'
- }
- },
- ],
- curInfo: {},
- // payTypeProofPicFileList: ['https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/28/1769587638946-mosaic-1769587638729.jpeg','https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/28/1769587638946-mosaic-1769587638729.jpeg','https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/28/1769587638946-mosaic-1769587638729.jpeg','https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/28/1769587638946-mosaic-1769587638729.jpeg','https://xiaohulu-crm.oss-cn-shanghai.aliyuncs.com/crm/2026/01/28/1769587638946-mosaic-1769587638729.jpeg'],
- }
- },
- props: {
- },
- emits: [],
- methods: {
- confirmEdit(){
- this.searchOrderList()
- },
- handleSwipeClick(e, item) {
- this.curInfo = item;
- this.$nextTick(()=>{
- if(e.index == 0){
- this.$refs.orderListEditRef.showModal();
- } else if(e.index == 1){//删除
- this.deleteShow = true;
- }
- })
- },
- confirmDelete() {
- uni.$u.api.wareHouseOrderDelete({
- id: this.curInfo.id
- }).then(() => {
- uni.$u.toast('删除成功');
- this.deleteShow = false;
- this.show = false;
- this.searchOrderList();
- }).catch(err => {
- uni.$u.toast(err || '删除失败');
- });
- },
- cancelDelete(){
- this.deleteShow = false;
- },
- clear(val){
- if(val == 'time'){
- this.searchInfo.time = '';
- this.searchInfo.startTime = '';
- this.searchInfo.endTime = '';
- }
- if(val == 'recyclePerson'){
- this.searchInfo.recyclePerson = '';
- this.searchInfo.recyclePersonId = '';
- }
- },
- getSelectTime(val) {
- this.searchInfo.startTime = this.$dayjs(val.beginTime).format('YYYY-MM-DD');
- this.searchInfo.endTime = this.$dayjs(val.endTime).format('YYYY-MM-DD');
- this.searchInfo.time = this.$dayjs(val.beginTime).format('YYYY-MM-DD') + ' 至 ' + this.$dayjs(val.endTime).format('YYYY-MM-DD');
- this.searchOrderList();
- },
- openSearchModal() {
- this.searchShow = true;
- this.$nextTick(() => {
- this.$refs.jtimePickerPopupRef.handleInit();
- })
- },
- closeSearchModal() {
- this.searchShow = false;
- },
- openTimePicker() {
- this.$refs.jtimePickerPopupRef.pickerShow();
- },
- openRecyclePersonPicker() {
- this.$refs.recyclePersonPickerRef.open();
- },
- handleSelectRecyclePerson(person) {
- this.searchInfo.recyclePerson = person.label;
- this.searchInfo.recyclePersonId = person.id;
- },
- handleTabChangeType(val){
- this.searchInfo.type = val
- },
- loadMore() {
- if (this.orderList.length >= this.total){
- uni.$u.toast('没有更多了');
- return;
- };
- this.searchInfo.pageNum++;
- this.getOrderList();
- },
- payTypeFormatter(type) {
- return paymentTabList.find(tab => tab.value == type)?.name || '-';
- },
- afterSaleTabFormatter(tabs) {
- let tabNames = [];
- tabs.forEach(item => {
- tabNames.push(afterSaleTabList.find(tab => tab.value == item)?.name || '-');
- })
- return tabNames.join('、');
- },
- async getOrderType(){
- this.orderTypeList = await this.$getDicts("crm_sendOrder_type");
- },
- orderTypeFormatter(type) {
- const obj = this.orderTypeList.find(item => item.dictValue == type) || {};
- return obj.dictLabel || '-';
- },
- async getTypeList(){
- this.typeList = await this.$getDicts("crm_form_category");
- },
- typeFormatter(type) {
- const obj = this.typeList.find(item => item.dictValue == type) || {};
- return obj.dictLabel || '-';
- },
- orderDateFormatter(date) {
- if (!date) return '-';
- return this.$dayjs(date).format('YYYY-MM-DD');
- },
- searchOrderList() {
- this.searchInfo.pageNum = 1;
- this.getOrderList();
- },
- submitSearch() {
- this.searchShow = false;
- this.searchOrderList();
- },
- resetForm() {
- this.searchInfo.time = ''
- this.searchInfo.startTime = ''
- this.searchInfo.endTime = ''
- this.searchInfo.recyclePerson = ''
- this.searchInfo.recyclePersonId = ''
- this.searchInfo.type = []
- },
- getOrderList() {
- uni.$u.api.wareHouseOrderList({
- pageNum: this.searchInfo.pageNum,
- pageSize: this.searchInfo.pageSize,
- dictLabel: this.searchInfo.dictLabel || '',
- startTime: this.searchInfo.startTime || '',
- endTime: this.searchInfo.endTime || '',
- recyclePerson: this.searchInfo.recyclePerson || '',
- recyclePersonId: this.searchInfo.recyclePersonId || '',
- type: this.searchInfo.type || [],
- }).then(res => {
- if(res.rows.length == 0){
- uni.$u.toast("暂无订单");
- this.orderList = [];
- this.total = 0;
- return;
- }
- if (this.searchInfo.pageNum === 1) {
- this.orderList = res.rows;
- } else {
- this.orderList = this.orderList.concat(res.rows);
- }
- this.total = res.total || 0;
- })
- },
- openList() {
- this.show = true;
- this.resetForm();
- this.searchInfo.pageNum = 1;
- this.searchInfo.pageSize = 10;
- this.getOrderList();
- this.getOrderType();
- this.getTypeList();
- },
- hideList() {
- this.show = false;
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- @import '../../styles/orderList/index.scss';
- </style>
|