3 changed files with 549 additions and 60 deletions
-
7src/api/tool/com_tool_instance_add_update.js
-
424src/views/modules/tooling/components/com_tool_instance_add_update.vue
-
178src/views/modules/tooling/manuf_tool.vue
@ -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) |
|||
@ -0,0 +1,424 @@ |
|||
<template> |
|||
<div class="customer-css"> |
|||
<el-dialog :title="titleCon" v-drag :visible.sync="visible" |
|||
width="750px" style="height: 650px;" class="customer-dialog"> |
|||
<el-container style="height: 265px;"> |
|||
<el-form :inline="true" label-position="top" label-width="80px"> |
|||
<!-- 第一行 --> |
|||
<el-row class="customer-row"> |
|||
<el-col :span="4"> |
|||
<el-form-item label="工具样品:"> |
|||
<el-input v-model="pageData.toolInstance" :disabled="!this.addFlag"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="描述:"> |
|||
<el-input v-model="pageData.description" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="最近校对日期:"> |
|||
<el-date-picker |
|||
value-format="yyyy-MM-dd" |
|||
style="width: 100%" |
|||
v-model="pageData.lastCalibrationDate" |
|||
type="date" |
|||
placeholder="最近校对日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="下一个校对日期:"> |
|||
<el-input v-model="pageData.nextCalibrationDate" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="有效性:"> |
|||
<el-input v-model="pageData.state" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<!-- 第二行 --> |
|||
<el-row class="customer-row"> |
|||
<el-col :span="4"> |
|||
<el-form-item label="工具/设备:"> |
|||
<el-input v-model="pageData.toolResourceId" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="工具/设备描述:"> |
|||
<el-input v-model="pageData.toolResourceDesc" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="对象标识:"> |
|||
<span slot="label" style="" @click="getBaseList(1020)"><a herf="#">对象标识:</a></span> |
|||
<el-input v-model="pageData.objectId" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="对象描述:"> |
|||
<el-input v-model="pageData.objectDesc" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="最近使用情况报告:"> |
|||
<el-input v-model="pageData.lastUsageReport" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<!-- 第三行 --> |
|||
<el-row class="customer-row"> |
|||
<el-col :span="4"> |
|||
<el-form-item label="工作中心:"> |
|||
<span slot="label" style="" @click="getBaseList(1021)"><a herf="#">工作中心:</a></span> |
|||
<el-input v-model="pageData.normalWorkCenterNo"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="描述:"> |
|||
<el-input v-model="pageData.normalWorkCenterDesc" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="生产线:"> |
|||
<span slot="label" style="" @click="getBaseList(1022)"><a herf="#">生产线:</a></span> |
|||
<el-input v-model="pageData.normalProductionLine" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="描述:"> |
|||
<el-input v-model="pageData.normalProductionLineDesc" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="鉴别:"> |
|||
<el-input v-model="pageData.toolDiscrimination" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<!-- 第四行 --> |
|||
<el-row class="customer-row"> |
|||
<el-col :span="4"> |
|||
<el-form-item label="线性:"> |
|||
<el-input v-model="pageData.toolLinearity"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="重复性:"> |
|||
<el-input v-model="pageData.toolRepeatability" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="偏差性:"> |
|||
<el-input v-model="pageData.toolBias"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="稳定性:"> |
|||
<el-input v-model="pageData.toolStability" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="4"> |
|||
<el-form-item label="再现能力:"> |
|||
<el-input v-model="pageData.toolReproducibility" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<!-- 第五行 --> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<el-form-item label="备注:"> |
|||
<el-input type="textarea" v-model="pageData.noteText" :rows="2" style="width: 725px;height: 20px"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</el-container> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="saveToolInfoFun">{{ buttons.confirmButton }}</el-button> |
|||
<el-button type="primary" @click="closeDialog">{{buttons.closeButton}}</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
<!-- 选择 --> |
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
insertToolInstance, |
|||
modifyToolInstance, |
|||
} from '@/api/tool/com_tool_instance_add_update.js'; |
|||
|
|||
/*组件*/ |
|||
import Chooselist from '@/views/modules/common/Chooselist'; /*选择组件*/ |
|||
|
|||
|
|||
var functionId = 'C106003002'; |
|||
export default { |
|||
components: { |
|||
Chooselist,/*选择组件*/ |
|||
}, |
|||
data() { |
|||
return { |
|||
titleCon: '工具新增', |
|||
showDefault: false, |
|||
visible: false, |
|||
addFlag: false, |
|||
pageData: { |
|||
site: this.$store.state.user.site, |
|||
username: this.$store.state.user.name, |
|||
toolId: '', |
|||
toolInstance: '', |
|||
description: '', |
|||
lastCalibrationDate: '', |
|||
nextCalibrationDate: '', |
|||
objectId: '', |
|||
objectDesc: '', |
|||
toolResourceId: '', |
|||
toolResourceDesc: '', |
|||
lastUsageReport: '', |
|||
normalWorkCenterNo: '', |
|||
normalWorkCenterDesc: '', |
|||
normalProductionLine: '', |
|||
normalProductionLineDesc: '', |
|||
state: '', |
|||
toolDiscrimination: '', |
|||
toolLinearity: '', |
|||
toolRepeatability: '', |
|||
toolBias: '', |
|||
toolStability: '', |
|||
toolReproducibility: '', |
|||
noteText: '', |
|||
ifsRowId: 0, |
|||
ifsRowVersion: '', |
|||
}, |
|||
dataListLoading: false, |
|||
buttons: { |
|||
confirmButton: '确定', |
|||
closeButton: '关闭', |
|||
}, |
|||
buttonList: [ |
|||
{ |
|||
functionId: functionId, |
|||
languageValue: '确定', |
|||
objectId: 'confirmButton', |
|||
objectType: 'button', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '关闭', |
|||
objectId: 'closeButton', |
|||
objectType: 'button', |
|||
tableId: '*' |
|||
}, |
|||
], |
|||
queryButton: { |
|||
functionId: functionId, |
|||
table_id: '*', |
|||
languageCode: this.$i18n.locale, |
|||
objectType: 'button' |
|||
}, |
|||
labelsList: [ |
|||
{ |
|||
functionId: functionId, |
|||
languageValue: '刀模板', |
|||
objectId: 'titleCon', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '换刀模', |
|||
objectId: 'replaceToolTitle', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '换刀模', |
|||
objectId: 'replaceTool', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '原工具实例编码:', |
|||
objectId: 'oriToolInstanceId', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '本卷生产数量:', |
|||
objectId: 'currentRollProdQty', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '之前卷生产数量:', |
|||
objectId: 'oriRollProdQty', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '累积生产数量:', |
|||
objectId: 'totalRollProdQty', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '请扫描工具实例!', |
|||
objectId: 'pleaseScanToolInstanceId', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '确认', |
|||
objectId: 'confirmLabel', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, { |
|||
functionId: functionId, |
|||
languageValue: '取消', |
|||
objectId: 'cancelLabel', |
|||
objectType: 'label', |
|||
tableId: '*' |
|||
}, |
|||
], |
|||
queryLabel: { |
|||
functionId: functionId, |
|||
table_id: '*', |
|||
languageCode: this.$i18n.locale, |
|||
objectType: 'label' |
|||
}, |
|||
} |
|||
}, |
|||
methods: { |
|||
|
|||
//初始化组件的参数 |
|||
init(toolInfo, addFlag) { |
|||
this.visible = true; |
|||
//判断是否是新增 |
|||
if(addFlag){ |
|||
this.titleCon = '工具实例新增'; |
|||
this.pageData.site = toolInfo.site; |
|||
this.pageData.toolId = toolInfo.toolId; |
|||
this.pageData.toolInstance = ''; |
|||
this.pageData.description = ''; |
|||
this.pageData.lastCalibrationDate = ''; |
|||
this.pageData.nextCalibrationDate = ''; |
|||
this.pageData.objectId = ''; |
|||
this.pageData.objectDesc = ''; |
|||
this.pageData.toolResourceId = ''; |
|||
this.pageData.toolResourceDesc = ''; |
|||
this.pageData.lastUsageReport = ''; |
|||
this.pageData.normalWorkCenterNo = ''; |
|||
this.pageData.normalWorkCenterDesc = ''; |
|||
this.pageData.normalProductionLine = ''; |
|||
this.pageData.normalProductionLineDesc = ''; |
|||
this.pageData.state = ''; |
|||
this.pageData.toolDiscrimination = ''; |
|||
this.pageData.toolLinearity = ''; |
|||
this.pageData.toolRepeatability = ''; |
|||
this.pageData.toolBias = ''; |
|||
this.pageData.toolStability = ''; |
|||
this.pageData.toolReproducibility = ''; |
|||
this.pageData.noteText = ''; |
|||
}else{ |
|||
this.titleCon = '工具修改'; |
|||
this.pageData = JSON.parse(JSON.stringify(toolInfo)); |
|||
} |
|||
this.addFlag = addFlag; |
|||
}, |
|||
|
|||
/*关闭modal*/ |
|||
closeDialog(){ |
|||
//刷新原页面的数据 |
|||
this.$emit('refreshTooInstanceData'); |
|||
//关闭当前的页面 |
|||
this.visible = false; |
|||
//this.$emit('update:visible', false); |
|||
}, |
|||
|
|||
// 获取基础数据列表S |
|||
getBaseList (val, type) { |
|||
this.tagNo = val |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
if(val === 1020){ |
|||
let strCon = ' AND site = \''+ this.pageData.site+'\''; |
|||
this.$refs.baseList.init(val, strVal, strCon) |
|||
}else if(val === 1021){ |
|||
let strCon = ' AND site = \''+ this.pageData.site+'\''; |
|||
this.$refs.baseList.init(val, strVal, strCon) |
|||
}else if(val === 1022){ |
|||
let strCon = ' AND site = \''+ this.pageData.site+'\''; |
|||
this.$refs.baseList.init(val, strVal, strCon) |
|||
}else{ |
|||
this.$refs.baseList.init(val, strVal) |
|||
} |
|||
|
|||
}) |
|||
}, |
|||
/* 列表方法的回调 */ |
|||
getBaseData (val) { |
|||
if (this.tagNo === 1020) { |
|||
this.pageData.objectId = val.mch_code; |
|||
this.pageData.objectDesc = val.mch_name; |
|||
}else if (this.tagNo === 1021) { |
|||
this.pageData.normalWorkCenterNo = val.work_center_no; |
|||
this.pageData.normalWorkCenterDesc = val.work_center_desc; |
|||
}else if (this.tagNo === 1022) { |
|||
this.pageData.normalProductionLine = val.production_line; |
|||
this.pageData.normalProductionLineDesc = val.description; |
|||
} |
|||
}, |
|||
|
|||
/*检查新的工信息*/ |
|||
saveToolInfoFun(){ |
|||
if(this.pageData.toolInstance == null || this.pageData.toolInstance == ''){ |
|||
this.$message.error('工具样品不能为空!'); |
|||
return false; |
|||
} |
|||
|
|||
//判断是否是新增 |
|||
if (this.addFlag){ |
|||
insertToolInstance(this.pageData).then(({data}) =>{ |
|||
if(data.code === 200){ |
|||
this.$message.success('操作成功!'); |
|||
this.closeDialog(); |
|||
}else{ |
|||
this.$message.error(data.msg); |
|||
} |
|||
}); |
|||
}else{ |
|||
modifyToolInstance(this.pageData).then(({data}) =>{ |
|||
if(data.code === 200){ |
|||
this.$message.success('操作成功!'); |
|||
this.closeDialog(); |
|||
}else{ |
|||
this.$message.error(data.msg); |
|||
} |
|||
}); |
|||
} |
|||
}, |
|||
}, |
|||
created() { |
|||
// this.factoryList() |
|||
// this.getLanguageList() |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
|
|||
/*调整两个input的间距*/ |
|||
.customer-row .el-col-4 + .el-col-4 { |
|||
margin-left: 25px; |
|||
} |
|||
|
|||
.customer-row .el-input--medium { |
|||
width: 135px !important; |
|||
} |
|||
|
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue