Commit b5a4c071 authored by jingnan's avatar jingnan 👀

Merge branch 'dev' of http://94.191.100.41/tfmom/tf-mom-web into dev

parents b2515e00 52e7a8c6
<template>
<section class="assembly-perform-confirm-material-footer">
<p class="confirm-material-footer-header-title">
<span class="title">物料领用发放:</span>
<span v-show="false">提示:当类型非(密封剂/涂料/胶粘剂)才可扫码录入!</span>
</p>
<!-- <scan v-show="false" :id="onlyUuid" @getQrCode="getQRcode">扫码录入</scan> -->
<!-- 表格 -->
<div>
<el-table
v-loading="loading"
:data="tableData"
height="25vh"
border
size="mini"
:cell-class-name="cellClassName"
>
<el-table-column type="index" :width="80" label="序号" align="center" />
<el-table-column :width="120" label="扫码录入" align="center">
<template slot-scope="scope">
<el-popover
v-model="scope.row.popoverVisible"
placement="right"
width="200"
trigger="manual"
>
<div>
<el-input
:ref="scope.row.uuid"
v-model="scanId"
clearable
placeholder="请使用扫码枪录入"
@change="getQRcodeBar($event, scope.row)"
/>
</div>
<span
slot="reference"
class="qiang"
title="扫码枪录入"
@click="codeScanBar(scope.row)"
/>
</el-popover>
<span class="scan" title="扫码录入" @click="clickScan(scope.row)" />
</template>
</el-table-column>
<el-table-column
prop="extMaterial.isRecord"
label="是否记实"
align="center"
:min-width="80"
show-overflow-tooltip
:formatter="(row, column, cellValue, index)=>{
if(cellValue){
return '是'
}else{
return '否'
}
}"
/>
<el-table-column
v-for="item in colums"
:key="item.key"
:prop="item.key"
align="center"
:min-width="item.minWidth"
:label="item.title"
sortable
show-overflow-tooltip
/>
<el-table-column :width="80" label="操作" align="center">
<template slot-scope="scope">
<el-button
:disabled="!scope.row.extScanCodeRecords[0].id"
size="mini"
type="danger"
@click="deleteRow(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)"
/> -->
</section>
</template>
<script>
import $ from 'jquery'
import { v4 as uuidv4 } from 'uuid'
import { post } from '@/utils/http'
// 电子签名
import '@/api/jq-signature'
// import scan from '@/components/scanCode/scanCode'
export default {
// components: {
// scan
// },
data() {
return {
// 加载中
loading: false,
onlyUuid: null,
rowId: null,
// 分页
tablePagination: {
currentPage: 1,
pageSize: 5,
total: 0,
pageSizes: [5, 10, 20, 50]
},
// 所有可动态配置的表格列
colums: [
{
title: '物料编码',
show: true,
key: 'extMaterial.resCode',
align: 'center',
sortable: true,
minWidth: 120
},
{
title: '牌号/规格',
show: true,
key: 'extMaterial.modelNo',
align: 'center',
sortable: true,
minWidth: 130
},
{
title: '材料名称',
show: true,
key: 'extMaterial.resName',
align: 'center',
sortable: true,
minWidth: 120
},
{
title: '类型',
show: true,
key: 'extMaterial.resTypeName',
align: 'center',
sortable: true,
minWidth: 120
},
{
title: '单位',
show: true,
key: 'extUnit.unitName',
align: 'center',
sortable: true,
minWidth: 80
},
{
title: '数量',
show: true,
key: 'reqAmount',
align: 'center',
sortable: true,
minWidth: 80
},
{
title: '采购标准',
show: true,
key: 'extScanCodeRecords[0].purchaseSTD',
align: 'center',
sortable: true,
minWidth: 120
},
{
title: '实发型号/件号',
show: true,
minWidth: '160',
key: 'extScanCodeRecords[0].modelNo',
align: 'center',
sortable: true
},
{
title: '追溯信息',
show: true,
key: 'extScanCodeRecords[0].retrospect',
align: 'center',
sortable: true,
minWidth: 120
},
// {
// title: '实发数量',
// show: true,
// key: 'scanCodeRecordVo.amount',
// align: 'center',
// sortable: true
// },
// {
// title: '类型',
// show: true,
// key: 'type',
// align: 'center',
// sortable: true
// },
{
title: '单据编号',
show: true,
key: 'extScanCodeRecords[0].docNo',
align: 'center',
sortable: true,
minWidth: 120
},
{
title: '状态',
show: true,
key: 'extScanCodeRecords[0].status',
align: 'center',
sortable: true,
minWidth: 100
}
],
// 默认展示的表格列
tableColums: [],
// 表格数据
tableData: [],
// 表格样式配置
tableOptions: {
stripe: true,
border: true
},
scanId: null
}
},
created() {
this.setDefaultColums()
},
mounted() {
this.onlyUuid = uuidv4()
// this.init()
},
methods: {
// 设置默认展示列
setDefaultColums() {
// this.tableColums = this.colums.filter(item => item.show)
},
// 初始化数据
init() {
// 设置数据
this.loading = true
this.tableData = []
const params = {
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'extSupporting.extProcessPlanId',
'operator': 'EQ',
'value': this.$parent.$parent.$parent.$parent.headerData.aoId
},
{
'fieldName': 'extScanCodeRecords.id',
'operator': 'NOTNULL'
}
],
'operator': 'AND'
}
],
'items': [],
'operator': 'AND'
},
'openProps': [
{
'name': 'extScanCodeRecords'
},
{
'name': 'extMaterial'
},
{
'name': 'extUnit'
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
],
'toValidateKeys': ''
}
// 发送请求
post(
'/ExtSupportingItem/search',
params
)
.then((res) => {
this.tableData = res.items.content.map((p) => {
return {
popoverVisible: false,
uuid: uuidv4(),
...p
}
})
this.tablePagination.total = res.items.totalElements
})
.catch((err) => console.error(err))
.finally(() => {
this.loading = false
})
},
clickScan(row) {
this.rowId = row.id
// if (['密封剂', '涂料', '胶粘剂'].includes(row.resTypeName)) {
// this.$message({
// showClose: true,
// message: '当前状态-' + row.resTypeName + ' 不可扫码录入!',
// type: 'warning'
// })
// return
// }
$('#' + this.onlyUuid).click()
},
codeScanBar(row) {
// if (['密封剂', '涂料', '胶粘剂'].includes(row.resTypeName)) {
// this.$message({
// showClose: true,
// message: '当前状态-' + row.resTypeName + ' 不可扫码录入!',
// type: 'warning'
// })
// return
// }
row.popoverVisible = true
this.rowId = row.id
this.$nextTick(() => {
this.$refs[row.uuid].focus()
})
},
getQRcodeBar($event, row) {
row.popoverVisible = false
this.getQRcode($event)
this.scanId = null
},
/**
* **扫描胶漆合格证二维码记实**
*/
getQRcode(info) {
// 发送请求
this.HttpRequest(
`ScanCodeRecord/saveMaterialConfirmation?stoId=${this.rowId}&scanId=${info}`,
{
id: info // AssignCardDetailId
},
'post'
)
.then((res) => {
if (res.message.includes('成功')) {
this.init()
this.$message({
showClose: true,
message: '添加成功!',
type: 'success'
})
} else {
this.$message({
showClose: true,
message: '添加失败',
type: 'error'
})
}
})
.catch((err) => console.log(err))
.finally(() => {})
},
setPage($event, state) {
if (state) {
this.tablePagination.currentPage = $event
} else {
this.tablePagination.currentPage = 1
this.tablePagination.pageSize = $event
}
this.init()
},
cellClassName({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 1) {
return 'scan-code'
}
},
/**
* 删除数据
*/
deleteRow(row) {
this.$confirm('你是否确定删除选中的数据项?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
// customClass: 'lacclaims-footer-message'
}).then(() => {
const params = {
id: row.scanCodeRecordVo.id, // 记实id
operator: 'REMOVE'
}
// 发送请求
this.HttpRequest('/ScanCodeRecord/recursion', params, 'post')
.then((res) => {
if (res.message.includes('成功')) {
this.init()
this.$message({
type: 'success',
message: '删除成功!'
})
} else {
this.$message({
type: 'error',
message: '删除失败!'
})
}
})
.catch((err) => console.error(err))
.finally(() => {
this.loading = false
this.$parent.$parent.$parent.$refs.header.init()
})
})
}
}
}
</script>
<style lang="scss">
.assembly-perform-confirm-material-footer {
.confirm-material-footer-header-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: 120px;
}
> span:last-child {
color: red;
font-size: 12px;
}
}
.el-table {
.scan-code {
padding: 0;
}
.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>
<section class="confirm-material-header">
<p class="confirm-material-header-title-table">
<span>物料配套发放:</span>
<span>提示:当零件类型为外购成品时,实称重量/去除重量才可双击编辑!</span>
</p>
<!-- <scan v-show="false" :id="onlyUuid" @getQrCode="getScanBar">扫码录入</scan> -->
<div>
<el-table
v-loading="loading"
:data="tableData"
height="25vh"
border
size="mini"
:cell-class-name="deeTableCellStyle"
@cell-dblclick="deeTableEdit"
>
<el-table-column type="index" :width="80" label="序号" align="center" />
<el-table-column :width="120" label="扫码录入" align="center">
<template slot-scope="scope">
<el-popover
v-model="scope.row.popoverVisible"
placement="right"
width="260"
trigger="manual"
popper-class="scan-popper"
>
<div class="content">
<el-form
:ref="'ruleForm' + scope.row.uuid"
:model="typing"
:rules="rules"
label-width="100px"
>
<el-form-item
v-show="scanIdShow"
label="扫码编码:"
prop="scanId"
>
<el-input
:ref="scope.row.uuid"
v-model="typing.scanId"
placeholder="请使用扫码枪录入"
@change="getScanName"
/>
</el-form-item>
<el-form-item v-show="!scanIdShow" label="型号/件号:">
<el-input
v-model="typing.scanName"
placeholder="型号/件号 加载中..."
/>
</el-form-item>
<el-form-item label="数量:" prop="count">
<el-input v-model="typing.count" placeholder="请填写数量" />
</el-form-item>
</el-form>
<!-- <div>
<span>ID:</span>
<el-input
:ref="scope.row.uuid"
v-model="typing.scanId"
placeholder="请使用扫码枪录入"
/>
</div>
<div>
<span>数量:</span>
<el-input v-model="typing.count" placeholder="请填写数量" />
</div> -->
<div class="footer">
<el-button
size="mini"
type="text"
@click="resetForm('ruleForm' + scope.row.uuid, scope.row)"
>取消</el-button>
<el-button
type="primary"
size="mini"
@click="submitForm('ruleForm' + scope.row.uuid, scope.row)"
>确定</el-button>
</div>
</div>
<div slot="reference">
<span
class="qiang"
title="扫码枪录入"
@click="codeScanBar(scope.row)"
/>
<span
class="scan"
title="扫码录入"
@click="clickScan(scope.row)"
/>
</div>
</el-popover>
</template>
</el-table-column>
<el-table-column
prop="extMaterial.isRecord"
label="是否记实"
align="center"
:min-width="100"
show-overflow-tooltip
:formatter="
(row, column, cellValue, index) => {
if (cellValue) {
return '是';
} else {
return '否';
}
}
"
/>
<el-table-column
prop="extMaterial.resCode"
align="center"
label="物料编码"
:width="120"
sortable
show-overflow-tooltip
/>
<el-table-column
prop="extMaterial.modelNo"
align="center"
label="型号/件号"
:width="120"
sortable
show-overflow-tooltip
/>
<el-table-column
prop="extMaterial.resName"
align="center"
label="名称"
:width="120"
sortable
show-overflow-tooltip
/>
<el-table-column
prop="extMaterial.resTypeName"
align="center"
label="零件类型"
:width="120"
sortable
/>
<el-table-column
prop="reqAmount"
align="center"
label="数量"
:width="80"
sortable
/>
<el-table-column
prop="unitName"
align="center"
label="单位"
:width="80"
/>
<el-table-column
prop="extMaterial.modelNo"
align="center"
label="型号/件号"
:width="120"
sortable
show-overflow-tooltip
/>
<el-table-column
prop="arrivedDrawNo"
align="center"
label="实发版次"
:width="120"
sortable
/>
<el-table-column
prop="extMaterial.testNo"
align="center"
label="验收单号"
:width="120"
sortable
show-overflow-tooltip
/>
<el-table-column
prop="checkoutAmount"
align="center"
label="已接收数量"
:width="130"
sortable
/>
<el-table-column
prop="outsideAmount"
align="center"
label="实发数量"
:width="120"
sortable
/>
<el-table-column
prop="type"
align="center"
label="类型"
:width="80"
sortable
/>
<el-table-column
prop="receiptNo"
align="center"
label="单据编号"
:width="120"
sortable
/>
<el-table-column
prop="jobResponseOutStorageVOS[0].actualWeight"
align="center"
label="实称重量"
:width="135"
>
<template slot="header">
<span>实称重量(KG) </span>
<i class="el-icon-edit-outline" />
</template>
<template slot-scope="scope">
<el-input-number
v-if="scope.row.actualWeightSelect"
v-model="scope.row.actualWeight"
:min="0"
controls-position="right"
:precision="4"
@focus="tableInputFocus"
@blur="deeTableBlur(scope.row, true)"
/>
<span
v-else-if="
scope.row[scope.column.property] ||
scope.row.resTypeName !== '外购成品'
"
>{{ scope.row[scope.column.property] }}</span>
<!-- <span v-else class="tips">必填项</span> -->
<i v-if="scope.row.actualWeightLoading" class="el-icon-loading" />
</template>
</el-table-column>
<el-table-column
prop="jobResponseOutStorageVOS[0].removeWeight"
align="center"
label="去除重量"
:width="135"
>
<template slot="header">
<span>去除重量(KG) </span>
<i class="el-icon-edit-outline" />
</template>
<template slot-scope="scope">
<el-input-number
v-if="scope.row.removeWeightSelect"
v-model="scope.row.removeWeight"
:min="0"
controls-position="right"
:precision="4"
@focus="tableInputFocus"
@blur="deeTableBlur(scope.row, false)"
/>
<span v-else>{{ scope.row[scope.column.property] }}</span>
<i v-if="scope.row.removeWeightLoading" class="el-icon-loading" />
</template>
</el-table-column>
<el-table-column
prop="stateName"
align="center"
label="状态"
:width="80"
sortable
/>
</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)"
/> -->
</section>
</template>
<script>
import $ from 'jquery'
import { post } from '@/utils/http'
// import scan from '@/components/scanCode/scanCode'
import { v4 as uuidv4 } from 'uuid'
export default {
// components: {
// scan
// },
data() {
return {
onlyUuid: null,
// 加载中
loading: false,
// 分页
tablePagination: {
currentPage: 1,
pageSize: 5,
total: 0,
pageSizes: [5, 10, 20, 50]
},
timer: null,
// 表格数据
tableData: [],
setRowValue: null,
scanIdShow: true,
typing: {
scanId: null,
scanName: null,
count: null
},
rules: {
scanId: [{ required: true, message: '请扫码录入' }],
count: [{ required: true, message: '请输入数量' }]
}
}
},
created() {},
mounted() {
this.onlyUuid = uuidv4()
},
methods: {
// 初始化数据
init() {
// 设置数据
this.loading = true
this.tableData = []
// const params = {
// aoId: this.$parent.$parent.$parent.$parent.headerData.aoId,
// pageCurrent: this.tablePagination.currentPage,
// pageSize: 9999
// }
// 发送请求
post(
`ExtSupportingItem/getAllMaterialConfirmation?aoId=${this.$parent.$parent.$parent.$parent.headerData.aoId}`,
{}
)
.then((res) => {
this.tableData = res.items.map((p) => {
return {
popoverVisible: false,
uuid: uuidv4(),
...p,
actualWeightSelect: false,
removeWeightSelect: false,
actualWeightLoading: false,
removeWeightLoading: false
}
})
this.tablePagination.total = res.items.length
})
.catch((err) => console.error(err))
.finally(() => {
this.loading = false
})
},
deeTableCellStyle({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 1) {
return 'scan-code'
}
if (
(column.property === 'actualWeight' && row.actualWeightSelect) ||
(column.property === 'removeWeight' && row.removeWeightSelect)
) {
return 'highlight'
}
// if (column.property === 'receiptNo' && !row.actualWeight) {
// return 'tdbans'
// }
// if (
// row.resTypeName === '外购成品' &&
// ((column.property === 'actualWeight' && !row.actualWeight))
// ) {
// return 'tdtips'
// }
},
tableInputFocus() {
clearTimeout(this.timer)
this.timer = null
},
deeTableEdit(row, column, cell, event) {
var that = this
if (row.resTypeName !== '外购成品') return
if (column.property === 'actualWeight') {
this.setRowValue = row.actualWeight
row.actualWeightSelect = true
} else if (column.property === 'removeWeight') {
this.setRowValue = row.removeWeight
row.removeWeightSelect = true
} else {
return
}
this.timer = setTimeout(function() {
if (column.property === 'actualWeight') {
row.actualWeightSelect = false
} else if (column.property === 'removeWeight') {
row.removeWeightSelect = false
}
clearTimeout(this.timer)
that.timer = null
}, 2000)
},
setPage($event, state) {
if (state) {
this.tablePagination.currentPage = $event
} else {
this.tablePagination.currentPage = 1
this.tablePagination.pageSize = $event
}
this.init()
},
deeTableBlur(row, status) {
var that = this
const param = {
operator: 'MODIFY',
id: row.tjrosId,
actualWeight: row.actualWeight,
removeWeight: row.removeWeight,
subTypeName: 'JobResponseOutStorageMatch'
}
if (status) {
row.actualWeightSelect = false
// 利用按值传递特性比较数值是否修改
if (Number(this.setRowValue) === Number(row.actualWeight)) return
row.actualWeightLoading = true
} else {
row.removeWeightSelect = false
// 利用按值传递特性比较数值是否修改
if (Number(this.setRowValue) === Number(row.removeWeight)) return
row.removeWeightLoading = true
}
this.HttpRequest('/JobResponseOutStorage/recursion', param, 'post')
.then((res) => {
if (res.message.includes('成功')) {
that.$message({
showClose: true,
message: '保存成功',
type: 'success'
})
} else {
that.$message({
showClose: true,
message: '保存失败',
type: 'error'
})
}
})
.catch((err) => console.error(err))
.finally(() => {
if (status) {
row.actualWeightLoading = false
} else {
row.removeWeightLoading = false
}
})
},
cellClassName({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 1) {
return 'scan-code'
}
},
resetForm(formName, row) {
row.popoverVisible = false
this.scanIdShow = true
this.$refs[formName].resetFields()
},
clickScan(row) {
if (row.stateName === '已出库') {
this.$message({
showClose: true,
message: '已出库 不可扫码录入!',
type: 'warning'
})
return
}
this.rowId = row.id
$('#' + this.onlyUuid).click()
row.popoverVisible = true
},
codeScanBar(row) {
if (row.stateName === '已出库') {
this.$message({
showClose: true,
message: '已出库 不可扫码录入',
type: 'warning'
})
return
}
row.popoverVisible = true
this.rowId = row.id
this.$nextTick(() => {
this.$refs[row.uuid].focus()
})
},
getScanBar(info) {
this.typing.scanId = info
this.getScanName(info)
},
submitForm(formName, row) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.scanIdShow = true
this.getQRcode(row)
this.$refs[formName].resetFields()
} else {
return false
}
})
},
/**
* **扫描胶漆合格证二维码记实**
*/
getQRcode(row) {
// 发送请求
var id = this.rowId
var scanid = this.typing.scanId
var count = this.typing.count
row.popoverVisible = false
row.stateName = '已出库'
this.HttpRequest(
`/ScanCodeRecord/saveMaterialConfirmationHead?stoId=${id}&scanId=${scanid}&amount=${count}`,
{},
'post'
)
.then((res) => {
if (res.message.includes('成功')) {
this.$message({
showClose: true,
message: '添加成功!',
type: 'success'
})
} else {
this.$message({
showClose: true,
message: '添加失败',
type: 'error'
})
}
})
.catch((err) => console.log(err))
.finally(() => {
this.typing = {
scanId: null,
count: null
}
this.$parent.$parent.$parent.$refs.footer.init()
})
},
async getScanName(value) {
this.scanIdShow = false
this.HttpRequest(
`/JobResponseOutStorage/getModelNo?id=${value}`,
{},
'post'
)
.then((res) => {
if (res.message.includes('成功')) {
this.typing.scanName = res.items
} else {
this.$message({
showClose: true,
message: '查询失败',
type: 'error'
})
}
})
.catch((err) => console.log(err))
.finally(() => {})
}
}
}
</script>
<style lang="scss">
.scan-popper > .content {
> .footer {
text-align: right;
}
}
.confirm-material-header {
.confirm-material-header-title-table {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
> span:first-child {
border-left: 6px solid #4099f7;
padding: 10px 0 10px 5px;
background-color: #e4e1e1;
// margin-bottom: 10px;
width: 120px;
white-space: nowrap;
}
> span:last-child {
color: red;
font-size: 12px;
}
}
.el-table {
.el-input-number{
width:100%;
input{
text-align: left;
}
.el-input-number__decrease, .el-input-number__increase{
width: 25px;
}
}
.scan-code {
padding: 0;
}
.tips {
color: #b1b1b1;
}
.tdbans {
border-right: 1px solid red;
}
.tdtips {
border: 1px solid red;
}
.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
class="material-confirmation-dialog"
>
<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.init()
this.$refs.footer.init()
})
},
handleClose() {}
}
}
</script>
<style lang="scss" >
.material-confirmation-dialog {
.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;
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%;
}
}
</style>
<template>
<dee-dialog
title="试验记录维护"
custom-class="mobile-dialog"
:dialog-visible.sync="visible"
width="90%"
:before-close="handleClose"
close-on-click-modal
class="record-maintenance-dialog"
>
<div>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="tableData"
height="60vh"
border
size="mini"
>
<el-table-column type="index" :width="80" label="序号" align="center" />
<el-table-column :width="160" label="操作" align="center">
<template slot-scope="scope">
<el-popover
placement="right"
width="660"
trigger="hover"
popper-class="record-maintenance-popper"
@show="getList(scope.row.id)"
>
<upload-files v-model="objFileLinks" />
<span slot="reference" style="cursor: pointer;olor: #409eff;">
附件浏览
</span>
</el-popover>
<el-button
size="mini"
type="danger"
@click="deleteRow(scope.row.id)"
>删除</el-button>
</template>
</el-table-column>
<el-table-column
v-for="c in colums"
:key="c.key"
:min-width="c.width"
:prop="c.key"
:label="c.title"
align="center"
sortable
:formatter="c.formatter"
show-overflow-tooltip
/>
</el-table>
</div>
</dee-dialog>
</template>
<script>
import { post } from '@/utils/http'
// import UploadFiles from '@/components/Lean/UploadFiles'
export default {
// components: { UploadFiles },
data() {
return {
visible: false,
// 加载中
loading: false,
// 搜索条件
form: {
status: 'Apply',
serialNumber: ''
},
// 分页
tablePagination: {
currentPage: 1,
pageSize: 10,
total: 0,
pageSizes: [10, 20, 50, 100]
},
// 所有可动态配置的表格列
colums: [
{
title: 'AO号',
show: true,
key: 'extProcessPlan.serialNumber',
sortable: true,
width: 260
},
{
title: 'AO名称',
show: true,
key: 'extProcessPlan.name',
sortable: true,
width: 150
},
{
title: '工序号',
show: true,
key: 'extProcessOperation.serialNumber',
sortable: true,
width: 120
},
{
title: '工序名称',
show: true,
key: 'extProcessOperation.name',
sortable: true,
width: 120
},
{
title: '操作者',
show: true,
key: 'creator.userName',
sortable: true,
width: 120
},
{
title: '申请时间',
show: true,
key: 'appTime',
sortable: true,
width: 120,
formatter: (row, column, cellValue, index) =>
cellValue && cellValue.split(' ').length > 1
? cellValue.split(' ')[0]
: cellValue
},
{
title: '状态',
show: true,
key: 'status',
sortable: true,
width: 120,
formatter: (row, column, cellValue, index) => {
if (cellValue === 'Apply') {
return '未确认'
} else {
return '已确认'
}
}
},
{
title: '试验类型',
show: true,
key: 'experimentType',
sortable: true,
width: 120
},
{
title: '试验报告号',
show: true,
key: 'reportNumber',
sortable: true,
width: 160
},
{
title: '试验结论',
show: true,
key: 'conclusion',
sortable: true,
width: 120
}
],
objFileLinks: [],
// 表格数据
tableData: []
}
},
created() {},
methods: {
// 打开弹出框
open() {
this.visible = true
this.$nextTick(() => {
this.init()
})
},
handleClose() {},
// 初始化数据
init() {
// 设置数据
this.loading = true
this.tableData = []
const params = {
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'extProcessOperationId',
'operator': 'EQ',
'value': this.$parent.editor.tableId
}
],
'operator': 'AND'
}
],
'items': [],
'operator': 'AND'
},
'openProps': [
{
'name': 'extProcessPlan'
},
{
'name': 'extProcessOperation'
},
{
'name': 'objFileLinks',
'openProps': [
{
'name': 'target'
}
]
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
],
'toValidateKeys': ''
}
// 发送请求
post('/ExperimentRecord/search', params)
.then((res) => {
this.tableData = res.items.content
this.tablePagination.total = res.items.totalElements
})
.catch((err) => console.log(err))
.finally(() => {
this.loading = false
})
},
getList(sourceId) {
const params = {
indices: ['ObjFileLink'],
searchItems: {
items: [
{
fieldName: 'sourceId',
operator: 'EQ',
value: sourceId
}
],
operator: 'AND'
},
openProps: [
{
pageFrom: 1,
pageSize: 1,
name: 'target'
}
]
}
post('/FileUtil/checkFile', params)
.then((res) => {
this.objFileLinks = res.items.content[0].objFileLinks
})
.catch((err) => console.error(err))
.finally(() => {})
},
deleteRow(id) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
const params = {
operator: 'REMOVE',
dxClassname: 'com.tf.mes.vo.prod.ExperimentRecordVo',
id: id
}
this.HttpRequest('/ExperimentRecord/recursion', params, 'post')
.then((res) => {
if (res && !res.message.includes('成功')) {
this.$message({
showClose: true,
message: res.message,
type: 'error'
})
}
})
.catch((err) => console.error(err))
.finally(() => {
this.init()
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
})
}
}
}
</script>
<style lang="scss">
.record-maintenance-dialog {
header {
display: flex;
margin-bottom: 10px;
> div {
display: flex;
margin-right: 20px;
align-items: center;
> span {
white-space: nowrap;
margin-right: 4px;
}
}
}
.dee-table-body {
height: 500px;
}
.el-table thead th {
color: #2e2e2e;
font-weight: 700;
font-size: 14px;
padding: 0;
background-color: #f3f6f7;
line-height: 46px !important;
}
.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%;
}
}
.record-maintenance-popper {
.el-form-item__label {
display: none !important;
}
.el-form-item__content {
padding-left: 0px !important;
}
.el-col {
padding: 0px !important;
}
.dee-upload-page,
.el-form-item {
margin-bottom: 0px !important;
}
.dee-table-header {
display: none;
}
.el-form-item {
margin-bottom: 0px;
}
}
</style>
...@@ -51,7 +51,10 @@ export default { ...@@ -51,7 +51,10 @@ export default {
}, },
methods: { methods: {
// 打开弹出框 // 打开弹出框
open() { open(data) {
this.versionChangeDesc = data.versionChangeDesc
this.workDescription = data.workDescription
this.prepareDescription = data.prepareDescription
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.getTablesData(1) this.getTablesData(1)
...@@ -69,7 +72,6 @@ export default { ...@@ -69,7 +72,6 @@ export default {
} }
this.$refs.table1.loading = true this.$refs.table1.loading = true
this.$refs.table2.loading = true this.$refs.table2.loading = true
// this.$refs.table3.loading = true
const params = { const params = {
'searchItems': { 'searchItems': {
'children': [ 'children': [
...@@ -115,9 +117,6 @@ export default { ...@@ -115,9 +117,6 @@ export default {
} else { } else {
this.tableFile = res.items.content || [] this.tableFile = res.items.content || []
} }
// this.versionChangeDesc = res.items.dxProcessPlanVo.versionChangeDesc
// this.prepareDescription = res.items.dxProcessPlanVo.prepareDescription
// this.workDescription = res.items.dxProcessPlanVo.workDescription
this.$nextTick(() => { this.$nextTick(() => {
if (value === 1) { if (value === 1) {
this.$refs.table1.init() this.$refs.table1.init()
...@@ -140,9 +139,6 @@ export default { ...@@ -140,9 +139,6 @@ export default {
} else { } else {
this.$refs.table2.loading = false this.$refs.table2.loading = false
} }
// this.$refs.table1.loading = false
// this.$refs.table2.loading = false
// this.$refs.table3.loading = false
}) })
}, },
getFrockTable() { getFrockTable() {
...@@ -156,7 +152,6 @@ export default { ...@@ -156,7 +152,6 @@ export default {
{ {
'fieldName': 'source.targetExtProcessUsageLink.sourceId', 'fieldName': 'source.targetExtProcessUsageLink.sourceId',
'operator': 'EQ', 'operator': 'EQ',
// 'value': '249391817076000'
'value': this.$parent.headerData.aoId 'value': this.$parent.headerData.aoId
}, },
{ {
......
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
class="gooey-menu-item" class="gooey-menu-item"
:disabled="isOK" :disabled="isOK"
content="技术要求" content="技术要求"
@click="!isOK && $refs.TechnicalRequirements.open()" @click="!isOK && $refs.TechnicalRequirements.open(headerData)"
> >
<el-badge :value="12" class="item" hidden> <el-badge :value="12" class="item" hidden>
<svg class="icon" aria-hidden="true"> <svg class="icon" aria-hidden="true">
...@@ -509,7 +509,7 @@ ...@@ -509,7 +509,7 @@
</div> </div>
</div> </div>
<!-- 物料确认 --> <!-- 物料确认 -->
<!-- <ConfirmMaterial ref="ConfirmMaterial" /> --> <ConfirmMaterial ref="ConfirmMaterial" />
<!--胶漆申领 --> <!--胶漆申领 -->
<!-- <LacClaims ref="LacClaims" /> --> <!-- <LacClaims ref="LacClaims" /> -->
<!-- 技术要求 --> <!-- 技术要求 -->
...@@ -522,7 +522,7 @@ ...@@ -522,7 +522,7 @@
<InspectionRejected ref="InspectionRejected" /> <InspectionRejected ref="InspectionRejected" />
<AttachmentUpload ref="AttachmentUpload" /> <AttachmentUpload ref="AttachmentUpload" />
<!-- 物料确认 --> <!-- 物料确认 -->
<!-- <RecordMaintenance ref="RecordMaintenance" /> --> <RecordMaintenance ref="RecordMaintenance" />
<!-- 物料确认 --> <!-- 物料确认 -->
</div> </div>
</template> </template>
...@@ -535,13 +535,13 @@ import '@/api/jq-signature' ...@@ -535,13 +535,13 @@ import '@/api/jq-signature'
import '@/icons/app/iconfont' import '@/icons/app/iconfont'
import { post, get } from '@/utils/http' import { post, get } from '@/utils/http'
// import Table from './components/table' // import Table from './components/table'
// import ConfirmMaterial from './components/ConfirmMaterial/index' 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 TechnicalRequirements from './components/TechnicalRequirements/index'
import AssemblyProcess from './components/AssemblyProcess/index' import AssemblyProcess from './components/AssemblyProcess/index'
import InspectionRejected from './components/chatBox/index' import InspectionRejected from './components/chatBox/index'
// import ProblemDeclare from './components/ProblemDeclare/index' // import ProblemDeclare from './components/ProblemDeclare/index'
// import RecordMaintenance from './components/RecordMaintenance/index' import RecordMaintenance from './components/RecordMaintenance/index'
// import scan from '@/components/scanCode/scanCode' // import scan from '@/components/scanCode/scanCode'
import AttachmentUpload from './components/AttachmentUpload/dialog' import AttachmentUpload from './components/AttachmentUpload/dialog'
export default { export default {
...@@ -551,7 +551,9 @@ export default { ...@@ -551,7 +551,9 @@ export default {
AttachmentUpload, AttachmentUpload,
TechnicalRequirements, TechnicalRequirements,
InspectionRejected, InspectionRejected,
AssemblyProcess AssemblyProcess,
RecordMaintenance,
ConfirmMaterial
}, },
data() { data() {
return { return {
...@@ -722,7 +724,10 @@ export default { ...@@ -722,7 +724,10 @@ export default {
scheduledEnd: data.scheduledEnd, scheduledEnd: data.scheduledEnd,
planStateCode: data.planState, planStateCode: data.planState,
disabled: true, disabled: true,
aoId: data.extProcessPlan.id aoId: data.extProcessPlan.id,
workDescription: data.extProcessPlan.workDescription,
versionChangeDesc: data.workDescription,
prepareDescription: data.extProcessPlan.prepareDescription
// 不合格 // 不合格
} }
that.getWorkingProcedure() that.getWorkingProcedure()
...@@ -791,44 +796,44 @@ export default { ...@@ -791,44 +796,44 @@ export default {
if (res && res.items) { if (res && res.items) {
that.workingProcedure = (res.items || []).map((p) => { that.workingProcedure = (res.items || []).map((p) => {
return { return {
id: p.joExecuteOpPlan[0].id, id: p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].id,
tableId: p.id, tableId: p.id,
serialNumber: p.code, serialNumber: p.code,
title: p.name, title: p.name,
html: p.joExecuteOpPlan[0].longdescription, html: p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].longdescription,
keyOperation: p.keyOperation, keyOperation: p.keyOperation,
checkFlag: p.checkFlag === 'true', checkFlag: p.checkFlag === 'true',
airFlag: p.airFlag === 'AAD' || p.airFlag === '目击', airFlag: p.airFlag === 'AAD' || p.airFlag === '目击',
versionKey: p.gaceVersion, versionKey: p.gaceVersion,
statusCode: p.joExecuteOpPlan[0].status, statusCode: p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].status,
isQualified: p.joExecuteOpPlan[0].isQualified, isQualified: p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].isQualified,
countOBJReject: p.joExecuteOpPlan[0].countOBJReject, countOBJReject: p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].countOBJReject,
countRecord: p.joExecuteOpPlan[0].countRecord, countRecord: p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].countRecord,
countProblem: p.joExecuteOpPlan[0].countProblem, countProblem: p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].countProblem,
countDebugging: p.joExecuteOpPlan[0].countDebugging, countDebugging: p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].countDebugging,
countQuality: p.joExecuteOpPlan[0].countQuality, countQuality: p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].countQuality,
revoke: p.joExecuteOpPlan[0].revoke, revoke: p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].revoke,
// 工装 // 工装
isOKClothesLink: p.joExecuteOpPlan[0].isOKClothesLink, isOKClothesLink: p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].isOKClothesLink,
isOKToolLink: p.joExecuteOpPlan[0].isOKToolLink, isOKToolLink: p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].isOKToolLink,
deviceLink: p.joExecuteOpPlan[0].deviceLink, deviceLink: p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].deviceLink,
operator: p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].jrExecuteOpPlans && operator: p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].jrExecuteOpPlans &&
p.joExecuteOpPlan[0].jrExecuteOpPlans.length && p.joExecuteOpPlan[0].jrExecuteOpPlans[0].operatorUser p.joExecuteOpPlan[0].jrExecuteOpPlans.length && p.joExecuteOpPlan[0].jrExecuteOpPlans[0].operatorUser
? p.joExecuteOpPlan[0].jrExecuteOpPlans[0].operatorUser.userName + ? p.joExecuteOpPlan[0].jrExecuteOpPlans[0].operatorUser.userName +
' ' + ' ' +
p.joExecuteOpPlan[0].jrExecuteOpPlans[0].operatorTime p.joExecuteOpPlan[0].jrExecuteOpPlans[0].operatorTime
: '', : '',
testor: testor:
p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].jrExecuteOpPlans && p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].jrExecuteOpPlans &&
p.joExecuteOpPlan[0].jrExecuteOpPlans.length && p.joExecuteOpPlan[0].jrExecuteOpPlans[0].testor ? p.joExecuteOpPlan[0].jrExecuteOpPlans[0].testor.userName + p.joExecuteOpPlan[0].jrExecuteOpPlans.length && p.joExecuteOpPlan[0].jrExecuteOpPlans[0].testor ? p.joExecuteOpPlan[0].jrExecuteOpPlans[0].testor.userName +
' ' + ' ' +
p.joExecuteOpPlan[0].jrExecuteOpPlans[0].testorTime : '', p.joExecuteOpPlan[0].jrExecuteOpPlans[0].testorTime : '',
dmir: { dmir: {
dmriImg: dmriImg:
p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].jrExecuteOpPlans && p.joExecuteOpPlan[0].jrExecuteOpPlans.length && p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].jrExecuteOpPlans && p.joExecuteOpPlan[0].jrExecuteOpPlans.length &&
p.joExecuteOpPlan[0].jrExecuteOpPlans[0].dmriImg, p.joExecuteOpPlan[0].jrExecuteOpPlans[0].dmriImg,
dmirTime: dmirTime:
p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].jrExecuteOpPlans && p.joExecuteOpPlan[0].jrExecuteOpPlans.length && p.joExecuteOpPlan && p.joExecuteOpPlan.length && p.joExecuteOpPlan[0].jrExecuteOpPlans && p.joExecuteOpPlan[0].jrExecuteOpPlans.length &&
p.joExecuteOpPlan[0].jrExecuteOpPlans[0].dmirTime p.joExecuteOpPlan[0].jrExecuteOpPlans[0].dmirTime
}, },
fileList: p.objFileLinks ? p.objFileLinks : [] fileList: p.objFileLinks ? p.objFileLinks : []
...@@ -1144,12 +1149,18 @@ export default { ...@@ -1144,12 +1149,18 @@ export default {
* 试验申请 * 试验申请
*/ */
testApplication() { testApplication() {
this.HttpRequest( const params = {
`ExperimentRecord/saveOpRecord?opId=${ 'operator': 'ADD',
this.editor.tableId 'status': 'Apply',
}&userId=${localStorage.getItem('userId')}`, 'extProcessPlanId': this.headerData.aoId,
{}, 'extProcessPlanIdType': 'ExtProcessPlan',
'post' 'extProcessOperationId': this.editor.tableId,
'extProcessOperationIdType': 'ExtProcessOperation',
'appTime': this.formatTime()
}
post(
`ExperimentRecord/recursion`,
params
) )
.then((res) => { .then((res) => {
if (res && res.message.includes('成功')) { if (res && res.message.includes('成功')) {
...@@ -1191,6 +1202,21 @@ export default { ...@@ -1191,6 +1202,21 @@ export default {
}) })
} }
}, },
getHandledValue(num) {
return num < 10 ? '0' + num : num
},
formatTime() {
const d = new Date()
const year = d.getFullYear()
const month = this.getHandledValue(d.getMonth() + 1)
const date = this.getHandledValue(d.getDate())
const hours = this.getHandledValue(d.getHours())
const minutes = this.getHandledValue(d.getMinutes())
const second = this.getHandledValue(d.getSeconds())
let resStr = ''
resStr = year + '-' + month + '-' + date + ' ' + hours + ':' + minutes + ':' + second
return resStr
},
inspectionDioge() { inspectionDioge() {
var that = this var that = this
this.$confirm('确定检验完成吗', '提示', { this.$confirm('确定检验完成吗', '提示', {
......
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