From 7bdc84b5844d2a481e2f17cdd2c8204fd4a403ee Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 29 九月 2025 16:48:31 +0800
Subject: [PATCH] 业务管理相关页面添加`批号`查询条件
---
src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue | 216 +++++++++++++++++++++++++++++------------------------
1 files changed, 117 insertions(+), 99 deletions(-)
diff --git a/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue b/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
index 2ab086f..bfbebb4 100644
--- a/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
+++ b/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
@@ -3,39 +3,32 @@
<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="uploadHeader"
+ :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 style="height: 70vh;overflow-y: auto;" v-if="filesDialogVisible">
- <ValueTable ref="fileList"
- :url="$api.insOrderPlan.getFileList"
- :delUrl="$api.insOrderPlan.delfile"
- class="value-table"
- :key="upIndex"
- :componentData="componentData"/>
+ <div v-if="filesDialogVisible">
+ <lims-table :tableData="tableDataFile" :column="columnFile" @pagination="paginationFile" height="500px"
+ key="tableDataFile" :page="pageFile" :tableLoading="tableLoadingFile"></lims-table>
</div>
</el-dialog>
</div>
</template>
<script>
-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";
export default {
name: "filesLookVisible",
// import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
- components: {ValueTable},
+ components: { limsTable },
props: {
filesDialogVisible: {
type: Boolean,
@@ -43,13 +36,69 @@
},
filesLookInfo: {
type: Object,
- default: () => {}
+ default: () => { }
},
},
data() {
// 杩欓噷瀛樻斁鏁版嵁
return {
- upIndex: 0,
+ tableDataFile: [],
+ tableLoadingFile: false,
+ columnFile: [
+ {
+ dataType: 'tag',
+ label: '绫诲瀷',
+ prop: 'type',
+ formatData: (params) => {
+ if (params == 1) {
+ return '鍥剧墖'
+ } else if (params == 2) {
+ return '鏂囦欢'
+ } else {
+ return ''
+ }
+ },
+ formatType: (params) => {
+ if (params == 1) {
+ return 'success'
+ } else if (params == 2) {
+ return 'warning'
+ } else {
+ return ''
+ }
+ }
+ },
+ { label: '闄勪欢鍚嶇О', prop: 'fileName' },
+ { label: '涓婁紶浜�', prop: 'name' },
+ { label: '涓婁紶鏃堕棿', prop: 'createTime' },
+ {
+ dataType: 'action',
+ fixed: 'right',
+ label: '鎿嶄綔',
+ width: '170px',
+ operation: [
+ {
+ name: '涓嬭浇',
+ type: 'text',
+ clickFun: (row) => {
+ this.handleDown(row);
+ }
+ },
+ {
+ name: '鍒犻櫎',
+ type: 'text',
+ clickFun: (row) => {
+ this.delete(row);
+ }
+ },
+ ]
+ }
+ ],
+ pageFile: {
+ total: 0,
+ size: 10,
+ current: 1
+ },
isShow: this.filesDialogVisible,
dataVisibleTitle: [
{
@@ -62,99 +111,59 @@
},
],
dataVisibleIndex: 0, // tab鏍忛�夋嫨鍊�
- componentData: {
- entity: {
- insOrderId:''
- },
- isIndex: true,
- showSelect: false,
- select: false,
- sort: false,
- init:false,
- do: [
- {
- id: 'parent',
- font: '涓嬭浇',
- type: 'text',
- method: 'handleDown'
- },{
- id: 'delete',
- font: '鍒犻櫎',
- type: 'text',
- method: 'doDiy',
- }
- ],
- isPage: false,
- linkEvent: {},
- tagField: {
- type:{
- select:[
- {
- value: 1,
- label: '鍥剧墖'
- },
- {
- value: 2,
- label: '鏂囦欢'
- }
- ]
- }
- },
- currentId: '',
- selectField: {},
- requiredAdd: [],
- requiredUp: []
+ entity: {
+ insOrderId: ''
},
-
}
},
mounted() {
- this.refreshTable()
+ this.getFileList()
},
// 鏂规硶闆嗗悎
methods: {
// 鍒囨崲鏁版嵁鏌ョ湅tab鏍�
- handleDataVisibleTab (m, i) {
+ handleDataVisibleTab(m, i) {
this.dataVisibleIndex = i
- this.refreshTable()
+ this.getFileList()
},
// 鏌ヨ鍥炶皟
- refreshTable(e) {
+ getFileList() {
if (this.dataVisibleIndex === 0) {
- this.componentData.entity.insOrderId = this.filesLookInfo.enterOrderId
+ this.entity.insOrderId = this.filesLookInfo.enterOrderId
} else {
- this.componentData.entity.insOrderId = this.filesLookInfo.quarterOrderId
+ this.entity.insOrderId = this.filesLookInfo.quarterOrderId
}
- this.$nextTick(() => {
- this.$refs['fileList'].selectList(e)
+ this.tableLoadingFile = true
+ const params = { ...this.entity }
+ getFileList(params).then(res => {
+ this.tableLoadingFile = false
+ if (res.code === 200) {
+ this.tableDataFile = res.data.records
+ this.pageFile.total = res.data.total
+ }
+ }).catch(err => {
+ this.tableLoadingFile = false
})
},
- handleDown(row){
- this.$axios.post(this.$api.insOrderPlan.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
- const link = document.createElement('a');
- link.href = url;
- link.download = row.fileName;
- link.click();
- }
- }
+ paginationFile(page) {
+ this.pageFile.size = page.limit
+ this.getFileList()
+ },
+ // 涓嬭浇
+ handleDown(row) {
+ downFile({ id: row.id, }).then(res => {
+ this.$download.saveAs(res.data.fileUrl, row.fileName);
}).catch(error => {
})
},
- handleSuccessUp(response, ) {
+ handleSuccessUp(response,) {
this.upLoading = false;
if (response.code == 200) {
this.$message.success('涓婁紶鎴愬姛');
- this.$refs.fileList.selectList()
+ this.getFileList()
+ } else {
+ this.$message.error(response.msg);
}
},
beforeUpload(file) {
@@ -179,15 +188,23 @@
this.$message.error('涓婁紶澶辫触')
this.$refs.upload.clearFiles()
},
+ // 鍒犻櫎
+ delete(row) {
+ this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning"
+ }).then(() => {
+ delFile({ id: row.id }).then(res => {
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.getFileList()
+ })
+ }).catch(() => { })
+ }
},
computed: {
- headers() {
- return {
- 'token': sessionStorage.getItem('token')
- }
- },
action() {
- return this.javaApi + this.$api.insOrderPlan.uploadFile
+ return this.javaApi + '/insOrderPlan/uploadFile'
}
},
}
@@ -197,7 +214,8 @@
.tab {
list-style-type: none;
display: flex;
- margin-bottom: 12px;
+ margin-top: 0 !important;
+ padding-left: 0 !important;
}
.tab li {
--
Gitblit v1.9.3