完善销售订单管理
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
// 上传图片
|
// 上传图片
|
||||||
|
|
||||||
export const uploadFile = '/api/portal/file/upload'
|
export const uploadFile = '/api/oms/file/upload'
|
||||||
|
|||||||
@@ -34,35 +34,6 @@ export function fetchBySid(sid) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据当前登录用户sid获取本分公司下的销售部门和销售专员
|
|
||||||
export function selectOrgList(data) {
|
|
||||||
return request({
|
|
||||||
url: '/portal/v1/sysorganization/selectOrgList',
|
|
||||||
method: 'get',
|
|
||||||
params: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 当前用户创建申请时判断该用户是否有该菜单的操作权限
|
|
||||||
export function selectHaveMessage(data) {
|
|
||||||
return request({
|
|
||||||
url: '/portal/v1/sysuser/selectHaveMessage ',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
headers: { 'Content-Type': 'application/json' }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据当前登录用户的角色获取菜单分页列表页面右上角按钮的隐藏
|
|
||||||
export function getButtonPermissions(data) {
|
|
||||||
return request({
|
|
||||||
url: '/portal/v1/sysfunction/getButtonPermissions',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
headers: { 'Content-Type': 'application/json' }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据当前登录用户的全路径查询相应部门下的所有人
|
// 根据当前登录用户的全路径查询相应部门下的所有人
|
||||||
export function selAllByOrgSidPath(data) {
|
export function selAllByOrgSidPath(data) {
|
||||||
return request({
|
return request({
|
||||||
@@ -72,43 +43,6 @@ export function selAllByOrgSidPath(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分公司全路径sid获取工种
|
|
||||||
export function getServiceType(data) {
|
|
||||||
return request({
|
|
||||||
url: '/as/v1/AsServiceItem/getServiceType',
|
|
||||||
method: 'get',
|
|
||||||
params: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 分公司全路径sid获取科目
|
|
||||||
export function selSubjectInfo(data) {
|
|
||||||
return request({
|
|
||||||
url: '/as/v1/asservicepackage/selSubjectInfo',
|
|
||||||
method: 'get',
|
|
||||||
params: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 分公司全路径sid获取班组
|
|
||||||
export function getGroupList(data) {
|
|
||||||
return request({
|
|
||||||
url: '/as/v1/asservicegroup/getGroupList',
|
|
||||||
method: 'post',
|
|
||||||
params: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询分页列表 -- 客户列表
|
|
||||||
export function customerListPage(params) {
|
|
||||||
return request({
|
|
||||||
url: '/yxtcrm/apiadmin/v1/crmcustomer/customerListPage',
|
|
||||||
method: 'post',
|
|
||||||
data: params,
|
|
||||||
headers: { 'Content-Type': 'application/json' }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取省
|
// 获取省
|
||||||
export function getProvince() {
|
export function getProvince() {
|
||||||
return request({
|
return request({
|
||||||
@@ -133,29 +67,10 @@ export function getCounty(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取售后服务--基础信息--供应商信息
|
|
||||||
export function choiceSupplierInfo(data) {
|
|
||||||
return request({
|
|
||||||
url: '/oms/apiadmin/supplierinfo/choiceSupplierInfo',
|
|
||||||
method: 'get',
|
|
||||||
params: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询分页列表 -- 商品列表
|
|
||||||
export function chooseproducts(params) {
|
|
||||||
return request({
|
|
||||||
url: '/yxtbase/apiadmin/base/basegoodssku/getGoodsListPage',
|
|
||||||
method: 'post',
|
|
||||||
data: params,
|
|
||||||
headers: { 'Content-Type': 'application/json' }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询所有仓库
|
// 查询所有仓库
|
||||||
export function getWarehouses(params) {
|
export function getWareHouse(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/base/wmswarehouseinfo/listAll',
|
url: '/oms/apiadmin/warehouseinfo/getWareHouse',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
headers: {
|
headers: {
|
||||||
@@ -163,16 +78,3 @@ export function getWarehouses(params) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 根据仓库查询库位
|
|
||||||
export function getWarehouseareas(data) {
|
|
||||||
return request({
|
|
||||||
url: '/oms/apiadmin/base/wmswarehousearea/selectAll',
|
|
||||||
method: 'get',
|
|
||||||
params: data,
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
44
src/api/salesOrder/salesOrder.js
Normal file
44
src/api/salesOrder/salesOrder.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
// 查询分页列表
|
||||||
|
listPage: function(params) {
|
||||||
|
return request({
|
||||||
|
url: '/oms/v1/smssalesbill/listPage',
|
||||||
|
method: 'post',
|
||||||
|
data: params,
|
||||||
|
headers: { 'Content-Type': 'application/json' }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 选择商品
|
||||||
|
chooseProducts: function(params) {
|
||||||
|
return request({
|
||||||
|
url: '/oms/apiadmin/base/basegoodsspu/getGoodsForSales',
|
||||||
|
method: 'post',
|
||||||
|
data: params,
|
||||||
|
headers: { 'Content-Type': 'application/json' }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fetchBySid: function(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oms/v1/smssalesbill/fetchDetailsBySid/' + data,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deleteBySids: function(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oms/v1/smssalesbill/delBySids',
|
||||||
|
method: 'DELETE',
|
||||||
|
data: data,
|
||||||
|
headers: { 'Content-Type': 'application/json' }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
saveOrUpdate: function(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oms/v1/smssalesbill/save',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
headers: { 'Content-Type': 'application/json' }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -50,6 +50,25 @@ export const constantRoutes = [
|
|||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
path: '/salesOrder',
|
||||||
|
component: Layout,
|
||||||
|
redirect: '/salesOrder',
|
||||||
|
meta: {
|
||||||
|
title: '销售订单管理'
|
||||||
|
},
|
||||||
|
children: [{
|
||||||
|
path: '/salesOrder/salesOrder',
|
||||||
|
component: () => import('@/views/salesOrder/salesOrder'),
|
||||||
|
name: 'SalesOrder',
|
||||||
|
meta: {
|
||||||
|
title: '销售订单管理',
|
||||||
|
noCache: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/purchase',
|
path: '/purchase',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
|||||||
334
src/views/salesOrder/salesOrder.vue
Normal file
334
src/views/salesOrder/salesOrder.vue
Normal file
@@ -0,0 +1,334 @@
|
|||||||
|
<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.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-select class="addinputInfo" v-model="listQuery.params.billTypeKey" placeholder="请选择" clearable filterable>
|
||||||
|
<el-option v-for="item in billType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="仓库">
|
||||||
|
<el-input v-model="listQuery.params.warehouseName" placeholder="" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="配送方式">
|
||||||
|
<el-select class="addinputInfo" v-model="listQuery.params.deliveryTypeKey" placeholder="请选择" clearable filterable>
|
||||||
|
<el-option v-for="item in deliveryType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</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.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" 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="deptName" label="制单部门" align="center" width="130" />
|
||||||
|
<el-table-column prop="createByName" label="制单人" align="center" width="120" />
|
||||||
|
<el-table-column prop="createTime" label="制单日期" align="center" width="120" />
|
||||||
|
<el-table-column prop="billTypeValue" label="订单类型" align="center" width="100" />
|
||||||
|
<el-table-column prop="warehouseName" label="仓库" align="center" min-width="160" />
|
||||||
|
<el-table-column prop="deliveryTypeValue" label="配送方式" align="center" width="100" />
|
||||||
|
<el-table-column prop="customerName" label="客户名称" align="center" min-width="130" />
|
||||||
|
<el-table-column prop="thisPay" label="实付" align="center" width="100" />
|
||||||
|
<el-table-column prop="discountAmount" label="优惠" align="center" width="100" />
|
||||||
|
<el-table-column prop="dueAmount" label="应收" align="center" width="100" />
|
||||||
|
<el-table-column prop="freight" label="运费" align="center" width="100" />
|
||||||
|
<el-table-column prop="salesName" 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>
|
||||||
|
<!--新增及修改 -->
|
||||||
|
<salesOrderAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="getList"/>
|
||||||
|
<!-- 详情 -->
|
||||||
|
<salesOrderInfo 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/salesOrder/salesOrder'
|
||||||
|
import salesOrderAdd from './salesOrderAdd'
|
||||||
|
import salesOrderInfo from './salesOrderInfo'
|
||||||
|
import { typeValues } from '@/api/Common/dictcommons'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'SalesOrder',
|
||||||
|
components: {
|
||||||
|
Pagination,
|
||||||
|
pageye,
|
||||||
|
ButtonBar,
|
||||||
|
salesOrderAdd,
|
||||||
|
salesOrderInfo
|
||||||
|
},
|
||||||
|
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
|
||||||
|
billType_list: [],
|
||||||
|
deliveryType_list: [],
|
||||||
|
FormLoading: false,
|
||||||
|
listLoading: false,
|
||||||
|
// 翻页
|
||||||
|
listQuery: {
|
||||||
|
current: 1,
|
||||||
|
size: 5,
|
||||||
|
total: 0,
|
||||||
|
params: {
|
||||||
|
createByName: '',
|
||||||
|
deptName: '',
|
||||||
|
billNo: '',
|
||||||
|
startDate: '',
|
||||||
|
endDate: '',
|
||||||
|
salesName: '',
|
||||||
|
billTypeKey: '',
|
||||||
|
deliveryTypeKey: '',
|
||||||
|
customerName: '',
|
||||||
|
warehouseName: '',
|
||||||
|
useOrgSid: '',
|
||||||
|
createOrgSid: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
// 初始化变量
|
||||||
|
this.getList()
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
typeValues({ type: 'billType' }).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.billType_list = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
typeValues({ type: 'deliveryType' }).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.deliveryType_list = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 搜索条件效果
|
||||||
|
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.useOrgSid = window.sessionStorage.getItem('orgSid')
|
||||||
|
this.listQuery.params.createOrgSid = window.sessionStorage.getItem('orgSid')
|
||||||
|
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: {
|
||||||
|
createByName: '',
|
||||||
|
deptName: '',
|
||||||
|
billNo: '',
|
||||||
|
startDate: '',
|
||||||
|
endDate: '',
|
||||||
|
salesName: '',
|
||||||
|
billTypeKey: '',
|
||||||
|
deliveryTypeKey: '',
|
||||||
|
customerName: '',
|
||||||
|
warehouseName: '',
|
||||||
|
useOrgSid: '',
|
||||||
|
createOrgSid: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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>
|
||||||
838
src/views/salesOrder/salesOrderAdd.vue
Normal file
838
src/views/salesOrder/salesOrderAdd.vue
Normal file
@@ -0,0 +1,838 @@
|
|||||||
|
<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="saveOrUpdate()">保存</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">订单类型</div>
|
||||||
|
<el-form-item>
|
||||||
|
<el-select class="addinputInfo" v-model="formobj.billTypeKey" placeholder="请选择" @change="billTypeChange" clearable filterable>
|
||||||
|
<el-option v-for="item in billType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">仓库</div>
|
||||||
|
<el-form-item>
|
||||||
|
<el-select class="addinputInfo" v-model="formobj.warehouseSid" placeholder="请选择" @change="warehouseChange" clearable filterable>
|
||||||
|
<el-option v-for="item in warehouse_list" :key="item.warehouseSid" :label="item.warehouseName" :value="item.warehouseSid"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">配送方式</div>
|
||||||
|
<el-form-item>
|
||||||
|
<el-select class="addinputInfo" v-model="formobj.deliveryTypeKey" placeholder="请选择" @change="deliveryTypeChange" clearable filterable>
|
||||||
|
<el-option v-for="item in deliveryType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</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" v-model="formobj.logisticsName" clearable placeholder="" /></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">业务员</div>
|
||||||
|
<el-form-item></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">货到付款</div>
|
||||||
|
<el-form-item>
|
||||||
|
<el-radio-group class="addinputInfo" v-model="formobj.isFirstPay">
|
||||||
|
<el-radio label="1">是</el-radio>
|
||||||
|
<el-radio label="0">否</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</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-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<div class="span-sty">附件</div>
|
||||||
|
<el-form-item>
|
||||||
|
<uploadImg ref="uploadImg" class="addinputInfo" v-model="formobj.files" :limit="50" bucket="map" :upload-data="{ type: '0001' }"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div class="title">客户信息</div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty"><span class="icon">*</span>客户</div>
|
||||||
|
<el-form-item prop="customerName"><el-input class="addinputInfo addinputw" v-model="formobj.customerName" 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.shipperName" 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.shipperMob" clearable placeholder=""/></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="16">
|
||||||
|
<div class="span-sty">详细地址</div>
|
||||||
|
<el-form-item>
|
||||||
|
<div class="addinputInfo" style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center">
|
||||||
|
<el-select v-model="formobj.deliveryProvince" filterable clearable placeholder="请选择省" style="width:160px" @change="provinceChange">
|
||||||
|
<el-option v-for="item in province_list" :key="item.sid" :label="item.name" :value="item.name"/>
|
||||||
|
</el-select>
|
||||||
|
<el-select v-model="formobj.deliveryCity" filterable placeholder="请选择市" style="width:160px" @change="cityChange">
|
||||||
|
<el-option v-for="item in city_list" :key="item.sid" :label="item.name" :value="item.name"/>
|
||||||
|
</el-select>
|
||||||
|
<el-select v-model="formobj.deliveryCounty" filterable placeholder="请选择县" style="width:160px" @change="countyChange">
|
||||||
|
<el-option v-for="item in county_list" :key="item.sid" :label="item.name" :value="item.name"/>
|
||||||
|
</el-select>
|
||||||
|
<el-input style="width: 30%" v-model="formobj.deliveryAddress" clearable placeholder=""/>
|
||||||
|
</div>
|
||||||
|
</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.postCode" clearable placeholder=""/></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div class="title">发票信息</div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">是否开发票</div>
|
||||||
|
<el-form-item>
|
||||||
|
<el-radio-group class="addinputInfo" style="font-size: 1px" v-model="formobj.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.isInvoicing != '1'" v-model="formobj.invoiceTypeKey" placeholder="请选择" @change="invoiceTypeChange" clearable filterable>
|
||||||
|
<el-option v-for="item in invoiceType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></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.isInvoicing != '1'" v-model="formobj.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.isInvoicing != '1'" v-model="formobj.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.isInvoicing != '1'" @keyup.native="formobj.taxRate = getNumber(formobj.taxRate, 2)" v-model="formobj.taxRate" clearable placeholder="" /></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div class="title titleOne">
|
||||||
|
<div>商品</div>
|
||||||
|
<div style="margin-right: 10px">
|
||||||
|
<span style="margin-right: 5px">开单价格</span>
|
||||||
|
<el-select size="mini" v-model="formobj.billPriceTypeKey" placeholder="请选择" @change="billPriceTypeChange" clearable filterable>
|
||||||
|
<el-option v-for="item in billPriceType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-table :key="commodityKey" :data="formobj.goodsList" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
|
||||||
|
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center" />
|
||||||
|
<el-table-column align="center" width="80">
|
||||||
|
<template slot="header" slot-scope="scope">
|
||||||
|
<i class="add-btn-icon el-icon-plus" style="color: red;font-size:20px" @click="commodityAdd(scope.row)"></i>
|
||||||
|
</template>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<i class="el-icon-delete" @click="commodityDelete(scope.$index)"></i>
|
||||||
|
</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="weight" label="重量" width="100" align="center" />
|
||||||
|
<el-table-column prop="unit" label="单位" width="100" align="center" />
|
||||||
|
<el-table-column prop="auxiliaryUnit" label="辅单位数量" width="120" align="center" />
|
||||||
|
<el-table-column prop="count" label="数量" width="150" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input @input="dueAmountInput(scope.row)" @keyup.native="scope.row.count = getNumber(scope.row.count, 0)" v-model="scope.row.count" clearable placeholder="" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="price" label="单价" width="100" align="center" />
|
||||||
|
<el-table-column label="折扣率" width="150" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input @input="discountPriceInput(scope.row)" @keyup.native="scope.row.discountRtate = getNumber(scope.row.discountRtate, 2)" v-model="scope.row.discountRtate" clearable placeholder="" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="discountPrice" label="折后单价" width="100" align="center" />
|
||||||
|
<el-table-column prop="dueAmount" label="应收款" width="100" align="center" />
|
||||||
|
<el-table-column prop="cost" label="商品成本" width="150" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input @keyup.native="scope.row.cost = getNumber(scope.row.cost, 2)" v-model="scope.row.cost" 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>
|
||||||
|
<el-row class="rowStyle">
|
||||||
|
<el-col :span="6">
|
||||||
|
<div class="span-sty">折扣率(%):</div>
|
||||||
|
<el-form-item><el-input class="addinputInfo" style="width: 150px" @keyup.native="formobj.discountRate = getNumber(formobj.discountRate , 2)" v-model="formobj.discountRate" clearable placeholder="" /></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<div class="span-sty">优惠金额:</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ yhCompute }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<div class="span-sty">优惠后金额:</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ yhhCompute }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<div class="span-sty">应收合计:</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ yhhCompute }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<div class="span-sty">运费:</div>
|
||||||
|
<el-form-item><el-input class="addinputInfo" style="width: 150px" @keyup.native="formobj.freight = getNumber(formobj.freight , 2)" v-model="formobj.freight" clearable placeholder="" /></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="rowStyle">
|
||||||
|
<el-col :span="6">
|
||||||
|
<div class="span-sty">本次收款</div>
|
||||||
|
<el-form-item><el-input class="addinputInfo" style="width: 150px" @keyup.native="formobj.thisPay = getNumber(formobj.thisPay , 2)" v-model="formobj.thisPay" clearable placeholder="" /></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<div class="span-sty">本次欠款</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ bcqkCompute }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<div class="span-sty">总欠款</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ bcqkCompute }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<div class="span-sty">预收款余额</div>
|
||||||
|
<el-form-item><el-input class="addinputInfo" style="width: 150px" @keyup.native="formobj.advanceBalance = getNumber(formobj.advanceBalance , 2)" v-model="formobj.advanceBalance" clearable placeholder="" /></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<div class="span-sty">结算账户</div>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input class="addinputInfo" style="width: 150px" v-model="formobj.bankAccount" clearable placeholder="" />
|
||||||
|
<el-button type="primary" size="mini" @click="handleAccount">多账户</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<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-column fixed width="60" label="序号" type="index" :index="index + 1" align="center" />
|
||||||
|
<el-table-column label="收支账户" align="center" min-width="150" />
|
||||||
|
<el-table-column label="金额" align="center" min-width="150" />
|
||||||
|
</el-table>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||||
|
<el-button type="primary" size="small" @click="handleConfirm">确定</el-button>
|
||||||
|
<el-button size="small" @click="dialogVisible = false">取消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import req from '@/api/salesOrder/salesOrder'
|
||||||
|
import uploadImg from '@/components/uploadFile/uploadImg'
|
||||||
|
import { getProvince, getCity, getCounty, typeValues, getWareHouse } from '@/api/Common/dictcommons'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'SalesOrderAdd',
|
||||||
|
components: {
|
||||||
|
uploadImg
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
viewTitle: '',
|
||||||
|
viewState: 1,
|
||||||
|
submitdisabled: false,
|
||||||
|
billType_list: [], // 订单类型
|
||||||
|
warehouse_list: [], // 仓库
|
||||||
|
deliveryType_list: [], // 配送方式
|
||||||
|
province_list: [],
|
||||||
|
city_list: [],
|
||||||
|
county_list: [],
|
||||||
|
invoiceType_list: [], // 发票类型
|
||||||
|
billPriceType_list: [], // 开票价格
|
||||||
|
// commodity商品
|
||||||
|
commodityKey: 1,
|
||||||
|
commodityLoading: false,
|
||||||
|
commodityQuery: {
|
||||||
|
current: 1,
|
||||||
|
size: 2,
|
||||||
|
total: 0,
|
||||||
|
params: {
|
||||||
|
goodsName: '',
|
||||||
|
createOrgSid: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
commodityData: [],
|
||||||
|
// 多账户
|
||||||
|
dialogVisible: false,
|
||||||
|
accountKey: 2,
|
||||||
|
accountList: [],
|
||||||
|
index: 0,
|
||||||
|
formobj: {
|
||||||
|
sid: '',
|
||||||
|
createBySid: '',
|
||||||
|
createByName: '',
|
||||||
|
useOrgSid: '',
|
||||||
|
createOrgSid: '',
|
||||||
|
remarks: '',
|
||||||
|
deptSid: '',
|
||||||
|
deptName: '',
|
||||||
|
createTime: '',
|
||||||
|
billTypeKey: '',
|
||||||
|
billTypeValue: '',
|
||||||
|
warehouseSid: '',
|
||||||
|
warehouseName: '',
|
||||||
|
deliveryTypeKey: '',
|
||||||
|
deliveryTypeValue: '',
|
||||||
|
logisticsName: '',
|
||||||
|
salesUserSid: '',
|
||||||
|
salesName: '',
|
||||||
|
isFirstPay: '',
|
||||||
|
billPriceTypeKey: '',
|
||||||
|
billPriceTypeValue: '',
|
||||||
|
customerSid: '',
|
||||||
|
customerName: '',
|
||||||
|
shipperName: '',
|
||||||
|
shipperMob: '',
|
||||||
|
deliveryProvinceSid: '',
|
||||||
|
deliveryProvince: '',
|
||||||
|
deliveryCitySid: '',
|
||||||
|
deliveryCity: '',
|
||||||
|
deliveryCountySid: '',
|
||||||
|
deliveryCounty: '',
|
||||||
|
deliveryAddress: '',
|
||||||
|
postCode: '',
|
||||||
|
isInvoicing: '',
|
||||||
|
invoiceTypeKey: '',
|
||||||
|
invoiceType: '',
|
||||||
|
invoiceTitle: '',
|
||||||
|
taxpayerNo: '',
|
||||||
|
taxRate: '',
|
||||||
|
discountRate: '',
|
||||||
|
coupon: '',
|
||||||
|
discountAmount: '',
|
||||||
|
amount: '',
|
||||||
|
dueAmount: '',
|
||||||
|
freight: '',
|
||||||
|
thisPay: '',
|
||||||
|
thisDebt: '',
|
||||||
|
totalDebt: '',
|
||||||
|
advanceBalance: '',
|
||||||
|
bankAccount: '',
|
||||||
|
settleAmount: '',
|
||||||
|
goodsList: [],
|
||||||
|
files: []
|
||||||
|
},
|
||||||
|
rules: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
// 计算优惠金额 = 商品列表中所有应收款之和 * 折扣率
|
||||||
|
yhCompute() {
|
||||||
|
let yh = '0'
|
||||||
|
if (this.formobj.goodsList.length > 0) {
|
||||||
|
this.formobj.goodsList.forEach((e) => {
|
||||||
|
if (e.goodsSpuName !== '') {
|
||||||
|
yh = parseFloat(yh) + parseFloat(e.dueAmount)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
yh = Math.round((parseFloat(yh) * parseFloat(this.formobj.discountRate !== '' ? this.formobj.discountRate : '0')) * 100) / 100
|
||||||
|
return yh
|
||||||
|
},
|
||||||
|
// 计算优惠后金额 = 商品列表中所有应收款之和 - 优惠金额
|
||||||
|
yhhCompute() {
|
||||||
|
let yhh = '0'
|
||||||
|
if (this.formobj.goodsList.length > 0) {
|
||||||
|
this.formobj.goodsList.forEach((e) => {
|
||||||
|
if (e.goodsSpuName !== '') {
|
||||||
|
yhh = parseFloat(yhh) + parseFloat(e.dueAmount)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
yhh = Math.round((parseFloat(yhh) - parseFloat(this.yhCompute)) * 100) / 100
|
||||||
|
return yhh
|
||||||
|
},
|
||||||
|
// 计算本次欠款 = 应收合计(优惠后金额) + 运费 - 本次收款
|
||||||
|
bcqkCompute() {
|
||||||
|
let bcqk = '0'
|
||||||
|
bcqk = Math.round((parseFloat(this.yhhCompute) + parseFloat(this.formobj.freight !== '' ? this.formobj.freight : '0') - parseFloat(this.formobj.thisPay !== '' ? this.formobj.thisPay : '0')) * 100) / 100
|
||||||
|
return bcqk
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
typeValues({ type: 'billType' }).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.billType_list = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
typeValues({ type: 'deliveryType' }).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.deliveryType_list = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
typeValues({ type: 'invoiceType' }).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.invoiceType_list = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
typeValues({ type: 'billPriceType' }).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.billPriceType_list = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
getProvince().then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.province_list = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
getWareHouse({ createOrgSid: window.sessionStorage.getItem('orgSid') }).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.warehouse_list = res.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
|
||||||
|
},
|
||||||
|
provinceChange(value) {
|
||||||
|
const choose = this.province_list.filter((item) => item.name === value)
|
||||||
|
if (choose !== null && choose.length > 0) {
|
||||||
|
this.formobj.deliveryProvinceSid = choose[0].sid
|
||||||
|
this.getCity(this.formobj.deliveryProvinceSid)
|
||||||
|
} else {
|
||||||
|
this.formobj.deliveryProvinceSid = ''
|
||||||
|
this.formobj.deliveryCitySid = ''
|
||||||
|
this.formobj.deliveryCity = ''
|
||||||
|
this.city_list = []
|
||||||
|
this.formobj.deliveryCounty = ''
|
||||||
|
this.formobj.deliveryCountySid = ''
|
||||||
|
this.county_list = []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getCity(val) {
|
||||||
|
getCity({ sid: val }).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.city_list = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
cityChange(value) {
|
||||||
|
const choose = this.city_list.filter((item) => item.name === value)
|
||||||
|
if (choose !== null && choose.length > 0) {
|
||||||
|
this.formobj.deliveryCitySid = choose[0].sid
|
||||||
|
this.getCounty(this.formobj.deliveryCitySid)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getCounty(val) {
|
||||||
|
getCounty({ sid: val }).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.county_list = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
countyChange(value) {
|
||||||
|
const choose = this.county_list.filter((item) => item.name === value)
|
||||||
|
if (choose !== null && choose.length > 0) {
|
||||||
|
this.formobj.deliveryCountySid = choose[0].sid
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showAdd() {
|
||||||
|
this.viewTitle = '【新增】商品销售单'
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['form_obj'].clearValidate()
|
||||||
|
})
|
||||||
|
this.init()
|
||||||
|
this.formobj.createByName = window.sessionStorage.getItem('userName')
|
||||||
|
this.formobj.createBySid = window.sessionStorage.getItem('userSid')
|
||||||
|
this.formobj.createOrgSid = window.sessionStorage.getItem('orgSid')
|
||||||
|
this.formobj.useOrgSid = window.sessionStorage.getItem('orgSid')
|
||||||
|
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)
|
||||||
|
},
|
||||||
|
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
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
billTypeChange(value) {
|
||||||
|
const choose = this.billType_list.filter((item) => item.dictKey === value)
|
||||||
|
if (choose !== null && choose.length > 0) {
|
||||||
|
this.formobj.billTypeValue = choose[0].dictValue
|
||||||
|
} else {
|
||||||
|
this.formobj.billTypeValue = ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
warehouseChange(value) {
|
||||||
|
const choose = this.warehouse_list.filter((item) => item.warehouseSid === value)
|
||||||
|
if (choose !== null && choose.length > 0) {
|
||||||
|
this.formobj.warehouseName = choose[0].warehouseName
|
||||||
|
} else {
|
||||||
|
this.formobj.warehouseName = ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deliveryTypeChange(value) {
|
||||||
|
const choose = this.deliveryType_list.filter((item) => item.dictKey === value)
|
||||||
|
if (choose !== null && choose.length > 0) {
|
||||||
|
this.formobj.deliveryTypeValue = choose[0].dictValue
|
||||||
|
} else {
|
||||||
|
this.formobj.deliveryTypeValue = ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
invoiceTypeChange(value) {
|
||||||
|
const choose = this.invoiceType_list.filter((item) => item.dictKey === value)
|
||||||
|
if (choose !== null && choose.length > 0) {
|
||||||
|
this.formobj.invoiceType = choose[0].dictValue
|
||||||
|
} else {
|
||||||
|
this.formobj.invoiceType = ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
billPriceTypeChange(value) {
|
||||||
|
const choose = this.billPriceType_list.filter((item) => item.dictKey === value)
|
||||||
|
if (choose !== null && choose.length > 0) {
|
||||||
|
this.formobj.billPriceTypeValue = choose[0].dictValue
|
||||||
|
} else {
|
||||||
|
this.formobj.billPriceTypeValue = ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
commodityAdd() {
|
||||||
|
this.formobj.goodsList.push({
|
||||||
|
goodSpuSid: '',
|
||||||
|
goodsSpuName: '',
|
||||||
|
goodsSkuSid: '',
|
||||||
|
goodsSkuTitle: '',
|
||||||
|
goodsSkuCode: '',
|
||||||
|
goodsSkuOwnSpec: '',
|
||||||
|
weight: '',
|
||||||
|
volume: '',
|
||||||
|
unit: '',
|
||||||
|
auxiliaryUnit: '',
|
||||||
|
price: '',
|
||||||
|
count: '',
|
||||||
|
discountRtate: '',
|
||||||
|
discountPrice: '',
|
||||||
|
dueAmount: '',
|
||||||
|
cost: '',
|
||||||
|
discountAmount: '',
|
||||||
|
amount: '',
|
||||||
|
inventoryCount: '',
|
||||||
|
remarks: ''
|
||||||
|
})
|
||||||
|
},
|
||||||
|
commodityInput(value) {
|
||||||
|
this.commodityQuery.params.createOrgSid = window.sessionStorage.getItem('orgSid')
|
||||||
|
this.commodityQuery.params.goodsName = value
|
||||||
|
this.commodityLoading = true
|
||||||
|
req.chooseProducts(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.goodsSpuName = value.goodsSpuName
|
||||||
|
row.goodsSkuSid = value.goodsSkuSid
|
||||||
|
row.goodsSkuTitle = value.goodsSkuTitle
|
||||||
|
row.goodsSkuCode = value.goodsSkuCode
|
||||||
|
row.goodsSkuOwnSpec = value.goodsSkuOwnSpec
|
||||||
|
row.weight = value.weight
|
||||||
|
row.volume = value.volume
|
||||||
|
row.unit = value.unit
|
||||||
|
row.auxiliaryUnit = value.auxiliaryUnit
|
||||||
|
row.price = value.price
|
||||||
|
row.count = value.count
|
||||||
|
document.body.click()
|
||||||
|
},
|
||||||
|
commodityDelete(index) {
|
||||||
|
this.formobj.goodsList.splice(index, 1)
|
||||||
|
},
|
||||||
|
// 合计
|
||||||
|
getSummaries(param) {
|
||||||
|
const { columns, data } = param
|
||||||
|
const sums = []
|
||||||
|
columns.forEach((column, index) => {
|
||||||
|
if (index === 0) {
|
||||||
|
sums[index] = '合计'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const values = data.map(item => Number(item[column.property]))
|
||||||
|
if (column.property === 'dueAmount') {
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return prev + curr
|
||||||
|
} else {
|
||||||
|
return prev
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
} else if (column.property === 'cost') {
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return prev + curr
|
||||||
|
} else {
|
||||||
|
return prev
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
} else if (column.property === 'discountAmount') {
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return prev + curr
|
||||||
|
} else {
|
||||||
|
return prev
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
} else if (column.property === 'amount') {
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return prev + curr
|
||||||
|
} else {
|
||||||
|
return prev
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return sums
|
||||||
|
},
|
||||||
|
// 计算折后单价 = 单价 * 折扣率
|
||||||
|
discountPriceInput(row) {
|
||||||
|
row.discountPrice = Math.round((parseFloat(row.price !== '' ? row.price : '0') * parseFloat(row.discountRtate !== '' ? row.discountRtate : '0')) * 100) / 100
|
||||||
|
this.dueAmountInput(row)
|
||||||
|
},
|
||||||
|
// 计算应收款 = 折后单价 * 数量
|
||||||
|
dueAmountInput(row) {
|
||||||
|
row.dueAmount = Math.round((parseFloat(row.discountPrice !== '' ? row.discountPrice : '0') * parseFloat(row.count !== '' ? row.count : '0')) * 100) / 100
|
||||||
|
},
|
||||||
|
handleAccount() {
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
handleConfirm() {
|
||||||
|
this.dialogVisible = false
|
||||||
|
},
|
||||||
|
saveOrUpdate() {
|
||||||
|
this.$refs['form_obj'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.formobj.discountAmount = this.yhCompute
|
||||||
|
this.formobj.amount = this.yhhCompute
|
||||||
|
this.formobj.dueAmount = this.yhhCompute
|
||||||
|
this.formobj.thisDebt = this.bcqkCompute
|
||||||
|
this.formobj.totalDebt = this.bcqkCompute
|
||||||
|
console.log(this.formobj, 858585)
|
||||||
|
// 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
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleReturn(isreload) {
|
||||||
|
if (isreload === 'true') this.$emit('reloadlist')
|
||||||
|
this.formobj = {
|
||||||
|
sid: '',
|
||||||
|
createBySid: '',
|
||||||
|
createByName: '',
|
||||||
|
useOrgSid: '',
|
||||||
|
createOrgSid: '',
|
||||||
|
remarks: '',
|
||||||
|
deptSid: '',
|
||||||
|
deptName: '',
|
||||||
|
createTime: '',
|
||||||
|
billTypeKey: '',
|
||||||
|
billTypeValue: '',
|
||||||
|
warehouseSid: '',
|
||||||
|
warehouseName: '',
|
||||||
|
deliveryTypeKey: '',
|
||||||
|
deliveryTypeValue: '',
|
||||||
|
logisticsName: '',
|
||||||
|
salesUserSid: '',
|
||||||
|
salesName: '',
|
||||||
|
isFirstPay: '',
|
||||||
|
billPriceTypeKey: '',
|
||||||
|
billPriceTypeValue: '',
|
||||||
|
customerSid: '',
|
||||||
|
customerName: '',
|
||||||
|
shipperName: '',
|
||||||
|
shipperMob: '',
|
||||||
|
deliveryProvinceSid: '',
|
||||||
|
deliveryProvince: '',
|
||||||
|
deliveryCitySid: '',
|
||||||
|
deliveryCity: '',
|
||||||
|
deliveryCountySid: '',
|
||||||
|
deliveryCounty: '',
|
||||||
|
deliveryAddress: '',
|
||||||
|
postCode: '',
|
||||||
|
isInvoicing: '',
|
||||||
|
invoiceTypeKey: '',
|
||||||
|
invoiceType: '',
|
||||||
|
invoiceTitle: '',
|
||||||
|
taxpayerNo: '',
|
||||||
|
taxRate: '',
|
||||||
|
discountRate: '',
|
||||||
|
coupon: '',
|
||||||
|
discountAmount: '',
|
||||||
|
amount: '',
|
||||||
|
dueAmount: '',
|
||||||
|
freight: '',
|
||||||
|
thisPay: '',
|
||||||
|
thisDebt: '',
|
||||||
|
totalDebt: '',
|
||||||
|
advanceBalance: '',
|
||||||
|
bankAccount: '',
|
||||||
|
settleAmount: '',
|
||||||
|
goodsList: [],
|
||||||
|
files: []
|
||||||
|
}
|
||||||
|
this.commodityData = []
|
||||||
|
this.accountList = []
|
||||||
|
this.submitdisabled = false
|
||||||
|
this.$emit('doback')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.span-sty {
|
||||||
|
width: 130px !important;
|
||||||
|
}
|
||||||
|
.addinputInfo {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
}
|
||||||
|
.titleOne {
|
||||||
|
padding: 7px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
/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);
|
||||||
|
}
|
||||||
|
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .el-radio-group {
|
||||||
|
display: inline;
|
||||||
|
line-height: 1px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.rowStyle {
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
.rowStyle .el-col {
|
||||||
|
border-right: 0;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
.rowStyle .el-col .span-sty {
|
||||||
|
border-right: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
413
src/views/salesOrder/salesOrderInfo.vue
Normal file
413
src/views/salesOrder/salesOrderInfo.vue
Normal file
@@ -0,0 +1,413 @@
|
|||||||
|
<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.billTypeValue }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">仓库</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.warehouseName }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">配送方式</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.deliveryTypeValue }}</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.logisticsName }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">业务员</div>
|
||||||
|
<el-form-item></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">货到付款</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.isFirstPay == '1' ? '是' : formobj.isFirstPay == '0' ? '否' : '' }}</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-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<div class="span-sty">附件</div>
|
||||||
|
<el-form-item><el-image class="addinputInfo" style="width: 100px;height: 100px" v-for="(item, index) in formobj.files" :key="index" :src="item" :preview-src-list="formobj.files" /> </el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div class="title">客户信息</div>
|
||||||
|
<el-row>
|
||||||
|
<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.shipperName }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">手机号</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.shipperMob }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="16">
|
||||||
|
<div class="span-sty">详细地址</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.deliveryProvince }}{{ formobj.deliveryCity }}{{ formobj.deliveryCounty }}{{ formobj.deliveryAddress }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">邮编</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.postCode }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div class="title">发票信息</div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">是否开发票</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.isInvoicing == '1' ? '是' : formobj.isInvoicing == '0' ? '否' : '' }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">发票类型</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.invoiceType }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">开票名称</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.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.taxpayerNo }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="16">
|
||||||
|
<div class="span-sty">税率(%)</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.taxRate }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div class="title">商品</div>
|
||||||
|
<el-table :key="commodityKey" :data="formobj.goodsList" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
|
||||||
|
<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="weight" label="重量" width="100" align="center" />
|
||||||
|
<el-table-column prop="unit" label="单位" width="100" align="center" />
|
||||||
|
<el-table-column prop="auxiliaryUnit" label="辅单位数量" width="120" align="center" />
|
||||||
|
<el-table-column prop="count" label="数量" width="150" align="center" />
|
||||||
|
<el-table-column prop="price" label="单价" width="100" align="center" />
|
||||||
|
<el-table-column prop="discountRtate" label="折扣率" width="150" align="center" />
|
||||||
|
<el-table-column prop="discountPrice" label="折后单价" width="100" align="center" />
|
||||||
|
<el-table-column prop="dueAmount" label="应收款" width="100" align="center" />
|
||||||
|
<el-table-column prop="cost" label="商品成本" width="150" align="center" />
|
||||||
|
<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>
|
||||||
|
<el-row class="rowStyle">
|
||||||
|
<el-col :span="6">
|
||||||
|
<div class="span-sty">折扣率(%):</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.discountRate }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<div class="span-sty">优惠金额:</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.discountAmount }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<div class="span-sty">优惠后金额:</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.amount }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<div class="span-sty">应收合计:</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.dueAmount }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<div class="span-sty">运费:</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.freight }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="rowStyle">
|
||||||
|
<el-col :span="6">
|
||||||
|
<div class="span-sty">本次收款</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.thisPay }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<div class="span-sty">本次欠款</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.thisDebt }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<div class="span-sty">总欠款</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.totalDebt }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<div class="span-sty">预收款余额</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.advanceBalance }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<div class="span-sty">结算账户</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.bankAccount }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import req from '@/api/salesOrder/salesOrder'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'SalesOrderInfo',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
viewTitle: '',
|
||||||
|
viewState: 1,
|
||||||
|
// commodity商品
|
||||||
|
commodityKey: 1,
|
||||||
|
index: 0,
|
||||||
|
formobj: {
|
||||||
|
sid: '',
|
||||||
|
createBySid: '',
|
||||||
|
createByName: '',
|
||||||
|
useOrgSid: '',
|
||||||
|
createOrgSid: '',
|
||||||
|
remarks: '',
|
||||||
|
deptSid: '',
|
||||||
|
deptName: '',
|
||||||
|
createTime: '',
|
||||||
|
billTypeKey: '',
|
||||||
|
billTypeValue: '',
|
||||||
|
warehouseSid: '',
|
||||||
|
warehouseName: '',
|
||||||
|
deliveryTypeKey: '',
|
||||||
|
deliveryTypeValue: '',
|
||||||
|
logisticsName: '',
|
||||||
|
salesUserSid: '',
|
||||||
|
salesName: '',
|
||||||
|
isFirstPay: '',
|
||||||
|
billPriceTypeKey: '',
|
||||||
|
billPriceTypeValue: '',
|
||||||
|
customerSid: '',
|
||||||
|
customerName: '',
|
||||||
|
shipperName: '',
|
||||||
|
shipperMob: '',
|
||||||
|
deliveryProvinceSid: '',
|
||||||
|
deliveryProvince: '',
|
||||||
|
deliveryCitySid: '',
|
||||||
|
deliveryCity: '',
|
||||||
|
deliveryCountySid: '',
|
||||||
|
deliveryCounty: '',
|
||||||
|
deliveryAddress: '',
|
||||||
|
postCode: '',
|
||||||
|
isInvoicing: '',
|
||||||
|
invoiceTypeKey: '',
|
||||||
|
invoiceType: '',
|
||||||
|
invoiceTitle: '',
|
||||||
|
taxpayerNo: '',
|
||||||
|
taxRate: '',
|
||||||
|
discountRate: '',
|
||||||
|
coupon: '',
|
||||||
|
discountAmount: '',
|
||||||
|
amount: '',
|
||||||
|
dueAmount: '',
|
||||||
|
freight: '',
|
||||||
|
thisPay: '',
|
||||||
|
thisDebt: '',
|
||||||
|
totalDebt: '',
|
||||||
|
advanceBalance: '',
|
||||||
|
bankAccount: '',
|
||||||
|
settleAmount: '',
|
||||||
|
goodsList: [],
|
||||||
|
files: []
|
||||||
|
},
|
||||||
|
rules: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 合计
|
||||||
|
getSummaries(param) {
|
||||||
|
const { columns, data } = param
|
||||||
|
const sums = []
|
||||||
|
columns.forEach((column, index) => {
|
||||||
|
if (index === 0) {
|
||||||
|
sums[index] = '合计'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const values = data.map(item => Number(item[column.property]))
|
||||||
|
if (column.property === 'dueAmount') {
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return prev + curr
|
||||||
|
} else {
|
||||||
|
return prev
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
} else if (column.property === 'cost') {
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return prev + curr
|
||||||
|
} else {
|
||||||
|
return prev
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
} else if (column.property === 'discountAmount') {
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return prev + curr
|
||||||
|
} else {
|
||||||
|
return prev
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
} else if (column.property === 'amount') {
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return prev + curr
|
||||||
|
} else {
|
||||||
|
return prev
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return sums
|
||||||
|
},
|
||||||
|
handleReturn(isreload) {
|
||||||
|
if (isreload === 'true') this.$emit('reloadlist')
|
||||||
|
this.formobj = {
|
||||||
|
sid: '',
|
||||||
|
createBySid: '',
|
||||||
|
createByName: '',
|
||||||
|
useOrgSid: '',
|
||||||
|
createOrgSid: '',
|
||||||
|
remarks: '',
|
||||||
|
deptSid: '',
|
||||||
|
deptName: '',
|
||||||
|
createTime: '',
|
||||||
|
billTypeKey: '',
|
||||||
|
billTypeValue: '',
|
||||||
|
warehouseSid: '',
|
||||||
|
warehouseName: '',
|
||||||
|
deliveryTypeKey: '',
|
||||||
|
deliveryTypeValue: '',
|
||||||
|
logisticsName: '',
|
||||||
|
salesUserSid: '',
|
||||||
|
salesName: '',
|
||||||
|
isFirstPay: '',
|
||||||
|
billPriceTypeKey: '',
|
||||||
|
billPriceTypeValue: '',
|
||||||
|
customerSid: '',
|
||||||
|
customerName: '',
|
||||||
|
shipperName: '',
|
||||||
|
shipperMob: '',
|
||||||
|
deliveryProvinceSid: '',
|
||||||
|
deliveryProvince: '',
|
||||||
|
deliveryCitySid: '',
|
||||||
|
deliveryCity: '',
|
||||||
|
deliveryCountySid: '',
|
||||||
|
deliveryCounty: '',
|
||||||
|
deliveryAddress: '',
|
||||||
|
postCode: '',
|
||||||
|
isInvoicing: '',
|
||||||
|
invoiceTypeKey: '',
|
||||||
|
invoiceType: '',
|
||||||
|
invoiceTitle: '',
|
||||||
|
taxpayerNo: '',
|
||||||
|
taxRate: '',
|
||||||
|
discountRate: '',
|
||||||
|
coupon: '',
|
||||||
|
discountAmount: '',
|
||||||
|
amount: '',
|
||||||
|
dueAmount: '',
|
||||||
|
freight: '',
|
||||||
|
thisPay: '',
|
||||||
|
thisDebt: '',
|
||||||
|
totalDebt: '',
|
||||||
|
advanceBalance: '',
|
||||||
|
bankAccount: '',
|
||||||
|
settleAmount: '',
|
||||||
|
goodsList: [],
|
||||||
|
files: []
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .el-radio-group {
|
||||||
|
display: inline;
|
||||||
|
line-height: 1px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.rowStyle {
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
.rowStyle .el-col {
|
||||||
|
border-right: 0;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
.rowStyle .el-col .span-sty {
|
||||||
|
border-right: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user