提交 1649f29c 编写于 作者: 申玉强's avatar 申玉强

Merge branch 'release' into 'develop'

Release

See merge request com.pica.cloud.education.frontend/pica.cloud.web-education-admin!478
因为 它太大了无法显示 源差异 。您可以改为 查看blob
...@@ -157,6 +157,7 @@ ...@@ -157,6 +157,7 @@
style="width: 450px;" style="width: 450px;"
@change="updateCertificate(index)" @change="updateCertificate(index)"
:disabled="disabled" :disabled="disabled"
filterable
> >
<el-option <el-option
v-for="item in optionsCertificate" v-for="item in optionsCertificate"
...@@ -182,6 +183,7 @@ ...@@ -182,6 +183,7 @@
placeholder="请选择证书" placeholder="请选择证书"
style="width: 350px" style="width: 350px"
:disabled="disabled" :disabled="disabled"
filterable
> >
<el-option <el-option
v-for="item in optionsCertificate" v-for="item in optionsCertificate"
......
...@@ -75,7 +75,7 @@ router.beforeEach((to, from, next) => { ...@@ -75,7 +75,7 @@ router.beforeEach((to, from, next) => {
} }
next(); next();
}else{ }else{
next(false) next({ path: "/home" });
return return
} }
}) })
......
...@@ -76,6 +76,7 @@ const createShop = r => require.ensure([], () => r(require('../views/shop/create ...@@ -76,6 +76,7 @@ const createShop = r => require.ensure([], () => r(require('../views/shop/create
const goodsManage = r => require.ensure([], () => r(require('../views/goods/goods-manage.vue')), 'goods-manage') const goodsManage = r => require.ensure([], () => r(require('../views/goods/goods-manage.vue')), 'goods-manage')
const freightConfig = r => require.ensure([], () => r(require('../views/freight/freight-config.vue')), 'freight-config') const freightConfig = r => require.ensure([], () => r(require('../views/freight/freight-config.vue')), 'freight-config')
const createGood = r => require.ensure([], () => r(require('../views/goods/create-good.vue')), 'create-good') const createGood = r => require.ensure([], () => r(require('../views/goods/create-good.vue')), 'create-good')
const createGoodNew = r => require.ensure([], () => r(require('../views/goods/create-good-new.vue')), 'create-good-new')
const orderManage = r => require.ensure([], () => r(require('../views/goods/order-manage.vue')), 'order-manage') const orderManage = r => require.ensure([], () => r(require('../views/goods/order-manage.vue')), 'order-manage')
const orderDetail = r => require.ensure([], () => r(require('../views/goods/order-detail.vue')), 'order-detail') const orderDetail = r => require.ensure([], () => r(require('../views/goods/order-detail.vue')), 'order-detail')
const plazaList = r => require.ensure([], () => r(require('../views/plaza/plaza-list.vue')), 'plaza-list') const plazaList = r => require.ensure([], () => r(require('../views/plaza/plaza-list.vue')), 'plaza-list')
...@@ -85,285 +86,312 @@ const videoManage = r => require.ensure([], () => r(require('../views/shortvideo ...@@ -85,285 +86,312 @@ const videoManage = r => require.ensure([], () => r(require('../views/shortvideo
const qualificationList = r => require.ensure([], () => r(require('../views/qualification/list.vue')), 'qualification') const qualificationList = r => require.ensure([], () => r(require('../views/qualification/list.vue')), 'qualification')
const qualificationDetail = r => require.ensure([], () => r(require('../views/qualification/detail.vue')), 'qualification') const qualificationDetail = r => require.ensure([], () => r(require('../views/qualification/detail.vue')), 'qualification')
export default [{ export default [
path: '/', {
path: "/",
component: App, component: App,
children: [ children: [
{ {
path: '/login', path: "/login",
component: login, component: login,
name: 'loginPage', name: "loginPage",
}, },
{ {
path: '', path: "",
redirect: '/home' redirect: "/home",
},{ },
path: '/index', {
component: home path: "/index",
},{ component: home,
path: '/home', },
component: home {
},{ path: "/home",
path: '/blank', component: home,
component: blank },
},{ {
path: '/item-manager', path: "/blank",
component: itemManager component: blank,
},{ },
path: '/add-manager', {
component: addManager path: "/item-manager",
},{ component: itemManager,
path: '/edit-manager', },
component: editManager {
},{ path: "/add-manager",
path: '/edit-cme', component: addManager,
component: editCme },
},{ {
path: '/edit-professional-exam', path: "/edit-manager",
component: editProfessionalExam component: editManager,
},{ },
path: '/subject-manager', {
component: subjectManager path: "/edit-cme",
},{ component: editCme,
path: '/report-download', },
component: reportDownload {
},{ path: "/edit-professional-exam",
path: '/edit-subject', component: editProfessionalExam,
component: editSubject },
},{ {
path: '/item-component', path: "/subject-manager",
component: itemComponent component: subjectManager,
},{ },
path: '/role', {
component: roleManager path: "/report-download",
},{ component: reportDownload,
path: '/circle-limit', },
component: circleLimit {
},{ path: "/edit-subject",
path: '/create-component', component: editSubject,
component: createComponent },
},{ {
path: '/item-role', path: "/item-component",
component: itemRole component: itemComponent,
} },
,{ {
path: '/report-list', path: "/role",
component: reportLis component: roleManager,
},{ },
path: '/item-list', {
component: itemList path: "/circle-limit",
},{ component: circleLimit,
path: '/data-alignment', },
component: dataAlignment {
},{ path: "/create-component",
path: '/name-list', component: createComponent,
component: nameList },
}, {
{ path: "/item-role",
path: '/export-download', component: itemRole,
component: exportDownload },
}, {
path: "/report-list",
component: reportLis,
},
{
path: "/item-list",
component: itemList,
},
{
path: "/data-alignment",
component: dataAlignment,
},
{
path: "/name-list",
component: nameList,
},
{
path: "/export-download",
component: exportDownload,
},
{ {
path: '/report-list-old', path: "/report-list-old",
component: reportLisOld component: reportLisOld,
},{ },
path: '/item-list-old', {
component: itemListOld path: "/item-list-old",
},{ component: itemListOld,
path: '/data-alignment-old', },
component: dataAlignmentOld {
},{ path: "/data-alignment-old",
path: '/name-list-old', component: dataAlignmentOld,
component: nameListOld },
}, {
{ path: "/name-list-old",
path: '/export-download-old', component: nameListOld,
component: exportDownloadOld },
}, {
path: "/export-download-old",
component: exportDownloadOld,
},
{ {
path: '/item-shield', path: "/item-shield",
component: itemShield, component: itemShield,
}, },
{ {
path: '/entry-manager', path: "/entry-manager",
component: entryManager, component: entryManager,
}, },
{ {
path: '/edit-entry', path: "/edit-entry",
component: editEntry, component: editEntry,
}, },
{ {
path: '/msg-push', path: "/msg-push",
component: msgPush, component: msgPush,
// redirect: 'msgpush/msg-push', // redirect: 'msgpush/msg-push',
}, },
{ {
path: '/edit-notice', path: "/edit-notice",
component: editNotice, component: editNotice,
// redirect: 'msgpush/msg-push', // redirect: 'msgpush/msg-push',
}, },
{ {
path: '/credit-manage', path: "/credit-manage",
component: creditManage, component: creditManage,
}, },
{ {
path: '/review-access-manage', path: "/review-access-manage",
component: reviewAccessManage, component: reviewAccessManage,
}, },
{ {
path: '/credit-send-manage', path: "/credit-send-manage",
component: creditSendManage, component: creditSendManage,
}, },
{ {
path: '/apply-detail', path: "/apply-detail",
component: applyDetail, component: applyDetail,
}, },
{ {
path: '/template-manager', path: "/template-manager",
component: templateManager component: templateManager,
}, },
{ {
path: '/template-editor', path: "/template-editor",
component: templateEditor component: templateEditor,
}, },
{ {
path: '/template-open', path: "/template-open",
component: templateOpen component: templateOpen,
}, },
{ {
path: '/edit-custom', path: "/edit-custom",
component: editCustom component: editCustom,
}, },
{ {
path: '/edu-role', path: "/edu-role",
component: eduRole component: eduRole,
}, },
{ {
path: '/notice-editor', path: "/notice-editor",
component: noticeEditor component: noticeEditor,
}, },
{ {
path: '/yq-range', path: "/yq-range",
component: yqRange component: yqRange,
}, },
{ {
path: '/activity-management', path: "/activity-management",
component: activityManagement component: activityManagement,
}, },
{ {
path:'/create-activity', path: "/create-activity",
component: createActivity component: createActivity,
},
}, {
{ path: "/live-manage",
path: '/live-manage', component: liveManage,
component: liveManage },
}, {
{ path: "/role-manage",
path: '/role-manage', component: roleManage,
component: roleManage },
}, {
{ path: "/admin-manage",
path: '/admin-manage', component: adminManage,
component: adminManage },
}, {
{ path: "/create-range",
path: '/create-range', component: createRange,
component: createRange },
}, {
{ path: "/range-manage",
path: '/range-manage', component: rangeManage,
component: rangeManage },
}, {
{ path: "/range-apply",
path: '/range-apply', component: rangeApply,
component: rangeApply },
}, {
{ path: "/create-live",
path: '/create-live', component: createLive,
component: createLive },
}, {
{ path: "/edit-range",
path:'/edit-range', component: editRange,
component: editRange },
}, {
{ path: "/blacklist-manage",
path: '/blacklist-manage', component: blackListManage,
component: blackListManage },
}, {
{ path: "/external-resource-manage",
path: '/external-resource-manage', component: externalResourceManage,
component: externalResourceManage, },
}, {
{ path: "/audit-custom-course",
path: '/audit-custom-course', component: auditCustomCourse,
component: auditCustomCourse, },
}, {
{ path: "/advert-simple-manage",
path: '/advert-simple-manage', component: advertSimpleManage,
component: advertSimpleManage, },
}, {
{ path: "/edit-simple-advert",
path: '/edit-simple-advert', component: editSimpleAdvert,
component: editSimpleAdvert, },
}, {
{ path: "/shop-list",
path: '/shop-list', component: shopList,
component: shopList, },
}, {
{ path: "/create-shop",
path: '/create-shop', component: createShop,
component: createShop, },
}, {
{ path: "/order-manage",
path: '/order-manage', component: orderManage,
component: orderManage, },
}, {
{ path: "/goods-manage",
path: '/goods-manage', component: goodsManage,
component: goodsManage, },
}, {
{ path: "/freight-config",
path: '/freight-config',
component: freightConfig, component: freightConfig,
}, },
{ {
path: '/create-good', path: "/create-good",
component: createGood, component: createGood,
}, },
{ {
path: '/order-detail', path: "/create-good-new",
component: orderDetail, component: createGoodNew,
}, },
{ {
path: '/plaza-list', path: "/order-detail",
component: plazaList, component: orderDetail,
}, },
{ {
path: '/activity-member', path: "/plaza-list",
component: activityMember, component: plazaList,
}, },
{ {
path: 'video-manage', path: "/activity-member",
component: videoManage, component: activityMember,
}, },
{ {
path: 'qualification-list', path: "video-manage",
component:qualificationList component: videoManage,
}, },
{ {
path: 'qualification-detail', path: "qualification-list",
component:qualificationDetail component: qualificationList,
}, },
{
path: "qualification-detail",
component: qualificationDetail,
},
// { // {
// path: '/followup', // path: '/followup',
// name: 'followUp', // name: 'followUp',
// component: followUp, // component: followUp,
// redirect: 'followup/plan-manage/planList', // redirect: 'followup/plan-manage/planList',
// }, // },
followRouters, followRouters,
patientsRouters, patientsRouters,
] ],
}] },
];
...@@ -218,9 +218,18 @@ html,body{ ...@@ -218,9 +218,18 @@ html,body{
border: 1px solid #449284 !important; border: 1px solid #449284 !important;
opacity: 0.5; opacity: 0.5;
} }
// .el-button--default:focus, .el-button--default:hover {
// color: #449284 !important;
// border-color: #449284 !important;
// background-color: #fff !important;
// }
.el-pagination.is-background .el-pager li:not(.disabled).active { .el-pagination.is-background .el-pager li:not(.disabled).active {
background: #449284 !important; background: #449284 !important;
} }
// 表格选中
.el-table__body tr.current-row>td.el-table__cell {
background-color: rgb(236, 244, 243) !important;
}
// 主题样式修改 // 主题样式修改
.el-radio__input.is-checked .el-radio__inner { .el-radio__input.is-checked .el-radio__inner {
......
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: "屏蔽机构操作上传文件",
});
};
...@@ -142,5 +142,82 @@ export const getBusinessCategory = () => { ...@@ -142,5 +142,82 @@ 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: "查询合作项目",
});
};
export const getGoodsCascadeList = (parentId, level) => {
return fetch({
headers,
url: getBaseUrl(
`store/commodity/categorys/cascade/list?pageNo=1&pageSize=999&parentId=${parentId}&categoryLevel=${level}`
),
method: "get",
description: " 获取商品(药品)分类",
});
};
// `store/medications/query/medicationGoodsListByPage`
export const getMedList = (data) => {
return fetch({
headers,
url: getBaseUrl(`store/medications/query/appliedMedicationGoodsListByPage`),
method: "post",
data,
description: "查询药品列表",
});
};
export const getCategorysList = (params) => {
return fetch({
headers,
url: getBaseUrl(`store/medical/categorys/list`),
method: "get",
params,
description: "查询药品类别",
});
};
export const saveMedList = (data) => {
return fetch({
headers,
url: getBaseUrl(`store/admin/medical/saveAndReturn`),
method: "post",
data,
description: "药品保存",
});
};
// 获取商品分类 / store / commodity / categorys / cascade / listAll;
export const getGoodsListAll = (params) => {
return fetch({
headers,
url: getBaseUrl(`store/commodity/categorys/cascade/listAll`),
method: "get",
params,
description: "查询商品类别",
});
};
// 条形码获取信息
export const getBarcodeData =(barCode) => {
return fetch({
headers,
url: getBaseUrl(`store/admin/medical/queryByBarcode/${barCode}`),
method: "get",
description: "条形码获取信息",
});
}
\ No newline at end of file
...@@ -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);
};
...@@ -684,6 +684,7 @@ ...@@ -684,6 +684,7 @@
v-model="item.certificateId" v-model="item.certificateId"
placeholder="请选择证书" placeholder="请选择证书"
style="" style=""
filterable
@change="updateCertificate(index)" @change="updateCertificate(index)"
:disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"
> >
...@@ -719,6 +720,7 @@ ...@@ -719,6 +720,7 @@
v-model="formComponent.certificate" v-model="formComponent.certificate"
placeholder="请选择证书" placeholder="请选择证书"
style="width: 350px" style="width: 350px"
filterable
:disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"
> >
<el-option <el-option
......
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
size="small" size="small"
placeholder="请输入组件名称" placeholder="请输入组件名称"
style="width: 30%" style="width: 30%"
clearable
></el-input> ></el-input>
<span class="word-num" <span class="word-num"
>{{ portalComponent.name.replace(/\s+/g, "").length }}/20</span >{{ portalComponent.name.replace(/\s+/g, "").length }}/20</span
...@@ -94,6 +95,7 @@ ...@@ -94,6 +95,7 @@
size="small" size="small"
placeholder="请输入组件简介" placeholder="请输入组件简介"
style="width: 37%" style="width: 37%"
clearable
></el-input> ></el-input>
<span class="word-num" <span class="word-num"
>{{ >{{
...@@ -135,6 +137,7 @@ ...@@ -135,6 +137,7 @@
:step="1" :step="1"
:min="0" :min="0"
:max="100" :max="100"
clearable
> >
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
...@@ -156,6 +159,7 @@ ...@@ -156,6 +159,7 @@
<el-col :span="10" v-if="hasCertificate"> <el-col :span="10" v-if="hasCertificate">
<el-form-item label="选择证书" prop="certificateId"> <el-form-item label="选择证书" prop="certificateId">
<el-select <el-select
filterable
v-model="portalComponent.certificateId" v-model="portalComponent.certificateId"
@change="selectChange" @change="selectChange"
:disabled="componentStatus == 3 || componentStatus == 4" :disabled="componentStatus == 3 || componentStatus == 4"
...@@ -206,7 +210,7 @@ ...@@ -206,7 +210,7 @@
:label="'模块' + parseInt(index + 1)" :label="'模块' + parseInt(index + 1)"
:name="'' + parseInt(index + 1)" :name="'' + parseInt(index + 1)"
> >
<div> <div v-if="(index + 1) == firstTab">
<el-form <el-form
ref="moduleForm" ref="moduleForm"
:model="item" :model="item"
...@@ -225,6 +229,7 @@ ...@@ -225,6 +229,7 @@
size="small" size="small"
placeholder="请选择模块名称" placeholder="请选择模块名称"
style="width: 288px" style="width: 288px"
clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -280,9 +285,13 @@ ...@@ -280,9 +285,13 @@
>{{ _item.name }}</el-button >{{ _item.name }}</el-button
> >
</div> </div>
<div <!-- <div
v-for="(item1, index1) in item.templetModelList" v-for="(item1, index1) in item.templetModelList"
:key="index1" :key="index1"
> -->
<div
v-for="(item1, index1) in showData(item.templetModelList)"
:key="item1.id"
> >
<el-form <el-form
ref="templateForm" ref="templateForm"
...@@ -294,7 +303,7 @@ ...@@ -294,7 +303,7 @@
<div class="template-content"> <div class="template-content">
<div class="template-content-div"> <div class="template-content-div">
<div class="title"> <div class="title">
{{ item1.name }} {{templateIndex + index1 + 1}}.{{ item1.name }}
<!-- <span v-if="newfieldDisabled(item)"> --> <!-- <span v-if="newfieldDisabled(item)"> -->
<span> <span>
变更顺序: 变更顺序:
...@@ -317,7 +326,7 @@ ...@@ -317,7 +326,7 @@
</div> </div>
<div <div
v-for="(item2, index2) in item1.partModelList" v-for="(item2, index2) in item1.partModelList"
:key="index2" :key="item2.id"
> >
<!-- 考试 --> <!-- 考试 -->
<div v-if="item2.type == 1"> <div v-if="item2.type == 1">
...@@ -327,7 +336,7 @@ ...@@ -327,7 +336,7 @@
<div <div
v-for="(item3, v-for="(item3,
index3) in item2.partContentModelList" index3) in item2.partContentModelList"
:key="index3" :key="item3.id"
> >
<el-row> <el-row>
<el-col :span="10" class="item-icon"> <el-col :span="10" class="item-icon">
...@@ -340,6 +349,7 @@ ...@@ -340,6 +349,7 @@
maxlength="30" maxlength="30"
placeholder="请输入考试名称" placeholder="请输入考试名称"
style="width: 288px" style="width: 288px"
clearable
></el-input> ></el-input>
<span <span
v-if="item2.numFlag == 2 && index3 == 0" v-if="item2.numFlag == 2 && index3 == 0"
...@@ -372,6 +382,7 @@ ...@@ -372,6 +382,7 @@
<span class="require">*</span> <span class="require">*</span>
<el-form-item label="关联考试"> <el-form-item label="关联考试">
<el-select <el-select
filterable
placeholder="请选择" placeholder="请选择"
v-model="item3.content3" v-model="item3.content3"
@focus=" @focus="
...@@ -445,6 +456,7 @@ ...@@ -445,6 +456,7 @@
<el-radio-group <el-radio-group
v-model="item3.certificateFlag" v-model="item3.certificateFlag"
:disabled="fieldDisabled(item)" :disabled="fieldDisabled(item)"
@change="changeCertificateFlag(item3)"
> >
<el-radio :label="2"></el-radio> <el-radio :label="2"></el-radio>
<el-radio :label="1"></el-radio> <el-radio :label="1"></el-radio>
...@@ -464,6 +476,7 @@ ...@@ -464,6 +476,7 @@
size="small" size="small"
placeholder="请选择证书" placeholder="请选择证书"
style="width: 288px" style="width: 288px"
filterable
> >
<el-option <el-option
v-for="(itemCertificate, v-for="(itemCertificate,
...@@ -485,12 +498,14 @@ ...@@ -485,12 +498,14 @@
{{ item2.introduce }} {{ item2.introduce }}
</div> </div>
<div class="sortable-course"> <div class="sortable-course">
<draggable v-model="item2.partContentModelList" @end="onDragEnd">
<el-row <el-row
v-for="(item3, v-for="(item3,
index3) in item2.partContentModelList" index3) in item2.partContentModelList"
:key="index3" :key="index3"
> >
<el-col :span="10" class="item-icon"> <el-col :span="10" class="item-icon">
<span v-if="item1.type == 3 || item1.type == 4 || item1.type == 5" class="sort-icon">{{index3 + 1}}</span>
<span class="require">*</span> <span class="require">*</span>
<el-form-item label="课程名称"> <el-form-item label="课程名称">
<el-input <el-input
...@@ -500,6 +515,7 @@ ...@@ -500,6 +515,7 @@
maxlength="30" maxlength="30"
placeholder="请输入课程名称" placeholder="请输入课程名称"
style="width: 288px" style="width: 288px"
clearable
></el-input> ></el-input>
<span <span
v-if="item2.numFlag == 2 && index3 == 0" v-if="item2.numFlag == 2 && index3 == 0"
...@@ -511,7 +527,8 @@ ...@@ -511,7 +527,8 @@
style="color: #449284" style="color: #449284"
></i> ></i>
<i <i
class="el-icon-caret-bottom" v-if="index3 != (item2.partContentModelList.length-1)"
class="el-icon-bottom"
@click=" @click="
sortCourseDown( sortCourseDown(
index, index,
...@@ -523,7 +540,8 @@ ...@@ -523,7 +540,8 @@
style="font-size: 17px" style="font-size: 17px"
></i> ></i>
<i <i
class="el-icon-caret-top" v-if="index3"
class="el-icon-top"
@click=" @click="
sortCourseUp( sortCourseUp(
index, index,
...@@ -550,7 +568,8 @@ ...@@ -550,7 +568,8 @@
style="color: red" style="color: red"
></i> ></i>
<i <i
class="el-icon-caret-bottom" v-if="index3 != (item2.partContentModelList.length-1)"
class="el-icon-bottom"
@click=" @click="
sortCourseDown( sortCourseDown(
index, index,
...@@ -562,7 +581,8 @@ ...@@ -562,7 +581,8 @@
style="font-size: 17px" style="font-size: 17px"
></i> ></i>
<i <i
class="el-icon-caret-top" v-if="index3"
class="el-icon-top"
@click=" @click="
sortCourseUp( sortCourseUp(
index, index,
...@@ -625,6 +645,7 @@ ...@@ -625,6 +645,7 @@
size="small" size="small"
placeholder="请输入试看时长" placeholder="请输入试看时长"
style="width: 300px" style="width: 300px"
clearable
></el-input> ></el-input>
<span class="word-num">(秒)</span> <span class="word-num">(秒)</span>
</el-form-item> </el-form-item>
...@@ -638,6 +659,7 @@ ...@@ -638,6 +659,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</draggable>
</div> </div>
</div> </div>
</div> </div>
...@@ -645,6 +667,17 @@ ...@@ -645,6 +667,17 @@
</div> </div>
</el-form> </el-form>
</div> </div>
<div class="pagination-warp">
<el-pagination
:current-page="pageNo"
:page-size="pageSize"
:page-sizes="[3]"
layout="total, sizes, prev, pager, next, jumper"
:total="item.templetModelList.length"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
></el-pagination>
</div>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -672,6 +705,7 @@ ...@@ -672,6 +705,7 @@
@change="selectChange" @change="selectChange"
placeholder="请选择资源包" placeholder="请选择资源包"
style="width: 60%" style="width: 60%"
filterable
> >
<el-option <el-option
v-for="(item, index) in resourceArray" v-for="(item, index) in resourceArray"
...@@ -736,6 +770,7 @@ ...@@ -736,6 +770,7 @@
</div> </div>
</el-form> </el-form>
</div> </div>
<span slot="footer" class="dialog-footer dialog-foot"> <span slot="footer" class="dialog-footer dialog-foot">
<el-button <el-button
type="default" type="default"
...@@ -751,6 +786,7 @@ ...@@ -751,6 +786,7 @@
</div> </div>
</template> </template>
<script> <script>
import draggable from "vuedraggable";
import BreadCrumb from "../../components/breadcrumb.vue"; import BreadCrumb from "../../components/breadcrumb.vue";
import { doUpload, getFilePath } from "../../utils/qiniu-util"; import { doUpload, getFilePath } from "../../utils/qiniu-util";
// import { validateWord150 } from "../../utils/validate.js" // import { validateWord150 } from "../../utils/validate.js"
...@@ -813,6 +849,7 @@ let validateModuleName = function (rule, value, callback, message) { ...@@ -813,6 +849,7 @@ let validateModuleName = function (rule, value, callback, message) {
export default { export default {
components: { components: {
BreadCrumb, BreadCrumb,
draggable
}, },
data() { data() {
return { return {
...@@ -878,6 +915,8 @@ export default { ...@@ -878,6 +915,8 @@ export default {
certificateCondition: "100", // 证书完成率 certificateCondition: "100", // 证书完成率
status: "", status: "",
}, },
pageNo: 1,
pageSize: 3,
componentList: { componentList: {
moduleModelList: [ moduleModelList: [
{ {
...@@ -953,6 +992,14 @@ export default { ...@@ -953,6 +992,14 @@ export default {
}, },
computed: { computed: {
...mapGetters(["_token", "idType"]), ...mapGetters(["_token", "idType"]),
templateIndex() {
return this.pageNo == 1 ? 0 : ((this.pageNo-1) * this.pageSize)
}
},
watch: {
firstTab() {
this.pageNo = 1;
}
}, },
created() { created() {
console.log("#######==========#####"); console.log("#######==========#####");
...@@ -980,6 +1027,27 @@ export default { ...@@ -980,6 +1027,27 @@ export default {
console.log("idType==>", vm.idType); console.log("idType==>", vm.idType);
}, },
methods: { methods: {
// 考试切换是否配置证书
changeCertificateFlag(caseItem) {
console.log(caseItem);
if (caseItem.certificateFlag == 1) {
caseItem.content4 = "";
}
},
handleSizeChange(val) {
this.pageSize = val;
this.showData(this.tamp);
},
handleCurrentChange(val) {
this.pageNo = val;
this.showData(this.tamp);
},
showData(data) {
this.tamp = data;
let start = this.pageNo == 1 ? 0 : ((this.pageNo-1) * this.pageSize);
console.log(start,this.pageNo * this.pageSize);
return data && data.length ? data.slice(start, this.pageNo * this.pageSize) : [];
},
// 模块可以拖动排序 // 模块可以拖动排序
tabDrop() { tabDrop() {
this.$nextTick(() => { this.$nextTick(() => {
...@@ -1026,7 +1094,6 @@ export default { ...@@ -1026,7 +1094,6 @@ export default {
}); });
}); });
}, },
// 根据ID查询组件基本信息 // 根据ID查询组件基本信息
componentBasicInfo() { componentBasicInfo() {
if (vm.componentId) { if (vm.componentId) {
...@@ -1049,7 +1116,6 @@ export default { ...@@ -1049,7 +1116,6 @@ export default {
}); });
} }
}, },
selectStandard(index) {}, selectStandard(index) {},
// 删除图片 // 删除图片
deleteImg() { deleteImg() {
...@@ -1268,20 +1334,26 @@ export default { ...@@ -1268,20 +1334,26 @@ export default {
examName = vm.testIdSelect[i].onlineExamName; examName = vm.testIdSelect[i].onlineExamName;
} }
} }
if ( vm.componentList.moduleModelList[vm.examIndex].templetModelList[
!vm.componentList.moduleModelList[vm.examIndex].templetModelList[
vm.examIndex1
].partModelList[vm.examIndex2].partContentModelList[vm.examIndex3]
.content1
) {
vm.componentList.moduleModelList[vm.examIndex].templetModelList[
vm.examIndex1 vm.examIndex1
].partModelList[vm.examIndex2].partContentModelList[ ].partModelList[vm.examIndex2].partContentModelList[
vm.examIndex3 vm.examIndex3
].content1 = examName; ].content1 = examName;
} // if (
// !vm.componentList.moduleModelList[vm.examIndex].templetModelList[
// vm.examIndex1
// ].partModelList[vm.examIndex2].partContentModelList[vm.examIndex3]
// .content1
// ) {
// vm.componentList.moduleModelList[vm.examIndex].templetModelList[
// vm.examIndex1
// ].partModelList[vm.examIndex2].partContentModelList[
// vm.examIndex3
// ].content1 = examName;
// }
}, },
examIDfocus(index, index1, index2, index3) { examIDfocus(index, index1flag, index2, index3) {
let index1 = index1flag + (this.pageNo-1) * this.pageSize;
vm.examIndex = index; vm.examIndex = index;
vm.examIndex1 = index1; vm.examIndex1 = index1;
vm.examIndex2 = index2; vm.examIndex2 = index2;
...@@ -1309,20 +1381,26 @@ export default { ...@@ -1309,20 +1381,26 @@ export default {
courseName = vm.courseIdSelect[i].name; courseName = vm.courseIdSelect[i].name;
} }
} }
if ( vm.componentList.moduleModelList[vm.courseIndex].templetModelList[
!vm.componentList.moduleModelList[vm.courseIndex].templetModelList[
vm.courseIndex1
].partModelList[vm.courseIndex2].partContentModelList[vm.courseIndex3]
.content1
) {
vm.componentList.moduleModelList[vm.courseIndex].templetModelList[
vm.courseIndex1 vm.courseIndex1
].partModelList[vm.courseIndex2].partContentModelList[ ].partModelList[vm.courseIndex2].partContentModelList[
vm.courseIndex3 vm.courseIndex3
].content1 = courseName; ].content1 = courseName;
} // if (
// !vm.componentList.moduleModelList[vm.courseIndex].templetModelList[
// vm.courseIndex1
// ].partModelList[vm.courseIndex2].partContentModelList[vm.courseIndex3]
// .content1
// ) {
// vm.componentList.moduleModelList[vm.courseIndex].templetModelList[
// vm.courseIndex1
// ].partModelList[vm.courseIndex2].partContentModelList[
// vm.courseIndex3
// ].content1 = courseName;
// }
}, },
courseIDfocus(index, index1, index2, index3) { courseIDfocus(index, index1flag, index2, index3) {
let index1 = index1flag + (this.pageNo-1) * this.pageSize;
vm.courseIndex = index; vm.courseIndex = index;
vm.courseIndex1 = index1; vm.courseIndex1 = index1;
vm.courseIndex2 = index2; vm.courseIndex2 = index2;
...@@ -1414,7 +1492,6 @@ export default { ...@@ -1414,7 +1492,6 @@ export default {
// } // }
// vm.$forceUpdate(); // vm.$forceUpdate();
}, },
// 删除模块前进行确认 // 删除模块前进行确认
beforeRemoveTab(targetName) { beforeRemoveTab(targetName) {
// 模板不为空 // 模板不为空
...@@ -1439,7 +1516,6 @@ export default { ...@@ -1439,7 +1516,6 @@ export default {
}); });
}); });
}, },
// 删除tab // 删除tab
removeTab(targetName) { removeTab(targetName) {
for (let i = 0; i < vm.componentList.moduleModelList.length; i++) { for (let i = 0; i < vm.componentList.moduleModelList.length; i++) {
...@@ -1592,9 +1668,9 @@ export default { ...@@ -1592,9 +1668,9 @@ export default {
} }
vm.templetIndex++; vm.templetIndex++;
}, },
// 删除模板前 // 删除模板前
beforeDeleteTemplate(index, index1) { beforeDeleteTemplate(index, index1flag) {
let index1 = index1flag + (this.pageNo-1) * this.pageSize;
vm.$confirm( vm.$confirm(
"确定要删除此模板吗?<br/>(<span style='color:red;font-size:12px;'>如需更新学情报告,可通过上下架项目实现</span>)", "确定要删除此模板吗?<br/>(<span style='color:red;font-size:12px;'>如需更新学情报告,可通过上下架项目实现</span>)",
"提示", "提示",
...@@ -1616,7 +1692,6 @@ export default { ...@@ -1616,7 +1692,6 @@ export default {
}); });
}); });
}, },
// 删除模板 // 删除模板
deleteTemplate(index, index1) { deleteTemplate(index, index1) {
for (let i = 0; i < vm.componentList.moduleModelList.length; i++) { for (let i = 0; i < vm.componentList.moduleModelList.length; i++) {
...@@ -1641,9 +1716,12 @@ export default { ...@@ -1641,9 +1716,12 @@ export default {
} }
} }
}, },
onDragEnd() {
},
// 课程排序-向上 // 课程排序-向上
sortCourseUp(index, index1, index2, index3) { sortCourseUp(index, index1flag, index2, index3) {
let index1 = index1flag + (this.pageNo-1) * this.pageSize;
// 不是第一个元素,才可能上移 // 不是第一个元素,才可能上移
if (index3 > 0) { if (index3 > 0) {
let item = vm.componentList.moduleModelList[index].templetModelList[ let item = vm.componentList.moduleModelList[index].templetModelList[
...@@ -1659,9 +1737,9 @@ export default { ...@@ -1659,9 +1737,9 @@ export default {
vm.$forceUpdate(); vm.$forceUpdate();
} }
}, },
// 课程排序-向下 // 课程排序-向下
sortCourseDown(index, index1, index2, index3) { sortCourseDown(index, index1flag, index2, index3) {
let index1 = index1flag + (this.pageNo-1) * this.pageSize;
let pLength = let pLength =
vm.componentList.moduleModelList[index].templetModelList[index1] vm.componentList.moduleModelList[index].templetModelList[index1]
.partModelList[index2].partContentModelList.length - 1; .partModelList[index2].partContentModelList.length - 1;
...@@ -1681,10 +1759,38 @@ export default { ...@@ -1681,10 +1759,38 @@ export default {
vm.$forceUpdate(); vm.$forceUpdate();
} }
}, },
// 课程排序-置顶
sortCourseUp(index, index1flag, index2, index3) {
let index1 = index1flag + (this.pageNo-1) * this.pageSize;
// 不是第一个元素,才可能上移
if (index3 > 0) {
let item = vm.componentList.moduleModelList[index].templetModelList[index1].partModelList[index2].partContentModelList.splice(index3, 1)[0];
vm.componentList.moduleModelList[index].templetModelList[index1].partModelList[index2].partContentModelList.splice(
0,
0,
item
);
vm.$forceUpdate();
}
},
// 课程排序-置底部
sortCourseDown(index, index1flag, index2, index3) {
let index1 = index1flag + (this.pageNo-1) * this.pageSize;
let pLength = vm.componentList.moduleModelList[index].templetModelList[index1].partModelList[index2].partContentModelList.length - 1;
if (index3 <= pLength && pLength > 0) {
let item = vm.componentList.moduleModelList[index].templetModelList[index1].partModelList[index2].partContentModelList.splice(index3, 1)[0];
vm.componentList.moduleModelList[index].templetModelList[index1].partModelList[index2].partContentModelList.splice(
parseInt(pLength),
0,
item
);
vm.$forceUpdate();
}
},
// 添加多个课程 // 添加多个课程
addMatterCourse(index, index1, index2) { addMatterCourse(index, index1flag, index2) {
console.log(index, index1, index2); console.log(index, index1flag, index2);
let index1 = index1flag + (this.pageNo-1) * this.pageSize;
for (let i = 0; i < vm.componentList.moduleModelList.length; i++) { for (let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if (index == i) { if (index == i) {
for ( for (
...@@ -1724,9 +1830,9 @@ export default { ...@@ -1724,9 +1830,9 @@ export default {
} }
} }
}, },
// 删除多个课程(多个考试)元件的确认框 // 删除多个课程(多个考试)元件的确认框
beforeDeleteMatterCourse(index, index1, index2, index3) { beforeDeleteMatterCourse(index, index1flag, index2, index3) {
let index1 = index1flag + (this.pageNo-1) * this.pageSize;
// 删除模块前进行确认 // 删除模块前进行确认
vm.$confirm( vm.$confirm(
"确定要删除此课程吗?<br>(<span style='color:red;font-size:12px;'>如需更新学情报告,可通过上下架项目实现</span>)", "确定要删除此课程吗?<br>(<span style='color:red;font-size:12px;'>如需更新学情报告,可通过上下架项目实现</span>)",
...@@ -1749,7 +1855,6 @@ export default { ...@@ -1749,7 +1855,6 @@ export default {
}); });
}); });
}, },
// 删除多个课程(多个考试)元件 // 删除多个课程(多个考试)元件
deleteMatterCourse(index, index1, index2, index3) { deleteMatterCourse(index, index1, index2, index3) {
for (let i = 0; i < vm.componentList.moduleModelList.length; i++) { for (let i = 0; i < vm.componentList.moduleModelList.length; i++) {
...@@ -1798,7 +1903,8 @@ export default { ...@@ -1798,7 +1903,8 @@ export default {
} }
}, },
// 模板下移 // 模板下移
sortUp(index, index1) { sortUp(index, index1flag) {
let index1 = index1flag + (this.pageNo-1) * this.pageSize;
for (let i = 0; i < vm.componentList.moduleModelList.length; i++) { for (let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if (index == i) { if (index == i) {
if ( if (
...@@ -1824,7 +1930,8 @@ export default { ...@@ -1824,7 +1930,8 @@ export default {
} }
}, },
// 模板下移 // 模板下移
sortDown(index, index1) { sortDown(index, index1flag) {
let index1 = index1flag + (this.pageNo-1) * this.pageSize;
for (let i = 0; i < vm.componentList.moduleModelList.length; i++) { for (let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if (index == i) { if (index == i) {
if (index1 != 0) { if (index1 != 0) {
...@@ -2026,6 +2133,7 @@ export default { ...@@ -2026,6 +2133,7 @@ export default {
} }
vm.$router.push({ path: "item-component", query: query }); vm.$router.push({ path: "item-component", query: query });
} else { } else {
vm.getModuleData();
vm.$message.info("暂存成功!"); vm.$message.info("暂存成功!");
} }
} else { } else {
...@@ -2249,6 +2357,21 @@ export default { ...@@ -2249,6 +2357,21 @@ export default {
} }
.item-icon { .item-icon {
position: relative; position: relative;
span.sort-icon {
position: absolute;
top: 9px;
left: 9px;
font-size: 12px;
border: 1px solid #606266;
border-radius: 50%;
text-align: center;
line-height: 22px;
width: 24px;
height: 24px;
box-sizing: border-box;
color: #606266;
transform: scale(0.8);
}
span.require { span.require {
position: absolute; position: absolute;
left: 37px; left: 37px;
...@@ -2311,6 +2434,10 @@ export default { ...@@ -2311,6 +2434,10 @@ export default {
} }
} }
} }
.pagination-warp {
padding: 10px;
text-align: right;
}
} }
.cc-class-box { .cc-class-box {
......
...@@ -1173,6 +1173,7 @@ ...@@ -1173,6 +1173,7 @@
placeholder="请选择证书" placeholder="请选择证书"
size="mini" size="mini"
style="width: 450px;" style="width: 450px;"
filterable
@change="updateCertificate(index)" @change="updateCertificate(index)"
:disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"
> >
...@@ -1234,6 +1235,7 @@ ...@@ -1234,6 +1235,7 @@
:class="customError.certificate.className" :class="customError.certificate.className"
> >
<el-select <el-select
filterable
v-model="formComponent.certificate" v-model="formComponent.certificate"
placeholder="请选择证书" placeholder="请选择证书"
style="width: 350px" style="width: 350px"
......
...@@ -956,6 +956,7 @@ ...@@ -956,6 +956,7 @@
placeholder="请选择证书" placeholder="请选择证书"
size="mini" size="mini"
style="width: 450px;" style="width: 450px;"
filterable
@change="updateCertificate(index)" @change="updateCertificate(index)"
:disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"
> >
...@@ -998,6 +999,7 @@ ...@@ -998,6 +999,7 @@
v-model="formComponent.certificate" v-model="formComponent.certificate"
placeholder="请选择证书" placeholder="请选择证书"
style="width: 350px" style="width: 350px"
filterable
:disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"
> >
<el-option <el-option
...@@ -1741,13 +1743,19 @@ export default { ...@@ -1741,13 +1743,19 @@ export default {
if (option == "edit" || option == "storageEdit") { if (option == "edit" || option == "storageEdit") {
notifyData.notifyId = this.formData.notifyId; 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 = { let postData = {
projectModel: JSON.stringify(projectModel), projectModel: JSON.stringify(projectModel),
attachmentModel: JSON.stringify(attachmentModel), attachmentModel: JSON.stringify(attachmentModel),
attachmentPDFModel: JSON.stringify(attachmentPDFModel), attachmentPDFModel: JSON.stringify(attachmentPDFModel),
notifyData: JSON.stringify(notifyData) notifyData: JSON.stringify(notifyData)
}; };
//console.log(postData); console.log('JSON.stringify(projectModel)', projectModel, attachmentModel, attachmentPDFModel, notifyData);
openLoading(vm); openLoading(vm);
vm.POST("portal/portalInfo/insertOrUpdate", postData).then(res => { vm.POST("portal/portalInfo/insertOrUpdate", postData).then(res => {
closeLoading(vm); closeLoading(vm);
...@@ -2822,7 +2830,6 @@ export default { ...@@ -2822,7 +2830,6 @@ export default {
projectId: this.projectId, projectId: this.projectId,
administrativeId: "", administrativeId: "",
hospitalLevel: "", hospitalLevel: "",
hospitalLevel: "",
scope: this.getScope("administrative"), scope: this.getScope("administrative"),
pageNum: this.formOrganization.pageNum, pageNum: this.formOrganization.pageNum,
pageSize: this.formOrganization.pageSize pageSize: this.formOrganization.pageSize
......
...@@ -1181,6 +1181,7 @@ ...@@ -1181,6 +1181,7 @@
placeholder="请选择证书" placeholder="请选择证书"
size="mini" size="mini"
style="width: 450px;" style="width: 450px;"
filterable
@change="updateCertificate(index)" @change="updateCertificate(index)"
:disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"
> >
...@@ -1244,6 +1245,7 @@ ...@@ -1244,6 +1245,7 @@
<el-select <el-select
v-model="formComponent.certificate" v-model="formComponent.certificate"
placeholder="请选择证书" placeholder="请选择证书"
filterable
style="width: 350px" style="width: 350px"
:disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"
> >
......
...@@ -213,7 +213,7 @@ ...@@ -213,7 +213,7 @@
<el-dialog <el-dialog
title="请选择项目类型" title="请选择项目类型"
:visible.sync="centerDialogVisible" :visible.sync="centerDialogVisible"
width="600px" width="750px"
:close-on-click-modal="false" :close-on-click-modal="false"
@close="handleTypeClose" @close="handleTypeClose"
center center
...@@ -224,6 +224,7 @@ ...@@ -224,6 +224,7 @@
<el-radio :label="2">CME项目</el-radio> <el-radio :label="2">CME项目</el-radio>
<el-radio :label="3">开放模板</el-radio> <el-radio :label="3">开放模板</el-radio>
<el-radio :label="5">职称考试</el-radio> <el-radio :label="5">职称考试</el-radio>
<el-radio :label="6">中医项目</el-radio>
</el-radio-group> </el-radio-group>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false">取 消</el-button> <el-button @click="centerDialogVisible = false">取 消</el-button>
...@@ -295,7 +296,6 @@ export default { ...@@ -295,7 +296,6 @@ export default {
data() { data() {
return { return {
changeStatusVisible: false, changeStatusVisible: false,
currentRow: null,
currentType: 4, currentType: 4,
changeStatusConfig: { changeStatusConfig: {
title: "确认通过该项目模版审核吗?", title: "确认通过该项目模版审核吗?",
...@@ -460,6 +460,9 @@ export default { ...@@ -460,6 +460,9 @@ export default {
toPage(isPreview = 0) { toPage(isPreview = 0) {
this.$router.push("edit-manager?projectType=1&isPreview=" + isPreview); this.$router.push("edit-manager?projectType=1&isPreview=" + isPreview);
}, },
toTCMPage(isPreview = 0) {
this.$router.push("edit-manager?projectType=5&isPreview=" + isPreview);
},
toCmePage(isPreview = 0) { toCmePage(isPreview = 0) {
this.$router.push("edit-cme?projectType=2&isPreview=" + isPreview); this.$router.push("edit-cme?projectType=2&isPreview=" + isPreview);
}, },
...@@ -490,6 +493,8 @@ export default { ...@@ -490,6 +493,8 @@ export default {
this.toTemplatePage(); this.toTemplatePage();
} else if (this.newProjectType == 5) { } else if (this.newProjectType == 5) {
this.toProfessionalExamPage(); this.toProfessionalExamPage();
}else if (this.newProjectType == 6) {
this.toTCMPage();
} }
}, },
...@@ -505,16 +510,6 @@ export default { ...@@ -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) { hanldeCmeClick(row) {
this.currentRow = row; this.currentRow = row;
let status = row.projectStatus; let status = row.projectStatus;
...@@ -661,13 +656,10 @@ export default { ...@@ -661,13 +656,10 @@ export default {
return text; return text;
// return true / false; // return true / false;
}, },
changeStatusPre() { changeStatusPre() {
this.changeStatus(this.currentRow, this.currentType); this.changeStatus(this.currentRow, this.currentType);
this.changeStatusVisible = false; this.changeStatusVisible = false;
}, },
//
changeStatusForSP(row, type) { changeStatusForSP(row, type) {
this.currentRow = row; this.currentRow = row;
this.currentType = type; this.currentType = type;
...@@ -681,17 +673,18 @@ export default { ...@@ -681,17 +673,18 @@ export default {
} }
this.changeStatusVisible = true; this.changeStatusVisible = true;
}, },
//改变状态 //改变状态
changeStatus(row, type) { changeStatus(row, type) {
console.log('--row', row);
let projectId = row.id; let projectId = row.id;
let level = row.level; let level = row.level;
if (type === 0) { if (type === 0) {
this.updateItemManager(this.formInline); this.updateItemManager(this.formInline);
//编辑 //编辑
if (row.projectType === 1) { if (row.projectType === 1 || row.projectType === 5 ) {
this.$router.push( this.$router.push(
"edit-manager?projectType=1&projectId=" + "edit-manager?projectType=" + row.projectType +"&projectId=" +
projectId + projectId +
"&level=" + "&level=" +
level + level +
...@@ -799,9 +792,6 @@ export default { ...@@ -799,9 +792,6 @@ export default {
this.deleteVisible = true; this.deleteVisible = true;
this.currentRow = row; this.currentRow = row;
}, },
hideDeleteFrom() {
this.deleteVisible = false;
},
// 删除项目 // 删除项目
confirmDelete() { confirmDelete() {
let req = {}; let req = {};
......
...@@ -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
...@@ -606,7 +606,7 @@ export default { ...@@ -606,7 +606,7 @@ export default {
} }
} }
// url = `/create-good?id=${row.goodsId}&storeId=${this.searchForm.storeId}&goodsType=${goodsType}&commissionFlag=${this.commissionFlag}` // url = `/create-good?id=${row.goodsId}&storeId=${this.searchForm.storeId}&goodsType=${goodsType}&commissionFlag=${this.commissionFlag}`
let url = `/create-good?id=${item}&storeId=${this.storeId}&goodsType=${goodsType}&commissionFlag=2`; let url = `/create-good-new?id=${item}&storeId=${this.storeId}&goodsType=${goodsType}&commissionFlag=2`;
// this.$store.dispatch('goodsManage/changeGoodsInfo', {...row}); // this.$store.dispatch('goodsManage/changeGoodsInfo', {...row});
this.$router.push({ this.$router.push({
path: url, path: url,
......
const form1 = {
approvalNumber: "", // 批准文号
medicCommonName: "", // 产品通用名称
barCode: "", // 条形码
medicGoodsName: "", // 商品名称
specifications: "", // 规格
productionCompany: "", // 生产企业
medicalCategoryId: "", // 药品分类
};
const form = {
id: 0,
goodsName: "",
goodsDescription: "",
goodsHeaderImages: [],
goodsType: "",
// barCode: "",
costPrice: 0,
decrStock: 0, //减少库存
incrStock: "", //增加库存
storeId: "",
optPrice: "",
scorePerformance: 0,
goodsStock: 0,
stock: 0,
externalGoodsCode: "",
leastCount: 1,
mostCount: -1,
incrType: 1,
saleType: 1,
minWhole: 1,
expressLimitFlag: 0, //是否支持退货退款
};
const form3 = {
goodsCategoryIdList: [], // 商品分类
cooperationProjectId: "", // 合作项目id
contractId: "", // 合同id
goodsName: "", // 商品名称
choiceGoods: false,
goodsDescription: "", // 商品介绍
goodsHeaderImages: [],
goodsVideoList: [],
goodsDetailImages: [],
medicationId: "",
};
export const originForm1 = form1;
export const originForm3 = form3;
export const originForm = form;
const checkBarcode = (rule, value, cb) => {
const valedBarcode = new RegExp("[\\u4E00-\\u9FFF]+", "g");
if (value && valedBarcode.test(value)) cb(new Error("条形码不能输入中文"));
cb();
};
const checkNumber = (rule, value, cb) => {
const val = String(value);
const isInt = /^([1-9][0-9]*)$/;
if (val && !isInt.test(val)) cb(new Error("请输入正整数"));
cb();
};
const checkProjectStr = (rule, value, callback) => {
if (value.indexOf("\\") != -1) {
//存在
callback(new Error("请勿输入字符“ \\ "));
} else if (value.indexOf(".") != -1) {
callback(new Error("请勿输入字符“ . "));
} else {
callback();
}
};
const rules1 = {
barCode: [
{ required: true, message: "请输入条形码", trigger: "blur" },
{ validator: checkBarcode, trigger: "blur" },
],
medicCommonName: [
{ required: true, message: "请输入产品名称/通用名称", trigger: "blur" },
],
medicGoodsName: [
{
required: true,
message: "请输入商品名称或品牌名/商品名",
trigger: "blur",
},
],
specifications: [{ required: true, message: "请输入规格", trigger: "blur" }],
productionCompany: [
{ required: true, message: "请输入生产企业", trigger: "blur" },
],
medicalCategoryId: [
{ required: true, message: "请选择药品分类", trigger: "change" },
],
approvalNumber: [
{ required: true, message: "请输入批准文号", trigger: "blur" },
],
// dosageId:[
// { required: true, message: "请选择剂型", trigger: "change" }
// ],
categoryIdLevel2: [
{ required: true, message: "请选择药品类型", trigger: "blur" },
],
categoryIdLevel3: [
{ required: true, message: "请选择一级类目", trigger: "blur" },
],
categoryIdLevel4: [
{ required: true, message: "请选择二级类目", trigger: "blur" },
],
categoryIdLevel5: [
{ required: true, message: "请选择三级类目", trigger: "blur" },
],
specification_url: [
{ required: true, message: "请上传药品说明书", trigger: "blur" },
],
// otc:[
// { required: true, message: "请选择是否是处方", trigger: "blur" }
// ],
dynamicFlag: [
{ required: true, message: "请选择内容发布权", trigger: "blur" },
],
};
const rules2 = {
// barCode: [
// { required: true, message: "请输入条形码", trigger: "submit" },
// { validator: checkBarcode, trigger: "submit" }
// ],
checkName: [{ required: true, message: "请输入检测名称", trigger: "blur" }],
hospitalName: [
{ required: true, message: "请输入医疗机构名称", trigger: "blur" },
],
hospitalType: [
{ required: true, message: "请选择医疗机构类型", trigger: "blur" },
],
checkItem: [{ required: true, message: "请输入检测项目", trigger: "blur" }],
checkStandard: [
{ required: true, message: "请输入检测指标", trigger: "blur" },
],
useCount: [
{ required: true, message: "请输入使用人数", trigger: "submit" },
{ validator: checkNumber, trigger: "submit" },
],
checkType: [{ required: true, message: "请选择检测类型", trigger: "blur" }],
suitableArr: [{ required: true, message: "请选择适用人群", trigger: "blur" }],
endTime: [{ required: true, message: "请选择商品使用日期", trigger: "blur" }],
// goodsCheckImages: [
// { required: true, message: "请上传检测说明图", trigger: "blur" }
// ],
};
const rules = {
// barCode: [
// { required: true, message: "请输入条形码", trigger: "blur" },
// { validator: checkBarcode, trigger: "blur" },
// ],
optPrice: [{ required: true, message: "请输入价格", trigger: "blur" }],
saleType: [{ required: true, message: "请选择销售方式", trigger: "change" }],
stock: [{ required: true, message: "请输入库存", trigger: "blur" }],
minWhole: [{ required: true, message: "请输入最小起批", trigger: "blur" }],
expressLimitFlag: [
{
required: true,
message: "请选择是否支持售后",
trigger: "change",
},
],
};
const rules3 = {
goodsName: [
{ required: true, message: "请输入商品名称", trigger: "blur" },
// { validator: checkProjectStr, trigger: "submit" },
],
goodsDescription: [
{ required: true, message: "请输入商品介绍", trigger: "blur" },
],
goodsHeaderImages: [
{ required: true, message: "请上传商品头图", trigger: "blur" },
],
goodsCategoryIdList: [
{ required: true, message: "请选择商品分类", trigger: "change" },
],
};
export const originRules1 = rules1;
export const originRules2 = rules2;
export const originRules3 = rules3;
export const originRules = rules;
.create-shop-wrapper-new{
.create-shop-content{
background: #fff;
padding: 10px;
.step-content {
overflow: hidden;
height: 60px;
padding: 10px 10px 50px ;
border-bottom: 1px solid #efefef;
.title{
font-size: 13px;
color: #449284;
}
}
.word-tip {
color: #e6af7a;
}
.word-show {
color: #449284;
cursor: pointer;
}
}
.suitableList-select {
width: 445px;
}
.el-button--text{
color: #449284;
font-size: 14px;
&::after{
content: '';
position: relative;
height: 14px;
/*border-right: 1px solid #EBEEF5;*/
border-right: 1px solid #aaaaaa;
padding-right: 10px;
}
&:last-of-type{
&::after{
content: '';
position: relative;
width: 1px;
height: 14px;
border-right: none;
}
}
}
.required-label .el-form-item__label::before {
content: "*";
color: #f56c6c;
margin-right: 4px;
}
.goods-category,.project-req {
.el-form-item__label::before {
content: "*";
color: #f56c6c;
margin-right: 4px;
}
.project-tip {
color: #aaaaaa;
}
}
.choice-goods {
.el-form-item__label::before {
content: "*";
color: #f56c6c;
margin-right: 4px;
}
}
.label-detailimg {
.el-form-item__label::before {
content: "*";
color: #f56c6c;
margin-right: 4px;
}
.bg-uploader {
.el-upload {
display: flex;
}
}
}
.basic-item-icon {
position: relative;
.show-goods-table {
.del-goods {
color: #449284;
cursor: pointer;
}
}
.require {
position: absolute;
left: 67px;
top: 11px;
color: #f56c6c;
}
.error-message{
font-size: 12px;
color: #f56c6c;
}
.upload-message {
position: absolute;
left: 0;
top: 105px;
font-size: 12px;
color: #f56c6c;
}
.backTip {
font-size: 12px;
color: red;
cursor: pointer;
}
.ad-back {
color: #449284;
}
.img-delete {
position: absolute;
left: 0px;
top: 0px;
width: 84px;
height: 100px;
background: #000;
opacity: 0.7;
z-index: 999;
i {
color: #fff;
margin-top: 39px;
margin-left: 0px;
}
}
}
.word-num {
font-size: 12px;
color: #999;
// padding-top: 5px;
}
.line {
margin-left: 10px;
width: 20px;
}
.bg-uploader {
.bg-img {
float: left;
width: 84px;
height: 100px;
}
.limit-text {
float: left;
margin-left: 10px;
margin-top: -10px;
p {
font-size: 12px;
color: #999;
text-align: left;
}
}
}
.el-upload__tip {
position: absolute;
top: -6px;
left: 130px;
}
.span-mt-10{
.edit-img {
width: 20px;
margin-top: 10px;
}
}
.p-tips{
font-size: 13px;
color: #8C8C8C;
line-height: 26px;
}
.part-tit{
font-size: 14px;
padding:20px 0 20px 20px;
}
.inline{
.el-form-item{
display: inline-block;
vertical-align:top;
.el-radio__label{
font-size: 12px;
}
}
}
.stock-com{
width: 158px;
height: 32px;
border-radius: 4px;
overflow: hidden;
.sp{
display: inline-block;
float: left;
color: #fff;
}
.sp-c{
line-height: 30px;
height: 30px;
width:92px;
text-align: center;
color: #666;
border-top:1px solid #449284;
border-bottom:1px solid #449284;
}
.sp-l{
border-right:1px solid #449284;
}
.sp-r{
border-left:1px solid #449284;
border-radius: 0 4px 4px 0;
}
.sp-l,.sp-r{
width: 32px;
text-align: center;
line-height: 32px;
font-size: 13px;
background: #449284 ;
cursor: pointer;
}
.opac{
opacity: 0.5;
}
}
.stock-dia{
.stock-item{
padding-bottom: 20px;
}
}
.fast-opt{
font-size: 12px;
padding:0 10px;
cursor: pointer;
color:#449284
}
.file-pics{
display: inline-block;
width: 84px;
height: 100px;
float:left;
margin-right: 15px;
position: relative;
}
.el-input-number__decrease, .el-input-number__increase {
position: absolute;
z-index: 1;
top: 1px;
width: 40px;
height: auto;
text-align: center;
background: #449284 !important;
color: #606266;
cursor: pointer;
font-size: 13px;
}
.el-icon-plus {
color:#ffffff;
}
.el-icon-minus {
color:#ffffff;
}
#introVideoLecture {
height: 140px;
}
.video-progress {
width: 20%;
}
.el-upload-list {
width: 30%;
}
.label-video {
position: relative;
.el-button:focus, .el-button:hover {
color: #449284;
border-color: #449284;
background-color: #ecf5ff;
}
.dl-video {
position: absolute;
top: 50%;
left: 35%;
transform: translate(-50%,-50%);
}
}
.add-goods-dialog {
.el-dialog__body {
padding-left: 35px;
padding-right: 35px;
}
.add-btn-row {
text-align: right;
}
.add-goods-table {
margin-top: 10px;
margin-bottom: 20px;
}
.add-goods-search {
margin-left: 10px;
}
.add-goods--pagination {
text-align: right;
margin-top: 25px;
margin-bottom: 25px;
}
}
.add-btn.is-disabled {
background: #fff !important;
border: 1px solid #DCDFE6 !important;
color: #606266 !important;
}
.add-med-dialog {
.medic-goods-max {
.el-input__inner {
padding-right: 45px;
}
}
}
.example-dialog {
img {
width: 100%;
height: 100%;
}
}
}
<template>
<div class="create-shop-wrapper-new">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond" :curmbThird="curmbThird" :jumPathThird="jumPathThird"></bread-crumb>
<div class="create-shop-content screenSet" id="screenSet">
<el-row class="step-content">
<el-col :span="20">
<p class="title">{{title}}</p>
</el-col>
<el-col :span="4" style="text-align: right">
<el-button size="small" @click="cancelComplete">取消</el-button>
<el-button size="small" type="primary" @click="complete">保存</el-button>
</el-col>
</el-row>
<el-form
ref="formData3"
:model="formData3"
:rules="rules3"
label-width="150px"
label-suffix=":"
class="basic-form"
>
<div class="basic-item-icon">
<div class="part-tit">基本信息</div>
<el-form-item label="商品分类" class="goods-category">
<el-cascader
size="small"
ref="cascader"
:options="goodsCategoryList"
:props="cascaderProps"
clearable
filterable
v-model="goodsCategoryIdList"
@change="searchCategoryChange"
/>
<div v-if="isgoodsCategory" :style="{color: '#f56c6c',fontSize: '12px'}">请选择商品分类</div>
</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"
@change="contractChange"
>
<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>
<div v-if="isProjectId" :style="{color: '#f56c6c',fontSize: '12px'}">请关联项目名称</div>
</el-form-item>
<el-form-item label="选择基础药品" prop="choiceGoods" class="choice-goods">
<el-col :span="16">
<el-button type="primary" @click="addMed" :disabled="isShowGoods">+添加药品</el-button>
<el-button @click="addNewGoods" :disabled="isShowGoods" class="add-btn">新增药品</el-button>
<div v-if="isShowGoodsMsg && !isShowGoods" :style="{color: '#f56c6c',fontSize: '12px'}">请选择基础药品</div>
</el-col>
<el-table
v-if="isShowGoods"
:data="choiceMedData"
ref="singlTable"
class="show-goods-table">
<el-table-column property="productName" label="产品名称/通用名称" width="180"></el-table-column>
<el-table-column property="barCode" label="条形码" width="180"></el-table-column>
<el-table-column property="goodsName" label="商品名称" width="180"></el-table-column>
<el-table-column property="approvalNumber" label="批准文号" width="180"></el-table-column>
<el-table-column property="specifications" label="规格" width="180"></el-table-column>
<el-table-column property="productionCompany" label="生产企业" width="180"></el-table-column>
<el-table-column label="操作" width="180"><span class="del-goods" @click="delGoods">删除</span></el-table-column>
</el-table>
</el-form-item>
<el-form-item label="商品名称" prop="goodsName">
<el-col :span="13">
<el-input
size="small"
v-model="formData3.goodsName"
placeholder="请输入商品名称"
show-word-limit
maxlength="60"
></el-input>
<!-- <span class="word-num">{{(formData.goodsName).replace(/\s+/g,"").length}}/60</span> -->
</el-col>
</el-form-item>
<el-form-item label="商品介绍" prop="goodsDescription">
<el-col :span="13">
<el-input
type="textarea"
rows="4"
size="small"
v-model="formData3.goodsDescription"
placeholder="请输入商品介绍"
maxlength="40"
show-word-limit
></el-input>
<span class="word-tip">此文案可摘取药品说明书【功能主治】or【适应症】</span>
<span class="word-show" @click="shoImgDialog = true">查看展示位置</span>
</el-col>
</el-form-item>
<el-form-item label="商品头图" class="required-label">
<el-upload
:file-list="fileGoodsList"
class="bg-uploader"
:show-file-list="isShowFileList"
action="#"
:before-upload="beforeUploadPic"
multiple
:on-exceed="imgExceed"
:limit="6"
>
<div class="file-pics" v-if="fileGoodsList.length > 0" :key="index" v-for="(item,index) in fileGoodsList">
<img :src="item.url" @mouseover.stop="headIndex=index" class="bg-img"/>
<div
class="img-delete"
v-if="headIndex==index"
@click.stop="deleteImg(item,fileGoodsList)"
@mouseout.stop="headIndex=-1"
>
<i class="el-icon-delete"></i>
</div>
</div>
<img class="bg-img" src="../../assets/image/small.png" v-if="fileGoodsList.length < 6"/>
<div class="limit-text" v-if="fileGoodsList.length < 6">
<!-- <p>限制大小: 200kb</p> -->
<p>建议尺寸:750*750</p>
<p>支持jpeg, png格式</p>
</div>
</el-upload>
<p class="upload-message" v-if="!isgoodsImages">请上传商品头图</p>
<!-- <p class="upload-message" v-if="uploadImgMessage1">请上传商品头图</p> -->
</el-form-item>
<el-form-item label="商品介绍视频" class="label-video">
<el-upload
accept=".mp4"
:on-remove="handleRemoveVideo"
:file-list="videoList"
:before-upload="beforeVideoUpload"
:show-file-list="false"
:disabled="videoList.length == 1"
:limit="1"
action="#"
class="bg-uploader"
>
<video id="introVideoLecture" :src="videoModel.videoFullPath" controls preload style="width: 100%;" v-if="videoList.length == 1">
视频
</video>
<img class="bg-img" src="../../assets/image/video.png" v-if="videoList.length <1"/>
<div class="limit-text" v-if="videoList.length <1">
<p>建议大小:20M以内</p>
<p>仅支持MP4格式</p>
<P>视频名称必须包含3个下划线:举例(YQ_01_02_03.mp4)</P>
</div>
</el-upload>
<el-progress :text-inside="true" :stroke-width="16" :percentage="uploadProgress" status="success" class="video-progress"
v-show="uploadProgress>0&&uploadProgress<100">
</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="商品详情图片" class="label-detailimg">
<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>支持jpeg, png格式</p>
</div>
</el-upload>
<p class="upload-message" v-if="!isSpecification_url">请上传商品详情图片</p>
</el-form-item>
</div>
</el-form>
<!-- 销售信息 -->
<el-form
ref="formData"
:model="formData"
:rules="rules"
label-width="150px"
label-suffix=":"
class="basic-form"
>
<div class="basic-item-icon">
<div class="part-tit">销售信息</div>
<div class="inline">
<el-form-item label="销售方式" prop="saleType">
<el-radio-group v-model="formData.saleType" size="small">
<el-radio :label="1">零售</el-radio>
<el-radio :label="2" :disabled="commissionFlag == 1">批发</el-radio>
</el-radio-group>
</el-form-item>
</div>
<div class="inline" v-if="formData.saleType == 1">
<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.00" :max="99999.99"></el-input-number>
</el-col>
</el-form-item>
</div>
<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="20000000.00"></el-input-number>
</el-col>
</el-form-item>
</div>
<div class="inline" v-if="formData.saleType == 1">
<el-form-item label="绩效分值">
<el-col :span="20">
<el-input-number class="stock-com" @input="$forceUpdate();" v-model="formData.scorePerformance" size="small" :precision="2" :min="0.00" :max="999999.99"></el-input-number>
</el-col>
</el-form-item>
</div>
<div class="inline">
<el-form-item label="库存" prop="stock" class="required-label">
<el-col :span="20">
<div class="stock-com">
<span class="sp sp-l" @click="changeStock(1)" :class="{'opac':formData.stock == 0}"><i class="el-icon-minus"></i></span>
<span class="sp sp-c">{{formData.stock}}</span>
<span class="sp sp-r" @click="changeStock(2)"><i class="el-icon-plus"></i></span>
</div>
<p class="error-message" v-if="!isgoodStock">库存不能为0</p>
</el-col>
</el-form-item>
</div>
<div class="inline" v-if="formData.saleType == 1">
<el-form-item label="最小起购件数" prop="leastCount" class="required-label">
<el-col :span="20">
<div class="stock-com" style="width: 500px;display:flex">
<el-input-number class="stock-com" @input="$forceUpdate();" v-model="formData.leastCount" size="small" :precision="0" :min="0" :max="9999"></el-input-number>
<span class="word-num" style="margin-left: 10px;">最高9999件哦</span>
</div>
<p class="error-message" v-if="formData.leastCount <= 0">最小起购件数不能为0</p>
</el-col>
</el-form-item>
</div>
<div class="inline" v-if="formData.saleType == 1 && formData.leastCount > 1">
<el-form-item label="递增方式">
<el-col :span="24">
<el-radio size="mini" v-model="formData.incrType" :label="2">倍数递增</el-radio>
<el-radio v-model="formData.incrType" :label="1">1件递增</el-radio>
</el-col>
</el-form-item>
</div>
<div class="inline" v-if="formData.saleType == 1">
<el-form-item label="单次购买上限" prop="mostCount" class="required-label">
<el-col :span="20" style="width: 300%;">
<div class="stock-com" style="width: 500px;display:flex">
<el-input-number class="stock-com" @input="$forceUpdate();" v-model="formData.mostCount" size="small" :precision="0" :min="-1" :max="9999"></el-input-number>
<span class="word-num" style="margin-left: 10px;">数值为-1时,代表单次购买上限已无限制(最高9999件哦)</span>
</div>
<p class="error-message" v-if="formData.mostCount === 0">单次购买上限不能为0</p>
</el-col>
</el-form-item>
</div>
<div class="inline" v-if="formData.saleType == 1">
<el-form-item label="第三方商品编码">
<el-col :span="20">
<el-input
size="small"
v-model="formData.externalGoodsCode"
placeholder="请输入第三方商品编码"
></el-input>
</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" 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>
</el-form-item>
</div>
<el-form-item label="是否支持售后" prop="expressLimitFlag" v-if="storeType < 3">
<el-radio-group v-model="formData.expressLimitFlag" :disabled="!hasRepoFlag" @change="radioChange">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
<p class="backTip" v-if="!hasRepoFlag" @click="goShopDeatil">若需设置商品支持售后,需先至店铺页<span class="ad-back">设置售后地址</span></p>
</el-form-item>
</div>
<div class="basic-item-icon" v-if="formData.saleType == 1">
<div class="part-tit">限购条件</div>
<div v-for="(item, index) in buyLimitDtoList" :key="index" >
<el-form-item label="限制条件">
<el-button @click="delLimit(index)" type="text" size="small">删除</el-button>
</el-form-item>
<el-form-item label="限制对象">
<el-col :span="10">
<el-radio-group v-model="item.limitUserType" size="small" @change="changeLimitUserType(item,index)">
<el-radio :label="1">开单人</el-radio>
<el-radio :label="2">患者</el-radio>
</el-radio-group>
</el-col>
</el-form-item>
<el-form-item label="购买限制">
<el-input-number v-model="item.days" style="margin-left: 5px;" size="small" :precision="0" :min="1" :max="100000"></el-input-number>
<el-select
v-model="item.daysType"
size="small">
<el-option
v-for="(item,index) in daysTypeList"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
<span style="margin-left: 5px;">内,最多购买</span>
<el-input-number v-model="item.limitCount" style="margin-left: 5px;" size="small" :precision="0" :min="1" :max="100000"></el-input-number>
<span style="margin-left: 5px;"></span>
</el-form-item>
</div>
<div class="inline">
<el-form-item>
<el-button size="small" type="primary" @click="addBuyingLimit"><i class="el-icon-plus"></i>限购条件</el-button>
</el-form-item>
</div>
</div>
</el-form>
<el-dialog
:title="stock.title"
:visible.sync="stockDio"
width="30%"
center>
<div class="stock-dia">
<div class="stock-item">更新库存后,将影响买家购买,请谨慎操作</div>
<div class="stock-item">当前库存:{{formData.goodsStock}}</div>
<div class="demo-input-suffix">
{{stock.type == 1 ? '减少数量' : '增加数量'}}
<el-input v-model="stock.num" :placeholder="stock.placeholderTxt" maxLength="8" style="width: 180px;"></el-input>
</div>
</div>
<span slot="footer" class="dialog-footer" style="text-align: right;">
<el-button type="primary" @click="updateStock">完成</el-button>
</span>
</el-dialog>
</div>
<!-- 添加药品 -->
<el-dialog title="添加药品" :visible.sync="baseAddVisible" class="add-goods-dialog" width="70%">
<el-row type="flex" class="row-bg">
<el-col :span="21">
<el-input
v-model="filterName"
clearable
class="input-el"
size="middle"
placeholder="试试搜索:药品69开头条形码/通用名称/商品名称/拼音首字母"
></el-input>
</el-col>
<el-col :span="2"><el-button type="primary" @click="getSearchInfo" class="add-goods-search">搜索</el-button></el-col>
</el-row>
<el-table
:data="medData"
ref="singleTable"
highlight-current-row
@current-change="handleCurrentChange"
@row-click="handleRowClick"
class="add-goods-table">
<el-table-column property="productName" label="产品名称/通用名称" width="150"></el-table-column>
<el-table-column property="barCode" label="条形码" width="200"></el-table-column>
<el-table-column property="goodsName" label="商品名称"></el-table-column>
<el-table-column property="approvalNumber" label="批准文号" width="150"></el-table-column>
<el-table-column property="specifications" label="规格" width="200"></el-table-column>
<el-table-column property="productionCompany" label="生产企业"></el-table-column>
</el-table>
<div class="add-goods--pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleNumChange"
:current-page="pageNo"
:page-sizes="[10, 20, 50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
<el-row type="flex" class="row-bg" justify="end">
<el-col class="add-btn-row">
<el-button @click="baseAddVisible = false">取消</el-button>
<el-button type="primary" @click="confirmAddGoods">确认</el-button>
</el-col>
</el-row>
</el-dialog>
<!-- 新增药品 -->
<el-dialog title="新增药品" :visible.sync="isNewMeddialog" class="add-med-dialog">
<el-form :model="formData1" ref="formData1" :rules="rules1" label-width="150px"
label-suffix=":">
<el-form-item label="药品分类" prop="medicalCategoryId">
<el-select v-model="formData1.medicalCategoryId" clearable placeholder="请选择药品分类" @change="medicalChange">
<el-option
v-for="item in medicalCategoryList"
:key="item.id"
:label="item.categoryName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<div v-if="formData1.medicalCategoryId">
<el-form-item :label="mCommonName" prop="medicCommonName" class="medic-goods-max">
<el-col :span="16">
<el-input
size="small"
v-model="formData1.medicCommonName"
:placeholder="mCommonNameLabel"
style="width:70%;"
maxlength="60"
show-word-limit
></el-input>
</el-col>
</el-form-item>
<el-form-item label="条形码" prop="barCode" v-if="![4,5].includes(formData1.medicalCategoryId)">
<el-col :span="16">
<el-input
size="small"
v-model="formData1.barCode"
placeholder="请输入条形码"
@input="changeBarCode"
></el-input>
<span class="fast-opt" @click="fastInput(1)">快速录入</span>
<span class="word-num">(点击可快速录入下面的基本信息)</span>
</el-col>
</el-form-item>
<el-form-item :label="commonName" prop="medicGoodsName" class="medic-goods-max">
<el-col :span="16">
<el-input
size="small"
v-model="formData1.medicGoodsName"
:placeholder="commonPlaceholder"
maxlength="60"
show-word-limit
></el-input>
<!-- <span class="word-num">{{(formData.medicGoodsName).replace(/\s+/g,"").length}}/60</span> -->
</el-col>
</el-form-item>
<!-- 批准文号 -->
<el-form-item label="批准文号" prop="approvalNumber" v-if="![4,5].includes(formData1.medicalCategoryId)">
<el-col :span="16">
<el-input
size="small"
v-model="formData1.approvalNumber"
placeholder="请输入批准文号"
style="width:70%;"
></el-input>
</el-col>
</el-form-item>
<!-- 规格 -->
<el-form-item label="规格" prop="specifications" v-if="![4,5].includes(formData1.medicalCategoryId)">
<el-col :span="18">
<el-input
size="small"
v-model="formData1.specifications"
placeholder="请输入规格"
style="width:70%;"
></el-input>
<span class="word-num">例如:0.125g*12袋/盒</span>
</el-col>
</el-form-item>
<!-- 生产企业 -->
<el-form-item label="生产企业" prop="productionCompany" v-if="![4,5].includes(formData1.medicalCategoryId)">
<el-col :span="16">
<el-input
size="small"
v-model="formData1.productionCompany"
placeholder="请输入生产企业"
style="width:70%;"
></el-input>
<span class="word-num"></span>
</el-col>
</el-form-item>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="isNewMeddialog = false">取 消</el-button>
<el-button type="primary" @click="addNewMed">确 定</el-button>
</div>
</el-dialog>
<!-- 查看展示 -->
<el-dialog
title="查看展示"
:visible.sync="shoImgDialog"
width="40%"
class="example-dialog"
>
<img src="../../assets/image/s-example.png" alt="">
</el-dialog>
</div>
</template>
<script>
import BreadCrumb from "@/components/breadcrumb.vue";
let vm = null;
import { openLoading, closeLoading, signFigures } from "@/utils/utils";
import { isEmptyUtils } from "@/utils/index";
import { doUpload, getFilePath, createFilePath } from "@/utils/qiniu-util";
import { updateGoods ,updateStock,getGoodsList, getGoodDetails, updateGoodsV2,getContractList, getCooperationProjectList,getMedList,getCategorysList,saveMedList,getGoodsListAll,getBarcodeData} from '@/utils/goods';
import { getStoreAdressRepot } from "@/utils/shop";
import Cropper from '@/components/common/cropper.vue'
import { originRules1, originRules, originRules3 } from './common/rules';
import { originForm1, originForm, originForm3 } from './common/forms';
export default {
components: {
BreadCrumb,
Cropper
},
data(){
return{
shoImgDialog: false, // 查看展示
medicalCategoryList: [], // 药品分类
isShowGoodsMsg: false,
medicationId: '', // 药品id (搜索药品列表)
medicationDetailId: '',
choiceMedData: [], // 选中的基础药品展示
isShowGoods: false, // 是否展示商品表格
filterName: '', // 搜索药品
// 商品分类级联配置
goodsCategoryIdList: [],
cascaderProps: {
multiple: true,
value: 'id',
label: 'categoryName',
children:'children'
// checkStrictly: true
},
isNewMeddialog: false, // 新增药品弹窗
isSelectGoods: false, // 是否选择了添加药品
medData: [],
currentRow: null,
baseAddVisible: false, // 添加药品
barAndGoodsFlag: false, // 编辑时商品名称和条形码是否可以编辑
goodDisabled: false, // 商品通用名称是否可编辑
isEdit: false,
stock:{
title:'减少库存',
type:1,
placeholderTxt:'请输入减少的库存数量',
num:''
},
fileGoodsList:[],
goodsCheckList: [],
fileIntrList:[],
intrIndex:-1,
isShowFileList:false,
isgoodStock:true,
headIndex:-1,
stockDio:false,
curmbFirst: '云鹊店铺',
curmbSecond: '商品管理',
curmbThird: '编辑商品',// /live-manage?id=
jumPathThird: '',
isgoodsImages:true,
isSpecification_url:true,
title:'',
daysTypeList:[{
label: '日',
value: 1,
}, {
label: '周',
value: 7,
}, {
label: '月',
value: 30,
}, {
label: '年',
value: 365,
}],
formData: JSON.parse(JSON.stringify(originForm)), // 通用信息
formData1: JSON.parse(JSON.stringify(originForm1)), // 基本信息
formData3: JSON.parse(JSON.stringify(originForm3)),
buyLimitDtoList:[],
rules: {},
rules1: {},
goodsId: 0, // 新增时传0,更新时必需>0
goodsType: '',
storeId: '',
commissionFlag: 2,
// 不同类型服务的表单通用字段
// 不同类型服务的表单通用字段
// 不同类型服务的表单通用字段
showCropper: false,
currentOption: {
offset_x: 120,
offset_y: 185,
width: 160,
height: 120,
cvWidth: 1000,
cvHeight: 800,
uploadType: 1,
cropDialogWidth: '900px',
cropBoxResizable: true,
minCropBoxWidth: 100,
minCropBoxHeight: 100,
aspectRatio: 16/9
},
slide2: {
oriUrl: '', // 原图
},
imgMouseOver1: false,
uploadImgMessage1: false,//未上传图片,校验提示语
isCheckServe: false, // 商品类型选择【检测服务】时!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
inputType: '',
limitVisibleFlag:false,
limit:{
title:"限购条件"
},
storeType: 1, //1: "供货商",2: "小药房",3: "医生小店"
hasRepoFlag: 0, //店铺是否有退货地址
videoList: [],//视频上传文件列表
videoModel:{
videoFullPath: ''
},
sumFile: 0,
uploadProgress:0, // 上传视频进度条
cooperationProjectList: [], // 合作项目
contractList: [], // 合同
isProject: false, // 是否选择合作项目
isContract: false, // 是否选择合同
pageNo: 1,
pageSize: 10,
totalRows: 0,
isAddServe: false, // 新增药品时 添加的是否为服务类 || 虚拟商品
goodsCategoryList: [],
isgoodsCategory: false, // 是否选择商品分类
isProjectId: false
}
},
computed: {
mCommonName() {
return [4,5].includes(this.formData1.medicalCategoryId) ? '产品名称' : '通用名称';
},
mCommonNameLabel() {
return [4,5].includes(this.formData1.medicalCategoryId) ? '请输入产品名称' : '请输入通用名称';
},
commonName() {
return [4,5].includes(this.formData1.medicalCategoryId) ? '品牌名/商品名' : '商品名称';
},
commonPlaceholder() {
return [4,5].includes(this.formData1.medicalCategoryId) ? '请输入品牌名/商品名' : '请输入商品名称';
}
},
created() {
vm = this;
const { id, storeId, goodsType, inputType, commissionFlag, storeType} = this.$route.query;
this.goodsType = goodsType;
this.storeId = storeId;
this.inputType = inputType || '';
this.commissionFlag = commissionFlag;
this.storeType = storeType;
this.rules = originRules;
this.rules1 = originRules1;
this.rules3 = originRules3;
this.jumPathThird = '/goods-manage?storeId=' + storeId +'&commissionFlag=' + this.commissionFlag +'&storeType=' + this.storeType;
this.title = id == 'add' ? '新增商品' : '编辑商品';
this.isEdit = id != 'add';
this.curmbThird = this.title;
this.formData.storeId = Number(storeId) || '';
this.getCooperationProjectList(); // 获取合作项目
if(id != 'add'){
this.getDetailByEdit(id, goodsType);
} else {
this.getStoreAdress();
}
// debugger;
// 判空
if (this.formData.leastCount == null || this.formData.leastCount === '') {
this.formData.leastCount = 1;
}
if (this.formData.mostCount == null || this.formData.mostCount === '') {
this.formData.mostCount = -1;
}
if (this.formData.incrType == null || this.formData.incrType === '') {
this.formData.incrType = 2;
}
this.getGoodsListAll();
},
methods: {
radioChange(val) {
this.formData.expressLimitFlag = val;
},
getArr(arr) {
if (arr.length > 0) {
let newoodsList = []
arr.forEach(item=> {
const subArr = item.filter(i=> {
return i !== -1;
})
newoodsList.push(subArr)
})
return newoodsList;
} else {
return []
}
},
// 获取商品分类
getGoodsListAll() {
getGoodsListAll().then(res => {
if (res.code == '000000') {
this.goodsCategoryList = res.data;
}
})
},
// 取消
cancelComplete() {
this.$confirm('取消后您填写的信息将不会被保存', '确认取消吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
this.$router.go(-1);
}).catch(() => {
});
},
// 药品分类切换
medicalChange(val) {
if ([4,5].includes(val)) {
this.isAddServe = true;
}
this.$refs.formData1.clearValidate();
const formData1Arr = ['medicCommonName','barCode','medicGoodsName','approvalNumber','specifications','productionCompany'];
formData1Arr.map(item => {
this.formData1[item] = '';
})
},
// 获取药品分类
getCategorysList() {
let params = {
pageNo: 1,
pageSize: 999,
categoryLevel: 1,
parentId: 0,
};
getCategorysList(params).then(res => {
if (res.code == '000000') {
this.medicalCategoryList = res.data.medicalCategorysList;
}
})
},
handleSizeChange(val) {
this.pageSize = val;
this.pageNo = 1;
this.searchAddGoods();
},
handleNumChange(val) {
this.pageNo = val;
this.searchAddGoods();
},
delGoods() {
this.$confirm('确认要删除该商品吗?', '', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
this.isShowGoods = false;
this.choiceMedData = [];
this.$message({
type: 'success',
message: '删除成功!'
});
}).catch(() => {
});
},
contractChange(val) {
if (val) {
this.isProjectId = false;
} else {
this.isProjectId = true;
}
},
// 商品分类级联多选
searchCategoryChange(value) {
console.log(value, '商品分类级联多选')
if (value.length > 0) {
this.isgoodsCategory = false;
} else {
this.isgoodsCategory = true;
}
this.goodsCategoryIdList = value;
// this.$refs.cascader.toggleDropDownVisible();
},
// 确认选择药品
confirmAddGoods() {
if (!this.isSelectGoods) {
this.$message.error('您还未选择药品');
return;
}
if (this.choiceMedData.length > 0) {
this.isShowGoods = true;
this.baseAddVisible = false;
}
},
addMed() {
this.baseAddVisible = true;
if (this.$refs.singleTable) {
this.isSelectGoods = false;
this.$refs.singleTable.setCurrentRow();
}
},
// 点击选择药品
handleRowClick(row) {
if (row) {
this.isSelectGoods = true;
}
this.$refs.singleTable.setCurrentRow(row);
},
// 点击切换药品
handleCurrentChange(val) {
if (val) {
this.currentRow = val;
this.formData3.medicationId = val.tradeMedicalLibId;
this.formData3.medicationDetailId = val.id;
this.isCheckServe = val.categoryName == 5? true : false;
let current = [this.currentRow];
this.choiceMedData = current;
}
},
// 新增药品
addNewMed() {
let isTrue;
this.$refs.formData1.validate((valid,object) => {
isTrue = valid;
if (!valid) return false;
});
if (!isTrue) return;
let data = {};
const {specifications,productionCompany,approvalNumber,medicGoodsName,barCode,medicCommonName,medicalCategoryId} = this.formData1;
// 服务类/虚拟商品
if (this.isAddServe) {
data = {
medicalCategoryId,
medicCommonName,
medicGoodsName,
applySource: 2,
}
} else {
data = {
medicalCategoryId,
medicCommonName,
medicGoodsName,
barCode,
approvalNumber,
medicalDetailFieldMap: {specifications,productionCompany},
applySource: 2,
};
}
this.saveMedList(data);
},
// 药品保存
saveMedList(data) {
saveMedList(data).then(res => {
if(res.code == '000000') {
this.$message({
type: 'success',
message: '新增药品成功!'
});
this.isNewMeddialog = false;
this.choiceMedData = [res.data]
this.formData3.medicationId = res.data.tradeMedicalLibId;
this.formData3.medicationDetailId = res.data.id;
this.isShowGoods = true;
console.log(this.choiceMedData , 'this.choiceMedData ')
} else {
this.$message({
type: 'error',
message: res.message
});
}
}).catch(err => {
this.$message({
type: 'error',
message: err.message
});
})
},
// 新增药品
addNewGoods(){
if (this.$refs.formData1) {
this.$refs.formData1.resetFields();
}
this.getCategorysList(); // 获取药品类别
this.isNewMeddialog = true;
},
getSearchInfo() {
this.pageNo = 1;
this.searchAddGoods();
},
// 基本信息添加药品
searchAddGoods() {
let data = {
filterName: this.filterName.trim(),
applySource: "2",
letterPinyin: "",
goodsName: "",
categoryName: "",
categoryIdLevel2: "",
categoryIdLevel3: "",
categoryIdLevel4: "",
barCode: "",
status: "",
goodsFlag: 1,
pageSize: this.pageSize,
pageNo: this.pageNo,
};
getMedList(data).then(res => {
if(res.code == '000000') {
this.medData = res.data.smallStoreList;
this.totalRows = res.data.totalNum;
}
})
},
// 获取合同
getContractList(projectId) {
getContractList(projectId || 0).then(res => {
if(res.code == '000000') {
this.contractList = res.data;
}
})
},
// 获取合作项目
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 = [];
},
// 判断imgurl是否有效
checkImgExists(imgurl) {
return new Promise(function(resolve, reject) {
var ImgObj = new Image()
ImgObj.src = imgurl
ImgObj.onload = function(res) {
resolve(res)
}
ImgObj.onerror = function(err) {
reject(err)
}
})
},
//eidt状态
async getDetailByEdit(id){
this.goodsId = id ;
const res = await getGoodsList({
goodsIdList:[id],
goodsName :'',
goodsType :'',
pageNo:1,
pageSize: 10,
storeId: this.storeId,
applySource: 2
});
if(res.code != '000000'){
return this.$message({
message: res.message,
type: 'error'
});
}
closeLoading(this);
if(res.data == null){
return this.$message({
type: 'error'
});
}
const {goodsList, hasRepoFlag } = res.data;
const { goodsName, goodsDescription, goodsType,expressLimitFlag, goodsHeaderImages=[], goodsVideoList=[],contractId, cooperationProjectId,goodsCategoryIdArr,medicationInfo } = goodsList[0];
const goodDet = goodsList[0];
goodDet.otc1 = goodDet.otc ? '1' : '0';
// 查询药品列表
this.choiceMedData = [medicationInfo];
if (this.choiceMedData.length > 0) {this.isShowGoods = true;}
this.isProject = Boolean(cooperationProjectId);
if(this.isProject) {this.getContractList(cooperationProjectId)}
this.isContract = Boolean(contractId);
// this.formData1 = goodDet;
this.formData = goodDet;
this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType,contractId, cooperationProjectId };
this.formData3.medicationId = medicationInfo.tradeMedicalLibId;
this.formData3.medicationDetailId = medicationInfo.id;
this.goodsCategoryIdList = this.getArr(goodsCategoryIdArr);
this.hasRepoFlag = hasRepoFlag;
this.buyLimitDtoList = this.formData.buyLimitDtoList;
this.formData.expressLimitFlag = expressLimitFlag;
this.formData.optPrice = this.formData.costPrice/100;
this.formData.scorePerformance = this.formData.scorePerformance/100;
this.fileGoodsList = this.getImges(goodDet.goodsImgList,1);
this.fileIntrList = this.getImges(goodDet.goodsDetailImageList,2);
this.formData.stock = this.formData.goodsStock;
if (goodDet.goodsVideoList.length > 0) {
this.videoList.push(goodDet.goodsVideoList[0]);
this.videoModel.videoFullPath = this.videoList[0].goodsImgUrl;
}
let newImgList = [];
this.fileGoodsList.map((item,index) => {
this.checkImgExists(item.imageUrl).then(()=> {
newImgList.push(item)
}).catch(()=> {
newImgList = this.fileGoodsList.splice(index,1);
})
})
this.fileGoodsList = newImgList;
this.rules = {
...this.rules,
...originRules
};
},
getImges(d,type){
let a = [];
if(d.length > 0){
for(let i=0;i<d.length;i++){
a.push({
url:type==1 ?d[i].goodsImgUrl :d[i].imageUrl,
imageUrl:type==1 ?d[i].goodsImgUrl :d[i].imageUrl,
goodsImgUrl:type==1 ?d[i].goodsImgUrl :d[i].imageUrl,
id: d[i].id,
imageSort: d[i].imageSort,
imgSort: d[i].imgSort,
imageType: type == 1 ? d[i].imgType : d[i].imageType,
})
}
}
return a;
},
// 修改条形码
changeBarCode(val) {
// this.$refs.formData1.resetFields();
this.formData1.barCode = val;
// this.goodDisabled = false;
},
//快速录入
fastInput(type){
const code = this.formData1.barCode.trim();
if(code == ''){
// this.$refs.formData1.validateField("barCode")
this.$message({
message: '请输入条形码',
type: 'error'
});
return;
}
getBarcodeData(code).then((res) => {
if(res.code != '000000'){
return this.$message({
message: res.message,
type: 'error'
});
}
if(res.data == null){
return this.$message({
message: '未查询到数据,请手动输入',
type: 'warning'
});
}
const {medicCommonName, medicGoodsName,medicalDetailFieldMap,approvalNumber} = res.data;
const {productionCompany,specifications} = medicalDetailFieldMap;
let fastParm = {medicCommonName,medicGoodsName ,specifications, productionCompany,approvalNumber}
this.formData1 = Object.assign(this.formData1,fastParm)
})
},
updateStock(){
let r = /^\+?[1-9][0-9]*$/;
//造假 接口来了删掉
if(this.stock.num <= 0){
return this.$message({
message: '增加库存数量不得为0',
type: 'warning'
});
}
if(!r.test(this.stock.num)){
return this.$message({
message: '库存数量必须正整数',
type: 'warning'
});
}
if(this.stock.type == 1){
if(this.stock.num > this.formData.goodsStock){
return this.$message({
message: '减少库存数量不得大于当前库存',
type: 'warning'
});
}
this.formData.stock = this.formData.goodsStock - this.stock.num
this.formData.decrStock = Number(this.stock.num)
this.formData.incrStock = ''
}else if(this.stock.type == 2){
this.formData.stock = Number(this.stock.num) + Number(this.formData.goodsStock)
this.formData.incrStock = Number(this.stock.num)
this.formData.decrStock = ''
}
//this.formData.goodsStock = this.formData.stock
this.isgoodStock = true;
this.stockDio = false
},
changeStock(type){
if(this.formData.stock == 0 && type == 1){
return;
}
let str = type == 1 ? '减少' : '增加',
txt = `请输入${str}的库存数量`,
tit = str + '库存'
this.stock = {
title:tit,
type,
num:'',
placeholderTxt:txt
}
this.stockDio = true
},
complete() {
let formNameList = ['formData', 'formData3'];
this.formData = { ...this.formData,...this.formData3};
for(let i=0;i<this.fileGoodsList.length;i++){
this.fileGoodsList[i].imageSort = i+1
}
for(let j=0;j<this.fileIntrList.length;j++){
this.fileIntrList[j].imageSort = j+1
}
this.formData.categoryId = this.formData.goodsType
this.formData.otc = this.formData.otc1 == 1 ? true : false
this.isgoodStock = this.formData.stock > 0 ? true : false
this.formData.goodsId = this.goodsId;
this.formData.goodsImages = this.fileGoodsList;
this.formData.goodsHeaderImages = this.fileGoodsList;
this.formData.goodsVideoList = this.videoList;
this.formData.goodsDetailImages = this.fileIntrList; // 商品详情图
this.formData.buyLimitDtoList = this.buyLimitDtoList;
this.formData.goodsCategoryIdList = this.goodsCategoryIdList;
this.isgoodsImages = this.formData.goodsImages.length == 0 ? false :true;
this.isSpecification_url = this.formData.goodsDetailImages.length == 0 ? false :true;
// 判断是否只选择了项目-合同名称的其中一项
const {cooperationProjectId,contractId,goodsCategoryIdList} = this.formData;
if (!goodsCategoryIdList.length) {
this.isgoodsCategory = true;
return this.$message({
message: '请选择商品分类',
type: 'error'
});
}
if (!cooperationProjectId || !contractId) {
this.isProjectId = true;
return this.$message({
message: '请关联项目名称',
type: 'error'
});
}
// 是否选择新增药品
if (this.choiceMedData.length == 0) {
this.isShowGoodsMsg = true;
this.$message({
message: '请选择基础药品',
type: 'error'
});
return;
}
let isTrue = false;
let item = "";
for(let i = 0; i < formNameList.length; i++){
item = formNameList[i];
this.$refs[item].validate((valid,object) => {
isTrue = valid;
if (!valid) return false;
});
if(!isTrue){
return;
}
}
// 是否上传商品头图 || 是否上传商品详情图片 || 库存是否为0 || 单次购买上线是否符合要求
if(!this.isgoodsImages || !this.isSpecification_url ||!this.isgoodStock || !this.checkCount()) return;
if(!isTrue){
return false;
}else{
this.formData.costPrice = signFigures(this.formData.optPrice*100, 10);
this.formData.hasChanged = true;
this.formData.inputType = this.inputType;
this.updateGoodsInfo();
}
},
//更新商品
updateGoodsInfo(){
console.log('提交值',JSON.parse(JSON.stringify(this.formData)));
// const submieFn = this.isCheckServe ? updateGoodsV2 : updateGoods;
const submieFn = updateGoods;
let params = JSON.parse(JSON.stringify(this.formData));
params.scorePerformance = params.scorePerformance * 100;
console.log('提交params',params)
submieFn(params).then((res)=>{
if (res.code !== '000000') {
return this.$message({
message: res.message,
type: 'error'
});
}
vm.$message.success("操作成功");
this.$router.push({
path: '/goods-manage',
query: {
storeId: this.formData.storeId,
commissionFlag: this.commissionFlag,
storeType: this.storeType
}
})
})
},
imgExceed(file) {
if (file.length > 6) {
this.$message.error("最多只能上传6张图片");
};
},
//上传商品头图
beforeUploadPic(file) {
// if(this.fileGoodsList.length > 6){
// this.$message.error("最多只能上传6张图片");
// return ;
// }
let vm = this;
let picTypes = ['image/jpeg','image/png']
const isLt200k = file.size / 1024 < 200;
if (picTypes.indexOf(file.type) == -1) {
return this.$message.error("请上传jpeg或png格式的图片");
}
let _img = new FileReader();
_img.readAsDataURL(file);
_img.onload = function (theFile) {
let image = new Image()
image.src = theFile.target.result
vm.slide2.oriUrl = theFile.target.result;
image.onload = function () {
let _this = this;
if (_this.width !== 750 || _this.height !== 750) {
vm.$message.error("图片长宽尺寸必须为750*750");
return;
};
openLoading(vm);
doUpload(vm, file, getFilePath(file, null), "preview4", "progress1", 1).then(function (path) {
closeLoading(vm);
console.log('上传成功后路径', path);
let len = vm.fileGoodsList.length;
vm.fileGoodsList.push({ url: path.fullPath, goodsImgUrl: path.fullPath,imageUrl:path.fullPath, imgSort: len+1,imageSort: len+1, goodsId: vm.formData.goodsId });
vm.isgoodsImages = true;
// vm.fileGoodsList.push({url:path.fullPath,goodsImgUrl: path.fullPath,imageUrl:path.fullPath,imageName:'',imageSort: len+1,imageType: 2,id: null,})
vm.$message.success("上传成功");
});
};
};
},
// 上传检测说明图
// beforeUploadPic2(file) {
// if(this.fileGoodsList.length > 10){
// return ;
// }
// let vm = this;
// let picTypes = ['image/jpeg','image/png']
// const isLt200k = file.size / 1024 < 200;
// if (picTypes.indexOf(file.type) == -1) {
// return this.$message.error("请上传jpeg或png格式的图片");
// }
// let _img = new FileReader();
// _img.readAsDataURL(file);
// _img.onload = function (theFile) {
// let image = new Image()
// image.src = theFile.target.result
// vm.slide2.oriUrl = theFile.target.result;
// image.onload = function () {
// let _this = this;
// console.log(_this.width,_this.height)
// openLoading(vm);
// doUpload(vm, file, getFilePath(file, null), "preview4", "progress1", 1).then(function (path) {
// closeLoading(vm);
// console.log('上传成功后路径', path);
// let len = vm.goodsCheckList.length;
// vm.goodsCheckList.push({ url: path.fullPath, imageUrl: path.fullPath, imageSort: len+1, id: vm.formData.goodsId });
// vm.$message.success("上传成功");
// });
// };
// };
// },
//上传商品详情图片
beforeUploadPic1(file,type) {
this.currentOption.aspectRatio = 1/1;
this.currentOption.cropBoxResizable = true;
this.currentOption.minCropBoxWidth = 160;
this.currentOption.minCropBoxHeight = 160;
let fileLimit = {
width: 160,
height: 160,
size: 0.5,
sizeText: "500K",
key: "headUrl",
more: "imgUrl1More",
show: "uploadImgMessage1"
};
this.beforeUpload(file, fileLimit);
},
//上传商品详情图片
beforeUpload(file, fileLimit) {
let vm = this;
const isJPG = file.type === "image/jpeg";
const isPNG = file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJPG && !isPNG) {
vm.$message.error("图片格式不符合规范,请根据规范上传图片");
return;
}
if (!isLt2M) {
vm.$message.error("图片大小请控制在2M以内 ");
return;
}
let _img = new FileReader();
_img.readAsDataURL(file);
_img.onload = function (theFile) {
let image = new Image()
image.src = theFile.target.result
vm.slide2.oriUrl = theFile.target.result;
image.onload = function () {
let _this = this;
// if (_this.width != fileLimit.width || _this.height != fileLimit.height) {
// if (_this.width < fileLimit.width || _this.height < fileLimit.height) {
// vm.$message.error("图片尺寸不符合规范,请根据规范上传图片");
// return;
// } else if(_this.width > fileLimit.width || _this.height > fileLimit.height){
// vm.showCropper = true;
// vm.currentOption.cvWidth = _this.width;
// vm.currentOption.cvHeight = _this.height;
// return;
// } else {
openLoading(vm);
doUpload(vm, file, getFilePath(file, null), "preview4", "progress1", 1).then(function (path) {
closeLoading(vm);
let len = vm.fileIntrList.length;
vm.fileIntrList.push({url:path.fullPath,imageUrl:path.fullPath,imageSort: len+1,imageType: 1,id: null, imageType: 4})
vm.isSpecification_url = true;
vm.$message.success("上传成功");
});
//}
};
};
return isJPG && isLt2M;
},
//删除图片
deleteImg(item,d) {
let index = ''
for(let i=0;i<d.length;i++){
if(item.url == d[i].url){
index = i;
break
}
}
d.splice(index,1)
// if (type == 1) {
// vm.formData.headUrl = "";
// vm.imgMouseOver1 = false;
// }
},
// 获取裁剪的图片数据
getCropImg(argument) {
this.showCropper = false;
this.cropData = argument[1]
vm.doUploadQiNiu(argument[2])
argument[3] && argument[3].destroy();
// vm.slide2.oriUrl = "";
},
// 单次购买上限和最大购买数
minusCount(type) {
if (type === 1) {
if (this.formData.leastCount >= 2) {
this.formData.leastCount -= 1;
this.formData1.leastCount = this.formData.leastCount;
}
} else if (type === 2) {
if(this.formData.mostCount > -1){
this.formData.mostCount -= 1;
this.formData1.mostCount = this.formData.mostCount;
}
}
else if(type === 3){
if (this.formData.minWhole >= 2) {
this.formData.minWhole -= 1;
}
}
// if (this.formData.mostCount < this.formData.leastCount) {
// this.formData.mostCount = this.formData.leastCount;
// }
},
plusCount(type) {
if (type === 1) {
this.formData.leastCount += 1;
this.formData1.leastCount = this.formData.leastCount;
} else if (type === 2) {
this.formData.mostCount += 1;
this.formData1.mostCount = this.formData.mostCount;
}
else if(type === 3){
this.formData.minWhole += 1;
}
// if (this.formData.mostCount < this.formData.leastCount) {
// this.formData.mostCount = this.formData.leastCount;
// }
},
// 上传七牛
doUploadQiNiu(file){
doUpload(this,file, getFilePath(file,null), 'preview4', 'uploadProgress1', '').then(function (path) {
vm.formData.headUrl = path.fullPath;
vm.$message.success('上传成功');
});
},
addBuyingLimit(){
if(this.buyLimitDtoList != null && this.buyLimitDtoList.length == 2){
this.$message({
message: '最多添加两个限制条件',
type: 'warning'
});
return;
}
if(this.buyLimitDtoList == null || this.buyLimitDtoList.length == 0){
this.buyLimitDtoList.push({
days:0,
daysType:1,
limitCount:0,
limitUserType:1
})
return;
}
if(this.buyLimitDtoList.length < 2){
let limitUserType = 1;
if(this.buyLimitDtoList[0].limitUserType == 1){
limitUserType = 2;
}
this.buyLimitDtoList.push({
days:0,
daysType:1,
limitCount:0,
limitUserType:limitUserType
})
}
// this.limitVisibleFlag = true;
},
delLimit(index){
this.buyLimitDtoList.splice(index,1);
},
changeLimitUserType(item,index){
if(item.limitUserType == 1){
if(this.buyLimitDtoList.length == 2 && index == 0){
this.buyLimitDtoList[1].limitUserType = 2;
}
else if(this.buyLimitDtoList.length == 2 && index == 1){
this.buyLimitDtoList[0].limitUserType = 2;
}
}
else {
if(this.buyLimitDtoList.length == 2 && index == 0){
this.buyLimitDtoList[1].limitUserType = 1;
}
else if(this.buyLimitDtoList.length == 2 && index == 1){
this.buyLimitDtoList[0].limitUserType = 1;
}
}
},
checkCount(){
let flag = true;
if(this.formData.saleType == 1 && this.formData.mostCount == 0){
flag = false;
this.$message({
message: '单次购买上限不能为0',
type: 'warning'
});
return flag;
}
if(this.formData.saleType == 1 && this.formData.mostCount != -1 && this.formData.mostCount < this.formData.leastCount){
flag = false;
this.$message({
message: '单次购买上限不能小于最小起购件数',
type: 'warning'
});
return flag;
}
return flag;
},
goShopDeatil() {
this.$router.push({
path: `/create-shop`,
query:{
storeId: this.storeId,
// storeData: JSON.stringify(row),
}
})
},
//店铺是否配置售后地址
getStoreAdress() {
getStoreAdressRepot(this.storeId).then(res => {
if (res.code == "000000") {
// repotList 地址数组
if(res.data && res.data.repotList && res.data.repotList.length) {
this.hasRepoFlag = true;
} else {
this.hasRepoFlag = false;
}
} else {
this.$message.error(res.message);
}
})
},
// 视频
deleteVideo(videoList) {
this.videoList = [];
this.videoModel.videoFullPath='';
},
beforeVideoUpload(file) {
const video2M = file.size / 1024 /1024 < 20;
console.log(file.size, 'video2Mvideo2Mvideo2M')
if (!video2M) {
this.$message.error('上传视频大小不能超过20M!');
}
else {
this.doVideoUpload(file, 1);
}
},
handleRemoveVideo(file, videoList) {
for (let i = 0; i < this.videoList.length; i++) {
if (this.videoList[i].name == file.name) {
this.videoList.splice(i, 1);
console.log("删除" + i);
}
}
},
checkUpdate(name) {
let flag = true;
for(let i=0;i<this.videoList.length;i++) {
if(this.videoList[i].name == name) {
flag = false;
this.$message.warning('上传文件重发');
}
}
console.log('name',name,'',this.videoList)
return flag;
},
doVideoUpload(file, index) {
console.log('file',file);
//console.log('videoList项目列表:',this.videoList);
this.videoModel.videoFullPath = '';
if(file.name.indexOf(' ') != -1){
this.$message.warning('文件名不能包含空格');
return;
}
let updateFlag = this.checkUpdate(file.name);
if(updateFlag == false) {
return;
}
var ext = file.type
var arr = ext.split('/');
var filety = "." + arr[1];
/*if (filety.indexOf(".pdf") < 0 && filety.indexOf(".jpeg") < 0 && filety.indexOf(".jpg") < 0
&& filety.indexOf(".png") < 0 && filety.indexOf(".mp4") < 0) {
this.$message.warning('文件格式错误');
return
}*/
let self = this;
//如果没有选择文件,返回
if (isEmptyUtils(file)) {
return;
}
console.log('file.type', file.type)
if(filety != ".mp4"){
// if (file.type !== 'video/mp4') {
self.$message.error('仅支持上传mp4格式视频');
return;
}
var arr = file.name.split('_');
if(arr.length != 4){
self.$message.error('上传视频文件名格式不正确:举例(GXY_001_02_03.mp4)');
return;
}
self.$message.info('开始上传');
self.videoModel.videoPath = createFilePath(file,file.name)
// let videoPath = createFilePath(file,file.name)
doUpload(self,file,self.videoModel.videoPath,"preview4",
"uploadProgress1",
"").then(function (result) {
console.log('成功result',result);
self.videoModel.videoFullPath = result.fullPath;
// self.model.size = result.size;
// self.model.ext = result.ext;
// self.model.name = self.model.videoPath;
let fileItem = {
goodsImgUrl: result.fullPath,
uid: '',
imageUrl: result.fullPath,
imageType: 9,
goodsId: self.formData.goodsId,
id: null,
deleteFlag: 0
}
self.videoList.push(fileItem);
self.$message.success('上传成功');
console.log('sumFile',self.sumFile,'videoList',self.videoList);
return false;
});
},
},
}
</script>
<style lang="scss">
@import "./create-good-new.scss";
</style>
\ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
label-suffix=":" label-suffix=":"
class="basic-form" class="basic-form"
> >
<!-- 通用信息 -->
<div class="basic-item-icon"> <div class="basic-item-icon">
<div class="part-tit">通用信息</div> <div class="part-tit">通用信息</div>
<el-form-item label="商品名称" prop="goodsName"> <el-form-item label="商品名称" prop="goodsName">
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
</el-progress> </el-progress>
<el-button class="dl-video" icon="el-icon-delete" circle @click="deleteVideo" v-if="videoList.length == 1"></el-button> <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>
<el-form-item label="业务类型" prop="businessCategoryId"> <!-- <el-form-item label="业务类型" prop="businessCategoryId">
<el-select <el-select
v-model="formData3.businessCategoryId" v-model="formData3.businessCategoryId"
placeholder="请选择业务类型" placeholder="请选择业务类型"
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
:value="item.id" :value="item.id"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item label="商品类型" prop="goodsType"> <el-form-item label="商品类型" prop="goodsType">
<el-select <el-select
v-model="formData3.goodsType" v-model="formData3.goodsType"
...@@ -140,7 +140,39 @@ ...@@ -140,7 +140,39 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </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-form-item label="是否支持售后" prop="expressLimitFlag" v-if="storeType < 3">
<el-radio-group v-model="formData3.expressLimitFlag" :disabled="!hasRepoFlag"> <el-radio-group v-model="formData3.expressLimitFlag" :disabled="!hasRepoFlag">
...@@ -154,6 +186,8 @@ ...@@ -154,6 +186,8 @@
</div> </div>
</el-form> </el-form>
<!-- 基本信息 -->
<el-form <el-form
ref="formData1" ref="formData1"
:model="formData1" :model="formData1"
...@@ -162,7 +196,7 @@ ...@@ -162,7 +196,7 @@
label-suffix=":" label-suffix=":"
class="basic-form" 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> <div class="part-tit">基本信息</div>
<el-form-item label="条形码" prop="barCode"> <el-form-item label="条形码" prop="barCode">
<el-col :span="18"> <el-col :span="18">
...@@ -234,8 +268,8 @@ ...@@ -234,8 +268,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">
...@@ -459,21 +493,96 @@ ...@@ -459,21 +493,96 @@
<p class="upload-message" v-if="!isSpecification_url">请上传说明书</p> <p class="upload-message" v-if="!isSpecification_url">请上传说明书</p>
</el-form-item> </el-form-item>
</div> </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========================================================= =========================================================调试新增检测服务 start=========================================================
=========================================================调试新增检测服务 start========================================================= --> =========================================================调试新增检测服务 start========================================================= -->
<!-- 服务信息 -->
<el-form <el-form
ref="formData2" ref="formData2"
:model="formData2" :model="formData2"
...@@ -482,7 +591,7 @@ ...@@ -482,7 +591,7 @@
label-suffix=":" label-suffix=":"
class="basic-form" 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> <div class="part-tit">服务信息</div>
<el-form-item label="条形码" prop="barCode"> <el-form-item label="条形码" prop="barCode">
<el-col :span="18"> <el-col :span="18">
...@@ -672,26 +781,12 @@ ...@@ -672,26 +781,12 @@
</div> </div>
</el-form> </el-form>
<!-- =========================================================调试新增检测服务 start========================================================= <!-- =========================================================调试新增检测服务 start=========================================================
=========================================================调试新增检测服务 start========================================================= =========================================================调试新增检测服务 start=========================================================
=========================================================调试新增检测服务 start========================================================= --> =========================================================调试新增检测服务 start========================================================= -->
<!-- 销售信息 -->
<el-form <el-form
ref="formData" ref="formData"
:model="formData" :model="formData"
...@@ -722,7 +817,7 @@ ...@@ -722,7 +817,7 @@
<div class="inline" v-if="formData.saleType == 2"> <div class="inline" v-if="formData.saleType == 2">
<el-form-item label="批发价" prop="optPrice"> <el-form-item label="批发价" prop="optPrice">
<el-col :span="20"> <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-col>
</el-form-item> </el-form-item>
</div> </div>
...@@ -789,13 +884,12 @@ ...@@ -789,13 +884,12 @@
</el-col> </el-col>
</el-form-item> </el-form-item>
</div> </div>
<div class="inline" v-if="formData.saleType == 2"> <div class="inline" v-if="formData.saleType == 2">
<el-form-item label="最小起批" prop="minWhole" class="required-label"> <el-form-item label="最小起批" prop="minWhole" class="required-label">
<el-col :span="20"> <el-col :span="20">
<div class="stock-com"> <div class="stock-com" style="width: 500px;display:flex">
<span class="sp sp-l" @click="minusCount(3)"><i class="el-icon-minus"></i></span> <el-input-number class="stock-com" @input="$forceUpdate();" v-model="formData.minWhole" size="small" :precision="0" :min="1"></el-input-number>
<span class="sp sp-c">{{formData.minWhole}}</span>
<span class="sp sp-r" @click="plusCount(3)"><i class="el-icon-plus"></i></span>
</div> </div>
<p class="error-message" v-if="formData.minWhole <= 0">最小起批不能为0</p> <p class="error-message" v-if="formData.minWhole <= 0">最小起批不能为0</p>
</el-col> </el-col>
...@@ -867,10 +961,10 @@ ...@@ -867,10 +961,10 @@
<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,getContractList, getCooperationProjectList} from '@/utils/goods';
import { getStoreAdressRepot } from "@/utils/shop"; import { getStoreAdressRepot } from "@/utils/shop";
import Cropper from '@/components/common/cropper.vue' import Cropper from '@/components/common/cropper.vue'
import { originRules1, originRules2, originRules, originRules3 } from './rules'; import { originRules1, originRules2, originRules, originRules3 } from './rules';
...@@ -1011,9 +1105,20 @@ ...@@ -1011,9 +1105,20 @@
videoModel:{ videoModel:{
videoFullPath: '' videoFullPath: ''
}, },
businessCategoryList:[], // businessCategoryList:[],
sumFile: 0, sumFile: 0,
uploadProgress:0, // 上传视频进度条 uploadProgress:0, // 上传视频进度条
cooperationProjectList: [], // 合作项目
contractList: [], // 合同
isProject: false, // 是否选择合作项目
isContract: false, // 是否选择合同
showTcm:false,
rangeTime:'',
// pickerOptions: {
// disabledDate: (time) => {
// return time.getTime() > new Date().getTime(); //减去一天的时间代表可以选择同一天;
// },
// },
} }
}, },
computed: { computed: {
...@@ -1045,8 +1150,9 @@ ...@@ -1045,8 +1150,9 @@
this.curmbThird = this.title; this.curmbThird = this.title;
this.formData.storeId = Number(storeId) || ''; this.formData.storeId = Number(storeId) || '';
this.getTypeCodeList(); this.getTypeCodeList();
this.getBusinessCategory(); // this.getBusinessCategory();
this.getLever(0,1) this.getLever(0,1)
this.getCooperationProjectList();
dosageAll().then((res)=>{ dosageAll().then((res)=>{
this.doseAll = res.data this.doseAll = res.data
if (!this.doseAll) { if (!this.doseAll) {
...@@ -1076,16 +1182,43 @@ ...@@ -1076,16 +1182,43 @@
if (this.formData.incrType == null || this.formData.incrType === '') { if (this.formData.incrType == null || this.formData.incrType === '') {
this.formData.incrType = 2; this.formData.incrType = 2;
} }
console.log('save');
}, },
methods: { methods: {
// 获取业务类型 // 获取合同
getBusinessCategory(){ getContractList(projectId) {
getBusinessCategory().then((res) => { getContractList(projectId || 0).then(res => {
if (res.code == '000000') { if(res.code == '000000') {
this.businessCategoryList=res.data 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是否有效 // 判断imgurl是否有效
checkImgExists(imgurl) { checkImgExists(imgurl) {
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
...@@ -1135,12 +1268,14 @@ ...@@ -1135,12 +1268,14 @@
}; };
const { goodsInfo, medicalService, buyLimitDtoList, hasRepoFlag} = res.data; 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.formData = {...this.formData, ...goodsInfo};
this.formData2 = medicalService; this.formData2 = medicalService;
this.formData = { ...this.formData, ...this.formData2 }; 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.buyLimitDtoList = buyLimitDtoList;
this.hasRepoFlag = hasRepoFlag; this.hasRepoFlag = hasRepoFlag;
this.$set(this.formData2, 'suitableArr', this.formData.suitable.split(',')); this.$set(this.formData2, 'suitableArr', this.formData.suitable.split(','));
...@@ -1192,20 +1327,30 @@ ...@@ -1192,20 +1327,30 @@
}); });
} }
const {goodsList, hasRepoFlag } = res.data; const {goodsList, hasRepoFlag } = res.data;
const { goodsName, goodsDescription, goodsType, businessCategoryId,expressLimitFlag, goodsHeaderImages=[], goodsVideoList=[] } = goodsList[0]; const { goodsName, goodsDescription, goodsType,expressLimitFlag, goodsHeaderImages=[], goodsVideoList=[],contractId, cooperationProjectId } = goodsList[0];
this.formData1 = goodsList[0]; const goodDet = goodsList[0];
this.formData = goodsList[0]; goodDet.otc1 = goodDet.otc ? '1' : '0';
this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType,businessCategoryId, expressLimitFlag }; 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.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 = [];
...@@ -1240,7 +1385,6 @@ ...@@ -1240,7 +1385,6 @@
}; };
this.barAndGoodsFlag = this.formData1.medicalCategoryId ? true : false; this.barAndGoodsFlag = this.formData1.medicalCategoryId ? true : false;
} }
console.log(this.formData);
}, },
getImges(d,type){ getImges(d,type){
let a = []; let a = [];
...@@ -1329,9 +1473,10 @@ ...@@ -1329,9 +1473,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)
...@@ -1343,6 +1488,7 @@ ...@@ -1343,6 +1488,7 @@
this.goodsType = goodsType; this.goodsType = goodsType;
if(goodsType == 337){ if(goodsType == 337){
this.isMedic = false; this.isMedic = false;
this.showTcm = false;
this.isCheckServe = true; this.isCheckServe = true;
getHospitalInfoByStoreId(this.storeId).then(({code,message,data})=>{ getHospitalInfoByStoreId(this.storeId).then(({code,message,data})=>{
this.formData2.hospitalName = data.hospital; this.formData2.hospitalName = data.hospital;
...@@ -1352,10 +1498,16 @@ ...@@ -1352,10 +1498,16 @@
this.checkPackageIdList = res.data; this.checkPackageIdList = res.data;
}) })
}else{ }else{
this.isMedic = goodsType == '5'; if (goodsType == 340) {
this.isCheckServe = false; this.showTcm = true;
this.getLever(goodsType,type); }else {
this.isMedic = goodsType == '5';
this.isCheckServe = false;
this.showTcm = false;
this.getLever(goodsType,type);
}
} }
console.log(goodsType,type);
console.log(this.formData); console.log(this.formData);
}, },
defaultArr(){ defaultArr(){
...@@ -1462,6 +1614,15 @@ ...@@ -1462,6 +1614,15 @@
}, },
complete() { 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.leastCount = this.formData.leastCount;
this.formData1.mostCount = this.formData.mostCount; this.formData1.mostCount = this.formData.mostCount;
let formNameList = ['formData', 'formData1', 'formData2', 'formData3']; let formNameList = ['formData', 'formData1', 'formData2', 'formData3'];
...@@ -1492,6 +1653,19 @@ ...@@ -1492,6 +1653,19 @@
this.formData.specificationImages = this.fileIntrList; this.formData.specificationImages = this.fileIntrList;
this.formData.buyLimitDtoList = this.buyLimitDtoList; this.formData.buyLimitDtoList = this.buyLimitDtoList;
this.isgoodsImages = this.formData.goodsImages.length == 0 ? false :true; 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){ // if(this.isMedic){
...@@ -1533,10 +1707,11 @@ ...@@ -1533,10 +1707,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, 10);
this.formData.hasChanged = true; this.formData.hasChanged = true;
this.formData.inputType = this.inputType; this.formData.inputType = this.inputType;
this.updateGoodsInfo(); this.updateGoodsInfo();
...@@ -1558,7 +1733,7 @@ ...@@ -1558,7 +1733,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') {
...@@ -2036,6 +2211,16 @@ ...@@ -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 { .required-label .el-form-item__label::before {
content: "*"; content: "*";
color: #f56c6c; color: #f56c6c;
......
...@@ -66,7 +66,7 @@ const form = { ...@@ -66,7 +66,7 @@ const form = {
mostCount: -1, mostCount: -1,
incrType: 1, incrType: 1,
saleType: 1, saleType: 1,
minWhole: 0, minWhole: 1,
expressLimitFlag: 0, //是否支持退货退款 expressLimitFlag: 0, //是否支持退货退款
}; };
...@@ -76,8 +76,10 @@ const form3 = { ...@@ -76,8 +76,10 @@ const form3 = {
goodsHeaderImages: [], goodsHeaderImages: [],
goodsVideoList: [], goodsVideoList: [],
goodsType: "", goodsType: "",
businessCategoryId:"", // businessCategoryId: "",
expressLimitFlag: 0, //是否支持退货退款 expressLimitFlag: 0, //是否支持退货退款
cooperationProjectId: '', // 合作项目id
contractId: '', // 合同id
}; };
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<el-input v-model="id" size="small" placeholder="请输入商品ID"></el-input> <el-input v-model="id" size="small" placeholder="请输入商品ID"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <!-- <el-col :span="6">
<el-form-item label="商品类型"> <el-form-item label="商品类型">
<el-select <el-select
v-model="searchForm.goodsType" v-model="searchForm.goodsType"
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
</el-row> </el-row>
<el-row :gutter="30" type="flex" style="margin-top: 10px"> <el-row :gutter="30" type="flex" style="margin-top: 10px">
<el-col :span="6"> <el-col :span="6">
...@@ -111,9 +111,17 @@ ...@@ -111,9 +111,17 @@
<el-table-column prop="goodsId" label="商品ID" width="120" align="center"> <el-table-column prop="goodsId" label="商品ID" width="120" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="goodsName" label="商品名称" width="160" align="center" show-overflow-tooltip></el-table-column> <el-table-column prop="goodsName" label="商品名称" width="160" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="type" label="商品类型" width="100" align="center"> <el-table-column prop="medicationName" label="药品名称" width="160" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="goodsCategoryStrArr" label="商品分类" width="160" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.goodsTypeStr }}</span> <p v-for="(item,index) in scope.row.goodsCategoryStrArr" :key="index">
{{item}}
</p>
</template>
</el-table-column>
<el-table-column prop="medicalCategoryStrArr" label="药品分类" width="100" align="center">
<template slot-scope="scope">
<span>{{ handleTableArry(scope.row.medicalCategoryStrArr) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status" label="商品状态" width="100" align="center"> <el-table-column prop="status" label="商品状态" width="100" align="center">
...@@ -558,14 +566,28 @@ ...@@ -558,14 +566,28 @@
} }
}, },
}, },
methods: { methods: {
handlePreview(){}, handlePreview(){},
handleRemove(){}, handleRemove(){},
beforeRemove(){}, beforeRemove(){},
handleSelectionChange(val){ handleSelectionChange(val){
this.selectList = val this.selectList = val
}, },
handleTableArry(val){
let str = ''
let newVal = []
if (val.length > 0) {
val.map(item => {
if (item !== '') {
newVal.push(item);
}
})
}
if (newVal.length > 0) {
str = newVal.join('/')
}
return str;
},
//批量上传 //批量上传
getBatchUpload(file) { getBatchUpload(file) {
let self = this; let self = this;
...@@ -662,6 +684,7 @@ ...@@ -662,6 +684,7 @@
}); });
} }
this.tableData = res.data.goodsList; this.tableData = res.data.goodsList;
this.totalRows = res.data.totalCount; this.totalRows = res.data.totalCount;
this.isSSO = res.data.isSSO; this.isSSO = res.data.isSSO;
}) })
...@@ -709,9 +732,9 @@ ...@@ -709,9 +732,9 @@
// storeType 1: "供货商",2: "小药房",3: "医生小店" // storeType 1: "供货商",2: "小药房",3: "医生小店"
let url = '' let url = ''
if(row == 'add'){ if(row == 'add'){
url = `/create-good?id=add&storeId=${this.searchForm.storeId}&inputType=1&commissionFlag=${this.commissionFlag}&storeType=${this.storeType}` url = `/create-good-new?id=add&storeId=${this.searchForm.storeId}&inputType=1&commissionFlag=${this.commissionFlag}&storeType=${this.storeType}`
}else{ }else{
url = `/create-good?id=${row.goodsId}&storeId=${this.searchForm.storeId}&goodsType=${goodsType}&commissionFlag=${this.commissionFlag}&storeType=${storeType}` url = `/create-good-new?id=${row.goodsId}&storeId=${this.searchForm.storeId}&goodsType=${goodsType}&commissionFlag=${this.commissionFlag}&storeType=${storeType}`
} }
// this.$store.dispatch('goodsManage/changeGoodsInfo', {...row}); // this.$store.dispatch('goodsManage/changeGoodsInfo', {...row});
this.$router.push({ this.$router.push({
......
...@@ -464,7 +464,7 @@ ...@@ -464,7 +464,7 @@
goGoodsEdit(row) { goGoodsEdit(row) {
// this.$store.dispatch('goodsManage/changeGoodsInfo', {...row}); // this.$store.dispatch('goodsManage/changeGoodsInfo', {...row});
this.$router.push({ this.$router.push({
path: '/create-good', path: '/create-good-new',
query: { query: {
id: row.goodsId, id: row.goodsId,
storeId: this.storeId, storeId: this.storeId,
......
...@@ -116,7 +116,7 @@ const rules = { ...@@ -116,7 +116,7 @@ const rules = {
const rules3 = { const rules3 = {
goodsName: [ goodsName: [
{ required: true, message: "请输入商品名称", trigger: "submit" }, { required: true, message: "请输入商品名称", trigger: "submit" },
{ validator: checkProjectStr, trigger: "submit" }, // { validator: checkProjectStr, trigger: "submit" },
], ],
goodsDescription: [ goodsDescription: [
{ required: true, message: "请输入商品介绍", trigger: "submit" }, { required: true, message: "请输入商品介绍", trigger: "submit" },
......
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
/> />
</div> </div>
<div class="space-between flex-c"> <div class="space-between flex-c">
<div>法人姓名:{{ detail.legalName }}</div> <div>法人姓名:{{ detail.legalName }}</div>
<div>法人身份证号:{{ detail.legalCertNo }}</div> <div>法人身份证号:{{ detail.legalCertNo }}</div>
<div> <div>
法人身份证有效日期:{{ detail.legalValidDateBegin }} 法人身份证有效日期:{{ detail.legalValidDateBegin }}
......
...@@ -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"
...@@ -848,7 +851,8 @@ ...@@ -848,7 +851,8 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="资质信息" class="required-label" v-if="formData.storeType < 3"> <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 v-if="certifyValidDtoList(7)" class="red">{{certifyValidDtoList(7)}}</p>
<p class="tips">药品经营许可证</p> <p class="tips">药品经营许可证</p>
<el-form-item prop="imgUrlP7"> <el-form-item prop="imgUrlP7">
...@@ -947,7 +951,8 @@ ...@@ -947,7 +951,8 @@
<!-- </el-date-picker>--> <!-- </el-date-picker>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </div>--> <!-- </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 v-if="certifyValidDtoList(9)" class="red">{{certifyValidDtoList(9)}}</p>
<p class="tips">食品经营(流通)许可证</p> <p class="tips">食品经营(流通)许可证</p>
<el-form-item prop="imgUrlP9"> <el-form-item prop="imgUrlP9">
...@@ -996,7 +1001,8 @@ ...@@ -996,7 +1001,8 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</div> </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 v-if="certifyValidDtoList(10)" class="red">{{certifyValidDtoList(10)}}</p>
<p class="tips">医疗器械经营许可证</p> <p class="tips">医疗器械经营许可证</p>
<el-form-item prop="imgUrlP10"> <el-form-item prop="imgUrlP10">
...@@ -1045,7 +1051,8 @@ ...@@ -1045,7 +1051,8 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</div> </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> <p class="tips">医疗器械网络销售备案</p>
<el-form-item prop="imgUrlP13"> <el-form-item prop="imgUrlP13">
<el-upload <el-upload
...@@ -1093,7 +1100,8 @@ ...@@ -1093,7 +1100,8 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</div> </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 v-if="certifyValidDtoList(11)" class="red">{{certifyValidDtoList(11)}}</p>
<p class="tips">二类医疗器械经营备案凭证</p> <p class="tips">二类医疗器械经营备案凭证</p>
<el-form-item prop="imgUrlP11"> <el-form-item prop="imgUrlP11">
...@@ -1168,6 +1176,23 @@ ...@@ -1168,6 +1176,23 @@
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="送检地址管理" class="warehouseAdress-wrap" v-if="formData.storeType < 3">
<p class="warehouseAdress-tip">(该地址用于机构回寄样本地址,请准确填写)</p>
<el-button type="success" class="warehouseAdress-add" size="small" v-if="!formData.tradeStoreDetectionAddress.receiverMobile" @click="createDetectionAdress(0)">+新增地址</el-button>
<div class="detectionAddress" v-if="formData.tradeStoreDetectionAddress && formData.tradeStoreDetectionAddress.receiverMobile">
<div class="warehouseAdress-item">
<span class="warehouseAdress-main">
<span class="warehouseAdress-msg">{{formData.tradeStoreDetectionAddress && formData.tradeStoreDetectionAddress.receiver}}</span>
<span class="warehouseAdress-msg">{{formData.tradeStoreDetectionAddress && formData.tradeStoreDetectionAddress.receiverMobile}}</span>
<span class="warehouseAdress-msg">{{setAddress(formData.tradeStoreDetectionAddress)}}</span>
</span>
<span class="warehouseAdress-do">
<el-button class="btn-small" @click.prevent="createDetectionAdress(1)">编辑</el-button>
<el-button class="btn-small" @click.prevent="deleteDetectionAdress">删除</el-button>
</span>
</div>
</div>
</el-form-item>
<el-form-item label="退货支持的物流公司" class="required-label" v-if="formData.storeType < 3"> <el-form-item label="退货支持的物流公司" class="required-label" v-if="formData.storeType < 3">
<el-radio-group v-model="formData.expressLimitFlag" @change="changeExpressLimitFlag"> <el-radio-group v-model="formData.expressLimitFlag" @change="changeExpressLimitFlag">
<el-radio :label="0">无限制</el-radio> <el-radio :label="0">无限制</el-radio>
...@@ -1367,10 +1392,10 @@ export default { ...@@ -1367,10 +1392,10 @@ export default {
label: "供货商", label: "供货商",
value: 1, value: 1,
}, },
{ // {
label: "小药房", // label: "小药房",
value: 2, // value: 2,
}, // },
{ {
label: "医生小店", label: "医生小店",
value: 3, value: 3,
...@@ -1428,6 +1453,7 @@ export default { ...@@ -1428,6 +1453,7 @@ export default {
imgUrlC1Date:'', imgUrlC1Date:'',
repotList:[//仓库地址 repotList:[//仓库地址
], ],
tradeStoreDetectionAddress:{}, // 送检地址
selectedKey: '', //默认收货地址 selectedKey: '', //默认收货地址
expressLimitFlag: 0, //是否限制物流公司 expressLimitFlag: 0, //是否限制物流公司
repotExpressList:[], //支持的物流公司 repotExpressList:[], //支持的物流公司
...@@ -1691,11 +1717,27 @@ export default { ...@@ -1691,11 +1717,27 @@ export default {
orgScopeLIST:[], orgScopeLIST:[],
certifyStatus: '', certifyStatus: '',
idCardError:false, idCardError:false,
isDetection:false, // 是否是创建送检地址
}; };
}, },
computed: { computed: {
certifyStatusColor () { certifyStatusColor () {
return `certifyStatusColor${this.certifyStatus}`; 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: { watch: {
...@@ -1821,13 +1863,14 @@ export default { ...@@ -1821,13 +1863,14 @@ export default {
storeType, storeType,
storeOwner, storeOwner,
storePhone, storePhone,
storeQualityUrl storeQualityUrl,
} = this.storeData.tradeStore; } = this.storeData.tradeStore;
this.formData.storeLogo = storeLogo; this.formData.storeLogo = storeLogo;
this.formData.storeName = storeName; this.formData.storeName = storeName;
this.formData.storeQualityUrl=storeQualityUrl; this.formData.storeQualityUrl=storeQualityUrl;
this.formData.storeDescription = storeDescription; this.formData.storeDescription = storeDescription;
this.formData.storeType = storeType; this.formData.storeType = storeType;
this.formData.tradeStoreDetectionAddress = this.storeData.tradeStoreDetectionAddress || {}
if (storeType == 1) { if (storeType == 1) {
this.formData.compainName = storeOwner; this.formData.compainName = storeOwner;
this.formData.phoneNum = storePhone; this.formData.phoneNum = storePhone;
...@@ -1911,6 +1954,49 @@ export default { ...@@ -1911,6 +1954,49 @@ export default {
}); });
}, },
completeWholeForm() { 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(); let flag = this.submitForm();
if (flag && this.certifyStatus == 3) { if (flag && this.certifyStatus == 3) {
this.$confirm('您的店铺已经审核通过,重新提交后需要重新审核。', '确认重新提交店铺信息吗?', { this.$confirm('您的店铺已经审核通过,重新提交后需要重新审核。', '确认重新提交店铺信息吗?', {
...@@ -1943,8 +2029,8 @@ export default { ...@@ -1943,8 +2029,8 @@ export default {
}); });
}); });
}else if(flag) { }else if(flag) {
this.formData.storeType = Number(this.formData.storeType); this.formData.storeType = Number(this.formData.storeType);
this.formData.storeEntry = "PCKAIDIAN"; // 添加店铺渠道 this.formData.storeEntry = "PCKAIDIAN"; // 添加店铺渠道
const {bizScope, areaStr} = this.formData.certifyReq; const {bizScope, areaStr} = this.formData.certifyReq;
const result = deepCopy(this.formData); const result = deepCopy(this.formData);
result.certifyReq.areaStr = JSON.stringify(areaStr); result.certifyReq.areaStr = JSON.stringify(areaStr);
...@@ -2484,6 +2570,7 @@ export default { ...@@ -2484,6 +2570,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 +2578,8 @@ export default { ...@@ -2491,6 +2578,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();
...@@ -2546,9 +2635,58 @@ export default { ...@@ -2546,9 +2635,58 @@ export default {
} }
this.formData.adminList.splice(index, 1); this.formData.adminList.splice(index, 1);
}, },
// 创建或编辑地址 type // 创建地址
createDetectionAdress(type){
this.isDetection = true;
this.warehouseAdressType = type;
this.warehouseAdressFormTitle = type ? '编辑地址' : '添加地址';
this.warehouseAdressIndex = 0;
if (type) {
this.formData.tradeStoreDetectionAddress.addr = this.formData.tradeStoreDetectionAddress.address;
Object.assign(this.warehouseAdressForm,this.formData.tradeStoreDetectionAddress);
this.getCitiesList();
this.getCountiesList();
this.getTownsList();
} else {
this.warehouseAdressForm = {
receiver: '',
receiverMobile: '',
provinceId: '',
cityId: '',
countyId: '',
townId: '',
provinceName: '',
cityName: '',
countyName: '',
townName: '',
addr: '',
address:'',
key: ''
}
}
this.warehouseAdressFormVisible = true;
},
deleteDetectionAdress(){
this.$confirm('确定要删除这条地址信息么?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '',
type: 'error'
}).then(() => {
this.formData.tradeStoreDetectionAddress = {}
this.$message({
type: 'success',
message: '删除成功!'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
// 编辑第几条数据 index // 编辑第几条数据 index
createAdress(type,index) { createAdress(type,index) {
this.isDetection = false;
this.warehouseAdressType = type; this.warehouseAdressType = type;
this.warehouseAdressFormTitle = type ? '编辑地址' : '添加地址'; this.warehouseAdressFormTitle = type ? '编辑地址' : '添加地址';
this.warehouseAdressIndex = type ? index : ''; this.warehouseAdressIndex = type ? index : '';
...@@ -2736,12 +2874,18 @@ export default { ...@@ -2736,12 +2874,18 @@ export default {
const { repotList } = this.formData; const { repotList } = this.formData;
this.$refs['warehouseAdressForm'].validate((valid) => { this.$refs['warehouseAdressForm'].validate((valid) => {
if (valid) { if (valid) {
if (warehouseAdressType) { if(this.isDetection){ // 送检地址
this.formData.tradeStoreDetectionAddress = JSON.parse(JSON.stringify(warehouseAdressForm))
this.formData.tradeStoreDetectionAddress.address = this.formData.tradeStoreDetectionAddress.addr
} else { // 仓库地址
if (warehouseAdressType) {
repotList[warehouseAdressIndex] = JSON.parse(JSON.stringify(warehouseAdressForm)); repotList[warehouseAdressIndex] = JSON.parse(JSON.stringify(warehouseAdressForm));
} else { } else {
warehouseAdressForm.key = repotList.length + Math.round(Math.random()*1000); warehouseAdressForm.key = repotList.length + Math.round(Math.random()*1000);
repotList.push(JSON.parse(JSON.stringify(warehouseAdressForm))); repotList.push(JSON.parse(JSON.stringify(warehouseAdressForm)));
}
} }
this.$message({ this.$message({
type: 'success', type: 'success',
message: `${warehouseAdressFormTitle}成功!` message: `${warehouseAdressFormTitle}成功!`
...@@ -2760,7 +2904,8 @@ export default { ...@@ -2760,7 +2904,8 @@ export default {
// 格式化地址 // 格式化地址
setAddress(arg) { setAddress(arg) {
let townName = arg.townName || ''; let townName = arg.townName || '';
return arg.provinceName + arg.cityName + arg.countyName + townName + arg.addr; console.log(arg,arg.addr, arg.address);
return arg.provinceName + arg.cityName + arg.countyName + townName + (arg.addr || arg.address);
}, },
// 获取退货物流 // 获取退货物流
getCompanyList() { getCompanyList() {
...@@ -2818,6 +2963,22 @@ export default { ...@@ -2818,6 +2963,22 @@ export default {
const s = {...query, currentTab: this.activeTabName}; const s = {...query, currentTab: this.activeTabName};
vm.$router.push({ path: "create-shop", query: s}); 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) { handleRegionChange(v) {
const checkedNodes = this.$refs['regionCascader'].getCheckedNodes()[0]; const checkedNodes = this.$refs['regionCascader'].getCheckedNodes()[0];
const n = []; const n = [];
...@@ -3140,7 +3301,7 @@ export default { ...@@ -3140,7 +3301,7 @@ export default {
color: #FFFFFF; color: #FFFFFF;
border-color: #449284; border-color: #449284;
} }
.warehouseAdress-list { .warehouseAdress-list,.detectionAddress {
display: block; display: block;
margin-top: 20px; margin-top: 20px;
border: 1px solid #DCDFE6; border: 1px solid #DCDFE6;
...@@ -3191,6 +3352,12 @@ export default { ...@@ -3191,6 +3352,12 @@ export default {
} }
} }
} }
.detectionAddress{
padding: 0;
height: 50px;
line-height: 50px;
overflow-y: hidden;
}
} }
.warehouseAdress-input { .warehouseAdress-input {
width: 500px; width: 500px;
...@@ -3201,6 +3368,11 @@ export default { ...@@ -3201,6 +3368,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;
} }
......
因为 它太大了无法显示 源差异 。您可以改为 查看blob
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册