|
@@ -34,16 +34,18 @@
|
|
|
import OrderType from "./components/orderType.vue";
|
|
|
import SettingConfig from "./components/settingConfig.vue";
|
|
|
import Assembly from "@/components/Assembly/saleOrder.vue";
|
|
|
+ import TerminateOrder from "@/components/Assembly/terminateOrder.vue";
|
|
|
@Component({ components: { SettingConfig } })
|
|
|
export default class SaleOrder extends Vue {
|
|
|
tabType : any = 'all';
|
|
|
vxeValue = false
|
|
|
isCitation = false
|
|
|
timeNum = 0;
|
|
|
+ calculateCount = 0;
|
|
|
timer : any = null
|
|
|
baseInfo : any = {} // 订单数据
|
|
|
regularData : any = [] // 固定值
|
|
|
-
|
|
|
+
|
|
|
leftTableConfig : any = {
|
|
|
attr: {
|
|
|
size: 'mini',
|
|
@@ -165,7 +167,7 @@
|
|
|
seq: true,
|
|
|
align: 'left',
|
|
|
radio: true,
|
|
|
- triggerRowCheck: 'row'
|
|
|
+ triggerRowCheck: 'row',
|
|
|
},
|
|
|
columns: [
|
|
|
{
|
|
@@ -218,7 +220,7 @@
|
|
|
tool: {
|
|
|
tools: {
|
|
|
save: true,
|
|
|
- return:true
|
|
|
+ return: true
|
|
|
},
|
|
|
customTools: []
|
|
|
},
|
|
@@ -318,6 +320,17 @@
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
+ {
|
|
|
+ span: 8,
|
|
|
+ label: '订单状态',
|
|
|
+ prop: 'status',
|
|
|
+ component: TerminateOrder,
|
|
|
+ compConfig: {
|
|
|
+ attr: {
|
|
|
+ readonly: true,
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
],
|
|
|
[
|
|
|
{
|
|
@@ -472,7 +485,7 @@
|
|
|
triggerRowCheck: 'row',
|
|
|
align: 'left',
|
|
|
radio: true,
|
|
|
- maxHeight: "620"
|
|
|
+ height: '620'
|
|
|
},
|
|
|
columns: [
|
|
|
{
|
|
@@ -480,15 +493,15 @@
|
|
|
title: '单据编号',
|
|
|
field: 'orderNumber',
|
|
|
isDetail: true,
|
|
|
- fixed:'left'
|
|
|
+ fixed: 'left'
|
|
|
},
|
|
|
{
|
|
|
width: 50,
|
|
|
component: OrderType,
|
|
|
- fixed:'left'
|
|
|
+ fixed: 'left'
|
|
|
},
|
|
|
{
|
|
|
- width: 180,
|
|
|
+ width: 100,
|
|
|
title: '机构名称',
|
|
|
field: 'organizationName',
|
|
|
},
|
|
@@ -518,14 +531,15 @@
|
|
|
field: 'affirmDeliveryData',
|
|
|
},
|
|
|
{
|
|
|
- width: 150,
|
|
|
+ width: 250,
|
|
|
title: '交货地点',
|
|
|
field: 'address',
|
|
|
},
|
|
|
{
|
|
|
- width: 80,
|
|
|
+ width: 70,
|
|
|
title: '状态',
|
|
|
field: 'status',
|
|
|
+ align: 'center',
|
|
|
component: Assembly,
|
|
|
},
|
|
|
{
|
|
@@ -614,6 +628,7 @@
|
|
|
attr: {
|
|
|
size: 'mini',
|
|
|
align: 'left',
|
|
|
+ height: '620'
|
|
|
},
|
|
|
columns: [
|
|
|
{
|
|
@@ -624,7 +639,7 @@
|
|
|
fixed: 'left'
|
|
|
},
|
|
|
{
|
|
|
- width: 180,
|
|
|
+ width: 130,
|
|
|
title: '机构名称',
|
|
|
field: 'organizationName',
|
|
|
},
|
|
@@ -634,7 +649,7 @@
|
|
|
field: 'financeOrderId',
|
|
|
},
|
|
|
{
|
|
|
- width: 90,
|
|
|
+ width: 120,
|
|
|
title: '收货人',
|
|
|
field: 'consignee',
|
|
|
},
|
|
@@ -654,14 +669,15 @@
|
|
|
field: 'affirmDeliveryData',
|
|
|
},
|
|
|
{
|
|
|
- width: 150,
|
|
|
+ width: 250,
|
|
|
title: '交货地点',
|
|
|
field: 'address',
|
|
|
},
|
|
|
{
|
|
|
- width: 100,
|
|
|
+ width: 70,
|
|
|
title: '状态',
|
|
|
field: 'status',
|
|
|
+ align: 'center',
|
|
|
component: Assembly,
|
|
|
},
|
|
|
{
|
|
@@ -686,9 +702,25 @@
|
|
|
}
|
|
|
created() {
|
|
|
this.timer = setInterval(() => {
|
|
|
- this.getDataList()
|
|
|
+ this.getDataList();
|
|
|
+ this.initTable();
|
|
|
}, 500)
|
|
|
}
|
|
|
+ // 计算高度
|
|
|
+ initTable() {
|
|
|
+ if (!this.$refs.bill) {
|
|
|
+ this.calculateCount++;
|
|
|
+ if (this.calculateCount > 5) return;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.initTable()
|
|
|
+ }, 500)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.config.source[0].table.attr.height = window.innerHeight - 300;
|
|
|
+ this.config.all.table.attr.height = window.innerHeight - 300;
|
|
|
+ this.config.returnOrder.table.attr.height = window.innerHeight - 300;
|
|
|
+ (this as any).$refs.bill.$refs.all.$refs.table.recalculate();
|
|
|
+ }
|
|
|
// 参数配置
|
|
|
configuration() {
|
|
|
(this as any).$refs.setForm.openSetting();
|
|
@@ -834,7 +866,7 @@
|
|
|
getPageList(query : any, type : any) {
|
|
|
let data = (this.$refs.bill as any).getTablePage('all');
|
|
|
query.pageNo = data.pageNo;
|
|
|
- query.pageSize = 10;
|
|
|
+ query.pageSize = data.pageSize;
|
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
|
api.pageList(query, 'supplyPurchaseOrder').then((res : any) => {
|
|
|
loading.close();
|
|
@@ -851,9 +883,6 @@
|
|
|
}
|
|
|
// 获取引单分页数据
|
|
|
getCitationList(query : any) {
|
|
|
- let data = (this.$refs.bill as any).getTablePage('all');
|
|
|
- query.pageNo = data.pageNo;
|
|
|
- query.pageSize = data.pageSize;
|
|
|
query.submitState = 1; // 已提交
|
|
|
query.status = 0; // 未接单
|
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
@@ -931,7 +960,7 @@
|
|
|
];
|
|
|
}
|
|
|
};
|
|
|
- billConfig.tool.tools = {return:true};
|
|
|
+ billConfig.tool.tools = { return: true };
|
|
|
billConfig.form.columns[0].map((v : any) => {
|
|
|
v.compConfig.attr.readonly = true;
|
|
|
})
|
|
@@ -942,7 +971,7 @@
|
|
|
billConfig.form.columns[0][4].compConfig.attr.readonly = false;
|
|
|
billConfig.form.columns[0][6].compConfig.attr.readonly = false;
|
|
|
billConfig.form.columns[1][0].compConfig.attr.readonly = false;
|
|
|
- billConfig.tool.tools = {return:true, save: true };
|
|
|
+ billConfig.tool.tools = { return: true, save: true };
|
|
|
};
|
|
|
console.log(parentData.suborderList);
|
|
|
(this.$refs.bill as any).setBillConfig(billConfig);
|
|
@@ -971,11 +1000,31 @@
|
|
|
(this.$refs.bill as any).setBillConfig(billConfig);
|
|
|
}
|
|
|
}
|
|
|
+ // 获取当前时间
|
|
|
+ getNowDate() {
|
|
|
+ let date = new Date();
|
|
|
+ let years : any = date.getFullYear();
|
|
|
+ let months : any = date.getMonth() + 1;
|
|
|
+ let days : any = date.getDate();
|
|
|
+ let hours : any = date.getHours();
|
|
|
+ let minutes : any = date.getMinutes();
|
|
|
+ let seconds : any = date.getSeconds();
|
|
|
+ months = months < 10 ? '0' + months : months;
|
|
|
+ days = days < 10 ? '0' + days : days;
|
|
|
+ hours = hours < 10 ? '0' + hours : hours;
|
|
|
+ minutes = minutes < 10 ? '0' + minutes : minutes;
|
|
|
+ seconds = seconds < 10 ? '0' + seconds : seconds;
|
|
|
+ return `${years}-${months}-${days} ${hours}:${minutes}:${seconds}`;
|
|
|
+ }
|
|
|
// 同步销售订单到财务系统
|
|
|
syncSystem() {
|
|
|
let selectData = (this as any).$refs.bill.getTableSelectData('all');
|
|
|
if (selectData.length > 0) {
|
|
|
if (selectData[0].isMaster !== 1 || selectData[0].status !== 0) return this.$message.warning('只能同步未出库的主单');
|
|
|
+ if (selectData[0].financeOrderId) return this.$message.warning('此数据已同步财务编号');
|
|
|
+ let planData = selectData[0].planDeliveryData.replaceAll(/[-:\s]/g, '');
|
|
|
+ let nowDate = this.getNowDate().replaceAll(/[-:\s]/g, '');
|
|
|
+ if (planData < nowDate) return this.$message.warning('计划交货时间小于当前时间,不能同步财务编号');
|
|
|
this.$confirm('确定同步订单吗', '注意', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
@@ -1002,6 +1051,10 @@
|
|
|
type: 'warning',
|
|
|
center: true
|
|
|
}).then(() => {
|
|
|
+ if (e.financeOrderId) return this.$message.warning('此数据已同步财务编号');
|
|
|
+ let planData = e.planDeliveryData.replaceAll(/[-:\s]/g, '');
|
|
|
+ let nowDate = this.getNowDate().replaceAll(/[-:\s]/g, '');
|
|
|
+ if (planData < nowDate) return this.$message.warning('计划交货时间小于当前时间,不能同步财务编号');
|
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
|
api.addSaleOrder({ ids: e.id }).then((res : any) => {
|
|
|
loading.close();
|
|
@@ -1084,7 +1137,7 @@
|
|
|
}
|
|
|
}
|
|
|
// 返回
|
|
|
- onReturn(){
|
|
|
+ onReturn() {
|
|
|
this.clickTab(this.tabType);
|
|
|
}
|
|
|
// 搜索
|