Browse Source

优化修改资产单据页面

LinWuTai 1 year ago
parent
commit
787d3c4e39

+ 7 - 0
ruoyi-admin/src/main/java/com/ruoyi/order/controller/TbOrderController.java

@@ -90,6 +90,13 @@ public class TbOrderController extends BaseController
                     orderDTO.setLendDepartmentName(sysDept.getDeptName());
                 }
             }
+            String lendPassingUnit = order.getLendPassingUnit();
+            if (StrUtil.isNotBlank(lendPassingUnit)) {
+                SysDept sysDept = sysDeptService.selectDeptById(Long.valueOf(lendPassingUnit));
+                if (sysDept != null) {
+                    orderDTO.setLendPassingUnitName(sysDept.getDeptName());
+                }
+            }
             String allocationCallOutDepartment = order.getAllocationCallOutDepartment();
             if (StrUtil.isNotBlank(allocationCallOutDepartment)) {
                 SysDept sysDept = sysDeptService.selectDeptById(Long.valueOf(allocationCallOutDepartment));

+ 3 - 0
ruoyi-admin/src/main/java/com/ruoyi/order/domain/dto/OrderDTO.java

@@ -20,6 +20,9 @@ public class OrderDTO extends TbOrder {
     /** 【借出】借出部门 */
     private String lendDepartmentName;
 
+    /** 【借出】往来单位 */
+    private String lendPassingUnitName;
+
     /** 制单部门名称 */
     private String preparedDepartmentName;
 

+ 26 - 4
ruoyi-ui/src/views/order/order/index.vue

@@ -255,7 +255,7 @@
       <el-table-column v-if="queryParams.orderType === '2'" label="【调拨】新功能位置编号" align="center" prop="allocationNewLocationNumber" />
       <el-table-column v-if="queryParams.orderType === '3'" label="【借出】借出部门" align="center" prop="lendDepartmentName" />
       <el-table-column v-if="queryParams.orderType === '3'" label="【借出】经手人" align="center" prop="lendBySponsor" />
-      <el-table-column v-if="queryParams.orderType === '3'" label="【借出】往来单位" align="center" prop="lendPassingUnit" />
+      <el-table-column v-if="queryParams.orderType === '3'" label="【借出】往来单位" align="center" prop="lendPassingUnitName" />
       <el-table-column label="原因说明" align="center" prop="reason" />
       <el-table-column label="制单人" align="center" prop="preparedBy" />
       <el-table-column label="制单部门" align="center" prop="preparedDepartmentName" />
@@ -378,8 +378,15 @@
         <el-form-item v-if="form.orderType === 2" label="【调拨】新管理人" prop="allocationNewResponsiblePerson">
           <el-input v-model="form.allocationNewResponsiblePerson" placeholder="请输入【调拨】新管理人" />
         </el-form-item>
-        <el-form-item v-if="form.orderType === 2" label="【调拨】新功能位置编号" prop="allocationNewLocationNumber">
-          <el-input v-model="form.allocationNewLocationNumber" placeholder="请输入【调拨】新功能位置编号" />
+        <el-form-item v-if="form.orderType === 2" label="【调拨】新功能位置" prop="allocationNewLocationNumber">
+          <el-select v-model="form.allocationNewLocationNumber" placeholder="请选择【调拨】新功能位置">
+            <el-option
+              v-for="item in locationList"
+              :key="item.number"
+              :label="item.name"
+              :value="item.number"
+            ></el-option>
+          </el-select>
         </el-form-item>
         <el-form-item v-if="form.orderType === 3" label="【借出】借出部门" prop="lendDepartment">
           <treeselect
@@ -393,7 +400,12 @@
           <el-input v-model="form.lendBySponsor" placeholder="请输入【借出】经手人" />
         </el-form-item>
         <el-form-item v-if="form.orderType === 3" label="【借出】往来单位" prop="lendPassingUnit">
-          <el-input v-model="form.lendPassingUnit" placeholder="请输入【借出】往来单位" />
+          <treeselect
+            v-model="form.lendPassingUnit"
+            :options="deptOptions"
+            placeholder="请选择【调拨】调入部门"
+            @keyup.enter.native="handleQuery"
+          />
         </el-form-item>
         <el-form-item label="原因说明" prop="reason">
           <el-input v-model="form.reason" placeholder="请输入原因说明" />
@@ -436,6 +448,7 @@
 <script>
 import { listOrder, getOrder, delOrder, addOrder, updateOrder } from "@/api/order/order";
 import { deptTreeSelect } from "@/api/system/user";
+import { listLocation } from "@/api/asset/location";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
@@ -462,6 +475,8 @@ export default {
       // 资产单据表格数据
       orderList: [],
       orderType: 1,
+      // 所属位置表格数据
+      locationList: [],
       // 资产原信息
       openAdjustment: false,
       adjustmentOriginalAssetInfo: null,
@@ -533,6 +548,7 @@ export default {
   created() {
     this.orderType = 1
     this.getDeptTree()
+    this.getLocation()
     this.getList();
   },
   methods: {
@@ -551,6 +567,12 @@ export default {
         this.deptOptions = response.data;
       });
     },
+    /** 获取所属位置 */
+    getLocation() {
+      listLocation().then((response) => {
+        this.locationList = response.rows;
+      });
+    },
     // 取消按钮
     cancel() {
       this.open = false;