派车管理

This commit is contained in:
binbin_pan 2024-12-24 13:02:43 +08:00
parent ff7bc9e436
commit f1b51a78da
11 changed files with 509 additions and 20 deletions

View File

@ -1,12 +1,12 @@
// 应用全局配置 // 应用全局配置
module.exports = { module.exports = {
// baseUrl: 'https://vue.ruoyi.vip/prod-api', // baseUrl: 'https://vue.ruoyi.vip/prod-api',
baseUrl: 'http://192.168.0.39:21995', // baseUrl: 'http://192.168.0.39:21995',
// baseUrl: 'http://192.168.2.160:21995', baseUrl: 'http://192.168.0.14:21520',
// baseUrl: 'http://localhost:8080', // baseUrl: 'http://localhost:8080',
uploadFileUrl: '/app/common/appUploadFile', uploadFileUrl: '/app/common/appUploadFile',
fileUrl: 'http://192.168.0.39:21995/statics', // 图片预览 // fileUrl: 'http://192.168.0.39:21995/statics', // 图片预览
// fileUrl: 'http://127.0.0.1:21995/statics', // 图片预览 fileUrl: 'http://192.168.0.14:21520/statics', // 图片预览
// 应用信息 // 应用信息
appInfo: { appInfo: {
// 应用名称 // 应用名称

View File

@ -133,7 +133,7 @@
{ {
"path": "pages/stockTaking/takingRecord", "path": "pages/stockTaking/takingRecord",
"style": { "style": {
"navigationStyle": "custom" "navigationBarTitleText": "盘点记录"
} }
}, },
{ {
@ -143,11 +143,16 @@
} }
}, },
{ {
"path" : "pages/sendACarSystem/index", "path": "pages/sendACarSystem/index",
"style" : "style": {
{ "navigationBarTitleText": "派车管理"
"navigationBarTitleText" : "派车管理" }
} },
{
"path": "pages/sendACarSystem/details",
"style": {
"navigationStyle": "custom"
}
} }
], ],
"tabBar": { "tabBar": {

View File

@ -60,7 +60,7 @@ export default {
url: this.goTo url: this.goTo
}) })
} else { } else {
uni.reLaunch({ uni.switchTab({
url: '/pages/index' url: '/pages/index'
}) })
} }

View File

@ -79,9 +79,9 @@
inputAlign="right" inputAlign="right"
></u-input> ></u-input>
</u-form-item> </u-form-item>
<u-form-item label="待报废量" prop="backNum" borderBottom required> <u-form-item label="待报废量" prop="scrapNum" borderBottom required>
<u-input <u-input
v-model="formData.backNum" v-model="formData.scrapNum"
type="number" type="number"
placeholder="请输入待报废量" placeholder="请输入待报废量"
border="none" border="none"
@ -116,7 +116,7 @@
v-if="showPickerTime" v-if="showPickerTime"
:show="showPickerTime" :show="showPickerTime"
v-model="dataTime" v-model="dataTime"
:max-date="new Date()" :max-date="Number(new Date())"
mode="date" mode="date"
@cancel="showPickerTime = false" @cancel="showPickerTime = false"
@confirm="confirmTime" @confirm="confirmTime"
@ -153,7 +153,7 @@ export default {
manager: '', // manager: '', //
checkTime: '', // checkTime: '', //
goodNum: '', // 使 goodNum: '', // 使
backNum: '', // scrapNum: '', //
remark: '', // remark: '', //
fileList: [], // - fileList: [], // -
uploadPaths: [] // - uploadPaths: [] // -
@ -175,7 +175,7 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
backNum: [ scrapNum: [
{ required: true, message: '请输入待报废量', trigger: 'blur' }, { required: true, message: '请输入待报废量', trigger: 'blur' },
// //
{ {
@ -250,7 +250,7 @@ export default {
manager: '', // manager: '', //
checkTime: '', // checkTime: '', //
goodNum: '', // 使 goodNum: '', // 使
backNum: '', // scrapNum: '', //
remark: '', // remark: '', //
fileList: [], // - fileList: [], // -
uploadPaths: [] // - uploadPaths: [] // -
@ -307,6 +307,11 @@ export default {
submit() { submit() {
console.log('🚀 ~ submit ~ ') console.log('🚀 ~ submit ~ ')
console.log('🚀 ~ submit ~ this.formData:', this.formData) console.log('🚀 ~ submit ~ this.formData:', this.formData)
// 使+ 退
if (Number(this.formData.goodNum) + Number(this.formData.scrapNum) > this.pop.backNum) {
this.$modal.msg('可继续使用量、待报废量总数不能超过退回量')
return
}
// //
this.$refs.uForm.validate().then(res => { this.$refs.uForm.validate().then(res => {
console.log('🚀 ~ submit ~ 提交-校验通过') console.log('🚀 ~ submit ~ 提交-校验通过')
@ -324,6 +329,7 @@ export default {
try { try {
const params = { const params = {
...this.formData, ...this.formData,
backNum: this.pop.backNum,
modelId: this.pop.id modelId: this.pop.id
} }
delete params.fileList delete params.fileList

View File

@ -159,7 +159,7 @@
v-if="showPickerTime" v-if="showPickerTime"
:show="showPickerTime" :show="showPickerTime"
v-model="dataTime" v-model="dataTime"
:max-date="new Date()" :max-date="Number(new Date())"
mode="date" mode="date"
@cancel="showPickerTime = false" @cancel="showPickerTime = false"
@confirm="confirmTime" @confirm="confirmTime"

View File

@ -0,0 +1,25 @@
<template>
<div>
审核记录
</div>
</template>
<script>
export default {
data() {
return {
}
},
onLoad() {
},
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,25 @@
<template>
<div>
计划详情
</div>
</template>
<script>
export default {
data() {
return {
}
},
onLoad() {
},
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,25 @@
<template>
<div>
派车详情
</div>
</template>
<script>
export default {
data() {
return {
}
},
onLoad() {
},
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,374 @@
<template>
<view>
<Navbar :title="navbarTitle" />
<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 class="item" :class="{ active: active == 3 }" @click="handleTab(3)">审核记录</div>
</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'
import AuditRecord from './components/AuditRecord'
import PlanDetails from './components/PlanDetails'
import SendCarDetails from './components/SendCarDetails'
export default {
components: { AuditRecord, PlanDetails, SendCarDetails },
data() {
return {
opt: {},
navbarTitle: '详情',
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(opt) {
this.opt = JSON.parse(opt.params)
console.log('🚀 ~ onLoad ~ this.opt', this.opt)
// 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>

View File

@ -27,7 +27,7 @@
></u-input> ></u-input>
</div> </div>
<!-- 列表 --> <!-- 列表 -->
<div class="list-cont" v-for="(item, index) in tableList" :key="index"> <div class="list-cont" v-for="(item, index) in tableList" :key="index" @click="handleDetail(item)">
<u-row justify="space-between" customStyle="margin-bottom: 10px; padding: 0 15px;"> <u-row justify="space-between" customStyle="margin-bottom: 10px; padding: 0 15px;">
<u-col span="6"> <u-col span="6">
<div>{{ item.code }}</div> <div>{{ item.code }}</div>
@ -268,6 +268,30 @@ export default {
groupChange() { groupChange() {
console.log('🚀 ~ radioValue', this.radioValue) console.log('🚀 ~ radioValue', this.radioValue)
}, },
//
handleDetail(item) {
console.log('查看详情', item)
let isPlan = false
let isSendCar = false
let isDetail = false
if (this.active == 1 && item.isSend) {
isPlan = true
} else if (this.active == 1 && item.status == 0) {
isSendCar = true
} else if (!item.isSend || item.status == 1) {
isDetail = true
}
const params = {
...item,
isPlan,
isSendCar,
isDetail,
}
uni.navigateTo({
url: `/pages/sendACarSystem/details?params=${JSON.stringify(params)}`
})
},
//
submit() { submit() {
console.log('提交') console.log('提交')
if (this.active == 1) { if (this.active == 1) {

View File

@ -120,7 +120,7 @@
v-if="showPickerTime" v-if="showPickerTime"
:show="showPickerTime" :show="showPickerTime"
v-model="dataTime" v-model="dataTime"
:max-date="new Date()" :max-date="Number(new Date())"
mode="date" mode="date"
@cancel="showPickerTime = false" @cancel="showPickerTime = false"
@confirm="confirmTime" @confirm="confirmTime"
@ -332,6 +332,11 @@ export default {
submit() { submit() {
console.log('🚀 ~ submit ~ ') console.log('🚀 ~ submit ~ ')
console.log('🚀 ~ submit ~ this.formData:', this.formData) console.log('🚀 ~ submit ~ this.formData:', this.formData)
//
if (this.formData.pkNum > this.pop.kcNum) {
this.$modal.msg('盘亏量不能大于库存量')
return
}
// //
this.$refs.uForm.validate().then(res => { this.$refs.uForm.validate().then(res => {
console.log('🚀 ~ submit ~ 提交-校验通过') console.log('🚀 ~ submit ~ 提交-校验通过')