From b2ef0ed3e50edea64ff707fb70c4d3cb40ba15e5 Mon Sep 17 00:00:00 2001 From: shijing Date: Fri, 1 Mar 2024 15:49:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/qm/behavior.vue | 11 ++++++ src/views/qm/first.vue | 27 ++++++++++---- src/views/qm/first_check.vue | 67 +++++++++++++++++++++-------------- src/views/qm/productCheck.vue | 5 +-- 4 files changed, 74 insertions(+), 36 deletions(-) diff --git a/src/views/qm/behavior.vue b/src/views/qm/behavior.vue index 9b25f4f9..8d61dc4d 100644 --- a/src/views/qm/behavior.vue +++ b/src/views/qm/behavior.vue @@ -189,6 +189,17 @@ export default { this.$refs.saveDialog.open("edit").setData(row); }); }, + table_del(row) { + let that = this; + that.$confirm(`确定删除吗?`, "提示", { + type: "warning", + }).then(() => { + that.$API.qm.ptest.delete.req(row.id).then(res => { + that.$message.success("操作成功"); + that.$refs.table.refresh(); + }) + }) + }, importInspect() { this.visible = true; }, diff --git a/src/views/qm/first.vue b/src/views/qm/first.vue index d41c3605..8332b5e6 100644 --- a/src/views/qm/first.vue +++ b/src/views/qm/first.vue @@ -128,7 +128,7 @@ export default { dialog: { check: false }, - excelName:'首件确认', + excelName: '首件确认', // apiObj: this.$API.qm.list, apiObj: this.$API.qm.ftest.list, query: { @@ -149,14 +149,27 @@ export default { }, table_edit(row) { this.dialog.check = true; + console.log('row', row) this.$nextTick(() => { this.$refs.checkDialog.open("edit").setData(row); }); }, - table_del() { }, + table_del(row) { + this.$confirm(`确定删除吗?`, "提示", { + type: "warning", + }).then(() => { + this.$API.qm.ftest.delete.req(row.id).then(res => { + this.$message.success("操作成功"); + this.$refs.table.refresh(); + }) + }) + }, //查看 table_show(row) { - + this.dialog.check = true; + this.$nextTick(() => { + this.$refs.checkDialog.open("show").setData(row); + }); }, handleCheckSuccess() { this.$refs.table.refresh(); @@ -168,10 +181,10 @@ export default { this.query = {}; }, exportExcel() { - this.exportLoading = true; - this.$XLSX('#myTable', this.excelName) - this.exportLoading = false; - }, + this.exportLoading = true; + this.$XLSX('#myTable', this.excelName) + this.exportLoading = false; + }, }, }; \ No newline at end of file diff --git a/src/views/qm/first_check.vue b/src/views/qm/first_check.vue index 2eb81d74..fcc53388 100644 --- a/src/views/qm/first_check.vue +++ b/src/views/qm/first_check.vue @@ -18,15 +18,21 @@ - + + + + @@ -46,8 +52,15 @@ - - + + + + + + + + + @@ -74,12 +87,8 @@ export default { return { loading: false, form: { - ftestitems: [ - // {testitem:'椭圆度(≤0.02mm)',test_val:'',check_val:''}, - // {testitem:'锥度(≤0.05mm)',test_val:'',check_val:''}, - // {testitem:'直径(≥29.0)',test_val:'',check_val:''}, - // {testitem:'长度(≥455mm)',test_val:'',check_val:''}, - ], + type: 'first', + ftestitems: [], }, rules: { belong_dept: [{ required: true, message: "请选择所属部门", trigger: "blur" }], @@ -102,7 +111,6 @@ export default { }; }, mounted() { - this.getTextItem(); // this.getProcess(); this.getUserList(); this.getDeptOptions(); @@ -111,6 +119,9 @@ export default { //显示 open(mode = "add") { this.mode = mode; + if (mode == "add") { + this.getTextItem(); + } this.visible = true; return this; }, @@ -123,7 +134,7 @@ export default { res.forEach(item => { let obj = {}; obj.testitem = item.id; - obj.testName = item.name; + obj.testitem_name = item.name; obj.test_val = 0; obj.check_val = 0; ftestitems.push(obj) @@ -142,7 +153,7 @@ export default { getUserList() { let that = this; this.$API.system.user.list.req({ page: 0, depts__name: '检验管理部' }).then(res => { - that.userList = res; + that.userList = res.results; }); }, // getProcess(){ @@ -160,23 +171,24 @@ export default { //提交 submit() { console.log('111111') - this.$refs.dialogForm.validate(async (valid) => { + let that = this; + that.$refs.dialogForm.validate(async (valid) => { if (valid) { - this.isSaveing = true; + that.isSaveing = true; try { - if (this.mode == "add") { - this.$API.qm.ftest.create.req(this.form).then(res => { - this.isSaveing = false; - this.$emit("success"); - this.visible = false; - this.$message.success("操作成功"); + if (that.mode == "add") { + that.$API.qm.ftest.create.req(that.form).then(res => { + that.$emit("success"); + that.isSaveing = false; + that.visible = false; + that.$message.success("操作成功"); }) - } else if (this.mode == "edit") { - this.$API.qm.ftest.update.req(this.form.id, this.form).then(res => { - this.isSaveing = false; - this.$emit("success"); - this.visible = false; - this.$message.success("操作成功"); + } else if (that.mode == "edit") { + that.$API.qm.ftest.update.req(that.form.id, that.form).then(res => { + that.$emit("success"); + that.isSaveing = false; + that.visible = false; + that.$message.success("操作成功"); }) } @@ -191,6 +203,7 @@ export default { //表单注入数据 setData(data) { Object.assign(this.form, data); + console.log('this.form', this.form) // this.form.test_group = this.form.split(',') }, //设置过滤项 diff --git a/src/views/qm/productCheck.vue b/src/views/qm/productCheck.vue index 81f6794a..31a859e9 100644 --- a/src/views/qm/productCheck.vue +++ b/src/views/qm/productCheck.vue @@ -129,6 +129,7 @@ export default { test_user: '', ftest_work: '',//work获取 isEdit: true, + type: 'prod' }, ftestitems: [], dialog: { @@ -217,11 +218,11 @@ export default { }) }, //删除 - table_del(row) { + delCheck(id) { this.$confirm(`确定删除吗?`, "提示", { type: "warning", }).then(() => { - this.$API.qm.ftest.delete.req(row.id).then((res) => { + this.$API.qm.ftest.delete.req(id).then((res) => { this.$message.success("删除成功"); this.$refs.table.refresh(); return res;