<template>
|
<el-dialog
|
width="40%"
|
title="退回原因"
|
top="10vh"
|
:visible.sync="innerVisible"
|
append-to-body
|
@close="$emit('update:currshowlist', false)"
|
:show="currshowlist"
|
class="part-dialog"
|
>
|
<el-form
|
:model="dataForm"
|
:rules="dataRule"
|
ref="dataForm"
|
label-width="120px"
|
class="l-mes"
|
>
|
<el-row>
|
<el-col :span="23">
|
<el-form-item label="退回原因" prop="returnReason" label-width="60px">
|
<el-input
|
type="textarea"
|
:rows="5"
|
v-model="dataForm.returnReason"
|
placeholder="必填"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="innerVisible = false">取消</el-button>
|
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
</span>
|
</el-dialog>
|
</template>
|
|
<script>
|
import { returnOrder } from '@/api/plan/customerorder'
|
import { mapGetters } from 'vuex'
|
|
export default {
|
props: {
|
currshowlist: {
|
type: Boolean,
|
default: false
|
},
|
customerOrderList: {
|
type: Array,
|
default: () => {
|
return []
|
}
|
}
|
},
|
data() {
|
return {
|
innerVisible: false,
|
dataForm: {
|
returnReason: null
|
},
|
dataRule: {}
|
}
|
},
|
computed: {
|
...mapGetters(['userInfo'])
|
},
|
watch: {
|
currshowlist() {
|
this.innerVisible = this.currshowlist
|
if (this.currshowlist) {
|
}
|
}
|
},
|
methods: {
|
dataFormSubmit() {
|
if (
|
this.dataForm.returnReason != null &&
|
this.dataForm.returnReason != ''
|
) {
|
const ids = []
|
this.customerOrderList.forEach((item) => {
|
ids.push(item.id)
|
})
|
console.log('this.userInfo.username', this.userInfo.username)
|
const setDataForm = {
|
customerOrderIds: ids,
|
returnUser: this.userInfo.staffName,
|
returnReason: this.dataForm.returnReason
|
}
|
returnOrder(setDataForm).then((response) => {
|
const reaData = response.data
|
if (reaData.code === 0) {
|
this.$emit('refreshCustomerOrder')
|
this.innerVisible = false
|
this.dataForm.returnReason = ''
|
this.$message.success('订单退回成功')
|
} else {
|
this.$message.error('订单退回失败')
|
}
|
})
|
} else {
|
this.$message.error('请填写退回原因')
|
}
|
}
|
}
|
}
|
</script>
|