提交 942c6103 编写于 作者: changdi.hao's avatar changdi.hao

Merge branch 'release'

因为 它太大了无法显示 源差异 。您可以改为 查看blob
import fetch from '../fetch';
import { getBaseUrl } from '@/utils/index';
import fetch from "../fetch";
import { getBaseUrl } from "@/utils/index";
export const uploadExcel = (data, projectId) => {
// return utils.checkAuth(()=>{
return fetch({
headers: {
'Content-Type': 'application/json;charset=UTF-8',
"Content-Type": "application/json;charset=UTF-8",
sysCode: 12,
token: localStorage.getItem('storageToken'),
token: localStorage.getItem("storageToken"),
},
url: getBaseUrl('portal/v2/role/importRoleFile?projectId=' + projectId),
method: 'post',
url: getBaseUrl("portal/v2/role/importRoleFile?projectId=" + projectId),
method: "post",
data: data,
description: '上传excel文件',
})
description: "上传excel文件",
});
// })
}
};
export const uploadOrgExcel = (data, projectId) => {
// return utils.checkAuth(()=>{
return fetch({
headers: {
'Content-Type': 'application/json;charset=UTF-8',
"Content-Type": "application/json;charset=UTF-8",
sysCode: 12,
token: localStorage.getItem('storageToken'),
token: localStorage.getItem("storageToken"),
},
url: getBaseUrl('portal/new/scope/org/v1/' + projectId + '/import'),
method: 'put',
url: getBaseUrl("portal/new/scope/org/v1/" + projectId + "/import"),
method: "put",
data: data,
description: '上传excel文件',
})
description: "上传excel文件",
});
// })
}
};
export const uploadPersonExcel = (data, projectId) => {
// return utils.checkAuth(()=>{
return fetch({
headers: {
'Content-Type': 'application/json;charset=UTF-8',
"Content-Type": "application/json;charset=UTF-8",
sysCode: 12,
token: localStorage.getItem('storageToken'),
token: localStorage.getItem("storageToken"),
},
url: getBaseUrl('portal/new/scope/doctor/v1/' + projectId + '/import'),
method: 'put',
url: getBaseUrl("portal/new/scope/doctor/v1/" + projectId + "/import"),
method: "put",
data: data,
description: '上传excel文件',
})
description: "上传excel文件",
});
// })
}
};
export const uploadShieldExcel = (data, projectId) => {
return fetch({
headers: {
token: localStorage.getItem('storageToken'),
token: localStorage.getItem("storageToken"),
},
url: getBaseUrl("aggregate/black/setPeopleBlackStatus/batch/" + projectId),
method: "post",
data: data,
description: "上传excel文件",
});
};
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('aggregate/black/setPeopleBlackStatus/batch/' + projectId),
method: 'post',
url: getBaseUrl("portal/black/setHospitalBlackStatus/batch"),
method: "post",
data: data,
description: '上传excel文件',
})
}
\ No newline at end of file
description: "屏蔽机构操作上传文件",
});
};
......@@ -142,5 +142,24 @@ export const getBusinessCategory = () => {
});
};
export const getContractList = (projectId) => {
return fetch({
headers,
url: getBaseUrl(`store/contract/options/queryByProjectId/${projectId}`),
method: "get",
description: "查询合同",
});
};
export const getCooperationProjectList = () => {
return fetch({
headers,
url: getBaseUrl(
`store/cooperation/project/options/query`
),
method: "get",
description: "查询合作项目",
});
};
......@@ -808,3 +808,23 @@ export const setOptionLabel = (self,selfModel,selfEId,selfEName,list,listEId,lis
export function deepCopy(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);
};
......@@ -1741,13 +1741,19 @@ export default {
if (option == "edit" || option == "storageEdit") {
notifyData.notifyId = this.formData.notifyId;
}
// 中医项目
const projectType = vm.getUrlSearch(window.location.href, "projectType");
console.log('--projectType', projectType);
if(projectType == 5){
projectModel.projectType = 5;
}
let postData = {
projectModel: JSON.stringify(projectModel),
attachmentModel: JSON.stringify(attachmentModel),
attachmentPDFModel: JSON.stringify(attachmentPDFModel),
notifyData: JSON.stringify(notifyData)
};
//console.log(postData);
console.log('JSON.stringify(projectModel)', projectModel, attachmentModel, attachmentPDFModel, notifyData);
openLoading(vm);
vm.POST("portal/portalInfo/insertOrUpdate", postData).then(res => {
closeLoading(vm);
......@@ -2822,7 +2828,6 @@ export default {
projectId: this.projectId,
administrativeId: "",
hospitalLevel: "",
hospitalLevel: "",
scope: this.getScope("administrative"),
pageNum: this.formOrganization.pageNum,
pageSize: this.formOrganization.pageSize
......
......@@ -213,7 +213,7 @@
<el-dialog
title="请选择项目类型"
:visible.sync="centerDialogVisible"
width="600px"
width="750px"
:close-on-click-modal="false"
@close="handleTypeClose"
center
......@@ -224,6 +224,7 @@
<el-radio :label="2">CME项目</el-radio>
<el-radio :label="3">开放模板</el-radio>
<el-radio :label="5">职称考试</el-radio>
<el-radio :label="6">中医项目</el-radio>
</el-radio-group>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false">取 消</el-button>
......@@ -295,7 +296,6 @@ export default {
data() {
return {
changeStatusVisible: false,
currentRow: null,
currentType: 4,
changeStatusConfig: {
title: "确认通过该项目模版审核吗?",
......@@ -460,6 +460,9 @@ export default {
toPage(isPreview = 0) {
this.$router.push("edit-manager?projectType=1&isPreview=" + isPreview);
},
toTCMPage(isPreview = 0) {
this.$router.push("edit-manager?projectType=5&isPreview=" + isPreview);
},
toCmePage(isPreview = 0) {
this.$router.push("edit-cme?projectType=2&isPreview=" + isPreview);
},
......@@ -490,6 +493,8 @@ export default {
this.toTemplatePage();
} else if (this.newProjectType == 5) {
this.toProfessionalExamPage();
}else if (this.newProjectType == 6) {
this.toTCMPage();
}
},
......@@ -505,16 +510,6 @@ export default {
}
},
// handleCreateProject(isPreview) {
// if (this.newProjectType == 1) { // 1 普通项目 2 CME项目
// this.toPage(isPreview);
// } else if (this.newProjectType == 2) {
// this.toCmePage(isPreview);
// } else if(this.newProjectType == 3) {
// this.toTemplatePage(isPreview);
// }
// },
hanldeCmeClick(row) {
this.currentRow = row;
let status = row.projectStatus;
......@@ -661,13 +656,10 @@ export default {
return text;
// return true / false;
},
changeStatusPre() {
this.changeStatus(this.currentRow, this.currentType);
this.changeStatusVisible = false;
},
//
changeStatusForSP(row, type) {
this.currentRow = row;
this.currentType = type;
......@@ -681,17 +673,18 @@ export default {
}
this.changeStatusVisible = true;
},
//改变状态
changeStatus(row, type) {
console.log('--row', row);
let projectId = row.id;
let level = row.level;
if (type === 0) {
this.updateItemManager(this.formInline);
//编辑
if (row.projectType === 1) {
if (row.projectType === 1 || row.projectType === 5 ) {
this.$router.push(
"edit-manager?projectType=1&projectId=" +
"edit-manager?projectType=" + row.projectType +"&projectId=" +
projectId +
"&level=" +
level +
......@@ -799,9 +792,6 @@ export default {
this.deleteVisible = true;
this.currentRow = row;
},
hideDeleteFrom() {
this.deleteVisible = false;
},
// 删除项目
confirmDelete() {
let req = {};
......
......@@ -8,7 +8,7 @@
</el-radio-group>
<!-- <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-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-form-item label="地区:">
<el-cascader
......@@ -47,12 +47,17 @@
</el-select>
</el-form-item>
</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="importOrder()" v-if="shieldType == 1">批量导入</el-button>
</el-col>
</el-form>
</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-column v-if="shieldType == 0" prop="hospitalName" label="医院名称" align="center"></el-table-column>
<el-table-column
......@@ -123,7 +128,7 @@
:show-file-list="true"
:before-upload="uploadfile"
>
<div class="upload-container">
<div class="upload-container inline-b">
<el-input
class="file-name"
v-model="fileData.fileName"
......@@ -151,13 +156,103 @@
>
</div>
</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>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { mapGetters } from "vuex";
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 operationData from "../../utils/operation";
let vm = null;
......@@ -215,6 +310,17 @@ export default {
shieldBlock: "",
scopeRow: {},
administrativeValue: "",
isShowMate: false,
isShowBatch: false,
mateFileData: {
file: "",
fileName: "",
},
batchFileData: {
file: "",
fileName: "",
},
mateTmpUrl: 'https://files.yunqueyi.com/template/org_template.xlsx',
props: {
lazy: true,
lazyLoad(node, resolve) {
......@@ -523,7 +629,102 @@ export default {
console.log(`当前页: ${val}`);
this.formInline.pageNo = val;
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>
......@@ -532,6 +733,11 @@ export default {
.component-content {
padding: 10px;
background: #fff;
.tip {
color: #D51F35;
font-size: 14px;
line-height: 32px;
}
.complete {
float: right;
}
......@@ -539,5 +745,14 @@ export default {
color: #D51F35;
}
}
.inline-b{
display: flex;
.el-button--mini{
margin-left: 20px;
}
}
.upload-container {
line-height: 0;
}
}
</style>
\ No newline at end of file
......@@ -18,7 +18,7 @@
label-suffix=":"
class="basic-form"
>
<!-- 通用信息 -->
<div class="basic-item-icon">
<div class="part-tit">通用信息</div>
<el-form-item label="商品名称" prop="goodsName">
......@@ -111,7 +111,7 @@
</el-progress>
<el-button class="dl-video" icon="el-icon-delete" circle @click="deleteVideo" v-if="videoList.length == 1"></el-button>
</el-form-item>
<el-form-item label="业务类型" prop="businessCategoryId">
<!-- <el-form-item label="业务类型" prop="businessCategoryId">
<el-select
v-model="formData3.businessCategoryId"
placeholder="请选择业务类型"
......@@ -124,7 +124,7 @@
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="商品类型" prop="goodsType">
<el-select
v-model="formData3.goodsType"
......@@ -140,7 +140,39 @@
></el-option>
</el-select>
</el-form-item>
<!-- 新增项目合同名称 -->
<el-form-item label="项目-合同名称" prop="cooperationProjectId" class="project-req">
<el-select
v-model="formData3.cooperationProjectId"
placeholder="请选择"
size="small"
:disabled="isEdit && isProject"
@change="getContract"
@clear="projectClear"
clearable
filterable>
<el-option
v-for="(item,index) in cooperationProjectList"
:key="item.projectName+'-'+index"
:label="item.projectName"
:value="item.cooperationProjectId"
></el-option>
</el-select>
<el-select
v-model="formData3.contractId"
placeholder="请选择"
size="small"
clearable
:disabled="isEdit && isContract">
<el-option
v-for="(item,index) in contractList"
:key="item.contractName+'-'+index"
:label="item.contractName"
:value="item.contractId"
></el-option>
</el-select>
<div class="project-tip">未找到项目名称请联系产品经理添加</div>
</el-form-item>
<el-form-item label="是否支持售后" prop="expressLimitFlag" v-if="storeType < 3">
<el-radio-group v-model="formData3.expressLimitFlag" :disabled="!hasRepoFlag">
......@@ -154,6 +186,8 @@
</div>
</el-form>
<!-- 基本信息 -->
<el-form
ref="formData1"
:model="formData1"
......@@ -162,7 +196,7 @@
label-suffix=":"
class="basic-form"
>
<div class="basic-item-icon" v-show="!isCheckServe">
<div class="basic-item-icon" v-if="!isCheckServe && !showTcm">
<div class="part-tit">基本信息</div>
<el-form-item label="条形码" prop="barCode">
<el-col :span="18">
......@@ -234,8 +268,8 @@
<div class="inline">
<el-form-item label="是否是处方药" prop="otc1">
<el-col :span="24">
<el-radio size="mini" v-model="formData1.otc1" label="1" :disabled="idMedicEdit">处方药</el-radio>
<el-radio v-model="formData1.otc1" label="0" :disabled="idMedicEdit">非处方药</el-radio>
<el-radio size="mini" v-model="formData1.otc1" label="1" >处方药</el-radio>
<el-radio v-model="formData1.otc1" label="0" >非处方药</el-radio>
</el-col>
</el-form-item>
<el-form-item label="剂型" prop="dosageId">
......@@ -459,21 +493,96 @@
<p class="upload-message" v-if="!isSpecification_url">请上传说明书</p>
</el-form-item>
</div>
</el-form>
<div class="basic-item-icon" v-show="showTcm">
<div class="part-tit">基本信息</div>
<el-form-item label="适用项目" prop="useProject" class="required-label">
<el-col :span="13">
<el-input
:disabled="goodDisabled || barAndGoodsFlag || idMedicEdit"
size="small"
v-model="formData1.useProject"
placeholder="请输入适用项目"
style="width:70%;"
maxlength="40"
show-word-limit
></el-input>
</el-col>
</el-form-item>
<div class="inline">
<el-form-item label="适用科室" prop="department" class="required-label">
<el-input
size="small"
v-model="formData1.department"
placeholder="请输入适用科室"
:disabled="idMedicEdit"
></el-input>
</el-form-item>
<el-form-item label="治疗疾病" prop="treatDisease" class="required-label">
<el-col :span="24">
<el-input
size="small"
v-model="formData1.treatDisease"
placeholder="请输入治疗疾病"
:disabled="idMedicEdit"
></el-input>
<span class="word-num"></span>
</el-col>
</el-form-item>
</div>
<el-form-item label="商品使用时间" prop="rangeTime" class="required-label">
<el-col :span="8">
<el-date-picker
v-model="rangeTime"
type="daterange"
value-format="yyyy-MM-dd"
start-placeholder="开始日期"
end-placeholder="结束日期"
:disabled="idMedicEdit"
>
</el-date-picker>
</el-col>
</el-form-item>
<el-form-item label="说明书">
<el-upload
class="bg-uploader"
action="#"
:show-file-list="false"
:before-upload="beforeUploadPic1"
>
<div v-if="fileIntrList.length > 0">
<div class="file-pics" v-if="item.url" :key="index" v-for="(item,index) in fileIntrList">
<img :src="item.url" @mouseover.stop="intrIndex=index" class="bg-img"/>
<div
class="img-delete"
v-if="intrIndex==index"
@click.stop="deleteImg(item,fileIntrList)"
@mouseout.stop="intrIndex=-1"
>
<i class="el-icon-delete"></i>
</div>
</div>
</div>
<img class="bg-img" src="../../assets/image/small.png" />
<div class="limit-text">
<p>限制大小: 2M</p>
<!-- <p>最小尺寸:750*420</p> -->
<p>支持jpeg, png格式</p>
</div>
</el-upload>
<p class="upload-message" v-if="!isSpecification_url">请上传说明书</p>
</el-form-item>
</div>
</el-form>
<!-- =========================================================调试新增检测服务 start=========================================================
=========================================================调试新增检测服务 start=========================================================
=========================================================调试新增检测服务 start========================================================= -->
<!-- 服务信息 -->
<el-form
ref="formData2"
:model="formData2"
......@@ -482,7 +591,7 @@
label-suffix=":"
class="basic-form"
>
<div class="basic-item-icon" v-show="!isMedic && isCheckServe">
<div class="basic-item-icon" v-show="!isMedic && isCheckServe && !showTcm">
<div class="part-tit">服务信息</div>
<el-form-item label="条形码" prop="barCode">
<el-col :span="18">
......@@ -672,26 +781,12 @@
</div>
</el-form>
<!-- =========================================================调试新增检测服务 start=========================================================
=========================================================调试新增检测服务 start=========================================================
=========================================================调试新增检测服务 start========================================================= -->
<!-- 销售信息 -->
<el-form
ref="formData"
:model="formData"
......@@ -722,7 +817,7 @@
<div class="inline" v-if="formData.saleType == 2">
<el-form-item label="批发价" prop="optPrice">
<el-col :span="20">
<el-input-number class="stock-com" @input="$forceUpdate();" v-model="formData.optPrice" size="small" :precision="2" :min="0" :max="99999.99"></el-input-number>
<el-input-number class="stock-com" @input="$forceUpdate();" v-model="formData.optPrice" size="small" :precision="2" :min="0" :max="20000000.00"></el-input-number>
</el-col>
</el-form-item>
</div>
......@@ -789,13 +884,12 @@
</el-col>
</el-form-item>
</div>
<div class="inline" v-if="formData.saleType == 2">
<el-form-item label="最小起批" prop="minWhole" class="required-label">
<el-col :span="20">
<div class="stock-com">
<span class="sp sp-l" @click="minusCount(3)"><i class="el-icon-minus"></i></span>
<span class="sp sp-c">{{formData.minWhole}}</span>
<span class="sp sp-r" @click="plusCount(3)"><i class="el-icon-plus"></i></span>
<div class="stock-com" style="width: 500px;display:flex">
<el-input-number class="stock-com" @input="$forceUpdate();" v-model="formData.minWhole" size="small" :precision="0" :min="1"></el-input-number>
</div>
<p class="error-message" v-if="formData.minWhole <= 0">最小起批不能为0</p>
</el-col>
......@@ -867,10 +961,10 @@
<script>
import BreadCrumb from "@/components/breadcrumb.vue";
let vm = null;
import { openLoading, closeLoading } from "../../utils/utils";
import { openLoading, closeLoading, signFigures } from "../../utils/utils";
import { isEmptyUtils } from "@/utils/index";
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,getContractList, getCooperationProjectList} from '@/utils/goods';
import { getStoreAdressRepot } from "@/utils/shop";
import Cropper from '@/components/common/cropper.vue'
import { originRules1, originRules2, originRules, originRules3 } from './rules';
......@@ -1011,9 +1105,20 @@
videoModel:{
videoFullPath: ''
},
businessCategoryList:[],
// businessCategoryList:[],
sumFile: 0,
uploadProgress:0, // 上传视频进度条
cooperationProjectList: [], // 合作项目
contractList: [], // 合同
isProject: false, // 是否选择合作项目
isContract: false, // 是否选择合同
showTcm:false,
rangeTime:'',
// pickerOptions: {
// disabledDate: (time) => {
// return time.getTime() > new Date().getTime(); //减去一天的时间代表可以选择同一天;
// },
// },
}
},
computed: {
......@@ -1045,8 +1150,9 @@
this.curmbThird = this.title;
this.formData.storeId = Number(storeId) || '';
this.getTypeCodeList();
this.getBusinessCategory();
// this.getBusinessCategory();
this.getLever(0,1)
this.getCooperationProjectList();
dosageAll().then((res)=>{
this.doseAll = res.data
if (!this.doseAll) {
......@@ -1076,16 +1182,43 @@
if (this.formData.incrType == null || this.formData.incrType === '') {
this.formData.incrType = 2;
}
console.log('save');
},
methods: {
// 获取业务类型
getBusinessCategory(){
getBusinessCategory().then((res) => {
if (res.code == '000000') {
this.businessCategoryList=res.data
// 获取合同
getContractList(projectId) {
getContractList(projectId || 0).then(res => {
if(res.code == '000000') {
this.contractList = res.data;
console.log(this.contractList, 'this.contractList');
}
}).catch((err)=>{})
})
},
// 获取合作项目
getCooperationProjectList() {
getCooperationProjectList().then(res => {
if(res.code == '000000') {
this.cooperationProjectList = res.data;
}
})
},
getContract(projectId) {
this.formData3.contractId = '';
this.contractList = [];
this.getContractList(projectId);
},
projectClear() {
this.formData3.contractId = '';
this.contractList = [];
},
// 获取业务类型
// getBusinessCategory(){
// getBusinessCategory().then((res) => {
// if (res.code == '000000') {
// this.businessCategoryList=res.data
// }
// }).catch((err)=>{})
// },
// 判断imgurl是否有效
checkImgExists(imgurl) {
return new Promise(function(resolve, reject) {
......@@ -1135,12 +1268,14 @@
};
const { goodsInfo, medicalService, buyLimitDtoList, hasRepoFlag} = res.data;
const { goodsName, goodsDescription, goodsType,businessCategoryId, expressLimitFlag,goodsHeaderImages=[], goodsVideoList=[] } = goodsInfo;
const { goodsName, goodsDescription, goodsType, expressLimitFlag,goodsHeaderImages=[], goodsVideoList=[], contractId, cooperationProjectId } = goodsInfo;
this.isProject = Boolean(cooperationProjectId);
if(this.isProject) {this.getContractList(cooperationProjectId) }
this.isContract = Boolean(contractId);
this.formData = {...this.formData, ...goodsInfo};
this.formData2 = medicalService;
this.formData = { ...this.formData, ...this.formData2 };
this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType,businessCategoryId, expressLimitFlag };
this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType, expressLimitFlag, cooperationProjectId, contractId };
this.buyLimitDtoList = buyLimitDtoList;
this.hasRepoFlag = hasRepoFlag;
this.$set(this.formData2, 'suitableArr', this.formData.suitable.split(','));
......@@ -1192,20 +1327,30 @@
});
}
const {goodsList, hasRepoFlag } = res.data;
const { goodsName, goodsDescription, goodsType, businessCategoryId,expressLimitFlag, goodsHeaderImages=[], goodsVideoList=[] } = goodsList[0];
this.formData1 = goodsList[0];
this.formData = goodsList[0];
this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType,businessCategoryId, expressLimitFlag };
const { goodsName, goodsDescription, goodsType,expressLimitFlag, goodsHeaderImages=[], goodsVideoList=[],contractId, cooperationProjectId } = goodsList[0];
const goodDet = goodsList[0];
goodDet.otc1 = goodDet.otc ? '1' : '0';
this.isProject = Boolean(cooperationProjectId);
if(this.isProject) {this.getContractList(cooperationProjectId)}
this.isContract = Boolean(contractId);
this.formData1 = goodDet;
if (this.formData1.goodsType == 340) {
this.showTcm = true;
if (this.formData1.useBeginTime && this.formData1.useEndTime) {
this.rangeTime = [new Date(this.formData1.useBeginTime).format("yyyy-MM-dd"), new Date(this.formData1.useEndTime).format("yyyy-MM-dd")]
}
}
this.formData = goodDet;
this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType, expressLimitFlag,contractId, cooperationProjectId };
this.hasRepoFlag = hasRepoFlag;
this.buyLimitDtoList = this.formData.buyLimitDtoList;
this.formData.optPrice = this.formData.costPrice/100;
this.formData.scorePerformance = this.formData.scorePerformance/100;
this.fileGoodsList = this.getImges(goodsList[0].goodsImgList,1);
this.fileIntrList = this.getImges(goodsList[0].medicImgList,2);
this.fileGoodsList = this.getImges(goodDet.goodsImgList,1);
this.fileIntrList = this.getImges(goodDet.medicImgList,2);
this.formData.stock = this.formData.goodsStock;
this.formData.otc1 = this.formData.otc ? '1' : '0';
if (goodsList[0].goodsVideoList.length > 0) {
this.videoList.push(goodsList[0].goodsVideoList[0]);
if (goodDet.goodsVideoList.length > 0) {
this.videoList.push(goodDet.goodsVideoList[0]);
this.videoModel.videoFullPath = this.videoList[0].goodsImgUrl;
}
let newImgList = [];
......@@ -1240,7 +1385,6 @@
};
this.barAndGoodsFlag = this.formData1.medicalCategoryId ? true : false;
}
console.log(this.formData);
},
getImges(d,type){
let a = [];
......@@ -1329,9 +1473,10 @@
if(categoryIdLevel4 != -1){
this.getLever(categoryIdLevel4,5,1)
}
this.formData1.otc1 = this.formData1.otc ? '1' : '0'
this.formData1 = Object.assign(this.formData1,fastParm)
this.formData1.otc1 = this.formData1.otc ? '1' : '0'
this.goodDisabled = medicationInfo.medicalCategoryId ? true : false
this.fileIntrList = this.getImges(imageList,2)
......@@ -1343,6 +1488,7 @@
this.goodsType = goodsType;
if(goodsType == 337){
this.isMedic = false;
this.showTcm = false;
this.isCheckServe = true;
getHospitalInfoByStoreId(this.storeId).then(({code,message,data})=>{
this.formData2.hospitalName = data.hospital;
......@@ -1352,10 +1498,16 @@
this.checkPackageIdList = res.data;
})
}else{
if (goodsType == 340) {
this.showTcm = true;
}else {
this.isMedic = goodsType == '5';
this.isCheckServe = false;
this.showTcm = false;
this.getLever(goodsType,type);
}
}
console.log(goodsType,type);
console.log(this.formData);
},
defaultArr(){
......@@ -1462,6 +1614,15 @@
},
complete() {
if (this.goodsType == 340 ) {
this.formData1.otc1 = "0";
}
console.log(this.formData1);
console.log(this.rangeTime);
this.formData1.useBeginTime = new Date(this.rangeTime ? this.rangeTime[0] + ' ' + '00:00:00' : '').getTime() || '';
this.formData1.useEndTime = new Date(this.rangeTime ? this.rangeTime[1] + ' ' + '23:59:59' : '').getTime() || '';
console.log('==============');
// debugger;
this.formData1.leastCount = this.formData.leastCount;
this.formData1.mostCount = this.formData.mostCount;
let formNameList = ['formData', 'formData1', 'formData2', 'formData3'];
......@@ -1492,6 +1653,19 @@
this.formData.specificationImages = this.fileIntrList;
this.formData.buyLimitDtoList = this.buyLimitDtoList;
this.isgoodsImages = this.formData.goodsImages.length == 0 ? false :true;
const {cooperationProjectId, contractId} = this.formData3;
if (!cooperationProjectId) {
return this.$message({
message: '请关联项目名称',
type: 'error'
});
}
if ((cooperationProjectId && !contractId) || (!cooperationProjectId && contractId)) {
return this.$message({
message: '请选择项目-合同名称',
type: 'warning'
});
}
// 如果是【药品】类型的商品
// if(this.isMedic){
......@@ -1533,10 +1707,11 @@
return;
}
}
if(!isTrue){
return false;
}else{
this.formData.costPrice = this.formData.optPrice*100
this.formData.costPrice = signFigures(this.formData.optPrice*100, 10);
this.formData.hasChanged = true;
this.formData.inputType = this.inputType;
this.updateGoodsInfo();
......@@ -1558,7 +1733,7 @@
updateGoodsInfo(){
console.log('提交值',JSON.parse(JSON.stringify(this.formData)));
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;
submieFn(params).then((res)=>{
if (res.code !== '000000') {
......@@ -2036,6 +2211,16 @@
}
}
}
.project-req {
.el-form-item__label::before {
content: "*";
color: #f56c6c;
margin-right: 4px;
}
.project-tip {
color: #aaaaaa;
}
}
.required-label .el-form-item__label::before {
content: "*";
color: #f56c6c;
......
......@@ -66,7 +66,7 @@ const form = {
mostCount: -1,
incrType: 1,
saleType: 1,
minWhole: 0,
minWhole: 1,
expressLimitFlag: 0, //是否支持退货退款
};
......@@ -76,8 +76,10 @@ const form3 = {
goodsHeaderImages: [],
goodsVideoList: [],
goodsType: "",
businessCategoryId:"",
// businessCategoryId: "",
expressLimitFlag: 0, //是否支持退货退款
cooperationProjectId: '', // 合作项目id
contractId: '', // 合同id
};
......
......@@ -116,7 +116,7 @@ const rules = {
const rules3 = {
goodsName: [
{ required: true, message: "请输入商品名称", trigger: "submit" },
{ validator: checkProjectStr, trigger: "submit" },
// { validator: checkProjectStr, trigger: "submit" },
],
goodsDescription: [
{ required: true, message: "请输入商品介绍", trigger: "submit" },
......
......@@ -814,6 +814,7 @@
<el-form-item
label="法人姓名"
label-width="100px"
class="hidden-conten"
>
<el-input
size="small"
......@@ -823,6 +824,7 @@
</el-form-item>
<el-form-item
label="证件号码"
class="hidden-conten"
>
<el-input
size="small"
......@@ -832,6 +834,7 @@
</el-form-item>
<el-form-item
label="有效日期"
class="hidden-conten"
>
<el-date-picker
v-model="formData.imgUrlC3Date"
......@@ -848,7 +851,8 @@
</div>
</el-form-item>
<el-form-item label="资质信息" class="required-label" v-if="formData.storeType < 3">
<div v-if="controlLicense.filter((i => { return String(i).charAt(0) == '1'; })).length > 0 || formData.storeType == 2">
<!-- <div v-if="controlLicense.filter((i => { return String(i).charAt(0) == '1'; })).length > 0 || formData.storeType == 2"> -->
<div v-if="imgUrlP7Show || formData.storeType == 2">
<p v-if="certifyValidDtoList(7)" class="red">{{certifyValidDtoList(7)}}</p>
<p class="tips">药品经营许可证</p>
<el-form-item prop="imgUrlP7">
......@@ -947,7 +951,8 @@
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </div>-->
<div v-if="controlLicense.filter((i => { return String(i).charAt(0) == '3'; })).length > 0">
<!-- <div v-if="controlLicense.filter((i => { return String(i).charAt(0) == '3'; })).length > 0"> -->
<div v-if="imgUrlP9Show">
<p v-if="certifyValidDtoList(9)" class="red">{{certifyValidDtoList(9)}}</p>
<p class="tips">食品经营(流通)许可证</p>
<el-form-item prop="imgUrlP9">
......@@ -996,7 +1001,8 @@
</el-date-picker>
</el-form-item>
</div>
<div v-if="controlLicense.filter((i => { return String(i).charAt(0) == '2'; })).length > 0">
<!-- <div v-if="controlLicense.filter((i => { return String(i).charAt(0) == '2'; })).length > 0"> -->
<div v-if="imgUrlP10Show">
<p v-if="certifyValidDtoList(10)" class="red">{{certifyValidDtoList(10)}}</p>
<p class="tips">医疗器械经营许可证</p>
<el-form-item prop="imgUrlP10">
......@@ -1045,7 +1051,8 @@
</el-date-picker>
</el-form-item>
</div>
<div v-if="controlLicense.filter((i => { return String(i).charAt(0) == '2' && String(i).charAt(3) == '3'; })).length > 0">
<!-- <div v-if="controlLicense.filter((i => { return String(i).charAt(0) == '2' && String(i).charAt(3) == '3'; })).length > 0"> -->
<div v-if="imgUrlP13Show">
<p class="tips">医疗器械网络销售备案</p>
<el-form-item prop="imgUrlP13">
<el-upload
......@@ -1093,7 +1100,8 @@
</el-date-picker>
</el-form-item>
</div>
<div v-if="controlLicense.filter((i => { return String(i).charAt(0) == '2' && String(i).charAt(3) == '2'; })).length > 0">
<!-- <div v-if="controlLicense.filter((i => { return String(i).charAt(0) == '2' && String(i).charAt(3) == '2'; })).length > 0"> -->
<div v-if="imgUrlP11Show">
<p v-if="certifyValidDtoList(11)" class="red">{{certifyValidDtoList(11)}}</p>
<p class="tips">二类医疗器械经营备案凭证</p>
<el-form-item prop="imgUrlP11">
......@@ -1367,10 +1375,10 @@ export default {
label: "供货商",
value: 1,
},
{
label: "小药房",
value: 2,
},
// {
// label: "小药房",
// value: 2,
// },
{
label: "医生小店",
value: 3,
......@@ -1696,6 +1704,21 @@ export default {
computed: {
certifyStatusColor () {
return `certifyStatusColor${this.certifyStatus}`;
},
imgUrlP7Show(){
return this.controlLicense.filter((i => { return String(i).charAt(0) == '1'; })).length > 0
},
imgUrlP9Show(){
return this.controlLicense.filter((i => { return String(i).charAt(0) == '3'; })).length > 0
},
imgUrlP10Show(){
return this.controlLicense.filter((i => { return String(i).charAt(0) == '2'; })).length > 0
},
imgUrlP11Show(){
return this.controlLicense.filter((i => { return String(i).charAt(0) == '2' && String(i).charAt(3) == '2'; })).length > 0
},
imgUrlP13Show(){
return this.controlLicense.filter((i => { return String(i).charAt(0) == '2' && String(i).charAt(3) == '3'; })).length > 0
}
},
watch: {
......@@ -1911,6 +1934,49 @@ export default {
});
},
completeWholeForm() {
console.log(this.controlLicense,this.formData);
this.formData.certifyReq.certifyLicenseImgList = this.formData.certifyReq.certifyLicenseImgList || [];
if(!this.imgUrlP7Show){
this.formData.imgUrlP7 = ''
this.formData.certifyReq.certifyLicenseImgList.forEach((v,i)=>{
if(v.imageType == 7) {
this.formData.certifyReq.certifyLicenseImgList.splice(i,1)
}
})
}
if(!this.imgUrlP9Show){
this.formData.imgUrlP9 = ''
this.formData.certifyReq.certifyLicenseImgList.forEach((v,i)=>{
if(v.imageType == 9) {
this.formData.certifyReq.certifyLicenseImgList.splice(i,1)
}
})
}
if(!this.imgUrlP10Show){
this.formData.imgUrlP10 = ''
this.formData.certifyReq.certifyLicenseImgList.forEach((v,i)=>{
if(v.imageType == 10) {
this.formData.certifyReq.certifyLicenseImgList.splice(i,1)
}
})
}
if(!this.imgUrlP11Show){
this.formData.imgUrlP11 = ''
this.formData.certifyReq.certifyLicenseImgList.forEach((v,i)=>{
if(v.imageType == 11) {
this.formData.certifyReq.certifyLicenseImgList.splice(i,1)
}
})
}
if(!this.imgUrlP13Show){
this.formData.imgUrlP13 = ''
this.formData.certifyReq.certifyLicenseImgList.forEach((v,i)=>{
if(v.imageType == 13) {
this.formData.certifyReq.certifyLicenseImgList.splice(i,1)
}
})
}
this.resetCertType();
let flag = this.submitForm();
if (flag && this.certifyStatus == 3) {
this.$confirm('您的店铺已经审核通过,重新提交后需要重新审核。', '确认重新提交店铺信息吗?', {
......@@ -2484,6 +2550,7 @@ export default {
this.$nextTick(() => {
const c = that.$refs['cascaderBizScope'].getCheckedNodes();
const m = c.filter( i => {return !i.hasChildren;}).map(k => {return {...k.data}});
console.log('--m----', m);
const j = [];
if(m) {
m.map( i => {
......@@ -2491,6 +2558,8 @@ export default {
})
this.controlLicense = j;
}
vm.formData.certifyReq.bizScope = m;
that.bizScopeCasValue = v;
});
const checkedNodes = this.$refs['cascaderBizScope'].getCheckedNodes();
......@@ -2818,6 +2887,22 @@ export default {
const s = {...query, currentTab: this.activeTabName};
vm.$router.push({ path: "create-shop", query: s});
},
resetCertType() {
console.log('this.formData.certifyReq.certType == 1');
console.log(this.formData.certifyReq.certType == 1);
if(this.formData.certifyReq.certType == 1) {
console.log('papsdpapspd');
this.formData.imgUrlC4 = '';
this.formData.imgUrlC5 = '';
this.formData.certifyReq.assignorCertBackUrl = '';
this.formData.certifyReq.assignorCertFrontUrl = '';
this.formData.certifyReq.assignorLetterUrl = '';
this.formData.certifyReq.assignorName = '';
this.formData.certifyReq.assignorCertNo = '';
this.formData.imgUrlC5Date = '';
this.formData.imgUrlP5 = '';
}
},
handleRegionChange(v) {
const checkedNodes = this.$refs['regionCascader'].getCheckedNodes()[0];
const n = [];
......@@ -3201,6 +3286,11 @@ export default {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.hidden-conten{
.el-form-item__label::before{
content: '';
}
}
.el-range-editor{
width: 500px;
}
......
因为 它太大了无法显示 源差异 。您可以改为 查看blob
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册