| | |
| | | |
| | | formFields: [], |
| | | formFields_criteria: [], |
| | | |
| | | fileobj: {}, |
| | | ocrobj: {}, |
| | | formData: {}, |
| | | formData_criteria: {}, |
| | | formData1:[], |
| | |
| | | this.formAttr.disabled = true; |
| | | } |
| | | else if (this.popupParames.sceneCode == "edit") {//编辑 |
| | | var newEntity_ = { |
| | | name: "md_org_account_criteria", |
| | | url: "root/data/getEntitySet", |
| | | paramsobj: {dataname: 'md_org_account_criteria',parent_id:this.popupParames.data.id}, |
| | | isnotoption: true, //true:不是选项 |
| | | } |
| | | this.dataRequest.push(newEntity_); |
| | | |
| | | // if (this.newformData) { |
| | | // let formData_ = clone(this.formData); |
| | | |
| | | // for (var k in this.newformData) { |
| | | // formData_[k] = this.newformData[k]; |
| | | // } |
| | | // this.formData = formData_; |
| | | // } |
| | | this.isedit = true; |
| | | } |
| | | else if (this.popupParames.sceneCode == "approval") {//审批 |
| | |
| | | me.tableFieldClick(); |
| | | } |
| | | me.formData = getDataByFields(me.formData, me.formFields); |
| | | |
| | | if (me.formData.file_authorization_content) { |
| | | me.imgurl = config.url_root + "starwaytestroot/file/getFile?category=org&token=" + Root.getToken() + "&id=" + me.formData.file_authorization_content; |
| | | } |
| | | if (me.rowData[me.dataname]) { |
| | | me.formData = clone(me.rowData[me.dataname]); |
| | | } |
| | |
| | | } |
| | | }); |
| | | }, |
| | | uploadFileFun_file(one,fileList,type) { |
| | | var me = this; |
| | | me.imgLoading = true |
| | | me.imgurl =URL.createObjectURL(one.raw) //保持文件在本窗口,否则会加载失败 |
| | | // me.imgurl = one.url |
| | | // console.log(one+fileList+type) |
| | | |
| | | |
| | | submitUpload(one, fileList, type) { |
| | | this.isOCR = false; |
| | | let me = this; |
| | | let formData = new FormData(); |
| | | var ocrtype = ""; |
| | | formData.append("oneFile", one.raw); |
| | | |
| | | formData.append("id", me.formData.id); |
| | | formData.append("dataName", "md_org_register"); |
| | | formData.append("field_fileName", "file_name_certificate_original"); |
| | | formData.append("field_fileId", "file_certificate_original"); |
| | | |
| | | uploadFile(me, formData, result_ => { |
| | | me.uploade_state = true; |
| | | // me.formData.file_authorization_content = result_.data.file.file_index_id; |
| | | me.uploadFileFun_file(one, fileList, type); |
| | | |
| | | }, function() {}, ocrtype); |
| | | }, |
| | | |
| | | uploadFileFun_file(one, fileList, type) { |
| | | let me = this; |
| | | let formData = new FormData() |
| | | formData.append("category" , "org"); |
| | | formData.append("oneFile" , one.raw); |
| | | |
| | | formData.append("id", me.formData.id); |
| | | formData.append("dataName", "md_org_register"); |
| | | formData.append("field_fileName", "file_name_certificate_original"); |
| | | formData.append("field_fileId", "file_certificate_original"); |
| | | |
| | | me.imgLoading = true; |
| | | uploadFileOCR("bizLicense", me, formData, function(result_){ |
| | | var form_data_ = {}; |
| | | |
| | | if (result_.data && result_.data.data && result_.data.data.upload && result_.data.data.ocr && result_.data.data.ocr.operator) { |
| | | var file_ = result_.data.data.upload; |
| | | var ocr_ = result_.data.data.ocr; |
| | | |
| | | if (typeof(ocr_.content)=="string") { |
| | | ocr_.content = JSON.parse(ocr_.content); |
| | | } |
| | | |
| | | for (var k in ocr_.content) { |
| | | // var v_ = decodeURI(ocr_[k]); |
| | | var v_ = ocr_.content[k]; |
| | | if ( "string" == typeof v_) { |
| | | //去除两端的空格 |
| | | v_ = v_.replace(/(^\s*)|(\s*$)/g, ""); |
| | | //去除中间的回车换行 |
| | | v_ = v_.replace(/[\r\n]/g,""); |
| | | //去除中间所有" |
| | | v_ = v_.replace(/\"/g,""); |
| | | } |
| | | form_data_[k] = v_; |
| | | } |
| | | |
| | | me.fileobj = file_; |
| | | me.ocrobj = form_data_; |
| | | console.log("识别信息",form_data_); |
| | | me.imgurl = config.url_root + "starwaytestroot/file/getFile?category=org&token=" + Root.getToken() + "&id=" + file_.indexid; |
| | | me.formData.file_authorization_content = file_.indexid; |
| | | } |
| | | else { |
| | | me.$message({ |
| | | type:"warning", |
| | | message:"识别失败" |
| | | }) |
| | | } |
| | | |
| | | if (me.ocrobj.validToDate) { |
| | | var txt = me.ocrobj.validToDate; |
| | | me.ocrobj.validToDate = me.newOcrDate(txt); |
| | | } |
| | | |
| | | if (me.ocrobj.validFromDate) { |
| | | var txt = me.ocrobj.validFromDate; |
| | | me.ocrobj.validFromDate = me.newOcrDate(txt); |
| | | } |
| | | |
| | | var from_ = clone(me.formData); |
| | | console.log(form_data_); |
| | | // from_.register_address = form_data_.Address || null; |
| | | // from_.certificate_no = me.ocrobj.RegNum || null; // 营业执照-证照编号 |
| | | // from_.name = form_data_.Name; |
| | | // from_.certificate_date_from = form_data_.SetDate; |
| | | // from_.certificate_date_to = form_data_.Period; |
| | | // from_.certificate_legal_representative = form_data_.Person; |
| | | // from_.certificate_scope = form_data_.Business; |
| | | |
| | | from_.register_address = form_data_.businessAddress || null; |
| | | from_.license_business_no = me.ocrobj.creditCode || null; // 营业执照-证照编号 |
| | | from_.name = form_data_.companyName; |
| | | from_.license_business_name = form_data_.companyName; |
| | | from_.license_business_date_from = form_data_.validFromDate; |
| | | from_.license_business_date_to = form_data_.validToDate; |
| | | from_.certificate_legal_representative = form_data_.legalPerson; |
| | | from_.certificate_scope = form_data_.businessScope; |
| | | |
| | | me.formData = from_; |
| | | |
| | | me.imgLoading = false; |
| | | |
| | | }, function() { |
| | | me.$message({ |
| | | type:"warning", |
| | | message:"识别失败" |
| | | }) |
| | | me.imgLoading = false; |
| | | }); |
| | | }, |
| | | |
| | | newOcrDate(txt) { |
| | | var txtList = txt.split("至"); |
| | | if(txtList[0] == "年月日"){ |
| | | txt = "2099-12-31"; |
| | | } |
| | | else { |
| | | if (txtList.length > 1) { |
| | | if(txtList[1].indexOf("长期") != -1 || txtList[1].indexOf("永久") != -1 || txtList[1].indexOf("不约定期限") != -1){//不约定期限 |
| | | txt = "2099-12-31"; |
| | | } |
| | | else { |
| | | txt = txtList[1]; |
| | | |
| | | txt = txt.replace("年", "-"); |
| | | txt = txt.replace("月", "-"); |
| | | txt = txt.replace("日", ""); |
| | | var datas_ = txt.split("-"); |
| | | var txt_ = ""; |
| | | datas_.map(d=>{ |
| | | d = d * 1; |
| | | if (txt_ == "") { |
| | | txt_ = d; |
| | | } |
| | | else { |
| | | txt_ += "-" + d; |
| | | } |
| | | }) |
| | | txt = txt_.toString(); |
| | | if(txt && txt.search && txt.search(/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/) == -1) { |
| | | txt = "" |
| | | } |
| | | //licenceObj_[k] = txt; |
| | | } |
| | | } |
| | | else if (txtList.length == 1) { |
| | | txt = txtList[0]; |
| | | if(txt.indexOf("长期") != -1 || txt.indexOf("永久") != -1 || txt.indexOf("不约定期限") != -1){ |
| | | txt = "2099-12-31"; |
| | | } |
| | | if (txt.indexOf("年") != -1) { |
| | | var Date = txt.replace("年", "-").replace("月", "-").replace("日", ""); |
| | | txt = Date; |
| | | } else if (txt.length == 8) { |
| | | var Date = txt.slice(0, 4) + "-" + txt.slice(4, 6) + "-" + txt.slice(6, 8); |
| | | txt = Date; |
| | | } else { |
| | | txt = ""; |
| | | } |
| | | |
| | | if(txt && txt.search && txt.search(/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/) == -1) { |
| | | txt = "" |
| | | } |
| | | } |
| | | } |
| | | return txt; |
| | | }, |
| | | |
| | | showThumbnail(file, type, num) { |
| | | var me = this; |
| | | |
| | | if(num == "2"){ |
| | | return me.fileUrl; |
| | | } |
| | | if(type == "pic") { |
| | | return file.url; |
| | | } |
| | | console.log(file) |
| | | // var me = this; |
| | | |
| | | // if(num == "2"){ |
| | | // return me.fileUrl; |
| | | // } |
| | | // if(type == "pic") { |
| | | // me.imgurl = file.url |
| | | // return file.url; |
| | | // } |
| | | |
| | | }, |
| | | var me = this; |
| | | |
| | | if(num == "2"){ |
| | | return me.fileUrl; |
| | | } |
| | | if(type == "pic") { |
| | | return file.url; |
| | | } |
| | | }, |
| | | |
| | | delyyzz() {//删除营业执照 |
| | | var me = this; |
| | | me.imgurl = ""; |
| | | me.formData1 = [] |
| | | me.imgurl = ""; |
| | | if (me.fileobj.indexid) { |
| | | me.fileobj.indexid = "" |
| | | } |
| | | me.formData.file_authorization_content = "" |
| | | }, |
| | | |
| | | //提交 |
| | |
| | | data: {}, |
| | | } |
| | | //新增的情况 |
| | | me.formdata_group.map(group => { |
| | | me.formdata_group.map(group => {// |
| | | group.children.map(unitobj => { |
| | | var row_ = { |
| | | id: uuid_short(), |
| | |
| | | </div> |
| | | <div :style="{height: dheight + 'px', 'overflow-y': 'auto'}"> |
| | | <!-- <div style="position: absolute; top:40px; bottom: 50px; left: 0px; right: 0px; overflow-y: auto;"> --> |
| | | <div class="el-dialog__body" style="width: 20%; float: left;"> |
| | | <el-image |
| | | v-if="imgurl.length>0" |
| | | :style="{width: '100%', 'max-height': dheight + 'px'}" |
| | | :src="imgurl" |
| | | :preview-src-list="[imgurl]"> |
| | | </el-image> |
| | | <el-upload |
| | | v-else-if="!imgurl" |
| | | class="ocr_img" |
| | | action="#" style="margin-top: 15px;margin-bottom: 15px;" accept="image/jpeg,image/gif,image/png" |
| | | ref="reportUpload1" list-type="picture-card" :file-list="formData1" |
| | | :on-change="(file, fileList) => {uploadFileFun_file(file, fileList, '1')}" :auto-upload="false"> |
| | | <!-- <i slot="default" class="el-icon-plus"></i> --> |
| | | <span style="font-size: 14px; color: #909399;">营业执照上传</span> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img class="el-upload-list__item-thumbnail" :src="showThumbnail(file, 'pic', '1')" alt=""> |
| | | </div> |
| | | </el-upload> |
| | | <el-button v-if="imgurl" size="small" type="danger" @click="delyyzz">删除营业执照</el-button> |
| | | <div v-loading.fullscreen.lock="imgLoading" element-loading-text="OCR识别中" style="width: 30%; float: left; overflow: hidden;"> |
| | | <el-image |
| | | v-if="imgurl && !imgLoading" |
| | | :style="{width: '100%', 'max-height': dheight - 50 + 'px'}" |
| | | :src="imgurl" |
| | | :preview-src-list="[imgurl]"> |
| | | </el-image> |
| | | |
| | | <div v-else-if="!imgLoading && (isedit || isrefuseedit)" class="ocr_img"> |
| | | <el-upload action="#" style="margin-top: 15px;margin-bottom: 15px;" |
| | | accept="image/jpeg,image/gif,image/png" |
| | | ref="reportUpload1" |
| | | list-type="picture-card" |
| | | :file-list="formData1.mdm_img" |
| | | :on-change="(file, fileList) => {submitUpload(file, fileList, '1')}" |
| | | :auto-upload="false"> |
| | | <!-- <i slot="default" class="el-icon-plus"></i> --> |
| | | <span style="font-size: 14px; color: #909399;">营业执照上传</span> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img class="el-upload-list__item-thumbnail" :src="showThumbnail(file, 'pic', '1')" alt=""> |
| | | </div> |
| | | </el-upload> |
| | | </div> |
| | | <el-button v-if="imgurl && (isedit || isrefuseedit)" size="small" type="danger" @click="delyyzz">删除营业执照</el-button> |
| | | </div> |
| | | |
| | | <div class="el-dialog__body" style="width: 79%; float: right;"> |
| | | <div class="el-dialog__body" style="width: 69%; float: right;"> |
| | | <h-form |
| | | ref="form1" |
| | | :form-attr="formAttr" |
| | |
| | | > |
| | | </h-form> |
| | | </div> |
| | | <div v-if='formFields.length>0' class="el-dialog__body" style="width: 100%; float: right; "> |
| | | <!-- <div v-if='formFields.length>0' class="el-dialog__body" style="width: 100%; float: right; "> |
| | | <div style="border: 1px solid #C0C4CC ;padding: 5px"> |
| | | <div class="h_table_title"><i class="iconfont icon-fuzhushuxian" style="color: rgb(2, 112, 193);"></i><span style="font-size: 16px;">推广商评分</span></div> |
| | | </i> |
| | | <!-- <el-row style="display: flex;flex-direction: row;justify-content:space-between;padding-left: 91px;padding-top: 10px;" > |
| | | <el-col :span="16"><div class="itemgroup_field"><span>评分项</span></div></el-col> |
| | | <el-col :span="8"><div class="itemgroup_field"><span>评分</span></div></el-col> |
| | | </el-row> --> |
| | | <div style="width: 100%;height: 5px;margin: 10px 0px 25px 0px;background-color: gainsboro; opacity: 40%;"></div> |
| | | <template v-for="(formgroup, k) in formdata_group"> |
| | | <div style="display: flex;justify-content: space-between;padding: 5px;"> |
| | | <div style="width: 7%; display: flex; align-items: center; justify-content: center; text-align: center;font-weight: bold;border-right: 3px solid gainsboro;"> |
| | | <div style="display: flex;justify-content: center;align-items: center;margin-right: 15px;"> |
| | | <!-- {{formgroup.groupname}} --> |
| | | {{formgroup.group_name}} |
| | | </div> |
| | | </div> |
| | |
| | | <el-col :span="6" class="itemgroup_row_item"> |
| | | <div> |
| | | <span :class="[unitobj.required_no ? 'me_h_nounitlabel' : 'me_h_unitlabel']" style="font-size: 12px;"> |
| | | <!-- {{unitobj.content_before}} --> |
| | | {{unitobj.content_before}} |
| | | </span> |
| | | </div> |
| | |
| | | <div style="width: 100%;height: 5px;margin: 25px 0px;background-color: gainsboro;opacity: 40%"></div> |
| | | </template > |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | <!-- <div class="el-dialog__footer" style="position: absolute; bottom: 0px; left: 0px; right: 0px;"> |
| | | <el-button size="small" type="default" @click="reasonvisible = false">取 消</el-button> |