Commit 3b5f532b authored by “lixuyan”'s avatar “lixuyan”

胶漆申领页面

parent b53051ef
<template>
<section class="lacclaims-footer">
<div class="lacclaims-footer-title">
<span class="title"> 胶漆材料记实</span>
<div class="right">
<el-popover
v-model="popoverVisible"
placement="left"
width="200"
trigger="manual"
>
<div>
<el-input
ref="scanCode"
v-model="scanId"
placeholder="请使用扫码枪录入"
@change="getQRcodeBar"
/>
</div>
<span
slot="reference"
class="qiang"
title="扫码枪录入"
@click="codeScanBar"
/>
</el-popover>
<scan class="qrcode" title="扫码录入" @getQrCode="getQRcode"> <span class="scan" /></scan>
</div>
</div>
<!-- 表格 -->
<div>
<div>
<el-table
ref="table"
v-loading="loading"
height="20vh"
:data="tableData"
border
size="mini"
>
<el-table-column
type="index"
:width="80"
label="序号"
align="center"
/>
<el-table-column
prop="allocateNo"
align="center"
label="胶漆料调配号"
:min-width="200"
show-overflow-tooltip
/>
<el-table-column
prop="allocateDate"
align="center"
label="调配时间"
:min-width="180"
/>
<el-table-column
prop="loseEfficacyDate"
align="center"
label="失效时间"
:min-width="180"
/>
<el-table-column
prop="useDate"
align="center"
label="记实时间"
:min-width="180"
/>
<el-table-column
prop="dxProcessMaterial.unit.unitCode"
align="center"
label="备注"
:min-width="240"
show-overflow-tooltip
/>
<el-table-column align="center" label="操作" :width="80">
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
@click="handleClick(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<el-pagination
:current-page="tablePagination.currentPage"
:page-sizes="tablePagination.pageSizes"
:page-size="tablePagination.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="tablePagination.total"
@size-change="setPage"
@current-change="setPage($event, true)"
/>
</div>
</section>
</template>
<script>
import { post } from '@/utils/http'
import '@/api/jq-signature'
import scan from '@/components/scanCode/scanCode'
export default {
components: {
scan
},
data() {
return {
// 加载中
loading: false,
// 分页
tablePagination: {
currentPage: 1,
pageSize: 5,
total: 0,
pageSizes: [5, 10, 20, 50]
},
// 表格数据
tableData: [],
tableId: null,
popoverVisible: false,
scanId: null
}
},
created() {},
mounted() {},
methods: {
// 初始化数据
getTableData(id) {
// 设置数据
this.loading = true
this.tableData = []
if (id) this.tableId = id
const params = {
pageFrom: this.tablePagination.currentPage,
pageSize: this.tablePagination.pageSize,
indices: ['ScanCodeRecord'],
searchItems: {
items: [
{
fieldName: 'keyID',
operator: 'EQ',
value: this.tableId
}
],
operator: 'AND'
}
}
// 发送请求
post('/ScanCodeRecord/listByKeyId', params)
.then((res) => {
this.tableData = res.items.content || []
this.tablePagination.total = res.items.totalElements
})
.catch((err) => console.log(err))
.finally(() => {
this.loading = false
})
},
/**
* 页码触发
*/
setPage($event, state) {
if (state) {
this.tablePagination.currentPage = $event
} else {
this.tablePagination.currentPage = 1
this.tablePagination.pageSize = $event
}
this.getTableData()
},
/**
* **扫描胶漆合格证二维码记实**
*/
getQRcode(info) {
// 发送请求
post(
'/ScanCodeRecord/scanCode',
{
allocateNo: info, // 记录卡号
keyID: this.tableId
}
)
.then((res) => {
if (res.message.includes('成功')) {
this.$parent.$parent.$parent.$refs.header.getTableData()
this.$message({
showClose: true,
message: '添加成功!',
type: 'success'
})
} else {
this.$message({
showClose: true,
message: '添加失败',
type: 'error'
})
}
})
.catch((err) => console.log(err))
.finally(() => {})
},
/**
* 删除
*/
handleClick(row) {
this.$confirm('你是否确定删除选中的数据项?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
// customClass: 'lacclaims-footer-message'
}).then(() => {
const params = {
id: row.id, // 记实id
operator: 'REMOVE'
}
// 发送请求
post('/ScanCodeRecord/recursion', params)
.then((res) => {
if (res.message.includes('成功')) {
this.$parent.$parent.$parent.$refs.header.getTableData()
this.$message({
type: 'success',
message: '删除成功!'
})
} else {
this.$message({
type: 'error',
message: '删除失败!'
})
}
})
.catch((err) => console.log(err))
.finally(() => {
this.loading = false
})
})
},
codeScanBar() {
this.popoverVisible = true
this.$nextTick(() => {
this.$refs.scanCode.focus()
})
},
/**
* 扫码枪录入
*/
getQRcodeBar($event) {
this.popoverVisible = false
this.getQRcode($event)
this.scanId = null
}
}
}
</script>
<style lang="scss">
.lacclaims-footer {
.lacclaims-footer-title {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
align-items: center;
.title {
border-left: 6px solid #4099f7;
padding: 10px 0 10px 5px;
background-color: #e4e1e1;
// margin-bottom: 10px;
width: 300px;
}
main {
color: #1497f5;
cursor: pointer;
&:hover {
color: #85c5f3;
}
}
}
.el-table thead th {
color: #2e2e2e;
font-weight: 700;
font-size: 14px;
padding: 0;
background-color: #f3f6f7;
line-height: 46px !important;
}
.el-table .highlight {
border: 1px solid #1497f5;
padding: 0;
.cell {
padding: 0;
.el-select {
width: 100%;
}
input {
border: 0;
height: 35px;
background-color: transparent;
text-align: center;
padding-right: 0;
}
}
}
.el-table .cell i.el-icon-loading {
font-size: 16px;
color: #ff0c00;
font-weight: bold;
position: absolute;
right: 10px;
top: 10px;
}
.el-pagination {
text-align: right;
padding: 10px 0;
}
.el-loading-spinner {
width: 100%;
}
.el-message-box {
z-index: 9999999;
}
.right{
display: flex;
align-items: center;
.qiang {
background-repeat: no-repeat;
margin-top: 3px;
cursor: pointer;
background-size: 100% 100%;
display: inline-block;
width: 26px;
margin-right: 10px;
height: 26px;
background-image: url("../../../../icons/扫码枪.png");
}
.scan {
margin-top: 3px;
cursor: pointer;
background-repeat: no-repeat;
background-size: 100% 100%;
display: inline-block;
width: 26px;
height: 26px;
background-image: url("../../../../icons/saoma.png");
}
}
}
</style>
<template>
<dee-dialog
id="dee-dialog"
title="胶漆申领"
custom-class="mobile-dialog"
:dialog-visible.sync="visible"
width="90%"
:before-close="handleClose"
close-on-click-modal
>
<Header ref="header" />
<Footer ref="footer" />
</dee-dialog>
</template>
<script>
import Header from './header'
import Footer from './footer'
export default {
components: {
Header,
Footer
},
data() {
return {
visible: false
}
},
created() { },
methods: {
// 打开弹出框
open() {
this.visible = true
this.$nextTick(() => {
this.$refs.header.getTableData()
})
},
handleClose() {}
}
}
</script>
<style lang="scss">
</style>
......@@ -511,7 +511,7 @@
<!-- 物料确认 -->
<ConfirmMaterial ref="ConfirmMaterial" />
<!--胶漆申领 -->
<!-- <LacClaims ref="LacClaims" /> -->
<LacClaims ref="LacClaims" />
<!-- 技术要求 -->
<TechnicalRequirements ref="TechnicalRequirements" />
<!-- 装配流程 -->
......@@ -536,7 +536,7 @@ import '@/icons/app/iconfont'
import { post, get } from '@/utils/http'
// import Table from './components/table'
import ConfirmMaterial from './components/ConfirmMaterial/index'
// import LacClaims from './components/LacClaims/index'
import LacClaims from './components/LacClaims/index'
import TechnicalRequirements from './components/TechnicalRequirements/index'
import AssemblyProcess from './components/AssemblyProcess/index'
import InspectionRejected from './components/chatBox/index'
......@@ -554,7 +554,8 @@ export default {
AssemblyProcess,
RecordMaintenance,
ConfirmMaterial,
ProblemDeclare
ProblemDeclare,
LacClaims
},
data() {
return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment