Browse Source

新增数据导入和导入组件

dev-xx
qb 12 months ago
parent
commit
d440b0a7b7
  1. 56
      src/api/basicdata/basicdataCategory.js
  2. 160
      src/components/MyUpload/MyUpload.vue
  3. 3
      src/main.js
  4. 47
      src/views/basicdata/TripartiteMaterial/list.vue
  5. 624
      src/views/basicdata/brand/basicdataCategory.vue
  6. 52
      src/views/distribution/inventory/CreateOrder.vue
  7. 170
      src/views/waybill/CreateZeroOrder.vue

56
src/api/basicdata/basicdataCategory.js

@ -8,9 +8,9 @@ export const getList = (current, size, params) => {
...params,
current,
size,
}
})
}
},
});
};
export const getListCo = (current, size, params) => {
return request({
url: '/api/logpm-basicdata/basicdataCategory/list',
@ -19,45 +19,45 @@ export const getListCo = (current, size, params) => {
...params,
current,
size,
}
})
}
},
});
};
export const getDetail = (id) => {
export const getDetail = id => {
return request({
url: '/api/logpm-basicdata/basicdataCategory/detail',
method: 'get',
params: {
id
}
})
}
id,
},
});
};
export const remove = (ids) => {
export const remove = ids => {
return request({
url: '/api/logpm-basicdata/basicdataCategory/remove',
method: 'post',
params: {
ids,
}
})
}
},
});
};
export const add = (row) => {
export const add = row => {
return request({
url: '/api/logpm-basicdata/basicdataCategory/submit',
method: 'post',
data: row
})
}
data: row,
});
};
export const update = (row) => {
export const update = row => {
return request({
url: '/api/logpm-basicdata/basicdataCategory/submit',
method: 'post',
data: row
})
}
data: row,
});
};
export const getDeptLazyTree = parentId => {
return request({
@ -69,3 +69,13 @@ export const getDeptLazyTree = parentId => {
});
};
/**
* 获取上传模板
*/
export const getDownTemplate = () => {
return request({
url: '/api/logpm-basicdata/basicdataCategory/downTemplate',
method: 'get',
responseType: 'blob',
});
};

160
src/components/MyUpload/MyUpload.vue

@ -0,0 +1,160 @@
<template>
<div>
<!-- 导入 -- 欧派 -->
<el-dialog
class="el-dialog-UploadPackageDelivery"
:title="props.title"
width="70%"
v-model="isShow"
>
<!-- 选择导入类型 -->
<div>
<div>
<el-divider content-position="left"> 数据导入 </el-divider>
</div>
<div class="flex-c-sb">
<P>请确认传入的文件为Excel文件格式</P>
<!-- 下载模板 -->
<template v-if="props.isDefined">
<slot></slot>
</template>
<template v-else="props.isDefined">
<a :src="props.templateSrc" v-if="props.templateSrc">
<el-button type="danger" icon="Download"> 下载模板 </el-button>
</a>
</template>
</div>
<div v-loading="details.loadingObj.UploadLoadong" element-loading-text="数据处理中...">
<el-upload
class="upload-demo"
drag
:headers="Object.keys(props.headers).length !== 0 ? props.headers : details.headers"
:action="props.uploadAddress"
:before-upload="handleBeforeUpload"
:on-success="handleSuccess"
:on-error="handleClose"
multiple
>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">拖拽文件或 <em>点击上传</em></div>
</el-upload>
</div>
</div>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { defineProps, computed, reactive, defineExpose } from 'vue';
import { getToken } from '@/utils/auth';
import { ElMessage } from 'element-plus';
const details = reactive({
loadingObj: {
UploadLoadong: false,
},
/** 头部 */
headers: {
'Blade-Auth': 'bearer ' + getToken(),
},
});
const props = defineProps({
/** 标题 */
title: {
type: String,
default: '数据导入',
},
/** 弹窗显示 */
modelValue: {
type: Boolean,
default: false,
},
/** 弹窗宽度 */
width: {
type: String,
default: '70%',
},
/** 请求头 */
headers: {
type: Object,
default: {},
},
/** 模板导出地址 */
templateSrc: {
type: String,
default: '',
},
/** 上传地址 */
uploadAddress: {
type: String,
default: '',
},
/** 是否自定义 */
isDefined: {
type: Boolean,
default: false,
},
});
const $emit = defineEmits(['update:modelValue']);
const isShow = computed({
get() {
return props.modelValue;
},
set(value) {
$emit('update:modelValue', value);
},
});
/** 上传文件 */
const handleBeforeUpload = file => {
console.log('file :>> ', file);
details.loadingObj.UploadLoadong = true;
//
const _fileNameArr = file.name.split('.');
const _fileType = _fileNameArr[_fileNameArr.length - 1];
const whiteArr = ['xls', 'xlsx'];
if (whiteArr.indexOf(_fileType) !== -1) return true;
ElMessage.warning('请传入xls或xlsx格式的文件');
details.loadingObj.UploadLoadong = false;
return false;
};
/** 长传成功 */
const handleSuccess = res => {
console.log('res :>> ', res);
details.loadingObj.UploadLoadong = false;
if (res.code !== 200) return ElMessage.warning('上传失败');
ElMessage.success(res.msg || '上传成功');
initOnLoad({}, true);
};
/** 上传失败 */
const handleClose = error => {
details.loadingObj.UploadLoadong = false;
const res = JSON.parse(error.message);
ElMessage.warning(res.msg || '上传失败');
};
defineExpose({ details });
</script>
<style scoped lang="scss">
//
:deep(.el-divider__text.is-left) {
font-size: 20px;
font-weight: bold;
color: var(--el-color-primary);
}
</style>

3
src/main.js

@ -30,6 +30,7 @@ import ArteryPrintTemplate from './components/ArteryPrintTemplate/ArteryPrintTem
import TripartiteTransferPrintTemplate from './components/TripartiteTransferPrintTemplate/TripartiteTransferPrintTemplate.vue';
import ImgList from './components/ImgList/ImgList.vue';
import MyPrint from './components/MyPrint/MyPrint.vue';
import MyUpload from './components/MyUpload/MyUpload.vue';
import { message } from './utils/resetMessage';
import App from './App.vue';
import 'animate.css';
@ -57,6 +58,8 @@ app.component('edittablehead', edittablehead);
app.component('SelectBox', SelectBox);
/** 打印 */
app.component('MyPrint', MyPrint);
/** 上传Excel */
app.component('MyUpload', MyUpload);
/** 运单打印模版 */
app.component('WaybillPrintTemplate', WaybillPrintTemplate);
/** 干线运输打印模版 */

47
src/views/basicdata/TripartiteMaterial/list.vue

@ -60,6 +60,17 @@
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="Plus" @click="handleAdd"> </el-button>
<el-button
type="danger"
icon="Upload"
plain
@click="
() => {
details.popUpShow.UploadPackageDelivery = true;
}
"
>
</el-button>
<!-- <el-button type="primary" icon="Edit" @click="handleEdit"> 编辑 </el-button> -->
</div>
<!-- 头部右侧按钮模块 -->
@ -204,6 +215,17 @@
</div>
</el-dialog>
<!-- 导入 -->
<MyUpload
ref="myUpload"
v-model="details.popUpShow.UploadPackageDelivery"
templateSrc=""
uploadAddress="/api/logpm-basicdata/basicdataCategory/import"
isDefined
>
<el-button type="danger" icon="Download" @click="handleDownloadTemplate"> 下载模板 </el-button>
</MyUpload>
<!-- 列表配置显示 -->
<edittablehead
@setcolum="setnewcolum"
@ -233,6 +255,7 @@ import {
import { useStore } from 'vuex';
import { useRouter, useRoute } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus';
import { getDownTemplate } from '@/api/basicdata/basicdataCategory';
//
const $router = useRouter();
@ -311,6 +334,8 @@ const details = reactive<any>({
popUpShow: {
/** 新增 */
addVisited: false,
/** 导入 */
UploadPackageDelivery: false,
},
form: {},
/** 品牌 */
@ -662,6 +687,28 @@ const handleRemove = ({ row }) => {
}
});
};
/** 下载模板 */
const handleDownloadTemplate = async () => {
try {
console.log('this.$refs :>> ', this.$refs);
this.$refs.myUpload.details.loadingObj.UploadLoadong = true;
const res = await getDownTemplate();
const { status, data } = res;
if (status !== 200) return;
downloadXls(data, '产品导入模板');
console.log('res :>> ', res);
} catch (error) {
console.log('error :>> ', error);
} finally {
this.$refs.myUpload.details.loadingObj.UploadLoadong = false;
}
};
</script>
<style scoped lang="scss">

624
src/views/basicdata/brand/basicdataCategory.vue

@ -1,320 +1,386 @@
<template>
<el-row>
<el-col :span="5">
<div class="box" v-if="qw">
<el-scrollbar>
<basic-container>
<avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" />
</basic-container>
</el-scrollbar>
</div>
</el-col>
<el-col :span="19">
<basic-container>
<avue-crud :option="option"
v-model:search="search"
v-model:page="page"
v-model="form"
:table-loading="loading"
:data="data"
:permission="permissionList"
:before-open="beforeOpen"
ref="crud"
@row-update="rowUpdate"
@row-save="rowSave"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
<template #menu-left>
<el-button type="danger"
icon="el-icon-delete"
plain
v-if="permission.basicdataCategory_delete"
@click="handleDelete">
</el-button>
<!-- <el-button type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- @click="handleExport"> -->
<!-- </el-button>-->
</template>
</avue-crud>
</basic-container>
</el-col>
</el-row>
<div>
<el-row>
<el-col :span="5">
<div class="box" v-if="qw">
<el-scrollbar>
<basic-container>
<avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" />
</basic-container>
</el-scrollbar>
</div>
</el-col>
<el-col :span="19">
<basic-container>
<avue-crud
:option="option"
v-model:search="search"
v-model:page="page"
v-model="form"
:table-loading="loading"
:data="data"
:permission="permissionList"
:before-open="beforeOpen"
ref="crud"
@row-update="rowUpdate"
@row-save="rowSave"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
<template #menu-left>
<el-button
type="danger"
icon="el-icon-delete"
plain
v-if="permission.basicdataCategory_delete"
@click="handleDelete"
>
</el-button>
<el-button
type="danger"
icon="Upload"
plain
v-if="permission.basicdataCategory_delete"
@click="
() => {
popUpShow.UploadPackageDelivery = true;
}
"
>
</el-button>
<!-- <el-button type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- @click="handleExport"> -->
<!-- </el-button>-->
</template>
</avue-crud>
</basic-container>
</el-col>
</el-row>
<MyUpload
ref="myUpload"
v-model="popUpShow.UploadPackageDelivery"
templateSrc=""
uploadAddress="/api/logpm-basicdata/basicdataCategory/import"
isDefined
>
<el-button type="danger" icon="Download" @click="handleDownloadTemplate">
下载模板
</el-button>
</MyUpload>
</div>
</template>
<script>
import {getList, getDetail, add, update, remove,
getDeptLazyTree
} from "@/api/basicdata/basicdataCategory";
import option from "@/option/basicdata/basicdataCategory";
import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common";
import {getToken} from '@/utils/auth';
import {downloadXls} from "@/utils/util";
import {dateNow} from "@/utils/date";
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
// import { getDeptLazyTree } from '@/api/system/dept';
import {
getList,
getDetail,
add,
update,
remove,
getDeptLazyTree,
getDownTemplate,
} from '@/api/basicdata/basicdataCategory';
import option from '@/option/basicdata/basicdataCategory';
import { mapGetters } from 'vuex';
import { exportBlob } from '@/api/common';
import { getToken } from '@/utils/auth';
import { downloadXls } from '@/utils/util';
import { dateNow } from '@/utils/date';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
// import { getDeptLazyTree } from '@/api/system/dept';
export default {
data() {
return {
form: {},
query: {},
search: {},
loading: false,
qw: true,
treeId: '',
page: {
pageSize: 30,
currentPage: 1,
total: 0
export default {
data() {
return {
form: {},
query: {},
search: {},
loading: false,
qw: true,
treeId: '',
page: {
pageSize: 30,
currentPage: 1,
total: 0,
},
selectionList: [],
option: option,
data: [],
treeData: [],
treeOption: {
nodeKey: 'id',
lazy: true,
treeLoad: function (node, resolve) {
// console.log("<<<<<<<<<<<<<<",node,resolve);
const parentId = node.level === 0 ? 1 : node.data.id;
getDeptLazyTree(parentId).then(res => {
// console.log("res>",res)
resolve(
res.data.data.map(item => {
return {
...item,
leaf: !item.hasChildren,
};
})
);
});
},
selectionList: [],
option: option,
data: [],
treeData: [],
treeOption: {
nodeKey: 'id',
lazy: true,
treeLoad: function (node, resolve) {
// console.log("<<<<<<<<<<<<<<",node,resolve);
const parentId = node.level === 0 ? 1 : node.data.id;
getDeptLazyTree(parentId).then(res => {
// console.log("res>",res)
resolve(
res.data.data.map(item => {
return {
...item,
leaf: !item.hasChildren,
};
})
);
});
},
addBtn: false,
menu: false,
size: 'small',
props: {
labelText: '标题',
label: 'title',
value: 'value',
children: 'children',
},
addBtn: false,
menu: false,
size: 'small',
props: {
labelText: '标题',
label: 'title',
value: 'value',
children: 'children',
},
},
/** 弹出层显示 */
popUpShow: {
/** 导入 -- 家配 */
UploadPackageDelivery: false,
},
};
},
computed: {
...mapGetters(['permission']),
permissionList() {
return {
addBtn: this.validData(this.permission.basicdataCategory_add, false),
viewBtn: this.validData(this.permission.basicdataCategory_view, false),
delBtn: this.validData(this.permission.basicdataCategory_delete, false),
editBtn: this.validData(this.permission.basicdataCategory_edit, false),
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.validData(this.permission.basicdataCategory_add, false),
viewBtn: this.validData(this.permission.basicdataCategory_view, false),
delBtn: this.validData(this.permission.basicdataCategory_delete, false),
editBtn: this.validData(this.permission.basicdataCategory_edit, false)
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(',');
},
methods: {
nodeClick(data) {
console.log("点击了",data);
this.treeId = data.id;
this.page.currentPage = 1;
this.onLoad(this.page);
},
rowSave(row, done, loading) {
//
// if(!!this.treeOption.treeLoad()){
//
// }else{
//
// }
console.log("row+++",row);
if(row.type == '1' ){
this.treeId = '';
}
if(!!this.treeId){
row.pid = this.treeId;
}
this.qw = false;
add(row).then(() => {
},
methods: {
nodeClick(data) {
console.log('点击了', data);
this.treeId = data.id;
this.page.currentPage = 1;
this.onLoad(this.page);
},
rowSave(row, done, loading) {
//
// if(!!this.treeOption.treeLoad()){
//
// }else{
//
// }
console.log('row+++', row);
if (row.type == '1') {
this.treeId = '';
}
if (!!this.treeId) {
row.pid = this.treeId;
}
this.qw = false;
add(row).then(
() => {
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
this.qw = true;
if(!!this.treeId){
if (!!this.treeId) {
this.onLoad(this.page);
}
done();
}, error => {
},
error => {
loading();
window.console.log(error);
});
},
rowUpdate(row, index, done, loading) {
this.qw = false;
update(row).then(() => {
}
);
},
rowUpdate(row, index, done, loading) {
this.qw = false;
update(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
type: 'success',
message: '操作成功!',
});
this.qw = true;
done();
}, error => {
},
error => {
loading();
console.log(error);
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
);
},
rowDel(row) {
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(row.id);
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
.then(() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
},
handleExport() {
let downloadUrl = `/blade-basicdataCategory/basicdataCategory/export-basicdataCategory?${this.website.tokenHeader}=${getToken()}`;
const {
name,
type,
} = this.query;
let values = {
name_: name,
type_: type,
};
this.$confirm("是否导出数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
NProgress.start();
exportBlob(downloadUrl, values).then(res => {
downloadXls(res.data, `品类${dateNow()}.xlsx`);
NProgress.done();
})
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDetail(this.form.id).then(res => {
this.form = res.data.data;
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning('请选择至少一条数据');
return;
}
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
}
done();
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage){
this.page.currentPage = currentPage;
},
sizeChange(pageSize){
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = false;
const {
name,
type,
} = this.query;
let values = {
name_like: name,
type: type,
};
if(!!this.treeId){
values.pid = this.treeId;
}else{
values.type = 1;
}
console.log("查询条件",values);
getList(page.currentPage, page.pageSize, values).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
this.$refs.crud.toggleSelection();
});
},
handleExport() {
let downloadUrl = `/blade-basicdataCategory/basicdataCategory/export-basicdataCategory?${
this.website.tokenHeader
}=${getToken()}`;
const { name, type } = this.query;
let values = {
name_: name,
type_: type,
};
this.$confirm('是否导出数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
NProgress.start();
exportBlob(downloadUrl, values).then(res => {
downloadXls(res.data, `品类${dateNow()}.xlsx`);
NProgress.done();
});
});
},
beforeOpen(done, type) {
if (['edit', 'view'].includes(type)) {
getDetail(this.form.id).then(res => {
this.form = res.data.data;
});
}
}
};
done();
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = false;
const { name, type } = this.query;
let values = {
name_like: name,
type: type,
};
if (!!this.treeId) {
values.pid = this.treeId;
} else {
values.type = 1;
}
console.log('查询条件', values);
getList(page.currentPage, page.pageSize, values).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
},
/** 下载模板 */
async handleDownloadTemplate() {
try {
console.log('this.$refs :>> ', this.$refs);
this.$refs.myUpload.details.loadingObj.UploadLoadong = true;
const res = await getDownTemplate();
const { status, data } = res;
if (status !== 200) return;
downloadXls(data, '产品导入模板');
console.log('res :>> ', res);
} catch (error) {
console.log('error :>> ', error);
} finally {
this.$refs.myUpload.details.loadingObj.UploadLoadong = false;
}
},
},
};
</script>
<style scoped lang='scss'>
:deep(.no-print){
<style scoped lang="scss">
:deep(.no-print) {
margin-left: auto;
}
:deep(.el-form-item__label){
:deep(.el-form-item__label) {
width: auto !important;
}
:deep(.no-print){
.el-button{
margin-right:0
:deep(.no-print) {
.el-button {
margin-right: 0;
}
}
</style>

52
src/views/distribution/inventory/CreateOrder.vue

@ -953,17 +953,21 @@
width="50%"
v-model="details.popUpShow.causeVisited"
>
<el-form :model="details.causeForm" label-width="120px">
<el-form-item label="修改原因:" style="margin-right: 0">
<el-form :model="details.causeForm" ref="causeFormRef" label-width="120px">
<el-form-item
label="修改原因:"
style="margin-right: 0"
prop="editResonCode"
:rules="[{ required: true, message: '请选择修改原因', trigger: ['blur', 'change'] }]"
>
<el-select
v-model="details.causeForm.pickupPricingType"
v-model="details.causeForm.editResonCode"
clearable
multiple
placeholder="请选择修改原因"
style="width: 100%"
>
<el-option
v-for="item in details.priceMethodType"
v-for="item in query.editWaybillReasonTypeList"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey"
@ -972,7 +976,7 @@
</el-form-item>
<el-form-item label="备注:" style="margin-right: 0">
<el-input type="textarea" placeholder="请输入描述" />
<el-input type="textarea" v-model="details.causeForm.remark" placeholder="请输入描述" />
</el-form-item>
</el-form>
@ -990,7 +994,7 @@
<el-button icon="CircleClose" @click="() => (details.popUpShow.causeVisited = false)"
> </el-button
>
<el-button type="primary" icon="CircleCheck" @click="handleRepetition"> </el-button>
<el-button type="primary" icon="CircleCheck" @click="handleSubmitCause"> </el-button>
</div>
</el-dialog>
</div>
@ -1053,6 +1057,7 @@ const instance = getCurrentInstance();
//
const ruleFormRef = ref<FormInstance>();
const causeFormRef = ref<FormInstance>();
//
const $router = useRouter();
@ -2712,6 +2717,39 @@ details.submitType = $route.query.orderStatus;
initPageInfo();
/** 改单提交 */
const handleSubmitCause = () => {
causeFormRef.value.validate(async valid => {
if (!valid) return;
const submitData = { ...details.submitData, ...details.causeForm };
for (let i = 0; i < details.query.editWaybillReasonTypeList.length; i++) {
const value = details.query.editWaybillReasonTypeList[i];
if (value.dictKey !== details.causeForm.editResonCode) continue;
submitData.editReson = value.dictValue;
break;
}
try {
details.loadingObj.submitLoadingBtn = true;
details.popUpShow.causeVisited = false;
const res = await postUpdateWaybill(submitData);
const { code, msg } = res.data;
if (code !== 200) return;
if (msg) ElMessage.success(msg);
back();
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.submitLoadingBtn = false;
}
});
};
// watch(
// $route,
// async () => {

170
src/views/waybill/CreateZeroOrder.vue

@ -1090,176 +1090,6 @@ const details = reactive<any>({
options: [],
/** 到站地区数组 */
regionOptione: [],
/** 支付字典 */
payOption: [
{
label: '现金',
value: 1,
},
{
label: '银行卡',
value: 2,
},
{
label: '微信',
value: 3,
},
{
label: '支付宝',
value: 4,
},
{
label: '支票',
value: 5,
},
{
label: '账本',
value: 6,
},
],
/** 开单付款字典 */
paymentOption: [
{
label: '现付',
value: 1,
},
{
label: '到付',
value: 2,
},
{
label: '月结',
value: 3,
},
{
label: '回付',
value: 4,
},
{
label: '内部结算',
value: 5,
},
{
label: '多笔付',
value: 6,
},
],
/** 紧急度 */
emergencyOption: [
{
label: '正常',
value: 1,
},
{
label: '急',
value: 2,
},
{
label: '特急',
value: 3,
},
{
label: '加急',
value: 4,
},
],
/** 送货方式字典 */
shippingOption: [
{
label: '自提',
value: 1,
},
{
label: '送货',
value: 2,
},
{
label: '送货上门',
value: 3,
},
{
label: '送货上门(有电梯)',
value: 4,
},
{
label: '送货上门(无电梯)',
value: 5,
},
{
label: '送货卸货',
value: 6,
},
{
label: '送货安装',
value: 7,
},
],
/** 开单回单方式 */
receiptOption: [
{
label: '签回单',
value: 1,
},
{
label: '打收条',
value: 2,
},
{
label: '签信封',
value: 3,
},
{
label: '签回单盖章',
value: 4,
},
{
label: '1份回单',
value: 5,
},
{
label: '2份回单',
value: 6,
},
{
label: '3份回单',
value: 7,
},
{
label: '4份回单',
value: 8,
},
{
label: '5份回单',
value: 9,
},
],
/** 运输方式 */
transportationOption: [
{
label: '公路快运',
value: 1,
},
{
label: '海运',
value: 2,
},
{
label: '卡车航班',
value: 3,
},
{
label: '空运',
value: 4,
},
{
label: '普通汽班',
value: 5,
},
{
label: '快递',
value: 6,
},
],
/** 收货方 -- 收货单位 */
consigneeOptions: [],
/** 收货方 -- 收货人 */

Loading…
Cancel
Save