diff --git a/src/assets/js/http.js b/src/assets/js/http.js index 7e721925..f7643631 100644 --- a/src/assets/js/http.js +++ b/src/assets/js/http.js @@ -173,8 +173,8 @@ if (process.env.NODE_ENV == "development") { // axios.defaults.baseURL = 'http://192.168.34.221:28888/' //郭圣雄本地 // axios.defaults.baseURL = 'http://192.168.34.221:28889/' //郭圣雄本地 // axios.defaults.baseURL = "http://192.168.34.221:9111/"; //郭圣雄本地 - // axios.defaults.baseURL = 'http://192.168.34.155:19111/' //彭洁本地 - axios.defaults.baseURL = 'http://182.90.224.237:51234/' //郭圣雄远程 + axios.defaults.baseURL = 'http://192.168.34.155:19111/' //彭洁本地 + // axios.defaults.baseURL = 'http://182.90.224.237:51234/' //郭圣雄远程 // axios.defaults.baseURL = 'http://jxj.zhgdyun.com:61212/' //彭洁远程 // axios.defaults.baseURL ='http://101.43.164.214:45020/' //沈阳和盈 // axios.defaults.baseURL ='http://183.249.224.118:9000/' //嘉兴王江泾公用码头 @@ -183,7 +183,7 @@ if (process.env.NODE_ENV == "development") { // axios.defaults.baseURL = 'http://125.88.207.86:8099/'//中建四局(沙湖)线上(最新)地址 // axios.defaults.baseURL = 'http://jxj.zhgdyun.com:15551/'//测试地址 // axios.defaults.baseURL = 'http://47.93.215.234:9809/'//鞍钢正式地址(弃用) - // axios.defaults.baseURL = 'http://42.180.188.17:9809/'//鞍钢正式地址 + // axios.defaults.baseURL = 'http://42.180.188.17:9809/' //鞍钢正式地址 // axios.defaults.baseURL = 'http://47.93.215.234:11211/'//鞍钢测试地址(弃用) // axios.defaults.baseURL = 'http://42.180.188.17:11211/' //鞍钢测试地址 // axios.defaults.baseURL = 'http://8.136.222.164:8808/' //中科安信正式地址 diff --git a/src/store/index.js b/src/store/index.js index f170e937..a01d3cb2 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -52,22 +52,21 @@ export default new Vuex.Store({ // FILEURL:'http://182.90.224.237:51234/image/', // UPLOADURL: "http://http://192.168.34.155:19111/upload/image/", // 洁本地 // FILEURL: "http://http://192.168.34.155:19111/image/", //洁本地 - // UPLOADURL: 'http://192.168.34.221:9111/upload/image/', // 郭圣雄本地 - // FILEURL: 'http://192.168.34.221:9111/image/', //郭圣雄本地 + UPLOADURL: 'http://192.168.34.221:9111/upload/image/', // 郭圣雄本地 + FILEURL: 'http://192.168.34.221:9111/image/', //郭圣雄本地 // WORKFLOWURL: "http://192.168.34.138:88/#/workspace/forms", //坤工作流地址(本地) - // WORKFLOWURL: "http://192.168.34.129:88/#/workspace/forms", //罗峰工作流地址(本地) + WORKFLOWURL: "http://192.168.34.129:88/#/workspace/forms", //罗峰工作流地址(本地) // UPLOADURL:'http://182.90.224.237:51234/upload/image/',// 郭圣雄远程 // FILEURL:'http://182.90.224.237:51234/image/',//郭圣雄远程 - // UPLOADURL:'http://42.180.188.17:11211/upload/image',//测试 - // FILEURL:'http://42.180.188.17:11211/image/',//测试 - BASEURL: baseUrl ? - baseUrl : - window.location.protocol + "//" + window.location.host + "/", //正式环境 - UPLOADURL: window.location.protocol + "//" + window.location.host + "/upload/image", //正式环境 - FILEURL: window.location.protocol + "//" + window.location.host + "/image/", //正式环境 + // UPLOADURL: 'http://42.180.188.17:11211/upload/image', //测试 + // FILEURL: 'http://42.180.188.17:11211/image/', //测试 + // BASEURL: baseUrl ? + // baseUrl : window.location.protocol + "//" + window.location.host + "/", //正式环境 + // UPLOADURL: window.location.protocol + "//" + window.location.host + "/upload/image", //正式环境 + // FILEURL: window.location.protocol + "//" + window.location.host + "/image/", //正式环境 // // WORKFLOWURL: 'http://47.93.215.234:19998/#/workspace/forms',//鞍钢平台工作流地址(弃用) // // WORKFLOWURL: 'http://47.93.215.234:19098/#/workspace/forms',//鞍钢测试平台工作流地址(弃用) - // WORKFLOWURL: 'http://42.180.188.17:19998/#/workspace/forms',//鞍钢平台工作流地址 + // WORKFLOWURL: 'http://42.180.188.17:19998/#/workspace/forms', //鞍钢平台工作流地址 // WORKFLOWURL: "http://42.180.188.17:19098/#/workspace/forms", //鞍钢测试平台工作流地址 //--------------------------------------------------------------------------------------------- // BASEURL: baseUrl diff --git a/src/views/projectFront/laborManage/dataValidation.vue b/src/views/projectFront/laborManage/dataValidation.vue index 16632e60..a4a10c82 100644 --- a/src/views/projectFront/laborManage/dataValidation.vue +++ b/src/views/projectFront/laborManage/dataValidation.vue @@ -59,7 +59,7 @@
diff --git a/src/views/projectFront/projectSummary/cooperatorDatails.vue b/src/views/projectFront/projectSummary/cooperatorDatails.vue index e07d3e08..897d4309 100644 --- a/src/views/projectFront/projectSummary/cooperatorDatails.vue +++ b/src/views/projectFront/projectSummary/cooperatorDatails.vue @@ -30,7 +30,9 @@ @@ -198,6 +238,7 @@ > +
- + - + - + + 点击上传 - +
新增 + +
- + - + - +
- + { if (res.code == 200) { - if(!res.result) return; - console.log('~~~~~~~~~~~~~~~~~~~~',res) + if (!res.result) return; + console.log("~~~~~~~~~~~~~~~~~~~~", res); } }); }, @@ -480,13 +522,20 @@ export default { fieldName2: this.$t("message.laborMange.photosOfQualification"), value: res.result.enterpriseName, value2: - res.result.enterpriseQualificationUrl && res.result.enterpriseQualificationUrl.split(',').length > 0? - res.result.enterpriseQualificationUrl.split(',').map(item => { - return { - name: item.split('*')[0], - url: this.$store.state.FILEURL + item.split('*')[1], - } - }) : res.result.enterpriseQualificationUrl.indexOf('http://') >= 0 ? res.result.enterpriseQualificationUrl: res.result.enterpriseQualificationUrl, + res.result.enterpriseQualificationUrl && + res.result.enterpriseQualificationUrl.split(",").length > 0 + ? res.result.enterpriseQualificationUrl + .split(",") + .map((item) => { + return { + name: item.split("*")[0], + url: this.$store.state.FILEURL + item.split("*")[1], + }; + }) + : res.result.enterpriseQualificationUrl.indexOf("http://") >= + 0 + ? res.result.enterpriseQualificationUrl + : res.result.enterpriseQualificationUrl, }, { fieldName: this.$t("message.laborMange.formOfBusiness"), @@ -514,7 +563,9 @@ export default { ? this.$t("message.cooperationUnit.subpackage10") : res.result.enterpriseTypeId == 11 ? this.$t("message.cooperationUnit.subpackage11") - : res.result.enterpriseTypeId == 12 ? this.$t("message.cooperationUnit.subpackage12") : '', + : res.result.enterpriseTypeId == 12 + ? this.$t("message.cooperationUnit.subpackage12") + : "", value2: res.result.enterpriseLegalPerson, }, { @@ -551,7 +602,9 @@ export default { fieldName: this.$t("message.laborMange.laborCertificateNo"), fieldName2: this.$t("message.laborMange.safetyProductionLicense"), value: res.result.qualificationNumber, - value2: res.result.enterpriseSafeAllow && res.result.enterpriseSafeAllow, + value2: + res.result.enterpriseSafeAllow && + res.result.enterpriseSafeAllow, }, { fieldName: this.$t("message.laborMange.natureOfUnit"), @@ -564,12 +617,17 @@ export default { : res.result.enterpriseProperty == 3 ? this.$t("message.laborMange.collectiveEnterprises") : this.$t("message.laborMange.privateEnterprise"), - value2: res.result.logo && res.result.logo.split(',').length > 0 ? res.result.logo.split(',').map(item => { - return { - name: item.split('*')[0], - url: this.$store.state.FILEURL + item.split('*')[1], - } - }) : res.result.logo.indexOf('http://') >= 0 || !res.result.logo ? res.result.logo : this.$store.state.FILEURL + res.result.logo + value2: + res.result.logo && res.result.logo.split(",").length > 0 + ? res.result.logo.split(",").map((item) => { + return { + name: item.split("*")[0], + url: this.$store.state.FILEURL + item.split("*")[1], + }; + }) + : res.result.logo.indexOf("http://") >= 0 || !res.result.logo + ? res.result.logo + : this.$store.state.FILEURL + res.result.logo, // res.result.logo ? this.$store.state.FILEURL +res.result.logo : "", }, { @@ -581,70 +639,117 @@ export default { { fieldName: "承包商名称", fieldName2: "项目施工区域", - value: res.result.projectEnterprise.cbsName ? res.result.projectEnterprise.cbsName : "", - value2: res.result.projectEnterprise.projectBuildArea ? res.result.projectEnterprise.projectBuildArea : "", + value: res.result.projectEnterprise.cbsName + ? res.result.projectEnterprise.cbsName + : "", + value2: res.result.projectEnterprise.projectBuildArea + ? res.result.projectEnterprise.projectBuildArea + : "", }, { - fieldName: "项目经理", fieldName2: "项目类型", - value: res.result.projectEnterprise.projectManage ? res.result.projectEnterprise.projectManage :"", - value2: res.result.projectEnterprise.cbsProjectTypeName ? res.result.projectEnterprise.cbsProjectTypeName:"", + value: res.result.projectEnterprise.projectManage + ? res.result.projectEnterprise.projectManage + : "", + value2: res.result.projectEnterprise.cbsProjectTypeName + ? res.result.projectEnterprise.cbsProjectTypeName + : "", }, { fieldName: "施工阶段", fieldName2: "纬度位置", - value: res.result.projectEnterprise.constructionStageName?res.result.projectEnterprise.constructionStageName:"", - value2: res.result.projectEnterprise.latitude ? res.result.projectEnterprise.latitude :"", + value: res.result.projectEnterprise.constructionStageName + ? res.result.projectEnterprise.constructionStageName + : "", + value2: res.result.projectEnterprise.latitude + ? res.result.projectEnterprise.latitude + : "", }, { fieldName: "经度位置", fieldName2: "工程类别", - value: res.result.projectEnterprise.longitude ? res.result.projectEnterprise.longitude:"", - value2: res.result.projectEnterprise.projectTypeName?res.result.projectEnterprise.projectTypeName:"", + value: res.result.projectEnterprise.longitude + ? res.result.projectEnterprise.longitude + : "", + value2: res.result.projectEnterprise.projectTypeName + ? res.result.projectEnterprise.projectTypeName + : "", }, { fieldName: "项目编号", fieldName2: "结构类型", - value: res.result.projectEnterprise.projectNumber ? res.result.projectEnterprise.projectNumber:"", - value2: res.result.projectEnterprise.structureTypeName ? res.result.projectEnterprise.structureTypeName:"", + value: res.result.projectEnterprise.projectNumber + ? res.result.projectEnterprise.projectNumber + : "", + value2: res.result.projectEnterprise.structureTypeName + ? res.result.projectEnterprise.structureTypeName + : "", }, { fieldName: "项目面积(m²)", fieldName2: "工程状态", - value: res.result.projectEnterprise.projectAcreage ? res.result.projectEnterprise.projectAcreage:"", - value2: this.$t('message.companyDiagram.BUILDSTATUS')[res.result.projectEnterprise.bulidStatus].name, + value: res.result.projectEnterprise.projectAcreage + ? res.result.projectEnterprise.projectAcreage + : "", + value2: this.$t("message.companyDiagram.BUILDSTATUS")[ + res.result.projectEnterprise.bulidStatus + ].name, }, { fieldName: "开工日期", fieldName2: "竣工日期", - value: res.result.projectEnterprise.startWorkDate?res.result.projectEnterprise.startWorkDate:"", - value2: res.result.projectEnterprise.completionDate ? res.result.projectEnterprise.completionDate :"", + value: res.result.projectEnterprise.startWorkDate + ? res.result.projectEnterprise.startWorkDate + : "", + value2: res.result.projectEnterprise.completionDate + ? res.result.projectEnterprise.completionDate + : "", }, { fieldName: "现场布置图", fieldName2: "现场施工图", - value: res.result.projectEnterprise.layoutImage && JSON.parse(res.result.projectEnterprise.layoutImage) instanceof Array && JSON.parse(res.result.projectEnterprise.layoutImage).length > 0? JSON.parse(res.result.projectEnterprise.layoutImage).map(item => { - return { - name: item.name, - url: this.$store.state.FILEURL + item.url, - } - }) :"", - value2: res.result.projectEnterprise.constructionMapUrl && JSON.parse(res.result.projectEnterprise.constructionMapUrl) instanceof Array && JSON.parse(res.result.projectEnterprise.constructionMapUrl).length > 0 ? JSON.parse(res.result.projectEnterprise.constructionMapUrl).map(item => { - return { - name: item.name, - url: this.$store.state.FILEURL + item.url, - } - }):"", + value: + res.result.projectEnterprise.layoutImage && + JSON.parse(res.result.projectEnterprise.layoutImage) instanceof + Array && + JSON.parse(res.result.projectEnterprise.layoutImage).length > 0 + ? JSON.parse(res.result.projectEnterprise.layoutImage).map( + (item) => { + return { + name: item.name, + url: this.$store.state.FILEURL + item.url, + }; + } + ) + : "", + value2: + res.result.projectEnterprise.constructionMapUrl && + JSON.parse( + res.result.projectEnterprise.constructionMapUrl + ) instanceof Array && + JSON.parse(res.result.projectEnterprise.constructionMapUrl) + .length > 0 + ? JSON.parse( + res.result.projectEnterprise.constructionMapUrl + ).map((item) => { + return { + name: item.name, + url: this.$store.state.FILEURL + item.url, + }; + }) + : "", }, { fieldName: "联系电话", - value: res.result.projectEnterprise.projectTel?res.result.projectEnterprise.projectTel:"", + value: res.result.projectEnterprise.projectTel + ? res.result.projectEnterprise.projectTel + : "", }, ]; this.infoEnterpriseId = res.result.id; // this.getDataDateils(); - console.log(this.enterpriseInfo,666777888) + console.log(this.enterpriseInfo, 666777888); } }); }, @@ -652,20 +757,34 @@ export default { getQueryById() { let data = { // enterpriseId: this.$props.projectEnterpriseId, - enterpriseId: this.infoEnterpriseId + enterpriseId: this.infoEnterpriseId, }; getQueryByIdListApi(data).then((res) => { if (res.code == 200) { - this.qualificationList = res.result; - this.qualificationList.map(item => { + // console.log(22222222, res.result) + this.qualificationList = res.result.map((item) => { + // console.log(!item.fileUrl.includes(this.$store.state.FILEURL)) if (!item.fileUrl.includes(this.$store.state.FILEURL)) { - if(item.fileUrl.includes("name")){ + // console.log(item.fileUrl.includes("name")) + const imageType = [ '.jpg','.png', '.jpeg'] + if (item.fileUrl.includes("name")) { + const name = JSON.parse(item.fileUrl)[0].name; + const type = name.substring(name.indexOf('.'),name.length); + console.log(type) + item.flag = imageType.includes(type); + console.log(item.flag) + item.fileNameNew = name; item.fileUrl = this.$store.state.FILEURL + JSON.parse(item.fileUrl)[0].url; + // // this.$set(item, "fileNameNew", JSON.parse(item.fileUrl)[0].name) } else { item.fileUrl = this.$store.state.FILEURL + item.fileUrl; } } - }) + return { + ...item + } + }); + // console.log(111111111, this.qualificationList) } }); }, @@ -674,6 +793,7 @@ export default { // type 1新增企业资质按钮 2新增不良记录按钮 if (type === 1) { this.qualificationDialog = true; + this.fileList = []; this.$nextTick(() => { this.$refs.qualificationForm.resetFields(); }); @@ -687,18 +807,18 @@ export default { // 新增企业资质 addQualification() { this.$refs.qualificationForm.validate((valid) => { - console.log('新增的参数',this.qualificationForm); + console.log("新增的参数", this.qualificationForm); if (valid) { let data = this.qualificationForm; // (data.enterpriseId = this.$props.projectEnterpriseId), data.enterpriseId = this.infoEnterpriseId; - addEnterpriseQualification(data).then((res) => { - // console.log('新增成功了吗',res) - this.getQueryById(); - this.$refs.upload.clearFiles(); - this.fileList = []; - this.$refs.qualificationForm.resetFields(); - }); + addEnterpriseQualification(data).then((res) => { + // console.log('新增成功了吗',res) + this.getQueryById(); + this.$refs.upload.clearFiles(); + this.fileList = []; + this.$refs.qualificationForm.resetFields(); + }); this.qualificationDialog = false; } else { console.log("error submit!!"); @@ -743,8 +863,13 @@ export default { }, // 资质文件上传成功 handleSuccess(file) { - console.log('上传成功放回的值',file) - let data = { name: file.data[0].filename, url: file.data[0].imageUrl }; + console.log("上传成功放回的值", file); + let data = { + name: file.data[0].fileInfo.originalFilename + ? file.data[0].fileInfo.originalFilename + : file.data[0].filename, + url: file.data[0].imageUrl, + }; // let data = { name: file.data[0].fileInfo.attr.originalFilename, url: file.data[0].imageUrl }; this.fileList.push(data); this.qualificationForm.fileUrl = @@ -765,20 +890,20 @@ export default { }, // 判断上传的是否为图片 handleBeforeUpload(file) { - var img = file.name.substring(file.name.lastIndexOf('.') + 1) - const suffix = img === 'jpg' - const suffix2 = img === 'png' - const suffix3 = img === 'jpeg' - const isLt1M = file.size / 1024 / 1024 < 1; - if (!suffix && !suffix2 && !suffix3) { - this.$message.error("只能上传图片!"); - return false - } - // 可以限制图片的大小 - if (!isLt1M) { - this.$message.error('上传图片大小不能超过 1MB!'); - } - return suffix || suffix2 || suffix3 + // var img = file.name.substring(file.name.lastIndexOf('.') + 1) + // const suffix = img === 'jpg' + // const suffix2 = img === 'png' + // const suffix3 = img === 'jpeg' + // const isLt1M = file.size / 1024 / 1024 < 1; + // if (!suffix && !suffix2 && !suffix3) { + // this.$message.error("只能上传图片!"); + // return false + // } + // // 可以限制图片的大小 + // if (!isLt1M) { + // this.$message.error('上传图片大小不能超过 1MB!'); + // } + // return suffix || suffix2 || suffix3 }, //截取图片地址 @@ -792,20 +917,20 @@ export default { showArr.push(this.fileUrl + showUrl); } return showArr; - } else if(type == 2) { + } else if (type == 2) { let arr = JSON.parse(url); // this.matchResult = arr.match("(.+?).(png|jpg|gif)"); // console.log('this.matchResult',this.matchResult) // arr = arr.split(","); let showArr = []; - showArr = arr.map((item)=>{ - let showUrl = item.url - let showArray = [] + showArr = arr.map((item) => { + let showUrl = item.url; + let showArray = []; showArray.push(this.fileUrl + showUrl); - return showArray - }) + return showArray; + }); return showArr; - + // for (let i = 0; i < arr.length; i++) { // let showUrl = arr[i].url; // // showArr.push(this.fileUrl + showUrl); @@ -817,7 +942,6 @@ export default { // } // } // console.log('showArr',showArr) - } }, @@ -830,6 +954,9 @@ export default { }; \ No newline at end of file +