提交 5dc1b51c 编写于 作者: 张磊's avatar 张磊

save

上级 b870a07e
......@@ -11,7 +11,7 @@
<span>
{{curmbSecond}}
</span>
<span class="verify-status" style="margin-left: 20px">{{1 | verifyStatus}}</span>
<span v-if="certifyStatus > 1" class="verify-status" style="margin-left: 20px">{{ certifyStatus | storeStatusFormat}}</span>
</p>
</el-col>
<el-col :span="4" style="text-align: right">
......@@ -19,7 +19,7 @@
size="small"
type="primary"
:disabled="disabledFORM || storeData && storeData.tradeStore.storeType == 3"
@click="complete"
@click="completeWholeForm"
>完成</el-button
>
<el-button size="small" type="primary" @click="back">返回</el-button>
......@@ -118,6 +118,7 @@
size="small"
clearable
:disabled="isDisabled"
@change="storeTypeChange"
style="width: 35%"
>
<el-option
......@@ -133,7 +134,7 @@
</el-form-item>
</el-tab-pane>
<el-tab-pane v-if="formData.storeType != 3" label="资质信息" name="second">
<el-tab-pane label="资质信息" name="second">
<div>
<div v-if="certifyValidDtoList(1)">
<el-form-item>
......@@ -401,7 +402,7 @@
>
</el-cascader>
</el-form-item>
<el-form-item class="required-label" label="营业证明">
<el-form-item v-if="formData.storeType != 3" class="required-label" label="营业证明">
<p v-if="certifyValidDtoList(2)" class="red">{{certifyValidDtoList(2)}}</p>
<p class="tips">营业执照</p>
<p class="p-tips">
......@@ -480,12 +481,12 @@
</div>
</div>
<el-form-item v-if="formData.storeType == 1" label="认证类型" label-width="100px">
<el-radio-group v-model="formData.isLegal" >
<el-radio-group v-model="formData.certifyReq.certType" >
<el-radio :label="1">法人认证</el-radio>
<el-radio :label="2">委托人认证</el-radio>
</el-radio-group>
</el-form-item>
<div v-if="formData.isLegal == 2">
<div v-if="formData.certifyReq.certType == 2">
<p v-if="certifyValidDtoList(4)" class="red">{{certifyValidDtoList(4)}}</p>
<div v-if="formData.storeType == 1">
<div>委托人身份证</div>
......@@ -587,7 +588,7 @@
</div>
</div>
</div>
<div v-if="formData.isLegal == 2" class="flex-upload">
<div v-if="formData.certifyReq.certType == 2|| formData.storeType == 2 " class="flex-upload">
<p v-if="certifyValidDtoList(5)" class="red">{{certifyValidDtoList(5)}}</p>
<div>委托书</div>
<el-upload
......@@ -621,7 +622,7 @@
</el-upload>
</div>
<div v-if="formData.storeType == 1 && formData.isLegal === 1">
<div v-if="formData.storeType == 1 && formData.certifyReq.certType === 1">
<p v-if="certifyValidDtoList(6)" class="red">{{certifyValidDtoList(6)}}</p>
<div>法人身份证</div>
<div class="flex-wrap">
......@@ -728,7 +729,7 @@
</el-form-item>
</div>
</div>
<div v-if="formData.storeType == 1 && formData.isLegal === 2">
<div v-if="formData.storeType == 1 && formData.certifyReq.certType === 2">
<p v-if="certifyValidDtoList(6)" class="red">{{certifyValidDtoList(6)}}</p>
<div>法人身份证</div>
<div class="flex-wrap">
......@@ -1315,7 +1316,7 @@
<script>
import BreadCrumb from "@/components/breadcrumb.vue";
import dayjs from 'dayjs';
import { openLoading, closeLoading } from "../../utils/utils";
import { openLoading, closeLoading, deepCopy} from "../../utils/utils";
import { doUpload, getFilePath } from "../../utils/qiniu-util";
import Cropper from "@/components/common/cropper.vue";
import { saveStore, queryStore, getLgCompanyList, getStoreAdressRepot, OCRStore, idCardOcr, orgOptionList, orgScopeOptionList} from "@/utils/shop";
......@@ -1364,7 +1365,6 @@ export default {
licenseDate: '',
orgRegionValueFirst: '请选择地区',
formData: {
orgRegionValue: [],
storeId: null,
userId: null,
storeQualityUrl:"",
......@@ -1400,6 +1400,7 @@ export default {
imgUrlC3: "", //证明图3
imgUrlC4: "",
imgUrlC5: "",
imgUrlP7Date: '',
imgUrlP6Date: '',
imgUrlP5Date: '',
imgUrlP4Date: '',
......@@ -1415,20 +1416,21 @@ export default {
expressLimitFlag: 0, //是否限制物流公司
repotExpressList:[], //支持的物流公司
expressDesc: '', //退款说明
isLegal: 1,
certifyReq:{
areaStr: [],
orgType: '',
orgName:'',
licenseUrl:'',
licenseValidDateBegin:'',
licenseValidDateEnd:'',
licenseType: 1,
certType: 1,
creditCode:'',
assignor_letter_url:'',
bizScope:''
},
assignorLetterUrl:'',
bizScope:'',
certifyLicenseImgList: []
},
},
cpmList: [], //所有的物流公司
warehouseAdressType: 0, // 0为新建地址,1为编辑地址
warehouseAdressIndex: 0, // 编辑的第几条地址
......@@ -1592,6 +1594,7 @@ export default {
imgUrlP4:[{type: "string", required: true, message: '请上传图片', trigger: 'change'}],
imgUrlP5:[{type: "string", required: true, message: '请上传图片', trigger: 'change'}],
imgUrlP6:[{type: "string", required: true, message: '请上传图片', trigger: 'change'}],
imgUrlP7:[{type: "string", required: true, message: '请上传图片', trigger: 'change'}],
imgUrlC1:[{type: "string", required: true, message: '请上传图片', trigger: 'change'}],
imgUrlC2:[{type: "string", required: true, message: '请上传图片', trigger: 'change'}],
imgUrlC3:[{type: "string", required: true, message: '请上传图片', trigger: 'change'}],
......@@ -1600,6 +1603,7 @@ export default {
imgUrlP4Date:[{type: "array", required: true, message: '请选择有效日期', trigger: 'change'}],
imgUrlP5Date:[{type: "array", required: true, message: '请选择有效日期', trigger: 'change'}],
imgUrlP6Date:[{type: "array", required: true, message: '请选择有效日期', trigger: 'change'}],
imgUrlP7Date:[{type: "array", required: true, message: '请选择有效日期', trigger: 'change'}],
},
imgMouseOver1: false,
uploadImgMessage1: false, //未上传图片,校验提示语
......@@ -1649,6 +1653,7 @@ export default {
},
orgLIST: [],
orgScopeLIST:[],
certifyStatus: ''
};
},
computed: {
......@@ -1673,6 +1678,7 @@ export default {
created() {
vm = this;
this.activeTabName = this.$route.query.currentTab || 'first';
this.certifyStatus = this.$route.query.certifyStatus || null;
this.disabledFORM = this.$route.query.disabled == 'false' ? false : true;
this.getCompanyList();
......@@ -1685,23 +1691,34 @@ export default {
const e = await this.orgOptionList();
if(q && w && e){
const storeId = this.$route.query.storeId || null;
const s = storejs.get('store_info');
if(storeId){
// 编辑 详情
this.curmbSecond = "编辑店铺";
this.isDisabled = true;
if(this.disabledFORM){
this.formData.storeId = storeId;
storejs.remove('store_info');
this.initInfo();
this.getDetail();
}else{
if(s && s.storeId == storeId){
this.formData = s;
const {orgRegionValue} = s;
const v = orgRegionValue.map(i => {return i.label;}).join('/');
const {areaStr} = s.certifyReq;
const v = areaStr.map(i => {return i.label;}).join('/');
this.orgRegionValueFirst = v;
this.areaStr = v;
this.orgDateReverse();
this.resetImgUrl();
}else{
this.formData.storeId = storeId;
storejs.remove('store_info');
this.initInfo();
this.getDetail();
}
}
}else{
// 新建店铺
this.curmbSecond = "新建店铺";
......@@ -1709,8 +1726,8 @@ export default {
if(s){
// 存在数据 就反现
this.formData = s;
const {orgRegionValue} = s;
const v = orgRegionValue.map(i => {return i.label;}).join('/');
const {areaStr} = s.certifyReq;
const v = areaStr.map(i => {return i.label;}).join('/');
this.orgRegionValueFirst = v;
this.orgDateReverse();
}
......@@ -1720,20 +1737,44 @@ export default {
//日期 设置
orgDateReverse () {
const {licenseValidDateBegin,licenseValidDateEnd,legalValidDateBegin, legalValidDateEnd, assignorValidDateBegin, assignorValidDateEnd} = this.formData.certifyReq;
const {certifyLicenseImgList} = this.formData;
const {certifyLicenseImgList} = this.formData.certifyReq;
this.formData.imgUrlC1Date = [licenseValidDateBegin, licenseValidDateEnd];
this.formData.imgUrlC5Date = [assignorValidDateBegin, assignorValidDateEnd];
this.formData.imgUrlC5Date = [legalValidDateBegin, legalValidDateEnd];
certifyLicenseImgList.map(i => {
const n = `imgUrlP${i.imageType}Date`;
const m = `imgUrlP${i.imageType}`;
this.formData[n] = [i.validDateBegin, i.validDateEnd];
this.formData[m] = i.url;
})
// imgUrlP5Date
},
resetImgUrl () {
// 营业执照 legalCertBackUrl legalCertFrontUrl
const s = this.formData.certifyReq;
this.formData.imgUrlC3 = s.legalCertBackUrl;
this.formData.imgUrlC2 = s.legalCertFrontUrl;
this.formData.imgUrlC1 = s.licenseUrl;
this.formData.imgUrlC5 = s.assignorCertBackUrl;
this.formData.imgUrlC4 = s.assignorCertFrontUrl;
this.formData.imgUrlP7 = s.assignorLetterUrl;
},
getDetail() {
getStoreAdressRepot(this.formData.storeId).then(res => {
if (res.code == "000000") {
Object.assign(this.formData,res.data);
const l = res.data;
const {areaStr, bizScope} = l.certifyReq;
l.certifyReq.areaStr = JSON.parse(areaStr);
l.certifyReq.bizScope = JSON.parse(bizScope);
Object.assign(this.formData, l);
const v = JSON.parse(areaStr).map(i => {return i.label;}).join('/');
this.orgRegionValueFirst = v;
this.areaStr = v;
this.orgDateReverse();
this.resetImgUrl();
} else {
this.$message.error(res.message);
}
......@@ -1799,7 +1840,7 @@ export default {
} else if (storeType == 2) {
this.formData.drugstoreName = storeOwner;
this.formData.drugstorePhone = storePhone;
this.formData.isLegal = 2;
this.formData.certifyReq.certType = 2;
if (this.storeData.imageList && this.storeData.imageList.length) {
this.storeData.imageList.map((item) => {
if (item.imageSort == 1) {
......@@ -1837,15 +1878,24 @@ export default {
}
});
},
complete() {
completeWholeForm() {
let flag = this.submitForm();
if (flag) {
if (flag && this.certifyStatus == 3) {
this.$confirm('确定要删除这条地址信息么?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '',
type: 'error'
}).then(() => {
this.formData.storeType = Number(this.formData.storeType);
this.formData.storeEntry = "PCKAIDIAN"; // 添加店铺渠道
console.log("提交的数据", this.formData);
saveStore(this.formData).then((res) => {
const {bizScope, areaStr} = this.formData.certifyReq;
const result = deepCopy(this.formData);
result.certifyReq.bizScope = JSON.stringify(bizScope);
result.certifyReq.areaStr = JSON.stringify(areaStr);
console.log("提交的数据", result);
saveStore(result).then((res) => {
if (res.code == "000000") {
storejs.remove('store_info');
this.$message.success("操作成功");
this.$router.push({
path: "/shop-list",
......@@ -1854,6 +1904,31 @@ export default {
this.$message.error(res.message);
}
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
}else if(flag) {
this.formData.storeType = Number(this.formData.storeType);
this.formData.storeEntry = "PCKAIDIAN"; // 添加店铺渠道
const {bizScope, areaStr} = this.formData.certifyReq;
const result = deepCopy(this.formData);
result.certifyReq.areaStr = JSON.stringify(areaStr);
result.certifyReq.bizScope = JSON.stringify(bizScope);
console.log("提交的数据", result);
saveStore(result).then((res) => {
if (res.code == "000000") {
storejs.remove('store_info');
this.$message.success("操作成功");
// this.$router.push({
// path: "/shop-list",
// });
} else {
this.$message.error(res.message);
}
});
}
},
// 返回
......@@ -2092,7 +2167,7 @@ export default {
orgDate (v, type) {
const b = dayjs(v[0]).format('YYYY-MM-DD');
const e = dayjs(v[1]).format('YYYY-MM-DD');
const l = this.formData.certifyLicenseImgList;
const l = this.formData.certifyReq.certifyLicenseImgList;
const t = type.charAt(type.length-1);
switch (type) {
case 'imgUrlC1':
......@@ -2121,10 +2196,12 @@ export default {
case 'imgUrlP5':
// 二类医疗器械经营备案凭证
case 'imgUrlP6':
// 委托书
case 'imgUrlP7':
// 年度报告
const r = l.filter( i => {return i.imageType == t})[0] || {};
l.push(Object.assign(r, {validDateBegin: b, validDateEnd: e, imageType: t}));
this.formData.certifyLicenseImgList = this.clearRepeat(l, 'imageType');
this.formData.certifyReq.certifyLicenseImgList = this.clearRepeat(l, 'imageType');
console.log('--this.formData', this.formData);
break;
default:
......@@ -2215,7 +2292,7 @@ export default {
return isJPG && isLt2M;
},
setImgUrl (path, fileLimit) {
const l = this.formData.certifyLicenseImgList;
const l = this.formData.certifyReq.certifyLicenseImgList;
const f = path.fullPath;
const imgName = fileLimit.key;
const u = this.formData[imgName];
......@@ -2243,7 +2320,7 @@ export default {
break;
case 'imgUrlP7':
// 委托书
this.formData.certifyReq.assignor_letter_url = u;
this.formData.certifyReq.assignorLetterUrl = u;
break;
case 'imgUrlP1':
// 药品经营许可证
......@@ -2256,10 +2333,11 @@ export default {
case 'imgUrlP5':
// 二类医疗器械经营备案凭证
case 'imgUrlP6':
// 委托书
// 年度报告
const r = l.filter( i => {return i.imageType == t})[0] || {};
l.push(Object.assign(r, {url: f, imageType: t}));
this.formData.certifyLicenseImgList = this.clearRepeat(l, 'imageType');
this.formData.certifyReq.certifyLicenseImgList = this.clearRepeat(l, 'imageType');
break;
default:
return false;
......@@ -2277,6 +2355,7 @@ export default {
.set("imgUrlP4", "imgMouseOverP4")
.set("imgUrlP5", "imgMouseOverP5")
.set("imgUrlP6", "imgMouseOverP6")
.set("imgUrlP7", "imgMouseOverP7")
.set("imgUrlC1", "imgMouseOverC1")
.set("imgUrlC2", "imgMouseOverC2")
.set("imgUrlC3", "imgMouseOverC3")
......@@ -2291,7 +2370,7 @@ export default {
this.deleteImgFormData(type);
},
deleteImgFormData (type) {
const l = this.formData.certifyLicenseImgList;
const l = this.formData.certifyReq.certifyLicenseImgList;
const t = type.charAt(type.length-1);
switch (type) {
case 'imgUrlC1':
......@@ -2315,7 +2394,7 @@ export default {
this.formData.certifyReq.legalCertBackUrl = '';
break;
case 'imgUrlP7':
this.formData.certifyReq.assignor_letter_url = '';
this.formData.certifyReq.assignorLetterUrl = '';
// 委托书
break;
case 'imgUrlP1':
......@@ -2331,7 +2410,7 @@ export default {
case 'imgUrlP6':
// 年度报告
const r = l.filter( i => {return i.imageType != t}) || [];
this.formData.certifyLicenseImgList = r;
this.formData.certifyReq.certifyLicenseImgList = r;
break;
default:
return false;
......@@ -2665,7 +2744,7 @@ export default {
n.push({label: i.label, value: i.value});
});
// countyId provinceId townId cityId
this.formData.orgRegionValue = n;
this.formData.certifyReq.areaStr = n;
this.formData.certifyReq.provinceId = v[0] || '';
this.formData.certifyReq.cityId = v[1] || '';
this.formData.certifyReq.countyId = v[2] || '';
......@@ -2739,19 +2818,29 @@ export default {
const l = vm.formData.certifyValidDtoList || [];
return l.filter(i => {return i.infoType == v;})[0] || '';
},
storeTypeChange () {
vm.formData.certifyValidDtoList = [];
console.log('--vm.formData', vm.formData);
}
},
filters: {
verifyStatus: function(value){
if (!value && value != 0) {
return "-";
} else {
let hash = {
1: "审核通过",
2: "审核中",
3: "审核不通过"
};
return hash[value];
storeStatusFormat(v) {
let s = '';
switch (v) {
case 2:
s = '待审核'
break;
case 3:
s = '审核成功'
break;
case 4:
s = '审核失败'
break;
default:
s =''
break;
}
return s;
}
},
};
......
......@@ -302,10 +302,7 @@
label: "固定分佣"
}],
storeTypeList: [
{
value: 1,
label: "未认证"
},
{
value: 2,
label: "认证提交中"
......@@ -317,10 +314,6 @@
{
value: 4,
label: "审核失败"
},
{
value: 5,
label: "作废"
},
],
setPriceVisible: false,
......@@ -725,9 +718,6 @@
storeStatusFormat(v) {
let s = '';
switch (v) {
case 1:
s = '未认证'
break;
case 2:
s = '待审核'
break;
......@@ -738,7 +728,7 @@
s = '审核失败'
break;
default:
s ='审核通过'
s ='审核成功'
break;
}
return s;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册