From be57c60a2b1ce03ebdd264176149c52870c0b760 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期二, 11 十一月 2025 10:52:28 +0800
Subject: [PATCH] 企业改成单位

---
 src/views/work/documentManage/docBorrowCopy/components/editDialog.vue |  235 ++++++++++++++++++----------------------------------------
 1 files changed, 74 insertions(+), 161 deletions(-)

diff --git a/src/views/work/documentManage/docBorrowCopy/components/editDialog.vue b/src/views/work/documentManage/docBorrowCopy/components/editDialog.vue
index 04c9540..ada90fe 100644
--- a/src/views/work/documentManage/docBorrowCopy/components/editDialog.vue
+++ b/src/views/work/documentManage/docBorrowCopy/components/editDialog.vue
@@ -9,7 +9,7 @@
         :close-on-click-modal="false"
     >
       <el-form :model="state.form" size="default" ref="superRef" :rules="state.formRules" label-width="150px" >
-        <el-form-item v-if="state.isAdmin" label="企业:" prop="companyId">
+        <el-form-item v-if="state.isAdmin" label="单位:" prop="companyId">
           <el-select v-model="state.form.companyId" placeholder="请选择" :disabled="state.title =='查看'" clearable @change="getDeptList">
             <el-option
                 v-for="item in state.companyList"
@@ -35,6 +35,17 @@
         <el-table :data="state.form.documentBorrowCopyRecordList" class="customedTable" :border="true">
           <el-table-column label="序号" type="index" width="80" align="center">
           </el-table-column>
+          <el-table-column label="时间" prop="borrowDate" align="center">
+            <template #default="scope">
+              <el-date-picker
+                  v-model="scope.row.borrowDate"
+                  type="date"
+                  value-format="YYYY-MM-DD"
+                  placeholder="请选择日期"
+                  :disabled="state.title =='查看'"
+              />
+            </template>
+          </el-table-column>
           <el-table-column label="文件名称" prop="fileName" align="center">
             <template #default="scope">
               <el-input
@@ -48,7 +59,7 @@
               </el-input>
             </template>
           </el-table-column>
-          <el-table-column label="编号" prop="number" align="center">
+          <el-table-column label="文件编号" prop="number" align="center">
             <template #default="scope">
               <el-input
                   v-model.trim="scope.row.number"
@@ -61,111 +72,57 @@
               </el-input>
             </template>
           </el-table-column>
-          <el-table-column label="发放记录" align="center">
-            <el-table-column label="部门" prop="distributionDeptName" align="center">
-              <template #default="scope">
-                <el-input
-                    v-model.trim="scope.row.distributionDeptName"
-                    size="large"
-                    type="textarea"
-                    style="width: 100%;"
-                    clearable
-                    :readonly="state.title =='查看'"
-                >
-                </el-input>
-              </template>
-            </el-table-column>
-            <el-table-column label="签收" prop="distributionSign" align="center">
-              <template #default="scope">
-                <el-input
-                    v-model.trim="scope.row.distributionSign"
-                    size="large"
-                    type="textarea"
-                    style="width: 100%;"
-                    clearable
-                    :readonly="state.title =='查看'"
-                >
-                </el-input>
-              </template>
-            </el-table-column>
-            <el-table-column label="日期" prop="distributionDate" align="center">
-              <template #default="scope">
-                <el-date-picker
-                    v-model="scope.row.distributionDate"
-                    type="date"
-                    value-format="YYYY-MM-DD"
-                    placeholder="请选择日期"
-                    :disabled="state.title =='查看'"
-                />
-              </template>
-            </el-table-column>
-            <el-table-column label="份数" prop="distributionNum" align="center">
-              <template #default="scope">
-                <el-input
-                    v-model.trim="scope.row.distributionNum"
-                    size="large"
-                    type="textarea"
-                    style="width: 100%;"
-                    clearable
-                    :readonly="state.title =='查看'"
-                >
-                </el-input>
-              </template>
-            </el-table-column>
+          <el-table-column label="受控状态" prop="controlledState" align="center">
+            <template #default="scope">
+              <el-input
+                  v-model.trim="scope.row.controlledState"
+                  size="large"
+                  type="textarea"
+                  style="width: 100%;"
+                  clearable
+                  :readonly="state.title =='查看'"
+              >
+              </el-input>
+            </template>
           </el-table-column>
-          <el-table-column label="回收记录" align="center">
-            <el-table-column label="部门" prop="collectionDeptName" align="center">
-              <template #default="scope">
-                <el-input
-                    v-model.trim="scope.row.collectionDeptName"
-                    size="large"
-                    type="textarea"
-                    style="width: 100%;"
-                    clearable
-                    :readonly="state.title =='查看'"
-                >
-                </el-input>
-              </template>
-            </el-table-column>
-            <el-table-column label="签回" prop="collectionSign" align="center">
-              <template #default="scope">
-                <el-input
-                    v-model.trim="scope.row.collectionSign"
-                    size="large"
-                    type="textarea"
-                    style="width: 100%;"
-                    clearable
-                    :readonly="state.title =='查看'"
-                >
-                </el-input>
-              </template>
-            </el-table-column>
-            <el-table-column label="日期" prop="collectionDate" align="center">
-              <template #default="scope">
-                <el-date-picker
-                    v-model="scope.row.collectionDate"
-                    type="date"
-                    value-format="YYYY-MM-DD"
-                    placeholder="请选择日期"
-                    :disabled="state.title =='查看'"
-                />
-              </template>
-            </el-table-column>
-            <el-table-column label="份数" prop="collectionNum" align="center">
-              <template #default="scope">
-                <el-input
-                    v-model.trim="scope.row.collectionNum"
-                    size="large"
-                    type="textarea"
-                    style="width: 100%;"
-                    clearable
-                    :readonly="state.title =='查看'"
-                >
-                </el-input>
-              </template>
-            </el-table-column>
+          <el-table-column label="借阅/复制(份数)" prop="collectionNum" align="center">
+            <template #default="scope">
+              <el-input
+                  v-model.number.trim="scope.row.collectionNum"
+                  size="large"
+                  type="number"
+                  style="width: 100%;"
+                  clearable
+                  :readonly="state.title =='查看'"
+              >
+              </el-input>
+            </template>
           </el-table-column>
-          <el-table-column label="备注/版本" prop="remark" align="center">
+          <el-table-column label="签名" prop="backSign" align="center">
+            <template #default="scope">
+              <el-input
+                  v-model.trim="scope.row.backSign"
+                  size="large"
+                  type="textarea"
+                  style="width: 100%;"
+                  clearable
+                  :readonly="state.title =='查看'"
+              >
+              </el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="归还日期" prop="backDate" align="center">
+            <template #default="scope">
+              <el-date-picker
+                  v-model="scope.row.backDate"
+                  type="date"
+                  value-format="YYYY-MM-DD"
+                  placeholder="请选择日期"
+                  :disabled="state.title =='查看'"
+              />
+            </template>
+          </el-table-column>
+          <el-table-column label="备注" prop="remark" align="center">
             <template #default="scope">
               <el-input
                   v-model.trim="scope.row.remark"
@@ -184,31 +141,6 @@
             </template>
           </el-table-column>
         </el-table>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="制表:" prop="tabulationId">
-              <el-select clearable v-model="state.form.tabulationId" :disabled="state.title =='查看'" filterable placeholder="编制" style="width: 100%">
-                <el-option
-                    v-for="item in state.userList"
-                    :key="item.userId"
-                    :label="item.name"
-                    :value="item.userId"
-                />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="日期:" prop="tabulationDate">
-              <el-date-picker
-                  v-model="state.form.tabulationDate"
-                  type="date"
-                  value-format="YYYY-MM-DD"
-                  placeholder="请选择日期"
-                  :disabled="state.title =='查看'"
-              />
-            </el-form-item>
-          </el-col>
-        </el-row>
       </el-form>
       <template #footer v-if="state.title !='查看'">
         <span class="dialog-footer">
@@ -223,17 +155,10 @@
 import {reactive, ref, toRefs, defineEmits, nextTick, onMounted} from 'vue'
 import {ElMessage} from "element-plus";
 import {getToken} from "@/utils/auth";
-import {
-  updateMaintenanceEvaluate,
-  getMaintenanceEvaluateDetail
-} from "@/api/infrastructureMng/ledger";
-
 import {listUser} from "@/api/system/user";
 import {
   getDocBorrowCopyDetail,
-  getDocDistributeCollectDetail,
   saveDocBorrowCopy,
-  saveDocDistributeCollect
 } from "@/api/documentManage";
 
 const emit = defineEmits(["getList"]);
@@ -241,7 +166,7 @@
 const superRef = ref()
 const checkList = (rule, value, callback) => {
   if (state.form.documentBorrowCopyRecordList.length == 0) {
-    callback(new Error('文件发放回收记录不可为空'))
+    callback(new Error('文件借阅复制记录不可为空'))
   } else {
     callback()
   }
@@ -253,17 +178,13 @@
     companyId: null,
     name: '',
     documentBorrowCopyRecordList: [],
-    deleteIds: [],
-    tabulationId: null,
-    tabulationName: '',
-    tabulationDate: ''
+    deleteIds: []
   },
   oldDeviceList: [],
   formRules:{
     companyId: [{ required: true, message: '请选择企业', trigger: 'blur' }],
     name: [{ required: true, message: '请填写名称', trigger: 'blur' }],
-    tabulationId: [{ required: true, message: '请选择制表人', trigger: 'blur' }],
-    tabulationDate: [{ required: true, message: '请选择制表日期', trigger: 'blur' }],
+    documentBorrowCopyRecordList: [{ required: true, validator: checkList, trigger: 'blur' }],
   },
   isAdmin: false,
   companyList: [],
@@ -290,17 +211,14 @@
 const addLine = () => {
   const obj = {
     id: null,
-    documentId: null,
+    documentBorrowId: null,
     fileName: '',
     number: '',
-    distributionDeptName: '',
-    distributionSign: '',
-    distributionDate: '',
-    distributionNum: null,
-    collectionDeptName: '',
-    collectionSign: '',
-    collectionDate: '',
+    borrowDate: '',
+    controlledState: '',
     collectionNum: null,
+    backSign: '',
+    backDate: '',
     remark: ''
   }
   state.form.documentBorrowCopyRecordList.push(obj);
@@ -350,8 +268,8 @@
       }
     })
     state.form.documentBorrowCopyRecordList = res.data.documentBorrowCopyRecordList?.map(
-        ({ id, documentId, fileName, number, distributionDeptName, distributionSign, distributionDate, distributionNum, collectionDeptName, collectionSign, collectionDate, collectionNum, remark}) => ({
-          id, documentId, fileName, number, distributionDeptName, distributionSign, distributionDate, distributionNum, collectionDeptName, collectionSign, collectionDate, collectionNum, remark
+        ({ id, documentBorrowId, fileName, number, borrowDate, controlledState, collectionNum, backSign, backDate, remark}) => ({
+          id, documentBorrowId, fileName, number, borrowDate, controlledState, collectionNum, backSign, backDate, remark
         })
     )
     state.oldDeviceList = state.form.documentBorrowCopyRecordList
@@ -361,9 +279,7 @@
 }
 
 const getDeptList = async ()=>{
-  state.form.tabulationId = null
-  state.form.tabulationName = ''
-  await getUserList(state.form.companyId)
+  // await getUserList(state.form.companyId)
 }
 
 const getUserList = async (companyId)=> {
@@ -388,10 +304,7 @@
     companyId: null,
     name: '',
     documentBorrowCopyRecordList: [],
-    deleteIds: [],
-    tabulationId: null,
-    tabulationName: '',
-    tabulationDate: ''
+    deleteIds: []
   }
   superRef.value.clearValidate();
   superRef.value.resetFields()

--
Gitblit v1.9.2