|
|
@@ -0,0 +1,370 @@
|
|
|
+<template>
|
|
|
+ <view>
|
|
|
+ <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="销售订单明细" @clickLeft="back"></uni-nav-bar>
|
|
|
+ <view class="top-wrapper">
|
|
|
+ <uni-section>
|
|
|
+ <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="form.searchName" placeholder="请输入订单编码/客户名称/合同编号/产品名称">
|
|
|
+ </uni-easyinput>
|
|
|
+ </uni-section>
|
|
|
+ <view style="display: flex;">
|
|
|
+ <button class="search_btn" @click="search">搜索</button>
|
|
|
+ <view class="more_search">
|
|
|
+ <image src="~@/static/moreSearch.svg" mode="" @click="handlScreen"></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="mainBox">
|
|
|
+ <view class="scroll_box">
|
|
|
+ <scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="lower">
|
|
|
+ <uni-table border stripe emptyText="暂无更多数据" style="width: 100%;">
|
|
|
+ <uni-tr style="width: 100%;">
|
|
|
+ <uni-th width="50" align="center" class="ellipsis">序号</uni-th>
|
|
|
+ <uni-th width="120" align="center" class="ellipsis">订单编码</uni-th>
|
|
|
+ <uni-th width="100" align="center" class="ellipsis">订单类型</uni-th>
|
|
|
+ <uni-th width="120" align="center" class="ellipsis">发起人所属部门</uni-th>
|
|
|
+ <uni-th width="120" align="center" class="ellipsis">产品名称</uni-th>
|
|
|
+ <uni-th width="120" align="center" class="ellipsis">产品编码</uni-th>
|
|
|
+ <uni-th width="100" align="center" class="ellipsis">销售类型</uni-th>
|
|
|
+ <uni-th width="100" align="center" class="ellipsis">到货方式</uni-th>
|
|
|
+ <uni-th width="120" align="center" class="ellipsis">客户名称</uni-th>
|
|
|
+ <uni-th width="120" align="center" class="ellipsis">售出方名称</uni-th>
|
|
|
+ <uni-th width="100" align="center" class="ellipsis">数量</uni-th>
|
|
|
+ <uni-th width="100" align="center" class="ellipsis">金额</uni-th>
|
|
|
+ <uni-th width="100" align="center" class="ellipsis">订单进度</uni-th>
|
|
|
+ <uni-th width="100" align="center" class="ellipsis">审核状态</uni-th>
|
|
|
+ <uni-th width="100" align="center" class="ellipsis">创建人</uni-th>
|
|
|
+ <uni-th width="100" align="center" class="ellipsis">创建时间</uni-th>
|
|
|
+ </uni-tr>
|
|
|
+ <!-- 表格数据行 -->
|
|
|
+ <uni-tr v-for="(item, index) in listData" :key="index">
|
|
|
+ <uni-td>
|
|
|
+ <view class="ellipsis">{{index+Number(1)}}</view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td>
|
|
|
+ <view class="ellipsis">
|
|
|
+ {{ item.orderNo }}
|
|
|
+ </view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td class="ellipsis">
|
|
|
+ <view>{{ item.needProduceName }}</view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td>
|
|
|
+ <view class="ellipsis">{{ item.deptName }}</view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td>
|
|
|
+ <view class="ellipsis">{{ item.productNames }}</view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td>
|
|
|
+ <view class="ellipsis">{{ item.productCodes }}</view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td>
|
|
|
+ <view class="ellipsis">{{ item.saleTypeName }}</view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td>
|
|
|
+ <view class="ellipsis">
|
|
|
+ {{ item.arrivalWaysName }}
|
|
|
+ </view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td>
|
|
|
+ <view class="ellipsis">{{ item.partaName }}</view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td>
|
|
|
+ <view class="ellipsis">{{ item.partbName }}</view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td>
|
|
|
+ <view class="ellipsis">{{ item.productCount }}</view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td>
|
|
|
+ <view class="ellipsis">{{ item.payAmount }}</view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td>
|
|
|
+ <view class="ellipsis">{{ item.progressName }}</view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td>
|
|
|
+ <view class="ellipsis">{{ item.orderStatusName }}</view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td>
|
|
|
+ <view class="ellipsis">{{ item.createUserName }}</view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td>
|
|
|
+ <view class="ellipsis">{{ item.createTime }}</view>
|
|
|
+ </uni-td>
|
|
|
+ </uni-tr>
|
|
|
+ </uni-table>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <screen ref="screen" @succeed="cabScreen" :type="type" :createTimeStart="form.createTimeStart" :createTimeEnd="form.createTimeEnd"
|
|
|
+ :needProduce="form.needProduce" :saleType="form.saleType" :progress="form.progress" :orderStatus="form.orderStatus"></screen>
|
|
|
+ </view>
|
|
|
+
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import screen from './components/salesScreen'
|
|
|
+ import { getTableList } from '@/api/saleManage/saleorder/index.js'
|
|
|
+ import { listOrganizations } from '@/api/common.js'
|
|
|
+ import { orderTypeEnum, saleOrderProgressStatusEnum, reviewStatusEnum } from '@/enum/dict.js'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ components: {
|
|
|
+ screen,
|
|
|
+
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ page: 1,
|
|
|
+ size: 20,
|
|
|
+ isEnd: true,
|
|
|
+ listData: [],
|
|
|
+ organizations: [],
|
|
|
+ type: '',
|
|
|
+ form: {
|
|
|
+ createTimeStart: '',
|
|
|
+ createTimeEnd: '',
|
|
|
+ needProduce: '',
|
|
|
+ saleType: '',
|
|
|
+ progress: '',
|
|
|
+ orderStatus: ''
|
|
|
+ },
|
|
|
+ rangeDate: [],
|
|
|
+ status: 'loading'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad(options) {
|
|
|
+ this.type = options.type
|
|
|
+ },
|
|
|
+ onShow() {},
|
|
|
+ //加载更多
|
|
|
+ onReachBottom() {
|
|
|
+ console.log('加载更多')
|
|
|
+ if (this.isEnd) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.getMoreLists()
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.setDefaultRangeDate()
|
|
|
+ this.getDeptInfo()
|
|
|
+ this.getData()
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ setDefaultRangeDate() {
|
|
|
+ const now = new Date()
|
|
|
+ const year = now.getFullYear()
|
|
|
+ const month = String(now.getMonth() + 1).padStart(2, '0')
|
|
|
+ const day = String(now.getDate()).padStart(2, '0')
|
|
|
+ const today = `${year}-${month}-${day}`
|
|
|
+ if (this.type === 'year') {
|
|
|
+ this.rangeDate = [`${year}-01-01`, today]
|
|
|
+ } else if (this.type === 'month') {
|
|
|
+ this.rangeDate = [`${year}-${month}-01`, today]
|
|
|
+ }
|
|
|
+ this.form.createTimeStart = this.rangeDate[0]
|
|
|
+ this.form.createTimeEnd = this.rangeDate[1]
|
|
|
+ },
|
|
|
+ async getDeptInfo() {
|
|
|
+ try {
|
|
|
+ const res = await listOrganizations(); // 假设接口直接返回部门数组(如用户提供的示例数据)
|
|
|
+ this.organizations = res; // 存储部门列表到状态中
|
|
|
+ console.log('部门列表加载完成:', this.organizations);
|
|
|
+ } catch (err) {
|
|
|
+ console.error('加载部门列表失败:', err);
|
|
|
+ this.organizations = []; // 异常时置空,避免匹配错误
|
|
|
+ }
|
|
|
+ },
|
|
|
+ lower() {
|
|
|
+ console.log('加载更多')
|
|
|
+ if (this.isEnd) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.getMoreLists()
|
|
|
+ },
|
|
|
+ expand(index, isOpen) {
|
|
|
+ this.$set(this.listData[index], 'open', isOpen)
|
|
|
+ console.log(this.listData[index])
|
|
|
+ },
|
|
|
+ //筛选
|
|
|
+ getData() {
|
|
|
+ let par = JSON.parse(JSON.stringify(this.form))
|
|
|
+ par.pageNum = this.page
|
|
|
+ par.size = this.size
|
|
|
+ // par = this.URLSearchParams(par)
|
|
|
+ console.log(par)
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ })
|
|
|
+
|
|
|
+ getTableList(par)
|
|
|
+ .then(res => {
|
|
|
+ console.log('res----', res)
|
|
|
+ res.list = res.list.map(item => {
|
|
|
+ const matchedDept = this.organizations.find(
|
|
|
+ (dept) => dept.id === item.createDept
|
|
|
+ );
|
|
|
+ item.deptName = matchedDept ? matchedDept.name : ''
|
|
|
+ item.needProduceName = orderTypeEnum.find(
|
|
|
+ (type) => type.code === item.needProduce
|
|
|
+ )?.label || ''
|
|
|
+ item.arrivalWaysName = item.arrivalWays == 1 ? '一次性到货' : item.arrivalWays == 2 ? '分批到货' : ''
|
|
|
+ item.progressName = saleOrderProgressStatusEnum.find(
|
|
|
+ (val) => val.value == item.progress
|
|
|
+ )?.label;
|
|
|
+ item.orderStatusName = reviewStatusEnum.find(
|
|
|
+ (val) => val.value == item.orderStatus
|
|
|
+ )?.label;
|
|
|
+ return {
|
|
|
+ ...item
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(res.list)
|
|
|
+ this.listData = [...this.listData, ...res.list]
|
|
|
+ let pages = res.count
|
|
|
+ console.log(this.page)
|
|
|
+ console.log(pages)
|
|
|
+ if (this.listData.length < pages) {
|
|
|
+ this.isEnd = false
|
|
|
+ this.status = 'loading'
|
|
|
+ } else {
|
|
|
+ this.isEnd = true
|
|
|
+ this.status = 'nomore'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ uni.hideLoading()
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ handlScreen() {
|
|
|
+ this.$refs.screen.open()
|
|
|
+ },
|
|
|
+ cabScreen(data) {
|
|
|
+ console.log('data---', data)
|
|
|
+ for (let key of Object.keys(data)) {
|
|
|
+ this.form[key] = data[key]
|
|
|
+ }
|
|
|
+ this.page = 1
|
|
|
+ this.listData = []
|
|
|
+ this.search()
|
|
|
+ },
|
|
|
+ search() {
|
|
|
+ this.listData = []
|
|
|
+ this.page = 1
|
|
|
+ this.getData()
|
|
|
+ },
|
|
|
+ getMoreLists() {
|
|
|
+ this.page++
|
|
|
+ this.getData()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .mainBox {
|
|
|
+ height: 100vh;
|
|
|
+ width: 100%;
|
|
|
+ // display: flex;
|
|
|
+ // flex-direction: column;
|
|
|
+ }
|
|
|
+
|
|
|
+ .uni-easyinput__placeholder-class {
|
|
|
+ font-size: 28rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/.uni-table {
|
|
|
+ min-width: 100vw !important;
|
|
|
+ font-size: 28rpx;
|
|
|
+
|
|
|
+ .uni-table-td,
|
|
|
+ .uni-table-th {
|
|
|
+ padding: 10rpx !important;
|
|
|
+ text-align: center !important;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #000000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .ellipsis {
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ max-width: 160px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 当屏幕宽度小于600px时,调整最大宽度 */
|
|
|
+ @media (max-width: 600px) {
|
|
|
+ .ellipsis {
|
|
|
+ max-width: 140px;
|
|
|
+ /* 小屏幕下更小的最大宽度 */
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .top-wrapper {
|
|
|
+ display: flex;
|
|
|
+ height: 88rpx;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 20rpx;
|
|
|
+
|
|
|
+ /deep/.uni-section {
|
|
|
+ margin-top: 0px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/.uni-section-header {
|
|
|
+ padding: 0px;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .search_btn {
|
|
|
+ width: 120rpx;
|
|
|
+ height: 70rpx;
|
|
|
+ line-height: 70rpx;
|
|
|
+ background: $theme-color;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .menu_icon {
|
|
|
+ width: 44rpx;
|
|
|
+ height: 44rpx;
|
|
|
+ margin-left: 14rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .more_search {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ height: 70rpx;
|
|
|
+ line-height: 70rpx;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/.u-input {
|
|
|
+ border: 1rpx solid #ccc;
|
|
|
+
|
|
|
+ .u-input__content__field-wrapper__field {
|
|
|
+ height: 40rpx !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ image {
|
|
|
+ width: 52rpx;
|
|
|
+ height: 52rpx;
|
|
|
+ margin-left: 10rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .scroll_box {
|
|
|
+ flex: 1;
|
|
|
+ overflow: scroll;
|
|
|
+
|
|
|
+ .scroll-Y {
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|