From ebedf7cee35a1131b3c5d180be5676249a87c252 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 26 三月 2025 09:29:43 +0800
Subject: [PATCH] 优化
---
admin/src/views/platform/LogisticsRecord/subscribe.vue | 92 ++++++++++++++++++++++-----------------------
1 files changed, 45 insertions(+), 47 deletions(-)
diff --git a/admin/src/views/platform/LogisticsRecord/subscribe.vue b/admin/src/views/platform/LogisticsRecord/subscribe.vue
index ba788b3..e4e611f 100644
--- a/admin/src/views/platform/LogisticsRecord/subscribe.vue
+++ b/admin/src/views/platform/LogisticsRecord/subscribe.vue
@@ -17,14 +17,14 @@
v-permissions="['business:platformbooks:exportExcel']">瀵煎嚭</el-button>
</div>
<el-table :height="tableHeightNew" v-loading="loading" :data="list" stripe>
- <el-table-column prop="contractNum" label="鍚堝悓鍗曞彿" min-width="100" show-overflow-tooltip />
+ <el-table-column prop="contractNum" label="鍚堝悓/鍗曟嵁缂栧彿" min-width="100" show-overflow-tooltip />
<el-table-column prop="inReason" label="鍏ュ洯鍘熷洜" min-width="100" show-overflow-tooltip />
<el-table-column prop="totalNum" label="鎬讳綔涓氶噺(涓囨敮)" min-width="100" show-overflow-tooltip />
<el-table-column prop="carCodeFront" label="杞︾墝鍓嶇収鍙�" min-width="100" show-overflow-tooltip />
<el-table-column prop="carCodeBack" label="杞︾墝鍚庣収鍙�" min-width="100" show-overflow-tooltip />
<el-table-column prop="driverName" label="椹鹃┒鍛�" min-width="100" show-overflow-tooltip />
<el-table-column prop="driverPhone" label="鑱旂郴鏂瑰紡" min-width="100" show-overflow-tooltip />
- <el-table-column prop="inTypeTemp" label="鍏ュ簱绫诲瀷" min-width="100" show-overflow-tooltip />
+ <el-table-column prop="inTypeTemp" label="浣滀笟绫诲瀷" min-width="100" show-overflow-tooltip />
<el-table-column prop="arriveDate" label="棰勭害鍒板満鏃堕棿" min-width="150" show-overflow-tooltip />
<el-table-column label="瀹℃壒缁撴灉" min-width="100" show-overflow-tooltip>
<template v-slot="scope">
@@ -41,7 +41,8 @@
<template v-slot="scope">
<el-button type="text" v-permissions="['business:platformbooks:detail']"
@click="handleDetail(scope.row)">棰勭害璇︽儏</el-button>
- <el-button type="text" class="red" v-permissions="['business:platformbooks:delete']" @click="handleDel(scope.row)">鍒犻櫎</el-button>
+ <el-button type="text" class="red" v-permissions="['business:platformbooks:delete']"
+ @click="handleDel(scope.row)">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
@@ -57,15 +58,15 @@
</el-option>
</el-select>
</el-form-item>
- <el-form-item label="鍚堝悓鍙�" prop="contractNum">
- <el-input v-model="param.contractNum" class="w300" placeholder="璇疯緭鍏ュ悎鍚屽彿"></el-input>
+ <el-form-item label="鍚堝悓/鍗曟嵁缂栧彿" prop="contractNum">
+ <el-input v-model="param.contractNum" class="w300" placeholder="璇疯緭鍏ュ悎鍚�/鍗曟嵁缂栧彿"></el-input>
</el-form-item>
<el-form-item label="鍒板満鏃堕棿" prop="arriveDate">
<el-date-picker v-model="param.arriveDate" @change="checkSurplus" value-format="yyyy-MM-dd HH:mm:ss"
type="datetime" class="w300" placeholder="璇烽�夋嫨">
</el-date-picker>
</el-form-item>
- <el-form-item label="鍏ュ簱绫诲瀷" prop="inType">
+ <el-form-item label="浣滀笟绫诲瀷" prop="inType">
<div>
<el-radio v-model="param.inType" :label="0">鏁翠欢鐩�</el-radio>
<el-radio v-model="param.inType" :label="1">浠剁儫</el-radio>
@@ -76,7 +77,7 @@
v-model="param.totalNum" placeholder="璇疯緭鍏�" class="w300"></el-input>
<span class="ml10">涓囨敮</span>
</el-form-item>
- <el-form-item label="鍑嗚繍璇佺収鐗�" prop="transportImg">
+ <el-form-item label="鍑嗚繍璇�/杩愬崟鐓х墖" prop="transportImg">
<UploadAvatarImage :file="{ 'imgurlfull': param.transportImgFull, 'imgurl': param.transportImg }"
:uploadData="{ folder: 'platform' }" @uploadSuccess="uploadSuccess" @uploadEnd="isUploading = false"
@uploadBegin="isUploading = true" />
@@ -105,7 +106,6 @@
<script>
import Pagination from '@/components/common/Pagination'
import QueryForm from '@/components/common/QueryForm'
-import BasePage from '@/components/base/BasePage'
import { platformBooksPage, platformReasonList, platformBooksApply, platformBooksExport } from '@/api'
import { checkSurplusNum, deletebooksById } from '@/api/platform/platform'
import DriverDetail from '@/views/task/driverDetail'
@@ -113,7 +113,9 @@
import UploadAvatarImage from '@/components/common/UploadAvatarImage'
import { Message } from 'element-ui'
import dayjs from 'dayjs'
+import BaseComputHeight from "@/components/base/BaseComputHeight"
export default {
+ extends: BaseComputHeight,
components: {
Pagination,
QueryForm,
@@ -121,8 +123,7 @@
GlobalWindow,
UploadAvatarImage
},
- extends: BasePage,
- data () {
+ data() {
return {
isShowDriver: false,
exLoading: false,
@@ -133,7 +134,8 @@
total: 0
},
filters: {
- selDate: [],
+ arriveDateStart: '',
+ arriveDateEnd: '',
fastdate: 0
},
list: [],
@@ -187,10 +189,10 @@
]
},
{
- filed: 'selDate',
- type: 'datetimerange',
- label: '鎿嶄綔鏃堕棿',
- pickerOptions: {}
+ filed1: 'arriveDateStart',
+ filed2: 'arriveDateEnd',
+ type: 'datetime',
+ label: '鎿嶄綔鏃堕棿'
},
{
type: 'slot',
@@ -202,12 +204,12 @@
}
}
},
- created () {
+ created() {
this.changeRadio('0')
- this.getList()
+ // this.getList()
},
methods: {
- checkSurplus () {
+ checkSurplus() {
const { arriveDate, reasonId, totalNum } = this.param
if (!arriveDate || !reasonId || !totalNum) return
checkSurplusNum({
@@ -222,25 +224,25 @@
}
})
},
- changeRadio (day) {
+ changeRadio(day) {
const arr = [dayjs().subtract(day, 'day').format('YYYY-MM-DD') + ' 00:00:00', dayjs().format('YYYY-MM-DD') + ' 23:59:59']
- this.$set(this.filters, 'selDate', arr)
+ this.filters.arriveDateStart = arr[0]
+ this.filters.arriveDateEnd = arr[1]
+ this.getList(1)
+ },
+ changeForm(str) {
+ if (this.filters.arriveDateStart > this.filters.arriveDateEnd) {
+ this.filters.arriveDateStart = this.filters.arriveDateEnd
+ return this.$message.error('寮�濮嬫椂闂翠笉鑳藉ぇ浜庣粨鏉熸椂闂�')
+ }
this.getList()
},
- changeForm (str) {
- if (str === 'selDate') {
- this.$set(this.filters, 'fastdate', null)
- this.getList()
- }
- },
- getList (page) {
+ getList(page) {
const { pagination, filters } = this
this.loading = true
platformBooksPage({
model: {
- ...filters,
- arriveDateStart: filters.selDate && filters.selDate.length > 0 ? filters.selDate[0] : null,
- arriveDateEnd: filters.selDate && filters.selDate.length > 0 ? filters.selDate[1] : null
+ ...filters
},
capacity: pagination.pageSize,
page: page || pagination.page
@@ -255,7 +257,7 @@
this.loading = false
})
},
- handleEx () {
+ handleEx() {
this.$dialog.exportConfirm('纭瀵煎嚭鍚楋紵')
.then(() => {
const { filters } = this
@@ -264,9 +266,7 @@
page: this.pagination.page,
capacity: 1000000,
model: {
- ...filters,
- arriveDateStart: filters.selDate && filters.selDate.length > 0 ? filters.selDate[0] : null,
- arriveDateEnd: filters.selDate && filters.selDate.length > 0 ? filters.selDate[1] : null
+ ...filters
}
})
.then(response => {
@@ -280,7 +280,7 @@
})
})
},
- onSubmit () {
+ onSubmit() {
this.$refs.ruleForm.validate((valid) => {
const param = this.param
param.inReason = this.reasonList.find(item => param.reasonId == item.id).reason
@@ -296,11 +296,11 @@
}
})
},
- uploadSuccess (file) {
+ uploadSuccess(file) {
this.$set(this.param, 'transportImg', file.imgurl)
this.$set(this.param, 'transportImgFull', file.imgurlfull)
},
- handleEdit (row) {
+ handleEdit(row) {
this.isShowEdit = true
this.param = {
inType: 0
@@ -311,27 +311,25 @@
this.$set(this.param, 'arriveDate', dayjs().format('YYYY-MM-DD HH:mm:ss'))
this.getplatformReason()
},
- getplatformReason () {
+ getplatformReason() {
platformReasonList().then(res => {
this.reasonList = res || []
})
},
- handleSub () {
+ handleSub() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
alert('submit!')
}
})
},
- clear () {
+ clear() {
this.pagination.page = 1
- this.filters = {
- selDate: []
- }
+ this.filters = {}
this.getList()
// this.changeRadio('0')
},
- handleDetail (row) {
+ handleDetail(row) {
this.isShowDriver = true
this.$nextTick(() => {
this.$refs.DriverDetailRef.id = row.id
@@ -340,7 +338,7 @@
this.$refs.DriverDetailRef.isShowModal = true
})
},
- handleDel (row) {
+ handleDel(row) {
this.$confirm('纭畾鍒犻櫎璇ヨ褰曞悧, 鏄惁缁х画?', '鎻愮ず', {
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
@@ -355,9 +353,9 @@
}).catch(() => {
})
},
- handleSizeChange (capacity) {
+ handleSizeChange(capacity) {
this.pagination.pageSize = capacity
- this.getList()
+ this.getList(1)
}
}
}
--
Gitblit v1.9.3