Commit bb1b422c by 前端

Merge branch 'v4.21.1' into 'master'

V4.21.1

See merge request !3
2 parents 48775129 0f2c2335
import { http } from '@/main'
const path = 'dj.api.smarcarlife.'
// 发货单分页查询
const getDeliveryList = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.delivery.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 发货单详情查看
const getDeliveryDetail = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.delivery.detail`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 采购订单入库
const addPurchaseOrder = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.warehousing`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 发货单导出
export function exportExcel(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.delivery.export`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getDeliveryList, addPurchaseOrder, exportExcel,getDeliveryDetail }
\ No newline at end of file
......@@ -60,4 +60,7 @@ const addSelfOrder = (params) => {
sign: true
})
}
export default { addSelfOrder,getGoodsList,getProductInfo, getProductTypeBySceneId ,getfwsGoodsList}
......@@ -199,7 +199,17 @@ export function getMerchantList(params) {
sign: true
})
}
//查询园区店关联的4s店列表 -入库门店
const get4SRefByYqShopList = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.scenemerchantref.query4SRefByYqShop`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//编辑
export function selectByOrderCode(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
......@@ -212,6 +222,18 @@ export function selectByOrderCode(params) {
})
}
// 是否有发货主体
export function checkShipper(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseOrder.checkShipper`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
// 确认发货
// export function purchaseOrderConfirmDelivery(data) {
// params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
......@@ -219,4 +241,4 @@ export function selectByOrderCode(params) {
// return http(data)
// }
export default { selectByOrderCode,purchaseOrderDelete, getMerchantList, purchaseOrderPutIn, exportExcel, shoppingCarUpdateNumber, purchaseOrderAdd, shoppingCarAdd, shoppingCarRemove, updateSelectedFlag, listGroupByGoodsType, getPurchaseOrderList, purchaseOrderCancelOrCheck, purchaseOrderDetail, listWithPagePurchaseInfo, addressGet, addressSave }
\ No newline at end of file
export default {checkShipper,get4SRefByYqShopList, selectByOrderCode,purchaseOrderDelete, getMerchantList, purchaseOrderPutIn, exportExcel, shoppingCarUpdateNumber, purchaseOrderAdd, shoppingCarAdd, shoppingCarRemove, updateSelectedFlag, listGroupByGoodsType, getPurchaseOrderList, purchaseOrderCancelOrCheck, purchaseOrderDetail, listWithPagePurchaseInfo, addressGet, addressSave }
\ No newline at end of file
import { http,http_common } from '@/main'
import { http, http_common } from '@/main'
const path = "dj.api."
const defaultPath = 'scrm.api.carlife.'
......@@ -40,5 +40,15 @@ const uploadImg = params => {
noSignAttr: ['file']
})
}
export default { getGoodsCategoryConfiguration, uploadImg, uploadVideo }
// 获取省市区信息
const getAreaInfoApi = function (params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}yseMerchantOffline.getAreaInfo`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getAreaInfoApi, getGoodsCategoryConfiguration, uploadImg, uploadVideo }
$color-yellow:#fdb757;
$color-green:#2cca74;
$color-gray:#999;
$color-red:#EB4E4E;
//背景图片 100%
@mixin bkgMaxSize($url) {
background-image: url($url);
......
......@@ -31,4 +31,7 @@ cursor: pointer;
background: url(../../images/shoppingCarIcon.webp) no-repeat;
background-size: 100% 100%;
margin-right: 4px;
}
.el-cascader-menu__wrap{
height: 204px!important;
}
\ No newline at end of file
import Vue from 'vue'
import { defaultStatusOptions, defaultDeliveryStatusOptions, defaultPutStatusOptions, tableData } from '@/utils/constants.js'
import { defaultStatusOptions,putStatusOptions, defaultDeliveryStatusOptions, defaultPutStatusOptions, tableData } from '@/utils/constants.js'
// 发货状态
Vue.filter('deliveryStatus', (id, formatString) => {
const text = '--'
......@@ -11,7 +11,7 @@ Vue.filter('deliveryStatus', (id, formatString) => {
return text
})
// 入库状态
Vue.filter('putStatus', (id, formatString) => {
Vue.filter('puStatus', (id, formatString) => {
const text = '--'
for (let i = 0; i < defaultPutStatusOptions.length; i++) {
if (defaultPutStatusOptions[i].id === id) {
......@@ -20,6 +20,16 @@ Vue.filter('deliveryStatus', (id, formatString) => {
}
return text
})
// 入库状态
Vue.filter('putOrderStatus', (id, formatString) => {
const text = '--'
for (let i = 0; i < putStatusOptions.length; i++) {
if (putStatusOptions[i].id === id) {
return putStatusOptions[i].label
}
}
return text
})
// 订单状态状态
Vue.filter('orderStatus', (id, formatString) => {
......
......@@ -9,9 +9,9 @@ const staticRoutes = Object.freeze([{
meta: {}
},
{
name: 'deliver',
path: '/deliver/index',
component: resolve => require([`@/views/deliver/index.vue`], resolve),
name: 'DeliverList',
path: '/DeliverList/index',
component: resolve => require([`@/views/DeliverList/index.vue`], resolve),
meta: {}
}
])
......
// 订单状态
export const defaultStatusOptions = [
{
id: 1,
label: "待审核"
},
{
id: 2,
label: "已审核"
},
{
id: 3,
label: "已取消"
}
]
// 发货状态
export const defaultDeliveryStatusOptions = [
{
id: 1,
label: "未发货"
},
{
id: 2,
label: "已发货"
}
]
// 入库状态
export const defaultPutStatusOptions = [
{
id: 1,
label: "未入库"
},
{
id: 2,
label: "已入库"
}
]
//采购类型
export const purchaseTypeList=[
{
id: 1,
label: "商城采购"
},
{
id: 2,
label: "自采入库"
},
]
export const membraneTypeList = [1, 4, 6, 12, 14]
{
id: 1,
label: "待审核"
},
{
id: 2,
label: "已审核"
},
{
id: 3,
label: "已取消"
},
{
id: 4,
label: "已驳回"
}
]
// 发货状态
export const defaultDeliveryStatusOptions = [
{
id: 1,
label: "未发货"
},
{
id: 3,
label: "部分发货"
},
{
id: 2,
label: "全部发货"
}
]
export const putStatusOptions = [
{
id: 1,
label: "未入库"
},
{
id: 3,
label: "部分入库"
}, {
id: 2,
label: "全部入库"
}
]
// 入库状态
export const defaultPutStatusOptions = [
{
id: 1,
label: "未入库"
},
{
id: 2,
label: "已入库"
}
]
//采购类型
export const purchaseTypeList = [
{
id: 1,
label: "商城采购"
},
{
id: 2,
label: "自采入库"
},
]
export const membraneTypeList = [1, 4, 6, 12, 14]
\ No newline at end of file
<template>
<GLDialog v-if="dialogShow" bigTitle="详细信息" mode="big" :visible.sync="dialogShow" :close-on-click-modal="false">
<div class="detail-info">
<div>
发货单号:
<span>{{ detailInfo.deliveryNumber }}</span>
</div>
<div>
承运公司:
<span>{{ detailInfo.deliveryCompany }}</span>
</div>
<div>
发货时间:
<span>{{ dayjs(detailInfo.deliveryDate).format('YYYY-MM-DD HH:mm:ss') }}</span>
</div>
</div>
<template v-for="(item, index) in detailInfo.deliveryDetailList">
<div class="table-wrap" :key="index">
<div class="detail-info">
<div>
商品名称:
<span>{{ item.upgradeGoodsName }}</span>
</div>
<div>
发货数量:
<span>{{ membraneTypeList.includes(item.goodsType) ? `${item.purchaseNumber}卷` : `${item.purchaseNumber}件` }}</span>
</div>
<div>
可用库存数量:
<span>{{ item.stockNum }}{{ membraneTypeList.includes(item.goodsType) ? `米` : `件` }}</span>
</div>
</div>
<el-form ref="addForm" :model="item" size="small">
<GLTable :tableData="item.goodsWarehousingList" :noDataImg="url" :tableParams="tableParams" :hasPage="false">
<template slot="increaseStockNum" slot-scope="scope">
<span>{{ membraneTypeList.includes(scope.scope.goodsType) ? `${scope.scope.increaseStockNum}米` : `${scope.scope.increaseStockNum}件` }}</span>
</template>
</GLTable>
</el-form>
</div>
</template>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogShow = false">关闭</el-button>
</span>
</GLDialog>
</template>
<script>
import * as dayjs from 'dayjs'
import { membraneTypeList } from '@/utils/constants.js'
export default {
name: 'DeliverAdd',
props: {
visible: {
type: Boolean,
default: false
},
id: {
type: String,
default: ''
}
},
computed: {
dialogShow: {
get() {
if (this.visible) {
this.getDetail()
}
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
},
data() {
return {
membraneTypeList: membraneTypeList,
dayjs: dayjs,
goodsList: [],
storeUsageList: [],
refByYqShopList: [],
tableParams: {
tableOption: false,
tableColumns: [
{
label: '入库数量',
prop: 'increaseStockNum',
addHtml: 'increaseStockNum'
},
{
label: '入库仓库',
prop: 'yqMerchantName'
},
{
label: '入库门店',
prop: 'merchantName'
}
]
},
detailInfo: {}
}
},
created() {},
methods: {
handleDetailClose() {
this.dialogShow = false
},
getDetail() {
this.$apis.delivery.getDeliveryDetail({ id: this.id }).then(res => {
if (res.code == 0) {
this.detailInfo = res.data
}
})
}
}
}
</script>
<style lang="scss" scoped>
.detail-info {
display: flex;
align-items: center;
justify-content: space-between;
color: #666666ff;
font-size: 14px;
margin-bottom: 16px;
span {
color: #333333ff;
}
.add-btn {
font-size: 14px;
color: #5850ff;
cursor: pointer;
}
}
.table-wrap {
border: 1px solid #e5e5e5;
padding: 16px;
box-sizing: border-box;
margin-top: 16px;
/deep/ .el-form-item__error {
padding-top: 2px;
z-index: 9999999;
position: static;
}
}
</style>
<!-- 专区管理 -->
<template>
<div class="marketing p-t-20">
<div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新建</el-button>
</div>
<div class="container">
<el-form :inline="true">
<el-form-item label="专区名称">
<el-input style="width: 215px;" :size="size" v-model="searchForm.zoneName"></el-input>
</el-form-item>
<el-form-item class="search-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="default" @click="handleReset">查询</el-button>
</el-form-item>
</el-form>
<!-- 表格区域 开始 -->
<GLTable
ref="zoneRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
export default {
name: 'zoneList',
data() {
return {
size: 'small',
url: url,
searchForm: {
zoneName: '',
createDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '专区名称',
name: 'zoneName',
type: 'input',
maxlength: 20
},
{
label: '创建日期',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
// 表格
getListApi: this.$apis.zoneList.getZoneListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '专区名称',
prop: 'zoneName'
},
{
label: '创建日期',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }
}
},
mounted() {},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
params.zoneType = '2' //专区类型(1发现频道,2商城专区)
if (this.searchForm.createDate.length) {
params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
this.$message({
type: 'success',
message: addOrEdit == '1' ? '新增' : '编辑'
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.zoneRef.data.length ? (this.$refs.zoneRef.tableHeightValues = '') : this.$refs.zoneRef.setTableHeightFun()
},
handleSearch() {
this.$refs.zoneRef.refreshTable()
},
handleReset() {
this.searchForm = {
zoneName: ''
}
this.handleSearch()
}
}
}
</script>
<style scoped>
.marketing .search-btns {
float: right;
margin-right: 0;
}
</style>
......@@ -22,7 +22,7 @@
</span>
<span class="address">
收货地址:
<span class="label">{{ $$(addressInfo, 'contactAddress') }}</span>
<span class="label">{{ $$(addressInfo, 'provinceName') }}{{ $$(addressInfo, 'cityName') }}{{ $$(addressInfo, 'areaName') }}{{ $$(addressInfo, 'contactAddress') }}</span>
</span>
</div>
</div>
......@@ -179,6 +179,7 @@ export default {
.then(result => {
if (result) {
this.addressInfo = result
console.log( this.addressInfo)
}
if (this.showOrderCom) {
......
<template>
<el-drawer class="shoppingCartDrawerCon" title="收货地址管理" size="500px" :visible.sync="dialogShow" :direction="direction">
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="100px" default-width="350px"
:form-ref="editChildRef" :form-obj="editForm" :form-data="editFormData" :form-rules="editRule"></glsx-combi-form>
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="100px" default-width="350px" :form-ref="editChildRef" :form-obj="editForm" :form-data="editFormData" :form-rules="editRule">
<span slot="provincesAndCities">
<!-- slot-scope="scope" -->
<el-cascader v-model="editForm.provincesAndCities" size="mini" ref="cascader" placeholder="请选择 省/市/区" style="width:350px" :options="provincesAndCities_options" :props="{ label: 'name', value: 'code', children: 'childrenList' }" />
</span>
</glsx-combi-form>
<div class="footer-btn">
<el-button @click="submit" type="primary">保存</el-button>
<el-button @click="dialogShow = false">取消</el-button>
</div>
</el-drawer>
</template>
......@@ -53,28 +56,41 @@ export default {
},
{
label: '收货地址',
name: 'provincesAndCities',
type: 'other',
addHtml: 'provincesAndCities'
},
{
label: '',
name: 'contactAddress',
type: 'input',
maxlength: 50,
placeholder: '请输入收货地址',
inputType: 'textarea'
inputType: 'textarea',
rows: 3,
style: {
'padding-left': '104px'
}
// tips: '如XX店车主关怀活动'
}
],
editForm: {
contactName: '',
contactPhone: '',
contactAddress: ''
contactAddress: '',
provincesAndCities: []
},
provincesAndCities_options: [],
editRule: {
contactName: [{ required: true, message: '请输入姓名', trigger: 'change' }],
contactPhone: [{ required: true, message: '请输入电话号码', trigger: 'change' },
{ validator: checkPhone, trigger: 'blur' }],
contactAddress: [{ required: true, message: '请输入收货地址', trigger: 'change' }]
contactPhone: [
{ required: true, message: '请输入电话号码', trigger: 'change' },
{ validator: checkPhone, trigger: 'blur' }
],
contactAddress: [{ required: true, message: '请输入收货地址', trigger: 'change' }],
provincesAndCities: [{ required: true, message: '请选择省市区', trigger: 'change' }]
},
editChildRef: 'editChildRef'
}
},
computed: {
......@@ -90,56 +106,79 @@ export default {
watch: {
visible(val) {
if (val) {
this.editForm = this.addressInfo ? this.$common.utils.deepClone(this.addressInfo) : {}
this.getAreaInfo()
if (this.addressInfo) {
this.editForm = this.$common.utils.deepClone(this.addressInfo)
this.editForm.provincesAndCities = [String(this.editForm.provinceId), String(this.editForm.cityId), String(this.editForm.areaId)]
} else {
this.editForm = {}
}
}
}
},
created() {},
methods: {
handleDetailClose() {
},
handleOkFn() {
// console.log('您点击了确定')
// 获取省市区信息
getAreaInfo() {
this.$apis.sysBase.getAreaInfoApi({ areaType: '2' }).then(res => {
this.provincesAndCities_options = res.areaList
})
},
handleRestFn() {
console.log('您点击了取消')
getProvincesAndCities() {
const nodesInfo = this.$refs.cascader.getCheckedNodes()
if (nodesInfo.length == 0 || Object.prototype.toString.call(nodesInfo[0]) != '[object Object]') {
return
}
this.editForm.provinceId = nodesInfo[0].pathNodes[0].value
this.editForm.provinceName = nodesInfo[0].pathNodes[0].label
this.editForm.cityId = nodesInfo[0].pathNodes[1].value
this.editForm.cityName = nodesInfo[0].pathNodes[1].label
this.editForm.areaId = nodesInfo[0].pathNodes[2].value
this.editForm.areaName = nodesInfo[0].pathNodes[2].label
},
submit() {
console.log(this.editForm.provincesAndCities)
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
this.getProvincesAndCities()
const params = this.$common.utils.deepClone(this.editForm)
this.$apis.purchaseShopping.addressSave(params).then((result) => {
this.$notify({
type: 'success',
title: '保存成功'
delete params.provincesAndCities
this.$apis.purchaseShopping
.addressSave(params)
.then(result => {
this.$notify({
type: 'success',
title: '保存成功'
})
this.dialogShow = false
this.$emit('handleConfirmAddress')
})
this.dialogShow = false
this.$emit('handleConfirmAddress')
}).catch((err) => {
})
.catch(err => {})
}
})
},
navBack() {
}
navBack() {}
}
}
</script>
<style lang="scss" scoped>
.shoppingCartDrawerCon {
// position: relative;
::v-deep .el-drawer__header {
/deep/ .el-drawer__header {
border-bottom: 1px solid #e7eaec;
margin-bottom: 20px;
padding-bottom: 10px;
font-weight: 600;
font-size: 20px;
}
/deep/ .el-textarea {
.el-textarea__inner {
height: auto !important;
}
}
.footer-btn {
text-align: center;
}
......
......@@ -20,6 +20,7 @@
<span class="num">{{ goodsInfo.purchaseOrderCount || 0 }}笔</span>
</span>
</div>
<div class="productCode">商品编码:{{goodsInfo.type}}</div>
<div class="skuCon">
<div class="label">规格:</div>
<div class="itemCon">
......@@ -46,7 +47,7 @@
</div>
<!-- <i class="carIcon"></i> -->
</div>
<div class="table-wrap" v-if="tableInfo.length">
<div class="table-wrap" v-if="tableInfo&&tableInfo.length">
<h3>适用门店</h3>
<GLTable :hasNum="false" :hasPage="false" :tableParams="tableParams" :table-data="tableInfo"></GLTable>
</div>
......@@ -150,8 +151,7 @@ export default {
getGoodsDetail() {
this.$apis.product.getProductInfo({ id: this.goodsId }).then(res => {
this.goodsInfo = res
this.tableInfo = res.upgradeGoodsList.filter(item => item.upgradeGoodsAlias)
// 调试用
this.tableInfo = res.upgradeGoodsList.merchantGoodsInfoList
// for (let index = 0; index < 12; index++) {
// this.goodsInfo.upgradeGoodsList[index] = this.goodsInfo.upgradeGoodsList[0]
// }
......@@ -329,4 +329,11 @@ export default {
margin-bottom: 16px;
}
}
.productCode{
font-weight: 400;
font-size: 14px;
color: #666666;
margin-bottom:16px;
padding-left: 18px;
}
</style>
<template>
<GLDialog v-if="dialogShow" bigTitle="详细信息" mode="big" :visible.sync="dialogShow" :close-on-click-modal="false" @onOk="dialogShow = false" @onCancel="dialogShow = false">
<GLDialog v-if="dialogShow" bigTitle="详细信息" mode="big" :visible.sync="dialogShow" :close-on-click-modal="false" @onOk="dialogShow = false" @onCancel="dialogShow = false">
<div class="detail-content" v-if="dialogShow">
<div class="addressTitle">
<img src="@/images/addressIcon.webp" alt="" class="icon" />
<span class="title">{{ paramsObj.merchantName }}</span>
</div>
<div class="address-info" v-if="paramsObj.purchaseType==1">
<div class="address-info" v-if="paramsObj.purchaseType == 1">
<span class="name">
收货人:
<span class="label">{{ detailInfo.contactName }}</span>
......@@ -16,7 +16,11 @@
</span>
<span class="address">
收货地址:
<span class="label">{{ detailInfo.contactAddress }}</span>
<span class="label">{{ detailInfo.provinceName }}{{ detailInfo.cityName }}{{ detailInfo.areaName }}{{ detailInfo.contactAddress }}</span>
</span>
<span class="address" v-if="detailInfo.rejectCause">
驳回原因:
<span class="label">{{ detailInfo.rejectCause }}</span>
</span>
</div>
<div class="table-class">
......@@ -47,6 +51,7 @@ export default {
dialogShow: {
get() {
if (this.visible) {
this.getDetail({ currentPage: 1, pageSize: 20 })
}
return this.visible
......@@ -65,43 +70,96 @@ export default {
tableColumns: [
{
label: '商品名称',
prop: 'upgradeGoodsName'
prop: 'upgradeGoodsName',
width: 120,
line: 1
},
{
label: '商品编码',
prop: 'type'
prop: 'type',
width: 100
},
{
label: '系列',
prop: 'goodsName'
prop: 'goodsName',
width: 100,
line: 1
},
{
label: '所属分类',
prop: 'goodsTypeName'
prop: 'goodsTypeName',
width: 100
},
{
label: '采购数量',
prop: 'goodsNumber',
formatter: cellValue => {
let condition= membraneTypeList.includes(cellValue.goodsType) ? `${cellValue.goodsNumber}卷/${cellValue.conversionValue ? cellValue.goodsNumber * cellValue.conversionValue : '-'}米` : `${cellValue.goodsNumber}件`
let condition = membraneTypeList.includes(cellValue.goodsType) ? `${cellValue.goodsNumber}卷` : `${cellValue.goodsNumber}件`
return this.paramsObj.purchaseType == 1 ? condition : `${cellValue.goodsNumber}件`
},
width: 100
},
{
label: '库存总量',
prop: 'goodsTypeName',
formatter: cellValue => {
let condition = membraneTypeList.includes(cellValue.goodsType) ? `${cellValue.conversionValue ? cellValue.goodsNumber * cellValue.conversionValue : '-'}米` : `${cellValue.goodsNumber}件`
return this.paramsObj.purchaseType==1?condition:`${cellValue.goodsNumber}件`
}
return this.paramsObj.purchaseType == 1 ? condition : `${cellValue.goodsNumber}件`
},
width: 100
},
{
label: '采购总价/元',
prop: 'goodsTotalPrice',
formatter: cellValue => {
return '¥' + cellValue.goodsTotalPrice
}
},
width: 120
}
]
},
detailInfo: {}
}
},
created() {
this.dynamicParams()
},
methods: {
dynamicParams() {
if (this.paramsObj.purchaseType == 1) {
this.tableParams.tableColumns.push(
{
label: '已发货数量',
prop: 'purchaseNumber',
width: 110,
line: 1
},
{
label: '已入库数量',
prop: 'inputNumber',
width: 110,
line: 1
}
)
} else {
this.tableParams.tableColumns.push(
{
label: '入库仓库',
prop: 'putYqMerchantName',
width: 100,
line: 1
},
{
label: '入库门店',
prop: 'putMerchantName',
width: 100,
line: 1
}
)
}
},
handleDetailClose() {
this.dialogShow = false
},
......@@ -111,6 +169,7 @@ export default {
getDetail(pageObj) {
this.$apis.purchaseShopping.purchaseOrderDetail({ orderCode: this.paramsObj.orderCode, pageSize: pageObj.pageSize, currentPage: pageObj.currentPage }).then(res => {
this.detailInfo = res
console.log(this.detailInfo)
this.detailInfo.tableData = res.pagination.list
this.detailInfo.tableTotal = res.pagination.total
})
......
......@@ -71,7 +71,8 @@
<ul class="orderInfoCom">
<li class="item" v-for="(item, index) in addressInfoList" :key="index">
<span class="label">{{ item.label }}</span>
<span class="conten">{{ $$(addressInfo, [item.name]) }}</span>
<span class="conten" v-if="item.name == 'contactAddress'">{{ $$(addressInfo, 'provinceName') }}{{ $$(addressInfo, 'cityName') }}{{ $$(addressInfo, 'areaName') }}{{ $$(addressInfo, 'contactAddress') }}</span>
<span class="conten" v-else>{{ $$(addressInfo, [item.name]) }}</span>
</li>
</ul>
</div>
......@@ -186,17 +187,25 @@ export default {
},
handleSubmit() {
if (this.throttleSubmit) return
console.log(this.throttleSubmit)
console.log('submit')
const { contactAddress, contactName, contactPhone } = this.addressInfo
const { contactAddress, contactName, contactPhone, provinceId, provinceName, cityId, cityName, areaId, areaName } = this.addressInfo
const params = {
orderDelivery: {
contactAddress,
contactName,
contactPhone
},
contactAddress,
contactName,
contactPhone,
provinceId,
provinceName,
cityId,
cityName,
areaId,
areaName,
shoppingCarList: this.selectList
}
if (provinceName === null) {
this.dialogShow = false
this.drawer = false
this.$message.error('请完善收货地址')
return
}
this.throttleSubmit = true
this.$apis.purchaseShopping.purchaseOrderAdd(params).then(result => {
this.drawer = false
......@@ -214,7 +223,6 @@ export default {
// }
},
handleDelete(upgradeGoodsId) {
// console.log(upgradeGoodsId)
this.$apis.purchaseShopping.shoppingCarRemove({ id: upgradeGoodsId }).then(result => {
this.getGoodsList()
})
......@@ -426,7 +434,8 @@ li {
.car-txt {
font-size: 14px;
color: #ffffff;
writing-mode:vertical-rl;
writing-mode: vertical-rl;
cursor: pointer;
}
&::after {
// content: "123";
......@@ -582,14 +591,14 @@ li {
text-align: center;
font-size: 20px;
color: #f8ba37;
margin:20px 0 40px 0;
margin: 20px 0 40px 0;
}
.tips {
display: flex;
justify-content: space-between;
span{
margin-bottom:20px;
span {
margin-bottom: 20px;
}
}
......
......@@ -29,7 +29,22 @@
<el-input v-model="scope.scope.goodsTotalPrice" placeholder="请输入" @blur="handleCalculate(scope.scope, 'goodsTotalPrice')"></el-input>
</el-form-item>
</template>
<!-- 入库仓库 -->
<template slot="putYqMerchantId" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'tableData.' + scope.index + '.putYqMerchantId'" :rules="rules.putYqMerchantId">
<el-select style="width: 100%" v-model="scope.scope.putYqMerchantId" placeholder="请选择" @change="handleSelect(scope.scope, scope.scope.putYqMerchantId)">
<el-option v-for="item in storeUsageList" :key="item.merchantNo" :label="item.merchantName" :value="item.merchantNo"></el-option>
</el-select>
</el-form-item>
</template>
<!-- 入库门店 -->
<template slot="putMerchantId" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'tableData.' + scope.index + '.putMerchantId'" :rules="rules.putMerchantId">
<el-select style="width: 100%" v-model="scope.scope.putMerchantId" placeholder="请选择" @change="handleStoreSelect(scope.scope, scope.scope.putMerchantId)">
<el-option v-for="item in scope.scope.refByYqShopList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId"></el-option>
</el-select>
</el-form-item>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDelete(scope.index)">删除</el-button>
</div>
......@@ -74,10 +89,12 @@ export default {
upgradePurchasePrice: [
{ required: true, message: '请输入采购单价', trigger: 'blur' },
{ validator: checkPrice, trigger: 'blur' }
]
],
putYqMerchantId: [{ required: true, message: '请选择入库仓库', trigger: 'change' }],
putMerchantId: [{ required: true, message: '请选择入库门店', trigger: 'change' }]
},
formdata: {
tableData: [{ upgradeGoodsId: '', type: '', goodsName: '', goodsNumber: '', upgradePurchasePrice: '', goodsTotalPrice: '' }]
tableData: [{ upgradeGoodsId: '', type: '', goodsName: '', goodsNumber: '', upgradePurchasePrice: '', goodsTotalPrice: '', putYqMerchantId: '', putYqMerchantName: '', putMerchantId: '', putMerchantName: '' , refByYqShopList: []}]
},
tableParams: {
tableOption: true,
......@@ -109,17 +126,58 @@ export default {
label: '采购总额/元',
prop: 'goodsTotalPrice',
addHtml: 'goodsTotalPrice'
},
{
label: '入库仓库',
prop: 'putYqMerchantId',
addHtml: 'putYqMerchantId'
},
{
label: '入库门店',
prop: 'putMerchantId',
addHtml: 'putMerchantId'
}
]
},
goodsList: []
goodsList: [],
storeUsageList: [],
refByYqShopList: []
}
},
created() {
this.getfwsGoodsList()
this.getMerchantList()
if (this.orderCode) this.getData()
},
methods: {
getMerchantList() {
this.$apis.purchaseShopping.getMerchantList({ mainPartnerMerchant: true }).then(res => {
this.storeUsageList = res
if (this.storeUsageList.length == 1) this.defaultSelect()
})
},
defaultSelect() {
let {
formdata: { tableData },
storeUsageList
} = this
tableData.forEach(item => {
item.putYqMerchantName = storeUsageList[0].merchantName
item.putYqMerchantId = storeUsageList[0].merchantNo
})
this.getRefByYqShopList(tableData[0], storeUsageList[0].merchantNo)
},
getRefByYqShopList(data, value) {
this.$apis.purchaseShopping.get4SRefByYqShopList({ scene: 1, merchantId: value }).then(res => {
data.refByYqShopList = res
if (data) {
data.refByYqShopList.unshift({
merchantName: data.putYqMerchantName,
merchantId: Number(data.putYqMerchantId)
})
}
})
},
handleSave(saveOrWarehousing) {
this.$refs['addForm'].validate(valid => {
if (valid) {
......@@ -130,7 +188,11 @@ export default {
goodsName: item.goodsName,
goodsNumber: item.goodsNumber,
upgradePurchasePrice: item.upgradePurchasePrice,
goodsTotalPrice: item.goodsTotalPrice
goodsTotalPrice: item.goodsTotalPrice,
putYqMerchantId: item.putYqMerchantId,
putYqMerchantName: item.putYqMerchantName,
putMerchantId: item.putMerchantId,
putMerchantName: item.putMerchantName
})
})
let params = {
......@@ -166,8 +228,15 @@ export default {
},
getData() {
this.$apis.purchaseShopping.selectByOrderCode({ orderCode: this.orderCode }).then(res => {
this.formdata.tableData = res
res.forEach(item => {
item.putYqMerchantId = String(item.putYqMerchantId)
item.putMerchantId = item.putMerchantId
item.refByYqShopList = []
this.getRefByYqShopList(item, item.putYqMerchantId)
})
this.$nextTick(() => {
this.formdata.tableData = res
})
})
},
handleDelete(index) {
......@@ -187,44 +256,80 @@ export default {
}
})
},
handleCalculate(data, key) {
handleSelect(data, id) {
this.storeUsageList.forEach(item => {
if (item.merchantNo == id) {
data.putYqMerchantName = item.merchantName
data.putMerchantId = ''
}
})
this.getRefByYqShopList(data, id)
},
handleStoreSelect(data, id) {
this.refByYqShopList.forEach(item => {
if (item.merchantId == id) {
data.putMerchantName = item.merchantName
}
})
},
handleCalculate(data, key) {
if (key == 'goodsNumber') {
data[key] = data[key]?new BigNumber(data[key]).dp(0).toNumber():''
data.goodsTotalPrice = data.upgradePurchasePrice&&data.goodsNumber?new BigNumber(data.upgradePurchasePrice)
.times(data.goodsNumber)
.dp(2)
.toNumber():''
data[key] = data[key] ? new BigNumber(data[key]).dp(0).toNumber() : ''
data.goodsTotalPrice =
data.upgradePurchasePrice && data.goodsNumber
? new BigNumber(data.upgradePurchasePrice)
.times(data.goodsNumber)
.dp(2)
.toNumber()
: ''
return
}
if (!data.goodsNumber) return
data[key] = data[key]?new BigNumber(data[key]).dp(2).toNumber():''
data[key] = data[key] ? new BigNumber(data[key]).dp(2).toNumber() : ''
let params = {
upgradePurchasePrice: data => {
data.goodsTotalPrice = data.upgradePurchasePrice?new BigNumber(data.upgradePurchasePrice)
.times(data.goodsNumber)
.dp(2)
.toNumber():''
data.goodsTotalPrice = data.upgradePurchasePrice
? new BigNumber(data.upgradePurchasePrice)
.times(data.goodsNumber)
.dp(2)
.toNumber()
: ''
},
goodsTotalPrice: data => {
data.upgradePurchasePrice = data.goodsTotalPrice?new BigNumber(data.goodsTotalPrice)
.div(data.goodsNumber)
.dp(2)
.toNumber():''
data.upgradePurchasePrice = data.goodsTotalPrice
? new BigNumber(data.goodsTotalPrice)
.div(data.goodsNumber)
.dp(2)
.toNumber()
: ''
}
}
params[key](data)
},
addLine() {
this.formdata.tableData.unshift({
let {
storeUsageList,
formdata: { tableData }
} = this
tableData.unshift({
refByYqShopList: [],
upgradeGoodsId: '',
type: '',
goodsName: '',
goodsNumber: '',
upgradePurchasePrice: '',
goodsTotalPrice: ''
goodsTotalPrice: '',
putYqMerchantId: storeUsageList.length == 1 ? storeUsageList[0].merchantNo : '',
putYqMerchantName: storeUsageList.length == 1 ? storeUsageList[0].merchantName : '',
putMerchantId: '',
putMerchantName: ''
})
if (storeUsageList.length == 1) {
this.getRefByYqShopList(tableData[0], tableData[0].putYqMerchantId)
}
},
goBack() {
this.$router.go(-1)
......@@ -255,6 +360,6 @@ export default {
}
/deep/ td.el-table__cell {
height: 64px;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!