This commit is contained in:
aihe 2024-06-02 00:21:36 +08:00
parent 90f20d7f7f
commit 66568dd165
5 changed files with 59 additions and 88 deletions

View File

@ -57,6 +57,13 @@
.w-full{ .w-full{
width: 100%; width: 100%;
} }
.text-singe-line {
word-break: break-all;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
%blcok { %blcok {
margin-top: 30rpx; margin-top: 30rpx;
border-radius: 30rpx; border-radius: 30rpx;

View File

@ -1,74 +1,46 @@
<template> <template>
<view class="edm-input-item">
<tpx-select v-model:value="modelInfo.goodsType" v-model:resObject="goodsRes" :getListFun="getGoodsList" :transKeyVal="{valKey: 'goodsName',titleKey: 'goodsName'}"
mode="drop" @onChange="handleChooseGood" type="multiple"
>
<tpx-text-item label="货物大类" :value="modelInfo.goodsType"></tpx-text-item>
</tpx-select>
</view>
<view class="edm-input-item">
<tpx-text-item label="货物名称">
<template v-slot:right>
<tpx-input v-model:value="modelInfo.goodsInfo" inputAlign="right"></tpx-input>
</template>
</tpx-text-item>
</view>
<view v-for="(item, index) in modelInfo.cargoList" class="yditem"> <view v-for="(item, index) in modelInfo.cargoList" class="yditem">
<view class="ydi-lab"> <view class="ydi-lab">
<text @click="handleEditGood(item, index)" class="font-weight">{{item.goodsName}}</text> <text class="font-weight">{{item.goodsName}}</text>
<view> <view>
<u-icon @click="handleDelGood(index)" name="trash" size="32"></u-icon> <u-icon @click="handleDelGood(index)" name="trash" size="32"></u-icon>
</view> </view>
</view> </view>
<view class="ydi-lab mt-10"> <bpe-gooditem-filed-edit-tmp :value="item"></bpe-gooditem-filed-edit-tmp>
<view @click="handleEditGood(item, index)" style="width: 100%;">
<u-row justify="between" custom-style="flex-wrap: wrap;">
<u-col v-if="item.nationArea" span="6">
<view class="pt-5">
<text class="clr-sub pr-10">产地</text>{{item.nationArea}}
</view>
</u-col>
<u-col span="6">
<view class="pt-5">
<text class="clr-sub pr-10">预报</text> {{item.cargoQty}}
</view>
</u-col>
<u-col v-if="item.price" span="6">
<view class="pt-5">
<text class="clr-sub pr-10">单价</text>{{item.price}} CNY
</view>
</u-col>
<u-col span="12">
<view class="pt-5">
<text class="clr-sub pr-10">尺寸</text>
{{item.length || '0'}}cm<text class="clr-sub pl-10 pr-10">*</text>
{{item.width || '0'}}cm<text class="clr-sub pl-10 pr-10 ">*</text>
{{item.length || '0'}}cm
</view>
</u-col>
<u-col span="12">
<view class="pt-5">
<text class="clr-sub pr-10">体积</text>
{{item.volume || '0'}}m³
</view>
</u-col>
</u-row>
</view>
</view> </view>
<view class="ydi-lab mt-10"> <!-- <u-button @click="handleAddGood" custom-style="border-radius: 16rpx;height: 66rpx;" type="primary" plain="true">
<u-row>
<text class="pr-20 clr-prm">异常</text>
<uni-number-box :min="0" v-model="item.abnormalQty" :max="10000" background="#fff"></uni-number-box>
</u-row>
<u-row>
<text class="pr-20">实入仓</text>
<uni-number-box :min="0" v-model="item.cargoQty" :max="10000" background="#fff"></uni-number-box>
</u-row>
</view>
</view>
<u-button @click="handleEditGood" custom-style="border-radius: 16rpx;height: 66rpx;" type="primary" plain="true">
<u-row justify="center"> <u-row justify="center">
<view> <view>
<u-icon name="plus" size="30" color="#B12D29"></u-icon> <u-icon name="plus" size="30" color="#B12D29"></u-icon>
</view> </view>
<text class="pl-10">增加货物</text> <text class="pl-10">增加货物</text>
</u-row> </u-row>
</u-button> </u-button> -->
<buns-goodinfo-sheet v-model:show="goodinfoModal.show" v-model:value="goodinfoModal.value" :showMode="showMode" @onSure="handleGoodChange"></buns-goodinfo-sheet>
</template> </template>
<script> <script>
import BpeGooditemFiledEditTmp from "@/components/buns-post-edit-templates/bpe-gooditem-filed-edit-tmp"
import * as apiService from "@/common/api"
export default { export default {
components: { BpeGooditemFiledEditTmp },
computed: { computed: {
modelInfo: { modelInfo: {
get(){ get(){
@ -93,11 +65,7 @@
}, },
data() { data() {
return { return {
goodinfoModal:{ goodsRes: { list: [] },
show: false,
value: {},
index: undefined
}
} }
}, },
created() { created() {
@ -110,26 +78,17 @@
}, },
methods: { methods: {
getGoodsList: apiService.getGoodsList,
handleDelGood(index) { handleDelGood(index) {
this.modelInfo.cargoList.splice(index, 1) this.modelInfo.cargoList.splice(index, 1)
}, },
handleAddGood(item = { }) {
handleEditGood(item = { nationArea: '中国' }, index) {
this.goodinfoModal.show = true
this.goodinfoModal.value = item
this.goodinfoModal.index = index
},
handleGoodChange(val) {
if(typeof this.goodinfoModal.index == 'undefined') {
// 新增回调处理
this.modelInfo.cargoList.push({ this.modelInfo.cargoList.push({
abnormalQty: 0, ...item
...val
}) })
} else { },
Object.assign(this.modelInfo.cargoList[this.goodinfoModal.index], val) handleChooseGood(val, name){
} this.modelInfo.goodsInfo = name
} }
} }
} }
@ -148,5 +107,8 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.edm-input-item{
padding: 8rpx 0;
border-bottom: 2rpx solid #F6F6F6;
}
</style> </style>

View File

@ -114,7 +114,7 @@
}, },
type: { type: {
default () { default () {
return "single" return "single" // single | multiple
} }
}, },
placeholder: { placeholder: {

View File

@ -1,5 +1,5 @@
<template> <template>
<text>{{title}}</text> <view class="text-singe-line">{{title}}</view>
</template> </template>
<script> <script>

View File

@ -1,12 +1,13 @@
<template> <template>
<u-row justify="between"> <u-row justify="between">
<view> <u-row>
<template v-if="!$slots.left"> <template v-if="!$slots.left">
<u-text :text="label" size="28" :bold="true"></u-text> <u-text :text="label" size="28" :bold="true"></u-text>
</template> </template>
<slot name="left"></slot> <slot name="left"></slot>
</view> </u-row>
<u-row :custom-style="`min-width: ${rightWidth}rpx;`" justify="end" align="center"> <view>
<u-row :custom-style="`min-width: ${rightWidth}rpx;margin-left: 10rpx;`" justify="end" align="center">
<template v-if="!$slots.right"> <template v-if="!$slots.right">
<view style="margin-right: 12rpx; flex:1; text-align: right;"> <view style="margin-right: 12rpx; flex:1; text-align: right;">
<tpx-text-dic :value="value" :list="list" :checkedList="checkedList" :placeholder="placeholder"></tpx-text-dic> <tpx-text-dic :value="value" :list="list" :checkedList="checkedList" :placeholder="placeholder"></tpx-text-dic>
@ -18,6 +19,7 @@
</template> </template>
<slot name="right"></slot> <slot name="right"></slot>
</u-row> </u-row>
</view>
</u-row> </u-row>
</template> </template>