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

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

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