|
@@ -1,8 +1,8 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <by-bill ref="bill" :propConfig="config" @search="search" @onDelete="onDelete" @onRefresh="resert" @resert="resert"
|
|
|
|
- @detail="openEdit" @onSave="onSave" @clickTab="clickTab" @onChangeRow="onChangeRow" @pagination="pagination"
|
|
|
|
- @getSupplierModal="getSupplierModal">
|
|
|
|
|
|
+ <by-bill ref="bill" :propConfig="config" @search="search" @onSmt="onSmt" @onDelete="onDelete" @onRefresh="resert"
|
|
|
|
+ @resert="resert" @detail="openEdit" @onSave="onSave" @clickTab="clickTab" @onChangeRow="onChangeRow"
|
|
|
|
+ @pagination="pagination" @onReturnSmt="onReturnSmt2" @getSupplierModal="getSupplierModal">
|
|
</by-bill>
|
|
</by-bill>
|
|
<!-- 选择物料 -->
|
|
<!-- 选择物料 -->
|
|
<productModal ref="product" :mulit="true" @confirm="confirmProduct" />
|
|
<productModal ref="product" :mulit="true" @confirm="confirmProduct" />
|
|
@@ -13,18 +13,20 @@
|
|
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
import api from "@/api/order";
|
|
import api from "@/api/order";
|
|
import productModal from "../orderTask/components/productModal.vue";
|
|
import productModal from "../orderTask/components/productModal.vue";
|
|
- import Focus from "../orderTask/components/focus.vue";
|
|
|
|
|
|
+ import BusinessType from "../warehousing/components/businessType.vue";
|
|
import towInOne from "../warehousing/components/towInOne.vue";
|
|
import towInOne from "../warehousing/components/towInOne.vue";
|
|
@Component({ components: { productModal } })
|
|
@Component({ components: { productModal } })
|
|
export default class OrderTask extends Vue {
|
|
export default class OrderTask extends Vue {
|
|
// 左边
|
|
// 左边
|
|
tabType : any = 'all';
|
|
tabType : any = 'all';
|
|
- isAdd : any = false
|
|
|
|
|
|
+ isAdd : any = false;
|
|
|
|
+ baseInfo : any = {};
|
|
|
|
+ isSubmit : any = false
|
|
|
|
+ isChange : any = false
|
|
// 右边
|
|
// 右边
|
|
supplierInfo : any = {} // 机构信息
|
|
supplierInfo : any = {} // 机构信息
|
|
|
|
+ businessType : any = '' // 业务类型
|
|
tableData : any = []
|
|
tableData : any = []
|
|
- mergeObj : any = []
|
|
|
|
- setStatusData : any = ''
|
|
|
|
timeNum = 0;
|
|
timeNum = 0;
|
|
timer : any = null
|
|
timer : any = null
|
|
config : any = {
|
|
config : any = {
|
|
@@ -53,18 +55,6 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- {
|
|
|
|
- span: 6,
|
|
|
|
- label: '机构名称',
|
|
|
|
- prop: 'organizationName',
|
|
|
|
- component: 'by-input',
|
|
|
|
- compConfig: {
|
|
|
|
- attr: {
|
|
|
|
- placeholder: '请输入机构名称',
|
|
|
|
- clearable: true
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
label: '退单编号',
|
|
label: '退单编号',
|
|
@@ -101,7 +91,7 @@
|
|
size: 'mini',
|
|
size: 'mini',
|
|
seq: true,
|
|
seq: true,
|
|
align: 'left',
|
|
align: 'left',
|
|
- checkbox: true
|
|
|
|
|
|
+ radio: true
|
|
},
|
|
},
|
|
columns: [
|
|
columns: [
|
|
{
|
|
{
|
|
@@ -109,15 +99,6 @@
|
|
title: '单据编号',
|
|
title: '单据编号',
|
|
field: 'orderNumber',
|
|
field: 'orderNumber',
|
|
},
|
|
},
|
|
- // {
|
|
|
|
- // width: 50,
|
|
|
|
- // component: OrderType,
|
|
|
|
- // },
|
|
|
|
- {
|
|
|
|
- width: 180,
|
|
|
|
- title: '机构名称',
|
|
|
|
- field: 'organizationName',
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
width: 178,
|
|
width: 178,
|
|
title: '退单编号',
|
|
title: '退单编号',
|
|
@@ -161,13 +142,13 @@
|
|
},
|
|
},
|
|
form: {
|
|
form: {
|
|
attr: {
|
|
attr: {
|
|
- size: 'small',
|
|
|
|
|
|
+ size: 'medium',
|
|
readonly: false,
|
|
readonly: false,
|
|
- // rules: {
|
|
|
|
- // outOrderNo: [{
|
|
|
|
- // required: true, message: '请输入单据编号', trigger: 'blur'
|
|
|
|
- // }]
|
|
|
|
- // }
|
|
|
|
|
|
+ rules: {
|
|
|
|
+ operator: [{
|
|
|
|
+ required: true, message: '请输入经办人', trigger: 'blur'
|
|
|
|
+ }],
|
|
|
|
+ }
|
|
},
|
|
},
|
|
columns: [
|
|
columns: [
|
|
[
|
|
[
|
|
@@ -184,21 +165,27 @@
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 8,
|
|
span: 8,
|
|
- label: '机构名称',
|
|
|
|
- prop: 'organizationName',
|
|
|
|
- component: Focus,
|
|
|
|
|
|
+ label: '经办人',
|
|
|
|
+ prop: 'operator',
|
|
|
|
+ component: 'by-input',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 8,
|
|
span: 8,
|
|
- label: '经办人',
|
|
|
|
- prop: 'operator',
|
|
|
|
|
|
+ label: '收货人',
|
|
|
|
+ prop: 'receive',
|
|
component: 'by-input',
|
|
component: 'by-input',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 8,
|
|
span: 8,
|
|
- label: '业务类型',
|
|
|
|
- prop: 'businessType',
|
|
|
|
- component: 'by-select',
|
|
|
|
|
|
+ label: '收获地址',
|
|
|
|
+ prop: 'receiveAddress',
|
|
|
|
+ component: 'by-input',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ span: 8,
|
|
|
|
+ label: '联系方式',
|
|
|
|
+ prop: 'receivePhone',
|
|
|
|
+ component: 'by-input',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 8,
|
|
span: 8,
|
|
@@ -206,6 +193,12 @@
|
|
prop: 'wmsId',
|
|
prop: 'wmsId',
|
|
component: 'by-input',
|
|
component: 'by-input',
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ span: 8,
|
|
|
|
+ label: '业务类型',
|
|
|
|
+ prop: 'businessType',
|
|
|
|
+ component: BusinessType,
|
|
|
|
+ },
|
|
],
|
|
],
|
|
[
|
|
[
|
|
{
|
|
{
|
|
@@ -256,7 +249,7 @@
|
|
{
|
|
{
|
|
width: 100,
|
|
width: 100,
|
|
title: '库存',
|
|
title: '库存',
|
|
- field: 'unit2',
|
|
|
|
|
|
+ field: 'inventory',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
width: 100,
|
|
width: 100,
|
|
@@ -288,24 +281,6 @@
|
|
},
|
|
},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- {
|
|
|
|
- width: 100,
|
|
|
|
- title: '实际金额',
|
|
|
|
- field: 'realityPrice',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- width: 100,
|
|
|
|
- title: '优惠金额',
|
|
|
|
- field: 'prePrice',
|
|
|
|
- component: 'by-input',
|
|
|
|
- compConfig: {
|
|
|
|
- attr: {
|
|
|
|
- size: 'mini',
|
|
|
|
- type: 'number',
|
|
|
|
- defaultValue: '0',
|
|
|
|
- },
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
width: 100,
|
|
width: 100,
|
|
title: '合计金额',
|
|
title: '合计金额',
|
|
@@ -351,18 +326,6 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- {
|
|
|
|
- span: 6,
|
|
|
|
- label: '机构名称',
|
|
|
|
- prop: 'organizationName',
|
|
|
|
- component: 'by-input',
|
|
|
|
- compConfig: {
|
|
|
|
- attr: {
|
|
|
|
- placeholder: '请输入机构名称',
|
|
|
|
- clearable: true
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
label: '财务系统单据',
|
|
label: '财务系统单据',
|
|
@@ -401,15 +364,6 @@
|
|
isDetail: true,
|
|
isDetail: true,
|
|
fixed: 'left'
|
|
fixed: 'left'
|
|
},
|
|
},
|
|
- {
|
|
|
|
- width: 200,
|
|
|
|
- title: '仓库,仓位',
|
|
|
|
- field: 'towInOne',
|
|
|
|
- component: towInOne,
|
|
|
|
- compConfig: {
|
|
|
|
- isSelect: false
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
width: 150,
|
|
width: 150,
|
|
title: '财务系统单据',
|
|
title: '财务系统单据',
|
|
@@ -440,6 +394,11 @@
|
|
title: '联系方式',
|
|
title: '联系方式',
|
|
field: 'receivePhone',
|
|
field: 'receivePhone',
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ width: 120,
|
|
|
|
+ title: '业务类型',
|
|
|
|
+ field: 'businessType',
|
|
|
|
+ },
|
|
{
|
|
{
|
|
width: 110,
|
|
width: 110,
|
|
title: '操作',
|
|
title: '操作',
|
|
@@ -454,9 +413,9 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
}, {
|
|
- name: '删除',
|
|
|
|
|
|
+ name: '反提交',
|
|
event: {
|
|
event: {
|
|
- click: (item : any) => (this as any).doDelete2(item)
|
|
|
|
|
|
+ click: (item : any) => (this as any).onReturnSmt(item)
|
|
}
|
|
}
|
|
}]
|
|
}]
|
|
}
|
|
}
|
|
@@ -483,18 +442,6 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- {
|
|
|
|
- span: 6,
|
|
|
|
- label: '机构名称',
|
|
|
|
- prop: 'organizationName',
|
|
|
|
- component: 'by-input',
|
|
|
|
- compConfig: {
|
|
|
|
- attr: {
|
|
|
|
- placeholder: '请输入机构名称',
|
|
|
|
- clearable: true
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
label: '财务系统单据',
|
|
label: '财务系统单据',
|
|
@@ -534,15 +481,6 @@
|
|
isDetail: true,
|
|
isDetail: true,
|
|
fixed: 'left'
|
|
fixed: 'left'
|
|
},
|
|
},
|
|
- {
|
|
|
|
- width: 200,
|
|
|
|
- title: '仓库,仓位',
|
|
|
|
- field: 'towInOne',
|
|
|
|
- component: towInOne,
|
|
|
|
- compConfig: {
|
|
|
|
- isSelect: false
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
width: 150,
|
|
width: 150,
|
|
title: '财务系统单据',
|
|
title: '财务系统单据',
|
|
@@ -573,6 +511,11 @@
|
|
title: '联系方式',
|
|
title: '联系方式',
|
|
field: 'receivePhone',
|
|
field: 'receivePhone',
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ width: 120,
|
|
|
|
+ title: '业务类型',
|
|
|
|
+ field: 'businessType',
|
|
|
|
+ },
|
|
{
|
|
{
|
|
width: 110,
|
|
width: 110,
|
|
title: '操作',
|
|
title: '操作',
|
|
@@ -616,18 +559,6 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- {
|
|
|
|
- span: 6,
|
|
|
|
- label: '机构名称',
|
|
|
|
- prop: 'organizationName',
|
|
|
|
- component: 'by-input',
|
|
|
|
- compConfig: {
|
|
|
|
- attr: {
|
|
|
|
- placeholder: '请输入机构名称',
|
|
|
|
- clearable: true
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
label: '财务系统单据',
|
|
label: '财务系统单据',
|
|
@@ -652,7 +583,7 @@
|
|
{
|
|
{
|
|
name: '出库', icon: 'el-icon-top', audit: [''], event: {
|
|
name: '出库', icon: 'el-icon-top', audit: [''], event: {
|
|
click: () => {
|
|
click: () => {
|
|
- (this as any).outbound('all')
|
|
|
|
|
|
+ (this as any).outbound()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -681,15 +612,6 @@
|
|
isDetail: true,
|
|
isDetail: true,
|
|
fixed: 'left'
|
|
fixed: 'left'
|
|
},
|
|
},
|
|
- {
|
|
|
|
- width: 200,
|
|
|
|
- title: '仓库,仓位',
|
|
|
|
- field: 'towInOne',
|
|
|
|
- component: towInOne,
|
|
|
|
- compConfig: {
|
|
|
|
- isSelect: false
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
width: 150,
|
|
width: 150,
|
|
title: '财务系统单据',
|
|
title: '财务系统单据',
|
|
@@ -720,12 +642,16 @@
|
|
title: '联系方式',
|
|
title: '联系方式',
|
|
field: 'receivePhone',
|
|
field: 'receivePhone',
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ width: 120,
|
|
|
|
+ title: '业务类型',
|
|
|
|
+ field: 'businessType',
|
|
|
|
+ },
|
|
{
|
|
{
|
|
width: 120,
|
|
width: 120,
|
|
title: '操作',
|
|
title: '操作',
|
|
action: true,
|
|
action: true,
|
|
plugins: [{
|
|
plugins: [{
|
|
- // icon: 'el-icon-edit',
|
|
|
|
name: '查看',
|
|
name: '查看',
|
|
audit: '',
|
|
audit: '',
|
|
event: {
|
|
event: {
|
|
@@ -763,18 +689,6 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- {
|
|
|
|
- span: 6,
|
|
|
|
- label: '机构名称',
|
|
|
|
- prop: 'organizationName',
|
|
|
|
- component: 'by-input',
|
|
|
|
- compConfig: {
|
|
|
|
- attr: {
|
|
|
|
- placeholder: '请输入机构名称',
|
|
|
|
- clearable: true
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
label: '财务系统单据',
|
|
label: '财务系统单据',
|
|
@@ -812,15 +726,6 @@
|
|
isDetail: true,
|
|
isDetail: true,
|
|
fixed: 'left'
|
|
fixed: 'left'
|
|
},
|
|
},
|
|
- {
|
|
|
|
- width: 200,
|
|
|
|
- title: '仓库,仓位',
|
|
|
|
- field: 'towInOne',
|
|
|
|
- component: towInOne,
|
|
|
|
- compConfig: {
|
|
|
|
- isSelect: false
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
width: 150,
|
|
width: 150,
|
|
title: '财务系统单据',
|
|
title: '财务系统单据',
|
|
@@ -851,24 +756,27 @@
|
|
title: '联系方式',
|
|
title: '联系方式',
|
|
field: 'receivePhone',
|
|
field: 'receivePhone',
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ width: 120,
|
|
|
|
+ title: '业务类型',
|
|
|
|
+ field: 'businessType',
|
|
|
|
+ },
|
|
{
|
|
{
|
|
width: 110,
|
|
width: 110,
|
|
title: '操作',
|
|
title: '操作',
|
|
action: true,
|
|
action: true,
|
|
plugins: [{
|
|
plugins: [{
|
|
- // icon: 'el-icon-edit',
|
|
|
|
name: '查看',
|
|
name: '查看',
|
|
audit: '',
|
|
audit: '',
|
|
event: {
|
|
event: {
|
|
click: (e : any) => {
|
|
click: (e : any) => {
|
|
- (this as any).setReadonly(e)
|
|
|
|
|
|
+ (this as any).openEdit(e)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}]
|
|
}]
|
|
}
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
created() {
|
|
created() {
|
|
@@ -878,10 +786,18 @@
|
|
}
|
|
}
|
|
// 引单
|
|
// 引单
|
|
citationOrder() {
|
|
citationOrder() {
|
|
- console.log();
|
|
|
|
let data : any = (this as any).$refs.bill.getSourceTableSelectData(0);
|
|
let data : any = (this as any).$refs.bill.getSourceTableSelectData(0);
|
|
console.log(data);
|
|
console.log(data);
|
|
|
|
+ data = data.map((item : any) => {
|
|
|
|
+ item.receiveAddress = item.address
|
|
|
|
+ item.receive = item.consignee
|
|
|
|
+ item.receivePhone = item.phone
|
|
|
|
+ const { ...newData } = item
|
|
|
|
+ return newData
|
|
|
|
+ })
|
|
|
|
+ if (data.length <= 0) return this.$message.warning('请选择引单数据');
|
|
(this.$refs.bill as any).showTab = 'bill';
|
|
(this.$refs.bill as any).showTab = 'bill';
|
|
|
|
+ this.isAdd = true;
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
(this.$refs.bill as any).setBillFormValue(data[0]); // 设置单据表单数据
|
|
(this.$refs.bill as any).setBillFormValue(data[0]); // 设置单据表单数据
|
|
(this.$refs.bill as any).setBillTableValue(data[0].suborderList, 0);// 设置第1张单据表格数据
|
|
(this.$refs.bill as any).setBillTableValue(data[0].suborderList, 0);// 设置第1张单据表格数据
|
|
@@ -893,33 +809,26 @@
|
|
}
|
|
}
|
|
// 监听表格数据变化
|
|
// 监听表格数据变化
|
|
onChangeRow(e : any) {
|
|
onChangeRow(e : any) {
|
|
- e.realityPrice = parseFloat((e.number * e.unitPrice).toFixed(2));
|
|
|
|
- e.totalPrice = e.realityPrice - e.prePrice;
|
|
|
|
|
|
+ e.totalPrice = parseFloat((e.number * e.unitPrice).toFixed(2));
|
|
}
|
|
}
|
|
// 确定商品新增
|
|
// 确定商品新增
|
|
confirmProduct(e : any) {
|
|
confirmProduct(e : any) {
|
|
let contents : any = [], goodsData = e, newArr : any = [], obj : any = {};
|
|
let contents : any = [], goodsData = e, newArr : any = [], obj : any = {};
|
|
goodsData = goodsData.map((item : any) => {
|
|
goodsData = goodsData.map((item : any) => {
|
|
item.materialName = item.skuTitle
|
|
item.materialName = item.skuTitle
|
|
- item.prePrice = 0
|
|
|
|
- // item.materialId = item.materialId
|
|
|
|
item.unitPrice = item.price
|
|
item.unitPrice = item.price
|
|
item.materialSku = item.id
|
|
item.materialSku = item.id
|
|
const { id, ...newData } = item
|
|
const { id, ...newData } = item
|
|
- // const { skuTitle, price, id, materialId, ...newData } = item
|
|
|
|
return newData
|
|
return newData
|
|
})
|
|
})
|
|
this.tableData = this.tableData.concat(goodsData);
|
|
this.tableData = this.tableData.concat(goodsData);
|
|
newArr = this.tableData.reduce((prev : any, current : any) => {
|
|
newArr = this.tableData.reduce((prev : any, current : any) => {
|
|
- // console.log('prev ==> ', prev);
|
|
|
|
- // console.log('current ==> ', current);
|
|
|
|
obj[current.materialSku] ? contents.push(current.materialName) : (obj[current.materialSku] = true && prev.push(current))
|
|
obj[current.materialSku] ? contents.push(current.materialName) : (obj[current.materialSku] = true && prev.push(current))
|
|
return prev
|
|
return prev
|
|
}, []);
|
|
}, []);
|
|
this.tableData = newArr;
|
|
this.tableData = newArr;
|
|
this.tableData.map((v : any, i : any) => {
|
|
this.tableData.map((v : any, i : any) => {
|
|
v.dataIndex = i
|
|
v.dataIndex = i
|
|
- if (!v.prePrice) v.prePrice = '0';
|
|
|
|
});
|
|
});
|
|
if (contents.length > 0) {
|
|
if (contents.length > 0) {
|
|
this.$alert('商品 “' + contents + '” 已存在!', '提示', {
|
|
this.$alert('商品 “' + contents + '” 已存在!', '提示', {
|
|
@@ -934,33 +843,20 @@
|
|
(this as any).$refs.bill.$refs.billForm.validate().then(() => {
|
|
(this as any).$refs.bill.$refs.billForm.validate().then(() => {
|
|
let query = (this.$refs.bill as any).getBillFormValue(); // 获取单据数据
|
|
let query = (this.$refs.bill as any).getBillFormValue(); // 获取单据数据
|
|
console.log(query);
|
|
console.log(query);
|
|
- // 供应商数据
|
|
|
|
- if (!query.organizationName) query.organizationName = this.supplierInfo.name;
|
|
|
|
- if (!query.organizationId) query.organizationId = this.supplierInfo.id;
|
|
|
|
- if (!query.organizationName) return this.$message.warning('请选择机构名称');
|
|
|
|
|
|
+
|
|
// 子表数据
|
|
// 子表数据
|
|
// query.suborderList = this.tableData;
|
|
// query.suborderList = this.tableData;
|
|
query.purchaseOrderId = query.id;
|
|
query.purchaseOrderId = query.id;
|
|
query.suborderList = (this.$refs.bill as any).getBillTableData(0);
|
|
query.suborderList = (this.$refs.bill as any).getBillTableData(0);
|
|
- query.businessType = "销售类型";
|
|
|
|
if (query.suborderList.length > 0) {
|
|
if (query.suborderList.length > 0) {
|
|
for (let v of query.suborderList) {
|
|
for (let v of query.suborderList) {
|
|
- console.log(v.prePrice);
|
|
|
|
- if (!v.number || v.number <= 0) return this.$message.warning('请输入正确物料数量');
|
|
|
|
|
|
+ // if (!v.number || v.number <= 0) return this.$message.warning('请输入正确物料数量');
|
|
if (!v.unitPrice || v.unitPrice <= 0) return this.$message.warning('请输入正确物料单价');
|
|
if (!v.unitPrice || v.unitPrice <= 0) return this.$message.warning('请输入正确物料单价');
|
|
- if (v.prePrice.length <= 0 || v.prePrice < 0) return this.$message.warning('请输入正确优惠金额');
|
|
|
|
|
|
+ if (v.number > v.inventory) return this.$message.warning('出库数据不能大于库存数量');
|
|
v.taskOrderId = query.id;
|
|
v.taskOrderId = query.id;
|
|
v.purchaseSuborderId = v.id;
|
|
v.purchaseSuborderId = v.id;
|
|
- v.storehouseName = '三号仓库';
|
|
|
|
- v.storehouseId = 3;
|
|
|
|
- v.storingLocationName = '七号仓位';
|
|
|
|
- v.storingLocationId = 7;
|
|
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- query.suborderList.map((v : any) => {
|
|
|
|
- delete v.id;
|
|
|
|
- });
|
|
|
|
- delete query.id;
|
|
|
|
// 表格删除
|
|
// 表格删除
|
|
query.suborderList.map((v : any, i : any) => {
|
|
query.suborderList.map((v : any, i : any) => {
|
|
if (v.isDeleted === 1 && !v.id) {
|
|
if (v.isDeleted === 1 && !v.id) {
|
|
@@ -969,142 +865,260 @@
|
|
});
|
|
});
|
|
if (query.deliveryData) query.deliveryData = query.deliveryData + ' 00:00:00';
|
|
if (query.deliveryData) query.deliveryData = query.deliveryData + ' 00:00:00';
|
|
console.log('出库参数query ==> ', query);
|
|
console.log('出库参数query ==> ', query);
|
|
- api.outbound(query, 'supplyOutOrder').then((res : any) => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- this.$message.success(res.msg);
|
|
|
|
- this.getDataList();
|
|
|
|
- (this.$refs.bill as any).showTab = 'all';
|
|
|
|
- (this.$refs.bill as any).setBillFormValue({});
|
|
|
|
- } else this.$message.error(res.msg);
|
|
|
|
- })
|
|
|
|
if (this.isAdd) {
|
|
if (this.isAdd) {
|
|
- // api.saveList(query, 'supplyOutOrder').then((res : any) => {
|
|
|
|
- // if (res.code === 200) {
|
|
|
|
- // this.$message.success(res.msg);
|
|
|
|
- // this.getDataList();
|
|
|
|
- // (this.$refs.bill as any).showTab = 'all';
|
|
|
|
- // (this.$refs.bill as any).setBillFormValue({});
|
|
|
|
- // } else this.$message.error(res.msg);
|
|
|
|
- // })
|
|
|
|
|
|
+ query.suborderList.map((v : any) => {
|
|
|
|
+ delete v.id;
|
|
|
|
+ });
|
|
|
|
+ delete query.id;
|
|
|
|
+ api.outbound(query, 'supplyOutOrder').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message.success(res.msg);
|
|
|
|
+ this.getDataList();
|
|
|
|
+ (this.$refs.bill as any).showTab = 'all';
|
|
|
|
+ (this.$refs.bill as any).setBillFormValue({});
|
|
|
|
+ } else this.$message.error(res.msg);
|
|
|
|
+ })
|
|
} else if (this.tabType === 'all' || this.tabType === 'draftsBox') {
|
|
} else if (this.tabType === 'all' || this.tabType === 'draftsBox') {
|
|
if (this.tabType === 'draftsBox') query.submitState = 0;
|
|
if (this.tabType === 'draftsBox') query.submitState = 0;
|
|
console.log('保存 ==>', query);
|
|
console.log('保存 ==>', query);
|
|
- // api.updateList(query, 'supplyOutOrder').then((res : any) => {
|
|
|
|
- // if (res.code === 200) {
|
|
|
|
- // this.$message.success(res.msg);
|
|
|
|
- // this.getDataList();
|
|
|
|
- // (this.$refs.bill as any).showTab = 'all';
|
|
|
|
- // (this.$refs.bill as any).setBillFormValue({});
|
|
|
|
- // } else this.$message.error(res.msg);
|
|
|
|
- // })
|
|
|
|
|
|
+ api.updateList(query, 'supplyOutOrder').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message.success(res.msg);
|
|
|
|
+ this.getDataList();
|
|
|
|
+ (this.$refs.bill as any).showTab = 'all';
|
|
|
|
+ (this.$refs.bill as any).setBillFormValue({});
|
|
|
|
+ } else this.$message.error(res.msg);
|
|
|
|
+ })
|
|
};
|
|
};
|
|
|
|
+
|
|
})
|
|
})
|
|
}
|
|
}
|
|
// 出库打开引单
|
|
// 出库打开引单
|
|
- outbound(e : any) {
|
|
|
|
- console.log('出库 ==>', e);
|
|
|
|
|
|
+ outbound() {
|
|
|
|
+ this.clickTab('source');
|
|
(this.$refs.bill as any).showTab = 'source';
|
|
(this.$refs.bill as any).showTab = 'source';
|
|
- // if (e === 'billTable_0') {
|
|
|
|
- // (this.$refs.product as any).setShow(true); // 打开sku弹窗
|
|
|
|
- // let obj = (this.$refs.bill as any).getBillFormValue();
|
|
|
|
- // if (!this.tableData) this.tableData = obj.suborderList;
|
|
|
|
- // console.log('this.tableData ==> ', this.tableData);
|
|
|
|
- // (this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
|
|
|
|
- // } else {
|
|
|
|
- // let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
|
|
- // billConfig.form.attr.readonly = false; // 设置只读
|
|
|
|
- // billConfig.tool.tools = { save: true, };
|
|
|
|
- // if (e === 'all') {
|
|
|
|
- // billConfig.tool.tools = { save: true, smt: true };
|
|
|
|
- // this.tableData = [];
|
|
|
|
- // (this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
|
|
|
|
- // }
|
|
|
|
- // this.isAdd = true;
|
|
|
|
- // (this.$refs.bill as any).setBillConfig(billConfig);
|
|
|
|
- // (this.$refs.bill as any).setBillFormValue({}); // 设置单据表单数据
|
|
|
|
- // };
|
|
|
|
}
|
|
}
|
|
// 打开编辑
|
|
// 打开编辑
|
|
openEdit(e : any) {
|
|
openEdit(e : any) {
|
|
console.log('编辑this.tabType ==>', this.tabType);
|
|
console.log('编辑this.tabType ==>', this.tabType);
|
|
- if (this.tabType === 'all' || this.tabType === 'draftsBox') {
|
|
|
|
- e = e.row ? e.row : e;
|
|
|
|
- console.log('编辑 ==>', e);
|
|
|
|
- if (this.tabType === 'all' && e.submitState === 1) return this.setReadonly(e);
|
|
|
|
- let data = e.suborderList
|
|
|
|
- data.map((v : any, i : any) => {
|
|
|
|
- v.dataIndex = i;
|
|
|
|
- if (!v.prePrice) v.prePrice = '0';
|
|
|
|
- v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
|
|
|
|
- });
|
|
|
|
- let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
|
|
- if (billConfig.tableConfig[0].table.columns.at(-1).title != '操作') {
|
|
|
|
- billConfig.tableConfig[0].table.columns.push({
|
|
|
|
- width: 90,
|
|
|
|
- title: '操作',
|
|
|
|
- action: true,
|
|
|
|
- plugins: [{
|
|
|
|
- icon: 'el-icon-delete',
|
|
|
|
- name: '删除',
|
|
|
|
- audit: '',
|
|
|
|
- event: {
|
|
|
|
- click: (item : any) => {
|
|
|
|
- (this as any).changeTable(item)
|
|
|
|
|
|
+ console.log('编辑 ==>', e);
|
|
|
|
+ e = e.row ? e.row : e;
|
|
|
|
+ api.single({ id: e.id }, 'supplyEntryOrder').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ let parentData = res.data ? res.data : e;
|
|
|
|
+ this.baseInfo = parentData;
|
|
|
|
+ if (this.tabType === 'all' || this.tabType === 'draftsBox') {
|
|
|
|
+ if (this.tabType === 'all' && parentData.submitState === 1) return this.setReadonly(parentData);
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
|
|
+ let data = parentData.suborderList;
|
|
|
|
+ let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
|
|
+ if (billConfig.tableConfig[0].table.columns.at(-1).title != '操作') {
|
|
|
|
+ billConfig.tableConfig[0].table.columns.push({
|
|
|
|
+ width: 90,
|
|
|
|
+ title: '操作',
|
|
|
|
+ action: true,
|
|
|
|
+ plugins: [{
|
|
|
|
+ icon: 'el-icon-delete',
|
|
|
|
+ name: '删除',
|
|
|
|
+ audit: '',
|
|
|
|
+ event: {
|
|
|
|
+ click: (item : any) => {
|
|
|
|
+ (this as any).changeTable(item)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }]
|
|
|
|
+ })
|
|
|
|
+ };
|
|
|
|
+ billConfig.form.attr.readonly = false; // 设置只读
|
|
|
|
+ billConfig.tool.tools = { save: true, };
|
|
|
|
+ if (this.tabType === 'draftsBox' || parentData.submitState === 0) billConfig.tool.tools = { save: true, smt: true };
|
|
|
|
+ data.map((v : any, i : any) => {
|
|
|
|
+ v.dataIndex = i;
|
|
|
|
+ v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
|
|
|
|
+ // 查库存
|
|
|
|
+ api.getInventoryByStoridAndSkuid({
|
|
|
|
+ storidId: v.storehouseId,
|
|
|
|
+ skuid: v.id,
|
|
|
|
+ }).then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ v.inventory = res.data;
|
|
|
|
+ if (data.length === (i + 1)) {
|
|
|
|
+ this.tableData = data;
|
|
|
|
+ (this.$refs.bill as any).setBillConfig(billConfig);
|
|
|
|
+ (this.$refs.bill as any).setBillFormValue(parentData);// 设置单据表单数据
|
|
|
|
+ (this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
|
|
|
|
+ this.isAdd = false;
|
|
|
|
+ (this.$refs.bill as any).showTab = 'bill';
|
|
|
|
+ loading.close();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- }]
|
|
|
|
- })
|
|
|
|
- };
|
|
|
|
- billConfig.form.attr.readonly = false; // 设置只读
|
|
|
|
- billConfig.tool.tools = { save: true, };
|
|
|
|
- if (this.tabType === 'draftsBox' || e.submitState === 0) billConfig.tool.tools = { save: true, smt: true };
|
|
|
|
- this.tableData = data;
|
|
|
|
- (this.$refs.bill as any).setBillConfig(billConfig);
|
|
|
|
- (this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
|
|
|
|
- (this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
|
|
|
|
- this.isAdd = false;
|
|
|
|
- (this.$refs.bill as any).showTab = 'bill';
|
|
|
|
- } else {
|
|
|
|
- this.setReadonly(e.row ? e.row : e);
|
|
|
|
- };
|
|
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.setReadonly(parentData);
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
// 设置只读
|
|
// 设置只读
|
|
setReadonly(e : any) {
|
|
setReadonly(e : any) {
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
readonly.form.attr.readonly = true; // 设置只读
|
|
readonly.form.attr.readonly = true; // 设置只读
|
|
readonly.tool.tools = {};
|
|
readonly.tool.tools = {};
|
|
readonly.tableConfig[0].table.columns = readonly.tableConfig[0].table.columns.filter((v : any) => v.title != '操作');
|
|
readonly.tableConfig[0].table.columns = readonly.tableConfig[0].table.columns.filter((v : any) => v.title != '操作');
|
|
- console.log(readonly.tableConfig[0].table.columns.slice(0, -1));
|
|
|
|
let data = e.suborderList;
|
|
let data = e.suborderList;
|
|
- (this.$refs.bill as any).setBillConfig(readonly);
|
|
|
|
- (this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
|
|
|
|
- (this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
|
|
|
|
- this.isAdd = false;
|
|
|
|
- (this.$refs.bill as any).showTab = 'bill';
|
|
|
|
-
|
|
|
|
|
|
+ data.map((v : any, i : any) => {
|
|
|
|
+ v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
|
|
|
|
+ // 查库存
|
|
|
|
+ api.getInventoryByStoridAndSkuid({
|
|
|
|
+ storidId: v.storehouseId,
|
|
|
|
+ skuid: v.id,
|
|
|
|
+ }).then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ v.inventory = res.data;
|
|
|
|
+ if (data.length === (i + 1)) {
|
|
|
|
+ (this.$refs.bill as any).setBillConfig(readonly);
|
|
|
|
+ (this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
|
|
|
|
+ (this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
|
|
|
|
+ this.isAdd = false;
|
|
|
|
+ (this.$refs.bill as any).showTab = 'bill';
|
|
|
|
+ loading.close();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ // 工具栏提交
|
|
|
|
+ onSmt(e : any) {
|
|
|
|
+ if (e === 'draftsBox') {
|
|
|
|
+ let selectData = (this.$refs.bill as any).getTableSelectData('draftsBox'); // 获取表格选中数据
|
|
|
|
+ if (selectData.length <= 0) return this.$message.warning('请选择提交数据');
|
|
|
|
+ if (selectData.length > 1) return this.$message.warning('只能提交一条数据');
|
|
|
|
+ this.$confirm('确定提交吗!', '注意', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ center: true
|
|
|
|
+ }).then(() => {
|
|
|
|
+ api.submitTo({ id: selectData[0].id }, 'supplyEntryOrder').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message.success('提交成功');
|
|
|
|
+ this.clickTab('draftsBox');
|
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => this.$message.info('已取消提交'));
|
|
|
|
+ } else {
|
|
|
|
+ console.log('isChange ==> ', this.isChange);
|
|
|
|
+ console.log('isSubmit ==> ', this.isSubmit);
|
|
|
|
+ if (this.isSubmit) {
|
|
|
|
+ this.$confirm('确定提交吗!', '注意', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ center: true
|
|
|
|
+ }).then(() => {
|
|
|
|
+ api.submitTo({ id: this.baseInfo.id }, 'supplyEntryOrder').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message.success('提交成功');
|
|
|
|
+ this.clickTab(this.tabType);
|
|
|
|
+ this.isSubmit = false;
|
|
|
|
+ (this.$refs.bill as any).showTab = this.tabType;
|
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => this.$message.info('已取消提交'));
|
|
|
|
+ } else {
|
|
|
|
+ // 表单旧数据
|
|
|
|
+ let oldbillForm : any = (this as any).$lodash.cloneDeep(this.baseInfo);
|
|
|
|
+ if (oldbillForm.suborderList) delete oldbillForm.suborderList;
|
|
|
|
+ oldbillForm = JSON.stringify(oldbillForm);
|
|
|
|
+ // 表单新数据
|
|
|
|
+ let newBillForm : any = (this as any).$refs.bill.getBillFormValue();
|
|
|
|
+ if (newBillForm.suborderList) delete newBillForm.suborderList;
|
|
|
|
+ newBillForm = JSON.stringify(newBillForm);
|
|
|
|
+ // 表格旧数据
|
|
|
|
+ this.baseInfo.suborderList.map((v : any) => {
|
|
|
|
+ if (v._X_ROW_KEY) delete v._X_ROW_KEY;
|
|
|
|
+ });
|
|
|
|
+ let oldData : any = JSON.stringify(this.baseInfo.suborderList);
|
|
|
|
+ // 表格新数据
|
|
|
|
+ let newData : any = JSON.stringify((this as any).$refs.bill.getBillTableData(0));
|
|
|
|
+ // 数据有变进保存
|
|
|
|
+ if (this.isChange || oldbillForm != newBillForm || oldData != newData) {
|
|
|
|
+ return this.$message.warning('数据变更必须先保存再提交');
|
|
|
|
+ } else {
|
|
|
|
+ this.$confirm('确定提交吗!', '注意', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ center: true
|
|
|
|
+ }).then(() => {
|
|
|
|
+ // console.log(this.baseInfo.id);
|
|
|
|
+ api.submitTo({ id: this.baseInfo.id }, 'supplyEntryOrder').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message.success('提交成功');
|
|
|
|
+ this.clickTab(this.tabType);
|
|
|
|
+ (this.$refs.bill as any).showTab = this.tabType;
|
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => this.$message.info('已取消提交'));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 操作反提交
|
|
|
|
+ onReturnSmt(e : any) {
|
|
|
|
+ console.log('反提交 ==>', e);
|
|
|
|
+ this.$confirm('确定反提交吗!', '注意', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ center: true
|
|
|
|
+ }).then(() => {
|
|
|
|
+ if (this.tabType === 'smt') {
|
|
|
|
+ api.cancelSubmission({ id: e.id }, 'supplyEntryOrder').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message.success('反提交成功');
|
|
|
|
+ this.clickTab(this.tabType);
|
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => this.$message.info('已取消反提交'));
|
|
|
|
+ }
|
|
|
|
+ // 工具栏反提交
|
|
|
|
+ onReturnSmt2() {
|
|
|
|
+ console.log('工具栏反提交 ==>', this.baseInfo);
|
|
|
|
+ this.$confirm('确定反提交吗!', '注意', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ center: true
|
|
|
|
+ }).then(() => {
|
|
|
|
+ if (this.tabType === 'smt') {
|
|
|
|
+ api.cancelSubmission({ id: this.baseInfo.id }, 'supplyEntryOrder').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message.success('反提交成功');
|
|
|
|
+ this.clickTab(this.tabType);
|
|
|
|
+ (this.$refs.bill as any).showTab = 'smt';
|
|
|
|
+ } else this.$message.error(res.msg)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => this.$message.info('已取消反提交'));
|
|
}
|
|
}
|
|
// 切换tab栏
|
|
// 切换tab栏
|
|
clickTab(e : any) {
|
|
clickTab(e : any) {
|
|
console.log('切换tab ==> ', e);
|
|
console.log('切换tab ==> ', e);
|
|
this.tabType = e;
|
|
this.tabType = e;
|
|
|
|
+ this.isAdd = false;
|
|
// submitState: 提交状态
|
|
// submitState: 提交状态
|
|
if (e === 'source') {
|
|
if (e === 'source') {
|
|
- api.pageList({}, 'supplyPurchaseOrder').then((res : any) => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- (this.$refs.bill as any).setSourceTableData(0, res.data.records);
|
|
|
|
- let page = {
|
|
|
|
- pageNo: res.data.current, //当前页
|
|
|
|
- pageSize: res.data.size, //每页条数
|
|
|
|
- total: res.data.total //总条数
|
|
|
|
- };
|
|
|
|
- (this.$refs.bill as any).setSourcePage(0, page)
|
|
|
|
- } else this.failHandle(res)
|
|
|
|
- })
|
|
|
|
|
|
+ this.isAdd = true;
|
|
|
|
+ this.getCitationList({});
|
|
}
|
|
}
|
|
- if (e === 'all') this.getPageList({ pageSize: 10, pageNo: 1 }, 'all'); // 草稿箱数据
|
|
|
|
|
|
+ if (e === 'all') this.getPageList({}, 'all'); // 草稿箱数据
|
|
if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
|
|
if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
|
|
if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
|
|
if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
|
|
- if (e === 'recycleBin') this.getSelectDeleteList({ pageNo: 1, pageSize: 10 }); // 回收站数据
|
|
|
|
|
|
+ if (e === 'recycleBin') this.getSelectDeleteList({}); // 回收站数据
|
|
}
|
|
}
|
|
// 初始化
|
|
// 初始化
|
|
getDataList() {
|
|
getDataList() {
|
|
@@ -1116,7 +1130,7 @@
|
|
return
|
|
return
|
|
}
|
|
}
|
|
clearInterval(this.timer)
|
|
clearInterval(this.timer)
|
|
- this.getPageList({ pageSize: 10, pageNo: 1 }, 'all'); // 综合数据
|
|
|
|
|
|
+ this.getPageList({}, 'all'); // 综合数据
|
|
}
|
|
}
|
|
// 分页
|
|
// 分页
|
|
pagination(e : any) {
|
|
pagination(e : any) {
|
|
@@ -1140,7 +1154,22 @@
|
|
} else this.failHandle(res)
|
|
} else this.failHandle(res)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+ // 获取引单分页数据
|
|
|
|
+ getCitationList(query : any) {
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
|
|
+ api.pageList(query, 'supplyPurchaseOrder').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ (this.$refs.bill as any).setSourceTableData(0, res.data.records);
|
|
|
|
+ let page = {
|
|
|
|
+ pageNo: res.data.current, //当前页
|
|
|
|
+ pageSize: res.data.size, //每页条数
|
|
|
|
+ total: res.data.total //总条数
|
|
|
|
+ };
|
|
|
|
+ loading.close();
|
|
|
|
+ (this.$refs.bill as any).setSourcePage(0, page);
|
|
|
|
+ } else this.failHandle(res)
|
|
|
|
+ })
|
|
}
|
|
}
|
|
// 获取分页数据
|
|
// 获取分页数据
|
|
getPageList(query : any, type : any) {
|
|
getPageList(query : any, type : any) {
|
|
@@ -1172,20 +1201,30 @@
|
|
}
|
|
}
|
|
// 搜索
|
|
// 搜索
|
|
search(parames : any) {
|
|
search(parames : any) {
|
|
- let query = parames.value
|
|
|
|
- if (parames.type === 'draftsBox') query.submitState = 0 // 草稿箱数据
|
|
|
|
- if (parames.type === 'smt') query.submitState = 1 // 已提交数据
|
|
|
|
- console.log('搜索 ==> ', query);
|
|
|
|
- this.getPageList(query, parames.type) // 获取分页数据
|
|
|
|
|
|
+ console.log('搜索 ==> ', parames);
|
|
|
|
+ let query = parames.value;
|
|
|
|
+ if (parames.type === 'source_0') {
|
|
|
|
+ this.getCitationList(query);
|
|
|
|
+ } else {
|
|
|
|
+ if (parames.type === 'draftsBox') query.submitState = 0;// 草稿箱数据
|
|
|
|
+ if (parames.type === 'smt') query.submitState = 1; // 已提交数据
|
|
|
|
+ this.getPageList(query, parames.type) // 获取分页数据
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// 刷新/重置
|
|
// 刷新/重置
|
|
resert(e : any) {
|
|
resert(e : any) {
|
|
let data : any = e.type ? e.type : e;
|
|
let data : any = e.type ? e.type : e;
|
|
- (this as any).$refs.bill.$refs[data].clearSearch();
|
|
|
|
- if (data === 'all') this.getPageList({}, 'all'); // 综合数据
|
|
|
|
- if (data === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
|
|
|
|
- if (data === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
|
|
|
|
- if (data === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
|
|
|
|
|
|
+ console.log('刷新/重置 ==> ', data);
|
|
|
|
+ if (data === 'source_0') {
|
|
|
|
+ (this as any).$refs.bill.$refs.source_0[0].clearSearch();
|
|
|
|
+ this.getCitationList({});
|
|
|
|
+ } else {
|
|
|
|
+ (this as any).$refs.bill.$refs[data].clearSearch();
|
|
|
|
+ if (data === 'all') this.getPageList({}, 'all'); // 综合数据
|
|
|
|
+ if (data === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
|
|
|
|
+ if (data === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
|
|
|
|
+ if (data === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// 单据表格删除
|
|
// 单据表格删除
|
|
changeTable(item : any) {
|
|
changeTable(item : any) {
|