From 8e249dedbd22b0e777057a32f2f944f7a1d4c7ef Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期四, 04 十二月 2025 14:14:11 +0800
Subject: [PATCH] #
---
pages/check/check.vue | 89 ++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 85 insertions(+), 4 deletions(-)
diff --git a/pages/check/check.vue b/pages/check/check.vue
index 2cd67a2..4b4f95f 100644
--- a/pages/check/check.vue
+++ b/pages/check/check.vue
@@ -8,7 +8,9 @@
</view>
</view>
<view class="mat-list-title">
- 鍟嗗搧鍒楄〃
+ <view style="width: 200rpx;"></view>
+ <view style="-webkit-flex: 1;flex: 1;">鍟嗗搧鍒楄〃</view>
+ <view style="width: 200rpx; display: flex; justify-content: center; align-items: center;"><button size="mini" type="primary" @click="openAddDialog">娣诲姞</button></view>
</view>
<scroll-view>
<view class="list" v-for="(item,i) in dataList" :key="i">
@@ -31,8 +33,8 @@
</view>
<view class="list-left-item">
- <view class="desc">瑙勬牸锛�</view>
- <view class="left-item">{{item.specs}}</view>
+ <view class="desc">渚涘簲鍟嗭細</view>
+ <view class="left-item">{{item.suppCode}}</view>
</view>
<view class="list-left-item">
<view class="desc">鎵瑰彿锛�</view>
@@ -121,6 +123,24 @@
@confirm="resetConfirm" @close="resetClose"></uni-popup-dialog>
</uni-popup>
</view>
+ <!-- 娣诲姞鍟嗗搧寮圭獥 -->
+ <view>
+ <uni-popup ref="addDialog" type="dialog">
+ <view class="popup">
+ <view class="title">娣诲姞鍟嗗搧</view>
+ <view class="popup-item">
+ <view class="popup-item-left">缂栫爜:</view>
+ <view class="popup-item-right">
+ <input type="text" v-model="addMatnr" placeholder="璇疯緭鍏ョ紪鐮�">
+ </view>
+ </view>
+ <view class="btn">
+ <view class="btn-left" @click="addClose">鍙栨秷</view>
+ <view class="btn-right" @click="addConfirm">鎻愪氦</view>
+ </view>
+ </view>
+ </uni-popup>
+ </view>
</view>
</template>
@@ -144,7 +164,8 @@
barcodeFocus: true,
matFocus: false,
matData: '',
- pushDisabled:false
+ pushDisabled:false,
+ addMatnr: ''
}
},
@@ -326,6 +347,64 @@
})
},
+ // 鎵撳紑娣诲姞寮圭獥
+ openAddDialog() {
+ this.addMatnr = ''
+ this.$refs.addDialog.open()
+ },
+ // 鍙栨秷娣诲姞
+ addClose() {
+ this.$refs.addDialog.close()
+ },
+ // 纭娣诲姞
+ addConfirm() {
+ if (!this.addMatnr) {
+ this.messageText = "璇疯緭鍏ョ紪鐮�"
+ this.messageToggle('error')
+ return
+ }
+ let that = this
+ uni.request({
+ url: that.baseUrl + '/mat/auth?matnr=' + encodeURIComponent(that.addMatnr),
+ header: {
+ 'token': uni.getStorageSync('token')
+ },
+ method: 'GET',
+ success(res) {
+ res = res.data
+ if (res.code === 200) {
+ if (!res.data) {
+ that.messageText = "鏈壘鍒拌鍟嗗搧"
+ that.messageToggle('error')
+ return
+ }
+ that.$refs.addDialog.close()
+ uni.navigateTo({
+ url: './checkMatSelected',
+ success: function(result) {
+ result.eventChannel.emit('mat', {data: res.data})
+ },
+ events: {
+ checkMatList: function(data) {
+ that.dataList.push(data.data)
+ }
+ }
+ })
+ } else if (res.code == 403) {
+ that.messageText = res.msg
+ that.messageToggle('error')
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../login/login'
+ });
+ }, 1000);
+ } else {
+ that.messageText = res.msg
+ that.messageToggle('error')
+ }
+ }
+ })
+ }
}
}
</script>
@@ -374,6 +453,8 @@
}
.mat-list-title {
+ display: flex;
+ align-items: center;
height: 80rpx;
line-height: 80rpx;
width: 100%;
--
Gitblit v1.9.1