iZaiZaiA 2 years ago
parent
commit
f1b24a9712

+ 2 - 2
package.json

@@ -12,7 +12,7 @@
         "crypto-js": "^4.1.1",
         "dayjs": "^1.11.5",
         "echarts": "^5.3.3",
-        "element-plus": "^2.2.16",
+        "element-plus": "^2.2.17",
         "js-base64": "^3.7.2",
         "js-cookie": "^3.0.1",
         "js-md5": "^0.7.3",
@@ -36,6 +36,6 @@
         "unplugin-auto-import": "^0.11.2",
         "unplugin-vue-components": "^0.22.7",
         "vfonts": "^0.0.3",
-        "vite": "^3.1.1"
+        "vite": "^3.1.2"
     }
 }

+ 26 - 2
src/api/modules/ledger/query.js

@@ -52,7 +52,15 @@ export default {
     //获取表单数据
     async getBussDataInfo(form, msg = true) {
         return httpApi({
-            url: '/api/blade-manager/exceltab/get-buss-dataInfo',
+            url: '/api/blade-manager/exceltab/get-the-log-business-data',
+            method: 'get',
+            params: form
+        }, msg);
+    },
+    //获取表单数据
+    async getTheLogBusinessData(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-manager/exceltab/get-the-log-business-data',
             method: 'get',
             params: form
         }, msg);
@@ -68,7 +76,23 @@ export default {
     //单表pdf预览
     async getBussPdfInfo(form, msg = true) {
         return httpApi({
-            url: '/api/blade-manager/exceltab/get-buss-pdfInfo',
+            url: '/api/blade-manager/exceltab/get-the-log-pdfInfo',
+            method: 'get',
+            params: form
+        }, msg);
+    },
+    //获取当前日志资料关联的工序节点信息
+    async queryCurrentLogSelectProcessList(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-business/contractLog/queryCurrentLogSelectProcessList',
+            method: 'post',
+            params: form
+        }, msg);
+    },
+    //获取当前日志资料关联的工序节点信息
+    async copyTheLogBusinessData(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-business/exceltab/copy-the-log-business-data',
             method: 'get',
             params: form
         }, msg);

+ 1 - 0
src/global/components/hc-report-modal/index.vue

@@ -137,6 +137,7 @@ onMounted(() => {
 //获取流程数据
 const linkUserJoinString = ref('')
 const getProcessData = async () => {
+    linkUserJoinString.value = ''
     const { error, code, data } = await tasksFlowApi.getPageData({
         projectId: projectId.value,
         contractId: contractId.value,

+ 4 - 0
src/plugins/HTableForm.js

@@ -65,7 +65,11 @@ export const HTableForm = ({template, tableForm, appId, onRight}) => {
             delTableFormFile(key) {
                 this.formData[key] = ''
             },
+            upFormData() {
+
+            }
         }
     })
     app.mount(appId)
+    return app
 }

+ 126 - 20
src/views/ledger/components/table-form.vue

@@ -6,6 +6,16 @@
                     <div class="hc-excel-table-form-view" :id="`table-form-${excelIdVal}`"></div>
                 </el-scrollbar>
                 <HcStatus :desc="statusDesc" v-else/>
+                <div class="hc-fixed-page" v-if="formLogDataList.length > 1">
+                    <el-scrollbar>
+                        <template v-for="(item,index) in formLogDataList">
+                            <el-button :type="index === formLogIndex ? 'primary' : ''" hc-btn @click="getBussDataInfo(index)">
+                                <HcIcon name="sticky-note"/>
+                                <span>第{{index + 1}}页</span>
+                            </el-button>
+                        </template>
+                    </el-scrollbar>
+                </div>
             </div>
             <div class="hc-right-pian-box hc-flex-column">
                 <DateCalendar :dateData="dateData" @choice-date="dateCalendarChoice"/>
@@ -46,7 +56,7 @@
                 </el-button>
             </HcTooltip>
             <HcTooltip keys="ledger_query_copy_form">
-                <el-button hc-btn :disabled="!isTableForm">
+                <el-button hc-btn :disabled="!isTableForm" @click="copyTableFormClick">
                     <HcIcon name="file-copy-2"/>
                     <span>复制当前表格及内容</span>
                 </el-button>
@@ -58,7 +68,7 @@
                 </el-button>
             </HcTooltip>
             <HcTooltip keys="ledger_query_add_form">
-                <el-button hc-btn :disabled="!isTableForm">
+                <el-button hc-btn :disabled="!isTableForm" @click="addTableFormClick">
                     <HcIcon name="add-circle"/>
                     <span>新增表格</span>
                 </el-button>
@@ -148,17 +158,19 @@ const getSubmitLogDateList = async (pid) => {
         dateData.value = []
     }
 }
+
 //日期日历回调
 const recordTime = ref('')
 const dateCalendarChoice = ({choices}) => {
     recordTime.value = choices
+    queryCurrentLogSelectProcessList(choices)
+    getTheLogBusinessData(excelIdVal.value, choices)
 }
 
 //表格表单渲染
 const isTableForm = ref(false)
 const getExcelHtmlData = async (excelId) => {
     if (excelId) {
-        getBussDataInfo(excelId)
         getExcelHtml(excelId)
     } else {
         statusDesc.value = `excelId: ${excelId || '-1 或 空'}`
@@ -166,33 +178,52 @@ const getExcelHtmlData = async (excelId) => {
     }
 }
 
+//表单数据
+const formLogDataList = ref([])
+const getTheLogBusinessData = async (excelId, recordDate) => {
+    const {primaryKeyId} = menuItem.value
+    const { data } = await queryApi.getTheLogBusinessData({
+        pkeyId: excelId,
+        nodePrimaryKeyId: primaryKeyId,
+        recordTime: recordDate,
+        theLogId: ""
+    }, false)
+    formLogDataList.value = getArrValue(data)
+    getBussDataInfo()
+}
+
 //获取表单初始数据
+const formLogIndex = ref(0)
 const tableFormData = ref({})
-const getBussDataInfo = async (excelId) => {
-    const { data } = await queryApi.getBussDataInfo({
-        pkeyId: excelId
-    }, false)
-    const info = getObjValue(data)
+const getBussDataInfo = (index = 0) => {
+    const formLog = formLogDataList.value
+    const info = getObjValue(formLog[index])
+    formLogIndex.value = index
     if (getObjNullValue(info)) {
         const pickerKey = info['pickerKey'] || ''
-        const pickerKeys = pickerKey.split(',')
-        for (let i = 0; i < pickerKeys.length; i++) {
-            const val = info[pickerKeys[i]] || ''
-            if (val) {
-                const data = val.replace(/'/g,'"');
-                info[pickerKeys[i]] = JSON.parse(data)
-            } else {
-                info[pickerKeys[i]] = []
+        if (pickerKey) {
+            const pickerKeys = pickerKey.split(',')
+            for (let i = 0; i < pickerKeys.length; i++) {
+                const val = info[pickerKeys[i]] || ''
+                if (val) {
+                    const data = val.replace(/'/g,'"');
+                    info[pickerKeys[i]] = JSON.parse(data)
+                } else {
+                    info[pickerKeys[i]] = []
+                }
             }
         }
         //有数据,关联数据
         tableFormData.value = info
+        console.log(tableFormApp.value)
+        //tableFormApp.value.formData = info
     } else {
         tableFormData.value = {}
     }
 }
 
 //获取模板标签数据
+const tableFormApp = ref(null)
 const getExcelHtml = async (excelId) => {
     //获取数据
     const { error, code, data } = await queryApi.getExcelHtml({
@@ -204,7 +235,7 @@ const getExcelHtml = async (excelId) => {
         isTableForm.value = true
         //渲染表单
         await nextTick(() => {
-            HTableForm({
+            tableFormApp.value = HTableForm({
                 template: resData,
                 tableForm: tableFormData.value,
                 appId: `#table-form-${excelId}`
@@ -312,14 +343,14 @@ const saveExcelBussData = async () => {
         tableFormSaveLoading.value = true
         const { error, code } = await queryApi.saveExcelBussData({
             ...tableFormData.value,
-            classify: 1,
             projectId: projectId.value,
             contractId: contractId.value,
             pkeyId: excelIdVal.value,
+            recordTime: recordTime.value,
             linkTabIds: linkTabIds,
             isTheLog: "1",
             theLogId: "",
-            recordTime: recordTime.value
+            classify: 1,
         },false)
         tableFormSaveLoading.value = false
         if (!error && code === 200) {
@@ -364,8 +395,12 @@ const previewBussPdf = () => {
 //预览PDF
 const getBussPdfInfo = async () => {
     previewLoading.value = true
+    const {primaryKeyId} = menuItem.value
     const { error, code, data } = await queryApi.getBussPdfInfo({
-        pkeyId: excelIdVal.value
+        pkeyId: excelIdVal.value,
+        nodePrimaryKeyId: primaryKeyId,
+        recordTime: recordTime.value,
+        theLogId: ""
     }, false)
     //处理数据
     previewLoading.value = false
@@ -377,6 +412,63 @@ const getBussPdfInfo = async () => {
     }
 }
 
+//获取当前日志资料关联的工序节点信息
+const queryCurrentLogSelectProcessList = async (dateVal) => {
+    const {primaryKeyId} = menuItem.value
+    const { data } = await queryApi.queryCurrentLogSelectProcessList({
+        nodePrimaryKeyId: primaryKeyId,
+        recordTime: dateVal,
+        theLogId: ""
+    }, false)
+    //处理数据
+    let dataKeys = getArrValue(data), NodesArr = []
+    for (let i = 0; i < dataKeys.length; i++) {
+        NodesArr.push({
+            primaryKeyId: dataKeys[i]?.primaryKeyId,
+            pathName: dataKeys[i]?.path
+        })
+    }
+    processDataList.value = NodesArr
+}
+
+//新增表格
+const addTableFormClick = () => {
+    formLogDataList.value.push({
+        projectId: projectId.value,
+        contractId: contractId.value,
+        recordTime: recordTime.value,
+        pkeyId: excelIdVal.value,
+        linkTabIds: [],
+        isTheLog: "1",
+        theLogId: "",
+        classify: 1
+    })
+    const index = formLogDataList.value.length - 1
+    getBussDataInfo(index)
+}
+
+//复制表格内容
+const copyTableFormClick = () => {
+    const formLog = formLogDataList.value
+    const logIndex = formLogIndex.value
+    formLogDataList.value.push({
+        ...formLog[logIndex],
+        projectId: projectId.value,
+        contractId: contractId.value,
+        recordTime: recordTime.value,
+        pkeyId: excelIdVal.value,
+        isTheLog: "1",
+        theLogId: "",
+        classify: 1
+    })
+    const index = formLogDataList.value.length - 1
+    getBussDataInfo(index)
+}
+
+//复制任意时间
+const copyTheLogBusinessData = () => {
+    //copyTheLogBusinessData
+}
 </script>
 
 <style lang="scss" scoped>
@@ -401,6 +493,14 @@ const getBussPdfInfo = async () => {
             background: #f1f5f8;
             border-radius: 10px;
             box-shadow: -2px 0px 10px 0px rgba(32,37,50,0.03), 0px 10px 21px 20px rgba(32,37,50,0.03);
+            .hc-fixed-page {
+                position: absolute;
+                top: 4px;
+                right: 4px;
+                bottom: 4px;
+                z-index: 99;
+                overflow: hidden;
+            }
         }
         .hc-right-pian-box {
             width: 360px;
@@ -467,4 +567,10 @@ const getBussPdfInfo = async () => {
         display: inline-block;
     }
 }
+.hc-table-form-content .hc-content-box .hc-table-forem-box .hc-fixed-page {
+    .el-button {
+        display: block;
+        margin: 20px;
+    }
+}
 </style>

+ 8 - 8
yarn.lock

@@ -441,10 +441,10 @@ electron-to-chromium@^1.4.202:
   resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.241.tgz#5aa03ab94db590d8269f4518157c24b1efad34d6"
   integrity sha512-e7Wsh4ilaioBZ5bMm6+F4V5c11dh56/5Jwz7Hl5Tu1J7cnB+Pqx5qIF2iC7HPpfyQMqGSvvLP5bBAIDd2gAtGw==
 
-element-plus@^2.2.16:
-  version "2.2.16"
-  resolved "https://registry.yarnpkg.com/element-plus/-/element-plus-2.2.16.tgz#84c00fc4a2d84031ec18d0f28820593c6e451513"
-  integrity sha512-rvaTMFIujec9YDC5lyaiQv2XVUCHuhVDq2k+9vQxP78N8Wd07iEOGa9pvEVOO2uYc75l4rSl2RE/IWPH/6Mdzw==
+element-plus@^2.2.17:
+  version "2.2.17"
+  resolved "https://registry.yarnpkg.com/element-plus/-/element-plus-2.2.17.tgz#abbb12c19dc029c95b0271822ea9a0e635704bc2"
+  integrity sha512-MGwMIE/q+FFD3kgS23x8HIe5043tmD1cTRwjhIX9o6fim1avFnUkrsfYRvybbz4CkyqSb185EheZS5AUPpXh2g==
   dependencies:
     "@ctrl/tinycolor" "^3.4.1"
     "@element-plus/icons-vue" "^2.0.6"
@@ -1231,10 +1231,10 @@ vfonts@^0.0.3:
   resolved "https://registry.yarnpkg.com/vfonts/-/vfonts-0.0.3.tgz#999d66fecea18efee3f2b966c81101ae8ce01a29"
   integrity sha512-nguyw8L6Un8eelg1vQ31vIU2ESxqid7EYmy8V+MDeMaHBqaRSkg3dTBToC1PR00D89UzS/SLkfYPnx0Wf23IQQ==
 
-vite@^3.1.1:
-  version "3.1.1"
-  resolved "https://registry.yarnpkg.com/vite/-/vite-3.1.1.tgz#fcfe12c3fe7e4c6def1fc52e4dc9cb0ccb2b1a59"
-  integrity sha512-hgxQWev/AL7nWYrqByYo8nfcH9n97v6oFsta9+JX8h6cEkni7nHKP2kJleNYV2kcGhE8jsbaY1aStwPZXzPbgA==
+vite@^3.1.2:
+  version "3.1.2"
+  resolved "https://registry.yarnpkg.com/vite/-/vite-3.1.2.tgz#6b080f928490b1a46465ed3cbb4815f31f1a5376"
+  integrity sha512-wTDKPkiVbeT+drTPdkuvjVIC/2vKKUc1w3qNOuwgpyvPCZF6fvdxB5v5WEcCsqaYea0zrwA4+XialJKCHM3oVQ==
   dependencies:
     esbuild "^0.15.6"
     postcss "^8.4.16"