Commit 300ddae3 by wangql

提交版本功能代码

1 parent 004c98f8
import request from "./request"
import RequestMethods from "./request.methods"
const path = "dj.api.smartcarlife.pos.trm."
// 删除设备绑定
export function trmDelete(data) {
data.method = `${path}delete`
return request(data)
}
// 查询设备详情
export function trmDetail(data) {
data.method = `${path}detail`
return request(data, RequestMethods.POST)
}
// 查询设备管理历史记录
export function trmHistory(data) {
data.method = `${path}history`
return request(data, RequestMethods.POST)
}
// 设备信息查询列表
export function trmList(data) {
data.method = `dj.api.life.pos.trm.list`
return request(data, RequestMethods.POST)
}
// 增加设备绑定
export function trmSave(data) {
data.method = `${path}save`
return request(data, RequestMethods.POST)
}
// 更新设备绑定
export function trmUpdate(data) {
data.method = `${path}update`
return request(data, RequestMethods.POST)
}
// 4s店列表
export function getShopMerchantList(data) {
data.method = `dj.smartcarlife.api.shopMerchant.list`
return request(data, RequestMethods.POST)
}
......@@ -125,6 +125,12 @@ export const routerName = {
parentId: "90603",
label: "删除",
handle: "handleDelete"
},
{
authId: "90603011",
parentId: "90603",
label: "收款码",
handle: "collectionQRcode"
}
],
component: _import("systemConfig/merchant/merchantManage")
......@@ -444,5 +450,85 @@ export const routerName = {
activePath: "/costCategoryManage"
},
component: _import("systemConfig/costCategoryManage/editReconciliation")
},
90617: {
path: "/deviceManage",
name: "deviceManage",
meta: {
title: "设备管理",
authId: "90617",
parentId: "906",
cache: false
},
auth: [
{
authId: "9061701",
parentId: "90617",
label: "添加",
icon: "plus",
category: "Button",
type: "primary",
handle: "handleAdd",
addRoutePath: [
{
authId: "9061705",
name: "编辑设备",
parentId: "90617"
}
]
},
{
authId: "9061702",
parentId: "90617",
label: "编辑",
handle: "handleEdit"
},
{
authId: "9061703",
parentId: "90617",
label: "历史记录",
handle: "handleHistory",
addRoutePath: [
{
authId: "9061706",
name: "历史记录",
parentId: "90617"
}
]
},
{
authId: "9061704",
parentId: "90617",
label: "删除",
handle: "handleDelete"
}
],
component: _import("systemConfig/deviceManage/deviceList")
},
9061705: {
path: "/editDevice",
name: "editDevice",
meta: {
title: "编辑对账类目",
authId: "9061705",
parentId: "90617",
cache: false,
sideHidden: false,
activePath: "/deviceManage"
},
component: _import("systemConfig/deviceManage/editDevice")
},
9061706: {
path: "/deviceHistory",
name: "deviceHistory",
meta: {
title: "历史记录",
authId: "9061706",
parentId: "90617",
cache: false,
sideHidden: false,
activePath: "/deviceManage"
},
component: _import("systemConfig/deviceManage/deviceHistory")
}
}
......@@ -71,33 +71,33 @@
<!-- 已分帐无可操作内容 -->
<div v-if="scope.scope.inputStatus !== '6'">
<el-button type="text"
v-if="scope.scope.inputStatus == '1'"
@click="orderDetail(scope.scope)">
v-if="scope.scope.inputStatus == '1'"
@click="orderDetail(scope.scope)">
订单详情
</el-button>
<el-button type="text"
v-if="scope.scope.inputStatus == '0'"
@click="relatActivityOrder(scope.scope)">
v-if="scope.scope.inputStatus == '0'"
@click="relatActivityOrder(scope.scope)">
关联活动订单
</el-button>
<el-button type="text"
v-if="scope.scope.inputStatus == '4'"
@click="record(scope.scope)">
v-if="scope.scope.inputStatus == '4'"
@click="record(scope.scope)">
确认补录
</el-button>
<el-button type="text"
v-if="scope.scope.inputStatus == '4'"
@click="cancelRelat(scope.scope)">
v-if="scope.scope.inputStatus == '4'"
@click="cancelRelat(scope.scope)">
取消关联
</el-button>
<el-button type="text"
v-if="scope.scope.inputStatus == '5'"
@click="chooseRule(scope.scope)">
v-if="scope.scope.inputStatus == '5'"
@click="chooseRule(scope.scope)">
发起分账
</el-button>
<el-button type="text"
v-if="scope.scope.manualFlag == '1'"
@click="ruleHistory(scope.scope)">
v-if="scope.scope.manualFlag == '1'"
@click="ruleHistory(scope.scope)">
分账记录
</el-button>
</div>
......@@ -131,7 +131,7 @@
<script>
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { getParkStore } from '@api/editCustomer'
import { getServiceStore, getParkStore } from '@api/editCustomer'
import { payTypeList } from '@/common/constants.js'
import { waitinputorderCount, waitinputorderPage, getList, markAsNoUse, batchUpdateToNotInput, batchUpdateConfirmInput } from '@api/order'
import updateYqMerchantDialog from './updateYqMerchantDialog'
......@@ -158,7 +158,8 @@ export default {
inputStatus: '',
yqMerchantId: '',
posTrmNo: '',
payType: ''
payType: '',
shopMerchantId: ''
},
searchFormSearch: {},
searchSelectObj: {
......@@ -215,7 +216,36 @@ export default {
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'parkServiceList'
optionsName: 'parkServiceList',
changeAttr: (value, targetItem) => {
if (value) {
// 获取流量方
this.getServiceStore(value)
} else {
this.baseData.storeIdList = []
}
this.searchForm.shopMerchantId = ''
this.getOptionsList()
}
}, {
label: '流量来源',
name: 'shopMerchantId',
type: 'select',
noDataText: '请先选择服务对接',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'storeIdList',
// changeAttr: (value, targetItem) => {
// if (value) {
// // // 获取二级流量方
// this.getDiversionMerchantRef(value)
// } else {
// this.baseData.subShopMerchantList = []
// }
// this.searchForm.subShopMerchantId = ''
// this.getOptionsList()
// }
}, {
label: '终端编码',
name: 'posTrmNo',
......@@ -280,6 +310,15 @@ export default {
// label: '园区店商户号',
prop: 'yqMerchantId',
width: '120px'
}, {
label: '流量方',
prop: 'shopMerchantName',
width: '200px'
},
{
label: '流量方商户号',
prop: 'shopMerchantId',
width: '120px'
},
{
label: '通知状态',
......@@ -343,7 +382,8 @@ export default {
confLabel: '已分帐'
}
],
payTypeList: clonePayTypeList
payTypeList: clonePayTypeList,
storeIdList: [],
},
merchantDialogVisible: false,
......@@ -434,7 +474,8 @@ export default {
inputStatus: '',
yqMerchantId: '',
posTrmNo: '',
payType: ''
payType: '',
shopMerchantId: ''
}
this.searchSelectObj = {
orderOrTrade: {
......@@ -442,6 +483,7 @@ export default {
value: ''
}
}
this.baseData.storeIdList = []
this.$refs.recordTable.refreshTable()
this.getCount()
},
......@@ -669,7 +711,16 @@ export default {
if (flag) {
this.$refs.recordTable.refreshTable()
}
}
},
getServiceStore(merchantId) {
getServiceStore({
yqMerchantId: merchantId
}).then(res => {
this.baseData.storeIdList = res || []
this.getOptionsList()
})
},
}
}
......
<!-- 设备管理 -->
<template>
<d2-container class="service-manage">
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData" />
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">
<auth-button category="Button" /></span>
</d2-table-header>
<d2-table ref="deviceTable"
:search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope" />
</d2-table>
</div>
</d2-container>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { trmList, trmDelete } from '@api/deviceManage'
import { mapActions } from 'vuex'
import { BaseData } from '@/common/constants.js'
export default {
name: 'DviceList',
data() {
return {
searchForm: {
posTrmNo: '',
searchMerchantName: '',
searchMerchantId: ''
},
showFormData: [{
label: '终端编码',
name: 'posTrmNo',
type: 'input',
placeholder: '请输入POS机的终端编码',
maxlength: '20',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '商户名称',
name: 'searchMerchantName',
type: 'input',
placeholder: '请输入流量方/园区店名称',
maxlength: '20',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '商户号',
name: 'searchMerchantId',
type: 'input',
inputType: 'number',
maxlength: '20',
placeholder: '请输入流量方/园区店商户号',
isClear: true,
keyFn: this.keyDowmGetList
}],
maxLength: 10,
getListApi: trmList,
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [{
label: '终端编码',
prop: 'posTrmNo'
}, {
label: '关联园区店',
prop: 'yqMerchantName'
}, {
label: '园区店商户号',
prop: 'yqMerchantId',
width: '120'
}, {
label: '关联流量方',
prop: 'merchantName'
}, {
label: '流量方商户号',
prop: 'merchantId',
width: '120'
}, {
label: '最近更新时间',
prop: 'updatedDate',
width: '160',
formatter: (cellValue) => {
return Util.dateFormate(cellValue.updatedDate, 'YYYY-MM-DD HH:mm:ss')
}
}]
},
baseData: {
}
}
},
components: {
},
mounted() {
this.getBaseData()
// this.$nextTick(() => {
// this.$refs.deviceTable.page.pageSize = 10
// })
},
methods: {
...mapActions({ close: 'd2admin/page/close' }),
async getBaseData() {
this.getOptionsList()
},
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
keyDowmGetList() {
this.$refs.deviceTable.refreshTable()
},
handleReset() {
this.searchForm = {
posTrmNo: '',
searchMerchantName: '',
searchMerchantId: ''
}
this.$refs.deviceTable.refreshTable()
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (
this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部'
) {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(
this.showFormData[index],
'optionList',
this.baseData[item.optionsName]
)
}
})
},
handleAdd() {
this.close({ tagName: '/editDevice' })
this.$router.push({
name: 'editDevice',
params: {
addOrEdit: 'add'
}
})
},
handleEdit(row) {
this.close({ tagName: '/editDevice' })
this.$router.push({
name: 'editDevice',
params: {
addOrEdit: 'edit',
info: row
}
})
},
// 删除
handleDelete(row) {
this.$confirm("删除后不可恢复,是否确定删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
trmDelete({ id: row.id }).then((res) => {
this.notice.okTips()
this.$refs.deviceTable.refreshTable()
})
})
.catch((err) => {
console.log(err)
})
},
handleHistory(row) {
this.close({ tagName: '/deviceHistory' })
this.$router.push({
name: 'deviceHistory',
params: {
info: row
}
})
},
}
}
</script>
<style scoped>
</style>
<!-- 编辑分账类目 -->
<template>
<d2-container>
<el-form ref="editDeviceFrom"
class="editDeviceFrom d2-container-content"
:model="form"
:rules="formRules"
label-width="150px"
v-loading="$store.state.d2admin.loading.value">
<el-form-item label=""
prop="posTrmNo">
<span class="tips-block"
slot="label">
<span class="tips-label">终端编码</span>
<el-tooltip popper-class="tooltip-class"
effect="dark"
placement="right">
<div slot="content">说明:为确保POS机产生的流水能正确关联,请准确填写银盛POS机的终端编码。</div>
<span class="tips-icon" />
</el-tooltip>:
</span>
<el-input v-model.trim="form.posTrmNo"
maxlength="8"
class="itd"
placeholder="请输入POS机的终端编码"
:disabled="isDisabled"
clearable />
</el-form-item>
<el-form-item label=""
prop="yqMerchantId">
<span class="tips-block"
slot="label">
<span class="tips-label">关联园区店</span>
<el-tooltip popper-class="tooltip-class"
effect="dark"
placement="right">
<div slot="content">说明:关联园区店后,终端编码对应的POS机产生的流水会自动关联上该园区店,可在“订单管理-待补录订单”中查询。</div>
<span class="tips-icon" />
</el-tooltip>:
</span>
<el-select v-model="form.yqMerchantId"
style="width: 400px"
placeholder="请选择关联园区店"
clearable
filterable>
<el-option v-for="(item,index) in parkServiceList"
:key="item.index"
:label="item.merchantName"
:value="item.merchantNo" />
</el-select>
</el-form-item>
<el-form-item label=""
prop="merchantId">
<span class="tips-block"
slot="label">
<span class="tips-label">关联流量方</span>
<el-tooltip popper-class="tooltip-class"
effect="dark"
placement="right">
<div slot="content">说明:关联流量方后,终端编码对应的POS机产生的流水会自动关联上该流量方,可在“订单管理-待补录订单”中查询。</div>
<span class="tips-icon" />
</el-tooltip>:
</span>
<el-select v-model="form.merchantId"
style="width: 400px"
placeholder="请选择关联流量方"
clearable
filterable>
<el-option v-for="(item,index) in merchantList"
:key="item.index"
:label="item.merchantName"
:value="item.merchantNo" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="handleSave"
:disabled="$store.state.d2admin.loading.value"
class="ok-btn">
保存
</el-button>
<el-button class="cancel-btn"
@click="handleCancel">
取消
</el-button>
</el-form-item>
</el-form>
</d2-container>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { trmDetail, trmSave, trmUpdate, getShopMerchantList } from '@api/deviceManage'
import { getParkStore } from "@api/editCustomer"
import { mapActions } from 'vuex'
export default {
name: 'EditDevice',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
key: new Date(),
form: {
posTrmNo: '',
yqMerchantId: '',
merchantId: ''
},
formRules: {
posTrmNo: [{
required: true,
message: '请输入终端编码',
trigger: 'change'
}]
},
isDisabled: false,
recordId: null,
parkServiceList: [],
merchantList: []
}
},
components: {},
computed: {},
created() {
},
mounted() {
this.getYqList()
this.getLlList()
this.addOrEdit = this.$route.params.addOrEdit
if (this.addOrEdit === 'edit') {
this.isDisabled = true
this.recordId = this.$route.params.info.id
this.getById(this.recordId)
}
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
getYqList() {
getParkStore({}).then((res) => {
this.parkServiceList = res
// if (this.addOrEdit === 'edit') {
// this.form.yqMerchantId =
// }
})
},
getLlList() {
getShopMerchantList({}).then((res) => {
this.merchantList = res
})
},
getById(id) {
trmDetail({ id: id }).then(res => {
var info = deepClone(res)
this.form.posTrmNo = info.posTrmNo
this.form.yqMerchantId = info.yqMerchantId.toString()
this.form.merchantId = info.merchantId.toString()
})
},
/**
* 保存信息
*/
handleSave() {
console.log(this.addOrEdit);
this.$refs.editDeviceFrom.validate(valid => {
if (valid) {
const params = deepClone(this.form)
console.log(params)
this.$confirm("保存后,后续该终端编码产生的流水记录会自动关联对应的园区店或流量方,且实时生效;是否确定保存?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
if (this.addOrEdit === 'add') {
trmSave(params).then(res => {
this.notice.okTips()
this.handleCancel()
})
} else {
params.id = this.recordId
trmUpdate(params).then(res => {
this.notice.okTips()
this.handleCancel()
})
}
})
.catch((err) => {
console.log(err)
})
}
})
},
handleCancel() {
this.$router.push({
name: 'deviceManage'
})
this.close({ tagName: '/editDevice' })
},
}
}
</script>
<style scoped>
.editDeviceFrom.d2-container-content {
margin-top: 0 !important;
}
.editDeviceFrom .warningFont {
color: #f56c6c;
font-size: 12px;
line-height: 1;
}
.editDeviceFrom .itd {
width: 400px;
}
.editDeviceFrom .tips {
font-size: 12px;
color: #999999;
margin: 0 0;
}
.editCusFrom .el-form-item {
margin-bottom: 36px;
}
</style>
......@@ -75,6 +75,12 @@
:show-btn-ids="['9060305']"
:data="scope.scope" />
</div>
<span slot="newOperate"
slot-scope="scope">
<auth-button slot="auth-button"
:show-btn-ids="['90603011']"
:data="scope.scope" />
</span>
</d2-table>
</div>
<relate-store-mer-dialog v-if="relateStoreVisible"
......@@ -263,6 +269,10 @@
:subordinateMerchantVisible="subordinateMerchantVisible"
:sub-shop-merchant-info="subShopMerchantInfo"
@dialogClose="colseSubordinateMerchant" />
<qrcode-dialog :q-rcode-visible="qRcodeVisible"
:info="recordInfo"
v-if="qRcodeVisible"
@dialogClose="dialogClose" />
</d2-container>
</template>
......@@ -296,6 +306,7 @@ import relateStoreMerDialog from "./components/relateStoreMerDialog"
import relateMerDialog from "./components/relateMerDialog"
import warrantyCardDialog from "./components/warrantyCardDialog"
import subordinateMerchantDialog from "./components/subordinateMerchantDialog"
import qrcodeDialog from './components/qRcodeDialog'
export default {
name: "MerchantManage",
......@@ -306,7 +317,8 @@ export default {
// QRcodeDialog
relateMerDialog,
warrantyCardDialog,
subordinateMerchantDialog
subordinateMerchantDialog,
qrcodeDialog
},
data() {
return {
......@@ -544,6 +556,11 @@ export default {
"YYYY-MM-DD HH:mm:ss"
)
}
},
{
label: "操作",
width: "80px",
addHtml: 'newOperate'
}
]
},
......@@ -638,7 +655,8 @@ export default {
warrantyCardVisible: false, // 质保卡弹窗
recordInfo: {},
subordinateMerchantVisible: false, // 下级商户弹窗
subShopMerchantInfo: {}
subShopMerchantInfo: {},
qRcodeVisible: false,
}
},
watch: {
......@@ -1125,6 +1143,8 @@ export default {
this.spanIndex3 = 0 // 合并流量方商户号索引
this.spanArr4 = [] // 合并渠道
this.spanIndex4 = 0 // 合并渠道索引
this.spanArr11 = [] // 合并第二操作栏
this.spanIndex11 = 0 // 合并第二操作栏索引
},
// 合并表格
merge(data) {
......@@ -1144,6 +1164,9 @@ export default {
this.spanArr4.push(1) // 合并渠道
this.spanIndex4 = 0
this.spanArr11.push(1) // 合并第二操作栏
this.spanIndex11 = 0
} else {
// 判断当前元素与上一元素是否相同
// // 合并序列
......@@ -1176,6 +1199,8 @@ export default {
this.spanArr3.push(0)
this.spanArr4[this.spanIndex4] += 1
this.spanArr4.push(0)
this.spanArr11[this.spanIndex11] += 1
this.spanArr11.push(0)
} else {
this.spanArr1.push(1)
this.spanIndex1 = i
......@@ -1185,6 +1210,8 @@ export default {
this.spanIndex3 = i
this.spanArr4.push(1)
this.spanIndex4 = i
this.spanArr11.push(1)
this.spanIndex11 = i
}
}
}
......@@ -1195,7 +1222,7 @@ export default {
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
const len = this.restructureList.length
// const t = this.columns.length
const t = 12
const t = 13
if (columnIndex === 0) {
// 第一列 序号
const _row_1 = this.spanArr1[rowIndex]
......@@ -1228,6 +1255,14 @@ export default {
rowspan: _row_4,
colspan: _col_4
}
} else if (columnIndex === 11) {
// 第11列 第二操作栏
const _row_11 = this.spanArr11[rowIndex]
const _col_11 = _row_11 > 0 ? 1 : 0
return {
rowspan: _row_11,
colspan: _col_11
}
} else if (columnIndex === t) {
const _row_6 = len
const _col_6 = 1
......@@ -1291,7 +1326,19 @@ export default {
colseSubordinateMerchant(flag) {
this.subordinateMerchantVisible = !this.subordinateMerchantVisible
flag && this.queryList()
}
},
// 收款二维码按钮
collectionQRcode(row) {
console.log(row);
this.recordInfo = row
this.qRcodeVisible = !this.qRcodeVisible
},
dialogClose() {
this.qRcodeVisible = !this.qRcodeVisible
},
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!