| | |
| | | <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> |
| | | <el-form :model="search" :inline="true" label-position="left"> |
| | | <el-form-item prop="code" label="申请单编号:" width="200" style="margin: 20px 10px;"> |
| | | <el-input v-model="search.code" size="small" ></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="date" label="检验时间:" width="200" style="margin: 20px 10px;"> |
| | | <el-date-picker v-model="search.date" type="daterange" range-separator="至" start-placeholder="开始日期" |
| | | end-placeholder="结束日期" size="small" value-format="yyyy-MM-dd" style="margin-right: 20px;"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item prop="testValue" label="检验结果:" width="200" style="margin: 20px 10px;"> |
| | | <el-select v-model="search.testValue" size="small"> |
| | | <el-option label="全部" :value="null"></el-option> |
| | | <el-option label="合格" :value="1"></el-option> |
| | | <el-option label="不合格" :value="0"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-button size="small" type="primary" @click="selectDataList">查询</el-button> |
| | | <el-button size="small" @click="cleanBtn">重置</el-button> |
| | | </div> |
| | | <div class="thing"> |
| | | <el-table :data="tableData" style="width: 100%;" row-key="code" default-expand-all |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="testState" label="检验状态" width="100px"> |
| | | <template slot-scope="scope"> |
| | | <el-tag type="success" v-if="scope.row.testState==1">合格</el-tag> |
| | | <el-tag type="danger" v-else-if="scope.row.testState==0">不合格</el-tag> |
| | | <el-tag type="success" effect="dark" v-if="scope.row.children!=undefined&&scope.row.testState!=null">已上报</el-tag> |
| | | <el-tag type="danger" effect="dark" v-else-if="scope.row.children!=undefined&&scope.row.testState==null">未上报</el-tag> |
| | | <el-tag type="success" v-else-if="scope.row.children==undefined&&scope.row.testState!=null">已检验</el-tag> |
| | | <el-tag type="danger" v-else-if="scope.row.children==undefined&&scope.row.testState==null">未检验</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="startTime" label="检验开始" width="100px"> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="150"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" type="primary" v-if="isIfReport(scope.row)" |
| | | <el-button size="mini" :disabled="!isIfReport(scope.row)" type="primary" v-if="scope.row.orderNum == '01'" |
| | | @click="addReported(scope.row.id)">上报</el-button> |
| | | <el-button size="mini" type="text" @click="openUpDia(scope.row)" |
| | | v-if="scope.row.orderNum=='02'">分配</el-button> |
| | | v-if="scope.row.orderNum=='02'&&scope.row.children==undefined&&scope.row.testState==null">分配</el-button> |
| | | <el-button size="mini" type="text" @click="openUpInsDia(scope.row)" |
| | | v-if="scope.row.orderNum=='02'">检验</el-button> |
| | | v-if="scope.row.orderNum=='02'&&scope.row.children==undefined&&scope.row.testState==null">检验</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <el-row style="line-height: 50px;"> |
| | | <el-col :span="4" style="font-size: 14px;text-align: right;">人员:</el-col> |
| | | <el-col :span="16" :offset="1"> |
| | | <el-select v-model="upData.checker" size="medium" clearable style="width: 100%;"> |
| | | <el-select @change="selectChecker" v-model="upData.checker" size="medium" clearable style="width: 100%;"> |
| | | <el-option v-for="(a, ai) in users" :key="ai" :label="a.name" :value="a.id"></el-option> |
| | | </el-select> |
| | | </el-col> |
| | |
| | | <el-button @click="upDia = false">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="检验" :visible.sync="upInsDia" width="500px"> |
| | | <el-dialog title="检验" :visible.sync="upInsDia" width="600px"> |
| | | <div class="body" style="max-height: 50vh;overflow-y: auto;"> |
| | | <el-row style="line-height: 46px;"> |
| | | <el-col :span="5" style="font-size: 14px;text-align: right;">申请单编码:</el-col> |
| | |
| | | <el-col :span="7">{{upData.internal}}</el-col> |
| | | </el-row> |
| | | <el-row style="line-height: 46px;"> |
| | | <el-col :span="5" style="font-size: 14px;text-align: right;">检验状态:</el-col> |
| | | <el-col :span="5" style="font-size: 14px;text-align: right;">检验结果:</el-col> |
| | | <el-col :span="7"> |
| | | <el-tag type="success" v-if="upData.testState==1">合格</el-tag> |
| | | <el-tag type="danger" v-else-if="upData.testState==0">不合格</el-tag> |
| | |
| | | </el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="60"> |
| | | <el-table-column label="操作" width="80"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" type="text" |
| | | @click.native.prevent="deleteRow(scope.$index, upData.testValue)">删除</el-button> |
| | |
| | | data() { |
| | | return { |
| | | search: { |
| | | name: null, |
| | | code: null, |
| | | date: [], |
| | | userName: null, |
| | | testValue: null, |
| | | }, |
| | | tableData: [], |
| | | upDia: false, |
| | |
| | | }, |
| | | methods: { |
| | | selectDataList() { |
| | | get(this.$url.selectAllPlan).then(res => { |
| | | var str = {} |
| | | str.code = this.search.code |
| | | str.status = this.search.testValue |
| | | try { |
| | | if (this.search.date.length != 0) { |
| | | str.beginTime = this.search.date[0] |
| | | str.endTime = this.search.date[1] |
| | | } |
| | | } catch (e) {} |
| | | get(this.$url.selectAllPlan, str).then(res => { |
| | | this.tableData = JSON.parse(JSON.stringify(res.data).replaceAll('pid', 'code').replaceAll('samplename', |
| | | 'name').replaceAll('inspectionStatus', 'testState')) |
| | | this.tableData.forEach(a => { |
| | |
| | | row.children.forEach(a => { |
| | | if (a.testState != null && a.testState != undefined) count++ |
| | | }) |
| | | return row.testState == undefined && row.orderNum == '01' && count == row |
| | | return row.testState == undefined && count == row |
| | | .children.length |
| | | }, |
| | | openUpDia(row) { |
| | | // console.log(row); |
| | | this.upDia = true |
| | | this.upData = { |
| | | id: row.code, |
| | | checker: null, |
| | | device: null |
| | | } |
| | | this.upData.checker=row.uId |
| | | this.upData.device=row.isuId |
| | | }, |
| | | submitUpData() { |
| | | // console.log(this.upData.device); |
| | | // console.log(this.devices); |
| | | // return; |
| | | if (this.upData.checker == null || this.upData.checker == '') { |
| | | this.$message.error('人员未分配') |
| | | return |
| | |
| | | this.upDia = false |
| | | this.selectDataList() |
| | | }) |
| | | }, |
| | | selectChecker(){ |
| | | // console.log(this.upData.checker); |
| | | }, |
| | | openUpInsDia(row) { |
| | | this.upInsDia = true |
| | |
| | | submitUpData2() { |
| | | var data = [] |
| | | this.upData.testValue.forEach(a => { |
| | | if(a.number!=''&&a.number!=null){ |
| | | if (a.number != '' && a.number != null) { |
| | | data.push(a.number) |
| | | } |
| | | }) |
| | |
| | | }).then(res => { |
| | | this.upInsDia = false |
| | | this.selectDataList() |
| | | this.$confirm(`<p style="line-height: 80px">您的项目(${this.upData.name})检验结果为:<span class="${res.data==1?'ins_state_success':'ins_state_error'}">${res.data==1?'合格':'不合格'}</span></p>`, '提交成功', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '关闭', |
| | | dangerouslyUseHTMLString:true, |
| | | type: `${res.data==1?'success':'error'}` |
| | | }).then(() => { |
| | | }).catch(() => { |
| | | }) |
| | | this.$confirm( |
| | | `<p style="line-height: 80px">您的项目(${this.upData.name})检验结果为:<span class="${res.data==1?'ins_state_success':'ins_state_error'}">${res.data==1?'合格':'不合格'}</span></p>`, |
| | | '提交成功', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '关闭', |
| | | dangerouslyUseHTMLString: true, |
| | | type: `${res.data==1?'success':'error'}` |
| | | }).then(() => {}).catch(() => {}) |
| | | }) |
| | | }, |
| | | cleanBtn(){ |
| | | this.search = { |
| | | code: null, |
| | | date: [], |
| | | testValue: null, |
| | | } |
| | | this.selectDataList() |
| | | } |
| | | } |
| | | } |