Browse Source

试验,材料进场,接口调试

iZaiZaiA 2 years ago
parent
commit
55d90cd792

+ 6 - 22
src/api/modules/tentative/material/approach.js

@@ -41,36 +41,20 @@ export default {
             data: form
         }, msg);
     },
-    //批量审批
-    async batchCompleteApprovalTask(form, msg = true) {
+    //批量打印进场材料Pdf
+    async exportPdf(form, msg = true) {
         return httpApi({
-            url: '/api/blade-business/task/batch-complete-approval-task',
+            url: '/api/blade-business/material/mobilization/export-pdf',
             method: 'post',
-            data: form
-        }, msg);
-    },
-    //获取发起
-    async queryUserStartFlow(form, msg = true) {
-        return httpApi({
-            url: '/api/blade-business/task/query-user-start-flow',
-            method: 'get',
             params: form
         }, msg);
     },
-    //批量页详情
-    async queryTaskInfo(form, msg = true) {
+    //材料取样记录
+    async samplingRecord(form, msg = true) {
         return httpApi({
-            url: '/api/blade-business/task/batch-approval-parameter',
+            url: '/api/blade-business/material/mobilization/sampling-record',
             method: 'get',
             params: form
         }, msg);
     },
-    //校验电签短信验证码
-    async checkSmsCode(form, msg = true) {
-        return httpApi({
-            url: '/api/blade-business/task/check-sms-code',
-            method: 'post',
-            data: form
-        }, msg);
-    },
 }

+ 32 - 2
src/views/tentative/material/approach.vue

@@ -27,7 +27,7 @@
                     </el-button>
                 </HcTooltip>
                 <HcTooltip keys="tentative_material_approach_printer">
-                    <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn>
+                    <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" :loading="printerLoading" @click="printerClick">
                         <HcIcon name="printer"/>
                         <span>打印</span>
                     </el-button>
@@ -547,6 +547,28 @@ const tableRemoveData = async () => {
     }
 }
 
+//打印
+const printerLoading = ref(false)
+const printerClick = async () => {
+    const rows = tableCheckedKeys.value
+    if (rows.length > 0 ) {
+        printerLoading.value = true
+        const ids = rowsToId(rows)
+        //删除请求
+        const { error, code, data } = await approachApi.exportPdf({
+            projectId: projectId.value,
+            contractId: contractId.value,
+            ids: ids,
+        })
+        //处理数据
+        printerLoading.value = false
+        if (!error && code === 200) {
+            console.log(data)
+            //window?.$message?.success('操作成功')
+            //searchClick()
+        }
+    }
+}
 
 //导入
 const importModal = ref(false)
@@ -618,8 +640,16 @@ const viewAttachmentModalClose = () => {
 
 //取样记录
 const samplingRecordModal = ref(false)
-const samplingRecordModalClick = (row) => {
+const samplingRecordModalClick = async (row) => {
     samplingRecordModal.value = true
+    samplingTableLoading.value = true
+    const { data } = await approachApi.samplingRecord({
+        projectId: projectId.value,
+        contractId: contractId.value,
+        id: row.id,
+    })
+    samplingTableLoading.value = false
+    samplingTableData.value = getArrValue(data)
 }
 
 //取样记录数据