|
@@ -61,6 +61,8 @@
|
|
|
<div class="order_item_header_r">
|
|
|
<!-- <span class="header_r">已发单1分钟</span> -->
|
|
|
<el-button size='small' class="btn" @click.stop="deleteItem(item)">发起配送</el-button>
|
|
|
+ <el-button size='small' class="btn" @click.stop="itemAddRemark(item.id, item)">添加备注</el-button>
|
|
|
+ <el-button size='small' class="btn" @click.stop="iGnoreOrder(item.id)">忽略订单</el-button>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
@@ -83,7 +85,7 @@
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-if="item.caution" class="itme_r">备注:{{item.caution}}</div>
|
|
|
+ <div v-if="item.takeRemark" class="itme_r">备注:{{item.takeRemark}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -315,11 +317,42 @@
|
|
|
<!-- 发起配送 -->
|
|
|
<send-order-popup ref="sendOrderPopup"></send-order-popup>
|
|
|
<!-- 骑手、商家、发件人地图 -->
|
|
|
- <order-map ref="orderMap"></order-map>
|
|
|
+ <order-map ref="orderMap"></order-map>
|
|
|
+ <!-- 备注弹出层 -->
|
|
|
+ <el-dialog width="580px" center title="新增备注" destroy-on-close :visible.sync="dialogTableVisible">
|
|
|
+ <div>
|
|
|
+ <el-input placeholder="请添加备注信息,最多输入20个字!" v-model="remark" :maxlength="20" />
|
|
|
+ </div>
|
|
|
+ <div style="text-align: center;margin-top: 20px;">
|
|
|
+ <el-button @click.stop="dialogTableVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" class="submit-btn" @click.stop="commitRemark(orderId, item)">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 忽略订单弹出层 -->
|
|
|
+ <el-dialog width="580px" center title="忽略订单" destroy-on-close :visible.sync="ignoreStatus">
|
|
|
+ <div class="ignore-modal">
|
|
|
+ <div class="title">请选择忽略该笔订单的原因</div>
|
|
|
+ <div class="check-item">
|
|
|
+ <img src="../../../static/image/check-radio.png" @click.stop="changeRadio(1)" v-if="radio != 1" class="radio" />
|
|
|
+ <img src="../../../static/image/check-radio-active.png" v-if="radio == 1" class="radio" />
|
|
|
+ <span>通过其他配送方式完成</span>
|
|
|
+ </div>
|
|
|
+ <div class="check-item">
|
|
|
+ <img src="../../../static/image/check-radio.png" @click.stop="changeRadio(2)" v-if="radio != 2" class="radio" />
|
|
|
+ <img src="../../../static/image/check-radio-active.png" v-if="radio == 2" class="radio" />
|
|
|
+ <span>取消该笔订单(由于用户取消或其他原因)</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="text-align: center;margin-top: 20px;">
|
|
|
+ <el-button @click.stop="ignoreStatus = false">取消</el-button>
|
|
|
+ <el-button type="primary" class="submit-btn" @click.stop="commitIGnore(orderId)">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script>
|
|
|
+<script>
|
|
|
+ import bus from '../../common/bus.js';
|
|
|
import orderMap from './orderAMap.vue';
|
|
|
import OrderDetail from './orderDetail.vue';
|
|
|
import orderTrack from './orderTrack.vue'
|
|
@@ -329,7 +362,10 @@
|
|
|
import sendOrderPopup from './sendOrderPopup.vue';
|
|
|
import {
|
|
|
sendValuation,
|
|
|
- waimaiprinter
|
|
|
+ waimaiprinter,
|
|
|
+ addRemark,
|
|
|
+ ignoreOrder,
|
|
|
+ rollOrder
|
|
|
} from '../../api/order.js';
|
|
|
export default {
|
|
|
name: 'OrderList',
|
|
@@ -337,7 +373,13 @@
|
|
|
return {
|
|
|
needTrack: true,
|
|
|
orderDetailStutus: 0,
|
|
|
- isLoading: false
|
|
|
+ isLoading: false,
|
|
|
+ dialogTableVisible: false,
|
|
|
+ ignoreStatus: false,
|
|
|
+ remark: '',
|
|
|
+ orderId: '',
|
|
|
+ item: {},
|
|
|
+ radio: '',
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
@@ -354,7 +396,71 @@
|
|
|
...mapState(['userInfo']),
|
|
|
},
|
|
|
mounted() {},
|
|
|
- methods: {
|
|
|
+ methods: {
|
|
|
+ changeRadio(i) {
|
|
|
+ this.radio = i;
|
|
|
+ },
|
|
|
+ // 忽略订单
|
|
|
+ iGnoreOrder(orderId) {
|
|
|
+ this.orderId = orderId;
|
|
|
+ this.ignoreStatus = true;
|
|
|
+ },
|
|
|
+ commitIGnore(orderId) {
|
|
|
+ if ( !this.radio ) {
|
|
|
+ return this.$message({
|
|
|
+ message: '请选择忽略原因',
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ orderId,
|
|
|
+ ignoreReason: this.radio == 1 ? 0 : 1
|
|
|
+ }
|
|
|
+ ignoreOrder( params ).then( res => {
|
|
|
+ this.ignoreStatus = false;
|
|
|
+ if ( res.code == 200 ) {
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ bus.$emit('refreshData');
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } )
|
|
|
+ },
|
|
|
+ itemAddRemark(orderId, item) {
|
|
|
+ this.dialogTableVisible = true;
|
|
|
+ this.orderId = orderId;
|
|
|
+ this.item = item;
|
|
|
+ this.remark = item.takeRemark || '';
|
|
|
+ },
|
|
|
+ // 一键发单备注
|
|
|
+ commitRemark( orderId, item ) {
|
|
|
+ let params = {
|
|
|
+ orderId,
|
|
|
+ remark: this.remark.trim()
|
|
|
+ }
|
|
|
+ addRemark( params ).then( res => {
|
|
|
+ this.dialogTableVisible = false;
|
|
|
+ if ( res.code == 200 ) {
|
|
|
+ this.$message({
|
|
|
+ message: '添加备注成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.$set( this.list.find( v => { return item.id == v.id }), 'takeRemark', this.remark);
|
|
|
+ this.$forceUpdate();
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } )
|
|
|
+ },
|
|
|
// 查看地图
|
|
|
checkMap(item) {
|
|
|
this.$refs.orderMap.setDialogStatus(item);
|
|
@@ -363,8 +469,21 @@
|
|
|
this.getValuation(item);
|
|
|
},
|
|
|
// 撤回订单
|
|
|
- orderBack(id) {
|
|
|
-
|
|
|
+ orderBack(orderId) {
|
|
|
+ rollOrder({ orderId }).then( res => {
|
|
|
+ if ( res.code == 200 ) {
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ bus.$emit('refreshData');
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } )
|
|
|
},
|
|
|
// 补打发票
|
|
|
orderPrinter(waimaiId) {
|
|
@@ -449,7 +568,35 @@
|
|
|
</script>
|
|
|
|
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
|
-<style lang="scss" scoped="scoped">
|
|
|
+<style lang="scss" scoped="scoped">
|
|
|
+ .ignore-modal {
|
|
|
+ .title {
|
|
|
+ font-size: 14px;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #92959B;
|
|
|
+ }
|
|
|
+ .check-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-top: 20px;
|
|
|
+ .radio {
|
|
|
+ width: 14px;
|
|
|
+ height: 14px;
|
|
|
+ margin-right: 6px;
|
|
|
+ }
|
|
|
+ span {
|
|
|
+ font-size: 14px;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #222222;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .submit-btn {
|
|
|
+ border: none !important;
|
|
|
+ background-color: #FC7200;
|
|
|
+ }
|
|
|
.empty-data {
|
|
|
font-size: 0;
|
|
|
text-align: center;
|