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 class="add-btn" @click="addLineTable(index)">
添加入库记录
</div>
</div>
<el-form ref="addForm" :model="item" size="small" :rules="rules">
<GLTable :tableData="item.goodsWarehousingList" :noDataImg="url" :tableParams="tableParams" :hasPage="false">
<template slot="increaseStockNum" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.increaseStockNum'" :rules="rules.increaseStockNum">
<el-input v-model="scope.scope.increaseStockNum" placeholder="请输入" @blur="handleCalculate(scope.scope, 'increaseStockNum', index)"></el-input>
</el-form-item>
</template>
<!-- 入库仓库 -->
<template slot="yqMerchantId" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.yqMerchantId'" :rules="rules.shopMerchantName">
<el-select style="width: 100%" v-model="scope.scope.yqMerchantId" placeholder="请选择" @change="handleSelect(scope.scope, scope.scope.yqMerchantId)">
<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="merchantId" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.merchantId'" :rules="rules.merchantId">
<el-select style="width: 100%" v-model="scope.scope.merchantId" placeholder="请选择" @change="handleStoreSelect(scope.scope, scope.scope.merchantId)">
<el-option v-for="item in 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(index, scope.index)">删除</el-button>
</div>
</GLTable>
</el-form>
</div>
</template>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogShow = false">关闭</el-button>
<el-button type="primary" size="small" @click="handleSave">保存入库</el-button>
</span>
</GLDialog>
</template>
<script>
import BigNumber from 'bignumber.js'
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() {
var checkPrice = (rule, value, callback) => {
if (isNaN(+value)) {
callback(new Error('请输入数字值'))
} else {
if (value <= 0 || value > 999999) {
callback(new Error('仅支持输入0~999999'))
} else {
callback()
}
}
}
return {
membraneTypeList: membraneTypeList,
dayjs: dayjs,
goodsList: [],
storeUsageList: [],
refByYqShopList: [],
tableParams: {
tableOption: true,
tableColumns: [
{
label: '入库数量',
prop: 'increaseStockNum',
addHtml: 'increaseStockNum'
},
{
label: '入库仓库',
prop: 'yqMerchantId',
addHtml: 'yqMerchantId'
},
{
label: '入库门店',
prop: 'merchantId',
addHtml: 'merchantId'
}
]
},
rules: {
yqMerchantId: [{ required: true, message: '请选择入库仓库', trigger: 'change' }],
merchantId: [{ required: true, message: '请选择入库门店', trigger: 'change' }],
increaseStockNum: [
{ required: true, message: '请输入入库数量', trigger: 'blur' },
{ validator: checkPrice, trigger: 'blur' }
]
},
detailInfo: {}
}
},
created() {},
methods: {
handleCalculate(data, key, index) {
if (data[key] > this.detailInfo.deliveryDetailList[index].stockNum) {
data[key] = this.detailInfo.deliveryDetailList[index].stockNum
return
}
data[key] = data[key] ? new BigNumber(data[key]).dp(2).toNumber() : ''
},
getMerchantList() {
this.$apis.purchaseShopping.getMerchantList({ mainPartnerMerchant: true }).then(res => {
this.storeUsageList = res
if (this.storeUsageList.length == 1) this.defaultSelect()
})
},
defaultSelect() {
let {
detailInfo: { deliveryDetailList },
storeUsageList
} = this
deliveryDetailList.forEach(item => {
item.goodsWarehousingList[0].yqMerchantName = storeUsageList[0].merchantName
item.goodsWarehousingList[0].yqMerchantId = storeUsageList[0].merchantNo
})
this.getRefByYqShopList(deliveryDetailList[0].goodsWarehousingList[0], storeUsageList[0].merchantNo)
},
getRefByYqShopList(data, value) {
this.$apis.purchaseShopping.get4SRefByYqShopList({ scene: 1, merchantId: value }).then(res => {
this.refByYqShopList = res
if (data) {
this.refByYqShopList.unshift({
merchantName: data.yqMerchantName,
merchantId: data.yqMerchantId
})
}
})
},
handleSelect(data, id) {
this.storeUsageList.forEach(item => {
if (item.merchantNo == id) {
data.yqMerchantName = item.merchantName
data.merchantId = ''
}
})
this.getRefByYqShopList(data, id)
},
handleStoreSelect(data, id) {
this.refByYqShopList.forEach(item => {
if (item.merchantId == id) {
data.merchantName = item.merchantName
}
})
},
handleDetailClose() {
this.dialogShow = false
},
getDetail() {
this.$apis.delivery.getDeliveryDetail({ id: this.id }).then(res => {
if (res.code == 0) {
res.data.deliveryDetailList.forEach(item => {
item.goodsWarehousingList =[
{
increaseStockNum: '',
yqMerchantId: '',
yqMerchantName: '',
merchantId: '',
merchantName: ''
}
]
})
this.detailInfo = res.data
this.getMerchantList()
}
})
},
handleDelete(index, line) {
if (this.detailInfo.deliveryDetailList[index].goodsWarehousingList.length > 1) {
this.detailInfo.deliveryDetailList[index].goodsWarehousingList.splice(line, 1)
}
},
addLineTable(index) {
let { storeUsageList } = this
this.detailInfo.deliveryDetailList[index].goodsWarehousingList.push({
increaseStockNum: '',
yqMerchantId: storeUsageList.length == 1 ? storeUsageList[0].merchantNo : '',
yqMerchantName: storeUsageList.length == 1 ? storeUsageList[0].merchantName : '',
merchantId: '',
merchantName: ''
})
let data = this.detailInfo.deliveryDetailList
this.$set(data, index, data[index])
},
validateForm(form) {
return new Promise(resolve => {
form.validate(valid => {
if (valid) {
resolve()
}
})
})
},
handleSave() {
let num = 0
this.$refs['addForm'].forEach(async item => {
try {
await this.validateForm(item)
num++
} catch (err) {
console.log(err)
}
if (num == this.$refs['addForm'].length) {
let params = {
deliveryDetailList: this.detailInfo.deliveryDetailList
}
params.id = this.id
this.$apis.delivery.addPurchaseOrder(params).then(res => {
console.log(res)
if (res.code == 0) {
this.$message({
type: 'success',
message: '操作成功!'
})
this.dialogShow = false
this.$emit('handleSuccess')
} else {
this.$message({
type: 'error',
message: res.message
})
}
})
}
})
}
}
}
</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;
}
/deep/ td.el-table__cell {
height: 64px;
}
}
</style>
<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="purchase">
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header">
<h2>发货单列表</h2>
<div>
<el-button size="small" @click="exportExcel">导出</el-button>
</div>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="orderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="putStatus" slot-scope="scope">
<div>
<span :class="[scope.scope.putStatus == 1 ? 'yellowSpot' : 'greenSpot']"></span>
<span>{{ scope.scope.putStatus | puStatus }}</span>
</div>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<deliver-add :visible.sync="addVisible" :id="id" @handleSuccess="handleSearch"></deliver-add>
<deliver-detail :visible.sync="detailVisible" :id="id"></deliver-detail>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import DeliverAdd from './deliverAdd'
import DeliverDetail from './deliverDetail'
import { defaultStatusOptions, defaultDeliveryStatusOptions, defaultPutStatusOptions, purchaseTypeList } from '@/utils/constants.js'
export default {
name: 'PurchaseOrder',
components: {
DeliverAdd,
DeliverDetail
},
data() {
return {
size: 'small',
url: url,
searchForm: {
deliveryNumber: '',
deliveryCompany: '',
putStatus: '',
orderCode:this.$route.query.orderCode?this.$route.query.orderCode:'',
merchantName: '',
placeOrderTimeStr: []
},
tableSearchForm: {},
id: '',
// 查看门店
addVisible: false,
detailVisible: false,
showFormData: [
{
label: '承运单号',
name: 'deliveryNumber',
type: 'input',
isClear: true,
maxlength: 50
},
{
label: '承运公司',
name: 'deliveryCompany',
type: 'input',
isClear: true,
maxlength: 20
},
{
label: '发货时间',
name: 'placeOrderTimeStr',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '所属订单',
name: 'orderCode',
type: 'input',
isClear: true,
maxlength: 20
},
{
label: '所属商户',
name: 'merchantName',
type: 'input',
isClear: true,
maxlength: 50
},
{
label: '状态',
name: 'putStatus',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'label',
optionsName: 'defaultPutStatusOptions'
}
],
tableButtonList: [
{
type: 'GLButton',
name: '查看',
attrs: {
type: 'text',
fn: '查看'
},
listeners: {
click: this.handleDetail
}
},
{
type: 'GLButton',
name: '入库',
attrs: {
type: 'text',
fn: '入库'
},
condition: row => {
return row.putStatus == 1&&row.operatorStatus == 1
},
listeners: {
click: this.handleWarehousing
}
}
],
// 表格
getListApi: this.$apis.delivery.getDeliveryList,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '承运单号',
prop: 'deliveryNumber',
formatter: cellValue => {
return cellValue.deliveryNumber || '--'
}
},
{
label: '承运公司',
prop: 'deliveryCompany',
formatter: cellValue => {
return cellValue.deliveryCompany || '--'
}
},
{
label: '发货时间',
prop: 'deliveryDate',
formatter: cellValue => {
return cellValue.deliveryDate?dayjs(cellValue.deliveryDate).format('YYYY-MM-DD HH:mm:ss'):'--'
}
},
{
label: '所属订单',
prop: 'orderCode'
},
{
label: '所属商户',
prop: 'merchantName'
},
{
label: '状态',
prop: 'putStatus',
addHtml: 'putStatus'
},
{
label: '操作',
width: '180px',
addHtml: 'auth-button'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 基本数据
baseData: {
defaultStatusOptions: defaultStatusOptions,
defaultDeliveryStatusOptions: defaultDeliveryStatusOptions,
defaultPutStatusOptions: defaultPutStatusOptions,
merchantName: [],
storeUsageList: [],
purchaseTypeList: purchaseTypeList
}
}
},
mounted() {
this.$apis.purchaseShopping.getMerchantList({}).then(res => {
this.baseData.merchantName = res
this.baseData.storeUsageList = res
this.getOptionsList('showFormData')
})
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.placeOrderTimeStr.length) {
params.deliveryDateStart = dayjs(this.searchForm.placeOrderTimeStr[0]).format('YYYY-MM-DD') + ' 00:00:00'
params.deliveryDateEnd = dayjs(this.searchForm.placeOrderTimeStr[1]).format('YYYY-MM-DD')+ ' 23:59:59'
}
delete params.placeOrderTimeStr
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
console.log(this.tableSearchForm)
delete this.tableSearchForm.placeOrderTimeStr
resolve()
})
},
// 入库
handleWarehousing(row) {
this.id = row.id
this.addVisible = true
},
handleDetail(row) {
this.id = row.id
this.detailVisible = true
},
//自采入库-编辑
handleEdit(row) {
this.$router.push({
path: '/purchaseOrder/into',
query: {
orderCode: row.orderCode
}
})
},
//删除
handleDelete(row) {
this.secondConfirm('删除', '删除后不可恢复。是否确定删除?', 'purchaseShopping', 'purchaseOrderDelete', { orderCode: row.orderCode })
},
//取消
handleCancel(row) {
this.secondConfirm('取消', '订单取消后即自动作废该订单,且无法撤回。是否确定取消?', 'purchaseShopping', 'purchaseOrderCancelOrCheck', { orderCode: row.orderCode, operateType: 2 })
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.orderRef.data.length ? (this.$refs.orderRef.tableHeightValues = '') : this.$refs.orderRef.setTableHeightFun()
},
// 创建采购
handleCreatePurchase() {
this.$router.push('/purchaseOrder/add')
},
// 自采入库
handlePutStprage() {
this.$router.push('/purchaseOrder/into')
},
exportExcel() {
var params = this.getParams()
this.$apis.delivery.exportExcel(params).then(res => {
window.location.href = res
})
},
handleSearch() {
this.$refs.orderRef.refreshTable()
},
handleReset() {
this.searchForm = {
deliveryNumber: '',
deliveryCompany: '',
putStatus: '',
orderCode: '',
merchantName: '',
placeOrderTimeStr: []
}
this.handleSearch()
}
}
}
</script>
<style scoped lang="scss">
@import '@/assets/css/mixin.scss';
.purchase {
.table-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
margin-top: 20px;
h2 {
font-weight: 600;
font-size: 16px;
color: #333;
}
.glbtn {
left: 46px;
position: absolute;
}
.btn {
right: 47px;
position: absolute;
}
}
.greenSpot {
@include dot;
background: $color-green;
}
.yellowSpot {
@include dot;
background: $color-yellow;
}
.ashSpot {
@include dot;
background: $color-gray;
}
.table-btns /deep/.el-button--text {
min-width: 0 !important;
padding: 0;
}
}
</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;
}
}
......
......@@ -7,7 +7,7 @@
<h2>采购订单列表</h2>
<div>
<GLButton type="primary" size="small" @click="handleCreatePurchase" fn="创建采购">商城采购</GLButton>
<GLButton type="primary" plain size="small" @click="handlePutStprage" fn="自采入库">自采入库</GLButton>
<GLButton type="primary" plain size="small" @click="handlePutStprage" fn="自采入库">自采入库</GLButton>
<el-button size="small" @click="exportExcel">导出</el-button>
</div>
</div>
......@@ -16,19 +16,19 @@
<GLTable ref="orderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="deliveryStatus" slot-scope="scope">
<div>
<span v-if="scope.scope.status" :class="[scope.scope.deliveryStatus == 1 ? 'yellowSpot' : 'greenSpot']"></span>
<span v-if="scope.scope.deliveryStatus" :class="[scope.scope.deliveryStatus == 1 ? 'ashSpot' : scope.scope.deliveryStatus == 2 ? 'greenSpot' : 'yellowSpot']"></span>
<span>{{ scope.scope.deliveryStatus | deliveryStatus }}</span>
</div>
</template>
<template slot="putStatus" slot-scope="scope">
<div>
<span :class="[scope.scope.putStatus == 1 ? 'yellowSpot' : 'greenSpot']"></span>
<span>{{ scope.scope.putStatus | putStatus }}</span>
<span v-if="scope.scope.putStatus" :class="[scope.scope.putStatus == 1 ? 'ashSpot' : scope.scope.putStatus == 2 ? 'greenSpot' : 'yellowSpot']"></span>
<span>{{ scope.scope.putStatus | putOrderStatus }}</span>
</div>
</template>
<template slot="status" slot-scope="scope">
<div>
<span v-if="scope.scope.status" :class="[scope.scope.status == 1 ? 'yellowSpot' : scope.scope.status == 2 ? 'greenSpot' : 'ashSpot']"></span>
<span v-if="scope.scope.status" :class="[scope.scope.status == 1 ? 'yellowSpot' : scope.scope.status == 2 ? 'greenSpot' : scope.scope.status == 3 ? 'ashSpot' : 'redSpot']"></span>
<span>{{ scope.scope.status | orderStatus }}</span>
</div>
</template>
......@@ -43,7 +43,7 @@
</GLTable>
<!-- 表格区域 end -->
</div>
<orderDeatilDialog :visible.sync="detailVisible" :paramsObj="paramsObj"></orderDeatilDialog>
<orderDeatilDialog :visible.sync="detailVisible" v-if="detailVisible" :paramsObj="paramsObj"></orderDeatilDialog>
</div>
</template>
......@@ -51,7 +51,7 @@
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import orderDeatilDialog from './components/orderDetailDialog'
import { defaultStatusOptions, defaultDeliveryStatusOptions, defaultPutStatusOptions, purchaseTypeList } from '@/utils/constants.js'
import { defaultStatusOptions, defaultDeliveryStatusOptions, putStatusOptions, purchaseTypeList } from '@/utils/constants.js'
export default {
name: 'PurchaseOrder',
components: {
......@@ -83,7 +83,22 @@ export default {
label: '订单编号',
name: 'orderCode',
type: 'input',
isClear: true
isClear: true,
maxlength: 20
},
{
label: '下单时间',
name: 'placeOrderTimeStr',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '下单商户',
name: 'merchantName',
type: 'input',
isClear: true,
maxlength: 50
},
{
label: '订单状态',
......@@ -110,50 +125,43 @@ export default {
optionList: [],
optionId: 'id',
optionLabel: 'label',
optionsName: 'defaultPutStatusOptions'
optionsName: 'putStatusOptions'
},
{
label: '下单时间',
name: 'placeOrderTimeStr',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '入库时间',
name: 'warehousingTimeStr',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '下单门店',
name: 'merchantId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'merchantName'
},
{
label: '入库门店',
name: 'putMerchantId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'merchantName'
},
{
label: '使用门店',
name: 'storeUsage',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'storeUsageList'
},
// {
// label: '入库时间',
// name: 'warehousingTimeStr',
// type: 'datePicker',
// isClear: true,
// pickerOptions: 'beforeRangePickerOptions'
// },
// {
// label: '下单门店',
// name: 'merchantId',
// type: 'select',
// optionList: [],
// optionId: 'merchantNo',
// optionLabel: 'merchantName',
// optionsName: 'merchantName'
// },
// {
// label: '入库门店',
// name: 'putMerchantId',
// type: 'select',
// optionList: [],
// optionId: 'merchantNo',
// optionLabel: 'merchantName',
// optionsName: 'merchantName'
// },
// {
// label: '使用门店',
// name: 'storeUsage',
// type: 'select',
// optionList: [],
// optionId: 'merchantNo',
// optionLabel: 'merchantName',
// optionsName: 'storeUsageList'
// },
{
label: '采购类型',
name: 'purchaseType',
......@@ -183,7 +191,7 @@ export default {
fn: '删除'
},
condition: row => {
return (row.putStatus == 1 && row.purchaseType == 2)
return row.putStatus == 1 && row.purchaseType == 2
},
listeners: {
click: this.handleDelete
......@@ -197,7 +205,7 @@ export default {
fn: '编辑'
},
condition: row => {
return (row.putStatus == 1 && row.purchaseType == 2)
return row.putStatus == 1 && row.purchaseType == 2
},
listeners: {
click: this.handleEdit
......@@ -217,18 +225,31 @@ export default {
click: this.handleCancel
}
},
// {
// type: 'GLButton',
// name: '入库',
// attrs: {
// type: 'text',
// fn: '入库'
// },
// condition: row => {
// return (row.putStatus == 1 && row.deliveryStatus == 2 && row.purchaseType == 1) || (row.putStatus == 1 && row.purchaseType == 2)
// },
// listeners: {
// click: this.handleWarehousing
// }
// },
{
type: 'GLButton',
name: '入库',
type: 'el-button',
name: '发货单',
attrs: {
type: 'text',
fn: '入库'
type: 'text'
},
condition: row => {
return (row.putStatus == 1 && row.deliveryStatus == 2 && row.purchaseType == 1) || (row.putStatus == 1 && row.purchaseType == 2)
return (row.purchaseType == 1 && row.deliveryStatus == 2) || (row.purchaseType == 1 && row.deliveryStatus == 3)
},
listeners: {
click: this.handleWarehousing
click: this.handleDispatch
}
}
],
......@@ -244,12 +265,11 @@ export default {
width: '200'
},
{
label: '订单总价',
label: '订单总价/元',
prop: 'totalPrice',
formatter: cellValue => {
return '¥' + cellValue.totalPrice
},
width: 100
}
},
{
label: '下单时间',
......@@ -260,70 +280,65 @@ export default {
width: 180
},
{
label: '下单门店',
prop: 'merchantName',
minWidth: 150
},
{
label: '发货状态',
prop: 'deliveryStatus',
addHtml: 'deliveryStatus',
width: 120
label: '下单商户',
prop: 'merchantName'
},
{
label: '承运公司',
prop: 'deliveryCompany',
label: '采购类型',
prop: 'purchaseType',
formatter: cellValue => {
return cellValue.deliveryCompany || '--'
},
minWidth: 120
return (cellValue.purchaseType && (cellValue.purchaseType == 1 ? '商城采购' : '自采入库')) || '--'
}
},
{
label: '承运单号',
prop: 'deliveryNumber',
formatter: cellValue => {
return cellValue.deliveryNumber || '--'
},
width: 120,
line: 1
label: '发货状态',
prop: 'deliveryStatus',
addHtml: 'deliveryStatus'
},
// {
// label: '承运公司',
// prop: 'deliveryCompany',
// formatter: cellValue => {
// return cellValue.deliveryCompany || '--'
// },
// minWidth: 120
// },
// {
// label: '承运单号',
// prop: 'deliveryNumber',
// formatter: cellValue => {
// return cellValue.deliveryNumber || '--'
// },
// width: 120,
// line: 1
// },
{
label: '入库状态',
prop: 'putStatus',
addHtml: 'putStatus',
width: 120
},
{
label: '入库时间',
prop: 'putTime',
formatter: cellValue => {
return cellValue.putTime ? dayjs(cellValue.putTime).format('YYYY-MM-DD HH:mm:ss') : '--'
},
width: 180
},
{
label: '入库门店',
prop: 'putMerchantName',
line: 1,
width: 150,
formatter: cellValue => {
return cellValue.putMerchantName || '--'
}
},
{
label: '采购类型',
prop: 'purchaseType',
line: 1,
width: 150,
formatter: cellValue => {
return (cellValue.purchaseType && (cellValue.purchaseType == 1 ? '商城采购' : '自采入库')) || '--'
}
addHtml: 'putStatus'
},
// {
// label: '入库时间',
// prop: 'putTime',
// formatter: cellValue => {
// return cellValue.putTime ? dayjs(cellValue.putTime).format('YYYY-MM-DD HH:mm:ss') : '--'
// },
// width: 180
// },
// {
// label: '入库门店',
// prop: 'putMerchantName',
// line: 1,
// width: 150,
// formatter: cellValue => {
// return cellValue.putMerchantName || '--'
// }
// },
{
label: '订单状态',
prop: 'status',
addHtml: 'status',
width: 120
addHtml: 'status'
},
{
label: '操作',
......@@ -337,7 +352,7 @@ export default {
baseData: {
defaultStatusOptions: defaultStatusOptions,
defaultDeliveryStatusOptions: defaultDeliveryStatusOptions,
defaultPutStatusOptions: defaultPutStatusOptions,
putStatusOptions: putStatusOptions,
merchantName: [],
storeUsageList: [],
purchaseTypeList: purchaseTypeList
......@@ -397,6 +412,9 @@ export default {
.catch(() => {})
})
},
handleDispatch(data) {
this.$router.push(`/DeliverList/index?orderCode=${data.orderCode}`)
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
......@@ -423,8 +441,7 @@ export default {
this.paramsObj = {
orderCode: row.orderCode,
merchantName: row.merchantName,
purchaseType:row.purchaseType
purchaseType: row.purchaseType
}
this.detailVisible = true
},
......@@ -476,8 +493,28 @@ export default {
this.$refs.orderRef.data.length ? (this.$refs.orderRef.tableHeightValues = '') : this.$refs.orderRef.setTableHeightFun()
},
// 创建采购
handleCreatePurchase() {
this.$router.push('/purchaseOrder/add')
async handleCreatePurchase() {
let result = await this.checkShipper()
console.log(result)
if (result) this.$router.push('/purchaseOrder/add')
},
checkShipper() {
return new Promise(resolve => {
this.$apis.purchaseShopping.checkShipper({}).then(res => {
console.log(res)
if (res.code == -1) {
this.$confirm('您暂未开通采购商城,请联系运营人员开通。', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
resolve(false)
})
} else {
resolve(true)
}
})
})
},
// 自采入库
handlePutStprage() {
......@@ -548,6 +585,10 @@ export default {
@include dot;
background: $color-gray;
}
.redSpot {
@include dot;
background: $color-red;
}
.table-btns /deep/.el-button--text {
min-width: 0 !important;
padding: 0;
......
......@@ -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!