Commit 75223f87 by zhangxw

采购上架 采购审核需求开发

1 parent d3ab59af
import { http, http_common } from '@/main'
const path = 'dj.api.smartcarlife.'
// 服务商下门店数据
const getSimpleMerchantList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.scenemerchantref.queryShopRefByPartnerShop`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 服务商下门店数据(分页)
const getSimpleMerchantListByPage = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.scenemerchantref.queryShopRefByPartnerShopPage`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 所属系列所属分类下拉框数据
const getPurchaseGroundingSearchSelectData = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseMall.listByDataType`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取采购上架列表
const getPurchaseGroundingList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseMall.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 导出采购上架记录
const exportPurchaseGrounding = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseMall.export`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 新增编辑采购上架记录
const addOrUpdatePurchaseGrounding = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseMall.addOrUpdate`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 上架商品数据
const getGroundingGoodsList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}upgradeGoods.listWithPage`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取采购上架记录详情
const getPurchaseGroundingDetail = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseMall.getById`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 删除采购上架记录
const delPurchaseGrounding = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseMall.deleteById`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 上下架采购上架记录
const updatePurchaseGroundingStatus = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseMall.updateStatus`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default {
getSimpleMerchantList,
getSimpleMerchantListByPage,
getPurchaseGroundingSearchSelectData,
getPurchaseGroundingList,
exportPurchaseGrounding,
addOrUpdatePurchaseGrounding,
getGroundingGoodsList,
getPurchaseGroundingDetail,
delPurchaseGrounding,
updatePurchaseGroundingStatus
}
\ No newline at end of file \ No newline at end of file
import { http, http_common } from '@/main'
const path = 'dj.api.smarcarlife.'
// 采购审核列表
const getPurchaseCheckList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseApply.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 审核
const auditPurchaseCheck = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseApply.audit`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 驳回
const cancelPurchaseCheck = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseApply.reject`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 导出
const exportPurchaseCheck = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseApply.export`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getPurchaseCheckList,
auditPurchaseCheck,
cancelPurchaseCheck,
exportPurchaseCheck
}
\ No newline at end of file \ No newline at end of file
import Vue from 'vue' import Vue from 'vue'
import { defaultStatusOptions,putStatusOptions, defaultDeliveryStatusOptions, defaultPutStatusOptions, tableData } from '@/utils/constants.js' import { defaultStatusOptions,putStatusOptions, defaultDeliveryStatusOptions, defaultPutStatusOptions, tableData, purchaseGroundingStatusList, groundingCheckStatusList } from '@/utils/constants.js'
// 发货状态 // 发货状态
Vue.filter('deliveryStatus', (id, formatString) => { Vue.filter('deliveryStatus', (id, formatString) => {
const text = '--' const text = '--'
...@@ -41,3 +41,25 @@ Vue.filter('deliveryStatus', (id, formatString) => { ...@@ -41,3 +41,25 @@ Vue.filter('deliveryStatus', (id, formatString) => {
} }
return text return text
}) })
// 上架记录状态
Vue.filter('groundingStatus', (id, formatString) => {
const text = '--'
for (let i = 0; i < purchaseGroundingStatusList.length; i++) {
if (purchaseGroundingStatusList[i].id === id) {
return purchaseGroundingStatusList[i].label
}
}
return text
})
// 采购审核状态
Vue.filter('purchaseCheckStatus',(id, formatString) => {
const text = '--'
for (let i = 0; i < groundingCheckStatusList.length; i++) {
if (groundingCheckStatusList[i].id === id) {
return groundingCheckStatusList[i].label
}
}
return text
})
...@@ -13,6 +13,18 @@ const staticRoutes = Object.freeze([{ ...@@ -13,6 +13,18 @@ const staticRoutes = Object.freeze([{
path: '/DeliverList/index', path: '/DeliverList/index',
component: resolve => require([`@/views/DeliverList/index.vue`], resolve), component: resolve => require([`@/views/DeliverList/index.vue`], resolve),
meta: {} meta: {}
},
{
name: 'purchaseGrounding',
path: 'purchaseGrounding/index',
component: resolve => require([`@/views/purchaseGrounding/index.vue`], resolve),
meta: {}
},
{
name: 'purchaseCheck',
path: 'purchaseCheck/index',
component: resolve => require([`@/views/purchaseCheck/index.vue`], resolve),
meta: {}
} }
]) ])
export default staticRoutes export default staticRoutes
\ No newline at end of file \ No newline at end of file
...@@ -86,3 +86,51 @@ export const purchaseTypeList = [ ...@@ -86,3 +86,51 @@ export const purchaseTypeList = [
} }
] ]
export const membraneTypeList = [1, 4, 6, 12, 14] export const membraneTypeList = [1, 4, 6, 12, 14]
// 采购上架状态
export const purchaseGroundingStatusList = [
{
id: 0,
label: '草稿'
},
{
id: 1,
label: '已下架'
},
{
id: 2,
label: '已上架'
}
]
// 采购审核状态
export const groundingCheckStatusList = [
{
id: 1,
label: '待审核'
},
{
id: 2,
label: '已审核'
},
{
id: 3,
label: '已取消'
},
{
id: 4,
label: '已驳回'
}
]
// 商品来源
export const goodsSourceOptions = [
{
id: 0,
label: '嘀加'
},
{
id: 1,
label: '自营'
}
]
<!-- 驳回弹窗 -->
<template>
<GLDialog title="驳回" :visible.sync="dialogVisible" class="rejectDialog" :destroy-on-close="true" :close-on-click-modal="false" :before-close="handleClose" @onOk="handleConfirm" @onCancel="handleClose">
<el-form ref="rejectForm" class="rejectForm" :model="dataForm" :rules="formRules" label-width="154px" size="small">
<el-form-item label="驳回原因:" prop="reason">
<el-input v-model.trim="dataForm.reason" placeholder="请输入驳回原因" maxlength="20" class="form-node"></el-input>
</el-form-item>
</el-form>
</GLDialog>
</template>
<script>
import { beforeRangePickerOptions } from '@/components/glsx-combi-form/common'
export default {
name: 'rejectDialog',
props: {
visible: {
type: Boolean,
default: false
},
recordInfo: {
type: Object,
default: () => {}
}
},
data() {
return {
beforeRangePickerOptions,
dataForm: {
reason: ''
},
formRules: {
reason: [{ required: true, message: '请输入驳回原因', trigger: 'change' }]
},
}
},
computed: {
dialogVisible: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
},
mounted() {
this.$nextTick(() => {
this.$refs['rejectForm'].resetFields()
})
},
methods: {
handleClose() {
this.dialogVisible = false
},
handleConfirm() {
this.$refs['rejectForm'].validate(valid => {
if (valid) {
this.$emit('handleRejectConfirm', this.dataForm)
}
})
},
}
}
</script>
<style scoped lang="scss">
.rejectDialog{
.form-node{
width: 432px;
}
/deep/.el-dialog__body{
display: flex;
align-items: center;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 采购上架详情 -->
<template>
<div class="purchase-grounding-detail purchase-grounding edit-box">
<div class="container edit-container">
<p class="edit-title">基础信息</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :pageThat="this" :labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="sourceStrSpan">{{ editForm['goodsSourceStr'] }}</div>
<div slot="groundingGoodsInfo">
<div class="goodsInfo-box">
<div class="item" v-for="(subItem, subIndex) in goodsDetailForm" :key="subIndex">
<div v-if="subItem.addHtml" class="item_box">
<div class="label">{{ (membraneTypeList.includes(editForm.groundingGoodsInfo['goodsType']) ? subItem.label + `(元)/卷` : (subItem.label + '(元)/件')) }}:</div>
<div class="value">{{ priceFilter(editForm.groundingGoodsInfo[subItem.value]) }}</div>
</div>
<div v-else class="item_box">
<div class="label">{{ subItem.label + ':' }}</div>
<div class="value">{{ editForm.groundingGoodsInfo[subItem.value] || '-' }}</div>
</div>
</div>
</div>
</div>
<div slot="purchasePriceSpan">{{ priceFilter(editForm['shopPurchasePrice']) }}</div>
</glsx-combi-form>
</div>
<div class="container edit-container">
<p class="edit-title">上架门店</p>
<glsx-combi-form class="edit-form-container" ref="editFormMerchantRef" :isEdit="isEdit" :labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="merchantEditFormData" :formRules="editRule">
<div slot="merchantTable" :style="{ width: `calc(100% - ${defaultLabelWidth} )` }">
<div class="table-title">
上架门店列表
</div>
<GLTable ref="warehousListRef" :hasPage="false" :tableParams="tableParams" :tableData="editForm.merchantList"></GLTable>
</div>
</glsx-combi-form>
</div>
<GLFooter>
<el-button type="primary" @click="cancelJump" size="medium" :loading="loading">返回</el-button>
</GLFooter>
</div>
</template>
<script>
import { goodsSourceOptions, membraneTypeList } from '@/utils/constants.js'
export default {
name: 'purchaseGroundingDetail',
data() {
return {
editChildRef: 'editChildRef',
routeInfo: {},
editForm: {
goodsSourceStr: '',
groundingGoodsInfo: {},
shopPurchasePrice: '',
merchantList: []
},
isEdit: true,
editRule: {
goodsSourceStr: [{ required: true, message: '请选择商品来源', trigger: 'change' }],
upgradeGoodsId: [{ required: true, message: '请选择上架商品', trigger: 'change' }],
shopPurchasePrice: [
{ required: true, message: '请输入门店采购价', trigger: 'blur' }
]
},
editFormData: [
{
label: '商品来源',
name: 'goodsSourceStr',
addHtml: 'sourceStrSpan'
},
{
label: '上架商品',
name: 'upgradeGoodsId',
addHtml: 'groundingGoodsInfo'
},
{
label: '门店采购价(元)/件',
name: 'shopPurchasePrice',
addHtml: 'purchasePriceSpan'
}
],
merchantEditFormData: [
{
addHtml: 'merchantTable'
}
],
// 门店表格
tableParams: {
tableColumns: [
{
label: '门店名称',
prop: 'merchantName'
},
{
label: '商户号',
prop: 'merchantId'
}
]
},
goodsDetailForm: [
{
label: '商品名称',
value: 'upgradeGoodsName',
},
{
label: '商品编码',
value: 'type'
},
{
label: '嘀加采购价',
addHtml: 'DJPurchasePrice',
value: 'purchasePrice'
},
{
label: '所属分类',
value: 'goodsTypeName'
},
{
label: '所属系列',
value: 'goodsName'
}
],
membraneTypeList // 膜类code集合
}
},
mounted() {
this.keyDown()
this.routeInfo = this.$route.query
this.getInfo()
},
methods: {
keyDown() {
document.onkeydown = function() {
var evt = window.event || arguments[0]
if (evt && evt.keyCode == 13) {
if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true
if (typeof evt.stopPropagation == 'function') evt.stopPropagation()
return false
}
return true
}
},
priceFilter(num) {
var pow = Math.pow(10, 2)
if ((num ?? '') === '') return '-'
return (Math.round(num * pow) / pow).toFixed(2)
},
getInfo() {
let params = {
id: this.routeInfo?.id
}
this.$apis.grounding.getPurchaseGroundingDetail(params).then(res => {
res.goodsSourceStr = !((res.goodsSource ?? '') === '') ? goodsSourceOptions[res.goodsSource - 0]?.label : '-'
res.groundingGoodsInfo = {
...res.goodsInfo,
...res.upgradeGoods
}
console.log(res)
this.editForm = res
})
},
cancelJump() {
this.$router.push({
path: '/purchaseGrounding/index'
})
}
}
}
</script>
<style scoped lang="scss">
.purchase-grounding{
.container{
padding: 0 0 20px;
background: #fff;
.edit-title {
font-size: 16px;
font-weight: 600;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
padding: 0 0 0 20px;
}
.goodsInfo-box{
background: #F9F9F9;
display: flex;
flex-wrap: wrap;
padding: 15px 0;
.item{
flex: 0 0 33%;
.item_box{
display: flex;
align-items: start;
.label{
flex-shrink: 0;
color: #666666;
width: 150px;
text-align: right;
}
}
}
}
}
.edit-container{
margin-bottom: 16px;
}
.edit-form-container {
margin:20px 20px 0 0;
.table-title {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
}
}
.m-r-20 {
/deep/.glsx-combi-form-block{
color: #666666;
&:nth-child(1){
.el-form-item__content{
width: calc(100% - 154px);
}
}
}
}
}
.purchase-grounding.purchase-grounding-detail .select-merchant {
/* width: calc(98% - 140px); */
width: 98%;
}
.merchant-table {
margin: 0 20px;
}
</style>
<!-- 关联门店弹窗 -->
<template>
<GLDialog bigTitle="选择门店" mode="big" :visible.sync="relateStoreVisible" okText="关联" :before-close="handleRelateStoreClose" @onOk="handleRelateStoreConfirm" @onCancel="handleRelateStoreClose" class="relateStore">
<slot></slot>
<el-row>
<el-col :span="16">
<div class="title">客户列表</div>
<el-table ref="seletingTable" class="table hightline" :data="selectingData" height="460px" @select="handleChange" @select-all="handleAll">
<el-table-column fixed="left" width="5">
<template slot-scope="scope">
<span :scope="scope"></span>
</template>
</el-table-column>
<el-table-column type="selection" width="55" align="center" :selectable="selectable"></el-table-column>
<el-table-column prop="merchantName" label="客户名称" align="center"></el-table-column>
<el-table-column prop="merchantId" label="商户号" align="center"></el-table-column>
</el-table>
<el-pagination v-if="hasPage" small background @current-change="handleCurrentChange" :current-page.sync="pageNum" :page-size="pageSize" layout="total, prev, pager, next" :total="total"></el-pagination>
</el-col>
<el-col :span="8">
<div class="title mar_l10">已选客户</div>
<div class="selected_box">
<div class="box_top">
<span>已选</span>
<el-button type="text" @click="handelClearStore">清空</el-button>
</div>
<div class="box_content">
<div class="select_item" v-for="(subItem, subIndex) in selectedData" :key="subIndex">
<div class="text_value">{{ subItem.merchantName }}({{subItem.merchantId}})</div>
<div class="select_clear" @click="handleDelete(subItem)"><i class="el-icon-error"></i></div>
</div>
</div>
</div>
</el-col>
</el-row>
</GLDialog>
</template>
<script>
export default {
name: 'relateStoreDialog',
data() {
return {
selectedData: [],
selectingData: [],
// 分页
total: 0,
pageNum: 1,
pageSize: 20
}
},
props: {
relateStoreVisible: {
type: Boolean,
default: false
},
hasPage: {
type: Boolean,
default: true
},
// 页面来源
// sourcePage: {
// type: String,
// default: ''
// },
storeApi: {
type: Function,
default: () => { }
},
storeSelected: {
type: Array,
default: () => []
},
storeSearchForm: {
type: Object,
default: () => { }
}
// 去掉表格中某些字段
// noTableField: {
// type: Array,
// default: () => []
// }
},
mounted() {
this.selectedData = this.storeSelected
this.selectedData.forEach(item => {
item.merchantId = item.merchantId ? item.merchantId + '' : item.merchantId
})
this.getSelectingList()
},
methods: {
selectable(row, index) {
var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true
return isSelect
},
recoverySelection() {
var exitIds = this.selectedData.map(item => item.merchantId + '')
this.selectingData.forEach(item => {
if (exitIds.includes(item.merchantId + '')) {
this.$refs.seletingTable.toggleRowSelection(item, true)
} else {
this.$refs.seletingTable.toggleRowSelection(item, false)
}
})
},
getSelectingList() {
this.storeApi({
...this.storeSearchForm,
currentPage: this.pageNum,
pageSize: this.hasPage ? this.pageSize : 99999,
scene: 1,
partnerMerchantId: this.$globalState?.session?.merchantId
}).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 => {
let 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.recoverySelection()
},
handelClearStore() {
this.selectedData = []
this.recoverySelection()
},
handleCurrentChange(val) {
this.pageNum = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
if (!this.selectedData.length) {
this.$message({
message: '请选择关联门店',
type: 'warning',
showClose: true,
customClass: 'message-Z-zinde'
})
return true
}
this.$emit('handleRelateStoreConfirm', this.selectedData)
},
handleRelateStoreClose() {
this.$emit('handleRelateStoreClose')
}
}
}
</script>
<style lang="scss" scoped>
.relateStore{
.title{
font-size: 16px;
margin-bottom: 10px;
}
.mar_l10{
margin-left: 10px;
}
.selected_box{
margin-left: 10px;
border: 1px solid #E5E5E5;
height: 460px;
.box_top{
font-size: 16px;
padding: 11px 26px;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #E5E5E5;
}
.box_content{
padding: 12px 8px;
overflow-y: scroll;
height: calc(100% - 40px);
box-sizing: border-box;
.select_item{
display: flex;
align-items: center;
justify-content: space-between;
height: 32px;
padding: 0 8px;
cursor: pointer;
.text_value{
width: calc(100% - 50px);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.select_clear{
width: 12px;
height: 12px;
i{
color: #A6A6A6;
}
}
}
.select_item:hover{
background: #F2F1FF;
}
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!