This commit is contained in:
aihe 2024-12-08 11:19:24 +08:00
parent ec08acc300
commit 359c1f29e2
6 changed files with 61 additions and 8 deletions

View File

@ -53,6 +53,18 @@ const dealBtnMap = {
}
// 货物数量单位
const goodNumUnitList = [
{ title: `件`, val: '件' },
{ title: `个`, val: '个' },
{ title: `条`, val: '条' },
{ title: `米`, val: '米' },
{ title: `根`, val: '根' },
{ title: `副`, val: '副' },
{ title: `张`, val: '张' },
{ title: `块`, val: '块' },
]
export {
addressNameCodeMap,
dateRangeList,
@ -62,4 +74,5 @@ export {
dealBtnMap,
dateTypeEnum,
dateTypeList,
goodNumUnitList,
}

View File

@ -76,7 +76,7 @@
<script>
import BpeGooditemFiledEditTmp from "@/components/buns-post-edit-templates/bpe-gooditem-filed-edit-tmp"
import * as apiService from "@/common/api"
import { goodNumUnitList } from "@/common/enum"
export default {
components: { BpeGooditemFiledEditTmp },
computed: {
@ -160,7 +160,8 @@
},
handleAddGood(item = { }) {
this.modelInfo.cargoList = this.modelInfo.cargoList || []
this.modelInfo.cargoList.push({
this.modelInfo.cargoList.push({
unit: goodNumUnitList[0].val,
...item
})
},

View File

@ -35,7 +35,7 @@
<view class="edm-input-item">
<tpx-text-item label="物品单价">
<template v-slot:right>
<tpx-input placeholder="请填写" v-model:value="modelInfo.price" :customStyle="`${comInSty}`" inputAlign="right" _digit="4" suffix="CNY"></tpx-input>
<tpx-input placeholder="请填写" v-model:value="modelInfo.price" :customStyle="`${comInSty}`" inputAlign="right" _digit="4"></tpx-input>
</template>
</tpx-text-item>
</view>

View File

@ -20,9 +20,21 @@
</u-row>
</view>
<view class="jsfm-item">
<tpx-text-item :required="true" label="件数" >
<tpx-text-item :required="true" label="数量" >
<template #right>
<tpx-input placeholder="请填写" v-model:value="modelInfo.cargoQty" inputAlign="right" :customStyle="`${comInSty}`" type="number" suffix="件" :_maxNum="cargoQtyMaxNum"></tpx-input>
<tpx-input placeholder="请填写" v-model:value="modelInfo.cargoQty" inputAlign="right" :customStyle="`${comInSty}`" type="number" :_maxNum="cargoQtyMaxNum"
>
<template #suffix>
<tpx-select v-model:value="modelInfo.unit" :list="goodNumUnitList"
mode="drop" :dropRightWidth="300"
>
<u-row custom-style="gap: 20rpx;margin-top:10rpx;" justify="between">
<tpx-text-dic :value="modelInfo.unit" :list="goodNumUnitList" :placeholder="goodNumUnitList[0].title"></tpx-text-dic>
</u-row>
</tpx-select>
</template>
</tpx-input>
</template>
</tpx-text-item>
</view>
@ -30,6 +42,7 @@
</template>
<script>
import { goodNumUnitList } from "@/common/enum"
export default {
computed: {
modelInfo: {
@ -86,6 +99,7 @@
},
data() {
return {
goodNumUnitList,
}
},
created() {

View File

@ -5,8 +5,9 @@
@blur="handleFocus" @focus="handleBlur"
:formatter="formatter" :disabled="disabled" :focus="autoFocus"
>
<template v-if="suffix" #suffix>
<text class="font-26 clr-sub pl-10">{{suffix}}</text>
<template v-if="suffix || $slots.suffix" #suffix>
<text v-if="suffix" class="font-26 clr-sub pl-10">{{suffix}}</text>
<slot v-if="$slots.suffix" name="suffix"></slot>
</template>
</u-input>

View File

@ -29,7 +29,7 @@
</view>
<view v-if="mode == modeEnum.drop && show" class="md-drop-cont">
<view v-if="mode == modeEnum.drop && show" class="md-drop-cont" :style="mdDropContStyle">
<tpx-scroll-view :maxHeight="dropMaxHeight" :resObject="filResObject" :searchParam="filDataSearchParam" :getListFun="getListFun" size="sm" :showLoadedAll="false" @onListChange="onListChange">
<slot name="listTop"></slot>
<view v-if="showKeyWord" class="mb-10">
@ -96,6 +96,20 @@
// 查接口的列表才有搜索
let bl = !!this.getListFun
return bl
},
mdDropContStyle(){
let { dropLeftWidth, dropRightWidth } = this
let s = ``
if(dropLeftWidth>0 || dropRightWidth>0){
s += `width:${dropLeftWidth||dropRightWidth}rpx;`
if(dropLeftWidth>0){
s += `right: auto;`
}
if(dropRightWidth>0){
s += `left: auto;`
}
}
return s
}
},
components: {
@ -143,6 +157,16 @@
return 400
}
},
dropLeftWidth: {
default () {
return 0
}
},
dropRightWidth: {
default () {
return 0
}
},
list: {
default () {
return []