zouyu
2024-01-11 980c3462a70d137b3f54f171c7989bb4cfe3b4ef
src/views/quality/packageInspectTemplate/inspect-detail.vue
@@ -14,6 +14,20 @@
        @row-save="addInspectHandler"
        @row-del="delInspectHandler"
        :page="page">
            <template slot="inspectNameForm" slot-scope="scope">
                <el-input
                placeholder="请输入检验项目名称"
                type="textarea"
                v-model="scope.row.inspectName"
                :rows="2" />
            </template>
            <template slot="inspectRequiredForm" slot-scope="scope">
                <el-input
                placeholder="请输入检验标准"
                type="textarea"
                v-model="scope.row.inspectRequired"
                :rows="2" />
            </template>
            <template #menu="{size,row,index}">
                <el-button v-if="row.children!=null" class="menu-button" :size="size" @click="addChildren(size,row,index)" type="text" icon="el-icon-circle-plus-outline">添加子项目</el-button>
                <el-button v-if="row.children==null" class="menu-button" :size="size" @click="showUpdateDialog(size,row,index)" type="text" icon="el-icon-edit">编辑</el-button>
@@ -71,7 +85,7 @@
        </el-form>
        <span slot="footer" class="dialog-footer">
            <el-button @click="addChildrenVisible = false">取 消</el-button>
            <el-button type="primary" @click="addInspectHandler">确 定</el-button>
            <el-button type="primary" @click="addChildrenHandler">确 定</el-button>
        </span>
    </el-dialog>
</div>
@@ -164,9 +178,24 @@
    },
    methods:{
        addChildren(size,row,index){
            console.log(row);
            this.addChildrenForm.inspectName = row.inspectName
            this.addChildrenVisible = true
        },
        addInspectHandler(row,done,loading){
            const _than = this
            let obj = {
                parentId: this.paramObj.id,
                ...row
            }
            addInspect(obj).then(res=>{
                if(res.status===200){
                    _than.getData()
                    _than.$message.success("添加成功")
                }
            }).catch(error=>{
                console.error(error)
            })
            done()
        },
        delInspectHandler(size,row,index){
            const _than = this
@@ -208,7 +237,7 @@
                }
            })
        },
        addInspectHandler(){
        addChildrenHandler(){
            const _than = this
            this.$refs.addChildrenForm.validate(valid=>{
                if(valid){