diff --git a/src/api/tool/com_tool_info_add_update.js b/src/api/tool/com_tool_info_add_update.js index c94ff58..dd8d231 100644 --- a/src/api/tool/com_tool_info_add_update.js +++ b/src/api/tool/com_tool_info_add_update.js @@ -5,3 +5,5 @@ export const insertToolInfo = data => createAPI('plm/tool/insertToolInfo', 'POST // 获取 export const modifyToolInfo = data => createAPI('plm/tool/modifyToolInfo', 'POST', data) + +export const getNextToolId = data => createAPI('plm/tool/getNextToolId', 'POST', data) diff --git a/src/views/modules/tooling/components/com_tool_info_add_update.vue b/src/views/modules/tooling/components/com_tool_info_add_update.vue index 2b02231..a3dc084 100644 --- a/src/views/modules/tooling/components/com_tool_info_add_update.vue +++ b/src/views/modules/tooling/components/com_tool_info_add_update.vue @@ -8,6 +8,7 @@ + 工具标识号 Next Tool ID @@ -60,7 +61,7 @@ - + @@ -126,6 +127,7 @@ import { insertToolInfo, modifyToolInfo, + getNextToolId, } from '@/api/tool/com_tool_info_add_update.js'; /*组件*/ @@ -349,6 +351,7 @@ export default { closeDialog(){ //刷新原页面的数据 this.$emit('refreshTooInfoData'); + this.$emit('changeCurrentToolInfo', this.pageData) //关闭当前的页面 this.visible = false; //this.$emit('update:visible', false); @@ -439,6 +442,35 @@ export default { }); } }, + + /*获取下一个工具标识号的下一个序号*/ + nextToolIdFun(){ + //首先判断前缀是否存在 + let site = this.pageData.site; + let toolId = this.pageData.toolId; + if(site == null || site === ''){ + this.$message.error('工厂不能为空!'); + return false; + } + if(toolId == null || toolId === ''){ + this.$message.error('请先输入工具标识号的前缀!'); + return false; + } + if(toolId.length !== 2){ + this.$message.error('请先输入工具标识号的前缀!'); + return false; + } + getNextToolId(this.pageData).then(({data}) =>{ + if(data.code === 200){ + //如果获取成功 + debugger + this.pageData.toolId = data.resultRow.toolId; + }else{ + this.$message.error(data.msg); + } + }); + + }, }, created() { // this.factoryList() @@ -459,7 +491,18 @@ export default { } /*下第一列单独设置宽度*/ .customer-row .first-col .el-input--medium { - width: 150px !important; + width: 170px !important; } + /*第一列和第二列的间距调整*/ + .customer-row .el-col-6 + .el-col-5{ + margin-left: 30px; + } + +/*Next Tool Id标签样式*/ + .customer-row .customer-button { + padding: 3px 6px; + font-size: 12px; + border-radius: 5px; + } 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 index 8d67759..cfd1a87 100644 --- a/src/views/modules/tooling/components/com_tool_instance_add_update.vue +++ b/src/views/modules/tooling/components/com_tool_instance_add_update.vue @@ -12,7 +12,7 @@ - + @@ -308,6 +308,13 @@ export default { trigger: ['blur','change'] } ], + description: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], }, } }, @@ -354,6 +361,8 @@ export default { closeDialog(){ //刷新原页面的数据 this.$emit('refreshTooInstanceData'); + this.$emit('changeCurrentToolInstance', this.pageData); + //关闭当前的页面 this.visible = false; //this.$emit('update:visible', false); @@ -403,7 +412,12 @@ export default { /*检查新的工信息*/ saveToolInfoFun(){ if(this.pageData.toolInstance == null || this.pageData.toolInstance == ''){ - this.$message.error('工具样品不能为空!'); + this.$message.error('工具实例不能为空!'); + return false; + } + + if(this.pageData.description == null || this.pageData.description == ''){ + this.$message.error('工具实例描述不能为空!'); return false; } diff --git a/src/views/modules/tooling/manuf_tool.vue b/src/views/modules/tooling/manuf_tool.vue index a760c08..2f7179e 100644 --- a/src/views/modules/tooling/manuf_tool.vue +++ b/src/views/modules/tooling/manuf_tool.vue @@ -35,6 +35,7 @@ :height="height" :data="dataList" border + :row-style="rowToolStyle" ref="mainTable" @row-click="changeData" highlight-current-row @@ -72,7 +73,6 @@ - + - + @@ -167,7 +170,6 @@ export default { toolInstanceDateShow,/*工具实例新增日期和修改组件*/ toolPropertyShow,/*工具属性修改组件*/ }, - name: "null", data() { return { fileContentList: [], @@ -843,7 +845,7 @@ export default { /*切换工具实例*/ changeInstanceData(row){ - this.currentRow = JSON.parse(JSON.stringify(row)); + this.currentInstanceRow = JSON.parse(JSON.stringify(row)); }, @@ -857,7 +859,12 @@ export default { this.totalPage = data.total; if(this.dataList.length > 0){ this.$refs.mainTable.setCurrentRow(this.dataList[0]); - this.currentRow = JSON.parse(JSON.stringify(this.dataList[0])); + //如果已经存在则 不修改默认数值 不然修改默认选择行为第一行 + if(this.currentRow && Object.keys(this.currentRow).length > 0){ + //已经存在 不需要修改 + }else{ + this.currentRow = JSON.parse(JSON.stringify(this.dataList[0])); + } }else { this.currentRow ={} } @@ -926,6 +933,32 @@ export default { this.search() }, + /*调整等待派工单的等待时间*/ + changeCurrentToolInfo(tempData) { + //重置选择行 + this.currentRow = JSON.parse(JSON.stringify(tempData)); + }, + + /*调整等待派工单的等待时间*/ + changeCurrentToolInstance(tempData) { + //重置选择行 + this.currentInstanceRow = JSON.parse(JSON.stringify(tempData)); + }, + + /*选中行的样式*/ + rowToolStyle ({row}) { + if (this.currentRow.site === row.site && this.currentRow.toolId === row.toolId) { + return { 'background-color': '#D9EDF7', cursor: 'pointer' }; + } + }, + + /*选中行的样式*/ + rowToolInstanceStyle ({row}) { + if (this.currentInstanceRow.site === row.site && this.currentInstanceRow.toolInstance === row.toolInstance) { + return { 'background-color': '#D9EDF7', cursor: 'pointer' }; + } + }, + }, activated() {