Просмотр исходного кода

fix: 物资申领新增通知领用

ai0187 1 месяц назад
Родитель
Сommit
67eb56003e

+ 12 - 0
src/api/emergency-supplier/index.ts

@@ -15,6 +15,7 @@ import type {
   SupplyRequestDetailItem,
   ReceiveSupplyRequestDetailForm,
   AddSupplyQuery,
+  NotifyDepartmentForm,
 } from '@/types/emergency-supplier';
 
 /**
@@ -271,3 +272,14 @@ export const getSupplyNameList = (planId: number) => {
     method: 'get',
   });
 };
+
+/**
+ * 通知领用物资
+ */
+export const notifySupplyRequestDetail = (data: NotifyDepartmentForm) => {
+  return http.request({
+    url: '/emergencySupplies/noticeReceiveSupplies',
+    method: 'post',
+    data,
+  });
+};

+ 14 - 1
src/types/emergency-supplier/index.ts

@@ -160,10 +160,16 @@ export interface SupplyRequestDetailList {
   deptName: string;
   /*数量 */
   quantity: number;
+  /*申请理由 */
+  requestReason: string;
   /*尺寸明细 */
   sizeDetail: string;
-  /*状态:1-申请中 2-采购中 3-领用 4-已领用 */
+  /*状态:1-申请中 2-采购中 3-领用 4-已通知领用 。流程为:申请中-采购中-已通知领用-已领用*/
   status: number;
+  /* 通知领用时间 */
+  requestTime: string;
+  /* 通知领用地点 */
+  requestLocation: string;
   /*创建时间 */
   createdAt: string;
   /*更新时间 */
@@ -197,3 +203,10 @@ export interface AddSupplyQuery {
   info: Partial<SupplyRequestDetailInfo>;
   detailList: Partial<AddSupplyRequestSubForm>[];
 }
+
+export interface NotifyDepartmentForm {
+  detailId: number; // 申领物资详情ID
+  noticeScope: number; // 通知范围: 1-通知此物资所有需求部门 2-仅通知此物资当前需求部门
+  requestTime: string; // 通知领用时间
+  requestLocation: string; // 通知领用地点
+}

+ 11 - 10
src/views/emergency/emergency-supplies/PageSupplyRequest.vue

@@ -42,20 +42,15 @@
           <template #action="scope">
             <div class="action-container--div">
               <ActionButton text="详情" @click="handleViewDetail(scope.row.id)" />
-              <template v-if="scope.row.status === SUPPLY_REQUEST_STATUS.APPLYING">
-                <ActionButton
-                  text="发起采购"
-                  @click="handleStartPurchase(scope.row)"
-                  v-if="supplyRequestManagePermission && scope.row.totalPrice > 0"
-                />
-                <ActionButton text="编辑" @click="handleEdit(scope.row)" v-if="supplyRequestManagePermission" />
+              <template v-if="scope.row.status === SUPPLY_REQUEST_STATUS.APPLYING && supplyRequestManagePermission">
+                <ActionButton text="发起采购" @click="handleStartPurchase(scope.row)" />
+                <ActionButton text="编辑" @click="handleEdit(scope.row)" />
                 <ActionButton
                   text="删除"
                   :popconfirm="{
                     title: '确定删除?',
                   }"
                   @confirm="handleDelete(scope.row.id)"
-                  v-if="supplyRequestManagePermission"
                 />
               </template>
               <template
@@ -98,7 +93,7 @@
   import { SUPPLY_REQUEST_STATUS, SUPPLY_REQUEST_STATUS_MAP } from './src/constant';
   import type { QueryPageRequest } from '@/types/basic-query';
   import type { SupplyRequestListQuery, SupplyRequestListItem } from '@/types/emergency-supplier';
-  import { getSupplyRequestList, deleteSupplyRequest } from '@/api/emergency-supplier';
+  import { getSupplyRequestList, deleteSupplyRequest, getSupplyRequestDetail } from '@/api/emergency-supplier';
 
   const router = useRouter();
   const { permissions } = useUserInfoHook();
@@ -175,7 +170,13 @@
   };
 
   // 发起采购
-  const handleStartPurchase = (row: SupplyRequestListItem) => {
+  const handleStartPurchase = async (row: SupplyRequestListItem) => {
+    if (!row.id) return;
+    const res = await getSupplyRequestDetail(row.id);
+    if (res.length === 0 || res.some((item) => item.detailList.length === 0)) {
+      ElMessage.error('此计划详情内没有物资,无法发起采购');
+      return;
+    }
     startPurchaseFormRef.value?.openDialog(row);
   };
 

+ 47 - 22
src/views/emergency/emergency-supplies/PageSupplyRequestDetail.vue

@@ -22,21 +22,33 @@
           <el-table :data="tableData" :span-method="handleSpanMethod" border v-loading="loading" style="width: 100%">
             <el-table-column type="index" label="序号" width="80" align="center" />
             <el-table-column prop="materialName" label="物资名称" min-width="140" align="center" />
-            <el-table-column prop="specification" label="规格" min-width="200" align="center" />
-            <el-table-column prop="unitPrice" label="单价 (元)" width="120" align="center" />
-            <el-table-column prop="subtotal" label="小计" min-width="200" align="center" />
+            <el-table-column prop="specification" label="规格" min-width="100" align="center" />
             <el-table-column prop="department" label="需求部门" min-width="140" align="center" />
             <el-table-column prop="quantity" label="数量" width="100" align="center" />
+            <el-table-column prop="requestReason" label="申请理由" min-width="200" align="center" />
             <el-table-column prop="sizeDetails" label="尺寸明细" min-width="200" align="center" />
             <el-table-column prop="status" label="状态" width="120" align="center">
               <template #default="scope">
                 <span>{{ getStatusText(scope.row.status) }}</span>
               </template>
             </el-table-column>
-            <el-table-column prop="claim" label="领用" width="100" align="center" v-if="supplyRequestManagePermission">
+            <el-table-column
+              prop="claim"
+              label="通知领用"
+              width="150"
+              align="center"
+              v-if="supplyRequestManagePermission"
+            >
               <template #default="scope">
                 <el-link
-                  v-if="scope.row.status === SUPPLY_REQUEST_STATUS.PURCHASING && !scope.row.isClaimed"
+                  v-if="scope.row.status === SUPPLY_REQUEST_DETAIL_STATUS.PURCHASING"
+                  type="primary"
+                  @click="handleNotify(scope.row)"
+                >
+                  通知
+                </el-link>
+                <el-link
+                  v-else-if="scope.row.status === SUPPLY_REQUEST_DETAIL_STATUS.NOTIFIED"
                   type="primary"
                   @click="handleClaim(scope.row)"
                 >
@@ -56,21 +68,21 @@
               <template #default="scope">
                 <div class="action-container">
                   <el-link
-                    v-if="scope.row.status === SUPPLY_REQUEST_STATUS.APPLYING"
+                    v-if="scope.row.status === SUPPLY_REQUEST_DETAIL_STATUS.APPLYING"
                     type="primary"
                     @click="handleEdit(scope.row)"
                   >
                     编辑
                   </el-link>
                   <el-link
-                    v-if="scope.row.status === SUPPLY_REQUEST_STATUS.APPLYING"
+                    v-if="scope.row.status === SUPPLY_REQUEST_DETAIL_STATUS.APPLYING"
                     type="primary"
                     style="margin-left: 8px"
                     @click="handleDelete(scope.row)"
                   >
                     删除
                   </el-link>
-                  <span v-if="scope.row.status !== SUPPLY_REQUEST_STATUS.APPLYING">-</span>
+                  <span v-if="scope.row.status !== SUPPLY_REQUEST_DETAIL_STATUS.APPLYING">-</span>
                 </div>
               </template>
             </el-table-column>
@@ -78,11 +90,13 @@
         </div>
       </div>
     </div>
-    <!-- 领用弹窗 -->
-    <ReceiveSupplyDialog ref="receiveSupplyDialogRef" @success="handleClaimSuccess" />
-    <!-- 添加物资弹窗 -->
-    <AddSuppliesDrawer ref="addSupplyDrawerRef" @success="handleAddMaterialSuccess" />
   </div>
+  <!-- 领用弹窗 -->
+  <ReceiveSupplyDialog ref="receiveSupplyDialogRef" @success="handleClaimSuccess" />
+  <!-- 添加物资弹窗 -->
+  <AddSuppliesDrawer ref="addSupplyDrawerRef" @success="handleAddMaterialSuccess" />
+  <!-- 通知部门领用弹窗 -->
+  <NotifyDepartmentDialog ref="notifyDepartmentDialogRef" @success="handleNotifySuccess" />
 </template>
 
 <script setup lang="ts">
@@ -91,7 +105,11 @@
   import { Plus, Download } from '@element-plus/icons-vue';
   import { ElMessage, ElMessageBox } from 'element-plus';
   import BreadcrumbBack from '@/components/BreadcrumbBack.vue';
-  import { SUPPLY_REQUEST_STATUS, SUPPLY_REQUEST_DETAIL_STATUS_MAP } from './src/constant';
+  import {
+    SUPPLY_REQUEST_STATUS,
+    SUPPLY_REQUEST_DETAIL_STATUS,
+    SUPPLY_REQUEST_DETAIL_STATUS_MAP,
+  } from './src/constant';
   import {
     getSupplyRequestInfoById,
     getSupplyRequestDetail,
@@ -105,6 +123,7 @@
   import { useUserInfoHook } from '@/hooks/useUserInfoHook';
   import { EMERGENCY_PERMISSIONS } from '@/views/emergency/src/constant';
   import AddSuppliesDrawer from './src/components/AddSuppliesDrawer.vue';
+  import NotifyDepartmentDialog from './src/components/NotifyDepartmentDialog.vue';
 
   const { permissions } = useUserInfoHook();
   const supplyRequestManagePermission = ref<Boolean>(false);
@@ -116,13 +135,11 @@
     infoId: number; // info 的 id,用于合并单元格
     materialName: string; // info 的 supplyName
     specification: string; // info 的 specs
-    unitPrice: number; // info 的 unitPrice
-    subtotal: string; // info 的 subtotal
     department: string; // detailList 的 deptName
     quantity: number; // detailList 的 quantity
+    requestReason: string; // detailList 的 requestReason
     sizeDetails: string; // detailList 的 sizeDetail
     status: number; // detailList 的 status
-    isClaimed?: boolean; // 是否已领用(根据状态判断)
   }
 
   const route = useRoute();
@@ -134,7 +151,8 @@
   const tableData = ref<TableRowData[]>([]);
   const addSupplyDrawerRef = ref<InstanceType<typeof AddSuppliesDrawer>>();
   const supplyRequestDetailData = ref<SupplyRequestDetailItem[]>([]);
-
+  // 通知部门领用弹窗相关
+  const notifyDepartmentDialogRef = ref<InstanceType<typeof NotifyDepartmentDialog>>();
   // 领用弹窗相关
   const receiveSupplyDialogRef = ref<InstanceType<typeof ReceiveSupplyDialog>>();
 
@@ -145,8 +163,8 @@
 
   // 合并单元格方法
   const handleSpanMethod = ({ row, rowIndex, columnIndex }: any) => {
-    // 需要合并的列索引:物资名称(1)、规格(2)、单价(3)、小计(4)、物资操作(10)
-    const mergeColumns = [1, 2, 3, 4, 10];
+    // 需要合并的列索引:物资名称(1)、规格(2)、物资操作(9)
+    const mergeColumns = [1, 2, 9];
     if (!mergeColumns.includes(columnIndex)) {
       return { rowspan: 1, colspan: 1 };
     }
@@ -190,13 +208,11 @@
             infoId: item.info.id, // 用于合并单元格
             materialName: item.info.supplyName,
             specification: item.info.specs,
-            unitPrice: item.info.unitPrice,
-            subtotal: item.info.subtotal,
             department: detail.deptName,
             quantity: detail.quantity,
+            requestReason: detail.requestReason,
             sizeDetails: detail.sizeDetail,
             status: detail.status,
-            isClaimed: detail.status === SUPPLY_REQUEST_STATUS.RECEIVED,
           });
         });
       });
@@ -233,6 +249,15 @@
     }
   };
 
+  // 通知领用
+  const handleNotify = (row: TableRowData) => {
+    notifyDepartmentDialogRef.value?.openDialog(row.id);
+  };
+  // 通知领用成功回调
+  const handleNotifySuccess = async () => {
+    await getDetailData();
+  };
+
   // 领用
   const handleClaim = (row: TableRowData) => {
     receiveSupplyDialogRef.value?.openDialog(row.materialName, row.quantity, row.id, id);

+ 6 - 28
src/views/emergency/emergency-supplies/src/components/AddSuppliesDrawer.vue

@@ -20,19 +20,6 @@
       <el-form-item label="规格:" prop="info.specs">
         <el-input v-model="formData.info.specs" placeholder="请输入规格" />
       </el-form-item>
-      <el-form-item
-        label="单价(元):"
-        prop="info.unitPrice"
-        :rules="[
-          { required: true, message: '请输入单价', trigger: 'blur' },
-          { validator: validateFormNumber, trigger: 'blur' },
-        ]"
-      >
-        <el-input v-model.number="formData.info.unitPrice" placeholder="请输入单价" type="number" min="0" />
-      </el-form-item>
-      <el-form-item label="小计:" prop="info.subtotal">
-        <el-input v-model="formData.info.subtotal" placeholder="请输入小计" type="textarea" :rows="3" />
-      </el-form-item>
       <el-form-item label="需求详情:" v-if="deptTree">
         <AddSuppliesSubForm
           ref="subFormRef"
@@ -59,19 +46,18 @@
 </template>
 
 <script setup lang="ts">
-  import { ElDrawer, ElForm, ElInput, ElSelect, ElMessage } from 'element-plus';
   import { ref, reactive, onMounted, useTemplateRef, computed } from 'vue';
+  import { useRoute } from 'vue-router';
+  import { ElDrawer, ElForm, ElInput, ElSelect, ElMessage } from 'element-plus';
   import type {
     AddSupplyRequestForm,
     AddSupplyRequestSubForm,
     SupplyRequestDetailItem,
   } from '@/types/emergency-supplier';
-  import { createSupplyRequestDetail, getSupplyNameList, updateSupplyRequestDetail } from '@/api/emergency-supplier';
-  import AddSuppliesSubForm from './AddSuppliesSubForm.vue';
-
   import type { DeptTree } from '@/types/dept/type';
+  import { createSupplyRequestDetail, getSupplyNameList, updateSupplyRequestDetail } from '@/api/emergency-supplier';
   import { getAllDepartments } from '@/api/auth/dept';
-  import { useRoute } from 'vue-router';
+  import AddSuppliesSubForm from './AddSuppliesSubForm.vue';
 
   const route = useRoute();
   const planId = Number(route.params.id);
@@ -136,8 +122,6 @@
       id: editData.info.id,
       supplyName: editData.info.supplyName,
       specs: editData.info.specs,
-      unitPrice: editData.info.unitPrice,
-      subtotal: editData.info.subtotal,
     };
 
     // 设置 detailList 数据(编辑时不需要保留 id,使用负数作为临时 id)
@@ -147,6 +131,7 @@
         deptId: detail.deptId,
         deptName: detail.deptName,
         quantity: detail.quantity,
+        requestReason: detail.requestReason,
         sizeDetail: detail.sizeDetail,
       };
     });
@@ -223,6 +208,7 @@
           deptId: item.deptId,
           deptName: item.deptName,
           quantity: item.quantity,
+          requestReason: item.requestReason,
           sizeDetail: item.sizeDetail,
         };
       }),
@@ -257,14 +243,6 @@
     }
   };
 
-  const validateFormNumber = (rule: any, value: number, callback: any) => {
-    if (value < 0) {
-      callback(new Error('输入不能小于0'));
-    } else {
-      callback();
-    }
-  };
-
   onMounted(() => {
     getSuppliesNameList();
     getDeptTreeData();

+ 11 - 0
src/views/emergency/emergency-supplies/src/components/AddSuppliesSubForm.vue

@@ -37,6 +37,17 @@
           @change="emits('updateSubForm', subFormData)"
         />
       </el-form-item>
+      <el-form-item
+        label="申请理由:"
+        prop="requestReason"
+        :rules="[{ required: true, message: '请输入申请理由', trigger: 'blur' }]"
+      >
+        <el-input
+          v-model="subFormData.requestReason"
+          placeholder="请输入申请理由"
+          @change="emits('updateSubForm', subFormData)"
+        />
+      </el-form-item>
       <el-form-item label="尺寸明细:" prop="sizeDetail">
         <el-input
           v-model="subFormData.sizeDetail"

+ 95 - 0
src/views/emergency/emergency-supplies/src/components/NotifyDepartmentDialog.vue

@@ -0,0 +1,95 @@
+<template>
+  <BasicDialog ref="basicDialogRef" title="物资领用通知" @refresh="refreshFormData">
+    <template #form>
+      <BasicForm ref="basicFormRef" :formData="ruleFormData" :formRules="formRules" :formConfig="ruleFormConfig">
+        <template #noticeScope>
+          <el-radio-group v-model="ruleFormData.noticeScope">
+            <el-radio v-for="item in notifyRangeOptions" :key="item.value" :label="item.value">{{
+              item.label
+            }}</el-radio>
+          </el-radio-group>
+        </template>
+      </BasicForm>
+    </template>
+    <template #footer>
+      <el-button @click="basicDialogRef?.closeDialog">取消</el-button>
+      <el-button type="primary" @click="handleSubmit">提交</el-button>
+    </template>
+  </BasicDialog>
+</template>
+
+<script setup lang="ts">
+  import { ref } from 'vue';
+  import { ElMessage, ElRadioGroup, ElRadio } from 'element-plus';
+  import BasicDialog from '@/components/BasicDialog.vue';
+  import BasicForm from '@/components/BasicForm.vue';
+  import { useFormConfigHook } from '@/hooks/useFormConfigHook';
+  import { NOTIFY_DEPARTMENT_FORM_CONFIG, NOTIFY_DEPARTMENT_FORM_DATA, NOTIFY_DEPARTMENT_FORM_RULES } from '../config';
+  import { NOTIFY_RANGE, NOTIFY_RANGE_OPTIONS } from '../constant';
+  import { notifySupplyRequestDetail } from '@/api/emergency-supplier';
+
+  const emits = defineEmits<{
+    (e: 'success'): void;
+  }>();
+
+  const basicDialogRef = ref<InstanceType<typeof BasicDialog>>();
+  const basicFormRef = ref<InstanceType<typeof BasicForm>>();
+  const tmpDetailId = ref<number | undefined>(undefined);
+
+  const { ruleFormConfig, ruleFormData, formRules } = useFormConfigHook(
+    NOTIFY_DEPARTMENT_FORM_CONFIG,
+    NOTIFY_DEPARTMENT_FORM_DATA,
+    NOTIFY_DEPARTMENT_FORM_RULES,
+  );
+
+  const notifyRangeOptions = ref<{ label: string; value: number }[]>(NOTIFY_RANGE_OPTIONS);
+
+  // 打开对话框
+  const openDialog = (id: number) => {
+    tmpDetailId.value = id;
+    basicDialogRef.value?.openDialog();
+  };
+
+  // 提交表单
+  const handleSubmit = async () => {
+    const validate = await basicFormRef.value?.validateForm();
+    if (!validate) return;
+
+    if (!tmpDetailId.value) {
+      ElMessage.error('缺少必要参数');
+      return;
+    }
+
+    try {
+      await notifySupplyRequestDetail({
+        detailId: tmpDetailId.value,
+        noticeScope: ruleFormData.noticeScope,
+        requestTime: ruleFormData.requestTime,
+        requestLocation: ruleFormData.requestLocation,
+      });
+      ElMessage.success('通知成功');
+      basicDialogRef.value?.closeDialog();
+      // 清理数据
+      tmpDetailId.value = undefined;
+      ruleFormData.noticeScope = NOTIFY_RANGE.ALL;
+      ruleFormData.requestTime = '';
+      ruleFormData.requestLocation = '';
+      // 触发父组件刷新列表
+      emits('success');
+    } catch (error) {
+      console.error('通知失败:', error);
+      ElMessage.error('通知失败');
+    }
+  };
+
+  // 刷新表单数据(在对话框打开时调用,用于清除验证状态)
+  const refreshFormData = () => {
+    basicFormRef.value?.clearValidate();
+  };
+
+  defineExpose({
+    openDialog,
+  });
+</script>
+
+<style scoped lang="scss"></style>

+ 1 - 1
src/views/emergency/emergency-supplies/src/components/StartPurchaseForm.vue

@@ -4,8 +4,8 @@
       <BasicForm ref="basicFormRef" :formData="ruleFormData" :formRules="formRules" :formConfig="ruleFormConfig" />
     </template>
     <template #footer>
-      <el-button type="primary" @click="handleSubmit">提交</el-button>
       <el-button @click="basicDialogRef?.closeDialog">取消</el-button>
+      <el-button type="primary" @click="handleSubmit">提交</el-button>
     </template>
   </BasicDialog>
 </template>

+ 1 - 1
src/views/emergency/emergency-supplies/src/components/SupplyRequestForm.vue

@@ -4,8 +4,8 @@
       <BasicForm ref="basicFormRef" :formData="ruleFormData" :formRules="formRules" :formConfig="ruleFormConfig" />
     </template>
     <template #footer>
-      <el-button type="primary" @click="handleSubmit">提交</el-button>
       <el-button @click="basicDialogRef?.closeDialog">取消</el-button>
+      <el-button type="primary" @click="handleSubmit">提交</el-button>
     </template>
   </BasicDialog>
 </template>

+ 43 - 0
src/views/emergency/emergency-supplies/src/config/form.ts

@@ -3,6 +3,7 @@
  */
 import type { FormConfig } from '@/types/basic-form';
 import { validateFormTime } from '@/utils/validateFormTime';
+import { NOTIFY_RANGE } from '../constant';
 
 // 盘点任务表单信息
 export const INVENTORY_TASK_FROM_CONFIG: FormConfig[] = [
@@ -386,3 +387,45 @@ export const START_PURCHASE_FORM_DATA = {
 export const START_PURCHASE_FORM_RULES = {
   purchaseDate: [{ required: true, message: '请选择采购日期', trigger: 'change' }],
 };
+
+// 物资领用通知表单配置
+export const NOTIFY_DEPARTMENT_FORM_CONFIG: FormConfig[] = [
+  {
+    label: '通知范围:',
+    prop: 'noticeScope',
+    slot: 'noticeScope',
+  },
+  {
+    label: '领用时间:',
+    prop: 'requestTime',
+    component: 'ElDatePicker',
+    componentProps: {
+      placeholder: '请选择领用时间',
+      type: 'date',
+      format: 'YYYY-MM-DD',
+      valueFormat: 'YYYY-MM-DD',
+    },
+  },
+  {
+    label: '领用地点:',
+    prop: 'requestLocation',
+    component: 'ElInput',
+    componentProps: {
+      placeholder: '请输入领用地点',
+    },
+  },
+];
+
+// 物资领用通知表单数据
+export const NOTIFY_DEPARTMENT_FORM_DATA = {
+  noticeScope: NOTIFY_RANGE.ALL,
+  requestTime: '',
+  requestLocation: '',
+};
+
+// 物资领用通知表单规则
+export const NOTIFY_DEPARTMENT_FORM_RULES = {
+  noticeScope: [{ required: true, message: '请选择通知范围', trigger: 'change' }],
+  requestTime: [{ required: true, message: '请选择领用时间', trigger: 'change' }],
+  requestLocation: [{ required: true, message: '请输入领用地点', trigger: 'blur' }],
+};

+ 6 - 0
src/views/emergency/emergency-supplies/src/config/index.ts

@@ -39,6 +39,9 @@ import {
   START_PURCHASE_FORM_CONFIG,
   START_PURCHASE_FORM_DATA,
   START_PURCHASE_FORM_RULES,
+  NOTIFY_DEPARTMENT_FORM_CONFIG,
+  NOTIFY_DEPARTMENT_FORM_DATA,
+  NOTIFY_DEPARTMENT_FORM_RULES,
 } from './form';
 
 export {
@@ -82,4 +85,7 @@ export {
   START_PURCHASE_FORM_CONFIG,
   START_PURCHASE_FORM_DATA,
   START_PURCHASE_FORM_RULES,
+  NOTIFY_DEPARTMENT_FORM_CONFIG,
+  NOTIFY_DEPARTMENT_FORM_DATA,
+  NOTIFY_DEPARTMENT_FORM_RULES,
 };

+ 0 - 5
src/views/emergency/emergency-supplies/src/config/table.ts

@@ -260,11 +260,6 @@ export const SUPPLY_REQUEST_TABLE_COLUMNS: TableColumnProps[] = [
     prop: 'purchaseDate',
     width: '180px',
   },
-  {
-    label: '总价(元)',
-    prop: 'totalPrice',
-    minWidth: '140px',
-  },
   {
     label: '状态',
     prop: 'status',

+ 20 - 0
src/views/emergency/emergency-supplies/src/constant/index.ts

@@ -97,10 +97,30 @@ export enum SUPPLY_REQUEST_DETAIL_STATUS {
   APPLYING = 1, // 申请中
   PURCHASING = 2, // 采购中
   RECEIVED = 3, // 已领用
+  NOTIFIED = 4, // 已通知领用
 }
 
 export const SUPPLY_REQUEST_DETAIL_STATUS_MAP = {
   [SUPPLY_REQUEST_DETAIL_STATUS.APPLYING]: '申请中',
   [SUPPLY_REQUEST_DETAIL_STATUS.PURCHASING]: '采购中',
   [SUPPLY_REQUEST_DETAIL_STATUS.RECEIVED]: '已领用',
+  [SUPPLY_REQUEST_DETAIL_STATUS.NOTIFIED]: '已通知领用',
 };
+
+/**
+ * 物资领用通知范围
+ */
+export enum NOTIFY_RANGE {
+  ALL = 1,
+  CURRENT = 2,
+}
+
+export const NOTIFY_RANGE_MAP = {
+  [NOTIFY_RANGE.ALL]: '通知此物资所有需求部门',
+  [NOTIFY_RANGE.CURRENT]: '仅通知此物资当前需求部门',
+};
+
+export const NOTIFY_RANGE_OPTIONS = [
+  { label: NOTIFY_RANGE_MAP[NOTIFY_RANGE.ALL], value: NOTIFY_RANGE.ALL },
+  { label: NOTIFY_RANGE_MAP[NOTIFY_RANGE.CURRENT], value: NOTIFY_RANGE.CURRENT },
+];