|
@@ -140,7 +140,9 @@
|
|
|
<el-form-item label-width="0px">
|
|
<el-form-item label-width="0px">
|
|
|
<div class="btn-wrapper">
|
|
<div class="btn-wrapper">
|
|
|
<el-button @click="goProduct">转生产计划</el-button>
|
|
<el-button @click="goProduct">转生产计划</el-button>
|
|
|
- <el-button type="primary" @click="orderRefresh" :loading="loading">订单刷新</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="orderRefresh" :loading="loading"
|
|
|
|
|
+ >订单刷新</el-button
|
|
|
|
|
+ >
|
|
|
<el-button type="success" @click="toCreate">创建订单</el-button>
|
|
<el-button type="success" @click="toCreate">创建订单</el-button>
|
|
|
<el-upload
|
|
<el-upload
|
|
|
class="avatar-uploader"
|
|
class="avatar-uploader"
|
|
@@ -183,7 +185,6 @@
|
|
|
import { importFile } from '@/api/saleOrder';
|
|
import { importFile } from '@/api/saleOrder';
|
|
|
import fileUrl from '@/assets/file/销售订单导入模板.xls';
|
|
import fileUrl from '@/assets/file/销售订单导入模板.xls';
|
|
|
import { pullSalesOrder, deleteOrder } from '@/api/saleOrder';
|
|
import { pullSalesOrder, deleteOrder } from '@/api/saleOrder';
|
|
|
- import { data } from 'ele-admin/lib/ele-pro-table';
|
|
|
|
|
export default {
|
|
export default {
|
|
|
props: {
|
|
props: {
|
|
|
selection: Array,
|
|
selection: Array,
|
|
@@ -194,7 +195,7 @@
|
|
|
CreateOrder,
|
|
CreateOrder,
|
|
|
GroupOrder
|
|
GroupOrder
|
|
|
},
|
|
},
|
|
|
- data () {
|
|
|
|
|
|
|
+ data() {
|
|
|
// 默认表单数据
|
|
// 默认表单数据
|
|
|
const defaultWhere = {
|
|
const defaultWhere = {
|
|
|
code: '',
|
|
code: '',
|
|
@@ -231,18 +232,18 @@
|
|
|
{ value: 1, label: '按单' },
|
|
{ value: 1, label: '按单' },
|
|
|
{ value: 2, label: '按库' }
|
|
{ value: 2, label: '按库' }
|
|
|
],
|
|
],
|
|
|
- loading:false
|
|
|
|
|
|
|
+ loading: false
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
// 是否开启响应式布局
|
|
// 是否开启响应式布局
|
|
|
- styleResponsive () {
|
|
|
|
|
|
|
+ styleResponsive() {
|
|
|
return this.$store.state.theme.styleResponsive;
|
|
return this.$store.state.theme.styleResponsive;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
activeName: {
|
|
activeName: {
|
|
|
- handler () {
|
|
|
|
|
|
|
+ handler() {
|
|
|
if (this.activeName == 'first') {
|
|
if (this.activeName == 'first') {
|
|
|
this.where.proStu = 1;
|
|
this.where.proStu = 1;
|
|
|
} else {
|
|
} else {
|
|
@@ -254,10 +255,10 @@
|
|
|
immediate: true
|
|
immediate: true
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- created () {},
|
|
|
|
|
|
|
+ created() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
/* 搜索 */
|
|
/* 搜索 */
|
|
|
- search () {
|
|
|
|
|
|
|
+ search() {
|
|
|
if (this.time.length) {
|
|
if (this.time.length) {
|
|
|
this.where.startTime = this.time[0];
|
|
this.where.startTime = this.time[0];
|
|
|
this.where.endTime = this.time[1];
|
|
this.where.endTime = this.time[1];
|
|
@@ -265,7 +266,7 @@
|
|
|
this.$emit('search', this.where);
|
|
this.$emit('search', this.where);
|
|
|
},
|
|
},
|
|
|
/* 重置 */
|
|
/* 重置 */
|
|
|
- reset () {
|
|
|
|
|
|
|
+ reset() {
|
|
|
this.time = [];
|
|
this.time = [];
|
|
|
this.where = { ...this.defaultWhere };
|
|
this.where = { ...this.defaultWhere };
|
|
|
if (this.activeName == 'first') {
|
|
if (this.activeName == 'first') {
|
|
@@ -275,28 +276,28 @@
|
|
|
}
|
|
}
|
|
|
this.search();
|
|
this.search();
|
|
|
},
|
|
},
|
|
|
- toImport () {
|
|
|
|
|
|
|
+ toImport() {
|
|
|
this.$refs.importDialog.open();
|
|
this.$refs.importDialog.open();
|
|
|
},
|
|
},
|
|
|
- toCreate () {
|
|
|
|
|
|
|
+ toCreate() {
|
|
|
this.$refs.createDialog.open();
|
|
this.$refs.createDialog.open();
|
|
|
},
|
|
},
|
|
|
- toGroup () {
|
|
|
|
|
|
|
+ toGroup() {
|
|
|
this.$refs.groupDialog.open();
|
|
this.$refs.groupDialog.open();
|
|
|
},
|
|
},
|
|
|
- goProduct () {
|
|
|
|
|
|
|
+ goProduct() {
|
|
|
if (!this.selection.length) {
|
|
if (!this.selection.length) {
|
|
|
return this.$message.warning('请先勾选一个或多个订单!');
|
|
return this.$message.warning('请先勾选一个或多个订单!');
|
|
|
}
|
|
}
|
|
|
const productCode = this.selection[0].productCode;
|
|
const productCode = this.selection[0].productCode;
|
|
|
- const orderType = this.selection[0].orderType;
|
|
|
|
|
|
|
+ const orderType = this.selection[0].orderType;
|
|
|
for (var i = 0; i < this.selection.length; i++) {
|
|
for (var i = 0; i < this.selection.length; i++) {
|
|
|
if (productCode != this.selection[i].productCode) {
|
|
if (productCode != this.selection[i].productCode) {
|
|
|
return this.$message.warning('物料编码不一致!');
|
|
return this.$message.warning('物料编码不一致!');
|
|
|
}
|
|
}
|
|
|
- if (orderType != this.selection[i].orderType) {
|
|
|
|
|
- return this.$message.warning('订单类型不一致!');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (orderType != this.selection[i].orderType) {
|
|
|
|
|
+ return this.$message.warning('订单类型不一致!');
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
const list = [];
|
|
const list = [];
|
|
|
this.selection.map((item) => {
|
|
this.selection.map((item) => {
|
|
@@ -311,18 +312,20 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 刷新订单
|
|
// 刷新订单
|
|
|
- orderRefresh () {
|
|
|
|
|
- this.loading = true
|
|
|
|
|
- pullSalesOrder().then((res) => {
|
|
|
|
|
- this.$message.success('刷新成功!')
|
|
|
|
|
- this.loading = false
|
|
|
|
|
- }).catch(() => {
|
|
|
|
|
- this.loading = false
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ orderRefresh() {
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ pullSalesOrder()
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ this.$message.success('刷新成功!');
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 点击批量删除
|
|
// 点击批量删除
|
|
|
- batchDelete () {
|
|
|
|
|
|
|
+ batchDelete() {
|
|
|
if (!this.selection.length) {
|
|
if (!this.selection.length) {
|
|
|
return this.$message.warning('请先勾选一个或多个订单!');
|
|
return this.$message.warning('请先勾选一个或多个订单!');
|
|
|
}
|
|
}
|
|
@@ -344,13 +347,13 @@
|
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- handleChange (file, fileList) {
|
|
|
|
|
|
|
+ handleChange(file, fileList) {
|
|
|
this.fileList = fileList;
|
|
this.fileList = fileList;
|
|
|
console.log(fileList);
|
|
console.log(fileList);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
//上传限制
|
|
//上传限制
|
|
|
- beforeUpload (file) {
|
|
|
|
|
|
|
+ beforeUpload(file) {
|
|
|
const isLt10M = file.size / 1024 / 1024 < 10;
|
|
const isLt10M = file.size / 1024 / 1024 < 10;
|
|
|
if (!isLt10M) {
|
|
if (!isLt10M) {
|
|
|
this.$message.error('上传文件大小不能超过 10MB!');
|
|
this.$message.error('上传文件大小不能超过 10MB!');
|
|
@@ -358,7 +361,7 @@
|
|
|
return isLt10M;
|
|
return isLt10M;
|
|
|
},
|
|
},
|
|
|
//文件上传
|
|
//文件上传
|
|
|
- uploadFile (param) {
|
|
|
|
|
|
|
+ uploadFile(param) {
|
|
|
let fd = new FormData();
|
|
let fd = new FormData();
|
|
|
this.fileList.forEach((item) => {
|
|
this.fileList.forEach((item) => {
|
|
|
fd.append('importExcel', item.raw);
|
|
fd.append('importExcel', item.raw);
|