|
@@ -2,7 +2,8 @@
|
|
<div>
|
|
<div>
|
|
<by-bill ref="bill" :propConfig="config" @search="search" @onSmt="onSmt" @onDelete="onDelete" @onRefresh="resert"
|
|
<by-bill ref="bill" :propConfig="config" @search="search" @onSmt="onSmt" @onDelete="onDelete" @onRefresh="resert"
|
|
@resert="resert" @detail="openEdit" @onSave="onSave" @clickTab="clickTab" @onChangeRow="onChangeRow"
|
|
@resert="resert" @detail="openEdit" @onSave="onSave" @clickTab="clickTab" @onChangeRow="onChangeRow"
|
|
- @pagination="pagination" @onReturnSmt="onReturnSmt2" @getSupplierModal="getSupplierModal" @printBefore="printBefore">
|
|
|
|
|
|
+ @pagination="pagination" @onReturnSmt="onReturnSmt2" @getSupplierModal="getSupplierModal"
|
|
|
|
+ @printBefore="printBefore" @onReturn="onReturn">
|
|
</by-bill>
|
|
</by-bill>
|
|
|
|
|
|
<SettingConfig ref="setForm" type="setCForm" title="出库单" />
|
|
<SettingConfig ref="setForm" type="setCForm" title="出库单" />
|
|
@@ -69,7 +70,7 @@
|
|
},
|
|
},
|
|
customTools: [
|
|
customTools: [
|
|
{
|
|
{
|
|
- name: '引单', icon: 'el-icon-bottom', audit: [''], event: {
|
|
|
|
|
|
+ name: '引单出库', icon: 'el-icon-bottom', audit: [''], event: {
|
|
click: () => {
|
|
click: () => {
|
|
(this as any).citationOrder()
|
|
(this as any).citationOrder()
|
|
}
|
|
}
|
|
@@ -130,6 +131,7 @@
|
|
tool: {
|
|
tool: {
|
|
tools: {
|
|
tools: {
|
|
save: true,
|
|
save: true,
|
|
|
|
+ return: true
|
|
}
|
|
}
|
|
},
|
|
},
|
|
log: {
|
|
log: {
|
|
@@ -595,7 +597,7 @@
|
|
},
|
|
},
|
|
customTools: [
|
|
customTools: [
|
|
{
|
|
{
|
|
- name: '出库', icon: 'el-icon-top', audit: [''], event: {
|
|
|
|
|
|
+ name: '引单出库', icon: 'el-icon-bottom', audit: [''], event: {
|
|
click: () => {
|
|
click: () => {
|
|
(this as any).outbound()
|
|
(this as any).outbound()
|
|
}
|
|
}
|
|
@@ -799,11 +801,11 @@
|
|
}, 500)
|
|
}, 500)
|
|
}
|
|
}
|
|
//打印前数据修改
|
|
//打印前数据修改
|
|
- printBefore(params:any){
|
|
|
|
|
|
+ printBefore(params : any) {
|
|
params.templateId = 12;
|
|
params.templateId = 12;
|
|
let value = (this.$refs.bill as any).getBillFormValue();
|
|
let value = (this.$refs.bill as any).getBillFormValue();
|
|
- if(value){
|
|
|
|
- let data:any={};
|
|
|
|
|
|
+ if (value) {
|
|
|
|
+ let data : any = {};
|
|
data.orderNumber = value.orderNumber;
|
|
data.orderNumber = value.orderNumber;
|
|
data.operator = value.operator;
|
|
data.operator = value.operator;
|
|
data.businessType = value.businessType;
|
|
data.businessType = value.businessType;
|
|
@@ -815,13 +817,13 @@
|
|
data.outOrderNo = value.outOrderNo;
|
|
data.outOrderNo = value.outOrderNo;
|
|
data.receive = value.receive;
|
|
data.receive = value.receive;
|
|
data.suborderList = [];
|
|
data.suborderList = [];
|
|
- if(value.suborderList){
|
|
|
|
|
|
+ if (value.suborderList) {
|
|
data.totalNumber = 0;//总数量
|
|
data.totalNumber = 0;//总数量
|
|
- data.totalDeliveryNumber=0; //总应出数量
|
|
|
|
|
|
+ data.totalDeliveryNumber = 0; //总应出数量
|
|
data.totalPri = 0;//总计金额
|
|
data.totalPri = 0;//总计金额
|
|
data.totalOutNumber = 0; //总出库数量
|
|
data.totalOutNumber = 0; //总出库数量
|
|
- for(const item of value.suborderList){
|
|
|
|
- let obj:any={};
|
|
|
|
|
|
+ for (const item of value.suborderList) {
|
|
|
|
+ let obj : any = {};
|
|
obj.materialName = item.materialName;
|
|
obj.materialName = item.materialName;
|
|
obj.financeSuborderId = item.financeSuborderId;
|
|
obj.financeSuborderId = item.financeSuborderId;
|
|
obj.storehouseName = item.storehouseName;
|
|
obj.storehouseName = item.storehouseName;
|
|
@@ -833,17 +835,17 @@
|
|
obj.unitPrice = item.unitPrice;
|
|
obj.unitPrice = item.unitPrice;
|
|
obj.totalPrice = item.totalPrice;
|
|
obj.totalPrice = item.totalPrice;
|
|
data.suborderList.push(obj);
|
|
data.suborderList.push(obj);
|
|
- if(Number(item.number)){
|
|
|
|
- data.totalNumber = add(data.totalNumber,Number(item.number))
|
|
|
|
|
|
+ if (Number(item.number)) {
|
|
|
|
+ data.totalNumber = add(data.totalNumber, Number(item.number))
|
|
}
|
|
}
|
|
- if(Number(item.deliveryNumber)){
|
|
|
|
- data.totalDeliveryNumber = add(data.totalDeliveryNumber,Number(item.deliveryNumber))
|
|
|
|
|
|
+ if (Number(item.deliveryNumber)) {
|
|
|
|
+ data.totalDeliveryNumber = add(data.totalDeliveryNumber, Number(item.deliveryNumber))
|
|
}
|
|
}
|
|
- if(Number(item.totalPrice)){
|
|
|
|
- data.totalPri = add(data.totalPri,Number(item.totalPrice));
|
|
|
|
|
|
+ if (Number(item.totalPrice)) {
|
|
|
|
+ data.totalPri = add(data.totalPri, Number(item.totalPrice));
|
|
}
|
|
}
|
|
- if(Number(item.outNumber)){
|
|
|
|
- data.totalOutNumber = add(data.totalOutNumber,Number(item.outNumber));
|
|
|
|
|
|
+ if (Number(item.outNumber)) {
|
|
|
|
+ data.totalOutNumber = add(data.totalOutNumber, Number(item.outNumber));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -926,7 +928,7 @@
|
|
} else this.$message.warning('请选择同步数据');
|
|
} else this.$message.warning('请选择同步数据');
|
|
}
|
|
}
|
|
// 保存
|
|
// 保存
|
|
- onSave(e : any) {
|
|
|
|
|
|
+ onSave() {
|
|
console.log('保存 ==>', this.tabType);
|
|
console.log('保存 ==>', this.tabType);
|
|
(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(); // 获取单据数据
|
|
@@ -939,6 +941,7 @@
|
|
if (!v.unitPrice || v.unitPrice <= 0) return this.$message.warning('请输入正确物料单价');
|
|
if (!v.unitPrice || v.unitPrice <= 0) return this.$message.warning('请输入正确物料单价');
|
|
if (v.deliveryNumber < v.number) return this.$message.warning('数量不能大于应出数量');
|
|
if (v.deliveryNumber < v.number) return this.$message.warning('数量不能大于应出数量');
|
|
if (v.number > v.inventory) return this.$message.warning('出库数量不能大于库存数量');
|
|
if (v.number > v.inventory) return this.$message.warning('出库数量不能大于库存数量');
|
|
|
|
+ if (v.totalPrice <= 0) return this.$message.warning('合计金额不能为负数');
|
|
v.taskOrderId = query.id;
|
|
v.taskOrderId = query.id;
|
|
v.purchaseSuborderId = v.id;
|
|
v.purchaseSuborderId = v.id;
|
|
}
|
|
}
|
|
@@ -1035,13 +1038,15 @@
|
|
}]
|
|
}]
|
|
})
|
|
})
|
|
};
|
|
};
|
|
- billConfig.tool.tools = { save: true, smt: true };
|
|
|
|
|
|
+ billConfig.tool.tools = { return: true, save: true, smt: true };
|
|
// 查销售订单数据
|
|
// 查销售订单数据
|
|
api.single({ id: e.purchaseOrderId }, 'supplyPurchaseOrder').then((val : any) => {
|
|
api.single({ id: e.purchaseOrderId }, 'supplyPurchaseOrder').then((val : any) => {
|
|
if (val.code === 200) {
|
|
if (val.code === 200) {
|
|
parentData.suborderList.map((v : any, i : any) => {
|
|
parentData.suborderList.map((v : any, i : any) => {
|
|
v.outNumber = val.data.suborderList[i].outNumber;
|
|
v.outNumber = val.data.suborderList[i].outNumber;
|
|
v.prePrice = val.data.suborderList[i].prePrice;
|
|
v.prePrice = val.data.suborderList[i].prePrice;
|
|
|
|
+ // v.realityPrice = val.data.suborderList[i].realityPrice-v.prePrice;
|
|
|
|
+ console.log(v);
|
|
});
|
|
});
|
|
let data : any = parentData.suborderList;
|
|
let data : any = parentData.suborderList;
|
|
let array : any = [];
|
|
let array : any = [];
|
|
@@ -1086,9 +1091,9 @@
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
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 = { return: true, };
|
|
if (this.tabType != 'recycleBin') {
|
|
if (this.tabType != 'recycleBin') {
|
|
- if (parentData.submitState === 1) readonly.tool.tools = { returnSmt: true,print:true };
|
|
|
|
|
|
+ if (parentData.submitState === 1) readonly.tool.tools = { return: true, returnSmt: true, print: true };
|
|
}
|
|
}
|
|
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 != '操作');
|
|
api.single({ id: e.purchaseOrderId }, 'supplyPurchaseOrder').then((val : any) => {
|
|
api.single({ id: e.purchaseOrderId }, 'supplyPurchaseOrder').then((val : any) => {
|
|
@@ -1341,6 +1346,10 @@
|
|
} else this.$message.error(res.msg)
|
|
} else this.$message.error(res.msg)
|
|
}).catch(() => loading.close());
|
|
}).catch(() => loading.close());
|
|
}
|
|
}
|
|
|
|
+ // 返回
|
|
|
|
+ onReturn() {
|
|
|
|
+ this.clickTab(this.tabType);
|
|
|
|
+ }
|
|
// 搜索
|
|
// 搜索
|
|
search(parames : any) {
|
|
search(parames : any) {
|
|
console.log('搜索 ==> ', parames);
|
|
console.log('搜索 ==> ', parames);
|