|
|
@ -4,7 +4,9 @@ |
|
|
|
<div class="tab-header webtop"> |
|
|
|
<div>{{ viewTitle }}</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> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -332,12 +334,12 @@ |
|
|
|
<!-- 多账户 --> |
|
|
|
<el-dialog title="多账户选择" :visible.sync="dialogVisible" width="40%" :show-close="false"> |
|
|
|
<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 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"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.money" clearable placeholder="" /> |
|
|
|
<el-input v-model="scope.row.amount" clearable placeholder="" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -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) |
|
|
|
} |
|
|
|