diff --git a/src/views/qm/product.vue b/src/views/qm/product.vue index 5bad7136..d1070c8c 100644 --- a/src/views/qm/product.vue +++ b/src/views/qm/product.vue @@ -1,132 +1,175 @@ \ No newline at end of file +import checkDialog from "./productCheck.vue"; +export default { + name: "rparty", + components: { + saveDialog, + checkDialog, + }, + data() { + return { + apiObj: this.$API.qm.ftestwork.list, + dialog: { + save: false, + check: false, + }, + query: { + page: 1, + page_size: 20, + type: 10, + }, + selection: [], + }; + }, + methods: { + add() { + this.dialog.save = true; + this.$nextTick(() => { + this.$refs.saveDialog.open("add"); + }); + }, + table_edit(row) { + this.dialog.save = true; + this.$nextTick(() => { + this.$refs.saveDialog.open("edit").setData(row); + }); + }, + table_del(row) { + this.$confirm(`确定删除吗?`, "提示", { + type: "warning", + }) + .then(() => { + this.$API.qm.ftestwork.delete + .req(row.id) + .then((res) => { + this.$message.success("删除成功"); + this.$refs.table.refresh(); + return res; + }) + .catch((err) => { + return err; + }); + }) + .catch(() => {}); + }, + //查看 + table_show(row) { + this.dialog.save = true; + this.$nextTick(() => { + this.$refs.saveDialog.open("show", 10).setData(row); + }); + }, + table_check(row) { + debugger; + console.log(row); + let that = this; + let type = ""; + if (row.material_name.indexOf("棒") > -1) { + type = "bang"; + } else { + type = "guan"; + } + that.product_type = type; + that.ftestWork = row.id; + that.dialog.check = true; + // this.$router.push({ + // name: "productDetail", + // query: { + // type: type, + // ftestWork: row.id, + // }, + // }); + }, + handleQuery() { + this.$refs.table.queryData(this.query); + }, + resetQuery() { + this.query = {}; + }, + handleSaveSuccess() { + this.dialog.save = false; + this.$refs.table.refresh(); + }, + handleCheckSuccess() { + this.dialog.check = false; + }, + }, +}; + diff --git a/src/views/qm/productCheck.vue b/src/views/qm/productCheck.vue index 0270912f..dc80c198 100644 --- a/src/views/qm/productCheck.vue +++ b/src/views/qm/productCheck.vue @@ -295,6 +295,17 @@ import saveDialog from "./product_check.vue"; export default { name: "mioitem", + emits: ["success", "closed"], + props: { + ftestWork: { + type: String, + default: "", + }, + type: { + type: String, + default: "", + }, + }, components: { saveDialog, }, @@ -318,8 +329,8 @@ export default { apiObj: null, params: {}, formTableData: [], - ftestWork: "", - type: "", + // ftestWork: "", + // type: "", userList: [], workObj: {}, }; @@ -332,8 +343,8 @@ export default { }, mounted() { let that = this; - that.type = that.$route.query.type; - that.ftestWork = that.$route.query.ftestWork; + // that.type = that.$route.query.type; + // that.ftestWork = that.$route.query.ftestWork; that.addTemplate.ftest_work = that.ftestWork; that.$API.qm.ftestwork.item.req(that.ftestWork).then((res) => { that.workObj = res;