Browse Source

工具的代码

master
DouDou 1 year ago
parent
commit
457d55fd85
  1. 2
      src/api/tool/com_tool_info_add_update.js
  2. 47
      src/views/modules/tooling/components/com_tool_info_add_update.vue
  3. 18
      src/views/modules/tooling/components/com_tool_instance_add_update.vue
  4. 45
      src/views/modules/tooling/manuf_tool.vue

2
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 modifyToolInfo = data => createAPI('plm/tool/modifyToolInfo', 'POST', data)
export const getNextToolId = data => createAPI('plm/tool/getNextToolId', 'POST', data)

47
src/views/modules/tooling/components/com_tool_info_add_update.vue

@ -8,6 +8,7 @@
<el-row class="customer-row" > <el-row class="customer-row" >
<el-col :span="6" class="first-col"> <el-col :span="6" class="first-col">
<el-form-item :label=labels.toolId prop="toolId"> <el-form-item :label=labels.toolId prop="toolId">
<span slot="label" ><a herf="#">工具标识号 <el-button type="primary" v-if="addFlag" class="customer-button" @click="nextToolIdFun">Next Tool ID</el-button></a></span>
<el-input v-model="pageData.toolId" style="width: 180px;" :disabled="!this.addFlag"></el-input> <el-input v-model="pageData.toolId" style="width: 180px;" :disabled="!this.addFlag"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -60,7 +61,7 @@
<el-row class="customer-row"> <el-row class="customer-row">
<el-col :span="6" class="first-col"> <el-col :span="6" class="first-col">
<el-form-item :label=labels.calibrationControl> <el-form-item :label=labels.calibrationControl>
<el-select filterable v-model="pageData.calibrationControl" style="width: 150px">
<el-select filterable v-model="pageData.calibrationControl" style="width: 170px">
<el-option label="No Calibration Required" value="No Calibration Required"></el-option> <el-option label="No Calibration Required" value="No Calibration Required"></el-option>
<el-option label="Calibration Required" value="Calibration Required"></el-option> <el-option label="Calibration Required" value="Calibration Required"></el-option>
</el-select> </el-select>
@ -126,6 +127,7 @@
import { import {
insertToolInfo, insertToolInfo,
modifyToolInfo, modifyToolInfo,
getNextToolId,
} from '@/api/tool/com_tool_info_add_update.js'; } from '@/api/tool/com_tool_info_add_update.js';
/*组件*/ /*组件*/
@ -349,6 +351,7 @@ export default {
closeDialog(){ closeDialog(){
// //
this.$emit('refreshTooInfoData'); this.$emit('refreshTooInfoData');
this.$emit('changeCurrentToolInfo', this.pageData)
// //
this.visible = false; this.visible = false;
//this.$emit('update: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() { created() {
// this.factoryList() // this.factoryList()
@ -459,7 +491,18 @@ export default {
} }
/*下第一列单独设置宽度*/ /*下第一列单独设置宽度*/
.customer-row .first-col .el-input--medium { .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;
}
</style> </style>

18
src/views/modules/tooling/components/com_tool_instance_add_update.vue

@ -12,7 +12,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="工具实例描述">
<el-form-item label="工具实例描述" prop="description">
<el-input v-model="pageData.description" ></el-input> <el-input v-model="pageData.description" ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -308,6 +308,13 @@ export default {
trigger: ['blur','change'] trigger: ['blur','change']
} }
], ],
description: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
}, },
} }
}, },
@ -354,6 +361,8 @@ export default {
closeDialog(){ closeDialog(){
// //
this.$emit('refreshTooInstanceData'); this.$emit('refreshTooInstanceData');
this.$emit('changeCurrentToolInstance', this.pageData);
// //
this.visible = false; this.visible = false;
//this.$emit('update:visible', false); //this.$emit('update:visible', false);
@ -403,7 +412,12 @@ export default {
/*检查新的工信息*/ /*检查新的工信息*/
saveToolInfoFun(){ saveToolInfoFun(){
if(this.pageData.toolInstance == null || this.pageData.toolInstance == ''){ 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; return false;
} }

45
src/views/modules/tooling/manuf_tool.vue

@ -35,6 +35,7 @@
:height="height" :height="height"
:data="dataList" :data="dataList"
border border
:row-style="rowToolStyle"
ref="mainTable" ref="mainTable"
@row-click="changeData" @row-click="changeData"
highlight-current-row highlight-current-row
@ -72,7 +73,6 @@
</el-table> </el-table>
<el-pagination <el-pagination
@size-change="sizeChangeHandle" @size-change="sizeChangeHandle"
@row-click="changeInstanceData"
:current-page="pageIndex" :current-page="pageIndex"
:page-sizes="[20, 50, 100, 1000]" :page-sizes="[20, 50, 100, 1000]"
:page-size="pageSize" :page-size="pageSize"
@ -88,6 +88,9 @@
:data="detailList" :data="detailList"
height="240" height="240"
border border
@row-click="changeInstanceData"
highlight-current-row
:row-style="rowToolInstanceStyle"
v-loading="dataListLoading" v-loading="dataListLoading"
style="width: 100%; "> style="width: 100%; ">
<el-table-column <el-table-column
@ -126,11 +129,11 @@
<!-- 选择组件 --> <!-- 选择组件 -->
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<!-- 工具信息 --> <!-- 工具信息 -->
<toolInfoAddUpdate ref="toolInfoAddUpdate" :close-on-click-modal="false" @refreshTooInfoData="refreshTooInfoData">
<toolInfoAddUpdate ref="toolInfoAddUpdate" :close-on-click-modal="false" @refreshTooInfoData="refreshTooInfoData" @changeCurrentToolInfo="changeCurrentToolInfo">
</toolInfoAddUpdate> </toolInfoAddUpdate>
<!-- 工具实例信息 --> <!-- 工具实例信息 -->
<toolInstanceAddUpdate ref="toolInstanceAddUpdate" :close-on-click-modal="false" @refreshTooInstanceData="refreshTooInstanceData">
<toolInstanceAddUpdate ref="toolInstanceAddUpdate" :close-on-click-modal="false" @refreshTooInstanceData="refreshTooInstanceData" @changeCurrentToolInstance="changeCurrentToolInstance">
</toolInstanceAddUpdate> </toolInstanceAddUpdate>
<!-- 工具实例生命周期信息 --> <!-- 工具实例生命周期信息 -->
@ -167,7 +170,6 @@ export default {
toolInstanceDateShow,/*工具实例新增日期和修改组件*/ toolInstanceDateShow,/*工具实例新增日期和修改组件*/
toolPropertyShow,/*工具属性修改组件*/ toolPropertyShow,/*工具属性修改组件*/
}, },
name: "null",
data() { data() {
return { return {
fileContentList: [], fileContentList: [],
@ -843,7 +845,7 @@ export default {
/*切换工具实例*/ /*切换工具实例*/
changeInstanceData(row){ 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; this.totalPage = data.total;
if(this.dataList.length > 0){ if(this.dataList.length > 0){
this.$refs.mainTable.setCurrentRow(this.dataList[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 { }else {
this.currentRow ={} this.currentRow ={}
} }
@ -926,6 +933,32 @@ export default {
this.search() 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() { activated() {

Loading…
Cancel
Save