| | |
| | | </div> |
| | | </div> |
| | | <div class="table-box"> |
| | | <el-table ref="commisionTable" :max-height="800" :cell-style="{textAlign: 'center'}" |
| | | :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}" |
| | | <el-table ref="commisionTable" :max-height="800" :cell-style="{textAlign: 'left'}" |
| | | :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'left'}" |
| | | :data="commisionTable" @selection-change="handleSelectionChange" style="width: 100%"> |
| | | <el-table-column type="selection" :selectable="checkSelect" min-width="10%" /> |
| | | <el-table-column type="index" label="序号" min-width="10%" /> |
| | |
| | | <el-table-column prop="entrusted" label="委托单位" min-width="12%" /> |
| | | <el-table-column prop="samples_number" label="样品数量" min-width="8%" /> |
| | | <el-table-column prop="sample_name" label="样品名称" min-width="8%" /> |
| | | <el-table-column prop="specifications_models" label="规格型号" min-width="12%" /> |
| | | <el-table-column prop="speName" label="规格型号" min-width="12%" /> |
| | | <el-table-column prop="inspectionTime" label="送样时间" min-width="8%" /> |
| | | <el-table-column prop="completionDeadline" label="完成期限" min-width="8%" /> |
| | | <el-table-column prop="contacts" label="委托编制人" min-width="8%" /> |
| | | <el-table-column prop="insTime" label="检验日期" min-width="8%" /> |
| | | <el-table-column prop="inspection_status" label="状态" min-width="8%"> |
| | | <template slot-scope="scope"> |
| | | <div v-if="scope.row.inspection_status === 0"> |
| | |
| | | selectViewUUID, |
| | | delLink, |
| | | chooseVersion, |
| | | lookProByVer |
| | | lookProByVer, |
| | | addInspect |
| | | } from '@/api/inspection/commisioninspection' |
| | | export default { |
| | | data() { |
| | |
| | | value: '1', |
| | | label: '部门1' |
| | | }], |
| | | radioValue: 0, |
| | | radioValue: null, |
| | | commisionTable: [{ |
| | | specifications_models: "GGXH-AAAAA", |
| | | inspectionTime: "2023-08-03", |
| | |
| | | }], |
| | | conditionsOptions: [{ |
| | | label: '全部', |
| | | value: 0 |
| | | value: null |
| | | }, |
| | | { |
| | | label: '已检验', |
| | | value: 1 |
| | | value: 0 |
| | | }, |
| | | { |
| | | label: '待检验', |
| | | value: 2 |
| | | value: 1 |
| | | } |
| | | ], |
| | | currentPage: 1, |
| | |
| | | }, |
| | | handleSelectionChange(val) { |
| | | if (val.length > 1) { |
| | | let data = val.pop(); |
| | | this.$refs.commisionTable.clearSelection(); |
| | | this.$refs.commisionTable.toggleRowSelection(val.pop()) |
| | | this.$refs.commisionTable.toggleRowSelection(data); |
| | | this.checkData = data; |
| | | }else{ |
| | | this.checkData = val; |
| | | } |
| | | this.checkData = val; |
| | | console.log(this.checkData); |
| | | }, |
| | | //生成报检单确认按钮 |
| | | confirmBtn(formName) { |
| | | this.$refs[formName].validate((valid)=>{ |
| | | if(valid){ |
| | | // let dateArr = this.addInspectionForm.inspectionDate; |
| | | // //添加报检单 |
| | | // let val = this.checkData[0]; |
| | | // let obj = { |
| | | // "endTime": dateArr[1], |
| | | // "experiment": "", |
| | | // "formTime": val.createTime, |
| | | // "id": val.id, |
| | | // "mcode": val.materialCoding, |
| | | // "name": val.materialName, |
| | | // "num": val.quantity, |
| | | // "specifications": val.specificationsModels, |
| | | // "startTime": dateArr[0], |
| | | // "supplier": val.supplierName, |
| | | // "type": val.type, |
| | | // "unit": val.unit, |
| | | // "version": this.addInspectionForm.version |
| | | // } |
| | | // // this.createReport(obj); |
| | | // this.addReportDialog = false; |
| | | // this.initNewSelection(); |
| | | // this.showNewPage = true; |
| | | let dateArr = this.addInspectionForm.inspectionDate; |
| | | //添加报检单 |
| | | let val = this.checkData[0]; |
| | | let obj = { |
| | | "endTime": dateArr[1], |
| | | "mcode":"mcode", |
| | | "formTime": val.inspectionTime, |
| | | "id": val.id, |
| | | "name": val.sample_name, |
| | | "num": val.samples_number, |
| | | "specifications": val.speName, |
| | | "startTime": dateArr[0], |
| | | "supplier": val.entrusted, |
| | | "type": 2, |
| | | // "unit": "mm", |
| | | "version": this.addInspectionForm.version |
| | | } |
| | | this.createReport(obj); |
| | | this.addReportDialog = false; |
| | | } |
| | | }); |
| | | }, |
| | | //生成报检单请求 |
| | | async createReport(param) { |
| | | await addInspect(param).then(res =>{ |
| | | this.search(); |
| | | this.$message.success('报检成功') |
| | | this.$router.push(`/experiment/Viewdetails/${res.data}`) |
| | | }).catch(()=>{ |
| | | this.$message.error('报检失败') |
| | | }); |
| | | }, |
| | | //生成报检单按钮 |
| | |
| | | } else { |
| | | let mcode = this.checkData[0].entrust_coding; |
| | | let name = this.checkData[0].sample_name; |
| | | let specifications = this.checkData[0].specifications_models; |
| | | let specifications = this.checkData[0].speName; |
| | | let id = this.checkData[0].id; |
| | | this.getChooseVersionFun(mcode,name,specifications,id); |
| | | this.addReportDialog = true; |
| | |
| | | changeVersionFun(){ |
| | | let mCode = this.checkData[0].entrust_coding; |
| | | let name = this.checkData[0].sample_name; |
| | | let specifications = this.checkData[0].specifications_models; |
| | | let specifications = this.checkData[0].speName; |
| | | let version = this.addInspectionForm.version; |
| | | let id = this.checkData[0].id; |
| | | this.getProByVersion(mCode,name,specifications,version,id); |
| | |
| | | specifications : specifications, |
| | | version: version |
| | | }).then((res)=>{ |
| | | console.log(res); |
| | | var data = res.data; |
| | | for(var i=0;i<data.length;i++){ |
| | | data[i].id = "0" + i; |
| | | } |
| | | vm.standardLibraryData = res.data; |
| | | }) |
| | | }, |
| | |
| | | var vm = this; |
| | | this.chooseVersion = []; |
| | | await chooseVersion({ |
| | | mcode : mCode, |
| | | id : id, |
| | | name : name, |
| | | specifications : specifications |
| | | }).then((res)=>{ |
| | |
| | | async radioclick() { |
| | | // 处理点击radio的时间 |
| | | if (this.radioValue === 0) { |
| | | this.getCommisionList() |
| | | } else { |
| | | const res = await getCommisionList({ |
| | | pageNo: this.currentPage, |
| | | pageSize: this.pageSize, |
| | |
| | | }) |
| | | this.commisionTable = res.data.row |
| | | this.total = res.data.total |
| | | } else if(this.radioValue === 1) { |
| | | const res = await getCommisionList({ |
| | | pageNo: this.currentPage, |
| | | pageSize: this.pageSize, |
| | | inspectionStatus: this.radioValue |
| | | }) |
| | | this.commisionTable = res.data.row |
| | | this.total = res.data.total |
| | | }else{ |
| | | this.getCommisionList(); |
| | | } |
| | | |
| | | }, |