diff --git a/src/api/Common/dictcommons.js b/src/api/Common/dictcommons.js index 84e828c..8b46441 100644 --- a/src/api/Common/dictcommons.js +++ b/src/api/Common/dictcommons.js @@ -62,6 +62,15 @@ export function choiceSupplierInfo(data) { }) } +// 查询所有仓库 +export function getWareHouse(params) { + return request({ + url: '/oms/apiadmin/warehouseinfo/getWareHouse', + method: 'post', + params: params + }) +} + // 查询所有仓库 export function getWarehouses(params) { return request({ diff --git a/src/views/salesOrder/salesOrderAdd.vue b/src/views/salesOrder/salesOrderAdd.vue index 98500e4..053e71e 100644 --- a/src/views/salesOrder/salesOrderAdd.vue +++ b/src/views/salesOrder/salesOrderAdd.vue @@ -4,7 +4,9 @@
{{ viewTitle }}
- 保存 + 保存 + 保存并新增 + 重置 关闭
@@ -332,12 +334,12 @@ - + - + @@ -354,7 +356,7 @@ import req from '@/api/salesOrder/salesOrder' import Pagination from '@/components/pagination' import uploadImg from '@/components/uploadFile/uploadImg' -import { getProvince, getCity, getCounty, typeValues, getWarehouses, chooseCustomerList } from '@/api/Common/dictcommons' +import { getProvince, getCity, getCounty, typeValues, getWareHouse, chooseCustomerList } from '@/api/Common/dictcommons' export default { name: 'SalesOrderAdd', @@ -411,7 +413,6 @@ export default { // 多账户 dialogVisible: false, accountKey: 2, - accountList: [], index: 0, formobj: { sid: '', @@ -473,7 +474,8 @@ export default { bankAccountKey: '', settleAmount: '', goodsList: [], - files: [] + files: [], + accounts: [] }, totalReceivables: '', // 商品列表中应收款总和 rules: {} @@ -526,7 +528,7 @@ export default { this.province_list = res.data } }) - getWarehouses({ createOrgSid: window.sessionStorage.getItem('orgSid') }).then((res) => { + getWareHouse({ createOrgSid: window.sessionStorage.getItem('orgSid') }).then((res) => { if (res.success) { this.warehouse_list = res.data } @@ -659,7 +661,7 @@ export default { }, customerList() { this.customerLoading = true - this.customerQuery.params.createOrgSid = this.formobj.deptSid + this.customerQuery.params.createOrgSid = window.sessionStorage.getItem('orgSid') chooseCustomerList(this.customerQuery).then((response) => { this.customerLoading = false if (response.success) { @@ -706,7 +708,7 @@ export default { }, commodityList() { this.commodityLoading = true - this.commodityQuery.params.createOrgSid = this.formobj.deptSid + this.commodityQuery.params.createOrgSid = window.sessionStorage.getItem('orgSid') req.chooseProducts(this.commodityQuery).then((response) => { this.commodityLoading = false if (response.success) { @@ -896,18 +898,18 @@ export default { if (this.bankAccount_list.length > 0) { this.bankAccount_list.forEach((e) => { aa.push({ - name: e.dictValue, - sid: e.dictKey, - money: '' + bankAccount: e.dictValue, + bankAccountKey: e.dictKey, + amount: '' }) }) } - this.accountList = aa + this.formobj.accounts = aa }, handleConfirm() { this.dialogVisible = false }, - saveOrUpdate() { + handleSave() { this.$refs['form_obj'].validate((valid) => { if (valid) { this.formobj.amount = this.yhhCompute @@ -932,7 +934,49 @@ export default { } }) }, - handleReturn() { + handleSaveAndAdd() { + this.$refs['form_obj'].validate((valid) => { + if (valid) { + this.formobj.amount = this.yhhCompute + this.formobj.dueAmount = this.yhhCompute + this.formobj.thisDebt = this.bcqkCompute + if (this.formobj.billTypeValue === '线下订单') { + this.formobj.billTypeKey = '001' + } else if (this.formobj.billTypeValue === '预售订单') { + this.formobj.billTypeKey = '002' + } + this.submitdisabled = true + req.saveOrUpdate(this.formobj).then((res) => { + if (res.success) { + this.$message({ showClose: true, type: 'success', message: '保存成功' }) + this.handlePartReset() + } else { + this.submitdisabled = false + } + }).catch(() => { + this.submitdisabled = false + }) + } + }) + }, + handlePartReset() { + this.formobj.freight = '' + this.formobj.thisPay = '' + this.formobj.billPriceTypeKey = '' + this.formobj.billPriceTypeValue = '' + this.formobj.bankAccountKey = '' + this.formobj.bankAccount = '' + this.formobj.amount = '' + this.formobj.dueAmount = '' + this.formobj.thisDebt = '' + this.formobj.goodsList = [] + this.totalReceivables = '' + this.commodityData = [] + this.formobj.accounts = [] + this.submitdisabled = false + }, + // 重置页面参数(点击保存或重置时调用) + handleReset() { this.formobj = { sid: '', billNo: '', @@ -993,12 +1037,14 @@ export default { bankAccountKey: '', settleAmount: '', goodsList: [], - files: [] + files: [], + accounts: [] } this.totalReceivables = '' this.commodityData = [] - this.accountList = [] this.submitdisabled = false + }, + handleReturn() { this.$store.dispatch('tagsView/delView', this.$route) this.$router.go(-1) }