物资配置

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'
//机具类型管理列表信息
export function getListAccessory(query) {
export function getListByPartType(query) {
return request({
url: '/material/ma_part_type/list',
url: '/material/ma_part_type/getListByPartType',
method: 'get',
params: query,
})

View File

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