From 86bccbfa3fc4b3961914f9750091b412e7a126a4 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期五, 15 三月 2024 13:47:46 +0800
Subject: [PATCH] #
---
pages/common/mat/matPick.vue | 134 +++++++++++++++++++++++++++++++++++++-------
1 files changed, 112 insertions(+), 22 deletions(-)
diff --git a/pages/common/mat/matPick.vue b/pages/common/mat/matPick.vue
index 077ca63..03807ae 100644
--- a/pages/common/mat/matPick.vue
+++ b/pages/common/mat/matPick.vue
@@ -5,9 +5,24 @@
<!-- key -->
<view class="item-key">{{item.title}}</view>
<!-- value -->
- <view class="item-val">{{item.value}}</view>
+ <view class="item-text" v-if="item.type == 'text'">{{mat[item.field]}}</view>
+ <!-- <view class="item-text" v-if="item.type == 'text'">{{item.value}}</view> -->
+ <view class="item-input" v-if="item.type == 'input'" :style="'text-align:'+ float">
+ <input type="text" @blur="blur" @focus="focus" v-model="inputData">
+ </view>
+ <view class="item-input" v-if="item.type == 'number-box'">
+ <uni-number-box v-model="numberData" :max="99999999" :step='1' color="#747474" @change="changeValue" />
+ </view>
+ <view class="item-input" v-if="item.type == 'select'">
+ <riko-combox @input="select" :candidates="candidates" :value="city" :inputFlag="true"></riko-combox>
+ </view>
</view>
</view>
+
+ <view class="z-floor">
+ <view class="z-primary" @click="back">鎻愬彇</view>
+ </view>
+
</view>
</template>
@@ -15,58 +30,133 @@
export default {
data() {
return {
+ candidates: [{name: 'box',id:1},{name: 'plan',id: 2}],
+ city: null,
data: [
{
- title: '鐗╂枡鍚嶇О鐗�',
+ title: '鍟嗗搧鍚嶇О',
field: 'maktx',
hied: false,
- value: '123456'
+ value: '123456',
+ type: 'text'
},
{
- title: '鐗╂枡缂栧彿',
- field: 'maktx',
+ title: '鍟嗗搧缂栧彿',
+ field: 'matnr',
hied: false,
- value: '娓╁害銆傜┖璋冪敤鏉ユ帶鍒舵暟鎹腑蹇冪殑娓╁害鍜屾箍搴︼紝鍒跺喎涓庣┖璋�'
+ value: '娓╁害銆傜┖璋�',
+ type: 'text'
},
{
- title: '鐗╂枡鍚嶇О鐗╃墿鏂欏悕绉扮墿',
- field: 'maktx',
+ title: '瑙勬牸',
+ field: 'specs',
hied: false,
- value: '123456'
+ value: '蠁160*45蠁160*45蠁160*45蠁160*45蠁160*45蠁160*45蠁160*45蠁160*45蠁160*45蠁160*45',
+ type: 'text'
},
- ]
+ {
+ title: '鎵瑰彿',
+ field: 'batch',
+ hied: false,
+ value: '鐗╂枡鍚嶇О鐗�',
+ type: 'input'
+ },
+ {
+ title: '鏁伴噺',
+ field: 'count',
+ hied: false,
+ value: '鐗╂枡鍚嶇О鐗�',
+ type: 'number-box'
+ },
+ // {
+ // title: '璐т富',
+ // field: 'maktx',
+ // hied: false,
+ // value: '鐗╂枡鍚嶇О鐗�',
+ // type: 'select'
+ // },
+ ],
+ mat: '',
+ float: 'left',
+ inputData: '',
+ numberData: ''
}
},
+ onLoad(option) {
+ let _this = this
+ const eventChannel = this.getOpenerEventChannel();
+ // 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
+ eventChannel.on('mat', function(data) {
+ _this.mat = data.mat
+ })
+ },
methods: {
-
+ blur() {
+ this.float = 'right'
+ },
+ focus() {
+ let newData = this.inputData
+ this.inputData = ''
+ this.float = 'left'
+ this.inputData = newData
+ },
+ changeValue() {
+ },
+ select(e){
+ console.log(e);
+ },
+ back() {
+ if (this.mat.anfme === 0) {
+ uni.showToast({title: '璇疯緭鍏ユ暟閲�', icon: "none", position: 'top'});
+ return;
+ }
+ this.getOpenerEventChannel().emit('matList', {data: this.mat});
+ uni.navigateBack({
+
+ })
+ }
}
}
</script>
<style scoped>
.box {
- min-height: 50rpx;
- background-color: antiquewhite;
+ min-height: 60rpx;
+ /* background-color: #202124; */
+ /* color: #FFF; */
+ background-color: #FFF;
margin: 16rpx;
+ padding: 64rpx 32rpx 1rpx 32rpx;
}
.item {
display: flex;
- align-items: center;
- margin: 8rpx;
+ min-height: 60rpx;
+ margin: 20rpx 0;
+ border-bottom: 1px solid #efeef2;
+ vertical-align: bottom;
+ padding: 0 10rpx;
+ line-height: 1.3;
+ }
+ .item:last-child {
+ border-bottom: none;
+ margin: 10rpx 0;
}
.item-key{
- background-color: #888;
min-width: 6em;
max-width: 6em;
align-self: center;
+ vertical-align: bottom;
+ font-weight: bold;
}
- .item-val {
+ .item-text {
flex: 1;
- border: 1px solid #999;
- border-radius: 16rpx;
- padding: 4rpx;
align-self: center;
-
-
+ text-align: right;
+ word-break: break-all
+ }
+ .item-input {
+ padding: 4rpx;
+ flex: 1;
+ align-self: center;
}
</style>
--
Gitblit v1.9.1