licp
2024-05-06 b98bb5a14531d68e3ee1a483a79899de0de47704
src/views/quality/finishedProductInspection/finishedProduct-form.vue
@@ -285,6 +285,54 @@
                        </el-table-column>
                        </el-table>
                </el-tab-pane>
                <el-tab-pane label="附件">
                    <el-table :data="configFileTableData" height="400px">
                        <el-table-column
                        prop="orderNumber"
                        align="center"
                        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 fixed="right" align="center" label="操作">
                        <template slot-scope="scope">
                            <el-button
                            @click="downloadProcessConfigFiles(scope.row)"
                            type="text"
                            size="small"
                            >下载</el-button
                            >
                        </template>
                        </el-table-column>
                    </el-table>
                </el-tab-pane>
            </el-tabs>
        </div>
@@ -351,12 +399,15 @@
 import { getIfsLocationByGroupCopyAll } from '@/api/warehouse/location'
 import qrCodeApp from '@/views/common/qrCodeApp'
 import { getStore } from '@/util/store'
 import { getProcessConfigFile } from '@/api/plan/manufacturingorder'
 import * as customerorder from '@/api/plan/customerorder'
export default {
    components:{
        qrCodeApp
    },
    data() {
        return {
            dataForm:null,
            progrecessFileLoading: false,
            processConfigFileTableData: [],
            headers: {
@@ -408,6 +459,7 @@
            },
            inspectionItems: [], // 新增检验项目表格
            inspectionResultForm: [],
            configFileTableData:[]
        }
    },
    watch: {
@@ -431,6 +483,21 @@
        this.init()
    },
    methods: {
        getProcessConfigFile(){
            getProcessConfigFile({
            orderNumber: this.dataForm.orderNumber,
            lineNumber: this.dataForm.customerNo
            }).then((res)=>{
                this.configFileTableData = res.data.data
            })
        },
        downloadProcessConfigFiles(row){
            customerorder.downloadProcessConfigFile(
                row.fileName,
                row.bucketName,
                row.originalFileName
            )
        },
      saveTable(){
        let finishedInsProducts = [];
        if(this.inspectionItems.length>0){
@@ -553,22 +620,31 @@
                result: this.inspectionResultForm[0].result
            }
            if (pro > 0) {
                this.$prompt('请输入不合格数量', '不合格数量', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    inputPattern: /^\d+$/,
                    inputErrorMessage: '请输入正确数字格式'
                }).then(({ value }) => {
                    obj.number = value
                    updateFinishedInspectById(obj).then(res => {
                        if(res.data.data.indexOf("成功") > 0){
                            this.$message.success("上报成功");
                            this.checkTestState()
                        }else{
                            this.$message.warning(res.data.data)
                        }
                    });
                }).catch(() => {});
                obj.number = 1;
                updateFinishedInspectById(obj).then(res => {
                    if(res.data.data.indexOf("成功") > 0){
                        this.$message.success("上报成功");
                        this.checkTestState()
                    }else{
                        this.$message.warning(res.data.data)
                    }
                });
                // this.$prompt('请输入不合格数量', '不合格数量', {
                //     confirmButtonText: '确定',
                //     cancelButtonText: '取消',
                //     inputPattern: /^\d+$/,
                //     inputErrorMessage: '请输入正确数字格式'
                // }).then(({ value }) => {
                //     obj.number = value
                //     updateFinishedInspectById(obj).then(res => {
                //         if(res.data.data.indexOf("成功") > 0){
                //             this.$message.success("上报成功");
                //             this.checkTestState()
                //         }else{
                //             this.$message.warning(res.data.data)
                //         }
                //     });
                // }).catch(() => {});
            }else{
                updateFinishedInspectById(obj).then(res => {
                    if(res.data.data.indexOf("成功") > 0){
@@ -601,6 +677,7 @@
            if(id != null){
                queryById(id).then(res=>{
                    let result = res.data.data
                    this.dataForm = result
                    this.processInspectVo.finInsNo = result.finInsNo
                    this.processInspectVo.orderNumber = result.orderNumber
                    this.processInspectVo.mcode = result.materialCode
@@ -628,10 +705,14 @@
                                if(obj.inspectionValue){
                                    arr = obj.inspectionValue.split(",")
                                }
                                obj.empiricalValueAddss = arr
                                this.$set(obj,'empiricalValueAddss',arr)
                                // obj.empiricalValueAddss = arr
                                if(obj.note){
                                        snote=obj.inote
                                    }
                                    // obj.inote=obj.note
                                    this.$set(obj,'inote',obj.note)
                                }else{
                                    this.$set(obj,'inote',null)
                                }
                                if(arr.length > this.empiricalValueAdd){
                                    this.empiricalValueAdd = arr.length
                                }
@@ -661,6 +742,7 @@
                        userName: Array.from(new Set(userList)).join(","),
                        result: this.resultVal==null ? rVal : this.resultVal,
                    }]
                    this.getProcessConfigFile()
                }).catch(error=>{
                    console.error(error)
                })
@@ -795,7 +877,7 @@
                                arr.splice((arr.length-1),1)
                                let obj = {
                                    devideId: i.eId,
                                    fpid: row.iid,
                                    fpid: i.iid,
                                    inspectionValue: arr.join(","),
                                    note : i.inote
                                }
@@ -816,11 +898,11 @@
            } else {
                if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) {
                    this.empiricalValueAdd = this.empiricalValueAdd - 1;
                    // this.changeRowResult()
                    this.saveTable()
                    this.changeRowResult()
                    this.inspectionItems.forEach(i => {
                        i.empiricalValueAddss.splice(this.empiricalValueAdd, 1);
                    });
                    this.saveTable()
                }
            }
        },