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