From 044b6f50a7cc57565409f67b62d4766f2e7cbf52 Mon Sep 17 00:00:00 2001
From: Mr.Zhang <710666463@qq.com>
Date: 星期四, 07 九月 2023 16:15:11 +0800
Subject: [PATCH] 小程序
---
minipro_standard/pages/inspectPatrol/inspectPatrol.vue | 122 ++++++++++++++++++++++++++++++----------
1 files changed, 91 insertions(+), 31 deletions(-)
diff --git a/minipro_standard/pages/inspectPatrol/inspectPatrol.vue b/minipro_standard/pages/inspectPatrol/inspectPatrol.vue
index 6d08d9c..b80a33f 100644
--- a/minipro_standard/pages/inspectPatrol/inspectPatrol.vue
+++ b/minipro_standard/pages/inspectPatrol/inspectPatrol.vue
@@ -59,53 +59,113 @@
</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>
--
Gitblit v1.9.3