提交 f2276614 编写于 作者: dmx_mac's avatar dmx_mac

Merge branch 'release' into test

import fetch from '../fetch'; import fetch from "../fetch";
import { getBaseUrl } from '@/utils/index'; import { getBaseUrl } from "@/utils/index";
export const uploadExcel = (data, projectId) => { export const uploadExcel = (data, projectId) => {
// return utils.checkAuth(()=>{ // return utils.checkAuth(()=>{
return fetch({ return fetch({
headers: { headers: {
'Content-Type': 'application/json;charset=UTF-8', "Content-Type": "application/json;charset=UTF-8",
sysCode: 12, sysCode: 12,
token: localStorage.getItem('storageToken'), token: localStorage.getItem("storageToken"),
}, },
url: getBaseUrl('portal/v2/role/importRoleFile?projectId=' + projectId), url: getBaseUrl("portal/v2/role/importRoleFile?projectId=" + projectId),
method: 'post', method: "post",
data: data, data: data,
description: '上传excel文件', description: "上传excel文件",
}) });
// }) // })
} };
export const uploadOrgExcel = (data, projectId) => { export const uploadOrgExcel = (data, projectId) => {
// return utils.checkAuth(()=>{ // return utils.checkAuth(()=>{
return fetch({ return fetch({
headers: { headers: {
'Content-Type': 'application/json;charset=UTF-8', "Content-Type": "application/json;charset=UTF-8",
sysCode: 12, sysCode: 12,
token: localStorage.getItem('storageToken'), token: localStorage.getItem("storageToken"),
}, },
url: getBaseUrl('portal/new/scope/org/v1/' + projectId + '/import'), url: getBaseUrl("portal/new/scope/org/v1/" + projectId + "/import"),
method: 'put', method: "put",
data: data, data: data,
description: '上传excel文件', description: "上传excel文件",
}) });
// }) // })
} };
export const uploadPersonExcel = (data, projectId) => { export const uploadPersonExcel = (data, projectId) => {
// return utils.checkAuth(()=>{ // return utils.checkAuth(()=>{
return fetch({ return fetch({
headers: { headers: {
'Content-Type': 'application/json;charset=UTF-8', "Content-Type": "application/json;charset=UTF-8",
sysCode: 12, sysCode: 12,
token: localStorage.getItem('storageToken'), token: localStorage.getItem("storageToken"),
}, },
url: getBaseUrl('portal/new/scope/doctor/v1/' + projectId + '/import'), url: getBaseUrl("portal/new/scope/doctor/v1/" + projectId + "/import"),
method: 'put', method: "put",
data: data, data: data,
description: '上传excel文件', description: "上传excel文件",
}) });
// }) // })
} };
export const uploadShieldExcel = (data, projectId) => { export const uploadShieldExcel = (data, projectId) => {
return fetch({ return fetch({
headers: { headers: {
token: localStorage.getItem('storageToken'), token: localStorage.getItem("storageToken"),
}, },
url: getBaseUrl('aggregate/black/setPeopleBlackStatus/batch/' + projectId), url: getBaseUrl("aggregate/black/setPeopleBlackStatus/batch/" + projectId),
method: 'post', method: "post",
data: data, data: data,
description: '上传excel文件', description: "上传excel文件",
}) });
} };
\ No newline at end of file
export const uploadMateExcel = (data) => {
return fetch({
headers: {
token: localStorage.getItem("storageToken"),
},
url: getBaseUrl("portal/black/transferHospitalInfo"),
method: "post",
data: data,
description: "转换机构信息上传文件",
});
};
export const uploadBatchExcel = (data) => {
return fetch({
headers: {
token: localStorage.getItem("storageToken"),
},
url: getBaseUrl("portal/black/setHospitalBlackStatus/batch"),
method: "post",
data: data,
description: "屏蔽机构操作上传文件",
});
};
...@@ -808,3 +808,23 @@ export const setOptionLabel = (self,selfModel,selfEId,selfEName,list,listEId,lis ...@@ -808,3 +808,23 @@ export const setOptionLabel = (self,selfModel,selfEId,selfEName,list,listEId,lis
export function deepCopy(obj) { export function deepCopy(obj) {
return obj ? JSON.parse(JSON.stringify(obj)) : obj; return obj ? JSON.parse(JSON.stringify(obj)) : obj;
} }
//按照有效数字位数进行四舍五入,默认6位有效数字
export function signFigures(num, rank = 6){
if(!num) return(0);
const sign = num / Math.abs(num);
const number = num * sign;
const temp = rank - 1 - Math.floor(Math.log10(number));
let ans;
if (temp > 0) {
ans = parseFloat(number.toFixed(temp));
}
else if (temp < 0) {
ans = Math.round(number / Math.pow(10, temp)) * temp;
}
else {
ans = Math.round(number);
}
return (ans * sign);
};
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</el-radio-group> </el-radio-group>
<!-- <el-button class="complete" type="primary" size="small" @click="complete">完成</el-button> --> <!-- <el-button class="complete" type="primary" size="small" @click="complete">完成</el-button> -->
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px"> <el-row :gutter="30" class="row" type="flex" style="margin-top: 10px">
<el-form :model="formInline" ref="formInline" label-width="75px" class="form-inline" style=";width:1000px;"> <el-form :model="formInline" ref="formInline" label-width="75px" class="form-inline" style="width:1000px;">
<el-col :span="6" v-if=" shieldType == 0"> <el-col :span="6" v-if=" shieldType == 0">
<el-form-item label="地区:"> <el-form-item label="地区:">
<el-cascader <el-cascader
...@@ -47,12 +47,17 @@ ...@@ -47,12 +47,17 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" style="padding:0;text-align:right;padding-right:10px;"> <el-col :span="6" style="padding:0;text-align:right;">
<el-button type="primary" size="small" @click="searchList()">搜索</el-button> <el-button type="primary" size="small" @click="searchList()">搜索</el-button>
<el-button type="primary" size="small" @click="importOrder()" v-if="shieldType == 1">批量导入</el-button> <el-button type="primary" size="small" @click="importOrder()" v-if="shieldType == 1">批量导入</el-button>
</el-col> </el-col>
</el-form> </el-form>
</el-row> </el-row>
<el-row justify="end" class="row" type="flex" style="margin: 5px 0 10px;width:1000px;" v-if="shieldType == 0">
<span class="tip">(请在机构信息匹配完成后再进行批量屏蔽)</span>
<el-button type="primary" size="small" @click="importMate()">机构匹配</el-button>
<el-button type="primary" size="small" @click="importBatch()">批量导入</el-button>
</el-row>
<el-table :data="tableData" style="width: 100%"> <el-table :data="tableData" style="width: 100%">
<el-table-column v-if="shieldType == 0" prop="hospitalName" label="医院名称" align="center"></el-table-column> <el-table-column v-if="shieldType == 0" prop="hospitalName" label="医院名称" align="center"></el-table-column>
<el-table-column <el-table-column
...@@ -123,7 +128,7 @@ ...@@ -123,7 +128,7 @@
:show-file-list="true" :show-file-list="true"
:before-upload="uploadfile" :before-upload="uploadfile"
> >
<div class="upload-container"> <div class="upload-container inline-b">
<el-input <el-input
class="file-name" class="file-name"
v-model="fileData.fileName" v-model="fileData.fileName"
...@@ -151,13 +156,103 @@ ...@@ -151,13 +156,103 @@
> >
</div> </div>
</el-dialog> </el-dialog>
<!-- 导入匹配机构名单 -->
<el-dialog
class="exportlogistics-dialog"
title="匹配机构导入"
:visible="isShowMate"
@close="isShowMate = false"
width="600px"
>
<el-form label-width="120px">
<el-form-item label="导入文档:">
<el-upload
class="upload-excel"
action="#"
accept=".xlsx"
multiple
:limit="1"
:show-file-list="false"
:before-upload="uploadMateFile"
>
<div class="upload-container inline-b">
<el-input
class="file-name"
v-model="mateFileData.fileName"
size="mini"
readonly
></el-input
>
<el-button type="primary" size="mini">选择文件</el-button>
</div>
</el-upload>
</el-form-item>
<el-form-item label="模板:">
<a class="import-url" :href="mateTmpUrl" style="color: #449284">
导入匹配机构模板.xlxs</a>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="cancelMateImport">取消</el-button>
<el-button
size="small"
:loading="isLoading"
type="primary"
@click="confirmMateImport"
>确认</el-button
>
</div>
</el-dialog>
<!-- 批量屏蔽 -->
<el-dialog
class="exportlogistics-dialog"
title="批量导入"
:visible="isShowBatch"
@close="isShowBatch = false"
width="600px"
>
<el-form label-width="120px">
<el-form-item label="导入文档:">
<el-upload
class="upload-excel"
action="#"
accept=".xlsx"
multiple
:limit="1"
:show-file-list="false"
:before-upload="uploadBatchFile"
>
<div class="upload-container inline-b">
<el-input
class="file-name"
v-model="batchFileData.fileName"
size="mini"
readonly
></el-input
>
<el-button type="primary" size="mini">选择文件</el-button>
</div>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="cancelBatchImport">取消</el-button>
<el-button
size="small"
:loading="isLoading"
type="primary"
@click="confirmBatchImport"
>确认</el-button
>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import BreadCrumb from "../../components/breadcrumb.vue"; import BreadCrumb from "../../components/breadcrumb.vue";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { openLoading, closeLoading } from "../../utils/utils"; import { openLoading, closeLoading } from "../../utils/utils";
import { uploadShieldExcel } from "@/utils/education/educationApi"; import { uploadShieldExcel, uploadMateExcel, uploadBatchExcel } from "@/utils/education/educationApi";
import * as commonUtil from "../../utils/utils"; import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation"; import * as operationData from "../../utils/operation";
let vm = null; let vm = null;
...@@ -215,6 +310,17 @@ export default { ...@@ -215,6 +310,17 @@ export default {
shieldBlock: "", shieldBlock: "",
scopeRow: {}, scopeRow: {},
administrativeValue: "", administrativeValue: "",
isShowMate: false,
isShowBatch: false,
mateFileData: {
file: "",
fileName: "",
},
batchFileData: {
file: "",
fileName: "",
},
mateTmpUrl: 'https://files.yunqueyi.com/template/org_template.xlsx',
props: { props: {
lazy: true, lazy: true,
lazyLoad(node, resolve) { lazyLoad(node, resolve) {
...@@ -523,7 +629,102 @@ export default { ...@@ -523,7 +629,102 @@ export default {
console.log(`当前页: ${val}`); console.log(`当前页: ${val}`);
this.formInline.pageNo = val; this.formInline.pageNo = val;
this.search(); this.search();
} },
importMate() {
this.isShowMate = true;
},
importBatch() {
this.isShowBatch = true
},
//机构匹配上传exel
uploadMateFile(file) {
console.log("file",file)
this.mateFileData.fileName = file.name;
const formData = new FormData();
formData.append("projectId", this.projectId)
formData.append("file",file)
this.mateFileData.file = formData;
console.log("file",formData)
},
// 机构匹配确认导入
confirmMateImport() {
if (!this.mateFileData.file) {
this.$message.error('请确认您上传的文件');
return
}
this.isLoading = true;
uploadMateExcel(this.mateFileData.file).then(res => {
this.isLoading = false;
if (res.code == '000000') {
if (res.data) {
this.cancelMateImport();
let a = document.createElement('a');
let href = res.data;
a.setAttribute('href',href);
a.click();
this.$message({
message: '导入成功,您上传的机构信息已匹配完成,请确认后进行批量屏蔽',
type: 'success'
});
} else {
this.$message.error(res.message);
}
} else {
this.$message.error(res.message);
}
}).catch(error => {
this.isLoading = false;
this.$message.error(error.message);
})
},
// 机构匹配取消导入
cancelMateImport() {
this.mateFileData = {
file: "",
fileName: "",
};
this.isShowMate = false;
},
//批量屏蔽上传exel
uploadBatchFile(file) {
this.batchFileData.fileName = file.name;
const formData = new FormData();
formData.append('projectId', this.projectId)
formData.append("file",file)
this.batchFileData.file = formData;
},
// 批量屏蔽确认导入
confirmBatchImport() {
if (!this.batchFileData.file) {
this.$message.error('请确认您上传的文件');
return
}
this.isLoading = true;
uploadBatchExcel(this.batchFileData.file).then(res => {
this.isLoading = false;
if (res.code == '000000') {
this.cancelBatchImport();
this.$message({
message: `导入成功${res.data.success}条,失败${res.data.failed}`,
type: 'warning'
});
this.searchList();
} else {
this.$message.error(res.message);
}
}).catch(error => {
this.isLoading = false;
this.$message.error(error.message);
})
},
//批量屏蔽取消导入
cancelBatchImport() {
this.batchFileData = {
file: "",
fileName: "",
};
this.isShowBatch = false;
},
} }
}; };
</script> </script>
...@@ -532,6 +733,11 @@ export default { ...@@ -532,6 +733,11 @@ export default {
.component-content { .component-content {
padding: 10px; padding: 10px;
background: #fff; background: #fff;
.tip {
color: #D51F35;
font-size: 14px;
line-height: 32px;
}
.complete { .complete {
float: right; float: right;
} }
...@@ -539,5 +745,14 @@ export default { ...@@ -539,5 +745,14 @@ export default {
color: #D51F35; color: #D51F35;
} }
} }
.inline-b{
display: flex;
.el-button--mini{
margin-left: 20px;
}
}
.upload-container {
line-height: 0;
}
} }
</style> </style>
\ No newline at end of file
...@@ -234,8 +234,8 @@ ...@@ -234,8 +234,8 @@
<div class="inline"> <div class="inline">
<el-form-item label="是否是处方药" prop="otc1"> <el-form-item label="是否是处方药" prop="otc1">
<el-col :span="24"> <el-col :span="24">
<el-radio size="mini" v-model="formData1.otc1" label="1" :disabled="idMedicEdit">处方药</el-radio> <el-radio size="mini" v-model="formData1.otc1" label="1" >处方药</el-radio>
<el-radio v-model="formData1.otc1" label="0" :disabled="idMedicEdit">非处方药</el-radio> <el-radio v-model="formData1.otc1" label="0" >非处方药</el-radio>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="剂型" prop="dosageId"> <el-form-item label="剂型" prop="dosageId">
...@@ -867,7 +867,7 @@ ...@@ -867,7 +867,7 @@
<script> <script>
import BreadCrumb from "@/components/breadcrumb.vue"; import BreadCrumb from "@/components/breadcrumb.vue";
let vm = null; let vm = null;
import { openLoading, closeLoading } from "../../utils/utils"; import { openLoading, closeLoading, signFigures } from "../../utils/utils";
import { isEmptyUtils } from "@/utils/index"; import { isEmptyUtils } from "@/utils/index";
import { doUpload, getFilePath, createFilePath } from "../../utils/qiniu-util"; import { doUpload, getFilePath, createFilePath } from "../../utils/qiniu-util";
import { updateGoods ,updateStock,dosageAll,getDeparts,getGoodsList, getGoodDetails, updateGoodsV2, getHospitalInfoByStoreId, getCheckPackageIdList, getTypeCodeList,getBusinessCategory } from '@/utils/goods'; import { updateGoods ,updateStock,dosageAll,getDeparts,getGoodsList, getGoodDetails, updateGoodsV2, getHospitalInfoByStoreId, getCheckPackageIdList, getTypeCodeList,getBusinessCategory } from '@/utils/goods';
...@@ -1192,20 +1192,21 @@ ...@@ -1192,20 +1192,21 @@
}); });
} }
const {goodsList, hasRepoFlag } = res.data; const {goodsList, hasRepoFlag } = res.data;
const { goodsName, goodsDescription, goodsType, businessCategoryId,expressLimitFlag, goodsHeaderImages=[], goodsVideoList=[] } = goodsList[0]; const { goodsName, goodsDescription, goodsType, businessCategoryId,expressLimitFlag, goodsHeaderImages=[], goodsVideoList=[] } = goodsList[0];
this.formData1 = goodsList[0]; const goodDet = goodsList[0];
this.formData = goodsList[0]; goodDet.otc1 = goodDet.otc ? '1' : '0';
this.formData1 = goodDet;
this.formData = goodDet;
this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType,businessCategoryId, expressLimitFlag }; this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType,businessCategoryId, expressLimitFlag };
this.hasRepoFlag = hasRepoFlag; this.hasRepoFlag = hasRepoFlag;
this.buyLimitDtoList = this.formData.buyLimitDtoList; this.buyLimitDtoList = this.formData.buyLimitDtoList;
this.formData.optPrice = this.formData.costPrice/100; this.formData.optPrice = this.formData.costPrice/100;
this.formData.scorePerformance = this.formData.scorePerformance/100; this.formData.scorePerformance = this.formData.scorePerformance/100;
this.fileGoodsList = this.getImges(goodsList[0].goodsImgList,1); this.fileGoodsList = this.getImges(goodDet.goodsImgList,1);
this.fileIntrList = this.getImges(goodsList[0].medicImgList,2); this.fileIntrList = this.getImges(goodDet.medicImgList,2);
this.formData.stock = this.formData.goodsStock; this.formData.stock = this.formData.goodsStock;
this.formData.otc1 = this.formData.otc ? '1' : '0'; if (goodDet.goodsVideoList.length > 0) {
if (goodsList[0].goodsVideoList.length > 0) { this.videoList.push(goodDet.goodsVideoList[0]);
this.videoList.push(goodsList[0].goodsVideoList[0]);
this.videoModel.videoFullPath = this.videoList[0].goodsImgUrl; this.videoModel.videoFullPath = this.videoList[0].goodsImgUrl;
} }
let newImgList = []; let newImgList = [];
...@@ -1329,9 +1330,10 @@ ...@@ -1329,9 +1330,10 @@
if(categoryIdLevel4 != -1){ if(categoryIdLevel4 != -1){
this.getLever(categoryIdLevel4,5,1) this.getLever(categoryIdLevel4,5,1)
} }
this.formData1.otc1 = this.formData1.otc ? '1' : '0'
this.formData1 = Object.assign(this.formData1,fastParm) this.formData1 = Object.assign(this.formData1,fastParm)
this.formData1.otc1 = this.formData1.otc ? '1' : '0'
this.goodDisabled = medicationInfo.medicalCategoryId ? true : false this.goodDisabled = medicationInfo.medicalCategoryId ? true : false
this.fileIntrList = this.getImges(imageList,2) this.fileIntrList = this.getImges(imageList,2)
...@@ -1533,10 +1535,11 @@ ...@@ -1533,10 +1535,11 @@
return; return;
} }
} }
if(!isTrue){ if(!isTrue){
return false; return false;
}else{ }else{
this.formData.costPrice = this.formData.optPrice*100 this.formData.costPrice = signFigures(this.formData.optPrice*100);
this.formData.hasChanged = true; this.formData.hasChanged = true;
this.formData.inputType = this.inputType; this.formData.inputType = this.inputType;
this.updateGoodsInfo(); this.updateGoodsInfo();
...@@ -1558,7 +1561,7 @@ ...@@ -1558,7 +1561,7 @@
updateGoodsInfo(){ updateGoodsInfo(){
console.log('提交值',JSON.parse(JSON.stringify(this.formData))); console.log('提交值',JSON.parse(JSON.stringify(this.formData)));
const submieFn = this.isCheckServe ? updateGoodsV2 : updateGoods; const submieFn = this.isCheckServe ? updateGoodsV2 : updateGoods;
let params = JSON.parse(JSON.stringify(this.formData)) let params = JSON.parse(JSON.stringify(this.formData));
params.scorePerformance = params.scorePerformance * 100; params.scorePerformance = params.scorePerformance * 100;
submieFn(params).then((res)=>{ submieFn(params).then((res)=>{
if (res.code !== '000000') { if (res.code !== '000000') {
......
...@@ -814,6 +814,7 @@ ...@@ -814,6 +814,7 @@
<el-form-item <el-form-item
label="法人姓名" label="法人姓名"
label-width="100px" label-width="100px"
class="hidden-conten"
> >
<el-input <el-input
size="small" size="small"
...@@ -823,6 +824,7 @@ ...@@ -823,6 +824,7 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="证件号码" label="证件号码"
class="hidden-conten"
> >
<el-input <el-input
size="small" size="small"
...@@ -832,6 +834,7 @@ ...@@ -832,6 +834,7 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="有效日期" label="有效日期"
class="hidden-conten"
> >
<el-date-picker <el-date-picker
v-model="formData.imgUrlC3Date" v-model="formData.imgUrlC3Date"
...@@ -1367,10 +1370,10 @@ export default { ...@@ -1367,10 +1370,10 @@ export default {
label: "供货商", label: "供货商",
value: 1, value: 1,
}, },
{ // {
label: "小药房", // label: "小药房",
value: 2, // value: 2,
}, // },
{ {
label: "医生小店", label: "医生小店",
value: 3, value: 3,
...@@ -2484,6 +2487,7 @@ export default { ...@@ -2484,6 +2487,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
const c = that.$refs['cascaderBizScope'].getCheckedNodes(); const c = that.$refs['cascaderBizScope'].getCheckedNodes();
const m = c.filter( i => {return !i.hasChildren;}).map(k => {return {...k.data}}); const m = c.filter( i => {return !i.hasChildren;}).map(k => {return {...k.data}});
console.log('--m----', m);
const j = []; const j = [];
if(m) { if(m) {
m.map( i => { m.map( i => {
...@@ -2491,6 +2495,8 @@ export default { ...@@ -2491,6 +2495,8 @@ export default {
}) })
this.controlLicense = j; this.controlLicense = j;
} }
vm.formData.certifyReq.bizScope = m;
that.bizScopeCasValue = v;
}); });
const checkedNodes = this.$refs['cascaderBizScope'].getCheckedNodes(); const checkedNodes = this.$refs['cascaderBizScope'].getCheckedNodes();
...@@ -3201,6 +3207,11 @@ export default { ...@@ -3201,6 +3207,11 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
.hidden-conten{
.el-form-item__label::before{
content: '';
}
}
.el-range-editor{ .el-range-editor{
width: 500px; width: 500px;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册