update: 1. 增加车牌号选填 2. tabbar全局注册

This commit is contained in:
admin 2024-07-16 09:35:15 +08:00
parent 618d4c82c2
commit 0c36e5300d
16 changed files with 589 additions and 31 deletions

View File

@ -51,7 +51,6 @@
<script setup lang="ts">
import Box from "@/components/Box/index.vue";
import Title from "@/components/Title/index.vue";
import TabBar from "@/components/TabBar/index.vue";
import { useMemberStore } from "@/store/index";
import { ProfileApi } from "@/services";
import pinia from "@/store";

View File

@ -0,0 +1,37 @@
<template>
<u-popup
:show="show"
mode="bottom"
:round="10"
:closeable="true"
@close="handleClose"
>
<plate-input
:plate="statePlate.plateNo"
@export="setPlate"
@close="handleClose"
/>
</u-popup>
</template>
<script setup lang="ts">
import plateInput from "@/components/uni-plate-input/uni-plate-input.vue";
const props = defineProps<{
show: boolean;
isShipment: boolean;
}>();
const emit = defineEmits(["handleDialog", "changeCarNo"]);
const statePlate = reactive({
plateNo: "",
});
const handleClose = () => {
emit("handleDialog", false);
};
const setPlate = (plate: string) => {
if (plate.length >= 7) statePlate.plateNo = plate;
emit("changeCarNo", plate);
statePlate.plateNo = ''
};
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1 @@
.so-mask{position:fixed;top:0;bottom:0;right:0;left:0;background:rgba(0,0,0,0.5);z-index:998}.so-plate{box-sizing:border-box;position:absolute;bottom:0;width:100%;left:0;background:#fff;padding:25upx 25upx 0 25upx}.so-plate-head{display:-webkit-box;display:flex;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center}.so-plate-type{-webkit-box-flex:1;flex:1;display:block}.so-plate-type label{display:inline-block;min-height:32upx;font-size:26upx;margin-right:10upx}.so-plate-body{box-sizing:border-box;padding:30upx 0;display:-webkit-box;display:flex;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center}.so-plate-word{border:1upx solid #ccc;border-radius:10upx;height:0;margin:0 5upx;box-sizing:border-box;padding-bottom:calc(4.28571429%);width:calc(4.28571429%);position:relative}.so-plate-word.active{border-color:#007aff;box-shadow:0 0 15upx 0 #007aff}.so-plate-word text{position:absolute;top:50%;left:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);font-weight:700;font-size:32upx}.so-plate-dot{width:15upx;height:15upx;background:#ccc;border-radius:50%;margin:0 5upx}.so-plate-keyboard{background:#eee;margin-left:-25upx;margin-right:-25upx;padding:20upx 25upx 10upx 25upx;box-sizing:border-box;-webkit-transition:all .3s;transition:all .3s}.so-plate-keyboard>view{display:-webkit-box;display:flex;flex-wrap:wrap;-webkit-box-pack:justify;justify-content:space-between}.so-plate-key{display:block;background:#fff;border-radius:10upx;box-shadow:0 0 8upx 0 #bbb;width:80upx;height:80upx;margin:5upx 0;font-size:32upx;text-align:center;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;position:relative}.so-plate-key.hover{background:#efefef}.so-plate-key.fill-block{width:80upx;height:80upx;background:none;box-shadow:none}.so-plate-btn{display:inline-block;background:#fff;border-radius:10upx;box-shadow:0 0 10upx 0 #bbb;font-size:28upx;text-align:center;margin:0 0 0 10upx}.so-plate-btn-group{display:-webkit-box;display:flex;-webkit-box-pack:justify;justify-content:space-between;background:#eee;margin-left:-25upx;margin-right:-25upx;box-sizing:border-box;padding:0 25upx 10upx 25upx}.so-plate-btn--cancel{margin:0}.so-plate-btn--submit{background:#5773f9;color:#fff}.so-plate-btn--delete{color:#fd6b6d}.animation-scale-up{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-name:scale-up;animation-name:scale-up}@-webkit-keyframes scale-up{0%{opacity:.8;-webkit-transform:scale(.8);transform:scale(.8)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes scale-up{0%{opacity:.8;-webkit-transform:scale(.8);transform:scale(.8)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}

View File

@ -0,0 +1,162 @@
.so-mask {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 998;
}
.main-plate {
// min-height: 370px;
// z-index: 999;
box-sizing: border-box;
// position: absolute;
// bottom: 0;
width: 100%;
left: 0;
background: #fff;
padding: 40upx 25upx 0 25upx;
&-head {
display: flex;
justify-content: space-between;
align-items: center;
}
&-type {
flex: 1;
display: block;
label {
display: inline-block;
min-height: 32upx;
font-size: 26upx;
margin-right: 10upx;
}
}
&-body {
box-sizing: border-box;
padding: 30upx 0;
display: flex;
justify-content: space-between;
align-items: center;
}
&-word {
border: 1upx solid #ccc;
border-radius: 10upx;
height: 0;
margin: 0 5upx;
box-sizing: border-box;
padding-bottom: calc((100% - 70upx) / 7);
width: calc((100% - 70upx) / 7);
position: relative;
&.active {
// border-color: #007aff;
// box-shadow: 0 0 15upx 0 #007aff;
border-color: $u-primary;
box-shadow: 0 0 15upx 0 $u-primary;
// color: $u-primary;
}
text {
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
font-weight: 700;
font-size: 32upx;
}
}
&-dot {
width: 15upx;
height: 15upx;
background: #ccc;
border-radius: 50%;
margin: 0 5upx;
}
&-keyboard {
// background: #eee;
margin-left: -25upx;
margin-right: -25upx;
padding: 20upx 25upx 10upx 25upx;
box-sizing: border-box;
transition: all 0.3s;
& > view {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
}
&-key {
display: block;
background: #fff;
border-radius: 10upx;
box-shadow: 0 0 8upx 0 #bbb;
width: 80upx;
height: 80upx;
margin: 5upx 0;
font-size: 32upx;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
position: relative;
&.hover {
background: #efefef;
}
&.fill-block {
width: 80upx;
height: 80upx;
background: none;
box-shadow: none;
}
}
&-btn {
display: inline-block;
background: #fff;
border-radius: 10upx;
box-shadow: 0 0 10upx 0 #bbb;
font-size: 28upx;
text-align: center;
margin: 0 0 0 10upx;
padding: 0 25upx;
&-group {
display: flex;
justify-content: space-between;
// background: #eee;
margin-left: -25upx;
margin-right: -25upx;
box-sizing: border-box;
padding: 0 25upx 10upx 25upx;
// position: absolute;
// bottom: 0px;
// width: 100%;
}
&--cancel {
margin: 0;
}
&--submit {
// background: #5773f9;
background-color: $u-primary;;
color: #fff;
}
&--delete {
color: #fd6b6d;
}
}
}
.animation-scale-up {
animation-duration: 0.2s;
animation-timing-function: ease-out;
animation-fill-mode: both;
animation-name: scale-up;
}
@keyframes scale-up {
0% {
opacity: 0.8;
transform: scale(0.8);
}
100% {
opacity: 1;
transform: scale(1);
}
}

View File

@ -0,0 +1,260 @@
<template>
<view class="main-mask">
<view class="main-plate animation-scale-up">
<!-- <view class="main-plate-head">
<view class="main-plate-type">
<radio-group @change="Changetype">
<label>
<radio value="1" :checked="type===1" />
普通车牌
</label>
<label>
<radio value="2" :checked="type===2" />
新能源车牌
</label>
</radio-group>
</view>
</view> -->
<view class="main-plate-body">
<view class="main-plate-word" :class="{ active: currenttIndex == 0 }" @tap="inputSwitch"
data-index="0">
<text>{{ currentInputValue[0] }}</text>
</view>
<view class="main-plate-word" :class="{ active: currenttIndex == 1 }" @tap="inputSwitch"
data-index="1">
<text>{{ currentInputValue[1] }}</text>
</view>
<view class="main-plate-dot"></view>
<view class="main-plate-word" :class="{ active: currenttIndex == 2 }" @tap="inputSwitch"
data-index="2">
<text>{{ currentInputValue[2] }}</text>
</view>
<view class="main-plate-word" :class="{ active: currenttIndex == 3 }" @tap="inputSwitch"
data-index="3">
<text>{{ currentInputValue[3] }}</text>
</view>
<view class="main-plate-word" :class="{ active: currenttIndex == 4 }" @tap="inputSwitch"
data-index="4">
<text>{{ currentInputValue[4] }}</text>
</view>
<view class="main-plate-word" :class="{ active: currenttIndex == 5 }" @tap="inputSwitch"
data-index="5">
<text>{{ currentInputValue[5] }}</text>
</view>
<view class="main-plate-word" :class="{ active: currenttIndex == 6 }" @tap="inputSwitch"
data-index="6">
<text>{{ currentInputValue[6] }}</text>
</view>
<view class="main-plate-word" :class="{ active: currenttIndex == 7 }" @tap="inputSwitch"
v-if="type == 2" data-index="7">
<text>{{ currentInputValue[7] }}</text>
</view>
</view>
<view class="main-plate-foot">
<!-- :style="{height:keyboardHeight}" -->
<view class="main-plate-keyboard" >
<view id="keyboard">
<block v-if="inputType == 1">
<view hover-class="hover" class="main-plate-key" v-for="el of provincesText" :key="el"
:data-value="el" @tap="chooseKey">{{ el }}</view>
</block>
<block v-if="inputType == 1">
<text class="main-plate-key fill-block"></text>
<text class="main-plate-key fill-block"></text>
</block>
<block v-if="inputType >= 3">
<view hover-class="hover" class="main-plate-key" v-for="el of numberText" :key="el"
:data-value="el" @tap="chooseKey">{{ el }}</view>
</block>
<block v-if="inputType >= 2">
<view hover-class="hover" class="main-plate-key" v-for="el of wordText" :key="el"
:data-value="el" @tap="chooseKey">{{ el }}</view>
</block>
<block v-if="inputType == 3">
<text v-for="el of fillBlock" :key="el.num" class="main-plate-key fill-block"></text>
</block>
<block v-if="inputType == 4">
<view hover-class="hover" class="main-plate-key" v-for="el of lastWordText" :key="el"
:data-value="el" @tap="chooseKey">{{ el }}</view>
</block>
<text v-if="inputType == 4" class="main-plate-key fill-block"></text>
</view>
</view>
<view class="main-plate-btn-group">
<view>
<button class="main-plate-btn main-plate-btn--cancel" @tap="$emit('close')">取消</button>
</view>
<view>
<button class="main-plate-btn main-plate-btn--delete" @tap="deleteKey">删除</button>
<button class="main-plate-btn main-plate-btn--submit" @tap="exportPlate">确定</button>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'uni-plate-input',
data() {
return {
type: 1, //
currenttIndex: 0, //
currentInputValue: ['', '', '', '', '', '', ''],
fillBlock: [{
num: 11
}, {
num: 12
}, {
num: 13
}, {
num: 14
}, {
num: 15
}, {
num: 16
}],
keyboardHeightInit: false,
keyboardHeight: 'auto',
provincesText: [
'京','冀','沪','津','晋','蒙','辽','吉',
'黑','苏','浙','皖','闽','赣','鲁','豫',
'鄂','湘','桂','琼','渝','川','贵','云',
'粤','藏','陕','甘','青','宁','新'
],
numberText: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'],
wordText: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U',
'V', 'W', 'X', 'Y', 'Z'
],
lastWordText: ['港', '澳','军', '警' , '学', '领']
};
},
props: {
plate: {
type: String
}
},
computed: {
inputType() {
switch (this.currenttIndex) {
case 0:
return 1;
break;
case 1:
return 2;
break;
case 2:
return 3;
break;
case 3:
return 3;
break;
case 4:
return 3;
break;
case 5:
return 3;
break;
case 6:
return this.type == 2 ? 3 : 4;
break;
case 7:
return 4;
break;
default:
return 1;
break;
}
}
},
watch: {
currenttIndex: function(n, o) {
if (!this.keyboardHeightInit) return
this.$nextTick(() => {
this.changeKeyboardHeight()
})
}
},
methods: {
inputSwitch(e) {
const {
index
} = e.currentTarget.dataset;
this.currenttIndex = parseInt(index);
},
Changetype(e) {
const {
value
} = e.detail;
this.type = parseInt(value)
this.currenttIndex = 0
if (value == 1) {
this.currentInputValue = ['', '', '', '', '', '', '']
} else {
this.currentInputValue = ['', '', '', '', '', '', '', '']
}
},
chooseKey(e) {
const {
value
} = e.currentTarget.dataset;
this.$set(this.currentInputValue, this.currenttIndex, value);
if (this.type == 1 && this.currenttIndex < 6) {
this.currenttIndex++
}
if (this.type == 2 && this.currenttIndex < 7) {
this.currenttIndex++
}
},
deleteKey() {
this.$set(this.currentInputValue, this.currenttIndex, '')
if (this.currenttIndex != 0) this.currenttIndex--
},
exportPlate() {
const plate = this.currentInputValue.join('')
let err = false
if (this.type === 1 && plate.length != 7) {
err = true
} else if (this.type === 2 && plate.length != 8) {
err = true
}
if (err) return uni.showToast({
title: '请输入完整的车牌号码!',
icon: 'none'
})
this.$emit('export', plate)
},
changeKeyboardHeight() {
const that = this
const query = uni.createSelectorQuery().in(this);
query.select('#keyboard').boundingClientRect();
query.exec(function(res) {
if (res && res[0]) {
that.keyboardHeight = res[0].height + uni.upx2px(30) + 'px'
that.keyboardHeightInit = true
}
});
}
},
mounted() {
const plateKey = this.plate.split('')
if (plateKey.length === 7) {
this.type = 1
} else if (plateKey.length === 8) {
this.type = 2
}
if (plateKey.length === 7 || plateKey.length === 8) {
this.currentInputValue = plateKey
this.currenttIndex = plateKey.length - 1
}
setTimeout(() => { //
this.$nextTick(() => {
this.changeKeyboardHeight()
})
}, 600);
}
};
</script>
<style scoped lang="scss">
@import './uni-plate-input';
</style>

View File

@ -2,13 +2,15 @@ import { createSSRApp } from "vue";
import uviewPlus from "uview-plus";
import pinia from './store'
import App from "./App.vue";
import './static/style/common.scss'
import TabBar from "@/components/TabBar/index.vue"//路径根据你的文件修改
export function createApp() {
const app = createSSRApp(App);
app.use(uviewPlus);
app.use(pinia);
app.component('TabBar', TabBar)
uni.$u.setConfig({
// 修改$u.config对象的属性

View File

@ -113,6 +113,15 @@
ref="productRef"
:isShipment="false"
></ProductDialog>
<!-- 车牌号 -->
<CarNoDialog
:show="showDialog.showCarNo"
@handleDialog="(v:boolean) => {handleDialog('showCarNo', v)}"
@changeCarNo="changeCarNo"
ref="carNoRef"
></CarNoDialog>
</template>
<script setup lang="ts">
import {
@ -127,9 +136,15 @@ import { countDots, formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType } from "@/utils/enum";
import _ from "underscore";
import ProductDialog from "@/components/Dialog/ProductDialog.vue";
import CarNoDialog from "@/components/Dialog/CarNoDialog.vue";
import valid from "@/utils/validate";
import { onLoad } from "@dcloudio/uni-app";
const changeCarNo = (plate: string) => {
if (plate.length >= 7) model1.order.carNumber = plate;
showDialog.showCarNo = false;
};
const handleClear = (item: any) => {
(model1.order as any)[item.key] = "";
};
@ -140,6 +155,7 @@ const showDialog = <
}
>reactive({
showProduct: false,
showCarNo: false,
});
const handleDialog = (key: string, v: boolean) => {
@ -328,6 +344,11 @@ const formAttrList = reactive<any>([
key: "carNumber",
type: "input",
unit: "",
disabled: true,
fn: () => {
showDialog.showCarNo = true
},
},
{
name: "收货产品",
@ -618,7 +639,7 @@ onUnmounted(() => {
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
border-radius: 13rpx 13rpx 0rpx 0rpx;
padding: 25rpx 50rpx;
position: fixed;
position: sticky;
width: calc(100vw - 100rpx);
bottom: 0rpx;
z-index: 999;

View File

@ -32,7 +32,11 @@
:customStyle="{}"
border="none"
:disabled="item.disabled || item.type === 'select'"
:disabledColor="['补单时间','过磅设备','客户','出货产品'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
:disabledColor="
['补单时间', '过磅设备', '客户', '出货产品'].indexOf(item.name) > -1
? '#ffffff'
: '#f5f7fa'
"
@change="(e:any) => {handleInput(e, item)}"
@clear="handleClear(item)"
>
@ -82,7 +86,9 @@
></u-datetime-picker>
<block v-for="(item, index) in formAttrList" :key="index">
<u-action-sheet
v-if="item.type === 'select' && item.key !== 'repairTime' && item.childKey"
v-if="
item.type === 'select' && item.key !== 'repairTime' && item.childKey
"
:actions="contrlModalParams[item.childKey].list"
:title="contrlModalParams[item.childKey].title"
:show="contrlModalParams[item.childKey].isShow"
@ -104,6 +110,13 @@
ref="productRef"
:isShipment="true"
></ProductDialog>
<!-- 车牌号 -->
<CarNoDialog
:show="showDialog.showCarNo"
@handleDialog="(v:boolean) => {handleDialog('showCarNo', v)}"
@changeCarNo="changeCarNo"
ref="carNoRef"
></CarNoDialog>
</template>
<script setup lang="ts">
import {
@ -119,9 +132,16 @@ import _ from "underscore";
import ProductDialog from "@/components/Dialog/ProductDialog.vue";
import valid from "@/utils/validate";
import { onLoad } from "@dcloudio/uni-app";
const handleClear = (item:any) => {
(model1.order as any)[item.key] = '';
}
import CarNoDialog from "@/components/Dialog/CarNoDialog.vue";
const changeCarNo = (plate: string) => {
if (plate.length >= 7) model1.order.carNumber = plate;
showDialog.showCarNo = false;
};
const handleClear = (item: any) => {
(model1.order as any)[item.key] = "";
};
//
const showDialog = <
{
@ -129,13 +149,13 @@ const showDialog = <
}
>reactive({
showProduct: false,
showCarNo: false,
});
const handleDialog = (key: string, v: boolean) => {
showDialog[key] = v;
};
//
const changeProduct = (obj: any) => {
model1.order.productName = obj.shmProductsName; //
@ -158,7 +178,7 @@ const handleInput = (e: any, item: any) => {
}, 10);
}
if (item.key === "number" ) {
if (item.key === "number") {
const temp = e?.replace(valid.valid_number, "");
if (countDots(temp).length > 1) {
uni.showToast({
@ -346,6 +366,10 @@ const formAttrList = reactive<any>([
key: "carNumber",
type: "input",
unit: "",
disabled: true,
fn: () => {
showDialog.showCarNo = true;
},
},
{
name: "司机电话",
@ -534,7 +558,7 @@ const startSave = () => {
if (res.code === 200) {
model1.order.id = res.data;
upload();
uni.navigateBack()
uni.navigateBack();
}
});
};
@ -575,8 +599,8 @@ onUnmounted(() => {
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
border-radius: 13rpx 13rpx 0rpx 0rpx;
padding: 25rpx 50rpx;
position: fixed;
width: calc(100vw - 100rpx);
position: sticky;
width: calc(100vw - 100rpx);
bottom: 0rpx;
z-index: 999;
::v-deep button {

View File

@ -51,7 +51,6 @@
<script setup lang="ts">
import Box from "@/components/Box/index.vue";
import Title from "@/components/Title/index.vue";
import TabBar from "@/components/TabBar/index.vue";
import { useMemberStore } from "@/store/index";
import { ProfileApi } from "@/services";
import pinia from "@/store";

View File

@ -106,7 +106,6 @@ import {
ReceiveApi,
ShipmentApi,
} from "@/services/index";
import TabBar from "@/components/TabBar/index.vue";
import { formatMoney } from "@/utils";
import { onBackPress, onShow } from "@dcloudio/uni-app";
import pinia from "@/store";

View File

@ -162,9 +162,8 @@ import {
ReceiveApi,
ShipmentApi,
} from "@/services/index";
import TabBar from "@/components/TabBar/index.vue";
import { formatMoney } from "@/utils";
import { onBackPress, onShow } from "@dcloudio/uni-app";
import { onShow } from "@dcloudio/uni-app";
import pinia from "@/store";
const store = useMemberStore(pinia);

View File

@ -125,6 +125,7 @@ const sub = () => {
border-radius: 50%;
padding: 5rpx;
left: 22rpx;
opacity: 0.5;
}
.right {
position: absolute;
@ -133,5 +134,6 @@ const sub = () => {
border-radius: 50%;
padding: 5rpx;
right: 22rpx;
opacity: 0.5;
}
</style>

View File

@ -139,11 +139,14 @@ const getCode = () => {
ProfileApi.getCommonDbPhone({ phone: model1.userInfo.phone }).then(
(res: any) => {
if (res.code === 200) {
if (res.data) {
if (res.data.length > 0) {
store.setMechanismCode(res.data[0].mechanismCode);
sendMsg();
} else {
uni.$u.toast("当前号码未加入货场,请联系管理员");
uni.showToast({
title: "当前号码未加入货场",
icon: 'none'
});
}
}
}

View File

@ -65,7 +65,6 @@
import { ProfileApi } from "@/services/index";
import { reactive } from "vue";
import { useMemberStore } from "@/store/index";
import TabBar from "@/components/TabBar/index.vue";
import SmallModal from "@/components/Modal/smallModal.vue";
import Box from "@/components/Box/index.vue";
import pinia from "@/store";

View File

@ -84,7 +84,13 @@
</template>
</u-form-item>
<u-form-item :label="'现场照片'" v-if="model1.order.id">
<Photo :params="{'businessId': model1.order.id, orderType: OrderType.Receive, imagesType: ImagesType.Tare}"/>
<Photo
:params="{
businessId: model1.order.id,
orderType: OrderType.Receive,
imagesType: ImagesType.Tare,
}"
/>
</u-form-item>
</u-form>
<block
@ -116,6 +122,14 @@
ref="productRef"
:isShipment="false"
></ProductDialog>
<!-- 车牌号 -->
<CarNoDialog
:show="showDialog.showCarNo"
@handleDialog="(v:boolean) => {handleDialog('showCarNo', v)}"
@changeCarNo="changeCarNo"
ref="carNoRef"
></CarNoDialog>
</template>
<script setup lang="ts">
import type { ComType } from "@/types/global";
@ -132,6 +146,13 @@ import ProductDialog from "@/components/Dialog/ProductDialog.vue";
import valid from "@/utils/validate";
import { countDots } from "@/utils";
import Photo from "@/components/Photo/index.vue";
import CarNoDialog from "@/components/Dialog/CarNoDialog.vue";
const changeCarNo = (plate: string) => {
if (plate.length >= 7) model1.order.carNumber = plate;
showDialog.showCarNo = false;
};
const handleClear = (item: any) => {
(model1.order as any)[item.key] = "";
};
@ -142,6 +163,7 @@ const showDialog = <
}
>reactive({
showProduct: false,
showCarNo: false,
});
const handleDialog = (key: string, v: boolean) => {
@ -290,6 +312,10 @@ const formAttrList = reactive<ComType>([
key: "carNumber",
type: "input",
unit: "",
disabled: true,
fn: () => {
showDialog.showCarNo = true;
},
},
{
name: "收货产品",
@ -825,7 +851,7 @@ onUnmounted(() => {
border-radius: 13rpx 13rpx 0rpx 0rpx;
padding: 25rpx 50rpx;
position: fixed;
width: calc(100vw - 100rpx);
width: calc(100vw - 100rpx);
bottom: 0rpx;
z-index: 999;
::v-deep button {

View File

@ -33,7 +33,7 @@
:customStyle="{}"
border="none"
:disabled="item.disabled || item.type === 'select'"
:disabledColor="item.name === '出货产品'?'#ffffff':'#f5f7fa'"
:disabledColor="item.name === '出货产品' ? '#ffffff' : '#f5f7fa'"
@change="(e:any) => {handleInput(e, item)}"
@clear="handleClear(item)"
>
@ -68,7 +68,13 @@
</template>
</u-form-item>
<u-form-item :label="'现场照片'" v-if="model1.order.id">
<Photo :params="{'businessId': model1.order.id, orderType: OrderType.Shipment, imagesType: 1}"/>
<Photo
:params="{
businessId: model1.order.id,
orderType: OrderType.Shipment,
imagesType: 1,
}"
/>
</u-form-item>
</u-form>
<block v-for="(item, index) in formAttrList" :key="index">
@ -96,6 +102,14 @@
ref="productRef"
:isShipment="true"
></ProductDialog>
<!-- 车牌号 -->
<CarNoDialog
:show="showDialog.showCarNo"
@handleDialog="(v:boolean) => {handleDialog('showCarNo', v)}"
@changeCarNo="changeCarNo"
ref="carNoRef"
></CarNoDialog>
</template>
<script setup lang="ts">
import { CustomerApi, GoodsApi, PictureApi, ShipmentApi } from "@/services";
@ -106,9 +120,15 @@ import _ from "underscore";
import ProductDialog from "@/components/Dialog/ProductDialog.vue";
import valid from "@/utils/validate";
import Photo from "@/components/Photo/index.vue";
const handleClear = (item:any) => {
(model1.order as any)[item.key] = '';
}
import CarNoDialog from "@/components/Dialog/CarNoDialog.vue";
const changeCarNo = (plate: string) => {
if (plate.length >= 7) model1.order.carNumber = plate;
showDialog.showCarNo = false;
};
const handleClear = (item: any) => {
(model1.order as any)[item.key] = "";
};
//
const showDialog = <
{
@ -116,6 +136,7 @@ const showDialog = <
}
>reactive({
showProduct: false,
showDialog: false,
});
const handleDialog = (key: string, v: boolean) => {
@ -237,7 +258,7 @@ const formAttrList = reactive<ComType>([
type: "input",
required: true,
unit: "KG",
disabled: true
disabled: true,
},
{
name: "提货方式",
@ -254,6 +275,10 @@ const formAttrList = reactive<ComType>([
key: "carNumber",
type: "input",
unit: "",
disabled: true,
fn: () => {
showDialog.showCarNo = true;
},
},
{
name: "司机电话",
@ -427,7 +452,7 @@ const updateOrder = () => {
title: "编辑成功",
icon: "success",
});
uni.navigateBack()
uni.navigateBack();
// if (state.scaleStatus === ScaleStatus.ToBeShipment || state.scaleStatus === ScaleStatus.ToBeGrossWeight) {
// // uni.redirectTo({
// // url: "/pagesShipment/shipmenting?scaleStatus=" + state.scaleStatus, //
@ -513,7 +538,7 @@ onLoad((option) => {
border-radius: 13rpx 13rpx 0rpx 0rpx;
padding: 25rpx 50rpx;
position: fixed;
width: calc(100vw - 100rpx);
width: calc(100vw - 100rpx);
bottom: 0rpx;
z-index: 999;
::v-deep button {