物资配置

This commit is contained in:
jjLv 2024-11-07 16:37:23 +08:00
parent f897b22203
commit b5dfa73ab8
2 changed files with 29 additions and 12 deletions

View File

@ -1,9 +1,9 @@
import request from '@/utils/request' import request from '@/utils/request'
//机具类型管理列表信息 //机具类型管理列表信息
export function getListAccessory(query) { export function getListByPartType(query) {
return request({ return request({
url: '/material/ma_part_type/list', url: '/material/ma_part_type/getListByPartType',
method: 'get', method: 'get',
params: query, params: query,
}) })

View File

@ -169,7 +169,7 @@
<el-table-column <el-table-column
label="规格型号" label="规格型号"
align="center" align="center"
prop="label3" prop="paName"
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column <el-table-column
@ -366,7 +366,7 @@
</template> </template>
<script> <script>
import { getListAccessory,getListTree,getAccessoryDetail,addAccessory,editAccessory,delAccessory, } from "@/api/ma/partType"; import { getListByPartType,getListTree,getAccessoryDetail,addAccessory,editAccessory,delAccessory, } from "@/api/ma/partType";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import IconSelect from "@/components/IconSelect"; import IconSelect from "@/components/IconSelect";
@ -422,7 +422,9 @@
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
keyWord:undefined keyWord:undefined,
level:1,
id:undefined,
}, },
companyId: undefined, companyId: undefined,
parentId:undefined, parentId:undefined,
@ -455,7 +457,7 @@
}, },
created() { created() {
this.getTreeselect(); this.getTreeselect();
this.getList();
}, },
watch: { watch: {
// //
@ -470,11 +472,20 @@
return data.label.indexOf(value) !== -1 return data.label.indexOf(value) !== -1
}, },
// -
async handleNodeClick(data,node) {
this.queryParams.id = data.id
this.queryParams.level = data.level
this.handleQuery()
},
/** 查询配件类型列表 */ /** 查询配件类型列表 */
getList() { getList() {
this.loading = true; this.loading = true;
getListAccessory(this.queryParams).then(response => { getListByPartType(this.queryParams).then(response => {
this.typeList = response.data; this.typeList = response.data.rows;
this.loading = false; this.loading = false;
}); });
@ -493,8 +504,13 @@
getTreeselect(){ getTreeselect(){
getListTree().then(response=>{ getListTree().then(response=>{
this.treeOptions = response.data; this.treeOptions = response.data;
if(this.treeOptions.length>0){
}); const firstNode = this.treeOptions[0];
this.queryParams.id = firstNode.id
this.queryParams.level = 1
this.getList();
}
})
}, },
/** 转换菜单数据结构 */ /** 转换菜单数据结构 */
@ -546,8 +562,6 @@
this.getList(); this.getList();
}); });
} else if(this.flagTemp==1){ } else if(this.flagTemp==1){
console.log('新增')
console.log('this.form')
addAccessory(this.form).then(response => { addAccessory(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.showHouse = false; this.showHouse = false;
@ -597,6 +611,9 @@
this.form.level = e.level this.form.level = e.level
}, },
/* 树节点增加 */ /* 树节点增加 */
appendTreeNode(data) { appendTreeNode(data) {
this.levelTemp = data.level; this.levelTemp = data.level;