|
@@ -27,6 +27,7 @@
|
|
|
baseInfo : any = {}
|
|
|
isSubmit : any = false
|
|
|
isChange : any = false
|
|
|
+ dataId : any = ''
|
|
|
// 右边
|
|
|
supplierInfo : any = {} // 机构信息
|
|
|
tableData : any = []
|
|
@@ -45,11 +46,11 @@
|
|
|
save: true,
|
|
|
}
|
|
|
},
|
|
|
- log:{
|
|
|
- request:{
|
|
|
- url:'/supply/supplyTaskOrderOperateLog/page',
|
|
|
- method:'GET'
|
|
|
- }
|
|
|
+ log: {
|
|
|
+ request: {
|
|
|
+ url: '/supply/supplyTaskOrderOperateLog/page',
|
|
|
+ method: 'GET'
|
|
|
+ }
|
|
|
},
|
|
|
form: {
|
|
|
attr: {
|
|
@@ -166,11 +167,6 @@
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
- {
|
|
|
- width: 140,
|
|
|
- title: '已交付数量',
|
|
|
- field: 'deliveryNumber',
|
|
|
- },
|
|
|
{
|
|
|
width: 140,
|
|
|
title: '单价',
|
|
@@ -853,6 +849,10 @@
|
|
|
console.log('保存tabType ==>', this.tabType);
|
|
|
(this as any).$refs.bill.$refs.billForm.validate().then(() => {
|
|
|
let query = (this.$refs.bill as any).getBillFormValue(); // 获取单据数据
|
|
|
+ // 手机验证
|
|
|
+ let reg = /^1[3456789]\d{9}$/;
|
|
|
+ // let reg = /^0\d{2,3}-\d{7,8}$/
|
|
|
+ if (query.deliveryPhone && !reg.test(query.deliveryPhone)) return this.$message.warning('请输入正确手机号码');
|
|
|
// 供应商数据
|
|
|
if (!query.organizationName) query.organizationName = this.supplierInfo.name;
|
|
|
if (!query.organizationId) query.organizationId = this.supplierInfo.id;
|
|
@@ -879,12 +879,13 @@
|
|
|
if (this.isAdd) {
|
|
|
api.saveList(query, 'supplyTaskOrder').then((res : any) => {
|
|
|
if (res.code === 200) {
|
|
|
- // this.isAdd = false;
|
|
|
- // this.isChange = false;
|
|
|
- // this.isSubmit = true;
|
|
|
- this.getDataList();
|
|
|
+ this.isAdd = false;
|
|
|
+ this.isChange = false;
|
|
|
+ this.isSubmit = true;
|
|
|
this.$message.success('保存成功');
|
|
|
- (this.$refs.bill as any).showTab = 'all';
|
|
|
+ this.dataId = res.data;
|
|
|
+ // this.getDataList();
|
|
|
+ // (this.$refs.bill as any).showTab = 'all';
|
|
|
} else this.$message.error(res.msg);
|
|
|
})
|
|
|
} else if (this.tabType === 'all' || this.tabType === 'draftsBox') {
|
|
@@ -912,11 +913,11 @@
|
|
|
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张单据表格数据
|
|
|
- // }
|
|
|
+ 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);
|
|
@@ -938,12 +939,12 @@
|
|
|
// 已提交
|
|
|
if (parentData.submitState === 1) {
|
|
|
loading.close();
|
|
|
- return this.setReadonly(parentData,true)
|
|
|
+ return this.setReadonly(parentData, true)
|
|
|
};
|
|
|
// 回收站
|
|
|
- if(this.tabType === 'recycleBin' ){
|
|
|
+ if (this.tabType === 'recycleBin') {
|
|
|
loading.close();
|
|
|
- return this.setReadonly(parentData,false)
|
|
|
+ return this.setReadonly(parentData, false)
|
|
|
};
|
|
|
let data = parentData.suborderList
|
|
|
data.map((v : any, i : any) => {
|
|
@@ -977,17 +978,18 @@
|
|
|
(this.$refs.bill as any).setBillFormValue(parentData);// 设置单据表单数据
|
|
|
(this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
|
|
|
this.isAdd = false;
|
|
|
+ this.dataId = '';
|
|
|
(this.$refs.bill as any).showTab = 'bill';
|
|
|
loading.close();
|
|
|
} else {
|
|
|
loading.close();
|
|
|
- this.setReadonly(parentData,false);
|
|
|
+ this.setReadonly(parentData, false);
|
|
|
};
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
// 设置只读
|
|
|
- setReadonly(e : any,isReturn:any) {
|
|
|
+ setReadonly(e : any, isReturn : any) {
|
|
|
let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
|
readonly.form.attr.readonly = true; // 设置只读
|
|
|
readonly.tool.tools = {};
|
|
@@ -1031,11 +1033,13 @@
|
|
|
type: 'warning',
|
|
|
center: true
|
|
|
}).then(() => {
|
|
|
- api.submitTo({ id: this.baseInfo.id }, 'supplyTaskOrder').then((res : any) => {
|
|
|
+ let id = this.dataId ? this.dataId : this.baseInfo.id;
|
|
|
+ api.submitTo({ id: id }, 'supplyTaskOrder').then((res : any) => {
|
|
|
if (res.code === 200) {
|
|
|
this.$message.success('提交成功');
|
|
|
this.clickTab(this.tabType);
|
|
|
this.isSubmit = false;
|
|
|
+ this.dataId = '';
|
|
|
(this.$refs.bill as any).showTab = this.tabType;
|
|
|
} else this.$message.error(res.msg)
|
|
|
})
|
|
@@ -1193,7 +1197,7 @@
|
|
|
if (e === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
|
|
|
if (e === 'bill') {
|
|
|
let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
|
- billConfig.tool.tools={};
|
|
|
+ billConfig.tool.tools = {};
|
|
|
billConfig.tool.customTools = [];
|
|
|
(this.$refs.bill as any).setBillConfig(billConfig);
|
|
|
}
|