王震
2023-12-18 26c4f7ae79ad5ad2300876b94f96f19e4f93d53a
Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before
已修改14个文件
498 ■■■■ 文件已修改
src/views/admin/user/index.vue 141 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basic/location/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basic/location/location-form.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basic/staff/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/common/qrCodeApp.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/common/rawMaterial-part.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/common/ztt-table.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipment/equipment/index.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipment/metering/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/finishedProductInspection/finishedProduct-form.vue 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/processInspect/processInspect-form.vue 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/rawMaterial/rawMaterial-form.vue 161 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/technology/routing/routing-form.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/admin/user/index.vue
@@ -66,6 +66,15 @@
                @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>
@@ -147,6 +156,45 @@
      :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>
@@ -158,12 +206,26 @@
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: {
@@ -216,6 +278,77 @@
    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
@@ -343,7 +476,11 @@
      })
    },
    unlock(row, index) {
      unlock({ id: row.userId }).then((repsonse) => {})
      unlock({ id: row.userId }).then((repsonse) => {
        if(repsonse.data.data){
          this.$message.success("该用户已解锁")
        }
      })
    }
  }
}
src/views/basic/location/index.vue
@@ -194,7 +194,7 @@
            optList: () => {
              return this.getWarehouseLocGroupList()
            }
          },
          }/* ,
          // ERP库位
          {
            minWidth: '200',
@@ -204,7 +204,7 @@
            isTrue: false,
            isSearch: true,
            searchInfoType: 'text'
          }
          } */
        ],
        toolbar: [
          {
src/views/basic/location/location-form.vue
@@ -134,10 +134,23 @@
      <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
@@ -152,13 +165,13 @@
              >
              </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
@@ -169,7 +182,7 @@
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
      <!-- <el-row>
        <el-col :span="12">
          <el-form-item label="创建时间" prop="createTime">
            <el-date-picker
@@ -184,7 +197,7 @@
          </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>
src/views/basic/staff/index.vue
@@ -38,8 +38,10 @@
      multipleSelection: [],
      uploadInfo: {
        // 是否展示上传EXCEL以及对应的url
        isShow: false,
        url: ''
        isShow: true,
        url: '/mes/staff/upload',
        Download: true,
        fileName: '员工模板'
      },
      prelang: 'operation',
      options: {
src/views/common/qrCodeApp.vue
@@ -39,11 +39,10 @@
        },
        //回调扫描结果
        onDecode(result) {
            console.log(result);
            if (result !== "") {
                this.result=result
                this.$emit("ok",result)
                alert(result)
                this.$emit("ok",this.result)
                this.cancelCode()
            }
        },
        // 相机反转
@@ -74,12 +73,7 @@
        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: 您需要授予相机访问权限";
@@ -105,12 +99,7 @@
        }
    },
    watch: {
        "result": {
            handler(newVal) {
                console.log('扫描值' + newVal);
            },
            deep: true
        }
    }
};
</script>
src/views/common/rawMaterial-part.vue
@@ -65,7 +65,6 @@
      return {
        ajaxFun: chooseIFS,
        innerVisible: false,
        listLoading: true,
        currentRow: null,
        multipleSelection: [],
        uploadInfo: {
@@ -220,6 +219,7 @@
        this.innerVisible = this.currshowlist
        if (this.currshowlist) {
          this.$nextTick(() => {
            // this.table.data=[]
            this.getData()
          })
        }
src/views/common/ztt-table.vue
@@ -509,7 +509,8 @@
                只能上传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>
@@ -942,8 +943,7 @@
      }
    },
    getDataList(selectedId) {
      // this.dataListLoading = true
      this.dataListLoading = false
      this.dataListLoading = true
      var criteria = {}
      criteria.dateTimeFilters = this.dateTimeFilters
      criteria.multiSearchFilter = this.multiSearchFilter
@@ -969,6 +969,7 @@
      return this.doCallback(this.ajaxFun, arr, selectedId)
    },
    doCallback(fn, args, selectedId) {
      this.tableData=[]
      return fn
        .apply(this, args)
        .then((response) => {
@@ -1582,7 +1583,8 @@
      if(response.data!=""&&response.data!=[]&&response.data!=null){
        this.$message({
          message: response.data,
          type: 'success'
          type: 'success',
          dangerouslyUseHTMLString: true,
        })
      }else{
        this.$message({
@@ -1614,7 +1616,11 @@
        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
src/views/equipment/equipment/index.vue
@@ -236,12 +236,12 @@
              type: 'primary',
              fun: this.labelPrint
            },
          // {
          //   text: '同步',
          //   type: 'primary',
          //   loading: false,
          //   fun: this.pullEquipFun
          // }
          {
            text: '同步',
            type: 'primary',
            loading: false,
            fun: this.pullEquipFun
          }
        ],
        operator: [
          {
src/views/equipment/metering/index.vue
@@ -38,7 +38,7 @@
              <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>
src/views/quality/finishedProductInspection/finishedProduct-form.vue
@@ -148,11 +148,17 @@
                            <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>
@@ -224,6 +230,18 @@
            </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>
@@ -240,9 +258,16 @@
 } 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: '是',
@@ -304,6 +329,33 @@
        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 = {
src/views/quality/processInspect/processInspect-form.vue
@@ -137,11 +137,17 @@
                                    <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>
@@ -202,6 +208,18 @@
                </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>
    
@@ -215,9 +233,16 @@
    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'}]
            },
@@ -273,6 +298,33 @@
        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 => {
src/views/quality/rawMaterial/rawMaterial-form.vue
@@ -28,12 +28,7 @@
            </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"
@@ -44,8 +39,9 @@
            </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">
@@ -63,7 +59,9 @@
            <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">
@@ -76,7 +74,9 @@
                </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">
@@ -185,11 +185,17 @@
                  <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>
@@ -278,6 +284,18 @@
    <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>
@@ -288,7 +306,7 @@
  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 {
@@ -299,6 +317,9 @@
    computed:{},
    data(){
        return{
            row: null,
            proIndex: 0,
            deviceCode: false,
            qrcode: false,
            userdata:[],
            currentRow:[],
@@ -321,7 +342,7 @@
                formTime: '',
                message: '',
                name: '',
                code: '88.118.1/A0498220',
                code: '',
                specs: '',
                unit: '',
                number: '',
@@ -345,7 +366,9 @@
              userName: '',
              testState: ''
            }],
            dataRule: {},
            dataRule: {
              code:[{ required: true, message: '请扫描选择零件', trigger: 'blur' }]
            },
            deviceList: [],
        }
    },
@@ -372,81 +395,62 @@
      },
    },
    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') {
@@ -712,7 +716,6 @@
            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
src/views/technology/routing/routing-form.vue
@@ -699,14 +699,14 @@
      },
      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' }
vue.config.js
@@ -4,6 +4,8 @@
 */
// 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'