退料查询

This commit is contained in:
bb_pan 2025-03-31 19:13:08 +08:00
parent 0bb1823d79
commit 4833acff1c
4 changed files with 159 additions and 149 deletions

View File

@ -5,6 +5,6 @@ VUE_APP_TITLE = 智能机具管理系统
ENV = 'production' ENV = 'production'
# 智能机具管理系统/生产环境 # 智能机具管理系统/生产环境
# VUE_APP_BASE_API = '/prod-api' VUE_APP_BASE_API = '/prod-api'
# 智能机具管理系统/宏源环境 # 智能机具管理系统/宏源环境 iws/jxhzb-api
VUE_APP_BASE_API = '/jiju-api' # VUE_APP_BASE_API = '/iws/jiju-api'

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 获取列表 // 获取列表
export const getTableListApi = data => { export const getTableListApi = data => {
return request({ return request({
url: '/***', url: '/material/back_apply_info/selectBackApplyList',
method: 'get', method: 'get',
params: data params: data
}) })
@ -11,7 +11,7 @@ export const getTableListApi = data => {
// 获取退料数量详情 // 获取退料数量详情
export const getReturnNumDetailsApi = data => { export const getReturnNumDetailsApi = data => {
return request({ return request({
url: '/***', url: '/material/back_apply_info/selectSecondList',
method: 'get', method: 'get',
params: data params: data
}) })

View File

@ -3,7 +3,7 @@
<!-- 退料数量弹框页面 --> <!-- 退料数量弹框页面 -->
<el-dialog title="查看详情" :visible.sync="outerVisible" @before-close="onClose" width="70%"> <el-dialog title="查看详情" :visible.sync="outerVisible" @before-close="onClose" width="70%">
<!-- 查询表单 --> <!-- 查询表单 -->
<el-form size="small" :model="queryParams" ref="queryFormRef"> <!-- <el-form size="small" :model="queryParams" ref="queryFormRef">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="6"> <el-col :span="6">
<el-form-item prop="keyword"> <el-form-item prop="keyword">
@ -16,7 +16,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form> -->
<!-- 列表数据 --> <!-- 列表数据 -->
<el-table :data="tableList" border> <el-table :data="tableList" border>
@ -30,15 +30,18 @@
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<template v-if="col.isSlot"> <template v-if="col.isSlot">
<el-image <div v-for="(img, index) in row.fileInfoList" :key="index">
:key="img" <el-image
:src="img" v-if="img && img.url && !/\.(pdf|docx|doc)$/i.test(img.url)"
fit="cover" :src="img.url"
class="img-box" fit="cover"
v-for="img in row[col.prop]" class="img-box"
:preview-src-list="previewSrcList" :preview-src-list="[img.url]"
@click="onHandleViewImg(row[col.prop])" />
/> <span v-else style="cursor: pointer; color: #409eff" @click="onHandleViewImg(img.url)">
查看
</span>
</div>
</template> </template>
<template v-else> <template v-else>
{{ row[col.prop] }} {{ row[col.prop] }}
@ -58,6 +61,16 @@ export default {
visible: { visible: {
type: Boolean, type: Boolean,
default: false default: false
},
state: {
type: Object,
default() {
return {
id: '',
typeId: '',
maId: ''
}
}
} }
}, },
data() { data() {
@ -66,64 +79,15 @@ export default {
queryParams: { queryParams: {
keyword: '' keyword: ''
}, },
tableList: [ tableList: [],
{
title: '测试1',
num: 10,
imgSrc: [
'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg',
'https://fuss10.elemecdn.com/1/34/19aa98b1fcb2781c4fba33d850549jpeg.jpeg',
'https://fuss10.elemecdn.com/0/6f/e35ff375812e6b0020b6b4e8f9583jpeg.jpeg',
'https://fuss10.elemecdn.com/9/bb/e27858e973f5d7d3904835f46abbdjpeg.jpeg',
'https://fuss10.elemecdn.com/d/e6/c4d93a3805b3ce3f323f7974e6f78jpeg.jpeg'
]
},
{
title: '测试1',
num: 1,
imgSrc: [
'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg',
'https://fuss10.elemecdn.com/1/34/19aa98b1fcb2781c4fba33d850549jpeg.jpeg',
'https://fuss10.elemecdn.com/0/6f/e35ff375812e6b0020b6b4e8f9583jpeg.jpeg',
'https://fuss10.elemecdn.com/9/bb/e27858e973f5d7d3904835f46abbdjpeg.jpeg',
'https://fuss10.elemecdn.com/d/e6/c4d93a3805b3ce3f323f7974e6f78jpeg.jpeg'
]
},
{
title: '测试1',
num: 17,
imgSrc: [
'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg',
'https://fuss10.elemecdn.com/1/34/19aa98b1fcb2781c4fba33d850549jpeg.jpeg',
'https://fuss10.elemecdn.com/0/6f/e35ff375812e6b0020b6b4e8f9583jpeg.jpeg',
'https://fuss10.elemecdn.com/9/bb/e27858e973f5d7d3904835f46abbdjpeg.jpeg',
'https://fuss10.elemecdn.com/d/e6/c4d93a3805b3ce3f323f7974e6f78jpeg.jpeg'
]
},
{
title: '测试1',
num: 5,
imgSrc: [
'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg',
'https://fuss10.elemecdn.com/1/34/19aa98b1fcb2781c4fba33d850549jpeg.jpeg',
'https://fuss10.elemecdn.com/0/6f/e35ff375812e6b0020b6b4e8f9583jpeg.jpeg',
'https://fuss10.elemecdn.com/9/bb/e27858e973f5d7d3904835f46abbdjpeg.jpeg',
'https://fuss10.elemecdn.com/d/e6/c4d93a3805b3ce3f323f7974e6f78jpeg.jpeg'
]
}
],
tableColumn: [ tableColumn: [
{ label: '机具名称', prop: 'title', show: true }, { label: '机具名称', prop: 'typeName', show: true },
{ label: '规格型号', prop: 'title', show: true }, { label: '规格型号', prop: 'typeModelName', show: true },
{ label: '退料总数', prop: 'title', show: true }, { label: '退料总数', prop: 'backNum', show: true },
{ label: '合格数量', prop: 'title', show: true }, { label: '合格数量', prop: 'passNum', show: true },
{ label: '不合格数量', prop: 'title', show: true }, { label: '不合格数量', prop: 'unPassNum', show: true },
{ label: '不合格原因', prop: 'title', show: true }, { label: '不合格原因', prop: 'unPassReason', show: true },
{ label: '不合格图片', prop: 'imgSrc', isSlot: true, show: false } { label: '不合格附件', prop: 'fileInfoList', isSlot: true, show: false }
] ]
} }
}, },
@ -140,7 +104,9 @@ export default {
methods: { methods: {
// //
async getReturnNumDetailsFun() { async getReturnNumDetailsFun() {
const res = await getReturnNumDetailsApi(this.queryParams) console.log('🚀 ~ getReturnNumDetailsFun ~ this.state:', this.state)
const res = await getReturnNumDetailsApi(this.state)
this.tableList = [res.data]
}, },
// //
onHandleSearch() { onHandleSearch() {
@ -151,8 +117,8 @@ export default {
this.$emit('update:visible', false) this.$emit('update:visible', false)
}, },
// //
onHandleViewImg(imgList) { onHandleViewImg(url) {
this.previewSrcList = imgList window.open(url)
} }
}, },
mounted() { mounted() {

View File

@ -12,40 +12,46 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="yyyy-MM-DD" value-format="yyyy-MM-dd"
style="width: 100%" style="width: 100%"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item prop="keyword"> <el-form-item prop="keyWord">
<el-input v-model="queryParams.keyword" placeholder="请输入关键字" clearable /> <el-input v-model="queryParams.keyWord" placeholder="请输入关键字" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item prop="unitId">
<el-select <treeselect
filterable :options="unitList"
clearable :show-count="true"
style="width: 100%" style="width: 95%"
v-model="queryParams.unit" :normalizer="normalizer"
placeholder="请选择往来单位" noChildrenText="没有数据了"
> noOptionsText="没有数据"
<el-option label="全部" value="1" /> placeholder="请选择公司"
</el-select> noResultsText="没有搜索结果"
v-model="queryParams.unitId"
:disable-branch-nodes="true"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item prop="proId">
<el-select <treeselect
filterable style="width: 95%"
clearable :show-count="true"
style="width: 100%" :options="projectList"
placeholder="请选择工程名称" :normalizer="normalizer"
v-model="queryParams.project" noOptionsText="没有数据"
> noChildrenText="没有数据了"
<el-option label="全部" value="1" /> placeholder="请选择领工程"
</el-select> noResultsText="没有搜索结果"
:disable-branch-nodes="true"
v-model="queryParams.proId"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -56,8 +62,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item prop="specs"> <el-form-item prop="typeModelName">
<el-input v-model="queryParams.specs" placeholder="请输入规格型号" clearable /> <el-input v-model="queryParams.typeModelName" placeholder="请输入规格型号" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -108,76 +114,92 @@
/> />
<!-- 二级页面弹框 --> <!-- 二级页面弹框 -->
<DialogModel :visible.sync="visible" v-if="visible" /> <DialogModel :visible.sync="visible" :state="state" v-if="visible" />
</div> </div>
</template> </template>
<script> <script>
import { getListProject, getListUnite } from '@/api/lease/apply'
import { getTableListApi } from '@/api/repair-testing/material-return' import { getTableListApi } from '@/api/repair-testing/material-return'
import DialogModel from './components/dialogModel.vue' import DialogModel from './components/dialogModel.vue'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default { export default {
components: { components: {
DialogModel DialogModel,
Treeselect
}, },
data() { data() {
return { return {
total: 0, // total: 0, //
time: [], // time: [], //
visible: false, // visible: false, //
tableList: [ tableList: [], //
{
title: '测试1',
num: 10
},
{
title: '测试1',
num: 1
},
{
title: '测试1',
num: 17
},
{
title: '测试1',
num: 5
}
], //
// //
queryParams: { queryParams: {
keyword: '', keyWord: '',
unit: '', unitId: null,
project: '', proId: null,
typeName: '', typeName: '',
specs: '', typeModelName: '',
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}, },
tableColumn: [ tableColumn: [
{ label: '标题', prop: 'title' }, // { label: '', prop: 'title' },
{ label: '协议号', prop: 'title' }, { label: '协议号', prop: 'agreementCode' },
{ label: '工程名称', prop: 'title' }, { label: '工程名称', prop: 'backProName' },
{ label: '往来单位', prop: 'title' }, { label: '往来单位', prop: 'backUnitName' },
{ label: '类型名称', prop: 'title' }, { label: '类型名称', prop: 'typeName' },
{ label: '规格型号', prop: 'title' }, { label: '规格型号', prop: 'typeModelName' },
{ label: '计量单位', prop: 'title' }, { label: '计量单位', prop: 'unitName' },
{ label: '退料单号', prop: 'title' }, { label: '退料单号', prop: 'backCode' },
{ label: '维修单号', prop: 'title' }, { label: '维修单号', prop: 'repairCode' },
{ label: '设备编码', prop: 'title' }, { label: '设备编码', prop: 'maCode' },
{ label: '退料数量', prop: 'num', isSlot: true }, { label: '退料数量', prop: 'backNum', isSlot: true },
{ label: '退料人员', prop: 'title' }, { label: '退料人员', prop: 'backPerson' },
{ label: '退料时间', prop: 'title' } { label: '退料时间', prop: 'backTime' }
] ],
unitList: [],
projectList: [],
state: {
id: '',
typeId: '',
maId: ''
}
} }
}, },
created() {
this.getTableList()
this.getUnitProject()
},
methods: { methods: {
async getTableList() { //
const queryParams = { async getUnitProject() {
...this.queryParams, try {
startTime: this.time && this.time.length > 0 ? this.time[0] : '', const comRes = await getListUnite({ proId: null })
endTime: this.time && this.time.length > 0 ? this.time[1] : '' this.unitList = comRes.data
const proRes = await getListProject({ unitId: null })
this.projectList = proRes.data
} catch (error) {
console.log('🚀 ~ error:', error)
} }
},
async getTableList() {
try {
const queryParams = {
...this.queryParams,
startTime: this.time && this.time.length > 0 ? this.time[0] : '',
endTime: this.time && this.time.length > 0 ? this.time[1] : ''
}
const res = await getTableListApi(queryParams) const res = await getTableListApi(queryParams)
this.tableList = res.data.rows
this.total = res.data.total
} catch (error) {
console.log('🚀 ~ getTableList ~ error:', error)
}
}, },
// //
onHandleSearch() { onHandleSearch() {
@ -190,15 +212,37 @@ export default {
this.getTableList() this.getTableList()
}, },
// //
onHandleExport() {}, onHandleExport() {
try {
let fileName = `退料查询_${new Date().getTime()}.xLsx`
let url = '/material/back_apply_info/exportBackApplyList'
const params = { ...this.queryParams }
this.download(url, params, fileName)
} catch (error) {
console.log('导出数据失败', error)
}
},
// //
onHandleViewDetails(row) { onHandleViewDetails(row) {
console.log(row, '详情') console.log(row, '详情')
this.visible = true this.visible = true
this.state = {
id: row.id,
typeId: row.typeId,
maId: row.maId
}
},
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children
}
return {
parentId: node.parentId,
id: node.id,
label: node.name,
children: node.children
}
} }
},
created() {
this.getTableList()
} }
} }
</script> </script>