Commit 924c14bd by 前端

Merge branch 'v3.22.1' into 'master'

V3.22.1

See merge request !30
2 parents 8fc0bc78 3783f46c
......@@ -1966,7 +1966,7 @@
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"version": "npm:vue-loader-v16@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
......@@ -8787,6 +8787,11 @@
"integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==",
"dev": true
},
"number-precision": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/number-precision/-/number-precision-1.6.0.tgz",
"integrity": "sha512-05OLPgbgmnixJw+VvEh18yNPUo3iyp4BEWJcrLu4X9W05KmMifN7Mu5exYvQXqxxeNWhvIF+j3Rij+HmddM/hQ=="
},
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
......
......@@ -15,6 +15,7 @@
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.5.4",
"number-precision": "^1.6.0",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuex": "^3.1.2",
......
......@@ -119,17 +119,17 @@ const getSharedListApi = params => {
const exportBrowseApi = (params, TYPE = 1) => {
//TYPE 1 浏览 2 访客 3 分享
params.method = {
1: 'scrm.api.shopmall.discover.goods.browse.records.export',
2: 'scrm.api.shopmall.discover.goods.visitor.records.export',
3: 'scrm.api.shopmall.discover.goods.shared.records.export'
1: 'scrm.api.shopmall.discover.goods.browse.records.export',
2: 'scrm.api.shopmall.discover.goods.visitor.records.export',
3: 'scrm.api.shopmall.discover.goods.shared.records.export'
}[TYPE]
return http({
url,
method: 'POST',
data: params,
sign: true
url,
method: 'POST',
data: params,
sign: true
})
}
}
const exportGoodsApi = params => {
params.method = 'scrm.api.shopmall.goods.configuration.export'
......@@ -150,7 +150,29 @@ const getSelfGoodsDetailApi = params => {
sign: true
})
}
/**
* 获取油劵列表
*/
const getOilCouponListApi = params => {
params.method = 'scrm.api.shopmall.goods.oil.coupon.list'
params.status = 1
params.filterStock = 1
return http({
url,
data: params
})
}
const getAllMerchantListApi = params => {
params.method = 'scrm.api.carlife.merchant.listWithPageByCurMerchant'
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getGoodsListApi,
updateGoodsStatusApi,
......@@ -165,5 +187,7 @@ export default {
getSharedListApi,
exportBrowseApi,
exportGoodsApi,
getSelfGoodsDetailApi
getSelfGoodsDetailApi,
getOilCouponListApi,
getAllMerchantListApi
}
\ No newline at end of file
<template>
<GLDialog bigTitle="选择门店" mode="big" :visible.sync="isVisible" :show-close="true" :before-close="handleClose" :close-on-click-modal="false" @onOk="onOk" @onCancel="handleClose">
<GLDialog
bigTitle="选择门店"
mode="big"
:visible.sync="isVisible"
:show-close="true"
:before-close="handleClose"
:close-on-click-modal="false"
@onOk="onOk"
@onCancel="handleClose"
>
<div class="dialog_body">
<template v-if="isOil">
<glsx-combi-form
ref="showSearch"
labelWidth="105px"
:formObj="dialogSearchForm"
:formData="dialogFormData"
>
<span slot="footer">
<el-button
:size="size"
type="primary"
@click="handleOk"
>查询</el-button>
<el-button
:size="size"
@click="handleRest"
>重置</el-button>
</span>
</glsx-combi-form>
</template>
<!-- <GLCombiForm :rowNumber="1" class="dialog_search" ref="searchRef" :formObj="dialogSearchForm" :formData="dialogFormData" @handleOk="handleOk" @handleRest="handleRest"></GLCombiForm> -->
<div class="dialog_table">
<GLTable v-if="showTable" :hasPage="false" :pageSizes="pageSizes" ref="tableRef" :beforeSearchFn="beforeSearchFn" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun" :searchForm="dialogSearchForm" :tableParams="tableParams" :getListApi="getListApi">
<div slot="spreadPrice" slot-scope="scope">
<GLTable
v-if="showTable"
:hasPage="isOil"
:pageSizes="pageSizes"
ref="tableRef"
:beforeSearchFn="beforeSearchFn"
:pageConf="pageConf"
@setTableFinishFun="setTableFinishFun"
:searchForm="dialogSearchForm"
:tableParams="tableParams"
:getListApi="getListApi"
>
<div
slot="spreadPrice"
slot-scope="scope"
>
<span :style="{ color: Number(scope.scope.lineationPrice - scope.scope.costPrice) <= 0 ? '#eb4e4e' : '#666666' }">{{ Number(Number(scope.scope.lineationPrice - scope.scope.costPrice).toFixed(1)) }}</span>
</div>
</GLTable>
......@@ -23,20 +66,20 @@ export default {
},
selectedList: {
type: Array,
default: ()=> []
default: () => []
},
goodsId:{
goodsId: {
type: String,
default: ''
}
},
data() {
data () {
return {
showTable: true,
copyList: [],
couponList: [],
directChargeList: [],
pageSizes: [5, 10, 20, 30, 40],
pageSizes: [10, 20, 30, 40],
dialogSearchForm: {
merchantName: '',
merchantId: ''
......@@ -46,16 +89,21 @@ export default {
label: '商户名称',
name: 'merchantName',
type: 'input',
isClear: true
placeholder: '请输入商户名称',
width: '300px',
labelWidth: '10px'
},
{
label: '商户ID',
name: 'merchantId',
type: 'input',
isClear: true
inputType: 'number',
placeholder: '请输入商户ID',
width: '300px',
labelWidth: '10px'
}
],
getListApi: this.$apis.goods.getMerchantListApi,
getListApi: null,
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableParams: {
listName: 'merchantList',
......@@ -72,32 +120,38 @@ export default {
prop: 'merchantId'
},
]
}
},
isOil: this.$parent.formObj.goodsSource == 3
}
},
created() {
created () {
const { isOil } = this
this.copyList = JSON.parse(JSON.stringify(this.selectedList))
this.getListApi = this.$apis.goods[isOil ? 'getAllMerchantListApi' : 'getMerchantListApi']
this.tableParams.listName = isOil ? 'list' : 'merchantList'
this.tableParams.tableColumns[1].prop = isOil ? 'merchantNo' : 'merchantId'
},
methods: {
handleOk() {
handleOk () {
console.log(this.dialogSearchForm)
this.$refs.tableRef.refreshTable()
},
handleRest() {
handleRest () {
this.dialogSearchForm = {
merchantName: '',
merchantId: ''
}
this.handleOk()
},
beforeSearchFn(){
beforeSearchFn () {
return new Promise(resolve => {
this.dialogSearchForm = {
id: this.goodsId
if (!this.isOil) this.dialogSearchForm = {
id: this.goodsId,
}
resolve()
})
},
onOk() {
onOk () {
let list = this.$refs.tableRef.mutiSelectArr[this.tableParams.mutiSelectName] || []
// for (let i = 0; i < this.selectedList.length; i++) {
// let idx = list.findIndex(item => item.id == this.selectedList[i].id)
......@@ -107,19 +161,20 @@ export default {
// }
list.map(item => this.$set(item, 'activityPrice', ''))
list.map(item => this.$set(item, 'originalPrice', ''))
this.$emit('confirmDialog', [...list, ...this.copyList])
this.$emit('confirmDialog', [...list, ...this.copyList])
},
handleClose() {
handleClose () {
this.$emit('closeDialog')
},
setTableFinishFun() {
setTableFinishFun () {
const KEY = this.isOil ? 'merchantNo' : 'merchantId'
this.copyList.forEach(row => {
this.$nextTick(() => {
let idx = this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data.findIndex(item => item.merchantId == row.merchantId)
let idx = this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data.findIndex(item => item[KEY] == row[KEY])
if (idx > -1) {
try {
this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data[idx], true)
let id = this.copyList.findIndex(item => item.merchantId == row.merchantId)
let id = this.copyList.findIndex(item => item[KEY] == row[KEY])
if (id > -1) this.copyList.splice(id, 1)
} catch (err) {
console.log(err)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!