menchuang пре 1 година
родитељ
комит
9c4bc6902a

+ 11 - 3
api/common.js

@@ -1,6 +1,5 @@
 import request from '@/utils/request'
 
-
 // 新增(提交)市政工程
 export function submitMunicipalData(param) {
 	return request({
@@ -9,11 +8,20 @@ export function submitMunicipalData(param) {
 		'data': param
 	})
 }
+
+// 工业工程新增
+export function Submitengineering(engineering) {
+	return request({
+		'url': '/zdsz/engineeringIndustry',
+		'method': 'post',
+		'data': engineering
+	})
+}
 // 获取房间工程历史
-export function getRoomProjectList(id,type) {
+export function getRoomProjectList(id, type) {
 
 	return request({
-		'url': '/zdsz/engineeringCivil/'+id+'/'+type,
+		'url': '/zdsz/engineeringCivil/' + id + '/' + type,
 		'method': 'get',
 	})
 }

+ 19 - 0
components/bottomSheet/bottomSheet.vue

@@ -18,11 +18,18 @@
 								<view class="uni-media-list-text-top"
 									style="font-size: 13px;color: #000;margin-top: 5px;">
 									腐蚀等级:{{value.zEngineeringMaterialBo[0].corrosionLevel}}</view>
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									施工时间:{{value.createTime}}</view>
 							</view>
+
 							<view v-if="title=='打孔'">
 								<view class="uni-media-list-text-top"
 									style="font-size: 13px;color: #000;margin-top: 5px;">
 									孔距:{{value.zEngineeringMaterialBo[0].corrosionLevel}}</view>
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									施工时间:{{value.createTime}}</view>
 							</view>
 							<view v-else-if="title=='立杠'">
 								<view class="uni-media-list-text-top"
@@ -34,6 +41,9 @@
 								<view class="uni-media-list-text-top"
 									style="font-size: 13px;color: #000;margin-top: 5px;">
 									数量:{{value.zEngineeringMaterialBo[0].number}}</view>
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									施工时间:{{value.createTime}}</view>
 							</view>
 							<view v-else-if="title=='挂表'">
 								<view class="uni-media-list-text-top"
@@ -43,6 +53,9 @@
 								<view class="uni-media-list-text-top"
 									style="font-size: 13px;color: #000;margin-top: 5px;">
 									数量:{{value.zEngineeringMaterialBo[0].number}}</view>
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									施工时间:{{value.createTime}}</view>
 							</view>
 							<view v-else-if="title=='表后管'">
 								<view class="uni-media-list-text-top"
@@ -54,6 +67,9 @@
 								<view class="uni-media-list-text-top"
 									style="font-size: 13px;color: #000;margin-top: 5px;">
 									数量:{{value.zEngineeringMaterialBo[0].number}}</view>
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									施工时间:{{value.createTime}}</view>
 							</view>
 							<view v-else-if="title=='阀管'">
 								<view class="uni-media-list-text-top"
@@ -71,6 +87,9 @@
 								<view class="uni-media-list-text-top"
 									style="font-size: 13px;color: #000;margin-top: 5px;">
 									数量:{{value.zEngineeringMaterialBo[0].number}}</view>
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									施工时间:{{value.createTime}}</view>
 							</view>
 							<!-- <view v-if="title=='拆旧管'">
 								<view class="uni-media-list-text-top"

+ 1 - 0
main.js

@@ -9,6 +9,7 @@ Vue.use(plugins)
 Vue.config.productionTip = false
 Vue.prototype.$store = store
 
+
 App.mpType = 'app'
 // 挂载全局图片地址
 Vue.prototype.$HTTP = config.baseUrl

+ 6 - 0
pages.json

@@ -118,6 +118,12 @@
 			"style": {
 				"navigationBarTitleText": "市政工程"
 			}
+		},
+		{
+			"path": "pages/enginproject/enginproject",
+			"style": {
+				"navigationBarTitleText": "工业工程"
+			}
 		}
 
 	],

+ 978 - 0
pages/enginproject/enginproject.vue

@@ -0,0 +1,978 @@
+	<template>
+		<view>
+			<view class="background">
+				<view class="uni-list">
+					<view class="container">
+						<view>
+							工程类型
+						</view>
+						<view v-if="this.isEmpty(this.projectType.dictValue)" style="margin-top: 10;"
+							@click="pickerShow('gclx',0)">
+							<span style="color: darkgray;">请选择工程类型</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('gclx',0)">
+							<span style="color: black;">{{projectType.dictLabel}}</span>
+						</view>
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+
+						<text>工程名称</text>
+						<input class="uni-input" type="text" v-model="projectName" placeholder="请填写工程名称" maxlength="100"
+							style="margin-left: 10px;text-align: right;"></input>
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+
+						<text>建设单位</text>
+						<input class="uni-input" type="text" v-model="jsdwValue" placeholder="请填写建设单位" maxlength="100"
+							style="margin-left: 10px;text-align: right;"></input>
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+
+						<text>项目负责人</text>
+						<input class="uni-input" type="text" v-model="xmfzrValue" placeholder="请填写项目负责人" maxlength="16"
+							style="margin-left: 10px;text-align: right;"></input>
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+
+						<text>现场负责人</text>
+						<input class="uni-input" type="text" v-model="xcfzrValue" placeholder="请填写现场负责人" maxlength="16"
+							style="margin-left: 10px;text-align: right;"></input>
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+
+						<text>设计单位</text>
+						<input class="uni-input" type="text" v-model="sjdwValue" placeholder="请填写设计单位" maxlength="100"
+							style="margin-left: 10px;text-align: right;"></input>
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+
+						<text>设计负责人</text>
+						<input class="uni-input" type="text" v-model="sjfzrValue" placeholder="请填写设计负责人" maxlength="16"
+							style="margin-left: 10px;text-align: right;"></input>
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+
+						<text>设计联系电话</text>
+						<input class="uni-input" type="number" v-model="sjPhoneValue" placeholder="请填写设计联系电话"
+							maxlength="11" style="margin-left: 10px;text-align: right;"></input>
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+
+						<text>监理单位</text>
+						<input class="uni-input" type="text" v-model="jldwValue" placeholder="请填写监理单位" maxlength="100"
+							style="margin-left: 10px;text-align: right;"></input>
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+
+						<text>监理负责人</text>
+						<input class="uni-input" type="text" v-model="jlfzrValue" placeholder="请填写监理负责人" maxlength="16"
+							style="margin-left: 10px;text-align: right;"></input>
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+
+						<text>监理联系电话</text>
+						<input class="uni-input" type="number" v-model="jlPhoneValue" placeholder="请填写监理联系电话"
+							maxlength="11" style="margin-left: 10px;text-align: right;"></input>
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="align-items" style="margin-bottom: 20px;">
+						<view class="container" style="color: gainsboro;">*请上传文件</view>
+						<view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
+							<image src="/static/images/chooseimg.png" mode=""
+								style="width: 100rpx; height: 100rpx; margin: 0 12rpx;; " @click="chooseFile()"></image>
+							<view v-for="(item,index) in fileArr" :key="index" style="position: relative;">
+								<view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">{{item.name}}
+									<!-- <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
+									</image> -->
+
+								</view>
+
+								<view @click="removeFile(index)"
+									style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
+									<uni-icons type="close" color="darkgray" size="18"></uni-icons>
+								</view>
+							</view>
+						</view>
+					</view>
+				</view>
+
+
+
+
+				<SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
+					subtitleKey="id" v-model="name"></SelectPicker>
+
+
+				<SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
+					titleKey="dictLabel" subtitleKey="dictValue" v-model="dictLabel"></SelectPicker>
+			</view>
+
+			<view class="background">
+				<view>
+					<view class="uni-list">
+						<view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
+							{{objValue.value}}
+
+							<span
+								style="color: blue;font-size: 14px;  display: flex;justify-content:flex-end; margin-right: 15px;"
+								@click="history">历史</span>
+						</view>
+						<view class="container">
+
+							<view>
+								施工时间
+							</view>
+							<view style="margin-top: 10;" @click="openDatetimePicker()">
+								<span style="color: black;">{{time}}</span>
+							</view>
+						</view>
+
+
+
+
+						<view v-for="(a,index) in czggslList" :key="index">
+							<view class="container">
+								<view>
+									材质
+								</view>
+								<view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('cz',index)">
+									<span style="color: black;">{{a.cz.id==''?'请选择材质':a.cz.name}}</span>
+								</view>
+
+							</view>
+							<view class="container">
+
+								<view>
+									规格
+								</view>
+
+								<view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('gg',index)">
+									<span style="color: black;">{{a.gg.id==''?'请选择规格':a.gg.name}}</span>
+								</view>
+							</view>
+							<view class="container">
+
+								<text>数量</text>
+								<input class="uni-input" type="number" v-model="a.sl" placeholder="请填写数量" maxlength="11"
+									style="margin-left: 10px;text-align: right;"></input>
+							</view>
+							<button v-if="index!=0" @click="this.czggslList.splice(index,1)">删除</button>
+						</view>
+						<button
+							@click="this.czggslList.push({cz:{id: '',name: ''},gg:{id: '',name: ''},sl:''})">添加</button>
+
+					</view>
+
+					<view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
+						<view class="container" style="color: gainsboro;">*请上传照片</view>
+						<view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
+							<image src="/static/images/chooseimg.png" mode=""
+								style="width: 100rpx; height: 100rpx; margin: 0 12rpx;; " @click="choose()"></image>
+							<view v-for="(item,index) in imgArr" :key="index" style="position: relative;">
+								<view
+									v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' ">
+									<image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
+										@click="showPhoto(index)">
+									</image>
+								</view>
+								<view v-else>
+									<video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
+								</view>
+								<view @click="remove(index)"
+									style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
+									<uni-icons type="close" color="darkgray" size="18"></uni-icons>
+								</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			<view class="action-btn">
+				<button @click="submit" class="btn cu-btn block bg-blue lg round">确认上传</button>
+			</view>
+
+			<bottom-sheet ref="refShare" :data="historyList"></bottom-sheet>
+			<yt-dateTimePicker ref="myPicker" @submit="handleSubmit" :start-year="2024" :end-year="2099"
+				:time-hide="[true, true, true, true, true, true]" :time-label="['年', '月', '日', '时', '分', '秒']" />
+		</view>
+	</template>
+
+
+
+	<script>
+		import SelectPicker from '../../components/selectPicker/select_picker.vue'
+		import bottomSheet from '../../components/bottomSheet/bottomSheet.vue'
+
+		import uniIcons from '../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
+		import {
+			getDicts
+		} from "@/api/system/dict/data";
+		import {
+			getEnginMaterialQualityList,
+			getEnginSpecificationsList,
+			getRoomProjectList,
+			getRoomProjectId,
+			Submitengineering,
+		} from '@/api/common'
+		import {
+			getToken
+		} from '../../utils/auth';
+
+		import {
+			getUserProfile
+		} from "@/api/system/user"
+
+		export default {
+			components: {
+				SelectPicker,
+				uniIcons,
+				bottomSheet,
+			},
+			data() {
+
+
+				return {
+					zEngineeringMaterialBo: [], //给后台传的值  用料列表
+					czggslList: [{
+						cz: {
+							id: '',
+							name: ''
+						},
+						gg: {
+							id: '',
+							name: ''
+						},
+						sl: ''
+					}, ],
+					conLists: [],
+					headers: {
+						Authorization: "Bearer " + getToken()
+					},
+					time: '', //施工时间
+					user: {
+						nickName: "",
+						phonenumber: "",
+						email: "",
+						sex: ""
+					},
+					loading: false,
+					loadingFile: false,
+					projectType: {}, //工程类型
+					open: false,
+					objValue: '', //上一页面传过来的值  新增接口用
+					openDict: false,
+					specificationValue: {}, //规格
+					projectContent: '', //施工内容
+					materialValue: {}, //材质
+					selectList: [],
+					dictOptions: [],
+					imgArr: [],
+					fileArr: [],
+					fileNameArr: [],
+					type: '',
+					jlPhoneValue: '', //监理电话
+					jlfzrValue: '', //监理负责人
+					jldwValue: '', //监理单位
+					sjPhoneValue: '', //设计电话
+					sjfzrValue: '', //设计负责人
+					sjdwValue: '', //设计单位
+					xcfzrValue: '', //现场负责人
+					xmfzrValue: '', //项目负责人
+					jsdwValue: '', //建设单位
+					projectName: '', //工程名称
+					SelectIndex: '', //选择的索引值
+
+				}
+			},
+
+			created() {
+				this.getUser();
+				this.time = this.traversalTime(new Date().getTime()) //在data里定义变量-nowTime
+				console.log(this.time)
+			},
+
+			onLoad(options) {
+				if ('params' in options) {
+					this.objValue = JSON.parse(decodeURIComponent(options.params));
+					if (this.objValue.enginType == `old_renovation`) {
+						this.title = '旧改工程-庭院'
+
+					} else if (this.objValue.enginType == `new_built`) {
+						this.title = '新建工程-庭院'
+					}
+
+					uni.setNavigationBarTitle({
+						title: this.title
+					})
+				}
+
+
+			},
+			methods: {
+				//判断是否选择
+
+				isEmpty(str) {
+
+					return (!str || 0 === str.length);
+
+				},
+
+				handleSubmit(e) {
+
+					this.time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
+
+				},
+
+				//获取当前时间
+				traversalTime(timestamp) {
+					//timestamp(时间戳)是整数,否则要parseInt转换
+					let time = new Date(timestamp);
+					let y = time.getFullYear();
+					let m = time.getMonth() + 1;
+					let d = time.getDate();
+					let h = time.getHours();
+					let mm = time.getMinutes();
+					let s = time.getSeconds();
+					return y + '-' + this.addTimes(m) + '-' + this.addTimes(d) + ' ' + this.addTimes(h) + ':' + this.addTimes(
+						mm) + ':' + this.addTimes(s);
+
+
+				},
+				addTimes(m) {
+					return m < 10 ? '0' + m : m
+				},
+				// 打开picker
+				openDatetimePicker() {
+					this.$refs.myPicker.show();
+				},
+
+				// 关闭picker
+				closeDatetimePicker() {
+					this.$refs.myPicker.hide();
+				},
+				getUser() {
+					getUserProfile().then(response => {
+						this.user = response.data.user
+					})
+				},
+				pickerShow(e, index) {
+					this.SelectIndex = index;
+					this.type = e; //赋值类型
+					if (e == 'cz') { //材质
+						this.open = true;
+						getEnginMaterialQualityList("民用工程").then(response => {
+							this.selectList = response.data;
+						});
+
+					} else if (e == 'gg') { //规格
+						if (this.isEmpty(this.czggslList[index].cz.id)) {
+							this.$modal.msg('请选择材质')
+							//	this.czggslList[index].cz = this.materialValue.id
+						} else {
+							this.open = true;
+							this.selectList = this.materialList;
+
+						}
+
+					} else if (e == 'gclx') { //工程类型
+						this.openDict = true;
+						getDicts("industry_engin_type").then(response => {
+							this.dictOptions = response.data;
+						});
+					}
+
+
+
+				},
+
+				chooseFile() {
+					let _this = this;
+					console.log('文件')
+					uni.chooseMessageFile({
+						// sizeType: ['album', 'camera'],
+						type: 'all',
+						success(resp) {
+							resp.tempFiles.forEach((item, index) => {
+								const task = uni.uploadFile({
+									url: _this.$HTTP + `/obs`,
+									filePath: item.path,
+									name: 'file',
+									formData: {},
+									header: _this.headers,
+
+									success: res => {
+										// 判断是否json字符串,将其转为json格式
+										console.log("结果", res)
+										// let data = _this.$u.test.jsonString(res
+										// 	.data) ? JSON.parse(res.data) : res.data;
+										let data = JSON.parse(res.data);
+										if (![200].includes(data.code)) {
+											// this.uploadError(index, data);
+											_this.$modal.msg(data.msg)
+										} else {
+											if (_this.progress === 100) {
+												console.log('_this.progress', _this.progress)
+												//console.log('data----', data)data
+												console.log('res--', res)
+												_this.fileArr.push({
+													'name': item.name,
+													'url': data.data.url
+												})
+												_this.fileNameArr.push(item.name)
+												console.log('fileArr', _this.fileArr)
+												_this.$modal.msg('上传成功!')
+											}
+										}
+									},
+									fail: e => {
+										console.log(e)
+										_this.$modal.msg('上传失败!')
+										//_this.uploadError(index, e);
+									},
+									complete: res => {
+										uni.hideLoading();
+										_this.uploading = false;
+
+									}
+								});
+								task.onProgressUpdate(res => {
+									_this.progress = res.progress;
+									console.log('onProgressUpdate', res)
+									console.log('task.onProgressUpdate', _this.progress)
+									uni.showLoading({
+										title: '上传中'
+									})
+									if (_this.progress != 100) {
+										_this.loading = false
+										console.log('_this.loading false', _this.loading)
+									} else {
+										_this.loading = true
+										console.log('_this.loading true', _this.loading)
+									}
+								});
+
+							})
+
+						},
+					})
+				},
+				showPhoto(index) {
+					uni.previewImage({
+						current: index,
+						urls: this.imgArr,
+					})
+
+				},
+				removeFile(index) {
+					uni.showModal({
+						title: '提示',
+						content: '是否删除该文件?',
+						success: (res) => {
+							if (res.confirm) {
+								this.fileArr.splice(index, 1)
+								this.fileNameArr.splice(index, 1)
+								console.log('this.fileArr', this.fileArr)
+
+							}
+						}
+					})
+				},
+				remove(index) {
+					uni.showModal({
+						title: '提示',
+						content: '是否删除该图片或视频?',
+						success: (res) => {
+							if (res.confirm) {
+								this.imgArr.splice(index, 1)
+								console.log('this.imgarr', this.imgArr)
+								// if (this.imgArr.length <= 0) {
+								// 	this.photo = true;
+								// }
+							}
+						}
+					})
+				},
+				choose() {
+					let _this = this;
+					uni.showActionSheet({
+						title: '上传',
+						itemList: ['图片', '视频'],
+						success: (res) => {
+							console.log(res)
+							if (res.tapIndex == 0) {
+								this.chooseimage()
+							} else {
+								this.choosevideo()
+							}
+						}
+					})
+				},
+				chooseimage() {
+
+					let _this = this;
+					console.log('图片', _this.headers)
+					uni.chooseImage({
+						sizeType: ['album', 'camera'],
+						success(resp) {
+							resp.tempFiles.forEach((item, index) => {
+								const task = uni.uploadFile({
+									url: _this.$HTTP + `/obs`,
+									filePath: item.path,
+									name: 'file',
+									formData: {},
+									header: _this.headers,
+
+									success: res => {
+										// 判断是否json字符串,将其转为json格式
+										console.log("结果", res)
+										// let data = _this.$u.test.jsonString(res
+										// 	.data) ? JSON.parse(res.data) : res.data;
+										let data = JSON.parse(res.data);
+										if (![200].includes(data.code)) {
+											// this.uploadError(index, data);
+											_this.$modal.msg(data.msg)
+										} else {
+											if (_this.progress === 100) {
+												console.log('_this.progress', _this.progress)
+												//console.log('data----', data)data
+												console.log('res--', res)
+												_this.imgArr.push(data.data.url)
+												console.log('imgArr', _this.imgArr)
+												_this.$modal.msg('上传成功!')
+												//_this.photo = false;
+											}
+										}
+									},
+									fail: e => {
+										console.log(e)
+										_this.$modal.msg('上传失败!')
+										//_this.uploadError(index, e);
+									},
+									complete: res => {
+										uni.hideLoading();
+										_this.uploading = false;
+
+									}
+								});
+								task.onProgressUpdate(res => {
+									_this.progress = res.progress;
+									console.log('onProgressUpdate', res)
+									console.log('task.onProgressUpdate', _this.progress)
+									uni.showLoading({
+										title: '上传中'
+									})
+									if (_this.progress != 100) {
+										_this.loading = false
+										console.log('_this.loading false', _this.loading)
+									} else {
+										_this.loading = true
+										console.log('_this.loading true', _this.loading)
+									}
+								});
+
+							})
+
+						},
+					})
+				},
+
+				choosevideo() {
+					let _this = this;
+					console.log('视频')
+					uni.chooseVideo({
+						sourceType: ['album', 'camera'],
+						maxDuration: 30,
+						success(resp) {
+							const task = uni.uploadFile({
+								url: _this.$HTTP + `/obs`,
+								filePath: resp.tempFilePath,
+								name: 'file',
+								formData: {},
+								header: _this.headers,
+								success: res => {
+									// 判断是否json字符串,将其转为json格式
+									let data = JSON.parse(res.data);
+									if (![200].includes(res.statusCode)) {
+										this.uploadError(index, data);
+									} else {
+										//上传成功
+										if (_this.progress === 100) {
+											console.log('_this.progress', _this.progress)
+											_this.imgArr.push(data.data.url)
+											console.log('imgArr', _this.imgArr)
+											_this.$modal.msg('上传成功!')
+											//_this.photo = false;
+										}
+									}
+								},
+								fail: e => {
+									_this.$modal.msg('上传失败!')
+									this.uploadError(index, e);
+								},
+								complete: res => {
+									uni.hideLoading();
+									_this.uploading = false;
+								}
+							});
+							task.onProgressUpdate(res => {
+								_this.progress = res.progress;
+								console.log('onProgressUpdate', res)
+								uni.showLoading({
+									title: '上传中'
+								})
+								if (_this.progress != 100) {
+									_this.loadingFile = false
+									console.log('_this.loading false', _this.loading)
+								} else {
+									_this.loadingFile = true
+									console.log('_this.loading true', _this.loading)
+								}
+							});
+
+						},
+					})
+				},
+
+				changeSelectDict(item, index) {
+					this.openDict = false;
+					this.projectType = item
+
+				},
+				changeSelect(item, index) {
+					// this.index = index;
+					// this.address = item.communityName;
+					this.open = false;
+
+					if (this.type == 'cz') {
+						this.materialValue = item;
+						this.specificationValue = ''; //重置规格
+						//根据材质ID 获取规格数据
+						getEnginSpecificationsList(item.id).then(res => {
+							this.materialList = res.data
+							this.czggslList[this.SelectIndex].cz.id = this.materialValue.id
+							this.czggslList[this.SelectIndex].cz.name = this.materialValue.name
+						})
+					} else if (this.type == 'gg') {
+						this.specificationValue = item;
+						this.czggslList[this.SelectIndex].gg.id = this.specificationValue.id
+						this.czggslList[this.SelectIndex].gg.name = this.specificationValue.name
+					} else if (this.type == 'gclx') {
+						this.projectType = item
+					}
+				},
+				//关闭弹窗
+				close(e) {
+					this.open = false
+				},
+				//关闭弹窗
+				closeDict(e) {
+					this.openDict = false
+				},
+
+
+
+
+				submit() {
+
+					console.log("文件", this.fileArr)
+					if (this.isEmpty(this.projectType.dictValue)) {
+						this.$modal.msg('请选择工程类型')
+						return
+					}
+					if (this.isEmpty(this.projectName)) {
+						this.$modal.msg('工程名称不能为空')
+						return
+					}
+					if (this.isEmpty(this.jsdwValue)) {
+						this.$modal.msg('建设单位不能为空')
+						return
+					}
+					if (this.isEmpty(this.xmfzrValue)) {
+						this.$modal.msg('项目负责人不能为空')
+						return
+					}
+					if (this.isEmpty(this.xcfzrValue)) {
+						this.$modal.msg('现场负责人不能为空')
+						return
+					}
+					if (this.isEmpty(this.sjdwValue)) {
+						this.$modal.msg('设计单位不能为空')
+						return
+					}
+					if (this.isEmpty(this.sjfzrValue)) {
+						this.$modal.msg('设计负责人不能为空')
+						return
+					}
+					if (this.isEmpty(this.sjPhoneValue)) {
+						this.$modal.msg('设计联系电话不能为空')
+						return
+					}
+					if (!this.$validation.mobile(this.sjPhoneValue)) {
+						this.$modal.msg('设计联系电话格式错误')
+						return
+					}
+					if (this.isEmpty(this.jldwValue)) {
+						this.$modal.msg('监理单位不能为空')
+						return
+					}
+					if (this.isEmpty(this.jlfzrValue)) {
+						this.$modal.msg('监理负责人不能为空')
+						return
+					}
+					if (this.isEmpty(this.jlPhoneValue)) {
+						this.$modal.msg('监理联系电话不能为空')
+						return
+					}
+					if (!this.$validation.mobile(this.jlPhoneValue)) {
+						this.$modal.msg('监理联系电话格式错误')
+						return
+					}
+
+					if (this.fileArr.length <= 0) {
+						this.$modal.msg('请上传文件')
+					} else if (this.loadingFile == false) {
+						this.$modal.msg('文件未上传完毕,无法提交!')
+					}
+
+					try {
+						//console.log("刚开始", this.czggslList);
+						this.czggslList.forEach((list) => {
+							if (this.isEmpty(list.cz.id)) {
+								this.$modal.msg('材质不能为空')
+
+
+								throw new Error('End Loop')
+
+							}
+							if (this.isEmpty(list.gg.id)) {
+								this.$modal.msg('规格不能为空')
+								throw new Error('End Loop')
+
+							}
+							if (this.isEmpty(list.sl)) {
+								this.$modal.msg('数量不能为空')
+
+								throw new Error('End Loop')
+
+							}
+
+
+
+						})
+					} catch (e) {
+						if (e.message === 'End Loop') throw e
+					}
+
+					if (this.imgArr.length <= 0) {
+						this.$modal.msg('请上传照片或视频')
+						return
+					}
+					if (this.loading == false) {
+						this.$modal.msg('照片或视频未上传完毕,无法提交!')
+						return
+					}
+
+					this.czggslList.forEach((list) => {
+							this.zEngineeringMaterialBo.push({
+								materialQuality: list.cz.id,
+								specifications: list.gg.id,
+								number: list.sl
+							})
+						}),
+
+						console.log("数据", this.zEngineeringMaterialBo)
+
+					let param = {
+						files: this.fileArr, //文件
+						type: '1', // 用来区分工业工程=1、市政工程=2
+						enginName: this.projectName, //工程名称
+						enginType: this.projectType.dictValue, // 工程类型
+						constructUnit: this.jsdwValue, // 建筑单位
+						projectHead: this.xmfzrValue, // 项目负责人
+						sceneHead: this.xcfzrValue, // 现场负责人
+						designUnit: this.sjdwValue, // 设计单位
+						designHead: this.sjfzrValue, // 设计负责人
+						designPhone: this.sjPhoneValue, // 设计联系电话
+						supervisionUnit: this.jldwValue, // 监理单位
+						supervisionHead: this.jlfzrValue, // 监理负责人
+						supervisionPhone: this.jlPhoneValue, // 监理联系电话
+						enginClassification: this.objValue.value, // 工程分类  上一页面传过来的
+						zEngineeringNodeBo: {
+							type: '工业工程', // 写死
+							zEngineeringInfoBo: {
+								zEngiineeringPhotoBoList: this.imgArr, //照片集合
+								zEngineeringMaterialBo: this.zEngineeringMaterialBo // 用料对象
+							}
+						}
+
+					}
+					Submitengineering(param).then(res => {
+						if (res.code == '200') {
+							uni.showToast({
+								title: res.msg,
+								icon: 'none',
+								//显示持续时间为 3秒
+								duration: 2000
+							});
+							setTimeout(function() {
+								uni.navigateBack();
+							}, 1000)
+
+						}
+					})
+
+				}
+
+
+			}
+		}
+	</script>
+
+	<style>
+		.container {
+			display: flex;
+			margin-left: 10px;
+			margin-top: 10px;
+			margin-right: 10px;
+			align-items: flex-start;
+			justify-content: space-between;
+		}
+
+		.text {
+			font-size: 16px;
+			color: #333;
+		}
+
+		.background {
+			border: 15px solid hsla(0, 0%, 100%, .5);
+			background: white;
+			background-clip: padding-box;
+			/*从padding开始往外面裁剪背景*/
+
+		}
+
+		.btn {
+			margin-top: 40px;
+			margin-right: 20px;
+			margin-bottom: 120px;
+			margin-left: 20px;
+			height: 45px;
+		}
+
+		.number {
+			display: flex;
+			/* 水平居中显示子元素 */
+			align-items: flex-start;
+			/* 垂直居中显示子元素 */
+			justify-content: space-between;
+			/* 左右间距等于间距大小 */
+			padding: 10px;
+			/* 设置padding以提高视觉效果 */
+		}
+
+		.textarea {
+			margin-top: 10upx;
+			width: 100%;
+			border: 1rpx solid red;
+			min-height: 100upx;
+			line-height: 20px;
+		}
+
+		page {
+			background: #f2f2f2;
+		}
+
+		.flex-x {
+			display: flex;
+			align-items: center;
+		}
+
+		.template_title,
+		.template_title1,
+		.template_title_list {
+			height: 90rpx;
+			background: #fff;
+			justify-content: space-between;
+			padding: 0 30rpx;
+			box-sizing: border-box;
+		}
+
+		.template_title1 {
+			background: none;
+		}
+
+		.template_title_list {
+			margin-bottom: 4rpx;
+		}
+
+		.template_title>view,
+		.template_title1>view {
+			font-size: 32rpx;
+			color: #8f8f8f;
+			flex-shrink: 0;
+			margin-right: 20rpx;
+		}
+
+		.template_title>input {
+			font-size: 28rpx;
+			color: #808080;
+			text-align: right;
+			flex-grow: 1;
+		}
+
+		/* 添加内容 */
+
+		.add_con>text {
+			font-size: 40rpx;
+			color: #f16765;
+			display: block;
+			margin-right: 20rpx;
+			margin-left: 10rpx;
+			line-height: 44rpx;
+		}
+
+		.add_con>view {
+			font-size: 32rpx;
+			color: #7885cb;
+		}
+
+		/* 删除内容 */
+
+		.del {
+			font-size: 32rpx;
+			color: #f16765;
+			margin-right: 14rpx;
+			padding: 20rpx;
+		}
+
+		input {
+			flex-grow: 1;
+			font-size: 28rpx;
+			color: #808080;
+		}
+
+		.btn {
+			margin-top: 100rpx;
+		}
+	</style>

+ 0 - 3
pages/oldrenovation/courtyard/courtyard.vue

@@ -246,9 +246,6 @@
 						email: "",
 						sex: ""
 					},
-					startDate: '2022-02-04',
-					endDate: '2025-02-04',
-					mode: 4,
 					type: '',
 					open: false,
 					objValue: '', //上一页面传过来的值  新增接口用

+ 3 - 1
pages/oldrenovation/indoor/indoor.vue

@@ -983,7 +983,7 @@
 					} else {
 						//提交
 						let param = ';'
-						if (this.objValue.enginClassValue == '拆旧管'||this.objValue.enginClassValue == '打孔') { //拆旧管  打孔
+						if (this.objValue.enginClassValue == '拆旧管' || this.objValue.enginClassValue == '打孔') { //拆旧管  打孔
 							param = {
 								district: this.XZQValue.dictValue,
 								areaId: this.XQValue.id,
@@ -1124,6 +1124,8 @@
 							unitId: this.DYValue.id, // 单元id
 							houseId: this.FJValue.id, // 房间id
 							enginCycle: this.projectValue.dictValue, // 工程周期
+							enginType: this.objValue.enginType, //写死 上一页面传过来的
+							enginClassification: this.objValue.enginClassification, //写死  上一页面传过来的  //室内 - 庭院 - 架空
 						}
 						getRoomProjectId(param).then(res => {
 

+ 53 - 31
pages/work/index.vue

@@ -25,7 +25,7 @@
 
 
 				<uni-grid-item>
-					<view class="grid-item-box" >
+					<view class="grid-item-box" @click="showGongYe">
 						<uni-icons type="staff-filled" size="30"></uni-icons>
 						<text class="text">工业工程</text>
 					</view>
@@ -122,6 +122,7 @@
 				showPopup: false,
 				shareState: false,
 				array: [],
+				projectType: '', //工程类型
 				OldProjectList: '', //旧改工程
 				NewProjectList: '', //民用工程
 				typeList: '', //二次弹窗数据
@@ -161,6 +162,7 @@
 				this.$modal.showToast('模块建设中~')
 			},
 			showMinYong() {
+				this.projectType = 'MinYong';
 				getDicts("old_renovation").then(response => {
 					this.OldProjectList = response.data;
 				});
@@ -241,45 +243,65 @@
 				this.handleShowSheet();
 			},
 
-
-
-
-
-
 			//二次弹窗 选择类型
 			showTypeSheet(item) {
-				this.showPopup = !this.showPopup; //隐藏第一次弹窗
-				this.enginClassValue = item.dictValue; //二次节点赋值
-				const obj = {
-					enginClassValue: this.enginClassValue, //(拆旧管等 字典值)
-					enginType: this.enginType, //旧改 还是新建  写死
-					enginClassification: this.enginClassification //室内  庭院  架空
-
-				};
-				console.log(obj)
-				this.handleHiddenShare();
-				// 室内
-				if (this.enginClassification == 'indoor_engin') {
-					uni.navigateTo({
-						url: '/pages/oldrenovation/indoor/indoor?params=' + encodeURIComponent(JSON.stringify(
-							obj))
-					})
-				}
-				// 庭院
-				else if (this.enginClassification == 'courtyard') {
+				if (this.projectType == 'MinYong') {
+					this.showPopup = !this.showPopup; //隐藏第一次弹窗
+					this.enginClassValue = item.dictValue; //二次节点赋值
+					const obj = {
+						enginClassValue: this.enginClassValue, //(拆旧管等 字典值)
+						enginType: this.enginType, //旧改 还是新建  写死
+						enginClassification: this.enginClassification //室内  庭院  架空
+
+					};
+					console.log(obj)
+					this.handleHiddenShare();
+					// 室内
+					if (this.enginClassification == 'indoor_engin') {
+						uni.navigateTo({
+							url: '/pages/oldrenovation/indoor/indoor?params=' + encodeURIComponent(JSON.stringify(
+								obj))
+						})
+					}
+					// 庭院
+					else if (this.enginClassification == 'courtyard') {
+						uni.navigateTo({
+							url: '/pages/oldrenovation/courtyard/courtyard?params=' + encodeURIComponent(JSON
+								.stringify(
+									obj))
+						})
+					} else if (this.enginClassification == 'overhead') { //架空
+						uni.navigateTo({
+							url: '/pages/oldrenovation/overhead/overhead?params=' + encodeURIComponent(JSON
+								.stringify(
+									obj))
+						})
+					}
+				} else if (this.projectType == 'GongYe') {
+					console.log("工业", item)
+					let obj = {
+						value: item.dictValue
+					};
+					this.handleHiddenShare();
 					uni.navigateTo({
-						url: '/pages/oldrenovation/courtyard/courtyard?params=' + encodeURIComponent(JSON
+						url: '/pages/enginproject/enginproject?params=' + encodeURIComponent(JSON
 							.stringify(
 								obj))
 					})
-				} else if (this.enginClassification == 'overhead') { //架空
-					uni.navigateTo({
-						url: '/pages/oldrenovation/overhead/overhead?params=' + encodeURIComponent(JSON.stringify(
-							obj))
-					})
 				}
 
+			},
+			showGongYe() {
+				this.projectType = 'GongYe';
+				//工业工程
+				getDicts("engin_classification").then(response => {
+					console.log("工业工程", response.data)
+					this.typeList = response.data;
+
+					console.log("工业工程", response.data)
 
+				});
+				this.handleShowSheet();
 			}
 		}
 	}

+ 3 - 0
plugins/index.js

@@ -1,6 +1,7 @@
 import tab from './tab'
 import auth from './auth'
 import modal from './modal'
+import validation from '@/utils/test.js';
 
 export default {
   install(Vue) {
@@ -10,5 +11,7 @@ export default {
     Vue.prototype.$auth = auth
     // 模态框对象
     Vue.prototype.$modal = modal
+	//校验
+	Vue.prototype.$validation=validation
   }
 }

+ 232 - 0
utils/test.js

@@ -0,0 +1,232 @@
+/**
+ * 验证电子邮箱格式
+ */
+function email(value) {
+	return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
+}
+
+/**
+ * 验证手机格式
+ */
+function mobile(value) {
+	return /^1[3-9]\d{9}$/.test(value)
+}
+
+/**
+ * 验证URL格式
+ */
+function url(value) {
+	return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value)
+}
+
+/**
+ * 验证日期格式
+ */
+function date(value) {
+	return !/Invalid|NaN/.test(new Date(value).toString())
+}
+
+/**
+ * 验证ISO类型的日期格式
+ */
+function dateISO(value) {
+	return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value)
+}
+
+/**
+ * 验证十进制数字
+ */
+function number(value) {
+	return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value)
+}
+
+/**
+ * 验证整数
+ */
+function digits(value) {
+	return /^\d+$/.test(value)
+}
+
+/**
+ * 验证身份证号码
+ */
+function idCard(value) {
+	return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(
+		value)
+}
+
+/**
+ * 是否车牌号
+ */
+function carNo(value) {
+	// 新能源车牌
+	const xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
+	// 旧车牌
+	const creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
+	if (value.length === 7) {
+		return creg.test(value);
+	} else if (value.length === 8) {
+		return xreg.test(value);
+	} else {
+		return false;
+	}
+}
+
+/**
+ * 金额,只允许2位小数
+ */
+function amount(value) {
+	//金额,只允许保留两位小数
+	return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
+}
+
+/**
+ * 中文
+ */
+function chinese(value) {
+	let reg = /^[\u4e00-\u9fa5]+$/gi;
+	return reg.test(value);
+}
+
+/**
+ * 只能输入字母
+ */
+function letter(value) {
+	return /^[a-zA-Z]*$/.test(value);
+}
+
+/**
+ * 只能是字母或者数字
+ */
+function enOrNum(value) {
+	//英文或者数字
+	let reg = /^[0-9a-zA-Z]*$/g;
+	return reg.test(value);
+}
+
+/**
+ * 验证是否包含某个值
+ */
+function contains(value, param) {
+	return value.indexOf(param) >= 0
+}
+
+/**
+ * 验证一个值范围[min, max]
+ */
+function range(value, param) {
+	return value >= param[0] && value <= param[1]
+}
+
+/**
+ * 验证一个长度范围[min, max]
+ */
+function rangeLength(value, param) {
+	return value.length >= param[0] && value.length <= param[1]
+}
+
+/**
+ * 是否固定电话
+ */
+function landline(value) {
+	let reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
+	return reg.test(value);
+}
+
+/**
+ * 判断是否为空
+ */
+function empty(value) {
+	switch (typeof value) {
+		case 'undefined':
+			return true;
+		case 'string':
+			if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
+			break;
+		case 'boolean':
+			if (!value) return true;
+			break;
+		case 'number':
+			if (0 === value || isNaN(value)) return true;
+			break;
+		case 'object':
+			if (null === value || value.length === 0) return true;
+			for (var i in value) {
+				return false;
+			}
+			return true;
+	}
+	return false;
+}
+
+/**
+ * 是否json字符串
+ */
+function jsonString(value) {
+	if (typeof value == 'string') {
+		try {
+			var obj = JSON.parse(value);
+			if (typeof obj == 'object' && obj) {
+				return true;
+			} else {
+				return false;
+			}
+		} catch (e) {
+			return false;
+		}
+	}
+	return false;
+}
+
+
+/**
+ * 是否数组
+ */
+function array(value) {
+	if (typeof Array.isArray === "function") {
+		return Array.isArray(value);
+	} else {
+		return Object.prototype.toString.call(value) === "[object Array]";
+	}
+}
+
+/**
+ * 是否对象
+ */
+function object(value) {
+	return Object.prototype.toString.call(value) === '[object Object]';
+}
+
+/**
+ * 是否短信验证码
+ */
+function code(value, len = 6) {
+	return new RegExp(`^\\d{${len}}$`).test(value);
+}
+
+
+export default {
+	email,
+	mobile,
+	url,
+	date,
+	dateISO,
+	number,
+	digits,
+	idCard,
+	carNo,
+	amount,
+	chinese,
+	letter,
+	enOrNum,
+	contains,
+	range,
+	rangeLength,
+	empty,
+	isEmpty: empty,
+	jsonString,
+	landline,
+	object,
+	array,
+	code
+}