init
This commit is contained in:
214
src/pages/xinrui/inspection/ProcedureInspection.vue
Normal file
214
src/pages/xinrui/inspection/ProcedureInspection.vue
Normal file
@@ -0,0 +1,214 @@
|
||||
<template>
|
||||
<section>
|
||||
<nav-bar title="工序质检"></nav-bar>
|
||||
<section class="content mgt186" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="0" infinite-scroll-immediate-check="false">
|
||||
<div class="filter-wraper">
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="filter-label txtjustify">物料</div>
|
||||
<div class="fxcol mgl20">
|
||||
<input type="text" class="filter-input filter-scan-input" placeholder="产品编码" v-model="val1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="filter-label txtjustify">批次</div>
|
||||
<div class="fxcol mgl20">
|
||||
<input type="text" class="filter-input filter-scan-input" placeholder="批次号" v-model="val2">
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="filter-label txtjustify">工序</div>
|
||||
<div class="fxcol mgl20 visible" >
|
||||
<dropdown-menu
|
||||
:option="option"
|
||||
:active="active"
|
||||
:open="open"
|
||||
@toggleItem="toggleItem"
|
||||
@dropdownMenu="dropdownMenu">
|
||||
</dropdown-menu>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="filter-label txtjustify">设备</div>
|
||||
<div class="fxcol mgl20">
|
||||
<input type="text" class="filter-input filter-scan-input" v-model="val3">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-wraper">
|
||||
<div class="left_fixed">
|
||||
<table class="layout-t left_layout_t">
|
||||
<tr>
|
||||
<th>质检单号</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.inspection_id" @click="toCheck(e)" :class="{'checked': e.inspection_id === pkId}">
|
||||
<td>{{e.inspection_code}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="slide">
|
||||
<table class="layout-t">
|
||||
<tr>
|
||||
<th>物料</th>
|
||||
<th>批次</th>
|
||||
<th>状态</th>
|
||||
<th>结果</th>
|
||||
<th>工序</th>
|
||||
<th>设备</th>
|
||||
<th>备注</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.inspection_id" @click="toCheck(e)" :class="{'checked': e.inspection_id === pkId}">
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<td>{{e.bill_status_name}}</td>
|
||||
<td>{{e.result_name}}</td>
|
||||
<td>{{e.workprocedure_name}}</td>
|
||||
<td>{{e.device_name}}</td>
|
||||
<td>{{e.remark}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="loading-tips">{{desc}}</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<button class="btn submit-button" @click="_queryWorkProcedureMst">查询</button>
|
||||
<button class="btn submit-button" @click="toInput">结果录入</button>
|
||||
<button class="btn submit-button" :disabled="disabled" :class="{'btn-disabled': pkId === ''}" @click="toSure">确认</button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import DropdownMenu from '@components/DropdownMenu.vue'
|
||||
import {queryWorkProcedureMst, queryWorkProducedure, inspectSure} from '@config/getData2.js'
|
||||
export default {
|
||||
name: 'ProcedureInspection',
|
||||
components: {
|
||||
NavBar,
|
||||
DropdownMenu
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
val1: '',
|
||||
val2: '',
|
||||
val3: '',
|
||||
dataList: [],
|
||||
option: [],
|
||||
active: '',
|
||||
open: false,
|
||||
page: 1,
|
||||
size: '10',
|
||||
busy: false,
|
||||
desc: '',
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
disabled: false
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this._queryWorkProducedure()
|
||||
},
|
||||
beforeRouteLeave (to, from, next) {
|
||||
if (to.path === '/home') {
|
||||
this.$store.dispatch('setKeepAlive', [])
|
||||
}
|
||||
next()
|
||||
},
|
||||
activated () {},
|
||||
methods: {
|
||||
toggleItem () {
|
||||
if (!this.open) {
|
||||
this.open = true
|
||||
} else {
|
||||
this.open = false
|
||||
}
|
||||
},
|
||||
dropdownMenu (i) {
|
||||
this.active = i + ''
|
||||
this.open = false
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId !== e.inspection_id ? e.inspection_id : ''
|
||||
this.pkObj = this.pkId === e.inspection_id ? e : {}
|
||||
},
|
||||
async _queryWorkProducedure () {
|
||||
let res = await queryWorkProducedure()
|
||||
if (res.code === '1') {
|
||||
this.option = res.results
|
||||
this.option.map(el => {
|
||||
this.$set(el, 'value', el.workprocedure_id)
|
||||
this.$set(el, 'label', el.workprocedure_name)
|
||||
})
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
async _queryWorkProcedureMst () {
|
||||
this.page = 1
|
||||
this.busy = false
|
||||
this.desc = ''
|
||||
let res = await queryWorkProcedureMst(this.val1, this.active !== '' ? this.option[this.active].workprocedure_id : '', this.val3, this.val2, this.page + '', this.size)
|
||||
if (res.code === '1') {
|
||||
this.dataList = []
|
||||
this.dataList = [...res.rows]
|
||||
if (res.rows.length < 10) {
|
||||
this.busy = true
|
||||
this.desc = '已加载全部数据'
|
||||
}
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
this.desc = res.desc
|
||||
}
|
||||
},
|
||||
async loadMore () {
|
||||
this.busy = true
|
||||
this.page++
|
||||
let res = await queryWorkProcedureMst(this.val1, this.active !== '' ? this.option[this.active].workprocedure_id : '', this.val3, this.val2, this.page + '', this.size)
|
||||
if (res.code === '1') {
|
||||
this.dataList = [...this.dataList, ...res.rows]
|
||||
if (res.rows.length < 10) {
|
||||
this.busy = true
|
||||
this.desc = '已加载全部数据'
|
||||
} else {
|
||||
this.busy = false
|
||||
}
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
this.desc = res.desc
|
||||
}
|
||||
},
|
||||
toInput () {
|
||||
this.$store.dispatch('materObj1', this.pkObj)
|
||||
this.$store.dispatch('setKeepAlive', ['ProcedureInspection', 'ResultEntry'])
|
||||
this.$router.push('/ResultEntry')
|
||||
},
|
||||
async _inspectSure () {
|
||||
try {
|
||||
let res = await inspectSure(this.pkId)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
this._queryWorkProcedureMst()
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
toSure () {
|
||||
this.disabled = true
|
||||
if (this.pkId) {
|
||||
this._inspectSure()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
>>>.content
|
||||
height calc(100% - 1.96rem)
|
||||
overflow-y auto
|
||||
</style>
|
||||
133
src/pages/xinrui/inspection/RawMaterInspection.vue
Normal file
133
src/pages/xinrui/inspection/RawMaterInspection.vue
Normal file
@@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<section>
|
||||
<nav-bar title="原材料质检"></nav-bar>
|
||||
<section class="content mgt186" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="0" infinite-scroll-immediate-check="false">
|
||||
<div class="filter-wraper">
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="filter-label txtjustify">物料</div>
|
||||
<div class="fxcol mgl20">
|
||||
<input type="text" class="filter-input filter-scan-input" v-model="val1" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="filter-label txtjustify">批次号</div>
|
||||
<div class="fxcol mgl20">
|
||||
<input type="text" class="filter-input filter-scan-input" v-model="val2" disabled>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-wraper">
|
||||
<div class="left_fixed">
|
||||
<table class="layout-t left_layout_t">
|
||||
<tr>
|
||||
<th>质检单号</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.inspection_id" @click="toCheck(e)" :class="{'checked': e.inspection_id === pkId}">
|
||||
<td>{{e.inspection_code}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="slide">
|
||||
<table class="layout-t">
|
||||
<tr>
|
||||
<th>物料编码</th>
|
||||
<th>物料名称</th>
|
||||
<th>批次</th>
|
||||
<th>状态</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.inspection_id" @click="toCheck(e)" :class="{'checked': e.inspection_id === pkId}">
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.pcsn}}</td>
|
||||
<td>{{e.bill_status_name}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="loading-tips">{{desc}}</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" @click="toInner">拍照</button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import {queryFactoryWarrantyMst} from '@config/getData2.js'
|
||||
export default {
|
||||
name: 'RawMaterInspection',
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
val1: '',
|
||||
val2: '',
|
||||
dataList: [],
|
||||
page: 1,
|
||||
size: '10',
|
||||
busy: false,
|
||||
desc: '',
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this._queryFactoryWarrantyMst()
|
||||
},
|
||||
methods: {
|
||||
async _queryFactoryWarrantyMst () {
|
||||
this.page = 1
|
||||
let res = await queryFactoryWarrantyMst(this.page + '', this.size)
|
||||
if (res.code === '1') {
|
||||
this.dataList = []
|
||||
this.dataList = [...res.rows]
|
||||
if (res.rows.length < 10) {
|
||||
this.busy = true
|
||||
this.desc = '已加载全部数据'
|
||||
}
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
this.desc = res.desc
|
||||
}
|
||||
},
|
||||
async loadMore () {
|
||||
this.busy = true
|
||||
this.page++
|
||||
let res = await queryFactoryWarrantyMst(this.page + '', this.size)
|
||||
if (res.code === '1') {
|
||||
this.dataList = [...this.dataList, ...res.rows]
|
||||
if (res.rows.length < 10) {
|
||||
this.busy = true
|
||||
this.desc = '已加载全部数据'
|
||||
} else {
|
||||
this.busy = false
|
||||
}
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
this.desc = res.desc
|
||||
}
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId !== e.inspection_id ? e.inspection_id : ''
|
||||
this.pkObj = this.pkId === e.inspection_id ? e : ''
|
||||
this.val1 = this.pkId === e.inspection_id ? e.material_name : ''
|
||||
this.val2 = this.pkId === e.inspection_id ? e.pcsn : ''
|
||||
},
|
||||
toInner () {
|
||||
if (this.pkId === '') {
|
||||
return
|
||||
}
|
||||
this.$store.dispatch('materObj', this.pkObj)
|
||||
this.$router.push('/UploadPict')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
>>>.content
|
||||
height calc(100% - 1.96rem)
|
||||
overflow-y auto
|
||||
</style>
|
||||
408
src/pages/xinrui/inspection/ResultEntry.vue
Normal file
408
src/pages/xinrui/inspection/ResultEntry.vue
Normal file
@@ -0,0 +1,408 @@
|
||||
<template>
|
||||
<section>
|
||||
<nav-bar :inner2="true" @goIn="goIn" title="质检结果录入"></nav-bar>
|
||||
<section class="content mgt186">
|
||||
<div class="filter-wraper">
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="filter-label txtjustify">物料</div>
|
||||
<div class="fxcol mgl20">
|
||||
<input type="text" class="filter-input filter-scan-input" :disabled="disabled" v-model="val1" @click="addMater">
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="filter-label txtjustify">批次</div>
|
||||
<div class="fxcol mgl20">
|
||||
<input type="text" class="filter-input filter-scan-input" :disabled="disabled" v-model="val2">
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="filter-label txtjustify">工序</div>
|
||||
<div class="fxcol mgl20 visible" >
|
||||
<dropdown-menu
|
||||
:option="option"
|
||||
:active="active"
|
||||
:open="open"
|
||||
:disabled="toggle"
|
||||
@toggleItem="toggleItem"
|
||||
@dropdownMenu="dropdownMenu">
|
||||
</dropdown-menu>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="filter-label txtjustify">设备</div>
|
||||
<div class="fxcol mgl20">
|
||||
<input type="text" class="filter-input filter-scan-input" :disabled="disabled" v-model="val3" @click="addEquip">
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="filter-label txtjustify">结果</div>
|
||||
<div class="fxcol mgl20 visible" >
|
||||
<dropdown-menu
|
||||
:option="option1"
|
||||
:active="active1"
|
||||
:open="open1"
|
||||
:disabled="toggle1"
|
||||
@toggleItem="toggleItem1"
|
||||
@dropdownMenu="dropdownMenu1">
|
||||
</dropdown-menu>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="filter-label txtjustify">等级</div>
|
||||
<div class="fxcol mgl20 visible" >
|
||||
<dropdown-menu
|
||||
:option="option2"
|
||||
:active="active2"
|
||||
:open="open2"
|
||||
@toggleItem="toggleItem2"
|
||||
@dropdownMenu="dropdownMenu2">
|
||||
</dropdown-menu>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-filter-tip">
|
||||
<div class="filter-label txtjustify">备注</div>
|
||||
<div class="fxcol mgl20">
|
||||
<input type="text" class="filter-input filter-scan-input" v-model="val4">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-wraper">
|
||||
<div class="left_fixed">
|
||||
<table class="layout-t left_layout_t">
|
||||
<tr>
|
||||
<th>项点编码</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.inspection_item_id">
|
||||
<td>{{e.inspection_item_code}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="slide">
|
||||
<table class="layout-t">
|
||||
<tr>
|
||||
<th>项点名称</th>
|
||||
<th>检测值</th>
|
||||
<th>标准上限</th>
|
||||
<th>标准下限</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.inspection_item_id">
|
||||
<td>{{e.inspection_item_name}}</td>
|
||||
<!-- <td><input-number :min="0 + ''" v-model="e.testing_value"/></td> -->
|
||||
<td><input type="number" class="sin_input" :class="{'bred': e.bred === true}" v-model="e.testing_value" @focus="handleFocus(e)" @blur="handleBlur(e)"></td>
|
||||
<td>{{e.up_limit_value | numeric(4)}}</td>
|
||||
<td>{{e.down_limit_value | numeric(4)}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="submit-bar">
|
||||
<button class="btn submit-button" :class="{'btn-disabled': dataList.length === 0}" @click="calculate">计算</button>
|
||||
<button class="btn submit-button" :disabled="disabled1" :class="{'btn-disabled': sure === false}" @click="toSure">保存</button>
|
||||
</section>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@components/NavBar.vue'
|
||||
import DropdownMenu from '@components/DropdownMenu.vue'
|
||||
import InputNumber from '@components/InputNumber.vue'
|
||||
import {queryWorkProducedure, queryInspection, inspectConfirm, updateWorkStatus} from '@config/getData2.js'
|
||||
export default {
|
||||
name: 'ResultEntry',
|
||||
components: {
|
||||
NavBar,
|
||||
DropdownMenu,
|
||||
InputNumber
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
val1: '',
|
||||
val2: '',
|
||||
val3: '',
|
||||
val4: '',
|
||||
dataList: [],
|
||||
option: [],
|
||||
active: '',
|
||||
open: false,
|
||||
toggle: JSON.stringify(this.$store.getters.materObj1) !== '{}',
|
||||
option1: [{value: '01', label: '合格'}, {value: '02', label: '不合格'}, {value: '03', label: '紧急放行'}],
|
||||
active1: '',
|
||||
open1: false,
|
||||
toggle1: JSON.stringify(this.$store.getters.materObj1) !== '{}',
|
||||
option2: [{value: '01', label: '一级'}, {value: '02', label: '二级'}, {value: '03', label: '三级'}],
|
||||
active2: '',
|
||||
open2: false,
|
||||
disabled: JSON.stringify(this.$store.getters.materObj1) !== '{}',
|
||||
disabled1: false,
|
||||
device_id: '',
|
||||
sure: false
|
||||
}
|
||||
},
|
||||
beforeRouteLeave (to, from, next) {
|
||||
if (to.path === '/ProcedureInspection') {
|
||||
this.$store.dispatch('setKeepAlive', ['ProcedureInspection'])
|
||||
this.$store.dispatch('materObj1', '')
|
||||
this.$store.dispatch('materObj', '')
|
||||
}
|
||||
next()
|
||||
},
|
||||
activated () {
|
||||
if (this.$route.query.eid !== '' && this.$route.query.eid !== undefined) {
|
||||
this.val3 = this.$route.query.ename
|
||||
this.device_id = this.$route.query.eid
|
||||
}
|
||||
if (this.$store.getters.materObj !== '') {
|
||||
this.val1 = this.$store.getters.materObj.material_code
|
||||
this._queryInspection('', this.$store.getters.materObj.material_id, this.$store.getters.materObj.workprocedure_uuid)
|
||||
}
|
||||
this.sure = false
|
||||
},
|
||||
created () {
|
||||
this._queryWorkProducedure()
|
||||
if (JSON.stringify(this.$store.getters.materObj1) !== '{}') {
|
||||
this.val1 = this.$store.getters.materObj1.material_code
|
||||
this.val2 = this.$store.getters.materObj1.pcsn
|
||||
this.val3 = this.$store.getters.materObj1.device_name
|
||||
this.val4 = this.$store.getters.materObj1.remark
|
||||
this.option1.map((el, i) => {
|
||||
if (el.value === this.$store.getters.materObj1.result) {
|
||||
this.active1 = i + ''
|
||||
}
|
||||
})
|
||||
this.option2.map((el, i) => {
|
||||
if (el.value === this.$store.getters.materObj1.grade) {
|
||||
this.active2 = i + ''
|
||||
}
|
||||
})
|
||||
this._queryInspection(this.$store.getters.materObj1.inspection_id, this.$store.getters.materObj1.material_id, this.$store.getters.materObj1.workprocedure_uuid)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleFocus (e) {
|
||||
e.testing_value = ''
|
||||
},
|
||||
handleBlur (e) {
|
||||
if (e.testing_value === '') {
|
||||
e.testing_value = e.testing_value2
|
||||
}
|
||||
if (Number(e.testing_value) < Number(e.down_limit_value) || Number(e.testing_value) > Number(e.up_limit_value)) {
|
||||
e.bred = true
|
||||
} else {
|
||||
e.testing_value2 = e.testing_value
|
||||
}
|
||||
},
|
||||
goIn () {
|
||||
if (this.$route.query.url === 'ProcessGrindBall') {
|
||||
this.$router.push('/ProcessGrindBall')
|
||||
} else if (this.$route.query.url === 'ProcessMix') {
|
||||
this.$router.push('/ProcessMix')
|
||||
} else if (this.$route.query.url === 'ProcessDry') {
|
||||
this.$router.push('/ProcessDry')
|
||||
} else {
|
||||
this.$router.push('/ProcedureInspection')
|
||||
}
|
||||
},
|
||||
addMater () {
|
||||
if (JSON.stringify(this.$store.getters.materObj1) === '{}') {
|
||||
this.$router.push({
|
||||
path: '/MaterInfoSearchRadio',
|
||||
query: {url: 'ResultEntry'}
|
||||
})
|
||||
}
|
||||
},
|
||||
addEquip () {
|
||||
if (JSON.stringify(this.$store.getters.materObj1) === '{}') {
|
||||
this.$router.push({
|
||||
path: '/EquipSearchRadio',
|
||||
query: {url: 'ResultEntry'}
|
||||
})
|
||||
}
|
||||
},
|
||||
async _queryWorkProducedure () {
|
||||
let res = await queryWorkProducedure()
|
||||
if (res.code === '1') {
|
||||
this.option = [...res.results]
|
||||
this.option.map(el => {
|
||||
this.$set(el, 'value', el.workprocedure_id)
|
||||
this.$set(el, 'label', el.workprocedure_name)
|
||||
})
|
||||
if (JSON.stringify(this.$store.getters.materObj1) !== '{}') {
|
||||
this.option.map((el, i) => {
|
||||
if (el.workprocedure_id === this.$store.getters.materObj1.workprocedure_uuid) {
|
||||
this.active = i + ''
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
async _queryInspection (iid, mid, wuuid) {
|
||||
let res = await queryInspection(iid, mid, wuuid)
|
||||
if (res.code === '1') {
|
||||
this.dataList = [...res.results]
|
||||
this.dataList.map(el => {
|
||||
el.testing_value = Number(el.testing_value).toFixed(4)
|
||||
this.$set(el, 'bred', false)
|
||||
this.$set(el, 'testing_value2', el.testing_value)
|
||||
})
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
},
|
||||
async _inspectConfirm () {
|
||||
try {
|
||||
let mst = {
|
||||
accountId: JSON.parse(this.$store.getters.userInfo).account_id,
|
||||
material_id: JSON.stringify(this.$store.getters.materObj1) !== '{}' ? this.$store.getters.materObj1.material_id : this.$store.getters.materObj.material_id,
|
||||
pcsn: JSON.stringify(this.$store.getters.materObj1) !== '{}' ? this.$store.getters.materObj1.pcsn : this.val2,
|
||||
workprocedure_uuid: JSON.stringify(this.$store.getters.materObj1) !== '{}' ? this.$store.getters.materObj1.workprocedure_uuid : (this.active !== '' ? this.option[this.active].workprocedure_id : ''),
|
||||
device_id: JSON.stringify(this.$store.getters.materObj1) !== '{}' ? this.$store.getters.materObj1.device_id : this.device_id,
|
||||
result: this.active1 !== '' ? this.option1[this.active1].value : '',
|
||||
grade: this.active2 !== '' ? this.option2[this.active2].value : '',
|
||||
remark: this.val4,
|
||||
inspection_id: JSON.stringify(this.$store.getters.materObj1) !== '{}' ? this.$store.getters.materObj1.inspection_id : ''
|
||||
}
|
||||
let dtl = []
|
||||
this.dataList.map(el => {
|
||||
dtl.push({inspectiondtl_id: el.inspectiondtl_id, inspection_item_id: el.inspection_item_id, testing_value: el.testing_value})
|
||||
})
|
||||
let res = await inspectConfirm(mst, dtl)
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
if (this.$route.query.url === 'ProcessGrindBall' || this.$route.query.url === 'ProcessMix' || this.$route.query.url === ' ProcessDry') {
|
||||
this._updateWorkStatus()
|
||||
} else {
|
||||
this.$store.dispatch('materObj1', '')
|
||||
this.goIn()
|
||||
}
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled1 = false
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
},
|
||||
toSure () {
|
||||
this.disabled1 = true
|
||||
if (this.val1 === '') {
|
||||
this.toast('请选择物料')
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
if (this.val2 === '') {
|
||||
this.toast('请输入批次')
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
if (this.active === '') {
|
||||
this.toast('请选择工序')
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
if (this.val3 === '') {
|
||||
this.toast('请选择设备')
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
if (this.active1 === '') {
|
||||
this.toast('请选择结果')
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
if (this.active2 === '') {
|
||||
this.toast('请选择等级')
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
if (this.sure) {
|
||||
this._inspectConfirm()
|
||||
}
|
||||
},
|
||||
calculate () {
|
||||
let flag = false
|
||||
this.dataList.map(el => {
|
||||
if ((Number(el.testing_value) > Number(el.up_limit_value) || Number(el.testing_value) < Number(el.down_limit_value)) && el.up_limit_value !== '') {
|
||||
this.$set(el, 'bred', true)
|
||||
flag = true
|
||||
} else if (el.up_limit_value === '') {
|
||||
this.$set(el, 'bred', false)
|
||||
} else {
|
||||
this.$set(el, 'bred', false)
|
||||
}
|
||||
})
|
||||
if (flag) {
|
||||
this.toast('结果不合格')
|
||||
this.active1 = '1'
|
||||
}
|
||||
if (!flag) {
|
||||
this.toast('结果合格')
|
||||
this.active1 = '0'
|
||||
}
|
||||
if (this.dataList.length) {
|
||||
this.sure = true
|
||||
}
|
||||
},
|
||||
toggleItem () {
|
||||
if (JSON.stringify(this.$store.getters.materObj1) !== '{}') {
|
||||
return
|
||||
}
|
||||
if (!this.open) {
|
||||
this.open = true
|
||||
} else {
|
||||
this.open = false
|
||||
}
|
||||
},
|
||||
dropdownMenu (i) {
|
||||
this.active = i + ''
|
||||
this.open = false
|
||||
},
|
||||
toggleItem1 () {
|
||||
if (JSON.stringify(this.$store.getters.materObj1) !== '{}') {
|
||||
return
|
||||
}
|
||||
if (!this.open1) {
|
||||
this.open1 = true
|
||||
} else {
|
||||
this.open1 = false
|
||||
}
|
||||
},
|
||||
dropdownMenu1 (i) {
|
||||
this.active1 = i + ''
|
||||
this.open1 = false
|
||||
},
|
||||
toggleItem2 () {
|
||||
// if (JSON.stringify(this.$store.getters.materObj1) !== '{}') {
|
||||
// return
|
||||
// }
|
||||
if (!this.open2) {
|
||||
this.open2 = true
|
||||
} else {
|
||||
this.open2 = false
|
||||
}
|
||||
},
|
||||
dropdownMenu2 (i) {
|
||||
this.active2 = i + ''
|
||||
this.open2 = false
|
||||
},
|
||||
async _updateWorkStatus () {
|
||||
let res = await updateWorkStatus(this.$route.query.id, '', '工序质检')
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
this.$store.dispatch('materObj1', '')
|
||||
this.goIn()
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '~@style/mixin'
|
||||
.bred
|
||||
border-color $red
|
||||
</style>
|
||||
Reference in New Issue
Block a user