From 20cf1938a8aa04a3f911d6d3729e8aec08a7d658 Mon Sep 17 00:00:00 2001
From: 曹睿 <360930172@qq.com>
Date: 星期二, 25 二月 2025 09:08:51 +0800
Subject: [PATCH] feat: 完成检测单页面
---
src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue | 117 +++++++++++++++++++++++++++-------------------------------
1 files changed, 55 insertions(+), 62 deletions(-)
diff --git a/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue b/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
index c28c5b0..5b90f8e 100644
--- a/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
+++ b/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
@@ -3,23 +3,20 @@
<el-dialog title="闄勪欢鏌ョ湅" :visible.sync="isShow" width="80%" @closed="$emit('closeFilesLook')">
<div style="display: flex;justify-content: space-between;">
<ul class="tab">
- <li v-for="(m,i) in dataVisibleTitle" :key="i" :class="{active:i===dataVisibleIndex}" @click="handleDataVisibleTab(m,i)">{{m.label}}</li>
+ <li v-for="(m, i) in dataVisibleTitle" :key="i" :class="{ active: i === dataVisibleIndex }"
+ @click="handleDataVisibleTab(m, i)">{{ m.label }}</li>
</ul>
- <el-upload :action="action"
- :auto-upload="true"
- :data="{orderId: dataVisibleIndex === 0 ? filesLookInfo.enterOrderId : filesLookInfo.quarterOrderId}"
- :on-success="handleSuccessUp" :show-file-list="false"
- accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="headers"
- :before-upload="beforeUpload"
- style="width: 80px !important;"
- :on-error="onError" ref='upload'>
+ <el-upload :action="action" :auto-upload="true"
+ :data="{ orderId: dataVisibleIndex === 0 ? filesLookInfo.enterOrderId : filesLookInfo.quarterOrderId }"
+ :on-success="handleSuccessUp" :show-file-list="false"
+ accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="headers"
+ :before-upload="beforeUpload" style="width: 80px !important;" :on-error="onError" ref='upload'>
<el-button size="small" type="primary" style="height: 38px">闄勪欢涓婁紶</el-button>
</el-upload>
</div>
<div v-if="filesDialogVisible">
- <lims-table :tableData="tableData" :column="column"
- @pagination="pagination" height="500px" key="tableData"
- :page="page" :tableLoading="tableLoading"></lims-table>
+ <lims-table :tableData="tableDataFile" :column="columnFile" @pagination="paginationFile" height="500px"
+ key="tableDataFile" :page="pageFile" :tableLoading="tableLoadingFile"></lims-table>
</div>
</el-dialog>
</div>
@@ -29,12 +26,12 @@
import ValueTable from "@/components/Table/value-table.vue";
import file from "@/utils/file";
import limsTable from "@/components/Table/lims-table.vue";
-import {delfile, downFile, getFileList} from "@/api/business/rawMaterialOrder";
-
+import { delfile, downFile, getFileList } from "@/api/business/rawMaterialOrder";
+import { getToken } from "@/utils/auth";
export default {
name: "filesLookVisible",
// import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
- components: {limsTable, ValueTable},
+ components: { limsTable, ValueTable },
props: {
filesDialogVisible: {
type: Boolean,
@@ -42,26 +39,24 @@
},
filesLookInfo: {
type: Object,
- default: () => {}
+ default: () => { }
},
},
data() {
// 杩欓噷瀛樻斁鏁版嵁
return {
- tableData: [],
- tableLoading: false,
- column: [
+ tableDataFile: [],
+ tableLoadingFile: false,
+ columnFile: [
{
dataType: 'tag',
label: '绫诲瀷',
prop: 'type',
formatData: (params) => {
if (params == 1) {
- return '鍚堟牸'
- } else if (params == 0) {
- return '涓嶅悎鏍�'
- } else if (params == 3) {
- return '涓嶅垽瀹�'
+ return '鍥剧墖'
+ } else if (params == 2) {
+ return '鏂囦欢'
} else {
return ''
}
@@ -69,18 +64,16 @@
formatType: (params) => {
if (params == 1) {
return 'success'
- } else if (params == 0) {
- return 'danger'
- } else if (params == 3) {
- return ''
- } else {
+ } else if (params == 2) {
+ return 'warning'
+ } else {
return ''
}
}
},
- {label: '闄勪欢鍚嶇О', prop: 'fileName'},
- {label: '涓婁紶浜�', prop: 'name'},
- {label: '涓婁紶鏃堕棿', prop: 'createTime'},
+ { label: '闄勪欢鍚嶇О', prop: 'fileName' },
+ { label: '涓婁紶浜�', prop: 'name' },
+ { label: '涓婁紶鏃堕棿', prop: 'createTime' },
{
dataType: 'action',
fixed: 'right',
@@ -104,10 +97,10 @@
]
}
],
- page: {
- total:0,
- size:10,
- current:1
+ pageFile: {
+ total: 0,
+ size: 10,
+ current: 1
},
isShow: this.filesDialogVisible,
dataVisibleTitle: [
@@ -122,53 +115,53 @@
],
dataVisibleIndex: 0, // tab鏍忛�夋嫨鍊�
entity: {
- insOrderId:''
+ insOrderId: ''
},
}
},
mounted() {
- this.refreshTable()
+ this.getFileList()
},
// 鏂规硶闆嗗悎
methods: {
// 鍒囨崲鏁版嵁鏌ョ湅tab鏍�
- handleDataVisibleTab (m, i) {
+ handleDataVisibleTab(m, i) {
this.dataVisibleIndex = i
- this.refreshTable()
+ this.getFileList()
},
// 鏌ヨ鍥炶皟
- refreshTable() {
+ getFileList() {
if (this.dataVisibleIndex === 0) {
this.entity.insOrderId = this.filesLookInfo.enterOrderId
} else {
this.entity.insOrderId = this.filesLookInfo.quarterOrderId
}
- this.tableLoading = true
- const params = {...this.entity}
+ this.tableLoadingFile = true
+ const params = { ...this.entity }
getFileList(params).then(res => {
- this.tableLoading = false
+ this.tableLoadingFile = false
if (res.code === 200) {
- this.tableData = res.data.records
- this.page.total = res.data.total
+ this.tableDataFile = res.data.records
+ this.pageFile.total = res.data.total
}
}).catch(err => {
- this.tableLoading = false
+ this.tableLoadingFile = false
})
},
- pagination (page) {
- this.page.size = page.limit
- this.refreshTable()
+ paginationFile(page) {
+ this.pageFile.size = page.limit
+ this.getFileList()
},
// 涓嬭浇
- handleDown(row){
- downFile({id: row.id,}).then(res => {
+ handleDown(row) {
+ downFile({ id: row.id, }).then(res => {
if (res.code === 200) {
let url = '';
- if(res.data.type==1){
- url = this.javaApi+'/img/'+res.data.fileUrl
- file.downloadIamge(url,row.fileName)
- }else{
- url = this.javaApi+'/word/'+res.data.fileUrl
+ if (res.data.type == 1) {
+ url = this.javaApi + '/img/' + res.data.fileUrl
+ file.downloadIamge(url, row.fileName)
+ } else {
+ url = this.javaApi + '/word/' + res.data.fileUrl
const link = document.createElement('a');
link.href = url;
link.download = row.fileName;
@@ -179,7 +172,7 @@
})
},
- handleSuccessUp(response, ) {
+ handleSuccessUp(response,) {
this.upLoading = false;
if (response.code == 200) {
this.$message.success('涓婁紶鎴愬姛');
@@ -209,13 +202,13 @@
this.$refs.upload.clearFiles()
},
// 鍒犻櫎
- delete (row) {
+ delete(row) {
this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", {
confirmButtonText: "纭畾",
cancelButtonText: "鍙栨秷",
type: "warning"
}).then(() => {
- delfile({id: row.id}).then(res => {
+ delfile({ id: row.id }).then(res => {
if (res.code === 500) {
return
}
@@ -224,13 +217,13 @@
}).catch(e => {
this.$message.error('鍒犻櫎澶辫触')
})
- }).catch(() => {})
+ }).catch(() => { })
}
},
computed: {
headers() {
return {
- 'token': sessionStorage.getItem('token')
+ 'Authorization': "Bearer " + getToken()
}
},
action() {
--
Gitblit v1.9.3