<template>
|
<GlobalAlertWindow
|
v-loading="isUploading"
|
:title="title"
|
:visible.sync="visible"
|
:confirm-working="isWorking"
|
@confirm="confirm"
|
>
|
<el-form :model="form" ref="form" label-width="120px" label-suffix=":" :rules="rules" inline>
|
<p class="tip-warn" style="margin: 30px;">
|
<i class="el-icon-warning"></i>
|
操作说明:您正在取消订单<span class="red">{{ form.code }} </span>,请谨慎操作!!</p>
|
<el-form-item label="备注" prop="cancelInfo">
|
<el-input type="textarea" :autosize="{ minRows: 4, maxRows:4 }" v-model="form.cancelInfo" placeholder="请输入取消说明" :maxlength="50" v-trim/>
|
</el-form-item>
|
|
</el-form>
|
</GlobalAlertWindow>
|
</template>
|
|
<script>
|
import BaseOpera from '@/components/base/BaseOpera'
|
import GlobalAlertWindow from '@/components/common/GlobalAlertWindow'
|
export default {
|
name: 'OperaOrderCancelWindow',
|
extends: BaseOpera,
|
components: { GlobalAlertWindow },
|
data () {
|
return {
|
isUploading: false,
|
// 表单数据
|
form: {
|
id: null,
|
cancelInfo: '',
|
code: null
|
},
|
// 验证规则
|
rules: {
|
cancelInfo: [
|
{ required: false, message: '请输入备注信息', tigger: 'blur' }
|
]
|
}
|
}
|
},
|
|
created () {
|
this.config({
|
api: '/business/goodsorder',
|
'field.id': 'id'
|
})
|
},
|
methods: {
|
confirm () {
|
this.$refs.form.validate((valid) => {
|
if (!valid) {
|
return
|
}
|
this.$dialog.messageWaring(`确定取消订单:${this.form.code}?`)
|
.then(() => {
|
this.isWorking = true
|
this.api.orderPlanCancelOrder(this.form)
|
.then(() => {
|
this.visible = false
|
this.$tip.apiSuccess('取消成功')
|
this.$emit('success')
|
}).catch(e => {
|
this.$tip.apiFailed(e)
|
})
|
.finally(() => {
|
this.isWorking = false
|
})
|
})
|
|
// 调用新建接口
|
})
|
}
|
}
|
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import "@/assets/style/alertstyle.scss";
|
|
</style>
|