Commit a1a30795 authored by home's avatar home

zxf

parent a7480613
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
console.info(this.value,imageIndex); console.info(this.value,imageIndex);
let arr = this.value.map((item,index)=>{ let arr = this.value.map((item,index)=>{
return this.staticUrl1 +item.data; return this.staticUrl1 + item.data;
}) })
uni.previewImage({ uni.previewImage({
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
//"appid" : "__UNI__FC9419E", //"appid" : "__UNI__FC9419E",
"appid" : "__UNI__1EA80F1", //这个是 web "appid" : "__UNI__1EA80F1", //这个是 web
"description" : "商家", "description" : "商家",
"versionName" : "1.0.88", "versionName" : "1.0.89",
"versionCode" : 188, "versionCode" : 189,
"transformPx" : false, "transformPx" : false,
/* 5+App特有相关 */ /* 5+App特有相关weex */
"app-plus" : { "app-plus" : {
"usingComponents" : true, "usingComponents" : true,
"nvueCompiler" : "weex", "nvueCompiler" : "uni-app",
"splashscreen" : { "splashscreen" : {
"alwaysShowBeforeRender" : false, "alwaysShowBeforeRender" : false,
"waiting" : false, "waiting" : false,
...@@ -115,9 +115,9 @@ ...@@ -115,9 +115,9 @@
}, },
"splashscreen" : { "splashscreen" : {
"android" : { "android" : {
"hdpi" : "C:/Users/Administrator/Desktop/证书/d0abce82961b508e6a0b9924d15fe86.png", "hdpi" : "C:/Users/Administrator/Desktop/da/DefaultLaunch640_1136.png",
"xhdpi" : "C:/Users/Administrator/Desktop/证书/d0abce82961b508e6a0b9924d15fe86.png", "xhdpi" : "C:/Users/Administrator/Desktop/da/DefaultLaunch750_1334.png",
"xxhdpi" : "C:/Users/Administrator/Desktop/证书/d0abce82961b508e6a0b9924d15fe86.png" "xxhdpi" : "C:/Users/Administrator/Desktop/da/DefaultLaunch1125_2436.png"
}, },
"ios" : { "ios" : {
"iphone" : { "iphone" : {
......
<template> <template>
<!-- 添加外卖商品 --> <!-- 添加外卖商品 -->
<view class="productpages"> <view class="productpages">
<view class="flexv ali-c" style="padding: 30upx 0 0 0;">
<view class="flexv ali-c" style="padding: 30upx 0 0 0;" :hidden="linkage_product_id != 0 " v-if="is_bld == 1 && is_datashow">
<image class="mb-20 img" @tap="saoma" src="/static/icon/saoma.png"></image> <image class="mb-20 img" @tap="saoma" src="/static/icon/saoma.png"></image>
<view>扫码入库</view> <view>扫码入库</view>
</view> </view>
<!-- <view class="noecellbox">
<view class="title" >关联产品 </view>
<view class="inputbox flex">
<input class="input flex1" type="text" v-model="" value="" placeholder-class="plclass" placeholder="请填写产品名称" />
</view>
</view> -->
<view class="noecellbox">
<view class="title" >关联产品 </view>
<view class="inputbox flex">
<picker mode="multiSelector" :value="classDataValue" :range="classData" @change="bindData" @columnchange="columnbindData">
<input disabled="true" class="input flex1" type="text" v-model="classValue" placeholder-class="plclass" placeholder="请选择关联产品" />
</picker>
</view>
</view>
<view class="noecellbox">
<view class="title" >产品规格(kg或个) </view>
<view class="inputbox flex">
<input class="input flex1" type="text" value="" v-model="form.specifications" placeholder-class="plclass" placeholder="请填写产品规格" />
</view>
</view>
<view class="noecellbox"> <view class="noecellbox">
<view class="title" >产品名称 <text style="color: red;">(必填)</text></view> <view class="title" >产品名称 <text style="color: red;">(必填)</text></view>
<view class="inputbox flex"> <view class="inputbox flex">
<input class="input flex1" type="text" v-model="form.product_name" value="" placeholder-class="plclass" placeholder="请填写产品名称" /> <input class="input flex1" type="text" v-model="form.product_name" value="" placeholder-class="plclass" placeholder="请填写产品名称" />
</view> </view>
</view> </view>
...@@ -31,128 +55,129 @@ ...@@ -31,128 +55,129 @@
original_name 原始商品名 original_name 原始商品名
--> -->
<!-- 2020-10-12 --> <!-- 2020-10-12 -->
<view class="noecellbox"> <view class="" :hidden="linkage_product_id != 0 " v-if="is_bld == 1 && is_datashow">
<view class="title">售卖类型</view> <!-- <view class="noecellbox">
<view class="inputbox flex"> <view class="title">售卖类型</view>
<radio-group @change="radioChange"> <view class="inputbox flex">
<view class="chindlost ali-c flex flex-wrap" > <radio-group @change="radioChange">
<view class="" v-for="(item, index) in sellType" :key="item.value"> <view class="chindlost ali-c flex flex-wrap" >
<label class="lableitem flex ali-c" > <view class="" v-for="(item, index) in sellType" :key="item.value">
<view> <label class="lableitem flex ali-c" >
<radio color="#FF6900" :value="item.value" :checked="item.value == form.sell_type" /> <view>
</view> <radio color="#FF6900" :value="item.value" :checked="item.value == form.sell_type" />
<view class="titles">{{item.name}}</view> </view>
</label> <view class="titles">{{item.name}}</view>
</label>
</view>
</view>
</radio-group>
</view>
</view> -->
<view class="noecellbox" v-if="isadd==1">
<view class="title">商品库存(库存剩余{{form.stock}})</view>
<view class="inputbox flex">
<radio-group @change="radioChanges">
<view class="chindlost ali-c flex flex-wrap" >
<view class="" style="margin-right: 20rpx;" v-for="(item, index) in storeNumber" :key="item.value">
<label class="lableitem flex ali-c" >
<view>
<radio color="#FF6900" :value="item.value" :checked="item.checked == 1" />
</view>
<view class="titles">{{item.name}}</view>
</label>
</view>
</view> </view>
</radio-group>
</view> 数量:<input class="input flex1" v-if="" @input="bingInput" type="number" v-model="stock_number" value="" placeholder-class="plclass" placeholder="增加库存数量" />
</view>
</radio-group>
</view> </view>
</view> <view class="noecellbox" v-if="isadd==0">
<view class="title">商品库存</view>
<view class="inputbox flex">
<view class="noecellbox" v-if="isadd==1"> <input class="input flex1" v-if="" type="number" v-model="stock_number" value="" placeholder-class="plclass" placeholder="增加库存数量" />
<view class="title">商品库存(库存剩余{{form.stock}})</view> </view>
<view class="inputbox flex">
<radio-group @change="radioChanges">
<view class="chindlost ali-c flex flex-wrap" >
<view class="" style="margin-right: 20rpx;" v-for="(item, index) in storeNumber" :key="item.value">
<label class="lableitem flex ali-c" >
<view>
<radio color="#FF6900" :value="item.value" :checked="item.checked == 1" />
</view>
<view class="titles">{{item.name}}</view>
</label>
</view>
</view>
</radio-group>
数量:<input class="input flex1" v-if="" @input="bingInput" type="number" v-model="stock_number" value="" placeholder-class="plclass" placeholder="增加库存数量" />
</view>
</view>
<view class="noecellbox" v-if="isadd==0">
<view class="title">商品库存</view>
<view class="inputbox flex">
<input class="input flex1" v-if="" type="number" v-model="stock_number" value="" placeholder-class="plclass" placeholder="增加库存数量" />
</view> </view>
</view>
<view class="noecellbox" v-if="codeDisabled" >
<view class="noecellbox" v-if="codeDisabled" > <view class="title">条形编码</view>
<view class="title">条形编码</view> <view class="inputbox flex">
<view class="inputbox flex"> <input class="input flex1" type="number" :disabled='codeDisabled' @tap="onCodeFocus" :value="form.code" placeholder-class="plclass" placeholder="请填写条形编码" />
<input class="input flex1" type="number" :disabled='codeDisabled' @tap="onCodeFocus" :value="form.code" placeholder-class="plclass" placeholder="请填写条形编码" /> </view>
</view> </view>
</view>
<view class="noecellbox" v-if="!codeDisabled">
<view class="noecellbox" v-if="!codeDisabled"> <view class="title">条形编码 <text style="color: #808080;">(称重商品编码1-4000)</text></view>
<view class="title">条形编码</view> <view class="inputbox flex">
<view class="inputbox flex"> <input class="input flex1" type="number" v-model="form.code" @tap="onCodeFocus" value="" placeholder-class="plclass" placeholder="请填写条形编码" />
<input class="input flex1" type="number" v-model="form.code" @tap="onCodeFocus" value="" placeholder-class="plclass" placeholder="请填写条形编码" /> </view>
</view> </view>
</view>
<view class="noecellbox">
<view class="noecellbox"> <view class="title">返佣比例</view>
<view class="title">返佣比例</view> <view class="inputbox flex">
<view class="inputbox flex"> <input class="input flex1" type="text" v-model="form.commission" value="" placeholder-class="plclass" placeholder="请填写返佣比例" />
<input class="input flex1" type="text" v-model="form.commission" value="" placeholder-class="plclass" placeholder="请填写返佣比例" /> </view>
</view> </view>
</view>
<view class="noecellbox">
<view class="noecellbox"> <view class="title">进货价</view>
<view class="title">进货价</view> <view class="inputbox flex">
<view class="inputbox flex"> <input class="input flex1" type="text" v-model="form.cost_price" value="" placeholder-class="plclass" placeholder="请填写进货价" />
<input class="input flex1" type="text" v-model="form.cost_price" value="" placeholder-class="plclass" placeholder="请填写进货价" /> </view>
</view> </view>
</view> <!--quality_guarantee_period 保质期(月)
<!--quality_guarantee_period 保质期(月) manufacture_date 生产日期
manufacture_date 生产日期 manufacturer 生产厂商
manufacturer 生产厂商 brand 品牌
brand 品牌 -->
--> <view class="noecellbox">
<view class="noecellbox"> <view class="title">生产日期</view>
<view class="title">生产日期</view> <view class="inputbox flex">
<view class="inputbox flex"> <picker mode="date" fields="day" :value="form.manufacture_date" @change="bindDateChange">
<picker mode="date" :value="form.manufacture_date" @change="bindDateChange"> <input disabled="true" class="input flex1" type="text" v-model="form.manufacture_date" value="" placeholder-class="plclass" placeholder="请填写生产日期" />
<input class="input flex1" type="text" v-model="form.manufacture_date" value="" placeholder-class="plclass" placeholder="请填写生产日期" /> <!-- <view class="uni-input">{{date}}</view> -->
<!-- <view class="uni-input">{{date}}</view> --> </picker>
</picker> </view>
</view> </view>
</view>
<view class="noecellbox">
<view class="noecellbox"> <view class="title">保质期</view>
<view class="title">保质期</view> <view class="inputbox flex">
<view class="inputbox flex"> <input class="input flex1" style="text-align: center;" type="number" v-model="qualitYears" value="" placeholder-class="plclass" placeholder="请填写年" />
<input class="input flex1" style="text-align: center;" type="number" v-model="qualitYears" value="" placeholder-class="plclass" placeholder="请填写年" />
<input class="input flex1" style="text-align: center;" type="number" v-model="qualityMonths" value="" placeholder-class="plclass" placeholder="请填写月" />
<input class="input flex1" style="text-align: center;" type="number" v-model="qualityMonths" value="" placeholder-class="plclass" placeholder="请填写月" />
<input class="input flex1" style="text-align: center;" type="number" v-model="qualityDays" value="" placeholder-class="plclass" placeholder="请填写日" />
<input class="input flex1" style="text-align: center;" type="number" v-model="qualityDays" value="" placeholder-class="plclass" placeholder="请填写日" />
</view>
</view> </view>
</view> <view class="noecellbox">
<view class="title">生产厂商</view>
<view class="noecellbox"> <view class="inputbox flex">
<view class="title">生产厂商</view> <input class="input flex1" type="text" v-model="form.manufacturer" value="" placeholder-class="plclass" placeholder="请填写生产厂商" />
<view class="inputbox flex"> </view>
<input class="input flex1" type="text" v-model="form.manufacturer" value="" placeholder-class="plclass" placeholder="请填写生产厂商" />
</view> </view>
</view>
<view class="noecellbox">
<view class="noecellbox"> <view class="title">品牌</view>
<view class="title">品牌</view> <view class="inputbox flex">
<view class="inputbox flex"> <input class="input flex1" type="text" v-model="form.brand" value="" placeholder-class="plclass" placeholder="请填写品牌" />
<input class="input flex1" type="text" v-model="form.brand" value="" placeholder-class="plclass" placeholder="请填写品牌" /> </view>
</view> </view>
</view> </view>
<!-- YYYYY --> <!-- YYYYY -->
<view class="" :hidden="linkage_product_id != 0 " v-if="is_datashow">
<view class="briefIntroduction"> <view class="briefIntroduction">
<view class="title fontColor">产品描述<text style="color: red;">(必填)</text></view> <view class="title fontColor">产品描述<text style="color: red;">(必填)</text></view>
...@@ -184,7 +209,6 @@ ...@@ -184,7 +209,6 @@
</view> </view>
</view> </view>
<view class="addmigs"> <view class="addmigs">
<view class="titlehe">缩略图<text style="color: red;">(必传)</text></view> <view class="titlehe">缩略图<text style="color: red;">(必传)</text></view>
<robby-image-upload <robby-image-upload
...@@ -256,24 +280,38 @@ ...@@ -256,24 +280,38 @@
</picker-view-column> </picker-view-column>
</picker-view> </picker-view>
</view> </view>
</view>
<view class="submitbtn active" @tap="getForm">提交</view> <view class="submitbtn active" @tap="getForm">提交</view>
</view> </view>
</template> </template>
<script> <script>
import QSApp from '@/components/QS-inputs-split/js/app.js'; import QSApp from '@/components/QS-inputs-split/js/app.js';
import {addEditEleProduct,typeManager,eleProductInfo,findEleProduct} from "@/utils/api/api.js"; import {addEditEleProduct,typeManager,eleProductInfo,findEleProduct} from "@/utils/api/api.js";
import{getskipShop,getshopclass} from "@/utils/api/merchant.js";
import robbyImageUpload from '@/components/plan-image-upload/up_img';//上传资质图片组件 import robbyImageUpload from '@/components/plan-image-upload/up_img';//上传资质图片组件
import {getActivityList} from '@/utils/api/merchant.js'; import {getActivityList} from '@/utils/api/merchant.js';
export default { export default {
components:{ components:{
robbyImageUpload robbyImageUpload
}, },
data() { data() {
return { return {
linkage_id:'',
is_datashow:true,
bools:'',
linkage_product_id:'',
classValue:'',
ordinary :[],
weigh :[],
classData:[
['普通商品','称重商品'],
[]
],
classDataValue:[0,0],
is_bld:'',
isadd:0, //0 填写商品库存 1修改库存 isadd:0, //0 填写商品库存 1修改库存
stock_number:'', stock_number:'',
stockType:1, stockType:1,
...@@ -307,7 +345,10 @@ ...@@ -307,7 +345,10 @@
name: 'product', name: 'product',
result:[], result:[],
form: { form: {
//cost_price 成本价 stock 商品库存purchase 进货价钱code 条形编码commission 返佣比例original_name 原始商品名
linkage_id:'',
//cost_price 成本价 stock 商品库存purchase 进货价钱code 条形编码commission 返佣比例original_name 原始商品名
specifications:'',//商品规格
stock:'', //商品库存 stock:'', //商品库存
cost_price:'', //进货价钱 cost_price:'', //进货价钱
code:'' ,//条形编码 code:'' ,//条形编码
...@@ -315,7 +356,7 @@ ...@@ -315,7 +356,7 @@
sell_type:0,// 售卖类型 sell_type:0,// 售卖类型
commodity_data:{}, //原始商品名 commodity_data:{}, //原始商品名
quality_guarantee_period:0, //保质期(月) quality_guarantee_period:0, //保质期(月)
manufacture_date:'2020-10-1' , //生产日期 manufacture_date:'' , //生产日期
manufacturer :'', ///生产厂商 manufacturer :'', ///生产厂商
brand :'', // 品牌 brand :'', // 品牌
checkbox: [],//断选 checkbox: [],//断选
...@@ -361,7 +402,8 @@ ...@@ -361,7 +402,8 @@
cate_name:"", cate_name:"",
index:0, index:0,
isScanCode:true,//是不是点击了扫码 isScanCode:true,//是不是点击了扫码
codeDisabled:false//条形码是否能输入 codeDisabled:false,//条形码是否能输入
update:true
} }
}, },
computed: { computed: {
...@@ -379,9 +421,34 @@ ...@@ -379,9 +421,34 @@
// } // }
}, },
onLoad(opdata) { onLoad(opdata) {
this.isadd = opdata.isadd getskipShop({
type:'bld'
}).then(res=>{
if(res.code == 0){
this.is_bld = res.data.is_bld
// this.is_bld=1
}
})
getshopclass({}).then(res=>{
if(res.code == 0){
console.log(res.data)
this.ordinary = res.data.ordinary
this.weigh = res.data.weigh
this.classData[1] = Array.from(res.data.ordinary)
if(this.ordinary.length!=[]){
for(let i=0;i<res.data.ordinary.length;i++){
this.classData[1][i] = res.data.ordinary[i].product_name
}
}
console.log(this.classData[1])
}
})
console.log(this.isadd,'aaa') this.isadd = opdata.isadd
// console.log(this.isadd,'aaa')
this.c_formData.user_token = this.$store.state.token; this.c_formData.user_token = this.$store.state.token;
this.activity_type = opdata.activity_type, this.activity_type = opdata.activity_type,
this.isShow = this.activity_type==1?true:false this.isShow = this.activity_type==1?true:false
...@@ -397,17 +464,98 @@ ...@@ -397,17 +464,98 @@
} }
this.typeManagerfun(); this.typeManagerfun();
this.getActivityListfun(); //获取数据列表 this.getActivityListfun(); //获取数据列表
// console.log(JSON.parse(opdata.results).data.code,111111111111111111111111111111111)
// let results=JSON.parse(opdata.results);
if(opdata.results){ if(opdata.results){
if(JSON.parse(opdata.results).data.code==1){
let results=JSON.parse(opdata.results);//扫描得到得商品信息 let results=JSON.parse(opdata.results);//扫描得到得商品信息
this.findEleProduct(results); this.findEleProduct(results);
// this.findEleProduct(opdata.results); // this.findEleProduct(opdata.results);
}else{
let results = JSON.parse(opdata.results);
this.form.code = results.code
this.findEleProduct(results)
}
} }
// this.issancodeType = opdata.results.issancodeType // this.issancodeType = opdata.results.issancodeType
// this.isType = opdata.results.isType // this.isType = opdata.results.isType
// console.log(this.isType) // console.log(this.isType)
}, },
methods: { methods: {
columnbindData(e){
// console.log(e,'啊啊啊啊啊')
this.classDataValue[e.detail.column]=e.detail.value;
if(e.detail.column == 0){
if(e.detail.value == 0){
console.log('我滑动到普通商品')
this.$set(this.classData,1,[]);
if(this.ordinary.length!=0){
this.ordinary.map(item=>{
this.classData[1].push(item.product_name);
})
}
console.log(this.classData[1])
}else {
console.log('我滑动到称重商品')
// this.classData[1] = [];
this.$set(this.classData,1,[]);
if(this.weigh.length!=0){
this.weigh.map(item=>{
this.classData[1].push(item.product_name);
})
}
}
}
},
bindData(e){
let that = this
console.log(e)
if(e.detail.value[0] == 0){
console.log(that.ordinary.length,'左边')
if(that.ordinary.length != 0){
that.linkage_id = that.ordinary[e.detail.value[1]].product_id
that.product_id = that.ordinary[e.detail.value[1]].product_id
that.classValue = that.ordinary[e.detail.value[1]].product_name
}else{AZ
uni.showToast({
title:'没有选中商品',
icon:'none'
})
return false;
}
}else{
console.log(that.weigh.length,'右边')
if(that.weigh.length != 0){
that.linkage_id = that.weigh[e.detail.value[1]].product_id
that.product_id = that.weigh[e.detail.value[1]].product_id
that.classValue = that.weigh[e.detail.value[1]].product_name
}else{
uni.showToast({
title:'没有选中商品',
icon:'none'
})
return false;
}
}
that.eleProductInfofun();
this.is_datashow = false;
console.log(this.is_datashow)
},
bingInput(e){ bingInput(e){
let stock_number=e.detail.value; let stock_number=e.detail.value;
this.stock_number=stock_number; this.stock_number=stock_number;
...@@ -435,7 +583,11 @@ ...@@ -435,7 +583,11 @@
}, },
async findEleProduct(results){ async findEleProduct(results){
uni.showLoading({title:'请稍后'}); uni.showLoading({title:'请稍后'});
let res=await findEleProduct({code:results.code}); let res=await findEleProduct({code:results.code});
console.log(res,11111111111111111111111)
uni.hideLoading(); uni.hideLoading();
if(res.code==-1){ //没有就录入 if(res.code==-1){ //没有就录入
this.isadd=0; this.isadd=0;
...@@ -449,6 +601,7 @@ ...@@ -449,6 +601,7 @@
this.form.price=results.data.data.price; this.form.price=results.data.data.price;
this.isScanCode=results.isScanCode; this.isScanCode=results.isScanCode;
this.codeDisabled=false;//条形码输入框是否禁止输入 this.codeDisabled=false;//条形码输入框是否禁止输入
}else if(res.code==0){ //有就把信息展示 }else if(res.code==0){ //有就把信息展示
this.isadd=1; this.isadd=1;
this.form.quality_guarantee_period = res.data.quality_guarantee_period this.form.quality_guarantee_period = res.data.quality_guarantee_period
...@@ -523,7 +676,6 @@ ...@@ -523,7 +676,6 @@
}, },
radioChange(e){ radioChange(e){
// console.log(this.isType) // console.log(this.isType)
this.form.sell_type = e.detail.value this.form.sell_type = e.detail.value
console.log(this.form.sell_type) console.log(this.form.sell_type)
...@@ -581,10 +733,10 @@ ...@@ -581,10 +733,10 @@
let res = await eleProductInfo({ let res = await eleProductInfo({
product_id:this.product_id, product_id:this.product_id,
}); });
console.log(res,'法大师傅大师傅大师傅士大夫大师傅'); // console.log(res,'法大师傅大师傅大师傅士大夫大师傅');
if(res.code==0){ if(res.code==0){
this.linkage_product_id = res.data.linkage_product_id
this.bools = res.data.product_name;
this.defaultinfo = res.data; this.defaultinfo = res.data;
this.form.product_name = res.data.product_name;//名称 this.form.product_name = res.data.product_name;//名称
this.form.desc = res.data.desc;//描述 this.form.desc = res.data.desc;//描述
...@@ -596,24 +748,20 @@ ...@@ -596,24 +748,20 @@
this.form.cate_id = res.data.cate_id;//分类id this.form.cate_id = res.data.cate_id;//分类id
this.form.activity_id = res.data.activity_id//秒杀时段id this.form.activity_id = res.data.activity_id//秒杀时段id
this.form.limit_num = res.data.limit_num this.form.limit_num = res.data.limit_num
// this.classValue = res.data.product_name
this.form.specifications = res.data.gram
// quality_guarantee_period:this.qualitYears*365+this.qualityMonths*30+this.qualityDays, //保质期(月) // quality_guarantee_period:this.qualitYears*365+this.qualityMonths*30+this.qualityDays, //保质期(月)
// manufacture_date:'' , //生产日期 // manufacture_date:'' , //生产日期
// manufacturer :'', ///生产厂商 // manufacturer :'', ///生产厂商
// brand :'', // 品牌 // brand :'', // 品牌
this.form.quality_guarantee_period = res.data.quality_guarantee_period this.form.quality_guarantee_period = res.data.quality_guarantee_period
this.qualitYears = parseInt(res.data.quality_guarantee_period/365) this.qualitYears = parseInt(res.data.quality_guarantee_period/365)
this.qualityMonths = parseInt((res.data.quality_guarantee_period%365)/30) this.qualityMonths = parseInt((res.data.quality_guarantee_period%365)/30)
this.qualityDays = parseInt((res.data.quality_guarantee_period%365)%30) this.qualityDays = parseInt((res.data.quality_guarantee_period%365)%30)
this.form.manufacture_date = res.data.manufacture_date this.form.manufacture_date = res.data.manufacture_date
this.form.manufacturer = res.data.manufacturer this.form.manufacturer = res.data.manufacturer
this.form.brand = res.data.brand this.form.brand = res.data.brand
// 2020-10-22 添加字段 // 2020-10-22 添加字段
this.form.stock = res.data.stock, //商品库存 this.form.stock = res.data.stock, //商品库存
this.form.cost_price = res.data.cost_price/100, //进货价钱 this.form.cost_price = res.data.cost_price/100, //进货价钱
this.form.code = res.data.code , //条形编码 this.form.code = res.data.code , //条形编码
...@@ -621,6 +769,11 @@ ...@@ -621,6 +769,11 @@
this.form.sell_type = res.data.sell_type, // 售卖类型 this.form.sell_type = res.data.sell_type, // 售卖类型
// this.form.commodity_data:{}, //原始商品名 // this.form.commodity_data:{}, //原始商品名
// 2020-10-22 添加字段 // 2020-10-22 添加字段
// this.commodity_type = ordinary
//下拉分类 初始值 //下拉分类 初始值
this.chindformList.forEach((item,index)=>{ this.chindformList.forEach((item,index)=>{
...@@ -628,7 +781,32 @@ ...@@ -628,7 +781,32 @@
this.index =index; this.index =index;
this.cate_name = item.cate_name; this.cate_name = item.cate_name;
} }
}); });
// this.classValue = res.data.product_name
if(res.data.commodity_type == 'ordinary') {
this.ordinary.map(item=>{
if(this.linkage_product_id == item.product_id){
this.classValue = item.product_name
}
})
}else if(res.data.commodity_type == 'weigh'){
console.log(res.data.commodity_type,585555555555555555555555)
this.weigh.map(item=>{
if(this.linkage_product_id == item.product_id){
this.classValue = item.product_name
console.log(this.classValue,item.product_name)
}
console.log(this.classValue)
})
}else{
this.classValue = '';
}
console.log(this.classValue)
//属性选默认值 //属性选默认值
if(res.data.is_new==1){ if(res.data.is_new==1){
...@@ -679,21 +857,24 @@ ...@@ -679,21 +857,24 @@
// quality_guarantee_period = this.qualitYears*365 + this.qualityMonths*30 + this.qualityDays // quality_guarantee_period = this.qualitYears*365 + this.qualityMonths*30 + this.qualityDays
console.log(this.qualitYears*365+this.qualityMonths*30+this.qualityDays*1) // console.log(this.qualitYears*365+this.qualityMonths*30+this.qualityDays*1)
// if(this.c_pics.length == 0){
// this.$api.msg('产品图片未上传');
// }
let can = { let can = {
linkage_id:this.linkage_id,
gram:this.form.specifications, //商品规格
quality_guarantee_period : this.qualitYears*365+this.qualityMonths*30+this.qualityDays*1, //保质期(月) quality_guarantee_period : this.qualitYears*365+this.qualityMonths*30+this.qualityDays*1, //保质期(月)
manufacture_date :this.form.manufacture_date, //生产日期 manufacture_date :this.form.manufacture_date, //生产日期
manufacturer: this.form.manufacturer, ///生产厂商 manufacturer: this.form.manufacturer, ///生产厂商
brand : this.form.brand, // 品牌 brand : this.form.brand, // 品牌
// stock:this.form.stock, //商品库存 // stock:this.form.stock, //商品库存
cost_price:this.form.cost_price, //进货价钱 cost_price:this.form.cost_price, //进货价钱
code:this.form.code,//条形编码 code:this.form.code,//条形编码
sell_type:this.form.sell_type, sell_type:this.form.sell_type,
commission:this.form.commission, //返佣比例 commission:this.form.commission, //返佣比例
commodity_data:this.form.commodity_data, //产品数据 commodity_data:this.form.commodity_data, //产品数据
product_name:this.form.product_name,//产品名称 product_name:this.form.product_name,//产品名称
...@@ -722,8 +903,6 @@ ...@@ -722,8 +903,6 @@
}) })
// if(this.stockType==1){ // if(this.stockType==1){
// console.log(this.stockType,1111111111) // console.log(this.stockType,1111111111)
// can.stock = this.stock_number // can.stock = this.stock_number
// }else{ // }else{
...@@ -742,7 +921,7 @@ ...@@ -742,7 +921,7 @@
}else{ }else{
can.is_hot = 0; can.is_hot = 0;
} }
if(this.product_id!=""){ if(this.product_id!="" && this.is_datashow !=false ){
can.action = "edit"; can.action = "edit";
can.product_id = this.product_id; can.product_id = this.product_id;
} }
...@@ -792,7 +971,7 @@ ...@@ -792,7 +971,7 @@
}, },
//图片上传 //图片上传
c_delImage(e) { c_delImage(e) {
console.log(e,'反对发射点') // console.log(e,'反对发射点')
let arr = [] let arr = []
for (let k in e.allImages) { for (let k in e.allImages) {
arr[k] = e.allImages[k].id arr[k] = e.allImages[k].id
...@@ -810,7 +989,7 @@ ...@@ -810,7 +989,7 @@
}, },
onMove_c(e) { onMove_c(e) {
this.c_pics = e; this.c_pics = e;
console.log(e,'反对法地方') // console.log(e,'反对法地方')
const obj = e const obj = e
for (let index in obj) { for (let index in obj) {
let id = obj[index].data let id = obj[index].data
......
...@@ -147,4 +147,12 @@ ...@@ -147,4 +147,12 @@
text-align: center; text-align: center;
width: 100%; width: 100%;
border-radius: 14upx; border-radius: 14upx;
} }
\ No newline at end of file .submitbtns2{
height: 44px;
line-height: 44px;
border-bottom: 1px solid #eee;
text-align: center;
width: 100%;
}
\ No newline at end of file
<template> <template>
<!-- 产品管理 --> <!-- 产品管理 -->
<!-- 产品 --> <!-- 产品 -->
<view class="ProductManage pb-100 yocode"> <view class="ProductManage pb-100 yocode">
<!-- tab切换 -->
<view class="projuctTab flex"> <view class="projuctTab flex" style="background-color: #EEEEEE;justify-content: center;align-items:center ;">
<view class="tabitems flex1" :class="{active:tabactive==1}" @tap="taggletab(1)"> <view class="" style="width: 65%;">
<view class="tabtitle">出售中</view> <input type="searchInput" value="" placeholder="搜索" style=" " />
<!-- ({{count[0]}}) --> </view>
</view> <view class="" style="width: 90upx;height: 90upx;" >
<view class="tabitems flex1" :class="{active:tabactive==2}" @tap="taggletab(2)"> <image src="../../static/icon/1.png" mode="" style="display: inline;"></image>
<view class="tabtitle">已下架</view> </view>
<!-- ({{count[1]}}) -->
</view>
</view> </view>
<!-- tab切换 -->
<view class="projuctTab flex" style="top: 184upx;">
<view class="tabitems flex1" :class="{active:tabactive==1}" @tap="taggletab(1)">
<view class="tabtitle">出售中</view>
<!-- ({{count[0]}}) -->
</view>
<view class="tabitems flex1" :class="{active:tabactive==2}" @tap="taggletab(2)">
<view class="tabtitle">已下架</view>
<!-- ({{count[1]}}) -->
</view>
</view>
<view class="projuctlist" v-if="goods_list.length!=0"> <view class="projuctlist" v-if="goods_list.length!=0">
...@@ -24,7 +33,7 @@ ...@@ -24,7 +33,7 @@
<checkbox :value="item.id.toString()" :checked="item.checked==true" /> <checkbox :value="item.id.toString()" :checked="item.checked==true" />
</label> --> </label> -->
<image class="thumbnail" :src="staticUrl + item.photo" mode=""></image> <image class="thumbnail" :src="staticUrl + item.photo" mode=""></image>
<view class="infobox"> <view class="infobox" style="width: 60%;">
<view class="title oneline">{{item.product_name}}</view> <view class="title oneline">{{item.product_name}}</view>
<!-- <view class="time">上架时间:{{item.create_time}}</view> --> <!-- <view class="time">上架时间:{{item.create_time}}</view> -->
<view class="price">¥{{item.price}}</view> <view class="price">¥{{item.price}}</view>
...@@ -63,12 +72,20 @@ ...@@ -63,12 +72,20 @@
<view class="btns btns2" v-show="tabactive==1" @tap="sold_outfun('all',1)">下架</view> <view class="btns btns2" v-show="tabactive==1" @tap="sold_outfun('all',1)">下架</view>
<view class="btns btns2" v-show="tabactive==2" @tap="sold_outfun('all',0)">上架</view> <view class="btns btns2" v-show="tabactive==2" @tap="sold_outfun('all',0)">上架</view>
</view> --> </view> -->
<!-- <view @click="open" class="submitbtns">添加</view> -->
<navigator :url="'/pages/addEditEleProduct/addEditEleProduct?activity_type='+activity_type+'&isadd=0' " class="submitbtns">添加</navigator> <navigator :url="'/pages/addEditEleProduct/addEditEleProduct?activity_type='+activity_type+'&isadd=0' " class="submitbtns">添加</navigator>
</view> </view>
<pageScrollTo v-if="isshowtop" ></pageScrollTo> <pageScrollTo v-if="isshowtop" ></pageScrollTo>
<!-- <uniPopup ref="popup" type="bottom" >
<view class="" style="background-color: #fff;">
<button @click="addeleproduct" type="default">添加外卖</button>
<navigator :url="'/pages/addEditEleProduct/addEditEleProduct?activity_type='+activity_type+'&isadd=0' " class="submitbtns2">添加外卖</navigator>
<navigator :url="'/pages/addEditEleProduct/addEditEleProduct?activity_type='+activity_type+'&isadd=0' " class="submitbtns2">商品入库</navigator>
<button type="default">商品入库</button>
<view @click="close" type="default" class="submitbtns2">取消</view>
</view>
</uniPopup> -->
</view> </view>
</template> </template>
...@@ -76,12 +93,13 @@ ...@@ -76,12 +93,13 @@
// import { goods_product_list, sold_out,sold_outAll} from "@/utils/api/store.js"; // import { goods_product_list, sold_out,sold_outAll} from "@/utils/api/store.js";
import pageScrollTo from "@/components/pageScrollTo/pageScrollTo.vue" import pageScrollTo from "@/components/pageScrollTo/pageScrollTo.vue"
import empty from "@/components/empty/empty.vue" import empty from "@/components/empty/empty.vue"
import uniPopup from '@/components/uni-popup/uni-popup.vue'
import {eleProductList,autoManageProduct,deleteEleProduct} from "@/utils/api/api.js"; import {eleProductList,autoManageProduct,deleteEleProduct} from "@/utils/api/api.js";
export default { export default {
components:{ components:{
pageScrollTo, pageScrollTo,
empty, empty,
uniPopup
}, },
data() { data() {
return { return {
...@@ -112,7 +130,8 @@ ...@@ -112,7 +130,8 @@
}, },
onShow() { onShow() {
// console.log(this.$refs.popup)
this.goods_list = []; this.goods_list = [];
this.page = 0; this.page = 0;
this.isallshow=false; this.isallshow=false;
...@@ -139,7 +158,23 @@ ...@@ -139,7 +158,23 @@
} }
}, },
methods:{ methods:{
addeleproduct(){
console.log('外卖')
// :url="'/pages/addEditEleProduct/addEditEleProduct?activity_type='+activity_type+'&isadd=0' "
uni.navigateTo({
url:"'/pages/addEditEleProduct/addEditEleProduct?activity_type="+this.activity_type+'&isadd=0'
})
},
close(){
this.$refs.popup.close()
},
open(){
this.$refs.popup.open()
},
//修改外卖产品 //修改外卖产品
tochanges(data,index){ tochanges(data,index){
uni.navigateTo({ uni.navigateTo({
...@@ -294,5 +329,5 @@ ...@@ -294,5 +329,5 @@
</script> </script>
<style lang="scss"> <style lang="scss">
@import "./eleProduct.scss" @import "./eleProduct.scss";
</style> </style>
...@@ -6,28 +6,30 @@ ...@@ -6,28 +6,30 @@
<view class="tit">店铺名称:{{ storeinfo.shop_name }}</view> <view class="tit">店铺名称:{{ storeinfo.shop_name }}</view>
<!-- {{shop.shop_name}} --> <!-- {{shop.shop_name}} -->
<view :class="['jiu', shop_type == 'ele'?'':'jus-b']"> <view :class="['jiu', shop_type == 'ele'?'':'jus-b']">
<view class="jiu_01" v-if="shop_type == 'ele'">
<view class="jiu_01" v-if="is_bld == 1">
<view @tap="saoma"> <view @tap="saoma">
<image class="img" src="/static/icon/1.png" mode=""></image> <image class="img" src="/static/icon/1.png" mode="" ></image>
<view>扫码入库</view> <view>扫码入库</view>
</view> </view>
</view> </view>
<view class="jiu_01">
<view class="jiu_01" :style="is_bld==1?'':'width: 33%;'">
<navigator url="/pages/notice/notice"> <navigator url="/pages/notice/notice">
<view><image class="img" src="/static/icon/newsicon.png" mode=""></image></view> <view><image class="img" src="/static/icon/newsicon.png" mode="" ></image></view>
<view>消息通知</view> <view>消息通知</view>
</navigator> </navigator>
</view> </view>
<view class="jiu_01"> <view class="jiu_01" :style="is_bld==1?'':'width: 33%;'">
<navigator url="/pages/user/tongji/tongji"> <navigator url="/pages/user/tongji/tongji">
<view><image class="img" src="/static/icon/zijinicons.png" mode=""></image></view> <view><image class="img" src="/static/icon/zijinicons.png" mode="" ></image></view>
<view>商户资金</view> <view>商户资金</view>
</navigator> </navigator>
</view> </view>
<view class="jiu_01 "> <view class="jiu_01" :style="is_bld==1?'':'width: 33%;'">
<navigator url="/pages/user/mingxi/mingxi"> <navigator url="/pages/user/mingxi/mingxi">
<view><image class="img" src="/static/icon/3.png" mode=""></image></view> <view><image class="img" src="/static/icon/3.png" mode="" ></image></view>
<view>佣金明细</view> <view>佣金明细</view>
</navigator> </navigator>
</view> </view>
...@@ -79,7 +81,7 @@ ...@@ -79,7 +81,7 @@
</view> </view>
<view class="jiu_max " v-if="shop_type == 'ele'"> <view class="jiu_max " v-if="shop_type == 'ele'">
<navigator :url="'/pages/eleProduct/eleProduct?activity_type='+ activity_type "> <navigator :url="'/pages/eleProduct/eleProduct?edit=0&activity_type='+ activity_type ">
<view class="jiu_min"> <view class="jiu_min">
<view><image class="img" src="/static/icon/20.png" mode=""></image></view> <view><image class="img" src="/static/icon/20.png" mode=""></image></view>
<view>外卖产品</view> <view>外卖产品</view>
...@@ -221,6 +223,25 @@ ...@@ -221,6 +223,25 @@
</view> </view>
</navigator> </navigator>
</view> </view>
<view class="jiu_max " >
<navigator url="/pages/eleProduct/eleProduct?edit=1">
<view class="jiu_min">
<view><image class="img" src="/static/icon/psfei.png" mode=""></image></view>
<view>快捷改价</view>
</view>
</navigator>
</view>
<view class="jiu_max " >
<navigator url="/pages/eleProduct/eleProduct?edit=2">
<view class="jiu_min">
<view><image class="img" src="/static/icon/psfei.png" mode=""></image></view>
<view>增减库存</view>
</view>
</navigator>
</view>
</view> </view>
<view class="BH"></view> <view class="BH"></view>
<Welcome ref="Welcome"></Welcome> <Welcome ref="Welcome"></Welcome>
...@@ -228,7 +249,8 @@ ...@@ -228,7 +249,8 @@
</view> </view>
</template> </template>
<script> <script>
import{getskipShop} from "@/utils/api/merchant.js";
import uniBadge from "@/components/uni/uni-badge/uni-badge.vue" import uniBadge from "@/components/uni/uni-badge/uni-badge.vue"
import uniIcon from "@/components/uni/uni-icon/uni-icon.vue" import uniIcon from "@/components/uni/uni-icon/uni-icon.vue"
import yomolUpgrade from '@/components/yomol-upgrade/yomol-upgrade.vue'; //升级组件 import yomolUpgrade from '@/components/yomol-upgrade/yomol-upgrade.vue'; //升级组件
...@@ -244,7 +266,8 @@ ...@@ -244,7 +266,8 @@
shop_type: "", //店铺类型 ele goods shop_type: "", //店铺类型 ele goods
is_luck_draw:"", is_luck_draw:"",
money_type:"", money_type:"",
activity_type:0 activity_type:0,
is_bld:''
} }
}, },
components: { components: {
...@@ -258,7 +281,15 @@ ...@@ -258,7 +281,15 @@
return this.$store.state.userInfo; return this.$store.state.userInfo;
} }
}, },
onLoad() { onLoad() {
getskipShop({
type:'bld'
}).then(res=>{
if(res.code == 0){
this.is_bld = res.data.is_bld
// this.is_bld = 1
}
})
//显示欢迎回来~ //显示欢迎回来~
setTimeout(() => { setTimeout(() => {
this.$refs.Welcome.show(); this.$refs.Welcome.show();
...@@ -298,7 +329,12 @@ ...@@ -298,7 +329,12 @@
success: (results) => { success: (results) => {
console.log(results); console.log(results);
if(results.data.code==0){ if(results.data.code==0){
this.$api.msg(results.data.msg); // this.$api.msg(results.data.msg);
results.isScanCode=false;
results.code=res.result;
uni.navigateTo({
url: '/pages/addEditEleProduct/addEditEleProduct?results='+JSON.stringify(results)
})
}else if(results.data.code==1){ }else if(results.data.code==1){
results.isScanCode=false; results.isScanCode=false;
results.code=res.result; results.code=res.result;
...@@ -427,11 +463,13 @@ ...@@ -427,11 +463,13 @@
padding: 30upx 20upx 30upx; padding: 30upx 20upx 30upx;
box-sizing: border-box; box-sizing: border-box;
font-size: 24upx; font-size: 24upx;
} }
.jiu_max { .jiu_max {
width: 33%; width: 33%;
} }
.jiu_min { .jiu_min {
width: 100%; width: 100%;
......
...@@ -34,4 +34,14 @@ import request from "./../request.js";//这里用的是two ...@@ -34,4 +34,14 @@ import request from "./../request.js";//这里用的是two
export function getActivityList(data){ export function getActivityList(data){
return request.post("store/getActivityList", data, { noAuth: true}); return request.post("store/getActivityList", data, { noAuth: true});
} }
\ No newline at end of file
//判断商家类型 商品入库
export function getskipShop(data){
return request.post("/user/skipShop", data, { noAuth: true});
}
//获取分类 列表
export function getshopclass(data){
return request.post("/ele/weigh", data, { noAuth: true});
}
...@@ -6,7 +6,7 @@ module.exports = { ...@@ -6,7 +6,7 @@ module.exports = {
isdebug:false,//正式 isdebug:false,//正式
// isdebug:true,//测试 // isdebug:true,//测试
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment