Browse Source

工具的代码

master
DouDou 1 year ago
parent
commit
b3507fb29a
  1. 114
      src/views/modules/tooling/components/com_tool_info_add_update.vue
  2. 17
      src/views/modules/tooling/manuf_tool.vue

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

@ -8,7 +8,7 @@
<el-row class="customer-row"> <el-row class="customer-row">
<el-col :span="6"> <el-col :span="6">
<el-form-item :label=labels.toolId> <el-form-item :label=labels.toolId>
<el-input v-model="pageData.toolId" ></el-input>
<el-input v-model="pageData.toolId" :disabled="!this.addFlag"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@ -19,7 +19,7 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item :label=labels.site> <el-form-item :label=labels.site>
<span slot="label" style="" @click="getBaseList(1017)"><a herf="#">:</a></span> <span slot="label" style="" @click="getBaseList(1017)"><a herf="#">:</a></span>
<el-input v-model="pageData.site" ></el-input>
<el-input v-model="pageData.site" :disabled="!this.addFlag"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@ -49,7 +49,10 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item :label=labels.schedCapacity> <el-form-item :label=labels.schedCapacity>
<el-input v-model="pageData.schedCapacity" ></el-input>
<el-select filterable v-model="pageData.schedCapacity" style="width: 135px">
<el-option label="Infinite capacity" value="Infinite capacity"></el-option>
<el-option label="Finite capacity" value="Finite capacity"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -57,7 +60,12 @@
<el-row class="customer-row"> <el-row class="customer-row">
<el-col :span="6"> <el-col :span="6">
<el-form-item :label=labels.calibrationControl> <el-form-item :label=labels.calibrationControl>
<el-input v-model="pageData.calibrationControl" ></el-input>
<el-select filterable v-model="pageData.calibrationControl" style="width: 135px">
<el-option label="No Calibration Required" value="No Calibration Required"></el-option>
<el-option label="Calibration Required" value="Calibration Required"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@ -71,8 +79,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-checkbox style="margin-left: 10px; margin-top: 18px;" v-model="pageData.enabledForControlPlanDb" true-label="true" false-label="false"
:label=labels.enabledForControlPlanDb name="type"></el-checkbox>
<el-checkbox style="margin-left: 10px; margin-top: 18px;" v-model="pageData.enabledForControlPlanDb" true-label="TRUE" false-label="FALSE"
:label=labels.enabledForControlPlanDb ></el-checkbox>
</el-col> </el-col>
</el-row> </el-row>
<!-- 第四行 --> <!-- 第四行 -->
@ -100,7 +108,7 @@
</el-form> </el-form>
</el-container> </el-container>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="addToolInstanceIdFun">{{ buttons.confirmButton }}</el-button>
<el-button type="primary" @click="saveToolInfoFun">{{ buttons.confirmButton }}</el-button>
<el-button type="primary" @click="closeDialog">{{buttons.closeButton}}</el-button> <el-button type="primary" @click="closeDialog">{{buttons.closeButton}}</el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -130,7 +138,7 @@ export default {
titleCon: '工具新增', titleCon: '工具新增',
showDefault: false, showDefault: false,
visible: false, visible: false,
readonlyFlag: true,
addFlag: false,
pageData: { pageData: {
site: this.$store.state.user.site, site: this.$store.state.user.site,
username: this.$store.state.user.name, username: this.$store.state.user.name,
@ -139,17 +147,16 @@ export default {
toolType: '', toolType: '',
toolTypeDesc: '', toolTypeDesc: '',
calendarId: '', calendarId: '',
schedCapacity: '',
schedCapacity: 'Infinite capacity',
alternateToolId: '', alternateToolId: '',
alternateToolDesc: '', alternateToolDesc: '',
calibrationControl: '', calibrationControl: '',
calibrationTime: '',
enabledForControlPlanDb: '',
calibrationTime: 0,
enabledForControlPlanDb: 'TRUE',
lastUsed: '', lastUsed: '',
noteText: '', noteText: '',
ifsRowId: 0, ifsRowId: 0,
ifsRowVersion: '', ifsRowVersion: '',
addFlag: false
}, },
dataListLoading: false, dataListLoading: false,
labels: { labels: {
@ -276,22 +283,21 @@ export default {
this.pageData.toolId = ''; this.pageData.toolId = '';
this.pageData.toolType = ''; this.pageData.toolType = '';
this.pageData.toolDesc = ''; this.pageData.toolDesc = '';
this.pageData.toolType = '';
this.pageData.toolTypeDesc = ''; this.pageData.toolTypeDesc = '';
this.pageData.calendarId = ''; this.pageData.calendarId = '';
this.pageData.schedCapacity = '';
this.pageData.schedCapacity = 'Infinite capacity';
this.pageData.alternateToolId = ''; this.pageData.alternateToolId = '';
this.pageData.alternateToolDesc = ''; this.pageData.alternateToolDesc = '';
this.pageData.calibrationControl = '';
this.pageData.calibrationTime = '';
this.pageData.enabledForControlPlanDb = '';
this.pageData.calibrationControl = 'No Calibration Required';
this.pageData.calibrationTime = 0;
this.pageData.enabledForControlPlanDb = 'FALSE';
this.pageData.lastUsed = ''; this.pageData.lastUsed = '';
this.pageData.noteText = ''; this.pageData.noteText = '';
}else{ }else{
this.titleCon = '工具修改'; this.titleCon = '工具修改';
this.pageData = JSON.parse(JSON.stringify(toolInfo)); this.pageData = JSON.parse(JSON.stringify(toolInfo));
} }
this.pageData.addFlag = addFlag;
this.addFlag = addFlag;
}, },
/*关闭modal*/ /*关闭modal*/
@ -332,53 +338,49 @@ export default {
} }
}, },
/*检查新的工具实例信息*/
checkToolInstanceIdFun(){
if(this.pageData.toolInstanceId == null || this.pageData.toolInstanceId == ''){
this.$message.error(this.labels.pleaseScanToolInstanceId);
/*检查新的工信息*/
saveToolInfoFun(){
if(this.pageData.toolId == null || this.pageData.toolId == ''){
this.$message.error('工具标识号不能为空!');
return false; return false;
} }
checkToolInstanceId(this.pageData).then(({data}) => {
//
if(data.code == 500){
this.$message.error(data.msg);
}else if (data.resultMap.resultCode == 201){
let msg = data.resultMap.resultMsg;
this.$confirm(msg, '提示', {
confirmButtonText: this.labels.confirmLabel,
cancelButtonText: this.labels.cancelLabel,
type: "warning"
}).then(() => {
this.pageData.checkFlag = true;
}).catch(() => {
this.pageData.checkFlag = false;
});
if(this.pageData.toolDesc == null || this.pageData.toolDesc == ''){
this.$message.error('工具描述不能为空!');
return false;
}
if(this.pageData.toolType == null || this.pageData.toolType == ''){
this.$message.error('工具类型不能为空!');
return false;
}
if(this.pageData.calendarId == null || this.pageData.calendarId == ''){
this.$message.error('日历标识不能为空!');
return false;
}
if(this.pageData.calibrationTime == null || this.pageData.calibrationTime === ''){
this.$message.error('校准间隔时间不能为空!');
return false;
}
//
if (this.addFlag){
insertToolInfo(this.pageData).then(({data}) =>{
if(data.code === 200){
this.$message.success('操作成功!');
this.closeDialog();
}else{ }else{
this.pageData.checkFlag = true;
this.$message.error(data.msg);
} }
}); });
},
/*添加刀模记录*/
addToolInstanceIdFun(){
/*添加工具的实例*/
addToolInstanceId(this.pageData).then(({data}) => {
if(data.code == 500){
this.$message.error(data.msg);
}else{ }else{
//
this.pageData.toolInstanceId = '';
this.pageData.oriToolInstanceId = '';
this.pageData.consumeQty = '';
this.pageData.oriConsumeQty = '';
this.pageData.totalConsumeQty = '';
modifyToolInfo(this.pageData).then(({data}) =>{
if(data.code === 200){
this.$message.success('操作成功!');
this.closeDialog();
}else{
this.$message.error(data.msg);
} }
}); });
}
}, },
}, },
created() { created() {
// this.factoryList() // this.factoryList()

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

@ -47,8 +47,8 @@
fixed="right" fixed="right"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<a type="text" size="small" v-if="scope.row.statusCode==='05'" @click="comfirmApply(scope.row)">下达</a>
<a type="text" size="small" v-if="scope.row.statusCode==='05'" @click="cancelApply(scope.row)">取消申请</a>
<a type="text" size="small" @click="editToolInfoModal(scope.row)">编辑</a>
<a type="text" size="small" @click="deleteToolInfoConfirm(scope.row)">删除</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -621,7 +621,6 @@ export default {
}, },
/* 列表方法的回调 */ /* 列表方法的回调 */
getBaseData (val) { getBaseData (val) {
debugger;
if (this.tagNo === 1016) { if (this.tagNo === 1016) {
this.searchData.toolType = val.tool_type; this.searchData.toolType = val.tool_type;
} }
@ -681,6 +680,13 @@ export default {
}); });
}, },
/*编辑工具信息*/
editToolInfoModal(toolInfo){
//modal
this.$nextTick(() => {
this.$refs.toolInfoAddUpdate.init(toolInfo, false)
});
},
// //
changeData(row) { changeData(row) {
@ -694,7 +700,6 @@ export default {
this.searchData.pageSize = this.pageSize this.searchData.pageSize = this.pageSize
this.searchData.pageIndex = this.pageIndex this.searchData.pageIndex = this.pageIndex
getToolInfoList(this.searchData).then(({data}) => { getToolInfoList(this.searchData).then(({data}) => {
debugger;
if (data.code == 200) { if (data.code == 200) {
this.dataList = data.rows; this.dataList = data.rows;
this.totalPage = data.total; this.totalPage = data.total;
@ -719,10 +724,6 @@ export default {
if (this.activeName == 'detail') { if (this.activeName == 'detail') {
this.getToolInstanceList(); this.getToolInstanceList();
} }
if (this.activeName == 'down') {
this.getFileContentData();
}
}, },

Loading…
Cancel
Save