From 52d463e03c1f074099ed8e8a6b7c3ddde52d2708 Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Fri, 27 Oct 2023 14:50:28 +0800
Subject: [PATCH] fix:小程序初版

---
 pages/actionChange/components/rectificationInfor.vue |  243 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 243 insertions(+), 0 deletions(-)

diff --git a/pages/actionChange/components/rectificationInfor.vue b/pages/actionChange/components/rectificationInfor.vue
new file mode 100644
index 0000000..fad999f
--- /dev/null
+++ b/pages/actionChange/components/rectificationInfor.vue
@@ -0,0 +1,243 @@
+<template>
+	<view class="">
+		<!-- ������������ -->
+		<view class="workOrderDetail">
+			<view class="headerCont">
+				<p class="title">������������</p>
+			</view>
+			<u-line color="#bbb" />
+			<view>
+				<view class="mainContent">
+					<u--form labelPosition="left" label-width="80" :model="form" :border-bottom="false" :rules="rules"
+						ref="uForm">
+						<view class="" v-if="pageState">
+							<p class="rowTip">
+								<view class="rowTipContenet">
+									<view class="wholeLine">
+										<text class="rowTipContenetLabel">������������:</text>
+										<text class="rowTipContenetAll">
+											{{ dictObj.yesOrNo[basicInfor.isChange] ||''}}
+										</text>
+									</view>
+								</view>
+								<view class="rowTipContenet">
+									<view class="wholeLine">
+										<text class="rowTipContenetLabel">���������:</text>
+										<text class="rowTipContenetAll">{{ basicInfor.changeName ||''}}</text>
+									</view>
+								</view>
+							</p>
+						</view>
+						<view class="" v-else>
+							<view class="formItemContent">
+								<u-form-item label="������������:" :required="!pageState" :border-bottom="false">
+									<u-radio-group v-model="form.isChange" @change="radioGroupChange">
+										<u-radio :key="index" v-for="(item, index) in list"
+											:custom-style="{marginRight: '8px'}" :label="item.name"
+											:name="item.value" />
+									</u-radio-group>
+								</u-form-item>
+							</view>
+							<view class="formItemContent">
+								<u-form-item label="���������:" prop="changeName" :border-bottom="false"
+									:required="!pageState">
+									<u-input v-model="form.changeName" border="none" placeholder="���������" type="text" />
+								</u-form-item>
+							</view>
+						</view>
+						<view class="formItemContent">
+							<u-form-item label="������������:" prop="changeDescribe" :border-bottom="false"
+								:required="!pageState">
+								<view class="fonttest" v-if="pageState">
+									{{ basicInfor.changeDescribe ||''}}
+								</view>
+								<u--textarea v-else v-model="form.changeDescribe" border="none" />
+							</u-form-item>
+						</view>
+						<view class="formItemContent">
+							<u-form-item label="������������:" :border-bottom="false">
+								<view class="fileBox" v-if="pageState">
+									<cl-upload v-model="fileList" :add="false" :action="`''`" cloud-type="other"
+										:remove="false" />
+								</view>
+								<view class="fileBox" v-else>
+									<fileUpload class="rowTipContenetAll" :sys-code="sysCode"
+										@handleFile="handleFile" />
+								</view>
+							</u-form-item>
+						</view>
+					</u--form>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+	import fileUpload from '../components/fileUpload.vue'
+	export default {
+		components: {
+			fileUpload
+		},
+		props: {
+			basicInfor: {
+				type: Object,
+				default: () => {}
+			},
+		},
+		watch: {
+			basicInfor: {
+				handler: function(newValue, oldValue) {
+					// ������������������
+					this.basicInfor = newValue
+				},
+				deep: true
+			}
+		},
+		computed: {
+			pageState() {
+				return this.basicInfor.pageState === 'view' || this.basicInfor.state >= 30
+			}
+		},
+		data() {
+			return {
+				sysCode: '1010202',
+				list: [{
+					name: '���',
+					value: 0,
+				}, {
+					name: '���',
+					value: 1,
+				}, ],
+				form: {
+					isChange: 0,
+					changeName: '',
+					changeDescribe: '',
+				},
+				dictObj: JSON.parse(uni.getStorageSync('dictObj') || '[]'),
+				fileList: [],
+				fileBaseList: [],
+				baseUrl: this.$storage.get('baseUrl'),
+				rules: {
+					'changeName': {
+						required: true,
+						message: '���������',
+						trigger: ['blur', 'change']
+					},
+					'changeDescribe': {
+						required: true,
+						message: '���������',
+						trigger: ['blur', 'change']
+					},
+				}
+			}
+		},
+		onLoad: function(option) {
+			//option���object������������������������������������������������
+			console.log(option) //���������������������������������������
+		},
+		onReady() {
+			//onReady ���uni-app���������������������������
+			this.$refs.uForm.setRules(this.rules)
+		},
+		mounted() {
+			if (this.basicInfor.fileChangeList && this.basicInfor.fileChangeList.length > 0) {
+				this.basicInfor.fileChangeList.forEach(item => {
+					let name = item.fileType === 1 ? 'name.png' : 'name.mp4'
+					this.fileList.push(`${this.baseUrl}/file/preview/${item.fileId}?${name}`) // ������
+				})
+				console.log('this.fileList', this.basicInfor.fileBaseList)
+				console.log('this.fileList', this.fileList)
+			}
+		},
+		methods: {
+			radioGroupChange(e) {
+				console.log('radioGroupe���e', e)
+			},
+			handleFile(data) {
+				this.fileBaseList = data
+				this.form.fileChangeList = this.fileBaseList
+			},
+			formVali() {
+				return new Promise((resolve, reject) => {
+					if (!this.pageState) {
+						this.$refs.uForm.validate().then(res => {
+							resolve(true)
+						}).catch(errors => {
+							reject(false)
+							uni.$u.toast('������������')
+						})
+					} else {
+						resolve(true)
+					}
+				})
+			}
+		},
+	}
+</script>
+<style scoped lang="scss">
+	/deep/.u-line {
+		margin: 19.23rpx 0px !important;
+	}
+
+	.workOrderDetail {
+		border: 1px solid #bbb;
+		border-radius: 5px;
+		margin: 19.23rpx;
+		padding: 19.23rpx;
+		color: #101010;
+		font-weight: 700;
+		font-size: 30.77rpx;
+
+		.headerCont {
+			display: flex;
+			justify-content: space-between;
+			font-size: 30.77rpx;
+		}
+
+		.mainContent {
+			margin-bottom: 10px;
+			font-weight: 500;
+
+			.rowTip {
+				display: flex;
+				padding: 5px 0;
+				border-bottom: 1px dashed #bbb;
+
+				.wholeLine {
+					display: flex;
+					width: 100%;
+					align-items: center;
+
+					.rowTipContenetLabel {
+						min-width: 144.23rpx;
+						font-size: 28.85rpx;
+						text-align: left;
+					}
+
+					.rowTipContenetAll {
+						font-size: 28.85rpx;
+						width: calc(100% - 144.23rpx);
+					}
+				}
+
+				.rowTipContenet {
+					width: 50%;
+					text-align: left;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					white-space: nowrap;
+
+					.butsName {
+						display: inline-block;
+						margin-left: 19.23rpx;
+						color: #1990ff;
+					}
+				}
+			}
+
+			.rowTipContenet_right {
+				text-align: right !important;
+			}
+		}
+	}
+</style>
\ No newline at end of file

--
Gitblit v1.8.0