zss
2024-03-11 d12fe5cd34a4ac05a7e8e40a4ee1cf2e69dc75e0
src/views/quality/processInspect/processInspect-form.vue
@@ -105,15 +105,16 @@
                    </div>
                </el-form>
            </div>
            <div class="finishedProduct-detail">
                <el-row style="width:100%;z-index: 10;height:30px;">
                    <el-col :span="12" class="inspectionProject_span">检验项目</el-col>
                    <el-col v-if="resultVal == null" :span="12" class="inspectionProject_span" style="text-align: right;">
            <div>
                <el-tabs class="finishedProduct-detail" @tab-click="tabsClick">
                    <el-tab-pane label="检验项目">
                        <el-row>
                            <el-col v-if="resultVal == null" :span="24" class="inspectionProject_span" style="text-align: right;">
                        <el-button size="mini" @click="clickAddInspectionColumn()">添加检测值列</el-button>
                        <el-button size="mini" @click="clickDeleteInspectionColumn()">删除检测值列</el-button>
                    </el-col>
                </el-row>
                <el-row style="width:100%;">
                        <el-row>
                    <el-col :span="24">
                        <el-table border
                            :data="inspectionItems"
@@ -206,6 +207,84 @@
                        </el-table>
                    </el-col>
                </el-row>
                    </el-tab-pane>
                    <el-tab-pane label="附件上传" type="card">
                        <div style="display: flex;justify-content:flex-end;">
                            <div></div>
                        </div>
                        <div
                        v-loading="progrecessFileLoading"
                        element-loading-text="请稍等,文件上传中"
                        >
                        <el-upload
                            :disabled="processInspectVo.proInsNo==null || (resultVal!=null && resultVal!='')"
                            drag
                            ref="upload"
                            action="/mes/rawInsProduct/upload"
                            :auto-upload="true"
                            :headers="headers"
                            :before-upload="submitUpload"
                            :on-success="uploadSuccess"
                            :data="paramData"
                            :with-credentials="true"
                            :show-file-list="false"
                        >
                            <i class="el-icon-upload"></i>
                            <div class="el-upload__text">
                            将文件拖到此处,或<em>点击上传</em>
                            </div>
                        </el-upload>
                        </div>
                        <el-table :data="processConfigFileTableData" height="260px">
                        <el-table-column
                            prop="rawInsNo"
                            align="center"
                            width="120"
                            label="原材料检验编号"
                            show-overflow-tooltip
                        ></el-table-column>
                        <el-table-column
                            prop="originalFileName"
                            align="center"
                            label="原文件名"
                            width="200"
                        ></el-table-column>
                        <el-table-column prop="fileName" align="center" label="文件后缀"></el-table-column>
                        <el-table-column prop="createUser" align="center" label="上传人"></el-table-column>
                        <el-table-column
                            prop="createTime"
                            align="center"
                            label="上传时间"
                            show-overflow-tooltip
                        ></el-table-column>
                        <el-table-column prop="updateUser" align="center" label="更新人">
                        </el-table-column>
                        <el-table-column
                            prop="updateTime"
                            align="center"
                            label="更新时间"
                            show-overflow-tooltip
                        ></el-table-column>
                        <el-table-column align="center" label="操作">
                            <template slot-scope="scope">
                            <el-button
                                @click="delProcessConfigFile(scope.row)"
                                type="text"
                                size="small"
                                :disabled="(resultVal!=null && resultVal!='')"
                                >删除</el-button
                            >
                            <el-button
                                @click="downloadProcessConfigFile(scope.row)"
                                type="text"
                                size="small"
                                >下载</el-button
                            >
                            </template>
                        </el-table-column>
                        </el-table>
                    </el-tab-pane>
                </el-tabs>
            </div>
            <div class="finishedProduct-result">
                <el-row style="width:100%">
@@ -273,16 +352,32 @@
    updateProcessInsProduct,
    updateProcessInspectsById,
} from '@/api/quality/processInspect'
import {
    getProcessConfigFiles,
    deleteProcessConfigFile,
    downloadProcessConfigFile
 } from '@/api/quality/attachment'
import processPart from '@/views/common/processinspect-part'
import { selectDevice } from '@/api/quality/processInspect'
import qrCodeApp from '@/views/common/qrCodeApp'
import { validatePositiveInteger } from '@/util/validate'
import { getStore } from '@/util/store'
export default {
    components:{
        qrCodeApp,processPart
    },
    data() {
        return {
            progrecessFileLoading: false,
            processConfigFileTableData: [],
            headers: {
              Authorization: 'Bearer ' + getStore({ name: 'access_token' })
            },
            paramData: {
              rawInsNo: '',
              lineNumber: '',
              type: 2
            },
            paramObj:{},
            qrcode: false,
            row: null,
@@ -348,12 +443,55 @@
        this.init()
    },
    methods: {
        delProcessConfigFile(row) {
          this.$confirm('是否删除该附件', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
            closeOnClickModal: false
          }).then(function() {
            return deleteProcessConfigFile(row.id)
          }).then((data) => {
            this.getConfigFiles()
          })
      },
      getConfigFiles() {
        const param = {
          no: this.processInspectVo.rawInsNo,
          lineNumber: this.processInspectVo.id,
          type: 2
        }
        getProcessConfigFiles(param).then((res) => {
          this.processConfigFileTableData = res.data.data
        })
      },
      downloadProcessConfigFile(row) {
        downloadProcessConfigFile({
            bucket: row.bucketName,
            fileName: row.fileName,
            originalFileName: row.originalFileName
        })
      },
      submitUpload() {
        this.paramData.no = this.processInspectVo.proInsNo
        this.paramData.lineNumber = this.processInspectVo.id
        this.progrecessFileLoading = true
      },
      uploadSuccess() {
        this.progrecessFileLoading = false
        this.getConfigFiles()
      },
      tabsClick(tab,even){
        if(tab.index == 1){
          if(this.processInspectVo.proInsNo==null){
            this.$message.error("请先保存过程检验信息")
            return
          }
            this.getConfigFiles();
        }
      },
      queryCode(){
        this.workshop = true
        console.log(this.workshop);
        // this.paramObj = {
        //   code: this.dataForm.code
        // }
      },
      cancelCodeDialog(){
        this.qrcode = false
@@ -710,14 +848,12 @@
<style scoped>
.finishedProduct-detail {
    width: 100%;
    height: 470px;
    height: 520px;
    padding: 10px 20px;
    display: flex;
    border: 1px solid #ddd;
    background-color: #fff;
    margin-top: 10px;
    box-sizing: border-box;
    flex-wrap: wrap;
}
.finishedProduct-result {