给单据中的供应商、客户、会员、账号新增完之后默认直接选中

This commit is contained in:
jishenghua
2024-04-30 00:20:52 +08:00
parent 621299a5be
commit b6741cffc7
11 changed files with 50 additions and 31 deletions

View File

@@ -169,27 +169,36 @@ export const BillModalMixin = {
} }
}) })
}, },
initSupplier() { initSupplier(isChecked) {
let that = this; let that = this;
findBySelectSup({}).then((res)=>{ findBySelectSup({}).then((res)=>{
if(res) { if(res) {
that.supList = res; that.supList = res
if(isChecked && res.length>0) {
that.form.setFieldsValue({'organId': res[0].id})
}
} }
}); });
}, },
initCustomer() { initCustomer(isChecked) {
let that = this; let that = this;
findBySelectCus({}).then((res)=>{ findBySelectCus({}).then((res)=>{
if(res) { if(res) {
that.cusList = res; that.cusList = res
if(isChecked && res.length>0) {
that.form.setFieldsValue({'organId': res[0].id})
}
} }
}); });
}, },
initRetail() { initRetail(isChecked) {
let that = this; let that = this;
findBySelectRetail({}).then((res)=>{ findBySelectRetail({}).then((res)=>{
if(res) { if(res) {
that.retailList = res; that.retailList = res
if(isChecked && res.length>0) {
that.form.setFieldsValue({'organId': res[0].id})
}
} }
}); });
}, },
@@ -221,13 +230,17 @@ export const BillModalMixin = {
} }
}) })
}, },
initAccount(){ initAccount(isChecked){
let that = this; let that = this;
getAccount({}).then((res)=>{ getAccount({}).then((res)=>{
if(res && res.code === 200) { if(res && res.code === 200) {
let list = res.data.accountList let list = res.data.accountList
let lastId = list.length>0?list[0].id:''
list.splice(0,0,{id: 0, name: '多账户'}) list.splice(0,0,{id: 0, name: '多账户'})
that.accountList = list that.accountList = list
if(isChecked) {
that.form.setFieldsValue({'accountId': lastId})
}
} }
}) })
}, },
@@ -286,13 +299,13 @@ export const BillModalMixin = {
this.$refs.accountModalForm.disableSubmit = false; this.$refs.accountModalForm.disableSubmit = false;
}, },
vendorModalFormOk() { vendorModalFormOk() {
this.initSupplier() this.initSupplier(1)
}, },
customerModalFormOk() { customerModalFormOk() {
this.initCustomer() this.initCustomer(1)
}, },
memberModalFormOk() { memberModalFormOk() {
this.initRetail() this.initRetail(1)
}, },
batchSetDepotModalFormOk(depotId) { batchSetDepotModalFormOk(depotId) {
this.getAllTable().then(tables => { this.getAllTable().then(tables => {
@@ -346,7 +359,7 @@ export const BillModalMixin = {
this.initDepot() this.initDepot()
}, },
accountModalFormOk() { accountModalFormOk() {
this.initAccount() this.initAccount(1)
}, },
onAdded(event) { onAdded(event) {
const { row, target } = event const { row, target } = event

View File

@@ -267,7 +267,7 @@
this.copyAddInit(this.prefixNo) this.copyAddInit(this.prefixNo)
} }
this.initSystemConfig() this.initSystemConfig()
this.initSupplier() this.initSupplier(0)
this.initDepot() this.initDepot()
}, },
//提交单据时整理成formData //提交单据时整理成formData

View File

@@ -267,7 +267,7 @@
this.copyAddInit(this.prefixNo) this.copyAddInit(this.prefixNo)
} }
this.initSystemConfig() this.initSystemConfig()
this.initCustomer() this.initCustomer(0)
this.initDepot() this.initDepot()
}, },
//提交单据时整理成formData //提交单据时整理成formData

View File

@@ -338,9 +338,9 @@
this.copyAddInit(this.prefixNo) this.copyAddInit(this.prefixNo)
} }
this.initSystemConfig() this.initSystemConfig()
this.initSupplier() this.initSupplier(0)
this.initDepot() this.initDepot()
this.initAccount() this.initAccount(0)
}, },
//提交单据时整理成formData //提交单据时整理成formData
classifyIntoFormData(allValues) { classifyIntoFormData(allValues) {

View File

@@ -387,9 +387,9 @@
this.copyAddInit(this.prefixNo) this.copyAddInit(this.prefixNo)
} }
this.initSystemConfig() this.initSystemConfig()
this.initSupplier() this.initSupplier(0)
this.initDepot() this.initDepot()
this.initAccount() this.initAccount(0)
}, },
//提交单据时整理成formData //提交单据时整理成formData
classifyIntoFormData(allValues) { classifyIntoFormData(allValues) {

View File

@@ -346,8 +346,8 @@
this.copyAddInit(this.prefixNo) this.copyAddInit(this.prefixNo)
} }
this.initSystemConfig() this.initSystemConfig()
this.initSupplier() this.initSupplier(0)
this.initAccount() this.initAccount(0)
}, },
/** 整理成formData */ /** 整理成formData */
classifyIntoFormData(allValues) { classifyIntoFormData(allValues) {

View File

@@ -320,9 +320,9 @@
this.copyAddInit(this.prefixNo) this.copyAddInit(this.prefixNo)
} }
this.initSystemConfig() this.initSystemConfig()
this.initRetail() this.initRetail(0)
this.initDepot() this.initDepot()
this.initAccount() this.initAccount(0)
}, },
//提交单据时整理成formData //提交单据时整理成formData
classifyIntoFormData(allValues) { classifyIntoFormData(allValues) {
@@ -351,10 +351,13 @@
rows: JSON.stringify(detailArr), rows: JSON.stringify(detailArr),
} }
}, },
initAccount(){ initAccount(isChecked){
getAccount({}).then((res)=>{ getAccount({}).then((res)=>{
if(res && res.code === 200) { if(res && res.code === 200) {
this.accountList = res.data.accountList this.accountList = res.data.accountList
if(isChecked && this.accountList.length>0) {
this.form.setFieldsValue({'accountId': this.accountList[0].id})
}
} }
}) })
}, },

View File

@@ -330,9 +330,9 @@
this.copyAddInit(this.prefixNo) this.copyAddInit(this.prefixNo)
} }
this.initSystemConfig() this.initSystemConfig()
this.initRetail() this.initRetail(0)
this.initDepot() this.initDepot()
this.initAccount() this.initAccount(0)
}, },
//提交单据时整理成formData //提交单据时整理成formData
classifyIntoFormData(allValues) { classifyIntoFormData(allValues) {
@@ -364,10 +364,13 @@
initPayTypeList() { initPayTypeList() {
this.payTypeList.push({"value":"现付", "text":"现付"}) this.payTypeList.push({"value":"现付", "text":"现付"})
}, },
initAccount(){ initAccount(isChecked){
getAccount({}).then((res)=>{ getAccount({}).then((res)=>{
if(res && res.code === 200) { if(res && res.code === 200) {
this.accountList = res.data.accountList this.accountList = res.data.accountList
if(isChecked && this.accountList.length>0) {
this.form.setFieldsValue({'accountId': this.accountList[0].id})
}
} }
}) })
}, },

View File

@@ -345,10 +345,10 @@
this.copyAddInit(this.prefixNo) this.copyAddInit(this.prefixNo)
} }
this.initSystemConfig() this.initSystemConfig()
this.initCustomer() this.initCustomer(0)
this.initSalesman() this.initSalesman()
this.initDepot() this.initDepot()
this.initAccount() this.initAccount(0)
}, },
//提交单据时整理成formData //提交单据时整理成formData
classifyIntoFormData(allValues) { classifyIntoFormData(allValues) {

View File

@@ -321,9 +321,9 @@
this.copyAddInit(this.prefixNo) this.copyAddInit(this.prefixNo)
} }
this.initSystemConfig() this.initSystemConfig()
this.initCustomer() this.initCustomer(0)
this.initSalesman() this.initSalesman()
this.initAccount() this.initAccount(0)
}, },
//提交单据时整理成formData //提交单据时整理成formData
classifyIntoFormData(allValues) { classifyIntoFormData(allValues) {

View File

@@ -405,10 +405,10 @@
this.copyAddInit(this.prefixNo) this.copyAddInit(this.prefixNo)
} }
this.initSystemConfig() this.initSystemConfig()
this.initCustomer() this.initCustomer(0)
this.initSalesman() this.initSalesman()
this.initDepot() this.initDepot()
this.initAccount() this.initAccount(0)
}, },
//提交单据时整理成formData //提交单据时整理成formData
classifyIntoFormData(allValues) { classifyIntoFormData(allValues) {