车辆管理

This commit is contained in:
binbin_pan 2024-12-23 18:23:08 +08:00
parent d10f1a5f66
commit ff7bc9e436
6 changed files with 637 additions and 19 deletions

View File

@ -113,31 +113,40 @@
}
},
{
"path" : "pages/inspectionEntry/index",
"style" :
{
"navigationStyle": "custom"
}
"path": "pages/inspectionEntry/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path" : "pages/inspectionEntry/inspectionRecord",
"style" :
{
"navigationBarTitleText": "检验记录"
}
"path": "pages/inspectionEntry/inspectionRecord",
"style": {
"navigationBarTitleText": "检验记录"
}
},
{
"path" : "pages/stockTaking/index",
"style" :
{
"navigationStyle": "custom"
}
"path": "pages/stockTaking/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path" : "pages/stockTaking/takingRecord",
"path": "pages/stockTaking/takingRecord",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/arrivalConfirmation/index",
"style": {
"navigationBarTitleText": "到货确认单上传"
}
},
{
"path" : "pages/sendACarSystem/index",
"style" :
{
"navigationStyle": "custom"
"navigationBarTitleText" : "派车管理"
}
}
],

View File

@ -0,0 +1,226 @@
<template>
<view>
<!-- 搜索 -->
<div class="search">
<u-input
v-model="keyWord"
placeholder="请输入搜索内容"
suffixIcon="search"
suffixIconStyle="color: #666"
shape="circle"
@blur="handleSearch"
></u-input>
</div>
<!-- 列表 -->
<div class="list-cont" v-for="(item, index) in tableList" :key="index">
<u-row justify="space-between" customStyle="margin-bottom: 10px; padding: 0 15px;">
<u-col span="6">
<div>{{ item.name }}</div>
</u-col>
<u-col span="6">
<div style="display: flex; justify-content: flex-end">
<u-tag text="已上传" type="success" v-if="item.imgList && item.imgList.length > 0"></u-tag>
<u-tag text="待上传" type="warning" v-else></u-tag>
</div>
</u-col>
</u-row>
<u-line style="margin-bottom: 5px"></u-line>
<div class="list-item">
<span>工程名称</span>
<span>{{ item.proName }}</span>
</div>
<div class="list-item df-item">
<div>
<span>派车数量</span>
<span style="color: #5ae725">{{ item.pcNum }}</span>
</div>
<div>
<u-button v-if="item.imgList && item.imgList.length > 0" size="small" @click="openImgModal(item)">
查看到货确认单
</u-button>
<u-button v-else type="primary" size="small" @click="openImgModal">上传到货确认单</u-button>
</div>
</div>
<div class="list-item">
<span>派车时间</span>
<span style="color: #f9ae3d">{{ item.time }}</span>
</div>
</div>
<!-- 上传图片 -->
<u-modal :show="imgModal" :title="imgModelTitle" showCancelButton @cancel="imgModal = false" @confirm="uploadImg">
<view class="slot-content" style="display: flex; flex-direction: column; align-items: center">
<uni-file-picker
v-model="imgList"
:auto-upload="false"
ref="files"
limit="3"
@select="selectImg"
@delete="deleteImg"
:readonly="readonly"
style="height: 100px; width: 260px"
/>
</view>
</u-modal>
<u-loadmore :status="status" line v-if="tableList.length > 10" />
<!-- 空状态 -->
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
</view>
</template>
<script>
import { getInventoryList } from '@/api/aqSafety'
export default {
data() {
return {
imgModal: false,
readonly: false,
imgModelTitle: '',
imgList: [],
uploadPaths: [],
keyWord: '',
status: 'loadmore',
pageNum: 1,
pageSize: 10,
total: 0,
tableList: [
{
name: '张三',
proName: '项目名称',
pcNum: 10,
time: '2021-08-01',
imgList: []
},
{
name: '李四',
proName: '项目名称',
pcNum: 20,
time: '2021-08-01',
imgList: [
{
url: 'https://img.yzcdn.cn/vant/cat.jpeg'
}
]
}
]
}
},
onLoad() {
// this.getList()
},
methods: {
handleSearch() {
this.pageSize = 10
this.getList()
},
async getList() {
try {
const params = {
encryptedData: JSON.stringify({ keyWord: this.keyWord }),
pageNum: this.pageNum,
pageSize: this.pageSize
}
console.log('🚀 ~ getList ~ params', params)
const res = await getInventoryList(params)
console.log('🚀 ~ getList ~ res', res)
this.tableList = res.data.list
this.total = res.data.total
} catch (error) {
console.log('🚀 ~ getList ~ error', error)
}
},
onReachBottom() {
console.log('🚀 ~ onReachBottom ~ ')
if (this.total < 10 || this.total == this.tableList.length) {
this.status = 'nomore'
return
}
this.status = 'loading'
setTimeout(() => {
this.pageSize += 10
this.getList()
if (this.tableList.length != this.total) this.status = 'loadmore'
else this.status = 'nomore'
}, 500)
console.log('加载..', this.pageSize)
},
//
openImgModal(item) {
this.imgModal = true
if (item) {
this.readonly = true
this.imgModelTitle = '查看到货确认单'
this.imgList = item.imgList
} else {
this.readonly = false
this.imgModelTitle = '上传到货确认单'
this.imgList = []
}
},
selectImg(e) {
console.log('🚀 ~ selectImg ~ e:', e)
e.tempFiles.forEach(file => {
this.imgList.push(file)
})
console.log('🚀 ~ selectImg ~ this.imgList:', this.imgList)
},
deleteImg(e) {
console.log('🚀 ~ deleteImg ~ e:', e)
this.imgList.splice(e.index, 1)
console.log('🚀 ~ deleteImg ~ this.imgList:', this.imgList)
},
uploadImg() {
console.log('🚀 ~ uploadImg ~ this.imgList:', this.imgList)
this.imgModal = false
},
upload(path) {
uni.uploadFile({
url: this.actionUrl,
filePath: path,
name: 'file',
header: {
Authorization: this.token
},
success: res => {
console.log('🚀 ~ selectImg ~ res:', res)
console.log('🚀 ~ selectImg ~ res--data:', JSON.parse(res.data).data)
this.uploadPaths.push(JSON.parse(res.data).data)
},
fail: err => {
console.log('🚀 ~ selectImg ~ err:', err)
}
})
}
}
}
</script>
<style lang="scss">
page {
padding: 15px;
background-color: #f8f8f8;
}
.search {
margin-bottom: 15px;
}
.list-cont {
padding: 15px 0;
margin-bottom: 15px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
.list-item {
padding: 5px 15px;
}
.df-item {
display: flex;
justify-content: space-between;
align-items: center;
}
}
</style>

View File

@ -33,11 +33,11 @@ export default {
},
{
name: 'home',
title: '首页'
title: '到货确认单'
},
{
name: 'star',
title: '音量'
title: '派车管理'
}
]
}
@ -54,6 +54,10 @@ export default {
url = '/pages/inspectionEntry/index'
} else if (index === 3) {
url = '/pages/stockTaking/index'
} else if (index === 4) {
url = '/pages/arrivalConfirmation/index'
} else if (index === 5) {
url = '/pages/sendACarSystem/index'
}
uni.navigateTo({ url })
}

View File

@ -0,0 +1,379 @@
<template>
<view>
<div class="tabs">
<div class="item" :class="{ active: active == 1 }" @click="handleTab(1)">派车分配</div>
<div class="item" :class="{ active: active == 2 }" @click="handleTab(2)">派车审核</div>
</div>
<!-- 搜索 -->
<div class="search">
<div v-if="active == 2" style="width: 30%">
<u-cell-group :border="false">
<u-cell
:value="checkStatus"
isLink
:label="checkStatus ? '' : '审核状态'"
:border="false"
@click="showPicker = true"
></u-cell>
</u-cell-group>
</div>
<u-input
v-model="keyWord"
placeholder="请输入搜索工程或计划"
suffixIcon="search"
suffixIconStyle="color: #666"
shape="circle"
@blur="handleSearch"
></u-input>
</div>
<!-- 列表 -->
<div class="list-cont" v-for="(item, index) in tableList" :key="index">
<u-row justify="space-between" customStyle="margin-bottom: 10px; padding: 0 15px;">
<u-col span="6">
<div>{{ item.code }}</div>
</u-col>
<u-col span="6" v-if="active == 1">
<div style="display: flex; justify-content: flex-end">
<u-tag text="已派车" type="success" v-if="item.isSend"></u-tag>
<u-tag text="待派车" type="warning" v-else></u-tag>
</div>
</u-col>
</u-row>
<u-line style="margin-bottom: 5px"></u-line>
<div class="list-item">
<span>工程名称</span>
<span>{{ item.proName }}</span>
</div>
<div class="list-item df-item">
<div>
<span>计划类型</span>
<span>{{ item.plan }}</span>
</div>
<div>
<u-button v-if="active == 1 && !item.isSend" type="primary" size="small" @click="openModal">
派车分配
</u-button>
<u-button v-else-if="active == 2 && item.status == 0" type="warning" size="small" @click="openModal">
审核
</u-button>
<u-tag text="已通过" type="success" v-else-if="active == 2 && item.status == 1"></u-tag>
</div>
</div>
<div class="list-item">
<span> </span>
<span>{{ item.sub }}</span>
</div>
</div>
<!-- 弹框 -->
<u-modal :show="showModal" :title="modalTitle" showCancelButton @cancel="showModal = false" @confirm="submit">
<view class="slot-content">
<div v-if="active == 1">
<u-radio-group v-model="radioValue" placement="column" @change="groupChange">
<u-radio
:customStyle="{ marginBottom: '8px' }"
v-for="(item, index) in radioList"
:key="index"
:label="item.name"
:name="item.value"
></u-radio>
</u-radio-group>
</div>
<div v-else>
<div class="item-wrap">
<div class="item" :class="{active: isPass}" @click="isPass = true">通过</div>
<div class="item" :class="{active: !isPass}" @click="isPass = false">不通过</div>
</div>
<u-textarea v-model="opinion" placeholder="不通过必须填写审核不通过意见" :rows="5" maxlength="200" count></u-textarea>
</div>
</view>
</u-modal>
<!-- 选择器 -->
<u-picker
v-if="showPicker"
:show="showPicker"
:columns="[columns]"
keyName="label"
@cancel="showPicker = false"
@confirm="confirm"
></u-picker>
<u-loadmore :status="status" line v-if="tableList.length > 10" />
<!-- 空状态 -->
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
</view>
</template>
<script>
import { getInventoryList } from '@/api/aqSafety'
export default {
data() {
return {
active: 1,
showModal: false,
modalTitle: '',
readonly: false,
keyWord: '',
status: 'loadmore',
pageNum: 1,
pageSize: 10,
total: 0,
tableList: [],
checkStatus: '', //
checkStatusId: '', // id
showPicker: false,
columns: [
{
label: '已审核',
value: 1
},
{
label: '待审核',
value: 0
}
],
//
radioList: [
{
name: '苹果',
value: '1',
disabled: false
},
{
name: '香蕉',
value: '2',
disabled: false
},
{
name: '橙子',
value: '3',
disabled: false
},
{
name: '榴莲',
value: '4',
disabled: false
}
],
radioValue: '', //
opinion: '', //
isPass: true //
}
},
computed: {
justifyContent() {
return this.active == 1 ? 'flex-start' : 'center'
}
},
onLoad() {
// this.getList()
},
methods: {
handleTab(index) {
this.active = index
if (index == 1) {
this.tableList = [
{
code: '20210801',
proName: '项目名称',
plan: '计划1',
sub: '供应商1',
//
isSend: true
},
{
code: '20210802',
proName: '项目名称',
plan: '计划2',
sub: '供应商2',
//
isSend: false
}
]
} else {
this.tableList = [
{
code: '20210803',
proName: '项目名称',
plan: '计划1',
sub: '供应商1',
status: 1
},
{
code: '20210804',
proName: '项目名称',
plan: '计划2',
sub: '供应商2',
status: 0
}
]
}
},
handleSearch() {
this.pageSize = 10
this.getList()
},
async getList() {
try {
const params = {
encryptedData: JSON.stringify({ keyWord: this.keyWord }),
pageNum: this.pageNum,
pageSize: this.pageSize
}
console.log('🚀 ~ getList ~ params', params)
const res = await getInventoryList(params)
console.log('🚀 ~ getList ~ res', res)
this.tableList = res.data.list
this.total = res.data.total
} catch (error) {
console.log('🚀 ~ getList ~ error', error)
}
},
onReachBottom() {
console.log('🚀 ~ onReachBottom ~ ')
if (this.total < 10 || this.total == this.tableList.length) {
this.status = 'nomore'
return
}
this.status = 'loading'
setTimeout(() => {
this.pageSize += 10
this.getList()
if (this.tableList.length != this.total) this.status = 'loadmore'
else this.status = 'nomore'
}, 500)
console.log('加载..', this.pageSize)
},
//
openModal() {
this.showModal = true
if (this.active == 1) {
this.modalTitle = '指定派车供应商'
this.radioValue = ''
} else {
this.modalTitle = '派车审核'
this.isPass = true
this.opinion = ''
}
},
confirm(e) {
console.log('🚀 ~ confirm ~ e', e)
this.checkStatus = e.value[0].label
this.checkStatusId = e.value[0].value
this.showPicker = false
},
groupChange() {
console.log('🚀 ~ radioValue', this.radioValue)
},
submit() {
console.log('提交')
if (this.active == 1) {
console.log('派车分配', this.radioValue)
if (!this.radioValue) {
uni.showToast({
title: '请选择派车供应商',
icon: 'none'
})
return
}
} else {
console.log('派车审核', this.isPass, this.opinion)
if (!this.isPass && !this.opinion) {
uni.showToast({
title: '请填写审核不通过意见',
icon: 'none'
})
return
}
}
this.showModal = false
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f8f8f8;
}
.search {
margin: 15px;
display: flex;
}
.list-cont {
margin: 15px;
padding: 15px 0;
margin-bottom: 15px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
.list-item {
padding: 5px 15px;
}
.df-item {
display: flex;
justify-content: space-between;
align-items: center;
}
}
.tabs {
display: flex;
justify-content: space-between;
background-color: #fff;
.item {
flex: 1;
text-align: center;
padding: 10px 0;
color: #666;
font-size: 16px;
font-weight: 500;
border-bottom: 2px solid transparent; //
transition: color 0.3s ease, border-bottom 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
//
&.active {
color: $u-primary;
border-bottom: 2px solid $u-primary;
background-color: #f8f8f8;
}
}
}
.slot-content {
width: 100%;
height: 100%;
.item-wrap {
margin-bottom: 15px;
width: 100%;
height: 100%;
display: flex;
justify-content: space-between;
align-items: center;
.item {
width: 45%;
height: 30px;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #e8e8e8;
border-radius: 30px;
background-color: #f8f8f8;
color: #666;
font-size: 16px;
font-weight: 500;
transition: color 0.3s ease, background-color 0.3s ease, border 0.3s ease;
&.active {
color: $u-primary;
background-color: #f8f8f8;
border: 1px solid $u-primary;
}
}
}
}
</style>

BIN
static/images/car.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/images/car2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB