Browse Source

优化修改资产盘点记录页面

LinWuTai 1 year ago
parent
commit
0a9092bbb2

+ 2 - 2
ruoyi-ui/src/views/asset/location/index.vue

@@ -11,9 +11,9 @@
         <!-- <el-input v-model="queryParams.parentId" placeholder="请输入位置名称" clearable @keyup.enter.native="handleQuery" /> -->
         <treeselect v-model="queryParams.parentId" :options="locationOption" placeholder="选择位置" @keyup.enter.native="handleQuery" />
       </el-form-item>
-      <el-form-item label="位置标签" prop="label">
+      <!-- <el-form-item label="位置标签" prop="label">
         <el-input v-model="queryParams.label" placeholder="请输入位置标签" clearable @keyup.enter.native="handleQuery" />
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>

+ 15 - 7
ruoyi-ui/src/views/inventory/inventory/index.vue

@@ -25,6 +25,9 @@
             @keyup.enter.native="handleQuery"
           />
       </el-form-item>
+      <el-form-item label="盘点地点" prop="inventoryLocation">
+        <treeselect v-model="queryParams.inventoryLocation" :options="locationOption" placeholder="选择位置" @keyup.enter.native="handleQuery" />
+      </el-form-item>
       <el-form-item label="盘点人" prop="inventoryBy">
         <el-input
           v-model="queryParams.inventoryBy"
@@ -221,14 +224,15 @@
           </el-date-picker>
         </el-form-item>
         <el-form-item label="盘点位置" prop="inventoryLocation">
-          <el-select v-model="form.inventoryLocation" placeholder="请选择盘点位置">
+          <!-- <el-select v-model="form.inventoryLocation" placeholder="请选择盘点位置">
             <el-option
               v-for="item in locationList"
               :key="item.number"
               :label="item.name"
               :value="item.number"
             ></el-option>
-          </el-select>
+          </el-select> -->
+          <treeselect v-model="form.inventoryLocation" :options="locationOption" placeholder="选择位置" />
         </el-form-item>
         <el-form-item label="备注" prop="remark">
           <el-input v-model="form.remark" placeholder="请输入备注" />
@@ -254,7 +258,7 @@
 <script>
 import { deptTreeSelect } from '@/api/system/user.js'
 import { listInventory, getInventory, delInventory, addInventory, updateInventory } from "@/api/inventory/inventory";
-import { listLocation } from "@/api/asset/location";
+import { treeSelect } from "@/api/asset/location";
 import { listDept } from "@/api/system/dept";
 import UserSearch from '@/components/SysUserSearch/index.vue'
 import Treeselect from "@riophae/vue-treeselect";
@@ -283,7 +287,7 @@ export default {
       total: 0,
       // 资产盘点记录表格数据
       inventoryList: [],
-      locationList: [],
+      locationOption: [],
       // 部门树选项
       deptOptions: [],
       arr: [],
@@ -349,9 +353,7 @@ export default {
     /** 查询资产盘点记录列表 */
     getList() {
       this.loading = true;
-      listLocation().then((response) => {
-        this.locationList = response.rows;
-      });
+      this.getTreeSelect()
       listDept().then((response) => {
         this.arr = response.data
       });
@@ -361,6 +363,12 @@ export default {
         this.loading = false;
       });
     },
+    getTreeSelect() {
+      treeSelect().then(res => {
+        console.log('下拉树结果', res)
+        this.locationOption = res.data
+      })
+    },
     //获取公司名
     companyName(val){
        let num = parseInt(val)