Commit 0eb7ffe0 by 前端

Merge branch 'chenwq_dev_v2.3.0' into 'v2.3.0'

Chenwq dev v2.3.0

See merge request !167
2 parents 37b9c392 23f0b138
......@@ -105,10 +105,12 @@ export default {
this.productList.forEach(function(item) {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function(a, b) {
let retailPriceList = JSON.parse(JSON.stringify(item.specificationDetailList))
retailPriceList.sort((a, b) => {
return a.retailPrice - b.retailPrice
})
let stockeList = item.specificationDetailList.sort(function(a, b) {
let stockeList = JSON.parse(JSON.stringify(item.specificationDetailList))
stockeList.sort((a, b) => {
return a.stock - b.stock
})
let minRatilPrice = retailPriceList[0].retailPrice / 100
......
......@@ -27,17 +27,14 @@
</template>
<script>
// import { getGoodsList } from '@/api/modules/common'
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectMutiProForcouponDialog',
data() {
return {
// 表格组件
// getListApi: this.$apis.common.getGoodsListApi,
productList: [],
userInfo: {},
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
searchProForm: {
name: ''
},
......@@ -97,8 +94,6 @@ export default {
var params = {
goodsStatus: 1,
goodsSource: 1,
// pageNum: isMounted ? 1 : this.$refs.mutiProRef.page.pageNum,
// pageSize: isMounted ? 10 : this.$refs.mutiProRef.page.pageSize
currentPage: 1,
pageNum: 1,
pageSize: 100000,
......@@ -109,33 +104,8 @@ export default {
this.$apis.couponManage.getAllGoodsApi(params).then(res => {
this.fnCallBack = true
// console.log(res)
// this.productList = res
this.productList = res.list
// this.$refs.mutiProRef.tableTotal = res.total
this.productList.forEach(function(item) {
// item.saleAmount = item.goodsStatistics.saleAmount
// if (item.specificationDetailList.length > 1) {
// let retailPriceList = item.specificationDetailList.sort(function(a, b) {
// return a.retailPrice - b.retailPrice
// })
// let stockeList = item.specificationDetailList.sort(function(a, b) {
// return a.stock - b.stock
// })
// let minRatilPrice = retailPriceList[0].retailPrice / 100
// let maxRatilPrice = retailPriceList[retailPriceList.length - 1].retailPrice / 100
// let minStock = stockeList[0].stock
// let maxStock = stockeList[stockeList.length - 1].stock
// item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
// item.minRatilPrice = minRatilPrice.toFixed(2)
// item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
// } else if (item.specificationDetailList.length == 1) {
// item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
// item.minRatilPrice = item.retailPrice
// item.goodsStock = item.specificationDetailList[0].stock
// } else {
// item.retailPrice = (item.retailPrice / 100).toFixed(2)
// item.minRatilPrice = item.retailPrice
// }
this.productList.forEach(function (item) {
item.retailPrice = (item.retailPrice / 100).toFixed(2)
})
this.recoverySelected()
......
......@@ -101,7 +101,7 @@
</el-form-item>
</template>
<template slot="denominationHtml">
<el-input v-model="editForm.denomination" style="width: 150px" :disabled="apear != 'couponAdd'" @blur.native.capture="editForm.useChannel == 1 && denominationBlur($event)">
<el-input v-model="editForm.denomination" id="denomination" style="width: 150px" :disabled="apear != 'couponAdd'" @blur.native.capture="editForm.useChannel == 1 && denominationBlur($event)">
<span slot="append">元</span>
</el-input>
<span style="color: red; margin-left: 15px" v-if="priceFlag && editForm.useChannel == 1">{{ selectedAllProList.length ? '存在零售价低于代金券的商品' : '系统暂无已创建的商品,请先创建好商品后再配置代金券' }}</span>
......@@ -745,18 +745,31 @@ export default {
return obj
},
// 跳转
whereToGo(id) {
document.getElementById(id).scrollIntoView()
},
handleConfirm() {
this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid, errorObj) => {
var merchantval = true
var merchantErrorObj = []
if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => {
this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
merchantval = merchantVaild
merchantErrorObj = errorObj
})
}
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
} else if (!merchantval) {
this.whereToGo(Object.keys(merchantErrorObj)[0])
}
if (valid && merchantval) {
if (this.priceFlag && this.editForm.useChannel == 1) {
//存在零售价低于代金券的商品
this.whereToGo('denomination')
return
}
var params = this.getCouponInfoParams()
......@@ -765,6 +778,7 @@ export default {
message: '未选择商品',
type: 'error'
})
this.whereToGo('denomination')
return
}
let method = ''
......
......@@ -97,11 +97,11 @@
</template>
<template slot="effectiveHtml">
<el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'" id="effectiveTime">
<el-date-picker v-model="editForm.effectiveTime" @change="haveChange" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="defaultTime" :format="format" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio>
</el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays">
<el-form-item prop="effectiveDays" ref="effectiveDays" id="effectiveDays">
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'">
领取后
<el-input v-model="editForm.effectiveDays" style="width: 100px; margin-left: 5px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.effectiveType != 1" />
......@@ -528,15 +528,27 @@ export default {
return obj
},
// 跳转
whereToGo(id) {
document.getElementById(id).scrollIntoView()
},
handleConfirm() {
this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid, errorObj) => {
var merchantval = true
var merchantErrorObj = []
if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => {
this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
merchantval = merchantVaild
merchantErrorObj = errorObj
})
}
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
} else if (!merchantval) {
this.whereToGo(Object.keys(merchantErrorObj)[0])
}
if (valid && merchantval) {
var params = this.getCouponInfoParams()
let method = ''
......
......@@ -77,11 +77,11 @@
</template>
<template slot="effectiveHtml">
<el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'" id="effectiveTime">
<el-date-picker v-model="editForm.effectiveTime" @change="haveChange" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="defaultTime" :format="format" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio>
</el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays">
<el-form-item prop="effectiveDays" ref="effectiveDays" id="effectiveDays">
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'">
领取后
<el-input v-model="editForm.effectiveDays" style="width: 100px; margin-left: 5px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.effectiveType != 1" />
......@@ -431,15 +431,27 @@ export default {
return obj
},
// 跳转
whereToGo(id) {
document.getElementById(id).scrollIntoView()
},
handleConfirm() {
this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid, errorObj) => {
var merchantval = true
var merchantErrorObj = []
if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => {
this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
merchantval = merchantVaild
merchantErrorObj = errorObj
})
}
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
} else if (!merchantval) {
this.whereToGo(Object.keys(merchantErrorObj)[0])
}
if (valid && merchantval) {
var params = this.getCouponInfoParams()
let method = ''
......
......@@ -5,10 +5,10 @@
</div>
<div class="live-room container" style="padding-top: 20px;">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
<el-form-item size="small" label="服务名称" prop="couponName" style="width: 440px">
<el-form-item size="small" label="服务名称" prop="couponName" style="width: 440px" id="couponName">
<el-input size="small" :disabled="disabledContent" v-model.trim="ruleForm.couponName" maxlength="20" placeholder="请输入服务名称,如“精洗轿车”"></el-input>
</el-form-item>
<el-form-item size="small" label="预估成本/元" prop="anticipatedCost" style="width: 440px">
<el-form-item size="small" label="预估成本/元" prop="anticipatedCost" style="width: 440px" id="anticipatedCost">
<el-input size="small" :disabled="disabledCost" v-model.trim="ruleForm.anticipatedCost" maxlength="20" placeholder="请输入预估成本"></el-input>
</el-form-item>
<el-form-item size="small" label="有效期" prop="effectiveType">
......@@ -16,7 +16,7 @@
<el-radio-group v-model="ruleForm.effectiveType" :disabled="disabledContent">
<el-radio :label="3" class="itemBlock">永久有效</el-radio>
<!-- effectiveType:1, effectiveDays:5 -->
<el-radio :label="1">
<el-radio :label="1" id="effectiveDays">
领取后
<el-input v-model="ruleForm.effectiveDays" maxlength="4" @input="
val => {
......@@ -26,7 +26,7 @@
天内有效
</el-radio>
<!-- effectiveStartTime effectiveEndTime +具体时间 -->
<el-radio :label="2">
<el-radio :label="2" id="daterange">
<el-date-picker :size="small" :disabled="title == '查看' || title == '编辑' || ruleForm.effectiveType != 2" style="width: 230px" v-model="ruleForm.daterange" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions || {}"></el-date-picker>
</el-radio>
</el-radio-group>
......@@ -44,7 +44,7 @@
<el-button @click="add1" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 1">+</el-button>
次
</el-radio>
<el-radio :label="2">
<el-radio :label="2" id="limitDays">
有效期内每
<el-input v-model="ruleForm.limitDays" maxlength="4" @input="
val => {
......@@ -75,7 +75,7 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<el-form-item size="small" label="库存" prop="stock" style="width: 315px">
<!-- <el-input size="small" :disabled="title == '查看'" maxlength="6" v-model.number="ruleForm.stock" placeholder="请输入"></el-input> -->
<span v-if="$isGroupUp">永久有效</span>
<span v-if="$isGroupUp">无库存限制</span>
<el-input :disabled="title == '查看'" v-else class="w-150" v-model="ruleForm.stock" placeholder="请输入库存">
<span slot="suffix">张</span>
</el-input>
......@@ -400,14 +400,27 @@ export default {
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
})
},
// 跳转
whereToGo(id) {
document.getElementById(id).scrollIntoView()
},
submitForm(formName) {
this.$refs[formName].validate(valid => {
this.$refs[formName].validate((valid, errorObj) => {
var merchantval = true
var merchantErrorObj = []
if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => {
this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
merchantval = merchantVaild
merchantErrorObj = errorObj
})
}
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
} else if (!merchantval) {
this.whereToGo(Object.keys(merchantErrorObj)[0])
}
if (valid && merchantval) {
if (this.isEdit == true) {
this.updateService()
......
......@@ -893,7 +893,7 @@ export default {
},
// 库存
'editForm.goodsStock'(newValue, oldValue) {
this.editForm.goodsStock = limitPrice(newValue, oldValue, 10, 0, 0, 10000000000, 'zNumReg')
this.editForm.goodsStock = limitPrice(newValue, oldValue, 9, 0, 0, 10000000000, 'zNumReg')
},
// 运费
'editForm.expressFee'(newValue, oldValue) {
......@@ -1095,7 +1095,7 @@ export default {
if (e.key != 'Backspace' && newValue.length > 1) {
oldValue = newValue.slice(0, newValue.length - 1)
}
this.nameToValSpecsList[idx].stock = limitPrice(newValue, oldValue, 10, 0, 0, 10000000000, 'zNumReg')
this.nameToValSpecsList[idx].stock = limitPrice(newValue, oldValue, 9, 0, 0, 10000000000, 'zNumReg')
},
// 二次确认
secondSimpleConfirm(title, txt, fn) {
......
......@@ -2,7 +2,6 @@
<template>
<div class="marketing pro-group p-t-20">
<div class="m-b-20">
<!-- <el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新建商品</el-button> -->
<GLButton :size="size" type="primary" fn="新建商品" class="el-icon-plus" @click="handleEdit(1)">新建商品</GLButton>
</div>
<div class="container">
......@@ -25,8 +24,6 @@
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleUpOrDown(scope.scope)">{{ scope.scope.goodsStatus ? '下架' : '上架' }}</el-button>
<!-- <el-button v-if="!scope.scope.goodsStatus" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button v-if="scope.scope.goodsStatus" type="text" @click="handleEdit(3, scope.scope)">查看</el-button> -->
<GLButton v-if="!scope.scope.goodsStatus" type="text" fn="编辑" @click="handleEdit(2, scope.scope)">编辑</GLButton>
<GLButton v-if="scope.scope.goodsStatus" type="text" fn="查看" @click="handleEdit(3, scope.scope)">查看</GLButton>
<el-button type="text" @click="handleTop(scope.scope)">置顶</el-button>
......@@ -336,10 +333,12 @@ export default {
this.$refs.proGroupRef.data.forEach(item => {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function (a, b) {
let retailPriceList = JSON.parse(JSON.stringify(item.specificationDetailList))
retailPriceList.sort((a, b) => {
return a.retailPrice - b.retailPrice
})
let stockeList = item.specificationDetailList.sort(function (a, b) {
let stockeList = JSON.parse(JSON.stringify(item.specificationDetailList))
stockeList.sort((a, b) => {
return a.stock - b.stock
})
let minRatilPrice = retailPriceList[0].retailPrice / 100
......
......@@ -386,10 +386,12 @@ export default {
this.$refs.proGroupRef.data.forEach(item => {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function (a, b) {
let retailPriceList = JSON.parse(JSON.stringify(item.specificationDetailList))
retailPriceList.sort((a, b) => {
return a.retailPrice - b.retailPrice
})
let stockeList = item.specificationDetailList.sort(function (a, b) {
let stockeList = JSON.parse(JSON.stringify(item.specificationDetailList))
stockeList.sort((a, b) => {
return a.stock - b.stock
})
let minRatilPrice = retailPriceList[0].retailPrice / 100
......
......@@ -275,7 +275,7 @@ export default {
return {
// add-新增;edit-编辑;look-查看
addOrEdit: 'add',
fromPage: 'index',
fromPage: '/marketing/sop/index',
id: ''
}
}
......@@ -301,6 +301,8 @@ export default {
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
if (this.routeInfo.addOrEdit == 'edit') {
this.getInfo()
} else if (this.routeInfo.info) {
this.setCustomer()
}
},
......@@ -394,6 +396,15 @@ export default {
}
},
setCustomer() {
this.editForm.customerOptType = this.routeInfo.info.customerOptType
if (this.routeInfo.info.customerOptType) {
this.currentCustomerIdx = this.customerDataList.findIndex(item => item.confId == this.editForm.customerOptType)
this.editForm[this.customerDataList[this.currentCustomerIdx].reqListName] = this.routeInfo.info[this.customerDataList[this.currentCustomerIdx].reqListName]
this.recoverCustomerList()
}
},
getInfo() {
this.$apis.sop.getSopInfoDetailApi({ sopId: this.routeInfo.id }).then(res => {
// console.log(res)
......@@ -794,8 +805,8 @@ export default {
})
},
cancelJump() {
this.$router.push({
path: '/sop/' + this.routeInfo.fromPage
this.$history.push({
path: this.routeInfo.fromPage
})
},
......
......@@ -127,17 +127,14 @@ export default {
this.crowdList.forEach((item, index) => {
item.idx = index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1
})
this.selectedCrowdList.length && (this.selectedCrowdId = this.selectedCrowdList[0].crowdId)
// this.recoverySelected()
this.selectedCrowdList.length && (this.selectedCrowdId = +this.selectedCrowdList[0].crowdId)
this.$refs.crowdRef.tableHeightValues = '460px'
})
},
setTableFinishFun() {
this.crowdList = this.$refs.crowdRef.data
// this.recoverySelected()
//接收到的数据为空
// this.$refs.crowdRef.tableHeightValues = this.$refs.crowdRef.data.length ? '' : '400px'
this.$refs.crowdRef.tableHeightValues = '460px'
},
......
......@@ -107,7 +107,7 @@ export default {
handleJump(path, row = {}) {
this.$router.push({
path: '/sop/' + path,
query: row ? { id: row.id, fromPage: 'index' } : ''
query: row ? { id: row.id, fromPage: '/marketing/sop/index' } : ''
})
},
......@@ -197,7 +197,7 @@ export default {
handleEdit(addOrEdit, row) {
var params = {
addOrEdit: addOrEdit,
fromPage: 'index',
fromPage: '/marketing/sop/index',
$title: encodeURI(addOrEdit == 'add' ? '新建SOP' : '编辑SOP')
}
addOrEdit != 'add' && (params.id = row.id)
......
......@@ -28,7 +28,7 @@ export default {
size: 'small',
routeInfo: {
id: '',
fromPage: 'index'
fromPage: '/marketing/sop/index'
}
}
},
......@@ -46,8 +46,8 @@ export default {
methods: {
handleTabClick() { },
handleBack() {
this.$router.push({
path: '/sop/' + this.routeInfo.fromPage
this.$history.push({
path: this.routeInfo.fromPage
})
}
}
......
......@@ -137,7 +137,7 @@ export default {
handleJump(path, row = {}) {
this.$router.push({
path: '/sop/' + path,
query: row ? { id: row.id, fromPage: 'sopList' } : ''
query: row ? { id: row.id, fromPage: '/marketing/sop/sopList' } : ''
})
},
......@@ -166,7 +166,7 @@ export default {
handleEdit(addOrEdit, row) {
var params = {
addOrEdit: addOrEdit,
fromPage: 'sopList',
fromPage: '/marketing/sop/sopList',
$title: encodeURI(addOrEdit == 'add' ? '新建SOP' : '编辑SOP')
}
addOrEdit != 'add' && (params.id = row.id)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!