Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before
| | |
| | | @click="$refs.crud.rowAdd()" |
| | | >添加 |
| | | </el-button> |
| | | <!-- <el-button |
| | | v-if="sys_user_add" |
| | | class="filter-item" |
| | | type="primary" |
| | | size="small" |
| | | icon="el-icon-upload" |
| | | @click="importDialogVisible=true" |
| | | >导入 |
| | | </el-button> --> |
| | | </template> |
| | | <template slot="username" slot-scope="scope"> |
| | | <span>{{ scope.row.username }}</span> |
| | |
| | | :currshowlist.sync="showStaff" |
| | | @listenToStaffEvent="selectStaff" |
| | | /> |
| | | <el-dialog title="导入" :visible.sync="importDialogVisible" width="30%"> |
| | | <span> |
| | | <div> |
| | | <div> |
| | | <el-upload |
| | | style="margin-left:8px;display: inline;" |
| | | class="upload-demo" |
| | | drag |
| | | :headers="headers" |
| | | :action="uploadInfo.url" |
| | | :beforeUpload="beforeAvatarUpload" |
| | | :limit="1" |
| | | :show-file-list="false" |
| | | :file-list="fileList" |
| | | :on-success="fileSuccessUploadScan" |
| | | :on-error="handleError" |
| | | accept=".xlsx,.xls,.csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" |
| | | :auto-upload="true" |
| | | ref="uploadScan" |
| | | multiple |
| | | > |
| | | <i class="el-icon-upload"></i> |
| | | <div class="el-upload__text"><em>点击导入数据</em></div> |
| | | <div class="el-upload__tip" slot="tip" > |
| | | 只能上传xlsx/xls文件,且不超过10M<el-button |
| | | type="text" |
| | | style="font-size:12px;" |
| | | @click="downDataTemplate(uploadInfo.fileName)" |
| | | v-if="uploadInfo.Download" |
| | | >下载模板</el-button |
| | | > |
| | | </div> |
| | | </el-upload> |
| | | </div> |
| | | <div></div> |
| | | </div> |
| | | </span> |
| | | <span slot="footer" class="dialog-footer"> </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <script> |
| | |
| | | import { mapGetters } from 'vuex' |
| | | import Template from '../../quality/parts/template' |
| | | import { getObj } from '@/api/basic/staff' |
| | | |
| | | import { getStore } from '@/util/store.js' |
| | | import { uploadTemplate } from '@/api/basic/template' |
| | | export default { |
| | | name: 'SysUser', |
| | | components: { Template, staffDialog }, |
| | | data() { |
| | | return { |
| | | fileList: [], // 上传文件列表 |
| | | // 上传头信息 |
| | | headers: { |
| | | Authorization: 'Bearer ' + getStore({ name: 'access_token' }) |
| | | }, |
| | | uploadInfo: { |
| | | // 是否展示上传EXCEL以及对应的url |
| | | isShow: true, |
| | | url: '/mes/user/upload', |
| | | Download: true, |
| | | fileName: '用户模板' |
| | | }, |
| | | importDialogVisible: false, |
| | | showStaff: false, |
| | | searchForm: {}, |
| | | treeOption: { |
| | |
| | | this.init() |
| | | }, |
| | | methods: { |
| | | // 限制文件上传大小,目前限制为10M(另可以加类型限制) |
| | | beforeAvatarUpload(file) { |
| | | const fileName = file.name |
| | | const fileType = fileName.substring(fileName.lastIndexOf('.') + 1) |
| | | const isLt10M = file.size / 1024 / 1024 < 10 |
| | | if (fileType !== 'xlsx' && fileType !== 'xls') { |
| | | this.$message.error('文件格式只能为xlsx或xls,请删除后重新上传') |
| | | } |
| | | if (!isLt10M) { |
| | | this.$message({ |
| | | message: '文件大小', |
| | | type: 'warning' |
| | | }) |
| | | } |
| | | return isLt10M |
| | | }, |
| | | // 文件上传成功回调事件 |
| | | fileSuccessUploadScan(response, file, fileList) { |
| | | if (response.code != '0') { |
| | | this.$message.warning(response.msg) |
| | | } else { |
| | | if(response.data!=""&&response.data!=[]&&response.data!=null){ |
| | | this.$message({ |
| | | message: response.data, |
| | | type: 'success', |
| | | dangerouslyUseHTMLString: true, |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | | message: '上传成功', |
| | | type: 'success' |
| | | }) |
| | | } |
| | | this.importDialogVisible=false |
| | | this.fileList=[] |
| | | this.init() |
| | | // this.getDataList() |
| | | } |
| | | this.$refs.uploadScan.clearFiles() |
| | | }, |
| | | // 上传失败 |
| | | handleError(err, file, fileList) { |
| | | const error = JSON.parse(err.message) |
| | | if (error.msg) { |
| | | this.$message.error(error.msg) |
| | | } else { |
| | | this.$message.error('上传失败') |
| | | } |
| | | }, |
| | | // 下载数据模板 |
| | | downDataTemplate() { |
| | | uploadTemplate("user").then((response) => { |
| | | const blob = new Blob([response.data], { |
| | | type: 'application/force-download' |
| | | }) |
| | | let fileName="模板文件"; |
| | | if(this.uploadInfo.fileName!=undefined&&this.uploadInfo.fileName!=''&&this.uploadInfo.fileName!=null){ |
| | | fileName=this.uploadInfo.fileName |
| | | } |
| | | const filename = decodeURI(fileName+'.xlsx') |
| | | // 创建一个超链接,将文件流赋进去,然后实现这个超链接的单击事件 |
| | | const elink = document.createElement('a') |
| | | elink.download = filename |
| | | elink.style.display = 'none' |
| | | elink.href = URL.createObjectURL(blob) |
| | | document.body.appendChild(elink) |
| | | elink.click() |
| | | URL.revokeObjectURL(elink.href) // 释放URL 对象 |
| | | document.body.removeChild(elink) |
| | | }) |
| | | }, |
| | | selectStaff(staff) { |
| | | this.form.staffInfo = staff.staffName + '-' + staff.staffNo |
| | | this.form.phone = staff.phone |
| | |
| | | }) |
| | | }, |
| | | unlock(row, index) { |
| | | unlock({ id: row.userId }).then((repsonse) => {}) |
| | | unlock({ id: row.userId }).then((repsonse) => { |
| | | if(repsonse.data.data){ |
| | | this.$message.success("该用户已解锁") |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | optList: () => { |
| | | return this.getWarehouseLocGroupList() |
| | | } |
| | | }, |
| | | }/* , |
| | | // ERP库位 |
| | | { |
| | | minWidth: '200', |
| | |
| | | isTrue: false, |
| | | isSearch: true, |
| | | searchInfoType: 'text' |
| | | } |
| | | } */ |
| | | ], |
| | | toolbar: [ |
| | | { |
| | |
| | | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="创建时间" prop="createTime"> |
| | | <el-date-picker |
| | | readonly |
| | | style="width: 100%" |
| | | v-model="moment" |
| | | type="datetime" |
| | | placeholder="选择日期时间" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-col :span="12"> |
| | | <el-form-item |
| | | label="IFS库位" |
| | | prop="ifsLocationDesc" |
| | | > |
| | | > --> |
| | | <!-- <el-select |
| | | v-model="dataForm.ifsLocation" |
| | | filterable |
| | |
| | | > |
| | | </el-option> |
| | | </el-select> --> |
| | | <el-cascader |
| | | <!-- <el-cascader |
| | | v-model="dataForm.ifsLocationDesc" |
| | | :props="locationProps" |
| | | style="width:100%" filterable |
| | | ></el-cascader> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-col> --> |
| | | <el-col :span="12"> |
| | | <el-form-item label="库位状态" prop="locStatus"> |
| | | <el-switch |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <!-- <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="创建时间" prop="createTime"> |
| | | <el-date-picker |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> </el-col> |
| | | </el-row> |
| | | </el-row> --> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="visible = false">取消</el-button> |
| | |
| | | multipleSelection: [], |
| | | uploadInfo: { |
| | | // 是否展示上传EXCEL以及对应的url |
| | | isShow: false, |
| | | url: '' |
| | | isShow: true, |
| | | url: '/mes/staff/upload', |
| | | Download: true, |
| | | fileName: '员工模板' |
| | | }, |
| | | prelang: 'operation', |
| | | options: { |
| | |
| | | }, |
| | | //回调扫描结果 |
| | | onDecode(result) { |
| | | console.log(result); |
| | | if (result !== "") { |
| | | this.result=result |
| | | this.$emit("ok",result) |
| | | alert(result) |
| | | this.$emit("ok",this.result) |
| | | this.cancelCode() |
| | | } |
| | | }, |
| | | // 相机反转 |
| | |
| | | async onInit(promise) { |
| | | try { |
| | | const { capabilities } = await promise; |
| | | console.log( |
| | | "🚀 ~ file: cameracomponent.vue:47 ~ onInit ~ capabilities", |
| | | capabilities |
| | | ); |
| | | } catch (error) { |
| | | // console.log() |
| | | this.$toast(error.name); |
| | | if (error.name === "NotAllowedError") { |
| | | this.error = "ERROR: 您需要授予相机访问权限"; |
| | |
| | | } |
| | | }, |
| | | watch: { |
| | | "result": { |
| | | handler(newVal) { |
| | | console.log('扫描值' + newVal); |
| | | }, |
| | | deep: true |
| | | } |
| | | |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | return { |
| | | ajaxFun: chooseIFS, |
| | | innerVisible: false, |
| | | listLoading: true, |
| | | currentRow: null, |
| | | multipleSelection: [], |
| | | uploadInfo: { |
| | |
| | | this.innerVisible = this.currshowlist |
| | | if (this.currshowlist) { |
| | | this.$nextTick(() => { |
| | | // this.table.data=[] |
| | | this.getData() |
| | | }) |
| | | } |
| | |
| | | 只能上传xlsx/xls文件,且不超过10M<el-button |
| | | type="text" |
| | | style="font-size:12px;" |
| | | @click="downDataTemplate" v-if="uploadInfo.Download" |
| | | @click="downDataTemplate(uploadInfo.fileName)" |
| | | v-if="uploadInfo.Download" |
| | | >下载模板</el-button |
| | | > |
| | | </div> |
| | |
| | | } |
| | | }, |
| | | getDataList(selectedId) { |
| | | // this.dataListLoading = true |
| | | this.dataListLoading = false |
| | | this.dataListLoading = true |
| | | var criteria = {} |
| | | criteria.dateTimeFilters = this.dateTimeFilters |
| | | criteria.multiSearchFilter = this.multiSearchFilter |
| | |
| | | return this.doCallback(this.ajaxFun, arr, selectedId) |
| | | }, |
| | | doCallback(fn, args, selectedId) { |
| | | this.tableData=[] |
| | | return fn |
| | | .apply(this, args) |
| | | .then((response) => { |
| | |
| | | if(response.data!=""&&response.data!=[]&&response.data!=null){ |
| | | this.$message({ |
| | | message: response.data, |
| | | type: 'success' |
| | | type: 'success', |
| | | dangerouslyUseHTMLString: true, |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | |
| | | const blob = new Blob([response.data], { |
| | | type: 'application/force-download' |
| | | }) |
| | | const filename = decodeURI('模板文件.xlsx') |
| | | let fileName="模板文件"; |
| | | if(this.uploadInfo.fileName!=undefined&&this.uploadInfo.fileName!=''&&this.uploadInfo.fileName!=null){ |
| | | fileName=this.uploadInfo.fileName |
| | | } |
| | | const filename = decodeURI(fileName+'.xlsx') |
| | | // 创建一个超链接,将文件流赋进去,然后实现这个超链接的单击事件 |
| | | const elink = document.createElement('a') |
| | | elink.download = filename |
| | |
| | | type: 'primary', |
| | | fun: this.labelPrint |
| | | }, |
| | | // { |
| | | // text: '同步', |
| | | // type: 'primary', |
| | | // loading: false, |
| | | // fun: this.pullEquipFun |
| | | // } |
| | | { |
| | | text: '同步', |
| | | type: 'primary', |
| | | loading: false, |
| | | fun: this.pullEquipFun |
| | | } |
| | | ], |
| | | operator: [ |
| | | { |
| | |
| | | <el-row> |
| | | <el-col :span="10" :offset="3">设备二维码:</el-col> |
| | | <el-col :span="10"> |
| | | <vueQr :text="tem.code" :size="80" :margin="2"></vueQr> |
| | | <vueQr :text="tem.code+'id@'+tem.id" :size="80" :margin="2"></vueQr> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | |
| | | <template slot-scope="scope"> |
| | | <span v-if="resultVal!=null && processInspectVo.id!=null" v-text="scope.row.ename"></span> |
| | | <div v-else> |
| | | <el-select style="width:100%" v-model="scope.row.eId" |
| | | <el-select style="width:80%" v-model="scope.row.eId" |
| | | v-if="scope.row.iname != null" filterable @change="updateDevice(scope.row)"> |
| | | <el-option v-for="(item,index) in deviceList" |
| | | :key="index" :value="item.id" :label="item.code +'-'+ item.name"></el-option> |
| | | </el-select> |
| | | <el-button |
| | | size="small" |
| | | slot="append" |
| | | icon="el-icon-full-screen" |
| | | v-if="scope.row.iname != null" |
| | | @click="codeDevice(scope.row,scope.$index)"></el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </el-row> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | title="设备扫描" |
| | | :visible.sync="deviceCode" |
| | | width="60%"> |
| | | <div style="height: 100vh;width: 100%;"> |
| | | <qr-code-app ref="codeDeviceCompont" @ok="getDeviceResultInfo" @cancelCodeDialog="cancelDeviceCodeDialog"></qr-code-app> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="deviceCode = false">取 消</el-button> |
| | | <el-button type="primary" @click="deviceCode = false">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | } from '@/api/quality/finishedProduct' |
| | | import { getIfsLocationByGroupCopyAll } from '@/api/warehouse/location' |
| | | import { remote } from '@/api/admin/dict' |
| | | import qrCodeApp from '@/views/common/qrCodeApp' |
| | | export default { |
| | | components:{ |
| | | qrCodeApp |
| | | }, |
| | | data() { |
| | | return { |
| | | row: null, |
| | | proIndex: 0, |
| | | deviceCode: false, |
| | | locationList: [], |
| | | dataVal: [{ |
| | | label: '是', |
| | |
| | | this.init() |
| | | }, |
| | | methods: { |
| | | cancelDeviceCodeDialog(){ |
| | | this.deviceCode = false |
| | | }, |
| | | getDeviceResultInfo(val){ |
| | | console.log("扫描后数据",val); |
| | | let id=val.split("id@")[1] |
| | | if(id!=undefined&&id!=''&&id!=null){ |
| | | let filterData=this.deviceList.filter(item=>{ |
| | | return item.id==id |
| | | })[0] |
| | | console.log(filterData); |
| | | this.row.eId=Number(id) |
| | | this.updateDevice(this.row) |
| | | }else{ |
| | | this.$message({ |
| | | message: '未识别出二位码计量器具信息!', |
| | | type: 'warning' |
| | | }); |
| | | } |
| | | }, |
| | | codeDevice(row,index){ |
| | | this.row=row |
| | | console.log("row",row); |
| | | this.deviceCode =true |
| | | this.$refs.codeDeviceCompont.openCamera() |
| | | this.proIndex=index |
| | | }, |
| | | changeLocation(val){ |
| | | if(val){ |
| | | let obj = { |
| | |
| | | <span v-if="resultVal != null && scope.row.iname != null" |
| | | v-text="scope.row.ename"></span> |
| | | <div v-else> |
| | | <el-select style="width:100%" v-model="scope.row.eId" v-if="scope.row.iname != null" |
| | | <el-select style="width:80%" v-model="scope.row.eId" v-if="scope.row.iname != null" |
| | | filterable @change="updateDevice(scope.row, scope.$index)"> |
| | | <el-option v-for="(item, index) in deviceList" :key="index" :value="item.id" |
| | | :label="item.code + '-' + item.name"></el-option> |
| | | </el-select> |
| | | <el-button |
| | | size="small" |
| | | slot="append" |
| | | icon="el-icon-full-screen" |
| | | v-if="scope.row.iname != null" |
| | | @click="codeDevice(scope.row,scope.$index)"></el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </el-row> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | title="设备扫描" |
| | | :visible.sync="deviceCode" |
| | | width="60%"> |
| | | <div style="height: 100vh;width: 100%;"> |
| | | <qr-code-app ref="codeDeviceCompont" @ok="getDeviceResultInfo" @cancelCodeDialog="cancelDeviceCodeDialog"></qr-code-app> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="deviceCode = false">取 消</el-button> |
| | | <el-button type="primary" @click="deviceCode = false">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | updateProcessInspectsById, |
| | | } from '@/api/quality/processInspect' |
| | | import { selectDevice } from '@/api/quality/processInspect' |
| | | import qrCodeApp from '@/views/common/qrCodeApp' |
| | | export default { |
| | | components:{ |
| | | qrCodeApp |
| | | }, |
| | | data() { |
| | | return { |
| | | row: null, |
| | | proIndex: 0, |
| | | deviceCode: false, |
| | | rules: { |
| | | orderNumber: [{required:true,message:'订单号不能为空',trigger:'blur'}] |
| | | }, |
| | |
| | | this.init() |
| | | }, |
| | | methods: { |
| | | cancelDeviceCodeDialog(){ |
| | | this.deviceCode = false |
| | | }, |
| | | getDeviceResultInfo(val){ |
| | | console.log("扫描后数据",val); |
| | | let id=val.split("id@")[1] |
| | | if(id!=undefined&&id!=''&&id!=null){ |
| | | let filterData=this.deviceList.filter(item=>{ |
| | | return item.id==id |
| | | })[0] |
| | | console.log(filterData); |
| | | this.row.eId=Number(id) |
| | | this.updateDevice(this.row) |
| | | }else{ |
| | | this.$message({ |
| | | message: '未识别出二位码计量器具信息!', |
| | | type: 'warning' |
| | | }); |
| | | } |
| | | }, |
| | | codeDevice(row,index){ |
| | | this.row=row |
| | | console.log("row",row); |
| | | this.deviceCode =true |
| | | this.$refs.codeDeviceCompont.openCamera() |
| | | this.proIndex=index |
| | | }, |
| | | submitSave() { |
| | | let pro = 0 |
| | | this.inspectionItems.forEach(item => { |
| | |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="零件号" prop="code"> |
| | | <el-input v-model="dataForm.code" :disabled="resultVal!=null && dataForm.id!=null"> |
| | | <!-- <el-button |
| | | slot="append" |
| | | icon="el-icon-search" |
| | | :disabled="resultVal!=null && dataForm.id!=null" |
| | | @click="queryCode()"></el-button> --> |
| | | <el-input v-model="dataForm.code" disabled> |
| | | <el-button |
| | | slot="append" |
| | | icon="el-icon-full-screen" |
| | |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item prop="name" label="原材料名称"> |
| | | <el-input v-model="dataForm.name" disabled > |
| | | </el-input> |
| | | <el-tooltip class="item" effect="dark" :content="dataForm.name"> |
| | | <el-input v-model="dataForm.name" disabled ></el-input> |
| | | </el-tooltip> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="规格型号" prop="specs"> |
| | | <el-input v-model="dataForm.specs" disabled></el-input> |
| | | <el-tooltip class="item" effect="dark" :content="dataForm.specs"> |
| | | <el-input v-model="dataForm.specs" disabled></el-input> |
| | | </el-tooltip> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="供应商名称" prop="supplier"> |
| | | <el-tooltip class="item" effect="dark" :content="dataForm.supplier" > |
| | | <el-input v-model="dataForm.supplier" disabled /> |
| | | </el-tooltip> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | |
| | | <el-table-column prop="deviceName" label="试验设备" min-width="260"> |
| | | <template slot-scope="scope"> |
| | | <div v-if="!scope.row.children"> |
| | | <el-select :disabled="dataForm!=null && resultVal!=null" style="width:100%" |
| | | <el-select ref="" :disabled="dataForm!=null && resultVal!=null" style="width:80%" |
| | | v-model="scope.row.deviceId" filterable @change="updateDevice(scope.row,scope.$index)"> |
| | | <el-option v-for="(item,index) in deviceList" |
| | | :key="index" :value="item.id" :label="item.code +'-'+ item.name"></el-option> |
| | | </el-select> |
| | | <el-button |
| | | size="small" |
| | | slot="append" |
| | | icon="el-icon-full-screen" |
| | | :disabled="dataForm!=null && resultVal!=null" |
| | | @click="codeDevice(scope.row,scope.$index)"></el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-button type="primary" @click="qrcode = false">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="设备扫描" |
| | | :visible.sync="deviceCode" |
| | | width="60%"> |
| | | <div style="height: 100vh;width: 100%;"> |
| | | <qr-code-app ref="codeDeviceCompont" @ok="getDeviceResultInfo" @cancelCodeDialog="cancelDeviceCodeDialog"></qr-code-app> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="deviceCode = false">取 消</el-button> |
| | | <el-button type="primary" @click="deviceCode = false">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | getObj, |
| | | updateRawInsProduct, |
| | | updateRawInspectsById, |
| | | updateDeviceById, } from '@/api/quality/rawMaterial' |
| | | updateDeviceById, chooseIFS} from '@/api/quality/rawMaterial' |
| | | import rawMaterialPartDialog from '@/views/common/rawMaterial-part' |
| | | import qrCodeApp from '@/views/common/qrCodeApp' |
| | | export default { |
| | |
| | | computed:{}, |
| | | data(){ |
| | | return{ |
| | | row: null, |
| | | proIndex: 0, |
| | | deviceCode: false, |
| | | qrcode: false, |
| | | userdata:[], |
| | | currentRow:[], |
| | |
| | | formTime: '', |
| | | message: '', |
| | | name: '', |
| | | code: '88.118.1/A0498220', |
| | | code: '', |
| | | specs: '', |
| | | unit: '', |
| | | number: '', |
| | |
| | | userName: '', |
| | | testState: '' |
| | | }], |
| | | dataRule: {}, |
| | | dataRule: { |
| | | code:[{ required: true, message: '请扫描选择零件', trigger: 'blur' }] |
| | | }, |
| | | deviceList: [], |
| | | } |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | methods:{ |
| | | cancelDeviceCodeDialog(){ |
| | | this.deviceCode = false |
| | | }, |
| | | getDeviceResultInfo(val){ |
| | | console.log("扫描后数据",val); |
| | | let id=val.split("id@")[1] |
| | | if(id!=undefined&&id!=''&&id!=null){ |
| | | let filterData=this.deviceList.filter(item=>{ |
| | | return item.id==id |
| | | })[0] |
| | | console.log(filterData); |
| | | this.row.deviceId=Number(id) |
| | | this.updateDevice(this.row,this.proIndex) |
| | | }else{ |
| | | this.$message({ |
| | | message: '未识别出二位码计量器具信息!', |
| | | type: 'warning' |
| | | }); |
| | | } |
| | | }, |
| | | codeDevice(row,index){ |
| | | this.row=row |
| | | console.log("row",row); |
| | | this.deviceCode =true |
| | | this.$refs.codeDeviceCompont.openCamera() |
| | | this.proIndex=index |
| | | }, |
| | | getResultInfo(data){ |
| | | // console.log("返回"); |
| | | console.log("扫描出的二维码值",data); |
| | | console.log("扫描后执行",data); |
| | | if(!data.includes("part_no")){ |
| | | this.$message({ |
| | | message: '未识别出二位码零件信息!', |
| | | type: 'warning' |
| | | }); |
| | | } |
| | | let obj=JSON.parse(data) |
| | | let info={"code":obj["part_no"]} |
| | | console.log("值",info); |
| | | if(info.code!=undefined&&info.code!=''){ |
| | | this.paramObj = info |
| | | this.showPart = true |
| | | }else{ |
| | | this.$message({ |
| | | message: '未识别出二位码零件信息!', |
| | | type: 'warning' |
| | | }); |
| | | } |
| | | }, |
| | | cancelCodeDialog(){ |
| | | this.qrcode = false |
| | | }, |
| | | // 打开相机 |
| | | Turnonthecamera() { |
| | | console.log("执行"); |
| | | this.qrcode = true |
| | | this.$refs.codeCompont.openCamera() |
| | | // this.camera = 'rear' |
| | | }, |
| | | // 扫码结果回调 |
| | | // onDecode(result) { |
| | | // console.log(result) |
| | | // this.turnCameraOff() |
| | | // }, |
| | | // 相机反转 |
| | | // switchCamera() { |
| | | // switch (this.camera) { |
| | | // case 'front': |
| | | // this.camera = 'rear' |
| | | // break |
| | | // case 'rear': |
| | | // this.camera = 'front' |
| | | // break |
| | | // default: |
| | | // this.$toast('错误') |
| | | // } |
| | | // }, |
| | | // 关闭相机 |
| | | // turnCameraOff() { |
| | | // this.camera = 'off' |
| | | // this.qrcode = false |
| | | // }, |
| | | // 打开手电筒 |
| | | // ClickFlash() { |
| | | // switch (this.torchActive) { |
| | | // case true: |
| | | // this.torchActive = false |
| | | // break |
| | | // case false: |
| | | // this.torchActive = true |
| | | // break |
| | | // default: |
| | | // this.$toast('错误') |
| | | // } |
| | | // }, |
| | | |
| | | // 检查是否调用摄像头 |
| | | // async onInit(promise) { |
| | | // try { |
| | | // await promise |
| | | // } catch (error) { |
| | | // if (error.name === 'StreamApiNotSupportedError') { |
| | | // } else if (error.name === 'NotAllowedError') { |
| | | // this.errorMessage = 'Hey! I need access to your camera' |
| | | // } else if (error.name === 'NotFoundError') { |
| | | // this.errorMessage = 'Do you even have a camera on your device?' |
| | | // } else if (error.name === 'NotSupportedError') { |
| | | // this.errorMessage = |
| | | // 'Seems like this page is served in non-secure context (HTTPS, localhost or file://)' |
| | | // } else if (error.name === 'NotReadableError') { |
| | | // this.errorMessage = |
| | | // "Couldn't access your camera. Is it already in use?" |
| | | // } else if (error.name === 'OverconstrainedError') { |
| | | // this.errorMessage = |
| | | // "Constraints don't match any installed camera. Did you asked for the front camera although there is none?" |
| | | // } else { |
| | | // this.errorMessage = 'UNKNOWN ERROR: ' + error.message |
| | | // } |
| | | // } |
| | | // }, |
| | | // 确认回调 |
| | | selectPart(param, nodePart, index) { |
| | | if (typeof param !== 'undefined') { |
| | |
| | | for(var i=0;i<row.testValueList.length;i++){ |
| | | let val = row.testValueList[i] |
| | | let reg = /^[0-9]*[1-9][0-9]*$/ |
| | | console.log(['是','否'].includes(val)); |
| | | if(!reg.test(val) && !['是','否'].includes(val)){ |
| | | this.$message.error("请输入数字或选择是否") |
| | | row.testValueList[i] = null |
| | |
| | | }, |
| | | dataRule: { |
| | | partNo: [ |
| | | { required: true, message: '零件不能为空', trigger: 'change' } |
| | | { required: true, message: '零件不能为空', trigger: 'blur' } |
| | | ], |
| | | bomTypeDb: [ |
| | | { required: true, message: '工艺类型不能为空', trigger: 'change' } |
| | | ], |
| | | bomId: [{ required: true, message: 'BOM不能为空', trigger: 'change' }], |
| | | phaseInDate: [ |
| | | { required: true, message: '逐步采用日期不能为空', trigger: 'blur' } |
| | | { required: true, message: '逐步采用日期不能为空', trigger: 'change' } |
| | | ], |
| | | alternativeNo: [ |
| | | { required: true, message: '替代不能为空', trigger: 'blur' } |
| | |
| | | */ |
| | | |
| | | |
| | | // const url = 'http://192.168.2.7:9999' |
| | | // const url = 'http://192.168.32.45:9999' |
| | | const url = 'http://192.168.2.7:9999' |
| | | // const url = 'http://192.168.32.45:9999' |
| | | //const url = 'http://192.168.2.7:9999' |