Commit 7286e169 authored by Hagsn3's avatar Hagsn3

提交

parent aff410aa
......@@ -14,7 +14,7 @@
<div class="scanDiv">
<el-button class="scanCode" type="primary" @click="scanCodes">扫码</el-button>
</div>
<div class="fontSp">单号: {{ inspectInfoList.jcCode }}</div>
<div class="fontSp">单号: {{ inspectInfoList.jcCode }}</div>
</div>
<!-- 下方表格-->
<div class="oneForm">
......@@ -62,7 +62,9 @@
<el-form-item label="厂家:" prop="jcCj">
<el-input
v-model="inspectInfoList.jcCj"
:disabled="(this.controlsForm.controls == '1' && this.controlsForm.approveStatus === '1') || (controlsForm.controls ==='3'&&controlsForm.approveStatus === '9' )"
:disabled="(this.controlsForm.controls=='3'&&this.controlsForm.approveStatus=='1')
||(this.controlsForm.controls == '1' && this.controlsForm.approveStatus === '1') ||
(controlsForm.controls ==='3'&&controlsForm.approveStatus === '9' )"
class="normalInput"
/>
<!-- <el-button class="scanCode" type="primary" @click="scanCodes">扫码</el-button>-->
......@@ -107,8 +109,8 @@
<!-- 检查内容-->
<div class="recordOneContainer">
<div class="inspectionStandards">
<el-form :model="inspectJbAl2o3List">
<el-form-item label="检验标准1:" label-width="80">
<el-form ref="inspectJbAl2o3List" :model="inspectJbAl2o3List" :rules="rules">
<el-form-item label="检验标准1:" label-width="80" prop="standardOne">
<el-input
v-model="inspectJbAl2o3List.standardOne"
class="inspectionStandardsInput"
......@@ -135,7 +137,7 @@
:disabled="controlsForm.controls ==='1'&& controlsForm.approveStatus ==='1'|| (controlsForm.controls == '3' && controlsForm.approveStatus === '1') || (controlsForm.controls ==='3'&&controlsForm.approveStatus === '9' )"
@input="handleData1Input(index)"
/>
<el-button class="clearButton" type="danger" icon="el-icon-delete" circle @click="clearForm(index)" />
<el-button class="clearButton" icon="el-icon-delete" circle @click="clearForm(index)" />
</div>
<div class="Value">{{ item.differenceValue }}</div>
<div class="averageValue">{{ item.differenceValue1 }}</div>
......@@ -157,8 +159,8 @@
<!-- 检查内容-->
<div class="recordOneContainer">
<div class="inspectionStandards">
<el-form :model="inspectJbAl2o3List">
<el-form-item label="检验标准2:" label-width="80">
<el-form ref="inspectJbAl2o3List" :model="inspectJbAl2o3List" :rules="rules">
<el-form-item label="检验标准2:" label-width="80" prop="standardTwo">
<el-input
v-model="inspectJbAl2o3List.standardTwo"
:disabled="controlsForm.controls ==='1'&& controlsForm.approveStatus ==='1'
......@@ -186,7 +188,12 @@
|| (controlsForm.controls == '3' && controlsForm.approveStatus === '1') || (controlsForm.controls ==='3'&&controlsForm.approveStatus === '9' )"
@input="handleData2Input(index)"
/>
<el-button class="clearButton" type="danger" icon="el-icon-delete" circle @click="clearInspectionFormTwo(index)" />
<el-button
class="clearButton"
icon="el-icon-delete"
circle
@click="clearInspectionFormTwo(index)"
/>
</div>
<div class="Value">{{ item.differenceValue }}</div>
<div class="averageValue">{{ item.differenceValue1 }}</div>
......@@ -216,8 +223,8 @@
<!-- 检查内容-->
<div class="recordOneContainer">
<div class="inspectionStandards">
<el-form :model="inspectJbAl2o3List">
<el-form-item label="检验标准1:" label-width="80">
<el-form ref="inspectJbAl2o3List" :model="inspectJbAl2o3List" :rules="rules">
<el-form-item label="检验标准1:" label-width="80" prop="limitOne">
<el-input
v-model="inspectJbAl2o3List.limitOne"
class="inspectionStandardsInput"
......@@ -227,8 +234,8 @@
/>
</el-form-item>
</el-form>
<el-form :model="inspectJbAl2o3List">
<el-form-item label="检验标准2:" label-width="80">
<el-form ref="inspectJbAl2o3List" :model="inspectJbAl2o3List" :rules="rules">
<el-form-item label="检验标准2:" label-width="80" prop="limitTwo">
<el-input
v-model="inspectJbAl2o3List.limitTwo"
class="inspectionStandardsInput"
......@@ -254,7 +261,12 @@
|| (controlsForm.controls == '3' &&controlsForm.approveStatus === '1') || (controlsForm.controls ==='3'&&controlsForm.approveStatus === '9' )"
@input="handleData3Input(index)"
/>
<el-button class="clearButton" type="danger" icon="el-icon-delete" circle @click="clearInspectionFormThree(index)" />
<el-button
class="clearButton"
icon="el-icon-delete"
circle
@click="clearInspectionFormThree(index)"
/>
</div>
<div class="Value">{{ item.differenceValue }}</div>
</div>
......@@ -477,11 +489,14 @@
:src="item.url"
fit="full"
:preview-src-list="item.srcList"
:Viewer-init-scale="1.5"
:viewer-init-scale="1.5"
@click.stop="handleClickStop(index)"
/>
<!-- 按钮区 -->
<div v-if="!((controlsForm.controls ==='1'&& controlsForm.approveStatus ==='1')||(controlsForm.controls ==='3'&& controlsForm.approveStatus ==='1') || (controlsForm.controls ==='3'&&controlsForm.approveStatus === '9' ))" class="OneElImgButton">
<div
v-if="!((controlsForm.controls ==='1'&& controlsForm.approveStatus ==='1')||(controlsForm.controls ==='3'&& controlsForm.approveStatus ==='1') || (controlsForm.controls ==='3'&&controlsForm.approveStatus === '9' ))"
class="OneElImgButton"
>
<div>
<el-button type="primary" icon="el-icon-upload" circle @click="downloadImage(item)" />
</div>
......@@ -569,8 +584,12 @@
<el-button class="buttoon" type="primary" @click="submitControl">保存</el-button>
<el-button class="buttoon" type="primary" @click="present">提交</el-button>
</div>
<div v-if="(controlsForm.controls ==='3'&& controlsForm.approveStatus ==='1') || (controlsForm.controls ==='3'&&controlsForm.approveStatus === '9' )" class="submitButton">
<el-button class="buttoon" type="primary" @click="back">返回</el-button></div>
<div
v-if="(controlsForm.controls ==='3'&& controlsForm.approveStatus ==='1') || (controlsForm.controls ==='3'&&controlsForm.approveStatus === '9' )"
class="submitButton"
>
<el-button class="buttoon" type="primary" @click="back">返回</el-button>
</div>
<div v-if="(controlsForm.controls ==='1'&& controlsForm.approveStatus ==='1')" class="submitButton">
<el-button class="buttoon" type="primary" @click="approve">同意</el-button>
<el-button class="buttoon" type="primary" @click="reject">驳回</el-button>
......@@ -609,7 +628,23 @@ export default {
}],
jcFacadeBl: [{
required: true, message: '请输入不良', trigger: 'blur'
}]
}],
standardOne: [
{ required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d+)?$/, message: '请输入有效的数字', trigger: 'change' }
],
standardTwo: [
{ required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d+)?$/, message: '请输入有效的数字', trigger: 'change' }
],
limitOne: [
{ required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d+)?$/, message: '请输入有效的数字', trigger: 'change' }
],
limitTwo: [
{ required: true, message: '请输入检验标准', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)(\.\d+)?$/, message: '请输入有效的数字', trigger: 'change' }
]
},
controlsForm: {
......@@ -764,13 +799,16 @@ export default {
methods: {
/** 清空表格里的数据*/
clearForm(index) {
this.recode1[index].recordData = undefined
this.recode1[index].recordData = ''
this.handleData1Input(index)
},
clearInspectionFormTwo(index) {
this.recode2[index].recordData = undefined
this.recode2[index].recordData = ''
this.handleData2Input(index)
},
clearInspectionFormThree(index) {
this.recode3[index].recordData = undefined
this.recode3[index].recordData = ''
this.handleData3Input(index)
},
/* 表单1的计算方法*/
handleData1Input(index) {
......@@ -780,16 +818,16 @@ export default {
if (index > 0 && this.recode1[index].recordData !== '' && this.recode1[index - 1].recordData !== '') {
const num1 = parseFloat(this.recode1[index - 1].recordData)
const num2 = parseFloat(this.recode1[index].recordData)
this.recode1[index].differenceValue = Math.abs(num1 - num2).toFixed(2)
this.recode1[index].differenceValue1 = ((num1 + num2) / 2).toFixed(2)
this.recode1[index].differenceValue = Math.abs(num1 - num2).toFixed(8)
this.recode1[index].differenceValue1 = ((num1 + num2) / 2).toFixed(8)
}
if (index < 9 && this.recode1[index].recordData !== '' && this.recode1[index + 1].recordData !== '') {
const num1 = parseFloat(this.recode1[index + 1].recordData)
const num2 = parseFloat(this.recode1[index].recordData)
this.recode1[index + 1].differenceValue = Math.abs(num1 - num2).toFixed(2)
this.recode1[index + 1].differenceValue1 = ((num1 + num2) / 2).toFixed(2)
this.recode1[index + 1].differenceValue = Math.abs(num1 - num2).toFixed(8)
this.recode1[index + 1].differenceValue1 = ((num1 + num2) / 2).toFixed(8)
}
if (this.recode1[index].recordData === '') {
if (index < 9 && this.recode1[index].recordData === '') {
this.recode1[index].differenceValue = ''
this.recode1[index + 1].differenceValue = ''
this.recode1[index].differenceValue1 = ''
......@@ -806,16 +844,16 @@ export default {
if (index > 0 && this.recode2[index].recordData !== '' && this.recode2[index - 1].recordData !== '') {
const num1 = parseFloat(this.recode2[index - 1].recordData)
const num2 = parseFloat(this.recode2[index].recordData)
this.recode2[index].differenceValue = Math.abs(num1 - num2).toFixed(2)
this.recode2[index].differenceValue1 = ((num1 + num2) / 2).toFixed(2)
this.recode2[index].differenceValue = Math.abs(num1 - num2).toFixed(8)
this.recode2[index].differenceValue1 = ((num1 + num2) / 2).toFixed(8)
}
if (index < 9 && this.recode2[index].recordData !== '' && this.recode2[index + 1].recordData !== '') {
const num1 = parseFloat(this.recode2[index + 1].recordData)
const num2 = parseFloat(this.recode2[index].recordData)
this.recode2[index + 1].differenceValue = Math.abs(num1 - num2).toFixed(2)
this.recode2[index + 1].differenceValue1 = ((num1 + num2) / 2).toFixed(2)
this.recode2[index + 1].differenceValue = Math.abs(num1 - num2).toFixed(8)
this.recode2[index + 1].differenceValue1 = ((num1 + num2) / 2).toFixed(8)
}
if (this.recode2[index].recordData === '') {
if (index < 9 && this.recode2[index].recordData === '') {
this.recode2[index].differenceValue = ''
this.recode2[index + 1].differenceValue = ''
this.recode2[index].differenceValue1 = ''
......@@ -829,14 +867,14 @@ export default {
if (index > 0 && this.recode3[index].recordData !== '' && this.recode3[index - 1].recordData !== '') {
const num1 = parseFloat(this.recode3[index - 1].recordData)
const num2 = parseFloat(this.recode3[index].recordData)
this.recode3[index].differenceValue = Math.abs(num1 - num2).toFixed(2)
this.recode3[index].differenceValue = Math.abs(num1 - num2).toFixed(8)
}
if (index < 9 && this.recode3[index].recordData !== '' && this.recode3[index + 1].recordData !== '') {
if (index < 14 && this.recode3[index].recordData !== '' && this.recode3[index + 1].recordData !== '') {
const num1 = parseFloat(this.recode3[index + 1].recordData)
const num2 = parseFloat(this.recode3[index].recordData)
this.recode3[index + 1].differenceValue = Math.abs(num1 - num2).toFixed(2)
this.recode3[index + 1].differenceValue = Math.abs(num1 - num2).toFixed(8)
}
if (this.recode3[index].recordData === '') {
if (index < 14 && this.recode3[index].recordData === '') {
this.recode3[index].differenceValue = ''
this.recode3[index + 1].differenceValue = ''
}
......@@ -952,9 +990,16 @@ export default {
this.inspectJbAl2o3List.wgTf = response.data.wgTf
this.inspectJbAl2o3List.limitData = response.data.limitData
this.inspectJbAl2o3List.ossId = response.data.ossId
this.getRecordList(this.inspectJbAl2o3List.standardOneData.split(','))
this.getRecordTwoList(this.inspectJbAl2o3List.standardTwoData.split(','))
this.getRecordThreeList(this.inspectJbAl2o3List.limitData.split(','))
if (this.inspectJbAl2o3List.standardOneData && this.inspectJbAl2o3List.standardOneData.length > 0) {
this.getRecordList(this.inspectJbAl2o3List.standardOneData.split(','))
}
if (this.inspectJbAl2o3List.standardTwoData && this.inspectJbAl2o3List.standardTwoData.length > 0) {
this.getRecordTwoList(this.inspectJbAl2o3List.standardTwoData.split(','))
}
if (this.inspectJbAl2o3List.limitData && this.inspectJbAl2o3List.limitData.length > 0) {
this.getRecordThreeList(this.inspectJbAl2o3List.limitData.split(','))
}
/** 审批信息**/
this.inspectInfoList.approveStatus = response.data.approveStatus
this.inspectsForm.approveUser = response.data.nickName
......@@ -964,23 +1009,23 @@ export default {
},
// 数组1
getRecordList(list1) {
for (let i = 0; i < 10; i++) {
for (let i = 0; i < list1.length; i++) {
this.recode1[i].recordData = list1[i]
this.handleData1Input(i)
}
},
// 数组2
getRecordTwoList(list1) {
for (let i = 0; i < 10; i++) {
for (let i = 0; i < list1.length; i++) {
this.recode2[i].recordData = list1[i]
this.handleData2Input(i)
}
},
// 数组3
getRecordThreeList(list1) {
for (let i = 0; i < 10; i++) {
for (let i = 0; i < list1.length; i++) {
this.recode3[i].recordData = list1[i]
this.handleData3Input[i]
this.handleData3Input(i)
}
},
judgmentParam() {
......@@ -1457,31 +1502,40 @@ export default {
})
},
present() {
// const middleForm = this.$refs.inspectJbAl2o3List.validate()
// const topForm = this.$refs.ruleForm.validate()
// // Promise.all(topForm, middleForm).then(results => {
// const valid = results.every(result => result)
// })
this.$refs.ruleForm.validate(vaild => {
if (vaild) {
this.inspectJbAl2o3List.standardOneData = this.getStringByArray(this.recode1)
this.inspectJbAl2o3List.standardTwoData = this.getStringByArray(this.recode2)
this.inspectJbAl2o3List.limitData = this.getStringByArray(this.recode3)
this.inspectInfoList.approveStatus = '1'
let ossIdList = this.getOssIdList()
var obj = {
incomeInspectInfo: this.inspectInfoList,
incomeInspectJbAl2o3: this.inspectJbAl2o3List,
ossIdList: ossIdList
}
console.log('obj', obj)
addIncomeInspectInfo(obj).then(response => {
console.log('re', response)
if (response.code === 200) {
this.msgSuccess('提交成功')
this.resetInspectInfo()
this.resetinspectJbAl2o3List()
this.resetRecord()
this.controlsForm.approveStatus = '0'
this.controlsForm.controls = '2'
this.$refs.inspectJbAl2o3List.validate(iJbA => {
if (vaild && iJbA) {
this.inspectJbAl2o3List.standardOneData = this.getStringByArray(this.recode1)
this.inspectJbAl2o3List.standardTwoData = this.getStringByArray(this.recode2)
this.inspectJbAl2o3List.limitData = this.getStringByArray(this.recode3)
this.inspectInfoList.approveStatus = '1'
let ossIdList = this.getOssIdList()
var obj = {
incomeInspectInfo: this.inspectInfoList,
incomeInspectJbAl2o3: this.inspectJbAl2o3List,
ossIdList: ossIdList
}
})
}
console.log('obj', obj)
addIncomeInspectInfo(obj).then(response => {
console.log('re', response)
if (response.code === 200) {
this.msgSuccess('提交成功')
this.resetInspectInfo()
this.resetinspectJbAl2o3List()
this.resetRecord()
this.controlsForm.approveStatus = '0'
this.controlsForm.controls = '2'
}
})
} else {
this.$message.error('请输入正确信息')
}
})
})
},
back() {
......@@ -1629,9 +1683,10 @@ export default {
<style scoped lang="scss">
.CheckBobyList {
::v-deep .el-image-viewer__img{
::v-deep .el-image-viewer__img {
min-width: 80% !important;
}
.el-dialog__wrapper {
background-color: rgba(0, 0, 0, 0.5);
}
......@@ -1749,6 +1804,7 @@ export default {
width: 43%;
margin-left: 4%;
}
.fontSp {
margin-left: 43%;
height: 28px;
......@@ -1990,7 +2046,10 @@ export default {
display: flex;
margin-left: 3%;
width: 25%;
.clearButton{
.clearButton {
background-color: transparent;
border: none;
margin-left: 6px;
}
}
......@@ -2019,12 +2078,14 @@ export default {
width: 25%;
margin-left: 3%;
height: 32px;
border: 1px solid #d9d9d9;
border-radius: 4px;
display: flex;
.clearButton{
margin-left: 6px;
}
.clearButton {
background-color: transparent;
border: none;
margin-left: 6px;
}
}
.Value {
......@@ -2101,7 +2162,10 @@ export default {
display: flex;
margin-left: 3%;
width: 27%;
.clearButton{
.clearButton {
background-color: transparent;
border: none;
margin-left: 6px;
}
}
......@@ -2130,10 +2194,12 @@ export default {
width: 27.5%;
margin-left: 3%;
height: 32px;
border: 1px solid #d9d9d9;
border-radius: 4px;
display: flex;
.clearButton{
.clearButton {
background-color: transparent;
border: none;
margin-left: 6px;
}
}
......@@ -2160,7 +2226,7 @@ export default {
text-align: LEFT;
color: #0057ff;
margin-left: 15%;
margin-top: -2%;
margin-top: -3%;
}
......@@ -2376,9 +2442,12 @@ export default {
display: flex;
margin-left: 3%;
width: 25%;
.clearButton{
margin-left: 6px;
}
.clearButton {
margin-left: 6px;
background-color: transparent;
border: none;
}
}
}
......@@ -2404,10 +2473,12 @@ export default {
width: 25%;
margin-left: 3%;
height: 32px;
border: 1px solid #d9d9d9;
border-radius: 4px;
display: flex;
.clearButton{
.clearButton {
background-color: transparent;
border: none;
margin-left: 6px;
}
}
......@@ -2434,7 +2505,7 @@ export default {
text-align: LEFT;
color: #0057ff;
margin-left: 15%;
margin-top: -4%;
margin-top: -3%;
}
......
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