| | |
| | | <template> |
| | | <div v-if="!showDetail"> |
| | | <div class="content-main"> |
| | | <div class="firstBox"> |
| | | <div class="title">检测信息</div> |
| | | <div class="tableBox"> |
| | | <div class="tableBox-header"> |
| | | <el-button class="split" type="primary" size="small" style="background-color: rgb(1, 102, 226);">添加样品</el-button> |
| | | <el-button class="split" @click="dialogueFormVisible = true" type="primary" size="small" style="background-color: rgb(1, 102, 226);">添加样品</el-button> |
| | | <el-input |
| | | v-model="searchData" |
| | | class="input-form split" |
| | |
| | | min-width="10%" |
| | | /> |
| | | <el-table-column |
| | | prop="sampleid" |
| | | prop="sampleNumber" |
| | | label="样品编号" |
| | | min-width="8%" |
| | | /> |
| | | <el-table-column |
| | | prop="samplename" |
| | | prop="sampleName" |
| | | label="样品名称" |
| | | min-width="10%" |
| | | /> |
| | | <el-table-column |
| | | prop="modelandspecification" |
| | | prop="specificationsModels" |
| | | label="规格型号" |
| | | min-width="10%" |
| | | /> |
| | |
| | | min-width="8%" |
| | | /> |
| | | <el-table-column |
| | | prop="amount" |
| | | prop="samplesNumber" |
| | | label="数量" |
| | | min-width="8%" |
| | | /> |
| | |
| | | label="添加方式" |
| | | min-width="8%"> |
| | | <template slot-scope="scope"> |
| | | <el-tag |
| | | :type="scope.row.addway === 0 ? 'success' : 'primary'" |
| | | disable-transitions |
| | | >{{ scope.row.addway === 0 ? '扫描' : '录入' }}</el-tag> |
| | | <div v-if="scope.row.addway === 0"> |
| | | <el-tag :type= 'success' disable-transitions>扫描</el-tag> |
| | | </div> |
| | | <div v-if="scope.row.addway === 1"> |
| | | <el-tag :type= 'primary' disable-transitions>录入</el-tag> |
| | | </div> |
| | | <div v-else></div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | min-width="8%" |
| | | /> |
| | | <el-table-column |
| | | prop="other" |
| | | prop="remarks" |
| | | label="备注" |
| | | min-width="8%" |
| | | /> |
| | |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small">修改</el-button> |
| | | <el-button type="text" size="small" @click="handleClick(scope.row)">删除</el-button> |
| | | <el-button type="text" size="small" @click="deleteRow(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </div> |
| | | <div class="secondBox"> |
| | | <el-row class="header"> |
| | | <el-col :span="12">基本信息</el-col> |
| | | <el-col :span="12" style="text-align: right;"> |
| | | <!-- 点击返回,当前页面值为false --> |
| | | <el-button type="primary" size="mini" style="background-color: rgb(1, 102, 226); ">打印委托单</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-form :model="infoForm" ref="infoForm" class="infoForm" label-position="right" label-width="100px" size="mini" > |
| | | <div class="formwrapper"> |
| | | <el-row :gutter="200"> |
| | | <el-col :span="12">基本信息</el-col> |
| | | <el-col :span="12" style="text-align: right;"> |
| | | <!-- 点击返回,当前页面值为false --> |
| | | <el-button type="primary" size="mini" style="background-color: rgb(1, 102, 226); ">打印委托单</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-form :model="infoForm" ref="infoForm" class="infoForm" label-position="right" label-width="100px" size="mini" > |
| | | <div class="formwrapper"> |
| | | <el-row :gutter="200"> |
| | | <el-col :span="5"> |
| | | <el-form-item label="委托编号:"> |
| | | <el-input style="width: 160px" type="text" :value="infoForm.commisioncode" readonly disabled="true" autocomplete="off" /> |
| | |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <el-form-item label="委托单位:"> |
| | | <el-select style="width: 160px;" v-model="infoForm.department" size="small" placeholder="请选择产品名称"> |
| | | <el-option value="选项1"></el-option> |
| | | <el-option value="选项2"></el-option> |
| | | </el-select> |
| | | <el-input style="width: 160px" v-model="infoForm.department" placeholder="请输入委托单位" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <el-form-item label="联系人:"> |
| | | <el-select style="width: 160px;" v-model="infoForm.contacter" size="small" placeholder="请选择产品名称"> |
| | | <el-option value="选项1"></el-option> |
| | | <el-option value="选项2"></el-option> |
| | | </el-select> |
| | | <el-input style="width: 160px" v-model="infoForm.contacter" placeholder="请输入委托单位" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <el-form-item label="联系电话:"> |
| | | <el-select style="width: 160px;" v-model="infoForm.tel" size="small" placeholder="请选择产品名称"> |
| | | <el-option value="选项1"></el-option> |
| | | <el-option value="选项2"></el-option> |
| | | </el-select> |
| | | <el-input style="width: 160px" v-model="infoForm.tel" placeholder="请输入联系电话" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="200"> |
| | | <el-col :span="5"> |
| | | <el-form-item label="联系地址:" > |
| | | <el-select style="width: 160px;" v-model="infoForm.address" size="small" placeholder="请选择产品名称"> |
| | | <el-option value="选项1"></el-option> |
| | | <el-option value="选项2"></el-option> |
| | | </el-select> |
| | | <el-input style="width: 160px;" v-model="infoForm.address" placeholder="请输入联系地址" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | |
| | | <el-col :span="5"> |
| | | <el-form-item label="送样方式:"> |
| | | <el-select style="width: 160px;" v-model="infoForm.way" size="small" placeholder="送样"> |
| | | <el-option value="选项1"></el-option> |
| | | <el-option value="选项2"></el-option> |
| | | <el-option v-for="options in sampleDeliveryMode" :key="options.key" :value="options.value">{{ options.value }}</el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-row> |
| | | </div> |
| | | <div class="submitBtn"> |
| | | <el-button type="primary" size="small" style="background-color: rgb(1, 102, 226);">提交</el-button> |
| | | <el-button type="primary" size="small" @click="submitInspection" style="background-color: rgb(1, 102, 226);">提交</el-button> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | <div class="checkType"> |
| | | <el-dialog |
| | | title="添加指标" |
| | | :visible.sync="dialogueFormVisible" |
| | | width="40%" |
| | | > |
| | | <el-form :model="addPointerForm" ref="addPointerForm" class="addPointerForm" label-position="right" label-width="100px" size="mini"> |
| | | <el-row :gutter="50"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="样品编号:"> |
| | | <el-select style="width: 160px;" v-model="addPointerForm.sampleNumber" size="small" placeholder="请选择样品编号"> |
| | | <el-option v-for="options in samplecodeoptions" :value="options.value" :key="options.key" >{{ options.value }}</el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="样品名称:"> |
| | | <el-select style="width: 160px;" v-model="addPointerForm.sampleName" size="small" placeholder="请选择样品名称"> |
| | | <el-option v-for="options in sampleoptions" :value="options.value" :key="options.key">{{ options.value }}</el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="50"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="规格型号:"> |
| | | <el-select style="width: 160px;" v-model="addPointerForm.specificationsModels" size="small" placeholder="请选择样品名称"> |
| | | <el-option v-for="options in model_spe_options" :value="options.value" :key="options.key">{{ options.value }}</el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="样品单位:"> |
| | | <el-input style="width: 160px" type="text" v-model="addPointerForm.unit" placeholder="请输入单位" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="50"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="样品数量:"> |
| | | <el-input style="width: 160px" type="text" v-model="addPointerForm.samplesNumber" placeholder="请输入数量" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="备注:"> |
| | | <el-input style="width: 160px" type="text" v-model="addPointerForm.remarks" placeholder="请输入备注" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="50"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="添加实验:"> |
| | | <el-checkbox-group v-model="addPointerForm.experiment" style="display: flex; flex-direction: column;"> |
| | | <el-checkbox v-for="expers in experList" :label="expers.label" :key="expers.key">{{ expers.label }}</el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="addInspection">添加</el-button> |
| | | <el-button @click="dialogueFormVisible = false">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-else> |
| | | <router-view></router-view> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getSampleName, getModelSpecification, getlink, addInspection} from '@/api/inspection/commisioninspection' |
| | | export default { |
| | | data() { |
| | | return { |
| | | currentPage: 0, |
| | | searchData: '', |
| | | infoForm: { |
| | | commisioncode: 'ST9162324', |
| | | commisioncode: '', |
| | | department: '', |
| | | contacter: '', |
| | | tel: '', |
| | |
| | | num: '', |
| | | other: '' |
| | | }, |
| | | detectionInfo: [{ |
| | | sampleid: 'GW31478631', |
| | | samplename: '绝缘杆', |
| | | modelandspecification: 'JLHA/G1A-185/30-26/7', |
| | | unit: '根', |
| | | amount: '40', |
| | | addway: 0, |
| | | experiment: '交流耐压试验', |
| | | other: '123', |
| | | opertion: '', |
| | | }] |
| | | detectionInfo: [], |
| | | addPointerForm:{ |
| | | sampleNumber: '', |
| | | sampleName: '', |
| | | specificationsModels: '', |
| | | unit: '', |
| | | samplesNumber: '', |
| | | remarks: '', |
| | | experiment: [], |
| | | addway: '' |
| | | }, |
| | | experList:[{ |
| | | key: '1', |
| | | label: '外观检查' |
| | | },{ |
| | | key: '2', |
| | | label: '动作电压试验' |
| | | },{ |
| | | key: '3', |
| | | label: '电阻管泄漏电流试验' |
| | | },{ |
| | | key: '4', |
| | | label: '绝缘部分交流耐压试验' |
| | | }], |
| | | sampleoptions:[{ |
| | | key:'1', |
| | | value: '选项1' |
| | | },{ |
| | | key:'2', |
| | | value: '选项2' |
| | | }], |
| | | samplecodeoptions:[{ |
| | | key:'1', |
| | | value: '' |
| | | }], |
| | | model_spe_options:[{ |
| | | key:'1', |
| | | value: '选项1' |
| | | },{ |
| | | key: '2', |
| | | value: '选项2' |
| | | }], |
| | | sampleDeliveryMode:[{ |
| | | key: '1', |
| | | value: '送样' |
| | | },{ |
| | | key: '2', |
| | | value: '上门' |
| | | }], |
| | | dialogueFormVisible: false, |
| | | showDetail: false |
| | | } |
| | | }, |
| | | created(){ |
| | | this.getlink() |
| | | }, |
| | | mounted(){ |
| | | this.getSampleName() |
| | | this.getModelSpecification() |
| | | }, |
| | | methods: { |
| | | // 获取链接link |
| | | getlink(){ |
| | | getlink().then((result)=>{ |
| | | this.$store.commit('settings/SAVE_LINK',result.data) |
| | | console.log(this.$store.state.settings.link) |
| | | }) |
| | | }, |
| | | async getSampleName(){ |
| | | const res = await getSampleName() |
| | | // console.log('res',res.data) |
| | | this.sampleoptions = res.data.map((item)=>{ |
| | | return{ |
| | | key:item.id.toString(), |
| | | value:item.name |
| | | } |
| | | }) |
| | | this.samplecodeoptions = res.data.map((item)=>{ |
| | | return{ |
| | | key:item.id.toString(), |
| | | value:item.code |
| | | } |
| | | }) |
| | | }, |
| | | async getModelSpecification(){ |
| | | const res = await getModelSpecification({materialId: '1'}) |
| | | // console.log(res) |
| | | this.model_spe_options = res.data.map((item)=>{ |
| | | return{ |
| | | key:item.specificationsId, |
| | | value:item.specificationsName |
| | | } |
| | | }) |
| | | }, |
| | | addInspection(){ |
| | | let exper = this.addPointerForm.experiment[0] |
| | | this.addPointerForm.addway = 1 |
| | | for(let i=1;i<this.addPointerForm.experiment.length;i++){ |
| | | exper += ',' + this.addPointerForm.experiment[i] |
| | | } |
| | | // console.log(exper) |
| | | this.addPointerForm.experiment = exper |
| | | let tmp = this.addPointerForm |
| | | this.detectionInfo.push(tmp) |
| | | this.dialogueFormVisible = false |
| | | this.addPointerForm ={ |
| | | sampleNumber: '', |
| | | sampleName: '', |
| | | specificationsModels: '', |
| | | unit: '', |
| | | samplesNumber: '', |
| | | remarks: '', |
| | | experiment: [], |
| | | addway: '' |
| | | } |
| | | }, |
| | | async submitInspection(){ |
| | | let sampledeliveryway |
| | | if(this.infoForm.way === '送样'){ |
| | | sampledeliveryway = 1 |
| | | }else{ |
| | | sampledeliveryway = 2 |
| | | } |
| | | const res = await addInspection({completionDeadline: this.infoForm.deadline, |
| | | contactAddress: this.infoForm.address, |
| | | contactNumber: this.infoForm.tel, |
| | | contacts: this.infoForm.contacter, |
| | | entrustRemarks: this.infoForm.other, |
| | | entrusted: this.infoForm.department, |
| | | inspectionTime: this.infoForm.time, |
| | | linkDetectionList: this.detectionInfo, |
| | | reportNumber: parseInt(this.infoForm.num), |
| | | sampleDeliveryMode: sampledeliveryway, |
| | | sampleDeliveryPhone: this.infoForm.sendertel, |
| | | sampleSender: this.infoForm.sender}) |
| | | // const res = await addInspection({ |
| | | // completionDeadline: "2023-08-03", |
| | | // contactAddress: "江苏南通", |
| | | // contactNumber: "12321423432", |
| | | // contacts: "小黑", |
| | | // entrustRemarks: "委托备注YPBH123456789YPBH123456789YPBH123456789", |
| | | // entrusted: "阿里巴巴", |
| | | // inspectionTime: "2023-08-03", |
| | | // linkDetectionList: [ |
| | | // { |
| | | // "experiment": "做梦", |
| | | // "remarks": "通过了", |
| | | // "sampleName": "发动机", |
| | | // "sampleNumber": "YPBH123456789", |
| | | // "samplesNumber": 20, |
| | | // "specificationsModels": "GGXH-AAAAA", |
| | | // "unit": "百度" |
| | | // } |
| | | // ], |
| | | // reportNumber: 23, |
| | | // sampleDeliveryMode: 1, |
| | | // sampleDeliveryPhone: "123456789676", |
| | | // sampleSender: "小白" |
| | | // }) |
| | | // console.log(res) |
| | | this.infoForm.commisioncode = res.data |
| | | if(res.data){ |
| | | this.$message({ |
| | | message: '恭喜你!', |
| | | type: 'success' |
| | | }) |
| | | // 跳转页面 |
| | | this.$router.push('/inspectionManagement/commissionInspection') |
| | | this.showDetail = true |
| | | }else{ |
| | | this.$message.error(res.message) |
| | | } |
| | | }, |
| | | handleSizeChange(pageSize) { |
| | | this.pageParams.pageSize = pageSize |
| | | }, |
| | | handleCurrentChange(pageNo) { |
| | | this.pageParams.pageNo = pageNo |
| | | }, |
| | | deleteRow(row){ |
| | | console.log(row) |
| | | row = null |
| | | } |
| | | } |
| | | } |