|
@@ -89,7 +89,7 @@
|
|
|
{
|
|
|
name: '引单', icon: 'el-icon-bottom', audit: [''], event: {
|
|
|
click: () => {
|
|
|
- // (this as any).onAdd('all')
|
|
|
+ (this as any).citationOrder()
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -101,14 +101,13 @@
|
|
|
size: 'mini',
|
|
|
seq: true,
|
|
|
align: 'left',
|
|
|
- radio: true
|
|
|
+ checkbox: true
|
|
|
},
|
|
|
columns: [
|
|
|
{
|
|
|
width: 144,
|
|
|
title: '单据编号',
|
|
|
field: 'orderNumber',
|
|
|
- isDetail: true,
|
|
|
},
|
|
|
// {
|
|
|
// width: 50,
|
|
@@ -164,11 +163,11 @@
|
|
|
attr: {
|
|
|
size: 'small',
|
|
|
readonly: false,
|
|
|
- rules: {
|
|
|
- outOrderNo: [{
|
|
|
- required: true, message: '请输入单据编号', trigger: 'blur'
|
|
|
- }]
|
|
|
- }
|
|
|
+ // rules: {
|
|
|
+ // outOrderNo: [{
|
|
|
+ // required: true, message: '请输入单据编号', trigger: 'blur'
|
|
|
+ // }]
|
|
|
+ // }
|
|
|
},
|
|
|
columns: [
|
|
|
[
|
|
@@ -658,7 +657,7 @@
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- name: '删除', icon: 'el-icon-top', audit: [''], event: {
|
|
|
+ name: '删除', icon: 'el-icon-delete', audit: [''], event: {
|
|
|
click: () => {
|
|
|
(this as any).onDelete('all')
|
|
|
}
|
|
@@ -877,6 +876,17 @@
|
|
|
this.getDataList()
|
|
|
}, 500)
|
|
|
}
|
|
|
+ // 引单
|
|
|
+ citationOrder() {
|
|
|
+ console.log();
|
|
|
+ let data : any = (this as any).$refs.bill.getSourceTableSelectData(0);
|
|
|
+ console.log(data);
|
|
|
+ (this.$refs.bill as any).showTab = 'bill';
|
|
|
+ setTimeout(() => {
|
|
|
+ (this.$refs.bill as any).setBillFormValue(data[0]); // 设置单据表单数据
|
|
|
+ (this.$refs.bill as any).setBillTableValue(data[0].suborderList, 0);// 设置第1张单据表格数据
|
|
|
+ }, 0)
|
|
|
+ }
|
|
|
// 获取机构数据
|
|
|
getSupplierModal(e : any) {
|
|
|
this.supplierInfo = e;
|
|
@@ -923,12 +933,16 @@
|
|
|
console.log('保存 ==>', this.tabType);
|
|
|
(this as any).$refs.bill.$refs.billForm.validate().then(() => {
|
|
|
let query = (this.$refs.bill as any).getBillFormValue(); // 获取单据数据
|
|
|
+ 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.suborderList = (this.$refs.bill as any).getBillTableData(0);
|
|
|
+ query.businessType = "销售类型";
|
|
|
if (query.suborderList.length > 0) {
|
|
|
for (let v of query.suborderList) {
|
|
|
console.log(v.prePrice);
|
|
@@ -936,12 +950,17 @@
|
|
|
if (!v.unitPrice || v.unitPrice <= 0) return this.$message.warning('请输入正确物料单价');
|
|
|
if (v.prePrice.length <= 0 || v.prePrice < 0) return this.$message.warning('请输入正确优惠金额');
|
|
|
v.taskOrderId = query.id;
|
|
|
- v.storehouseName = '我是仓库';
|
|
|
- v.storehouseId = 2;
|
|
|
- v.storingLocationName = '我是仓位';
|
|
|
- v.storingLocationId = 4;
|
|
|
+ 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) => {
|
|
|
if (v.isDeleted === 1 && !v.id) {
|
|
@@ -949,30 +968,35 @@
|
|
|
}
|
|
|
});
|
|
|
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) {
|
|
|
- query.submitState = 0
|
|
|
- console.log('保存进草稿箱 ==>', query);
|
|
|
- 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);
|
|
|
- })
|
|
|
+ // 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);
|
|
|
+ // })
|
|
|
} else if (this.tabType === 'all' || this.tabType === 'draftsBox') {
|
|
|
if (this.tabType === 'draftsBox') query.submitState = 0;
|
|
|
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);
|
|
|
+ // })
|
|
|
};
|
|
|
})
|
|
|
}
|
|
@@ -1064,6 +1088,19 @@
|
|
|
console.log('切换tab ==> ', e);
|
|
|
this.tabType = e;
|
|
|
// submitState: 提交状态
|
|
|
+ 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)
|
|
|
+ })
|
|
|
+ }
|
|
|
if (e === 'all') this.getPageList({ pageSize: 10, pageNo: 1 }, 'all'); // 草稿箱数据
|
|
|
if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
|
|
|
if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
|