wangzhuo 1 年之前
父节点
当前提交
e05146a496
共有 3 个文件被更改,包括 234 次插入65 次删除
  1. 41 38
      pages.json
  2. 133 0
      pages/device/FileDetails/selectMachine.vue
  3. 60 27
      pages/device/RepairDetails/RepairDetails.vue

+ 41 - 38
pages.json

@@ -86,43 +86,46 @@
 					"titleNView": false
 				}
 			}
-		}    ,{
-                    "path" : "device/EquipmentArchives/EquipmentArchives",
-                    "style" :                                                                                    
-                {
-                    "navigationBarTitleText": "设备档案",
-                    "enablePullDownRefresh": false
-                }
-                
-                }
-                ,{
-                    "path" : "device/FileDetails/FileDetails",
-                    "style" :                                                                                    
-                {
-                    "navigationBarTitleText": "设备档案",
-                    "enablePullDownRefresh": false
-                }
-                
-                }
-                ,{
-                    "path" : "device/RepairReportList/RepairReportList",
-                    "style" :                                                                                    
-                {
-                    "navigationBarTitleText": "报修列表",
-                    "enablePullDownRefresh": false
-                }
-                
-                }
-                ,{
-                    "path" : "device/RepairDetails/RepairDetails",
-                    "style" :                                                                                    
-                {
-                    "navigationBarTitleText": "设备报修",
-                    "enablePullDownRefresh": false
-                }
-                
-                }
-            ]
+		}, {
+			"path": "device/EquipmentArchives/EquipmentArchives",
+			"style": {
+				"navigationBarTitleText": "设备档案",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "device/FileDetails/FileDetails",
+			"style": {
+				"navigationBarTitleText": "设备档案",
+				"enablePullDownRefresh": false
+			}
+		}, 
+		
+		{
+			"path": "device/FileDetails/selectMachine",
+			"style": {
+				"navigationBarTitleText": "选择设备",
+				"enablePullDownRefresh": false
+			}
+		},
+		
+		
+		
+		{
+			"path": "device/RepairReportList/RepairReportList",
+			"style": {
+				"navigationBarTitleText": "报修列表",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "device/RepairDetails/RepairDetails",
+			"style": {
+				"navigationBarTitleText": "设备报修",
+				"enablePullDownRefresh": false
+			}
+
+		}]
 	}, {
 		"root": "pages/views",
 		"pages": [{
@@ -469,4 +472,4 @@
 			}
 		]
 	}
-}
+}

+ 133 - 0
pages/device/FileDetails/selectMachine.vue

@@ -0,0 +1,133 @@
+<template>
+	<view>
+		<view style="padding: 20rpx;">
+			<u-search placeholder="请输入设备名称" v-model="name" @custom="custom"></u-search>
+		</view>
+		<u-index-list :indexList="indexList" v-if="!loading">
+			<template v-for="(item, index) in itemArr">
+				<!-- #ifdef APP-NVUE -->
+				<u-index-anchor :text="indexList[index]" :key="index" v-if="item.length>0"></u-index-anchor>
+				<!-- #endif -->
+				<u-index-item :key="index">
+					<!-- #ifndef APP-NVUE -->
+					<u-index-anchor :text="indexList[index]" v-if="item.length>0"></u-index-anchor>
+					<!-- #endif -->
+					<view class="list" v-for="(item1, index1) in item" :key="index1">
+						<view class="list__item" @click="choice(item1,index1)">
+							<text class="list__item__user-name">{{item1.cname}}</text>
+							<text class="list__item__user-tel">{{item1.tel}}</text>
+						</view>
+						<u-line></u-line>
+					</view>
+				</u-index-item>
+			</template>
+		</u-index-list>
+		<u-loading-page loading-mode="spinner" :loading="loading"></u-loading-page>
+		<u-modal :show="show" :content="'是否确认选择:'+this.form.cname" @confirm="confirm" @cancel="show = false"
+			:showCancelButton="true" style="text-align: center;"></u-modal>
+	</view>
+</template>
+
+<script>
+	import {
+		queryAllCustomer,
+		queryInitialsCustomer
+	} from '@/api/views/sale/index.js'
+	const indexList = () => {
+		const indexList = []
+		const charCodeOfA = 'A'.charCodeAt(0)
+		for (let i = 0; i < 26; i++) {
+			indexList.push(String.fromCharCode(charCodeOfA + i))
+		}
+		indexList.push('#')
+		return indexList
+	}
+	export default {
+		data() {
+			return {
+				name:'',
+				indexList: indexList(),
+				itemArrTwo: [],
+				loading: true,
+				show: false,
+				form: {},
+				params:{}
+			}
+		},
+		onLoad(params) {
+			this.params = {
+				...params,
+				adminProfiles: uni.getStorageSync('userInfo').user_id
+			}
+			queryAllCustomer(this.params).then(res=>{
+				console.log(res)
+				this.itemArrTwo = res.data
+				this.loading = false
+			})
+		},
+		computed: {
+			itemArr() {
+				return this.indexList.map((item,index) => {
+					return this.itemArrTwo[index]
+				})
+			}
+		},
+		onNavigationBarButtonTap(e) {
+			uni.$u.route('/pages/views/customer/customerDetails');
+		},
+		methods: {
+			custom(){
+				this.loading = true
+				queryAllCustomer({
+					...this.params,
+					cname:this.name
+					}).then(res=>{
+					this.itemArrTwo = res.data
+					this.loading = false
+				})
+			},
+			choice(item1, index1) {
+				console.log("item1");
+				console.log(item1);
+				this.form = item1
+				this.show = true
+			},
+			confirm() {
+				let pages = getCurrentPages() // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
+				let prevPage = pages[pages.length - 2] //上一页页面实例
+				prevPage.$vm.otherFun(this.form)
+				uni.navigateBack()
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.list {
+
+		&__item {
+			@include flex;
+			padding: 6px 12px;
+			align-items: center;
+			justify-content: space-between;
+
+			&__user-name {
+				font-size: 32rpx;
+				color: $u-main-color;
+			}
+
+			&__user-tel {
+				font-size: 32rpx;
+				margin-right: 20rpx;
+				color: $u-main-color;
+			}
+		}
+
+		&__footer {
+			color: $u-tips-color;
+			font-size: 14px;
+			text-align: center;
+			margin: 15px 0;
+		}
+	}
+</style>

+ 60 - 27
pages/device/RepairDetails/RepairDetails.vue

@@ -61,7 +61,7 @@
 		</view>
 		
 		
-		
+		<!-- 维修单 -->
 		<view class="repairdetails" v-if="wxStyle != ''">
 			
 			<view class="cardBox">
@@ -111,7 +111,7 @@
 			
 		</view>
 		
-		
+		<!-- 工作单 -->
 		<view class="repairdetails" v-if="gzStyle != ''">
 			
 			<view class="cardBox">
@@ -144,27 +144,18 @@
 				</view>
 			</view>
 			
-			<view >
+			<view>
 				<view class="kapian" v-for="(item,index) in form.maintenanceFees" :key="item.id">
 					<view class="WXflex">
-						<view class="wxscfun" v-if="form.status == 3" @click="maintenanceDe(item,index)">删除</view>
+						<view class="wxscfun" style="color: #fff; background-color: #FD4B09;" v-if="form.status == 3" @click="maintenanceDe(item,index)">删除</view>
 					</view>
-					<view class="repairProject">
+					<view class="repairProject" @click="kapianClick(item)">
 						<view class="wxbox">
-							<u-input v-model="item.costName" disabledColor="#fff" :disabled="form.status != 3"
-							border="none" placeholder="添加项目" ></u-input>
+							{{item.costName}}
 						</view>
 						
-						<view class="wxbox">
-							<u-input v-model="item.amount" disabledColor="#fff" :disabled="form.status != 3"
-							border="none" inputAlign="right" @input="moneyInput" placeholder="金额" >
-							<u--text
-								text="元"
-								slot="suffix"
-								margin="0 3px 0 0"
-								type="tips"
-								></u--text>
-							</u-input>
+						<view class="wxbox" style="color: #FD4B09;">
+							{{item.amount}}元
 						</view>
 					</view>
 				</view>
@@ -174,13 +165,11 @@
 			<view class="kapian" >
 				<view class="wxtitleflex">
 					<view class="wxtitle">添加费用</view>
-					<view v-if="form.status == 3 && type != 'XQ'" class="addwx" @click="wxaddfun">添加</view>
+					<view v-if="form.status == 3 && type != 'XQ'" style="color: #fff; background-color: #FD4B09;" class="addwx" @click="kapianShow = true">添加</view>
 				</view>
 			</view>
 		</view>
-		
-		
-
+		<!-- wxaddfun -->
 			  
 			
 			
@@ -194,7 +183,7 @@
 			<view class="bottombox_name" @click="pickerShowfun" v-if="form.status == 1 && userInfoRoleName.indexOf('admin') != -1">
 				<text>{{form.maintenanceWorkerName == null || form.maintenanceWorkerName == '' ? '请选择维修工' : form.maintenanceWorkerName}}</text>
 			</view>
-			<view v-if="form.status == 3" style="color: #FD4B09;">维修费:{{form.maintenanceAmount}}元</view>
+			<view v-if="form.status == 3 && wxStyle == ''" style="color: #FD4B09;">维修费:{{form.maintenanceAmount}}元</view>
 			<view class="bottombox_right">
 				<view class="buttonClass"
 				 v-if="form.status == 1 && userInfoRoleName.indexOf('admin') != -1" 
@@ -212,6 +201,29 @@
 		 @confirm="pickerShowConfirm" @cancel="pickerShowCancel"></u-picker>
 		
 		<u-toast ref="uToast"></u-toast>
+		<!-- 添加费用弹窗 -->
+		
+		
+		<!-- <u-popup :show="show" mode="top"  @close="close" @open="open">
+		        <view>
+		            <text>人生若只如初见,何事秋风悲画扇</text>
+		        </view>
+		</u-popup> -->
+		
+		<u-modal :show="kapianShow" title="项目" :showCancelButton="true" @cancel="kapianCancel" @confirm="kapianConfirm" confirmColor="#FD4B09">
+			<view class="kapianModel">
+				<view>
+					<text style="color: #FD4B09;">项目:</text>
+					<u-input v-model="kapian.costName" disabledColor="#fff" :disabled="form.status != 3"
+					border="none" confirm-type="next" placeholder="添加项目" ></u-input>
+				</view>
+				<view>
+					<text style="color: #FD4B09;">金额:</text>
+					<u-input v-model="kapian.amount" disabledColor="#fff" :disabled="form.status != 3"
+					border="none" type="digit" confirm-type="done" @input="moneyInput" placeholder="金额" ></u-input>
+				</view>
+			</view>
+		</u-modal>
 	</view>
 </template>
 
@@ -235,11 +247,6 @@
 				id:null,
 				wxStyle: '',
 				gzStyle: '',
-				range: [
-				          { value: 0, text: "篮球" },
-				          { value: 1, text: "足球" },
-				          { value: 2, text: "游泳" },
-				        ],
 				form:{
 					maintenanceFees:[
 						{
@@ -255,8 +262,12 @@
 						}
 					]
 				},
+				// 项目
+				kapian: {},
 				// 弹窗的开启
 				pickerShow:false,
+				// 添加费用弹窗
+				kapianShow: false,
 				pickerList:[],
 				userInfoRoleName:[]
 			}
@@ -271,6 +282,20 @@
 			
 		},
 		methods: {
+			kapianClick(item) {
+				this.kapian = item
+				this.kapianShow = true;
+			},
+			// 添加项目取消
+			kapianCancel() {
+				this.kapian = {};
+				this.kapianShow = false;
+			},
+			// 添加项目确认
+			kapianConfirm() {
+				this.form.maintenanceFees.push(this.kapian)
+				this.kapianShow = false;
+			},
 			moneyInput() {
 				var money = 0
 				
@@ -532,6 +557,11 @@
 
 <style lang="scss" scoped>
 	
+	.kapianModel {
+		display: flex;
+		// justify-content: flex-start;
+	}
+	
 	.label {
 		left: 0rpx;
 		top: 190rpx;
@@ -590,6 +620,9 @@
 		
 		.repairProject {
 			display: flex;
+			justify-content: space-between;
+			
+			padding: 0 20rpx;
 		}
 		
 		.wxtitleflex {