| | |
| | | </el-dialog> |
| | | <div class="library-table"> |
| | | <div class="table-header"> |
| | | <div class="search-bar"> |
| | | <el-radio-group v-model="radioValue" @change="radioclick"> |
| | | <el-radio-button v-for="option in radioOptions" :key="option.value" |
| | | :label="option.value">{{ option.label }}</el-radio-button> |
| | | </el-radio-group> |
| | | </div> |
| | | <div class="generateInsp"> |
| | | <el-button @click="addReportBtn" type="primary" size="mini" icon="el-icon-document" |
| | | style="background-color: rgb(1, 102, 226);">生成报检单</el-button> |
| | |
| | | <el-table ref="inspectionTable" :max-height="600" :cell-style="{textAlign: 'center'}" |
| | | :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}" |
| | | :data="inspectionTable" style="width: 100%" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" :selectable="checkSelect" min-width="5%"> |
| | | </el-table-column> |
| | | <el-table-column type="selection" :selectable="checkSelect" min-width="5%"></el-table-column> |
| | | <el-table-column type="index" label="序号" min-width="8%" /> |
| | | <el-table-column prop="createTime" label="来料日期" min-width="8%" /> |
| | | <el-table-column prop="dateSurvey" label="来料日期" min-width="8%" /> |
| | | <el-table-column prop="supplierName" label="供应商名称" min-width="12%" /> |
| | | <el-table-column prop="materialCoding" label="材料编码" min-width="8%" /> |
| | | <el-table-column prop="materialName" label="材料名称" min-width="8%" /> |
| | |
| | | <el-table-column prop="quantity" label="数量" min-width="5%" /> |
| | | <el-table-column prop="inspectionDate" label="报检日期" min-width="8%" /> |
| | | <el-table-column prop="surveyor" label="检验人" min-width="8%" /> |
| | | <el-table-column prop="dateSurvey" label="检验日期" min-width="8%" /> |
| | | <el-table-column prop="insTime" label="检验日期" min-width="8%" /> |
| | | <el-table-column prop="type" label="状态" min-width="8%"> |
| | | <template slot-scope="scope"> |
| | | <span :style="{ color: scope.row.type === 1 ? 'green' : 'red' }"> |
| | |
| | | </div> |
| | | </div> |
| | | <el-dialog title="选择日期" :visible.sync="addReportDialog" width="60%"> |
| | | <el-form :model="addInspectionForm" :rules="addInspectionFormRules" rule="addInspectionForm"> |
| | | <el-form :model="addInspectionForm" :rules="addInspectionFormRules" ref="addInspectionForm"> |
| | | <el-form-item label="检验日期" label-width="100px" prop="inspectionDate"> |
| | | <el-date-picker v-model="addInspectionForm.inspectionDate" type="daterange" value-format="yyyy-MM-dd" |
| | | range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"> |
| | |
| | | label: '未报检' |
| | | }], |
| | | radioValue: null, |
| | | inspectionTable: [{ |
| | | createTime: '2023-07-28', |
| | | supplier_name: '国网山东省电力有限公司', |
| | | materialCoding: 'BP214274', |
| | | materialName: '铝包钢绞线', |
| | | specificationsModels: 'JLHA/G1A-185/30-26/7', |
| | | unit: '吨', |
| | | quantity: 21, |
| | | dateSurvey: '2023-08-02', |
| | | surveyor: '黄小明', |
| | | inspectionDate: '2023-12-09', |
| | | condition: 1 |
| | | }], |
| | | inspectionTable: [], |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | total: 20, |
| | |
| | | }); |
| | | }, |
| | | blurOptions(row) { |
| | | console.log("更新", row); |
| | | }, |
| | | async initNewSelection() { |
| | | const res = await selectUser(); |
| | |
| | | this.deviceoptions = res2.data; |
| | | }, |
| | | resetForm(formName) { |
| | | // this.addInspectionForm.inspectionDate = [], |
| | | // this.$refs[formName].resetFields(); |
| | | this.addInspectionForm.inspectionDate = [], |
| | | this.$refs[formName].resetFields(); |
| | | this.addReportDialog = false |
| | | }, |
| | | removeFun(row, index) { |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | console.log(row.id); |
| | | this.deleteMaterialFun(row, index); |
| | | }).catch(() => {}); |
| | | }, |
| | | checkSelect(row, index) { |
| | | checkSelect(row) { |
| | | if (row.type === 1) { |
| | | return false; |
| | | } else { |
| | |
| | | } |
| | | }, |
| | | handleSelectionChange(val) { |
| | | if (val.length > 1) { |
| | | this.$refs.inspectionTable.clearSelection(); |
| | | this.$refs.inspectionTable.toggleRowSelection(val.pop()) |
| | | } |
| | | this.checkData = val; |
| | | console.log(val); |
| | | }, |
| | | //生成报检单按钮 |
| | | addReportBtn() { |
| | |
| | | let name = this.checkData[0].materialName; |
| | | let specifications = this.checkData[0].specificationsModels; |
| | | this.getChooseVersionFun(mcode,name,specifications); |
| | | console.log(this.standardLibraryData); |
| | | this.addReportDialog = true; |
| | | } |
| | | } |
| | |
| | | specifications : specifications, |
| | | version: version |
| | | }).then((res)=>{ |
| | | console.log(res); |
| | | vm.standardLibraryData = res.data; |
| | | }) |
| | | |
| | |
| | | }, |
| | | //生成报检单确认按钮 |
| | | confirmBtn(formName) { |
| | | 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; |
| | | 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; |
| | | } |
| | | })); |
| | | }, |
| | | //生成报检单 |
| | | async createReport(param) { |
| | | let res = await addInspect(param); |
| | | const res2 = await selectInspectsListById({ |
| | | id: res.data |
| | | }); |
| | | this.resultData = res2.data; |
| | | this.inspectionForm = res2.data; |
| | | this.inspectionItems = res2.data.insProducts; |
| | | if(res.data==null)return |
| | | this.$message.success('报检成功') |
| | | this.$router.push(`/experiment/Viewdetails/${res.data}`) |
| | | }, |
| | | // 获取分页列表数据 |
| | | async getRawMaterialList() { |
| | |
| | | date: '' |
| | | } |
| | | this.getRawMaterialList() |
| | | }, |
| | | radioclick() { |
| | | console.log(this.inspectionTable); |
| | | if (this.radioValue === 0) { |
| | | |
| | | } |
| | | }, |
| | | getAllTableData() { |
| | | this.getRawMaterialList() |
| | | }, |
| | | getCheckData() { |
| | | |
| | | }, |
| | | getUnCheckData() { |
| | | |
| | | }, |
| | | // 每页条数改变时触发 选择一页显示多少行 |
| | | handleSizeChange(val) { |
| | |
| | | flex-direction: column; |
| | | |
| | | .table-header { |
| | | width: 100%; |
| | | height: 70px; |
| | | padding: 20px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | |
| | | .generateInsp{ |
| | | position: relative; |
| | | left: 92%; |
| | | } |
| | | .el-form-item { |
| | | margin-bottom: 30px !important; |
| | | } |