ruanqi 2 years ago
parent
commit
64bab812e5
  1. 1
      src/api/knifemold/tool-info.js
  2. 112
      src/views/modules/knifemold/tool-info.vue

1
src/api/knifemold/tool-info.js

@ -55,3 +55,4 @@ export const itemSaveData = data => createAPI(`toolInfo/itemSaveData`, 'POST', d
export const getItemData = data => createAPI(`toolInfo/getItemData`, 'POST', data) export const getItemData = data => createAPI(`toolInfo/getItemData`, 'POST', data)
export const deleteItemModal = data => createAPI(`toolInfo/deleteItemModal`, 'POST', data) export const deleteItemModal = data => createAPI(`toolInfo/deleteItemModal`, 'POST', data)
export const checkAssessRecord = data => createAPI(`toolInfo/checkAssessRecord`, 'POST', data) export const checkAssessRecord = data => createAPI(`toolInfo/checkAssessRecord`, 'POST', data)
export const refreshItemModal = data => createAPI(`toolInfo/refreshItemModal`, 'POST', data)

112
src/views/modules/knifemold/tool-info.vue

@ -505,7 +505,8 @@
<el-dialog title="工具属性清单" :close-on-click-modal="false" v-drag :visible.sync="toolItemModelFlag" width="830px"> <el-dialog title="工具属性清单" :close-on-click-modal="false" v-drag :visible.sync="toolItemModelFlag" width="830px">
<el-form :inline="true" label-position="top" > <el-form :inline="true" label-position="top" >
<el-form-item > <el-form-item >
<el-button type="primary" @click="addItemModal()">新增</el-button>
<!-- <el-button type="primary" @click="addItemModal()">新增</el-button>-->
<el-button type="primary" @click="refreshItemModal()">刷新属性</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
@ -537,7 +538,6 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<a type="text" size="small" @click="updateItemModal(scope.row)">编辑</a> <a type="text" size="small" @click="updateItemModal(scope.row)">编辑</a>
<a type="text" size="small" @click="deleteItemModal(scope.row)">删除</a>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -547,12 +547,12 @@
</el-dialog> </el-dialog>
<el-dialog title="属性项目" :close-on-click-modal="false" v-drag :visible.sync="itemModalFlag" width="310px"> <el-dialog title="属性项目" :close-on-click-modal="false" v-drag :visible.sync="itemModalFlag" width="310px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item >
<el-link slot="label" @click="getBaseList(1004)">属性编码</el-link>
<el-input v-model="itemData.toolItemNo" :disabled="itemModalDisableFlag" style="width: 120px" @change="changeItemDisable()" ></el-input>
<el-form-item label="属性编码:">
<!-- <el-link slot="label" @click="getBaseList(1004)">属性编码</el-link>-->
<el-input v-model="itemData.propertiesItemNo" :disabled="itemModalDisableFlag" style="width: 120px" @change="changeItemDisable()" ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="属性名称:"> <el-form-item label="属性名称:">
<el-input v-model="itemData.toolItemDesc" disabled style="width: 120px"></el-input>
<el-input v-model="itemData.itemDesc" disabled style="width: 120px"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
@ -593,7 +593,7 @@ import {
getItemModal, getItemModal,
itemSaveData, itemSaveData,
getItemData, getItemData,
deleteItemModal,
refreshItemModal,
} from '@/api/knifemold/tool-info.js' } from '@/api/knifemold/tool-info.js'
import {printToolData} from '@/api/knifemold/receive.js' import {printToolData} from '@/api/knifemold/receive.js'
import {searchProcessRouteTool} from '@/api/base/productProcessRoute.js' import {searchProcessRouteTool} from '@/api/base/productProcessRoute.js'
@ -1887,7 +1887,7 @@ export default {
serialNumber: '101013Table2EamPropertiesItemID', serialNumber: '101013Table2EamPropertiesItemID',
tableId: "101013Table2", tableId: "101013Table2",
tableName: "点检项目表", tableName: "点检项目表",
columnProp: 'toolItemNo',
columnProp: 'propertiesItemNo',
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
columnLabel: '属性编码', columnLabel: '属性编码',
@ -1905,7 +1905,7 @@ export default {
serialNumber: '101013Table2EamPropertiesItemDesc', serialNumber: '101013Table2EamPropertiesItemDesc',
tableId: "101013Table2", tableId: "101013Table2",
tableName: "点检项目表", tableName: "点检项目表",
columnProp: 'toolItemDesc',
columnProp: 'itemDesc',
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
columnLabel: '属性名称', columnLabel: '属性名称',
@ -1976,8 +1976,8 @@ export default {
id:0, id:0,
site:'', site:'',
toolID:'', toolID:'',
toolItemNo:'',
toolItemDesc:'',
propertiesItemNo:'',
itemDesc:'',
textValue:'', textValue:'',
numValue:'', numValue:'',
}, },
@ -2173,11 +2173,11 @@ export default {
if (this.tagNo === 7) { if (this.tagNo === 7) {
this.editHeaderData.umid = val.UMID this.editHeaderData.umid = val.UMID
} }
if (this.tagNo === 1004) {
this.itemData.toolItemNo = val.ItemNo
this.itemData.toolItemDesc = val.ItemDesc
this.changeItemDisable();
}
// if (this.tagNo === 1004) {
// this.itemData.itemNo = val.ItemNo
// this.itemData.itemDesc = val.ItemDesc
// this.changeItemDisable();
// }
}, },
// //
getBaseList(val, number) { getBaseList(val, number) {
@ -2191,12 +2191,12 @@ export default {
if (val === 70) { if (val === 70) {
strVal = this.headerData.toolId strVal = this.headerData.toolId
} }
if (val === 1004) {
if(this.itemModalDisableFlag){
return false
}
strVal = this.itemData.toolItemNo
}
// if (val === 1004) {
// if(this.itemModalDisableFlag){
// return false
// }
// strVal = this.itemData.itemNo
// }
if (val === 23) { if (val === 23) {
strVal = this.editHeaderData.familyId strVal = this.editHeaderData.familyId
} }
@ -2426,7 +2426,6 @@ export default {
}, },
// //
searchItemList(){ searchItemList(){
debugger
this.itemModalData.site=this.headerData.site this.itemModalData.site=this.headerData.site
this.itemModalData.toolID=this.headerData.toolId this.itemModalData.toolID=this.headerData.toolId
getItemModal(this.itemModalData).then(({data}) => { getItemModal(this.itemModalData).then(({data}) => {
@ -2437,29 +2436,14 @@ export default {
this.searchItemList(); this.searchItemList();
this.toolItemModelFlag=true; this.toolItemModelFlag=true;
}, },
addItemModal(){
this.itemData={
id:0,
site:this.headerData.site,
toolID:this.headerData.toolId,
toolItemNo:'',
toolItemDesc:'',
textValue:'',
numValue:null,
}
this.itemTextDisableFlag=true
this.itemNumberDisableFlag=true
this.itemModalDisableFlag=false
this.itemModalFlag=true;
},
itemSaveData(){ itemSaveData(){
if(this.itemData.toolID==''||this.itemData.toolID==null){
if(this.itemData.partNo==''||this.itemData.partNo==null){
this.$alert('未选择工具!', '错误', { this.$alert('未选择工具!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false return false
} }
if(this.itemData.toolItemNo==''||this.itemData.toolItemNo==null){
if(this.itemData.propertiesItemNo==''||this.itemData.propertiesItemNo==null){
this.$alert('未选择属性!', '错误', { this.$alert('未选择属性!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
@ -2488,9 +2472,9 @@ export default {
this.itemData={ this.itemData={
id:1, id:1,
site:row.site, site:row.site,
toolID:row.toolID,
toolItemNo:row.toolItemNo,
toolItemDesc:row.toolItemDesc,
partNo:row.partNo,
propertiesItemNo:row.propertiesItemNo,
itemDesc:row.itemDesc,
textValue:row.textValue, textValue:row.textValue,
numValue:row.numValue, numValue:row.numValue,
} }
@ -2504,26 +2488,9 @@ export default {
this.itemModalDisableFlag=true this.itemModalDisableFlag=true
this.itemModalFlag=true; this.itemModalFlag=true;
}, },
deleteItemModal(row){
this.$confirm('确定进行删除操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//
deleteItemModal(row).then(({data}) => {
if (data.code === 0) {
this.searchItemList();
this.$message.success(data.msg)
} else {
this.$message.warning(data.msg)
}
})
})
},
changeItemDisable(){ changeItemDisable(){
let inData={ let inData={
toolItemNo:this.itemData.toolItemNo
itemNo:this.itemData.itemNo
} }
getItemData(inData).then(({data}) => { getItemData(inData).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
@ -2537,6 +2504,29 @@ export default {
} }
}) })
}, },
refreshItemModal(){
let inData={
site:this.itemModalData.site,
toolId:this.itemModalData.toolID
}
refreshItemModal(inData).then(({data}) => {
if (data && data.code === 0) {
this.searchItemList();
this.$message({
message: '刷新成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
} }
} }
</script> </script>

Loading…
Cancel
Save