licp
2024-11-27 a06fc9ad238199d601ae86795188151f56fdd3fe
修改样品出入库
已修改5个文件
140 ■■■■ 文件已修改
src/components/tool/file-preview.vue 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b1-inspect-order-plan.vue 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b1-inspection-order.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b1-sample.vue 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tool/file-preview.vue
@@ -67,7 +67,6 @@
import VueOfficeExcel from '@vue-office/excel'
//引入相关样式
import '@vue-office/excel/lib/index.css'
import * as XLSX from "xlsx";
export default {
  components: {
    VueOfficeDocx,
@@ -156,6 +155,7 @@
            column:[]
          }
          obj.tableData = this.formatCSVToTable(m.content.replaceAll('null',' '))
          // .replaceAll('MIN','=MIN').replaceAll('MAX','=MAX').replaceAll('AVERAGE','=AVERAGE')
          for (let item in obj.tableData[0]) {
            obj.column.push({
              label: item,
@@ -165,11 +165,6 @@
          return obj
        })
        this.csvList = arr
        // console.log(333,this.csvList)
        this.csvList.forEach(m=>{
          console.log(this.calculateFormulas(m.column,m.tableData))
          m.tableData = this.calculateFormulas(m.column,m.tableData)
        })
      }).catch( err => {
        console.log(err)
      })
@@ -210,28 +205,6 @@
        }
      }
      return result
    },
    /**
     * 计算表格公式
     *
     * @param tableHeaders 表头数据
     * @param tableData 表格数据
     */
    calculateFormulas(tableHeaders,tableData){
      // 生成 Excel Sheet 格式
      const sheetData = [tableHeaders.map(m=>m.label), ...tableData.map((row) => Object.values(row))];
      const worksheet = XLSX.utils.aoa_to_sheet(sheetData);
      // 计算公式
      XLSX.utils.sheet_add_aoa(worksheet, [], { origin: -1 });
      const newSheetData = XLSX.utils.sheet_to_json(worksheet, { header: 1 });
      // 更新表头和表格数据
      tableData = newSheetData.slice(1).map((row) =>
        row.reduce((obj, value, index) => {
          obj[newSheetData[0][index]] = value;
          return obj;
        }, {})
      );
      return tableData
    },
    resetStyle(){
      const elements = document.querySelectorAll('[style*="pt"]');
src/components/view/b1-inspect-order-plan.vue
@@ -421,6 +421,7 @@
        <el-button type="primary" @click="confirmExport" :loading="upLoadExport">确 定</el-button>
      </span>
    </el-dialog>
    <input id="ScanCodeInfo" v-model="codeInfo" @keyup.enter="keyup" style="opacity: 0;height: 0px;margin: 0px;padding: 0px;position: absolute;top: 0;"></input>
  </div>
</template>
@@ -680,6 +681,36 @@
        }
            }
        },
    watch:{
      qrCodeVisible(newVal){
        if(newVal){
            // this.$message.success('扫码:打开')
            this.sampleCode = null
            let input = document.getElementById('ScanCodeInfo');
            input.focus();
            this.startTime = setInterval(()=>{
                input.focus()
            },1000)
        }else{
            // this.$message.warning('扫码:关闭')
            clearInterval(this.startTime)
        }
      },
      exportVisible(newVal){
        if(newVal){
            // this.$message.success('扫码:打开')
            this.sampleCode = null
            let input = document.getElementById('ScanCodeInfo');
            input.focus();
            this.startTime = setInterval(()=>{
                input.focus()
            },1000)
        }else{
            // this.$message.warning('扫码:关闭')
            clearInterval(this.startTime)
        }
      },
    },
        created() {
            this.getLaboratoryDicts()
            this.getTypeDicts()
@@ -790,7 +821,6 @@
      keyup(e){
        var code = ''
        try{
          // console.log(2222,this.codeInfo)
          code = this.codeInfo.substring()
          if(code==null||code==undefined||code==''){
            this.$message.error('该二维码有误')
src/components/view/b1-inspection-order.vue
@@ -389,11 +389,11 @@
      <div style="width:100%;height: 400px;overflow-y: auto;" v-loading="loadPint">
        <div class="dia_body">
          <el-checkbox
          style="margin: 10px 5px;"
          style="margin: 10px 5px;text-align: left;"
          :indeterminate="isIndeterminate"
          v-model="checkAll"
          @change="handleCheckAllChange">全选</el-checkbox>
          <el-checkbox-group @change="changePrintCode()" v-model="checkIndexList">
          <el-checkbox-group @change="changePrintCode()" v-model="checkIndexList" style="text-align: left;">
            <el-card class="box-card" v-for="(item, i) in qrData" :key="i+'wwwww'" style="margin-bottom: 15px; font-size: 16px !important;">
              <el-checkbox :label="i" :key="i" style="position: relative;top:-10px;left:5px"><br></el-checkbox>
              <div>
src/components/view/b1-sample.vue
@@ -366,7 +366,7 @@
        <el-button type="primary" @click="confirmShelves" :loading="upLoadShelves">确 定</el-button>
      </span>
    </el-dialog>
    <!-- <input type="password" id="ScanCodeInfo" v-model="codeInfo" @keyup.enter="keyup" style="opacity: 0;height: 0px;margin: 0px;padding: 0px;position: absolute;top: 0;"></input> -->
    <input  id="ScanCodeInfo0" v-model="codeInfo" @keyup.enter="keyup" style="opacity: 0;height: 0px;margin: 0px;padding: 0px;position: absolute;top: 0;"></input>
  </div>
</template>
@@ -412,39 +412,41 @@
        codeInfo:null,
      }
    },
    // watch:{
    //   storageVisible(newVal){
    //     if(newVal){
    //         // this.$message.success('扫码:打开')
    //         let input = document.getElementById('ScanCodeInfo');
    //         input.focus();
    //         this.startTime = setInterval(()=>{
    //             input.focus()
    //         },1000)
    //     }else{
    //         // this.$message.warning('扫码:关闭')
    //         clearInterval(this.startTime)
    //     }
    //   },
    //   exportVisible(newVal){
    //     if(newVal){
    //         // this.$message.success('扫码:打开')
    //         let input = document.getElementById('ScanCodeInfo');
    //         input.focus();
    //         this.startTime = setInterval(()=>{
    //             input.focus()
    //         },1000)
    //     }else{
    //         // this.$message.warning('扫码:关闭')
    //         clearInterval(this.startTime)
    //     }
    //   },
    //   isEdit(newVal){
    //     if(!newVal){
    //       this.shelves = {}
    //     }
    //   }
    // },
    watch:{
      storageVisible(newVal){
        if(newVal){
            this.sampleCode = null
            // this.$message.success('扫码:打开')
            let input = document.getElementById('ScanCodeInfo0');
            input.focus();
            this.startTime = setInterval(()=>{
                input.focus()
            },1000)
        }else{
            // this.$message.warning('扫码:关闭')
            clearInterval(this.startTime)
        }
      },
      exportVisible(newVal){
        if(newVal){
            // this.$message.success('扫码:打开')
            this.sampleCode = null
            let input = document.getElementById('ScanCodeInfo0');
            input.focus();
            this.startTime = setInterval(()=>{
                input.focus()
            },1000)
        }else{
            // this.$message.warning('扫码:关闭')
            clearInterval(this.startTime)
        }
      },
      isEdit(newVal){
        if(!newVal){
          this.shelves = {}
        }
      }
    },
    mounted() {
      this.selectList()
    },
@@ -452,6 +454,7 @@
      keyup(e){
        var code = ''
        try{
            console.log(2222,this.codeInfo)
            code = this.codeInfo.substring()
            if(code==null||code==undefined||code==''){
                this.$message.error('该二维码有误')
src/main.js
@@ -21,11 +21,11 @@
//本地
// Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80";
// const javaApi = 'http://127.0.0.1:8001';
const javaApi = 'http://172.20.10.5:8001';
// const javaApi = 'http://172.20.10.5:8001';
// //通信测试库
// Vue.prototype.LOCATIONVUE = "http://10.1.13.77:8080";
// const javaApi = 'http://10.1.13.77:8001';
const javaApi = 'http://10.1.13.77:8001';
// 通信正式库
// Vue.prototype.LOCATIONVUE = "https://ztwxlims.ztt.cn:7443";