|
|
|
@ -1,11 +1,14 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<basic-container> |
|
|
|
<basic-container> |
|
|
|
|
|
|
|
|
|
|
|
<avue-crud :option="option" :table-loading="loading" :data="data" v-model="form" v-model:page="page" ref="crud" |
|
|
|
<avue-crud :option="option" :table-loading="loading" :data="data" v-model="form" |
|
|
|
|
|
|
|
v-model:page="page" ref="crud" |
|
|
|
|
|
|
|
v-model:search="searchParams" |
|
|
|
@row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" |
|
|
|
@row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" |
|
|
|
@row-update="rowUpdate" |
|
|
|
@row-update="rowUpdate" |
|
|
|
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
|
|
|
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
|
|
|
@refresh-change="refreshChange" @on-load="onLoad"> |
|
|
|
@refresh-change="refreshChange" @on-load="onLoad" |
|
|
|
|
|
|
|
:beforeOpen="beforeOpen"> |
|
|
|
<template #menu-left> |
|
|
|
<template #menu-left> |
|
|
|
<el-button type="primary" @click="handleAdd()">新增</el-button> |
|
|
|
<el-button type="primary" @click="handleAdd()">新增</el-button> |
|
|
|
<el-button type="danger" @click="batchDel()">删除</el-button> |
|
|
|
<el-button type="danger" @click="batchDel()">删除</el-button> |
|
|
|
@ -16,12 +19,20 @@ |
|
|
|
<template #menu="{ row }"> |
|
|
|
<template #menu="{ row }"> |
|
|
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template #partId-form="{type}"> |
|
|
|
<template #partCode-form="{type}"> |
|
|
|
<el-select v-if="type == 'edit'" placeholder="请选择零件" v-model="form.partId" |
|
|
|
<el-select v-if="type == 'edit'" remote filterable :remote-method="queryPart" |
|
|
|
|
|
|
|
:loading="partLoading" placeholder="请选择零件" v-model="form.partId" |
|
|
|
@change="changePart"> |
|
|
|
@change="changePart"> |
|
|
|
<el-option v-for="item in partData" :key="item.id" :label="item.partCode" :value="item.id"></el-option> |
|
|
|
<el-option v-for="item in partData" :key="item.id" :label="item.partCode" :value="item.id"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template #partCode-search="{ disabled, size }"> |
|
|
|
|
|
|
|
<el-select remote filterable :remote-method="queryPart" |
|
|
|
|
|
|
|
:loading="partLoading" placeholder="请选择零件" v-model="searchParams.partId" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<el-option v-for="item in partData" :key="item.id" :label="item.partCode" :value="item.id"></el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <template #heatTreat="scope"> |
|
|
|
<!-- <template #heatTreat="scope"> |
|
|
|
<el-tag v-if="scope.row.afterPlating" type="success">是</el-tag> |
|
|
|
<el-tag v-if="scope.row.afterPlating" type="success">是</el-tag> |
|
|
|
@ -67,6 +78,7 @@ export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
partData:[], |
|
|
|
partData:[], |
|
|
|
|
|
|
|
partLoading:false, |
|
|
|
isShowImport:false, |
|
|
|
isShowImport:false, |
|
|
|
inBatchesOpen: false, |
|
|
|
inBatchesOpen: false, |
|
|
|
platingSmallOpen: false, |
|
|
|
platingSmallOpen: false, |
|
|
|
@ -96,6 +108,7 @@ export default { |
|
|
|
total: 0, |
|
|
|
total: 0, |
|
|
|
}, |
|
|
|
}, |
|
|
|
showDialog:false, |
|
|
|
showDialog:false, |
|
|
|
|
|
|
|
searchParams:{}, |
|
|
|
option: { |
|
|
|
option: { |
|
|
|
columnSort: true, |
|
|
|
columnSort: true, |
|
|
|
tip: false, |
|
|
|
tip: false, |
|
|
|
@ -141,7 +154,7 @@ export default { |
|
|
|
column: [ |
|
|
|
column: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: '零件号', |
|
|
|
label: '零件号', |
|
|
|
prop: 'partId', |
|
|
|
prop: 'partCode', |
|
|
|
// bind: 'dsPart.partCode', |
|
|
|
// bind: 'dsPart.partCode', |
|
|
|
search: true, |
|
|
|
search: true, |
|
|
|
sortable: true, |
|
|
|
sortable: true, |
|
|
|
@ -155,11 +168,13 @@ export default { |
|
|
|
trigger: 'blur', |
|
|
|
trigger: 'blur', |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
dicUrl:'/api/blade-desk/dsPart/getPartList', |
|
|
|
// dicUrl:'/api/blade-desk/dsPart/getPartList', |
|
|
|
props:{ |
|
|
|
// dicUrl:"/api/blade-desk/dsPart/list?current=1&size=100", |
|
|
|
label: 'partCode', |
|
|
|
// props:{ |
|
|
|
value:'id' |
|
|
|
// label: 'partCode', |
|
|
|
}, |
|
|
|
// value:'id', |
|
|
|
|
|
|
|
// res:'res.records' |
|
|
|
|
|
|
|
// }, |
|
|
|
// onChange:val =>{ |
|
|
|
// onChange:val =>{ |
|
|
|
// console.log('val-------------',val) |
|
|
|
// console.log('val-------------',val) |
|
|
|
// this.form.partName = val && val.item && val.item.partName |
|
|
|
// this.form.partName = val && val.item && val.item.partName |
|
|
|
@ -313,7 +328,7 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
this.getPartList() |
|
|
|
// this.getPartList() |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
@ -324,15 +339,55 @@ export default { |
|
|
|
partCode:val && val.item && val.item.partCode |
|
|
|
partCode:val && val.item && val.item.partCode |
|
|
|
}).then(res =>{ |
|
|
|
}).then(res =>{ |
|
|
|
console.log('option--------',this.option) |
|
|
|
console.log('option--------',this.option) |
|
|
|
|
|
|
|
this.form.subPartCode = '' |
|
|
|
this.option.column[6].dicData = res.data.data |
|
|
|
this.option.column[6].dicData = res.data.data |
|
|
|
// this.form.tableData[index].subList = res.data.data |
|
|
|
// this.form.tableData[index].subList = res.data.data |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
getPartList(){ |
|
|
|
getPartList(){ |
|
|
|
getPartList().then(res =>{ |
|
|
|
getPartList({ |
|
|
|
this.partData = res.data.data |
|
|
|
current:1, |
|
|
|
|
|
|
|
size:50 |
|
|
|
|
|
|
|
}).then(res =>{ |
|
|
|
|
|
|
|
console.log('partData--------',res) |
|
|
|
|
|
|
|
this.partData = res.data.data.records |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
queryPart(query){ |
|
|
|
|
|
|
|
this.partLoading = true |
|
|
|
|
|
|
|
console.log('form----------',this.form) |
|
|
|
|
|
|
|
if(query){ |
|
|
|
|
|
|
|
getPartList({ |
|
|
|
|
|
|
|
current:1, |
|
|
|
|
|
|
|
size:50, |
|
|
|
|
|
|
|
partCode:query |
|
|
|
|
|
|
|
}).then(res =>{ |
|
|
|
|
|
|
|
this.partData = res.data.data.records |
|
|
|
|
|
|
|
this.partLoading = false |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
getPartList({ |
|
|
|
|
|
|
|
current:1, |
|
|
|
|
|
|
|
size:50 |
|
|
|
|
|
|
|
}).then(res =>{ |
|
|
|
|
|
|
|
console.log('partData--------',res) |
|
|
|
|
|
|
|
this.partData = res.data.data.records |
|
|
|
|
|
|
|
let tmp = this.partData.find(item => item.id == this.form.partId) |
|
|
|
|
|
|
|
if(!tmp){ |
|
|
|
|
|
|
|
getPartList({ |
|
|
|
|
|
|
|
current:1, |
|
|
|
|
|
|
|
size:50, |
|
|
|
|
|
|
|
partCode:this.form.partCode |
|
|
|
|
|
|
|
}).then(res =>{ |
|
|
|
|
|
|
|
this.partData = [...this.partData,...res.data.data.records] |
|
|
|
|
|
|
|
this.partLoading = false |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.partLoading = false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 点击新增按钮 |
|
|
|
// 点击新增按钮 |
|
|
|
handleAdd(){ |
|
|
|
handleAdd(){ |
|
|
|
console.log('111111111111111') |
|
|
|
console.log('111111111111111') |
|
|
|
@ -436,10 +491,12 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
searchReset() { |
|
|
|
searchReset() { |
|
|
|
|
|
|
|
this.searchParams = {} |
|
|
|
this.query = {}; |
|
|
|
this.query = {}; |
|
|
|
this.onLoad(this.page); |
|
|
|
this.onLoad(this.page); |
|
|
|
}, |
|
|
|
}, |
|
|
|
searchChange(params, done) { |
|
|
|
searchChange(params, done) { |
|
|
|
|
|
|
|
console.log('params-------------',params) |
|
|
|
this.query = params; |
|
|
|
this.query = params; |
|
|
|
this.page.currentPage = 1; |
|
|
|
this.page.currentPage = 1; |
|
|
|
this.onLoad(this.page, params); |
|
|
|
this.onLoad(this.page, params); |
|
|
|
@ -453,7 +510,20 @@ export default { |
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
beforeOpen(done, type) { |
|
|
|
beforeOpen(done, type) { |
|
|
|
|
|
|
|
if(type == 'edit'){ |
|
|
|
|
|
|
|
if(this.form.partCode && this.form.partCode != ''){ |
|
|
|
|
|
|
|
getPartList({ |
|
|
|
|
|
|
|
current:1, |
|
|
|
|
|
|
|
size:10, |
|
|
|
|
|
|
|
partCode:this.form.partCode |
|
|
|
|
|
|
|
}).then(res =>{ |
|
|
|
|
|
|
|
this.partData = [...this.partData,...res.data.data.records] |
|
|
|
|
|
|
|
done() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
done() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
currentChange(currentPage) { |
|
|
|
currentChange(currentPage) { |
|
|
|
this.page.currentPage = currentPage; |
|
|
|
this.page.currentPage = currentPage; |
|
|
|
|