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 @@ ...@@ -1966,7 +1966,7 @@
} }
}, },
"vue-loader-v16": { "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", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==", "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true, "dev": true,
...@@ -8787,6 +8787,11 @@ ...@@ -8787,6 +8787,11 @@
"integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==",
"dev": true "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": { "oauth-sign": {
"version": "0.9.0", "version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.6",
"glsx-components": "^1.5.4", "glsx-components": "^1.5.4",
"number-precision": "^1.6.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuex": "^3.1.2", "vuex": "^3.1.2",
......
...@@ -119,17 +119,17 @@ const getSharedListApi = params => { ...@@ -119,17 +119,17 @@ const getSharedListApi = params => {
const exportBrowseApi = (params, TYPE = 1) => { const exportBrowseApi = (params, TYPE = 1) => {
//TYPE 1 浏览 2 访客 3 分享 //TYPE 1 浏览 2 访客 3 分享
params.method = { params.method = {
1: 'scrm.api.shopmall.discover.goods.browse.records.export', 1: 'scrm.api.shopmall.discover.goods.browse.records.export',
2: 'scrm.api.shopmall.discover.goods.visitor.records.export', 2: 'scrm.api.shopmall.discover.goods.visitor.records.export',
3: 'scrm.api.shopmall.discover.goods.shared.records.export' 3: 'scrm.api.shopmall.discover.goods.shared.records.export'
}[TYPE] }[TYPE]
return http({ return http({
url, url,
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const exportGoodsApi = params => { const exportGoodsApi = params => {
params.method = 'scrm.api.shopmall.goods.configuration.export' params.method = 'scrm.api.shopmall.goods.configuration.export'
...@@ -150,7 +150,29 @@ const getSelfGoodsDetailApi = params => { ...@@ -150,7 +150,29 @@ const getSelfGoodsDetailApi = params => {
sign: true 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 { export default {
getGoodsListApi, getGoodsListApi,
updateGoodsStatusApi, updateGoodsStatusApi,
...@@ -165,5 +187,7 @@ export default { ...@@ -165,5 +187,7 @@ export default {
getSharedListApi, getSharedListApi,
exportBrowseApi, exportBrowseApi,
exportGoodsApi, exportGoodsApi,
getSelfGoodsDetailApi getSelfGoodsDetailApi,
getOilCouponListApi,
getAllMerchantListApi
} }
\ No newline at end of file \ No newline at end of file
<template> <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"> <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> --> <!-- <GLCombiForm :rowNumber="1" class="dialog_search" ref="searchRef" :formObj="dialogSearchForm" :formData="dialogFormData" @handleOk="handleOk" @handleRest="handleRest"></GLCombiForm> -->
<div class="dialog_table"> <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"> <GLTable
<div slot="spreadPrice" slot-scope="scope"> 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> <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> </div>
</GLTable> </GLTable>
...@@ -23,20 +66,20 @@ export default { ...@@ -23,20 +66,20 @@ export default {
}, },
selectedList: { selectedList: {
type: Array, type: Array,
default: ()=> [] default: () => []
}, },
goodsId:{ goodsId: {
type: String, type: String,
default: '' default: ''
} }
}, },
data() { data () {
return { return {
showTable: true, showTable: true,
copyList: [], copyList: [],
couponList: [], couponList: [],
directChargeList: [], directChargeList: [],
pageSizes: [5, 10, 20, 30, 40], pageSizes: [10, 20, 30, 40],
dialogSearchForm: { dialogSearchForm: {
merchantName: '', merchantName: '',
merchantId: '' merchantId: ''
...@@ -46,16 +89,21 @@ export default { ...@@ -46,16 +89,21 @@ export default {
label: '商户名称', label: '商户名称',
name: 'merchantName', name: 'merchantName',
type: 'input', type: 'input',
isClear: true placeholder: '请输入商户名称',
width: '300px',
labelWidth: '10px'
}, },
{ {
label: '商户ID', label: '商户ID',
name: 'merchantId', name: 'merchantId',
type: 'input', 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' }, pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableParams: { tableParams: {
listName: 'merchantList', listName: 'merchantList',
...@@ -72,32 +120,38 @@ export default { ...@@ -72,32 +120,38 @@ export default {
prop: 'merchantId' prop: 'merchantId'
}, },
] ]
} },
isOil: this.$parent.formObj.goodsSource == 3
} }
}, },
created() { created () {
const { isOil } = this
this.copyList = JSON.parse(JSON.stringify(this.selectedList)) 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: { methods: {
handleOk() { handleOk () {
console.log(this.dialogSearchForm)
this.$refs.tableRef.refreshTable() this.$refs.tableRef.refreshTable()
}, },
handleRest() { handleRest () {
this.dialogSearchForm = { this.dialogSearchForm = {
merchantName: '', merchantName: '',
merchantId: '' merchantId: ''
} }
this.handleOk() this.handleOk()
}, },
beforeSearchFn(){ beforeSearchFn () {
return new Promise(resolve => { return new Promise(resolve => {
this.dialogSearchForm = { if (!this.isOil) this.dialogSearchForm = {
id: this.goodsId id: this.goodsId,
} }
resolve() resolve()
}) })
}, },
onOk() { onOk () {
let list = this.$refs.tableRef.mutiSelectArr[this.tableParams.mutiSelectName] || [] let list = this.$refs.tableRef.mutiSelectArr[this.tableParams.mutiSelectName] || []
// for (let i = 0; i < this.selectedList.length; i++) { // for (let i = 0; i < this.selectedList.length; i++) {
// let idx = list.findIndex(item => item.id == this.selectedList[i].id) // let idx = list.findIndex(item => item.id == this.selectedList[i].id)
...@@ -107,19 +161,20 @@ export default { ...@@ -107,19 +161,20 @@ export default {
// } // }
list.map(item => this.$set(item, 'activityPrice', '')) list.map(item => this.$set(item, 'activityPrice', ''))
list.map(item => this.$set(item, 'originalPrice', '')) list.map(item => this.$set(item, 'originalPrice', ''))
this.$emit('confirmDialog', [...list, ...this.copyList]) this.$emit('confirmDialog', [...list, ...this.copyList])
}, },
handleClose() { handleClose () {
this.$emit('closeDialog') this.$emit('closeDialog')
}, },
setTableFinishFun() { setTableFinishFun () {
const KEY = this.isOil ? 'merchantNo' : 'merchantId'
this.copyList.forEach(row => { this.copyList.forEach(row => {
this.$nextTick(() => { 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) { if (idx > -1) {
try { try {
this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data[idx], true) 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) if (id > -1) this.copyList.splice(id, 1)
} catch (err) { } catch (err) {
console.log(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!