Commit db7bf890 authored by 高铭波's avatar 高铭波

perf(order):勘察材料检验逻辑修改

parent 361c6fc7
...@@ -48,7 +48,19 @@ export default { ...@@ -48,7 +48,19 @@ export default {
return process.uniEnv.qn_base_url + "mixing.png"; return process.uniEnv.qn_base_url + "mixing.png";
}, },
arrowText() { arrowText() {
return this.dataValue && this.dataValue.length > 0 ? "已选择" : "请选择"; if(this.$u.test.isEmpty(this.dataValue)) return "请选择";
if(this.item.fieldsName == "materialList") {
let hasMate = false
var newData = this.dataValue.find((item) => {
if(!this.$u.test.isEmpty(item.useLength)) {
hasMate = true
return item.useLength != '0'
}
})
if(hasMate && this.$u.test.isEmpty(newData)) return "请选择"
}
return "已选择";
}, },
}, },
watch: {}, watch: {},
......
...@@ -289,6 +289,7 @@ import XhParts from "@/components/createCom/XhParts" ...@@ -289,6 +289,7 @@ import XhParts from "@/components/createCom/XhParts"
import takePhoto from "@/components/take/index.vue"; import takePhoto from "@/components/take/index.vue";
import baseFile from "@/components/upload/index"; import baseFile from "@/components/upload/index";
import Detail from "@/components/order/detail.vue"; import Detail from "@/components/order/detail.vue";
import returnPartsVue from '../parts/returnParts.vue';
// 表单类型map // 表单类型map
const formType = new Map([ const formType = new Map([
...@@ -676,13 +677,14 @@ export default { ...@@ -676,13 +677,14 @@ export default {
panelResult.submitted++; panelResult.submitted++;
} else if (value && Array.isArray(value) && value.length > 0) { } else if (value && Array.isArray(value) && value.length > 0) {
if (ele.fieldsName === "materialList") { if (ele.fieldsName === "materialList") {
let materRow = value.find((val) => { let hasMate = false
return ( let mateRow = value.find((mate) => {
val.hasOwnProperty("useLength") && if(mate.hasOwnProperty("useLength")) {
!this.$u.test.isEmpty(val.useLength) hasMate = true
); return !this.$u.test.isEmpty(mate.useLength)
}
}); });
if (!this.$u.test.isEmpty(materRow)) { if (!hasMate || !this.$u.test.isEmpty(mateRow)) {
panelResult.submitted++; panelResult.submitted++;
} }
} else { } else {
......
...@@ -270,9 +270,9 @@ export default { ...@@ -270,9 +270,9 @@ export default {
validateForm() { validateForm() {
if (this.isMaterial) { if (this.isMaterial) {
let row = this.list.find((item) => { let row = this.list.find((item) => {
return !this.$u.test.isEmpty(item.useLength); return !this.$u.test.isEmpty(item.useLength) && item.useLength != '0';
}); });
if (this.$u.test.isEmpty(row)) { if (!this.$u.test.isEmpty(this.list) && this.$u.test.isEmpty(row)) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: "请填写电缆、漏保、空开等用量", title: "请填写电缆、漏保、空开等用量",
type: "error", type: "error",
......
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