|
@@ -26,7 +26,7 @@
|
|
<el-tag
|
|
<el-tag
|
|
:label="item.id"
|
|
:label="item.id"
|
|
:value="item.licenseName"
|
|
:value="item.licenseName"
|
|
- :type="item.serviceState == '0' ? 'info' : 'danger'"
|
|
|
|
|
|
+ :type="item.serviceState == '0' ? 'danger' : 'info'"
|
|
style="width: 7.5vw; text-align: center; height: 4vh; line-height:4vh;"
|
|
style="width: 7.5vw; text-align: center; height: 4vh; line-height:4vh;"
|
|
effect="plain">
|
|
effect="plain">
|
|
{{ item.licenseName }}
|
|
{{ item.licenseName }}
|
|
@@ -38,7 +38,7 @@
|
|
<el-tag
|
|
<el-tag
|
|
:label="item.id"
|
|
:label="item.id"
|
|
:value="item.licenseName"
|
|
:value="item.licenseName"
|
|
- :type="item.serviceState == '0' ? 'info' : 'danger'"
|
|
|
|
|
|
+ :type="item.serviceState == '0' ? 'danger' : 'info'"
|
|
style="width: 7.5vw; text-align: center; height: 4vh; line-height:4vh;"
|
|
style="width: 7.5vw; text-align: center; height: 4vh; line-height:4vh;"
|
|
effect="plain">
|
|
effect="plain">
|
|
{{ item.licenseName }}
|
|
{{ item.licenseName }}
|
|
@@ -76,7 +76,7 @@
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<span>经营方式:<el-input v-model="form.businessType" placeholder="请输入经营方式" style="width: 60%" :disabled="isFlag"/></span>
|
|
<span>经营方式:<el-input v-model="form.businessType" placeholder="请输入经营方式" style="width: 60%" :disabled="isFlag"/></span>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="5">
|
|
|
|
|
|
+ <el-col :span="6">
|
|
<span>
|
|
<span>
|
|
有效期至:
|
|
有效期至:
|
|
<el-date-picker
|
|
<el-date-picker
|
|
@@ -99,7 +99,7 @@
|
|
<el-form-item class="container">
|
|
<el-form-item class="container">
|
|
<el-button type="primary" style="margin-right: 4vw;" @click="upload()" :disabled="isFlag">上传证照</el-button>
|
|
<el-button type="primary" style="margin-right: 4vw;" @click="upload()" :disabled="isFlag">上传证照</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item style="margin-left: -3vw; border: 5px solid #fff; padding: 5px; padding-top: 15px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);">
|
|
|
|
|
|
+ <el-form-item style="height: 205px; margin-left: -3vw; border: 5px solid #fff; padding: 5px; padding-top: 15px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);">
|
|
<el-col :span="3" v-for="imgs in imgList" :key="'index4-'+imgs.id" style="border-right: 1px solid #ebeef5;">
|
|
<el-col :span="3" v-for="imgs in imgList" :key="'index4-'+imgs.id" style="border-right: 1px solid #ebeef5;">
|
|
<el-image
|
|
<el-image
|
|
:src="imgs.filepath"
|
|
:src="imgs.filepath"
|
|
@@ -177,8 +177,8 @@
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<div class="button-container">
|
|
<div class="button-container">
|
|
<el-button type="danger" @click="qx" >取消</el-button>
|
|
<el-button type="danger" @click="qx" >取消</el-button>
|
|
- <el-button type="danger" @click="tj" v-show="!isFlag">提交</el-button>
|
|
|
|
- <el-button type="danger" @click="bc" v-show="!isFlag">保存</el-button>
|
|
|
|
|
|
+ <el-button type="danger" @click="tj(2)" v-show="!isFlag">提交</el-button>
|
|
|
|
+ <el-button type="danger" @click="bc(1)" v-show="!isFlag">保存</el-button>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
@@ -191,9 +191,9 @@
|
|
<el-upload
|
|
<el-upload
|
|
list-type="picture"
|
|
list-type="picture"
|
|
class="upload-demo"
|
|
class="upload-demo"
|
|
- :action="uploadUrl"
|
|
|
|
- :on-success="handleSuccess"
|
|
|
|
|
|
+ action="#"
|
|
:on-remove="handleRemove"
|
|
:on-remove="handleRemove"
|
|
|
|
+ :http-request="handleFileUpload"
|
|
:file-list="fileList">
|
|
:file-list="fileList">
|
|
<i class="el-icon-upload"></i>
|
|
<i class="el-icon-upload"></i>
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
@@ -207,13 +207,16 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
- import { getToken } from '@/utils/auth'
|
|
|
|
- import { zjCompanyInfo, byCompanyCode, zjLicenseInfo, byLicenseId } from "@/api/qualityControl/qualityControl";
|
|
|
|
-
|
|
|
|
|
|
+ import axios from 'axios';
|
|
|
|
+ import { getToken } from '@/utils/auth';
|
|
|
|
+ import { zjCompanyInfo, byCompanyCode, zjLicenseInfo, byLicenseId, upload, addOrEdit, getLicenseType } from "@/api/qualityControl/qualityControl";
|
|
export default {
|
|
export default {
|
|
name: "qualityControlDetail",
|
|
name: "qualityControlDetail",
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ key:'53cfd89363924f95b75b7221b6d0bfe3',
|
|
|
|
+ endpoint:'https://zhiguan.cognitiveservices.azure.cn/',
|
|
|
|
+ imgs: '',
|
|
isFlag: false,
|
|
isFlag: false,
|
|
form: {
|
|
form: {
|
|
xxx: '2'
|
|
xxx: '2'
|
|
@@ -235,26 +238,9 @@ export default {
|
|
},
|
|
},
|
|
// 主表ID
|
|
// 主表ID
|
|
id: '',
|
|
id: '',
|
|
- items1: [
|
|
|
|
- ],
|
|
|
|
- items2: [
|
|
|
|
- ],
|
|
|
|
- options: [{
|
|
|
|
- value: '选项1',
|
|
|
|
- label: '黄金糕'
|
|
|
|
- }, {
|
|
|
|
- value: '选项2',
|
|
|
|
- label: '双皮奶'
|
|
|
|
- }, {
|
|
|
|
- value: '选项3',
|
|
|
|
- label: '蚵仔煎'
|
|
|
|
- }, {
|
|
|
|
- value: '选项4',
|
|
|
|
- label: '龙须面'
|
|
|
|
- }, {
|
|
|
|
- value: '选项5',
|
|
|
|
- label: '北京烤鸭'
|
|
|
|
- }],
|
|
|
|
|
|
+ items1: [],
|
|
|
|
+ items2: [],
|
|
|
|
+ options: [],
|
|
scopeLevelList: [
|
|
scopeLevelList: [
|
|
{
|
|
{
|
|
value: '1',
|
|
value: '1',
|
|
@@ -318,8 +304,43 @@ export default {
|
|
this.tableData = response.data
|
|
this.tableData = response.data
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ getLicenseType().then(res=>{
|
|
|
|
+ if(res.code == '200'){
|
|
|
|
+ this.options = res.data
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+
|
|
|
|
+ // 修改时自定义上传方法
|
|
|
|
+ handleFileUpload(params){
|
|
|
|
+ let newfile=params.file
|
|
|
|
+ let suffix = (newfile.name).substr((newfile.name).lastIndexOf("."));
|
|
|
|
+ newfile =new File([params.file], this.randomLong()+`${suffix}`)
|
|
|
|
+ newfile.uid=params.file.uid // new File 没有uid属性,会导致组件底层报错,这里手动加上
|
|
|
|
+ console.log(newfile)
|
|
|
|
+ // 使用FormData传参数和文件
|
|
|
|
+ var fileForm = new FormData();
|
|
|
|
+ // 文件
|
|
|
|
+ fileForm.append("file", newfile);
|
|
|
|
+ // 调用封装好的上传方法,传给后台FormData
|
|
|
|
+ upload(fileForm).then(res=>{
|
|
|
|
+ if(res && res.data.code == 200){
|
|
|
|
+ this.fileList.push({
|
|
|
|
+ 'id': res.data.id,
|
|
|
|
+ 'name':res.data.filename,
|
|
|
|
+ 'url': process.env.NODE_ENV == "development"
|
|
|
|
+ ? "https://dev-sy.derom.com/document-center/minio/"+res.data.filepath
|
|
|
|
+ : "https://sy.derom.com/document-center/minio/"+res.data.filepath
|
|
|
|
+ })
|
|
|
|
+ this.imgs = process.env.NODE_ENV == "development"
|
|
|
|
+ ? "https://sy.derom.com/01762feca72748b9b343c861753fe6f.png"
|
|
|
|
+ : "https://sy.derom.com/document-center/minio/"+res.data.filepath
|
|
|
|
+ this.sends()
|
|
|
|
+ this.$modal.msgSuccess("上传成功");
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
upload(){
|
|
upload(){
|
|
this.fileList = [];
|
|
this.fileList = [];
|
|
this.imgList.forEach(element => {
|
|
this.imgList.forEach(element => {
|
|
@@ -338,15 +359,6 @@ export default {
|
|
})
|
|
})
|
|
.catch(_ => {});
|
|
.catch(_ => {});
|
|
},
|
|
},
|
|
- handleSuccess(e){
|
|
|
|
- this.fileList.push({
|
|
|
|
- 'id': e.id,
|
|
|
|
- 'name':e.filename,
|
|
|
|
- 'url': process.env.NODE_ENV == "development"
|
|
|
|
- ? "https://dev-sy.derom.com/document-center/minio/"+e.filepath
|
|
|
|
- : "https://sy.derom.com/document-center/minio/"+e.filepath
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
canclUpload(){
|
|
canclUpload(){
|
|
this.dialogVisible = false;
|
|
this.dialogVisible = false;
|
|
},
|
|
},
|
|
@@ -375,17 +387,10 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
addTable() {
|
|
addTable() {
|
|
- const newRow = { id: this.randomLong(), one: '', two: '', three: '', four: '' };
|
|
|
|
|
|
+ const newRow = { id: this.randomLong(), scopeLevel: '', code: '', name: '', remark: '' };
|
|
this.tableData.push(newRow);
|
|
this.tableData.push(newRow);
|
|
},
|
|
},
|
|
deleteTable(e) {
|
|
deleteTable(e) {
|
|
- if(this.tableData.length === 1){
|
|
|
|
- this.$message({
|
|
|
|
- message: '当前行无法删除, 请至少保留一条适用科室信息!',
|
|
|
|
- type: 'warning'
|
|
|
|
- });
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
this.tableData = this.tableData.filter(row =>
|
|
this.tableData = this.tableData.filter(row =>
|
|
row.id != e.id
|
|
row.id != e.id
|
|
);
|
|
);
|
|
@@ -401,12 +406,176 @@ export default {
|
|
qx(){
|
|
qx(){
|
|
this.$router.go(-1)
|
|
this.$router.go(-1)
|
|
},
|
|
},
|
|
- tj(){
|
|
|
|
-
|
|
|
|
|
|
+ tj(state){
|
|
|
|
+ this.form.workState = state;
|
|
|
|
+ this.$set(this.form, 'zjBusinessScopeList', this.tableData)
|
|
|
|
+ this.$set(this.form, 'organizationId', this.baseInfoData.organizationId);
|
|
|
|
+ this.$set(this.form, 'companyAttributes', this.baseInfoData.companyAttributes);
|
|
|
|
+ this.$set(this.form, 'companySourceCode', this.baseInfoData.companySourceCode);
|
|
|
|
+ if(this.imgList.length>0){
|
|
|
|
+ let pics = '';
|
|
|
|
+ this.imgList.forEach(element => {
|
|
|
|
+ pics += element.id+',';
|
|
|
|
+ });
|
|
|
|
+ if(pics!=''){
|
|
|
|
+ pics = pics.slice(0, -1);
|
|
|
|
+ this.form.licensePicture = pics;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ addOrEdit(this.form).then(res=>{
|
|
|
|
+ if(res.code == 200){
|
|
|
|
+ this.$modal.msgSuccess("提交成功");
|
|
|
|
+ this.$router.go(-1)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ bc(state){
|
|
|
|
+ this.form.workState = state;
|
|
|
|
+ this.$set(this.form, 'zjBusinessScopeList', this.tableData)
|
|
|
|
+ this.$set(this.form, 'organizationId', this.baseInfoData.organizationId);
|
|
|
|
+ this.$set(this.form, 'companyAttributes', this.baseInfoData.companyAttributes);
|
|
|
|
+ this.$set(this.form, 'companySourceCode', this.baseInfoData.companySourceCode);
|
|
|
|
+ if(this.imgList.length>0){
|
|
|
|
+ let pics = '';
|
|
|
|
+ this.imgList.forEach(element => {
|
|
|
|
+ pics += element.id+',';
|
|
|
|
+ });
|
|
|
|
+ if(pics!=''){
|
|
|
|
+ pics = pics.slice(0, -1);
|
|
|
|
+ this.form.licensePicture = pics;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ addOrEdit(this.form).then(res=>{
|
|
|
|
+ if(res.code == 200){
|
|
|
|
+ this.$modal.msgSuccess("保存成功");
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ async sends(){
|
|
|
|
+ const response = await axios.post('https://zhiguan.cognitiveservices.azure.cn/vision/v3.2/read/analyze', {'url': this.imgs}, {
|
|
|
|
+ headers: {
|
|
|
|
+ 'Ocp-Apim-Subscription-Key': this.key,
|
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ // console.log("A:::" + JSON.stringify(response))
|
|
|
|
+ if(response.status == '202'){
|
|
|
|
+ let Operations = response.headers["operation-location"];
|
|
|
|
+ // console.log("B:::" + Operations)
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.sendGet(Operations);
|
|
|
|
+ },1000)
|
|
|
|
+ }else{
|
|
|
|
+ console.log("图片解析失败!")
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async sendGet(url){
|
|
|
|
+ const res = await axios.get(url, {
|
|
|
|
+ headers: {
|
|
|
|
+ 'Ocp-Apim-Subscription-Key': this.key,
|
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ // console.log("C:::" + JSON.stringify(res))
|
|
|
|
+ if(res.data.status == 'succeeded'){
|
|
|
|
+ let ocrs = res.data.analyzeResult.readResults;
|
|
|
|
+ if(ocrs.length>0){
|
|
|
|
+ let lines = ocrs[0].lines;
|
|
|
|
+ lines.forEach((element,index) => {
|
|
|
|
+ console.log("A:::" + element.text)
|
|
|
|
+ if(element.text.includes('许可证编号')){
|
|
|
|
+ if(element.text.includes(':')){
|
|
|
|
+ this.form.licenseNumber = element.text.substr(6);
|
|
|
|
+ }else{
|
|
|
|
+ this.form.licenseNumber = element.text.substr(5);
|
|
|
|
+ }
|
|
|
|
+ this.form.licenseNumber = this.form.licenseNumber.split(' ').join('')
|
|
|
|
+ }
|
|
|
|
+ if(element.text.includes('许可证') && !element.text.includes('编号')){
|
|
|
|
+ this.form.licenseName = element.text;
|
|
|
|
+ this.form.licenseName = this.form.licenseName.split(' ').join('')
|
|
|
|
+ }
|
|
|
|
+ if(element.text.includes('发证机关')||element.text.includes('发证部门')||element.text.includes('颁证机构')){
|
|
|
|
+ if(element.text.includes(':')){
|
|
|
|
+ this.form.licenseCompany = element.text.substr(5);
|
|
|
|
+ }else{
|
|
|
|
+ this.form.licenseCompany = element.text.substr(4);
|
|
|
|
+ }
|
|
|
|
+ if(!lines[index+1].text.includes(":")){
|
|
|
|
+ this.form.licenseCompany += lines[index+1].text;
|
|
|
|
+ }
|
|
|
|
+ this.form.licenseCompany = this.form.licenseCompany.split(' ').join('').split(',').join('')
|
|
|
|
+ }
|
|
|
|
+ if(element.text.includes('生产方式') || element.text.includes('经营方式')){
|
|
|
|
+ if(element.text.includes(':')){
|
|
|
|
+ this.form.businessType = element.text.substr(5);
|
|
|
|
+ }else{
|
|
|
|
+ this.form.businessType = element.text.substr(4);
|
|
|
|
+ }
|
|
|
|
+ if(!lines[index+1].text.includes(":")){
|
|
|
|
+ this.form.businessType += lines[index+1].text;
|
|
|
|
+ }
|
|
|
|
+ this.form.businessType = this.form.businessType.split(' ').join('')
|
|
|
|
+ }
|
|
|
|
+ if(element.text.includes('有效期限') && !element.text.includes('至')){
|
|
|
|
+ let wb = '';
|
|
|
|
+ if(element.text.includes(':')){
|
|
|
|
+ wb = element.text.substr(5);
|
|
|
|
+ if(wb != ''){
|
|
|
|
+ wb = wb.replace('年','-');
|
|
|
|
+ wb = wb.replace('月','-');
|
|
|
|
+ wb = wb.replace('日','');
|
|
|
|
+ wb = wb.split(' ').join('')
|
|
|
|
+ this.form.validUntil = wb;
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ wb = element.text.substr(4);
|
|
|
|
+ if(wb != ''){
|
|
|
|
+ wb = wb.replace('年','-');
|
|
|
|
+ wb = wb.replace('月','-');
|
|
|
|
+ wb = wb.replace('日','');
|
|
|
|
+ wb = wb.split(' ').join('')
|
|
|
|
+ this.form.validUntil = wb;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(element.text.includes('至')){
|
|
|
|
+ let wb = '';
|
|
|
|
+ wb = element.text.substr(1);
|
|
|
|
+ if(wb != ''){
|
|
|
|
+ wb = wb.replace('年','-');
|
|
|
|
+ wb = wb.replace('月','-');
|
|
|
|
+ wb = wb.replace('日','');
|
|
|
|
+ wb = wb.split(' ').join('')
|
|
|
|
+ this.form.validUntil = wb;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(element.text.includes('发证日期')){
|
|
|
|
+ let wb = '';
|
|
|
|
+ if(element.text.includes(':')){
|
|
|
|
+ wb = element.text.substr(5);
|
|
|
|
+ if(wb != ''){
|
|
|
|
+ wb = wb.replace('年','-');
|
|
|
|
+ wb = wb.replace('月','-');
|
|
|
|
+ wb = wb.replace('日','');
|
|
|
|
+ wb = wb.split(' ').join('')
|
|
|
|
+ this.form.licenseDate = wb;
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ wb = element.text.substr(4);
|
|
|
|
+ if(wb != ''){
|
|
|
|
+ wb = wb.replace('年','-');
|
|
|
|
+ wb = wb.replace('月','-');
|
|
|
|
+ wb = wb.replace('日','');
|
|
|
|
+ wb = wb.split(' ').join('')
|
|
|
|
+ this.form.licenseDate = wb;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- bc(){
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|