Browse Source

处理订单快递单号错误时重新发货

master
朱耘稷 4 years ago
parent
commit
04b480da7d
  1. 8
      src/api/yxStoreOrder.js
  2. 45
      src/views/shop/order/form.vue
  3. 11
      src/views/shop/order/index.vue

8
src/api/yxStoreOrder.js

@ -23,6 +23,14 @@ export function edit(data) {
}) })
} }
export function updateDelivery(data) {
return request({
url: 'api/yxStoreOrder/updateDelivery',
method: 'put',
data
})
}
export function editT(data) { export function editT(data) {
return request({ return request({
url: 'api/yxStoreOrder/check', url: 'api/yxStoreOrder/check',

45
src/views/shop/order/form.vue

@ -8,7 +8,7 @@
v-for="item in express" v-for="item in express"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id" :value="item.name"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -25,7 +25,7 @@
<script> <script>
import { add, edit, get } from '@/api/yxStoreOrder' import { add, edit, get,updateDelivery } from '@/api/yxStoreOrder'
export default { export default {
props: { props: {
isAdd: { isAdd: {
@ -79,19 +79,36 @@ export default {
}) })
}, },
doEdit() { doEdit() {
edit(this.form).then(res => { if(this.form._status == 4){
this.resetForm() updateDelivery(this.form).then(res => {
this.$notify({ this.resetForm()
title: '操作成功', this.$notify({
type: 'success', title: '操作成功',
duration: 2500 type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
}) })
this.loading = false }else{
this.$parent.init() edit(this.form).then(res => {
}).catch(err => { this.resetForm()
this.loading = false this.$notify({
console.log(err.response.data.message) title: '操作成功',
}) type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
}
}, },
resetForm() { resetForm() {
this.dialog = false this.dialog = false

11
src/views/shop/order/index.vue

@ -159,6 +159,14 @@
@click="edit(scope.row)" @click="edit(scope.row)"
> >
去发货</el-button> 去发货</el-button>
<el-button
v-if="scope.row._status == 4"
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
size="mini"
type="primary"
@click="edit(scope.row)"
>
修改快递</el-button>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item> <el-dropdown-item>
<el-button <el-button
@ -396,7 +404,8 @@
shippingType: data.shippingType, shippingType: data.shippingType,
isChannel: data.isChannel, isChannel: data.isChannel,
isRemind: data.isRemind, isRemind: data.isRemind,
isSystemDel: data.isSystemDel isSystemDel: data.isSystemDel,
_status:data._status
} }
_this.dialog = true _this.dialog = true
}, },

Loading…
Cancel
Save