Browse Source

修改直接完工功能2024/7/18 17:24:08

hella_vue3
zhang_li 3 months ago
parent
commit
5a00aaf5c8
  1. 4
      src/api/request2.js
  2. 28
      src/common/style/new_style.css
  3. 2
      src/mycomponents/balance/location.vue
  4. 18
      src/mycomponents/balance/toLocation.vue
  5. 4
      src/mycomponents/item/itemCompareQty.vue
  6. 2
      src/mycomponents/job/jobComMainDetailCard.vue
  7. 32
      src/mycomponents/qty/recommendQty.vue
  8. 77
      src/pages/fg/coms/comReceiptPopup.vue
  9. 201
      src/uni_modules/vk-uview-ui/components/u-select/u-select.vue

4
src/api/request2.js

@ -2648,3 +2648,7 @@ export function getPlaneInfoByproductLine(productionLine,planDate) {
export function planReceiptSubmit(data) { export function planReceiptSubmit(data) {
return http.post("/wms/production-main/getPlanProductionByProductionLineAndPlanDate",data) return http.post("/wms/production-main/getPlanProductionByProductionLineAndPlanDate",data)
} }
export function getProductionlineAndWorkStation() {
return http.get("/wms/production-main/getProductionlineAndWorkStation")
}

28
src/common/style/new_style.css

@ -2076,6 +2076,11 @@ button::after {
color:#2E3A63; color:#2E3A63;
margin-left:20rpx margin-left:20rpx
} }
.card_big_content {
font-size: 40rpx;
font-weight: bold;
padding: 5px;
}
.card_icon_normal { .card_icon_normal {
width: 30rpx; width: 30rpx;
@ -2085,23 +2090,25 @@ button::after {
} }
.card_packing_code { .card_packing_code {
color: #1677FF; color: #3315EB;
font-size: 26rpx; padding: 5px;
font-style: italic; font-size: 30rpx;
} }
.card_batch { .card_batch {
color: #9747FF; color: #9747FF;
font-size: 26rpx; padding: 5px;
font-style: italic; font-size: 30rpx;
} }
.card_container { .card_container {
color: #0076F6; color: #0076F6;
padding: 5px; padding: 5px;
font-size: 30rpx;
} }
.card_container_content { .card_container_content {
font-size: 32rpx; font-size: 32rpx;
padding: 5px; padding: 5px;
@ -2497,10 +2504,17 @@ button[disabled] {
.text_recommend { .text_recommend {
color: #0A84FF; color: #0A84FF;
font-size: 38rpx; font-size: 34rpx;
font-weight:bold font-weight: bold;
} }
.text_packQty {
color: #3315EB;
font-size: 40rpx;
font-weight: bold;
}
.text_balance { .text_balance {
font-size: 36rpx; font-size: 36rpx;
} }

2
src/mycomponents/balance/location.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="card_view"> <view class="card_view">
<text class="card_location">{{ title }}</text> <text class="card_location">{{ title }}</text>
<text class="card_content" style="font-size: 37rpx">{{ locationCode }}</text> <text class="card_big_content" style="font-size: 40rpx">{{ locationCode }}</text>
</view> </view>
</template> </template>

18
src/mycomponents/balance/toLocation.vue

@ -1,21 +1,19 @@
<template> <template>
<view class="card_view "> <view class="card_view">
<text class="card_to_location">{{title}}</text> <text class="card_to_location">{{ title }}</text>
<text class="card_content ">{{locationCode}}</text> <text class="card_content">{{ locationCode }}</text>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
const props = defineProps({ const props = defineProps({
locationCode: { locationCode: {
type: String, type: String
}, },
title: { title: {
type: String, type: String,
default: '库位' default: '库位'
}, }
})
})
</script> </script>
<style> <style></style>
</style>

4
src/mycomponents/item/itemCompareQty.vue

@ -3,8 +3,8 @@
<view style="flex: 1"> <view style="flex: 1">
<item :dataContent="dataContent"></item> <item :dataContent="dataContent"></item>
</view> </view>
<view style="width: 30%; display: flex; justify-content: flex-end; margin-right: 10rpx"> <view style="width: 40%; display: flex; justify-content: flex-end; margin-right: 10rpx">
<recommend-qty v-if="handleQty == 0" :dataContent="dataContent" :isShowStatus="false" :isShowStdPack="true" :objTextStyle="objTextStyle"></recommend-qty> <recommend-qty v-if="handleQty == 0" :dataContent="dataContent" :isShowStatus="false" :isShowStdPack="true"></recommend-qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)" :handleQty="Number(handleQty)" :isShowStatus="false" :isShowPackUnit="isShowPackUnit"> </compare-qty> <compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)" :handleQty="Number(handleQty)" :isShowStatus="false" :isShowPackUnit="isShowPackUnit"> </compare-qty>
</view> </view>
</view> </view>

2
src/mycomponents/job/jobComMainDetailCard.vue

@ -1,7 +1,7 @@
<template> <template>
<view class=""> <view class="">
<view class="task_text" style="border-top: 1px solid #dedede; padding-top: 20rpx"> <view class="task_text" style="border-top: 1px solid #dedede; padding-top: 20rpx">
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="false" :objTextStyle="{ fontWeight: 'bold', fontSize: '40rpx' }"></itemCompareQty> <itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="false"></itemCompareQty>
<div> <div>
<pack v-if="isShowPack && dataContent.packingNumber != null" :packingCode="dataContent.packingNumber"> </pack> <pack v-if="isShowPack && dataContent.packingNumber != null" :packingCode="dataContent.packingNumber"> </pack>
<batch v-if="isShowBatch && dataContent.batch != null" :batch="dataContent.batch"></batch> <batch v-if="isShowBatch && dataContent.batch != null" :batch="dataContent.batch"></batch>

32
src/mycomponents/qty/recommendQty.vue

@ -1,12 +1,16 @@
<template> <template>
<view> <view>
<status v-if="isShowStatus" :status='dataContent.inventoryStatus'></status> <status v-if="isShowStatus" :status="dataContent.inventoryStatus"></status>
<view class="u-flex u-row center"> <view class="u-flex u-row center">
<view class="text_recommend " :style='objTextStyle'> <view class="text_recommend">
{{Number(dataContent.qty)}} {{ Number(dataContent.qty) }}
</view> </view>
<uom :uom="dataContent.uom"></uom> <uom :uom="dataContent.uom"></uom>
<view v-if="dataContent.packQty != undefined" class="uni-flex uni-row">
<view class="uom">/</view>
<view class="text_packQty">{{ calc(dataContent.qty, dataContent.packQty) }} </view>
</view>
</view> </view>
<view> <view>
<pack-unit :dataContent="dataContent"></pack-unit> <pack-unit :dataContent="dataContent"></pack-unit>
@ -15,13 +19,14 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import packUnit from '@/mycomponents/qty/packUnit.vue' import packUnit from '@/mycomponents/qty/packUnit.vue'
import uom from '@/mycomponents/qty/uom.vue' import uom from '@/mycomponents/qty/uom.vue'
import status from '@/mycomponents/status/status.vue' import status from '@/mycomponents/status/status.vue'
const props = defineProps({
const props = defineProps({
type: { type: {
type: String, type: String,
default: 'default' //recommend: compare: default: 'default' // recommend: compare:
}, },
dataContent: { dataContent: {
@ -46,13 +51,14 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
objTextStyle:{ objTextStyle: {
type: Object, type: Object,
default: null default: null
} }
}) })
const calc = (qty, packQty) => {
return Math.ceil(Number(qty) / Number(packQty))
}
</script> </script>
<style lang="scss"> <style lang="scss"></style>
</style>

77
src/pages/fg/coms/comReceiptPopup.vue

@ -17,13 +17,12 @@
<view class="customerBorder" @click="showSelectLine"> <view class="customerBorder" @click="showSelectLine">
{{ productionLineName }} {{ productionLineName }}
</view> </view>
<u-select v-model="showProductLineSelect" mode="single-column" :list="productLineList" @confirm="confirmSelectLine"></u-select> <u-select v-model="showProductLineSelect" mode="mutil-column-auto" :list="productLineList" @confirm="confirmSelectLine"></u-select>
<view class=""> <view class="">
<image src="/static/icons/down.svg" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelectLine"> </image> <image src="/static/icons/down.svg" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelectLine"> </image>
</view> </view>
</view> </view>
<view class="split_line"></view> <view class="split_line"></view>
<view class="title" style="display: flex; align-items: center; padding: 10rpx"> <view class="title" style="display: flex; align-items: center; padding: 10rpx">
@ -31,6 +30,7 @@
<view class="customerBorder"> <view class="customerBorder">
{{ itemCode }} {{ itemCode }}
</view> </view>
<view v-if="planQty > 0">{{ planQty }}({{ getUomInfo(uom) }})</view>
<u-select v-model="showItemCodeSelect" mode="single-column" :list="itemCodeList" @confirm="confirmSelectItem"></u-select> <u-select v-model="showItemCodeSelect" mode="single-column" :list="itemCodeList" @confirm="confirmSelectItem"></u-select>
<view class=""> <view class="">
<image src="/static/icons/down.svg" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelectItemCode"> </image> <image src="/static/icons/down.svg" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelectItemCode"> </image>
@ -46,22 +46,23 @@
</view> </view>
</view> </view>
<view class="split_line"></view> <view class="split_line"></view>
<view class="title" style="display: flex; align-items: center; padding: 10rpx"> <!-- <view class="title " style="display: flex;align-items: center;padding: 10rpx;">
<text style="flex-shrink: 0; width: 25%">计划数量</text> <text style=" flex-shrink: 0; width: 25%;">计划数量</text>
<view class="customerBorder"> <view class="customerBorder">
{{ planQty }} {{planQty}}
</view> </view>
<view class=""> <view class="">
<image src="" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx"> </image> <image src="" mode="" style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;">
</view> </image>
</view> </view>
</view> -->
<view class="split_line"></view> <view class="split_line"></view>
<view class="title" style="display: flex; align-items: center; padding: 10rpx"> <view class="title" style="display: flex; align-items: center; padding: 10rpx">
<text style="flex-shrink: 0; width: 25%">包装规格</text> <text style="flex-shrink: 0; width: 25%">包装规格</text>
<view class="customerBorder"> <view class="customerBorder">
{{ packUnit }} {{ packUnit }}
</view> </view>
<u-select v-model="showPackUnitSelect" mode="mutil-column-auto" :list="packUnitList" @confirm="confirmSelectPackUnit"></u-select> <u-select v-model="showPackUnitSelect" mode="mutil-column" :list="packUnitList" @confirm="confirmSelectPackUnit"></u-select>
<view class=""> <view class="">
<image src="/static/icons/down.svg" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelectPackUnit"> </image> <image src="/static/icons/down.svg" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelectPackUnit"> </image>
</view> </view>
@ -82,7 +83,7 @@
</template> </template>
<script> <script>
import { getIssueJobByProductionline, getPlaneInfoByproductLine, getPackUnitByItemCode } from '@/api/request2.js' import { getIssueJobByProductionline, getPlaneInfoByproductLine, getPackUnitByItemCode, getProductionlineAndWorkStation } from '@/api/request2.js'
import { getPackUnitName, getUomInfo } from '@/common/directory.js' import { getPackUnitName, getUomInfo } from '@/common/directory.js'
import { getCurrDate, getBatch8 } from '@/common/basic.js' import { getCurrDate, getBatch8 } from '@/common/basic.js'
@ -115,36 +116,7 @@ export default {
showPackUnitSelect: false, showPackUnitSelect: false,
itemCodeList: [], itemCodeList: [],
showItemCodeSelect: false, showItemCodeSelect: false,
packUnitList: [ packUnitList: []
{
value: 1,
label: '中国',
children: [
{
value: 2,
label: '广东'
},
{
value: 5,
label: '广西'
}
]
},
{
value: 8,
label: '美国',
children: [
{
value: 9,
label: '纽约'
},
{
value: 10,
label: '华盛顿'
}
]
}
]
} }
}, },
props: { props: {
@ -247,13 +219,13 @@ export default {
title: '加载中', title: '加载中',
mask: true mask: true
}) })
getIssueJobByProductionline() getProductionlineAndWorkStation()
.then((res) => { .then((res) => {
uni.hideLoading() uni.hideLoading()
if (res.data && res.data.length > 0) { if (res.data && res.data.length > 0) {
res.data.forEach((item) => { // res.data.forEach(item => {
item.label = item.name // item.label = item.name
}) // })
this.productLineList = res.data this.productLineList = res.data
this.showProductLineSelect = true this.showProductLineSelect = true
} else { } else {
@ -285,7 +257,8 @@ export default {
uni.hideLoading() uni.hideLoading()
if (res.data && res.data.length > 0) { if (res.data && res.data.length > 0) {
res.data.forEach((item) => { res.data.forEach((item) => {
item.label = item.itemCode item.label = `${item.itemCode}${item.planQty}${item.uom})`
item.value = item
}) })
this.itemCodeList = res.data this.itemCodeList = res.data
this.showItemCodeSelect = true this.showItemCodeSelect = true
@ -302,11 +275,17 @@ export default {
} }
}, },
confirmSelectItem(data) { confirmSelectItem(data) {
this.itemCode = data[0].label const productionPlan = data[0].value
const item = this.itemCodeList.find((res) => res.itemCode == this.itemCode) this.itemCode = productionPlan.itemCode
this.uom = item.uom // var item = this.itemCodeList.find(res => res.itemCode == this.itemCode)
this.planQty = item.planQty this.uom = productionPlan.uom
this.number = item.number this.planQty = productionPlan.planQty
this.number = productionPlan.number
// this.itemCode = data[0].label
// var item = this.itemCodeList.find(res => res.itemCode == this.itemCode)
// this.uom = item.uom
// this.planQty = item.planQty
// this.number = item.number
}, },
showSelectPackUnit() { showSelectPackUnit() {

201
src/uni_modules/vk-uview-ui/components/u-select/u-select.vue

@ -12,27 +12,14 @@
<u-popup :blur="blur" :maskCloseAble="maskCloseAble" mode="bottom" :popup="false" v-model="popupValue" length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="close" :z-index="uZIndex"> <u-popup :blur="blur" :maskCloseAble="maskCloseAble" mode="bottom" :popup="false" v-model="popupValue" length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="close" :z-index="uZIndex">
<view class="u-select"> <view class="u-select">
<view class="u-select__header" @touchmove.stop.prevent=""> <view class="u-select__header" @touchmove.stop.prevent="">
<view <view class="u-select__header__cancel u-select__header__btn" :style="{ color: cancelColor }" hover-class="u-hover-class" :hover-stay-time="150" @tap.stop="getResult('cancel')">
class="u-select__header__cancel u-select__header__btn" {{ cancelText }}
:style="{ color: cancelColor }"
hover-class="u-hover-class"
:hover-stay-time="150"
@tap.stop="getResult('cancel')"
>
{{cancelText}}
</view> </view>
<view class="u-select__header__title"> <view class="u-select__header__title">
{{title}} {{ title }}
</view> </view>
<view <view class="u-select__header__confirm u-select__header__btn" :style="{ color: moving ? cancelColor : confirmColor }" hover-class="u-hover-class" :hover-stay-time="150" @touchmove.stop="" @tap.stop="getResult('confirm')">
class="u-select__header__confirm u-select__header__btn" {{ confirmText }}
:style="{ color: moving ? cancelColor : confirmColor }"
hover-class="u-hover-class"
:hover-stay-time="150"
@touchmove.stop=""
@tap.stop="getResult('confirm')"
>
{{confirmText}}
</view> </view>
</view> </view>
<view class="u-select__body"> <view class="u-select__body">
@ -50,7 +37,7 @@
</template> </template>
<script> <script>
/** /**
* select 列选择器 * select 列选择器
* @description 此选择器用于单列多列多列联动的选择场景(从1.3.0版本起不建议使用Picker组件的单列和多列模式Select组件是专门为列选择而构造的组件更简单易用) * @description 此选择器用于单列多列多列联动的选择场景(从1.3.0版本起不建议使用Picker组件的单列和多列模式Select组件是专门为列选择而构造的组件更简单易用)
* @tutorial http://uviewui.com/components/select.html * @tutorial http://uviewui.com/components/select.html
@ -73,7 +60,7 @@
*/ */
export default { export default {
emits: ["update:modelValue", "input", "confirm","cancel"], emits: ['update:modelValue', 'input', 'confirm', 'cancel'],
props: { props: {
// //
value: { value: {
@ -88,7 +75,7 @@ export default {
list: { list: {
type: Array, type: Array,
default() { default() {
return []; return []
} }
}, },
// //
@ -124,7 +111,7 @@ export default {
defaultValue: { defaultValue: {
type: Array, type: Array,
default() { default() {
return [0]; return [0]
} }
}, },
// single-column-mutil-column-mutil-column-auto- // single-column-mutil-column-mutil-column-auto-
@ -166,7 +153,7 @@ export default {
blur: { blur: {
type: [Number, String], type: [Number, String],
default: 0 default: 0
}, }
}, },
data() { data() {
return { return {
@ -183,197 +170,195 @@ export default {
columnNum: 0, columnNum: 0,
// //
moving: false moving: false
}; }
}, },
watch: { watch: {
// select // select
value: { value: {
immediate: true, immediate: true,
handler(val) { handler(val) {
if(val) setTimeout(() => this.init(), 10); if (val) setTimeout(() => this.init(), 10)
this.popupValue = val; this.popupValue = val
} }
}, },
modelValue: { modelValue: {
immediate: true, immediate: true,
handler(val) { handler(val) {
if(val) setTimeout(() => this.init(), 10); if (val) setTimeout(() => this.init(), 10)
this.popupValue = val; this.popupValue = val
}
} }
},
}, },
computed: { computed: {
uZIndex() { uZIndex() {
// z-index使 // z-index使
return this.zIndex ? this.zIndex : this.$u.zIndex.popup; return this.zIndex ? this.zIndex : this.$u.zIndex.popup
}, }
}, },
methods: { methods: {
// //
pickstart() { pickstart() {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
this.moving = true; this.moving = true
// #endif // #endif
}, },
// //
pickend() { pickend() {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
this.moving = false; this.moving = false
// #endif // #endif
}, },
init() { init() {
this.setColumnNum(); this.setColumnNum()
this.setDefaultSelector(); this.setDefaultSelector()
this.setColumnData(); this.setColumnData()
this.setSelectValue(); this.setSelectValue()
}, },
// //
setDefaultSelector() { setDefaultSelector() {
// columnNum0 // columnNum0
this.defaultSelector = this.defaultValue.length == this.columnNum ? this.defaultValue : Array(this.columnNum).fill(0); this.defaultSelector = this.defaultValue.length == this.columnNum ? this.defaultValue : Array(this.columnNum).fill(0)
this.lastSelectIndex = this.$u.deepClone(this.defaultSelector); this.lastSelectIndex = this.$u.deepClone(this.defaultSelector)
}, },
// //
setColumnNum() { setColumnNum() {
// 1 // 1
if(this.mode == 'single-column') this.columnNum = 1; if (this.mode == 'single-column') this.columnNum = 1
// this.list // this.list
else if(this.mode == 'mutil-column') this.columnNum = this.list.length; else if (this.mode == 'mutil-column') this.columnNum = this.list.length
// this.list // this.list
else if(this.mode == 'mutil-column-auto') { else if (this.mode == 'mutil-column-auto') {
let num = 1; let num = 1
let column = this.list; let column = this.list
// children // children
while(column[0][this.childName]) { while (column[0][this.childName]) {
column = column[0] ? column[0][this.childName] : {}; column = column[0] ? column[0][this.childName] : {}
num ++; num++
} }
this.columnNum = num; this.columnNum = num
} }
}, },
// picker // picker
setColumnData() { setColumnData() {
let data = []; let data = []
this.selectValue = []; this.selectValue = []
if(this.mode == 'mutil-column-auto') { if (this.mode == 'mutil-column-auto') {
// //
let column = this.list[this.defaultSelector.length ? this.defaultSelector[0] : 0]; let column = this.list[this.defaultSelector.length ? this.defaultSelector[0] : 0]
// //
for (let i = 0; i < this.columnNum; i++) { for (let i = 0; i < this.columnNum; i++) {
// list // list
if (i == 0) { if (i == 0) {
data[i] = this.list; data[i] = this.list
column = column[this.childName]; column = column[this.childName]
} else { } else {
// //
data[i] = column; data[i] = column
column = column[this.defaultSelector[i]][this.childName]; column = column[this.defaultSelector[i]][this.childName]
} }
} }
} else if(this.mode == 'single-column') { } else if (this.mode == 'single-column') {
data[0] = this.list; data[0] = this.list
} else { } else {
data = this.list; data = this.list
} }
this.columnData = data; this.columnData = data
}, },
// defaultValue // defaultValue
setSelectValue() { setSelectValue() {
let tmp = null; let tmp = null
for(let i = 0; i < this.columnNum; i++) { for (let i = 0; i < this.columnNum; i++) {
tmp = this.columnData[i][this.defaultSelector[i]]; tmp = this.columnData[i][this.defaultSelector[i]]
let data = { const data = {
value: tmp ? tmp[this.valueName] : null, value: tmp ? tmp[this.valueName] : null,
label: tmp ? tmp[this.labelName] : null label: tmp ? tmp[this.labelName] : null
}; }
// //
if(tmp && tmp.extra) data.extra = tmp.extra; if (tmp && tmp.extra) data.extra = tmp.extra
this.selectValue.push(data) this.selectValue.push(data)
} }
}, },
// //
columnChange(e) { columnChange(e) {
let index = null; let index = null
let columnIndex = e.detail.value; const columnIndex = e.detail.value
// push // push
this.selectValue = []; this.selectValue = []
if(this.mode == 'mutil-column-auto') { if (this.mode == 'mutil-column-auto') {
// //
this.lastSelectIndex.map((val, idx) => { this.lastSelectIndex.map((val, idx) => {
if (val != columnIndex[idx]) index = idx; if (val != columnIndex[idx]) index = idx
}); })
this.defaultSelector = columnIndex; this.defaultSelector = columnIndex
for (let i = index + 1; i < this.columnNum; i++) { for (let i = index + 1; i < this.columnNum; i++) {
// children // children
// //
this.columnData[i] = this.columnData[i - 1][i - 1 == index ? columnIndex[index] : 0][this.childName]; this.columnData[i] = this.columnData[i - 1][i - 1 == index ? columnIndex[index] : 0][this.childName]
// //
this.defaultSelector[i] = 0; this.defaultSelector[i] = 0
} }
// this.columnDatacolumnChange // this.columnDatacolumnChange
// undefined // undefined
columnIndex.map((item, index) => { columnIndex.map((item, index) => {
let data = this.columnData[index][columnIndex[index]]; const data = this.columnData[index][columnIndex[index]]
let tmp = { const tmp = {
value: data ? data[this.valueName] : null, value: data ? data[this.valueName] : null,
label: data ? data[this.labelName] : null, label: data ? data[this.labelName] : null
}; }
// //
if(data && data.extra !== undefined) tmp.extra = data.extra; if (data && data.extra !== undefined) tmp.extra = data.extra
this.selectValue.push(tmp); this.selectValue.push(tmp)
}) })
// //
this.lastSelectIndex = columnIndex; this.lastSelectIndex = columnIndex
} else if(this.mode == 'single-column') { } else if (this.mode == 'single-column') {
let data = this.columnData[0][columnIndex[0]]; const data = this.columnData[0][columnIndex[0]]
// //
let tmp = { const tmp = {
value: data ? data[this.valueName] : null, value: data ? data[this.valueName] : null,
label: data ? data[this.labelName] : null, label: data ? data[this.labelName] : null
}; }
// //
if(data && data.extra !== undefined) tmp.extra = data.extra; if (data && data.extra !== undefined) tmp.extra = data.extra
this.selectValue.push(tmp); this.selectValue.push(tmp)
} else if(this.mode == 'mutil-column') { } else if (this.mode == 'mutil-column') {
// //
columnIndex.map((item, index) => { columnIndex.map((item, index) => {
let data = this.columnData[index][columnIndex[index]]; const data = this.columnData[index][columnIndex[index]]
// //
let tmp = { const tmp = {
value: data ? data[this.valueName] : null, value: data ? data[this.valueName] : null,
label: data ? data[this.labelName] : null, label: data ? data[this.labelName] : null
}; }
// //
if(data && data.extra !== undefined) tmp.extra = data.extra; if (data && data.extra !== undefined) tmp.extra = data.extra
this.selectValue.push(tmp); this.selectValue.push(tmp)
}) })
} }
}, },
close() { close() {
this.$emit('input', false); this.$emit('input', false)
this.$emit("update:modelValue", false); this.$emit('update:modelValue', false)
}, },
// //
getResult(event = null) { getResult(event = null) {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
if (this.moving) return; if (this.moving) return
// #endif // #endif
if (event) this.$emit(event, this.selectValue); if (event) this.$emit(event, this.selectValue)
this.close(); this.close()
}, },
selectHandler() { selectHandler() {
this.$emit('click'); this.$emit('click')
} }
} }
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import "../../libs/css/style.components.scss"; @import '../../libs/css/style.components.scss';
.u-select { .u-select {
&__action { &__action {
position: relative; position: relative;
line-height: $u-form-item-height; line-height: $u-form-item-height;
@ -383,7 +368,7 @@ export default {
position: absolute; position: absolute;
right: 20rpx; right: 20rpx;
top: 50%; top: 50%;
transition: transform .4s; transition: transform 0.4s;
transform: translateY(-50%); transform: translateY(-50%);
z-index: 1; z-index: 1;
@ -415,7 +400,7 @@ export default {
&__body { &__body {
width: 100%; width: 100%;
height: 300rpx; height: 500rpx;
overflow: hidden; overflow: hidden;
background-color: #fff; background-color: #fff;

Loading…
Cancel
Save