From d511ffc4d2b1e0fce010a204348a21cfae89747b Mon Sep 17 00:00:00 2001
From: whycq <whycq>
Date: 星期五, 17 六月 2022 11:12:17 +0800
Subject: [PATCH] #
---
uni_modules/uni-combox/package.json | 90 ++++++++++
pages/basics/matOut.vue | 106 +++++++++++
uni_modules/uni-combox/readme.md | 11 +
uni_modules/uni-combox/changelog.md | 15 +
pages.json | 8
uni_modules/uni-combox/components/uni-combox/uni-combox.vue | 275 ++++++++++++++++++++++++++++++
pages/index/index.vue | 6
7 files changed, 511 insertions(+), 0 deletions(-)
diff --git a/pages.json b/pages.json
index 1513bb1..a156445 100644
--- a/pages.json
+++ b/pages.json
@@ -47,7 +47,15 @@
"navigationBarTitleText": "閫�鍑虹櫥褰�",
"enablePullDownRefresh": false
}
+ },{
+ "path" : "pages/basics/matOut",
+ "style" :
+ {
+ "navigationBarTitleText": "鍑哄簱鍚姩",
+ "enablePullDownRefresh": false
+ }
}
+
],
"globalStyle": {
"navigationBarTextStyle": "white",
diff --git a/pages/basics/matOut.vue b/pages/basics/matOut.vue
new file mode 100644
index 0000000..9bb2168
--- /dev/null
+++ b/pages/basics/matOut.vue
@@ -0,0 +1,106 @@
+<template>
+ <view>
+ <form>
+ <view class="cu-form-group margin-top">
+ <view class="title">鍑哄簱鍗曞彿锛�</view>
+ <input v-model="billNo" placeholder="鎵爜 / 杈撳叆" name="input" @input="searchBillNo">
+ </view>
+ <view class="cu-form-group margin-top">
+
+ <view class="title" >鍑哄簱鍙o細</view>
+ <view class="combox" >
+ <uni-combox :candidates="candidates" placeholder="璇烽�夋嫨鍑哄簱绔欑偣" v-model="city"></uni-combox>
+ </view>
+ </view>
+ </form>
+
+ <view style="margin-top: 10px;">
+ <uni-table ref="table" border stripe emptyText="鏆傛棤鏇村鏁版嵁">
+ <uni-tr>
+ <uni-th align="center" width="50">鍑哄簱鏁伴噺</uni-th>
+ <uni-th align="center" width="70">浜у搧ID</uni-th>
+ <uni-th align="center" width="80">浜у搧浠e彿</uni-th>
+ <uni-th align="center" width="70">浜у搧鍚嶇О</uni-th>
+ </uni-tr>
+ <uni-tr v-for="(item, index) in matData" :key="index">
+ <uni-td align="center">{{item.qty}}</uni-td>
+ <uni-td align="center">{{item.matNo}}</uni-td>
+ <uni-td align="center">{{item.size}}</uni-td>
+ <uni-td align="center">{{item.matName}}</uni-td>
+ </uni-tr>
+ </uni-table>
+ </view>
+
+ <view class="cu-bar foot justify-center input" style="height: 130rpx;">
+ <view class="reset flex solid-bottom padding justify-center" >
+ <button class="cu-btn bg-yellow main-btn margin-xs" style="width: 400rpx;">鍚姩鍑哄簱</button>
+ </view>
+ </view>
+
+ </view>
+</template>
+
+<script>
+ export default {
+ data() {
+ return {
+ billNo: null,
+ matData:[],
+ candidates: ['鍖椾含', '鍗椾含', '涓滀含', '姝︽眽', '澶╂触', '涓婃捣', '娴峰彛'],
+ city: ''
+ }
+ },
+ mounted(){
+ const UIP = uni.getStorageSync('UIP');
+ this.baseIP = UIP;
+ const UPORT = uni.getStorageSync('UPORT');
+ this.basePORT = UPORT;
+ },
+ methods: {
+ searchBillNo() {
+ let that = this;
+ uni.request({
+ url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + "/waitMatout/list/auth",
+ header: {'token':uni.getStorageSync('token')},
+ data: {
+ curr:1,
+ limit:10,
+ typeCode:1,
+ bill_no:that.billNo
+ },
+ success(result) {
+
+ let res = result.data
+ if (res.code === 200 ) {
+ that.matData = res.data.records
+ console.log(that.matData)
+ } else if (res.code === 403) {
+ uni.navigateBack({
+ delta: 1
+ })
+ } else {
+
+ }
+
+ }
+ })
+ }
+ }
+ }
+</script>
+
+<style>
+ .pda-btn1 {
+ margin-left:260rpx;
+ margin-right: auto;
+ margin-top: 150rpx;
+ width: 200rpx;
+ height: 80rpx;
+ font-size: 30upx;
+ font-weight: bold;
+ }
+ .combox {
+ width: 200px;
+ padding: 12px;
+ }
+</style>
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 28bd97e..d03472e 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -28,6 +28,12 @@
cuIcon: 'goods'
},
{
+ title: '鍑哄簱鍚姩',
+ name: 'matOut',
+ color: 'green',
+ cuIcon: 'video'
+ },
+ {
title: '搴撳瓨鐩樼偣',
name: 'stockCheck',
color: 'cyan',
diff --git a/uni_modules/uni-combox/changelog.md b/uni_modules/uni-combox/changelog.md
new file mode 100644
index 0000000..23c2748
--- /dev/null
+++ b/uni_modules/uni-combox/changelog.md
@@ -0,0 +1,15 @@
+## 1.0.1锛�2021-11-23锛�
+- 浼樺寲 label銆乴abel-width 灞炴��
+## 1.0.0锛�2021-11-19锛�
+- 浼樺寲 缁勪欢UI锛屽苟鎻愪緵璁捐璧勬簮锛岃瑙�:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
+- 鏂囨。杩佺Щ锛岃瑙�:[https://uniapp.dcloud.io/component/uniui/uni-combox](https://uniapp.dcloud.io/component/uniui/uni-combox)
+## 0.1.0锛�2021-07-30锛�
+- 缁勪欢鍏煎 vue3锛屽浣曞垱寤簐ue3椤圭洰锛岃瑙� [uni-app 椤圭洰鏀寔 vue3 浠嬬粛](https://ask.dcloud.net.cn/article/37834)
+## 0.0.6锛�2021-05-12锛�
+- 鏂板 缁勪欢绀轰緥鍦板潃
+## 0.0.5锛�2021-04-21锛�
+- 浼樺寲 娣诲姞渚濊禆 uni-icons, 瀵煎叆鍚庤嚜鍔ㄤ笅杞戒緷璧�
+## 0.0.4锛�2021-02-05锛�
+- 浼樺寲 缁勪欢寮曠敤鍏崇郴锛岄�氳繃uni_modules寮曠敤缁勪欢
+## 0.0.3锛�2021-02-04锛�
+- 璋冩暣涓簎ni_modules鐩綍瑙勮寖
diff --git a/uni_modules/uni-combox/components/uni-combox/uni-combox.vue b/uni_modules/uni-combox/components/uni-combox/uni-combox.vue
new file mode 100644
index 0000000..d4cb79d
--- /dev/null
+++ b/uni_modules/uni-combox/components/uni-combox/uni-combox.vue
@@ -0,0 +1,275 @@
+<template>
+ <view class="uni-combox" :class="border ? '' : 'uni-combox__no-border'">
+ <view v-if="label" class="uni-combox__label" :style="labelStyle">
+ <text>{{label}}</text>
+ </view>
+ <view class="uni-combox__input-box">
+ <input class="uni-combox__input" type="text" :placeholder="placeholder"
+ placeholder-class="uni-combox__input-plac" v-model="inputVal" @input="onInput" @focus="onFocus"
+@blur="onBlur" />
+ <uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" @click="toggleSelector">
+ </uni-icons>
+ </view>
+ <view class="uni-combox__selector" v-if="showSelector">
+ <view class="uni-popper__arrow"></view>
+ <scroll-view scroll-y="true" class="uni-combox__selector-scroll">
+ <view class="uni-combox__selector-empty" v-if="filterCandidatesLength === 0">
+ <text>{{emptyTips}}</text>
+ </view>
+ <view class="uni-combox__selector-item" v-for="(item,index) in filterCandidates" :key="index"
+ @click="onSelectorClick(index)">
+ <text>{{item}}</text>
+ </view>
+ </scroll-view>
+ </view>
+ </view>
+</template>
+
+<script>
+ /**
+ * Combox 缁勫悎杈撳叆妗�
+ * @description 缁勫悎杈撳叆妗嗕竴鑸敤浜庢棦鍙互杈撳叆涔熷彲浠ラ�夋嫨鐨勫満鏅�
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=1261
+ * @property {String} label 宸︿晶鏂囧瓧
+ * @property {String} labelWidth 宸︿晶鍐呭瀹藉害
+ * @property {String} placeholder 杈撳叆妗嗗崰浣嶇
+ * @property {Array} candidates 鍊欓�夐」鍒楄〃
+ * @property {String} emptyTips 绛涢�夌粨鏋滀负绌烘椂鏄剧ず鐨勬枃瀛�
+ * @property {String} value 缁勫悎妗嗙殑鍊�
+ */
+ export default {
+ name: 'uniCombox',
+ emits: ['input', 'update:modelValue'],
+ props: {
+ border: {
+ type: Boolean,
+ default: true
+ },
+ label: {
+ type: String,
+ default: ''
+ },
+ labelWidth: {
+ type: String,
+ default: 'auto'
+ },
+ placeholder: {
+ type: String,
+ default: ''
+ },
+ candidates: {
+ type: Array,
+ default () {
+ return []
+ }
+ },
+ emptyTips: {
+ type: String,
+ default: '鏃犲尮閰嶉」'
+ },
+ // #ifndef VUE3
+ value: {
+ type: [String, Number],
+ default: ''
+ },
+ // #endif
+ // #ifdef VUE3
+ modelValue: {
+ type: [String, Number],
+ default: ''
+ },
+ // #endif
+ },
+ data() {
+ return {
+ showSelector: false,
+ inputVal: ''
+ }
+ },
+ computed: {
+ labelStyle() {
+ if (this.labelWidth === 'auto') {
+ return ""
+ }
+ return `width: ${this.labelWidth}`
+ },
+ filterCandidates() {
+ return this.candidates.filter((item) => {
+ return item.toString().indexOf(this.inputVal) > -1
+ })
+ },
+ filterCandidatesLength() {
+ return this.filterCandidates.length
+ }
+ },
+ watch: {
+ // #ifndef VUE3
+ value: {
+ handler(newVal) {
+ this.inputVal = newVal
+ },
+ immediate: true
+ },
+ // #endif
+ // #ifdef VUE3
+ modelValue: {
+ handler(newVal) {
+ this.inputVal = newVal
+ },
+ immediate: true
+ },
+ // #endif
+ },
+ methods: {
+ toggleSelector() {
+ this.showSelector = !this.showSelector
+ },
+ onFocus() {
+ this.showSelector = true
+ },
+ onBlur() {
+ setTimeout(() => {
+ this.showSelector = false
+ }, 153)
+ },
+ onSelectorClick(index) {
+ this.inputVal = this.filterCandidates[index]
+ this.showSelector = false
+ this.$emit('input', this.inputVal)
+ this.$emit('update:modelValue', this.inputVal)
+ },
+ onInput() {
+ setTimeout(() => {
+ this.$emit('input', this.inputVal)
+ this.$emit('update:modelValue', this.inputVal)
+ })
+ }
+ }
+ }
+</script>
+
+<style lang="scss" scoped>
+ .uni-combox {
+ font-size: 14px;
+ border: 1px solid #DCDFE6;
+ border-radius: 4px;
+ padding: 6px 10px;
+ position: relative;
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ // height: 40px;
+ flex-direction: row;
+ align-items: center;
+ // border-bottom: solid 1px #DDDDDD;
+ }
+
+ .uni-combox__label {
+ font-size: 16px;
+ line-height: 22px;
+ padding-right: 10px;
+ color: #999999;
+ }
+
+ .uni-combox__input-box {
+ position: relative;
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex: 1;
+ flex-direction: row;
+ align-items: center;
+ }
+
+ .uni-combox__input {
+ flex: 1;
+ font-size: 14px;
+ height: 22px;
+ line-height: 22px;
+ }
+
+ .uni-combox__input-plac {
+ font-size: 14px;
+ color: #999;
+ }
+
+ .uni-combox__selector {
+ /* #ifndef APP-NVUE */
+ box-sizing: border-box;
+ /* #endif */
+ position: absolute;
+ top: calc(100% + 12px);
+ left: 0;
+ width: 100%;
+ background-color: #FFFFFF;
+ border: 1px solid #EBEEF5;
+ border-radius: 6px;
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+ z-index: 2;
+ padding: 4px 0;
+ }
+
+ .uni-combox__selector-scroll {
+ /* #ifndef APP-NVUE */
+ max-height: 200px;
+ box-sizing: border-box;
+ /* #endif */
+ }
+
+ .uni-combox__selector-empty,
+ .uni-combox__selector-item {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ cursor: pointer;
+ /* #endif */
+ line-height: 36px;
+ font-size: 14px;
+ text-align: center;
+ // border-bottom: solid 1px #DDDDDD;
+ padding: 0px 10px;
+ }
+
+ .uni-combox__selector-item:hover {
+ background-color: #f9f9f9;
+ }
+
+ .uni-combox__selector-empty:last-child,
+ .uni-combox__selector-item:last-child {
+ /* #ifndef APP-NVUE */
+ border-bottom: none;
+ /* #endif */
+ }
+
+ // picker 寮瑰嚭灞傞�氱敤鐨勬寚绀哄皬涓夎
+ .uni-popper__arrow,
+ .uni-popper__arrow::after {
+ position: absolute;
+ display: block;
+ width: 0;
+ height: 0;
+ border-color: transparent;
+ border-style: solid;
+ border-width: 6px;
+ }
+
+ .uni-popper__arrow {
+ filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
+ top: -6px;
+ left: 10%;
+ margin-right: 3px;
+ border-top-width: 0;
+ border-bottom-color: #EBEEF5;
+ }
+
+ .uni-popper__arrow::after {
+ content: " ";
+ top: 1px;
+ margin-left: -6px;
+ border-top-width: 0;
+ border-bottom-color: #fff;
+ }
+
+ .uni-combox__no-border {
+ border: none;
+ }
+</style>
diff --git a/uni_modules/uni-combox/package.json b/uni_modules/uni-combox/package.json
new file mode 100644
index 0000000..4a05c3f
--- /dev/null
+++ b/uni_modules/uni-combox/package.json
@@ -0,0 +1,90 @@
+{
+ "id": "uni-combox",
+ "displayName": "uni-combox 缁勫悎妗�",
+ "version": "1.0.1",
+ "description": "鍙互閫夋嫨涔熷彲浠ヨ緭鍏ョ殑琛ㄥ崟椤� ",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "combox",
+ "缁勫悎妗�",
+ "select"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+ "dcloudext": {
+ "category": [
+ "鍓嶇缁勪欢",
+ "閫氱敤缁勪欢"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "鏃�",
+ "data": "鏃�",
+ "permissions": "鏃�"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-scss",
+ "uni-icons"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "n"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "寰俊娴忚鍣�(Android)": "y",
+ "QQ娴忚鍣�(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "灏忕▼搴�": {
+ "寰俊": "y",
+ "闃块噷": "y",
+ "鐧惧害": "y",
+ "瀛楄妭璺冲姩": "y",
+ "QQ": "y"
+ },
+ "蹇簲鐢�": {
+ "鍗庝负": "u",
+ "鑱旂洘": "u"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "y"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/uni_modules/uni-combox/readme.md b/uni_modules/uni-combox/readme.md
new file mode 100644
index 0000000..ffa2cc8
--- /dev/null
+++ b/uni_modules/uni-combox/readme.md
@@ -0,0 +1,11 @@
+
+
+## Combox 缁勫悎妗�
+> **缁勪欢鍚嶏細uni-combox**
+> 浠g爜鍧楋細 `uCombox`
+
+
+缁勫悎妗嗙粍浠躲��
+
+### [鏌ョ湅鏂囨。](https://uniapp.dcloud.io/component/uniui/uni-combox)
+#### 濡備娇鐢ㄨ繃绋嬩腑鏈変换浣曢棶棰橈紝鎴栬�呮偍瀵箄ni-ui鏈変竴浜涘ソ鐨勫缓璁紝娆㈣繋鍔犲叆 uni-ui 浜ゆ祦缇わ細871950839
\ No newline at end of file
--
Gitblit v1.9.1