Commit bbd1dfc8 by zhangxw

上架凭证 订单延迟分账 批量下架需求开发

1 parent cc201344
...@@ -53,4 +53,10 @@ export function getAllGroupByCategory(data) { ...@@ -53,4 +53,10 @@ export function getAllGroupByCategory(data) {
export function getAllGoodsList(data) { export function getAllGoodsList(data) {
data.method = `${path}productManager.search` data.method = `${path}productManager.search`
return request(data, 'post') return request(data, 'post')
}
// 批量下架
export function batchUpdateStatus(data) {
data.method = `${path}merchantGoodsInfo.updateBatchOffShelf`
return request(data, 'post')
} }
\ No newline at end of file \ No newline at end of file
...@@ -135,3 +135,9 @@ export function getDivisionRecordByOrderCode(data) { ...@@ -135,3 +135,9 @@ export function getDivisionRecordByOrderCode(data) {
data.method = `${path2}getDivisionRecordByOrderCode` data.method = `${path2}getDivisionRecordByOrderCode`
return request(data, "post") return request(data, "post")
} }
// 取消分账
export function cancelDivideAccountsAPI(data) {
data.method = `${path2}order.cancelProfitAllocation`
return request(data, "post")
}
...@@ -10,6 +10,7 @@ import sign from "./sign" ...@@ -10,6 +10,7 @@ import sign from "./sign"
import RequestMethods from "./request.methods" import RequestMethods from "./request.methods"
import util from "@/libs/util.js" import util from "@/libs/util.js"
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import axiosPackage from 'axios'
const request = ( const request = (
params = {}, params = {},
method = RequestMethods.GET, method = RequestMethods.GET,
...@@ -71,6 +72,7 @@ const request = ( ...@@ -71,6 +72,7 @@ const request = (
} }
// console.log(signWay[apiName], "baseApiName") // console.log(signWay[apiName], "baseApiName")
const secret = baseConfig[baseApiName].secret const secret = baseConfig[baseApiName].secret
const CancelToken = axiosPackage.CancelToken
var reqData = var reqData =
method === RequestMethods.POST method === RequestMethods.POST
? { ? {
...@@ -79,6 +81,16 @@ const request = ( ...@@ -79,6 +81,16 @@ const request = (
} }
: { params: sign(params, noSignAttr, secret, signWay[apiName]) } : { params: sign(params, noSignAttr, secret, signWay[apiName]) }
reqData = reqData = Object.assign(reqData, options, {}) reqData = reqData = Object.assign(reqData, options, {})
// 请求进度
if (params?.onProcess) {
reqData.onUploadProgress = params.onProcess
}
// 取消请求
if (params?.cancelFun) {
reqData.cancelToken = new CancelToken(function excutor(c) {
params.cancelFun.cancel = c
})
}
// console.log(method === RequestMethods.POST) // console.log(method === RequestMethods.POST)
// console.log(url) // console.log(url)
// console.log(options) // console.log(options)
......
...@@ -90,3 +90,9 @@ export function queryFeeCategoryByType(data) { ...@@ -90,3 +90,9 @@ export function queryFeeCategoryByType(data) {
data.method = `${path}smartcarlife.feeCategory.queryFeeCategoryByType` data.method = `${path}smartcarlife.feeCategory.queryFeeCategoryByType`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// pdf上传
export function uploadPDF(data) {
data.method = `${path}smartcarlife.common.uploadPdf`
return request(data, RequestMethods.POST, ["file"])
}
...@@ -184,7 +184,7 @@ service.interceptors.response.use( ...@@ -184,7 +184,7 @@ service.interceptors.response.use(
break break
} }
} }
if (error && error.stack.indexOf("timeout") > -1) { if (error && error?.stack?.indexOf("timeout") > -1) {
if (error.stack.indexOf("5000ms")) { if (error.stack.indexOf("5000ms")) {
error.message = "查询超时,请刷新页面重试!" error.message = "查询超时,请刷新页面重试!"
} }
...@@ -192,7 +192,7 @@ service.interceptors.response.use( ...@@ -192,7 +192,7 @@ service.interceptors.response.use(
// console.log(error) // console.log(error)
} }
store.commit("d2admin/loading/set", false) store.commit("d2admin/loading/set", false)
errorLog(error) if (!error.__CANCEL__) errorLog(error) // 取消请求 不做错误提示
return Promise.reject(error) return Promise.reject(error)
} }
) )
......
...@@ -346,6 +346,14 @@ export const routerName = { ...@@ -346,6 +346,14 @@ export const routerName = {
} }
] ]
}, },
{
authId: "9030908",
parentId: "90309",
label: "批量下架",
category: "Button",
type: "primary",
handle: "handleBatchOffShelf"
}
], ],
component: _import("goods/grounding/index") component: _import("goods/grounding/index")
}, },
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
{{ i.title }} {{ i.title }}
</p> </p>
<div class="flex_item"> <div class="flex_item">
<div v-for="(item, index) in i.formBlock" :key="index" :class="(item.type === 'incidBox' || item.type === 'table') ? 'item message-box' : 'item'"> <div v-for="(item, index) in i.formBlock" :key="index" :class="(item.type === 'incidBox' || item.type === 'table' || item.type === 'upload') ? 'item message-box' : 'item'">
<!-- 商品附带信息 --> <!-- 商品附带信息 -->
<div v-if="formData['upgradeGoodsName'] && item.type === 'incidBox'"> <div v-if="formData['upgradeGoodsName'] && item.type === 'incidBox'">
<el-form-item :prop="item.name" <el-form-item :prop="item.name"
...@@ -77,6 +77,27 @@ ...@@ -77,6 +77,27 @@
<relateStoreTable v-if="$$(formData['merchantGoodsRefList'], 'length')" :merchant-goods-ref-list="formData['merchantGoodsRefList']" :isDetail="true"></relateStoreTable> <relateStoreTable v-if="$$(formData['merchantGoodsRefList'], 'length')" :merchant-goods-ref-list="formData['merchantGoodsRefList']" :isDetail="true"></relateStoreTable>
</el-form-item> </el-form-item>
</div> </div>
<!-- 图片文件 -->
<div v-else-if="item.type === 'upload'">
<div v-if="$$(formData[item.name], 'length')">
<el-form-item :prop="item.name"
:label="item.label ? item.label + ':' : ''"
:id="item.name"
:label-width="item.label ? '180px' : '0px'"
class="dis-in-block"
style="margin-bottom: 0">
<div class="file_box">
<div class="file_item" v-for="(subItem, subIndex) in formData[item.name]" :key="subIndex">
<div class="item_box" @click="handleFileView(subItem)">
<img class="image_icon" v-if="subItem.voucherFileUrl.includes('.png') || subItem.voucherFileUrl.includes('.jpg')" src="../images/photo_thumbnail.png"/>
<img class="image_icon" v-if="subItem.voucherFileUrl.includes('.pdf')" src="../images/PDF_thumbnail.png"/>
<span class="file_size">文件大小:{{ formatSize(subItem.fileSize) }}</span>
</div>
</div>
</div>
</el-form-item>
</div>
</div>
<div v-else> <div v-else>
<el-form-item :prop="item.name" <el-form-item :prop="item.name"
:label="item.label ? (item.unit ? (membraneTypeList.includes(formData['goodsType']) ? item.label + `(元)/车` : (item.label + '(元)/件')) : item.label) + ':' : ''" :label="item.label ? (item.unit ? (membraneTypeList.includes(formData['goodsType']) ? item.label + `(元)/车` : (item.label + '(元)/件')) : item.label) + ':' : ''"
...@@ -106,6 +127,11 @@ ...@@ -106,6 +127,11 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-image-viewer
v-if="imgViewerVisible"
:on-close="closeImgViewer"
:url-list="imageFileArr"
:initialIndex="initialIndex" />
</div> </div>
</template> </template>
...@@ -118,7 +144,8 @@ import relateStoreTable from "./relateStoreTable.vue" ...@@ -118,7 +144,8 @@ import relateStoreTable from "./relateStoreTable.vue"
export default { export default {
name: 'groundingForm', name: 'groundingForm',
components: { components: {
relateStoreTable relateStoreTable,
'el-image-viewer': () => import('element-ui/packages/image/src/image-viewer')
}, },
data() { data() {
return { return {
...@@ -128,7 +155,11 @@ export default { ...@@ -128,7 +155,11 @@ export default {
selectedValue: '', selectedValue: '',
show: false, show: false,
examineFlag: false, examineFlag: false,
membraneTypeList membraneTypeList,
dialogObj: {},
imageFileArr: [],
imgViewerVisible: false,
initialIndex: 0
} }
}, },
...@@ -169,6 +200,16 @@ export default { ...@@ -169,6 +200,16 @@ export default {
} }
}, },
deep: true deep: true
},
// 获取所有文件中的图片
'formData.voucherList': {
handler(newVal) {
if (newVal) {
let imageFileArr = newVal.filter(v => v.voucherFileUrl && (v.voucherFileUrl.includes('.png') || v.voucherFileUrl.includes('jpg')))
this.imageFileArr = imageFileArr.map(item => { return item.voucherFileUrl })
}
},
deep: true
} }
}, },
...@@ -227,6 +268,42 @@ export default { ...@@ -227,6 +268,42 @@ export default {
} }
this.selectedValue = value this.selectedValue = value
}, },
// 文件预览
handleFileView(item) {
if (item?.voucherFileUrl?.includes('.pdf')) {
window.open(item.voucherFileUrl) // pdf文件新窗口打开直接预览
} else {
this.imgViewerVisible = true
this.imageFileArr.forEach((val, index) => { // 图片使用elementImage图片预览组件
if (val == item.voucherFileUrl) this.initialIndex = index
})
}
},
closeImgViewer() {
this.imgViewerVisible = false
},
// 文件大小格式化
formatSize(byte) {
let size = ""
if (byte < 0.1 * 1024) {
// 小于0.1KB,则转化成B
size = `${byte.toFixed(2)}B`
} else if (byte < 0.1 * 1024 * 1024) {
// 小于0.1MB,则转化成KB
size = `${(byte / 1024).toFixed(2)}KB`
} else if (byte < 0.1 * 1024 * 1024 * 1024) {
// 小于0.1GB,则转化成MB
size = `${(byte / (1024 * 1024)).toFixed(2)}MB`
}
const sizeStr = `${size}` // 转成字符串
const index = sizeStr.indexOf(".") // 获取小数点处的索引
const dou = sizeStr.substr(index + 1, 2) // 获取小数点后两位的值
if (dou == "00") {
// 判断后两位是否为00,如果是则删除00
return sizeStr.substring(0, index) + sizeStr.substr(index + 3, 2)
}
return size
},
// 处理金额补零 // 处理金额补零
priceFilter(num) { priceFilter(num) {
var pow = Math.pow(10, 2) var pow = Math.pow(10, 2)
...@@ -268,6 +345,7 @@ export default { ...@@ -268,6 +345,7 @@ export default {
flex-flow: wrap; flex-flow: wrap;
.item { .item {
flex: 0 0 33%; flex: 0 0 33%;
margin-bottom: 10px;
} }
.message-box{ .message-box{
flex: 0 0 100%; flex: 0 0 100%;
...@@ -294,6 +372,29 @@ export default { ...@@ -294,6 +372,29 @@ export default {
} }
} }
} }
.file_box{
width: 100%;
display: flex;
flex-wrap: wrap;
.file_item{
flex: 0 0 20%;
display: flex;
.item_box{
display: flex;
align-items: center;
cursor: pointer;
.image_icon{
width: 24px;
height: 24px;
}
.file_size{
color: #999999;
font-size: 14px;
margin-left: 8px;
}
}
}
}
} }
} }
.width_100{ .width_100{
......
...@@ -169,6 +169,13 @@ export default { ...@@ -169,6 +169,13 @@ export default {
label: '上架门店', label: '上架门店',
isRequired: true, isRequired: true,
type: 'button' type: 'button'
}, {
name: 'voucherList',
label: '上架凭证',
type: 'upload',
topTips: '支持扩展名:.pdf .jpg .png',
tips: '注:最多可上传30个文件',
maxPhotoNum: 30
}] }]
}], }],
editData: { editData: {
...@@ -186,7 +193,8 @@ export default { ...@@ -186,7 +193,8 @@ export default {
minSellPrice: '', minSellPrice: '',
giveCostPrice: '', giveCostPrice: '',
recoveryCostPrice: '', recoveryCostPrice: '',
reconcilyCostPrice: '' reconcilyCostPrice: '',
voucherList: []
}, },
secondGoodsList: [], secondGoodsList: [],
goodsNameKeyword: '', goodsNameKeyword: '',
...@@ -329,8 +337,12 @@ export default { ...@@ -329,8 +337,12 @@ export default {
confNameValue: res?.upgradeGoodsName, confNameValue: res?.upgradeGoodsName,
confTypeNameValue: `(${res?.goodsTypeName} / ${res?.goodsName} / ${res?.upgradeCommodityCode})`, confTypeNameValue: `(${res?.goodsTypeName} / ${res?.goodsName} / ${res?.upgradeCommodityCode})`,
}] }]
res.voucherList.forEach(val => { // 处理上传进度 默认进度100%
if (val.voucherFileUrl) val.uploadProgress = 100
})
res.serviceItemNames = res.upgradeGoods?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` })?.join(',') // 服务项目 res.serviceItemNames = res.upgradeGoods?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` })?.join(',') // 服务项目
res.merchantGoodsRefList = res.merchantGoodsRefList || [] // 上架门店 res.merchantGoodsRefList = res.merchantGoodsRefList || [] // 上架门店
res.voucherList = res.voucherList || [] // 上架凭证
this.editData = res || {} this.editData = res || {}
this.getSelectingList(defaultSelect) this.getSelectingList(defaultSelect)
}) })
...@@ -360,18 +372,30 @@ export default { ...@@ -360,18 +372,30 @@ export default {
}) })
}) })
let arr = [] let arr = []
data?.merchantGoodsRefList?.forEach(val => { // 组合数据 防止请求参数过长 data?.merchantGoodsRefList?.forEach(val => { // 上架门店组合数据 防止请求参数过长
arr.push({ arr.push({
merchantId: val.merchantId, merchantId: val.merchantId,
merchantName: val.merchantName merchantName: val.merchantName
}) })
}) })
let fileArr = []
data?.voucherList?.forEach(val => { // 处理上传凭证数据 删除或取消上传并不会删除数组 只是将url置空
if (val.voucherFileUrl) {
fileArr.push({
voucherFileUrl: val.voucherFileUrl,
fileSize: val.fileSize,
fileName: val.fileName
})
}
})
// 整理上传凭证数据
delete formObj?.productType delete formObj?.productType
let params = { let params = {
saveDraft: num !== 1, saveDraft: num !== 1,
id: data.id, id: data.id,
...formObj, ...formObj,
merchantGoodsRefList: arr merchantGoodsRefList: arr,
voucherList: fileArr
} }
if (num == 1 && !baseConfig.supplierCode.includes(data.supplierCode)) { // 第三方商品无需走审核流程不用提示 if (num == 1 && !baseConfig.supplierCode.includes(data.supplierCode)) { // 第三方商品无需走审核流程不用提示
this.$confirm('<p>上架信息保存后,自动进入上架审核流程</p>是否确定保存?', '提示', { this.$confirm('<p>上架信息保存后,自动进入上架审核流程</p>是否确定保存?', '提示', {
......
...@@ -127,6 +127,10 @@ export default { ...@@ -127,6 +127,10 @@ export default {
name: 'merchantGoodsRefList', name: 'merchantGoodsRefList',
label: '上架门店', label: '上架门店',
type: 'table' type: 'table'
}, {
name: 'voucherList',
label: '上架凭证',
type: 'upload'
}] }]
}, { }, {
title: '操作信息', title: '操作信息',
...@@ -193,8 +197,9 @@ export default { ...@@ -193,8 +197,9 @@ export default {
res.warrantyPeriod = res.upgradeGoods?.warrantyPeriod res.warrantyPeriod = res.upgradeGoods?.warrantyPeriod
res.serviceYears = res.upgradeGoods?.serviceYears res.serviceYears = res.upgradeGoods?.serviceYears
res.merchantGoodsRefList = res.merchantGoodsRefList || [] res.merchantGoodsRefList = res.merchantGoodsRefList || []
res.thirdPartyCode = res?.upgradeGoods?.thirdPartyCode || '', res.thirdPartyCode = res?.upgradeGoods?.thirdPartyCode || ''
res.entityCardFlag = res?.upgradeGoods?.entityCardFlag res.entityCardFlag = res?.upgradeGoods?.entityCardFlag
res.voucherList = res?.voucherList || []
this.editData = res || {} this.editData = res || {}
this.$nextTick(() => { this.$nextTick(() => {
this.show = true this.show = true
......
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
<span style="{display: inline-block;}"> <span style="{display: inline-block;}">
<auth-button category="Button" :show-btn-ids="['9030903']" /> <auth-button category="Button" :show-btn-ids="['9030903']" />
</span> </span>
<!-- 批量下架 -->
<span style="{display: inline-block};margin-left: 10px">
<auth-button category="Button" :show-btn-ids="['9030908']" />
</span>
<!-- 导出 --> <!-- 导出 -->
<span style="{display: inline-block};margin-left: 10px"> <span style="{display: inline-block};margin-left: 10px">
<auth-button category="Button" :show-btn-ids="['9030902']" /> <auth-button category="Button" :show-btn-ids="['9030902']" />
...@@ -120,7 +124,7 @@ ...@@ -120,7 +124,7 @@
</template> </template>
<script> <script>
import { getProductTypeBySceneId, getList } from '@api/product' import { getProductTypeBySceneId, getList } from '@api/product'
import { getGroundingManageList, updateGoodsStatus, batchReviewAPI, delGroundingById } from '@api/grounding' import { getGroundingManageList, updateGoodsStatus, batchReviewAPI, delGroundingById, batchUpdateStatus } from '@api/grounding'
import { deepClone, Util } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { sceneCodeList, sceneList } from '@/common/constants.js' import { sceneCodeList, sceneList } from '@/common/constants.js'
import { getParkStore } from '@api/editCustomer' import { getParkStore } from '@api/editCustomer'
...@@ -513,11 +517,11 @@ export default { ...@@ -513,11 +517,11 @@ export default {
}) })
}, },
selectableFn(row) { selectableFn(row) {
var isSelect = true // var isSelect = true
if (row.status !== 4) { // 仅待审核状态可勾选 // if (row.status !== 4) { // 仅待审核状态可勾选
isSelect = false // isSelect = false
} // }
return isSelect return true
}, },
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
...@@ -609,7 +613,7 @@ export default { ...@@ -609,7 +613,7 @@ export default {
}) })
}, },
handleUpOrDown(row) { handleUpOrDown(row) {
var html = row.status == '0' ? '上架信息保存后,自动进入上架审核流程,是否确定保存?' : '下架后对应的门店无法再使用该商品,是否确定下架?' var html = row.status == '0' ? '上架后重新进入审核流程;是否确定上架?' : '下架后对应的门店无法再使用该商品,是否确定下架?'
this.$confirm(html, '提示', { this.$confirm(html, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -624,19 +628,30 @@ export default { ...@@ -624,19 +628,30 @@ export default {
console.log(err) console.log(err)
}) })
}, },
// 批量审核
handleBatchReview() { handleBatchReview() {
var selectedData = [] var selectedData = []
if (this.$refs.groundingIndexTable.mutiSelectArr.groundingIndex) { if (this.$refs.groundingIndexTable.mutiSelectArr.groundingIndex) {
selectedData = this.$refs.groundingIndexTable.mutiSelectArr.groundingIndex selectedData = this.$refs.groundingIndexTable.mutiSelectArr.groundingIndex
} }
// 上架状态
let status = selectedData.map(v => { return v.status }) || []
if (!selectedData.length) { if (!selectedData.length) {
this.$message({ this.$message({
message: "请选择需要审核的商品", message: "请选择需要审核的记录",
type: "warning", type: "warning",
showClose: true showClose: true
}) })
return false return false
} }
if (status.includes(1) || status.includes(0) || status.includes(3)) { // 包含1已上架/0已下架/3草稿
this.$message({
message: '请选择待审核的记录',
type: 'warning',
showClose: true
})
return false
}
this.$confirm('审核通过后,商品完成上架,对应的门店可使用该商品,是否确定审核?', '提示', { this.$confirm('审核通过后,商品完成上架,对应的门店可使用该商品,是否确定审核?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -650,6 +665,44 @@ export default { ...@@ -650,6 +665,44 @@ export default {
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
}) })
},
// 批量下架
handleBatchOffShelf() {
var selectedData = []
if (this.$refs.groundingIndexTable.mutiSelectArr.groundingIndex) {
selectedData = this.$refs.groundingIndexTable.mutiSelectArr.groundingIndex
}
// 上架状态
let status = selectedData.map(v => { return v.status }) || []
if (!selectedData.length) {
this.$message({
message: "请选择需要下架的记录",
type: "warning",
showClose: true
})
return false
}
if (status.includes(4) || status.includes(0) || status.includes(3)) { // 包含4待审核/0已下架/3草稿
this.$message({
message: '请选择已上架的记录',
type: 'warning',
showClose: true
})
return false
}
this.$confirm('下架后对应的门店无法再使用该商品,是否确定下架?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let ids = selectedData.map(v => { return v.id }) || []
batchUpdateStatus({ ids: ids }).then(res => {
this.notice.okTips()
this.$refs.groundingIndexTable.refreshTable()
})
}).catch(err => {
console.log(err)
})
} }
} }
} }
......
...@@ -724,6 +724,7 @@ export default { ...@@ -724,6 +724,7 @@ export default {
handleImgChange(e, targetItem, subIndex = 0) { handleImgChange(e, targetItem, subIndex = 0) {
var reader = new FileReader() var reader = new FileReader()
var fileInfo = e.srcElement.files[0] var fileInfo = e.srcElement.files[0]
if (!fileInfo) return
reader.readAsDataURL(fileInfo) reader.readAsDataURL(fileInfo)
reader.onload = e => { reader.onload = e => {
const imgFile = e.target.result const imgFile = e.target.result
...@@ -737,6 +738,9 @@ export default { ...@@ -737,6 +738,9 @@ export default {
} else { } else {
this.formData[targetItem.name][subIndex].content = res this.formData[targetItem.name][subIndex].content = res
} }
document.getElementById(`${targetItem.name}file`).value = ""
}).catch(() => {
document.getElementById(`${targetItem.name}file`).value = ""
}) })
} }
}, },
...@@ -933,7 +937,7 @@ export default { ...@@ -933,7 +937,7 @@ export default {
height: 100%; height: 100%;
position: absolute; position: absolute;
width: 88px; width: 88px;
height: 74px; height: 88px;
left: 0; left: 0;
top: 0; top: 0;
z-index: 2; z-index: 2;
......
...@@ -163,6 +163,13 @@ ...@@ -163,6 +163,13 @@
@click="ruleHistory(scope.row)"> @click="ruleHistory(scope.row)">
分账记录 分账记录
</el-button> </el-button>
<!-- 取消分账 分帐中状态 -->
<el-button type="text"
size="small"
v-if="scope.row.profitAllocationStatus == 5"
@click="cancelRule(scope.row)">
取消分账
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -216,8 +223,9 @@ import { ...@@ -216,8 +223,9 @@ import {
getList, getList,
getOrderCount, getOrderCount,
waitinputorderCount, waitinputorderCount,
orderImport orderImport,
, getServiceStore getServiceStore,
cancelDivideAccountsAPI
} from "@api/order" } from "@api/order"
import { getDiversionMerchantRef } from "@api/merchant" import { getDiversionMerchantRef } from "@api/merchant"
import { manageTypeList, BaseData } from "@/common/constants" import { manageTypeList, BaseData } from "@/common/constants"
...@@ -271,7 +279,8 @@ export default { ...@@ -271,7 +279,8 @@ export default {
profitAllocationStatusOpts: { profitAllocationStatusOpts: {
1: '未分账', 1: '未分账',
2: '已分账', 2: '已分账',
4: '待分账' 4: '待分账',
5: '分账中'
}, },
showFormData: [ showFormData: [
{ {
...@@ -526,6 +535,10 @@ export default { ...@@ -526,6 +535,10 @@ export default {
{ {
confId: '4', confId: '4',
confLabel: '待分账' confLabel: '待分账'
},
{
confId: '5',
confLabel: '分账中'
} }
], ],
}, },
...@@ -896,6 +909,19 @@ export default { ...@@ -896,6 +909,19 @@ export default {
this.ruleInfoVisible = true this.ruleInfoVisible = true
}, },
// 取消分账
cancelRule(row) {
this.$confirm('取消分帐后,订单按线下对账方式计算分润,收款金额统一分账至嘀加智慧云,请谨慎操作。是否确定取消?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
cancelDivideAccountsAPI({orderCode: row.orderCode}).then(res => {
this.notice.okTips()
this.handleSearch()
})
}).catch(() => {})
},
ruleInfoDialogClose(flag) { ruleInfoDialogClose(flag) {
this.ruleInfoVisible = !this.ruleInfoVisible this.ruleInfoVisible = !this.ruleInfoVisible
// if (flag) { // if (flag) {
......
...@@ -273,6 +273,10 @@ export default { ...@@ -273,6 +273,10 @@ export default {
{ {
label: "退款备注", label: "退款备注",
name: 'refundRemark' name: 'refundRemark'
},
{
label: '备注',
name: 'remarks'
} }
] ]
this.detailFormData = detailFormData this.detailFormData = detailFormData
......
...@@ -160,6 +160,12 @@ ...@@ -160,6 +160,12 @@
标记已退款 标记已退款
</el-button> </el-button>
</span> </span>
<!-- 取消分账 分账中状态 -->
<span v-if="scope.scope.ledgerStatus == '4'">
<el-button type="text" size="mini" style="margin-left: 10px" @click="cancelRule(scope.scope)">
取消分账
</el-button>
</span>
</div> </div>
</d2-table> </d2-table>
</div> </div>
...@@ -229,7 +235,7 @@ import { ...@@ -229,7 +235,7 @@ import {
} from "@/common/constants" } from "@/common/constants"
import { Util, deepClone } from "@/common/util" import { Util, deepClone } from "@/common/util"
import orderManage from "@api/orderManage" import orderManage from "@api/orderManage"
import { batchUpdateToNotInput, batchUpdateConfirmInput, markAsRefunded } from '@api/order' import { batchUpdateToNotInput, batchUpdateConfirmInput, markAsRefunded, cancelDivideAccountsAPI } from '@api/order'
import chooseRuleDialog from './chooseRuleDialog' import chooseRuleDialog from './chooseRuleDialog'
import ruleInfoDialog from './ruleInfoDialog' import ruleInfoDialog from './ruleInfoDialog'
export default { export default {
...@@ -374,7 +380,8 @@ export default { ...@@ -374,7 +380,8 @@ export default {
{ confId: "0", confName: "未分账" }, { confId: "0", confName: "未分账" },
{ confId: "1", confName: "待确认" }, { confId: "1", confName: "待确认" },
{ confId: "2", confName: "待分账" }, { confId: "2", confName: "待分账" },
{ confId: "3", confName: "已分账" } { confId: "3", confName: "已分账" },
{ confId: "4", confName: "分账中" }
] ]
}, },
...@@ -872,7 +879,7 @@ export default { ...@@ -872,7 +879,7 @@ export default {
prop: "ledgerStatus", prop: "ledgerStatus",
width: 100, width: 100,
formatter: (cellValue) => { formatter: (cellValue) => {
return { 0: "未分账", 1: "待确认", 2: "待分账", 3: "已分账" }[cellValue.ledgerStatus] || "-" return { 0: "未分账", 1: "待确认", 2: "待分账", 3: "已分账", 4: "分账中" }[cellValue.ledgerStatus] || "-"
} }
}, },
{ {
...@@ -1319,6 +1326,18 @@ export default { ...@@ -1319,6 +1326,18 @@ export default {
}) })
}).catch(() => { }) }).catch(() => { })
}, },
// 取消分账
cancelRule(row) {
this.$confirm('取消分帐后,订单按线下对账方式计算分润,收款金额统一分账至嘀加智慧云,请谨慎操作。是否确定取消?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
cancelDivideAccountsAPI({}).then(res => {
this.notice.okTips()
this.handleSearch()
})
}).catch(() => {})
},
ruleInfoDialogClose(flag) { ruleInfoDialogClose(flag) {
this.ruleInfoVisible = !this.ruleInfoVisible this.ruleInfoVisible = !this.ruleInfoVisible
if (flag) { if (flag) {
......
...@@ -158,6 +158,10 @@ ...@@ -158,6 +158,10 @@
@click="ruleHistory(scope.row)"> @click="ruleHistory(scope.row)">
分账记录 分账记录
</el-button> </el-button>
<el-button type="text" style="margin-left: 0;" size="small" v-if="scope.row.profitAllocationStatus == 5"
@click="cancelRule(scope.row)">
取消分账
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -205,7 +209,7 @@ ...@@ -205,7 +209,7 @@
<script> <script>
import { Util } from '@/common/util' import { Util } from '@/common/util'
import { getList, getOrderCount, waitinputorderCount, orderImport } from '@api/order' import { getList, getOrderCount, waitinputorderCount, orderImport, cancelDivideAccountsAPI } from '@api/order'
import { getDiversionMerchantRef, listShop4sByRef } from '@api/merchant' import { getDiversionMerchantRef, listShop4sByRef } from '@api/merchant'
import { manageTypeList, BaseData } from '@/common/constants' import { manageTypeList, BaseData } from '@/common/constants'
import { mapActions, mapState, mapMutations } from 'vuex' import { mapActions, mapState, mapMutations } from 'vuex'
...@@ -255,7 +259,8 @@ export default { ...@@ -255,7 +259,8 @@ export default {
profitAllocationStatusOpts: { profitAllocationStatusOpts: {
1: '未分账', 1: '未分账',
2: '已分账', 2: '已分账',
4: '待分账' 4: '待分账',
5: '分账中'
}, },
showFormData: [{ showFormData: [{
label: '订单状态', label: '订单状态',
...@@ -482,6 +487,10 @@ export default { ...@@ -482,6 +487,10 @@ export default {
{ {
confId: '4', confId: '4',
confLabel: '待分账' confLabel: '待分账'
},
{
confId: '5',
confLabel: '分账中'
} }
], ],
parkServiceList: [], parkServiceList: [],
...@@ -576,7 +585,7 @@ export default { ...@@ -576,7 +585,7 @@ export default {
'baseData.subShopMerchantList': { 'baseData.subShopMerchantList': {
handler(val) { handler(val) {
console.log('baseData.subShopMerchantList', val) // console.log('baseData.subShopMerchantList', val)
if (val.length > 0) { if (val.length > 0) {
this.showFormData[this.findFormIdx('subShopMerchantId')].isHide = false this.showFormData[this.findFormIdx('subShopMerchantId')].isHide = false
} else { } else {
...@@ -690,7 +699,7 @@ export default { ...@@ -690,7 +699,7 @@ export default {
listShop4sByRef({ listShop4sByRef({
scene: 1 scene: 1
}).then(res => { }).then(res => {
console.log('this.getAllServiceStore()', res) // console.log('this.getAllServiceStore()', res)
this.baseData.storeIdList = res || [] this.baseData.storeIdList = res || []
this.getOptionsList() this.getOptionsList()
}) })
...@@ -844,6 +853,19 @@ export default { ...@@ -844,6 +853,19 @@ export default {
this.ruleInfoVisible = true this.ruleInfoVisible = true
}, },
// 取消分账
cancelRule(row) {
this.$confirm('取消分帐后,订单按线下对账方式计算分润,收款金额统一分账至嘀加智慧云,请谨慎操作。是否确定取消?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
cancelDivideAccountsAPI({orderCode: row.orderCode}).then(res => {
this.notice.okTips()
this.handleSearch()
})
}).catch(() => {})
},
ruleInfoDialogClose(flag) { ruleInfoDialogClose(flag) {
this.ruleInfoVisible = !this.ruleInfoVisible this.ruleInfoVisible = !this.ruleInfoVisible
// if (flag) { // if (flag) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!