Commit 0ba49430 by 王志慧

修复采购管理第一轮测试bug

1 parent e6ef6ed6
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) => {
......
// 订单状态
export const defaultStatusOptions = [
{
id: 1,
label: "待审核"
},
{
id: 2,
label: "已审核"
},
{
id: 3,
label: "已取消"
},
{
id: 4,
label: "已驳回"
}
]
// 发货状态
export const defaultDeliveryStatusOptions = [
{
id: 1,
label: "未发货"
},
{
id: 3,
label: "部分发货"
},
{
id: 2,
label: "全部发货"
}
]
{
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]
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
......@@ -159,7 +159,7 @@ export default {
data[key] = data[key] ? new BigNumber(data[key]).dp(2).toNumber() : ''
},
getMerchantList() {
this.$apis.purchaseShopping.getMerchantList({mainPartnerMerchant :true}).then(res => {
this.$apis.purchaseShopping.getMerchantList({ mainPartnerMerchant: true }).then(res => {
this.storeUsageList = res
if (this.storeUsageList.length == 1) this.defaultSelect()
})
......@@ -173,15 +173,17 @@ export default {
item.goodsWarehousingList[0].yqMerchantName = storeUsageList[0].merchantName
item.goodsWarehousingList[0].yqMerchantId = storeUsageList[0].merchantNo
})
this.getRefByYqShopList(deliveryDetailList[0].goodsWarehousingList[0],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.$apis.purchaseShopping.get4SRefByYqShopList({ scene: 1, merchantId: value }).then(res => {
this.refByYqShopList = res
this.refByYqShopList.unshift({
merchantName: data.yqMerchantName,
merchantId: data.yqMerchantId
})
if (data) {
this.refByYqShopList.unshift({
merchantName: data.yqMerchantName,
merchantId: data.yqMerchantId
})
}
})
},
handleSelect(data, id) {
......@@ -191,7 +193,7 @@ export default {
data.merchantId = ''
}
})
this.getRefByYqShopList(data, id)
this.getRefByYqShopList('', id)
},
handleStoreSelect(data, id) {
this.refByYqShopList.forEach(item => {
......
......@@ -22,8 +22,8 @@
<span>{{ item.upgradeGoodsName }}</span>
</div>
<div>
发货数量:
<span>{{ item.purchaseNumber }}卷</span>
发货数量:
<span>{{ item.purchaseType == 2 ? `${item.purchaseNumber}件`:membraneTypeList.includes(item.goodsType) ? `${item.purchaseNumber}卷` : `${item.purchaseNumber}件` }}</span>
</div>
<div>
可用库存数量:
......@@ -46,6 +46,7 @@
<script>
import * as dayjs from 'dayjs'
import { membraneTypeList } from '@/utils/constants.js'
export default {
name: 'DeliverAdd',
props: {
......@@ -73,6 +74,7 @@ export default {
},
data() {
return {
membraneTypeList:membraneTypeList,
dayjs:dayjs,
goodsList: [],
storeUsageList: [],
......
......@@ -15,7 +15,7 @@
<template slot="putStatus" slot-scope="scope">
<div>
<span :class="[scope.scope.putStatus == 1 ? 'yellowSpot' : 'greenSpot']"></span>
<span>{{ scope.scope.putStatus | putStatus }}</span>
<span>{{ scope.scope.putStatus | puStatus }}</span>
</div>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
......@@ -49,7 +49,7 @@ export default {
deliveryNumber: '',
deliveryCompany: '',
putStatus: '',
orderCode: '',
orderCode:this.$route.query.orderCode?this.$route.query.orderCode:'',
merchantName: '',
placeOrderTimeStr: []
},
......@@ -216,6 +216,7 @@ export default {
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
console.log(this.tableSearchForm)
delete this.tableSearchForm.placeOrderTimeStr
resolve()
})
......
<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" />
......@@ -18,7 +18,7 @@
收货地址:
<span class="label">{{ detailInfo.provinceName }}{{ detailInfo.cityName }}{{ detailInfo.areaName }}{{ detailInfo.contactAddress }}</span>
</span>
<span class="address">
<span class="address" v-if="detailInfo.rejectCause">
驳回原因:
<span class="label">{{ detailInfo.rejectCause }}</span>
</span>
......@@ -51,6 +51,7 @@ export default {
dialogShow: {
get() {
if (this.visible) {
this.getDetail({ currentPage: 1, pageSize: 20 })
}
return this.visible
......@@ -123,7 +124,7 @@ export default {
}
},
created() {
this.dynamicParams()
this.dynamicParams()
},
methods: {
dynamicParams() {
......@@ -168,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
})
......
......@@ -23,7 +23,7 @@
<template slot="putStatus" slot-scope="scope">
<div>
<span v-if="scope.scope.putStatus" :class="[scope.scope.putStatus == 1 ? 'ashSpot' : scope.scope.putStatus == 2 ? 'greenSpot' : 'yellowSpot']"></span>
<span>{{ scope.scope.putStatus | putStatus }}</span>
<span>{{ scope.scope.putStatus | putOrderStatus }}</span>
</div>
</template>
<template slot="status" slot-scope="scope">
......@@ -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>
......@@ -86,6 +86,20 @@ export default {
isClear: true,
maxlength: 20
},
{
label: '下单时间',
name: 'placeOrderTimeStr',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '下单商户',
name: 'merchantName',
type: 'input',
isClear: true,
maxlength: 50
},
{
label: '订单状态',
name: 'status',
......@@ -114,56 +128,50 @@ export default {
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: 'purchaseType',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'label',
optionsName: 'purchaseTypeList'
}
// {
// 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',
// type: 'select',
// optionList: [],
// optionId: 'id',
// optionLabel: 'label',
// optionsName: 'purchaseTypeList'
// }
],
tableButtonList: [
{
......@@ -218,20 +226,20 @@ 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: '入库',
// 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: 'el-button',
name: '发货单',
......@@ -307,23 +315,23 @@ export default {
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: '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',
......@@ -411,8 +419,8 @@ export default {
.catch(() => {})
})
},
handleDispatch() {
this.$router.push('/DeliverList/index')
handleDispatch(data) {
this.$router.push(`/DeliverList/index?orderCode=${data.orderCode}`)
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
......
......@@ -151,8 +151,31 @@ export default {
},
methods: {
getMerchantList() {
this.$apis.purchaseShopping.getMerchantList({mainPartnerMerchant :true}).then(res => {
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 => {
this.refByYqShopList = res
if (data) {
this.refByYqShopList.unshift({
merchantName: data.putYqMerchantName,
merchantId: data.putYqMerchantId
})
}
})
},
handleSave(saveOrWarehousing) {
......@@ -225,11 +248,7 @@ export default {
}
})
},
getRefByYqShopList(value) {
this.$apis.purchaseShopping.get4SRefByYqShopList({ scene: 1, merchantId: value }).then(res => {
this.refByYqShopList = res
})
},
handleSelect(data, id) {
this.storeUsageList.forEach(item => {
if (item.merchantNo == id) {
......@@ -237,7 +256,7 @@ export default {
data.putMerchantId = ''
}
})
this.getRefByYqShopList(id)
this.getRefByYqShopList('', id)
},
handleStoreSelect(data, id) {
this.refByYqShopList.forEach(item => {
......@@ -283,13 +302,18 @@ export default {
},
addLine() {
let { storeUsageList } = this
this.formdata.tableData.unshift({
upgradeGoodsId: '',
type: '',
goodsName: '',
goodsNumber: '',
upgradePurchasePrice: '',
goodsTotalPrice: ''
goodsTotalPrice: '',
putYqMerchantId: storeUsageList.length == 1 ? storeUsageList[0].merchantNo : '',
putYqMerchantName: storeUsageList.length == 1 ? storeUsageList[0].merchantName : '',
putMerchantId: '',
putMerchantName: ''
})
},
goBack() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!