6 changed files with 1549 additions and 1 deletions
@ -0,0 +1,44 @@ |
|||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
export default { |
||||
|
// 查询分页列表
|
||||
|
listPage: function(params) { |
||||
|
return request({ |
||||
|
url: '/sms/apiadmin/v1/smssalesbill/listPage', |
||||
|
method: 'post', |
||||
|
data: params, |
||||
|
headers: { 'Content-Type': 'application/json' } |
||||
|
}) |
||||
|
}, |
||||
|
fetchBySid: function(data) { |
||||
|
return request({ |
||||
|
url: '/sms/apiadmin/v1/smssalesbill/fetchDetailsBySid/' + data, |
||||
|
method: 'get' |
||||
|
}) |
||||
|
}, |
||||
|
deleteBySids: function(data) { |
||||
|
return request({ |
||||
|
url: '/sms/apiadmin/v1/smssalesbill/delBySids', |
||||
|
method: 'DELETE', |
||||
|
data: data, |
||||
|
headers: { 'Content-Type': 'application/json' } |
||||
|
}) |
||||
|
}, |
||||
|
saveOrUpdate: function(data) { |
||||
|
return request({ |
||||
|
url: '/sms/apiadmin/v1/smssalesbill/save', |
||||
|
method: 'post', |
||||
|
data: data, |
||||
|
headers: { 'Content-Type': 'application/json' } |
||||
|
}) |
||||
|
}, |
||||
|
// 结算
|
||||
|
settle: function(data) { |
||||
|
return request({ |
||||
|
url: '/sms/apiadmin/v1/smssalesbill/settlement', |
||||
|
method: 'post', |
||||
|
data: data, |
||||
|
headers: { 'Content-Type': 'application/json' } |
||||
|
}) |
||||
|
} |
||||
|
} |
@ -0,0 +1,313 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<!--列表页面--> |
||||
|
<div v-show="viewState == 1"> |
||||
|
<button-bar view-title="销售单管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/> |
||||
|
<!--Start查询列表部分--> |
||||
|
<div class="main-content"> |
||||
|
<div class="searchcon"> |
||||
|
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button> |
||||
|
<div v-show="isSearchShow" class="search"> |
||||
|
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header"> |
||||
|
<el-form-item label="分公司"> |
||||
|
<el-input v-model="listQuery.params.useOrgName" placeholder="" clearable/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="制单部门"> |
||||
|
<el-input v-model="listQuery.params.deptName" placeholder="" clearable/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="制单人"> |
||||
|
<el-input v-model="listQuery.params.createByName" placeholder="" clearable/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="单据编号"> |
||||
|
<el-input v-model="listQuery.params.billNo" placeholder="" clearable/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="制单日期"> |
||||
|
<el-date-picker v-model="listQuery.params.startDate" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker> |
||||
|
<span style="padding: 0 8px">至</span> |
||||
|
<el-date-picker v-model="listQuery.params.endDate" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="客户名称"> |
||||
|
<el-input v-model="listQuery.params.customerName" placeholder="" clearable/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="车牌号"> |
||||
|
<el-input v-model="listQuery.params.vehMark" placeholder="" clearable/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="车架号"> |
||||
|
<el-input v-model="listQuery.params.vinNo" placeholder="" clearable/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="服务顾问"> |
||||
|
<el-input v-model="listQuery.params.salesName" placeholder="" clearable/> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<div class="btn" style="text-align: center;"> |
||||
|
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button> |
||||
|
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!--End查询列表部分--> |
||||
|
<div class="listtop"> |
||||
|
<div class="tit">销售单列表</div> |
||||
|
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> |
||||
|
</div> |
||||
|
<!--Start 主页面主要部分 --> |
||||
|
<div class=""> |
||||
|
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange"> |
||||
|
<el-table-column type="selection" align="center" width="50"/> |
||||
|
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center"/> |
||||
|
<el-table-column label="操作" width="180" align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button type="primary" :disabled="scope.row.state == '已结算'" size="small" @click="toEdit(scope.row)">办理</el-button> |
||||
|
<el-button type="primary" size="small" @click="toInfo(scope.row)">查看</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="billNo" label="单据编号" align="center" width="190" /> |
||||
|
<el-table-column prop="state" label="单据状态" align="center" width="120" /> |
||||
|
<el-table-column prop="useOrgName" label="分公司" align="center" width="120" /> |
||||
|
<el-table-column prop="deptName" label="制单部门" align="center" width="120" /> |
||||
|
<el-table-column prop="createByName" label="制单人" align="center" width="120" /> |
||||
|
<el-table-column prop="createTime" label="制单日期" align="center" width="120" /> |
||||
|
<el-table-column prop="salesName" label="服务顾问" align="center" width="100" /> |
||||
|
<el-table-column prop="customerName" label="客户名称" align="center" min-width="160" /> |
||||
|
<el-table-column prop="vehMark" label="车牌号" align="center" width="100" /> |
||||
|
<el-table-column prop="vinNo" label="车架号" align="center" width="100" /> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
<!--End 主页面主要部分--> |
||||
|
<div class="pages"> |
||||
|
<div class="tit"/> |
||||
|
<!-- 翻页 --> |
||||
|
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> |
||||
|
</div> |
||||
|
<!--End查询列表部分--> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!--新增及修改 --> |
||||
|
<salesticketAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="getList"/> |
||||
|
<!-- 详情 --> |
||||
|
<salesticketInfo v-show="viewState == 4" ref="divInfo" @doback="resetState" /> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import Pagination from '@/components/pagination' |
||||
|
import pageye from '@/components/pagination/pageye' |
||||
|
import ButtonBar from '@/components/ButtonBar' |
||||
|
import req from '@/api/operation/salesticket' |
||||
|
import salesticketAdd from './salesticketAdd' |
||||
|
import salesticketInfo from './salesticketInfo' |
||||
|
|
||||
|
export default { |
||||
|
name: 'SalesTicket', |
||||
|
components: { |
||||
|
Pagination, |
||||
|
pageye, |
||||
|
ButtonBar, |
||||
|
salesticketAdd, |
||||
|
salesticketInfo |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
btndisabled: false, |
||||
|
btnList: [ |
||||
|
{ |
||||
|
type: 'primary', |
||||
|
size: 'small', |
||||
|
icon: 'plus', |
||||
|
btnKey: 'toAdd', |
||||
|
btnLabel: '新增' |
||||
|
}, |
||||
|
{ |
||||
|
type: 'danger', |
||||
|
size: 'small', |
||||
|
icon: 'del', |
||||
|
btnKey: 'doDel', |
||||
|
btnLabel: '删除' |
||||
|
}, |
||||
|
{ |
||||
|
type: 'info', |
||||
|
size: 'small', |
||||
|
icon: 'cross', |
||||
|
btnKey: 'doClose', |
||||
|
btnLabel: '关闭' |
||||
|
} |
||||
|
], |
||||
|
isSearchShow: false, |
||||
|
searchxianshitit: '显示查询条件', |
||||
|
viewState: 1, // 1、列表 2、新增 3、编辑 4、查看 |
||||
|
tableKey: 0, |
||||
|
list: [], |
||||
|
sids: [], // 用于导出的时候保存已选择的SIDs |
||||
|
FormLoading: false, |
||||
|
listLoading: false, |
||||
|
// 翻页 |
||||
|
listQuery: { |
||||
|
current: 1, |
||||
|
size: 5, |
||||
|
total: 0, |
||||
|
params: { |
||||
|
useOrgName: '', |
||||
|
deptName: '', |
||||
|
createByName: '', |
||||
|
bilLNo: '', |
||||
|
startDate: '', |
||||
|
endDate: '', |
||||
|
customerName: '', |
||||
|
vehMark: '', |
||||
|
vinNo: '', |
||||
|
salesName: '', |
||||
|
orgPath: '', |
||||
|
usersid: '', |
||||
|
menuUrl: '' |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
// 初始化变量 |
||||
|
this.getList() |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.$refs['btnbar'].setButtonList(this.btnList) |
||||
|
}, |
||||
|
methods: { |
||||
|
// 搜索条件效果 |
||||
|
clicksearchShow() { |
||||
|
this.isSearchShow = !this.isSearchShow |
||||
|
if (this.isSearchShow) { |
||||
|
this.searchxianshitit = '隐藏查询条件' |
||||
|
} else { |
||||
|
this.searchxianshitit = '显示查询条件' |
||||
|
} |
||||
|
}, |
||||
|
btnHandle(btnKey) { |
||||
|
console.log('XXXXXXXXXXXXXXX ' + btnKey) |
||||
|
switch (btnKey) { |
||||
|
case 'toAdd': |
||||
|
this.toAdd() |
||||
|
break |
||||
|
case 'doDel': |
||||
|
this.doDel() |
||||
|
break |
||||
|
case 'doClose': |
||||
|
this.doClose() |
||||
|
break |
||||
|
default: |
||||
|
break |
||||
|
} |
||||
|
}, |
||||
|
// 信息条数 获取点击时当前的sid |
||||
|
handleSelectionChange(row) { |
||||
|
const aa = [] |
||||
|
row.forEach(element => { |
||||
|
aa.push(element.sid) |
||||
|
}) |
||||
|
this.sids = aa |
||||
|
}, |
||||
|
// 表中序号 |
||||
|
indexMethod(index) { |
||||
|
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
||||
|
var pageindex = index + 1 + pagestart |
||||
|
return pageindex |
||||
|
}, |
||||
|
// 查询列表信息 |
||||
|
getList() { |
||||
|
this.listLoading = true |
||||
|
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid') |
||||
|
this.listQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath') |
||||
|
this.listQuery.params.menuUrl = this.$route.path |
||||
|
req.listPage(this.listQuery).then(response => { |
||||
|
this.listLoading = false |
||||
|
if (response.success) { |
||||
|
this.list = response.data.records |
||||
|
this.listQuery.total = response.data.total |
||||
|
} else { |
||||
|
this.list = [] |
||||
|
this.listQuery.total = 0 |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 查询按钮 |
||||
|
handleFilter() { |
||||
|
this.listQuery.current = 1 |
||||
|
this.getList() |
||||
|
}, |
||||
|
// 点击重置 |
||||
|
handleReset() { |
||||
|
this.listQuery = { |
||||
|
current: 1, |
||||
|
size: 5, |
||||
|
total: 0, |
||||
|
params: { |
||||
|
useOrgName: '', |
||||
|
deptName: '', |
||||
|
createByName: '', |
||||
|
bilLNo: '', |
||||
|
startDate: '', |
||||
|
endDate: '', |
||||
|
customerName: '', |
||||
|
vehMark: '', |
||||
|
vinNo: '', |
||||
|
salesName: '', |
||||
|
orgPath: '', |
||||
|
usersid: '', |
||||
|
menuUrl: '' |
||||
|
} |
||||
|
} |
||||
|
this.getList() |
||||
|
}, |
||||
|
toAdd() { |
||||
|
this.viewState = 2 |
||||
|
this.$refs['divAdd'].showAdd() |
||||
|
}, |
||||
|
toEdit(row) { |
||||
|
this.viewState = 3 |
||||
|
this.$refs['divAdd'].showEdit(row) |
||||
|
}, |
||||
|
toInfo(row) { |
||||
|
this.viewState = 4 |
||||
|
this.$refs['divInfo'].showInfo(row) |
||||
|
}, |
||||
|
// 删除 |
||||
|
doDel() { |
||||
|
if (this.sids.length === 0) { |
||||
|
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' }) |
||||
|
return |
||||
|
} |
||||
|
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?' |
||||
|
this.$confirm(tip, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
const loading = this.$loading({ |
||||
|
lock: true, |
||||
|
text: 'Loading', |
||||
|
spinner: 'el-icon-loading', |
||||
|
background: 'rgba(0, 0, 0, 0.7)' |
||||
|
}) |
||||
|
req.deleteBySids(this.sids).then((resp) => { |
||||
|
if (resp.success) { |
||||
|
this.$message({ type: 'success', message: resp.msg, showClose: true }) |
||||
|
} |
||||
|
this.getList() |
||||
|
loading.close() |
||||
|
}).catch(e => { |
||||
|
loading.close() |
||||
|
}) |
||||
|
}).catch(() => { |
||||
|
}) |
||||
|
}, |
||||
|
// 修改、编辑、详情返回列表页面 |
||||
|
resetState() { |
||||
|
this.viewState = 1 |
||||
|
}, |
||||
|
doClose() { |
||||
|
this.$store.dispatch('tagsView/delView', this.$route) |
||||
|
this.$router.go(-1) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
</style> |
@ -0,0 +1,827 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<div v-show="viewState == 1"> |
||||
|
<div class="tab-header webtop"> |
||||
|
<div>{{ viewTitle }}</div> |
||||
|
<div> |
||||
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="selectCustomer()">选择客户</el-button> |
||||
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button> |
||||
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="settleAccounts()">结算</el-button> |
||||
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="listconadd"> |
||||
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
||||
|
<el-row style="border-top: 1px solid #e0e3eb"> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">制单人</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">制单部门</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">制单日期</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty"><span class="icon">*</span>服务顾问</div> |
||||
|
<el-form-item prop="salesName"> |
||||
|
<el-select class="addinputInfo" v-model="formobj.salesName" placeholder="请选择" @change="waitorChange" clearable filterable> |
||||
|
<el-option v-for="item in user_list" :key="item.sid" :label="item.name" :value="item.name"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="16"> |
||||
|
<div class="span-sty"><span class="icon">*</span>科目</div> |
||||
|
<el-form-item prop="subject"> |
||||
|
<el-select class="addinputInfo" v-model="formobj.subject" placeholder="请选择" @change="changeSubject" clearable filterable> |
||||
|
<el-option v-for="item in subject_list" :key="item.subjectSid" :label="item.subject" :value="item.subject"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<div class="span-sty">快捷备注</div> |
||||
|
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.shotRemarks" clearable placeholder="" /></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<div class="span-sty">备注(打印)</div> |
||||
|
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.printRemarks" clearable placeholder="" /></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<div class="span-sty">备注</div> |
||||
|
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.remarks" clearable placeholder="" /></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-collapse v-model="activeNames"> |
||||
|
<el-collapse-item title="客户信息" name="1"> |
||||
|
<el-row style="border-top: 1px solid #e0e3eb"> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty"><span class="icon">*</span>客户</div> |
||||
|
<el-form-item prop="customerName"><span class="addinputInfo">{{ formobj.customerName }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">联系电话</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.mobile }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">车牌号/车架号</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.vehMark }}/{{ formobj.vinNo }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<div class="span-sty">客户单位</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.customerOrg }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-collapse-item> |
||||
|
<el-collapse-item title="发票信息" name="2"> |
||||
|
<el-row style="border-top: 1px solid #e0e3eb"> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">是否开发票</div> |
||||
|
<el-form-item> |
||||
|
<el-radio-group class="addinputInfo" style="font-size: 1px" v-model="formobj.invoiceVo.isInvoicing"> |
||||
|
<el-radio label="1">是</el-radio> |
||||
|
<el-radio label="0">否</el-radio> |
||||
|
</el-radio-group> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">发票类型</div> |
||||
|
<el-form-item> |
||||
|
<el-select class="addinputInfo" :disabled="formobj.invoiceVo.isInvoicing != '1'" v-model="formobj.invoiceVo.invoiceType" placeholder="请选择" @change="invoiceTypeChange" clearable filterable> |
||||
|
<el-option v-for="item in invoiceType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">开票名称</div> |
||||
|
<el-form-item><el-input class="addinputInfo addinputw" :disabled="formobj.invoiceVo.isInvoicing != '1'" v-model="formobj.invoiceVo.invoiceTitle" clearable placeholder="" /></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">税号</div> |
||||
|
<el-form-item><el-input class="addinputInfo addinputw" :disabled="formobj.invoiceVo.isInvoicing != '1'" v-model="formobj.invoiceVo.taxpayerNo" clearable placeholder="" /></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="16"> |
||||
|
<div class="span-sty">税率(%)</div> |
||||
|
<el-form-item><el-input class="addinputInfo addinputw" :disabled="formobj.invoiceVo.isInvoicing != '1'" @keyup.native="formobj.invoiceVo.taxRate = getNumber(formobj.invoiceVo.taxRate, 2)" v-model="formobj.invoiceVo.taxRate" clearable placeholder="" /></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-collapse-item> |
||||
|
</el-collapse> |
||||
|
<div class="title titleOne"> |
||||
|
<div>商品</div> |
||||
|
<el-button type="primary" size="mini" @click="commodityAdd">添加</el-button> |
||||
|
</div> |
||||
|
<el-table :key="commodityKey" :data="formobj.goodsVos" :index="index" border style="width: 100%"> |
||||
|
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center" /> |
||||
|
<el-table-column fixed label="操作" align="center" width="70"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button type="danger" size="small" @click="commodityDelete(scope.$index)">删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="商品名称" width="200" align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-popover placement="right" width="500" trigger="click"> |
||||
|
<div> |
||||
|
<el-table :data="commodityData" v-loading="commodityLoading" highlight-current-row @current-change="commodityCurrentChange($event, scope.row)"> |
||||
|
<el-table-column fixed prop="goodsSpuName" label="商品名称" align="center" /> |
||||
|
<el-table-column prop="goodsSkuCode" label="图号" align="center" /> |
||||
|
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" /> |
||||
|
<el-table-column prop="unit" label="单位" align="center" /> |
||||
|
</el-table> |
||||
|
<el-pagination :page.sync="commodityQuery.current" :page-size="commodityQuery.size" layout="total, pager" :total="commodityQuery.total" /> |
||||
|
</div> |
||||
|
<el-input slot="reference" v-model="scope.row.goodsSpuName" @input="commodityInput(scope.row.goodsSpuName)" clearable placeholder="商品名称"/> |
||||
|
</el-popover> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="goodsSkuCode" label="图号" width="100" align="center" /> |
||||
|
<el-table-column prop="goodsSkuOwnSpec" label="规格" width="100" align="center" /> |
||||
|
<el-table-column prop="unit" label="单位" width="100" align="center" /> |
||||
|
<el-table-column prop="supplierName" label="厂家" width="100" align="center" /> |
||||
|
<el-table-column prop="currentCount" label="库存" width="100" align="center" /> |
||||
|
<el-table-column label="销售价" align="center" width="150"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.price" @keyup.native="scope.row.price = getNumber(scope.row.price, 2)" clearable placeholder="" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="数量" align="center" width="100"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.count" @keyup.native="scope.row.count = getNumber(scope.row.count, 2)" clearable placeholder="" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="折扣" align="center" width="100"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input @input="computeYHAndXSJE(scope.row)" v-model="scope.row.discount" @keyup.native="scope.row.discount = getNumber(scope.row.discount, 2)" clearable placeholder="" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="discountAmount" label="优惠" width="100" align="center" /> |
||||
|
<el-table-column prop="amount" label="金额" width="100" align="center" /> |
||||
|
<el-table-column label="备注" align="center" min-width="300"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.remarks" clearable placeholder="" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div class="title titleOne"> |
||||
|
<div>附加项目</div> |
||||
|
<el-button type="primary" size="mini" @click="subjoinAdd">添加</el-button> |
||||
|
</div> |
||||
|
<el-table :key="subjoinKey" :data="formobj.aitemVos" :index="index" border style="width: 100%"> |
||||
|
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
||||
|
<el-table-column fixed label="操作" align="center" width="70"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button type="danger" size="small" @click="subjoinDelete(scope.$index)">删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="附加项目" align="center" width="200"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-popover placement="right" width="500" trigger="click"> |
||||
|
<div> |
||||
|
<el-table :data="subjoinData" v-loading="subjoinLoading" highlight-current-row @current-change="subjoinCurrentChange($event, scope.row)"> |
||||
|
<el-table-column fixed prop="aitemName" label="项目名称" align="center" /> |
||||
|
<el-table-column prop="aitemCode" label="拼音缩写" align="center" /> |
||||
|
<el-table-column prop="price" label="销售金额" align="center" /> |
||||
|
</el-table> |
||||
|
<el-pagination :page.sync="subjoinQuery.current" :page-size="subjoinQuery.size" layout="total, pager" :total="subjoinQuery.total" /> |
||||
|
</div> |
||||
|
<el-input slot="reference" v-model="scope.row.aitemName" @input="subjoinInput(scope.row.aitemName)" clearable placeholder="项目名称、拼音"/> |
||||
|
</el-popover> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="销售价" align="center" width="150"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.price" @keyup.native="scope.row.price = getNumber(scope.row.price, 2)" clearable placeholder="" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="备注" align="center" min-width="200"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.remarks" clearable placeholder="" /> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<div class="span-sty" style="border-right: 0px">合计金额:</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ jeTotal }} = 材料费:{{ clfTotal }} + 附加费:{{ fjfTotal }} + 税额:{{ seTotal }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<div class="span-sty" style="border-right: 0px">应收金额:</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ ysjeTotal }} = 合计金额:{{ jeTotal }} - 优惠:<el-input style="width: 100px" v-model="formobj.discountAmount" @keyup.native="formobj.discountAmount = getNumber(formobj.discountAmount, 2)" clearable placeholder="" /></span></el-form-item> |
||||
|
<!-- - 优惠券:<el-input style="width: 100px" v-model="formobj.coupon" @keyup.native="formobj.coupon = getNumber(formobj.coupon, 2)" clearable placeholder="" /> - 积分抵扣:<el-input style="width: 100px" v-model="formobj.scoreDeduct" @keyup.native="formobj.scoreDeduct = getNumber(formobj.scoreDeduct, 2)" clearable placeholder="" />--> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 选择客户 --> |
||||
|
<customer v-show="viewState == 2" ref="divCus" @backData="backData" @doback="resetState"/> |
||||
|
<!-- 结算 --> |
||||
|
<el-dialog :visible.sync="settleVisible" width="70%"> |
||||
|
<el-form ref="formobj" :model="formobj" :rules="rules" class="formaddcopy02"> |
||||
|
<el-row style="border-top: 1px solid #e0e3eb"> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty"><span class="icon">*</span>付款人姓名</div> |
||||
|
<el-form-item prop="settlementVo.payerName"><el-input class="addinputInfo addinputw" v-model="formobj.settlementVo.payerName" clearable placeholder="" /></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">付款人编号</div> |
||||
|
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.settlementVo.payerNo" clearable placeholder="" /></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">应收金额</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ ysjeTotal }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">订金抵扣</div> |
||||
|
<el-form-item><el-input class="addinputInfo addinputw" @keyup.native="formobj.settlementVo.depositdeductAmount = getNumber(formobj.settlementVo.depositdeductAmount, 2)" v-model="formobj.settlementVo.depositdeductAmount" clearable placeholder="" /></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty"><span class="icon">*</span>结算方式</div> |
||||
|
<el-form-item prop="settlementVo.settleValue"> |
||||
|
<el-select class="addinputInfo" v-model="formobj.settlementVo.settleValue" placeholder="请选择" @change="settleChange" clearable filterable> |
||||
|
<el-option v-for="item in settle_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty"><span class="icon">*</span>结算金额</div> |
||||
|
<el-form-item prop="settlementVo.settleAmount"><el-input class="addinputInfo addinputw" @keyup.native="formobj.settlementVo.settleAmount = getNumber(formobj.settlementVo.settleAmount, 2)" v-model="formobj.settlementVo.settleAmount" clearable placeholder="" /></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">其他结算方式</div> |
||||
|
<el-form-item> |
||||
|
<el-select class="addinputInfo" v-model="formobj.settlementVo.otherSettleValue" placeholder="请选择" @change="otherSettleChange" clearable filterable> |
||||
|
<el-option v-for="item in otherSettle_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">其他结算金额</div> |
||||
|
<el-form-item><el-input class="addinputInfo addinputw" @keyup.native="formobj.settlementVo.otherSettleAmount = getNumber(formobj.settlementVo.otherSettleAmount, 2)" v-model="formobj.settlementVo.otherSettleAmount" clearable placeholder="" /></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">欠款金额</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ qkjeTotal }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<div class="span-sty"><span class="icon">*</span>结算时间</div> |
||||
|
<el-form-item prop="settlementVo.settleTime"><el-date-picker class="addinputInfo addinputw" v-model="formobj.settlementVo.settleTime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期" /></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<div style="text-align:center;margin-top: 20px;"> |
||||
|
<el-button type="primary" size="mini" @click="confirm">确 定</el-button> |
||||
|
<el-button type="info " size="mini" @click="settleVisible = false">取 消</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import req from '@/api/operation/salesticket' |
||||
|
import additionitem from '@/api/basicinformation/additionitem' |
||||
|
import { selAllByOrgSidPath, selSubjectInfo, typeValues, listPageSales, getOrgSidByPath } from '@/api/Common/dictcommons' |
||||
|
import customer from '../preregistration/relation/customer' |
||||
|
|
||||
|
export default { |
||||
|
name: 'SalesTicketAdd', |
||||
|
components: { |
||||
|
customer |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
viewTitle: '', |
||||
|
viewState: 1, |
||||
|
submitdisabled: false, |
||||
|
user_list: [], // 服务顾问 |
||||
|
subject_list: [], // 科目 |
||||
|
settleVisible: false, // 结算弹框 |
||||
|
invoiceType_list: [], // 发票类型 |
||||
|
settle_list: [], // 结算方式 |
||||
|
otherSettle_list: [], // 其他结算方式 |
||||
|
activeNames: '1', |
||||
|
index: 0, |
||||
|
// commodity商品 |
||||
|
commodityKey: 1, |
||||
|
commodityLoading: false, |
||||
|
commodityQuery: { |
||||
|
current: 1, |
||||
|
size: 2, |
||||
|
total: 0, |
||||
|
params: { |
||||
|
goodsName: '', |
||||
|
useOrgSid: '' |
||||
|
} |
||||
|
}, |
||||
|
commodityData: [], |
||||
|
// subjoin附加项目 |
||||
|
subjoinKey: 2, |
||||
|
subjoinLoading: false, |
||||
|
subjoinQuery: { |
||||
|
current: 1, |
||||
|
size: 2, |
||||
|
total: 0, |
||||
|
params: { |
||||
|
aitemName: '', |
||||
|
orgPath: '' |
||||
|
} |
||||
|
}, |
||||
|
subjoinData: [], |
||||
|
formobj: { |
||||
|
sid: '', |
||||
|
createTime: '', |
||||
|
createByName: '', |
||||
|
createBySid: '', |
||||
|
customerName: '', |
||||
|
customerSid: '', |
||||
|
deptName: '', |
||||
|
deptSid: '', |
||||
|
mobile: '', |
||||
|
vehMark: '', |
||||
|
vinNo: '', |
||||
|
billNo: '', |
||||
|
subjectSid: '', |
||||
|
subject: '', |
||||
|
salesUserSid: '', |
||||
|
salesName: '', |
||||
|
shotRemarks: '', |
||||
|
printRemarks: '', |
||||
|
discountAmount: '', |
||||
|
coupon: '', |
||||
|
scoreDeduct: '', |
||||
|
customerOrg: '', |
||||
|
receivableAmount: '', |
||||
|
invoiceVo: { |
||||
|
isInvoicing: '', |
||||
|
invoiceType: '', |
||||
|
invoiceTypeKey: '', |
||||
|
invoiceTitle: '', |
||||
|
taxpayerNo: '', |
||||
|
invoiceCode: '', |
||||
|
taxRate: '' |
||||
|
}, |
||||
|
aitemVos: [], |
||||
|
goodsVos: [], |
||||
|
settlementVo: { |
||||
|
payerNo: '', |
||||
|
payerName: '', |
||||
|
receivableAmount: '', |
||||
|
depositdeductAmount: '', |
||||
|
settleKey: '', |
||||
|
settleValue: '', |
||||
|
settleAmount: '', |
||||
|
otherSettleKey: '', |
||||
|
otherSettleValue: '', |
||||
|
otherSettleAmount: '', |
||||
|
debts: '', |
||||
|
settleTime: '' |
||||
|
} |
||||
|
}, |
||||
|
rules: { |
||||
|
salesName: [{ required: true, message: '服务顾问不能为空', trigger: 'change' }], |
||||
|
subject: [{ required: true, message: '科目不能为空', trigger: 'change' }] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
// 计算材料费 = 商品列表中所有销售价之和 |
||||
|
clfTotal() { |
||||
|
let clf = '0' |
||||
|
if (this.formobj.goodsVos.length > 0) { |
||||
|
this.formobj.goodsVos.forEach((e) => { |
||||
|
if (e.goodsSpuName !== '') { |
||||
|
clf = Math.round((parseFloat(clf) + parseFloat(e.price !== '' ? e.price : '0')) * 100) / 100 |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
return clf |
||||
|
}, |
||||
|
// 计算附加费 == 附加项目列表中所有销售价之和 |
||||
|
fjfTotal() { |
||||
|
let fjf = '0' |
||||
|
if (this.formobj.aitemVos.length > 0) { |
||||
|
this.formobj.aitemVos.forEach((e) => { |
||||
|
if (e.aitemName !== '') { |
||||
|
fjf = Math.round((parseFloat(fjf) + parseFloat(e.price !== '' ? e.price : '0')) * 100) / 100 |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
return fjf |
||||
|
}, |
||||
|
// 计算税额 = 材料费 * 税率 |
||||
|
seTotal() { |
||||
|
let se = '0' |
||||
|
se = Math.round((parseFloat(this.clfTotal) * (parseFloat(this.formobj.invoiceVo.taxRate !== '' ? this.formobj.invoiceVo.taxRate : '0') / 100)) * 100) / 100 |
||||
|
return se |
||||
|
}, |
||||
|
// 计算合计金额 = 工时费 + 材料费 + 附加费 + 税额 |
||||
|
jeTotal() { |
||||
|
let je = '0' |
||||
|
je = Math.round((parseFloat(je) + parseFloat(this.clfTotal) + parseFloat(this.fjfTotal) + parseFloat(this.seTotal)) * 100) / 100 |
||||
|
return je |
||||
|
}, |
||||
|
// 计算应收金额 |
||||
|
ysjeTotal() { |
||||
|
let ysje = '0' |
||||
|
ysje = Math.round((parseFloat(ysje) + parseFloat(this.jeTotal) - parseFloat(this.formobj.discountAmount !== '' ? this.formobj.discountAmount : '0')) * 100) / 100 |
||||
|
// - parseFloat(this.formobj.coupon !== '' ? this.formobj.coupon : '0') - parseFloat(this.formobj.scoreDeduct !== '' ? this.formobj.scoreDeduct : '0') |
||||
|
return ysje |
||||
|
}, |
||||
|
// 结算页面中计算欠款金额 = 应付金额 - 订金抵扣 - 结算金额 - 其他结算金额 |
||||
|
qkjeTotal() { |
||||
|
let qkje = '0' |
||||
|
qkje = Math.round((parseFloat(this.ysjeTotal) - parseFloat(this.formobj.settlementVo.depositdeductAmount !== '' ? this.formobj.settlementVo.depositdeductAmount : '0') - parseFloat(this.formobj.settlementVo.settleAmount !== '' ? this.formobj.settlementVo.settleAmount : '0') - parseFloat(this.formobj.settlementVo.otherSettleAmount !== '' ? this.formobj.settlementVo.otherSettleAmount : '0')) * 100) / 100 |
||||
|
return qkje |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
init() { |
||||
|
typeValues({ type: 'billingType' }).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.invoiceType_list = res.data |
||||
|
} |
||||
|
}) |
||||
|
typeValues({ type: 'settle' }).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.settle_list = res.data |
||||
|
} |
||||
|
}) |
||||
|
typeValues({ type: 'otherSettle' }).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.otherSettle_list = res.data |
||||
|
} |
||||
|
}) |
||||
|
selSubjectInfo({ useOrgSid: window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) }).then((resp) => { |
||||
|
if (resp.success) { |
||||
|
this.subject_list = resp.data |
||||
|
} |
||||
|
}) |
||||
|
selAllByOrgSidPath({ orgSidPath: window.sessionStorage.getItem('defaultOrgPath') }).then((resp) => { |
||||
|
if (resp.success) { |
||||
|
this.user_list = resp.data |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
getNumber(val, limit) { |
||||
|
val = val.replace(/[^0-9.]/g, '') // 保留数字 |
||||
|
val = val.replace(/^00/, '0.') // 开头不能有两个0 |
||||
|
val = val.replace(/^\./g, '0.') // 开头为小数点转换为0. |
||||
|
val = val.replace(/\.{2,}/g, '.') // 两个以上的小数点转换成一个 |
||||
|
val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); // 只保留一个小数点 |
||||
|
/^0\d+/.test(val) ? val = val.slice(1) : '' // 两位以上数字开头不能为0 |
||||
|
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$' |
||||
|
const reg = new RegExp(str) |
||||
|
if (limit === 0) { |
||||
|
// 不需要小数点 |
||||
|
val = val.replace(reg, '$1') |
||||
|
} else { |
||||
|
// 通过正则保留小数点后指定的位数 |
||||
|
val = val.replace(reg, '$1.$2') |
||||
|
} |
||||
|
return val |
||||
|
}, |
||||
|
showAdd() { |
||||
|
this.viewTitle = '【新增】商品销售单' |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs['form_obj'].clearValidate() |
||||
|
}) |
||||
|
this.init() |
||||
|
this.formobj.createByName = window.sessionStorage.getItem('name') |
||||
|
this.formobj.createBySid = window.sessionStorage.getItem('userSid') |
||||
|
this.formobj.deptName = window.sessionStorage.getItem('defaultOrgPathName').substring(window.sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1) |
||||
|
this.formobj.deptSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) |
||||
|
var nowDate = new Date() |
||||
|
var date = { |
||||
|
year: nowDate.getFullYear(), |
||||
|
month: nowDate.getMonth() + 1, |
||||
|
day: nowDate.getDate() |
||||
|
} |
||||
|
this.formobj.createTime = date.year + '-' + (date.month >= 10 ? date.month : '0' + date.month) + '-' + (date.day >= 10 ? date.day : '0' + date.day) |
||||
|
getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.formobj.createOrgSid = res.data |
||||
|
this.formobj.useOrgSid = res.data |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
showEdit(row) { |
||||
|
this.viewTitle = '【编辑】商品销售单' |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs['form_obj'].clearValidate() |
||||
|
}) |
||||
|
this.init() |
||||
|
req.fetchBySid(row.sid).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.formobj = res.data |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
selectCustomer() { |
||||
|
this.viewState = 2 |
||||
|
this.$refs['divCus'].getList() |
||||
|
}, |
||||
|
backData(value) { |
||||
|
this.viewState = 1 |
||||
|
value = JSON.parse(JSON.stringify(value)) |
||||
|
this.formobj.customerName = value.name |
||||
|
this.formobj.customerSid = value.sid |
||||
|
this.formobj.mobile = value.mobile |
||||
|
this.formobj.vehMark = value.vehMark |
||||
|
this.formobj.vinNo = value.vinNo |
||||
|
this.formobj.customerOrg = value.orgName |
||||
|
}, |
||||
|
changeSubject(value) { |
||||
|
const choose = this.subject_list.filter((item) => item.subject === value) |
||||
|
if (choose.length > 0 && choose !== null) { |
||||
|
this.formobj.subjectSid = choose[0].subjectSid |
||||
|
} else { |
||||
|
this.formobj.subjectSid = '' |
||||
|
} |
||||
|
}, |
||||
|
waitorChange(value) { |
||||
|
const choose = this.user_list.filter((item) => item.name === value) |
||||
|
if (choose.length > 0 && choose !== null) { |
||||
|
this.formobj.salesUserSid = choose[0].sid |
||||
|
} else { |
||||
|
this.formobj.salesUserSid = '' |
||||
|
} |
||||
|
}, |
||||
|
invoiceTypeChange(value) { |
||||
|
const choose = this.invoiceType_list.filter((item) => item.dictValue === value) |
||||
|
if (choose.length > 0 && choose !== null) { |
||||
|
this.formobj.invoiceVo.invoiceTypeKey = choose[0].dictKey |
||||
|
} else { |
||||
|
this.formobj.invoiceVo.invoiceTypeKey = '' |
||||
|
} |
||||
|
}, |
||||
|
commodityAdd() { |
||||
|
this.formobj.goodsVos.push({ |
||||
|
goodSpuSid: '', |
||||
|
goodsSkuSid: '', |
||||
|
goodsSpuName: '', // 商品名称 |
||||
|
goodsSkuCode: '', // 商品编码(图号) |
||||
|
goodsSkuownSpec: '', // 规格型号 |
||||
|
unit: '', // 计量单位 |
||||
|
warehouseName: '', // 仓库名称 |
||||
|
warehouseRackCode: '', // 库位编号 |
||||
|
count: '', // 出/退库数量 |
||||
|
price: '', // 销售价 |
||||
|
discount: '', // 折扣(0-10,0免费,10不打折) |
||||
|
discountAmount: '', // 优惠金额 (=销售价*(1-折扣*0.1) ) |
||||
|
amount: '', // 金额(销售价-优惠金额) |
||||
|
remarks: '', |
||||
|
currentCount: '', // 库存数量 |
||||
|
supplierName: '', // 厂家 |
||||
|
goodsID: '' // 商品ID |
||||
|
}) |
||||
|
}, |
||||
|
commodityInput(value) { |
||||
|
this.commodityQuery.params.useOrgSid = this.formobj.deptSid |
||||
|
this.commodityQuery.params.goodsName = value |
||||
|
this.commodityLoading = true |
||||
|
listPageSales(this.commodityQuery).then((response) => { |
||||
|
if (response.success) { |
||||
|
this.commodityLoading = false |
||||
|
this.commodityData = response.data.records |
||||
|
this.commodityQuery.total = response.data.total |
||||
|
} else { |
||||
|
this.commodityLoading = false |
||||
|
this.commodityData = [] |
||||
|
this.commodityQuery.total = 0 |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
commodityCurrentChange(value, row) { |
||||
|
row.goodSpuSid = value.goodSpuSid |
||||
|
row.goodsSkuSid = value.goodsSkuSid |
||||
|
row.goodsSpuName = value.goodsSpuName |
||||
|
row.goodsSkuCode = value.goodsSkuCode |
||||
|
row.goodsSkuownSpec = value.goodsSkuownSpec |
||||
|
row.unit = value.unit |
||||
|
row.warehouseName = '' |
||||
|
row.warehouseRackCode = '' |
||||
|
row.count = value.count |
||||
|
row.price = value.price |
||||
|
row.discount = '' |
||||
|
row.discountAmount = '' |
||||
|
row.amount = '' |
||||
|
row.remarks = '' |
||||
|
row.currentCount = value.currentCount |
||||
|
row.supplierName = value.supplierName |
||||
|
row.goodsID = value.goodsID |
||||
|
document.body.click() |
||||
|
}, |
||||
|
commodityDelete(index) { |
||||
|
this.formobj.goodsVos.splice(index, 1) |
||||
|
}, |
||||
|
// 计算优惠、销售金额 |
||||
|
computeYHAndXSJE(row) { |
||||
|
// 计算优惠(销售价 * (1 - (折扣 * 0.1))) |
||||
|
row.discountAmount = Math.round((parseFloat(row.price === '' ? '0' : row.price) * Math.round((parseFloat(1) - parseFloat(row.discount === '' ? '0' : row.discount) * parseFloat(0.1)) * 100) / 100) * 100) / 100 |
||||
|
// 计算销售金额(销售价 - 优惠) |
||||
|
if (row.price == 0) { |
||||
|
row.amount = '0' |
||||
|
} else { |
||||
|
row.amount = Math.round((parseFloat(row.price === '' ? '0' : row.price) - parseFloat(row.discountAmount === '' ? '0' : row.discountAmount)) * 100) / 100 |
||||
|
} |
||||
|
}, |
||||
|
subjoinAdd() { |
||||
|
this.formobj.aitemVos.push({ |
||||
|
aitemSid: '', |
||||
|
aitemName: '', |
||||
|
price: '' |
||||
|
}) |
||||
|
}, |
||||
|
subjoinInput(value) { |
||||
|
this.subjoinQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath') |
||||
|
this.subjoinQuery.params.aitemName = value |
||||
|
this.subjoinLoading = true |
||||
|
additionitem.listPage(this.subjoinQuery).then((response) => { |
||||
|
if (response.success) { |
||||
|
this.subjoinLoading = false |
||||
|
this.subjoinData = response.data.records |
||||
|
this.subjoinQuery.total = response.data.total |
||||
|
} else { |
||||
|
this.subjoinLoading = false |
||||
|
this.subjoinData = [] |
||||
|
this.subjoinQuery.total = 0 |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
subjoinDelete(index) { |
||||
|
this.formobj.aitemVos.splice(index, 1) |
||||
|
}, |
||||
|
subjoinCurrentChange(value, row) { |
||||
|
row.aitemSid = value.sid |
||||
|
row.aitemName = value.aitemName |
||||
|
row.price = value.price |
||||
|
document.body.click() |
||||
|
}, |
||||
|
saveOrUpdate() { |
||||
|
this.$refs['form_obj'].validate((valid) => { |
||||
|
if (valid) { |
||||
|
this.formobj.receivableAmount = this.ysjeTotal |
||||
|
this.submitdisabled = true |
||||
|
req.saveOrUpdate(this.formobj).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.$message({ showClose: true, type: 'success', message: '保存成功' }) |
||||
|
this.handleReturn('true') |
||||
|
} else { |
||||
|
this.submitdisabled = false |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
this.submitdisabled = false |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
settleAccounts() { |
||||
|
this.settleVisible = true |
||||
|
}, |
||||
|
settleChange(value) { |
||||
|
const choose = this.settle_list.filter((item) => item.dictValue === value) |
||||
|
if (choose.length > 0 && choose !== null) { |
||||
|
this.formobj.settlementVo.settleKey = choose[0].dictKey |
||||
|
} else { |
||||
|
this.formobj.settlementVo.settleKey = '' |
||||
|
} |
||||
|
}, |
||||
|
otherSettleChange(value) { |
||||
|
const choose = this.otherSettle_list.filter((item) => item.dictValue === value) |
||||
|
if (choose.length > 0 && choose !== null) { |
||||
|
this.formobj.settlementVo.otherSettleKey = choose[0].dictKey |
||||
|
} else { |
||||
|
this.formobj.settlementVo.otherSettleKey = '' |
||||
|
} |
||||
|
}, |
||||
|
confirm() { |
||||
|
this.$refs['form_obj'].validate((valid) => { |
||||
|
if (valid) { |
||||
|
if (this.formobj.customerName === '') { |
||||
|
this.$message({ showClose: true, type: 'error', message: '客户信息不能为空' }) |
||||
|
return |
||||
|
} |
||||
|
if (this.formobj.goodsVos.length === 0) { |
||||
|
this.$message({ showClose: true, type: 'error', message: '商品列表不能为空' }) |
||||
|
return |
||||
|
} |
||||
|
this.formobj.receivableAmount = this.ysjeTotal |
||||
|
this.submitdisabled = true |
||||
|
req.settle(this.formobj).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.$message({ showClose: true, type: 'success', message: '结算成功' }) |
||||
|
this.handleReturn('true') |
||||
|
} else { |
||||
|
this.submitdisabled = false |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
this.submitdisabled = false |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
resetState() { |
||||
|
this.viewState = 1 |
||||
|
}, |
||||
|
handleReturn(isreload) { |
||||
|
if (isreload === 'true') this.$emit('reloadlist') |
||||
|
this.formobj = { |
||||
|
sid: '', |
||||
|
createTime: '', |
||||
|
createByName: '', |
||||
|
createBySid: '', |
||||
|
customerName: '', |
||||
|
customerSid: '', |
||||
|
deptName: '', |
||||
|
deptSid: '', |
||||
|
mobile: '', |
||||
|
vehMark: '', |
||||
|
vinNo: '', |
||||
|
billNo: '', |
||||
|
subjectSid: '', |
||||
|
subject: '', |
||||
|
salesUserSid: '', |
||||
|
salesName: '', |
||||
|
shotRemarks: '', |
||||
|
printRemarks: '', |
||||
|
discountAmount: '', |
||||
|
coupon: '', |
||||
|
scoreDeduct: '', |
||||
|
customerOrg: '', |
||||
|
receivableAmount: '', |
||||
|
invoiceVo: { |
||||
|
isInvoicing: '', |
||||
|
invoiceType: '', |
||||
|
invoiceTypeKey: '', |
||||
|
invoiceTitle: '', |
||||
|
taxpayerNo: '', |
||||
|
invoiceCode: '', |
||||
|
taxRate: '' |
||||
|
}, |
||||
|
aitemVos: [], |
||||
|
goodsVos: [], |
||||
|
settlementVo: { |
||||
|
payerNo: '', |
||||
|
payerName: '', |
||||
|
receivableAmount: '', |
||||
|
depositdeductAmount: '', |
||||
|
settleKey: '', |
||||
|
settleValue: '', |
||||
|
settleAmount: '', |
||||
|
otherSettleKey: '', |
||||
|
otherSettleValue: '', |
||||
|
otherSettleAmount: '', |
||||
|
debts: '', |
||||
|
settleTime: '' |
||||
|
} |
||||
|
} |
||||
|
this.settleVisible = false |
||||
|
this.submitdisabled = false |
||||
|
this.$emit('doback') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.span-sty { |
||||
|
width: 130px !important; |
||||
|
} |
||||
|
.addinputInfo { |
||||
|
margin-left: 120px !important; |
||||
|
} |
||||
|
/deep/ .el-form-item__error { |
||||
|
margin-left: 120px !important; |
||||
|
} |
||||
|
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw { |
||||
|
margin-left: 120px !important; |
||||
|
width: calc(100% - 115px); |
||||
|
} |
||||
|
.titleOne { |
||||
|
padding: 7px; |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,346 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<div v-show="viewState == 1"> |
||||
|
<div class="tab-header webtop"> |
||||
|
<div>{{ viewTitle }}</div> |
||||
|
<div> |
||||
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="listconadd"> |
||||
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
||||
|
<el-row style="border-top: 1px solid #e0e3eb"> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">制单人</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">制单部门</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">制单日期</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">服务顾问</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.salesName }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="16"> |
||||
|
<div class="span-sty">科目</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.subject }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<div class="span-sty">快捷备注</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.shotRemarks }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<div class="span-sty">备注(打印)</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.printRemarks }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<div class="span-sty">备注</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-collapse v-model="activeNames"> |
||||
|
<el-collapse-item title="客户信息" name="1"> |
||||
|
<el-row style="border-top: 1px solid #e0e3eb"> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">客户</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.customerName }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">联系电话</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.mobile }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">车牌号/车架号</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.vehMark }}/{{ formobj.vinNo }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<div class="span-sty">客户单位</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.customerOrg }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-collapse-item> |
||||
|
<el-collapse-item title="发票信息" name="2"> |
||||
|
<el-row style="border-top: 1px solid #e0e3eb"> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">是否开发票</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.invoiceVo.isInvoicing == '1' ? '是' : formobj.invoiceVo.isInvoicing == '0' ? '否' : '' }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">发票类型</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.invoiceVo.invoiceType }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">开票名称</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.invoiceVo.invoiceTitle }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="8"> |
||||
|
<div class="span-sty">税号</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.invoiceVo.taxpayerNo }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="16"> |
||||
|
<div class="span-sty">税率(%)</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.invoiceVo.taxRate }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-collapse-item> |
||||
|
</el-collapse> |
||||
|
<div class="title">商品</div> |
||||
|
<el-table :key="commodityKey" :data="formobj.goodsVos" :index="index" border style="width: 100%"> |
||||
|
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center" /> |
||||
|
<el-table-column prop="goodsSpuName" label="商品名称" width="200" align="center" /> |
||||
|
<el-table-column prop="goodsSkuCode" label="图号" width="100" align="center" /> |
||||
|
<el-table-column prop="goodsSkuOwnSpec" label="规格" width="100" align="center" /> |
||||
|
<el-table-column prop="unit" label="单位" width="100" align="center" /> |
||||
|
<el-table-column prop="supplierName" label="厂家" width="100" align="center" /> |
||||
|
<el-table-column prop="currentCount" label="库存" width="100" align="center" /> |
||||
|
<el-table-column prop="price" label="销售价" align="center" width="150" /> |
||||
|
<el-table-column prop="count" label="数量" align="center" width="100" /> |
||||
|
<el-table-column prop="discount" label="折扣" align="center" width="100" /> |
||||
|
<el-table-column prop="discountAmount" label="优惠" width="100" align="center" /> |
||||
|
<el-table-column prop="amount" label="金额" width="100" align="center" /> |
||||
|
<el-table-column prop="remarks" label="备注" align="center" min-width="300" /> |
||||
|
</el-table> |
||||
|
<div class="title">附加项目</div> |
||||
|
<el-table :key="subjoinKey" :data="formobj.aitemVos" :index="index" border style="width: 100%"> |
||||
|
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
||||
|
<el-table-column prop="aitemName" label="附加项目" align="center" width="200" /> |
||||
|
<el-table-column prop="price" label="销售价" align="center" width="150" /> |
||||
|
<el-table-column prop="remarks" label="备注" align="center" min-width="200" /> |
||||
|
</el-table> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<div class="span-sty" style="border-right: 0px">合计金额:</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ jeTotal }} = 材料费:{{ clfTotal }} + 附加费:{{ fjfTotal }} + 税额:{{ seTotal }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<div class="span-sty" style="border-right: 0px">应收金额:</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ ysjeTotal }} = 合计金额:{{ jeTotal }} - 优惠:{{ formobj.discountAmount }}</span></el-form-item> |
||||
|
<!-- - 优惠券:<el-input style="width: 100px" v-model="formobj.coupon" @keyup.native="formobj.coupon = getNumber(formobj.coupon, 2)" clearable placeholder="" /> - 积分抵扣:<el-input style="width: 100px" v-model="formobj.scoreDeduct" @keyup.native="formobj.scoreDeduct = getNumber(formobj.scoreDeduct, 2)" clearable placeholder="" />--> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import req from '@/api/operation/salesticket' |
||||
|
|
||||
|
export default { |
||||
|
name: 'SalesTicketInfo', |
||||
|
data() { |
||||
|
return { |
||||
|
viewTitle: '', |
||||
|
viewState: 1, |
||||
|
activeNames: '1', |
||||
|
index: 0, |
||||
|
// commodity商品 |
||||
|
commodityKey: 1, |
||||
|
// subjoin附加项目 |
||||
|
subjoinKey: 2, |
||||
|
formobj: { |
||||
|
sid: '', |
||||
|
createTime: '', |
||||
|
createByName: '', |
||||
|
createBySid: '', |
||||
|
customerName: '', |
||||
|
customerSid: '', |
||||
|
deptName: '', |
||||
|
deptSid: '', |
||||
|
mobile: '', |
||||
|
vehMark: '', |
||||
|
vinNo: '', |
||||
|
billNo: '', |
||||
|
subjectSid: '', |
||||
|
subject: '', |
||||
|
salesUserSid: '', |
||||
|
salesName: '', |
||||
|
shotRemarks: '', |
||||
|
printRemarks: '', |
||||
|
discountAmount: '', |
||||
|
coupon: '', |
||||
|
scoreDeduct: '', |
||||
|
customerOrg: '', |
||||
|
receivableAmount: '', |
||||
|
invoiceVo: { |
||||
|
isInvoicing: '', |
||||
|
invoiceType: '', |
||||
|
invoiceTypeKey: '', |
||||
|
invoiceTitle: '', |
||||
|
taxpayerNo: '', |
||||
|
invoiceCode: '', |
||||
|
taxRate: '' |
||||
|
}, |
||||
|
aitemVos: [], |
||||
|
goodsVos: [], |
||||
|
settlementVo: { |
||||
|
payerNo: '', |
||||
|
payerName: '', |
||||
|
receivableAmount: '', |
||||
|
depositdeductAmount: '', |
||||
|
settleKey: '', |
||||
|
settleValue: '', |
||||
|
settleAmount: '', |
||||
|
otherSettleKey: '', |
||||
|
otherSettleValue: '', |
||||
|
otherSettleAmount: '', |
||||
|
debts: '', |
||||
|
settleTime: '' |
||||
|
} |
||||
|
}, |
||||
|
rules: {} |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
// 计算材料费 = 商品列表中所有销售价之和 |
||||
|
clfTotal() { |
||||
|
let clf = '0' |
||||
|
if (this.formobj.goodsVos.length > 0) { |
||||
|
this.formobj.goodsVos.forEach((e) => { |
||||
|
if (e.goodsSpuName !== '') { |
||||
|
clf = Math.round((parseFloat(clf) + parseFloat(e.price !== '' ? e.price : '0')) * 100) / 100 |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
return clf |
||||
|
}, |
||||
|
// 计算附加费 == 附加项目列表中所有销售价之和 |
||||
|
fjfTotal() { |
||||
|
let fjf = '0' |
||||
|
if (this.formobj.aitemVos.length > 0) { |
||||
|
this.formobj.aitemVos.forEach((e) => { |
||||
|
if (e.aitemName !== '') { |
||||
|
fjf = Math.round((parseFloat(fjf) + parseFloat(e.price !== '' ? e.price : '0')) * 100) / 100 |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
return fjf |
||||
|
}, |
||||
|
// 计算税额 = 材料费 * 税率 |
||||
|
seTotal() { |
||||
|
let se = '0' |
||||
|
se = Math.round((parseFloat(this.clfTotal) * (parseFloat(this.formobj.invoiceVo.taxRate !== '' ? this.formobj.invoiceVo.taxRate : '0') / 100)) * 100) / 100 |
||||
|
return se |
||||
|
}, |
||||
|
// 计算合计金额 = 工时费 + 材料费 + 附加费 + 税额 |
||||
|
jeTotal() { |
||||
|
let je = '0' |
||||
|
je = Math.round((parseFloat(je) + parseFloat(this.clfTotal) + parseFloat(this.fjfTotal) + parseFloat(this.seTotal)) * 100) / 100 |
||||
|
return je |
||||
|
}, |
||||
|
// 计算应收金额 |
||||
|
ysjeTotal() { |
||||
|
let ysje = '0' |
||||
|
ysje = Math.round((parseFloat(ysje) + parseFloat(this.jeTotal) - parseFloat(this.formobj.discountAmount !== '' ? this.formobj.discountAmount : '0')) * 100) / 100 |
||||
|
// - parseFloat(this.formobj.coupon !== '' ? this.formobj.coupon : '0') - parseFloat(this.formobj.scoreDeduct !== '' ? this.formobj.scoreDeduct : '0') |
||||
|
return ysje |
||||
|
}, |
||||
|
// 结算页面中计算欠款金额 = 应付金额 - 订金抵扣 - 结算金额 - 其他结算金额 |
||||
|
qkjeTotal() { |
||||
|
let qkje = '0' |
||||
|
qkje = Math.round((parseFloat(this.ysjeTotal) - parseFloat(this.formobj.settlementVo.depositdeductAmount !== '' ? this.formobj.settlementVo.depositdeductAmount : '0') - parseFloat(this.formobj.settlementVo.settleAmount !== '' ? this.formobj.settlementVo.settleAmount : '0') - parseFloat(this.formobj.settlementVo.otherSettleAmount !== '' ? this.formobj.settlementVo.otherSettleAmount : '0')) * 100) / 100 |
||||
|
return qkje |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
showInfo(row) { |
||||
|
this.viewTitle = '商品销售单详情' |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs['form_obj'].clearValidate() |
||||
|
}) |
||||
|
req.fetchBySid(row.sid).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.formobj = res.data |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
selectCustomer() { |
||||
|
this.viewState = 2 |
||||
|
this.$refs['divCus'].getList() |
||||
|
}, |
||||
|
handleReturn(isreload) { |
||||
|
if (isreload === 'true') this.$emit('reloadlist') |
||||
|
this.formobj = { |
||||
|
sid: '', |
||||
|
createTime: '', |
||||
|
createByName: '', |
||||
|
createBySid: '', |
||||
|
customerName: '', |
||||
|
customerSid: '', |
||||
|
deptName: '', |
||||
|
deptSid: '', |
||||
|
mobile: '', |
||||
|
vehMark: '', |
||||
|
vinNo: '', |
||||
|
billNo: '', |
||||
|
subjectSid: '', |
||||
|
subject: '', |
||||
|
salesUserSid: '', |
||||
|
salesName: '', |
||||
|
shotRemarks: '', |
||||
|
printRemarks: '', |
||||
|
discountAmount: '', |
||||
|
coupon: '', |
||||
|
scoreDeduct: '', |
||||
|
customerOrg: '', |
||||
|
receivableAmount: '', |
||||
|
invoiceVo: { |
||||
|
isInvoicing: '', |
||||
|
invoiceType: '', |
||||
|
invoiceTypeKey: '', |
||||
|
invoiceTitle: '', |
||||
|
taxpayerNo: '', |
||||
|
invoiceCode: '', |
||||
|
taxRate: '' |
||||
|
}, |
||||
|
aitemVos: [], |
||||
|
goodsVos: [], |
||||
|
settlementVo: { |
||||
|
payerNo: '', |
||||
|
payerName: '', |
||||
|
receivableAmount: '', |
||||
|
depositdeductAmount: '', |
||||
|
settleKey: '', |
||||
|
settleValue: '', |
||||
|
settleAmount: '', |
||||
|
otherSettleKey: '', |
||||
|
otherSettleValue: '', |
||||
|
otherSettleAmount: '', |
||||
|
debts: '', |
||||
|
settleTime: '' |
||||
|
} |
||||
|
} |
||||
|
this.settleVisible = false |
||||
|
this.submitdisabled = false |
||||
|
this.$emit('doback') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.span-sty { |
||||
|
width: 130px !important; |
||||
|
} |
||||
|
.addinputInfo { |
||||
|
margin-left: 120px !important; |
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue