Browse Source

首页新增待审核表格、审批和撤销按钮

ljx 1 year ago
parent
commit
afe7ce77ae

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

@@ -200,6 +200,17 @@ public class TbOrderController extends BaseController
     }
 
     /**
+     * 修改资产单据
+     */
+    @PreAuthorize("@ss.hasPermi('order:order:audit')")
+    @Log(title = "资产单据", businessType = BusinessType.UPDATE)
+    @PutMapping("/audit")
+    public AjaxResult audit(@RequestBody TbOrder tbOrder)
+    {
+        return toAjax(tbOrderService.updateTbOrder(tbOrder));
+    }
+
+    /**
      * 删除资产单据
      */
     @PreAuthorize("@ss.hasPermi('order:order:remove')")

+ 9 - 0
ruoyi-ui/src/api/order/order.js

@@ -35,6 +35,15 @@ export function updateOrder(data) {
   })
 }
 
+// 审批资产单据
+export function auditOrder(data) {
+  return request({
+    url: '/order/order/audit',
+    method: 'put',
+    data: data
+  })
+}
+
 // 删除资产单据
 export function delOrder(id) {
   return request({

+ 296 - 2
ruoyi-ui/src/views/index.vue

@@ -1,3 +1,297 @@
 <template>
-  <div><h1>酒店资产管理</h1></div>
-</template>
+  <div class="hotel-index">
+    <h3>待审批信息</h3>
+    <el-table
+      :data="orderList"
+      height="260"
+      border
+      style="width: 100%"
+      :default-sort="{ prop: 'applicationDate', order: 'descending' }"
+    >
+      <el-table-column type="expand">
+        <template slot-scope="props">
+          <el-form label-position="left" class="table-expand">
+            <el-descriptions :column="4" border>
+              <el-descriptions-item
+                v-if="props.row.orderType !== 1"
+                label="资产总原值"
+              >
+                <span>{{ props.row.assetTotalOriginalValue }}</span>
+              </el-descriptions-item>
+              <el-descriptions-item
+                v-if="props.row.orderType !== 1"
+                label="资产总净值"
+              >
+                <span>{{ props.row.assetTotalNetValue }}</span>
+              </el-descriptions-item>
+              <el-descriptions-item
+                v-if="props.row.orderType === 1"
+                label="【调整】资产编号"
+              >
+                <span>{{ props.row.adjustmentAssetNumber }}</span>
+              </el-descriptions-item>
+              <el-descriptions-item
+                v-if="props.row.orderType === 1"
+                label="【调整】资产原信息"
+              >
+                <el-button
+                  type="text"
+                  icon="el-icon-search"
+                  @click="
+                    onSelectOriginalAssetInfo(
+                      props.row.adjustmentOriginalAssetInfo
+                    )
+                  "
+                  >查看</el-button
+                >
+              </el-descriptions-item>
+              <el-descriptions-item
+                v-if="props.row.orderType === 2"
+                label="【调拨】调出部门"
+              >
+                <span>{{ props.row.allocationCallOutDepartmentName }}</span>
+              </el-descriptions-item>
+              <el-descriptions-item
+                v-if="props.row.orderType === 2"
+                label="【调拨】调出经办人"
+              >
+                <span>{{ props.row.allocationCallOutBy }}</span>
+              </el-descriptions-item>
+              <el-descriptions-item
+                v-if="props.row.orderType === 2"
+                label="【调拨】调出日期"
+              >
+                <span>{{
+                  parseTime(props.row.allocationCallOutDate, "{y}-{m}-{d}")
+                }}</span>
+              </el-descriptions-item>
+              <el-descriptions-item
+                v-if="props.row.orderType === 2"
+                label="【调拨】调入部门"
+              >
+                <span>{{ props.row.allocationCallInDepartmentName }}</span>
+              </el-descriptions-item>
+              <el-descriptions-item
+                v-if="props.row.orderType === 2"
+                label="【调拨】调入经办人"
+              >
+                <span>{{ props.row.allocationCallInBy }}</span>
+              </el-descriptions-item>
+              <el-descriptions-item
+                v-if="props.row.orderType === 2"
+                label="【调拨】调入日期"
+              >
+                <span>{{
+                  parseTime(props.row.allocationCallInDate, "{y}-{m}-{d}")
+                }}</span>
+              </el-descriptions-item>
+              <el-descriptions-item
+                v-if="props.row.orderType === 2"
+                label="【调拨】新管理人"
+              >
+                <span>{{ props.row.allocationNewResponsiblePerson }}</span>
+              </el-descriptions-item>
+              <el-descriptions-item
+                v-if="props.row.orderType === 2"
+                label="【调拨】新功能位置编号"
+              >
+                <span>{{ props.row.allocationNewLocationNumber }}</span>
+              </el-descriptions-item>
+              <el-descriptions-item
+                v-if="props.row.orderType === 3"
+                label="【借出】借出部门"
+              >
+                <span>{{ props.row.lendDepartmentName }}</span>
+              </el-descriptions-item>
+              <el-descriptions-item
+                v-if="props.row.orderType === 3"
+                label="【借出】经手人"
+              >
+                <span>{{ props.row.lendBySponsor }}</span>
+              </el-descriptions-item>
+              <el-descriptions-item
+                v-if="props.row.orderType === 3"
+                label="【借出】往来单位"
+              >
+                <span>{{ props.row.lendPassingUnitName }}</span>
+              </el-descriptions-item>
+              <el-descriptions-item label="原因说明">{{
+                props.row.reason
+              }}</el-descriptions-item>
+              <el-descriptions-item label="所属公司">{{
+                props.row.corporationName
+              }}</el-descriptions-item>
+            </el-descriptions>
+          </el-form>
+        </template>
+      </el-table-column>
+      <el-table-column label="单据编号" align="center" prop="orderNumber" />
+      <el-table-column label="单据类型" align="center" prop="orderType">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.asset_order_type"
+            :value="scope.row.orderType"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="申请日期"
+        align="center"
+        prop="applicationDate"
+        width="180"
+      >
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.applicationDate, "{y}-{m}-{d}") }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="申请部门"
+        align="center"
+        prop="applicationDepartmentName"
+      />
+      <el-table-column label="制单人" align="center" prop="preparedBy" />
+      <el-table-column
+        label="制单部门"
+        align="center"
+        prop="preparedDepartmentName"
+      />
+      <el-table-column label="记录状态" align="center" prop="recordStatus">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.asset_record_status"
+            :value="scope.row.recordStatus"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleAudit(scope.row, 2)"
+            v-hasPermi="['order:order:audit']"
+            >审批</el-button
+          >
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleAudit(scope.row, 0)"
+            v-hasPermi="['order:order:audit']"
+            >撤销</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 【调整】资产信息 -->
+    <el-dialog
+      title="资产调整"
+      :visible.sync="openAdjustment"
+      width="900px"
+      append-to-body
+    >
+      <AssetInfo
+        :title="'资产原信息'"
+        :assetInfo="adjustmentOriginalAssetInfo"
+      />
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listOrder, auditOrder } from "@/api/order/order";
+
+export default {
+  dicts: ["asset_order_type", "asset_record_status"],
+  components: {
+    AssetInfo: () => import("@/components/asset/assetCard.vue"),
+  },
+  data() {
+    return {
+      // 表单参数
+      form: {},
+      // 资产单据表格数据
+      orderList: [],
+      // 资产原信息
+      openAdjustment: false,
+      adjustmentOriginalAssetInfo: null,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        recordStatus: 1,
+      },
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询资产单据列表 */
+    getList() {
+      this.loading = true;
+      listOrder(this.queryParams).then((response) => {
+        this.orderList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    onSelectOriginalAssetInfo(info) {
+      const json = JSON.parse(info);
+      this.adjustmentOriginalAssetInfo = json;
+      this.openAdjustment = true;
+      console.log("资产原信息:", json);
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        orderNumber: null,
+        orderType: null,
+        assetTotalOriginalValue: null,
+        assetTotalNetValue: null,
+        applicationDate: null,
+        applicationDepartment: null,
+        adjustmentAssetNumber: null,
+        adjustmentOriginalAssetInfo: null,
+        allocationCallOutDepartment: null,
+        allocationCallOutBy: null,
+        allocationCallOutDate: null,
+        allocationCallInDepartment: null,
+        allocationCallInBy: null,
+        allocationCallInDate: null,
+        allocationNewResponsiblePerson: null,
+        allocationNewLocationNumber: null,
+        lendDepartment: null,
+        lendBySponsor: null,
+        lendPassingUnit: null,
+        reason: null,
+        preparedBy: null,
+        preparedDepartment: null,
+        corporation: null,
+        recordStatus: null,
+      };
+    },
+    handleAudit(row, recordStatus) {
+      this.reset();
+      this.form.id = row.id;
+      this.form.recordStatus = recordStatus;
+      auditOrder(this.form).then((response) => {
+        this.$modal.msgSuccess("操作成功");
+        this.getList();
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.hotel-index {
+  padding: 0 15px;
+}
+</style>