退料查询
This commit is contained in:
parent
0bb1823d79
commit
4833acff1c
|
|
@ -5,6 +5,6 @@ VUE_APP_TITLE = 智能机具管理系统
|
|||
ENV = 'production'
|
||||
|
||||
# 智能机具管理系统/生产环境
|
||||
# VUE_APP_BASE_API = '/prod-api'
|
||||
# 智能机具管理系统/宏源环境
|
||||
VUE_APP_BASE_API = '/jiju-api'
|
||||
VUE_APP_BASE_API = '/prod-api'
|
||||
# 智能机具管理系统/宏源环境 iws/jxhzb-api
|
||||
# VUE_APP_BASE_API = '/iws/jiju-api'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||
// 获取列表
|
||||
export const getTableListApi = data => {
|
||||
return request({
|
||||
url: '/***',
|
||||
url: '/material/back_apply_info/selectBackApplyList',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
|
|
@ -11,7 +11,7 @@ export const getTableListApi = data => {
|
|||
// 获取退料数量详情
|
||||
export const getReturnNumDetailsApi = data => {
|
||||
return request({
|
||||
url: '/***',
|
||||
url: '/material/back_apply_info/selectSecondList',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<!-- 退料数量弹框页面 -->
|
||||
<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-col :span="6">
|
||||
<el-form-item prop="keyword">
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-form> -->
|
||||
|
||||
<!-- 列表数据 -->
|
||||
<el-table :data="tableList" border>
|
||||
|
|
@ -30,15 +30,18 @@
|
|||
>
|
||||
<template slot-scope="{ row }">
|
||||
<template v-if="col.isSlot">
|
||||
<div v-for="(img, index) in row.fileInfoList" :key="index">
|
||||
<el-image
|
||||
:key="img"
|
||||
:src="img"
|
||||
v-if="img && img.url && !/\.(pdf|docx|doc)$/i.test(img.url)"
|
||||
:src="img.url"
|
||||
fit="cover"
|
||||
class="img-box"
|
||||
v-for="img in row[col.prop]"
|
||||
:preview-src-list="previewSrcList"
|
||||
@click="onHandleViewImg(row[col.prop])"
|
||||
:preview-src-list="[img.url]"
|
||||
/>
|
||||
<span v-else style="cursor: pointer; color: #409eff" @click="onHandleViewImg(img.url)">
|
||||
查看
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ row[col.prop] }}
|
||||
|
|
@ -58,6 +61,16 @@ export default {
|
|||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
state: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
id: '',
|
||||
typeId: '',
|
||||
maId: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
|
@ -66,64 +79,15 @@ export default {
|
|||
queryParams: {
|
||||
keyword: ''
|
||||
},
|
||||
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'
|
||||
]
|
||||
}
|
||||
],
|
||||
tableList: [],
|
||||
tableColumn: [
|
||||
{ label: '机具名称', prop: 'title', show: true },
|
||||
{ label: '规格型号', prop: 'title', show: true },
|
||||
{ label: '退料总数', prop: 'title', show: true },
|
||||
{ label: '合格数量', prop: 'title', show: true },
|
||||
{ label: '不合格数量', prop: 'title', show: true },
|
||||
{ label: '不合格原因', prop: 'title', show: true },
|
||||
{ label: '不合格图片', prop: 'imgSrc', isSlot: true, show: false }
|
||||
{ label: '机具名称', prop: 'typeName', show: true },
|
||||
{ label: '规格型号', prop: 'typeModelName', show: true },
|
||||
{ label: '退料总数', prop: 'backNum', show: true },
|
||||
{ label: '合格数量', prop: 'passNum', show: true },
|
||||
{ label: '不合格数量', prop: 'unPassNum', show: true },
|
||||
{ label: '不合格原因', prop: 'unPassReason', show: true },
|
||||
{ label: '不合格附件', prop: 'fileInfoList', isSlot: true, show: false }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
|
@ -140,7 +104,9 @@ export default {
|
|||
methods: {
|
||||
// 获取详情
|
||||
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() {
|
||||
|
|
@ -151,8 +117,8 @@ export default {
|
|||
this.$emit('update:visible', false)
|
||||
},
|
||||
// 点击图片
|
||||
onHandleViewImg(imgList) {
|
||||
this.previewSrcList = imgList
|
||||
onHandleViewImg(url) {
|
||||
window.open(url)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
|
|||
|
|
@ -12,40 +12,46 @@
|
|||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="yyyy-MM-DD"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item prop="keyword">
|
||||
<el-input v-model="queryParams.keyword" placeholder="请输入关键字" clearable />
|
||||
<el-form-item prop="keyWord">
|
||||
<el-input v-model="queryParams.keyWord" placeholder="请输入关键字" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-select
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="queryParams.unit"
|
||||
placeholder="请选择往来单位"
|
||||
>
|
||||
<el-option label="全部" value="1" />
|
||||
</el-select>
|
||||
<el-form-item prop="unitId">
|
||||
<treeselect
|
||||
:options="unitList"
|
||||
:show-count="true"
|
||||
style="width: 95%"
|
||||
:normalizer="normalizer"
|
||||
noChildrenText="没有数据了"
|
||||
noOptionsText="没有数据"
|
||||
placeholder="请选择公司"
|
||||
noResultsText="没有搜索结果"
|
||||
v-model="queryParams.unitId"
|
||||
:disable-branch-nodes="true"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-select
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请选择工程名称"
|
||||
v-model="queryParams.project"
|
||||
>
|
||||
<el-option label="全部" value="1" />
|
||||
</el-select>
|
||||
<el-form-item prop="proId">
|
||||
<treeselect
|
||||
style="width: 95%"
|
||||
:show-count="true"
|
||||
:options="projectList"
|
||||
:normalizer="normalizer"
|
||||
noOptionsText="没有数据"
|
||||
noChildrenText="没有数据了"
|
||||
placeholder="请选择领工程"
|
||||
noResultsText="没有搜索结果"
|
||||
:disable-branch-nodes="true"
|
||||
v-model="queryParams.proId"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -56,8 +62,8 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item prop="specs">
|
||||
<el-input v-model="queryParams.specs" placeholder="请输入规格型号" clearable />
|
||||
<el-form-item prop="typeModelName">
|
||||
<el-input v-model="queryParams.typeModelName" placeholder="请输入规格型号" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
|
@ -108,69 +114,80 @@
|
|||
/>
|
||||
|
||||
<!-- 二级页面弹框 -->
|
||||
<DialogModel :visible.sync="visible" v-if="visible" />
|
||||
<DialogModel :visible.sync="visible" :state="state" v-if="visible" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getListProject, getListUnite } from '@/api/lease/apply'
|
||||
import { getTableListApi } from '@/api/repair-testing/material-return'
|
||||
import DialogModel from './components/dialogModel.vue'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
DialogModel
|
||||
DialogModel,
|
||||
Treeselect
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
total: 0, // 总条数
|
||||
time: [], // 日期数据源
|
||||
visible: false, // 二级页面弹框
|
||||
tableList: [
|
||||
{
|
||||
title: '测试1',
|
||||
num: 10
|
||||
},
|
||||
{
|
||||
title: '测试1',
|
||||
num: 1
|
||||
},
|
||||
{
|
||||
title: '测试1',
|
||||
num: 17
|
||||
},
|
||||
{
|
||||
title: '测试1',
|
||||
num: 5
|
||||
}
|
||||
], // 列表数据源
|
||||
tableList: [], // 列表数据源
|
||||
// 查询条件
|
||||
queryParams: {
|
||||
keyword: '',
|
||||
unit: '',
|
||||
project: '',
|
||||
keyWord: '',
|
||||
unitId: null,
|
||||
proId: null,
|
||||
typeName: '',
|
||||
specs: '',
|
||||
typeModelName: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
tableColumn: [
|
||||
{ label: '标题', prop: 'title' },
|
||||
{ label: '协议号', prop: 'title' },
|
||||
{ label: '工程名称', prop: 'title' },
|
||||
{ label: '往来单位', prop: 'title' },
|
||||
{ label: '类型名称', prop: 'title' },
|
||||
{ label: '规格型号', prop: 'title' },
|
||||
{ label: '计量单位', prop: 'title' },
|
||||
{ label: '退料单号', prop: 'title' },
|
||||
{ label: '维修单号', prop: 'title' },
|
||||
{ label: '设备编码', prop: 'title' },
|
||||
{ label: '退料数量', prop: 'num', isSlot: true },
|
||||
{ label: '退料人员', prop: 'title' },
|
||||
{ label: '退料时间', prop: 'title' }
|
||||
]
|
||||
// { label: '标题', prop: 'title' },
|
||||
{ label: '协议号', prop: 'agreementCode' },
|
||||
{ label: '工程名称', prop: 'backProName' },
|
||||
{ label: '往来单位', prop: 'backUnitName' },
|
||||
{ label: '类型名称', prop: 'typeName' },
|
||||
{ label: '规格型号', prop: 'typeModelName' },
|
||||
{ label: '计量单位', prop: 'unitName' },
|
||||
{ label: '退料单号', prop: 'backCode' },
|
||||
{ label: '维修单号', prop: 'repairCode' },
|
||||
{ label: '设备编码', prop: 'maCode' },
|
||||
{ label: '退料数量', prop: 'backNum', isSlot: true },
|
||||
{ label: '退料人员', prop: 'backPerson' },
|
||||
{ label: '退料时间', prop: 'backTime' }
|
||||
],
|
||||
unitList: [],
|
||||
projectList: [],
|
||||
state: {
|
||||
id: '',
|
||||
typeId: '',
|
||||
maId: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTableList()
|
||||
this.getUnitProject()
|
||||
},
|
||||
methods: {
|
||||
// 获取公司和工程
|
||||
async getUnitProject() {
|
||||
try {
|
||||
const comRes = await getListUnite({ proId: null })
|
||||
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] : '',
|
||||
|
|
@ -178,6 +195,11 @@ export default {
|
|||
}
|
||||
|
||||
const res = await getTableListApi(queryParams)
|
||||
this.tableList = res.data.rows
|
||||
this.total = res.data.total
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ getTableList ~ error:', error)
|
||||
}
|
||||
},
|
||||
// 查询
|
||||
onHandleSearch() {
|
||||
|
|
@ -190,15 +212,37 @@ export default {
|
|||
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) {
|
||||
console.log(row, '详情')
|
||||
this.visible = true
|
||||
this.state = {
|
||||
id: row.id,
|
||||
typeId: row.typeId,
|
||||
maId: row.maId
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTableList()
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children
|
||||
}
|
||||
return {
|
||||
parentId: node.parentId,
|
||||
id: node.id,
|
||||
label: node.name,
|
||||
children: node.children
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue