Commit d58db6b9 authored by honghy's avatar honghy

需求113 后台-集运-包裹列表-操作-转异

parent 08bafad9
import request from '@/utils/request'
// 创建集运异常
export function createConsException(data) {
return request({
url: '/ecw/cons-exception/create',
method: 'post',
data: data
})
}
// 更新集运异常
export function updateConsException(data) {
return request({
url: '/ecw/cons-exception/update',
method: 'put',
data: data
})
}
// 删除集运异常
export function deleteConsException(id) {
return request({
url: '/ecw/cons-exception/delete?id=' + id,
method: 'delete'
})
}
// 获得集运异常
export function getConsException(id) {
return request({
url: '/ecw/cons-exception/get?id=' + id,
method: 'get'
})
}
// 获得集运异常分页
export function getConsExceptionPage(query) {
return request({
url: '/ecw/cons-exception/page',
method: 'get',
params: query
})
}
// 导出集运异常 Excel
export function exportConsExceptionExcel(query) {
return request({
url: '/ecw/cons-exception/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
<template>
<el-dialog :title="$t('订单转异')" center :visible.sync="showException">
<el-form ref="transmutationForm" :model="params" label-width="200">
<el-form-item prop="exceptionType" :rules="{ required:true,message:'至少选择一个转异原因'}"
:label="$t('原因类型')">
<el-select v-model="params.exceptionType" placeholder="至少选择一个转异原因">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.CONS_EXCEPTION_TYPE)"
:key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('附件')">
<image-upload v-model="params.exceptionUrls"></image-upload>
</el-form-item>
<el-form-item :label="$t('详细信息')">
<el-input v-model="params.exceptionRemark" :rows="8" type="textarea"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">{{ $t("确 定") }}</el-button>
<el-button @click="cancel">{{ $t("取 消") }}</el-button>
</span>
</el-dialog>
</template>
<script>
import imageUpload from "@/components/ImageUpload/index.vue"
import { createConsException } from "@/api/ecw/consException"
export default {
name: "transmutation",
components: { imageUpload },
props: {
id: [Number],
showException: {
type: Boolean,
default: false
},
params: {
type: Object,
default: function() {
return {
exceptionType: null,
exceptionUrls: [],
exceptionRemark: null
}
}
}
},
data() {
return {}
},
methods: {
submitForm() {
this.$refs.transmutationForm.validate(validate => {
if (validate) {
var param = {
consId: this.id,
exceptionType: this.params.exceptionType,
exceptionRemark: this.params.exceptionRemark,
exceptionUrls: this.params.exceptionUrls.length ? this.params.exceptionUrls.split(",") : [],
mediaBusinessType: 1,
exceptionStatus: 0
}
createConsException(param).then(response => {
this.showException = false
this.$modal.msgSuccess("新增成功");
});
}
})
},
cancel() {
this.showException = false
}
}
}
</script>
<style scoped>
</style>
......@@ -138,6 +138,7 @@
v-hasPermi="['ecw:cons:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:cons:delete']">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="transmutation(scope.row)">{{$t('转异')}}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -218,16 +219,19 @@
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<Transmutation :showException="showException" :id="id"></Transmutation>
</div>
</template>
<script>
import {createCons, deleteCons, exportConsExcel, getCons, getConsPage, updateCons} from "@/api/ecw/cons";
import Transmutation from "@/views/ecw/cons/components/Transmutation.vue"
import Template from "@/views/cms/template/index.vue";
export default {
name: "Cons",
components: {
Transmutation
Template
},
data() {
......@@ -282,7 +286,9 @@ export default {
// 表单校验
rules: {
signed: [{ required: true, message: "是否被签收,0未签收,1已签收不能为空", trigger: "blur" }],
}
},
showException: false,
id: null
};
},
created() {
......@@ -455,6 +461,11 @@ export default {
this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false;
}).catch(() => {});
},
//转异
transmutation(row) {
this.id = row.id
this.showException = true
}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment