wangzhuo 1 year ago
parent
commit
cfaa15ed91

+ 17 - 0
api/device/index.js

@@ -40,6 +40,23 @@ export function goodsdescDescList(data) {
 		params:data
 	})
 }
+
+// 获取设备数据没有分页
+export function descListAll(data) {
+	return http.request({
+		url: '/blade-client/goodsDescParts/descListAll',
+		method: 'GET',
+		params:data
+	})
+}
+// 获取设备分类
+export function goodstypeTree(data) {
+	return http.request({
+		url: '/blade-client/goodstype/tree',
+		method: 'GET',
+		params:data
+	})
+}
 // 获取设备维修列表
 export function maintenanceList(data) {
 	return http.request({

File diff suppressed because it is too large
+ 410 - 248
pages/device/FileDetails/FileDetails.vue


+ 65 - 40
pages/device/FileDetails/selectMachine.vue

@@ -1,27 +1,22 @@
 <template>
 	<view>
-		<view style="padding: 20rpx;">
-			<u-search placeholder="请输入设备名称" v-model="name" @custom="custom"></u-search>
+		<view style="background-color: #fd4b09;">
+			<u-tabs :list="tabbar" @click="click" lineColor="#fff" :activeStyle="{ color: '#fff' }" keyName="title"
+				:inactiveStyle="{ color: '#ffffff80' }">></u-tabs>
+			<view style="padding: 20rpx;">
+				<u-search placeholder="请输入设备名称" v-model="name" @custom="custom"></u-search>
+			</view>
 		</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>
+
+		<view class="list" v-for="(item1, index1) in itemArrTwo" :key="index1">
+			<view>
+				<u--image :showLoading="true" :src="item1.url" width="80px" height="80px" @click="click"></u--image>
+			</view>
+			<view class="list__item" @click="choice(item1,index1)">
+				<view class="list__item__user-name">{{item1.cname}}</view>
+			</view>
+		</view>
+
 		<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>
@@ -30,9 +25,9 @@
 
 <script>
 	import {
-		queryAllCustomer,
-		queryInitialsCustomer
-	} from '@/api/views/sale/index.js'
+		goodsdescDescList,
+		goodstypeTree
+	} from '@/api/device/index.js'
 	const indexList = () => {
 		const indexList = []
 		const charCodeOfA = 'A'.charCodeAt(0)
@@ -45,13 +40,18 @@
 	export default {
 		data() {
 			return {
-				name:'',
+				name: '',
 				indexList: indexList(),
 				itemArrTwo: [],
 				loading: true,
 				show: false,
 				form: {},
-				params:{}
+				params: {},
+				re: {
+					current: 1,
+					size: 20
+				},
+				tabbar: []
 			}
 		},
 		onLoad(params) {
@@ -59,15 +59,26 @@
 				...params,
 				adminProfiles: uni.getStorageSync('userInfo').user_id
 			}
-			queryAllCustomer(this.params).then(res=>{
-				console.log(res)
-				this.itemArrTwo = res.data
+			goodstypeTree().then(res => {
+				var data = res.data
+				var datas = {title: '全部', id: null}
+				data.unshift(datas)
+				this.tabbar = data
+			})
+			goodsdescDescList(this.re).then(res => {
+				this.itemArrTwo = res.data.records
 				this.loading = false
 			})
 		},
+		onReachBottom() {
+			this.re.current++;
+			goodsdescDescList(this.re).then(res => {
+				this.itemArrTwo = this.itemArrTwo.concat(res.data.records);
+			})
+		},
 		computed: {
 			itemArr() {
-				return this.indexList.map((item,index) => {
+				return this.indexList.map((item, index) => {
 					return this.itemArrTwo[index]
 				})
 			}
@@ -76,26 +87,32 @@
 			uni.$u.route('/pages/views/customer/customerDetails');
 		},
 		methods: {
-			custom(){
+			click(tab) {
+				this.re.goodsTypeId = tab.id
+				this.name = ''
+				goodsdescDescList(this.re).then(res => {
+					this.itemArrTwo = res.data.records
+					this.loading = false
+				})
+			},
+			custom() {
 				this.loading = true
-				queryAllCustomer({
-					...this.params,
-					cname:this.name
-					}).then(res=>{
-					this.itemArrTwo = res.data
+				goodsdescDescList({
+					...this.re,
+					cname: this.name
+				}).then(res => {
+					this.itemArrTwo = res.data.records
 					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)
+				prevPage.$vm.machineOtherFun(this.form)
 				uni.navigateBack()
 			}
 		}
@@ -104,6 +121,14 @@
 
 <style lang="scss">
 	.list {
+		
+		background-color: #fff;
+		
+		display: flex;
+		padding: 20rpx;
+		
+		border-top: 1px solid #f0f0f0;
+		// border-bottom: 1px solid red;
 
 		&__item {
 			@include flex;
@@ -130,4 +155,4 @@
 			margin: 15px 0;
 		}
 	}
-</style>
+</style>

+ 48 - 8
pages/device/RepairDetails/RepairDetails.vue

@@ -99,8 +99,8 @@
 				<!-- <view style="font-size: 30rpx;color: #999;margin-left: 10rpx;">添加图片</view> -->
 				<view style="margin-top: 20rpx;">
 					<u-upload
-						:fileList="form.maintenanceFiles"
-						 :disabled="form.status != 3"
+						:fileList="userImgList"
+						 disabled
 						@afterRead="afterRead"
 						@delete="deletePic"
 						name="1"
@@ -181,13 +181,13 @@
 			<view class="bottombox_name" v-if="form.dispatchingWorkers == 2 && form.status != 1">
 				<text>{{form.maintenanceWorkerName}}</text>
 			</view>
-			<view class="bottombox_name" @click="pickerShowfun" v-if="form.status == 1 && userInfoRoleName.indexOf('admin') != -1">
+			<view class="bottombox_name" @click="pickerShowfun" v-if="form.dispatchingWorkers == 1 && userInfoRoleName.indexOf('admin') != -1">
 				<text>{{form.maintenanceWorkerName == null || form.maintenanceWorkerName == '' ? '请选择维修工' : form.maintenanceWorkerName}}</text>
 			</view>
 			<view v-if="(form.status == 3 || form.status == 4) && form.dispatchingWorkers == 3" style="color: #FD4B09;">维修费:{{form.maintenanceAmount?form.maintenanceAmount:0}}元</view>
 			<view class="bottombox_right">
 				<view class="buttonClass"
-				 v-if="form.status == 1 && userInfoRoleName.indexOf('admin') != -1" 
+				 v-if="form.dispatchingWorkers == 1 && userInfoRoleName.indexOf('admin') != -1" 
 				 @click="maintenanceDispatchingWorkersfun">确认派工</view>
 				<view class="buttonClass" 
 					v-if="form.dispatchingWorkers == 2 && userInfoRoleName.indexOf('admin') != -1"
@@ -212,13 +212,13 @@
 		        </view>
 		</u-popup> -->
 		
-		<u-modal :show="kapianShow" title="项目" :showCancelButton="true" @cancel="kapianCancel" @confirm="kapianConfirm" confirmColor="#FD4B09">
+		<u-modal :show="kapianShow" title="收费项目" :showCancelButton="true" @cancel="kapianCancel" @confirm="kapianConfirm" confirmColor="#FD4B09">
 			<view style="position: relative;">
 				<view class="positionSC" @click="maintenanceDe(kapianindex)">删除</view>
 				<view class="kapianModel">
 					<text style="color: #FD4B09;font-size: 28rpx;">项目:</text>
 					<u-input v-model="kapian.costName" disabledColor="#fff" :disabled="form.status != 3"
-					border="bottom" confirm-type="next" placeholder="添加项目" ></u-input>
+					border="bottom" confirm-type="next" placeholder="收费项目" ></u-input>
 				</view>
 				<view class="kapianModel">
 					<text style="color: #FD4B09;font-size: 28rpx;">金额:</text>
@@ -227,6 +227,13 @@
 				</view>
 			</view>
 		</u-modal>
+		<!-- <u-overlay :show="overlayShow">
+				<view class="warp">
+					<view class="rect" @tap.stop></view>
+				</view>
+			</u-overlay> -->
+			
+			<u-loading-page bg-color="#e8e8e8" :loading="overlayShow" loading-text="加载中..." style="z-index: 999;" bgColor="rgba(0,0,0,0.5)"></u-loading-page>
 	</view>
 </template>
 
@@ -251,6 +258,7 @@
 				id:null,
 				wxStyle: '',
 				gzStyle: '',
+				overlayShow: false,
 				form:{
 					maintenanceFees:[
 						{
@@ -276,6 +284,8 @@
 				userInfoRoleName:[],
 				// 当前点击费用的下标
 				kapianindex:null,
+				// 用户图片
+				userImgList: []
 			}
 		},
 		onLoad(e) {
@@ -310,6 +320,9 @@
 				}
 				this.kapianindex = null
 				this.kapianShow = false;
+				
+				this.kapian = {}
+				
 			},
 			moneyInput() {
 				var money = 0
@@ -340,6 +353,7 @@
 			},
 			// 撤销派工
 			maintenanceRevokeDispatchingWorkersfun(){
+				this.overlayShow = true;
 				maintenanceRevokeDispatchingWorkers(this.form).then(res=>{
 					if (res.code == 200) {
 						this.$refs.uToast.show({
@@ -353,10 +367,13 @@
 							message: res.msg,
 						})
 					}
+					
+					this.overlayShow = false;
 				})
 			},
 			// 派工
 			maintenanceDispatchingWorkersfun(){
+				this.overlayShow = true;
 				if (!this.form.maintenanceWorkerId) {
 					return this.$refs.uToast.show({type: 'warning',message: '请选择维修工'})
 				}
@@ -378,6 +395,7 @@
 						})
 					}
 					
+					this.overlayShow = false;
 				})
 			},
 			// 维修工弹窗开启
@@ -420,6 +438,7 @@
 			},
 			// 确认费用
 			Confirmexpenses(){
+				this.overlayShow = true
 				let a = true
 				if (this.form.maintenanceFees.length <= 0) {
 					return this.$refs.uToast.show({type: 'warning',message: '请添加维修费用'})
@@ -438,6 +457,11 @@
 					})
 					if (a == false) return 
 					
+					var imgList = this.form.maintenanceFiles
+					for (let key in imgList) {
+						this.form.maintenanceFiles[key].sort = key + 1
+					}
+					
 					maintenanceConfirm(this.form).then(res=>{
 						if (res.code == 200) {
 							this.$refs.uToast.show({
@@ -454,6 +478,7 @@
 								message: res.msg,
 							})
 						}
+						this.overlayShow = false;
 					})
 					
 				}
@@ -461,6 +486,7 @@
 			},
 			// 撤销费用
 			Revocationfeesfun(){
+				this.overlayShow = true;
 				maintenancerRvokeConfirmFees(this.form).then(res=>{
 					if (res.code == 200) {
 						this.$refs.uToast.show({
@@ -474,14 +500,18 @@
 							message: res.msg,
 						})
 					}
+					this.overlayShow = false;
 				})
 			},
 			// 确认结算
 			ConfirmSettlement(){
+				this.overlayShow = true;
+				this.overlayShow = false;
 				
 			},
 			// 确认接单接口
 			receivingOrdersfun(){
+				this.overlayShow = true
 				maintenanceReceivingOrders(this.form).then(res=>{
 					console.log(res,180);
 					if (res.code == 200) {
@@ -497,6 +527,7 @@
 							message: res.msg,
 						})
 					}
+					this.overlayShow = false
 				})
 			},
 			// 维修设备详情
@@ -505,13 +536,21 @@
 					this.form = res.data
 					
 					
-					
+					for (let index in this.form.maintenanceFiles) {
+						if(this.form.maintenanceFiles[index].uploadType == 0) {
+							this.userImgList.push(img)
+							this.form.maintenanceFiles.splice(index, 1)
+						}
+					}
 					if (this.form.status == 4) {
 						this.gzStyle = "#fd4b09"
 						this.wxStyle = ""
 					} else if (this.form.status == 3 && this.form.dispatchingWorkers == 3) {
 						this.gzStyle = "#fd4b09"
 						this.wxStyle = ""
+					} else if (this.form.status == 3 && this.form.dispatchingWorkers == 1) {
+						this.wxStyle = "#fd4b09"
+						this.gzStyle = ""
 					} else if (this.form.dispatchingWorkers == 2) {
 						console.log(this.form.status);
 						this.wxStyle = "#fd4b09"
@@ -540,6 +579,7 @@
 			// 图片删除
 			deletePic(e){
 				if(e.file.uploadType == 0) return this.$refs.uToast.show({ type: 'warning', message: '请勿删除客户添加的图片',})
+				if(this.form.status != 3) return this.$refs.uToast.show({ type: 'warning', message: '修改数据请撤销费用',})
 				this.form.maintenanceFiles.splice(e.index,1)
 			},
 			// 上传图片
@@ -611,7 +651,7 @@
 		padding: 10rpx 15rpx;
 		border-radius: 12rpx;
 	}
-	
+
 	.label {
 		left: 0rpx;
 		top: 190rpx;

Some files were not shown because too many files changed in this diff