Commit c24c2a90 by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !30
2 parents 3d85d07c 31a3431c
......@@ -176,3 +176,15 @@ export function addOrUpdateSceneMerchantRef(data) {
data.method = `${path2}shopMerchant.addOrUpdateSceneMerchantRef`
return request(data, RequestMethods.POST)
}
// 获取商户基础信息
export function getBaseInfo(data) {
data.method = `${path2}serviceMerchant.getBaseInfo`
return request(data)
}
// 修改4s店质保卡二维码展示标志位
export function updateCardCodeFlag(data) {
data.method = `${path2}serviceMerchant.updateCardCodeFlag`
return request(data, RequestMethods.POST)
}
......@@ -315,7 +315,7 @@ export default {
v.listShowShopPrice = v.upgradePrice
v.listShowStock = v.stock
v.listShowSpecificationData = v.specificationData
v.goodsInfo.goodsName = val.baseGoodsName
v.goodsInfo.goodsName = val.baseGoodsName || v.goodsInfo.goodsName // 新数据显示商品名称,历史商品数据显示素材名称
stockTotal += v.stock
})
let minPrice = shopPriceArr.length ? Math.min(...shopPriceArr) : 0
......
......@@ -815,6 +815,12 @@ export const resources = {
category: "Button",
type: "primary",
handle: "handleMerchantRelate"
},
{
authId: "9060309",
parentId: "90603",
label: "质保卡配置",
handle: "setWarrantyCard"
}
],
component: _import("systemConfig/merchant/merchantManage")
......
......@@ -455,6 +455,10 @@ export default {
// goodsType: '',
// goodsTypeName: '全部'
// })
this.baseData.productTypeList.unshift({
categoryType: '',
categoryName: '全部'
})
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
......@@ -696,17 +700,14 @@ export default {
},
// 根据所选场景获取类目
handleChangeSelect(value) {
if (!value) {
this.baseData.productTypeList = []
this.getBaseData()
return
}
this.searchForm.goodsType = ''
this.baseData.productTypeList = []
getProductTypeBySceneId({ sceneType: value }).then(res => {
this.searchForm.goodsType = ''
this.baseData.productTypeList = res
console.log(res)
this.getBaseData()
})
},
}
}
}
......
......@@ -80,7 +80,7 @@ export default {
linkMerchants: [{ required: true, message: '请选择关联门店', trigger: 'change' }],
speciLinkMerchants: [{ required: true, message: '请选择关联门店', trigger: 'change' }],
specificationDetailList: [{ required: true, message: '请添加规格并保存', trigger: 'change' }],
baseGoodsName: [{ required: true, message: '请输入商品名称', trigger: ['blur', 'change'] }]
// baseGoodsName: [{ required: true, message: '请输入商品名称', trigger: ['blur', 'change'] }]
},
comFormRef: 'com',
editForm: [{
......@@ -261,7 +261,7 @@ export default {
this.editForm[0].formBlock[0].optionList = res
})
},
getGoodsInfo(id, flag, coloseDialog) {
getGoodsInfo(id, flag) {
getGoodsInfoById({ id: id }).then(res => {
// this.userInfo.beSuper && this.getGoodsList()
this.editForm[0].formBlock[0].optionList = [{
......@@ -315,8 +315,6 @@ export default {
this.markOldVal.retailPrice = res.retailPrice
this.$nextTick(() => {
this.show = true
if (coloseDialog) return
if (!flag) this.$refs.d2Form.showMerchantsDialog(this.radioType || '0')
})
})
},
......@@ -342,7 +340,6 @@ export default {
this.editForm[linkMerchantIndex].formBlock[0].name = data == '0' ? 'linkMerchants' : 'speciLinkMerchants'
},
handleAddConfirm(e, flag = false) {
if (flag) this.$refs.d2Form.confirmEvent()
let data = deepClone(e)
let [goodsSpecificationNameList, goodsSpecificationList] = [[], []]
data.specificationDetailList.length && data.specificationDetailList.map(val => {
......@@ -388,9 +385,14 @@ export default {
goodsSpecificationNameList: goodsSpecificationNameList,
goodsSpecificationList: goodsSpecificationList
}
console.log(params)
addOrEditBaseGoods(params).then(res => {
// 获取商品详情 获取到规格数据
this.getGoodsInfo(res.id, flag)
// flag true提交
if (flag) {
this.$refs.d2Form.confirmEvent()
} else {
this.$refs.d2Form.showMerchantsDialog(this.radioType || '0', res)
}
})
// // 执行分配门店默认执行保存
// if (typeof flag == 'boolean') {
......
......@@ -190,7 +190,7 @@ export default {
}]
this.editData.goodsVideoList = []
// 获取场景下类目
if (this.editData.sceneType) {
if ((this.editData.sceneType??'') !== '') {
this.handleChangeSelect(this.editData.sceneType)
}
if (this.editData.videoUrl) this.editData.goodsVideoList = [{ content: this.editData.videoUrl }]
......@@ -286,14 +286,14 @@ export default {
},
// 根据所选场景获取类目
handleChangeSelect(value) {
if (!value.toString()) {
if ((this.editData.sceneType??'') === '') {
this.editForm[0].formBlock[2].optionList = []
this.getBaseData()
return
}
getProductTypeBySceneId({ sceneType: value }).then(res => {
this.editForm[0].formBlock[2].optionList = res
if (!res.find(v => v.id === this.editData.goodsType)) {
if (!res.find(v => v.categoryType === this.editData.goodsType)) {
this.editData.goodsType = ''
}
console.log(this.editData)
......
......@@ -217,7 +217,6 @@ export default {
this.baseData.scenCodeList.unshift(allOpt)
// 获取全部类目
getProductTypeBySceneId({ sceneType: '' }).then(res => {
this.searchForm.goodsType = ''
this.baseData.productTypeList = res
this.getBaseData()
})
......@@ -230,9 +229,8 @@ export default {
close: 'd2admin/page/close'
}),
async getBaseData() {
// this.baseData.productTypeList = deepClone(await this.get(BaseData.productType))
this.baseData.productTypeList.unshift({
id: '',
categoryType: '',
categoryName: '全部'
})
this.showFormData.forEach((item, index) => {
......@@ -247,6 +245,8 @@ export default {
// 根据所选场景获取类目
handleChangeSelect(value) {
this.searchForm.goodsType = ''
this.baseData.productTypeList = []
getProductTypeBySceneId({ sceneType: value }).then(res => {
this.baseData.productTypeList = res
this.getBaseData()
......
<!-- 质保卡 -->
<template>
<d2-dialog title="质保卡配置"
:is-visible="warrantyCardVisible"
class="accountDailog"
@closeDialog="handleClose"
@confirmDialog="handleAddConfirm">
<div class="container">
<h4>控制小程序订单是否显示二维码</h4>
<div>
<img src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/showpng.png"
class="img"
alt="">
</div>
<el-radio-group v-model="infoForm.cardCodeFlag">
<el-radio :label="0">订单显示</el-radio>
<el-radio :label="1">订单不显示</el-radio>
</el-radio-group>
</div>
</d2-dialog>
</template>
<script>
import { getBaseInfo, updateCardCodeFlag } from '@api/merchant'
import { deepClone } from '@/common/util'
export default {
name: 'WarrantyCardDialog',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
infoForm: {
cardCodeFlag: 0
}
// formRules: {
// cardCodeFlag: [{ required: true, message: '请输入备注信息', trigger: 'change' }]
// }
}
},
props: {
warrantyCardVisible: {
type: Boolean,
default: false
},
recordInfo: {
type: Object,
default: null
}
},
watch: {
},
created() {
},
components: {},
mounted() {
if (this.recordInfo) {
this.getInfo(this.recordInfo.merchantId)
}
},
methods: {
getInfo(merchantId) {
getBaseInfo({ merchantId: merchantId }).then(res => {
this.infoForm.cardCodeFlag = res.cardCodeFlag || 0
})
},
handleAddConfirm() {
var params = deepClone(this.infoForm)
params.merchantId = this.recordInfo.merchantId
updateCardCodeFlag(params).then(res => {
this.notice.okTips('操作成功')
this.handleClose(true)
})
},
handleClose(flag) {
this.$emit('dialogClose', flag)
}
}
}
</script>
<style scoped>
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.img {
display: inline-block;
width: 250px;
height: 350px;
/* object-fit: cover; */
}
.dateItem {
display: flex;
}
.dateItem .el-form-item__content {
display: flex;
margin-left: 0 !important;
}
.accountDailog .el-dialog {
margin-top: 20vh !important;
min-width: 700px;
}
.accountDailog .el-select-dropdown__item {
width: 395px !important;
}
</style>
......@@ -25,20 +25,20 @@
</d2-table-header>
<!-- :get-list-api="getListApi" -->
<d2-table ref="merchantTable"
:tableData="restructureList"
:table-data="restructureList"
:search-form="searchForm"
:table-params="tableParams"
:hasNum="false"
:tableTotal="total"
:arraySpanMethod="arraySpanMethod"
:has-num="false"
:table-total="total"
:array-span-method="arraySpanMethod"
@refreshTable="jumpPage">
<el-button type="text" />
<div slot="auth-button"
slot-scope="scope"
v-if="scope.scope.scene">
<auth-button slot="auth-button"
:data="scope.scope" />
</div>
</d2-table>
</div>
<relate-store-mer-dialog v-if="relateStoreVisible"
......@@ -219,6 +219,10 @@
:store-selected="storeSelected"
@handleRelateConfirm="handleRelateConfirm"
@handleRelateClose="handleRelateClose" />
<warranty-card-dialog v-if="warrantyCardVisible"
:warranty-card-visible="warrantyCardVisible"
:record-info="recordInfo"
@dialogClose="closeWarrantyCard" />
</d2-container>
</template>
......@@ -247,6 +251,7 @@ import {
} from "@/common/constants.js"
import relateStoreMerDialog from "./components/relateStoreMerDialog"
import relateMerDialog from "./components/relateMerDialog"
import warrantyCardDialog from "./components/warrantyCardDialog"
export default {
name: "MerchantManage",
......@@ -255,7 +260,8 @@ export default {
relateStoreMerDialog,
financialRulesDetail,
// QRcodeDialog
relateMerDialog
relateMerDialog,
warrantyCardDialog
},
data() {
return {
......@@ -340,7 +346,7 @@ export default {
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'sceneTypeList'
},
}
],
getListApi: getList,
showData: {},
......@@ -574,7 +580,7 @@ export default {
confId: 3,
confLabel: '1.3售后直播众筹活动'
}
],
]
},
defaultProps: {
children: "childs",
......@@ -591,17 +597,19 @@ export default {
rowData: {},
/** 合并参数start */
spanArr1: [], //合并序列
spanIndex1: 0, //合并序列索引
spanArr2: [], //合并流量方名称
spanIndex2: 0, //合并流量方名称索引
spanArr3: [], //合并流量方商户号
spanIndex3: 0, //合并流量方商户号索引
spanArr4: [], //合并渠道
spanIndex4: 0, //合并渠道索引
spanArr1: [], // 合并序列
spanIndex1: 0, // 合并序列索引
spanArr2: [], // 合并流量方名称
spanIndex2: 0, // 合并流量方名称索引
spanArr3: [], // 合并流量方商户号
spanIndex3: 0, // 合并流量方商户号索引
spanArr4: [], // 合并渠道
spanIndex4: 0, // 合并渠道索引
/** 合并参数end */
relateVisible: false
relateVisible: false,
warrantyCardVisible: false, // 质保卡弹窗
recordInfo: {}
}
},
watch: {
......@@ -654,6 +662,7 @@ export default {
},
// 财务
handleDetail(row) {
console.log(row, 'row')
this.close({ tagName: "/merchantDetail" })
this.$router.push({
name: "merchantDetail",
......@@ -1013,7 +1022,7 @@ export default {
...params
}
getList(params).then(res => {
console.log(res);
console.log(res)
this.page.currentPage = res.pageNum
this.page.pageSize = res.pageSize
this.total = res.total
......@@ -1035,55 +1044,54 @@ export default {
return item
})
this.restructureList = dataList.reduce((prev, cur, index, arr) => {
let sceneList = cur.sceneList
const sceneList = cur.sceneList
delete cur.sceneList
if (sceneList && sceneList.length > 0) {
sceneList.map((item) => {
prev.push({
...item,
...cur,
...cur
})
})
} else {
prev.push(cur)
}
return prev
}, [])
console.log(this.restructureList);
console.log(this.restructureList)
this.merge(this.restructureList)
}
},
// 初始化合并行数组
mergeInit() {
this.spanArr1 = []; //合并序列
this.spanIndex1 = 0; //合并序列索引
this.spanArr2 = []; //合并流量方名称
this.spanIndex2 = 0; //合并流量方名称索引
this.spanArr3 = []; //合并流量方商户号
this.spanIndex3 = 0; //合并流量方商户号索引
this.spanArr4 = []; //合并渠道
this.spanIndex4 = 0; //合并渠道索引
this.spanArr1 = [] // 合并序列
this.spanIndex1 = 0 // 合并序列索引
this.spanArr2 = [] // 合并流量方名称
this.spanIndex2 = 0 // 合并流量方名称索引
this.spanArr3 = [] // 合并流量方商户号
this.spanIndex3 = 0 // 合并流量方商户号索引
this.spanArr4 = [] // 合并渠道
this.spanIndex4 = 0 // 合并渠道索引
},
// 合并表格
merge(data) {
this.mergeInit();
this.mergeInit()
if (data.length > 0) {
for (var i = 0; i < data.length; i++) {
if (i === 0) {
//第一行必须存在,以第一行为基准
this.spanArr1.push(1); //合并序列
this.spanIndex1 = 0;
// 第一行必须存在,以第一行为基准
this.spanArr1.push(1) // 合并序列
this.spanIndex1 = 0
this.spanArr2.push(1); //合并流量方名称
this.spanIndex2 = 0;
this.spanArr2.push(1) // 合并流量方名称
this.spanIndex2 = 0
this.spanArr3.push(1); //合并流量方商户号
this.spanIndex3 = 0;
this.spanArr3.push(1) // 合并流量方商户号
this.spanIndex3 = 0
this.spanArr4.push(1); //合并渠道
this.spanIndex4 = 0;
this.spanArr4.push(1) // 合并渠道
this.spanIndex4 = 0
} else {
// 判断当前元素与上一元素是否相同
// // 合并序列
......@@ -1108,25 +1116,24 @@ export default {
// 根据id判断固定合并前面4列
if (data[i].merchantId == data[i - 1].merchantId) {
this.spanArr1[this.spanIndex1] += 1;
this.spanArr1.push(0);
this.spanArr2[this.spanIndex2] += 1;
this.spanArr2.push(0);
this.spanArr3[this.spanIndex3] += 1;
this.spanArr3.push(0);
this.spanArr4[this.spanIndex4] += 1;
this.spanArr4.push(0);
this.spanArr1[this.spanIndex1] += 1
this.spanArr1.push(0)
this.spanArr2[this.spanIndex2] += 1
this.spanArr2.push(0)
this.spanArr3[this.spanIndex3] += 1
this.spanArr3.push(0)
this.spanArr4[this.spanIndex4] += 1
this.spanArr4.push(0)
} else {
this.spanArr1.push(1);
this.spanIndex1 = i;
this.spanArr2.push(1);
this.spanIndex2 = i;
this.spanArr3.push(1);
this.spanIndex3 = i;
this.spanArr4.push(1);
this.spanIndex4 = i;
this.spanArr1.push(1)
this.spanIndex1 = i
this.spanArr2.push(1)
this.spanIndex2 = i
this.spanArr3.push(1)
this.spanIndex3 = i
this.spanArr4.push(1)
this.spanIndex4 = i
}
}
}
}
......@@ -1134,48 +1141,48 @@ export default {
// 合并单元格
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
const len = this.restructureList.length;
const len = this.restructureList.length
// const t = this.columns.length
const t = 12
if (columnIndex === 0) {
//第一列 序号
const _row_1 = this.spanArr1[rowIndex];
const _col_1 = _row_1 > 0 ? 1 : 0;
// 第一列 序号
const _row_1 = this.spanArr1[rowIndex]
const _col_1 = _row_1 > 0 ? 1 : 0
return {
rowspan: _row_1,
colspan: _col_1,
};
colspan: _col_1
}
} else if (columnIndex === 1) {
// 第二列 流量方名称
const _row_2 = this.spanArr2[rowIndex];
const _col_2 = _row_2 > 0 ? 1 : 0;
const _row_2 = this.spanArr2[rowIndex]
const _col_2 = _row_2 > 0 ? 1 : 0
return {
rowspan: _row_2,
colspan: _col_2,
};
colspan: _col_2
}
// 第三列 流量方商户号
} else if (columnIndex === 2) {
const _row_3 = this.spanArr3[rowIndex];
const _col_3 = _row_3 > 0 ? 1 : 0;
const _row_3 = this.spanArr3[rowIndex]
const _col_3 = _row_3 > 0 ? 1 : 0
return {
rowspan: _row_3,
colspan: _col_3,
};
colspan: _col_3
}
// 第四列 渠道
} else if (columnIndex === 3) {
const _row_4 = this.spanArr4[rowIndex];
const _col_4 = _row_4 > 0 ? 1 : 0;
const _row_4 = this.spanArr4[rowIndex]
const _col_4 = _row_4 > 0 ? 1 : 0
return {
rowspan: _row_4,
colspan: _col_4,
};
colspan: _col_4
}
} else if (columnIndex === t) {
const _row_6 = len;
const _col_6 = 1;
const _row_6 = len
const _col_6 = 1
return {
rowspan: _row_6,
colspan: _col_6,
};
colspan: _col_6
}
} else if (rowIndex === len) {
return {
rowspan: 1,
......@@ -1184,7 +1191,7 @@ export default {
}
},
//商户关联
// 商户关联
handleMerchantRelate() {
this.relateVisible = true
},
......@@ -1199,6 +1206,19 @@ export default {
this.queryList()
}
},
// 打开质保卡弹窗
setWarrantyCard(row) {
this.warrantyCardVisible = !this.warrantyCardVisible
this.recordInfo = row
console.log('this.recordInfo', this.recordInfo)
},
// 关闭质保卡弹窗
closeWarrantyCard(flag) {
this.warrantyCardVisible = !this.warrantyCardVisible
flag && this.queryList()
}
}
}
</script>
......
......@@ -184,6 +184,7 @@ export default {
getAdminInfo({}).then(res => {
this.adminInfo = res
})
console.log(this.$route.params.merchantId)
if (this.$route.params.merchantId) {
// console.log(this.$route.params)
// this.merchantItem = {
......@@ -194,8 +195,24 @@ export default {
// parentMerchantName: this.$route.params.partnerMerchant ? this.$route.params.partnerMerchant.merchantName : '',
// parentMerchantId: this.$route.params.partnerMerchant ? this.$route.params.partnerMerchant.merchantId : ''
// }
const { merchantId, merchantName, channelType, userType, parentMerchantName, parentMerchantId, partnerMerchants, yqMerchantId, yqMerchantName } = this.$route.params
const merchantItem = { merchantId, merchantName, channelType, userType, parentMerchantName, parentMerchantId, partnerMerchants, yqMerchantId, yqMerchantName }
console.log(this.$route.params, 'this.$route.params')
// 兼容修复v3.2 版本数据结构问题
// debugger
const { merchantId, merchantName, channelType, userType, serviceList, yqMerchant } = this.$route.params
const merchantItem = { merchantId, merchantName, channelType, userType }
if (yqMerchant) {
merchantItem.yqMerchantId = yqMerchant.merchantId
merchantItem.yqMerchantName = yqMerchant.merchantName
}
if (serviceList) {
if (serviceList.length == 1) {
merchantItem.parentMerchantId = serviceList[0].merchantId
merchantItem.parentMerchantName = serviceList[0].merchantName
} else {
merchantItem.partnerMerchants = serviceList
}
}
// const { merchantId, merchantName, channelType, userType, parentMerchantName, parentMerchantId, partnerMerchants, yqMerchantId, yqMerchantName } = this.$route.params
Object.assign(this.form, merchantItem)
sessionStorage.setItem(this.sessionName, JSON.stringify(merchantItem))
this.getRuleProgress(this.$route.params.merchantId)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!