|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <by-bill ref="bill" :propConfig="config" @search="search" @onAdd="onAdd" @onDelete="onDelete" @onRefresh="onRefresh"
|
|
|
+ <by-bill ref="bill" :propConfig="config" @search="search" @onDelete="onDelete" @onRefresh="onRefresh"
|
|
|
@detail="openEdit" @onSave="onSave" @clickTab="clickTab" @onChangeRow="onChangeRow" @pagination="pagination"
|
|
|
@getSupplierModal="getSupplierModal">
|
|
|
</by-bill>
|
|
@@ -31,6 +31,128 @@
|
|
|
attr: {
|
|
|
activeName: 'all'
|
|
|
},
|
|
|
+ // 引单
|
|
|
+ source: [
|
|
|
+ {
|
|
|
+ title: '销售订单',
|
|
|
+ search: {
|
|
|
+ attr: {
|
|
|
+ size: 'mini',
|
|
|
+ },
|
|
|
+ columns: [
|
|
|
+ [
|
|
|
+ {
|
|
|
+ span: 6,
|
|
|
+ label: '单据编号',
|
|
|
+ prop: 'orderNumber',
|
|
|
+ component: 'by-input',
|
|
|
+ compConfig: {
|
|
|
+ attr: {
|
|
|
+ placeholder: '请输入单据编号',
|
|
|
+ clearable: true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ span: 6,
|
|
|
+ label: '机构名称',
|
|
|
+ prop: 'organizationName',
|
|
|
+ component: 'by-input',
|
|
|
+ compConfig: {
|
|
|
+ attr: {
|
|
|
+ placeholder: '请输入机构名称',
|
|
|
+ clearable: true
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ span: 6,
|
|
|
+ label: '退单编号',
|
|
|
+ prop: 'chargebackNo',
|
|
|
+ component: 'by-input',
|
|
|
+ compConfig: {
|
|
|
+ attr: {
|
|
|
+ placeholder: '请输入退单编号',
|
|
|
+ clearable: true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ tool: {
|
|
|
+ tools: {
|
|
|
+ search: true,
|
|
|
+ refresh: true
|
|
|
+ },
|
|
|
+ customTools: [
|
|
|
+ {
|
|
|
+ name: '引单', icon: 'el-icon-bottom', audit: [''], event: {
|
|
|
+ click: () => {
|
|
|
+ // (this as any).onAdd('all')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ table: {
|
|
|
+ attr: {
|
|
|
+ height: 600,
|
|
|
+ size: 'mini',
|
|
|
+ seq: true,
|
|
|
+ align: 'left',
|
|
|
+ radio: true
|
|
|
+ },
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ width: 144,
|
|
|
+ title: '单据编号',
|
|
|
+ field: 'orderNumber',
|
|
|
+ isDetail: true,
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // width: 50,
|
|
|
+ // component: OrderType,
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ width: 180,
|
|
|
+ title: '机构名称',
|
|
|
+ field: 'organizationName',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 178,
|
|
|
+ title: '退单编号',
|
|
|
+ field: 'chargebackNo',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 90,
|
|
|
+ title: '收货人',
|
|
|
+ field: 'consignee',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ title: '联系方式',
|
|
|
+ field: 'phone',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 150,
|
|
|
+ title: '计划交货时间',
|
|
|
+ field: 'planDeliveryData',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 150,
|
|
|
+ title: '确定交货时间',
|
|
|
+ field: 'affirmDeliveryData',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 150,
|
|
|
+ title: '交货地点',
|
|
|
+ field: 'address',
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ],
|
|
|
// 单据
|
|
|
bill: {
|
|
|
tool: {
|
|
@@ -105,11 +227,6 @@
|
|
|
},
|
|
|
tableConfig: [
|
|
|
{
|
|
|
- tool: {
|
|
|
- tools: {
|
|
|
- add: true
|
|
|
- }
|
|
|
- },
|
|
|
table: {
|
|
|
attr: {
|
|
|
size: 'mini',
|
|
@@ -329,8 +446,8 @@
|
|
|
title: '操作',
|
|
|
action: true,
|
|
|
plugins: [{
|
|
|
- icon: 'el-icon-edit',
|
|
|
- name: '编辑',
|
|
|
+ // icon: 'el-icon-edit',
|
|
|
+ name: '查看',
|
|
|
audit: '',
|
|
|
event: {
|
|
|
click: (e : any) => {
|
|
@@ -536,7 +653,7 @@
|
|
|
{
|
|
|
name: '出库', icon: 'el-icon-top', audit: [''], event: {
|
|
|
click: () => {
|
|
|
- (this as any).onAdd('all')
|
|
|
+ (this as any).outbound('all')
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -609,8 +726,8 @@
|
|
|
title: '操作',
|
|
|
action: true,
|
|
|
plugins: [{
|
|
|
- icon: 'el-icon-edit',
|
|
|
- name: '编辑',
|
|
|
+ // icon: 'el-icon-edit',
|
|
|
+ name: '查看',
|
|
|
audit: '',
|
|
|
event: {
|
|
|
click: (e : any) => {
|
|
@@ -766,7 +883,7 @@
|
|
|
}
|
|
|
// 监听表格数据变化
|
|
|
onChangeRow(e : any) {
|
|
|
- e.realityPrice = e.number * e.unitPrice;
|
|
|
+ e.realityPrice = parseFloat((e.number * e.unitPrice).toFixed(2));
|
|
|
e.totalPrice = e.realityPrice - e.prePrice;
|
|
|
}
|
|
|
// 确定商品新增
|
|
@@ -859,30 +976,29 @@
|
|
|
};
|
|
|
})
|
|
|
}
|
|
|
- // 打开新增
|
|
|
- onAdd(e : any) {
|
|
|
+ // 出库打开引单
|
|
|
+ outbound(e : any) {
|
|
|
console.log('出库 ==>', e);
|
|
|
- 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张单据表格数据
|
|
|
- }
|
|
|
- billConfig.tableConfig[0].tool.tools = { add: true };
|
|
|
- this.isAdd = true;
|
|
|
- (this.$refs.bill as any).setBillConfig(billConfig);
|
|
|
- (this.$refs.bill as any).setBillFormValue({}); // 设置单据表单数据
|
|
|
- };
|
|
|
- (this.$refs.bill as any).showTab = 'bill';
|
|
|
+ (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) {
|
|
@@ -918,7 +1034,6 @@
|
|
|
billConfig.form.attr.readonly = false; // 设置只读
|
|
|
billConfig.tool.tools = { save: true, };
|
|
|
if (this.tabType === 'draftsBox' || e.submitState === 0) billConfig.tool.tools = { save: true, smt: true };
|
|
|
- billConfig.tableConfig[0].tool.tools = { add: true };
|
|
|
this.tableData = data;
|
|
|
(this.$refs.bill as any).setBillConfig(billConfig);
|
|
|
(this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
|
|
@@ -935,7 +1050,6 @@
|
|
|
readonly.form.attr.readonly = true; // 设置只读
|
|
|
readonly.tool.tools = {};
|
|
|
readonly.tableConfig[0].table.columns = readonly.tableConfig[0].table.columns.filter((v : any) => v.title != '操作');
|
|
|
- readonly.tableConfig[0].tool.tools = {};
|
|
|
console.log(readonly.tableConfig[0].table.columns.slice(0, -1));
|
|
|
let data = e.suborderList;
|
|
|
(this.$refs.bill as any).setBillConfig(readonly);
|