gaoluyang
2 天以前 922a907b054f11ff6e9b64b672aea563bb326835
进销存new
1.档案管理修改
已修改2个文件
41 ■■■■■ 文件已修改
src/views/fileManagement/borrow/index.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fileManagement/document/index.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fileManagement/borrow/index.vue
@@ -100,16 +100,14 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="借阅书籍:" prop="documentationId">
               <!-- <el-select v-model="borrowForm.documentationId" placeholder="请选择借阅书籍" style="width: 100%" @change="handleScanContent">
                 <el-option
                   v-for="item in documentList"
                   :key="item.id"
                   :label="item.docName || item.name"
                   :value="item.id"
                 />
               </el-select> -->
               <div style="display: flex; gap: 10px;">
                <el-select v-model="borrowForm.documentationId" placeholder="请选择借阅书籍" style="flex: 1;width: 100px;" @change="handleSelectChange">
                <el-select
                  v-if="borrowOperationType !== 'edit'"
                  v-model="borrowForm.documentationId"
                  placeholder="请选择借阅书籍"
                  style="flex: 1;width: 100px;"
                  @change="handleSelectChange"
                >
                  <el-option 
                    v-for="item in documentList" 
                    :key="item.id" 
@@ -118,6 +116,13 @@
                  />
                </el-select>
                <el-input
                  v-else
                  v-model="currentEditDocName"
                  style="flex: 1;width: 100px;"
                  disabled
                />
                <el-input
                  v-if="borrowOperationType !== 'edit'"
                  v-model="scanContent"
                  placeholder="扫码输入"
                  style="width: 100px;"
@@ -205,6 +210,7 @@
const selectedRows = ref([]);
const documentList = ref([]); // 文档列表,用于借阅书籍选择
const scanContent = ref() // 扫码内容
const currentEditDocName = ref(''); // 编辑时存储的文档名称
// 分页相关
const pagination = reactive({
  currentPage: 1,
@@ -282,6 +288,7 @@
      {
        name: "编辑",
        type: "text",
        disabled: (row) => row.borrowStatus === '归还',
        clickFun: (row) => {
          openBorrowDia('edit', row)
        },
@@ -428,13 +435,16 @@
  if (type === "edit") {
    // 编辑模式,加载现有数据
    Object.assign(borrowForm, data);
    // 存储文档名称用于显示
    currentEditDocName.value = data.docName || '';
  } else {
    // 新增模式,清空表单
    Object.keys(borrowForm).forEach(key => {
      borrowForm[key] = "";
    });
         // 设置默认状态
     borrowForm.borrowStatus = "借阅";
    currentEditDocName.value = ''; // 清空编辑时的文档名称
    // 设置默认状态
    borrowForm.borrowStatus = "借阅";
    // 设置当前日期为借阅日期
    borrowForm.borrowDate = new Date().toISOString().split('T')[0];
  }
@@ -445,6 +455,7 @@
  proxy.$refs.borrowFormRef.resetFields();
  borrowDia.value = false;
  scanContent.value = ''; // 清空扫码内容
  currentEditDocName.value = ''; // 清空编辑时的文档名称
};
// 提交借阅表单
src/views/fileManagement/document/index.vue
@@ -862,12 +862,14 @@
      documentForm[key] = "";
    });
    documentForm.attachments = []; // 新增模式下也清空附件
    // 设置默认值 - 使用字典数据的第一个选项作为默认值
    // 设置默认值 - 文档状态默认设置为"正常"
    if (document_status.value && document_status.value.length > 0) {
      documentForm.docStatus = document_status.value[0].value;
      const normalStatus = document_status.value.find(item => item.label === '正常');
      documentForm.docStatus = normalStatus ? normalStatus.value : document_status.value[0].value;
    }
    if (document_urgency.value && document_urgency.value.length > 0) {
      documentForm.urgencyLevel = document_urgency.value[0].value;
      const normalUrgency = document_urgency.value.find(item => item.label === '普通');
      documentForm.urgencyLevel = normalUrgency ? normalUrgency.value : document_urgency.value[0].value;
    }
  }
};