| | |
| | | <div class="inspection_list_item" v-if="form.gdmc">
|
| | | <span>计划数量</span>
|
| | | <div class="right1">
|
| | | <span
|
| | | style="color: black;">{{info.planNum}}{{info.umodel ? info.umodel.name : ''}}</span>
|
| | | <span style="color: black;">{{info.planNum}}{{info.umodel ? info.umodel.name : ''}}</span>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | |
| | | </div>
|
| | | <div class="inspection_footer">
|
| | | <button class="inspection_footer_sub" @click="submit" v-preventReClick>提交</button>
|
| | | </div> |
| | | <u-picker :show="show1" title="请选择不良说明" :columns="columns" @cancel="show1=false" @confirm="badConfirm"></u-picker>
|
| | | </div>
|
| | | <u-picker :show="show1" title="请选择不良说明" :columns="columns" keyName="name" @cancel="show1=false"
|
| | | @confirm="badConfirm">
|
| | | </u-picker>
|
| | | </view>
|
| | | </template>
|
| | |
|
| | | <script> |
| | | import { createStandard } from '@/util/api/QualityAPI' |
| | | import { checkAllList, getListByCondition, toolingQueryById } from "@/util/api/WorkOrderAPI" |
| | | export default { |
| | | <script>
|
| | | import {
|
| | | createStandard
|
| | | } from '@/util/api/QualityAPI'
|
| | | import {
|
| | | checkAllList
|
| | | } from "@/util/api/WorkOrderAPI" |
| | | import { REGULAR } from '@/util/utils'
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | info: {},
|
| | | show1: false,
|
| | | columns: [['中国', '美国', '日本']],
|
| | | columns1: [],
|
| | | columns: [],
|
| | | form: {
|
| | | status: '0',
|
| | | status: '2',
|
| | | gdid: '',
|
| | | gdmc: '',
|
| | | jygz: '',
|
| | | jygzmc: '',
|
| | | hgsl: 0,
|
| | | blsl: 1,
|
| | | blsl: 0,
|
| | | blgz: '',
|
| | | blgzmc: '',
|
| | | blsm: '',
|
| | | dw: ''
|
| | | }
|
| | | };
|
| | | }, |
| | | onLoad() { |
| | | uni.$on('workOrder', (data) => { |
| | | this.form.gdmc = data.mmodel.name + '-' + data.pgmodel.name |
| | | this.form.gdid = data.id |
| | | this.info = data |
| | | |
| | | }) |
| | | }, |
| | | },
|
| | | onLoad() {
|
| | | checkAllList({
|
| | | bmodelCateType: '3'
|
| | | })
|
| | | .then(res => {
|
| | | let bad = res.data.map(item => {
|
| | | return {
|
| | | name: item.combinationName,
|
| | | id: item.id
|
| | | }
|
| | | })
|
| | | this.columns = [bad]
|
| | | })
|
| | | uni.$on('workOrder', (data) => {
|
| | | this.form.gdmc = data.mmodel.name + '-' + data.pgmodel.name
|
| | | this.form.gdid = data.id
|
| | | this.info = data
|
| | |
|
| | | })
|
| | | },
|
| | | methods: {
|
| | | jumpGD() { |
| | | uni.navigateTo({ |
| | | url: '/pages/selectWorkOrder/selectWorkOrder' |
| | | }) |
| | | }, |
| | | openBL() {}, |
| | | getValue1() {}, |
| | | selectBad() { |
| | | console.log('------0-----'); |
| | | this.show1 = true |
| | | }, |
| | | badConfirm(value) { |
| | | console.log(value); |
| | | this.show1 = false |
| | | jumpGD() {
|
| | | uni.navigateTo({
|
| | | url: '/pages/selectWorkOrder/selectWorkOrder?type=2'
|
| | | })
|
| | | },
|
| | | selectBad() {
|
| | | this.show1 = true
|
| | | },
|
| | | badConfirm({
|
| | | value
|
| | | }) {
|
| | | this.form.blsm = value[0].name
|
| | | this.show1 = false
|
| | | },
|
| | | submit() {
|
| | | if (!this.form.gdid) return uni.$u.toast('工单不能为空') |
| | | |
| | | if (this.form.hgsl || this.form.blsl) {
|
| | | if (this.form.hgsl) {
|
| | | if (this.form.dw == '0') { // 整数
|
| | | if (!REGULAR.positiveInteger.test(this.form.hgsl)) return uni.$u.toast('良品数量只能为正整数') |
| | | } else if (this.form.dw == '1') { // 小数
|
| | | if (!REGULAR.number.test(this.form.hgsl)) uni.$u.toast('良品数量只能为正整数或四位小数')
|
| | | }
|
| | | }
|
| | | if (this.form.blsl) {
|
| | | if (this.form.dw == '0') { // 整数
|
| | | if (!REGULAR.positiveInteger.test(this.form.blsl)) return uni.$u.toast('不良数量只能为正整数')
|
| | | } else if (this.form.dw == '1') { // 小数
|
| | | if (!REGULAR.number.test(this.form.blsl)) {
|
| | | return uni.$u.toast('不良数量只能为正整数或四位小数')
|
| | | }
|
| | | }
|
| | | }
|
| | | } else {
|
| | | return uni.$u.toast('良品和不良不能同时为空')
|
| | | }
|
| | | let total = (this.form.hgsl ? Number(this.form.hgsl) : 0) + (this.form.blsl ? Number(this.form.blsl) : 0)
|
| | | if (total > this.info.planNum) {
|
| | | return uni.$u.toast('合格不良相加不能超过计划数量')
|
| | | }
|
| | | if (Number(this.form.blsl) > 0) {
|
| | | if (!this.form.blsm) return uni.$u.toast('不良说明不能为空')
|
| | | }
|
| | | createStandard({
|
| | | workorderId: this.form.gdid,
|
| | | qualifiedNum: this.form.hgsl ? this.form.hgsl : 0,
|
| | | unqualifiedNum: this.form.blsl ? this.form.blsl : 0,
|
| | | checkInfo: this.form.blsm,
|
| | | checkType: this.form.status
|
| | | }).then(res => {
|
| | | if (res.code === 200) { |
| | | uni.$u.toast('检验成功')
|
| | | uni.navigateBack()
|
| | | }
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | </template>
|
| | |
|
| | | <script> |
| | | import { |
| | | createStandard |
| | | } from '@/util/api/QualityAPI' |
| | | import { |
| | | checkAllList |
| | | } from "@/util/api/WorkOrderAPI" |
| | | import { REGULAR } from '@/util/utils' |
| | | export default { |
| | | data() {
|
| | | return {
|
| | | info: {},
|
| | | show1: false,
|
| | | columns: [['中国', '美国', '日本']],
|
| | | columns1: [],
|
| | | form: {
|
| | | status: '0',
|
| | | gdid: '',
|
| | | gdmc: '',
|
| | | jygz: '',
|
| | | jygzmc: '',
|
| | | hgsl: 0,
|
| | | blsl: 1,
|
| | | blgz: '',
|
| | | blgzmc: '',
|
| | | blsm: '',
|
| | | dw: ''
|
| | | }
|
| | | };
|
| | | data() { |
| | | return { |
| | | info: {}, |
| | | show1: false, |
| | | columns: [], |
| | | form: { |
| | | status: '1', |
| | | gdid: '', |
| | | gdmc: '', |
| | | jygz: '', |
| | | jygzmc: '', |
| | | hgsl: 0, |
| | | blsl: 0, |
| | | blgz: '', |
| | | blgzmc: '', |
| | | blsm: '', |
| | | dw: '' |
| | | } |
| | | }; |
| | | }, |
| | | onLoad() { |
| | | checkAllList({ |
| | | bmodelCateType: '3' |
| | | }) |
| | | .then(res => { |
| | | let bad = res.data.map(item => { |
| | | return { |
| | | name: item.combinationName, |
| | | id: item.id |
| | | } |
| | | }) |
| | | this.columns = [bad] |
| | | }) |
| | | uni.$on('workOrder', (data) => { |
| | | console.log(data); |
| | | this.form.gdmc = data.mmodel.name + '-' + data.pgmodel.name |
| | | this.form.gdid = data.id |
| | | this.info = data |
| | | |
| | | |
| | | }) |
| | | }, |
| | | methods: {
|
| | | methods: { |
| | | jumpGD() { |
| | | uni.navigateTo({ |
| | | url: '/pages/selectWorkOrder/selectWorkOrder' |
| | | url: '/pages/selectWorkOrder/selectWorkOrder?type=1' |
| | | }) |
| | | }, |
| | | openBL() {}, |
| | | getValue1() {}, |
| | | selectBad() { |
| | | console.log('------0-----'); |
| | | this.show1 = true |
| | | }, |
| | | badConfirm(value) { |
| | | this.show1 = false; |
| | | }
|
| | | }
|
| | | badConfirm({ |
| | | value |
| | | }) { |
| | | this.form.blsm = value[0].name |
| | | this.show1 = false |
| | | }, |
| | | submit() { |
| | | if (!this.form.gdid) return uni.$u.toast('工单不能为空') |
| | | |
| | | if (this.form.hgsl || this.form.blsl) { |
| | | if (this.form.hgsl) { |
| | | if (this.form.dw == '0') { // 整数 |
| | | if (!REGULAR.positiveInteger.test(this.form.hgsl)) return uni.$u.toast('良品数量只能为正整数') |
| | | } else if (this.form.dw == '1') { // 小数 |
| | | if (!REGULAR.number.test(this.form.hgsl)) uni.$u.toast('良品数量只能为正整数或四位小数') |
| | | } |
| | | } |
| | | if (this.form.blsl) { |
| | | if (this.form.dw == '0') { // 整数 |
| | | if (!REGULAR.positiveInteger.test(this.form.blsl)) return uni.$u.toast('不良数量只能为正整数') |
| | | } else if (this.form.dw == '1') { // 小数 |
| | | if (!REGULAR.number.test(this.form.blsl)) { |
| | | return uni.$u.toast('不良数量只能为正整数或四位小数') |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | return uni.$u.toast('良品和不良不能同时为空') |
| | | } |
| | | let total = (this.form.hgsl ? Number(this.form.hgsl) : 0) + (this.form.blsl ? Number(this.form.blsl) : 0) |
| | | if (total > this.info.planNum) { |
| | | return uni.$u.toast('合格不良相加不能超过计划数量') |
| | | } |
| | | if (Number(this.form.blsl) > 0) { |
| | | if (!this.form.blsm) return uni.$u.toast('不良说明不能为空') |
| | | } |
| | | createStandard({ |
| | | workorderId: this.form.gdid, |
| | | qualifiedNum: this.form.hgsl ? this.form.hgsl : 0, |
| | | unqualifiedNum: this.form.blsl ? this.form.blsl : 0, |
| | | checkInfo: this.form.blsm, |
| | | checkType: this.form.status |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | uni.$u.toast('检验成功') |
| | | uni.navigateBack() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }
|
| | | </script>
|
| | |
|
| | |
| | | </template>
|
| | |
|
| | | <script> |
| | | import { |
| | | createStandard |
| | | } from '@/util/api/QualityAPI' |
| | | import { |
| | | checkAllList |
| | | } from "@/util/api/WorkOrderAPI" |
| | | import { REGULAR } from '@/util/utils' |
| | | export default { |
| | | data() {
|
| | | return {
|
| | | info: {},
|
| | | show1: false,
|
| | | columns: [['中国', '美国', '日本']],
|
| | | columns1: [],
|
| | | form: {
|
| | | status: '0',
|
| | | gdid: '',
|
| | | gdmc: '',
|
| | | jygz: '',
|
| | | jygzmc: '',
|
| | | hgsl: 0,
|
| | | blsl: 1,
|
| | | blgz: '',
|
| | | blgzmc: '',
|
| | | blsm: '',
|
| | | dw: ''
|
| | | }
|
| | | };
|
| | | data() { |
| | | return { |
| | | info: {}, |
| | | show1: false, |
| | | columns: [], |
| | | form: { |
| | | status: '0', |
| | | gdid: '', |
| | | gdmc: '', |
| | | jygz: '', |
| | | jygzmc: '', |
| | | hgsl: 0, |
| | | blsl: 0, |
| | | blgz: '', |
| | | blgzmc: '', |
| | | blsm: '', |
| | | dw: '' |
| | | } |
| | | }; |
| | | }, |
| | | onLoad() { |
| | | checkAllList({ |
| | | bmodelCateType: '3' |
| | | }) |
| | | .then(res => { |
| | | let bad = res.data.map(item => { |
| | | return { |
| | | name: item.combinationName, |
| | | id: item.id |
| | | } |
| | | }) |
| | | this.columns = [bad] |
| | | }) |
| | | uni.$on('workOrder', (data) => { |
| | | this.form.gdmc = data.mmodel.name + '-' + data.pgmodel.name |
| | | this.form.gdid = data.id |
| | | this.info = data |
| | | |
| | | |
| | | }) |
| | | }, |
| | | methods: {
|
| | | methods: { |
| | | jumpGD() { |
| | | uni.navigateTo({ |
| | | url: '/pages/selectWorkOrder/selectWorkOrder' |
| | | url: '/pages/selectWorkOrder/selectWorkOrder?type=1' |
| | | }) |
| | | }, |
| | | openBL() {}, |
| | | getValue1() {}, |
| | | selectBad() { |
| | | console.log('------0-----'); |
| | | this.show1 = true |
| | | }, |
| | | badConfirm() { |
| | | this.show1 = false; |
| | | }
|
| | | }
|
| | | badConfirm({ |
| | | value |
| | | }) { |
| | | this.form.blsm = value[0].name |
| | | this.show1 = false |
| | | }, |
| | | submit() { |
| | | if (!this.form.gdid) return uni.$u.toast('工单不能为空') |
| | | |
| | | if (this.form.hgsl || this.form.blsl) { |
| | | if (this.form.hgsl) { |
| | | if (this.form.dw == '0') { // 整数 |
| | | if (!REGULAR.positiveInteger.test(this.form.hgsl)) return uni.$u.toast('良品数量只能为正整数') |
| | | } else if (this.form.dw == '1') { // 小数 |
| | | if (!REGULAR.number.test(this.form.hgsl)) uni.$u.toast('良品数量只能为正整数或四位小数') |
| | | } |
| | | } |
| | | if (this.form.blsl) { |
| | | if (this.form.dw == '0') { // 整数 |
| | | if (!REGULAR.positiveInteger.test(this.form.blsl)) return uni.$u.toast('不良数量只能为正整数') |
| | | } else if (this.form.dw == '1') { // 小数 |
| | | if (!REGULAR.number.test(this.form.blsl)) { |
| | | return uni.$u.toast('不良数量只能为正整数或四位小数') |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | return uni.$u.toast('良品和不良不能同时为空') |
| | | } |
| | | let total = (this.form.hgsl ? Number(this.form.hgsl) : 0) + (this.form.blsl ? Number(this.form.blsl) : 0) |
| | | if (total > this.info.planNum) { |
| | | return uni.$u.toast('合格不良相加不能超过计划数量') |
| | | } |
| | | if (Number(this.form.blsl) > 0) { |
| | | if (!this.form.blsm) return uni.$u.toast('不良说明不能为空') |
| | | } |
| | | createStandard({ |
| | | workorderId: this.form.gdid, |
| | | qualifiedNum: this.form.hgsl ? this.form.hgsl : 0, |
| | | unqualifiedNum: this.form.blsl ? this.form.blsl : 0, |
| | | checkInfo: this.form.blsm, |
| | | checkType: this.form.status |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | uni.$u.toast('检验成功') |
| | | uni.navigateBack() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }
|
| | | </script>
|
| | |
|