From 6dd2ed2eb744d085130554abed50ca1a98c8c508 Mon Sep 17 00:00:00 2001
From: 李林 <z1292839451@163.com>
Date: 星期一, 21 八月 2023 09:16:52 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/experiment/planAssignments/plan.vue |  255 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 255 insertions(+), 0 deletions(-)

diff --git a/src/views/experiment/planAssignments/plan.vue b/src/views/experiment/planAssignments/plan.vue
new file mode 100644
index 0000000..0d931cc
--- /dev/null
+++ b/src/views/experiment/planAssignments/plan.vue
@@ -0,0 +1,255 @@
+<style scoped>
+	.plan {
+		width: 100%;
+	}
+
+	.title {
+		height: 60px;
+		width: calc(100% - 20px);
+		background-color: white;
+		margin: 5px 10px;
+		display: flex;
+		align-items: center;
+		padding: 0 30px;
+	}
+
+	.thing {
+		margin: 10px;
+		padding: 15px;
+		background-color: white;
+		height: calc(100vh - 15vh);
+	}
+</style>
+<style>
+	.plan .has-gutter tr th {
+		background-color: #f5f7fa !important;
+		color: #333;
+	}
+
+	.plan .cell {
+		color: #333;
+	}
+</style>
+
+<template>
+	<div class="plan">
+		<div class="title">
+			<span>椤圭洰鍚嶇О锛�</span>
+			<el-input v-model="search.name" size="medium" style="width: 200px;margin-right: 20px;"></el-input>
+			<span>妫�楠屾椂闂达細</span>
+			<el-date-picker v-model="search.date" type="daterange" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�"
+				end-placeholder="缁撴潫鏃ユ湡" size="medium" style="margin-right: 20px;">
+			</el-date-picker>
+			<span>妫�楠屼汉锛�</span>
+			<el-input v-model="search.userName" size="medium" style="width: 200px;margin-right: 20px;"></el-input>
+			<el-button size="small" type="primary">鏌ヨ</el-button>
+			<el-button size="small">閲嶇疆</el-button>
+		</div>
+		<div class="thing">
+			<el-table :data="tableData" style="width: 100%;" row-key="id" default-expand-all
+				:tree-props="{children: 'children', hasChildren: 'hasChildren'}" :key="upIndex">
+				<el-table-column type="index" width="50" label="搴忓彿">
+				</el-table-column>
+				<el-table-column prop="date" label="鐢宠鍗曞彿">
+				</el-table-column>
+				<el-table-column prop="name" label="妫�楠岀粨鏋�">
+				</el-table-column>
+				<el-table-column prop="address" label="鍦板潃">
+				</el-table-column>
+				<el-table-column label="鎿嶄綔" width="80">
+					<template slot-scope="scope">
+						<el-button size="mini" type="primary" v-if="isIfReport(scope.row)">涓婃姤</el-button>
+						<el-button size="mini" type="warning" @click="openUpDia(scope.row)"
+							v-else-if="scope.row.insId==undefined&&scope.row.address==null">鍒嗛厤</el-button>
+						<el-button size="mini" type="success" @click="openUpInsDia(scope.row)"
+							v-else-if="scope.row.insId==undefined&&scope.row.name==null">妫�楠�</el-button>
+					</template>
+				</el-table-column>
+			</el-table>
+		</div>
+		<el-dialog title="鍒嗛厤璁惧鍜屼汉鍛�" :visible.sync="upDia" width="500px" top="30vh">
+			<div class="body">
+				<el-row style="line-height: 46px;">
+					<el-col :span="4" style="font-size: 14px;text-align: right;">浜哄憳:</el-col>
+					<el-col :span="16" :offset="1">
+						<el-input v-model="upData.address" size="small" clearable></el-input>
+					</el-col>
+				</el-row>
+			</div>
+			<span slot="footer" class="dialog-footer">
+				<el-button type="primary" @click="submitUpData">纭� 瀹�</el-button>
+				<el-button @click="upDia = false">鍙� 娑�</el-button>
+			</span>
+		</el-dialog>
+		<el-dialog title="妫�楠�" :visible.sync="upInsDia" width="500px">
+			<div class="body" style="max-height: 50vh;overflow-y: auto;">
+				<el-row style="line-height: 46px;">
+					<el-col :span="4" style="font-size: 14px;text-align: right;">鏍峰搧缂栫爜锛�</el-col>
+					<el-col :span="8">{{upData.date}}</el-col>
+					<el-col :span="4" style="font-size: 14px;text-align: right;">鏍峰搧鍚嶇О锛�</el-col>
+					<el-col :span="8">{{upData.date}}</el-col>
+				</el-row>
+				<el-row style="line-height: 46px;">
+					<el-col :span="4" style="font-size: 14px;text-align: right;">妫�楠岄」鐩細</el-col>
+					<el-col :span="8">{{upData.date}}</el-col>
+					<el-col :span="4" style="font-size: 14px;text-align: right;">鍗曚綅锛�</el-col>
+					<el-col :span="8">{{upData.date}}</el-col>
+				</el-row>
+				<el-row style="line-height: 46px;">
+					<el-col :span="4" style="font-size: 14px;text-align: right;">鏍囧噯鍊硷細</el-col>
+					<el-col :span="8">{{upData.date}}</el-col>
+					<el-col :span="4" style="font-size: 14px;text-align: right;">鍐呮帶鍊硷細</el-col>
+					<el-col :span="8">{{upData.date}}</el-col>
+				</el-row>
+				<el-row style="line-height: 46px;">
+					<el-col style="text-align: right;"><el-button size="mini" @click="addRes">娣诲姞妫�楠屽��</el-button></el-col>
+				</el-row>
+				<el-row>
+					<el-col>
+						<el-table :data="upData.res" border style="width: 99.9%;" :key="upIndex2">
+							<el-table-column type="index" width="100" label="搴忓彿">
+							</el-table-column>
+							<el-table-column label="妫�楠屽��">
+								<template slot-scope="scope">
+									<el-input v-model.number="scope.row.number" size="small" clearable placeholder="璇疯緭鍏�"
+										@change="(val)=>scope.row.number = isNaN(val)?null:val">
+									</el-input>
+								</template>
+							</el-table-column>
+							<el-table-column label="鎿嶄綔" width="60">
+								<template slot-scope="scope">
+									<el-button size="mini" type="text"
+										@click.native.prevent="deleteRow(scope.$index, upData.res)">鍒犻櫎</el-button>
+								</template>
+							</el-table-column>
+						</el-table>
+					</el-col>
+				</el-row>
+			</div>
+			<span slot="footer" class="dialog-footer">
+				<el-button type="primary" @click="submitUpData">鎻� 浜�</el-button>
+				<el-button @click="upInsDia = false">鍙� 娑�</el-button>
+			</span>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				search: {
+					name: null,
+					date: [],
+					userName: null,
+				},
+				tableData: [{
+					id: 1,
+					insId: 123,
+					date: '2016-05-02',
+					name: null,
+					address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�',
+					children: [{
+						id: 33,
+						date: '2016-05-01',
+						name: null,
+						res: '[{"number": 1},{"number": 2}]',
+						address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�'
+					}, {
+						id: 34,
+						date: '2016-05-01',
+						name: null,
+						res: '[{"number": 1,"res": "涓嶅悎鏍�"},{"number": 2}]',
+						address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�'
+					}]
+				}, {
+					id: 2,
+					insId: 123,
+					date: '2016-05-04',
+					name: null,
+					address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1517 寮�',
+					children: []
+				}, {
+					id: 3,
+					insId: 123,
+					date: '2016-05-01',
+					children: [{
+						id: 31,
+						date: '2016-05-01',
+						name: null,
+						res: '[{"number": 1},{"number": 2}]',
+						address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�'
+					}, {
+						id: 32,
+						date: '2016-05-01',
+						name: null,
+						res: '[]',
+						address: null
+					}]
+				}],
+				upDia: false,
+				upData: {},
+				upIndex: 0,
+				upInsDia: false,
+				upIndex2: 0
+			}
+		},
+		mounted() {
+			this.selectDataList()
+		},
+		methods: {
+			selectDataList() {
+				this.tableData.forEach(a => {
+					a.code = '[1]'
+					if (a.children != undefined) {
+						a.children.forEach(b => {
+							b.code = '[2]'
+							b.res = JSON.parse(b.res)
+						})
+					}
+				})
+				this.upIndex++
+			},
+			isIfReport(row) {
+				var count = 0
+				if (row.children == undefined) return false
+				row.children.forEach(a => {
+					if (a.name != null && a.name != undefined) count++
+				})
+				return row.insId != undefined && count == row.children.length
+			},
+			openUpDia(row) {
+				this.upDia = true
+				this.upData = {
+					id: row.id,
+					address: row.address
+				}
+			},
+			submitUpData() {
+				this.tableData.forEach(a => {
+					a.children.forEach(b => {
+						if (b.id == this.upData.id) {
+							b.address = this.upData.address
+						}
+					})
+				})
+				this.$message.success('淇敼鎴愬姛')
+				this.upIndex++
+				this.upDia = false
+			},
+			openUpInsDia(row) {
+				this.upInsDia = true
+				this.upData = this.HaveJson(row)
+			},
+			deleteRow(index, rows) {
+				rows.splice(index, 1);
+			},
+			addRes() {
+				this.upData.res.push({
+					"number": null
+				})
+				this.upIndex2++
+			}
+		}
+	}
+</script>
\ No newline at end of file

--
Gitblit v1.9.3