From ebf0a9a058dbe2c3a18a8f7fb2d39a4eec1f82cc Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 3 Apr 2025 16:46:02 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=B7=BB=E5=8A=A0=E5=B7=A5?= =?UTF-8?q?=E8=89=BA=E8=B7=AF=E7=BA=BF=E5=A4=8D=E5=88=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/model/mtm.js | 4 +- src/views/mtm/routepack.vue | 114 +++++++++++++++++++++++++++++++++--- 2 files changed, 107 insertions(+), 11 deletions(-) diff --git a/src/api/model/mtm.js b/src/api/model/mtm.js index ad286a5a..339cc355 100644 --- a/src/api/model/mtm.js +++ b/src/api/model/mtm.js @@ -440,8 +440,8 @@ export default { }, copy:{ name: "复制", - req: async function (id,data) { - return await http.post(`${config.API_URL}/mtm/routepack/${id}/copy/`,data) + req: async function (data) { + return await http.post(`${config.API_URL}/mtm/routepack/copy/`,data) } }, togglestate:{ diff --git a/src/views/mtm/routepack.vue b/src/views/mtm/routepack.vue index 239440af..cf66411b 100644 --- a/src/views/mtm/routepack.vue +++ b/src/views/mtm/routepack.vue @@ -93,14 +93,14 @@ @click="table_show(scope.row, scope.$index)" >查看 - + + + + + + + + + + + + + + + + + + + + + + + + + + + { + that.materialIn = res; + }); + }, + getMaterialOut() { + let that = this; + that.$API.mtm.material.list.req({ page: 0, type__in: "10,20",is_hidden: false}).then((res) => { + that.materialOut = res; + }); + }, getType(state) { if (state == 10) { return "warning"; @@ -252,13 +331,30 @@ export default { }, //复制 table_copy(row){ - this.$API.mtm.routepack.copy.req(row.id).then((res) => { - this.$message.success("复制成功"); - this.$refs.table.refresh(); - return res; - }).catch((err) => { - return err; - }); + let that = this; + that.form.routepack = row.id; + that.form.new_name = ''; + that.form.material_in = ''; + that.form.material_out =''; + that.dialogVisible = true; + }, + form_save(){ + let that = this; + that.$refs.dialogForm.validate(async (valid) => { + if (valid) { + that.isSaveing = true; + that.$API.mtm.routepack.copy.req(that.form).then((res) => { + that.$message.success("复制成功"); + that.$refs.table.refresh(); + that.isSaveing = false; + that.dialogVisible = false; + return res; + }).catch((err) => { + that.isSaveing = false; + return err; + }); + } + }) }, // handleWatch(row) { // let that = this;