配件类型左侧树
This commit is contained in:
		
							parent
							
								
									5d2a0e272b
								
							
						
					
					
						commit
						b4ea9dbf98
					
				| 
						 | 
				
			
			@ -3,26 +3,26 @@ import request from '@/utils/request'
 | 
			
		|||
//机具类型管理列表信息
 | 
			
		||||
export function getListByPartType(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
      url: '/material/ma_part_type/getListByPartType',
 | 
			
		||||
      method: 'get',
 | 
			
		||||
      params: query,
 | 
			
		||||
    url: '/material/ma_part_type/getListByPartType',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//机具类型管理列表信息
 | 
			
		||||
export function getListTree(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
      url: '/material/ma_part_type/getPartTree',
 | 
			
		||||
      method: 'get',
 | 
			
		||||
      params: query,
 | 
			
		||||
    url: '/material/ma_part_type/getPartTree',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//查看机具类型管理列表详细信息
 | 
			
		||||
export function getAccessoryDetail(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
      url: '/material/ma_part_type/'+ id,
 | 
			
		||||
      method: 'get',
 | 
			
		||||
    url: '/material/ma_part_type/' + id,
 | 
			
		||||
    method: 'get',
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -31,27 +31,34 @@ export function getAccessoryDetail(id) {
 | 
			
		|||
// 仓库管理--删除
 | 
			
		||||
export function delAccessory(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
      url: '/material/ma_part_type/' + id,
 | 
			
		||||
      method: 'delete',
 | 
			
		||||
    url: '/material/ma_part_type/' + id,
 | 
			
		||||
    method: 'delete',
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 仓库管理--修改
 | 
			
		||||
export function editAccessory(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
      url: '/material/ma_part_type',
 | 
			
		||||
      method: 'put',
 | 
			
		||||
      data: data,
 | 
			
		||||
    url: '/material/ma_part_type',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 仓库管理--新增
 | 
			
		||||
export function addAccessory(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
      url: '/material/ma_part_type',
 | 
			
		||||
      method: 'post',
 | 
			
		||||
      data: data,
 | 
			
		||||
    url: '/material/ma_part_type',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// 配件类型管理--新增
 | 
			
		||||
export function addMaType(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/material/ma_part_type',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -339,8 +339,8 @@
 | 
			
		|||
            </el-form-item>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span="12">
 | 
			
		||||
            <el-form-item label="名称" prop="typeName">
 | 
			
		||||
              <el-input style="width: 100%" v-model="addFormParams.typeName" />
 | 
			
		||||
            <el-form-item label="名称" prop="paName">
 | 
			
		||||
              <el-input style="width: 100%" v-model="addFormParams.paName" />
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
| 
						 | 
				
			
			@ -366,6 +366,7 @@ import {
 | 
			
		|||
  addAccessory,
 | 
			
		||||
  editAccessory,
 | 
			
		||||
  delAccessory,
 | 
			
		||||
  addMaType,
 | 
			
		||||
} from "@/api/ma/partType";
 | 
			
		||||
import Treeselect from "@riophae/vue-treeselect";
 | 
			
		||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 | 
			
		||||
| 
						 | 
				
			
			@ -429,7 +430,7 @@ export default {
 | 
			
		|||
      addTitle: "", // 新增弹框标题
 | 
			
		||||
      addFormParams: {
 | 
			
		||||
        label: "",
 | 
			
		||||
        typeName: "",
 | 
			
		||||
        paName: "",
 | 
			
		||||
        companyId: 101,
 | 
			
		||||
      },
 | 
			
		||||
      treeOptions: undefined,
 | 
			
		||||
| 
						 | 
				
			
			@ -449,6 +450,16 @@ export default {
 | 
			
		|||
          },
 | 
			
		||||
        ],
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      addFormParamsRules: {
 | 
			
		||||
        paName: [
 | 
			
		||||
          {
 | 
			
		||||
            required: true,
 | 
			
		||||
            message: "名称不能为空",
 | 
			
		||||
            trigger: "blur",
 | 
			
		||||
          },
 | 
			
		||||
        ],
 | 
			
		||||
      },
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
| 
						 | 
				
			
			@ -639,7 +650,9 @@ export default {
 | 
			
		|||
        this.title = "新增";
 | 
			
		||||
      } else {
 | 
			
		||||
        Object.assign(this.addFormParams, data);
 | 
			
		||||
        this.addFormParams.typeName = "";
 | 
			
		||||
        console.log("data", data);
 | 
			
		||||
        console.log("addFormParams", this.addFormParams);
 | 
			
		||||
        this.addFormParams.paName = "";
 | 
			
		||||
        this.addTitle = "新增";
 | 
			
		||||
        this.addTitleVisible = true;
 | 
			
		||||
      }
 | 
			
		||||
| 
						 | 
				
			
			@ -667,22 +680,22 @@ export default {
 | 
			
		|||
      this.parentId = data.parentId;
 | 
			
		||||
      Object.assign(this.addFormParams, data);
 | 
			
		||||
      this.addTitle = "修改";
 | 
			
		||||
      this.addFormParams.typeName = data.label;
 | 
			
		||||
      this.addFormParams.paName = data.label;
 | 
			
		||||
      this.addTitleVisible = true;
 | 
			
		||||
    },
 | 
			
		||||
    /* 确定 */
 | 
			
		||||
    onSubmit() {
 | 
			
		||||
      const { id, typeName } = this.addFormParams;
 | 
			
		||||
      const { id, paName } = this.addFormParams;
 | 
			
		||||
      const addParams = {
 | 
			
		||||
        parentId: this.levelTemp == 0 ? 0 : this.idTemp,
 | 
			
		||||
        typeName,
 | 
			
		||||
        paName,
 | 
			
		||||
        level: this.levelTemp,
 | 
			
		||||
        houseId: this.levelTemp == 0 ? id : null,
 | 
			
		||||
        id: id,
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      const editParams = {
 | 
			
		||||
        houseId: id,
 | 
			
		||||
        typeName,
 | 
			
		||||
        paName,
 | 
			
		||||
        level: this.levelTemp,
 | 
			
		||||
        parentId: this.parentId,
 | 
			
		||||
        typeId: id,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue