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 { export {
addressNameCodeMap, addressNameCodeMap,
dateRangeList, dateRangeList,
@ -62,4 +74,5 @@ export {
dealBtnMap, dealBtnMap,
dateTypeEnum, dateTypeEnum,
dateTypeList, dateTypeList,
goodNumUnitList,
} }

View File

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

View File

@ -35,7 +35,7 @@
<view class="edm-input-item"> <view class="edm-input-item">
<tpx-text-item label="物品单价"> <tpx-text-item label="物品单价">
<template v-slot:right> <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> </template>
</tpx-text-item> </tpx-text-item>
</view> </view>

View File

@ -20,9 +20,21 @@
</u-row> </u-row>
</view> </view>
<view class="jsfm-item"> <view class="jsfm-item">
<tpx-text-item :required="true" label="件数" > <tpx-text-item :required="true" label="数量" >
<template #right> <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> </template>
</tpx-text-item> </tpx-text-item>
</view> </view>
@ -30,6 +42,7 @@
</template> </template>
<script> <script>
import { goodNumUnitList } from "@/common/enum"
export default { export default {
computed: { computed: {
modelInfo: { modelInfo: {
@ -86,6 +99,7 @@
}, },
data() { data() {
return { return {
goodNumUnitList,
} }
}, },
created() { created() {

View File

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

View File

@ -29,7 +29,7 @@
</view> </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"> <tpx-scroll-view :maxHeight="dropMaxHeight" :resObject="filResObject" :searchParam="filDataSearchParam" :getListFun="getListFun" size="sm" :showLoadedAll="false" @onListChange="onListChange">
<slot name="listTop"></slot> <slot name="listTop"></slot>
<view v-if="showKeyWord" class="mb-10"> <view v-if="showKeyWord" class="mb-10">
@ -96,6 +96,20 @@
// 查接口的列表才有搜索 // 查接口的列表才有搜索
let bl = !!this.getListFun let bl = !!this.getListFun
return bl 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: { components: {
@ -143,6 +157,16 @@
return 400 return 400
} }
}, },
dropLeftWidth: {
default () {
return 0
}
},
dropRightWidth: {
default () {
return 0
}
},
list: { list: {
default () { default () {
return [] return []