|
@@ -1,11 +1,11 @@
|
|
|
/**
|
|
|
* Created by ZHJY on 2020/9/17.
|
|
|
*/
|
|
|
-;
|
|
|
$('.navLayout').find('.navList').removeClass("on").find('.con').hide().find('a').removeClass("on");
|
|
|
$('.navLayout').find('.navList').eq(1).addClass("on").find('.con').show().find('a').eq(2).addClass("on");
|
|
|
var releaseContainer = new Vue({
|
|
|
el:"#releaseContainer",
|
|
|
+ mixins: [getInfoMixins,checkeMixins,releaseMixins],
|
|
|
data: {
|
|
|
NODE_ENV_BASE_URL:'',
|
|
|
releaseType:'',
|
|
@@ -62,6 +62,7 @@ var releaseContainer = new Vue({
|
|
|
qualificationNo:'',//资质证书编号
|
|
|
productName:'',//资质产品名称
|
|
|
qualificationTime:'',//证书有效日期
|
|
|
+ skus:[]// sku
|
|
|
},
|
|
|
params:{
|
|
|
param:[],//相关参数
|
|
@@ -119,122 +120,9 @@ var releaseContainer = new Vue({
|
|
|
isTaxPonitEdit:false,
|
|
|
fromMessage:'',//提示文字
|
|
|
isBrandAssociation:false,
|
|
|
- vShow_Name:false,
|
|
|
- vShow_AliasName:false,
|
|
|
- vShow_TinyTypeID:false,
|
|
|
- vShow_BrandID:false,
|
|
|
- vShow_GoodsType:false,
|
|
|
- vShow_QualificationImg:false,
|
|
|
- vShow_Tags:false,
|
|
|
- vShow_Unit:false,
|
|
|
- vShow_NormalPrice:false,
|
|
|
- vShow_price:false,
|
|
|
- vShow_includedTax:false,
|
|
|
- vShow_MinBuyNumber:false,
|
|
|
- vShow_Stock:false,
|
|
|
- vShow_isProvince:false,
|
|
|
- vShow_isNewProductType:false,
|
|
|
- vShow_taxPoint:false,
|
|
|
- vShow_GoodsImages:false,
|
|
|
- vShow_detailInfoEditor:true,
|
|
|
- vShow_orderInfoEditor:true,
|
|
|
- vShow_attribute:false,
|
|
|
- vShow_trainingMethod:false,
|
|
|
- vShow_trainingType:false,
|
|
|
- vShow_QualificationNo:false,
|
|
|
- vShow_ProductName:false,
|
|
|
- vShow_QualificationTime:false,
|
|
|
- },
|
|
|
- computed: {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
- GetEditReleaseProductInfo: function(productId){
|
|
|
- var _this = this;
|
|
|
- SupplierApi.EditReleaseProductInfo({productId:productId},function(response){
|
|
|
- if(response.code == 0){
|
|
|
- console.log(response);
|
|
|
- var data = response.data;
|
|
|
- _this.releaseParams.brandId = data.brandId;
|
|
|
- _this.releaseParams.name = data.name;
|
|
|
- _this.releaseParams.aliasName = data.aliasName;
|
|
|
- _this.releaseParams.productType = data.productType;
|
|
|
- _this.releaseParams.trainingMethod = data.trainingMethod;
|
|
|
- _this.releaseParams.trainingType = data.trainingType;
|
|
|
- _this.releaseParams.trainingFee = data.trainingFee;
|
|
|
- _this.releaseParams.machineType = data.machineType;
|
|
|
- _this.releaseParams.qualificationImg = data.qualificationImg;
|
|
|
- _this.releaseParams.unit = data.unit;
|
|
|
- _this.releaseParams.productCode = data.productCode;
|
|
|
- _this.releaseParams.normalPrice = data.normalPrice;
|
|
|
- _this.releaseParams.price = data.price;
|
|
|
- _this.releaseParams.includedTax = data.includedTax;
|
|
|
- _this.releaseParams.invoiceType = data.invoiceType;
|
|
|
- _this.releaseParams.taxPoint = data.supplierTaxPoint;
|
|
|
- _this.releaseParams.costPrice = data.costPrice;
|
|
|
- _this.releaseParams.minBuyNumber = data.minBuyNumber;
|
|
|
- _this.releaseParams.stock = data.stock;
|
|
|
- _this.releaseParams.step = data.step;
|
|
|
- _this.releaseParams.byFlag = data.byFlag;
|
|
|
- _this.releaseParams.allAreaFlag = data.allAreaFlag;
|
|
|
- _this.releaseParams.productName = data.productName;
|
|
|
- _this.releaseParams.qualificationNo = data.qualificationNo;
|
|
|
- _this.releaseParams.qualificationTime = data.qualificationTime;
|
|
|
- _this.releaseParams.newProductType = data.newProductType;
|
|
|
- _this.releaseParams.detailInfo = data.productDetail.detailInfo;
|
|
|
- _this.releaseParams.serviceInfo = data.productDetail.serviceInfo;
|
|
|
- _this.releaseParams.orderInfo = data.productDetail.orderInfo;
|
|
|
- _this.productDetailInfoId = data.productDetail.productDetailInfoId;
|
|
|
- _this.tagsList = _this.setTagArray(data.tags);
|
|
|
- _this.EchoProductFn(data.productType);
|
|
|
- _this.EchoMachineTypeFn(data.machineType);
|
|
|
- _this.selectText.bigTypeID = data.bigTypeName;
|
|
|
- _this.selectText.smallTypeID = data.smallTypeName;
|
|
|
- _this.selectText.tinyTypeID = data.tinyTypeName;
|
|
|
- _this.releaseParams.bigTypeId = data.bigTypeId;
|
|
|
- _this.releaseParams.smallTypeId =data.smallTypeId;
|
|
|
- _this.releaseParams.tinyTypeId =data.tinyTypeId;
|
|
|
- _this.releaseParams.firstClassifyName = data.bigTypeName;
|
|
|
- _this.releaseParams.twoClassifyName = data.smallTypeName;
|
|
|
- _this.releaseParams.threeClassifyName = data.tinyTypeName;
|
|
|
- _this.releaseParams.commodityType =data.commodityType;
|
|
|
- _this.releaseParams.brandName = data.brandName;
|
|
|
- _this.GoodsImagesList = _this.EchoGoodsImagesListFn(data.imageList);
|
|
|
- _this.classificationTwoList = data.smallTypeName;
|
|
|
- _this.classificationThreeList = data.tinyTypeName;
|
|
|
- if(data.commodityType !=null||data.commodityType != ''){
|
|
|
- _this.releaseParams.commodityType = data.commodityType;
|
|
|
- _this.GetFistClassFn(data.commodityType);
|
|
|
- }
|
|
|
- if(_this.classificationTwoList!=''){
|
|
|
- _this.GetTwoClassFn(data.bigTypeID);
|
|
|
- }
|
|
|
- if (_this.classificationThreeList){
|
|
|
- _this.GetThreeClassFn(data.smallTypeID);
|
|
|
- }
|
|
|
- if(data.searchKey != null){
|
|
|
- _this.setSearchKeyArray(data.searchKey);
|
|
|
- }
|
|
|
- if(data.parametersList == ''){
|
|
|
- _this.paramKeyList = [{paramsName:'',paramsContent:''}];
|
|
|
- }else{
|
|
|
- _this.paramKeyList = data.parametersList;
|
|
|
- }
|
|
|
- // 下拉列表初始化
|
|
|
- setTimeout(function(){
|
|
|
- _this.ChangeClassificationFirst({bigTypeId:data.bigTypeId, name:data.bigTypeName});
|
|
|
- setTimeout(function(){
|
|
|
- _this.ChangeClassificationTwo({smallTypeId:data.smallTypeId, name:data.smallTypeName});
|
|
|
- setTimeout(function(){
|
|
|
- _this.ChangeClassificationThree({tinyTypeId:data.tinyTypeId, name:data.tinyTypeName});
|
|
|
- },500);
|
|
|
- },500);
|
|
|
- },500);
|
|
|
- }else{
|
|
|
- CAIMEI.Alert(response.msg, '确定', false);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
getclass:function(val){
|
|
|
this.selectText.bigTypeID='请选择一级分类';
|
|
|
this.selectText.smallTypeID = '请选择二级分类';
|
|
@@ -243,32 +131,6 @@ var releaseContainer = new Vue({
|
|
|
this.classificationThreeList =[];
|
|
|
this.GetFistClassFn(val);
|
|
|
},
|
|
|
- EchoProductFn : function(type) {
|
|
|
- switch (type) {
|
|
|
- case 0 && null:
|
|
|
- this.selectText.goodsType = '其他';
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- this.selectText.goodsType = '妆字号';
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- this.selectText.goodsType = '械字号';
|
|
|
- break;
|
|
|
- }
|
|
|
- },
|
|
|
- EchoMachineTypeFn : function(type) {
|
|
|
- switch (type) {
|
|
|
- case 1 && null:
|
|
|
- this.selectText.apparatusType = '一类医疗器械';
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- this.selectText.apparatusType = '二类医疗器械';
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- this.selectText.apparatusType = '三类医疗器械';
|
|
|
- break;
|
|
|
- }
|
|
|
- },
|
|
|
choiceTrain : function(val){
|
|
|
var _this = this;
|
|
|
_this.releaseParams.trainType = Number(val);
|
|
@@ -277,11 +139,6 @@ var releaseContainer = new Vue({
|
|
|
var _this = this;
|
|
|
_this.releaseParams.expensesType = Number(val);
|
|
|
},
|
|
|
- EchoGoodsImagesListFn: function(arr){//处理商品主图回显
|
|
|
- var newArray =[];
|
|
|
- arr.forEach( function(el){ newArray.push(el.image) });
|
|
|
- return newArray;
|
|
|
- },
|
|
|
touchmoveFn: function(){
|
|
|
this.isSelectActive =0;
|
|
|
},
|
|
@@ -408,83 +265,6 @@ var releaseContainer = new Vue({
|
|
|
_this.isBrandAssociation = false;
|
|
|
_this.vShow_BrandID = false;
|
|
|
},
|
|
|
- GetFistClassFn: function(val){//获取一级分类菜单
|
|
|
- var _this = this;
|
|
|
- PublicApi.GetFirstClassFication({typeSort:val},function (response) {
|
|
|
- if(response.code == 0){
|
|
|
- _this.classificationFirstList = response.data;
|
|
|
- }else{
|
|
|
- CAIMEI.Alert(response.msg, '确定', false);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- GetTwoClassFn: function(value){//获取二级分类菜单
|
|
|
- var _this = this;
|
|
|
- PublicApi.GetTwoClassFication({bigTypeId:value},function (response) {
|
|
|
- if(response.code == 0){
|
|
|
- if(response.data.length>0){
|
|
|
- _this.classificationTwoList = response.data;
|
|
|
- }else {
|
|
|
- _this.classificationTwoList = [];
|
|
|
- _this.releaseParams.twoClassifyName = '';
|
|
|
- _this.releaseParams.smallTypeId = ''
|
|
|
- }
|
|
|
- }else{
|
|
|
- CAIMEI.Alert(response.msg, '确定', false);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- GetThreeClassFn: function(value){//获取三级分类菜单
|
|
|
- var _this = this;
|
|
|
- PublicApi.GetThreeClassFication({smallTypeId:value},function (response) {
|
|
|
- if(response.code == 0){
|
|
|
- if(response.data.length>0){
|
|
|
- _this.classificationThreeList = response.data;
|
|
|
- }else {
|
|
|
- _this.releaseParams.threeClassifyName = '';
|
|
|
- _this.classificationThreeList = [];
|
|
|
- _this.releaseParams.tinyTypeId = ''
|
|
|
- }
|
|
|
- }else{
|
|
|
- CAIMEI.Alert(response.msg, '确定', false);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- ChangeClassificationFirst: function(option){//选择一级分类
|
|
|
- var _this = this;
|
|
|
- _this.selectText.bigTypeID = option.name;
|
|
|
- _this.releaseParams.firstClassifyName = option.name;
|
|
|
- _this.releaseParams.bigTypeId = option.bigTypeId
|
|
|
- _this.selectText.smallTypeID='请选择二级分类';
|
|
|
- _this.selectText.tinyTypeID = '请选择三级分类';
|
|
|
- _this.releaseParams.smallTypeId ='';
|
|
|
- _this.releaseParams.tinyTypeId ='';
|
|
|
- _this.classificationTwoList=[];
|
|
|
- _this.classificationThreeList =[];
|
|
|
- _this.isSelectActive = 0;
|
|
|
- if(_this.releaseParams.bigTypeId!=''){
|
|
|
- _this.GetTwoClassFn(option.bigTypeId);
|
|
|
- }
|
|
|
- },
|
|
|
- ChangeClassificationTwo: function(option){//选择二级分类
|
|
|
- var _this = this;
|
|
|
- if(!option.smallTypeId){_this.isSelectActive = 0; return;}
|
|
|
- _this.selectText.smallTypeID = option.name;
|
|
|
- _this.selectText.tinyTypeID = '请选择三级分类';
|
|
|
- _this.releaseParams.smallTypeId = option.smallTypeId;
|
|
|
- _this.releaseParams.twoClassifyName = option.name;
|
|
|
- _this.isSelectActive = 0;
|
|
|
- _this.GetThreeClassFn(option.smallTypeId);
|
|
|
- },
|
|
|
- ChangeClassificationThree: function(option){//选择三级分类
|
|
|
- var _this = this;
|
|
|
- if(!option.tinyTypeId){_this.isSelectActive = 0; return;}
|
|
|
- _this.releaseParams.tinyTypeId = option.tinyTypeId;
|
|
|
- _this.selectText.tinyTypeID = option.name;
|
|
|
- _this.releaseParams.threeClassifyName = option.name;
|
|
|
- _this.isSelectActive = 0;
|
|
|
- _this.vShow_TinyTypeID = false;
|
|
|
- },
|
|
|
addTag:function(){//添加标签
|
|
|
var _this = this;
|
|
|
if(_this.tagsText == ''){
|
|
@@ -679,336 +459,6 @@ var releaseContainer = new Vue({
|
|
|
return;
|
|
|
}
|
|
|
},
|
|
|
- PrevStep: function(){//返回上一步
|
|
|
- this.activeNum--;
|
|
|
- this.scrollIntoView();
|
|
|
- },
|
|
|
- NextStep: function(){//进入第二步
|
|
|
- var _this = this;
|
|
|
- var KeyString = '',TagString='';
|
|
|
- console.log(_this.releaseParams);
|
|
|
- if(_this.releaseParams.name == ''){
|
|
|
- _this.vShow_Name = true;
|
|
|
- _this.fromMessage = '请输入商品显示名';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_Name = false;
|
|
|
- },2000);
|
|
|
- return
|
|
|
- }
|
|
|
- if(_this.releaseParams.aliasName == ''){
|
|
|
- _this.vShow_AliasName = true;
|
|
|
- _this.fromMessage = '请输入内部商品名';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_AliasName = false;
|
|
|
- },2000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.commodityType == ''){
|
|
|
- _this.vShow_attribute=true;
|
|
|
- _this.fromMessage = '请选择商品属性';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_attribute = false;
|
|
|
- },2000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.commodityType == 2){
|
|
|
- if(_this.releaseParams.trainingMethod == 0){
|
|
|
- _this.vShow_trainingMethod=true;
|
|
|
- _this.fromMessage = '请选择培训方式';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_trainingMethod = false;
|
|
|
- },2000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.trainingType == 0){
|
|
|
- _this.vShow_trainingType=true;
|
|
|
- _this.fromMessage = '请选择培训费用';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_trainingType = false;
|
|
|
- },2000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.trainingType == 1){
|
|
|
- if(_this.releaseParams.trainingFee == ''){
|
|
|
- _this.vShow_trainingType=true;
|
|
|
- _this.fromMessage = '请填写包含食宿,交通等各项费用的培训总金额';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_trainingType = false;
|
|
|
- },2000);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if(_this.releaseParams.bigTypeId == ''){
|
|
|
- _this.vShow_TinyTypeID = true;
|
|
|
- _this.fromMessage = '请选择商品分类';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_TinyTypeID = false;
|
|
|
- },2000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.classificationTwoList!=''&& _this.classificationTwoList!=null){
|
|
|
- if(_this.releaseParams.smallTypeId == ''){
|
|
|
- _this.vShow_TinyTypeID = true;
|
|
|
- _this.fromMessage = '请选择二级分类';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_TinyTypeID = false;
|
|
|
- },2000);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- if(_this.classificationThreeList!='' && _this.classificationThreeList!=null){
|
|
|
- if(_this.releaseParams.tinyTypeId == ''){
|
|
|
- _this.vShow_TinyTypeID = true;
|
|
|
- _this.fromMessage = '请选择三级分类';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_TinyTypeID = false;
|
|
|
- },2000);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- if(_this.releaseParams.brandId == ''){
|
|
|
- _this.vShow_BrandID = true;
|
|
|
- _this.fromMessage = '请选择商品品牌';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_BrandID = false;
|
|
|
- },2000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.productType === ""){
|
|
|
- _this.vShow_GoodsType = true;
|
|
|
- _this.fromMessage = '请选择商品类型';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_GoodsType = false;
|
|
|
- },2000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.productType == 2){
|
|
|
- if(_this.releaseParams.machineType == ''){
|
|
|
- _this.vShow_GoodsType = true;
|
|
|
- _this.fromMessage = '请选择器械类型';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_GoodsType = false;
|
|
|
- },3000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.qualificationImg == ''){
|
|
|
- _this.vShow_QualificationImg = true;
|
|
|
- _this.fromMessage = '请上传资质图片';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_QualificationImg = false;
|
|
|
- },3000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.qualificationNo == ''){
|
|
|
- _this.vShow_QualificationNo = true;
|
|
|
- _this.fromMessage = '请输入证书编号';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_QualificationNo = false;
|
|
|
- },3000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.productName == ''){
|
|
|
- _this.vShow_ProductName = true;
|
|
|
- _this.fromMessage = '请输入产品名称';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_ProductName = false;
|
|
|
- },3000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.qualificationTime == ''){
|
|
|
- _this.vShow_QualificationTime = true;
|
|
|
- _this.fromMessage = '请选择证书有效期';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_QualificationTime = false;
|
|
|
- },3000);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- //商品标签
|
|
|
- if(_this.tagsList =='') {
|
|
|
- _this.vShow_Tags = true;
|
|
|
- _this.fromMessage = '请添加商品标签';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_Tags = false;
|
|
|
- },3000);
|
|
|
- return;
|
|
|
- }else{
|
|
|
- _this.tagsList.forEach(function(el){
|
|
|
- TagString += el.tag+',';
|
|
|
- });
|
|
|
- _this.releaseParams.tags = TagString.substring(0, TagString.lastIndexOf(','));
|
|
|
- }
|
|
|
- if(_this.releaseParams.unit == ''){
|
|
|
- _this.vShow_Unit = true;
|
|
|
- _this.fromMessage = '请输入包装规格';
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_Unit = false;
|
|
|
- },3000);
|
|
|
- _this.scrollIntoView();
|
|
|
- return;
|
|
|
- }
|
|
|
- //搜索关键词
|
|
|
- if(_this.searchKeyList!=''){
|
|
|
- _this.searchKeyList.forEach(function(el){
|
|
|
- KeyString+=el.value+',';
|
|
|
- });
|
|
|
- _this.releaseParams.searchKey = KeyString.substring(0, KeyString.lastIndexOf(','));
|
|
|
- }
|
|
|
- if( _this.paramKeyList[0].paramsName == ''){
|
|
|
- _this.params.param = [];
|
|
|
- }else{
|
|
|
- _this.params.param = _this.paramKeyList;
|
|
|
- }
|
|
|
- _this.activeNum++;
|
|
|
- _this.scrollIntoView();
|
|
|
- },
|
|
|
- NextStep1: function(){//进入第三步
|
|
|
- var _this = this;
|
|
|
- if(_this.releaseParams.normalPrice == ''){
|
|
|
- _this.vShow_NormalPrice = true;
|
|
|
- _this.fromMessage = '请输入市场价';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_NormalPrice = false;
|
|
|
- },3000);
|
|
|
- return
|
|
|
- }
|
|
|
- if(_this.releaseParams.normalPrice == 0){
|
|
|
- _this.vShow_NormalPrice = true;
|
|
|
- _this.fromMessage = '市场价不能为0';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_NormalPrice = false;
|
|
|
- },3000);
|
|
|
- return
|
|
|
- }
|
|
|
- if(_this.releaseParams.price == ''){
|
|
|
- _this.vShow_price = true;
|
|
|
- _this.fromMessage = '请输入售价';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_price = false;
|
|
|
- },3000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.price == 0){
|
|
|
- _this.vShow_price = true;
|
|
|
- _this.fromMessage = '售价不能为0';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_price = false;
|
|
|
- },3000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.includedTax == 3){
|
|
|
- _this.vShow_includedTax = true;
|
|
|
- _this.fromMessage = '请选择是否含税';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_includedTax = false;
|
|
|
- },3000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.minBuyNumber === ''){
|
|
|
- _this.vShow_MinBuyNumber = true;
|
|
|
- _this.fromMessage = '请输入起订量';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_MinBuyNumber = false;
|
|
|
- },3000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.stock === ''){
|
|
|
- _this.vShow_Stock = true;
|
|
|
- _this.fromMessage = '请输入库存';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_Stock = false;
|
|
|
- },3000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.minBuyNumber > _this.releaseParams.stock){
|
|
|
- _this.vShow_MinBuyNumber = true;
|
|
|
- _this.fromMessage = '起订量不能大于库存';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_MinBuyNumber = false;
|
|
|
- },3000);
|
|
|
- return;
|
|
|
- }
|
|
|
- if(_this.releaseParams.areaFlag == '0'){
|
|
|
- _this.ProvinceList.forEach(function(el){
|
|
|
- if(el.isChecked){
|
|
|
- _this.releaseParams.provinceIds+=el.provinceID+',';
|
|
|
- }
|
|
|
- });
|
|
|
- if(_this.releaseParams.provinceIds == ''){
|
|
|
- _this.vShow_isProvince = true;
|
|
|
- _this.fromMessage = '请选择指定区域';
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_isProvince = false;
|
|
|
- },3000);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- _this.activeNum++;
|
|
|
- _this.scrollIntoView();
|
|
|
- if(_this.vShow_detailInfoEditor){
|
|
|
- _this.initCKeditor();
|
|
|
- }
|
|
|
- },
|
|
|
- NextStep2: function() {//点击进入第四步
|
|
|
- var _this = this;
|
|
|
- var detailInfo= detailInfoEditor.getData();
|
|
|
- _this.releaseParams.detailInfo = detailInfo;
|
|
|
- if(_this.GoodsImagesList ==''){
|
|
|
- CAIMEI.dialog('请上传商品图片');
|
|
|
- return;
|
|
|
- }
|
|
|
- if( _this.releaseParams.detailInfo ==''){
|
|
|
- CAIMEI.dialog('请填写商品详情');
|
|
|
- return;
|
|
|
- }
|
|
|
- _this.params.image = [];
|
|
|
- _this.GoodsImagesList.forEach(function(el,index){
|
|
|
- var imageObject = {};
|
|
|
- if(index == 0 ){
|
|
|
- imageObject = {productImageId:'',image:el,mainFlag:'1'};
|
|
|
- }else{
|
|
|
- imageObject = {productImageId:'',image:el,mainFlag:'0'};
|
|
|
- }
|
|
|
- _this.params.image.push(imageObject);
|
|
|
- });
|
|
|
- _this.activeNum++;
|
|
|
- _this.scrollIntoView();
|
|
|
- if(_this.vShow_orderInfoEditor){
|
|
|
- _this.initOrderCKeditor();
|
|
|
- _this.initSeverCKeditor();
|
|
|
- }
|
|
|
- },
|
|
|
- NextStep3: function() {//点击进入5步
|
|
|
- var _this = this;
|
|
|
- _this.activeNum++;
|
|
|
- _this.scrollIntoView();
|
|
|
- },
|
|
|
initCKeditor: function(){//富文本
|
|
|
var _this = this;
|
|
|
_this.vShow_detailInfoEditor = false;
|
|
@@ -1057,164 +507,22 @@ var releaseContainer = new Vue({
|
|
|
});
|
|
|
},
|
|
|
addReleaseGoodSubmitFn: function(){//提交发布商品
|
|
|
- var _this = this;
|
|
|
- if(_this.releaseParams.newProductType === 0){
|
|
|
- _this.vShow_isNewProductType = true;
|
|
|
- _this.fromMessage = '请选择是否参与新品展示';
|
|
|
- _this.scrollIntoView();
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_isNewProductType = false;
|
|
|
- },3000);
|
|
|
- return;
|
|
|
- }
|
|
|
- _this.releaseParams.orderInfo = orderInfoEditor.getData();
|
|
|
- _this.releaseParams.serviceInfo = severInfoEditor.getData();
|
|
|
- if(_this.releaseType == 'edit'){
|
|
|
- _this.releaseParams.productDetailInfoId = _this.productDetailInfoId;
|
|
|
- _this.releaseParams.productId = _this.productId;
|
|
|
- CAIMEI.returnedTarget();
|
|
|
- _this.releaseParams = Object.assign(_this.releaseParams,{params:JSON.stringify(_this.params)});
|
|
|
- delete _this.releaseParams.imageList;
|
|
|
- delete _this.releaseParams.parametersList;
|
|
|
- delete _this.releaseParams.productDetail;
|
|
|
- }else{
|
|
|
- CAIMEI.returnedTarget();
|
|
|
- _this.releaseParams = Object.assign(_this.releaseParams,{params:JSON.stringify(_this.params)});
|
|
|
- }
|
|
|
- // console.log( _this.releaseParams);
|
|
|
- SupplierApi.AddSupplierReleaseProduct(_this.releaseParams,function(response){
|
|
|
- if(response.code == 0){
|
|
|
- CAIMEI.dialog('提交成功,等待审核',true,function () {
|
|
|
- if(_this.releaseType == 'edit'){
|
|
|
- SupplierApi.UpdateSearchManageProduct({productId:_this.productId},function (res) {
|
|
|
- console.log('编辑商品更新搜索索引~~~成功');
|
|
|
- })
|
|
|
- }
|
|
|
- location.href = '/supplier/goods.html';
|
|
|
- if(CAIMEI.Storage.getItem('adProductPeview')){
|
|
|
- CAIMEI.Storage.removeItem('adProductPeview');
|
|
|
- }
|
|
|
- });
|
|
|
- }else{
|
|
|
- CAIMEI.Alert(response.msg, '确定', false);
|
|
|
- }
|
|
|
- });
|
|
|
+ this.addSupplierReleaseInfo();
|
|
|
},
|
|
|
addReleasePeview: function(){//预览按钮
|
|
|
var _this = this;
|
|
|
CAIMEI.returnedTarget();
|
|
|
- _this.releaseParams.orderInfo = orderInfoEditor.getData();
|
|
|
- _this.releaseParams.serviceInfo = severInfoEditor.getData();
|
|
|
- _this.releaseParams = Object.assign(_this.releaseParams,{params:_this.params});
|
|
|
+ this.releaseParams.orderInfo = orderInfoEditor.getData();
|
|
|
+ this.releaseParams.serviceInfo = severInfoEditor.getData();
|
|
|
+ this.releaseParams = Object.assign(_this.releaseParams,{params:_this.params,skus:_this.skuParams});
|
|
|
CAIMEI.Storage.setItem('adProductPeview', JSON.stringify(_this.releaseParams));
|
|
|
setTimeout(function(){
|
|
|
window.open('/supplier/goods/preview.html');
|
|
|
},1000)
|
|
|
},
|
|
|
- blur_name: function(e){//商品名失去焦点
|
|
|
- var _this = this;
|
|
|
- _this.vShow_Name = false;
|
|
|
- if(e.target.value == ''){
|
|
|
- _this.vShow_Name = true;
|
|
|
- _this.fromMessage = '请输入商品显示名';
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_Name = false;
|
|
|
- },3000);
|
|
|
- }else{
|
|
|
- _this.vShow_Name = false;
|
|
|
- }
|
|
|
- },
|
|
|
- blur_aliasName: function(e){//内部商品名失去焦点
|
|
|
- var _this = this;
|
|
|
- _this.vShow_AliasName = false;
|
|
|
- if(e.target.value == ''){
|
|
|
- _this.vShow_AliasName = true;
|
|
|
- _this.fromMessage = '请输入内部商品名';
|
|
|
- setTimeout(function(){
|
|
|
- _this.vShow_AliasName = false;
|
|
|
- },3000);
|
|
|
- }else{
|
|
|
- _this.vShow_AliasName = false;
|
|
|
- }
|
|
|
- },
|
|
|
- blur_taxPoint: function(event){
|
|
|
- var E_TaxPoint = event.target.value;
|
|
|
- if(E_TaxPoint!=''){
|
|
|
- this.releaseParams.taxPoint = parseFloat(E_TaxPoint);
|
|
|
- }else{
|
|
|
- this.releaseParams.taxPoint = '';
|
|
|
- }
|
|
|
- this.vShow_taxPoint = false;
|
|
|
- },
|
|
|
- blur_tags: function(e){
|
|
|
- this.vShow_Tags = false;
|
|
|
- },
|
|
|
- blur_aliasUnit: function(e){
|
|
|
- this.vShow_Unit = false;
|
|
|
- },
|
|
|
- blur_qualificationNo: function(e){
|
|
|
- this.vShow_QualificationNo = false;
|
|
|
- },
|
|
|
- blur_productName: function(e){
|
|
|
- this.vShow_ProductName = false;
|
|
|
- },
|
|
|
- input_normalPrice: function(e){
|
|
|
- this.vShow_NormalPrice = false;
|
|
|
- },
|
|
|
- input_price: function(e){
|
|
|
- this.vShow_price = false;
|
|
|
- },
|
|
|
- input_trainingFee: function(event){
|
|
|
- var E_Number = event.target.value;
|
|
|
- if(E_Number!=''){
|
|
|
- this.releaseParams.trainingFee = parseInt(E_Number.replace(/[^0-9]/g,''));
|
|
|
- }else{
|
|
|
- this.releaseParams.trainingFee = '';
|
|
|
- }
|
|
|
- },
|
|
|
- input_minBuyNumber: function(event){
|
|
|
- this.vShow_MinBuyNumber = false;
|
|
|
- var E_Number = event.target.value;
|
|
|
- if(E_Number!=''){
|
|
|
- this.releaseParams.minBuyNumber = parseInt(E_Number.replace(/[^0-9]/g,''));
|
|
|
- }else{
|
|
|
- this.releaseParams.minBuyNumber = '';
|
|
|
- }
|
|
|
- },
|
|
|
- input_stock: function(event){
|
|
|
- this.vShow_Stock = false;
|
|
|
- var E_stock = event.target.value;
|
|
|
- if(E_stock!=''){
|
|
|
- this.releaseParams.stock = parseInt(E_stock.replace(/[^0-9]/g,''));
|
|
|
- }else{
|
|
|
- this.releaseParams.stock = '';
|
|
|
- }
|
|
|
- },
|
|
|
- toFixedFn: function(text){
|
|
|
- return Number(text).toFixed(2);
|
|
|
- },
|
|
|
scrollIntoView: function(){
|
|
|
document.getElementById('releaseContainer').scrollIntoView({block: 'start', behavior: 'smooth'});
|
|
|
},
|
|
|
- setTagArray: function(arr){//回显处理商品标签
|
|
|
- var arrSplit = arr.split(',');
|
|
|
- var _ARRAY = [];
|
|
|
- arrSplit.forEach(function(item){
|
|
|
- var _OBJ = {tag:item};
|
|
|
- _ARRAY.push(_OBJ)
|
|
|
- });
|
|
|
- return _ARRAY
|
|
|
- },
|
|
|
- setSearchKeyArray: function(arr){//回显处理商品搜索关键词
|
|
|
- var _this = this;
|
|
|
- var arrSplit = arr.split(',');
|
|
|
- return _this.searchKeyList.map(function(el,index){
|
|
|
- el.value = arrSplit[index] || '';
|
|
|
- })
|
|
|
- },
|
|
|
- gernerateTitleId: function(index){
|
|
|
- return "title_" +index
|
|
|
- },
|
|
|
dragstart: function(value) { // 记录初始信息
|
|
|
this.oldNum = value;
|
|
|
},
|
|
@@ -1243,14 +551,6 @@ var releaseContainer = new Vue({
|
|
|
var _this = this;
|
|
|
var NODE_ENV_BASE_URL = $('#coreServer').val();
|
|
|
_this.NODE_ENV_BASE_URL = NODE_ENV_BASE_URL;
|
|
|
- if(globalUserData){
|
|
|
- _this.releaseParams.shopId = globalUserData.shopId;
|
|
|
- _this.releaseParams.userId = globalUserData.userId;
|
|
|
- _this.releaseType = CAIMEI.getUrlParam('type');
|
|
|
- if( _this.releaseType == 'edit'){
|
|
|
- _this.productId = Number(CAIMEI.getUrlParam('productId'));
|
|
|
- _this.GetEditReleaseProductInfo(_this.productId);
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
});
|