shish 2 лет назад
Родитель
Сommit
e22e7a1cd9
2 измененных файлов с 35 добавлено и 11 удалено
  1. 30 9
      ghsApp/src/admin/expend/addExpend.vue
  2. 5 2
      ghsApp/src/admin/expend/list.vue

+ 30 - 9
ghsApp/src/admin/expend/addExpend.vue

@@ -4,15 +4,12 @@
       <form @submit="formSubmit">
       <form @submit="formSubmit">
         <view class="module-com input-line-wrap">
         <view class="module-com input-line-wrap">
 
 
-          <tui-list-cell class="line-cell" :hover="false" :arrow="false">
+          <tui-list-cell class="line-cell" :hover="false" :arrow="true">
             <view class="tui-title">类型</view>
             <view class="tui-title">类型</view>
-            <button class="admin-button-com middle" @tap="form.type = 6" :class="form.type == 6? 'blue' : 'default'">物品</button>
-            <button class="admin-button-com middle" @tap="form.type = 3" :class="form.type == 3? 'blue' : 'default'">伙食</button>
-            <button class="admin-button-com middle" @tap="form.type = 0" :class="form.type == 0 ? 'blue' : 'default'">店租</button>
-            <button class="admin-button-com middle" @tap="form.type = 1" :class="form.type == 1? 'blue' : 'default'">水电</button>
-            <button class="admin-button-com middle" @tap="form.type = 2" :class="form.type == 2? 'blue' : 'default'">物业</button>
-            <button class="admin-button-com middle" @tap="form.type = 4" :class="form.type == 4? 'blue' : 'default'">房租</button>
-            <button class="admin-button-com middle" @tap="form.type = 5" :class="form.type == 5? 'blue' : 'default'">其它</button>
+            <view class="tui-input" @click="changeType">
+              <text v-if="form.type == -1" style="color:#CCCCCC;">请选择</text>
+              <text v-else>{{ form.typeName }}</text>
+            </view>
           </tui-list-cell>
           </tui-list-cell>
 
 
           <tui-list-cell class="line-cell" :hover="false">
           <tui-list-cell class="line-cell" :hover="false">
@@ -64,6 +61,17 @@
         </view>
         </view>
       </form>
       </form>
     </view>
     </view>
+
+    <uni-popup ref="typeShowMore" background-color="#fff" type="center" :animation="true" class="class-popup-style">
+		<view style="display:flex;width:100vw;padding:20upx 20upx 40upx 20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
+			<view v-for="(item, index) in typeList" :key="index" style="width:100vw;margin-top:8upx;">
+				<button @click="getType(item)">{{ item.name }}</button>
+			</view>
+			<view style="width:100vw;margin-top:30upx;margin-bottom:70upx;"><button @click="closeTypeShow()">取消</button></view>
+		</view>
+	</uni-popup>
+
+
   </view>
   </view>
 </template>
 </template>
 <script>
 <script>
@@ -79,7 +87,8 @@ export default {
   data() {
   data() {
     return {
     return {
       form:{
       form:{
-        type:6,
+        type:-1,
+        typeName:'',
         amount:'',
         amount:'',
         remark:'',
         remark:'',
         payWay:0,
         payWay:0,
@@ -99,6 +108,18 @@ export default {
 			})
 			})
   },
   },
   methods: {
   methods: {
+    getType(info){
+      this.form.type = info.id
+      this.form.typeName = info.name
+      this.$forceUpdate()
+      this.closeTypeShow()
+    },
+		closeTypeShow(){
+			this.$refs.typeShowMore.close()
+		},
+		changeType(){
+			this.$refs.typeShowMore.open('top')
+		},
     bxChange(e) {
     bxChange(e) {
       this.form.bx = e.detail.value;
       this.form.bx = e.detail.value;
     },
     },

+ 5 - 2
ghsApp/src/admin/expend/list.vue

@@ -13,7 +13,7 @@
 	<block v-if="!$util.isEmpty(list.data)">
 	<block v-if="!$util.isEmpty(list.data)">
 		<view v-for="(item, index) in list.data" :key="index">
 		<view v-for="(item, index) in list.data" :key="index">
 			<view style="background-color: white;margin-bottom:15upx;padding:10upx 0 10upx 20upx;">
 			<view style="background-color: white;margin-bottom:15upx;padding:10upx 0 10upx 20upx;">
-				<view style="color:red;font-weight:bold;font-size:30upx;">
+				<view style="font-weight:bold;font-size:30upx;">
 					<text>{{item.type == 0 ? '店租':item.type==1?'水电':item.type==2?'物业':item.type==3?'伙食':item.type==4?'房租':item.type==6?'物品':'其它'}}</text>
 					<text>{{item.type == 0 ? '店租':item.type==1?'水电':item.type==2?'物业':item.type==3?'伙食':item.type==4?'房租':item.type==6?'物品':'其它'}}</text>
 					<text style="margin-left:20upx;">¥{{item.amount?parseFloat(item.amount):0}}</text>
 					<text style="margin-left:20upx;">¥{{item.amount?parseFloat(item.amount):0}}</text>
 				</view>
 				</view>
@@ -38,7 +38,7 @@
 	<uni-popup ref="typeShowMore" background-color="#fff" type="center" :animation="true" class="class-popup-style">
 	<uni-popup ref="typeShowMore" background-color="#fff" type="center" :animation="true" class="class-popup-style">
 		<view style="display:flex;width:100vw;padding:20upx 20upx 40upx 20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
 		<view style="display:flex;width:100vw;padding:20upx 20upx 40upx 20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
 			<view v-for="(item, index) in typeList" :key="index" style="width:100vw;margin-top:8upx;">
 			<view v-for="(item, index) in typeList" :key="index" style="width:100vw;margin-top:8upx;">
-				<button @click="">{{ item }}</button>
+				<button @click="getCurrentType(item)">{{ item.name }}</button>
 			</view>
 			</view>
 			<view style="width:100vw;margin-top:30upx;margin-bottom:70upx;"><button @click="closeTypeShow()">取消</button></view>
 			<view style="width:100vw;margin-top:30upx;margin-bottom:70upx;"><button @click="closeTypeShow()">取消</button></view>
 		</view>
 		</view>
@@ -87,6 +87,9 @@ export default {
 		},
 		},
 		closePayShow(){
 		closePayShow(){
 			this.$refs.payShowMore.close()
 			this.$refs.payShowMore.close()
+		},
+		getCurrentType(info){
+
 		},
 		},
 		closeTypeShow(){
 		closeTypeShow(){
 			this.$refs.typeShowMore.close()
 			this.$refs.typeShowMore.close()