2024-06-02 15:02:19 +00:00
|
|
|
|
<template>
|
2024-07-29 16:28:21 +00:00
|
|
|
|
<view v-if="showMode!=1" class="dt-block" >
|
2024-06-02 15:02:19 +00:00
|
|
|
|
<view class="dt-tle">
|
2024-07-29 16:28:21 +00:00
|
|
|
|
<view class="com-section">物品信息</view>
|
2024-06-02 15:02:19 +00:00
|
|
|
|
</view>
|
|
|
|
|
|
<view class="dt-cont">
|
|
|
|
|
|
<view class="dt-block mt-10">
|
2024-07-31 15:37:10 +00:00
|
|
|
|
<tpx-tags v-model:value="checkedGoodId" type="multiple" :list="hotGoods" @onChange="handleChooseGood"></tpx-tags>
|
2024-06-02 15:02:19 +00:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<view class="dt-block" >
|
|
|
|
|
|
<view class="dt-cont">
|
2024-08-02 08:57:05 +00:00
|
|
|
|
<view v-if="showMode!=1" class="edm-input-item pos-rlt">
|
|
|
|
|
|
<view class="mt-30 lbRequiredDot" style="position: absolute;"></view>
|
2024-06-02 15:02:19 +00:00
|
|
|
|
<tpx-select v-model:value="checkedGoodId" v-model:resObject="goodsRes" :getListFun="getGoodsList" :transKeyVal="{valKey: 'goodsName',titleKey: 'goodsName'}"
|
|
|
|
|
|
mode="drop" @onChange="handleChooseGood"
|
|
|
|
|
|
>
|
2024-08-02 08:57:05 +00:00
|
|
|
|
<tpx-textarea v-model:value="modelInfo.goodsName" placeholder="物品名称" :autoHeight="true" :height="40"></tpx-textarea>
|
2024-06-02 15:02:19 +00:00
|
|
|
|
</tpx-select>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
2024-06-11 09:35:55 +00:00
|
|
|
|
<!-- <view class="edm-input-item">
|
|
|
|
|
|
<tpx-text-item label="件数">
|
2024-06-02 15:02:19 +00:00
|
|
|
|
<template v-slot:right>
|
|
|
|
|
|
<tpx-input placeholder="请填写" v-model:value="modelInfo.cargoQty" inputAlign="right" type="number" suffix="件" :_maxNum="cargoQtyMaxNum"></tpx-input>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</tpx-text-item>
|
2024-06-11 09:35:55 +00:00
|
|
|
|
</view> -->
|
2024-06-02 15:02:19 +00:00
|
|
|
|
|
2024-08-02 09:41:30 +00:00
|
|
|
|
<bpe-gooditemsize-tmp v-model:value="modelInfo" :submitVal="submitVal" :comInSty="comInSty"></bpe-gooditemsize-tmp>
|
2024-06-02 15:02:19 +00:00
|
|
|
|
|
|
|
|
|
|
<view v-if="showMode!=1">
|
|
|
|
|
|
<view class="edm-input-item">
|
|
|
|
|
|
<tpx-text-item label="物品单价">
|
|
|
|
|
|
<template v-slot:right>
|
2024-12-08 03:19:24 +00:00
|
|
|
|
<tpx-input placeholder="请填写" v-model:value="modelInfo.price" :customStyle="`${comInSty}`" inputAlign="right" _digit="4"></tpx-input>
|
2024-06-02 15:02:19 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
</tpx-text-item>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<view class="edm-input-item">
|
2024-08-02 08:57:05 +00:00
|
|
|
|
<tpx-select v-model:value="modelInfo.nationArea" v-model:resObject="countryRes" :getListFun="getCountryList" :transKeyVal="{valKey: 'name',titleKey: 'name'}"
|
|
|
|
|
|
mode="drop"
|
|
|
|
|
|
>
|
|
|
|
|
|
<tpx-text-item label="原产地">
|
|
|
|
|
|
<template v-slot:right>
|
2024-08-02 09:41:30 +00:00
|
|
|
|
<tpx-input placeholder="请填写" v-model:value="modelInfo.nationArea" :customStyle="`${comInSty}`" inputAlign="right"></tpx-input>
|
2024-08-02 08:57:05 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
</tpx-text-item>
|
|
|
|
|
|
</tpx-select>
|
2024-06-02 15:02:19 +00:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<view v-if="showMode!=1" class="dt-block" style="margin-top: 50rpx;">
|
|
|
|
|
|
<view class="dt-tle">
|
|
|
|
|
|
<view class="com-section grey">其他信息(按需填写)</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="dt-cont">
|
|
|
|
|
|
<view class="edm-input-item">
|
|
|
|
|
|
<tpx-text-item label="品牌">
|
|
|
|
|
|
<template v-slot:right>
|
2024-08-02 09:41:30 +00:00
|
|
|
|
<tpx-input placeholder="请填写" v-model:value="modelInfo.brand" :customStyle="`${comInSty}`" inputAlign="right"></tpx-input>
|
2024-06-02 15:02:19 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
</tpx-text-item>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="edm-input-item">
|
|
|
|
|
|
<tpx-text-item label="材质">
|
|
|
|
|
|
<template v-slot:right>
|
2024-08-02 09:41:30 +00:00
|
|
|
|
<tpx-input placeholder="请填写" v-model:value="modelInfo.material" :customStyle="`${comInSty}`" inputAlign="right"></tpx-input>
|
2024-06-02 15:02:19 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
</tpx-text-item>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="edm-input-item">
|
|
|
|
|
|
<tpx-text-item label="用途">
|
|
|
|
|
|
<template v-slot:right>
|
2024-08-02 09:41:30 +00:00
|
|
|
|
<tpx-input placeholder="请填写" v-model:value="modelInfo.purpose" :customStyle="`${comInSty}`" inputAlign="right"></tpx-input>
|
2024-06-02 15:02:19 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
</tpx-text-item>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="edm-input-item">
|
|
|
|
|
|
<tpx-text-item label="成分">
|
|
|
|
|
|
<template v-slot:right>
|
2024-08-02 09:41:30 +00:00
|
|
|
|
<tpx-input placeholder="请填写" v-model:value="modelInfo.ingredients" :customStyle="`${comInSty}`" inputAlign="right"></tpx-input>
|
2024-06-02 15:02:19 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
</tpx-text-item>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="edm-input-item">
|
|
|
|
|
|
<tpx-text-item label="供应商">
|
|
|
|
|
|
<template v-slot:right>
|
2024-08-02 09:41:30 +00:00
|
|
|
|
<tpx-input placeholder="请填写" v-model:value="modelInfo.supplier" :customStyle="`${comInSty}`" inputAlign="right"></tpx-input>
|
2024-06-02 15:02:19 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
</tpx-text-item>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="edm-input-item" style="padding-top: 24rpx;padding-bottom: 24rpx;">
|
|
|
|
|
|
<tpx-text-item label="保存物品信息">
|
|
|
|
|
|
<template v-slot:right>
|
|
|
|
|
|
<u-switch v-model="modelInfo.isSave" activeValue="1" inactiveValue="0" active-color="#B12D29" size="34"></u-switch>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</tpx-text-item>
|
|
|
|
|
|
|
|
|
|
|
|
<u-row justify="between">
|
|
|
|
|
|
<text class="font-28 "></text>
|
|
|
|
|
|
<view>
|
|
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</u-row>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import * as apiService from "@/common/api"
|
|
|
|
|
|
import { transListKeyTitle } from "@/common/util"
|
|
|
|
|
|
import BpeGooditemsizeTmp from "@/components/buns-post-edit-templates/bpe-gooditemsize-tmp"
|
|
|
|
|
|
export default {
|
|
|
|
|
|
components: { BpeGooditemsizeTmp },
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
dicData() {
|
|
|
|
|
|
return this.$store.getters.dicData
|
|
|
|
|
|
},
|
|
|
|
|
|
modelInfo: {
|
|
|
|
|
|
get(){
|
|
|
|
|
|
return this.value
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
cargoQtyMaxNum(){
|
|
|
|
|
|
// 限制数量的最大值
|
|
|
|
|
|
let { cargoList, parcelQty } = this.submitVal
|
|
|
|
|
|
let curQty = (+this.modelInfo.cargoQty) || 0
|
|
|
|
|
|
let qtMaxNum = parcelQty + curQty
|
|
|
|
|
|
cargoList.map(t=> {
|
|
|
|
|
|
if(t.cargoQty) {
|
|
|
|
|
|
qtMaxNum = qtMaxNum - t.cargoQty
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
if(qtMaxNum < 0) {
|
|
|
|
|
|
qtMaxNum = 0
|
|
|
|
|
|
}
|
|
|
|
|
|
return qtMaxNum
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
},
|
|
|
|
|
|
props: {
|
|
|
|
|
|
value: {
|
|
|
|
|
|
default () {
|
|
|
|
|
|
return {}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
submitVal: {
|
|
|
|
|
|
default () {
|
|
|
|
|
|
return {}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
showMode: {
|
|
|
|
|
|
default () {
|
|
|
|
|
|
return '1' // 1 只显示商品名称、体积; 2:显示全部商品信息
|
|
|
|
|
|
}
|
2024-08-02 09:41:30 +00:00
|
|
|
|
},
|
|
|
|
|
|
comInSty: {
|
|
|
|
|
|
default () {
|
|
|
|
|
|
return ''
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2024-06-02 15:02:19 +00:00
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
goodsRes: { list: [] },
|
2024-08-02 08:57:05 +00:00
|
|
|
|
countryRes: { list: [] },
|
2024-06-02 15:02:19 +00:00
|
|
|
|
checkedGoodId: '',
|
|
|
|
|
|
hotGoods: [
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
|
|
|
this.initData()
|
|
|
|
|
|
},
|
|
|
|
|
|
onHide() {
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
unmounted() {},
|
|
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
getGoodsList: apiService.getGoodsList,
|
2024-08-02 08:57:05 +00:00
|
|
|
|
getCountryList: apiService.getEmisCountry,
|
2024-06-02 15:02:19 +00:00
|
|
|
|
|
|
|
|
|
|
async initData() {
|
|
|
|
|
|
this.checkedGoodId = ''
|
|
|
|
|
|
let res = await apiService.getHotGoodsList({ customerCode: this.modelInfo.customerCode, pageSize: 5 })
|
|
|
|
|
|
let list = res.rows || []
|
2024-07-29 16:28:21 +00:00
|
|
|
|
// 截取前3个热门商品
|
|
|
|
|
|
list.splice(3, list.length - 3)
|
2024-06-02 15:02:19 +00:00
|
|
|
|
this.hotGoods = transListKeyTitle({ valKey: 'goodsCode',titleKey: 'goodsName', list })
|
|
|
|
|
|
},
|
|
|
|
|
|
handleCloseModal() {
|
|
|
|
|
|
this.$emit('update:show', false)
|
|
|
|
|
|
},
|
|
|
|
|
|
handleSubmitValue() {
|
|
|
|
|
|
this.$emit('onSure', this.modelInfo)
|
|
|
|
|
|
this.$emit('update:value', this.modelInfo)
|
|
|
|
|
|
this.handleCloseModal()
|
|
|
|
|
|
},
|
2024-07-31 15:37:10 +00:00
|
|
|
|
handleChooseGood(val, text) {
|
|
|
|
|
|
const goodsNames = text
|
|
|
|
|
|
this.modelInfo.goodsName = goodsNames
|
2024-06-02 15:02:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
.shet-cont{
|
|
|
|
|
|
padding: 10rpx 0 30rpx 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
.dt-block {
|
|
|
|
|
|
// background-color: #FFF;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
}
|
|
|
|
|
|
.dt-tle {
|
|
|
|
|
|
padding-bottom: 10rpx;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
.t1 {
|
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
.t2{
|
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.dt-cont{
|
|
|
|
|
|
}
|
|
|
|
|
|
.dt-item {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
|
margin-bottom: 20rpx;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.yditem{
|
|
|
|
|
|
padding: 20rpx 20rpx;
|
|
|
|
|
|
background-color: #F6F6F6;
|
|
|
|
|
|
border-radius: 10rpx;
|
|
|
|
|
|
margin-bottom: 20rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
.ydi-lab{
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
.edm-input-item{
|
|
|
|
|
|
padding: 8rpx 0;
|
|
|
|
|
|
// border-bottom: 2rpx solid #F6F6F6;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|