4 changed files with 195 additions and 8 deletions
-
2src/api/part/partInformation.js
-
176src/components/selector/table/partTable.vue
-
5src/components/selector/table/projectPartTable.vue
-
20src/views/modules/quote/detail/quoteDetail.vue
@ -0,0 +1,176 @@ |
|||||
|
<script> |
||||
|
import {handleQueryPart, handleQueryPartByPage} from "../../../api/part/partInformation"; |
||||
|
import BuSelect from "../select/BuSelect.vue"; |
||||
|
|
||||
|
export default { |
||||
|
name: "partTable", |
||||
|
components: {BuSelect}, |
||||
|
model:{ |
||||
|
prop: "visible", |
||||
|
event: "update" |
||||
|
}, |
||||
|
props:{ |
||||
|
visible: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
isPage:{ |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
height:{ |
||||
|
type: Number, |
||||
|
default: 300 |
||||
|
}, |
||||
|
partNo:{ |
||||
|
type: String, |
||||
|
default: "" |
||||
|
} |
||||
|
}, |
||||
|
data(){ |
||||
|
return{ |
||||
|
no:0, |
||||
|
size:20, |
||||
|
total:0, |
||||
|
queryLoading:false, |
||||
|
partList: [], |
||||
|
part:{ |
||||
|
buId:'', |
||||
|
partNo:"", |
||||
|
partDesc:"", |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
computed:{ |
||||
|
open:{ |
||||
|
get(){ |
||||
|
return this.visible |
||||
|
}, |
||||
|
set(val){ |
||||
|
this.$emit("update", val) |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods:{ |
||||
|
handleQueryPart(){ |
||||
|
let params = { |
||||
|
...this.part, |
||||
|
userName:this.$store.state.user.name, |
||||
|
} |
||||
|
this.queryLoading = true |
||||
|
handleQueryPart(params).then(({data})=>{ |
||||
|
if (data && data.code === 0){ |
||||
|
this.partList = data.rows |
||||
|
}else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.queryLoading = false |
||||
|
}).catch((error)=>{ |
||||
|
this.$message.error(error) |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
handleQueryPartByPage(){ |
||||
|
let params = { |
||||
|
...this.part, |
||||
|
userName:this.$store.state.user.name, |
||||
|
no:this.no, |
||||
|
size:this.size, |
||||
|
} |
||||
|
this.queryLoading = true |
||||
|
handleQueryPartByPage(params).then(({data})=>{ |
||||
|
if (data && data.code === 0){ |
||||
|
this.partList = data.rows |
||||
|
this.total = data.total |
||||
|
}else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.queryLoading = false |
||||
|
}).catch((error)=>{ |
||||
|
this.$message.error(error) |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
handleDblClick(row){ |
||||
|
this.$emit("dblclick", row) |
||||
|
}, |
||||
|
handleSizeChange(val){ |
||||
|
this.size = val |
||||
|
this.handleQueryPartByPage() |
||||
|
}, |
||||
|
handlePageChange(val){ |
||||
|
this.no = val |
||||
|
this.handleQueryPartByPage() |
||||
|
} |
||||
|
}, |
||||
|
watch:{ |
||||
|
visible(newVal,oldVal){ |
||||
|
if(newVal){ |
||||
|
if (this.isPage){ |
||||
|
this.handleQueryPartByPage() |
||||
|
}else { |
||||
|
this.handleQueryPart() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
partNo(newVal,oldVal){ |
||||
|
this.part.partNo = newVal |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.part.partNo = this.partNo |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<template> |
||||
|
<el-dialog title="物料信息" v-drag :visible.sync="open" width="800px" :close-on-click-modal="false" modal-append-to-body> |
||||
|
<el-form :model="part" label-width="100px" label-position="top"> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="4"> |
||||
|
<el-form-item label="BU"> |
||||
|
<bu-select v-model="part.buId"> |
||||
|
<el-option label="全部" value=""></el-option> |
||||
|
</bu-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="4"> |
||||
|
<el-form-item label="物料编码"> |
||||
|
<el-input v-model="part.partNo"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="4"> |
||||
|
<el-form-item label="物料描述"> |
||||
|
<el-input v-model="part.partDesc"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="4"> |
||||
|
<el-form-item label=" "> |
||||
|
<el-button type="primary" v-if="isPage" @click="handleQueryPartByPage">查询</el-button> |
||||
|
<el-button type="primary" v-else @click="handleQueryPart">查询</el-button> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<el-table v-loading="queryLoading" :data="partList" style="width: 100%" border :height="height" @row-dblclick="handleDblClick"> |
||||
|
<el-table-column prop="buDesc" label="BU" ></el-table-column> |
||||
|
<el-table-column prop="partNo" label="物料编码" ></el-table-column> |
||||
|
<el-table-column prop="partDesc" label="物料描述" ></el-table-column> |
||||
|
<el-table-column prop="umName" label="单位" ></el-table-column> |
||||
|
<el-table-column prop="partType2Desc" label="类型" ></el-table-column> |
||||
|
</el-table> |
||||
|
<el-pagination v-if="isPage" @size-change="handleSizeChange" |
||||
|
@current-change="handlePageChange" |
||||
|
:current-page="no" |
||||
|
:page-sizes="[20, 50, 100, 200, 500]" |
||||
|
:page-size="size" |
||||
|
:pager-count="5" |
||||
|
:total="total" |
||||
|
layout="total,sizes, prev, pager, next, jumper"> |
||||
|
</el-pagination> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue