diff --git a/src/api/tool/com_tool_instance_add_update.js b/src/api/tool/com_tool_instance_add_update.js new file mode 100644 index 0000000..62ce247 --- /dev/null +++ b/src/api/tool/com_tool_instance_add_update.js @@ -0,0 +1,7 @@ +import { createAPI } from '@/utils/httpRequest.js' + +// 获取 +export const insertToolInstance = data => createAPI('plm/tool/insertToolInstance', 'POST', data) + +// 获取 +export const modifyToolInstance = data => createAPI('plm/tool/modifyToolInstance', 'POST', data) diff --git a/src/views/modules/tooling/components/com_tool_instance_add_update.vue b/src/views/modules/tooling/components/com_tool_instance_add_update.vue new file mode 100644 index 0000000..9b4a5e7 --- /dev/null +++ b/src/views/modules/tooling/components/com_tool_instance_add_update.vue @@ -0,0 +1,424 @@ + + + + + diff --git a/src/views/modules/tooling/manuf_tool.vue b/src/views/modules/tooling/manuf_tool.vue index f9049b0..232b476 100644 --- a/src/views/modules/tooling/manuf_tool.vue +++ b/src/views/modules/tooling/manuf_tool.vue @@ -71,7 +71,7 @@ - 新增 + 新增 - - - - - - - - - - - - + + + @@ -127,6 +127,10 @@ + + + + @@ -140,12 +144,14 @@ import { /*组件*/ 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"; /*工具实例新增和修改组件*/ /*組件*/ export default { components: { Chooselist,/*选择组件*/ toolInfoAddUpdate,/*工具新增和修改组件*/ + toolInstanceAddUpdate,/*工具实例新增和修改组件*/ }, name: "null", data() { @@ -162,6 +168,7 @@ export default { endDate:'', }, currentRow:{}, + currentInstanceRow: {}, height: 200, dataList:[], detailList:[], @@ -399,13 +406,13 @@ export default { { userId: this.$store.state.user.name, functionId: 106003, - serialNumber: '106003Table2SeqNo', + serialNumber: '106003Table2ToolInstance', tableId: '106003Table2', - tableName: '工具申请明细', - columnProp: 'seqNo', + tableName: '工具实例明细', + columnProp: 'toolInstance', headerAlign: 'center', align: 'center', - columnLabel: '序号', + columnLabel: '工具样品', columnHidden: false, columnImage: false, columnSortable: false, @@ -417,13 +424,13 @@ export default { { userId: this.$store.state.user.name, functionId: 106003, - serialNumber: '106003Table2QuotationNo', + serialNumber: '106003Table2Description', tableId: '106003Table2', - tableName: '工具申请明细', - columnProp: 'quotationNo', + tableName: '工具实例明细', + columnProp: 'description', headerAlign: 'center', align: 'center', - columnLabel: '所属报价单', + columnLabel: '工具样品描述', columnHidden: false, columnImage: false, columnSortable: false, @@ -437,7 +444,7 @@ export default { functionId: 106003, serialNumber: '106003Table2ToolNo', tableId: '106003Table2', - tableName: '工具申请明细', + tableName: '工具实例明细', columnProp: 'toolNo', headerAlign: 'center', align: 'center', @@ -453,13 +460,13 @@ export default { { userId: this.$store.state.user.name, functionId: 106003, - serialNumber: '106003Table2ToolDescription', + serialNumber: '106003Table2LastCalibrationDate', tableId: '106003Table2', - tableName: '工具申请明细', - columnProp: 'toolDescription', + tableName: '工具实例明细', + columnProp: 'lastCalibrationDate', headerAlign: 'center', align: 'center', - columnLabel: '工具描述', + columnLabel: '最近校准日期', columnHidden: false, columnImage: false, columnSortable: false, @@ -471,13 +478,13 @@ export default { { userId: this.$store.state.user.name, functionId: 106003, - serialNumber: '106003Table2ToolSpec', + serialNumber: '106003Table2ObjectId', tableId: '106003Table2', - tableName: '工具申请明细', - columnProp: 'toolSpec', + tableName: '工具实例明细', + columnProp: 'objectId', headerAlign: 'center', align: 'center', - columnLabel: '工具规格', + columnLabel: '对象标识', columnHidden: false, columnImage: false, columnSortable: false, @@ -489,13 +496,13 @@ export default { { userId: this.$store.state.user.name, functionId: 106003, - serialNumber: '106003Table2ApplyQty', + serialNumber: '106003Table2NormalWorkCenterNo', tableId: '106003Table2', - tableName: '工具申请明细', - columnProp: 'applyQty', + tableName: '工具实例明细', + columnProp: 'normalWorkCenterNo', headerAlign: 'center', align: 'center', - columnLabel: '申请数量', + columnLabel: '工作中心', columnHidden: false, columnImage: false, columnSortable: false, @@ -507,49 +514,49 @@ export default { { userId: this.$store.state.user.name, functionId: 106003, - serialNumber: '106003Table2ExpectedServiceLife', + serialNumber: '106003Table2NormalWorkCenterDesc', tableId: '106003Table2', - tableName: '工具申请明细', - columnProp: 'expectedServiceLife', + tableName: '工具实例明细', + columnProp: 'normalWorkCenterDesc', headerAlign: 'center', align: 'center', - columnLabel: '预计寿命', + columnLabel: '工作重心描述', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 50 + columnWidth: 60 }, { userId: this.$store.state.user.name, functionId: 106003, - serialNumber: '106003Table2UnitCost', + serialNumber: '106003Table2NormalProductionLine', tableId: '106003Table2', - tableName: '工具申请明细', - columnProp: 'unitCost', + tableName: '工具实例明细', + columnProp: 'normalProductionLine', headerAlign: 'center', align: 'center', - columnLabel: '单位成本', + columnLabel: '生产线', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 60 + columnWidth: 50 }, { userId: this.$store.state.user.name, functionId: 106003, - serialNumber: '106003Table2quotationUnitCost', + serialNumber: '106003Table2NormalProductionLineDesc', tableId: '106003Table2', - tableName: '工具申请明细', - columnProp: 'quotationUnitCost', + tableName: '工具实例明细', + columnProp: 'normalProductionLineDesc', headerAlign: 'center', align: 'center', - columnLabel: '单位报价成本', + columnLabel: '生产线描述', columnHidden: false, columnImage: false, columnSortable: false, @@ -561,10 +568,10 @@ export default { { userId: this.$store.state.user.name, functionId: 106003, - serialNumber: '106003Table2Remark', + serialNumber: '106003Table2NoteText', tableId: '106003Table2', - tableName: '工具申请明细', - columnProp: 'remark', + tableName: '工具实例明细', + columnProp: 'noteText', headerAlign: 'center', align: 'center', columnLabel: '备注', @@ -642,6 +649,7 @@ export default { return s }, + /*刷新工具信息*/ refreshTooInfoData() { this.searchData.pageSize = this.pageSize this.searchData.pageIndex = this.pageIndex @@ -656,8 +664,6 @@ export default { /*新增工具的modal*/ addToolInfoModal(){ - //1.设置相关的参数 - //打开modal的页面 this.$nextTick(() => { this.$refs.toolInfoAddUpdate.init(null, true) @@ -690,6 +696,48 @@ export default { }) }, + /*新增工具实例的modal*/ + addToolInstanceModal(){ + //判断是否选择好数据 + if(this.currentRow && Object.keys(this.currentRow).length > 0){ + //打开modal的页面 + this.$nextTick(() => { + this.$refs.toolInstanceAddUpdate.init(this.currentRow, true) + }); + }else{ + this.$message.error('请先选择工具信息再添加工具实例!'); + } + }, + + /*修改工具实例的modal*/ + editToolInstanceModal(row){ + this.currentInstanceRow = row; + //判断是否选择好数据 + if(Object.keys(this.currentInstanceRow).length > 0){ + //打开modal的页面 + this.$nextTick(() => { + this.$refs.toolInstanceAddUpdate.init(this.currentInstanceRow, false) + }); + }else{ + this.$message.error('请先选择工具实例再添加工具实例!'); + } + }, + + /*刷新工具信息*/ + refreshTooInstanceData() { + getToolInstanceList(this.currentRow).then(({data}) => { + if (data.code == 200) { + this.detailList = data.rows; + } + this.dataListLoading = false + }) + }, + + /*工具实例的生命周期*/ + editToolInstanceDateModal(){ + + }, + //切换工具触发 changeData(row) { this.currentRow = JSON.parse(JSON.stringify(row)); @@ -697,6 +745,11 @@ export default { this.refreshCurrentTabTable (); }, + //切换工具实例触发 + currentInstanceRow(row) { + this.currentInstanceRow = JSON.parse(JSON.stringify(row)); + }, + // 获取数据列表 search () { this.searchData.pageSize = this.pageSize @@ -724,10 +777,20 @@ export default { // 刷新页签的table数据 refreshCurrentTabTable () { if (this.activeName == 'detail') { - this.getToolInstanceList(); + this.refreshToolInstanceData(); } }, + /*刷新工具实例的信息*/ + refreshToolInstanceData(){ + getToolInstanceList(this.currentRow).then(({data}) => { + if (data.code == 200) { + this.detailList = data.rows; + } + this.dataListLoading = false + }) + }, + // 下载 downloadFile(row){ @@ -773,11 +836,6 @@ export default { this.pageIndex = 1 this.search() }, - // 当前页 - currentChangeHandle (val) { - this.pageIndex = val - this.search() - }, }, activated() {