|
@@ -167,7 +167,7 @@
|
|
|
<el-input v-model="queryParams.plannedDuration" placeholder="请输入计划工期" maxlength="50" :disabled="title == '添加用料' "></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="文件" prop="files" v-if="queryParams.id">
|
|
|
- <ObsFileUpload ref="obsFileUpload" :file-size="100" :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg','mp4']" :limit="9999" :value="queryParams.pics" @input="filesUpload"
|
|
|
+ <ObsFileUpload ref="obsFileUpload" :disabled="title != '新增工程'" :file-size="100" :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg','mp4']" :limit="9999" :value="queryParams.pics" @input="filesUpload"
|
|
|
></ObsFileUpload>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="文件" prop="files" v-else>
|
|
@@ -553,6 +553,9 @@ export default {
|
|
|
enginContent: [
|
|
|
{ required: true, message: "工程内容不能为空", trigger: "blur" }
|
|
|
],
|
|
|
+ files: [
|
|
|
+ { required: true, message: "至少上传一个文件", trigger: "blur" }
|
|
|
+ ],
|
|
|
|
|
|
},
|
|
|
// 节点规则校验
|
|
@@ -720,8 +723,10 @@ export default {
|
|
|
this.currentId = e.id
|
|
|
this.$refs.ConstructionDetails.open(this.dict.type.engineering_infrastructure)
|
|
|
},
|
|
|
- filesUpload(){
|
|
|
-
|
|
|
+ filesUpload(url){
|
|
|
+ console.log('upload successfully')
|
|
|
+ this.queryParams.files = url
|
|
|
+ this.$refs.form.validate()
|
|
|
},
|
|
|
// 添加用料
|
|
|
addMaterial(data){
|
|
@@ -860,68 +865,49 @@ export default {
|
|
|
this.nodeDetailVisible = false
|
|
|
},
|
|
|
toNodeDetail(){
|
|
|
- let nodeCollection = []
|
|
|
- // 收集节点信息
|
|
|
- this.currentCheckList.forEach((e,idx) => {
|
|
|
- let nodeItem = this.$refs['EnginNodeInfo'+ idx][0].infoCollection()
|
|
|
- // console.log(nodeItem)
|
|
|
- delete nodeItem.zEngiineeringPhotoBoList
|
|
|
- nodeCollection.push(nodeItem)
|
|
|
- })
|
|
|
- this.queryParams.zEngineeringNodeBoList = nodeCollection
|
|
|
- console.log('queryParams',this.queryParams)
|
|
|
- if (this.title == '修改基建工程') {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- this.queryParams.files = this.$refs['obsFileUpload'].fileList;
|
|
|
- if (this.$refs.obsFileUpload.fileList==null||this.$refs.obsFileUpload.fileList.length===0){
|
|
|
- this.$message.warning('必须上传文件!')
|
|
|
- return
|
|
|
- }
|
|
|
- let param = this.queryParams
|
|
|
- delete param.zEngineeringNodeBo
|
|
|
- putEngineeringInfrastructure(param).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.$message({
|
|
|
- message: '修改成功',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- this.open = false
|
|
|
- console.log('选中节点集合', this.currentCheckList)
|
|
|
- this.currentCheckList = []
|
|
|
- this.getList()
|
|
|
- // this.$emit('closeToSucceed')
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
+ if(valid){
|
|
|
+ let nodeCollection = []
|
|
|
+ // 收集节点信息
|
|
|
+ this.currentCheckList.forEach((e,idx) => {
|
|
|
+ let nodeItem = this.$refs['EnginNodeInfo'+ idx][0].infoCollection()
|
|
|
+ // console.log(nodeItem)
|
|
|
+ delete nodeItem.zEngiineeringPhotoBoList
|
|
|
+ nodeCollection.push(nodeItem)
|
|
|
+ })
|
|
|
+ this.queryParams.zEngineeringNodeBoList = nodeCollection
|
|
|
+ console.log('queryParams',this.queryParams)
|
|
|
+ if (this.title == '修改基建工程') {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.queryParams.files = this.$refs['obsFileUpload'].fileList;
|
|
|
+ if (this.$refs.obsFileUpload.fileList==null||this.$refs.obsFileUpload.fileList.length===0){
|
|
|
+ this.$message.warning('必须上传文件!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let param = this.queryParams
|
|
|
+ delete param.zEngineeringNodeBo
|
|
|
+ putEngineeringInfrastructure(param).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: '修改成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.open = false
|
|
|
+ console.log('选中节点集合', this.currentCheckList)
|
|
|
+ this.currentCheckList = []
|
|
|
+ this.getList()
|
|
|
+ // this.$emit('closeToSucceed')
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- })
|
|
|
- }
|
|
|
- });
|
|
|
- } else if(this.enginNodeStatus == '添加用料'){
|
|
|
- this.queryParams.files = this.$refs['obsFileUpload'].fileList;
|
|
|
- addEngineeringInfrastructure(this.queryParams).then(res => {
|
|
|
- if(res.code == 200){
|
|
|
- this.$message({
|
|
|
- message: '添加成功',
|
|
|
- type: 'success'
|
|
|
});
|
|
|
- this.open = false
|
|
|
- console.log('选中节点集合',this.currentCheckList)
|
|
|
- this.currentCheckList = []
|
|
|
- this.getList()
|
|
|
- // this.$emit('closeToSucceed')
|
|
|
- }
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
+ } else if(this.enginNodeStatus == '添加用料'){
|
|
|
this.queryParams.files = this.$refs['obsFileUpload'].fileList;
|
|
|
- if (this.$refs.obsFileUpload.fileList==null||this.$refs.obsFileUpload.fileList.length===0){
|
|
|
- this.$message.warning('必须上传文件!')
|
|
|
- return
|
|
|
- }
|
|
|
addEngineeringInfrastructure(this.queryParams).then(res => {
|
|
|
if(res.code == 200){
|
|
|
this.$message({
|
|
|
- message: '新增成功',
|
|
|
+ message: '添加成功',
|
|
|
type: 'success'
|
|
|
});
|
|
|
this.open = false
|
|
@@ -931,9 +917,35 @@ export default {
|
|
|
// this.$emit('closeToSucceed')
|
|
|
}
|
|
|
})
|
|
|
+ }else{
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.queryParams.files = this.$refs['obsFileUpload'].fileList;
|
|
|
+ if (this.$refs.obsFileUpload.fileList==null||this.$refs.obsFileUpload.fileList.length===0){
|
|
|
+ this.$message.warning('必须上传文件!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ addEngineeringInfrastructure(this.queryParams).then(res => {
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$message({
|
|
|
+ message: '新增成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.open = false
|
|
|
+ console.log('选中节点集合',this.currentCheckList)
|
|
|
+ this.currentCheckList = []
|
|
|
+ this.getList()
|
|
|
+ // this.$emit('closeToSucceed')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
- }
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
return
|
|
|
getDictList({enginType:['engineering_infrastructure']}).then(res => {
|
|
|
this.nodeList = res.data
|
|
@@ -1121,10 +1133,8 @@ export default {
|
|
|
viewEngineeringInfrastructure(row.id).then(res => {
|
|
|
console.log(res)
|
|
|
let newData = res.data
|
|
|
- console.log(newData)
|
|
|
- console.log(res.data.zEngineeringNodeBoList[0].type)
|
|
|
let zEngineeringNodeBo = {
|
|
|
- type:res.data.zEngineeringNodeBoList[0].type,
|
|
|
+ type:res.data.zEngineeringNodeBoList[0].type || null,
|
|
|
zEngineeringInfoBo:res.data.zEngineeringNodeBoList[0].zEngineeringInfoBo
|
|
|
}
|
|
|
newData.zEngineeringNodeBo = zEngineeringNodeBo
|