Commit 1cab5ade by 前端

Merge branch 'saas+v4.20.0' into 'master'

Saas+v4.20.0

See merge request !3
2 parents e58d467f 1834f280
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"dayjs": "^1.10.7", "dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^2.0.8", "glsx-common": "^2.0.9",
"glsx-components": "^1.2.5", "glsx-components": "^1.2.5",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
......
import { http } from '@/main'
// const path = 'dj.api.'
// const path2 = 'dj.smartcarlife.api.'
// 查询优惠券列表
const getListApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.life.merchant.coupon.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 领用明细 - 查询优惠券列表
const getDetailListApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.life.customer.coupon.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
const getTypeList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.goods.type.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
const addCouponApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.life.coupon.info.add`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
const updateCouponApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.life.merchant.coupon.update`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const deleteCouponApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.life.merchant.coupon.delete`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 分页查找园区店
const commodityAddSeviceMerchant = function(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.servicemerchantref.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取核销人
const getDistinctColum = function(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.life.customer.coupon.distinctColum`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
const exportCoupon = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.life.merchant.coupon.exportExcel'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const exportCustomerCoupon = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.life.customer.coupon.exportExcel'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getListApi, getDetailListApi, getTypeList, addCouponApi, updateCouponApi, deleteCouponApi, commodityAddSeviceMerchant, getDistinctColum, exportCoupon, exportCustomerCoupon }
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
* @FilePath: \scrm\scrm-sub-blog\src\components\index.js * @FilePath: \scrm\scrm-sub-blog\src\components\index.js
*/ */
import Vue from 'vue' import Vue from 'vue'
import glsxDialog from '@/components/glsx-dialog/index.vue' // import glsxDialog from '@/components/glsx-dialog/index.vue'
import GlsxCombiForm from '@/components/glsx-combi-form/index.vue' import GlsxCombiForm from '@/components/glsx-combi-form/index.vue'
import GlsxForm from '@/components/glsx-form/index.vue' import GlsxForm from '@/components/glsx-form/index.vue'
Vue.component('glsx-dialog', glsxDialog) // Vue.component('glsx-dialog', glsxDialog)
Vue.component('GlsxCombiForm', GlsxCombiForm) Vue.component('GlsxCombiForm', GlsxCombiForm)
Vue.component('GlsxForm', GlsxForm) Vue.component('GlsxForm', GlsxForm)
\ No newline at end of file \ No newline at end of file
...@@ -11,14 +11,14 @@ ...@@ -11,14 +11,14 @@
let cfg = require('./conf.js') let cfg = require('./conf.js')
import { Http, utils } from 'glsx-common' import { Http, utils } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) { export const fetchConfig = function(common) {
// if (isEnv) { // if (isEnv) {
// let { request } = cfg // let { request } = cfg
// Object.assign(request, { timeout }) // Object.assign(request, { timeout })
// return Promise.resolve(cfg) // return Promise.resolve(cfg)
let params = { moduleName: 'inventory', mockUrl: 'https://oss-config.glsx.com.cn/mock/643e06c7ea3da3a974f54357/purchase/config',httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } } let params = { moduleName: 'inventory', mockUrl: 'https://oss-config.glsx.com.cn/mock/643e06c7ea3da3a974f54357/purchase/config',httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
return utils.getConfig(params) return common.utils.getConfig(params)
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/616d28231072f92988f059fb/home/config') // return new Http().get('https://oss-config.test.glsx.com.cn/mock/616d28231072f92988f059fb/home/config')
// return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get('http://config-center-backend.test.glsx.com/glsxAdmin/config?moduleUrl=home').then(res => res) // return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get('http://config-center-backend.test.glsx.com/glsxAdmin/config?moduleUrl=home').then(res => res)
} }
......
...@@ -12,13 +12,14 @@ let instance = null ...@@ -12,13 +12,14 @@ let instance = null
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState,routerBase }) { export async function bootstrap({ history, common, messenger, globalState,routerBase }) {
const { response, request, sign, secret, sign_common, request_common } = await fetchConfig() const { response, request, sign, secret, sign_common, request_common, purchaseType} = await fetchConfig(common)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
Vue.prototype.$common = common Vue.prototype.$common = common
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox Vue.prototype.$messageBox = messageBox
Vue.prototype.$purchaseType = purchaseType
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } }) Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState // Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
......
export function debounce(func, wait = 200) { export function debounce(func, wait = 200) {
let timeout; let timeout
return function (event) { return function(event) {
clearTimeout(timeout) clearTimeout(timeout)
timeout = setTimeout(() => { timeout = setTimeout(() => {
func.call(this, event) func.call(this, event)
...@@ -24,10 +24,50 @@ export function dateFormat(dateTime, format = 'YYYY-MM-DD HH:mm') { ...@@ -24,10 +24,50 @@ export function dateFormat(dateTime, format = 'YYYY-MM-DD HH:mm') {
return format return format
} }
/** /**
* 校验手机号码格式 * 校验手机号码格式
*/ */
export function checkPhone(mobile) { export function checkPhone(mobile) {
const myreg = const myreg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
/^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return myreg.test(mobile) return myreg.test(mobile)
} }
/**
* 用于glsx-combi-form的select写入options
* formName String FormData的属性名
* hasAll Boolean 是否需要添加“全部”属性
* refreshSigle String 更新特定的属性的options
*/
export function getOptionsList(that, formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = that[formName].find(k => k.name == refreshSigle)
var index = that[formName].findIndex(k => k.name == refreshSigle)
that.$set(that[formName][index], 'optionList', that.$common.utils.deepClone(that.baseData[item.optionsName]))
if (hasAll && that.baseData[item.optionsName].length && that.baseData[item.optionsName][0][that[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[that[formName][index].optionId] = ''
temp[that[formName][index].optionLabel] = '全部'
that[formName][index].optionList.unshift(temp)
}
} else {
that[formName].forEach((item, index) => {
if (item.type === 'select' && that.baseData[item.optionsName]?.length) {
that.$set(that[formName][index], 'optionList', that.$common.utils.deepClone(that.baseData[item.optionsName]))
if (hasAll && that.baseData[item.optionsName].length && that.baseData[item.optionsName][0][that[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[that[formName][index].optionId] = ''
temp[that[formName][index].optionLabel] = '全部'
that[formName][index].optionList.unshift(temp)
}
}
})
}
}
export function aToExport(url) {
var a = document.createElement('a')
a.setAttribute('id', 'exportToExport')
a.setAttribute('href', url)
a.setAttribute('target', '_blank')
document.body.appendChild(a)
a.click()
}
...@@ -2,15 +2,18 @@ ...@@ -2,15 +2,18 @@
<template> <template>
<div class="addWrap"> <div class="addWrap">
<div class="d2-container-content gl-form-min" style="padding: 10px 20px"> <div class="d2-container-content gl-form-min" style="padding: 10px 20px">
<el-form :inline="true" size="small" :model="editAllocationForm" ref="editAllocationFormRef" :rules="formRules" class="demo-form-inline"> <el-form :inline="true" size="small" :model="editAllocationForm" ref="editAllocationFormRef" :rules="formRules"
class="demo-form-inline">
<el-form-item label="调出门店:" prop="callOutYqMerchantId"> <el-form-item label="调出门店:" prop="callOutYqMerchantId">
<el-select v-model="editAllocationForm.callOutYqMerchantId" style="width: 300px"> <el-select v-model="editAllocationForm.callOutYqMerchantId" style="width: 300px">
<el-option v-for="item in callOutYqMerchantList" :key="item.merchantNo" :label="item.merchantName" :value="item.merchantNo" /> <el-option v-for="item in callOutYqMerchantList" :key="item.merchantNo" :label="item.merchantName"
:value="item.merchantNo" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="调入门店:" prop="callInYqMerchantId"> <el-form-item label="调入门店:" prop="callInYqMerchantId">
<el-select v-model="editAllocationForm.callInYqMerchantId" filterable style="width: 300px"> <el-select v-model="editAllocationForm.callInYqMerchantId" filterable style="width: 300px">
<el-option v-for="item in callInYqMerchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId" /> <el-option v-for="item in callInYqMerchantList" :key="item.merchantId" :label="item.merchantName"
:value="item.merchantId" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -20,13 +23,15 @@ ...@@ -20,13 +23,15 @@
<div class="gl-form-min"> <div class="gl-form-min">
<el-form :inline="true" size="small" :model="editAllocationForm"> <el-form :inline="true" size="small" :model="editAllocationForm">
<el-form-item label=""> <el-form-item label="">
<el-input v-model="searchForm.searchName" style="width: 200px" placeholder="请输入商品名称/系列" maxlength="20" clearable /> <el-input v-model="searchForm.searchName" style="width: 200px" placeholder="请输入商品名称/系列" maxlength="20"
clearable />
</el-form-item> </el-form-item>
<el-button @click="handleSearch" size="small" type="primary" style="marginleft: 15px">查询</el-button> <el-button @click="handleSearch" size="small" type="primary" style="marginleft: 15px">查询</el-button>
</el-form> </el-form>
</div> </div>
</div> </div>
<GLTable ref="allocationTable" :getListApi="getListApi" :pageConf="pageConf" :searchForm="searchFormSearch" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn"> <GLTable ref="allocationTable" :getListApi="getListApi" :pageConf="pageConf" :searchForm="searchFormSearch"
:tableParams="tableParams" :beforeSearchFn="beforeSearchFn">
<div slot="auth-button" slot-scope="scope"> <div slot="auth-button" slot-scope="scope">
<el-button type="text" @click="allocation(scope.scope)" :disabled="setDisabled(scope.scope)">选择</el-button> <el-button type="text" @click="allocation(scope.scope)" :disabled="setDisabled(scope.scope)">选择</el-button>
</div> </div>
...@@ -40,9 +45,11 @@ ...@@ -40,9 +45,11 @@
</div> </div>
</GLTable> </GLTable>
</div> </div>
<glsx-form ref="allocationForm" :origin-data="editData" :form-list="editForm" form-ref="inveFormRef" @handleAddConfirm="handleAddConfirm" @handleClose="handleAddClose"></glsx-form> <glsx-form ref="allocationForm" :origin-data="editData" :form-list="editForm" form-ref="inveFormRef"
@handleAddConfirm="handleAddConfirm" @handleClose="handleAddClose"></glsx-form>
<!-- 盘点 --> <!-- 盘点 -->
<allocation-num-dialog :allocation-num-visible="allocationNumVisible" :allocation-info="allocationInfo" v-if="allocationNumVisible" @dialogClose="dialogClose" /> <allocation-num-dialog :allocation-num-visible="allocationNumVisible" :allocation-info="allocationInfo"
v-if="allocationNumVisible" @dialogClose="dialogClose" />
</div> </div>
</template> </template>
...@@ -87,6 +94,11 @@ export default { ...@@ -87,6 +94,11 @@ export default {
prop: 'goodsName' prop: 'goodsName'
}, },
{ {
label: '商品编码',
prop: 'productCode',
width: '250px'
},
{
label: '系列', label: '系列',
prop: 'sourceMaterialName' prop: 'sourceMaterialName'
}, },
...@@ -117,6 +129,11 @@ export default { ...@@ -117,6 +129,11 @@ export default {
prop: 'goodsName' prop: 'goodsName'
}, },
{ {
label: '商品编码',
prop: 'productCode',
width: '250px'
},
{
label: '系列', label: '系列',
prop: 'sourceMaterialName' prop: 'sourceMaterialName'
}, },
...@@ -288,17 +305,20 @@ export default { ...@@ -288,17 +305,20 @@ export default {
padding: 20px; padding: 20px;
margin-bottom: 20px; margin-bottom: 20px;
} }
.count-txt { .count-txt {
font-weight: 700; font-weight: 700;
color: #2a58ad; color: #2a58ad;
margin: 0 2px; margin: 0 2px;
} }
.title { .title {
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;
color: #333333; color: #333333;
padding: 17px 0; padding: 17px 0;
} }
.leftSpan { .leftSpan {
display: inline-block; display: inline-block;
box-sizing: border-box; box-sizing: border-box;
......
<!-- 盘点详情弹窗弹窗 --> <!-- 盘点详情弹窗弹窗 -->
<template> <template>
<GLDialog bigTitle="详细信息" <GLDialog bigTitle="详细信息" :visible.sync="allocationDetailVisible" class="inventoryDetailDailog" mode="big" okText="关闭"
:visible.sync="allocationDetailVisible" @onCancel="handleClose" @onOk="handleClose">
class="inventoryDetailDailog"
mode="big"
okText="关闭"
@onCancel="handleClose"
@onOk="handleClose">
<div> <div>
<div class="d2-container-content"> <div class="d2-container-content">
<GLTable ref="recordTable" <GLTable ref="recordTable" :getListApi="getListApi" :searchForm="searchFormSearch" :tableParams="tableParams"
:getListApi="getListApi"
:searchForm="searchFormSearch"
:tableParams="tableParams"
:beforeSearchFn="beforeSearchFn"> :beforeSearchFn="beforeSearchFn">
</GLTable> </GLTable>
</div> </div>
...@@ -47,6 +39,11 @@ export default { ...@@ -47,6 +39,11 @@ export default {
prop: 'goodsName' prop: 'goodsName'
}, },
{ {
label: '商品编码',
prop: 'productCode',
// width: 250
},
{
label: '系列', label: '系列',
prop: 'sourceMaterialName' prop: 'sourceMaterialName'
}, },
...@@ -74,7 +71,7 @@ export default { ...@@ -74,7 +71,7 @@ export default {
}, },
allocationInfo: { allocationInfo: {
type: Object, type: Object,
default: () => {} default: () => { }
} }
}, },
...@@ -104,6 +101,7 @@ export default { ...@@ -104,6 +101,7 @@ export default {
color: #2a58ad; color: #2a58ad;
margin: 0 2px; margin: 0 2px;
} }
.inventoryDetailDailog .el-dialog { .inventoryDetailDailog .el-dialog {
margin-top: 20vh !important; margin-top: 20vh !important;
min-width: 700px; min-width: 700px;
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
<div class="gl-form-min"> <div class="gl-form-min">
<el-form ref="ruleForm" :model="searchForm" size="small" inline="true"> <el-form ref="ruleForm" :model="searchForm" size="small" inline="true">
<el-form-item label=""> <el-form-item label="">
<el-input v-model="searchForm.searchName" style="width: 200px" placeholder="请输入商品名称/系列" maxlength="20" clearable /> <el-input v-model="searchForm.searchName" style="width: 200px" placeholder="请输入商品名称/系列" maxlength="20"
clearable />
</el-form-item> </el-form-item>
<el-button @click="handleSearch" size="small" type="primary">查询</el-button> <el-button @click="handleSearch" size="small" type="primary">查询</el-button>
...@@ -14,7 +15,8 @@ ...@@ -14,7 +15,8 @@
</div> </div>
</div> </div>
<p class="title">盘存</p> <p class="title">盘存</p>
<GLTable ref="recordTable" :getListApi="getListApi" :searchForm="searchFormSearch" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :pageConf="pageConf"> <GLTable ref="recordTable" :getListApi="getListApi" :searchForm="searchFormSearch" :tableParams="tableParams"
:beforeSearchFn="beforeSearchFn" :pageConf="pageConf">
<div slot="auth-button" slot-scope="scope"> <div slot="auth-button" slot-scope="scope">
<el-button type="text" @click="inventory(scope.scope)" :disabled="setDisabled(scope.scope)">盘点</el-button> <el-button type="text" @click="inventory(scope.scope)" :disabled="setDisabled(scope.scope)">盘点</el-button>
</div> </div>
...@@ -25,9 +27,14 @@ ...@@ -25,9 +27,14 @@
<GLTable ref="recordTable2" :tableData="chooseDataList" :tableParams="tableParams2" :hasPage="false"> <GLTable ref="recordTable2" :tableData="chooseDataList" :tableParams="tableParams2" :hasPage="false">
<template slot="profitAndLoss" slot-scope="scope"> <template slot="profitAndLoss" slot-scope="scope">
<span v-if="scope.scope.profitAndLoss || scope.scope.profitAndLoss == 0"> <span v-if="scope.scope.profitAndLoss || scope.scope.profitAndLoss == 0">
<span v-if="parseFloat(scope.scope.profitAndLoss) > 0" style="color: blue">{{ '+' + parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span> <span v-if="parseFloat(scope.scope.profitAndLoss) > 0" style="color: blue">{{ '+' +
<span v-else-if="parseFloat(scope.scope.profitAndLoss) < 0" style="color: red">{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span> parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' :
<span v-else>{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span> '件') }}</span>
<span v-else-if="parseFloat(scope.scope.profitAndLoss) < 0" style="color: red">{{
parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' :
'件') }}</span>
<span v-else>{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) +
(membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
</span> </span>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
...@@ -36,9 +43,11 @@ ...@@ -36,9 +43,11 @@
</div> </div>
</GLTable> </GLTable>
</div> </div>
<glsx-form ref="addInventoryForm" :origin-data="editData" :form-list="editForm" form-ref="inveFormRef" @handleAddConfirm="handleAddConfirm" @handleClose="handleAddClose"></glsx-form> <glsx-form ref="addInventoryForm" :origin-data="editData" :form-list="editForm" form-ref="inveFormRef"
@handleAddConfirm="handleAddConfirm" @handleClose="handleAddClose"></glsx-form>
<!-- 盘点 --> <!-- 盘点 -->
<inventory-num-dialog :inventory-num-visible="inventoryNumVisible" :record-info="recordInfo" v-if="inventoryNumVisible" @dialogClose="dialogClose" /> <inventory-num-dialog :inventory-num-visible="inventoryNumVisible" :record-info="recordInfo"
v-if="inventoryNumVisible" @dialogClose="dialogClose" />
</div> </div>
</template> </template>
...@@ -70,6 +79,11 @@ export default { ...@@ -70,6 +79,11 @@ export default {
prop: 'goodsName' prop: 'goodsName'
}, },
{ {
label: '商品编码',
prop: 'productCode',
width: '250px'
},
{
label: '系列', label: '系列',
prop: 'sourceMaterialName' prop: 'sourceMaterialName'
}, },
...@@ -101,6 +115,11 @@ export default { ...@@ -101,6 +115,11 @@ export default {
width: '160px' width: '160px'
}, },
{ {
label: '商品编码',
prop: 'productCode',
width: '250px'
},
{
label: '系列', label: '系列',
prop: 'sourceMaterialName', prop: 'sourceMaterialName',
width: '250px' width: '250px'
...@@ -272,20 +291,22 @@ export default { ...@@ -272,20 +291,22 @@ export default {
padding: 20px; padding: 20px;
margin-bottom: 20px; margin-bottom: 20px;
} }
.count-txt { .count-txt {
font-weight: 700; font-weight: 700;
color: #2a58ad; color: #2a58ad;
margin: 0 2px; margin: 0 2px;
} }
.title { .title {
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;
color: #333333; color: #333333;
padding: 17px 0; padding: 17px 0;
} }
.leftSpan { .leftSpan {
display: inline-block; display: inline-block;
box-sizing: border-box; box-sizing: border-box;
margin-right: 10px; margin-right: 10px;
} }</style>
</style>
<!-- 盘点详情弹窗弹窗 --> <!-- 盘点详情弹窗弹窗 -->
<template> <template>
<GLDialog bigTitle="详细信息" :visible.sync="inventoryDetailVisible" :before-close="handleClose" class="inventoryDetailDailog" mode="big" okText="关闭" @onCancel="handleClose" @onOk="handleClose"> <GLDialog bigTitle="详细信息" :visible.sync="inventoryDetailVisible" :before-close="handleClose"
class="inventoryDetailDailog" mode="big" okText="关闭" @onCancel="handleClose" @onOk="handleClose">
<div> <div>
<div class="header" slot="header" style="padding: 10px 20px"> <div class="header" slot="header" style="padding: 10px 20px">
<!-- <GLCombiForm ref="showSearch" <!-- <GLCombiForm ref="showSearch"
...@@ -10,12 +11,18 @@ ...@@ -10,12 +11,18 @@
:form-data="showFormData"></GLCombiForm> --> :form-data="showFormData"></GLCombiForm> -->
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
<GLTable ref="recordTable" :getListApi="getListApi" :searchForm="searchFormSearch" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn"> <GLTable ref="recordTable" :getListApi="getListApi" :searchForm="searchFormSearch" :tableParams="tableParams"
:beforeSearchFn="beforeSearchFn">
<template slot="profitAndLoss" slot-scope="scope"> <template slot="profitAndLoss" slot-scope="scope">
<span v-if="scope.scope.profitAndLoss || scope.scope.profitAndLoss == 0"> <span v-if="scope.scope.profitAndLoss || scope.scope.profitAndLoss == 0">
<span v-if="parseFloat(scope.scope.profitAndLoss) > 0" style="color: blue">{{ '+' + parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span> <span v-if="parseFloat(scope.scope.profitAndLoss) > 0" style="color: blue">{{ '+' +
<span v-else-if="parseFloat(scope.scope.profitAndLoss) < 0" style="color: red">{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span> parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米'
<span v-else>{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span> : '件') }}</span>
<span v-else-if="parseFloat(scope.scope.profitAndLoss) < 0" style="color: red">{{
parseFloat(scope.scope.profitAndLoss).toFixed(2) + (membraneTypeList.includes(scope.scope.goodsType) ? '米'
: '件') }}</span>
<span v-else>{{ parseFloat(scope.scope.profitAndLoss).toFixed(2) +
(membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') }}</span>
</span> </span>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
...@@ -55,6 +62,11 @@ export default { ...@@ -55,6 +62,11 @@ export default {
// width: '200px' // width: '200px'
}, },
{ {
label: '商品编码',
prop: 'productCode',
// width: 250
},
{
label: '系列', label: '系列',
prop: 'sourceMaterialName' prop: 'sourceMaterialName'
}, },
...@@ -97,12 +109,12 @@ export default { ...@@ -97,12 +109,12 @@ export default {
}, },
recordInfo: { recordInfo: {
type: Object, type: Object,
default: () => {} default: () => { }
} }
}, },
computed: {}, computed: {},
mounted() {}, mounted() { },
methods: { methods: {
beforeSearchFn() { beforeSearchFn() {
...@@ -125,6 +137,7 @@ export default { ...@@ -125,6 +137,7 @@ export default {
color: #2a58ad; color: #2a58ad;
margin: 0 2px; margin: 0 2px;
} }
.inventoryDetailDailog .el-dialog { .inventoryDetailDailog .el-dialog {
margin-top: 20vh !important; margin-top: 20vh !important;
min-width: 700px; min-width: 700px;
......
<!-- 盘点 --> <!-- 盘点 -->
<template> <template>
<GLDialog title="盘点" :visible.sync="inventoryNumVisible" class="inventoryNumDailog" @onCancel="handleClose" @onOk="handleAddConfirm"> <GLDialog title="盘点" :visible.sync="inventoryNumVisible" class="inventoryNumDailog" @onCancel="handleClose"
@onOk="handleAddConfirm">
<div class="gl-form-page gl-form-min"> <div class="gl-form-page gl-form-min">
<el-form ref="inventoryNumForm" :model="infoForm" :rules="formRules" label-width="154px" size="small"> <el-form ref="inventoryNumForm" :model="infoForm" :rules="formRules" label-width="154px" size="small">
<el-form-item label="盘点数量:" prop="inventoryNum"> <el-form-item label="盘点数量:" prop="inventoryNum">
...@@ -43,18 +44,18 @@ export default { ...@@ -43,18 +44,18 @@ export default {
}, },
recordInfo: { recordInfo: {
type: Object, type: Object,
default: () => {} default: () => { }
} }
}, },
watch: {}, watch: {},
created() {}, created() { },
components: {}, components: {},
computed: {}, computed: {},
mounted() {}, mounted() { },
methods: { methods: {
handleUpgradeNum(newVal) { handleUpgradeNum(newVal) {
...@@ -78,5 +79,4 @@ export default { ...@@ -78,5 +79,4 @@ export default {
} }
} }
</script> </script>
<style > <style ></style>
</style>
<!-- 新增/编辑优惠券 -->
<template>
<div>
<GLDialog :bigTitle="!couponInfo ? '新增精品礼券' : '编辑精品礼券'" mode="big" :visible.sync="couponsVisible" :before-close="handleAdd" @onCancel="handleAdd" @onOk="handleAddConfirm">
<el-form ref="couponAddForm" :model="couponsForm" :rules="formRules" label-width="140px">
<el-form-item label="精品礼券名称:" prop="couponName">
<el-input style="width: 216px;" v-model="couponsForm.couponName" placeholder="给礼券起个名字" maxlength="20" />
</el-form-item>
<el-form-item label="类型" prop="couponType">
<el-select :disabled="couponInfo" v-model="couponsForm.couponType">
<el-option v-for="(item, index) in baseData.productTypeList" :key="index" :label="item.goodsTypeName" :value="item.goodsType" />
</el-select>
</el-form-item>
<el-form-item label="是否收费">
<el-radio-group :disabled="couponInfo" v-model="couponsForm.chargeFlag">
<el-radio label="N">
免费
</el-radio>
<el-radio label="Y" disabled>
收费
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="礼券说明:" prop="remark">
<el-input type="textarea" :rows="10" placeholder="请输入内容" v-model="couponsForm.remark" />
</el-form-item>
<template v-if="couponInfo">
<el-form-item label="门店名称:">
<span>{{ couponInfo.merchantName }}</span>
</el-form-item>
<el-form-item label="券码数量:" prop="amount" :rules="[
{ required: true, message: '请输入券码数量', trigger: 'blur' },
{ validator: validateAccount, trigger: 'blur' }
]">
<el-input-number v-model="couponsForm.amount" :min="1" :max="99999" size="mini" />
</el-form-item>
</template>
<el-form-item v-if="!couponInfo" label="批量发放门店:" prop="merchantCouponDTOList" :rules="[{ required: true, message: '请选择门店', trigger: 'change' }]">
<el-button @click="handleAddStore">
添加
</el-button>
<selected-show-table :table-data="couponsForm.merchantCouponDTOList" @handleTableStoreDelete="handleTableStoreDelete">
<span slot="num" slot-scope="scope">
<el-input-number v-model="couponsNumList[scope.scope.index]" :min="1" :max="99999" size="mini" @change="handleNumChange(scope.scope.index)" />
<span class="car-error-txt" style="display: inline-block; padding-top: 2px;" v-show="!couponsNumList[scope.scope.index]">请输入数量</span>
</span>
</selected-show-table>
</el-form-item>
</el-form>
</GLDialog>
<relate-store-dialog v-if="relateStoreVisible" ref="relateStore" :relate-store-visible="relateStoreVisible" :source-page="sourcePage" :store-api="storeApi" :store-search-form="storeSearchForm" :store-selected="storeSelected" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose">
<el-row slot>
<el-form :model="storeSearchForm" :rules="rules" ref="relate" :inline="true">
<el-form-item label="园区店:">
<el-input v-model.trim="storeSearchForm.yqMerchantName" placeholder="园区店名称" @keydown.native="handleStoreInput" clearable />
</el-form-item>
<el-form-item label="4S店:">
<el-input v-model.trim="storeSearchForm.merchantName" placeholder="4S店名称" @keydown.native="handleStoreInput" clearable />
</el-form-item>
<el-button type="primary" @click="handleSearchStore">
搜索
</el-button>
</el-form>
</el-row>
</relate-store-dialog>
</div>
</template>
<script>
// import * as api from '@api/coupons'
import selectedShowTable from './selectedShowTable'
import relateStoreDialog from './relateStoreDialog'
// import { mapActions } from 'vuex'
// import { BaseData } from '@/common/constants.js'
// import { commodityAddSeviceMerchant } from '@/api/commodity'
// import { deepClone } from '@/common/util'
export default {
name: 'EditCouponsDialog',
data() {
return {
// userInfo: this.$store.state.d2admin.user.info,
userInfo: this.$globalState.session,
couponsForm: {
couponName: '',
couponType: '',
couponTypeName: '',
chargeFlag: 'N',
remark: '',
merchantCouponDTOList: []
},
couponsNumList: [],
remarkTemp: '1.本券外加本人身份证、行驶证方可免费体验价值1280元(前档680元+车身600元)的健康环保赠送膜。\n2.车主须提前3-5天预约施工,以便贴膜中心做好各项施工准备,未预约恕不接待。\n3.如车主需要更高品质全车太阳膜,本券可抵扣1280元(前档680元+车身600元)。\n4.如您的爱车已贴膜,来贴膜中心进行升级贴膜,需收取额外的撕膜除胶费300元,敬请谅解。\n5.本券仅在嘀加智享车生活贴膜施工中心使用。\n6.本券最终解释权归嘀加智享车生活贴膜中心所有。',
formRules: {
couponName: [{ required: true, message: '请输入精品礼券名称', trigger: 'change' }],
couponType: [{ required: true, message: '请选择类型', trigger: 'change' }],
remark: [{ required: true, message: '请输入礼券说明', trigger: 'change' }]
// merchantCouponDTOList: [{ required: true, message: '请选择门店', trigger: 'change' }]
},
// 关联门店
relateStoreVisible: false,
sourcePage: 'coupons',
storeSelected: [],
storeApi: this.$apis.coupons.commodityAddSeviceMerchant,
// storeApi: this.$apis.coupons.getSimpleMerchantList,
storeSearchForm: {
yqMerchantName: '',
merchantName: ''
},
// 基本数据
baseData: {
productTypeList: []
}
}
},
components: {
relateStoreDialog,
selectedShowTable
},
props: {
couponsVisible: {
type: Boolean,
default: false
},
// isAdd: {
// type: Boolean,
// default: false
// },
couponInfo: {
type: Object,
default: () => { }
}
},
watch: {
couponsVisible(value) {
if (value && this.couponInfo) {
var addAttr = ['chargeFlag', 'couponType', 'couponTypeName']
this.couponsForm = JSON.parse(JSON.stringify(this.couponInfo))
addAttr.forEach(item => {
this.couponsForm[item] = this.couponsForm.couponInfo[item]
})
// console.log(this.couponsForm)
}
}
},
mounted() {
// this.getBaseData()
this.getTypeList()
!this.couponInfo && (this.couponsForm.remark = this.remarkTemp)
},
methods: {
// ...mapActions({
// get: 'd2admin/base/get'
// }),
// async getBaseData() {
// this.baseData.productTypeList = JSON.parse(JSON.stringify((await this.get(BaseData.productType))
// },
getTypeList() {
this.$apis.coupons.getTypeList({}).then(res => {
this.baseData.productTypeList = res
})
},
validateAccount(rule, value, callback) {
value < this.couponInfo.amount ? callback(new Error(`数量不能小于${this.couponInfo.amount}张`)) : callback()
},
handleAdd() {
// this.couponsVisible = !this.couponsVisible
this.couponsForm = {
couponName: '',
couponType: '',
couponTypeName: '',
chargeFlag: 'N',
remark: this.remarkTemp,
merchantCouponDTOList: []
}
this.$emit('couponClose', false)
this.$refs.couponAddForm && this.$refs.couponAddForm.resetFields()
},
// 关联门店 - start
handleNumChange(idx) {
this.couponsForm.merchantCouponDTOList[idx].amount = this.couponsNumList[idx]
},
handleAddStore() {
this.storeSelected = JSON.parse(JSON.stringify(this.couponsForm.merchantCouponDTOList))
this.relateStoreVisible = !this.relateStoreVisible
},
handleRelateStoreClose() {
this.relateStoreVisible = !this.relateStoreVisible
this.relateCloseReset()
},
handleStoreInput(e) {
(e.keyCode === 13) && this.handleSearchStore()
},
handleSearchStore() {
this.$refs.relateStore.handleCurrentChange(1)
},
relateCloseReset() {
this.storeSelected = []
},
handleRelateStoreConfirm(selectedData) {
if (!selectedData.length) {
this.$message({
message: '请选择关联门店',
type: 'warning',
showClose: true
})
return true
}
this.couponsForm.merchantCouponDTOList = selectedData
this.couponsNumList = new Array(selectedData.length).fill(99999)
this.couponsForm.merchantCouponDTOList.forEach((item, idx) => {
if (!item.hasOwnProperty('amount')) {
item.amount = 99999
} else {
this.couponsNumList[idx] = item.amount
}
})
this.handleRelateStoreClose()
this.$refs.couponAddForm.clearValidate('merchantCouponDTOList')
},
// 关联门店 - end
handleTableStoreDelete(row) {
var idx = this.couponsForm.merchantCouponDTOList.findIndex(item => item.merchantId === row.merchantId)
this.couponsForm.merchantCouponDTOList.splice(idx, 1)
this.couponsNumList.splice(idx, 1)
},
handleAddConfirm() {
// console.log(this.couponsForm.remark)
console.log(this.userInfo)
this.$refs.couponAddForm.validate(valid => {
if (valid) {
var params = JSON.parse(JSON.stringify(this.couponsForm))
params.couponTypeName = this.baseData.productTypeList.find(item => item.goodsType === this.couponsForm.couponType).goodsTypeName
params.createdBy = this.userInfo.accountName
if (this.couponInfo) {
// 编辑
} else {
// 新增
if (!this.couponsForm.merchantCouponDTOList.every(item => item.amount)) {
return true
}
params.merchantCouponDTOList = []
this.couponsForm.merchantCouponDTOList.forEach((item, idx) => {
params.merchantCouponDTOList.push({
yqMerchantId: item.yqMerchantId,
yqMerchantName: item.yqMerchantName,
merchantId: item.merchantId,
merchantName: item.merchantName,
channelType: item.channelType,
amount: item.amount
})
})
}
console.log(params)
var apiName = this.couponInfo ? 'updateCouponApi' : 'addCouponApi'
this.$apis.coupons[apiName](params).then(res => {
this.$notify({
type: 'success',
title: res.message || '操作成功'
})
this.couponsForm = {
couponName: '',
couponType: '',
couponTypeName: '',
chargeFlag: 'N',
remark: this.remarkTemp,
merchantCouponDTOList: []
}
this.$refs.couponAddForm && this.$refs.couponAddForm.resetFields()
this.$emit('couponClose', true)
})
}
})
}
}
}
</script>
<style scoped>
</style>
<!-- 关联门店弹窗 -->
<template>
<GLDialog bigTitle="关联门店" :visible.sync="relateStoreVisible" mode="big" okText="关联" @onOk="handleRelateStoreConfirm" @onCancel="handleRelateStoreClose" class="relateStore">
<slot />
<el-row class="tableCon">
<!-- <el-col :span="12"> -->
<div class="tableBox">
<el-table ref="seletingTable" :data="selectingData" height="464px" class="table" border @select="handleChange" @select-all="handleAll">
<el-table-column type="selection" width="55" align="center" :selectable="selectable" />
<el-table-column v-if="sourcePage != 'serviceStore'" prop="yqMerchantName" label="园区店名称" align="center">
<template slot-scope="scope">
<span :class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{ scope.row.yqMerchantName }}</span>
</template>
</el-table-column>
<el-table-column prop="merchantName" label="4S店名称" align="center">
<template slot-scope="scope">
<span :class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{ scope.row.merchantName }}</span>
<el-tooltip v-if="!scope.row.isSetUpgradeSettleRule" popper-class="tooltip-class" effect="dark" content="该门店无配置财务分润规则,无法关联!" placement="top">
<span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)" class="tip-icon">?</span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<el-pagination small background @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pageSize" layout="total, prev, pager, next" :total="total" />
</div>
<!-- </el-col> -->
<!-- <el-col :span="12"> -->
<el-table :data="selectedData" class="table tableBox" border height="464px">
<el-table-column v-if="sourcePage != 'serviceStore'" prop="yqMerchantName" label="园区店名称" align="center" />
<el-table-column prop="merchantName" label="4S店名称" align="center" />
<el-table-column label="删除" align="center" width="50px">
<template slot-scope="scope">
<el-button class="el-icon-delete" @click="handleDelete(scope.row)" type="text" />
</template>
</el-table-column>
</el-table>
<!-- </el-col> -->
</el-row>
</GLDialog>
</template>
<script>
export default {
name: 'RelateStoreDialog',
data() {
return {
selectedData: [],
selectingData: [],
needTip: ['editProduct'],
// 分页
total: 0,
currentPage: 1,
pageSize: 20
}
},
props: {
relateStoreVisible: {
type: Boolean,
default: false
},
// 页面来源
sourcePage: {
type: String,
default: ''
},
storeApi: {
type: Function,
default: () => { }
},
storeSelected: {
type: Array,
default: () => []
},
storeSearchForm: {
type: Object,
default: () => { }
}
// 去掉表格中某些字段
// noTableField: {
// type: Array,
// default: () => []
// }
},
mounted() {
console.log('???/')
this.selectedData = this.storeSelected
this.getSelectingList()
},
methods: {
selectable(row, index) {
var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true
if (this.sourcePage === 'editProduct') {
// 不能选的判断
// console.log('??')
isSelect = row.isSetUpgradeSettleRule
}
return isSelect
},
recoverySelection() {
var exitIds = this.selectedData.map(item => item.merchantId)
this.selectingData.forEach(item => {
exitIds.includes(item.merchantId) && this.$refs.seletingTable.toggleRowSelection(item, true)
})
},
getSelectingList() {
this.storeApi({
...this.storeSearchForm,
currentPage: this.currentPage,
pageSize: this.pageSize
}).then(res => {
this.selectingData = res.list
this.total = res.total
this.$nextTick(() => {
this.recoverySelection()
})
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(item => item.merchantId === row.merchantId)
addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId))
},
handleAll(selection) {
this.selectingData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.merchantId === item.merchantId)
var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
if (selection.length && (isExit === -1) && !isServed) {
this.selectedData.push(item)
} else if (!selection.length && (isExit !== -1)) {
this.selectedData.splice(isExit, 1)
}
})
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId)
this.$refs.seletingTable.toggleRowSelection(row)
},
handleCurrentChange(val) {
this.currentPage = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
this.$emit('handleRelateStoreConfirm', this.selectedData)
},
handleRelateStoreClose() {
this.$emit('handleRelateStoreClose')
}
}
}
</script>
<style lang="scss">
.relateStore .table {
margin: 0 auto 20px !important;
width: 98%;
}
.relateStore .tableCon {
display: flex;
.tableBox {
flex: 1;
}
}
.service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
}
.service-store .relateStore .el-table--medium td,
.d2-form .relateStore .el-table--medium td {
padding: 6px 8px !important;
}
.relateStore .red {
color: red;
}
.relateStore .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
</style>
<!-- 被选中门店展示 -->
<template>
<div>
<el-table :data="tableData" style="width: 690px" border class="store-table">
<el-table-column label="序号" align="center" type="index" width="64px" />
<el-table-column prop="yqMerchantName" label="园区店名称" align="center" />
<el-table-column prop="merchantName" label="4S店名称" align="center" />
<el-table-column prop="merchantId" label="商户编号" align="center" />
<el-table-column prop="userType" label="商户类型" align="center">
<template slot-scope="scope">
<span>{{ baseData[scope.row.channelType === 2 ? 'ghUserTypeList' : 'userTypeList'][scope.row.userType] }}</span>
</template>
</el-table-column>
<el-table-column label="删除" align="center">
<template slot-scope="scope">
<el-button class="el-icon-delete" @click="handleDelete(scope.row)" type="text" />
</template>
</el-table-column>
<el-table-column label="券码数量(张)" align="center" width="160px">
<template slot-scope="scope">
<slot name="num" :scope="{row: scope.row, index: scope.$index}" />
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
// import { userType, ghUserType } from '@/common/constants.js'
export default {
name: 'SelectedShowTable',
data() {
return {
// 基本数据
baseData: {
userTypeList: [],
ghUserTypeList: []
}
}
},
props: {
tableData: {
type: Array,
default: () => []
}
},
components: {},
computed: {},
mounted() { },
methods: {
handleDelete(row) {
this.$confirm('是否确认删除该门店?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$emit('handleTableStoreDelete', row)
})
}
}
}
</script>
<style scoped>
</style>
const couponsObj = {
searchFormData: [
{
label: '礼券名称',
name: 'couponName',
type: 'input',
isClear: true
},
{
label: '门店名称',
name: 'merchantName',
type: 'input',
isClear: true
},
{
label: '类型',
name: 'couponTypeList',
type: 'select',
multiple: true,
optionList: [],
optionId: 'goodsType',
optionLabel: 'goodsTypeName',
optionsName: 'typeList'
},
{
label: '状态',
name: 'enabledFlagList',
type: 'select',
multiple: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'enabledFlagList'
},
{
label: '发券人',
name: 'employeeNameKeyword',
type: 'input',
isClear: true,
isHide: true
},
{
label: '核销状态',
name: 'usedFlagList',
type: 'select',
multiple: true,
isHide: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'usedFlagList'
},
{
label: '核销人',
name: 'sellerNameList',
type: 'select',
multiple: true,
isHide: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'sellerNameList'
}
]
}
export default {
couponsObj
}
<template>
<div class="purchase">
<div class="container">
<GLCombiForm :key="refresh" ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header">
<el-tabs v-model="activeName" type="card" @tab-click="handleTabChange">
<el-tab-pane label="店面列表" name="storeList"></el-tab-pane>
<el-tab-pane label="领用明细" name="couponsDetail"></el-tab-pane>
</el-tabs>
<div class="btn">
<GLButton v-show="activeName == 'storeList'" type="primary" size="small" @click="handleEdit('add', {})" fn="新增">新增</GLButton>
<el-button size="small" @click="handleExport">导出</el-button>
</div>
</div>
<!-- 店面列表 - 表格区域 开始 -->
<GLTable v-show="activeName == 'storeList'" ref="storeRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @sortChange="sortChange">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
<!-- 领用明细 - 表格区域 开始 -->
<GLTable v-show="activeName == 'couponsDetail'" ref="detailRef" :getListApi="getDetailListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="detailTableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @sortChange="detailSortChange"></GLTable>
<!-- 表格区域 end -->
</div>
<edit-coupons-dialog :coupons-visible="couponsVisible" :coupon-info="couponInfo" @couponClose="couponClose" />
</div>
</template>
<script>
import url from '@/assets/empty.png'
import constData from './constant/data'
import editCouponsDialog from './components/editCouponsDialog'
import { getOptionsList, aToExport } from '@/utils/index'
import * as dayjs from 'dayjs'
// import baseList from './constant/baseList'
export default {
name: 'coupons',
components: {
editCouponsDialog
},
data() {
return {
refresh: new Date(),
size: 'small',
url: url,
activeName: 'storeList',
searchForm: {
couponName: '',
merchantName: ''
},
couponInfo: null,
searchFormData: constData.couponsObj.searchFormData,
sortObj: {
amount: {
ascending: 1,
descending: 2
},
allowance: {
ascending: 3,
descending: 4
},
getAmount: {
ascending: 5,
descending: 6
},
usedAmount: {
ascending: 7,
descending: 8
}
},
detailSortObj: {
createdDate: {
descending: 0,
ascending: 1
},
usedTime: {
ascending: 2,
descending: 3
}
},
// 表格
getListApi: this.$apis.coupons.getListApi,
tableParams: {
needUnique: true,
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '批次号',
prop: 'merchantCouponCode'
},
{
label: '礼券名称',
prop: 'couponName'
},
{
label: '类型',
prop: 'couponTypeName',
formatter: cellValue => {
return cellValue.couponInfo?.couponTypeName || ''
}
},
{
label: '门店名称',
prop: 'merchantName',
width: '200px',
formatter: cellValue => {
return cellValue.merchantName + (cellValue.yqMerchantName ? ' - ' + cellValue.yqMerchantName : '')
}
},
{
label: '总数',
prop: 'amount',
sortable: 'custom'
},
{
label: '余量',
prop: 'allowance',
sortable: 'custom',
formatter: cellValue => {
return cellValue.amount - cellValue.getAmount
}
},
{
label: '发放量',
prop: 'getAmount',
sortable: 'custom'
},
{
label: '核销量',
prop: 'usedAmount',
sortable: 'custom'
},
{
label: '状态',
prop: 'enabledFlag',
formatter: cellValue => {
return {
Y: '启用',
N: '停用'
}[cellValue.enabledFlag]
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 表格按钮
tableButtonList: [
{
type: 'GLButton',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑'
},
listeners: {
click: row => this.handleEdit('edit', row)
}
},
{
type: 'GLButton',
name: '停用',
attrs: {
type: 'text',
fn: '停用'
},
condition: row => {
return row.enabledFlag == 'Y'
},
listeners: {
click: row => this.handleStop(row)
}
},
{
type: 'GLButton',
name: '启用',
attrs: {
type: 'text',
fn: '启用'
},
condition: row => {
return row.enabledFlag == 'N'
},
listeners: {
click: row => this.handleStop(row)
}
},
{
type: 'GLButton',
name: '删除',
attrs: {
type: 'text',
fn: '删除'
},
listeners: {
click: row => this.handleDelete(row)
}
}
],
// 领用详情
getDetailListApi: this.$apis.coupons.getDetailListApi,
detailTableParams: {
listName: 'list',
tableColumns: [
{
label: '领用时间',
prop: 'createdDate',
sortable: 'custom',
width: '180px',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '车主姓名',
prop: 'customerName'
},
{
label: '手机号',
prop: 'customerPhone',
width: '140px'
},
{
label: '礼券名称',
prop: 'couponName'
},
{
label: '类型',
prop: 'couponTypeName'
},
{
label: '门店名称',
prop: 'merchantName',
width: '200px',
formatter: cellValue => {
return cellValue.merchantName + (cellValue.yqMerchantName ? ' - ' + cellValue.yqMerchantName : '')
}
},
{
label: '发券人',
prop: 'employeeName',
optionConfig: {
searchItemName: 'employeeNameList',
optionId: 'confId',
optionLabel: 'confValue'
}
},
{
label: '核销状态',
prop: 'usedFlag',
width: '100px',
formatter: cellValue => {
return {
N: '待核销',
Y: '已核销'
}[cellValue.usedFlag]
},
optionConfig: {
searchItemName: 'usedFlagList',
optionId: 'confId',
optionLabel: 'confValue'
}
},
{
label: '核销人',
prop: 'sellerName'
},
{
label: '核销时间',
prop: 'usedTime',
sortable: 'custom',
width: '180px',
formatter: cellValue => {
return cellValue.usedTime ? dayjs(cellValue.usedTime).format('YYYY-MM-DD HH:mm:ss') : ''
}
}
]
},
// 新增
couponsVisible: false,
// 基本数据
baseData: {
typeList: [],
enabledFlagList: [
{ confLabel: '启用', confId: 'Y' },
{ confLabel: '停用', confId: 'N' }
],
usedFlagList: [
{ confLabel: '待核销', confId: 'N' },
{ confLabel: '已核销', confId: 'Y' }
],
sellerNameList: []
},
imgVisible: false,
previewImgUrl: ''
}
},
mounted() {
getOptionsList(this, 'searchFormData', false)
this.getTypeList()
this.getDistinctColum()
},
methods: {
getTypeList() {
this.$apis.coupons.getTypeList({}).then(res => {
this.baseData.typeList = res
getOptionsList(this, 'searchFormData', false, 'couponTypeList')
})
},
getDistinctColum() {
// columType属性类型(1:发券人;2:转化人)
this.$apis.coupons.getDistinctColum({ columType: 2, currentPage: 1, pageSize: 100 }).then(res => {
let _list = []
res.forEach(item => {
_list.push({
confId: item,
confName: item
})
})
this.baseData.sellerNameList = _list
getOptionsList(this, 'searchFormData', false, 'sellerNameList')
})
},
/** 二次确认封装 */
secondConfirm(that, title, txt, apiModule, apiName, apiParams, type = 'warning', fn) {
that.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type,
callback: action => {
if (action == 'confirm') {
that.$apis[apiModule][apiName](apiParams).then(res => {
that.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
that.handleSearch()
}
})
}
}
})
},
changeFormAttr(formName, attrName, labelList, attrValue) {
labelList.forEach(item => {
let idx = this[formName].findIndex(k => k.label == item)
this[formName][idx][attrName] = attrValue
})
},
// tab切换
handleTabChange() {
this.refresh = new Date()
let storeAttrList = ['状态']
let couponAttrList = ['发券人', '核销状态', '核销人']
this.changeFormAttr('searchFormData', 'isHide', storeAttrList, this.activeName != 'storeList')
this.changeFormAttr('searchFormData', 'isHide', couponAttrList, this.activeName != 'couponsDetail')
this.handleReset()
},
// 停用
handleStop(row) {
let params = {
id: row.id,
enabledFlag: row.enabledFlag === 'Y' ? 'N' : 'Y'
}
let txt = row.enabledFlag === 'Y' ? '停用' : '启用'
this.secondConfirm(this, txt + '提示', '是否' + txt + '该礼券?', 'coupons', 'updateCouponApi', params)
},
// 删除
handleDelete(row) {
let params = {
id: row.id
}
this.secondConfirm(this, '删除提示', '是否确认删除该礼券?', 'coupons', 'deleteCouponApi', params)
},
// 导出
handleExport() {
let params = {
...this.searchForm,
currentPage: 1,
pageSize: 9999
}
let apiName = {
storeList: 'exportCoupon',
couponsDetail: 'exportCustomerCoupon'
}
this.$apis.coupons[apiName[this.activeName] || 'storeList'](params).then(res => {
aToExport(res.data)
})
},
// 排序
sortChange({ col, prop, order }) {
this.searchForm.orderByType = this.sortObj[prop][order]
this.handleSearch()
},
// 领用明细-排序
detailSortChange({ col, prop, order }) {
this.searchForm.orderByType = this.detailSortObj[prop][order]
this.handleSearch()
},
handleSearch() {
let refName = this.activeName == 'storeList' ? 'storeRef' : 'detailRef'
this.$refs[refName].refreshTable()
},
handleReset() {
this.searchForm = {
couponName: '',
merchantName: ''
}
this.handleSearch()
},
handleEdit(editType, info) {
this.couponsVisible = !this.couponsVisible
this.couponInfo = editType == 'edit' ? info : null
},
couponClose(isRefresh) {
this.couponsVisible = !this.couponsVisible
isRefresh && this.handleSearch()
}
}
}
</script>
<style scoped>
.table-header {
position: relative;
}
.btn {
position: absolute;
right: 0;
top: 0;
}
</style>
...@@ -32,7 +32,8 @@ export default { ...@@ -32,7 +32,8 @@ export default {
upgradeGoodsName: '', upgradeGoodsName: '',
yqMerchantId: '', yqMerchantId: '',
goodsType: '', goodsType: '',
goodsSeries: '' goodsSeries: '',
productCode: ''
}, },
tableSearchForm: {}, tableSearchForm: {},
stockInfo: {}, stockInfo: {},
...@@ -45,7 +46,12 @@ export default { ...@@ -45,7 +46,12 @@ export default {
maxlength: '20', maxlength: '20',
isClear: true isClear: true
}, },
{
label: '商品编码',
name: 'productCode',
type: 'input',
isClear: true
},
{ {
label: '系列', label: '系列',
name: 'goodsSeries', name: 'goodsSeries',
...@@ -83,6 +89,10 @@ export default { ...@@ -83,6 +89,10 @@ export default {
prop: 'upgradeGoodsName' prop: 'upgradeGoodsName'
}, },
{ {
label: '商品编码',
prop: 'productCode'
},
{
label: '系列', label: '系列',
prop: 'goodsSeries' prop: 'goodsSeries'
}, },
...@@ -197,7 +207,9 @@ export default { ...@@ -197,7 +207,9 @@ export default {
upgradeGoodsName: '', upgradeGoodsName: '',
yqMerchantId: '', yqMerchantId: '',
goodsType: '', goodsType: '',
goodsSeries: '' goodsSeries: '',
productCode: ''
} }
this.handleSearch() this.handleSearch()
} }
......
...@@ -2,14 +2,17 @@ ...@@ -2,14 +2,17 @@
<template> <template>
<div class="purchase"> <div class="purchase">
<div class="container"> <div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch"
@handleRest="handleReset"></GLCombiForm>
<div class="table-header"> <div class="table-header">
<h2>出库列表</h2> <h2>出库列表</h2>
<el-button type="primary" size="small" @click="exportExcel">导出</el-button> <el-button type="primary" size="small" @click="exportExcel">导出</el-button>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="outboundRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"></GLTable> <GLTable ref="outboundRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm"
:tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"></GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
</div> </div>
...@@ -33,7 +36,8 @@ export default { ...@@ -33,7 +36,8 @@ export default {
yqMerchantId: '', yqMerchantId: '',
goodsType: '', goodsType: '',
businessCode: '', businessCode: '',
goodsSeries: '' goodsSeries: '',
productCode: ''
}, },
tableSearchForm: {}, tableSearchForm: {},
paramsObj: {}, paramsObj: {},
...@@ -64,6 +68,12 @@ export default { ...@@ -64,6 +68,12 @@ export default {
isClear: true isClear: true
}, },
{ {
label: '商品编码',
name: 'productCode',
type: 'input',
isClear: true
},
{
label: '出库门店', label: '出库门店',
name: 'yqMerchantId', name: 'yqMerchantId',
type: 'select', type: 'select',
...@@ -72,6 +82,14 @@ export default { ...@@ -72,6 +82,14 @@ export default {
optionLabel: 'merchantName', optionLabel: 'merchantName',
optionsName: 'yqMerchantList' optionsName: 'yqMerchantList'
}, },
{
label: '使用门店',
name: 'storeUsage',
type: 'input',
maxlength: '20',
isClear: true
},
{ {
label: '所属分类', label: '所属分类',
name: 'goodsType', name: 'goodsType',
...@@ -117,6 +135,12 @@ export default { ...@@ -117,6 +135,12 @@ export default {
line: 1 line: 1
}, },
{ {
label: '商品编码',
prop: 'productCode',
width: 180,
line: 1
},
{
label: '系列', label: '系列',
prop: 'goodsSeries' prop: 'goodsSeries'
}, },
...@@ -156,6 +180,15 @@ export default { ...@@ -156,6 +180,15 @@ export default {
label: '出库门店', label: '出库门店',
prop: 'yqMerchantName', prop: 'yqMerchantName',
width: 200 width: 200
},
{
// label: '适用门店',
label: '使用门店',
prop: 'storeUsage',
width: 200,
formatter: cellValue => {
return cellValue.storeUsage || '-'
}
} }
] ]
}, },
...@@ -258,7 +291,8 @@ export default { ...@@ -258,7 +291,8 @@ export default {
yqMerchantId: '', yqMerchantId: '',
goodsType: '', goodsType: '',
businessCode: '', businessCode: '',
goodsSeries: '' goodsSeries: '',
productCode: ''
} }
this.handleSearch() this.handleSearch()
} }
...@@ -268,10 +302,12 @@ export default { ...@@ -268,10 +302,12 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/assets/css/mixin.scss'; @import '@/assets/css/mixin.scss';
.purchase { .purchase {
.table-header { .table-header {
@include space-between_center; @include space-between_center;
margin-bottom: 10px; margin-bottom: 10px;
h2 { h2 {
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;
......
...@@ -40,7 +40,8 @@ export default { ...@@ -40,7 +40,8 @@ export default {
upgradeGoodsName: '', upgradeGoodsName: '',
yqMerchantId: '', yqMerchantId: '',
goodsType: '', goodsType: '',
goodsSeries: '' goodsSeries: '',
productCode: ''
}, },
tableSearchForm: {}, tableSearchForm: {},
stockInfo: {}, stockInfo: {},
...@@ -53,7 +54,12 @@ export default { ...@@ -53,7 +54,12 @@ export default {
maxlength: '20', maxlength: '20',
isClear: true isClear: true
}, },
{
label: '商品编码',
name: 'productCode',
type: 'input',
isClear: true
},
{ {
label: '系列', label: '系列',
name: 'goodsSeries', name: 'goodsSeries',
...@@ -93,6 +99,12 @@ export default { ...@@ -93,6 +99,12 @@ export default {
line: 1 line: 1
}, },
{ {
label: '商品编码',
prop: 'productCode',
width: 180,
line: 1
},
{
label: '系列', label: '系列',
prop: 'goodsSeries' prop: 'goodsSeries'
}, },
...@@ -195,7 +207,7 @@ export default { ...@@ -195,7 +207,7 @@ export default {
}, },
exportExcel() { exportExcel() {
this.exportLoading = true this.exportLoading = true
var params = this.searchForm var params = this.tableSearchForm
this.$apis.stockManage.exportMerchantExcel(params).then(res => { this.$apis.stockManage.exportMerchantExcel(params).then(res => {
window.location.href = res window.location.href = res
}) })
...@@ -209,7 +221,8 @@ export default { ...@@ -209,7 +221,8 @@ export default {
upgradeGoodsName: '', upgradeGoodsName: '',
yqMerchantId: '', yqMerchantId: '',
goodsType: '', goodsType: '',
goodsSeries: '' goodsSeries: '',
productCode: ''
} }
this.handleSearch() this.handleSearch()
}, },
......
<template> <template>
<GLDialog class="stock-dialog" v-if="stockMonthVisible" :destroy-on-close="true" bigTitle="月度库存结算单" mode="big" okText="关闭" :visible.sync="stockMonthVisible" :close-on-click-modal="false" @onOk="handleClose" @onCancel="handleClose"> <GLDialog class="stock-dialog" v-if="stockMonthVisible" :destroy-on-close="true" :before-close="handleClose" bigTitle="月度库存结算单" mode="big" okText="关闭" :visible.sync="stockMonthVisible" :close-on-click-modal="false" @onOk="handleClose" @onCancel="handleClose">
<div class="detail-content" v-if="stockMonthVisible"> <div class="detail-content" v-if="stockMonthVisible">
<el-form :inline="true" :model="searchForm" size="small"> <el-form :inline="true" :model="searchForm" size="small">
<el-form-item label="年度:"> <el-form-item label="年度:">
...@@ -150,6 +150,7 @@ export default { ...@@ -150,6 +150,7 @@ export default {
}, },
handleClose() { handleClose() {
console.log(111)
this.$emit('dialogClose') this.$emit('dialogClose')
} }
} }
......
<template> <template>
<div class="purchase"> <div class="purchase">
<div class="container"> <div class="container">
...@@ -33,7 +32,8 @@ export default { ...@@ -33,7 +32,8 @@ export default {
yqMerchantId: '', yqMerchantId: '',
goodsType: '', goodsType: '',
businessCode: '', businessCode: '',
goodsSeries: '' goodsSeries: '',
productCode: ''
}, },
tableSearchForm: {}, tableSearchForm: {},
paramsObj: {}, paramsObj: {},
...@@ -64,6 +64,12 @@ export default { ...@@ -64,6 +64,12 @@ export default {
isClear: true isClear: true
}, },
{ {
label: '商品编码',
name: 'productCode',
type: 'input',
isClear: true
},
{
label: '入库门店', label: '入库门店',
name: 'yqMerchantId', name: 'yqMerchantId',
type: 'select', type: 'select',
...@@ -117,6 +123,12 @@ export default { ...@@ -117,6 +123,12 @@ export default {
line: 1 line: 1
}, },
{ {
label: '商品编码',
prop: 'productCode',
width: 180,
line: 1
},
{
label: '系列', label: '系列',
prop: 'goodsSeries', prop: 'goodsSeries',
width: 150, width: 150,
...@@ -132,7 +144,7 @@ export default { ...@@ -132,7 +144,7 @@ export default {
label: '入库数量', label: '入库数量',
prop: 'increaseStockNum', prop: 'increaseStockNum',
formatter: cellValue => { formatter: cellValue => {
return cellValue.increaseStockNum || cellValue.increaseStockNum == 0 ? parseFloat(cellValue.increaseStockNum).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-' return cellValue.increaseStockNum || cellValue.increaseStockNum == 0 ? parseFloat(cellValue.increaseStockNum).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) && cellValue.goodsType != this.$purchaseType? '米' : '件') : '-'
}, },
width: 120 width: 120
}, },
...@@ -302,7 +314,8 @@ export default { ...@@ -302,7 +314,8 @@ export default {
yqMerchantId: '', yqMerchantId: '',
goodsType: '', goodsType: '',
businessCode: '', businessCode: '',
goodsSeries: '' goodsSeries: '',
productCode: ''
} }
this.handleSearch() this.handleSearch()
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!