jiangyu 3 năm trước cách đây
mục cha
commit
467a090e79
2 tập tin đã thay đổi với 67 bổ sung33 xóa
  1. 18 11
      src/components/jc/fillSampleReport.vue
  2. 49 22
      src/components/jc/setTaskcd.vue

+ 18 - 11
src/components/jc/fillSampleReport.vue

@@ -88,7 +88,7 @@
 					<el-form-item label="抽样地点:" prop="sample_address" class="labelItem">	
 						<el-cascader placeholder="请选择地区" :options="options" v-model="selectedOptions1" @change="handleChange1" style="width:15%">
 						</el-cascader>
-						<el-input v-model="sample_unit.sample_address2" placeholder="请输入详细地址" style="width:26.5%;margin-left:5px;"></el-input>
+						<el-input v-model="sample_unit.sample_address2" placeholder="请输入详细地址" style="width:24.5%;margin-left:5px;"></el-input>
 				</el-form-item>
 
 				<el-form-item label="抽样人员1:" prop="sample_person_one" class="labelItem">
@@ -98,7 +98,7 @@
 					<el-input v-model="sample_unit.sample_person_two" style="width:40%"></el-input>
 				</el-form-item>
 				<el-form-item label="抽样单日期:" prop="cyd_date" class="labelItem">
-					<el-date-picker v-model="sample_unit.cyd_date" style="width: 42%;" align="right" type="date"
+					<el-date-picker v-model="sample_unit.cyd_date" style="width: 40%;" align="right" type="date"
 						:picker-options="pickerOptions" clearable />
 				</el-form-item>
 				<el-form-item label="备注:" prop="cyd_log" class="labelItem">
@@ -106,17 +106,16 @@
 				</el-form-item>
 			</el-form>
 			<el-form>
-				<el-form-item label="抽样单报告上传:" prop="releaser" class="labelItem">
+				<el-form-item label="抽样单报告上传:" prop="sample_unit" class="labelItem">
 					<el-upload
 						class="upload-demo"
 						:headers="myHeaders"
-						action='http://new.syjc.com/api/v1'
+						action='http://new.syjc.com/api/v1/ossUpload'
 						:on-preview="handlePreview"
 						:on-remove="handleRemove"
 						:before-remove="beforeRemove"
+						:on-success="uploadSuccess"
 						multiple
-						:limit="10"
-						:on-exceed="handleExceed"
 						:file-list="fileList">
 						<el-button size="small" type="primary">点击上传</el-button>
 						<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
@@ -329,7 +328,9 @@
 					sample_person_one: '',
 					sample_person_two: '',
 					cyd_date: '',
-					cyd_log: ''
+					cyd_log: '',
+					file_url: '',
+					file_name: ''
 				},//填报抽样单最后一步
 				units: [],
 				production: [],
@@ -526,12 +527,18 @@
 			handlePreview(file) {
 				console.log(file);
 			},
-			handleExceed(files, fileList) {
-				this.$message.warning(`当前限制选择 10 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
-			},
 			beforeRemove(file, fileList) {
 				return this.$confirm(`确定移除 ${ file.name }?`);
 			},
+
+			// 上传成功
+			uploadSuccess(res) {
+				console.log(res.data)
+				this.sample_unit.file_url = res.data.fileUrl
+				this.sample_unit.file_name = res.data.fileName
+				console.log(this.sample_unit.file_url)
+				console.log(this.sample_unit.file_name)
+			},
 			//填报抽样单样品信息分页
 			handleSizeChange(val) {
 				this.queryInfo.pageSize = val;
@@ -670,7 +677,7 @@
 		left:135px;
 	}
 		.el-upload__tip{
-			margin-left: 8.125rem;
+			margin-left: 7.5rem;
 		}
 		.el-upload-list__item-name{
 			margin-left: 7.8125rem

+ 49 - 22
src/components/jc/setTaskcd.vue

@@ -185,7 +185,9 @@
 							<template slot-scope="scope">
 								<el-button style="margin:5px 5px" type="success" size="small" plain @click="sampleDetail(scope.row.id)">查看
 								</el-button>
-								<el-button style="margin:5px 5px" type="primary" size="small" plain icon="el-icon-edit-outline" @click="putCydStatus(scope.row.id)">上报抽样信息
+								<el-button style="margin:5px 5px" type="primary" size="small" plain icon="el-icon-edit-outline" v-if="scope.row.cyd_status == 1" @click="putCydStatus(scope.row.id)">上报抽样信息
+								</el-button>
+								<el-button style="margin:5px 5px" type="primary" size="small" plain icon="el-icon-edit-outline" v-else>抽样信息已上报
 								</el-button>
 							</template>
 						</el-table-column>
@@ -231,7 +233,9 @@
 							<el-button style="margin:5px 5px" type="success" size="mini" v-if="scope.row.jc_value_id==null" plain
 								@click="getJcdObj(scope.row.id)">填报检测单</el-button>
 							<el-button style="margin:5px 5px" type="primary" v-else size="mini" plain @click="update(scope.row)">修改</el-button>
-							<el-button style="margin:5px 5px" type="primary" size="mini" plain @click="upJcdItem(scope.row.sample_id)">上报
+							<el-button style="margin:5px 5px" type="primary" size="mini" plain @click="upJcdItem(scope.row.sample_id)" v-if="scope.row.cyd_status == 1">上报检测单
+							</el-button>
+							<el-button style="margin:5px 5px" type="primary" size="mini" plain @click="upJcdItem(scope.row.sample_id)" v-else>检测单已上报
 							</el-button>
 							<!-- <el-button style="margin:5px 5px" type="primary" size="mini" plain @click="creatpdf(scope.row.sample_id)">生成检测报告
 							</el-button> -->
@@ -251,17 +255,23 @@
 				class="dialogItem">
 
 
-			<div id="" style="margin:10px auto; width:100%">
+			<div id="inputJcd" style="margin:10px 50px; width:100%">
 				<el-form :rules="rules" :model="jcd">
+					<el-row>
+					<el-col :span="10">
 					<el-form-item label="检测单编码:" prop="jcd_code" class="labelItem">	
-							<el-input v-model="jcd.jcd_code" placeholder="请输入检测单编码" style="width:26.5%;margin-left:5px;"></el-input>
+							<el-input v-model="jcd.jcd_code" placeholder="请输入检测单编码" style="width:50%;margin-left:5px;"></el-input>
 					</el-form-item>
+					</el-col>
+					<el-col :span="6">
 					<el-form-item label="检测结果:" prop="jcd_result" class="labelItem">
 						<el-radio-group v-model="jcd.jcd_result" @change="jcResult()">
 							<el-radio :label="1">合格</el-radio>
 							<el-radio :label="0">不合格</el-radio>
 						</el-radio-group>
 					</el-form-item>
+					</el-col>
+					</el-row>
 					<!-- 上传检测报告 -->
 					<el-form-item label="检测单报告上传:" prop="jcd" class="labelItem">
 					<el-upload
@@ -278,14 +288,17 @@
 						<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
 					</el-upload>
 				</el-form-item>
+	
+				
 				</el-form>
 			</div>
-			<div style="display: flex;flex-direction: row;float: right;margin-bottom: 10px;">
+			<!-- <div v-show="jcd.jcd_result==0"> -->
+			<div style="display: flex;flex-direction: row;float: right;margin-bottom: 10px;" v-show="jcd.jcd_result==0">
 				<el-button type="success" size="small" plain @click="addJcxItemDialog = true">新增不合格项</el-button>
 			</div>
 				<!--  表格数据区域-->
-				<el-table :data="jcxItems" border stripe highlight-current-row style="width: 100%"
-					:row-style="rowStyle" :cell-style="cellStyle" align="center">
+				<el-table :data="jcxItems" border stripe highlight-current-row style="width: 100%;"
+					:row-style="rowStyle" :cell-style="cellStyle" align="center" v-show="jcd.jcd_result==0">
 					<el-table-column label="序号" width="50px">
 						<template slot-scope="scope">
 							{{ scope.$index+1 }}
@@ -308,21 +321,23 @@
 				<!--    分页器区域-->
 				<el-pagination @size-change="handleSizeChange2" @current-change="handleCurrentChange2"
 					:current-page="queryInfo2.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo2.pageSize"
-					layout="total, sizes, prev, pager, next, jumper" :total="jcxItemTotal" background />
-				
+					layout="total, sizes, prev, pager, next, jumper" :total="jcxItemTotal" background  v-show="jcd.jcd_result==0" />
+
+		
 			<div class="footer">
 				<el-button type="success" style="margin-bottom:30px;" size="small" @click="putJcd()">完成</el-button>
 			</div>
 			</el-dialog>
 
-			<el-dialog title="新增不合格检测项目" :visible.sync="addJcxItemDialog" width="70%" :close-on-click-modal="false"
+			<el-dialog title="新增不合格检测项目" :visible.sync="addJcxItemDialog" width="40%" :close-on-click-modal="false"
 				class="dialogItem">
+				<div id="addUnqualifiedJcx" style="margin:auto;">
 				<el-form :rules="rules" :model="jcxItem" style="margin:10px auto;">
 					<el-form-item label="检测项目:" prop="item_name" class="labelItem">
 						<el-input v-model="jcxItem.item_name" style="width:42%"></el-input>
 					</el-form-item>
 					<el-form-item label="标准指标:" prop="item_standard" class="labelItem">	
-							<el-input v-model="jcxItem.item_standard" style="width:42%;margin-left:5px;"></el-input>
+							<el-input v-model="jcxItem.item_standard" style="width:42%;"></el-input>
 					</el-form-item>
 					<el-form-item label="实测值:" prop="item_measured_value" class="labelItem">
 						<el-input v-model="jcxItem.item_measured_value" style="width:42%"></el-input>
@@ -337,7 +352,7 @@
 						<el-input v-model="jcxItem.item_log" style="width:42%"></el-input>
 					</el-form-item>
 				</el-form>
-
+				</div>
 			<div class="footer">
 				<el-button type="success" style="margin-bottom:30px;" size="small" @click="postJcdItem()">保存</el-button>
 			</div>
@@ -740,10 +755,10 @@
 				// console.log(res)
 				this.tableData1 = res.data.rows
 				for(let i= 0; i < this.tableData1.length; i++) {
-					if(this.tableData1[i].cyd_status = 1) {
-						this.tableData1[i].status = '未发布'
+					if(this.tableData1[i].cyd_status == 1) {
+						this.tableData1[i].status = '未上报'
 					}else {
-						this.tableData1[i].status = '已发布'
+						this.tableData1[i].status = '已上报'
 					}
 				}
 				console.log(this.tableData1[0].cyd_status)
@@ -764,15 +779,14 @@
 				// console.log(res)
 				this.tableData = res.data.rows
 				for(let i= 0; i < this.tableData.length; i++) {
-					if(this.tableData[i].cyd_status = 1) {
-						this.tableData[i].status = '未发布'
+					if(this.tableData[i].cyd_status == 1) {
+						this.tableData[i].status = '未上报'
 					}else {
-						this.tableData[i].status = '已发布'
+						this.tableData[i].status = '已上报'
 					}
 				}
-				console.log(this.tableData[0].cyd_status)
-				this.total = res.data.total
-				
+				console.log(this.tableData[0].status)
+				this.total = res.data.total	
 			},
 
 			// 删除不合格检测项目信息
@@ -809,7 +823,7 @@
 				const res = await this.$http.post('getJcdItems',that.queryInfo2)
 				console.log(res.data.data.rows)
 				this.jcxItems = res.data.data.rows
-				this.jcxItemTotal = res.data.data.tatal
+				this.jcxItemTotal = res.data.data.total
 			},
 			//填报检测单完成
 			async putJcd() {
@@ -1239,4 +1253,17 @@
 		.el-descriptions-item__label.is-bordered-label{
 		width: 18.75rem;}
 	}
+	/deep/ #addUnqualifiedJcx{
+		.el-form-item__label{
+			width: 15%;
+		}
+		.el-form-item__error{
+		left: 6.875rem;
+	}
+	}
+	// /deep/ #inputJcd{
+	// 	.el-upload__tip{
+	// 		margin-left: 7.1875rem;
+	// 	}
+	// }
 </style>