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;