init: CATL电池线质量检验APP首次入库

This commit is contained in:
XingCheng3
2026-06-08 17:11:44 +08:00
commit b5914d0ad1
72 changed files with 46833 additions and 0 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,545 @@
<template>
<div class="app-container">
<el-card style="">
<el-row>
<div style="display: flex;margin-bottom: 20px">
<van-field v-model="dateTimeShowInfo" left-icon="clock-o" style="width: 220px;border-radius: 4px;border:1px solid #DCDFE6;height: 36px;line-height: 18px" readonly @focus="forbid;dateTimeShow=!dateTimeShow" />
<!-- <van-calendar v-model="dateTimeShow" :min-date="new Date(2000,1,1)" :default-date="dateTimeDefault" type="range" @confirm="confirmFnDate" />-->
<van-calendar v-model="dateTimeShow" :min-date="minDate" :max-date="maxDate" :default-date="dateTimeDefault" type="range" @confirm="confirmFnDate" />
<!-- <el-select v-model="statusNumberValue" placeholder="状态" size="medium" style="margin-left:10px;width:120px" @change="fetchData">-->
<!-- <el-option-->
<!-- v-for="item in statusNumber"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"/>-->
<!-- </el-select>-->
<el-button type="warning" icon="el-icon-search" size="small" style="margin-left: 20px;" @click="fetchData()">查询</el-button>
</div>
</el-row>
<el-row style="overflow: auto;height: 700px">
<van-list
v-model="loading_checkOrder"
:finished="true"
finished-text="没有更多了"
>
<van-cell v-for="(item,index) in tableData" :key="index">
<van-card class="s-card">
<template #tags>
<van-row style="font-size: 1.5rem">
<van-tag type="primary" size="large" @click="CheckOrder_rowClick(item)">{{item.质检数量}}</van-tag>
<van-tag v-if="item.状态 === 4 && item.是否合格 === 1" size="large" type="success">OK</van-tag>
<van-tag v-if="item.状态 === 4 && item.是否合格 === 2" size="large" type="danger">NOK</van-tag>
<van-tag v-if="item.状态 === 1" size="large" style="float: right" type="danger">未下发</van-tag>
<van-tag v-if="item.状态 === 2" size="large" style="float: right" type="primary">已下发</van-tag>
<van-tag v-if="item.状态 === 3" size="large" style="float: right" type="warning">质检中</van-tag>
<van-tag v-if="item.状态 === 4" size="large" style="float: right" type="success">已完成</van-tag>
</van-row>
<van-row style="font-size: 1.3rem">
<div style="margin: 10px 10px 0 0;">
<van-icon name="todo-list-o" color="#1989fa"/>
<span>质检单称</span>
{{item.质检单名称}}
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="clock-o" color="#1989fa"/>
<span>检验日期</span>
<span> {{item.质检日期}}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="contact-o" color="#1989fa"/>
<span>检验部门</span>
<span> {{item.部门名称}}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="comment-o" color="#1989fa"/>
<span>备注</span>
<span> {{item.检查备注}}</span>
</div>
</van-row>
</template>
</van-card>
</van-cell>
</van-list>
</el-row>
<el-row style="position: absolute;left: 0;bottom: 10px;width: 100%;background: #e7e7e7;">
<van-pagination
v-model="pageCurrent"
:total-items="totalNum"
:items-per-page="pageSize"
force-ellipses
@change="handleCurrentChange"
/>
</el-row>
<van-dialog
v-model="showTableData_content"
width="95%"
:lock-scroll="false"
:show-cancel-button="false"
:show-confirm-button="false"
style="max-height: 70%!important;overflow: auto"
>
<div class="dialog-content">
<!-- 固定顶部的内容 -->
<div class="dialog-header">检查项目详情{{tableData_content.length}}</div>
<!-- 可滚动的内容区域 -->
<div class="scrollable-content">
<van-list
v-model="loading_checkOrder_content"
:finished="finished_checkOrder_content"
>
<van-cell v-for="(item,index) in tableData_content" :key="index">
<van-card class="s-card">
<template #tags>
<van-row style="font-size: 1.5rem">
<van-tag v-if="item['状态'] === 0" type="danger" size="large">{{index + 1}}.未检</van-tag>
<van-tag v-if="item['状态'] === 1" type="success" size="large">{{index + 1}}.已检</van-tag>
<van-tag v-if="item.项目类型 === '定性'" type="primary" size="large">{{item.项目类型}}{{item.检查数量}}</van-tag>
<van-tag v-if="item.项目类型 === '定量'"type="warning" size="large">{{item.项目类型}}{{item.检查数量}}</van-tag>
</van-row>
<van-row style="font-size: 1.3rem">
<van-col span="24">
<div style="margin: 10px 10px 0 0;">
<van-icon name="star-o" color="#1989fa"/>
<span>项目</span>
<span> {{item.检查项目}}</span>
</div>
</van-col>
<!-- <van-col span="8" v-if="item.指导图片数量 > 0">-->
<!-- <div style="margin: 10px 10px 0 0;">-->
<!-- <van-icon name="photo-o" color="#1989fa"/>-->
<!-- <span>指导图片</span>-->
<!-- <el-link type="primary">{{item.指导图片数量}}</el-link>-->
<!-- </div>-->
<!-- </van-col>-->
</van-row>
<van-row style="font-size: 1.3rem">
<div style="margin: 10px 10px 0 0;">
<van-icon name="coupon-o" color="#1989fa"/>
<span>内容</span>
<span> {{item.检查内容}}</span>
</div>
</van-row>
<van-row style="font-size: 1.3rem">
<van-col span="24">
<div style="margin: 10px 10px 0 0;">
<van-icon name="font-o" color="#1989fa"/>
<span>工具</span>
<span>{{item.检查工具编号1}}{{item.检查工具名称}}</span>
</div>
</van-col>
</van-row>
<van-row style="font-size: 1.3rem">
<van-col span="12">
<div style="margin: 10px 10px 0 0;">
<van-icon name="setting-o" color="#1989fa"/>
<span>方法</span>
<span>{{item.检查方法名称}}</span>
</div>
</van-col>
<van-col v-if="item.项目类型 === '定量'" span="6">
<div style="margin: 10px 10px 0 0;">
<van-icon name="arrow-up" color="#1989fa"/>
<span>上限</span>
{{item.上限}}
</div>
</van-col>
<van-col v-if="item.项目类型 === '定量'" span="6">
<div style="margin: 10px 10px 0 0;">
<van-icon name="arrow-down" color="#1989fa"/>
<span>下限</span>
{{item.下限}}
</div>
</van-col>
</van-row>
<!-- <van-row style="font-size: 1.3rem">-->
<!-- <div style="margin: 10px 10px 0 0;">-->
<!-- <van-icon name="comment-o" color="#1989fa"/>-->
<!-- <span>备注</span>-->
<!-- <span>{{item.原始备注 }}</span>-->
<!-- </div>-->
<!-- </van-row>-->
<van-divider>检查结果</van-divider>
<!-- <van-row style="font-size: 1.3rem">-->
<!-- <van-field-->
<!-- v-model="item.产品编号"-->
<!-- label="产品编号"-->
<!-- readonly-->
<!-- placeholder="产品编号"-->
<!-- style="margin: 1px 0"-->
<!-- />-->
<!-- </van-row>-->
<van-row v-if="item.项目类型 === '定性'" style="font-size: 1.3rem;display: flex;align-items: center;">
<van-col span="24" style="pointer-events: none;">
<div v-for="(item1, index1) in item.children" style="display: flex;align-items: center;margin: 1px 0">
<van-col span="15" style="margin: 1px 0">
<van-field
v-model="item1.产品编号"
readonly
left-icon="scan"
placeholder=""
style="width: 95%"
/>
</van-col>
<van-col span="9" style="margin: 1px 0">
<div style="display: flex;">
<van-tag v-if="item1.是否合格 === 1" type="success" size="large" style="width: 35px;display: flex;justify-content: center;">OK</van-tag>
<van-tag v-else-if="item1.是否合格 === 2" type="danger" size="large" style="width: 35px;display: flex;justify-content: center;">NOK</van-tag>
<van-tag v-else size="large" color="#909399" text-color="#ffffff" style="width: 35px;display: flex;justify-content: center;">&nbsp;</van-tag>
</div>
</van-col>
</div>
</van-col>
</van-row>
<van-row v-if="item.项目类型 === '定量'" style="font-size: 1.3rem;">
<div v-for="(item1, index1) in item.children" style="display: flex;align-items: center;">
<van-col span="15" style="pointer-events: none;margin: 1px 0">
<van-field
v-model="item1.产品编号"
readonly
style="width: 95%"
left-icon="scan"
/>
</van-col>
<van-col span="7" style="margin: 1px 0">
<van-field
v-model="item1.测量值"
:label="(index1 + 1)"
name="checkOrderValue"
label-width="2rem"
readonly
placeholder="检验值"
/>
</van-col>
<van-col span="2" style="pointer-events: none;">
<van-tag v-if="item1.是否合格 === 1" type="success" size="large" style="width: 35px;display: flex;justify-content: center;">OK</van-tag>
<van-tag v-else-if="item1.是否合格 === 2" type="danger" size="large" style="width: 35px;display: flex;justify-content: center;">NOK</van-tag>
<van-tag v-else size="large" color="#909399" text-color="#ffffff" style="width: 35px;display: flex;justify-content: center;">&nbsp;</van-tag>
</van-col>
</div>
</van-row>
<van-row style="font-size: 1.3rem;display: flex;align-items: center;">
<van-col span="15">
<van-field
v-model="item.备注"
label="备注"
readonly
style="width: 95%;margin: 1px 0"
/>
</van-col>
<van-col span="9">
<el-button v-if="item.上传图片数量 > 0" type="primary" size="small" @click="getGuidePic1(item)">查看图片({{item.上传图片数量}})</el-button>
</van-col>
</van-row>
</template>
</van-card>
</van-cell>
</van-list>
</div>
<!-- 固定底部的内容 -->
<div class="dialog-footer">
<van-button plain size="small" style="width: 100%;font-size: 16px;height: 48px;" @click="showTableData_content=false">关闭</van-button>
</div>
</div>
</van-dialog>
<van-dialog
v-model="showTableData_content_exchange2"
width="70%"
:lock-scroll="false"
:show-cancel-button="false"
:show-confirm-button="false"
style="max-height: 70%!important;overflow: auto"
>
<div class="dialog-content">
<!-- 固定顶部的内容 -->
<div class="dialog-header">图片查看</div>
<!-- 可滚动的内容区域 -->
<div class="scrollable-content">
<van-list :finished="true">
<van-cell v-for="(item,index) in RepairManagementDataTableOrigin" :key="index">
<el-row v-if="/(jpg|jpeg|png|GIF|JPG|PNG)$/i.test(item.附件类型)">
{{index + 1}}<el-link type="primary" @click="showPic(item)" class="noShowAllText">{{item.附件名称}}.{{item.附件类型 }}</el-link>
</el-row>
<el-row v-else>
{{index + 1}}{{item.附件名称}}.{{item.附件类型 }}
</el-row>
</van-cell>
</van-list>
</div>
<!-- 固定底部的内容 -->
<div class="dialog-footer">
<van-button size="small" style="width: 100%" @click="showTableData_content_exchange2=false">关闭</van-button>
</div>
</div>
</van-dialog>
</el-card>
</div>
</template>
<script>
import {base64ImgtoFile, formatDate, getBeforeOrAfterTime, getNowTime2} from '../../../utils/tool'
import {ImagePreview, Toast} from 'vant'
export default {
data() {
return {
userInfo: {},
minDate: null,
maxDate: null,
statusNumberValue: 4,
statusNumber: [
{
value: 0,
label: '全部'
},
{
value: 1,
label: '未下发'
},
{
value: 2,
label: '已下发'
},
{
value: 3,
label: '质检中'
},
{
value: 4,
label: '已完成'
}
],
dateTime: [],
dateTimeDefault: [],
dateTimeShowInfo: '',
dateTimeShow: false,
loading_checkOrder: false,
finished_checkOrder: true,
tableData: [],
tableData_content: [],
showTableData_content: false,
loading_checkOrder_content: true,
finished_checkOrder_content: true,
currentSelectCheckOrder: {},
currentSelectCheckOrderContent: {},
RepairManagementReplaceForm: {
ID: ''
},
dialogFormVisible_addCheckOrder_content_show: false,
showTableData_content_exchange: false,
showTableData_content_exchange2: false,
RepairManagementDataTableOrigin: [],
imageType: ['bmp', 'jpg', 'png', 'gif'],
pdfType: ['pdf'],
currentPage: 1,
pageSize: 10,
pageCurrent: 1,
totalNum: null
}
},
watch: {},
created() {
this.userInfo = JSON.parse(localStorage.getItem('userInfo'))
// 获取今日日期
const today = new Date();
this.minDate = new Date(today.getFullYear(), today.getMonth() - 1, today.getDate());
this.maxDate = new Date(today.getFullYear(), today.getMonth() + 1, today.getDate());
console.log('CheckPlanSearch')
this.$parent.showNav = true
this.dateTime = [getBeforeOrAfterTime(-30), getNowTime2()]
this.dateTimeShowInfo = this.dateTime[0] + ' ~ ' + this.dateTime[1]
this.dateTimeDefault = [new Date(getBeforeOrAfterTime(-7)), new Date(getNowTime2())]
this.fetchData()
},
mounted () {
document.getElementById('topPageName').innerText = '检验历史'
},
methods: {
forbid(){
//禁止软键盘弹出
document.activeElement.blur();
},
confirmFnDate(date) {
this.dateTimeShow = false
this.dateTime=[formatDate(date[0]), formatDate(date[1])]
this.dateTimeShowInfo= this.dateTime[0] + ' ~ ' + this.dateTime[1]
this.fetchData()
},
fetchData() {
this.listLoading = true
const statusNumber = this.statusNumberValue === 0 ? 0 : 1
var param = []
param[0] = ['开始日期', this.dateTime[0]]
param[1] = ['结束日期', this.dateTime[1]]
param[2] = ['状态', this.statusNumberValue]
param[3] = ['状态_ischeck', statusNumber]
param[4] = ['PageCurrent', this.pageCurrent]
param[5] = ['PageSize', this.pageSize]
param[6] = ['PageCount', 1000, 'int', '1']
param[7] = ['ItemCount', 1000, 'int', '1']
param[8] = ['日期_ischeck', 1]
param[9] = ['部门id', this.userInfo['考核部门编号']]
var Data = this.CreateData('11', '质检_工单_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.result
this.totalNum = parseInt(response.data.output[0].ItemCount)
this.listLoading = false
}).catch(er => {
this.listLoading = false
this.$message.error('错误')
})
},
CheckOrder_rowClick(row) {
this.currentSelectCheckOrder = row
this.showTableData_content = true
this.fetchData_content(row)
},
fetchData_content(row) {
var param = []
param[0] = ['质检单号', row.质检单号]
var Data = this.CreateData('11', '质检_工单检查内容_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData_content = []
const tableData_content1 = {}
for (let i = 0; i < response.data.length; i++) {
if(Object.prototype.hasOwnProperty.call(tableData_content1, response.data[i]['ID'])) {
tableData_content1[response.data[i]['ID']]['children'].push({
ID: response.data[i]['测量值id'],
测量值: response.data[i]['测量值'],
产品编号: response.data[i]['产品编号1'],
是否合格: response.data[i]['是否合格1'],
状态: response.data[i]['测量值状态'],
})
} else {
tableData_content1[response.data[i]['ID']] = { ...{children: [{
ID: response.data[i]['测量值id'],
测量值: response.data[i]['测量值'],
产品编号: response.data[i]['产品编号1'],
是否合格: response.data[i]['是否合格1'],
状态: response.data[i]['测量值状态'],
}]}, ...response.data[i], }
}
}
for (const [key, value] of Object.entries(tableData_content1) ) {
this.tableData_content.push(value)
if(value.状态 === 1) this.tableData_contentFinish++
}
}).catch(er => {
this.$message.error('错误')
})
},
getGuidePic1(item) {
this.RepairManagementReplaceForm.ID = item.ID
const param = []
param[0] = ['检查项id', item.ID]
const Data = this.CreateData('11', '质检_质检单_详细内容_图片_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
for (let i = 0; i < response.data.length; i++) {
if (this.imageType.indexOf(response.data[i]['附件类型'].toLowerCase()) !== -1) {
response.data[i]['url'] = window.URL.createObjectURL(base64ImgtoFile(response.data[i]['附件内容'], response.data[i]['附件名称'], response.data[i]['附件类型']))
} else {
response.data[i]['url'] = window.URL.createObjectURL(base64ImgtoFile(response.data[i]['附件内容'], response.data[i]['附件名称'], response.data[i]['附件类型']))
}
}
this.RepairManagementDataTableOrigin = response.data
this.showTableData_content_exchange2 = true
} else {
this.RepairManagementDataTableOrigin = []
Toast.fail('暂无图片!')
}
})
},
showPic(item) {
ImagePreview({
images: [
item.url
]
});
},
// 分页功能改变显示数量
onLoad(){
this.loading_checkOrder = true
this.pageCurrent++
this.fetchData()
},
handleSizeChange(val) {
this.pageSize = val
this.fetchData()
},
// 分页功能改变当前页
handleCurrentChange(val) {
this.pageCurrent = val
this.fetchData()
}
}
}
</script>
<style scoped>
.app-container{
margin-top: 50px;
}
.check-Content-Name {
font-size: 14px;
line-height: 30px;
}
.check-Content-Value {
font-size: 14px;
font-weight: bolder;
line-height: 30px;
}
.xin-main{
position: relative;
height: 100%;
overflow: hidden;
}
.xin-content{
overflow-y: scroll;
box-sizing: border-box;
overflow-x: hidden;
}
.xin-footer {
text-align: center;
margin: 20px;
}
.dialog-content {
display: flex;
flex-direction: column;
height: 100%;
}
.dialog-header,
.dialog-footer {
position: sticky;
z-index: 10;
}
.dialog-header {
top: 0;
background-color: white;
padding-top: 26px;
font-weight: 500;
line-height: 24px;
text-align: center;
}
.dialog-footer {
bottom: -3px;
background-color: white;
text-align: center;
margin-top: 10px;
display: flex;
}
.scrollable-content {
flex: 1;
overflow-y: auto;
padding: 10px;
}
</style>

View File

@@ -0,0 +1,397 @@
<template>
<div class="app-container">
<van-card class="s-card" style="height: 100vh;margin: 10px">
<template #tags>
<van-form @submit="RepairManagementReplaceSubmit" ref="occCreateForm">
<van-field
v-model="occCreateForm.productCode"
ref="occCreateFormProductCode"
name="产品编号"
label="产品编号"
clearable
right-icon="scan"
required
placeholder="请输入/扫描产品编号"
:rules="[{ required: true, message: '请输入/扫描产品编号' }]"
/>
<van-field
v-model="occCreateForm.remake"
rows="4"
autosize
required
clearable
label="缺陷描述"
type="textarea"
placeholder="请输入缺陷描述"
/>
<div style="margin: 16px;">
<van-button round block type="info" native-type="submit">提交</van-button>
</div>
</van-form>
</template>
</van-card>
<!-- 问题选择项目选择-->
<van-popup v-model="dialogFormVisible_CheckContent" position="bottom">
<van-tree-select
:items="stationNumber"
:main-active-index.sync="activeIndex"
@click-nav="addCheckOrder_content_stationNumber_Click"
@click-item="addCheckOrder_content_stationNumber_Click_sure"
/>
</van-popup>
</div>
</template>
<script>
import {Dialog, Toast} from 'vant'
export default {
name: 'OccCreate',
data() {
return {
occCreateForm: {
productCode: '',
opCode: '',
problem: '',
problemId: '',
remake: ''
},
dialogFormVisible_selectStation: false,
dialogFormVisible_selectProgram: false,
stationNumber: [],
stationNumber1: [],
dialogFormVisible_CheckContent: false,
activeIndex: 0,
CheckContentBase: [],
barcode: '',
barcodeMaterial: '',
loading_checkOrder: false,
RepairManagementDataTable: [],
userInfo: '',
showTableData_content: false,
loading_checkOrder_content: false,
RepairManagementMaterialDataTable: [],
showTableData_content_exchange: false,
showTableData_content_destroy: false,
loading_checkOrder_content_exchange: false,
RepairType: 1,
currentSelectRow: {},
RepairManagementReplaceDialogVisible: false,
RepairManagementDestroyAllDialogVisible: false,
RepairManagementReplaceForm: {
ID: 0,
OpCode: '',
EngineID: '',
isUsedOpMaterial: true,
TraceabilityCode: 0,
materialCount: 0,
materialCode: '',
materialBarCode: '',
materialName: '',
materialBarCodeNew: ''
},
RepairManagementReplaceRules: {
materialBarCodeNew: [{ required: true, message: '请输入/扫描新物料码!', trigger: 'blur' }]
},
RepairManagementType: '1',
partCode: '',
opCode: '',
opCodeS: [],
stationArr: [],
RepairManagementDataLogTable: [],
RepairManagementDataTableOrigin: [],
engineValue: {
OpName: null,
EngineID: null, // 产品编号
EngineType: null, // 产品型号
EngineTypeID: null, // 机型代码
PalletCode: null,
ProcessCode: null, // 程序号
PartPalletCode: null, // 托盘号
PalletInfo: null, // 托盘信息
RepairPartStatusPLC: null,
QualityMask: null,
OrderForm: null, // 订单号
EngineTypeString: null // 产品型号字符串北汽专用
}
}
},
created() {
this.userInfo = localStorage.getItem('userInfo') === '' ? {} : JSON.parse(localStorage.getItem('userInfo'))
console.log(this.userInfo)
this.getStationNumber()
this.searchCheckContentBase('')
},
mounted() {
document.getElementById('topPageName').innerText = '缺陷记录'
this.$refs.occCreateFormProductCode.focus()
},
methods: {
getStationNumber() {
this.stationNumber = []
this.stationNumber1 = []
var param = []
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
this.ExecDatabase(Data).then(response => {
this.stationNumber.push({
label: '无工位选项',
value: '',
// id: response.data[i].工位号,
text: '无工位选项',
children: [],
labelName: '无工位选项'
})
this.stationNumber1.push('无工位选项')
for (let i = 0; i < response.data.length; i++) {
this.stationNumber.push({
label: `${response.data[i].工位号}${response.data[i].工位名称}`,
value: response.data[i].工位号,
// id: response.data[i].工位号,
text: response.data[i].工位名称,
children: [],
labelName: response.data[i].工位名称
})
this.stationNumber1.push(response.data[i].工位名称)
}
})
},
addCheckOrder_content_stationNumber_Click(index) {
this.searchCheckContentBase(this.stationNumber[index].value)
},
addCheckOrder_content_stationNumber_Click_sure(param) {
this.occCreateForm.problemId = param['ID']
this.occCreateForm.problem = param['问题项目']
this.dialogFormVisible_CheckContent = false
},
searchCheckContentBase(stationNumberValue) {
this.CheckContentBase = []
var param = []
param[0] = ['工位号', stationNumberValue]
var Data = this.CreateData('11', 'CATL_基础_OCC_查询', param)
this.ExecDatabase(Data).then(response => {
this.CheckContentBase = response.data
for (let i = 0; i < response.data.length; i++) {
response.data[i].value = response.data[i].ID
response.data[i].text = response.data[i].问题项目
}
for (let i = 0; i < this.stationNumber.length; i++) {
if(this.stationNumber[i].value === stationNumberValue) {
this.stationNumber[i].children = response.data
}
}
}).catch(er => {
Toast.fail('错误')
})
},
// 提交
RepairManagementReplaceSubmit() {
this.$refs['occCreateForm'].validate().then(()=>{
const param = []
param[0] = ['产品编号', this.occCreateForm.productCode]
param[1] = ['问题ID', this.occCreateForm.problemId]
param[2] = ['备注', this.occCreateForm.remake]
param[3] = ['记录人', this.userInfo.姓名]
param[4] = ['问题来源', '技术质量']
const Data = this.CreateData('12', 'CATL_OCC_历史_增加', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
if (response.data[0].result === '1') {
Toast.success('问题记录成功!')
this.occCreateForm.remake = ''
this.occCreateForm.problemId = ''
this.occCreateForm.problem = ''
} else {
Toast.fail('问题记录失败!')
}
} else {
Toast.fail('问题记录失败!')
}
})
})
},
RepairManagementDestroyShow() {
this.RepairManagementReplaceForm.OpCode = ''
this.RepairManagementReplaceForm.materialCode = ''
this.RepairManagementReplaceForm.materialName = ''
this.RepairManagementReplaceForm.TraceabilityCode = ''
this.RepairManagementReplaceForm.ID = ''
this.RepairManagementReplaceForm.materialCount = ''
this.RepairManagementReplaceForm.materialBarCode = ''
this.RepairManagementReplaceForm.materialBarCodeNew = ''
this.barcodeMaterial = ''
this.showTableData_content_destroy = true
},
getTableAfterDestroy(row) {
const param = []
param[0] = ['发动机号', row.发动机号]
const Data = this.CreateData('11', '质量数据查询_测量数据发动机在线状态_返修工位', param)
this.ExecDatabase(Data).then(response => {
console.log(response.data)
if (response.data.length > 0) {
this.RepairManagementDataTable = response.data
} else {
this.RepairManagementDataTable = []
}
// this.$emit('initEngineValue', this.engineValue)
})
},
// 返修报废提交
RepairManagementDestroy(row) {
Dialog.confirm({
title: '物料报废',
message: `是否报废当前物料【${row.物料号}】【${row.零件名称}】?`
}).then(() => {
const param = []
param[0] = ['工位号', '']
param[1] = ['ID', row.ID]
param[2] = ['追溯代码', row.追溯代码]
param[3] = ['操作者', this.userInfo.姓名]
param[4] = ['新物料条码', '']
const Data = this.CreateData('12', '电子看板_装配零件_返修件_报废物料_编辑', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
if (response.data[0].result === '1') {
Toast.success('物料报废成功!')
this.getTable1(this.currentSelectRow, false)
this.getTableAfterDestroy(this.currentSelectRow)
} else {
Toast.success('物料报废失败!')
}
} else {
Toast.success('物料报废失败!')
}
})
}).catch(() => {
Toast({
message: '已取消操作',
icon: 'close',
});
})
},
// 返修报废提交
RepairManagementDestroy2() {
const row = this.RepairManagementReplaceForm
if(row.materialCode === '') {
Toast.fail('请查询物料信息!')
return
}
Dialog.confirm({
title: '物料报废',
message: `是否报废当前物料【${row.materialCode}】【${row.materialName}】?`
}).then(() => {
const param = []
param[0] = ['工位号', '']
param[1] = ['ID', row.ID]
param[2] = ['追溯代码', row.TraceabilityCode]
param[3] = ['操作者', this.userInfo.姓名]
param[4] = ['新物料条码', '']
const Data = this.CreateData('12', '电子看板_装配零件_返修件_报废物料_编辑', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
if (response.data[0].result === '1') {
Toast.success('物料报废成功!')
this.getTable1(this.currentSelectRow, false)
this.getTableAfterDestroy(this.currentSelectRow)
this.showTableData_content_destroy = false
} else {
Toast.fail('物料报废失败!')
}
} else {
Toast.fail('物料报废失败!')
}
})
}).catch(() => {
Toast({
message: '已取消操作',
icon: 'close',
});
})
},
// 返修报废 物料回仓
RepairManagementReturnOp() {
if (this.RepairManagementDataTable.length === 0) {
Toast.fail('请先查询产品信息!')
return
}
Dialog.confirm({
title: '物料返回提示',
message: '剩余物料将返回线边库位?'
}).then(() => {
const param = []
param[0] = ['发动机号', this.barcode]
param[1] = ['操作者', this.userInfo.姓名]
const Data = this.CreateData('12', '电子看板_装配零件_返修件_报废物料_返回', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
if (response.data[0].result === '1') {
Toast.success('物料回仓成功!')
this.getTableAfterDestroy(this.currentSelectRow)
} else {
Toast.fail('物料回仓失败!')
}
} else {
Toast.fail('物料回仓失败!')
}
})
})
.catch(() => {
Toast({
message: '已取消操作',
icon: 'close',
});
})
}
}
}
</script>
<style scoped>
.app-container{
margin-top: 50px;
}
.dialog-content {
display: flex;
flex-direction: column;
height: 100%;
}
.dialog-header,
.dialog-footer {
position: sticky;
z-index: 10;
}
.dialog-header {
top: 0;
background-color: white;
padding-top: 26px;
font-weight: 500;
line-height: 24px;
text-align: center;
}
.dialog-footer {
bottom: -3px;
background-color: white;
text-align: center;
margin-top: 10px;
display: flex;
}
.scrollable-content {
flex: 1;
overflow-y: auto;
padding: 10px;
}
</style>

View File

@@ -0,0 +1,420 @@
<template>
<div class="app-container">
<el-card style="height: 800px">
<el-row>
<div style="display: flex;margin: 20px 0">
<!-- <van-field ref="barcode" v-model="barcode" left-icon="scan" clearable style="width: 260px;border-radius: 4px;border:1px solid #DCDFE6;height: 36px;line-height: 18px" />-->
<van-field v-model="dateTimeShowInfo" left-icon="clock-o" style="width: 270px;border-radius: 4px;border:1px solid #DCDFE6;height: 36px;line-height: 18px" readonly @focus="forbid;dateTimeShow=!dateTimeShow" />
<van-calendar v-model="dateTimeShow" :min-date="minDate" :max-date="maxDate" :default-date="dateTimeDefault" type="range" @confirm="confirmFnDate" />
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px;" @click="getTable2">查询</el-button>
<el-button type="danger" icon="el-icon-add" size="small" style="margin-left: 10px;" @click="addOqc">缺陷记录</el-button>
</div>
</el-row>
<el-row style="overflow: auto;height: 750px">
<van-list
v-model="loading_checkOrder"
:finished="true"
finished-text="没有更多了"
>
<van-cell v-for="(item,index) in RepairManagementDataLogTable" :key="index" style="padding: 10px 5px">
<van-card class="s-card">
<template #tags>
<van-row style="font-size: 1.5rem">
<van-tag type="primary" size="large">{{index+1 }}</van-tag>
<van-tag type="success" size="large">{{item.产品编号 }}</van-tag>
<van-tag style="float: right" v-if="item.放行方式 === null" type="warning" size="large">未处理</van-tag>
<van-tag style="float: right" v-if="item.放行方式 === '合格放行'" type="success" size="large">{{item.放行方式 }}</van-tag>
<van-tag style="float: right" v-if="item.放行方式 === '偏差放行'" type="warning" size="large">{{item.放行方式 }}</van-tag>
<van-tag style="float: right" v-if="item.放行方式 === '返工放行'" type="danger" size="large">{{item.放行方式}}</van-tag>
</van-row>
<van-row style="font-size: 1.3rem">
<van-col span="20" style="margin-top: 10px">
<div style="margin: 10px 10px 0 0;">
<van-icon name="contact-o" color="#1989fa"/>
<span>记录人</span>
<span> {{item.记录人 }}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="clock-o" color="#1989fa"/>
<span>记录时间</span>
{{item.记录时间}}
</div>
<!-- <div style="margin: 10px 10px 0 0;">-->
<!-- <van-icon name="comment-o" color="#1989fa"/>-->
<!-- <span>问题项目</span>-->
<!-- {{item.问题项目}}-->
<!-- </div>-->
<div style="margin: 10px 10px 0 0;">
<van-icon name="notes-o" color="#1989fa"/>
<span>缺陷描述</span>
<span> {{item.备注}}</span>
</div>
</van-col>
<van-col span="4">
<van-button v-if="item.附件数量 > 0" plain icon="orders-o" size="small" type="warning" style="margin-top: 10px" @click="showFile(item)">查看附件</van-button>
</van-col>
</van-row>
</template>
</van-card>
</van-cell>
</van-list>
</el-row>
</el-card>
<van-dialog
v-model="showTableData_content_exchange"
width="70%"
:lock-scroll="false"
:show-cancel-button="false"
:show-confirm-button="false"
style="max-height: 70%!important;overflow: auto"
>
<div class="dialog-content">
<!-- 固定顶部的内容 -->
<div class="dialog-header">附件</div>
<!-- 可滚动的内容区域 -->
<div class="scrollable-content">
<van-list :finished="true">
<van-cell v-for="(item,index) in RepairManagementDataTableOrigin" :key="index">
<el-row v-if="/(jpg|jpeg|png|GIF|JPG|PNG)$/i.test(item.附件类型)">
{{index + 1}}<el-link type="primary" @click="showPic(item)">{{item.附件名称}}.{{item.附件类型 }}</el-link>
</el-row>
<el-row v-else>
{{index + 1}}{{item.附件名称}}.{{item.附件类型 }}
</el-row>
</van-cell>
</van-list>
</div>
<!-- 固定底部的内容 -->
<div class="dialog-footer">
<van-button plain size="small" style="width: 100%;font-size: 16px;height: 48px;" @click="showTableData_content_exchange=false">关闭</van-button>
</div>
</div>
</van-dialog>
<van-dialog
v-model="showTableData_content_exchange1"
width="80%"
title="缺陷记录"
:lock-scroll="false"
:show-cancel-button="false"
:show-confirm-button="false"
style="max-height: 70%!important;overflow: auto"
>
<van-form ref="occCreateForm">
<van-field
v-model="occCreateForm.productCode"
ref="occCreateFormProductCode"
name="产品编号"
label="产品编号"
clearable
right-icon="scan"
required
placeholder="请输入/扫描产品编号"
:rules="[{ required: true, message: '请输入/扫描产品编号' }]"
@keydown.enter.prevent
/>
<van-field
v-model="occCreateForm.remake"
rows="4"
autosize
required
clearable
label="缺陷描述"
type="textarea"
placeholder="请输入缺陷描述"
/>
<div style="background-color: white;text-align: center;margin-top: 10px;display: flex;">
<van-button type="default" style="width: 100%" @click="showTableData_content_exchange1 = false">关闭</van-button>
<van-button type="info" native-type="submit" style="width: 100%" @click="RepairManagementReplaceSubmit('form_editCheckOrder')">提交</van-button>
</div>
</van-form>
</van-dialog>
</div>
</template>
<script>
import {Dialog, ImagePreview, Toast} from 'vant'
import {base64ImgtoFile, dataURLtoFile, formatDate, getBeforeOrAfterTime, getNowTime2} from '../../../utils/tool'
import axios from 'axios'
let forms = null; //设置公共变量,用来创建 FromData 对象,把文件带到后台
export default {
name: 'RepairManagement',
props: {
pageType: {
type: Number,
default: 0
}
},
data() {
return {
minDate: null,
maxDate: null,
statusNumber: [
{
label: '全部',
value: 9999
},
{
label: '未处理',
value: 0
},
{
label: '已处理',
value: 1
}
],
statusNumberValue: 9999,
dateTimeShowInfo: '',
dateTimeShow: false,
dateTimeDefault: [],
dateTime: [],
barcode: '',
barcodeMaterial: '',
loading_checkOrder: false,
showImages: false,
imageList: [],
RepairManagementDataTable: [],
userInfo: '',
showTableData_content: false,
loading_checkOrder_content: false,
RepairManagementMaterialDataTable: [],
showTableData_content_exchange1: false,
occCreateForm: {
productCode: '',
opCode: '',
problem: '',
problemId: '',
remake: ''
},
uploader: [],
Data: {},
RepairManagementReplaceForm: {
ID: 0,
productCode: '',
solveType: '',
solvePeople: ''
},
showTableData_content_exchange: false,
loading_checkOrder_content_exchange: false,
RepairType: 1,
currentSelectRow: {},
RepairManagementReplaceDialogVisible: false,
RepairManagementDestroyAllDialogVisible: false,
RepairManagementReplaceRules: {
materialBarCodeNew: [{ required: true, message: '请输入/扫描新物料码!', trigger: 'blur' }]
},
RepairManagementType: '1',
partCode: '',
opCode: '',
opCodeS: [],
stationArr: [],
RepairManagementDataLogTable: [],
RepairManagementDataTableOrigin: [],
engineValue: {
OpName: null,
EngineID: null, // 产品编号
EngineType: null, // 产品型号
EngineTypeID: null, // 机型代码
PalletCode: null,
ProcessCode: null, // 程序号
PartPalletCode: null, // 托盘号
PalletInfo: null, // 托盘信息
RepairPartStatusPLC: null,
QualityMask: null,
OrderForm: null, // 订单号
EngineTypeString: null // 产品型号字符串北汽专用
}
}
},
created() {
// 获取今日日期
const today = new Date();
this.minDate = new Date(today.getFullYear(), today.getMonth() - 1, today.getDate());
this.maxDate = new Date(today.getFullYear(), today.getMonth() + 1, today.getDate());
this.userInfo = localStorage.getItem('userInfo') === '' ? {} : JSON.parse(localStorage.getItem('userInfo'))
this.dateTime = [getBeforeOrAfterTime(-7), getNowTime2()]
this.dateTimeShowInfo = this.dateTime[0] + ' ~ ' + this.dateTime[1]
this.dateTimeDefault = [new Date(getBeforeOrAfterTime(-7)), new Date(getNowTime2())]
},
mounted() {
document.getElementById('topPageName').innerText = '缺陷历史'
// this.$refs.barcode.focus()
this.getTable2()
},
methods: {
forbid(){
//禁止软键盘弹出
document.activeElement.blur();
},
addOqc() {
this.showTableData_content_exchange1 = true
this.occCreateForm.productCode = ''
this.occCreateForm.remake = ''
this.occCreateForm.problemId = ''
this.occCreateForm.problem = ''
},
// 提交
RepairManagementReplaceSubmit() {
this.$refs['occCreateForm'].validate().then(()=>{
const param = []
param[0] = ['产品编号', this.occCreateForm.productCode]
param[1] = ['问题ID', this.occCreateForm.problemId]
param[2] = ['备注', this.occCreateForm.remake]
param[3] = ['记录人', this.userInfo.姓名]
param[4] = ['问题来源', '技术质量']
const Data = this.CreateData('12', 'CATL_OCC_历史_增加', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
if (response.data[0].result === '1') {
Toast.success('问题记录成功!')
this.occCreateForm.remake = ''
this.occCreateForm.problemId = ''
this.occCreateForm.problem = ''
this.showTableData_content_exchange1 = false
} else {
Toast.fail('问题记录失败!')
}
} else {
Toast.fail('问题记录失败!')
}
})
})
},
getTable2() {
this.RepairManagementDataLogTable = []
const param = []
param[0] = ['产品编号', this.barcode]
param[1] = ['开始日期', this.dateTime[0]]
param[2] = ['结束日期', this.dateTime[1]]
param[3] = ['状态', this.statusNumberValue]
param[4] = ['PageCurrent', 1]
param[5] = ['PageSize', 50]
param[6] = ['PageCount', '1111', 'int', '1']
param[7] = ['ItemCount', '1111', 'int', '1']
const Data = this.CreateData('11', 'CATL_OCC_历史_查询_分页_技术质量', param)
this.ExecDatabase(Data).then(response => {
if (response.data.result && response.data.result.length > 0) {
this.RepairManagementDataLogTable = response.data.result
} else {
this.RepairManagementDataLogTable = []
Toast.fail('不存在NC项目')
}
console.log(this.RepairManagementDataLogTable)
})
},
showFile(item) {
const param = []
param[0] = ['ID', item.ID]
const Data = this.CreateData('11', 'CATL_OCC_历史附件列表_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
for (let i = 0; i < response.data.length; i++) {
if(!/\.(jpg|jpeg|png|GIF|JPG|PNG)$/.test(response.data[i]['附件类型'])) {
response.data[i]['url'] = window.URL.createObjectURL(base64ImgtoFile('data:image/png;base64,' + response.data[i]['附件内容']))
}
}
this.RepairManagementDataTableOrigin = response.data
this.showTableData_content_exchange = true
} else {
this.RepairManagementDataTableOrigin = []
}
})
},
showPic(item) {
ImagePreview({
images: [
item.url
]
});
},
afterRead(file){
forms = new FormData()
forms.append("file", file.file); //获取上传图片信息
},
solveNc(row) {
this.showTableData_content_exchange1 = true
this.RepairManagementReplaceForm.ID = row.ID
this.uploader = []
},
reportPicUpload() {
//如果文件列表为空,则不需要调用上传
if(this.uploader == null || this.uploader.length === 0){
return
}
var param = []
param[0] = ['OCC_ID', this.RepairManagementReplaceForm.ID]
param[1] = ['文件名称', '']
param[2] = ['文件后缀', '']
param[3] = ['文件内容', null]
var Data1 = this.CreateData('15', 'CATL_OCC_历史附件_增加', param)
this.Data.param = Data1
axios({
method: "post",
url: window.dt_Config.requestConfig,
params: this.Data,
data: forms,
}).then((res) => {
if(res.status === 200){
Toast.success('附件上传成功!')
this.getTable2()
this.showTableData_content_exchange1 = false
}else{
Toast.fail('附件上传失败!');
}
})
},
confirmFnDate(date) {
this.dateTimeShow = false
this.dateTime=[formatDate(date[0]), formatDate(date[1])]
this.dateTimeShowInfo= this.dateTime[0] + ' ~ ' + this.dateTime[1]
this.getTable2()
}
}
}
</script>
<style scoped>
.app-container{
margin-top: 50px;
}
.dialog-content {
display: flex;
flex-direction: column;
height: 100%;
}
.dialog-header,
.dialog-footer {
position: sticky;
z-index: 10;
}
.dialog-header {
top: 0;
background-color: white;
padding-top: 26px;
font-weight: 500;
line-height: 24px;
text-align: center;
}
.dialog-footer {
bottom: -3px;
background-color: white;
text-align: center;
margin-top: 10px;
display: flex;
}
.scrollable-content {
flex: 1;
overflow-y: auto;
padding: 10px;
}
</style>

View File

@@ -0,0 +1,396 @@
<template>
<div class="app-container">
<el-row>
<div style="display: flex;margin: 20px 0">
<van-field ref="barcode" v-model="barcode" left-icon="scan" clearable style="width: 260px;border-radius: 4px;border:1px solid #DCDFE6;height: 36px;line-height: 18px" />
<van-field v-model="dateTimeShowInfo" left-icon="clock-o" style="width: 270px;border-radius: 4px;border:1px solid #DCDFE6;height: 36px;line-height: 18px" readonly @focus="forbid;dateTimeShow=!dateTimeShow" />
<van-calendar v-model="dateTimeShow" :min-date="minDate" :max-date="maxDate" :default-date="dateTimeDefault" type="range" @confirm="confirmFnDate" />
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px;" @click="getTable2">查询</el-button>
</div>
</el-row>
<el-row style="overflow: auto;height: 730px">
<van-list
v-model="loading_checkOrder"
:finished="true"
finished-text="没有更多了"
>
<van-cell v-for="(item,index) in RepairManagementDataLogTable" :key="index" style="padding: 10px 5px">
<van-card class="s-card">
<template #tags>
<van-row style="font-size: 1.5rem">
<van-tag type="primary" size="large">{{index+1 }}</van-tag>
<van-tag type="success" size="large">{{item.产品编号 }}</van-tag>
<van-tag style="float: right" v-if="item.放行方式 === null" type="warning" size="large">未处理</van-tag>
<van-tag style="float: right" v-if="item.放行方式 === '合格放行'" type="success" size="large">{{item.放行方式 }}</van-tag>
<van-tag style="float: right" v-if="item.放行方式 === '偏差放行'" type="warning" size="large">{{item.放行方式 }}</van-tag>
<van-tag style="float: right" v-if="item.放行方式 === '返工放行'" type="danger" size="large">{{item.放行方式}}</van-tag>
</van-row>
<van-row style="font-size: 1.3rem">
<van-col span="20" style="margin-top: 10px">
<div style="margin: 10px 10px 0 0;">
<van-icon name="contact-o" color="#1989fa"/>
<span>申告人</span>
<span> {{item.记录人 }}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="clock-o" color="#1989fa"/>
<span>申告时间</span>
{{item.记录时间}}
</div>
<!-- <div style="margin: 10px 10px 0 0;">-->
<!-- <van-icon name="comment-o" color="#1989fa"/>-->
<!-- <span>问题项目</span>-->
<!-- {{item.问题项目}}-->
<!-- </div>-->
<div style="margin: 10px 10px 0 0;">
<van-icon name="notes-o" color="#1989fa"/>
<span>申告问题</span>
<span> {{item.备注}}</span>
</div>
</van-col>
<van-col span="4">
<van-button v-if="item.合格放行 === 0" plain icon="completed-o" size="small" type="primary" style="margin-top: 10px" @click="solveNc(item)">申告处理</van-button>
</van-col>
</van-row>
</template>
</van-card>
</van-cell>
</van-list>
</el-row>
<van-dialog
v-model="showTableData_content_exchange"
width="70%"
title="申告处理"
:lock-scroll="false"
:show-cancel-button="false"
:show-confirm-button="false"
style="max-height: 70%!important;overflow: auto"
>
<van-form validate-first ref="form_addCheckOrder">
<!-- 通过 pattern 进行正则校验 -->
<van-field
v-model="RepairManagementReplaceForm.productCode"
label="产品编号"
readonly
name="productCode"
placeholder="产品编号"
/>
<van-field
readonly
clickable
name="area"
:value="RepairManagementReplaceForm.solveType"
label="处理方式"
placeholder="点击选择处理方式"
@click="solveTypeShow = true"
:rules="[{ required: true, message: '请选择处理方式' }]"
/>
<van-field name="uploader" label="照片上传">
<template #input>
<van-uploader v-model="uploader" :after-read="afterRead" :max-count="1" :before-read='beforeRead' />
</template>
</van-field>
<div style="background-color: white;text-align: center;margin-top: 10px;display: flex;">
<van-button type="default" style="width: 100%" @click="addCheckOrder_cancel('form_addCheckOrder')">关闭</van-button>
<van-button type="info" native-type="submit" style="width: 100%" @click="addCheckOrder_sure('form_addCheckOrder')">确定</van-button>
</div>
</van-form>
</van-dialog>
<!-- 增加检查工单的人员选择-->
<van-popup v-model="solveTypeShow" position="bottom">
<van-picker
title="标题"
show-toolbar
:columns="solveTypeList"
@confirm="getSolveType"
@cancel="solveTypeShow = false"
/>
</van-popup>
</div>
</template>
<script>
import {Dialog, Toast} from 'vant'
import axios from 'axios'
import {formatDate, getBeforeOrAfterTime, getNowTime2} from '../../../utils/tool'
let forms = null; //设置公共变量,用来创建 FromData 对象,把文件带到后台
export default {
name: 'RepairManagement',
props: {
pageType: {
type: Number,
default: 0
}
},
data() {
return {
minDate: null,
maxDate: null,
statusNumber: [
{
label: '全部',
value: 9999
},
{
label: '未处理',
value: 0
},
{
label: '已处理',
value: 1
}
],
statusNumberValue: 0,
dateTimeShowInfo: '',
dateTimeShow: false,
dateTimeDefault: [],
dateTime: [],
barcode: '',
loading_checkOrder: false,
RepairManagementDataLogTable: [],
showTableData_content_exchange: false,
Data: {},
RepairManagementReplaceForm: {
ID: 0,
productCode: '',
solveType: '',
solvePeople: ''
},
solveTypeList: ['合格放行','偏差放行','返工放行'],
solveTypeShow: false,
uploader: [],
RepairManagementDataTable: [],
userInfo: '',
showTableData_content: false,
loading_checkOrder_content: false,
RepairManagementMaterialDataTable: [],
loading_checkOrder_content_exchange: false,
RepairType: 1,
currentSelectRow: {},
RepairManagementReplaceDialogVisible: false,
RepairManagementDestroyAllDialogVisible: false,
RepairManagementReplaceRules: {
materialBarCodeNew: [{ required: true, message: '请输入/扫描新物料码!', trigger: 'blur' }]
},
RepairManagementType: '1',
partCode: '',
opCode: '',
opCodeS: [],
stationArr: [],
RepairManagementDataTableOrigin: [],
engineValue: {
OpName: null,
EngineID: null, // 产品编号
EngineType: null, // 产品型号
EngineTypeID: null, // 机型代码
PalletCode: null,
ProcessCode: null, // 程序号
PartPalletCode: null, // 托盘号
PalletInfo: null, // 托盘信息
RepairPartStatusPLC: null,
QualityMask: null,
OrderForm: null, // 订单号
EngineTypeString: null // 产品型号字符串北汽专用
}
}
},
created() {
// 获取今日日期
const today = new Date();
this.minDate = new Date(today.getFullYear(), today.getMonth() - 1, today.getDate());
this.maxDate = new Date(today.getFullYear(), today.getMonth() + 1, today.getDate());
this.userInfo = localStorage.getItem('userInfo') === '' ? {} : JSON.parse(localStorage.getItem('userInfo'))
this.dateTime = [getBeforeOrAfterTime(-7), getNowTime2()]
this.dateTimeShowInfo = this.dateTime[0] + ' ~ ' + this.dateTime[1]
this.dateTimeDefault = [new Date(getBeforeOrAfterTime(-7)), new Date(getNowTime2())]
},
mounted() {
document.getElementById('topPageName').innerText = '申告处理'
this.$refs.barcode.focus()
this.getTable2()
},
methods: {
forbid(){
//禁止软键盘弹出
document.activeElement.blur();
},
getTable2() {
this.RepairManagementDataLogTable = []
const param = []
param[0] = ['产品编号', this.barcode]
param[1] = ['开始日期', this.dateTime[0]]
param[2] = ['结束日期', this.dateTime[1]]
param[3] = ['PageCurrent', 1]
param[4] = ['PageSize', 50]
param[5] = ['PageCount', '1111', 'int', '1']
param[6] = ['ItemCount', '1111', 'int', '1']
const Data = this.CreateData('11', 'CATL_问题申告_处理查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.result && response.data.result.length > 0) {
this.RepairManagementDataLogTable = response.data.result
console.log(this.RepairManagementDataLogTable)
} else {
this.RepairManagementDataLogTable = []
Toast.fail('不存在未处理申告!')
}
})
},
solveNc(row) {
this.showTableData_content_exchange = true
this.RepairManagementReplaceForm.ID = row.ID
this.RepairManagementReplaceForm.productCode = row.产品编号
this.RepairManagementReplaceForm.solvePeople = this.userInfo.姓名
this.uploader = []
},
getSolveType(value) {
this.RepairManagementReplaceForm.solveType = value
this.solveTypeShow = false
},
addCheckOrder_sure(formName) {
this.$refs[formName].validate().then(()=>{
var param = []
param[0] = ['ID', this.RepairManagementReplaceForm.ID]
param[1] = ['放行方式', this.RepairManagementReplaceForm.solveType]
param[2] = ['处理人', this.RepairManagementReplaceForm.solvePeople]
var Data = this.CreateData('12', 'CATL_OCC_历史处理_增加', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
Toast.success('处理成功!')
this.showTableData_content_exchange = false
this.reportPicUpload()
} else {
Toast.fail('处理失败!')
}
})
}).catch(er => {})
},
beforeRead(file) {
const imgformat = /image\/(png|jpg|jpeg)$/;
if (!imgformat.test(file.type)) {
Toast.fail('请上传 jpg/jpeg/png 格式图片');
return false;
}
if (file.size > 20 * 1024 * 1024) {
Toast.fail('文件大小不能超过 20M');
return false;
}
return true
},
afterRead(file){
let canvas = document.createElement('canvas'); // 创建Canvas对象(画布)
let context = canvas.getContext('2d');
let img = new Image();
img.src = file.content; // 指定图片的DataURL(图片的base64编码数据)
img.onload = function () {
// 画布大小 这里的this指向img
canvas.width = this.width;
canvas.height = this.height;
context.drawImage(img, 0, 0, this.width, this.height); // 图片大小
// file.content = canvas.toDataURL(file.file.type, 0.3); // 0.92为默认压缩质量
const dataurl = canvas.toDataURL(file.file.type, 0.5); // 0.92为默认压缩质量
var arr = dataurl.split(','),
mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]),
n = bstr.length,
u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
var fileNew = new File([u8arr], file.file.name, {type: mime});
forms = new FormData()
forms.append("file", fileNew); //获取上传图片信息
};
},
reportPicUpload() {
//如果文件列表为空,则不需要调用上传
if(this.uploader == null || this.uploader.length === 0){
this.getTable2()
return
}
var param = []
param[0] = ['OCC_ID', this.RepairManagementReplaceForm.ID]
param[1] = ['文件名称', '']
param[2] = ['文件后缀', '']
param[3] = ['文件内容', null]
var Data1 = this.CreateData('15', 'CATL_OCC_历史附件_增加', param)
this.Data.param = Data1
axios({
method: "post",
url: window.dt_Config.requestConfig,
params: this.Data,
data: forms,
}).then((res) => {
if(res.status === 200){
Toast.success('附件上传成功!');
this.showTableData_content_exchange = false
this.getTable2()
}else{
Toast.fail('附件上传失败!');
}
})
},
addCheckOrder_cancel(formName) {
this.showTableData_content_exchange = false
this.$refs[formName].resetValidation()
},
confirmFnDate(date) {
this.dateTimeShow = false
this.dateTime=[formatDate(date[0]), formatDate(date[1])]
this.dateTimeShowInfo= this.dateTime[0] + ' ~ ' + this.dateTime[1]
this.getTable2()
},
}
}
</script>
<style scoped>
.app-container{
margin-top: 50px;
}
.dialog-content {
display: flex;
flex-direction: column;
height: 100%;
}
.dialog-header,
.dialog-footer {
position: sticky;
z-index: 10;
}
.dialog-header {
top: 0;
background-color: white;
padding-top: 26px;
font-weight: 500;
line-height: 24px;
text-align: center;
}
.dialog-footer {
bottom: -3px;
background-color: white;
text-align: center;
margin-top: 10px;
display: flex;
}
.scrollable-content {
flex: 1;
overflow-y: auto;
padding: 10px;
}
</style>