【类 型】:refactor
【主 题】:调整 订单获取接口 相关代码 【描 述】: [原因]:数据库 订单表的解构变化 导致接口获取失败 [过程]:取消quest字段 全部改用 status back字段 并且此俩字段的类型改为 枚举类型 [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
1b137c0442
commit
7d346defe2
@ -62,11 +62,8 @@
|
|||||||
<el-select v-model="questForm.id" :filterable="isMobile" placeholder="请选择,也可输入搜索" :disabled="airLock">
|
<el-select v-model="questForm.id" :filterable="isMobile" placeholder="请选择,也可输入搜索" :disabled="airLock">
|
||||||
<el-option v-for="item in questList" :key="item.id" :label="item.id" :value="item.id">
|
<el-option v-for="item in questList" :key="item.id" :label="item.id" :value="item.id">
|
||||||
<span class="l">{{ item.id }}</span>
|
<span class="l">{{ item.id }}</span>
|
||||||
<span class="l m-l-5">{{ item.name }}</span>
|
<span class="l m-l-5">{{ item.receiver }}</span>
|
||||||
<span class="l m-l-5">{{ item.receive_site_name }}</span>
|
<span class="l m-l-5">{{ item.receive_site_name }}</span>
|
||||||
<span v-for="product in item.products" :key="product.id" class="l m-l-5">{{
|
|
||||||
product.name
|
|
||||||
}}-{{ product.pro_buff }}-{{ product.num }}份</span>
|
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -300,13 +297,13 @@ export default {
|
|||||||
*/
|
*/
|
||||||
questList () {
|
questList () {
|
||||||
const plane = this.plane
|
const plane = this.plane
|
||||||
return plane ? this.$store.state.questList.filter((item) => item.shop_id === plane.shop_id && item.quest === '1' && item.status === '20' && item.back === '0' && item.runing === null) : []
|
return plane ? this.$store.state.orderList.filter((item) => item.shop_id === plane.shop_id && item.status === 'processing' && item.back === 'normal') : []
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @description: 已付款 已承接 已发货 订单列表
|
* @description: 已发货 订单列表
|
||||||
*/
|
*/
|
||||||
overQuestList () {
|
overQuestList () {
|
||||||
return this.$store.state.questList.filter((item) => item.quest === '1' && item.status === '30' && item.runing != null)
|
return this.$store.state.orderList.filter((item) => item.status === 'shipped')
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @description: 航线列表
|
* @description: 航线列表
|
||||||
@ -539,6 +536,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
setTimeout(() => {
|
||||||
|
console.log(this.$store.state.orderList)
|
||||||
|
}, 3000)
|
||||||
if (this.siteList && this.routeList) {
|
if (this.siteList && this.routeList) {
|
||||||
this.airLock = this.siteList.some(item => item.runing === this.planesId)
|
this.airLock = this.siteList.some(item => item.runing === this.planesId)
|
||||||
}
|
}
|
||||||
@ -550,7 +550,7 @@ export default {
|
|||||||
} else { // 如果没有执行任务 把地图上航线清除
|
} else { // 如果没有执行任务 把地图上航线清除
|
||||||
this.$emit('clearRoute')
|
this.$emit('clearRoute')
|
||||||
}
|
}
|
||||||
this.$store.dispatch('fetchQuestList')// 刷新订单列表
|
this.$store.dispatch('fetchOrderList')// 刷新订单列表
|
||||||
this.$store.dispatch('fetchSiteList')// 刷新站点列表
|
this.$store.dispatch('fetchSiteList')// 刷新站点列表
|
||||||
},
|
},
|
||||||
siteList (val) {
|
siteList (val) {
|
||||||
|
@ -52,12 +52,12 @@
|
|||||||
<el-button type="danger" icon="iconfont icon-zhengque">
|
<el-button type="danger" icon="iconfont icon-zhengque">
|
||||||
<font class="m-l-5">同意退款</font>
|
<font class="m-l-5">同意退款</font>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="questAss(item.id, 'back', 'zero')" type="warning" icon="iconfont icon-cuowu">
|
<el-button @click="questAss(item.id, 'back', 'rejected')" type="warning" icon="iconfont icon-cuowu">
|
||||||
<font class="m-l-5">拒绝退款</font>
|
<font class="m-l-5">拒绝退款</font>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
<el-button-group v-else-if="item.back == 'normal' && item.status == 'pending'">
|
<el-button-group v-else-if="item.back == 'normal' && item.status == 'pending'">
|
||||||
<el-button @click="questAss(item.id, 'quest', '1')" type="primary" icon="iconfont icon-chengjie">
|
<el-button @click="questAss(item.id, 'status', 'processing')" type="primary" icon="iconfont icon-chengjie">
|
||||||
<font class="m-l-5">确认备货</font>
|
<font class="m-l-5">确认备货</font>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="danger" icon="iconfont icon-cuowu">
|
<el-button type="danger" icon="iconfont icon-cuowu">
|
||||||
@ -89,6 +89,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { parseTime } from '@/utils/index'
|
import { parseTime } from '@/utils/index'
|
||||||
|
import { questAss } from '@/utils/api/table'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
@ -126,6 +127,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
questAss, // 修改订单
|
||||||
parseTime, // 时间戳格式化
|
parseTime, // 时间戳格式化
|
||||||
orderState (back, status) {
|
orderState (back, status) {
|
||||||
if (back === 'requested') {
|
if (back === 'requested') {
|
||||||
|
@ -926,7 +926,7 @@ const store = new Vuex.Store({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @description: 获取订单列表 ps:待发货及待收货 并且不是退款成功状态
|
* @description: 获取订单列表
|
||||||
* @return {*} 列表
|
* @return {*} 列表
|
||||||
*/
|
*/
|
||||||
async fetchOrderList ({ commit }) {
|
async fetchOrderList ({ commit }) {
|
||||||
|
@ -21,7 +21,7 @@ export async function apiCrosFrequency (params) {
|
|||||||
/**
|
/**
|
||||||
* @description: 向改变订单承接任务api 提交数据 ()
|
* @description: 向改变订单承接任务api 提交数据 ()
|
||||||
* @param {*} id 订单id
|
* @param {*} id 订单id
|
||||||
* @param {*} state "quest"修改quest字段 "status"修改status字段
|
* @param {*} state "status"修改status字段 "back"修改back字段
|
||||||
*/
|
*/
|
||||||
export function questAss (id, state, val) {
|
export function questAss (id, state, val) {
|
||||||
const data = new URLSearchParams()// post对象参数 转成 字符串连接
|
const data = new URLSearchParams()// post对象参数 转成 字符串连接
|
||||||
@ -31,6 +31,7 @@ export function questAss (id, state, val) {
|
|||||||
api.post('questAss', data).then(res => {
|
api.post('questAss', data).then(res => {
|
||||||
if (res.data.status === 1) {
|
if (res.data.status === 1) {
|
||||||
Message.success(res.data.msg)
|
Message.success(res.data.msg)
|
||||||
|
store.dispatch('fetchOrderList')// 更新订单列表
|
||||||
} else {
|
} else {
|
||||||
Message.error(res.data.msg)
|
Message.error(res.data.msg)
|
||||||
}
|
}
|
||||||
|
@ -168,8 +168,8 @@ export default {
|
|||||||
if (this.getQuestInterval !== null) {
|
if (this.getQuestInterval !== null) {
|
||||||
clearInterval(this.getQuestInterval)
|
clearInterval(this.getQuestInterval)
|
||||||
}
|
}
|
||||||
const pending = list.filter(item => item.status === 'pending')// 过滤处理中 订单
|
const pending = list.filter(item => item.status === 'pending' && item.back === 'normal')// 过滤处理中 订单
|
||||||
const processing = list.filter(item => item.status === 'processing')// 过滤 备货中订单
|
const processing = list.filter(item => item.status === 'processing' && item.back === 'normal')// 过滤 备货中订单
|
||||||
const requested = list.filter(item => item.back === 'requested')// 过滤退款订单
|
const requested = list.filter(item => item.back === 'requested')// 过滤退款订单
|
||||||
if (this.pendingCount < pending.length && this.pendingCount != null) { // 有新的数据 播放提示声音
|
if (this.pendingCount < pending.length && this.pendingCount != null) { // 有新的数据 播放提示声音
|
||||||
this.playMusic('newMsg')// 新消息 声音播放
|
this.playMusic('newMsg')// 新消息 声音播放
|
||||||
|
@ -55,8 +55,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
},
|
|
||||||
created () {
|
|
||||||
/* init */
|
/* init */
|
||||||
this.$store.commit('app/setIsMobile')// 获取客户端平台类型
|
this.$store.commit('app/setIsMobile')// 获取客户端平台类型
|
||||||
this.$store.dispatch('fetchAirList')// 获取飞机列表
|
this.$store.dispatch('fetchAirList')// 获取飞机列表
|
||||||
@ -69,6 +67,8 @@ export default {
|
|||||||
this.$store.dispatch('fetchSkuList')// 获取商品sku列表
|
this.$store.dispatch('fetchSkuList')// 获取商品sku列表
|
||||||
this.$store.dispatch('fetchOrderList')// 获取订单列表
|
this.$store.dispatch('fetchOrderList')// 获取订单列表
|
||||||
},
|
},
|
||||||
|
created () {
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
/**
|
/**
|
||||||
* @description: 异步拿到飞机列表之后 再进行一些初始化操作
|
* @description: 异步拿到飞机列表之后 再进行一些初始化操作
|
||||||
|
Loading…
Reference in New Issue
Block a user