| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <view class="inspection">
|
| | | <div class="inspection_list">
|
| | | <div class="inspection_list_item">
|
| | | <span>æ£éªç±»å</span>
|
| | | <div class="right">
|
| | | <div class="right_item active">å®å·¥æ£</div>
|
| | | <!-- <div class="right_item active" v-if="form.status == '1'">å·¡æ£</div>
|
| | | <div class="right_item active" v-if="form.status == '2'">å®å·¥æ£</div> -->
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="x"></div>
|
| | | <div class="inspection_list">
|
| | | <div class="inspection_list_item" @click="jumpGD">
|
| | | <span>æ£éªå·¥å</span>
|
| | | <div class="right1">
|
| | | <span :style="form.gdmc ? 'color: #000;' : ''">{{ form.gdmc ? form.gdmc : 'ç¹å»éæ©æ£éªå·¥å'}}</span>
|
| | | <u-icon name="arrow-right" color="#999999" size="18" />
|
| | | </div>
|
| | | </div>
|
| | | <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>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="x"></div>
|
| | | <div class="inspection_list">
|
| | | <div class="inspection_list_item">
|
| | | <span>è¯åæ°</span>
|
| | | <div class="right1">
|
| | | <input type="number" v-model="form.hgsl" placeholder="0" />
|
| | | <span class="dw" v-if="info.umodel">{{info.umodel.name}}</span>
|
| | | </div>
|
| | | </div>
|
| | | <div class="inspection_list_item">
|
| | | <span>ä¸è¯æ°é</span>
|
| | | <div class="right1">
|
| | | <input type="number" v-model="form.blsl" placeholder="0" />
|
| | | <span class="dw" v-if="info.umodel">{{info.umodel.name}}</span>
|
| | | </div>
|
| | | </div>
|
| | | <div class="inspection_list_item" @click="selectBad" v-show="form.blsl > 0">
|
| | | <span>ä¸è¯è¯´æ</span>
|
| | | <div class="right1">
|
| | | <span :style="form.blsm ? 'color: #000;' : ''">{{ form.blsm ? form.blsm : 'ç¹å»éæ©ä¸è¯åå '}}</span>
|
| | | <u-icon name="arrow-right" color="#999999" size="18" />
|
| | | </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" keyName="name" @cancel="show1=false"
|
| | | @confirm="badConfirm">
|
| | | </u-picker>
|
| | | </view>
|
| | | </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: [],
|
| | | form: {
|
| | | status: '2',
|
| | | 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: {
|
| | | 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()
|
| | | }
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .inspection {
|
| | | width: 100%;
|
| | | height: 100%;
|
| | | position: absolute;
|
| | | background: #F7F7F7;
|
| | |
|
| | | .x {
|
| | | height: 20rpx;
|
| | | }
|
| | |
|
| | | .inspection_list {
|
| | | padding: 0 30rpx;
|
| | | background: white;
|
| | |
|
| | | .inspection_list_item {
|
| | | height: 98rpx;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: space-between;
|
| | | border-bottom: 1rpx solid #E5E5E5;
|
| | |
|
| | | &:last-child {
|
| | | border: none;
|
| | | }
|
| | |
|
| | | span {
|
| | | font-size: 30rpx;
|
| | | font-weight: 400;
|
| | | color: #222222;
|
| | | }
|
| | |
|
| | | .right1 {
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | span {
|
| | | font-size: 28rpx;
|
| | | font-weight: 400;
|
| | | color: #999999;
|
| | | margin-right: 10rpx;
|
| | | }
|
| | |
|
| | | input {
|
| | | width: 180rpx;
|
| | | height: 60rpx;
|
| | | border-radius: 8rpx;
|
| | | border: 1rpx solid #CCCCCC;
|
| | | margin-right: 10rpx;
|
| | | padding: 0 30rpx;
|
| | | box-sizing: border-box;
|
| | | font-size: 28rpx;
|
| | | }
|
| | |
|
| | | input::-webkit-input-placeholder {
|
| | | font-size: 28rpx;
|
| | | font-weight: 400;
|
| | | color: #999999;
|
| | | }
|
| | |
|
| | | .dw {
|
| | | font-size: 28rpx;
|
| | | font-weight: 400;
|
| | | color: #666666;
|
| | | }
|
| | | }
|
| | |
|
| | | .right {
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | .active {
|
| | | background: $nav-color !important;
|
| | | color: #ffffff !important;
|
| | | }
|
| | |
|
| | | .right_item {
|
| | | padding: 18rpx 32rpx;
|
| | | background: #F2F2F2;
|
| | | border-radius: 8rpx;
|
| | | font-size: 26rpx;
|
| | | font-weight: 400;
|
| | | color: #333333;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | margin-left: 20rpx;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .inspection_footer {
|
| | | position: fixed;
|
| | | bottom: 0;
|
| | | left: 0;
|
| | | width: calc(100% - 60rpx);
|
| | | padding: 30rpx 30rpx 68rpx 30rpx;
|
| | | background: #F7F7F7;
|
| | |
|
| | | .inspection_footer_sub {
|
| | | width: 100%;
|
| | | height: 88rpx;
|
| | | background: #4275FC;
|
| | | box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.0800);
|
| | | border-radius: 8rpx;
|
| | | font-size: 30rpx;
|
| | | font-weight: 500;
|
| | | color: #FFFFFF;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | border: none;
|
| | | }
|
| | | }
|
| | | }
|
| | | </style> |