zouyu
2023-11-01 1094076235c6765ee0b527272d476df227d690ff
	modified:   src/api/quality/finishedProduct.js
deleted: src/const/crud/quality/rawMaterial.js
modified: src/views/quality/finishedProductInspection/finishedProductInspectionAdd.vue
deleted: src/views/quality/finishedProductInspection/finishedProductInspectionLook.vue
deleted: src/views/quality/finishedProductInspection/finishedProductInspectionUp.vue
modified: src/views/quality/finishedProductInspection/index.vue
new file: src/views/quality/package/index.vue
modified: src/views/quality/rawMaterial/rawMaterial-form.vue
已删除3个文件
已修改4个文件
已添加1个文件
1998 ■■■■ 文件已修改
src/api/quality/finishedProduct.js 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/const/crud/quality/rawMaterial.js 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/finishedProductInspection/finishedProductInspectionAdd.vue 383 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/finishedProductInspection/finishedProductInspectionLook.vue 605 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/finishedProductInspection/finishedProductInspectionUp.vue 745 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/finishedProductInspection/index.vue 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/package/index.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/rawMaterial/rawMaterial-form.vue 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/quality/finishedProduct.js
@@ -29,4 +29,35 @@
    url: '/mes/qualityFinishedInspect/'+obj,
    method: 'get',
  })
}
export function deletePro(obj) {
  return request({
    url: '/mes/qualityFinishedInspect/'+obj,
    method: 'delete',
  })
}
export function updateDeviceById(obj) {
  return request({
    url: '/mes/qualityFinishedInsProduct/updateDevByfpId',
    method: 'post',
    params: obj
  })
}
export function updateFinishedInsProduct(obj) {
  return request({
    url: '/mes/qualityFinishedInsProduct/updatefinishedInsProduct',
    method: 'post',
    params: obj
  })
}
export function updateFinishedInspectById(obj) {
  return request({
    url: '/mes/qualityFinishedInspect/updateFinishedInspectById',
    method: 'post',
    params: obj
  })
}
src/const/crud/quality/rawMaterial.js
ÎļþÒÑɾ³ý
src/views/quality/finishedProductInspection/finishedProductInspectionAdd.vue
@@ -4,10 +4,10 @@
    <div class="page-header">
        <div class="header-left">
            <a @click="$router.go(-1)"><i class="icon-btn-back"></i></a>
            <h2>编辑-产品检验</h2>
            <h2>编辑-产品检验单</h2>
        </div>
        <div class="btn-group header-right">
            <el-button @click="addTestProject">生成检验项目</el-button>
            <el-button @click="addTestProject" v-if="processInspectVo.id==null">生成检验项目</el-button>
        </div>
    </div>
    <div class="page-main">
@@ -18,7 +18,8 @@
                    <el-row>
                        <el-col :span="6">
                            <el-form-item label="订单号:">
                                <el-input @blur="selectInfoByOrderId" v-model="processInspectVo.orderNumber" placeholder="请输入订单号" autocomplete="off" />
                                <el-input @blur="selectInfoByOrderId" :disabled="processInspectVo.id != null"
                                v-model="processInspectVo.orderNumber" placeholder="请输入订单号" autocomplete="off" />
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
@@ -43,7 +44,7 @@
                    <el-row>
                        <el-col :span="6">
                            <el-form-item label="产品名称:">
                                <el-select style="width: 100%" @change="changeOptionsSamplename"
                                <el-select style="width: 100%" @change="changeOptionsSamplename" :disabled="processInspectVo.id != null"
                                    v-model="processInspectVo.material" size="small" placeholder="请选择产品名称">
                                    <el-option v-for="(item,index) in optionsSamplename" :key="index" :label="item.material"
                                        :value="item.materialCode">
@@ -74,7 +75,7 @@
                        <el-col :span="6">
                            <el-form-item label="数量:">
                                <el-input v-model="processInspectVo.quantity" placeholder="请输入数量"
                                    autocomplete="off" />
                                    autocomplete="off" :disabled="processInspectVo.id != null" />
                            </el-form-item>
                        </el-col>
                    </el-row>
@@ -82,91 +83,85 @@
            </el-form>
        </div>
        <div class="finishedProduct-detail">
            <el-row style="width:100%;z-index: 10;height:50px;">
            <el-row style="width:100%;z-index: 10;height:30px;">
                <el-col :span="12" class="inspectionProject_span">检验项目</el-col>
                <el-col :span="12" class="inspectionProject_span" style="text-align: right;">
                    <el-button size="mini" @click="clickAddInspectionColumn()">添加检验值列</el-button>
                    <el-button size="mini" @click="clickDeleteInspectionColumn()">删除检验值列</el-button>
                    <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-col :span="24">
                    <el-table border :data="inspectionItems" max-height="400" height="calc(100vh - 550px)"
                    <el-table border :data="inspectionItems" height="400"
                        :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}" 
                        :cell-style="{textAlign:'center'}" row-key="iid"
                        :cell-style="{textAlign:'center'}" row-key="iid" default-expand-all
                        style="width: 100%" ref="table" :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
                        <el-table-column type="index" label="序号" width="60"></el-table-column>
                        <el-table-column label="项目" prop="father"></el-table-column>
                        <el-table-column prop="iname" label="指标"></el-table-column>
                        <el-table-column prop="iunit" label="单位"></el-table-column>
                        <el-table-column prop="required" label="标准值"></el-table-column>
                        <el-table-column label="项目" prop="father" width="240" ></el-table-column>
                        <el-table-column prop="iname" label="指标" width="240" ></el-table-column>
                        <el-table-column prop="iunit" label="单位" width="240" ></el-table-column>
                        <el-table-column prop="required" label="标准值" width="240" ></el-table-column>
                        <el-table-column prop="inspectionValue" v-for="(item, index) in empiricalValueAdd" :key="index" label="检测值"
                            min-width="100" style="text-align: center;">
                            width="240" style="text-align: center;">
                            <template slot-scope="scope">
                                <el-tooltip :disabled="scope.row.dname != null" class="item" effect="dark" content="请先选择设备!"
                                <el-tooltip v-if="scope.row.iname!=null" :disabled="scope.row.eId != null"
                                class="item" effect="dark" content="请先选择设备!"
                                    placement="top-start">
                                    <!-- <el-input :disabled="scope.row.dname === null" v-model="scope.row.empiricalValueAddss[index]"
                                        @blur="changeState(scope.row, index)" placeholder="请输入检测值"></el-input> -->
                                    <el-input :disabled="scope.row.eId == null" v-model="scope.row.empiricalValueAddss[index]"
                                        @blur="changeState(scope.row, index)" placeholder="请输入检测值"></el-input>
                                </el-tooltip>
                            </template>
                        </el-table-column>
                        <el-table-column prop="dname" label="试验设备" min-width="100">
                        <el-table-column prop="deviceName" label="试验设备" min-width="250">
                            <template slot-scope="scope">
                                <el-button v-if="!scope.row.isSelectDevice" type="text" @click="clickTableSelect(scope)">{{
                                    scope.row.dname == null ? "请选择" : scope.row.dname
                                }}</el-button>
                                <el-select  v-if="scope.row.isSelectDevice" style="width: 100%;" @change="clickNodeSure(scope.row)" v-model="filterText" placeholder="请选择">
                                    <el-option v-for="item in materialOptions" :key="item.id" :label="item.device" :value="item.id">
                                    </el-option>
                                <el-select style="width:100%" 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.number +'-'+ item.name"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="deviceName" label="试验设备" min-width="260">
                            <template slot-scope="scope">
                            <el-select style="width:100%" v-model="scope.row.equipmentId" filterable @change="updateDevice(scope.row)">
                                <el-option v-for="(item,index) in deviceList"
                                :key="index" :value="item.id" :label="item.number +'-'+ item.name"></el-option>
                            </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column label="结论" fixed="right" min-width="100">
                            <template slot-scope="scope">
                                <span style="color: #34BD66;" v-if="scope.row.result === 1">合格</span>
                                <span style="color: #E84738;" v-else-if="scope.row.result === 0">不合格</span>
                                <span v-show="scope.row.result === null">暂未结论</span>
                                <div v-if="scope.row.iname!=null">
                                    <span style="color: #34BD66;" v-if="scope.row.iresult == 1">合格</span>
                                    <span style="color: #E84738;" v-else-if="scope.row.iresult == 0">不合格</span>
                                    <span v-else>暂无结论</span>
                                </div>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
        </div>
        <div class="finishedProduct-detail">
        <div class="finishedProduct-result">
            <el-row style="width:100%">
                <el-col :span="24">检测结果</el-col>
            </el-row>
            <el-row style="width:100%;margin-top:-180px">
            <el-row style="width:100%;">
                <el-col :span="24">
                    <el-table border max-height="400" :data="inspectionResultForm"
                    <el-table border height="90" :data="inspectionResultForm"
                    :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}" 
                    :cell-style="{textAlign:'center'}">
                        <el-table-column prop="id" label="物料编号"></el-table-column>
                        <el-table-column prop="name" label="物料名称"></el-table-column>
                        <el-table-column prop="inspecter" label="检验员"></el-table-column>
                        <el-table-column prop="conclusion" label="检验结论"></el-table-column>
                        <el-table-column prop="operation" label="上报"></el-table-column>
                        <el-table-column prop="materialCode" label="物料编号"></el-table-column>
                        <el-table-column prop="material" label="物料名称"></el-table-column>
                        <el-table-column prop="userName" label="检验员"></el-table-column>
                        <el-table-column prop="result" label="检验结论">
                            <template slot-scope="scope">
                                <el-tag type="success" v-if="scope.row.result == 1">合格</el-tag>
                                <el-tag type="danger" v-else-if="scope.row.result == 0">不合格</el-tag>
                            </template>
                        </el-table-column>
                        <el-table-column  label="操作">
                            <template>
                                <el-button type="text"  @click="submitSave()" size="small">上报</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
        </div>
    </div>
    <el-dialog title="请选择设备" :visible.sync="centerDialogVisible" width="20%">
        <div class="div_device_dialog">
            <el-select style="width: 100%;" @change="clickNodeSure()" v-model="filterText" placeholder="请选择">
                <el-option v-for="item in materialOptions" :key="item.id" :label="item.device" :value="item.id">
                </el-option>
            </el-select>
        </div>
    </el-dialog>
</div>
</template>
@@ -174,39 +169,22 @@
import { 
    chooseMater,
    addFinish,
    queryById, } from '@/api/quality/finishedProduct'
import { updateDeviceById,selectDevice } from '@/api/quality/rawMaterial'
    queryById,
    updateDeviceById,
    updateFinishedInsProduct,
    updateFinishedInspectById,
 } from '@/api/quality/finishedProduct'
import { selectDevice } from '@/api/quality/rawMaterial'
export default {
    data() {
        return {
            deviceList: [],
            hasChildren: true,
            showUp: false,
            isAddProject: false,
            showLook: false,
            detailId: 0,
            rowInfp: {},
            search: {
                countSize: 10,
                pageSize: 1,
                result: "", // æ£€æµ‹çŠ¶æ€
                name: "", // äº§å“åç§°
                techfather: "" // å·¥åº
            },
            optionsSamplename: [],
            inspectionTable: [],
            tableColumn: [],
            optionSoptionSprocesses: [],
            optionTechnology: [],
            inspectionTableTotal: 0,
            pageSize: 10,
            currentPage: 1,
            treeProject: [],
            // æ·»åŠ åˆ—
            empiricalValueAdd: 1,
            // ç¼–辑时存储最长的列数字,做删除判断
            empiricalValueAddMaxNumber: 0,
            showAddPage: false,
            processInspectVo: {
                id: null,
                material: null,
@@ -220,56 +198,9 @@
                unit: null,
                technologyId: null
            },
            InspectioniD: null,
            addInspectionform: [
                {
                    number: "",
                    username: "",
                    projectname: "",
                    tracenumber: "",
                    code: "",
                    class: "",
                    specificationmodel: "",
                    unit: "",
                    quantity: "",
                    group: "",
                    worker: "",
                    machine: ""
                }]
            ,
            inspectionItems: [], // æ–°å¢žæ£€éªŒé¡¹ç›®è¡¨æ ¼
            inspectionResultForm: [
                {
                    id: "",
                    name: "",
                    inspecter: "",
                    conclusion: "",
                    operation: ""
                }
            ],
            options: [],
            value: "",
            rowList: [],
            spanArr: [],
            position: 0,
            // è®¾å¤‡é€‰æ‹©æ ‘显示
            centerDialogVisible: false,
            filterText: "",
            materialOptions: [],
            defaultProps: {
                // è®¾å¤‡æ ‘数据设置
                children: "children",
                label: "name"
            },
            nodeData: {
                id: 0,
                name: null
            }, // node点击保存当前点击数据
            clickSelectDevice: {
                index: null, // ç‚¹å‡»é€‰æ‹©å­˜å‚¨å½“前行索引
                rpId: null // ç‚¹å‡»é€‰æ‹©å­˜å‚¨å½“前行项目Id
            }
        };
            inspectionResultForm: [],
        }
    },
    watch: {
    },
@@ -282,20 +213,101 @@
    },
    mounted() {
        this.getDeviceList()
        this.processInspectVo.id = this.$route.query.id
        this.init()
    },
    methods: {
        submitSave(){
            let pro = 0
            this.inspectionItems.forEach(item => {
                if(item.children){
                    let arr = item.children.filter(obj=>{
                            return obj.iresult == 0;
                    })
                    console.log("aaa--",arr,arr.length)
                    pro+=arr.length
                }
            })
            if (pro > 0) {
                this.$prompt('请输入不合格数量', '不合格数量', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    inputPattern: /^\d+$/,
                    inputErrorMessage: '请输入正确数字格式'
                }).then(({ value }) => {
                    let data = {
                    id: this.processInspectVo.id,
                    number: value
                    }
                    updateFinishedInspectById(data).then(res => {
                        this.$message.success("上报成功");
                    });
                }).catch(() => {});
            }else{
                updateFinishedInspectById({id:this.processInspectVo.id,number:0}).then(res => {
                    this.$message.success("上报成功");
                });
            }
            this.init()
        },
        init(){
            let id = this.processInspectVo.id
            if(id != null){
                queryById(id).then(res=>{
                    let result = res.data.data
                    this.processInspectVo.orderNumber = result.orderNumber
                    this.processInspectVo.mcode = result.materialCode
                    this.processInspectVo.prname = result.customerName
                    this.processInspectVo.sname = result.projectName
                    this.processInspectVo.material = result.material
                    this.processInspectVo.specificationsModel = result.specs
                    this.processInspectVo.unit = result.punit
                    this.processInspectVo.quantity = result.quantity
                    let resultVal = 1
                    let userList = []
                    result.children.forEach(item=>{
                        item.iid = Math.random()
                        if(item.children != undefined){
                            item.children.forEach(obj=>{
                                let arr = []
                                if(obj.userName){
                                    userList.push(obj.userName)
                                }
                                if(obj.inspectionValue){
                                    arr = obj.inspectionValue.split(",")
                                }
                                if(obj.iresult && obj.iresult == 0){
                                    resultVal = 0
                                }
                                obj.empiricalValueAddss = arr
                                if(arr.length > this.empiricalValueAdd){
                                    this.empiricalValueAdd = arr.length
                                }
                            })
                        }
                    })
                    this.inspectionItems = result.children
                    this.inspectionResultForm = [{
                        materialCode: result.materialCode,
                        material: result.material,
                        userName: Array.from(new Set(userList)).join(","),
                        result: resultVal,
                    }]
                }).catch(error=>{
                    console.log(error)
                })
            }
        },
        getDeviceList(){
            selectDevice(null).then(res=>{
            this.deviceList = res.data.data
                this.deviceList = res.data.data
            })
        },
        updateDevice(row){
            if(this.dataForm.id != null){
            updateDeviceById({equiomentId:row.equipmentId,rpId:row.rpId}).then(res=>{
            updateDeviceById({equiomentId:row.eId,fpid:row.iId}).then(res=>{
            }).catch(error=>{
                console.log(error)
            })
            }
        },
        changeOptionsSamplename(val) {
            let sample = this.optionsSamplename.filter(o => {
@@ -307,65 +319,29 @@
            this.processInspectVo.specificationsModel = sample.specs
            this.processInspectVo.unit = sample.unit
        },
        handleClick(row) {
            this.rowInfp = row
            this.showLook = true
        },
        updateInsInfo(row) {
            this.rowInfp = row
            this.showUp = true
        },
        searchPro() {
            this.search.countSize = this.pageSize
            this.search.pageSize = this.currentPage
            this.defaultInitializationTable()
        },
        // ç‚¹å‡»è¡¨æ ¼é€‰æ‹©è§¦å‘
        clickTableSelect(scope) {
            if(this.clickSelectDevice.index!=null){
                this.$set(this.inspectionItems[this.clickSelectDevice.index],'isSelectDevice',false)
            }
            this.clickSelectDevice.index = scope.$index;
            this.clickSelectDevice.rpId = scope.row.id;
            this.getOptions(scope.row);
        },
        changeState(row, index) {
            if (row.did != null && row.did != '') {
                // let val = row.empiricalValueAddss.filter(item => {
                //     return item != '' && item != null
                // })
                // let eq = val.filter(item => {
                //     return /^[^><=]/.test(item)
                // })
                // if (eq.length > 0) {
                //     this.$message({
                //         message: "检测值[" + eq + "]格式首位应包含>,<或者=",
                //         type: 'warning'
                //     });
                //     return
                // }
            if (row.iid != null && row.iid != '') {
                let str = ""
                row.empiricalValueAddss.forEach(e => {
                    str += e + ","
                })
                if (str.slice(0, -1) === '' || str.slice(0, -1) === null || str.slice(0, -1) === undefined) {
                str = str.slice(0,-1);
                if (str === undefined || str === '' || str === null ) {
                    return
                }
                this.$axios.post(this.$api.url.inspectionItemlose_focus_update, {
                    deviceId: row.did,
                    inspectionItemId: row.id,
                    inspectionValue: str.slice(0, -1)
                }, {
                    headers: { "Content-Type": "application/json" }
                }).then(res => {
                    row.result = res.data.result
                    row.username = res.data.username
                let obj = {
                    equiomentId: row.eId,
                    fpid: row.iid,
                    inspectionValue: str
                }
                updateFinishedInsProduct(obj).then(res=>{
                    if(res.data.code == 0){
                        this.$message.success("更新成功")
                    }else{
                        this.$message.error("更新失败")
                    }
                    this.init()
                })
            } else {
                this.$message({
                    message: '请选择择设备!',
                    type: 'warning'
                });
            }
        },
        addTestProject() {
@@ -388,6 +364,11 @@
                        let proList = response.data.data.children
                        proList.forEach(item=>{
                            item.iid = Math.random();
                            if(item.children != undefined){
                                item.children.forEach(obj=>{
                                    obj.empiricalValueAddss = []
                                })
                            }
                        })
                        this.inspectionItems = proList
                    }).catch(error=>{
@@ -421,34 +402,6 @@
                }
            })
        },
        // è¡¨æ ¼åˆå§‹åŒ–接口
        defaultInitializationTable() {
            // this.$axios
            //     .post(this.$api.url.selectProcessInspectsList, this.search)
            //     .then(res => {
            //         this.inspectionTableTotal = res.data.total;
            //         this.inspectionTable = res.data.row;
            //     });
        },
        // æ·»åŠ è¡Œ
        clickAddLine() {
            let obj = {
                material: "",
                materialCode: "",
                orderNumber: "",
                quantity: 0,
                specificationsModel: "",
                techfather: "",
                techname: "",
                technologyId: 0,
                unit: ""
            };
            this.inspectionItems.push(obj);
        },
        // åˆ é™¤è¡Œ
        clickDeleteline(scope) {
            this.inspectionItems.splice(scope.$index, 1);
        },
        // åˆ é™¤æ£€éªŒå€¼åˆ—
        clickDeleteInspectionColumn() {
            if (this.empiricalValueAdd - 1 === 0) {
@@ -456,7 +409,7 @@
                if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) {
                    this.empiricalValueAdd = this.empiricalValueAdd - 1;
                    this.inspectionItems.forEach(i => {
                        i.testValueList.splice(this.empiricalValueAdd, 1);
                        i.empiricalValueAddss.splice(this.empiricalValueAdd, 1);
                    });
                }
            }
@@ -472,7 +425,19 @@
<style scoped>
.finishedProduct-detail {
  width: 100%;
  height: 460px;
  height: 470px;
  padding: 10px 20px;
  display: flex;
  border: 1px solid #ddd;
  background-color: #fff;
  margin-top: 10px;
  box-sizing: border-box;
  flex-wrap: wrap;
}
.finishedProduct-result {
  width: 100%;
  height: 150px;
  padding: 10px 20px;
  display: flex;
  border: 1px solid #ddd;
src/views/quality/finishedProductInspection/finishedProductInspectionLook.vue
ÎļþÒÑɾ³ý
src/views/quality/finishedProductInspection/finishedProductInspectionUp.vue
ÎļþÒÑɾ³ý
src/views/quality/finishedProductInspection/index.vue
@@ -21,14 +21,10 @@
    import ttable from '@/views/common/ztt-table.vue'
    import * as fecha from 'element-ui/lib/utils/date'
    import finishedProductInspectionAdd from './finishedProductInspectionAdd'
    import finishedProductInspectionUp from './finishedProductInspectionUp'
    import finishedProductInspectionLook from './finishedProductInspectionLook'
    import { page } from '@/api/quality/finishedProduct'
    import { page,deletePro } from '@/api/quality/finishedProduct'
    export default {
        components: {
            finishedProductInspectionAdd,
            finishedProductInspectionUp,
            finishedProductInspectionLook,
            ttable
        },
        data() {
@@ -240,6 +236,23 @@
            // this.getInspectionTableData()
        },
        methods: {
            deleteHandle(row){
                console.log(row.id)
                this.$confirm('确认删除该数据吗?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning',
                }).then(()=>{
                    deletePro(row.id).then(res=>{
                        if(res.data.code == 0){
                            this.$message.success("删除成功")
                        }else{
                            this.$message.error("删除失败")
                        }
                        this.getData()
                    })
                })
            },
            // æ–°å¢ž / ä¿®æ”¹
            addOrUpdateHandle(row) {
                this.$router.push({
@@ -276,21 +289,9 @@
            handleAddNew() {
                this.showAdd = true
            },
            // async getInspectionTableData() {
            //     const {
            //         data: {
            //             row,
            //             total
            //         }
            //     } = await this.$axios.get(this.$api.url.finishedInsListPage, {
            //         params: {
            //             ...this.pageParams,
            //             ...this.searchData
            //         }
            //     })
            //     this.inspectionTable = row
            //     this.pageParams.total = total
            // },
            getData() {
                this.$refs.finishedProduct.getDataList()
            },
            goToDetail(row) {
                this.rowInfo = row
                this.showLook = true
src/views/quality/package/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
<template>
  <div>包装检验</div>
</template>
<script>
export default {
}
</script>
<style>
</style>
src/views/quality/rawMaterial/rawMaterial-form.vue
@@ -38,6 +38,7 @@
            <el-col :span="6">
                <el-form-item prop="formTime" label="来料日期">
                <el-date-picker 
                    style="width:100%"
                    v-model="dataForm.formTime"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
@@ -92,8 +93,8 @@
            <el-col :span="5">
                <div style="width:100%;text-align: right;">
                    <el-button v-show="dataForm.id==null" size="small" @click="clickAddLine">添加检验行</el-button>
                    <el-button size="small" @click="addTeatValueColumn()">添加检验值列</el-button>
                    <el-button size="small" @click="delTeatValueColumn()">删除检验值列</el-button>
                    <el-button size="small" @click="addTeatValueColumn()">添加检测值列</el-button>
                    <el-button size="small" @click="delTeatValueColumn()">删除检测值列</el-button>
                </div>
            </el-col>
        </el-row>
@@ -101,7 +102,7 @@
            <el-col :span="24">
                <el-table :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}" 
                :cell-style="{textAlign:'center'}" ref="table"
                :data="list" border style="width: 100%;" height="320">
                :data="list" border style="width: 100%;" height="400">
                  <el-table-column type="index" label="序号" width="60">
                  </el-table-column>
                  <el-table-column prop="name" label="项目" width="260">
@@ -159,25 +160,30 @@
            </el-col>
        </el-row>
      </div>
      <div class="rawMaterial-detail">
      <div class="rawMaterial-result">
        <el-row>
          <el-col :span="24">检验结论</el-col>
        </el-row>
        <el-row style="width:100%">
          <el-col :span="24">
            <avue-crud
              ref="conclusion"
              :option="option"
              :data="conclusionTable"
              v-model="conclusion">
                <template slot="judgeState" slot-scope="scope">
                  <el-tag type="success" v-if="scope.row.judgeState == 1">合格</el-tag>
                  <el-tag type="danger" v-else-if="scope.row.judgeState == 0">不合格</el-tag>
                </template>
                <template #menu>
                  <el-button type="text" @click="submitSave()" size="small">上报</el-button>
                </template>
              </avue-crud>
            <el-table border height="90" :data="conclusionTable" ref="conclusion" v-model="conclusion"
            :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}"
            :cell-style="{textAlign:'center'}">
                <el-table-column prop="code" label="物料编号"></el-table-column>
                <el-table-column prop="name" label="物料名称"></el-table-column>
                <el-table-column prop="userName" label="检验员"></el-table-column>
                <el-table-column prop="judgeState" label="检验结论">
                  <template slot-scope="scope">
                    <el-tag type="success" v-if="scope.row.judgeState == 1">合格</el-tag>
                    <el-tag type="danger" v-else-if="scope.row.judgeState == 0">不合格</el-tag>
                  </template>
                </el-table-column>
                <el-table-column  label="操作">
                    <template>
                        <el-button type="text" @click="submitSave()" size="small">上报</el-button>
                    </template>
                </el-table-column>
            </el-table>
          </el-col>
        </el-row>
      </div>
@@ -187,7 +193,6 @@
</template>
<script>
import { object,conclusion } from '@/const/crud/quality/rawMaterial'
import { 
  selectDevice,
  addRawInspects,
@@ -243,8 +248,6 @@
              userName: '',
              testState: ''
            }],
            tableOption: object,
            option: conclusion,
            dataRule: {},
            deviceList: [],
        }
@@ -257,10 +260,6 @@
    mounted(){
      this.dataForm.id = this.$route.query.id
      this.init()
      let isShow = this.dataForm.id == null ? true : false
      this.tableOption.menu = isShow
      let len = this.tableOption.column.length
      this.tableOption.column[len-1].hide = isShow
      this.getDeviceList()
    },
    watch:{
@@ -426,7 +425,6 @@
          })
        }else{
          this.conclusionTable = []
          this.tableOption.column = object.column
        }
      },
      save(){
@@ -454,7 +452,19 @@
<style>
.rawMaterial-detail {
  width: 100%;
  height: 400px;
  height: 470px;
  padding: 10px 20px;
  display: flex;
  border: 1px solid #ddd;
  background-color: #fff;
  margin-top: 10px;
  box-sizing: border-box;
  flex-wrap: wrap;
}
.rawMaterial-result {
  width: 100%;
  height: 150px;
  padding: 10px 20px;
  display: flex;
  border: 1px solid #ddd;