|
@@ -17,12 +17,13 @@
|
|
|
export default class OrderTask extends Vue {
|
|
|
// 右边
|
|
|
tableData : any = []
|
|
|
+ mergeObj : any = []
|
|
|
setStatusData : any = ''
|
|
|
timeNum = 0;
|
|
|
timer : any = null
|
|
|
config : any = {
|
|
|
attr: {
|
|
|
- activeName: 'bill'
|
|
|
+ activeName: 'all'
|
|
|
},
|
|
|
// 单据
|
|
|
bill: {
|
|
@@ -60,8 +61,14 @@
|
|
|
},
|
|
|
{
|
|
|
span: 8,
|
|
|
- label: '交货地点',
|
|
|
- prop: 'deliveryAddress',
|
|
|
+ label: '联系方式',
|
|
|
+ prop: 'deliveryPhone',
|
|
|
+ component: 'by-input',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ span: 8,
|
|
|
+ label: '交货人',
|
|
|
+ prop: 'delivery',
|
|
|
component: 'by-input',
|
|
|
},
|
|
|
{
|
|
@@ -76,14 +83,8 @@
|
|
|
},
|
|
|
{
|
|
|
span: 8,
|
|
|
- label: '交货人',
|
|
|
- prop: 'delivery',
|
|
|
- component: 'by-input',
|
|
|
- },
|
|
|
- {
|
|
|
- span: 8,
|
|
|
- label: '联系方式',
|
|
|
- prop: 'deliveryPhone',
|
|
|
+ label: '交货地点',
|
|
|
+ prop: 'deliveryAddress',
|
|
|
component: 'by-input',
|
|
|
},
|
|
|
{
|
|
@@ -92,14 +93,23 @@
|
|
|
prop: 'deliveryWay',
|
|
|
component: 'by-input',
|
|
|
},
|
|
|
+ ],
|
|
|
+ [
|
|
|
{
|
|
|
- span: 8,
|
|
|
+ span: 28,
|
|
|
label: '备注',
|
|
|
slot: true,
|
|
|
prop: 'remark',
|
|
|
component: 'by-input',
|
|
|
+ compConfig: {
|
|
|
+ attr: {
|
|
|
+ size: 'mini',
|
|
|
+ placeholder: '请输入备注',
|
|
|
+ type:'textarea'
|
|
|
+ },
|
|
|
+ }
|
|
|
},
|
|
|
- ],
|
|
|
+ ]
|
|
|
]
|
|
|
},
|
|
|
tableConfig: [
|
|
@@ -114,15 +124,12 @@
|
|
|
size: 'mini',
|
|
|
height: 580,
|
|
|
align: 'center',
|
|
|
- // seq: true,
|
|
|
- // checkbox: true
|
|
|
},
|
|
|
columns:
|
|
|
[{
|
|
|
width: 300,
|
|
|
title: '物料名称',
|
|
|
field: 'materialName',
|
|
|
- // component: 'by-input'
|
|
|
},
|
|
|
{
|
|
|
title: '单位',
|
|
@@ -158,17 +165,6 @@
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
- // {
|
|
|
- // title: '规格',
|
|
|
- // field: 'specs',
|
|
|
- // component: 'by-input',
|
|
|
- // compConfig: {
|
|
|
- // attr: {
|
|
|
- // size: 'mini',
|
|
|
- // readonly:true
|
|
|
- // },
|
|
|
- // }
|
|
|
- // },
|
|
|
{
|
|
|
title: '单价',
|
|
|
field: 'unitPrice',
|
|
@@ -834,8 +830,8 @@
|
|
|
name: '查看',
|
|
|
audit: '',
|
|
|
event: {
|
|
|
- click: (item : any) => {
|
|
|
- (this as any).openEdit(item)
|
|
|
+ click: () => {
|
|
|
+ (this as any).setReadonly()
|
|
|
}
|
|
|
}
|
|
|
}]
|
|
@@ -850,10 +846,25 @@
|
|
|
this.getDataList()
|
|
|
}, 500)
|
|
|
}
|
|
|
+ // 设置只读
|
|
|
+ setReadonly() {
|
|
|
+ let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
|
+ // readonly.form.attr.readonly = true; // 设置只可读
|
|
|
+ for (let key in readonly.tool) {
|
|
|
+ delete readonly.tool[key]
|
|
|
+ };
|
|
|
+ for (let key in readonly.tableConfig[0].tool) {
|
|
|
+ delete readonly.tableConfig[0].tool[key]
|
|
|
+ };
|
|
|
+ console.log('setBillConfig ==> ', readonly);
|
|
|
+ (this.$refs.bill as any).setBillConfig(readonly);
|
|
|
+ (this.$refs.bill as any).showTab = 'bill';
|
|
|
+ }
|
|
|
// 监听表格数据变化
|
|
|
onChangeRow(e : any) {
|
|
|
- // console.log(e);
|
|
|
- // this.tableData.filter((v:any) => v.id == e.id);
|
|
|
+ this.tableData[e.dataIndex].realityPrice = e.number * e.unitPrice;
|
|
|
+ // console.log(this.tableData);
|
|
|
+ (this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
|
|
|
}
|
|
|
// 保存
|
|
|
onSave(e : any) {
|
|
@@ -922,13 +933,16 @@
|
|
|
}
|
|
|
// 打开编辑
|
|
|
openEdit(e : any) {
|
|
|
+ console.log('编辑 ==>', e);
|
|
|
e = e.row ? e.row : e;
|
|
|
let data = e.suborderList
|
|
|
data.map((v : any, i : any) => {
|
|
|
v.dataIndex = i
|
|
|
});
|
|
|
this.tableData = data;
|
|
|
- console.log('表格数据 ==> ', this.tableData);
|
|
|
+ // let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
|
+ // console.log(this.config.bill);
|
|
|
+ // (this.$refs.bill as any).setBillConfig(readonly);
|
|
|
(this.$refs.bill as any).setBillFormValue(e); // 设置单据表单数据
|
|
|
(this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
|
|
|
(this.$refs.bill as any).showTab = 'bill';
|
|
@@ -957,19 +971,11 @@
|
|
|
}
|
|
|
// 切换tab栏
|
|
|
clickTab(e : any) {
|
|
|
- // console.log(e);
|
|
|
+ console.log('切换tab ==> ', e);
|
|
|
// submitState: 提交状态
|
|
|
if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
|
|
|
if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
|
|
|
- if (e === 'recycleBin') { // 回收站数据
|
|
|
- // let data = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
|
- // data.form.attr.readonly = true;
|
|
|
- // for (const item of data.tableConfig) {
|
|
|
- // delete item.tool
|
|
|
- // }
|
|
|
- // (this.$refs.bill as any).setBillConfig(data)
|
|
|
- this.getSelectDeleteList('supplyTaskOrder')
|
|
|
- }
|
|
|
+ if (e === 'recycleBin') this.getSelectDeleteList('supplyTaskOrder'); // 回收站数据
|
|
|
}
|
|
|
// 初始化
|
|
|
getDataList() {
|