|
@@ -175,11 +175,11 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-form-item label="文件" prop="" v-if="currentType==='put'" style="width: 100%">
|
|
|
|
|
|
+ <el-form-item label="附件" prop="files" v-if="currentType==='put'" style="width: 100%">
|
|
<ObsFileUpload ref="obsFileUpload" :file-size="100" :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg']" :limit="9999" :value="form.pics"
|
|
<ObsFileUpload ref="obsFileUpload" :file-size="100" :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg']" :limit="9999" :value="form.pics"
|
|
></ObsFileUpload>
|
|
></ObsFileUpload>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="文件" prop="" v-if="currentType==='add'" style="width: 100%">
|
|
|
|
|
|
+ <el-form-item label="附件" prop="files" v-if="currentType==='add'" style="width: 100%">
|
|
<ObsFileUpload ref="obsFileUpload" :file-size="100" :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg']" :limit="9999" :value="form.files"
|
|
<ObsFileUpload ref="obsFileUpload" :file-size="100" :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg']" :limit="9999" :value="form.files"
|
|
></ObsFileUpload>
|
|
></ObsFileUpload>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -193,68 +193,101 @@
|
|
</el-dialog>
|
|
</el-dialog>
|
|
<!-- 施工信息dialog -->
|
|
<!-- 施工信息dialog -->
|
|
<el-dialog :visible.sync="nodeDetailVisible" title="施工信息" append-to-body customClass="appendElNodeDialog" width="70% !important">
|
|
<el-dialog :visible.sync="nodeDetailVisible" title="施工信息" append-to-body customClass="appendElNodeDialog" width="70% !important">
|
|
- <!-- 节点表单 -->
|
|
|
|
- <el-form ref="nodeForm" :model="form.zEngineeringNodeBo.zEngineeringInfoBo" :rules="nodeRules" label-width="200px">
|
|
|
|
- <el-form-item label="施工时间" prop="constructTime">
|
|
|
|
- <el-date-picker
|
|
|
|
- v-model="form.zEngineeringNodeBo.zEngineeringInfoBo.constructTime"
|
|
|
|
- value-format="yyyy-MM-dd hh:mm:ss"
|
|
|
|
- type="datetime"
|
|
|
|
- style="width: 100%"
|
|
|
|
- placeholder="请选择施工时间">
|
|
|
|
- </el-date-picker>
|
|
|
|
|
|
+ <!-- 节点表单 -->
|
|
|
|
+ <el-form ref="nodeForm" :model="form.zEngineeringNodeBo.zEngineeringInfoBo" :rules="nodeRules" label-width="200px">
|
|
|
|
+ <el-form-item label="施工时间" prop="constructTime">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="form.zEngineeringNodeBo.zEngineeringInfoBo.constructTime"
|
|
|
|
+ value-format="yyyy-MM-dd hh:mm:ss"
|
|
|
|
+ type="datetime"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ placeholder="请选择施工时间">
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="施工人" prop="constructUser" v-if="form.id">
|
|
|
|
+ <el-input v-model="form.zEngineeringNodeBo.zEngineeringInfoBo.constructUser" placeholder="请填写施工人" maxlength="20" disabled></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-form-item label="照片" prop="zEngiineeringPhotoBoList" style="width: 100%;">
|
|
|
|
+ <ObsImageUpload ref="obsImageUpload" :limit="9999" :fileType="['png', 'jpg', 'jpeg']" :value="form.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList"
|
|
|
|
+ @input="getUrl"></ObsImageUpload>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row v-for="(item, index) in form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo" :key="index">
|
|
|
|
+ <!-- 在此处添加默认的行内容 -->
|
|
|
|
+ <template v-if="index === null">
|
|
|
|
+ <div>默认的行内容</div>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 循环输出的行内容 -->
|
|
|
|
+ <template v-else>
|
|
|
|
+ <div>{{ item }}</div>
|
|
|
|
+ </template>
|
|
|
|
+ <el-col :span="7">
|
|
|
|
+ <el-form-item
|
|
|
|
+ :prop="'zEngineeringMaterialBo.' + index + '.materialQuality'"
|
|
|
|
+ label-width="50px"
|
|
|
|
+ label="材质"
|
|
|
|
+
|
|
|
|
+ >
|
|
|
|
+ <!-- :rules="{required: true, message: '请输入材质', trigger: 'blur'}"-->
|
|
|
|
+ <!-- <el-input v-model="item.materialQuality" placeholder="请输入材质" style="width: 100%"/>-->
|
|
|
|
+ <el-select v-model="item.materialQuality" placeholder="请选择材质" style="width: 100%" @change="getEnginSpecificationsList(item, index)">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="e in materialQualityList"
|
|
|
|
+ :key="e.id"
|
|
|
|
+ :label="e.name"
|
|
|
|
+ :value="e.id"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="7">
|
|
|
|
+ <el-form-item
|
|
|
|
+ :prop="'zEngineeringMaterialBo.' + index + '.specifications'"
|
|
|
|
+ label-width="50px"
|
|
|
|
+ label="规格"
|
|
|
|
+
|
|
|
|
+ >
|
|
|
|
+ <!-- :rules="{required: true, message: '请输入规格', trigger: 'blur'}"-->
|
|
|
|
+ <!-- <el-input v-model="item.specifications" placeholder="请输入规格" style="width: 100%"/>-->
|
|
|
|
+ <el-select v-model="item.specifications" placeholder="请选择规格" style="width: 100%">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="e in specificationsList"
|
|
|
|
+ :key="e.id"
|
|
|
|
+ :label="e.name"
|
|
|
|
+ :value="e.id"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="7">
|
|
|
|
+ <el-form-item
|
|
|
|
+ :prop="'zEngineeringMaterialBo.' + index + '.number'"
|
|
|
|
+ label-width="50px"
|
|
|
|
+ label="数量"
|
|
|
|
+
|
|
|
|
+ >
|
|
|
|
+ <!-- :rules="[{required: true, message: '请输入数量', trigger: 'change'},{validator: [checkPositiveInteger], trigger: 'blur'}]"-->
|
|
|
|
+ <div class="block" style="display: inline-block; margin-right: 20px;">
|
|
|
|
+ <el-input v-model="item.number" placeholder="请输入数量" style="width: 100%" maxlength="8"/>
|
|
|
|
+ </div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="施工人" prop="constructUser" v-if="form.id">
|
|
|
|
- <el-input v-model="form.zEngineeringNodeBo.zEngineeringInfoBo.constructUser" placeholder="请填写施工人" maxlength="20" disabled></el-input>
|
|
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="3">
|
|
|
|
+ <el-form-item style="margin-left: -120px;">
|
|
|
|
+ <el-button v-if="form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo.length > 1" @click="removezEngineeringMaterialBo(index)">
|
|
|
|
+ 删除
|
|
|
|
+ </el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-row>
|
|
|
|
- <el-form-item label="照片" prop="zEngiineeringPhotoBoList" style="width: 100%;">
|
|
|
|
- <ObsImageUpload ref="obsImageUpload" :limit="9999" :fileType="['png', 'jpg', 'jpeg']" :value="form.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList"
|
|
|
|
- @input="getUrl"></ObsImageUpload>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-row>
|
|
|
|
- <el-row v-for="(item, index) in form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo" :key="index">
|
|
|
|
- <el-col :span="7">
|
|
|
|
- <el-form-item
|
|
|
|
- :prop="'zEngineeringMaterialBo.' + index + '.materialQuality'"
|
|
|
|
- label-width="50px"
|
|
|
|
- label="材质" :rules="{required: true, message: '请输入材质', trigger: 'blur'}">
|
|
|
|
- <el-input v-model="item.materialQuality" placeholder="请输入材质" style="width: 100%"/>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="7">
|
|
|
|
- <el-form-item
|
|
|
|
- :prop="'zEngineeringMaterialBo.' + index + '.specifications'"
|
|
|
|
- label-width="50px"
|
|
|
|
- label="规格" :rules="{required: true, message: '请输入规格', trigger: 'blur'}">
|
|
|
|
- <el-input v-model="item.specifications" placeholder="请输入规格" style="width: 100%"/>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="7">
|
|
|
|
- <el-form-item
|
|
|
|
- :prop="'zEngineeringMaterialBo.' + index + '.number'"
|
|
|
|
- label-width="50px"
|
|
|
|
- label="数量" :rules="{required: true, message: '请输入数量', trigger: 'change'}">
|
|
|
|
- <div class="block" style="display: inline-block; margin-right: 20px;">
|
|
|
|
- <el-input v-model="item.number" placeholder="请输入数量" style="width: 100%"/>
|
|
|
|
- </div>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="3">
|
|
|
|
- <el-form-item style="margin-left: -120px;">
|
|
|
|
- <el-button v-if="form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo.length > 1" @click="removezEngineeringMaterialBo(index)">
|
|
|
|
- 删除
|
|
|
|
- </el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
- <div style="width: 25%; float: right">
|
|
|
|
- <el-button @click="addzEngineeringMaterialBo">新增用料信息</el-button>
|
|
|
|
- <el-button :loading="buttonLoading" type="primary" @click="submitForm">提交</el-button>
|
|
|
|
- <el-button @click="nodeCancel">取 消</el-button>
|
|
|
|
- </div>
|
|
|
|
- </el-form>
|
|
|
|
- </el-dialog>
|
|
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <div style="width: 25%; float: right">
|
|
|
|
+ <el-button @click="addzEngineeringMaterialBo">新增用料信息</el-button>
|
|
|
|
+ <el-button :loading="buttonLoading" type="primary" @click="submitForm">提交</el-button>
|
|
|
|
+ <el-button @click="nodeCancel">取 消</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-form>
|
|
|
|
+ </el-dialog>
|
|
<ConstructionDetails
|
|
<ConstructionDetails
|
|
ref="ConstructionDetails"
|
|
ref="ConstructionDetails"
|
|
:currentCollapses="currentCollapses"
|
|
:currentCollapses="currentCollapses"
|
|
@@ -271,8 +304,8 @@ import {
|
|
QueryEngineeIndustry
|
|
QueryEngineeIndustry
|
|
} from '@/api/zdsz/engineeringIndustry'
|
|
} from '@/api/zdsz/engineeringIndustry'
|
|
import EngineePipe from '@/components/EngineePipe'
|
|
import EngineePipe from '@/components/EngineePipe'
|
|
-import { validPhoneMobile } from '@/api/rules'
|
|
|
|
-import ConstructionDetails from "@/components/ConstructionDetails/index.vue";
|
|
|
|
|
|
+import { checkPositiveInteger, validPhoneMobile } from '@/api/rules'
|
|
|
|
+import ConstructionDetails from '@/components/ConstructionDetails/index.vue'
|
|
import { getEnginMaterialQualityList } from '@/api/zdsz/enginee'
|
|
import { getEnginMaterialQualityList } from '@/api/zdsz/enginee'
|
|
import { getEnginSpecificationsList } from '@/api/zdsz/enginSpecifications'
|
|
import { getEnginSpecificationsList } from '@/api/zdsz/enginSpecifications'
|
|
|
|
|
|
@@ -284,25 +317,19 @@ export default {
|
|
EngineePipe
|
|
EngineePipe
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
- var validatePicPass = (rule, value, callback) => {
|
|
|
|
- console.log('校验值', this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList)
|
|
|
|
- let p = new Promise((resolve, reject) => {
|
|
|
|
- if(this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList.length != 0){
|
|
|
|
- this.$message({
|
|
|
|
- message: '校验通过',
|
|
|
|
- type: 'success'
|
|
|
|
- });
|
|
|
|
- resolve(true)
|
|
|
|
- }else{
|
|
|
|
- this.$message({
|
|
|
|
- message: 'no pass',
|
|
|
|
- type: 'error'
|
|
|
|
- });
|
|
|
|
- reject(new Error('no pass'))
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- return p;
|
|
|
|
- };
|
|
|
|
|
|
+ // 自定义校验
|
|
|
|
+ const validatePicPass = (rule, value, callback) => {
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ // 至少有一个图片、一个用料信息、一个创建时间
|
|
|
|
+ if (this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList.length !== 0
|
|
|
|
+ && (this.form.zEngineeringNodeBo.zEngineeringInfoBo.constructTime !== null || undefined)
|
|
|
|
+ && this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo.length !== 0) {
|
|
|
|
+ resolve(true)
|
|
|
|
+ } else {
|
|
|
|
+ reject(new Error('no pass'))
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
return {
|
|
return {
|
|
// 按钮loading
|
|
// 按钮loading
|
|
buttonLoading: false,
|
|
buttonLoading: false,
|
|
@@ -338,26 +365,6 @@ export default {
|
|
zEngineeringInfoBo: {}, //施工信息
|
|
zEngineeringInfoBo: {}, //施工信息
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- constructAccordingDrawingsOption: [ // 是否按图纸施工
|
|
|
|
- {
|
|
|
|
- value: '1',
|
|
|
|
- label: '是'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- value: '0',
|
|
|
|
- label: '否'
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- segmentedCompressionQualifiedOption: [ // 分段打压
|
|
|
|
- {
|
|
|
|
- value: '1',
|
|
|
|
- label: '是'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- value: '0',
|
|
|
|
- label: '否'
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
nodeDetailVisible: false, // 施工信息dialog
|
|
nodeDetailVisible: false, // 施工信息dialog
|
|
// 表单参数
|
|
// 表单参数
|
|
form: {
|
|
form: {
|
|
@@ -392,8 +399,9 @@ export default {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- zEngineeringAttachmentsList:[], // 工程附件
|
|
|
|
EngineepipeType: [], // 工程类型
|
|
EngineepipeType: [], // 工程类型
|
|
|
|
+ materialQualityList: [], // 用料材质List
|
|
|
|
+ specificationsList: [], // 用料规格List
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {
|
|
rules: {
|
|
sceneHead: [
|
|
sceneHead: [
|
|
@@ -437,23 +445,21 @@ export default {
|
|
type: [
|
|
type: [
|
|
{required: false, message: "类型不能为空", trigger: "blur"}
|
|
{required: false, message: "类型不能为空", trigger: "blur"}
|
|
],
|
|
],
|
|
- remark: [
|
|
|
|
- {required: false, message: "备注不能为空", trigger: "blur"}
|
|
|
|
- ],
|
|
|
|
- zEngineeringAttachmentsList: [
|
|
|
|
|
|
+ files: [
|
|
{required: false, message: "附件不能为空", trigger: "blur"}
|
|
{required: false, message: "附件不能为空", trigger: "blur"}
|
|
],
|
|
],
|
|
-
|
|
|
|
},
|
|
},
|
|
// 节点规则校验
|
|
// 节点规则校验
|
|
nodeRules: {
|
|
nodeRules: {
|
|
- // constructTime: [
|
|
|
|
- // {required: true, message: "施工时间不能为空", trigger: ['blur','change']}
|
|
|
|
- // ],
|
|
|
|
|
|
+ constructTime: [
|
|
|
|
+ {required: true, message: "施工时间不能为空", trigger: 'change', validator: validatePicPass}
|
|
|
|
+ ],
|
|
zEngiineeringPhotoBoList: [
|
|
zEngiineeringPhotoBoList: [
|
|
{required: true, message: "图片不能为空", trigger: 'change', validator: validatePicPass}
|
|
{required: true, message: "图片不能为空", trigger: 'change', validator: validatePicPass}
|
|
],
|
|
],
|
|
-
|
|
|
|
|
|
+ zEngineeringMaterialBo:[
|
|
|
|
+ {required: true, message: "不能为空", trigger: 'change', validator: validatePicPass}
|
|
|
|
+ ]
|
|
},
|
|
},
|
|
currentType: null, // 附件组件类型 put修改 add新增
|
|
currentType: null, // 附件组件类型 put修改 add新增
|
|
};
|
|
};
|
|
@@ -473,8 +479,17 @@ export default {
|
|
},500)
|
|
},500)
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 验证正整数(不包含0的正整数)
|
|
|
|
+ checkPositiveInteger,
|
|
|
|
+ getEnginSpecificationsList(item, index){
|
|
|
|
+ let materialId = item.materialQuality
|
|
|
|
+ this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo[index].specifications = null
|
|
|
|
+ // 根据材质ID获取材质规格
|
|
|
|
+ getEnginSpecificationsList({ materialId }).then(res => {
|
|
|
|
+ this.specificationsList = res.data
|
|
|
|
+ })
|
|
|
|
+ },
|
|
addzEngineeringMaterialBo(){
|
|
addzEngineeringMaterialBo(){
|
|
- console.log(this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo)
|
|
|
|
this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo.push({
|
|
this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo.push({
|
|
materialQuality: '', // 用料材质
|
|
materialQuality: '', // 用料材质
|
|
specifications: '', // 用料规格
|
|
specifications: '', // 用料规格
|
|
@@ -540,14 +555,10 @@ export default {
|
|
getList() {
|
|
getList() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
let enginType = this.form.zEngineeringNodeBo.type;
|
|
let enginType = this.form.zEngineeringNodeBo.type;
|
|
- // 获取材质 市政工程 1 - 工业工程 2
|
|
|
|
- getEnginMaterialQualityList({enginType}).then(res => {
|
|
|
|
- console.log(res);
|
|
|
|
|
|
+ // 获取材质
|
|
|
|
+ getEnginMaterialQualityList({ enginType }).then(res => {
|
|
|
|
+ this.materialQualityList = res.data
|
|
});
|
|
});
|
|
- // 获取材质规格
|
|
|
|
- getEnginSpecificationsList('材质ID').then(res => {
|
|
|
|
- console.log(res)
|
|
|
|
- })
|
|
|
|
getEngineeIndustryList({
|
|
getEngineeIndustryList({
|
|
type: this.form.type
|
|
type: this.form.type
|
|
}).then(res => {
|
|
}).then(res => {
|
|
@@ -569,10 +580,11 @@ export default {
|
|
this.form.zEngineeringNodeBo={}
|
|
this.form.zEngineeringNodeBo={}
|
|
this.form.zEngineeringNodeBo.zEngineeringInfoBo={}
|
|
this.form.zEngineeringNodeBo.zEngineeringInfoBo={}
|
|
this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo=[]
|
|
this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo=[]
|
|
- // this.resetForm("form");
|
|
|
|
- // for (let formKey in this.zEngineeringInfoBo) {
|
|
|
|
- // this.zEngineeringInfoBo[formKey] = null
|
|
|
|
- // }
|
|
|
|
|
|
+ this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo.push({
|
|
|
|
+ materialQuality: '', // 用料材质
|
|
|
|
+ specifications: '', // 用料规格
|
|
|
|
+ number: '' // 用料数量
|
|
|
|
+ })
|
|
this.getType()
|
|
this.getType()
|
|
},
|
|
},
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|