Browse Source

文本拼接中间插入符号的显示调整

jiangyu 3 năm trước cách đây
mục cha
commit
962f0d7f84
2 tập tin đã thay đổi với 21 bổ sung61 xóa
  1. 11 58
      src/components/jc/setTask.vue
  2. 10 3
      src/components/jc/taskdetail.vue

+ 11 - 58
src/components/jc/setTask.vue

@@ -128,47 +128,6 @@
 					</el-col>
 				</el-row>
 				</el-form>
-				<!-- <el-row style="margin-right: 0px;">
-					<el-form ref="form" style="display: flex; flex-direction: row; margin-left: 5px;">
-						<el-form-item label="抽样机构" class="select" size="mini">
-							<el-input v-model="form.bear_unit" @focus="getTestListShow = true"></el-input>
-						</el-form-item>
-						<el-form-item label="检测机构" class="select" size="mini">
-							<el-input v-model="form.check_unit" @focus="getTestListShow2 = true"></el-input>
-						</el-form-item>
-						<el-form-item label="抽样数量" class="select" size="mini">
-							<el-input v-model="form.sample_number"></el-input>
-						</el-form-item>
-						<el-form-item label="报告上传单位" class="select" size="mini">
-							<el-input v-model="form.report_unit" @focus="getTestListShow1 = true"></el-input>
-						</el-form-item>
-					</el-form>
-				</el-row> -->
-				<!-- <el-row style="margin-right: 0px;">
-					<el-col :span="11">
-						<el-form style="display: flex; flex-direction: row; margin-left: 5px; margin-top: 10px;" size="mini">
-							<el-form-item label="抽样地区" class="select">
-								<el-cascader  :options="region" v-model="selectedOptions"
-									@change="handleChange">
-								</el-cascader>
-							</el-form-item>
-							<el-form-item label="报告上传时间:" class="select" >
-								<el-date-picker v-model="form.uploadtime" type="date" value-format="yyyy-MM-dd">
-								</el-date-picker>
-							</el-form-item>
-						</el-form>
-					</el-col>
-					<el-col :span="5" style="margin-top: 10px;">
-						<el-button type="primary" size="mini" plain @click="save('form')">保存
-						</el-button>
-						<!-- <el-button type="primary" size="small" plain icon="el-icon-edit-outline" @click="appear">
-								重置
-							</el-button> -->
-						<!-- <el-button type="primary" size="mini" plain @click="back()">上一步</el-button>
-						<el-button type="primary" size="mini" plain @click="nexto()">下一步</el-button>
-					</el-col>
-				</el-row> --> 
-				
 
 				<!--  表格数据区域-->
 
@@ -187,14 +146,8 @@
 						</template>
 					</el-table-column>
 
-					<el-table-column :key="table.label" v-for="table in tableHeader" :label="table.label"
+				<el-table-column :key="table.label" v-for="table in tableHeader" :label="table.label"
 						:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
-					<!-- <el-table-column label="操作" align="center" fixed="right">
-						<template slot-scope="scope">
-							<el-button type="success" size="small" plain @click="sampleDetail(scope.row.sample_id)">删除
-							</el-button>
-						</template>
-					</el-table-column> -->
 				</el-table>
 				<!--    分页器区域-->
 				<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
@@ -480,16 +433,16 @@
 			async sampleDetail(id) {
 				console.log(id)
 				// 判断任务是否为该创建者创建
-				for (let i = 0; i < this.multipleSelection.length; i++) {
-					if (rybh != this.multipleSelection[i].releaser) {
-						this.$alert('仅创建者可以删除!', {
-							confirmButtonText: '确定',
-							callback: action => {
-
-							}
-						});
-					}
-				}
+				// for (let i = 0; i < this.multipleSelection.length; i++) {
+				// 	if (rybh != this.multipleSelection[i].releaser) {
+				// 		this.$alert('仅创建者可以删除!', {
+				// 			confirmButtonText: '确定',
+				// 			callback: action => {
+
+				// 			}
+				// 		});
+				// 	}
+				// }
 				var that = this;
 				const length = this.multipleSelection.length;
 				// var val = this.selectedData;

+ 10 - 3
src/components/jc/taskdetail.vue

@@ -66,11 +66,11 @@
 		</el-descriptions>
 		<el-descriptions class="margin-top" :size="size" border>
 			<el-descriptions-item>
-
 				<template slot="label">
 					检测对象
 				</template>
-				<span v-for="item in readForm.product">{{item.product_name}}、</span>
+				{{productNameText}}
+				<!-- <span v-for="item in readForm.product">{{item.product_name}}、</span> -->
 			</el-descriptions-item>
 		</el-descriptions>
 		<el-descriptions class="margin-top" :size="size" border>
@@ -78,7 +78,8 @@
 				<template slot="label">
 					检测项
 				</template>
-				<span v-for="item in readForm.pesticides">{{item.test_name}}、</span>
+				{{pesticidesNameText}}
+				<!-- <span v-for="item in readForm.pesticides">{{item.test_name}}、</span> -->
 			</el-descriptions-item>
 		</el-descriptions>
 		<el-table :data="underTask" border stripe highlight-current-row style="width: 100%">
@@ -105,6 +106,8 @@
 				// 机构地域表格数据
 				underTask: [],
 				underTasktotal: 0,
+				productNameText: '',
+				pesticidesNameText: '',
 				tableHeader: [{
 						label: '抽样机构',
 						prop: 'bear_name',
@@ -159,6 +162,10 @@
 					}
 				}
 				this.readForm = res.data
+				console.log(this.readForm)
+				that.productNameText = that.readForm.product.map(el => el.product_name).join('、 ')
+				that.pesticidesNameText = that.readForm.pesticides.map(el => el.test_name).join('、 ')
+				
 			},
 			// 获取机构地域表格
 			async getUnderTask() {