Commit fb729fff by 前端

Merge branch 'v3.6.0' into 'master'

V3.6.0

See merge request !52
2 parents b6f70c97 d7fc0ffc
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-01-09 18:24:21
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-03-11 18:05:07
* @FilePath: \scrm-micro-battles\src\App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div id="app">
<!-- <h2>
......@@ -61,5 +69,7 @@ export default {
// overflow-y: auto;
height: 100%;
}
.el-message {
z-index: 9999 !important;
}
</style>
>
......@@ -170,8 +170,7 @@ const orderVerfication = params => {
url: '/rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: false
sign: true
})
}
......@@ -211,4 +210,5 @@ const finishOrderStatus = params => {
})
}
export default { getInstallInfo, orderVerfication, signerOrder, getListApi, getCountApi, getOrderDetailApi, orderExportApi, writeOffApi, crowdFundWriteOffApi, crowdFundRefundApi, addDeliveryApi, examineDetailApi, examineAllowApi, confirmReceiptGoodsApi, updateOrderType, batchRefundOrder, importCrowdFundingOrder, finishOrderStatus }
......@@ -292,6 +292,18 @@ const getCrowdfundingParams = params => {
sign: true
})
}
/**获取众筹活动名称&门店 */
const getCrowdGoldParams = params => {
params.method = 'scrm.api.shopmall.crowdfunding.activity.parameter.list'
/**1秒杀 2直播间活动 3众筹 4膨胀金 */
params.marketingType = 5
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**众筹活动直播视频列表 */
const getTencentcloudmediaList = params => {
......@@ -304,4 +316,4 @@ const getTencentcloudmediaList = params => {
})
}
export default { getPayListApi, getPayMerchatListApi, liveroomDetailexport, liveroomDetailpage, liveroomOverview, getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi, getLiveListApi, getRankListApi, exportRankListApi, getDataBoardApi, getVisitorListApi, getSharedListApi, getDailyOrderQuantityStatistics, exportDailyOrderQuantityStatistics, getCrowdfundingParams, getTencentcloudmediaList }
export default { getCrowdGoldParams, getPayListApi, getPayMerchatListApi, liveroomDetailexport, liveroomDetailpage, liveroomOverview, getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi, getLiveListApi, getRankListApi, exportRankListApi, getDataBoardApi, getVisitorListApi, getSharedListApi, getDailyOrderQuantityStatistics, exportDailyOrderQuantityStatistics, getCrowdfundingParams, getTencentcloudmediaList }
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-01-04 16:41:09
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-01-11 17:18:05
* @FilePath: \scrm-micro-battles\src\views\battle\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!-- 专区管理 -->
<template>
<div class="activity">
<GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs>
......@@ -54,70 +45,92 @@
<GLFull :label="tag.staffName" :identi="`${tag.id}`" labelWidth="110" textType="user" :haveClose="true" v-for="(tag, idx) in userList" :key="idx" @handleRemove="removeStaff(idx)"></GLFull>
</div>
</el-form-item>
<el-form-item label="战报配置:">
<div class="config-pannel">
<div class="config-item">
<!-- 战报自动发送 -->
<el-form-item class="select-wrap" label="战报自动发送:">
<div class="common el-form-item__content">
<div class="el-input" ref="automaticRef">
<div class="el-input__inner" @click="openAutomatic">
<span v-if="wechat.automaticName == ''" class="placeholder">选择成员</span>
{{ wechat.automaticName }}
</div>
<span class="el-input__suffix" @click="openAutomatic">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', isAutomatic ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top" v-if="!isAutomatic">
<gl-select-menu :domEl="automaticEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" v-model="filterText"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<template v-if="automaticData.length > 0">
<el-tree class="filter-tree" :data="automaticData" node-key="id" :default-expanded-keys="expandedKeys" :props="defaultProps" default-expand-all :filter-node-method="filterNode" ref="tree" @node-click="handleNodeClick"></el-tree>
</template>
<div class="empty" v-else>暂无数据</div>
</div>
</gl-select-menu>
</transition>
<!-- 战报自动发送 -->
<el-form-item class="select-wrap" label="战报自动发送:">
<div class="common el-form-item__content">
<div class="el-input" ref="automaticRef">
<div class="el-input__inner" @click="openMenu(1)">
<span v-if="!wechat.battleStaffName" class="placeholder">选择成员</span>
{{ wechat.battleStaffName }}
</div>
<span class="el-input__suffix" @click="openMenu(1)">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', menuIndex != 1 ? 'is-reverse' : '']"></i></span>
</span>
</div>
<div class="empty-btn" @click="clearWechat(1)">清空</div>
</div>
<transition name="el-zoom-in-top" v-if="menuIndex == 1">
<gl-select-menu :domEl="automaticEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" v-model="filterText"></el-input>
</el-form-item>
<!-- 关联群 -->
<el-form-item class="select-wrap" label="关联群:">
<div class="common el-form-item__content">
<div class="el-input" ref="groupRef">
<div class="el-input__inner" @click="openGroup">
<span class="placeholder" v-if="wechat.roomName == ''">选择选择群</span>
{{ wechat.roomName }}
</div>
<span class="el-input__suffix" @click="openGroup">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', isgroup ? 'is-reverse' : '']"></i></span>
</span>
</div>
</div>
<transition name="el-zoom-in-top" v-if="!isgroup">
<gl-select-menu :domEl="domEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" prefix-icon="el-icon-search" v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="i in roomName == '' ? groupList : stageList" class="el-select-dropdown__item" :key="i" @click="selectGroup(i)">
<span>{{ i.roomName }}</span>
</li>
</template>
<div class="empty" v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<template v-if="automaticData.length > 0">
<el-tree class="filter-tree" :data="automaticData" node-key="id" :default-expanded-keys="expandedKeys" :props="defaultProps" default-expand-all :filter-node-method="filterNode" ref="tree" @node-click="handleNodeClick"></el-tree>
</template>
<div class="empty" v-else>暂无数据</div>
</div>
</gl-select-menu>
</transition>
</el-form-item>
<!-- 喜报自动发送 -->
<el-form-item class="select-wrap" label="喜报自动发送:">
<div class="common el-form-item__content">
<div class="el-input" ref="happyRef">
<div class="el-input__inner" @click="openMenu(2)">
<span v-if="!wechat.goodStaffName" class="placeholder">选择成员</span>
{{ wechat.goodStaffName }}
</div>
<span class="el-input__suffix" @click="openMenu(2)">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', menuIndex != 2 ? 'is-reverse' : '']"></i></span>
</span>
</div>
<div class="empty-btn" @click="clearWechat(2)">清空</div>
</div>
<transition name="el-zoom-in-top" v-if="menuIndex == 2">
<gl-select-menu :domEl="happyEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" v-model="filterTextH"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<template v-if="automaticData.length > 0">
<el-tree class="filter-tree" :data="automaticData" node-key="id" :default-expanded-keys="expandedKeys" :props="defaultProps" default-expand-all :filter-node-method="filterNode" ref="treeH" @node-click="handleNodeClick"></el-tree>
</template>
<div class="empty" v-else>暂无数据</div>
</div>
</gl-select-menu>
</transition>
</el-form-item>
<!-- 关联群 -->
<el-form-item class="select-wrap" label="关联群:">
<div class="common el-form-item__content">
<div class="el-input" ref="groupRef">
<div class="el-input__inner" @click="openMenu(3)">
<span class="placeholder" v-if="wechat.roomName == ''">选择选择群</span>
{{ wechat.roomName }}
</div>
<span class="el-input__suffix" @click="openMenu(3)">
<span class="el-input__suffix-inner"><i :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up', menuIndex != 3 ? 'is-reverse' : '']"></i></span>
</span>
</div>
<div class="clear-btn" @click="clearWechat">清空</div>
</div>
<transition name="el-zoom-in-top" v-if="menuIndex == 3">
<gl-select-menu :domEl="domEl" @changeStatu="hideSelect">
<el-form-item class="search-groomname">
<el-input placeholder="请输入搜索关键词" prefix-icon="el-icon-search" v-model="roomName"></el-input>
</el-form-item>
<div class="el-select-dropdown__wrap el-scrollbar__wrap">
<ul class="el-scrollbar__view el-select-dropdown__list">
<template v-if="groupList.length > 0">
<li v-for="i in roomName == '' ? groupList : stageList" class="el-select-dropdown__item" :key="i" @click="selectGroup(i)">
<span>{{ i.roomName }}</span>
</li>
</template>
<div class="empty" v-else>暂无数据</div>
</ul>
</div>
</gl-select-menu>
</transition>
</el-form-item>
</el-form>
</div>
......@@ -127,7 +140,6 @@
</GLDialog>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
......@@ -143,6 +155,7 @@ export default {
return {
isgroup: true,
isAutomatic: true,
menuIndex: 0,
merchantId: '',
merchantName: '',
activeName: 'first',
......@@ -152,6 +165,7 @@ export default {
battlestaffVisible: false,
url: url,
setectList: [],
setectEditList: [],
merchantList: [],
groupList: [],
tabPaneList: [
......@@ -202,7 +216,6 @@ export default {
// 表格
userList: [],
selectArray: [],
getListApi: this.$apis.battle.getActivitylist,
tableParams: {
// btnId: new Date().getTime() + parseInt(Math.random() * 1000),
......@@ -217,18 +230,17 @@ export default {
label: '活动名称',
prop: 'activityName'
},
{
label: '活动门店',
prop: 'merchantName'
},
{
{
label: '活动类型',
prop: 'marketingType',
formatter: cellValue => {
const data = this.baseData.activityTypeList.filter(item => item.confId == cellValue.marketingType)
return data.length > 0 ? data[0].confName : '--'
}
formatter: cellValue => {
const data = this.baseData.activityTypeList.filter(item => item.confId == cellValue.marketingType)
return data.length > 0 ? data[0].confName : '--'
}
},
{
label: '活动时间',
......@@ -252,6 +264,7 @@ export default {
},
expandedKeys: [],
filterText: '',
filterTextH: '',
automaticData: [],
stageList: [],
roomName: '',
......@@ -260,7 +273,8 @@ export default {
staffType: '2'
},
wechat: {
automaticName: '',
battleStaffName: '',
goodStaffName: '',
roomName: ''
},
baseData: {
......@@ -271,7 +285,6 @@ export default {
}
}
},
mounted() {
this.getOptionsList('searchFormData')
this.getCrowdfundingParams()
......@@ -283,6 +296,9 @@ export default {
},
automaticEl() {
return this.$refs.automaticRef
},
happyEl() {
return this.$refs.happyRef
}
},
watch: {
......@@ -307,6 +323,9 @@ export default {
filterText(val) {
this.$refs.tree.filter(val)
},
filterTextH(val) {
this.$refs.treeH.filter(val)
},
roomName(val) {
this.filterRoomName(val)
}
......@@ -339,26 +358,29 @@ export default {
},
async getCrowdfundingParams() {
/**参数类型 1:众筹活动名称(返回类型String),2:众筹活动门店 */
const activity = await this.$apis.seckillActivity.getCrowdfundingParams({
const funding = await this.$apis.seckillActivity.getCrowdfundingParams({
parameterType: 1
})
const gold = await this.$apis.seckillActivity.getCrowdGoldParams({
parameterType: 1
})
const activity = [...funding?.parameters, ...gold?.parameters]
let activityNameList = []
if (activity?.parameters && activity.parameters.length) {
activity.parameters.map(e => {
activityNameList.push({
confId: e,
confName: e
})
activity.map(e => {
activityNameList.push({
confId: e,
confName: e
})
}
})
this.$set(this.searchFormData[1], 'optionList', this.$common.utils.deepClone(activityNameList))
},
clearData() {
this.setectList = []
// this.setectList = []
this.config.merchantId = this.merchantId
this.config.staffType = '2'
this.wechat = {
automaticName: '',
battleStaffName: '',
goodStaffName: '',
roomName: ''
}
this.hideSelect()
......@@ -375,28 +397,51 @@ export default {
})
},
handleNodeClick(data) {
this.setSendName(data.name, data.staffId)
// this.wechat.roomName = ''
this.hideSelect()
this.wechat.automaticName = data.name
this.wechat.staffId = data.staffId
},
setSendName(name, staffId, isClear, i) {
console.log(staffId, this.wechat.battleStaffId, i)
if (this.menuIndex == 1 || i == 1) {
if (staffId == this.wechat.battleStaffId && staffId) return
Object.assign(this.wechat, { battleStaffName: name, battleStaffId: staffId })
}
if (this.menuIndex == 2 || i == 2) {
if (staffId == this.wechat.goodStaffId && staffId) return
Object.assign(this.wechat, { goodStaffName: name, goodStaffId: staffId })
}
console.log(this.wechat)
if (isClear && !this.wechat.battleStaffName && !this.wechat.goodStaffName) {
this.wechat.roomName = ''
this.groupList = []
return
}
if (isClear && (this.wechat.battleStaffName || this.wechat.goodStaffName)) return
this.wechat.roomName = ''
this.getGroupList(this.wechat.staffId)
this.getGroupList()
},
hideSelect() {
this.isgroup = true
this.isAutomatic = true
this.menuIndex = 0
},
selectGroup(data) {
this.hideSelect()
this.wechat.roomName = data.roomName
this.wechat.groupId = data.roomChatId
},
openGroup(e) {
this.isAutomatic = true
this.isgroup = !this.isgroup
const { goodStaffId, battleStaffId } = this.wechat
if (!data.staffInfoList) return
if (this.wechat.battleStaffName) {
const staffCloudId = data.staffInfoList.find(i => i.staffId == battleStaffId)?.staffCloudId
this.wechat.battleGroupId = staffCloudId + '_' + data.roomIdOnly
}
if (this.wechat.goodStaffName) {
const staffCloudId = data.staffInfoList.find(i => i.staffId == goodStaffId)?.staffCloudId
this.wechat.goodGroupId = staffCloudId + '_' + data.roomIdOnly
}
// this.wechat.groupId = data.roomChatId
},
openAutomatic() {
this.isgroup = true
this.isAutomatic = !this.isAutomatic
openMenu(e) {
if (e == this.menuIndex) return (this.menuIndex = 0)
this.menuIndex = e
},
removeStaff(index) {
this.userList.splice(index, 1)
......@@ -436,10 +481,10 @@ export default {
this.activityOpen(scope)
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
// this.$message({
// type: 'info',
// message: '已取消'
// })
})
},
activityOpen(scope) {
......@@ -464,6 +509,7 @@ export default {
})
return
}
this.getDepartmentTree()
this.userList = []
// this.editStatus = false
this.battleVisible = true
......@@ -495,7 +541,7 @@ export default {
})
return
}
if (this.wechat.automaticName !== '' && this.wechat.roomName == '') {
if (this.wechat.battleStaffName !== '' && this.wechat.roomName == '') {
this.$message({
message: '请选择关联群',
type: 'error'
......@@ -513,14 +559,19 @@ export default {
userId: item.userId
})
})
this.setectList.forEach(item => {
const setectList = this.setectEditList.length ? this.setectEditList : this.setectList
setectList.forEach(item => {
let autoStaff = {}
if (Object.keys(this.wechat).length) {
const { battleStaffId, battleStaffName, battleGroupId, goodStaffName, roomName, goodGroupId, goodStaffId } = this.wechat
autoStaff = {
autoStaffId: this.wechat.staffId,
autoStaffName: this.wechat.automaticName,
autoGroupId: this.wechat.groupId,
autoGroupName: this.wechat.roomName,
battleStaffId,
battleStaffName,
battleGroupId,
goodGroupId,
goodStaffName,
goodStaffId,
autoGroupName: roomName,
autoGroupMerchantId: this.$merchantId
}
}
......@@ -530,7 +581,6 @@ export default {
staffRequestList
})
})
this.$apis.battle.insertStaff({ batchstaffRequestList, staffType: this.config.staffType }).then(res => {
this.$message({
message: res.code == '0' ? '配置成功' : res.message,
......@@ -546,28 +596,27 @@ export default {
},
handlebattleClose() {
this.clearData()
this.setectEditList = []
this.battleVisible = false
},
handleDetails() {},
handlebattleOn(data, sign) {
this.setectList = []
this.setectEditList = []
this.userList = []
this.wechat = {
automaticName: '',
roomName: ''
battleStaffName: '',
roomName: '',
goodStaffName: ''
}
this.setectList.push(data)
this.setectEditList.push(data)
this.battleVisible = true
if (sign) {
this.getStaffList(data)
}
this.getDepartmentTree()
},
clearWechat() {
this.wechat = {
automaticName: '',
roomName: ''
}
clearWechat(i) {
this.setSendName('', '', true, i)
},
//获取编辑
getStaffList(data) {
......@@ -577,16 +626,31 @@ export default {
this.merchantName = res.staffs[0].merchantName
this.userList = res.staffs
this.config.staffType = res.staffType + ''
this.wechat.staffId = res.autoStaffId
this.wechat.automaticName = res.autoStaffName
this.wechat.groupId = res.autoGroupId
this.wechat.roomName = res.autoGroupName
// this.wechat.staffId = res.autoStaffId
// this.wechat.battleStaffName = res.autoStaffName
// this.wechat.groupId = res.autoGroupId
// this.wechat.roomName = res.autoGroupName
const { goodStaffId, goodStaffName, battleStaffId, battleStaffName, goodGroupId, battleGroupId, autoGroupName, autoGroupMerchantId } = res
this.wechat = {
goodStaffId,
goodStaffName,
battleStaffId,
battleStaffName,
goodGroupId,
battleGroupId,
roomName: autoGroupName,
autoGroupMerchantId
}
this.getGroupList(this.wechat.staffId)
})
},
getGroupList(id) {
this.$apis.battle.getGroupList({ msgStaffIdList: id }).then(res => {
if (res.code == 0) this.groupList = res.data
const { battleStaffId, goodStaffId } = this.wechat
const msgStaffIdList = [battleStaffId, goodStaffId]
this.$apis.battle.getGroupList({ msgStaffIdList, unionRoom: true }).then(res => {
if (res.code == 0) {
this.groupList = res.data
}
})
},
handleSetting() {
......@@ -612,12 +676,10 @@ export default {
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.battleRef.data.length ? (this.$refs.battleRef.tableHeightValues = '') : this.$refs.battleRef.setTableHeightFun()
},
handleSearch() {
this.$refs.battleRef.refreshTable()
},
......@@ -676,13 +738,15 @@ export default {
}
}
</script>
<style scoped lang="scss">
.activity {
/deep/ {
.el-select .el-tag {
max-width: 60% !important;
}
.el-form-item__content {
overflow: inherit !important;
}
}
.container {
margin-top: 16px;
......@@ -698,6 +762,13 @@ export default {
}
}
}
.empty-btn {
position: absolute;
right: -40px;
top: 0px;
font-size: 14px;
color: #5850ff;
}
.config-pannel {
background: #f9f9f9;
width: 520px;
......
......@@ -19,13 +19,12 @@
v-model="searchForm.requestSource"
@tab-click="handleTabClick"
>
<template v-for="(i,index) in requestSourceList">
<el-tab-pane
:label="i"
:name="index"
:key="index"
v-for="(i,index) in requestSourceList"
></el-tab-pane>
</template>
</el-tabs>
</div>
<div class="btn-group">
......@@ -363,13 +362,23 @@
<GLDialog
v-if="writeOffApprovalVisible"
title="核销审批"
width="400px"
mode="mid"
:width="approvalInfo.verificationVoucher ? '':'400px'"
:visible.sync="writeOffApprovalVisible"
@onCancel="handleApprovalClose"
@onOk="handleApprovalComfirm"
@onOk="handleApprovalConfirm"
:okText="approvalInfo.verificationVoucher ? '审批通过': '确定'"
:cancelText="approvalInfo.verificationVoucher ? '不通过': '取消'"
:orderCode="orderCode"
>
<ul>
<ul v-if="approvalInfo.verificationVoucher" class="approvalWrap">
<li v-for="item in userInfo" :key="item.key" class="approvalInfoItem">
{{ item.label }}
<span v-if="item.key!='verificationVoucher'">{{ approvalInfo[item.key] || '--' }}</span>
<el-image v-else style="width: 100px; height: 100px" :src="approvalInfo[item.key]" :preview-src-list="[approvalInfo[item.key]]"></el-image>
</li>
</ul>
<ul v-else>
<li class="approvalInfoTips">
<img
class="tips-img"
......@@ -381,6 +390,16 @@
<li class="approvalInfoItem">提交时间: {{ approvalInfo.confirmInstallTime }}</li>
</ul>
</GLDialog>
<GLDialog title="审批不通过" mode="mid" :visible.sync="isCancelVisible" @onOk="confirmNoPass(1)" @onCancel="closePassDialog">
<div class="noPassDialog">
<span class="tip">请输入审批不通过的原因</span>
<el-form class="form" ref="cancelRef" label-width="154px" :rules="cancelRules" :model="cancelForm">
<el-form-item label="原因说明:" prop="reasonsForFailure">
<el-input style="width: 432px;" :size="size" type="textarea" v-model="cancelForm.reasonsForFailure" placeholder="请输入审批不通过说明" maxlength="50" rows="3" show-word-limit></el-input>
</el-form-item>
</el-form>
</div>
</GLDialog>
<!-- :selectedCrowdList="JSON.parse(JSON.stringify(customerDataList[0].list))" -->
<!-- <GLDialog :bigTitle="'选择成员'"
mode="big"
......@@ -543,8 +562,31 @@
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { utils } from 'glsx-common'
import { dateFormat } from '../../utils/index'
import selectStaff from './components/selectStaff.vue'
import { businessType, orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, exportFn } from '@/common/constant'
const userInfo = [
{
label: '员工名称:',
key: 'confirmInstallStaffName'
},
{
label: '提交时间:',
key: 'confirmInstallTime'
},
{
label: '活动名称:',
key: 'activityName'
},
{
label: '应付尾款:',
key: 'tailPrice'
},
{
label: '尾款凭证:',
key: 'verificationVoucher'
},
]
export default {
name: 'orderManage',
components: {
......@@ -553,6 +595,26 @@ export default {
},
data () {
return {
userInfo,
isCancelVisible: false,
cancelForm: {
reasonsForFailure: ''
},
cancelRules: {
reasonsForFailure: [
{
required: true,
validator: (rule, value, callback) => {
if (!value || (value && !value.trim())) {
return callback(new Error('请输入审批不通过说明'))
} else {
return callback()
}
},
trigger: 'change'
}
]
},
isStaffVisible: false,
size: 'small',
url: url,
......@@ -698,7 +760,8 @@ export default {
fn: '退款'
},
condition: row => {
return row.orderSource == 4 && [2, 6, 21].includes(+row.orderStatus) && row.isOffline != 0
// return row.orderSource == 4 && [2, 6, 21, 22].includes(+row.orderStatus) && row.isOffline != 0
return row.showRefund == 1 //是否展示退款按钮 1:是 0:否
},
listeners: {
click: row => {
......@@ -720,7 +783,8 @@ export default {
fn: '订单核销'
},
condition: row => {
return (row.deliveryType == 1 && row.orderStatus == 21) || (row.afterSaleType == 2 && [2, 4, 5, 6, 7, 9, 10].includes(row.orderStatus))
// return (row.deliveryType == 1 && row.orderStatus == 21) || (row.afterSaleType == 2 && [2, 4, 5, 6, 7, 9, 10].includes(row.orderStatus))
return row.showVerf == 1 //是否展示核销按钮 1:是 0:否
},
listeners: {
click: this.handleWriteOff
......@@ -806,7 +870,8 @@ export default {
// checkSelectKey: 'orderStatus',
// checkSelectVal: [9, 10, 11, 22],
checkSelectable: row => {
return [9, 10, 11, 22].indexOf(row.orderStatus) == -1 && row.isOffline != '0' && row?.paymentModel != 3
// return [9, 10, 11, 22].indexOf(row.orderStatus) == -1 && row.isOffline != '0' && row?.paymentModel != 3
return row.showRefund == 1 && row?.paymentModel != 3 //v3.6.0修改批量退款
},
listName: 'list',
tableOption: true,
......@@ -1418,28 +1483,74 @@ export default {
})
}
},
//取消弹框,如果没有凭证,直接关闭
handleApprovalClose () {
this.writeOffApprovalVisible = !this.writeOffApprovalVisible
if(this.approvalInfo.verificationVoucher){
this.openPassDialog()
}else{
this.writeOffApprovalVisible = false
}
},
handleApprovalComfirm () {
this.$apis.orderManage.orderVerfication({ orderCode: this.orderCode }).then(result => {
this.handleApprovalClose()
// 确认不通过审批
confirmNoPass(){
this.$refs?.cancelRef?.validate(valid => {
if(valid) this.handleApprovalConfirm(1)
})
},
// 确认通过审批
handleApprovalConfirm (type) {
let params = { orderCode: this.orderCode }
if(type==1) {
params.reasonsForFailure = this.cancelForm.reasonsForFailure
params.failureflag = true
}
this.$apis.orderManage.orderVerfication(params).then(result => {
this.writeOffApprovalVisible = false
this.closePassDialog()
this.handleSearch()
})
},
//关闭不通过弹窗
closePassDialog() {
this.isCancelVisible = false
this.cancelForm = {
reasonsForFailure: ''
}
},
// 打开不通过弹窗
openPassDialog() {
this.$refs?.cancelRef?.clearValidate()
this.writeOffApprovalVisible = false
this.isCancelVisible = true
},
// 核销审批
handleWriteOffApproval (val) {
// val.orderCode = 'S2110081902337632'
this.orderCode = val.orderCode
this.$apis.orderManage
.getInstallInfo({
subOrderCode: val.orderCode
// subOrderCode: 'S2211111603132050'
.getOrderDetailApi({
orderCode: val.orderCode
})
.then(result => {
this.approvalInfo = result
// console.log(result)
})
this.handleApprovalClose()
if(result){
if(result.verificationVoucher){
result.confirmInstallTime = result.confirmInstallTime ? dateFormat(result.confirmInstallTime) : ''
result.crowdFundingPrice = result.crowdFundingPrice || 0
result.payPrice = result.payPrice || 0
result.tailPrice = (result.crowdFundingPrice - result.payPrice) + '元'
this.approvalInfo = result
this.writeOffApprovalVisible = true
}else{
this.$apis.orderManage
.getInstallInfo({
subOrderCode: val.orderCode
}).then(result => {
this.approvalInfo = result
this.writeOffApprovalVisible = true
})
}
}
})
},
// 订单指派
handlerAssign (item) {
......@@ -1473,7 +1584,7 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
callback: utils.debounce((action) => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
......@@ -1487,7 +1598,7 @@ export default {
}
})
}
}
}, 500)
})
},
......@@ -1946,6 +2057,7 @@ export default {
.approvalInfoItem {
margin-left: 20px;
margin-bottom: 10px;
display: flex;
}
.refund-dialog {
.refund-item {
......@@ -2003,4 +2115,27 @@ export default {
margin-left: 8px;
}
}
.approvalWrap{
margin-left: 84px;
}
.noPassDialog{
.tip{
margin-left: 72px;
width: 522px;
font-weight: 400;
font-size: 14px;
color: #666666;
}
.form{
margin-top: 16px;
.el-form-item__label{
height: 32px;
line-height: 32px;
padding-right: 10px;
}
.el-textarea__inner{
font-family: auto;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!