完善销售订单
This commit is contained in:
@@ -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) {
|
export function getWarehouses(params) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -4,7 +4,9 @@
|
|||||||
<div class="tab-header webtop">
|
<div class="tab-header webtop">
|
||||||
<div>{{ viewTitle }}</div>
|
<div>{{ viewTitle }}</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button>
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleSave()">保存</el-button>
|
||||||
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleSaveAndAdd()">保存并新增</el-button>
|
||||||
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleReset()">重置</el-button>
|
||||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -332,12 +334,12 @@
|
|||||||
<!-- 多账户 -->
|
<!-- 多账户 -->
|
||||||
<el-dialog title="多账户选择" :visible.sync="dialogVisible" width="40%" :show-close="false">
|
<el-dialog title="多账户选择" :visible.sync="dialogVisible" width="40%" :show-close="false">
|
||||||
<el-form class="formaddcopy02">
|
<el-form class="formaddcopy02">
|
||||||
<el-table :key="accountKey" :data="accountList" :index="index" border style="width: 100%">
|
<el-table :key="accountKey" :data="formobj.accounts" :index="index" border style="width: 100%">
|
||||||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center" />
|
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center" />
|
||||||
<el-table-column prop="name" label="收支账户" align="center" min-width="150" />
|
<el-table-column prop="bankAccount" label="收支账户" align="center" min-width="150" />
|
||||||
<el-table-column label="金额" align="center" min-width="150">
|
<el-table-column label="金额" align="center" min-width="150">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-model="scope.row.money" clearable placeholder="" />
|
<el-input v-model="scope.row.amount" clearable placeholder="" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -354,7 +356,7 @@
|
|||||||
import req from '@/api/salesOrder/salesOrder'
|
import req from '@/api/salesOrder/salesOrder'
|
||||||
import Pagination from '@/components/pagination'
|
import Pagination from '@/components/pagination'
|
||||||
import uploadImg from '@/components/uploadFile/uploadImg'
|
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 {
|
export default {
|
||||||
name: 'SalesOrderAdd',
|
name: 'SalesOrderAdd',
|
||||||
@@ -411,7 +413,6 @@ export default {
|
|||||||
// 多账户
|
// 多账户
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
accountKey: 2,
|
accountKey: 2,
|
||||||
accountList: [],
|
|
||||||
index: 0,
|
index: 0,
|
||||||
formobj: {
|
formobj: {
|
||||||
sid: '',
|
sid: '',
|
||||||
@@ -473,7 +474,8 @@ export default {
|
|||||||
bankAccountKey: '',
|
bankAccountKey: '',
|
||||||
settleAmount: '',
|
settleAmount: '',
|
||||||
goodsList: [],
|
goodsList: [],
|
||||||
files: []
|
files: [],
|
||||||
|
accounts: []
|
||||||
},
|
},
|
||||||
totalReceivables: '', // 商品列表中应收款总和
|
totalReceivables: '', // 商品列表中应收款总和
|
||||||
rules: {}
|
rules: {}
|
||||||
@@ -526,7 +528,7 @@ export default {
|
|||||||
this.province_list = res.data
|
this.province_list = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
getWarehouses({ createOrgSid: window.sessionStorage.getItem('orgSid') }).then((res) => {
|
getWareHouse({ createOrgSid: window.sessionStorage.getItem('orgSid') }).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.warehouse_list = res.data
|
this.warehouse_list = res.data
|
||||||
}
|
}
|
||||||
@@ -659,7 +661,7 @@ export default {
|
|||||||
},
|
},
|
||||||
customerList() {
|
customerList() {
|
||||||
this.customerLoading = true
|
this.customerLoading = true
|
||||||
this.customerQuery.params.createOrgSid = this.formobj.deptSid
|
this.customerQuery.params.createOrgSid = window.sessionStorage.getItem('orgSid')
|
||||||
chooseCustomerList(this.customerQuery).then((response) => {
|
chooseCustomerList(this.customerQuery).then((response) => {
|
||||||
this.customerLoading = false
|
this.customerLoading = false
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
@@ -706,7 +708,7 @@ export default {
|
|||||||
},
|
},
|
||||||
commodityList() {
|
commodityList() {
|
||||||
this.commodityLoading = true
|
this.commodityLoading = true
|
||||||
this.commodityQuery.params.createOrgSid = this.formobj.deptSid
|
this.commodityQuery.params.createOrgSid = window.sessionStorage.getItem('orgSid')
|
||||||
req.chooseProducts(this.commodityQuery).then((response) => {
|
req.chooseProducts(this.commodityQuery).then((response) => {
|
||||||
this.commodityLoading = false
|
this.commodityLoading = false
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
@@ -896,18 +898,18 @@ export default {
|
|||||||
if (this.bankAccount_list.length > 0) {
|
if (this.bankAccount_list.length > 0) {
|
||||||
this.bankAccount_list.forEach((e) => {
|
this.bankAccount_list.forEach((e) => {
|
||||||
aa.push({
|
aa.push({
|
||||||
name: e.dictValue,
|
bankAccount: e.dictValue,
|
||||||
sid: e.dictKey,
|
bankAccountKey: e.dictKey,
|
||||||
money: ''
|
amount: ''
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.accountList = aa
|
this.formobj.accounts = aa
|
||||||
},
|
},
|
||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
},
|
},
|
||||||
saveOrUpdate() {
|
handleSave() {
|
||||||
this.$refs['form_obj'].validate((valid) => {
|
this.$refs['form_obj'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.formobj.amount = this.yhhCompute
|
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 = {
|
this.formobj = {
|
||||||
sid: '',
|
sid: '',
|
||||||
billNo: '',
|
billNo: '',
|
||||||
@@ -993,12 +1037,14 @@ export default {
|
|||||||
bankAccountKey: '',
|
bankAccountKey: '',
|
||||||
settleAmount: '',
|
settleAmount: '',
|
||||||
goodsList: [],
|
goodsList: [],
|
||||||
files: []
|
files: [],
|
||||||
|
accounts: []
|
||||||
}
|
}
|
||||||
this.totalReceivables = ''
|
this.totalReceivables = ''
|
||||||
this.commodityData = []
|
this.commodityData = []
|
||||||
this.accountList = []
|
|
||||||
this.submitdisabled = false
|
this.submitdisabled = false
|
||||||
|
},
|
||||||
|
handleReturn() {
|
||||||
this.$store.dispatch('tagsView/delView', this.$route)
|
this.$store.dispatch('tagsView/delView', this.$route)
|
||||||
this.$router.go(-1)
|
this.$router.go(-1)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user