Browse Source

奉建路的

ZaiZai 2 years ago
parent
commit
4f02934f0f

+ 66 - 190
pages/qualityInspection_fj/addInspection.vue

@@ -24,76 +24,76 @@
                 <uni-forms-item label="检查日期" required name="startDate">
                     <uni-datetime-picker type="date" return-type="string" v-model="addform.startDate"/>
                 </uni-forms-item>
-                <uni-forms-item label="工程名称" required name="unitName">
+                <uni-forms-item label="工程名称" name="unitName">
                     <uni-easyinput v-model="addform.unitName" placeholder="请输入工程名称"/>
                 </uni-forms-item>
-                <uni-forms-item label="关联部位" required name="relationString">
+                <uni-forms-item label="关联部位" name="relation">
                     <view class="hc-fj-form-item-s">
                         <view class="title text-cut">请点击右边按钮选择</view>
                         <button class="cu-btn bg-blue" @click="relationStringClick">+选择关联</button>
                     </view>
                 </uni-forms-item>
-                <uni-forms-item label="左/右幅" required name="aroundPicture">
+                <uni-forms-item label="左/右幅" name="aroundPicture">
                     <uni-data-select v-model="addform.aroundPicture" :localdata="aroundPictureData"/>
                 </uni-forms-item>
-                <uni-forms-item label="分部工程类别" required name="segmentName">
+                <uni-forms-item label="分部工程类别" name="segmentName">
                     <uni-easyinput v-model="addform.segmentName" placeholder="请输入分部工程类别"/>
                 </uni-forms-item>
                 <!-- 桥梁工程 -->
                 <block v-if="addform.engineeringType === 2">
-                    <uni-forms-item label="分项工程名称" required name="subitemName">
+                    <uni-forms-item label="分项工程名称" name="subitemName">
                         <uni-easyinput v-model="addform.subitemName" placeholder="请输入分项工程名称"/>
                     </uni-forms-item>
-                    <uni-forms-item label="缺陷所处位置" required name="startStopStake">
+                    <uni-forms-item label="缺陷所处位置" name="startStopStake">
                         <uni-easyinput v-model="addform.startStopStake" placeholder="请输入"/>
                     </uni-forms-item>
-                    <uni-forms-item label="构建编号" required name="buildNumber">
+                    <uni-forms-item label="构建编号" name="buildNumber">
                         <uni-easyinput v-model="addform.buildNumber" placeholder="请输入"/>
                     </uni-forms-item>
                 </block>
                 <!-- 隧道工程 -->
                 <block v-if="addform.engineeringType === 1">
-                    <uni-forms-item label="分项工程桩号" required name="subitemStake">
+                    <uni-forms-item label="分项工程桩号" name="subitemStake">
                         <uni-easyinput v-model="addform.subitemStake" placeholder="请输入分项工程桩号"/>
                     </uni-forms-item>
-                    <uni-forms-item label="缺陷起点桩号" required name="startStopStake">
+                    <uni-forms-item label="缺陷起点桩号" name="startStopStake">
                         <uni-easyinput v-model="addform.startStopStake" placeholder="请输入"/>
                     </uni-forms-item>
-                    <uni-forms-item label="横坐标" required name="abscissa_1">
+                    <uni-forms-item label="横坐标" name="abscissa_1">
                         <uni-easyinput v-model="addform.abscissa_1" placeholder="请输入"/>
                     </uni-forms-item>
-                    <uni-forms-item label="缺陷止点桩号" required name="stopStake">
+                    <uni-forms-item label="缺陷止点桩号" name="stopStake">
                         <uni-easyinput v-model="addform.stopStake" placeholder="请输入"/>
                     </uni-forms-item>
-                    <uni-forms-item label="横坐标" required name="abscissa_2">
+                    <uni-forms-item label="横坐标" name="abscissa_2">
                         <uni-easyinput v-model="addform.abscissa_2" placeholder="请输入"/>
                     </uni-forms-item>
-                    <uni-forms-item label="长(m)" required name="dataLength">
+                    <uni-forms-item label="长(m)" name="dataLength">
                         <uni-easyinput v-model="addform.dataLength" placeholder="请输入"/>
                     </uni-forms-item>
-                    <uni-forms-item label="宽(m)" required name="dataWidth">
+                    <uni-forms-item label="宽(m)" name="dataWidth">
                         <uni-easyinput v-model="addform.dataWidth" placeholder="请输入"/>
                     </uni-forms-item>
-                    <uni-forms-item label="面积" required name="dataArea">
+                    <uni-forms-item label="面积" name="dataArea">
                         <uni-easyinput v-model="addform.dataArea" placeholder="请输入面积"/>
                     </uni-forms-item>
                 </block>
-                <uni-forms-item label="病害类型" required name="diseaseType" v-if="addform.engineeringType === 1">
+                <uni-forms-item label="病害类型" name="diseaseType" v-if="addform.engineeringType === 1">
                     <uni-data-select v-model="addform.diseaseType" :clear="false" :localdata="diseaseTypeData" @change="diseaseTypeChange"/>
                 </uni-forms-item>
-                <uni-forms-item label="病害类型" required name="diseaseType" v-if="addform.engineeringType === 2">
+                <uni-forms-item label="病害类型" name="diseaseType" v-if="addform.engineeringType === 2">
                     <uni-data-select v-model="addform.diseaseType" :clear="false" :localdata="diseaseTypeData1" @change="diseaseTypeChange"/>
                 </uni-forms-item>
-                <uni-forms-item label="严重程度" required name="severity">
+                <uni-forms-item label="严重程度" name="severity">
                     <uni-data-select v-model="addform.severity" :localdata="severityData"/>
                 </uni-forms-item>
-                <uni-forms-item label="限制性缺陷" required name="defectType">
+                <uni-forms-item label="限制性缺陷" name="defectType">
                     <uni-data-select v-model="addform.defectType" :localdata="defectTypeData"/>
                 </uni-forms-item>
-                <uni-forms-item label="病害描述" required name="hiddenDanger">
+                <uni-forms-item label="病害描述" name="hiddenDanger">
                     <uni-easyinput type="textarea" v-model="addform.hiddenDanger" :disabled="!addform.diseaseType" placeholder="请先选择病害类型"/>
                 </uni-forms-item>
-                <uni-forms-item label="上传照片" required name="photoImages">
+                <uni-forms-item label="上传照片" name="photoImages">
                     <view class="hc-form-up-img-box">
                         <block v-for="(item, index) in photoImages" :key="index">
                             <view class="bg-img" @click="viewImage(index)">
@@ -103,31 +103,31 @@
                                 </view>
                             </view>
                         </block>
-                        <view class="solids-add" @click="chooseImageTap" v-if="photoImages.length <= 0">
+                        <view class="solids-add" @click="chooseImageTap">
                             <text class='cuIcon-add'/>
                         </view>
                         <view class="tip-text">支持JPG/JPEG/PNG</view>
                     </view>
                 </uni-forms-item>
-                <uni-forms-item label="是否限期整改" required name="deadline">
+                <uni-forms-item label="是否限期整改" name="deadline">
                     <uni-data-checkbox v-model="addform.deadline" :localdata="[{text: '是',value: 1}, {text: '否',value: 0}]"/>
                 </uni-forms-item>
-                <uni-forms-item label="限期整改日期" required name="endDate">
+                <uni-forms-item label="限期整改日期" name="endDate">
                     <uni-datetime-picker type="date" return-type="string" v-model="addform.endDate"/>
                 </uni-forms-item>
-                <uni-forms-item label="施工方检查人" required name="checkName">
+                <uni-forms-item label="施工方检查人" name="checkName">
                     <uni-easyinput v-model="addform.checkName" placeholder="请输入施工方检查人员"/>
                 </uni-forms-item>
-                <uni-forms-item label="监理方检查人" required name="superCheckName">
+                <uni-forms-item label="监理方检查人" name="superCheckName">
                     <uni-easyinput v-model="addform.superCheckName" placeholder="请输入监理方检查人员"/>
                 </uni-forms-item>
-                <uni-forms-item label="整改人员" required name="taskflowUser">
+                <uni-forms-item label="整改人员" name="taskflowUser">
                     <view class="flex">
                         <uni-easyinput :value="taskflowUserStr" disabled/>
                         <view class="name-btn" @click="userChange">选择+</view>
                     </view>
                 </uni-forms-item>
-                <uni-forms-item label="备注">
+                <uni-forms-item label="备注" name="remark">
                     <uni-easyinput v-model="addform.remark" type="textarea" placeholder="请输入备注"/>
                 </uni-forms-item>
             </uni-forms>
@@ -136,6 +136,7 @@
 </template>
 <script>
 import config from "../../core/api.js"
+import {deepCopy} from "@/uni_modules/uni-forms/components/uni-forms/utils";
 
 export default {
     data() {
@@ -213,22 +214,10 @@ export default {
             },
             // 校验规则
             formRules: {
-                supervisionUnitName: {
-                    rules: [{
-                        required: true,
-                        errorMessage: '请输入检查单位'
-                    }]
-                },
                 startDate: {
                     rules: [{
                         required: true,
-                        errorMessage: '请输入检查单位'
-                    }]
-                },
-                checkName: {
-                    rules: [{
-                        required: true,
-                        errorMessage: '请输入检查人员'
+                        errorMessage: '请选择检查日期'
                     }]
                 },
             }
@@ -282,7 +271,7 @@ export default {
         //上传照片
         chooseImageTap() {
             uni.chooseFile({
-                count: 1,
+                count: 3,
                 extension: ['.jpg', '.png', '.jpeg'],
                 success: ({tempFiles, tempFilePaths}) => {
                     this.addform.photoImages = tempFiles
@@ -305,7 +294,7 @@ export default {
         //关联工程部位
         relationStringClick() {
             //把已选值储存到全局变量
-            getApp().globalData.relationStringId = this.addform.relationStringId;
+            getApp().globalData.relationId = this.addform.relationId;
             uni.navigateTo({
                 url: "/pages/qualityInspection_fj/tree"
             })
@@ -327,156 +316,45 @@ export default {
         //提交代码
         submitForm() {
             this.$refs.formRef.validate().then(res => {
-                console.log('success', res);
-            }).catch(err => {
-                console.log('err', err);
-            })
-            /*this.$refs.form.validate().then(res => {
-                if (this.addform.deadline == '1' && !this.addform.endDate) {
-                    this.$prompt.none("请选择整改期限日期");
-                    return;
-                }
-                if (!(this.addform.taskflowUser && this.addform.taskflowUser.length)) {
-                    this.$prompt.none("请选择整改人员");
-                    return;
-                }
                 this.addInfoHandle();
-            })*/
+            }).catch(() => {
+                uni.showToast({
+                    title: '请完善表单信息',
+                    duration: 1500,
+                    icon: 'none'
+                });
+            })
         },
-
         addInfoHandle() {
-            //console.log('addInfoHandle')
-            let taskflowUserIds = [];
-            if (this.addform.taskflowUser) {
-                this.addform.taskflowUser.forEach(element => {
-                    taskflowUserIds.push(element.id)
+            let formData = deepCopy(this.addform);
+            //处理日期格式
+            formData.startDate = this.$dayjs(formData.startDate).format('YYYY 年 MM 月 DD 日');
+            formData.endDate = this.$dayjs(formData.endDate).format('YYYY 年 MM 月 DD 日');
+            //处理人员
+            let taskFlowUserIds = [];
+            if (formData.taskFlowUser) {
+                formData.taskFlowUser.forEach(element => {
+                    taskFlowUserIds.push(element.id)
                 });
+                formData.taskFlowUser = JSON.stringify(formData.taskFlowUser);
             }
-
-            let noticeUserIds = [];
-            if (this.addform.noticeUser) {
-                this.addform.noticeUser.forEach(element => {
-                    noticeUserIds.push(element.id)
-                });
-            }
-
-            //var formData = new FormData();
-
-            //console.log(formData)
-            // if(this.addInfoType == 2){
-            // 	formData.append('id', this.addform.id)
-            // 	formData.append('status', 2)//复核中
-            // }
-            // formData.append('cs', 1)//监理指令1  施工整改0
-            // formData.append('contractName', this.addform.contractName)
-            // formData.append('supervisionUnitName', this.addform.supervisionUnitName)
-            // formData.append('contractorUnitName', this.addform.contractorUnitName)
-            // formData.append('deadline', this.addform.deadline)
-            // formData.append('startDate', this.$dayjs(this.addform.startDate).format('YYYY 年 MM 月 DD 日'))
-            // formData.append('endDate', this.$dayjs(this.addform.endDate).format('YYYY 年 MM 月 DD 日'))
-            // formData.append('checkName', this.addform.checkName)
-            // formData.append('taskflowUserIds', taskflowUserIds.join(','))
-            // formData.append('noticeUserIds', noticeUserIds.join(','))
-            // formData.append('hiddenDanger', this.addform.hiddenDanger)
-            // formData.append('modifyRequirements', this.addform.modifyRequirements)
-
-            let formData = {};
-            if (this.addInfoType == 2) {
-                formData.id = this.addform.id;
-                formData.status = 2;//复核中
-            }
-            formData.cs = 1;//监理指令1  施工整改0
-            formData.contractName = this.addform.contractName;
-            formData.supervisionUnitName = this.addform.supervisionUnitName;
-            formData.contractorUnitName = this.addform.contractorUnitName;
-            formData.deadline = this.addform.deadline;
-            formData.startDate = this.$dayjs(this.addform.startDate).format('YYYY 年 MM 月 DD 日');
-            formData.endDate = this.$dayjs(this.addform.endDate).format('YYYY 年 MM 月 DD 日');
-            formData.checkName = this.addform.checkName;
-            formData.taskflowUserIds = taskflowUserIds.join(',');
-            formData.noticeUserIds = noticeUserIds.join(',');
-            formData.hiddenDanger = this.addform.hiddenDanger;
-            formData.modifyRequirements = this.addform.modifyRequirements;
-
-            let fileLists = [];
-            for (var i = 0; i < this.fileList.length; i++) {
-                if (this.fileList[i].files && this.fileList[i].files.length) {
-                    this.fileList[i].files.forEach((file) => {
-                        fileLists.push({
-                            id: file.id,
-                            file: file,
-                            remark: this.fileList[i].remark,
-                            type: 1,
-                            groupType: i + 1,
-                        })
-                    })
-                } else {
-                    fileLists.push({
-                        remark: this.fileList[i].remark,
-                        type: 1,
-                        groupType: i + 1,
-                    })
-                }
-            }
-
-            for (var i = 0; i < this.fileList2.length; i++) {
-                if (this.fileList2[i].files && this.fileList2[i].files.length) {
-                    this.fileList2[i].files.forEach((file) => {
-                        fileLists.push({
-                            id: file.id,
-                            file: file,
-                            remark: this.fileList2[i].remark,
-                            type: 0,
-                            groupType: i + 1,
-                        });
-                    })
-                } else {
-                    fileLists.push({
-                        remark: this.fileList2[i].remark,
-                        type: 0,
-                        groupType: i + 1,
-                    })
-                }
+            formData.taskFlowUserIds = taskFlowUserIds.join(',');
+            //处理文件
+            if (formData.photoImages) {
+                console.log(formData.photoImages)
+                formData.photoImages.forEach((file, i) => {
+                    console.log(file)
+                    /*if (file.raw) {
+                        formData.append(`orders[${index}].images[${i}].file`, file.raw);
+                    }
+                    formData.append(`orders[${index}].images[${i}].remark`, file.remark);
+                    formData.append(`orders[${index}].images[${i}].type`, '1');
+                    formData.append(`orders[${index}].images[${i}].groupType`, '1');*/
+                })
+                //formData.append(`orders[${index}].files`, JSON.stringify(item.files));
             }
-
-            //console.log(fileLists)
-            // fileLists.forEach((file,i)=>{
-            //   if(file.file){
-            // 	formData.append('images['+i+'].file',file.file);
-            //   }
-            //   formData.append('images['+i+'].remark',file.remark);
-            //   formData.append('images['+i+'].type',file.type);
-            //   formData.append('images['+i+'].groupType',file.groupType);
-            // })
-
-            // let jsonData = {};
-            // //console.log(formData)
-            // formData.forEach((value, key) => jsonData[key] = value);
-            // jsonData.userId = this.userid;
-            // jsonData.projectId = this.project.id;
-            // jsonData.contractId = this.project.contractId;
-            // console.log(jsonData)
-            ////return;
-
-            fileLists.forEach((file, i) => {
-                //console.log(file)
-                if (file.file && file.file.size) {
-                    formData['images[' + i + '].file'] = file.file;
-                }
-                if (file.id) {
-                    formData['images[' + i + '].id'] = file.id;
-                }
-                formData['images[' + i + '].remark'] = file.remark;
-                formData['images[' + i + '].type'] = file.type;
-                formData['images[' + i + '].groupType'] = file.groupType;
-            })
-            formData.userId = this.userid;
-            formData.projectId = this.project.id;
-            formData.contractId = this.project.contractId;
-            console.log(formData)
-            //return;
-
-            const url = config.api;
+            console.log('formData', formData)
+            /*const url = config.api;
             const token = uni.getStorageSync("token");
             uni.showLoading({
                 title: '加载中'
@@ -500,10 +378,8 @@ export default {
                 }, complete() {
                     uni.hideLoading();
                 }
-            })
-
+            })*/
         },
-
         backPage() {
             uni.navigateBack({
                 delta: 1

+ 20 - 7
pages/qualityInspection_fj/qualityInspection.vue

@@ -45,7 +45,7 @@
                         </view>
                     </view>
                     <view class="action">
-                        <button class="cu-btn bg-blue1" @click.stop="revocationTap" v-if="item.status==1">撤回</button>
+                        <button class="cu-btn bg-blue1" @click.stop="revocationTap(item)" v-if="item.status==1">撤回</button>
                         <button class="cu-btn bg-grey" v-if="item.status==4">已撤</button>
                     </view>
                 </view>
@@ -202,12 +202,25 @@ export default {
             })
         },
         //撤回
-        revocationTap() {
-            /**
-             * 2、办结、复核,撤回操作 依次对应1  2  3
-             * POST:/app/qualityModifyInfo/updateStatus
-             * 入参:WEB端一样
-             */
+        revocationTap({id}) {
+            this.http.request("/app/qualityModifyInfo/updateStatus",{
+                id: id,
+                opCode: 4
+            }).then((json)=>{
+                if(json.result == 1){
+                    uni.showToast({
+                        title: '操作成功',
+                        mask: true
+                    });
+                    this.searchClick()
+                } else {
+                    uni.showToast({
+                        title: `操作失败:${json.msg}`,
+                        duration: 1500,
+                        icon: 'none'
+                    });
+                }
+            })
         },
         //新增记录
         newRecordTap() {

+ 16 - 300
pages/qualityInspection_fj/tree.vue

@@ -1,76 +1,11 @@
 <template>
 	<view>
-		<!-- 头部 -->
 		<cu-custom bgColor="bg-blue" :isBack="true">
 			<block slot="backText"></block>
 			<block slot="content">选择关联工程部位</block>
-            <block slot="right">
-                <text style="margin-right: 10rpx" @click="navTo">确定</text>
-            </block>
+            <block slot="right"></block>
 		</cu-custom>
-		<scroll-view scroll-y class="margin-bottom" style="padding-bottom: 300rpx;">
-			<view v-for="(item,index) in treeData" :key="item.id" class="treeData_b">
-				<view class="treeData_1" @click="treeTap(index+1,item)">
-					<view style="font-weight: bold;font-size: 34rpx;" :class="item.selected&&!allSelect?'indexColor':''">{{item.name}}</view>
-					<view v-if="item.children.length>0">
-						<image src="/static/information/shang.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="show == index + 1"></image>
-						<image src="/static/information/xia.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="show != index + 1 || show == 0"></image>
-					</view>
-				</view>
-				<view v-for="(second,seconds) in item.children" :key="second.id" v-if="show == index + 1">
-					<view class="treeData_1s treeData_2" @click="secondTap(seconds + 1,second)">
-						<view :class="second.selected&&!allSelect?'indexColor':''">{{second.name}}</view>
-						<view v-if="second.children.length>0">
-							<image src="/static/information/shang.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showsecond == seconds + 1"></image>
-							<image src="/static/information/xia.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showsecond != seconds + 1 || showsecond == 0"></image>
-						</view>
-					</view>
-					<view v-if="showsecond == seconds + 1" :style="{'padding-bottom': second.children.length>0 ? '22rpx':''}">
-						<view v-for="(three,threes) in second.children" :key="three.id" class="treeData_three">
-							<view class="treeData_1s treeData_3" @click="threeTap(threes + 1,three)">
-								<view :class="three.selected&&!allSelect?'indexColor':''">{{three.name}}</view>
-								<view v-if="three.children.length>0">
-									<image src="/static/information/shang.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showthree == threes + 1"></image>
-									<image src="/static/information/xia.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showthree != threes + 1 || showthree == 0"></image>
-								</view>
-							</view>
-							<view v-if="showthree == threes + 1" v-for="(four,fours) in three.children" :key="four.id">
-								<view class="treeData_1s treeData_3" @click="fourTap(fours + 1,four)">
-									<view style="padding-left: 22rpx;" :class="four.selected&&!allSelect?'indexColor':''"><text style="margin-right: 10rpx;">◈</text>{{four.name}}</view>
-									<view v-if="four.children.length>0">
-										<image src="/static/information/shang.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showfour == fours + 1"></image>
-										<image src="/static/information/xia.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showfour != fours + 1 || showfour == 0"></image>
-									</view>
-								</view>
-								<view v-if="showfour == fours + 1" v-for="(five,fives) in four.children" :key="five.id">
-									<view class="treeData_1s treeData_3" @click="fiveTap(fives + 1,five)">
-										<view style="padding-left: 44rpx;" :class="five.selected&&!allSelect?'indexColor':''"><text style="margin-right: 10rpx;">➣</text>{{five.name}}</view>
-										<view v-if="five.children.length>0">
-											<image src="/static/information/shang.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showfive == fives + 1"></image>
-											<image src="/static/information/xia.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showfive != fives + 1 || showfive == 0"></image>
-										</view>
-									</view>
-									<view v-if="showfive == fives + 1" v-for="(six,sixs) in five.children" :key="six.id">
-										<view class="treeData_1s treeData_3" @click="sixTap(sixs + 1,six)">
-											<view style="padding-left: 66rpx;" :class="six.selected&&!allSelect?'indexColor':''"><text style="margin-right: 10rpx;">•</text>{{six.name}}</view>
-											<view v-if="six.children.length>0">
-												<image src="/static/information/shang.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showsix == sixs + 1"></image>
-												<image src="/static/information/xia.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showsix != sixs + 1 || showsix == 0"></image>
-											</view>
-										</view>
-										<view v-if="showsix == sixs + 1" v-for="(seven,sevens) in six.children" :key="seven.id">
-											<view class="treeData_1s treeData_3" @click="sevenTap(sevens + 1,seven)">
-												<view style="padding-left: 88rpx;" :class="seven.selected&&!allSelect?'indexColor':''">{{seven.name}}</view>
-											</view>
-										</view>
-									</view>
-								</view>
-							</view>
-						</view>
-					</view>
-				</view>
-			</view>
-		</scroll-view>
+
 	</view>
 </template>
 
@@ -79,21 +14,8 @@
 		data() {
 			return {
 				treeData: [],
-				show: 0, //一级状态
-				showsecond: 0, //二级状态
-				showthree: 0, //三级状态
-				showfour: 0, //四级状态
-				showfive: 0, //五级状态
-				showsix: 0, //六级状态
-				showseven: 0, //七级状态
-				modalShow: false,
-				path: "",
-				percentage:"",
-				width:"",
-				processNum:"",
-				allSelect:false,//是否选中全部
-                userid: null,
-                project: null,
+                project: {},
+                userid: '',
 			}
 		},
 		onLoad() {
@@ -103,229 +25,23 @@
 			this.findDataProgress();
 		},
 		methods: {
-			findDataProgress() {
-				var that = this;
-				that.http.request('/app/qualityModifyInfo/getDataByparantId', {
+            findDataProgress() {
+                var that = this;
+                that.http.request('/app/qualityModifyInfo/getDataByparantId', {
                     type: 0,
                     id: '',
-                    projectId:this.project.id,
-                    contractId:this.project.contractId,
-				}).then((result) => {
-					if (result.datas != null) {
-						that.treeData = result.datas[0].children;
-						that.text(that.treeData);
-					}
-				})
-			},
-			search() {
-				uni.setStorageSync("pageType", 1); //区分搜索页面跳转
-				uni.navigateTo({
-					url: "/pages/search/search"
-				})
-			},
-			filterNode(value, data) {
-				if (!value) return true;
-				return data.label.indexOf(value) !== -1;
-			},
-			/* 获取节点的资料进度 */
-			handleNodeClick(data) {
-				var that =this;
-					that.http.request("/app/divideClient/countInstance",{ids:data.id,contractId:""}).then((res)=>{
-						var num = res.data*100
-						that.percentage = Math.round(num);
-						that.width ="width:"+Math.round(num)+"%;";
-						that.processNum = res.size;
-						that.findPath(data.id);
-					});
-			},
-			/* 全程工程的施工进度 */
-			allData(){
-				this.allSelect = true;
-				var that =this;
-				var project = uni.getStorageSync("porject"+"_"+uni.getStorageSync("userInfo").id);
-				that.http.request("/app/divideClient/countInstance",{ids:project.contractId,contractId:project.contractId}).then((res)=>{
-					var num = res.data*100
-					that.percentage = Math.round(num);
-					that.width ="width:"+Math.round(num)+"%;";
-					that.processNum = res.size;
-					that.path=" / 全部工程"
-					that.modalShow = true
-				});
-			},
-			findPath(id){
-				/* 获取父节点信息 */
-				var that=this;
-				that.http.request("/app/divideClient/selectNodeTreeById",{id:id}).then((res)=>{
-					that.path="";
-					res.datas.forEach((item)=>{
-						if(item.parentId!=0){
-							that.path += " / "+item.name;
-						}
-					});
-					that.modalShow = true
-				});
-			},
-			treeTap(e,r) {
-				this.text(this.treeData)
-				r.selected = true;
-				this.allSelect = false;
-				if (this.show == e) {
-					this.show = 0
-				} else {
-					this.show = e
-				}
-				this.handleNodeClick(r);
-			},
-			secondTap(e,r) {
-				this.text(this.treeData)
-				r.selected = true;
-				this.allSelect = false;
-				if (this.showsecond == e) {
-					this.showsecond = 0
-				} else {
-					this.showsecond = e
-				}
-				this.handleNodeClick(r);
-			},
-			threeTap(e,r) {
-				this.text(this.treeData)
-				r.selected = true;
-				this.allSelect = false;
-				if (this.showthree == e) {
-					this.showthree = 0
-				} else {
-					this.showthree = e
-				}
-				this.handleNodeClick(r);
-			},
-			fourTap(e,r) {
-				this.text(this.treeData);
-				this.$set(r,"selected",true);
-				this.allSelect = false;
-				if (this.showfour == e) {
-					this.showfour = 0
-				} else {
-					this.showfour = e
-				}
-				this.handleNodeClick(r);
-			},
-			fiveTap(e,r) {
-				this.text(this.treeData);
-				this.$set(r,"selected",true);
-				this.allSelect = false;
-				if (this.showfive == e) {
-					this.showfive = 0
-				} else {
-					this.showfive = e
-				}
-				this.handleNodeClick(r);
-			},
-			sixTap(e,r) {
-				this.text(this.treeData)
-				r.selected = true;
-				this.allSelect = false;
-				if (this.showsix == e) {
-					this.showsix = 0
-				} else {
-					this.showsix = e
-				}
-				this.handleNodeClick(r);
-			},
-			sevenTap(e,r) {
-				this.text(this.treeData)
-				r.selected = true;
-				this.allSelect = false;
-				if (this.showseven == e) {
-					this.showseven = 0
-				} else {
-					this.showseven = e
-				}
-				this.handleNodeClick(r);
-			},
-			text(data) {
-				var that = this;
-				data.forEach((item) => {
-					item.selected = false;
-					if (item.children.length > 0) {
-						that.text(item.children);
-					}
-
-				})
-				that.treeData  = data;
-			},
-            navTo(){
-
-            }
-		}
+                    projectId: this.project.id,
+                    contractId: this.project.contractId,
+                }).then((result) => {
+                    if (result.datas != null) {
+                        that.treeData = result.datas;
+                    }
+                })
+            },
+        }
 	}
 </script>
 
 <style>
 	page{background-color: #F7F7F7;}
-	.toTop {
-		position: fixed;
-		bottom: 0;
-		width: 100%;
-		background-color: #F7F7F7;
-		height: calc(var(--window-bottom) + 15px)
-	}
-
-	.solid-bottom-type {
-		border-bottom: 1upx solid white;
-	}
-
-	.treeData_b {
-		margin: 12rpx 22rpx 0;
-		background-color: #fff;
-		border-radius: 10rpx;
-		padding: 0 22rpx;
-	}
-
-	.treeData_1 {
-		font-size: 30rpx;
-		color: #101010;
-		height: 88rpx;
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-	}
-
-	.treeData_1s {
-		font-size: 30rpx;
-		color: #101010;
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		padding: 22upx 0;
-		min-height: 88rpx;
-	}
-
-	.treeData_2 {
-		border-top: 1upx dashed #E3E1E1;
-	}
-
-	.treeData_3 {
-		border-top: 1upx dashed #E3E1E1;
-	}
-
-	.treeData_three {
-		background-color: #F7F7F7;
-		padding: 0 22rpx;
-		border-radius: 10rpx;
-		margin-bottom: 22;
-	}
-
-	.treeData_three:first-child {
-		border-radius: 10rpx 10rpx 0 0;
-	}
-
-	.treeData_three:last-child {
-		border-radius: 0 0 10rpx 10rpx;
-	}
-
-	.indexColor {
-		color: #0A8CD5;
-		font-weight: bold;
-	}
-	.padding-sm{padding:20rpx 22rpx;}
 </style>

+ 10 - 0
uni_modules/peng-lazy-tree/changelog.md

@@ -0,0 +1,10 @@
+## 1.0.4(2023-02-08)
+更新文档
+## 1.0.3(2023-02-08)
+样式微调
+## 1.0.2(2023-02-07)
+新增了父子级联选择功能
+## 1.0.1(2023-02-07)
+删除冗余代码,提高程序运行速度
+## 1.0.0(2023-02-06)
+1.0.0

File diff suppressed because it is too large
+ 133 - 0
uni_modules/peng-lazy-tree/components/peng-lazy-tree/peng-lazy-tree.vue


+ 151 - 0
uni_modules/peng-lazy-tree/components/peng-lazy-tree/style.css

@@ -0,0 +1,151 @@
+.peng-tree-mask {
+  position: fixed;
+  top: 0rpx;
+  right: 0rpx;
+  bottom: 0rpx;
+  left: 0rpx;
+  z-index: 9998;
+  background-color: rgba(0, 0, 0, 0.6);
+  opacity: 0;
+  transition: all 0.3s ease;
+  visibility: hidden;
+}
+.peng-tree-mask.show {
+  visibility: visible;
+  opacity: 1;
+}
+.peng-tree-cnt {
+  position: fixed;
+  top: 0rpx;
+  right: 0rpx;
+  bottom: 0rpx;
+  left: 0rpx;
+  z-index: 9999;
+  top: 360rpx;
+  transition: all 0.3s ease;
+  transform: translateY(100%);
+}
+.peng-tree-cnt.show {
+  transform: translateY(0);
+}
+.peng-tree-bar {
+  background-color: #fff;
+  height: 72rpx;
+  padding-left: 20rpx;
+  padding-right: 20rpx;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  box-sizing: border-box;
+  border-bottom-width: 1rpx !important;
+  border-bottom-style: solid;
+  border-bottom-color: #f5f5f5;
+  font-size: 32rpx;
+  color: #757575;
+  line-height: 1;
+}
+.peng-tree-bar-confirm {
+  color: #007aff;
+}
+.peng-tree-view {
+  position: absolute;
+  top: 0rpx;
+  right: 0rpx;
+  bottom: 0rpx;
+  left: 0rpx;
+  top: 72rpx;
+  background-color: #fff;
+  padding-top: 20rpx;
+  padding-right: 20rpx;
+  padding-bottom: 20rpx;
+  padding-left: 20rpx;
+}
+.peng-tree-view-sc {
+  height: 100%;
+  overflow: hidden;
+}
+.peng-tree-item {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  font-size: 26rpx;
+  color: #757575;
+  line-height: 1;
+  height: 0;
+  opacity: 0;
+  transition: 0.2s;
+  position: relative;
+  overflow: hidden;
+}
+.peng-tree-item.show {
+  height: 80rpx;
+  opacity: 1;
+}
+.peng-tree-item.showchild:before {
+  transform: rotate(90deg);
+}
+.peng-tree-item.last:before {
+  opacity: 0;
+}
+.peng-tree-icon {
+  width: 26rpx;
+  height: 26rpx;
+  margin-right: 8rpx;
+}
+.peng-tree-label {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  height: 100%;
+  line-height: 1.2;
+}
+.peng-tree-check {
+  width: 40px;
+  height: 40px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.peng-tree-check-yes,
+.peng-tree-check-no {
+  width: 20px;
+  height: 20px;
+  border-top-left-radius: 20%;
+  border-top-right-radius: 20%;
+  border-bottom-right-radius: 20%;
+  border-bottom-left-radius: 20%;
+  border-top-width: 1rpx;
+  border-left-width: 1rpx;
+  border-bottom-width: 1rpx;
+  border-right-width: 1rpx;
+  border-style: solid;
+  border-color: #007aff;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  box-sizing: border-box;
+}
+.peng-tree-check-yes-b {
+  width: 12px;
+  height: 12px;
+  border-top-left-radius: 20%;
+  border-top-right-radius: 20%;
+  border-bottom-right-radius: 20%;
+  border-bottom-left-radius: 20%;
+  background-color: #007aff;
+}
+.peng-tree-check .radio {
+  border-top-left-radius: 50%;
+  border-top-right-radius: 50%;
+  border-bottom-right-radius: 50%;
+  border-bottom-left-radius: 50%;
+}
+.peng-tree-check .radio .peng-tree-check-yes-b {
+  border-top-left-radius: 50%;
+  border-top-right-radius: 50%;
+  border-bottom-right-radius: 50%;
+  border-bottom-left-radius: 50%;
+}
+.hover-c {
+  opacity: 0.6;
+}

+ 81 - 0
uni_modules/peng-lazy-tree/package.json

@@ -0,0 +1,81 @@
+{
+  "id": "peng-lazy-tree",
+  "displayName": "树形选择器,支持多选、单选、级联选择、接口数据懒加载",
+  "version": "1.0.4",
+  "description": "该插件支持多选,单选,级联选择,接口数据懒加载,有需求的伙伴欢迎使用并留言反馈建议,该插件只在app上使用过,其他小程序需要自行测试",
+  "keywords": [
+    "peng-lazy-tree"
+],
+  "repository": "",
+  "engines": {
+    "HBuilderX": "^3.3.7"
+  },
+  "dcloudext": {
+    "type": "component-vue",
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": ""
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "Vue": {
+          "vue2": "y",
+          "vue3": "u"
+        },
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "y"
+        },
+        "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",
+          "钉钉": "y",
+          "快手": "y",
+          "飞书": "y",
+          "京东": "y"
+        },
+        "快应用": {
+          "华为": "y",
+          "联盟": "y"
+        }
+      }
+    }
+  }
+}

+ 145 - 0
uni_modules/peng-lazy-tree/readme.md

@@ -0,0 +1,145 @@
+#### 参数说明
+
+|     属性名      |类型|   默认值   | 说明 |
+|:------------:|---|:-------:|--------------------------------------|
+|    idKey     |String|   id    | 指定 Object 中 key 的值作为单条数据的唯一id|
+|   nameKey    |String|  name   | 指定 Object 中 key 的值作为选择器显示的内容|
+|    title     |String|    -    | 选择器的名称默认为空|
+|  titleColor  |String| #757575 | 标题的颜色|
+| confirmColor |String| #007aff | 确定按钮及选择框的颜色|
+| cancelColor  |String| #757575 | 取消按钮的颜色|
+| currentIcon  |String|  默认图标   | 折叠时的图标|
+| defaultIcon  |String|  默认图标   | 打开之后的图标|
+| lastIcon  |String|   默认无   | 没有子集时的图标|
+| maskClick  |Boolean|   true   | 点击遮罩层是否关闭|
+|   multiple   |Boolean|  true   | 是否可以多选(true:多选、false:单选)|
+|   selectParent   |Boolean|  true   | 父级是否可选(true:可选、false:不可选)|
+|   cascade   |Boolean|  false  | 在(多选 && 父级可选)模式下,开启级联选择(true:级联、false:不级联) |
+| url  |String|   必传   | 接口地址|
+| method  |String|   GET   | 接口请求方式|
+| header  |Object|   {}   | 接口header传参|
+| formData  |Object|   {}   | 接口body传参|
+| formUrl  |String|   parentId   | url接口取数据传参,如http://xxx.xxx?parentId=bbb中的parentId|
+| default  |String|   空值   | url获取数据默认值,如http://xxx.xxx?parentId=bbb中的bbb|
+|    allKey    |String|  id  | 需要查询下一级的取值字段|
+| success  |Array|   []   | 接口返回值取数据,只支持解析最多两层数据,解析如下(接口返回值说明)|
+| @error  |Handler|    -    | 接口获取数据报错返回信息|
+| @cancel  |Handler|    -    | 点击取消或点击遮罩层关闭时的回调方法|
+| @confirm  |Handler|    -    | 点击确定按钮时的回调方法|
+
+#### 接口返回值说明
+```vue
+	//1、接口返回值为
+	{
+		code:200,
+		result:{
+			qqq:"qqq",
+			bbb:"bbb",
+			records:[
+				{需要展示的数据001},
+				{需要展示的数据002},
+				{需要展示的数据003}
+			]
+		}
+	}
+	success值则需要传["result", "records"]
+	//1、接口返回值为
+	{
+		code:200,
+		result:[
+			{需要展示的数据001},
+			{需要展示的数据002},
+			{需要展示的数据003}
+		]
+	}
+	success值则需要传["result"]
+```
+
+#### 返回值说明
+```vue
+	treeConfirm(e) {
+        console.log("你点击了确定")
+        console.log(e)
+		/**
+		 * e==>
+		 * [
+		 *	 {id: "100", name: "测试100", parentId: ["1"]}
+		 *	 {id: "110", name: "测试110", parentId: ["1","2"]}
+		 *	 {id: "111", name: "测试111", parentId: ["1","2","3"]}
+		 * ]
+		 * e为选中的数据数组
+		 * e中的对象中有id(idKey指定的字段值)、name(nameKey指定的字段)、parentId(处自己外所有上级的id数组)
+		 */
+    },
+
+```
+
+#### 代码使用示例
+```vue
+<template>
+	<view class="content">
+		<button @click="dakai">打开</button>
+		<peng-lazy-tree ref="pengLazyPeng" 
+			title="选择器" 
+			titleColor="red"
+			cancelColor="#757575"
+			confirmColor="#007aff"
+			:maskClick="true"
+			:selectParent="true"
+			:multiple="true"
+			
+			url="https://admin.qingshanzhi.cn/cc-admin/qsz/speciesType/list"
+			formUrl="parentId" 
+			default="0"
+			:header="header"
+			:formData="formData"
+			method="GET"
+			:success="success"
+			
+			idKey="id"
+			nameKey="name"
+			allKey="id"
+			
+			@error="error"
+			@confirm="confirm"
+			@cancel="cancel" />
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				formData:{
+					name:"",
+					valuel:""
+				},
+				header: {
+					Authorization: uni.getStorageSync('token'),
+				},
+				success: ["result", "records"]
+			}
+		},
+		methods: {
+			//打开选择器
+			dakai() {
+				this.$refs.pengLazyPeng._show()
+			},
+			//接口报错返回
+			error(e) {
+				console.log(e)
+			},
+			//点击确定返回
+			confirm(e) {
+				console.log(e)
+			},
+			//点击取消时间
+			cancel(e) {
+				console.log(e)
+			}
+		}
+	}
+</script>
+
+
+```

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