From 840c901446c4bf8a6c64bc25525ed9d518d92e82 Mon Sep 17 00:00:00 2001 From: DouDou <877258667@qq.com> Date: Fri, 6 Sep 2024 15:06:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=85=B7=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tool/com_tool_instance_date_add_update.js | 13 + src/api/tool/tool_info.js | 3 + .../com_tool_instance_date_add_update.vue | 355 ++++++++++++++++++ src/views/modules/tooling/manuf_tool.vue | 56 ++- 4 files changed, 412 insertions(+), 15 deletions(-) create mode 100644 src/api/tool/com_tool_instance_date_add_update.js create mode 100644 src/views/modules/tooling/components/com_tool_instance_date_add_update.vue diff --git a/src/api/tool/com_tool_instance_date_add_update.js b/src/api/tool/com_tool_instance_date_add_update.js new file mode 100644 index 0000000..dafd046 --- /dev/null +++ b/src/api/tool/com_tool_instance_date_add_update.js @@ -0,0 +1,13 @@ +import { createAPI } from '@/utils/httpRequest.js' + +// 获取 +export const getToolInstanceDates = data => createAPI('plm/tool/getToolInstanceDates', 'POST', data) + +// 获取 +export const insertToolInstanceDate = data => createAPI('plm/tool/insertToolInstanceDate', 'POST', data) + +// 获取 +export const modifyToolInstanceDate = data => createAPI('plm/tool/modifyToolInstanceDate', 'POST', data) + +// 删除 +export const removeToolInstanceDate = data => createAPI('plm/tool/removeToolInstanceDate', 'POST', data) diff --git a/src/api/tool/tool_info.js b/src/api/tool/tool_info.js index 7c7363c..8730429 100644 --- a/src/api/tool/tool_info.js +++ b/src/api/tool/tool_info.js @@ -9,3 +9,6 @@ export const getToolInstanceList = data => createAPI('plm/tool/getToolInstanceLi // 删除 export const removeToolInfo = data => createAPI('plm/tool/removeToolInfo', 'POST', data) +// 删除 +export const removeToolInstance = data => createAPI('plm/tool/removeToolInstance', 'POST', data) + diff --git a/src/views/modules/tooling/components/com_tool_instance_date_add_update.vue b/src/views/modules/tooling/components/com_tool_instance_date_add_update.vue new file mode 100644 index 0000000..abd119f --- /dev/null +++ b/src/views/modules/tooling/components/com_tool_instance_date_add_update.vue @@ -0,0 +1,355 @@ + + + + + diff --git a/src/views/modules/tooling/manuf_tool.vue b/src/views/modules/tooling/manuf_tool.vue index 232b476..651d99a 100644 --- a/src/views/modules/tooling/manuf_tool.vue +++ b/src/views/modules/tooling/manuf_tool.vue @@ -114,7 +114,7 @@ @@ -131,6 +131,10 @@ + + + + @@ -139,12 +143,14 @@ import { getToolInfoList, // 工具信息查询 getToolInstanceList, //工具实例信息查询 removeToolInfo,/*删除工具信息*/ + removeToolInstance,/*删除工具实例信息*/ } from '@/api/tool/tool_info.js' /*组件*/ import Chooselist from '@/views/modules/common/Chooselist'; /*选择组件*/ import toolInfoAddUpdate from "./components/com_tool_info_add_update"; /*工具新增和修改组件*/ import toolInstanceAddUpdate from "./components/com_tool_instance_add_update"; /*工具实例新增和修改组件*/ +import toolInstanceDateAddUpdate from "./components/com_tool_instance_date_add_update"; /*工具实例新增日期和修改组件*/ /*組件*/ export default { @@ -152,6 +158,7 @@ export default { Chooselist,/*选择组件*/ toolInfoAddUpdate,/*工具新增和修改组件*/ toolInstanceAddUpdate,/*工具实例新增和修改组件*/ + toolInstanceDateAddUpdate,/*工具实例新增日期和修改组件*/ }, name: "null", data() { @@ -733,23 +740,50 @@ export default { }) }, - /*工具实例的生命周期*/ - editToolInstanceDateModal(){ + /*删除工具实例确认*/ + deleteToolInstanceConfirm(toolInfo){ + this.$confirm('是否删除工具实例:'+ toolInfo.toolInstance+'?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + removeToolInstance(toolInfo).then(({data}) => { + if (data.code === 200) { + this.$message.success('操作成功!'); + this.refreshTooInstanceData(); + } else { + this.$message.error(data.msg); + } + }) + }) + }, + /*工具实例的生命周期*/ + editToolInstanceDateModal(toolInfo){ + this.currentInstanceRow = toolInfo; + //判断是否选择好数据 + if(Object.keys(this.currentInstanceRow).length > 0){ + //打开modal的页面 + this.$nextTick(() => { + this.$refs.toolInstanceDateAddUpdate.init(this.currentInstanceRow) + }); + }else{ + this.$message.error('请先选择工具实例再添加工具实例!'); + } }, //切换工具触发 changeData(row) { this.currentRow = JSON.parse(JSON.stringify(row)); - this.currentRow2 = row; this.refreshCurrentTabTable (); }, - //切换工具实例触发 - currentInstanceRow(row) { - this.currentInstanceRow = JSON.parse(JSON.stringify(row)); + /*切换工具实例*/ + changeInstanceData(row){ + this.currentRow = JSON.parse(JSON.stringify(row)); }, + // 获取数据列表 search () { this.searchData.pageSize = this.pageSize @@ -791,16 +825,8 @@ export default { }) }, - // 下载 downloadFile(row){ - // let inData={ - // site:this.currentRow.site, - // username:this.$store.state.user.name, - // projectId:this.currentRow.projectId - // } - // getProjectUserRole(inData).then(({data}) => { - // if(this.$store.state.user.name=='admin'||data.row.downFlag=='Y') { downLoadProjectFile(row) .then(({data}) => { // 不限制文件下载类型