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{
width: 100%;
}
.text-singe-line {
word-break: break-all;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
%blcok {
margin-top: 30rpx;
border-radius: 30rpx;

View File

@ -1,74 +1,46 @@
<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 class="ydi-lab">
<text @click="handleEditGood(item, index)" class="font-weight">{{item.goodsName}}</text>
<text class="font-weight">{{item.goodsName}}</text>
<view>
<u-icon @click="handleDelGood(index)" name="trash" size="32"></u-icon>
</view>
</view>
<view class="ydi-lab mt-10">
<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 class="ydi-lab mt-10">
<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>
<bpe-gooditem-filed-edit-tmp :value="item"></bpe-gooditem-filed-edit-tmp>
</view>
<u-button @click="handleEditGood" custom-style="border-radius: 16rpx;height: 66rpx;" type="primary" plain="true">
<!-- <u-button @click="handleAddGood" custom-style="border-radius: 16rpx;height: 66rpx;" type="primary" plain="true">
<u-row justify="center">
<view>
<u-icon name="plus" size="30" color="#B12D29"></u-icon>
</view>
<text class="pl-10">增加货物</text>
</u-row>
</u-button>
<buns-goodinfo-sheet v-model:show="goodinfoModal.show" v-model:value="goodinfoModal.value" :showMode="showMode" @onSure="handleGoodChange"></buns-goodinfo-sheet>
</u-button> -->
</template>
<script>
import BpeGooditemFiledEditTmp from "@/components/buns-post-edit-templates/bpe-gooditem-filed-edit-tmp"
import * as apiService from "@/common/api"
export default {
components: { BpeGooditemFiledEditTmp },
computed: {
modelInfo: {
get(){
@ -93,11 +65,7 @@
},
data() {
return {
goodinfoModal:{
show: false,
value: {},
index: undefined
}
goodsRes: { list: [] },
}
},
created() {
@ -110,26 +78,17 @@
},
methods: {
getGoodsList: apiService.getGoodsList,
handleDelGood(index) {
this.modelInfo.cargoList.splice(index, 1)
},
handleEditGood(item = { nationArea: '中国' }, index) {
this.goodinfoModal.show = true
this.goodinfoModal.value = item
this.goodinfoModal.index = index
handleAddGood(item = { }) {
this.modelInfo.cargoList.push({
...item
})
},
handleGoodChange(val) {
if(typeof this.goodinfoModal.index == 'undefined') {
// 新增回调处理
this.modelInfo.cargoList.push({
abnormalQty: 0,
...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;
align-items: center;
}
.edm-input-item{
padding: 8rpx 0;
border-bottom: 2rpx solid #F6F6F6;
}
</style>

View File

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

View File

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

View File

@ -1,23 +1,25 @@
<template>
<u-row justify="between">
<view>
<u-row>
<template v-if="!$slots.left">
<u-text :text="label" size="28" :bold="true"></u-text>
</template>
<slot name="left"></slot>
</view>
<u-row :custom-style="`min-width: ${rightWidth}rpx;`" justify="end" align="center">
<template v-if="!$slots.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>
</view>
<template v-if="!$slots.rightRcon">
<u-icon size="26" name="arrow-right" color="#333"></u-icon>
</template>
<slot name="rightRcon"></slot>
</template>
<slot name="right"></slot>
</u-row>
<view>
<u-row :custom-style="`min-width: ${rightWidth}rpx;margin-left: 10rpx;`" justify="end" align="center">
<template v-if="!$slots.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>
</view>
<template v-if="!$slots.rightRcon">
<u-icon size="26" name="arrow-right" color="#333"></u-icon>
</template>
<slot name="rightRcon"></slot>
</template>
<slot name="right"></slot>
</u-row>
</view>
</u-row>
</template>