完善采购订单数据计算逻辑
This commit is contained in:
@@ -17,6 +17,16 @@ export function getTypeValueList(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据当前登录用户的全路径查询相应部门下的所有人
|
||||||
|
export function selAllByOrgSidPath(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oms/apiadmin/sysstafforg/selAllByOrgSidPath',
|
||||||
|
method: 'post',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 根据部门sid获取客户信息
|
// 根据部门sid获取客户信息
|
||||||
export function chooseCustomerList(data) {
|
export function chooseCustomerList(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -51,17 +51,15 @@ export const constantRoutes = [
|
|||||||
meta: {
|
meta: {
|
||||||
title: '客户管理'
|
title: '客户管理'
|
||||||
},
|
},
|
||||||
children: [
|
children: [{
|
||||||
{
|
path: '/customerInformation/customerInformation',
|
||||||
path: '/customerInformation/customerInformation',
|
component: () => import('@/views/customerManagement/customerInformation/customerInformation'),
|
||||||
component: () => import('@/views/customerManagement/customerInformation/customerInformation'),
|
name: 'CustomerInformation',
|
||||||
name: 'CustomerInformation',
|
meta: {
|
||||||
meta: {
|
title: '客户信息管理',
|
||||||
title: '客户信息管理',
|
noCache: true
|
||||||
noCache: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/salesOrder',
|
path: '/salesOrder',
|
||||||
@@ -112,6 +110,15 @@ export const constantRoutes = [
|
|||||||
title: '采购订单',
|
title: '采购订单',
|
||||||
noCache: true
|
noCache: true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/purchaseReview/index',
|
||||||
|
component: () => import('@/views/purchase/purchaseReview/index'),
|
||||||
|
name: 'PurchaseReview',
|
||||||
|
meta: {
|
||||||
|
title: '订单审核',
|
||||||
|
noCache: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,10 +9,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
<div v-show="isSearchShow" class="search">
|
<div v-show="isSearchShow" class="search">
|
||||||
<el-form :inline="true" class="tab-header">
|
<el-form :inline="true" class="tab-header">
|
||||||
<el-form-item label="单据编号">
|
<el-form-item label="业务日期">
|
||||||
<el-input v-model="queryParams.params.billNo" placeholder="" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="单据日期">
|
|
||||||
<el-date-picker v-model="queryParams.params.createStartTime" type="date" placeholder="选择日期"
|
<el-date-picker v-model="queryParams.params.createStartTime" type="date" placeholder="选择日期"
|
||||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||||
</el-date-picker>至
|
</el-date-picker>至
|
||||||
@@ -20,24 +17,15 @@
|
|||||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="制单人">
|
|
||||||
<el-input v-model="queryParams.params.createByName" placeholder="" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="采购员">
|
|
||||||
<el-input v-model="queryParams.params.purchaserName" placeholder="" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="物流单号">
|
|
||||||
<el-input v-model="queryParams.params.logisticsNum" placeholder="" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="供应商">
|
<el-form-item label="供应商">
|
||||||
<el-select v-model="queryParams.params.supplierName" clearable placeholder="请选择供应商"
|
<el-select v-model="queryParams.params.supplierSid" clearable placeholder="请选择供应商"
|
||||||
style="width: 220px;">
|
style="width: 220px;">
|
||||||
<el-option v-for="item in supplierList" :key="item.sid" :label="item.supplierName" :value="item.sid">
|
<el-option v-for="item in supplierList" :key="item.sid" :label="item.supplierName" :value="item.sid">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="收货仓库">
|
<el-form-item label="仓库">
|
||||||
<el-select v-model="queryParams.params.warehouseName" placeholder="请选择仓库" style="width: 220px;">
|
<el-select v-model="queryParams.params.wareHouseSid" placeholder="请选择仓库" style="width: 220px;">
|
||||||
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName"
|
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName"
|
||||||
:value="item.sid" />
|
:value="item.sid" />
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -49,6 +37,34 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="物流单号">
|
||||||
|
<el-input v-model="queryParams.params.logisticsNum" placeholder="" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="单据编号">
|
||||||
|
<el-input v-model="queryParams.params.billNo" placeholder="" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="制单人">
|
||||||
|
<el-input v-model="queryParams.params.createByName" placeholder="" clearable />
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="业务员">
|
||||||
|
<el-input v-model="queryParams.params.purchaserName" placeholder="" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品">
|
||||||
|
<el-select v-model="queryParams.params.goodsSid" placeholder="请选择" style="width: 220px;">
|
||||||
|
<el-option v-for="(item,i) in goodsList" :key="i" :label="item.name" :value="item.sid">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="queryParams.params.remarks" placeholder="" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="收货状态">
|
||||||
|
<el-select v-model="queryParams.params.receiveStateKey" placeholder="请选择" style="width: 220px;">
|
||||||
|
<el-option v-for="(item,i) in receiveStateList" :key="i" :label="item.dictValue"
|
||||||
|
:value="item.dictKey">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item> -->
|
||||||
<el-form-item label="发货状态">
|
<el-form-item label="发货状态">
|
||||||
<el-select v-model="queryParams.params.deliveryStateKey" placeholder="请选择" style="width: 220px;">
|
<el-select v-model="queryParams.params.deliveryStateKey" placeholder="请选择" style="width: 220px;">
|
||||||
<el-option v-for="(item,i) in deliveryStateList" :key="i" :label="item.dictValue"
|
<el-option v-for="(item,i) in deliveryStateList" :key="i" :label="item.dictValue"
|
||||||
@@ -67,51 +83,61 @@
|
|||||||
<!-- Start 项目列表头部 -->
|
<!-- Start 项目列表头部 -->
|
||||||
<div class="listtop">
|
<div class="listtop">
|
||||||
<div class="tit">采购订单列表</div>
|
<div class="tit">采购订单列表</div>
|
||||||
|
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||||
|
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||||
</div>
|
</div>
|
||||||
<!-- End 项目列表头部 -->
|
<!-- End 项目列表头部 -->
|
||||||
<!-- Start 项目列表 -->
|
<!-- Start 项目列表 -->
|
||||||
<div class="">
|
<div class="">
|
||||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||||
@selection-change="selectionLineChangeHandle" @row-click="rowItemClick" :row-style="isRed">
|
@selection-change="selectionLineChangeHandle" @row-click="rowItemClick" show-summary
|
||||||
<el-table-column fixed width="50" type="selection" align="center" />
|
:summary-method="getSummaries">
|
||||||
|
<el-table-column fixed width="80" type="selection" align="center" />
|
||||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||||
<el-table-column fixed label="操作" align="center">
|
<el-table-column fixed label="操作" align="center" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">查看</el-button>
|
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">查看</el-button>
|
||||||
|
<el-button type="primary" size="mini">物流单号</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="createTime" label="单据日期" width="120" align="center" />
|
<el-table-column prop="createTime" label="业务日期" width="120" align="center" />
|
||||||
<el-table-column prop="billNo" label="单据编号" align="center" />
|
<el-table-column prop="billNo" label="单据编号" width="120" align="center" />
|
||||||
<el-table-column prop="supplierName" label="供应商" align="center" />
|
<el-table-column prop="supplierName" label="供应商" width="150" align="center" />
|
||||||
<el-table-column prop="purchaserName" label="业务员" align="center" />
|
<el-table-column prop="purchaserName" label="业务员" width="120" align="center" />
|
||||||
<el-table-column prop="wareHouseName" label="收货仓库" align="center" />
|
<el-table-column prop="wareHouseName" label="收货仓库" width="150" align="center" />
|
||||||
<el-table-column prop="amountTotal" label="商品总额" align="center" />
|
<el-table-column prop="receiveStateValue" label="状态" width="120" align="center" />
|
||||||
<el-table-column prop="freight" label="采购运费" align="center" />
|
<el-table-column prop="amountTotal" label="商品总额" width="120" align="center" />
|
||||||
<el-table-column prop="otherAmount" label="其他费用" align="center" />
|
<el-table-column prop="freight" label="采购运费" width="120" align="center" />
|
||||||
<el-table-column prop="prepayment" label="预付金额" align="center" />
|
<el-table-column prop="otherAmount" label="其他费用" width="120" align="center" />
|
||||||
<el-table-column prop="logisticsNum" label="物流单号" align="center" />
|
<el-table-column prop="prepayment" label="预付金额" width="120" align="center" />
|
||||||
<el-table-column prop="productProgress" label="生产进度" align="center" />
|
<el-table-column prop="prepayment" label="总税额" width="120" align="center" />
|
||||||
|
<el-table-column prop="logisticsNum" label="物流单号" width="120" align="center" />
|
||||||
|
<el-table-column prop="productProgress" label="生产进度" width="120" align="center" />
|
||||||
|
<el-table-column prop="productProgress" label="未含税总额" width="120" align="center" />
|
||||||
<el-table-column prop="countTotal" label="总采购数量" width="120" align="center" />
|
<el-table-column prop="countTotal" label="总采购数量" width="120" align="center" />
|
||||||
<el-table-column prop="receiveStateValue" label="收货状态" align="center" />
|
<el-table-column prop="countTotal" label="总入库数量" width="120" align="center" />
|
||||||
<el-table-column prop="deliveryStateValue" label="发货状态" align="center" />
|
<el-table-column prop="countTotal" label="总入库金额" width="120" align="center" />
|
||||||
<el-table-column prop="createByName" label="制单人" align="center" />
|
<!-- <el-table-column prop="receiveStateValue" label="收货状态" align="center" /> -->
|
||||||
<el-table-column prop="remarks" label="备注" align="center" />
|
<el-table-column prop="deliveryStateValue" label="发货状态" width="120" align="center" />
|
||||||
|
<el-table-column prop="remarks" label="备注" width="200" align="center" />
|
||||||
|
<el-table-column prop="createByName" label="创建人" align="center" />
|
||||||
|
<el-table-column prop="remarks" label="最后修改时间" width="150" align="center" />
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<!-- End 项目列表 -->
|
<!-- End 项目列表 -->
|
||||||
<div class="pages">
|
<!-- <div class="pages">
|
||||||
<div class="tit" />
|
<div class="tit" /> -->
|
||||||
<!-- 翻页 -->
|
<!-- 翻页 -->
|
||||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
<!-- <pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
|
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect"
|
||||||
|
text-color="#666" active-text-color="white">
|
||||||
|
|
||||||
<el-menu :default-active="activeIndex" class="el-menu-demo" style="margin-top: -10px;" mode="horizontal"
|
|
||||||
@select="handleSelect">
|
|
||||||
<el-menu-item index="1">采购明细</el-menu-item>
|
<el-menu-item index="1">采购明细</el-menu-item>
|
||||||
<el-menu-item index="2">费用/预付款</el-menu-item>
|
<el-menu-item index="2">费用/预付款</el-menu-item>
|
||||||
<el-menu-item index="3">附件</el-menu-item>
|
<el-menu-item index="3">附 件</el-menu-item>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
|
|
||||||
<div v-show="activeIndex=='1'" style="margin-bottom: 50px;">
|
<div v-show="activeIndex=='1'" style="margin-bottom: 50px;">
|
||||||
@@ -231,6 +257,12 @@
|
|||||||
purchaseBillDetailList: {}
|
purchaseBillDetailList: {}
|
||||||
},
|
},
|
||||||
btnList: [{
|
btnList: [{
|
||||||
|
type: 'primary',
|
||||||
|
size: 'small',
|
||||||
|
icon: 'submit',
|
||||||
|
btnKey: 'toSubmit',
|
||||||
|
btnLabel: '提交审核'
|
||||||
|
}, {
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
size: 'small',
|
size: 'small',
|
||||||
icon: 'plus',
|
icon: 'plus',
|
||||||
@@ -247,7 +279,7 @@
|
|||||||
{
|
{
|
||||||
type: 'danger',
|
type: 'danger',
|
||||||
size: 'small',
|
size: 'small',
|
||||||
icon: 'plus',
|
icon: 'del',
|
||||||
btnKey: 'doDel',
|
btnKey: 'doDel',
|
||||||
btnLabel: '删除'
|
btnLabel: '删除'
|
||||||
},
|
},
|
||||||
@@ -265,7 +297,9 @@
|
|||||||
total: 0,
|
total: 0,
|
||||||
params: {
|
params: {
|
||||||
"supplierName": "",
|
"supplierName": "",
|
||||||
|
"supplierSid": "",
|
||||||
"wareHouseName": "",
|
"wareHouseName": "",
|
||||||
|
"wareHouseSid": "",
|
||||||
"receiveStateKey": "",
|
"receiveStateKey": "",
|
||||||
"logisticsNum": "",
|
"logisticsNum": "",
|
||||||
"deliveryStateKey": "",
|
"deliveryStateKey": "",
|
||||||
@@ -275,6 +309,10 @@
|
|||||||
"createStartTime": "",
|
"createStartTime": "",
|
||||||
"createEndTime": "",
|
"createEndTime": "",
|
||||||
"orgLevelKey": "",
|
"orgLevelKey": "",
|
||||||
|
"menuUrl": "",
|
||||||
|
"orgPath": "",
|
||||||
|
"userSid": "",
|
||||||
|
"goodsSid": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sids: [],
|
sids: [],
|
||||||
@@ -283,6 +321,7 @@
|
|||||||
deliveryStateList: [],
|
deliveryStateList: [],
|
||||||
warehouseList: [],
|
warehouseList: [],
|
||||||
supplierList: [],
|
supplierList: [],
|
||||||
|
goodsList: [],
|
||||||
createOrgSid: "",
|
createOrgSid: "",
|
||||||
rowItemData: [],
|
rowItemData: [],
|
||||||
}
|
}
|
||||||
@@ -293,7 +332,7 @@
|
|||||||
created() {
|
created() {
|
||||||
|
|
||||||
getOrgSidByPath({
|
getOrgSidByPath({
|
||||||
orgPath: window.sessionStorage.getItem('defaultOrgPath')
|
orgPath: window.sessionStorage.getItem('orgSid')
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.createOrgSid = res.data
|
this.createOrgSid = res.data
|
||||||
@@ -332,7 +371,7 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
getWarehouses({
|
getWarehouses({
|
||||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
orgPath: window.sessionStorage.getItem('orgSid'),
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.warehouseList = res.data
|
this.warehouseList = res.data
|
||||||
@@ -343,10 +382,109 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 合计
|
||||||
|
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 === 'amountTotal') { //商品总额
|
||||||
|
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 === 'freight') { //采购运费
|
||||||
|
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 === 'otherAmount') { //其他费用
|
||||||
|
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 === 'prepayment') { //总税额
|
||||||
|
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 === 'productProgress') { //未含税总额
|
||||||
|
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 === 'countTotal') { //总采购数量
|
||||||
|
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 === 'countTotal') { // 已入库数量
|
||||||
|
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 === 'countTotal') { //已入库金额
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return prev + curr
|
||||||
|
} else {
|
||||||
|
return prev
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return sums
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
rowItemClick(row) {
|
rowItemClick(row) {
|
||||||
console.log("row", row);
|
console.log("row", row);
|
||||||
|
|
||||||
// this.rowItemData = [row];
|
this.rowItemData = [row];
|
||||||
|
|
||||||
req.fetchDetailsBySid(row.sid).then((resp) => {
|
req.fetchDetailsBySid(row.sid).then((resp) => {
|
||||||
if (resp.success) {
|
if (resp.success) {
|
||||||
@@ -367,17 +505,6 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
isRed({
|
|
||||||
row
|
|
||||||
}) {
|
|
||||||
// const checkIdList = this.rowItemData.map((item) => item.sid);
|
|
||||||
// if (checkIdList.includes(row.sid)) {
|
|
||||||
// return {
|
|
||||||
// backgroundColor: "#34A1DB",
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
|
|
||||||
handleSelect(val) {
|
handleSelect(val) {
|
||||||
console.log("val", val);
|
console.log("val", val);
|
||||||
this.activeIndex = val
|
this.activeIndex = val
|
||||||
@@ -404,6 +531,9 @@
|
|||||||
},
|
},
|
||||||
btnHandle(btnKey) {
|
btnHandle(btnKey) {
|
||||||
switch (btnKey) {
|
switch (btnKey) {
|
||||||
|
case 'toSubmit':
|
||||||
|
this.toSubmit()
|
||||||
|
break
|
||||||
case 'toAdd':
|
case 'toAdd':
|
||||||
this.toAdd()
|
this.toAdd()
|
||||||
break
|
break
|
||||||
@@ -423,7 +553,7 @@
|
|||||||
loadList() {
|
loadList() {
|
||||||
this.tableLoading = true
|
this.tableLoading = true
|
||||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
this.queryParams.params.orgPath = window.sessionStorage.getItem('orgSidPath')
|
||||||
this.queryParams.params.menuUrl = this.$route.path
|
this.queryParams.params.menuUrl = this.$route.path
|
||||||
req.listPage(this.queryParams).then((resp) => {
|
req.listPage(this.queryParams).then((resp) => {
|
||||||
this.tableLoading = false
|
this.tableLoading = false
|
||||||
@@ -477,7 +607,9 @@
|
|||||||
total: 0,
|
total: 0,
|
||||||
params: {
|
params: {
|
||||||
"supplierName": "",
|
"supplierName": "",
|
||||||
|
"supplierSid": "",
|
||||||
"wareHouseName": "",
|
"wareHouseName": "",
|
||||||
|
"wareHouseSid": "",
|
||||||
"receiveStateKey": "",
|
"receiveStateKey": "",
|
||||||
"logisticsNum": "",
|
"logisticsNum": "",
|
||||||
"deliveryStateKey": "",
|
"deliveryStateKey": "",
|
||||||
@@ -487,10 +619,25 @@
|
|||||||
"createStartTime": "",
|
"createStartTime": "",
|
||||||
"createEndTime": "",
|
"createEndTime": "",
|
||||||
"orgLevelKey": "",
|
"orgLevelKey": "",
|
||||||
|
"menuUrl": "",
|
||||||
|
"orgPath": "",
|
||||||
|
"userSid": "",
|
||||||
|
"goodsSid": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.loadList()
|
this.loadList()
|
||||||
},
|
},
|
||||||
|
toSubmit() {
|
||||||
|
if (this.sids.length > 0) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
showClose: true,
|
||||||
|
message: '请至少选择一条记录进行操作'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
toAdd() {
|
toAdd() {
|
||||||
this.viewState = 2
|
this.viewState = 2
|
||||||
this.$refs['divadd'].showAdd()
|
this.$refs['divadd'].showAdd()
|
||||||
@@ -596,4 +743,18 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-menu-item.is-active {
|
||||||
|
background-color: #3370ff !important;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
span {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-submenu__title.is-active {
|
||||||
|
background: #1c88cf !important;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -22,15 +22,15 @@
|
|||||||
<el-row class="first_row">
|
<el-row class="first_row">
|
||||||
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="span-sty">制单人</div>
|
<div class="span-sty">申请人</div>
|
||||||
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item>
|
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="span-sty">制单部门</div>
|
<div class="span-sty">申请部门</div>
|
||||||
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item>
|
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="span-sty">制单日期</div>
|
<div class="span-sty">申请日期</div>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-date-picker v-model="formobj.createTime" type="date" class="addinputw addinputInfo"
|
<el-date-picker v-model="formobj.createTime" type="date" class="addinputw addinputInfo"
|
||||||
value-format="yyyy-MM-dd" placeholder="选择日期">
|
value-format="yyyy-MM-dd" placeholder="选择日期">
|
||||||
@@ -93,10 +93,108 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<div class="span-sty">备注</div>
|
||||||
|
<el-form-item> <el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo"
|
||||||
|
type="textarea" :rows="4" clearable /></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<div class="title titleOne" style="margin-top: 10px;">
|
||||||
|
<div>商品列表</div>
|
||||||
|
<el-button type="primary" size="mini" class="btntopblueline" @click="goodsAdd()">添加</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table v-loading="listLoading" :data="formobj.purchaseBillDetailList" border style="width: 100%;"
|
||||||
|
show-summary :summary-method="getSummaries">
|
||||||
|
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
|
||||||
|
<el-table-column fixed width="80" label="序号" type="index" :index="indexMethod" align="center" />
|
||||||
|
<el-table-column fixed label="操作" wid align="center" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="primary" size="mini" @click="deleteGoods(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="商品编码" prop="goodsSkuCode" width="150" align="center" />
|
||||||
|
<el-table-column label="商品名称" prop="goodsName" width="150" align="center" />
|
||||||
|
<el-table-column label="商品规格" prop="goodsSkuOwnSpec" width="150" align="center" />
|
||||||
|
<el-table-column label="单位" prop="unit" width="120" align="center" />
|
||||||
|
<el-table-column label="采购数量" align="center" prop="count" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.count" clearable placeholder=""
|
||||||
|
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" @input="calculation(scope.row,'count',$event)" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="数量(pcs)" prop="pcsNum" align="center" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.pcsNum" clearable placeholder=""
|
||||||
|
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="数量(pcs)" prop="pcsNum" width="120" align="center" /> -->
|
||||||
|
<el-table-column label="吊牌价" prop="tagPrice" width="120" align="center" />
|
||||||
|
<!-- <el-table-column label="单价" prop="cost" width="120" align="center" /> -->
|
||||||
|
<el-table-column label="单价" align="center" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.cost" clearable placeholder=""
|
||||||
|
@input="calculation(scope.row,'cost',$event)"
|
||||||
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="折扣率(%)" align="center" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.discountRate" clearable placeholder=""
|
||||||
|
@input="calculation(scope.row,'count',$event)"
|
||||||
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="discountPrice" label="折扣单价" width="120" align="center" />
|
||||||
|
<el-table-column prop="shareAmount" label="分摊金额" width="150" align="center" />
|
||||||
|
<el-table-column prop="amount" label="总价" width="120" align="center" />
|
||||||
|
<!-- <el-table-column prop="taxRate" label="税率" width="120" align="center" /> -->
|
||||||
|
<el-table-column label="税率(%)" align="center" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.taxRate" clearable placeholder=""
|
||||||
|
@input="calculation(scope.row,'count',$event)"
|
||||||
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="notTaxPprice" label="未含税价" width="120" align="center" />
|
||||||
|
<el-table-column prop="totalTax" label="总税额" width="120" align="center" />
|
||||||
|
<el-table-column prop="totalNotTaxPprice" label="未含总税价" width="120" align="center" />
|
||||||
|
<!-- <el-table-column prop="purchaseCycle" label="采购周期" width="120" align="center" /> -->
|
||||||
|
<el-table-column label="采购周期" align="center" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.purchaseCycle" clearable placeholder="" @input="computeDate(scope.row)"
|
||||||
|
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" /> </template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="deliveryDate" label="预计到货日期" width="180" align="center" />
|
||||||
|
<!-- <el-table-column label="预计到货日期" align="center" min-width="250">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-date-picker v-model="scope.row.deliveryDate" type="date" value-format="yyyy-MM-dd"
|
||||||
|
placeholder="选择日期" />
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<!-- <el-table-column prop="manufactureDate" label="生产日期" width="120" align="center" /> -->
|
||||||
|
<el-table-column label="生产日期" align="center" min-width="250">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-date-picker v-model="scope.row.manufactureDate" type="date" value-format="yyyy-MM-dd"
|
||||||
|
placeholder="选择日期" @change="manufactureDateChange(scope.row)" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="overdueDate" label="过期日期" width="120" align="center" />
|
||||||
|
<el-table-column prop="batchNumber" label="批次号" width="200" align="center" />
|
||||||
|
<el-table-column prop="itemNumber" label="货号" width="120" align="center" />
|
||||||
|
<el-table-column label="备注" align="center" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.remarks" clearable placeholder="" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<el-row class="first_row" style="margin-top: 10px;">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="span-sty">采购运费</div>
|
<div class="span-sty">采购运费</div>
|
||||||
<el-form-item prop="freight"> <el-input class="addinputw addinputInfo"
|
<el-form-item prop="freight"> <el-input class="addinputw addinputInfo"
|
||||||
v-model="formobj.purchaseBillAmount.freight" clearable placeholder=""
|
v-model="formobj.purchaseBillAmount.freight" clearable placeholder="" @change="computeShareAmount"
|
||||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /></el-form-item>
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /></el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
@@ -128,6 +226,7 @@
|
|||||||
<div class="span-sty">其他费用</div>
|
<div class="span-sty">其他费用</div>
|
||||||
<el-form-item prop="otherAmountName"> <el-input class="addinputw addinputInfo"
|
<el-form-item prop="otherAmountName"> <el-input class="addinputw addinputInfo"
|
||||||
v-model="formobj.purchaseBillAmount.otherAmountName" clearable placeholder=""
|
v-model="formobj.purchaseBillAmount.otherAmountName" clearable placeholder=""
|
||||||
|
@change="computeShareAmount"
|
||||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@@ -161,54 +260,6 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
|
||||||
<el-col :span="24">
|
|
||||||
<div class="span-sty">备注</div>
|
|
||||||
<el-form-item> <el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo"
|
|
||||||
type="textarea" :rows="4" clearable /></el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<div class="title titleOne">
|
|
||||||
<div>商品列表</div>
|
|
||||||
<el-button type="primary" size="mini" class="btntopblueline" @click="goodsAdd()">添加</el-button>
|
|
||||||
</div>
|
|
||||||
<el-table v-loading="listLoading" :data="formobj.purchaseBillDetailList" border style="width: 100%;">
|
|
||||||
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
|
|
||||||
<el-table-column fixed width="80" label="序号" type="index" :index="indexMethod" align="center" />
|
|
||||||
<el-table-column fixed label="操作" wid align="center" width="100">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button type="primary" size="mini" @click="deleteGoods(scope.row)">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="商品编码" prop="goodsSkuCode" width="150" align="center" />
|
|
||||||
<el-table-column label="商品名称" prop="goodsSpuName" width="150" align="center" />
|
|
||||||
<el-table-column label="商品规格" prop="goodsSkuOwnSpec" width="150" align="center" />
|
|
||||||
<el-table-column label="单位" prop="unit" width="120" align="center" />
|
|
||||||
<el-table-column label="采购数量" align="center" width="150">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-input v-model="scope.row.count" clearable placeholder=""
|
|
||||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" @input="calculation(scope.row)" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="单价" prop="cost" width="120" align="center" />
|
|
||||||
<el-table-column label="折扣率(%)" align="center" width="150">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-input v-model="scope.row.discountRate" clearable placeholder=""
|
|
||||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"
|
|
||||||
@input="calculation(scope.row)" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="discountPrice" label="折扣单价" width="120" align="center" />
|
|
||||||
<!-- <el-table-column prop="shareAmount" label="分摊金额" width="150" align="center" /> -->
|
|
||||||
<el-table-column prop="amount" label="总价" width="120" align="center" />
|
|
||||||
<el-table-column label="预计到货日期" align="center" min-width="250">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-date-picker v-model="scope.row.deliveryDate" type="date" value-format="yyyy-MM-dd"
|
|
||||||
placeholder="选择日期" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@@ -270,8 +321,8 @@
|
|||||||
"deptSid": window.sessionStorage.getItem('departmentSid'),
|
"deptSid": window.sessionStorage.getItem('departmentSid'),
|
||||||
"deptName": window.sessionStorage.getItem('departmentName'),
|
"deptName": window.sessionStorage.getItem('departmentName'),
|
||||||
"useOrgSid": window.sessionStorage.getItem('orgSid'),
|
"useOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||||
"createOrgSid": window.sessionStorage.getItem('orgSid'),
|
"createOrgSid": window.sessionStorage.getItem('departmentSid'),
|
||||||
"orgPath": window.sessionStorage.getItem('orgSid'),
|
"orgPath": window.sessionStorage.getItem('orgSidPath'),
|
||||||
"purchaseBillAmount": {
|
"purchaseBillAmount": {
|
||||||
"sid": "",
|
"sid": "",
|
||||||
"billSid": "",
|
"billSid": "",
|
||||||
@@ -338,7 +389,14 @@
|
|||||||
}],
|
}],
|
||||||
|
|
||||||
},
|
},
|
||||||
imgList: []
|
imgList: [],
|
||||||
|
allCount: 0,
|
||||||
|
allPcsNum: 0,
|
||||||
|
allShareAmount: 0,
|
||||||
|
allAmount: 0,
|
||||||
|
allNotTaxPprice: 0,
|
||||||
|
allTotalTax: 0,
|
||||||
|
allTotalNotTaxPprice: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -415,10 +473,268 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
calculation(row) {
|
// 合计
|
||||||
|
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 === 'count') { // 数量
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
this.allCount = prev + curr
|
||||||
|
return (Number(prev) + Number(curr)).toFixed(2)
|
||||||
|
} else {
|
||||||
|
this.allCount = prev
|
||||||
|
return Number(prev).toFixed(2)
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
} else if (column.property === 'pcsNum') { // 数量pcs
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
this.allPcsNum = prev + curr
|
||||||
|
return (Number(prev) + Number(curr)).toFixed(2)
|
||||||
|
} else {
|
||||||
|
this.allPcsNum = prev
|
||||||
|
return Number(prev).toFixed(2)
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
} else if (column.property === 'shareAmount') { //分摊金额
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
this.allShareAmount = prev + curr
|
||||||
|
return (Number(prev) + Number(curr)).toFixed(2)
|
||||||
|
} else {
|
||||||
|
this.allShareAmount = prev
|
||||||
|
return Number(prev).toFixed(2)
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
} else if (column.property === 'amount') { //总价
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
this.allAmount = prev + curr
|
||||||
|
return (Number(prev) + Number(curr)).toFixed(2)
|
||||||
|
} else {
|
||||||
|
this.allAmount = prev
|
||||||
|
return Number(prev).toFixed(2)
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
} else if (column.property === 'notTaxPprice') { //未含税价
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
this.allNotTaxPprice = prev + curr
|
||||||
|
return (Number(prev) + Number(curr)).toFixed(2)
|
||||||
|
} else {
|
||||||
|
this.allNotTaxPprice = prev
|
||||||
|
return Number(prev).toFixed(2)
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
} else if (column.property === 'totalTax') { //总税额
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
this.allTotalTax = prev + curr
|
||||||
|
return (Number(prev) + Number(curr)).toFixed(2)
|
||||||
|
} else {
|
||||||
|
this.allTotalTax = prev
|
||||||
|
return Number(prev).toFixed(2)
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
} else if (column.property === 'totalNotTaxPprice') { //未含税总价
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
this.allTotalNotTaxPprice = prev + curr
|
||||||
|
return (Number(prev) + Number(curr)).toFixed(2)
|
||||||
|
} else {
|
||||||
|
this.allTotalNotTaxPprice = prev
|
||||||
|
return Number(prev).toFixed(2)
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return sums
|
||||||
|
},
|
||||||
|
|
||||||
|
// 清除分摊金额 并反算
|
||||||
|
calculation(row, updateProp, event) {
|
||||||
|
|
||||||
|
this.formobj.purchaseBillAmount.freight = 0.00
|
||||||
|
this.formobj.purchaseBillAmount.otherAmountName = 0.00
|
||||||
|
|
||||||
|
// 重新计算
|
||||||
|
// 除去修改单价时 修改其他字段都先计算出单价 然后其他价格数据在计算一次
|
||||||
|
// 如果修改的是单价 则先把本条数据直接赋值单价 然后其他价格数据在计算一次
|
||||||
|
// 后需要把列表其他数据先计算出单价字段 然后其他价格数据在计算一次
|
||||||
|
for (var i = 0; i < this.formobj.purchaseBillDetailList.length; i++) {
|
||||||
|
|
||||||
|
var item = this.formobj.purchaseBillDetailList[i]
|
||||||
|
|
||||||
|
if (row.sid != item.sid) {
|
||||||
|
// 列表其他数据 先计算单价
|
||||||
|
// item.cost = (Number(item.cost) - Number(item.shareAmount) / Number(item.count)).toFixed(2)
|
||||||
|
item.cost = Number(item.cost1)
|
||||||
|
this.calculation2(item)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// if (updateProp == 'count') {
|
||||||
|
// // 修改的是数量
|
||||||
|
// item.cost = Number(item.cost1)
|
||||||
|
// this.calculation2(item)
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (updateProp == 'cost') {
|
||||||
|
// 修改的不是单价
|
||||||
|
this.calculation2(item)
|
||||||
|
} else {
|
||||||
|
item.cost = Number(item.cost1)
|
||||||
|
this.calculation2(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (updateProp == 'discountRate') {
|
||||||
|
// // 修改的是折扣率
|
||||||
|
// item.cost = Number(item.cost1)
|
||||||
|
// this.calculation2(item)
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (updateProp == 'taxRate') {
|
||||||
|
// // 修改的是税率
|
||||||
|
// item.cost = Number(item.cost1)
|
||||||
|
// this.calculation2(item)
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 最后把列表所有的分摊金额赋值成0
|
||||||
|
item.shareAmount = 0.00
|
||||||
|
item.cost1 = Number(item.cost)
|
||||||
|
item.count1 = Number(item.count)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
calculation2(row) {
|
||||||
|
|
||||||
|
// 折后单价 = 单价*折扣率 / 100
|
||||||
row.discountPrice = (Number(row.cost) * Number(row.discountRate) / 100).toFixed(2)
|
row.discountPrice = (Number(row.cost) * Number(row.discountRate) / 100).toFixed(2)
|
||||||
row.amount = (Number(row.count) * Number(row.discountPrice)).toFixed(2)
|
// console.log("calculation》》》》", row.discountPrice)
|
||||||
|
|
||||||
|
// 总价 = 单价* 数量*折扣率 / 100
|
||||||
|
row.amount = (Number(row.count) * Number(row.cost) * Number(row.discountRate) / 100).toFixed(2)
|
||||||
|
// console.log("calculation》》》》", row.amount)
|
||||||
|
|
||||||
|
// 总税额 = 总价/(1+税率)*税率
|
||||||
|
row.totalTax = (Number(row.amount) / (1 + Number(row.taxRate) / 100) * Number(row.taxRate) / 100)
|
||||||
|
.toFixed(2)
|
||||||
|
// console.log("calculation2》》》》", row.totalTax)
|
||||||
|
|
||||||
|
// 未含税价 =(总价-总税额)/数量
|
||||||
|
row.notTaxPprice = ((Number(row.amount) - Number(row.totalTax)) / row.count).toFixed(2)
|
||||||
|
// console.log("calculation2》》》》", row.notTaxPprice)
|
||||||
|
|
||||||
|
// 未含税总价 = 总价-总税额
|
||||||
|
row.totalNotTaxPprice = (Number(row.amount) - Number(row.totalTax)).toFixed(2)
|
||||||
|
// console.log("calculation2》》》》", row.totalNotTaxPprice)
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
computeDate(row) {
|
||||||
|
// 预计到货日期 = 当前日期+采购周期
|
||||||
|
row.deliveryDate = this.addDate(getCurrentDate(), Number(row.purchaseCycle))
|
||||||
|
|
||||||
|
},
|
||||||
|
manufactureDateChange(row) {
|
||||||
|
|
||||||
|
console.log("manufactureDateChange》》》》", row.manufactureDate)
|
||||||
|
console.log("manufactureDateChange》》》》", row.shelfLife)
|
||||||
|
row.overdueDate = this.addDate(row.manufactureDate, Number(row.shelfLife))
|
||||||
|
|
||||||
|
let reg = new RegExp('-', 'g') //g代表全部
|
||||||
|
|
||||||
|
row.batchNumber = row.manufactureDate.replace(reg, '') + " - " + row.overdueDate.replace(reg, '')
|
||||||
|
|
||||||
|
},
|
||||||
|
// days 只能是int
|
||||||
|
addDate(date, days) {
|
||||||
|
var dates = new Date(date)
|
||||||
|
dates.setDate(dates.getDate() + days)
|
||||||
|
var year = dates.getFullYear()
|
||||||
|
var month = dates.getMonth() + 1
|
||||||
|
var day = dates.getDate()
|
||||||
|
if (month < 9) {
|
||||||
|
month = "0" + month
|
||||||
|
}
|
||||||
|
if (day < 9) {
|
||||||
|
day = "0" + day
|
||||||
|
}
|
||||||
|
var time = year + '-' + month + '-' + day
|
||||||
|
return time
|
||||||
|
},
|
||||||
|
|
||||||
|
// 计算分摊金额
|
||||||
|
computeShareAmount() {
|
||||||
|
// 分摊金额 = (采购运费+其他费用)*单价*数量/所有商品总价
|
||||||
|
|
||||||
|
var price = Number(this.formobj.purchaseBillAmount.freight) + Number(this.formobj.purchaseBillAmount
|
||||||
|
.otherAmountName)
|
||||||
|
|
||||||
|
var all = 0 // 除去最后一个的分摊总和
|
||||||
|
var totalAmount = 0 // 原所有商品总价
|
||||||
|
for (var i = 0; i < this.formobj.purchaseBillDetailList.length; i++) {
|
||||||
|
|
||||||
|
var item = this.formobj.purchaseBillDetailList[i]
|
||||||
|
totalAmount = (Number(totalAmount) + Number(Number(item.cost1) * Number(item.count1))).toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 分摊金额 = (采购运费+其他费用)*单价*数量/ 原所有商品总价
|
||||||
|
|
||||||
|
for (var i = 0; i < this.formobj.purchaseBillDetailList.length; i++) {
|
||||||
|
|
||||||
|
var item = this.formobj.purchaseBillDetailList[i]
|
||||||
|
|
||||||
|
if (i == this.formobj.purchaseBillDetailList.length - 1) {
|
||||||
|
// 最后一条数据
|
||||||
|
item.shareAmount = (Number(price) - Number(all)).toFixed(2)
|
||||||
|
item.cost = (Number(item.cost1) + (Number(item.shareAmount) / Number(item.count))).toFixed(2)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
item.shareAmount = (Number(price) * Number(item.cost1) * Number(item.count) / Number(totalAmount))
|
||||||
|
.toFixed(2)
|
||||||
|
item.cost = (Number(item.cost1) + (Number(item.shareAmount) / Number(item.count))).toFixed(2)
|
||||||
|
all += Number(item.shareAmount)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// this.calculation(item)
|
||||||
|
this.calculation2(item)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -456,35 +772,38 @@
|
|||||||
this.viewState = 1
|
this.viewState = 1
|
||||||
console.log('>>>>>>>>>backData', value)
|
console.log('>>>>>>>>>backData', value)
|
||||||
|
|
||||||
|
|
||||||
for (var i = 0; i < value.length; i++) {
|
for (var i = 0; i < value.length; i++) {
|
||||||
|
|
||||||
this.formobj.purchaseBillDetailList.push(
|
this.formobj.purchaseBillDetailList.push({
|
||||||
|
"sid": value[i].sid != null ? value[i].sid : '',
|
||||||
{
|
"goodsSkuCode": value[i].goodsSkuCode != null ? value[i].goodsSkuCode : '',
|
||||||
|
"goodsName": value[i].goodsName != null ? value[i].goodsName : '',
|
||||||
"sid": "",
|
"barCode": value[i].barCode != null ? value[i].barCode : '',
|
||||||
"remarks": "",
|
"goodsSkuOwnSpec": value[i].goodsSkuOwnSpec != null ? value[i].goodsSkuOwnSpec : '',
|
||||||
"billSid": "",
|
"unit": value[i].unit != null ? value[i].unit : '',
|
||||||
"goodsSpuSid": value[i].sid,
|
"count": value[i].count != null ? value[i].count : '0',
|
||||||
"goodsSpuName": value[i].goodsName,
|
"count1": value[i].count != null ? value[i].count : '0',
|
||||||
"goodsSkuSid": "",
|
"pcsNum": value[i].pcsNum != null ? value[i].pcsNum : '0',
|
||||||
"goodsSkuTitle": "",
|
"tagPrice": value[i].tagPrice != null ? value[i].tagPrice : '',
|
||||||
"goodsSkuCode": value[i].goodsSkuCode,
|
"cost": value[i].cost != null ? value[i].cost : '',
|
||||||
"goodsSN": "",
|
"cost1": value[i].cost != null ? value[i].cost : '',
|
||||||
"goodsNum": "",
|
"discountRate": value[i].discountRate != null ? value[i].discountRate : '100',
|
||||||
"goodsSkuOwnSpec": value[i].goodsSkuOwnSpec,
|
"discountPrice": value[i].discountPrice != null ? value[i].discountPrice : '0.00',
|
||||||
"unit": value[i].unit,
|
"shareAmount": value[i].shareAmount != null ? value[i].shareAmount : '0.00',
|
||||||
"cost": value[i].cost,
|
"amount": value[i].amount != null ? value[i].amount : '0.00',
|
||||||
"count": "0",
|
"taxRate": value[i].taxRate != null ? value[i].taxRate : '',
|
||||||
"discountRate": value[i].discountRate,
|
"notTaxPprice": value[i].notTaxPprice != null ? value[i].notTaxPprice : '',
|
||||||
"discountPrice": "0.00",
|
"totalTax": value[i].totalTax != null ? value[i].totalTax : '',
|
||||||
"shareAmount": "0.00",
|
"totalNotTaxPprice": value[i].totalNotTaxPprice != null ? value[i].totalNotTaxPprice : '',
|
||||||
"shareRate": "0.00",
|
"purchaseCycle": value[i].purchaseCycle != null ? value[i].purchaseCycle : '',
|
||||||
"amount": "0.00",
|
"deliveryDate": value[i].deliveryDate != null ? value[i].deliveryDate : '',
|
||||||
"cycle": "",
|
"manufactureDate": value[i].manufactureDate != null ? value[i].manufactureDate : '',
|
||||||
"deliveryDate": "",
|
"shelfLife": value[i].shelfLife != null ? value[i].shelfLife : '',
|
||||||
"taxAmount": "0.00",
|
"overdueDate": value[i].overdueDate != null ? value[i].overdueDate : '',
|
||||||
"taxPrice": "0.00"
|
"batchNumber": value[i].batchNumber != null ? value[i].batchNumber : '',
|
||||||
|
"itemNumber": value[i].itemNumber != null ? value[i].itemNumber : '',
|
||||||
|
"remarks": value[i].remarks != null ? value[i].remarks : ''
|
||||||
}
|
}
|
||||||
|
|
||||||
)
|
)
|
||||||
@@ -585,9 +904,9 @@
|
|||||||
"wareHouseName": "",
|
"wareHouseName": "",
|
||||||
"deptSid": window.sessionStorage.getItem('departmentSid'),
|
"deptSid": window.sessionStorage.getItem('departmentSid'),
|
||||||
"deptName": window.sessionStorage.getItem('departmentName'),
|
"deptName": window.sessionStorage.getItem('departmentName'),
|
||||||
"useOrgSid": '',
|
"useOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||||
"createOrgSid": '',
|
"createOrgSid": window.sessionStorage.getItem('departmentSid'),
|
||||||
"orgPath": '',
|
"orgPath": window.sessionStorage.getItem('orgSidPath'),
|
||||||
"purchaseBillAmount": {
|
"purchaseBillAmount": {
|
||||||
"sid": "",
|
"sid": "",
|
||||||
"billSid": "",
|
"billSid": "",
|
||||||
@@ -656,6 +975,7 @@
|
|||||||
.then(resp => {
|
.then(resp => {
|
||||||
if (resp.success) {
|
if (resp.success) {
|
||||||
this.formobj = resp.data
|
this.formobj = resp.data
|
||||||
|
|
||||||
loading.close()
|
loading.close()
|
||||||
this.imgList = []
|
this.imgList = []
|
||||||
for (var i = 0; i < resp.data.purchaseAppendixList.length; i++) {
|
for (var i = 0; i < resp.data.purchaseAppendixList.length; i++) {
|
||||||
|
|||||||
@@ -63,8 +63,43 @@
|
|||||||
class="addinputInfo">{{ formobj.purchaseBillAmount.currencyValue }}</span></el-form-item>
|
class="addinputInfo">{{ formobj.purchaseBillAmount.currencyValue }}</span></el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<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>
|
||||||
|
|
||||||
|
<div class="title titleOne" style="margin-top: 10px;">
|
||||||
|
<div>商品列表</div>
|
||||||
|
</div>
|
||||||
|
<el-table v-loading="listLoading" :data="formobj.purchaseBillDetailList" border style="width: 100%;">
|
||||||
|
<el-table-column fixed width="80" label="序号" type="index" :index="indexMethod" align="center" />
|
||||||
|
<el-table-column prop="goodsName" label="商品名称" width="120" align="center" />
|
||||||
|
<el-table-column prop="goodsSkuCode" label="商品编码" width="120" align="center" />
|
||||||
|
<el-table-column prop="goodsSkuOwnSpec" label="规格型号" width="120" align="center" />
|
||||||
|
<el-table-column prop="unit" label="单位" align="center" />
|
||||||
|
<el-table-column prop="count" label="采购数量" width="120" align="center" />
|
||||||
|
<el-table-column label="数量(pcs)" prop="pcsNum" align="center" width="150" />
|
||||||
|
<el-table-column label="吊牌价" prop="tagPrice" width="120" align="center" />
|
||||||
|
<el-table-column label="单价" prop="cost" width="120" align="center" />
|
||||||
|
<el-table-column prop="discountRate" label="折扣率(%)" width="120" align="center" />
|
||||||
|
<el-table-column prop="discountPrice" label="折扣单价" width="120" align="center" />
|
||||||
|
<el-table-column prop="shareAmount" label="分摊金额" width="150" align="center" />
|
||||||
|
<el-table-column prop="amount" label="总价" width="120" align="center" />
|
||||||
|
<el-table-column prop="taxRate" label="税率" width="120" align="center" />
|
||||||
|
<el-table-column prop="notTaxPprice" label="未含税价" width="120" align="center" />
|
||||||
|
<el-table-column prop="totalTax" label="总税额" width="120" align="center" />
|
||||||
|
<el-table-column prop="totalNotTaxPprice" label="未含总税价" width="120" align="center" />
|
||||||
|
<el-table-column prop="purchaseCycle" label="采购周期" width="120" align="center" />
|
||||||
|
<el-table-column prop="deliveryDate" label="预计到货日期" width="180" align="center" />
|
||||||
|
<el-table-column prop="manufactureDate" label="生产日期" width="180" align="center" />
|
||||||
|
<el-table-column prop="overdueDate" label="过期日期" width="120" align="center" />
|
||||||
|
<el-table-column prop="batchNumber" label="批次号" width="200" align="center" />
|
||||||
|
<el-table-column prop="itemNumber" label="货号" width="120" align="center" />
|
||||||
|
<el-table-column prop="remarks" label="备注" width="120" align="center" />
|
||||||
|
</el-table>
|
||||||
|
<el-row class="first_row" style="margin-top: 10px;">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="span-sty">采购运费</div>
|
<div class="span-sty">采购运费</div>
|
||||||
<el-form-item><span class="addinputInfo">{{ formobj.purchaseBillAmount.freight }}</span></el-form-item>
|
<el-form-item><span class="addinputInfo">{{ formobj.purchaseBillAmount.freight }}</span></el-form-item>
|
||||||
@@ -108,30 +143,6 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</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>
|
|
||||||
|
|
||||||
<div class="title titleOne">
|
|
||||||
<div>商品列表</div>
|
|
||||||
</div>
|
|
||||||
<el-table v-loading="listLoading" :data="formobj.purchaseBillDetailList" border style="width: 100%;">
|
|
||||||
<el-table-column fixed width="80" label="序号" type="index" :index="indexMethod" align="center" />
|
|
||||||
<el-table-column 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-column prop="count" label="采购数量" align="center" />
|
|
||||||
<el-table-column prop="cost" label="单价" align="center" />
|
|
||||||
<el-table-column prop="discountRate" label="折扣率(%)" align="center" />
|
|
||||||
<el-table-column prop="discountPrice" label="折扣单价" align="center" />
|
|
||||||
<el-table-column prop="shareAmount" label="分摊金额" align="center" />
|
|
||||||
<el-table-column prop="amount" label="总价" align="center" />
|
|
||||||
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@@ -149,7 +160,7 @@
|
|||||||
viewState: 1,
|
viewState: 1,
|
||||||
listLoading: false,
|
listLoading: false,
|
||||||
formobj: {
|
formobj: {
|
||||||
|
purchaseBillAmount: {}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -39,8 +39,24 @@
|
|||||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
||||||
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" />
|
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" />
|
||||||
<el-table-column prop="unit" label="单位" align="center" />
|
<el-table-column prop="unit" label="单位" align="center" />
|
||||||
|
<!-- <el-table-column prop="tagPrice" label="吊牌价" align="center" /> -->
|
||||||
<el-table-column prop="cost" label="单价" align="center" />
|
<el-table-column prop="cost" label="单价" align="center" />
|
||||||
<el-table-column prop="discountRate" label="折扣率(%)" align="center" />
|
<!-- <el-table-column prop="discountRate" label="折扣率(%)" align="center" /> -->
|
||||||
|
<!-- <el-table-column prop="discountRatePrice" label="折扣率单价" align="center" /> -->
|
||||||
|
<!-- <el-table-column prop="splitPirce" label="分摊金额" align="center" /> -->
|
||||||
|
<!-- <el-table-column prop="amount" label="总价" align="center" /> -->
|
||||||
|
<!-- <el-table-column prop="taxRate" label="税率" align="center" /> -->
|
||||||
|
<!-- <el-table-column prop="notTaxPprice" label="未含税价" align="center" /> -->
|
||||||
|
<!-- <el-table-column prop="totalTax" label="总税额" align="center" /> -->
|
||||||
|
<!-- <el-table-column prop="totalNotTaxPprice" label="未含税总价" align="center" /> -->
|
||||||
|
<!-- <el-table-column prop="purchaseCycle" label="总税额" align="center" />
|
||||||
|
<el-table-column prop="discountRate" label="采购周期" align="center" />
|
||||||
|
<el-table-column prop="deliveryDate" label="预计到货日期" align="center" />
|
||||||
|
<el-table-column prop="manufactureDate" label="生产日期" align="center" />
|
||||||
|
<el-table-column prop="overdueDate" label="过期日期" align="center" />
|
||||||
|
<el-table-column prop="batchNumber" label="批次号" align="center" />
|
||||||
|
<el-table-column prop="itemNumber" label="货号" align="center" /> -->
|
||||||
|
<!-- <el-table-column prop="remarks" label="备注" align="center" /> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<div class="pages">
|
<div class="pages">
|
||||||
|
|||||||
746
src/views/purchase/purchaseReview/index.vue
Normal file
746
src/views/purchase/purchaseReview/index.vue
Normal file
@@ -0,0 +1,746 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div v-show="viewState == 1">
|
||||||
|
<button-bar ref="btnbar" view-title="采购订单审核管理" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
||||||
|
<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 :inline="true" class="tab-header">
|
||||||
|
<el-form-item label="业务日期">
|
||||||
|
<el-date-picker v-model="queryParams.params.createStartTime" type="date" placeholder="选择日期"
|
||||||
|
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||||
|
</el-date-picker>至
|
||||||
|
<el-date-picker v-model="queryParams.params.createEndTime" type="date" placeholder="选择日期"
|
||||||
|
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="供应商">
|
||||||
|
<el-select v-model="queryParams.params.supplierSid" clearable placeholder="请选择供应商"
|
||||||
|
style="width: 220px;">
|
||||||
|
<el-option v-for="item in supplierList" :key="item.sid" :label="item.supplierName" :value="item.sid">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="仓库">
|
||||||
|
<el-select v-model="queryParams.params.wareHouseSid" placeholder="请选择仓库" style="width: 220px;">
|
||||||
|
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName"
|
||||||
|
:value="item.sid" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="收货状态">
|
||||||
|
<el-select v-model="queryParams.params.receiveStateKey" placeholder="请选择" style="width: 220px;">
|
||||||
|
<el-option v-for="(item,i) in receiveStateList" :key="i" :label="item.dictValue"
|
||||||
|
:value="item.dictKey">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物流单号">
|
||||||
|
<el-input v-model="queryParams.params.logisticsNum" placeholder="" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="单据编号">
|
||||||
|
<el-input v-model="queryParams.params.billNo" placeholder="" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="制单人">
|
||||||
|
<el-input v-model="queryParams.params.createByName" placeholder="" clearable />
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="业务员">
|
||||||
|
<el-input v-model="queryParams.params.purchaserName" placeholder="" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品">
|
||||||
|
<el-select v-model="queryParams.params.goodsSid" placeholder="请选择" style="width: 220px;">
|
||||||
|
<el-option v-for="(item,i) in goodsList" :key="i" :label="item.name" :value="item.sid">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="queryParams.params.remarks" placeholder="" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="收货状态">
|
||||||
|
<el-select v-model="queryParams.params.receiveStateKey" placeholder="请选择" style="width: 220px;">
|
||||||
|
<el-option v-for="(item,i) in receiveStateList" :key="i" :label="item.dictValue"
|
||||||
|
:value="item.dictKey">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="发货状态">
|
||||||
|
<el-select v-model="queryParams.params.deliveryStateKey" placeholder="请选择" style="width: 220px;">
|
||||||
|
<el-option v-for="(item,i) in deliveryStateList" :key="i" :label="item.dictValue"
|
||||||
|
:value="item.dictKey">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div class="btn" style="text-align: center;">
|
||||||
|
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||||
|
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Start 项目列表头部 -->
|
||||||
|
<div class="listtop">
|
||||||
|
<div class="tit">采购订单审核列表</div>
|
||||||
|
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||||
|
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||||
|
</div>
|
||||||
|
<!-- End 项目列表头部 -->
|
||||||
|
<!-- Start 项目列表 -->
|
||||||
|
<div class="">
|
||||||
|
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||||
|
@selection-change="selectionLineChangeHandle" @row-click="rowItemClick" show-summary
|
||||||
|
:summary-method="getSummaries">
|
||||||
|
<el-table-column fixed width="80" type="selection" align="center" />
|
||||||
|
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||||
|
<el-table-column fixed label="操作" align="center" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">查看</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="createTime" label="业务日期" width="120" align="center" />
|
||||||
|
<el-table-column prop="billNo" label="单据编号" width="120" align="center" />
|
||||||
|
<el-table-column prop="supplierName" label="供应商" width="150" align="center" />
|
||||||
|
<el-table-column prop="purchaserName" label="业务员" width="120" align="center" />
|
||||||
|
<el-table-column prop="wareHouseName" label="收货仓库" width="150" align="center" />
|
||||||
|
<el-table-column prop="receiveStateValue" label="状态" width="120" align="center" />
|
||||||
|
<el-table-column prop="amountTotal" label="商品总额" width="120" align="center" />
|
||||||
|
<el-table-column prop="freight" label="采购运费" width="120" align="center" />
|
||||||
|
<el-table-column prop="otherAmount" label="其他费用" width="120" align="center" />
|
||||||
|
<el-table-column prop="prepayment" label="预付金额" width="120" align="center" />
|
||||||
|
<el-table-column prop="prepayment" label="总税额" width="120" align="center" />
|
||||||
|
<el-table-column prop="logisticsNum" label="物流单号" width="120" align="center" />
|
||||||
|
<el-table-column prop="productProgress" label="生产进度" width="120" align="center" />
|
||||||
|
<el-table-column prop="productProgress" label="未含税总额" width="120" align="center" />
|
||||||
|
<el-table-column prop="countTotal" label="总采购数量" width="120" align="center" />
|
||||||
|
<el-table-column prop="countTotal" label="总入库数量" width="120" align="center" />
|
||||||
|
<el-table-column prop="countTotal" label="总入库金额" width="120" align="center" />
|
||||||
|
<el-table-column prop="deliveryStateValue" label="发货状态" width="120" align="center" />
|
||||||
|
<el-table-column prop="remarks" label="备注" width="200" align="center" />
|
||||||
|
<el-table-column prop="createByName" label="创建人" align="center" />
|
||||||
|
<el-table-column prop="remarks" label="最后修改时间" width="150" align="center" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<!-- End 项目列表 -->
|
||||||
|
<!-- <div class="pages">
|
||||||
|
<div class="tit" /> -->
|
||||||
|
<!-- 翻页 -->
|
||||||
|
<!-- <pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||||
|
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect"
|
||||||
|
text-color="#666" active-text-color="white">
|
||||||
|
|
||||||
|
<el-menu-item index="1">采购明细</el-menu-item>
|
||||||
|
<!-- <el-menu-item index="2">费用/预付款</el-menu-item> -->
|
||||||
|
<!-- <el-menu-item index="3">附 件</el-menu-item> -->
|
||||||
|
<el-menu-item index="4">操作日志</el-menu-item>
|
||||||
|
</el-menu>
|
||||||
|
|
||||||
|
<div v-show="activeIndex=='1'" style="margin-bottom: 50px;">
|
||||||
|
<el-table :data="formobj.purchaseBillDetailList" border style="width: 100%">
|
||||||
|
<el-table-column width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||||
|
<el-table-column 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-column prop="count" label="采购数量" align="center" />
|
||||||
|
<el-table-column prop="cost" label="单价" align="center" />
|
||||||
|
<el-table-column prop="discountRate" label="折扣率(%)" align="center" />
|
||||||
|
<el-table-column prop="discountPrice" label="折扣单价" align="center" />
|
||||||
|
<el-table-column prop="shareAmount" label="分摊金额" align="center" />
|
||||||
|
<el-table-column prop="amount" label="总价" align="center" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-show="activeIndex=='2'" style="margin-bottom: 50px;">
|
||||||
|
|
||||||
|
<el-form ref="dataForm" class="formaddcopy02" :model="formobj.purchaseBillAmount">
|
||||||
|
<el-row class="first_row">
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">采购运费</div>
|
||||||
|
<el-form-item> <span class="addinputInfo">{{ formobj.purchaseBillAmount.freight }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">分摊方式</div>
|
||||||
|
<el-form-item> <span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.freightShareTypeValue }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">结算账户</div>
|
||||||
|
<el-form-item> <span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.settleAccount }}</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.purchaseBillAmount.otherAmountName }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">分摊方式</div>
|
||||||
|
<el-form-item> <span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.otherShareTypeValue }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">预付金额</div>
|
||||||
|
<el-form-item> <span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.prepayment }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-show="activeIndex=='3'" style="margin-bottom: 50px;">
|
||||||
|
|
||||||
|
<span v-for="(item,index) in formobj.purchaseAppendixList" :key="index" class="addinputInfo"
|
||||||
|
style="margin-top: 10px;">
|
||||||
|
<el-popover placement="left" trigger="click" width="300">
|
||||||
|
<img :src="item.url" width="100%" />
|
||||||
|
<img slot="reference" :src="item.url" :alt="item.url"
|
||||||
|
style="max-height: 70px;max-width: 70px; padding: 5px" />
|
||||||
|
</el-popover>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-show="activeIndex=='4'" style="margin-bottom: 50px;">
|
||||||
|
<el-table :data="formobj.purchaseBillDetailList" border style="width: 100%">
|
||||||
|
<el-table-column width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||||
|
<el-table-column prop="goodsSpuName" label="操作时间" width="250" align="center" />
|
||||||
|
<el-table-column prop="goodsSkuCode" label="操作账号" width="180" align="center" />
|
||||||
|
<el-table-column prop="goodsSkuOwnSpec" label="操作类型" width="180" align="center" />
|
||||||
|
<el-table-column prop="unit" label="操作结果" align="center" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- End 查询和其列表部分 -->
|
||||||
|
<!-- 新增修改部分组件 -->
|
||||||
|
<divInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" @reloadlist="loadList" />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import req from '@/api/purchase/purchaseOrder.js'
|
||||||
|
import ButtonBar from '@/components/ButtonBar'
|
||||||
|
import Pagination from '@/components/pagination'
|
||||||
|
import pageye from '@/components/pagination/pageye'
|
||||||
|
import divInfo from './purchaseOrderInfo.vue'
|
||||||
|
import {
|
||||||
|
getOrgSidByPath,
|
||||||
|
getTypeValueList,
|
||||||
|
choiceSupplierInfo,
|
||||||
|
getWarehouses
|
||||||
|
} from '@/api/Common/dictcommons'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
ButtonBar,
|
||||||
|
Pagination,
|
||||||
|
pageye,
|
||||||
|
divInfo
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeIndex: '1',
|
||||||
|
btndisabled: false,
|
||||||
|
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||||
|
isSearchShow: false,
|
||||||
|
searchxianshitit: '显示查询条件',
|
||||||
|
tableLoading: false,
|
||||||
|
dataList: [],
|
||||||
|
formobj: {
|
||||||
|
purchaseBillAmount: {
|
||||||
|
freight: ""
|
||||||
|
},
|
||||||
|
purchaseAppendixList: [],
|
||||||
|
purchaseBillDetailList: {}
|
||||||
|
},
|
||||||
|
btnList: [{
|
||||||
|
type: 'primary',
|
||||||
|
size: 'small',
|
||||||
|
icon: 'submit',
|
||||||
|
btnKey: 'toSubmit',
|
||||||
|
btnLabel: '确认审核'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'info',
|
||||||
|
size: 'small',
|
||||||
|
icon: 'cross',
|
||||||
|
btnKey: 'doClose',
|
||||||
|
btnLabel: '关闭'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
queryParams: {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
total: 0,
|
||||||
|
params: {
|
||||||
|
"supplierName": "",
|
||||||
|
"supplierSid": "",
|
||||||
|
"wareHouseName": "",
|
||||||
|
"wareHouseSid": "",
|
||||||
|
"receiveStateKey": "",
|
||||||
|
"logisticsNum": "",
|
||||||
|
"deliveryStateKey": "",
|
||||||
|
"billNo": "",
|
||||||
|
"purchaserName": "",
|
||||||
|
"remarks": "",
|
||||||
|
"createStartTime": "",
|
||||||
|
"createEndTime": "",
|
||||||
|
"orgLevelKey": "",
|
||||||
|
"menuUrl": "",
|
||||||
|
"orgPath": "",
|
||||||
|
"userSid": "",
|
||||||
|
"goodsSid": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sids: [],
|
||||||
|
selectionList: [],
|
||||||
|
receiveStateList: [],
|
||||||
|
deliveryStateList: [],
|
||||||
|
warehouseList: [],
|
||||||
|
supplierList: [],
|
||||||
|
goodsList: [],
|
||||||
|
createOrgSid: "",
|
||||||
|
rowItemData: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
getOrgSidByPath({
|
||||||
|
orgPath: window.sessionStorage.getItem('orgSid')
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.createOrgSid = res.data
|
||||||
|
this.init()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.loadList()
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
init() {
|
||||||
|
|
||||||
|
getTypeValueList({
|
||||||
|
type: 'receiveState'
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.receiveStateList = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
getTypeValueList({
|
||||||
|
type: 'deliveryState'
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.deliveryStateList = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
choiceSupplierInfo({
|
||||||
|
createOrgSid: this.createOrgSid
|
||||||
|
}).then((resp) => {
|
||||||
|
if (resp.success) {
|
||||||
|
this.supplierList = resp.data
|
||||||
|
console.log("aaaaaa", this.supplierNameList);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
getWarehouses({
|
||||||
|
orgPath: window.sessionStorage.getItem('orgSid'),
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.warehouseList = res.data
|
||||||
|
|
||||||
|
console.log("aaaaaa", this.warehouseList);
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 合计
|
||||||
|
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 === 'amountTotal') { //商品总额
|
||||||
|
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 === 'freight') { //采购运费
|
||||||
|
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 === 'otherAmount') { //其他费用
|
||||||
|
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 === 'prepayment') { //总税额
|
||||||
|
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 === 'productProgress') { //未含税总额
|
||||||
|
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 === 'countTotal') { //总采购数量
|
||||||
|
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 === 'countTotal') { // 已入库数量
|
||||||
|
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 === 'countTotal') { //已入库金额
|
||||||
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
|
const value = Number(curr)
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
return prev + curr
|
||||||
|
} else {
|
||||||
|
return prev
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
sums[index] += ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return sums
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
rowItemClick(row) {
|
||||||
|
console.log("row", row);
|
||||||
|
|
||||||
|
this.rowItemData = [row];
|
||||||
|
|
||||||
|
req.fetchDetailsBySid(row.sid).then((resp) => {
|
||||||
|
if (resp.success) {
|
||||||
|
this.formobj = resp.data
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: "数据异常。",
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: "数据异常。",
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
handleSelect(val) {
|
||||||
|
console.log("val", val);
|
||||||
|
this.activeIndex = val
|
||||||
|
},
|
||||||
|
selectionLineChangeHandle(val) {
|
||||||
|
console.log("val", val);
|
||||||
|
|
||||||
|
this.selectionList = val
|
||||||
|
|
||||||
|
const aa = []
|
||||||
|
val.forEach(element => {
|
||||||
|
aa.push(element.sid)
|
||||||
|
})
|
||||||
|
this.sids = aa
|
||||||
|
},
|
||||||
|
// 搜索条件效果
|
||||||
|
clicksearchShow() {
|
||||||
|
this.isSearchShow = !this.isSearchShow
|
||||||
|
if (this.isSearchShow) {
|
||||||
|
this.searchxianshitit = '隐藏查询条件'
|
||||||
|
} else {
|
||||||
|
this.searchxianshitit = '显示查询条件'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
btnHandle(btnKey) {
|
||||||
|
switch (btnKey) {
|
||||||
|
case 'toSubmit':
|
||||||
|
this.toSubmit()
|
||||||
|
break
|
||||||
|
case 'toAdd':
|
||||||
|
this.toAdd()
|
||||||
|
break
|
||||||
|
case 'toEdit':
|
||||||
|
this.toEdit()
|
||||||
|
break
|
||||||
|
case 'doDel':
|
||||||
|
this.doDel()
|
||||||
|
break
|
||||||
|
case 'doClose':
|
||||||
|
this.doClose()
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
},
|
||||||
|
loadList() {
|
||||||
|
this.tableLoading = true
|
||||||
|
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||||
|
this.queryParams.params.orgPath = window.sessionStorage.getItem('orgSidPath')
|
||||||
|
this.queryParams.params.menuUrl = this.$route.path
|
||||||
|
req.listPage(this.queryParams).then((resp) => {
|
||||||
|
this.tableLoading = false
|
||||||
|
if (resp.success) {
|
||||||
|
const data = resp.data
|
||||||
|
this.queryParams.total = data.total
|
||||||
|
this.dataList = data.records
|
||||||
|
|
||||||
|
req.fetchDetailsBySid(this.dataList[0].sid).then((resp) => {
|
||||||
|
if (resp.success) {
|
||||||
|
this.formobj = resp.data
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: "数据异常。",
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: "数据异常。",
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// 根据resp.code进行异常情况处理
|
||||||
|
this.dataList = []
|
||||||
|
this.queryParams.total = 0
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.tableLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 序号
|
||||||
|
indexMethod(index) {
|
||||||
|
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||||
|
var pageindex = index + 1 + pagestart
|
||||||
|
return pageindex
|
||||||
|
},
|
||||||
|
dosearch() {
|
||||||
|
this.queryParams.current = 1
|
||||||
|
this.loadList()
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.queryParams = {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
total: 0,
|
||||||
|
params: {
|
||||||
|
"supplierName": "",
|
||||||
|
"supplierSid": "",
|
||||||
|
"wareHouseName": "",
|
||||||
|
"wareHouseSid": "",
|
||||||
|
"receiveStateKey": "",
|
||||||
|
"logisticsNum": "",
|
||||||
|
"deliveryStateKey": "",
|
||||||
|
"billNo": "",
|
||||||
|
"purchaserName": "",
|
||||||
|
"remarks": "",
|
||||||
|
"createStartTime": "",
|
||||||
|
"createEndTime": "",
|
||||||
|
"orgLevelKey": "",
|
||||||
|
"menuUrl": "",
|
||||||
|
"orgPath": "",
|
||||||
|
"userSid": "",
|
||||||
|
"goodsSid": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.loadList()
|
||||||
|
},
|
||||||
|
toSubmit() {
|
||||||
|
if (this.sids.length > 0) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
showClose: true,
|
||||||
|
message: '请至少选择一条记录进行操作'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toAdd() {
|
||||||
|
this.viewState = 2
|
||||||
|
this.$refs['divadd'].showAdd()
|
||||||
|
},
|
||||||
|
toEdit() {
|
||||||
|
|
||||||
|
if (this.selectionList.length != 1) {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: "请选择一条数据。",
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.viewState = 3
|
||||||
|
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||||
|
},
|
||||||
|
|
||||||
|
doClose() {
|
||||||
|
this.$store.dispatch('tagsView/delView', this.$route)
|
||||||
|
this.$router.go(-1)
|
||||||
|
},
|
||||||
|
toRelevancy(row) {
|
||||||
|
this.viewState = 4
|
||||||
|
this.$refs['divinfo'].showAdd(row)
|
||||||
|
},
|
||||||
|
doDel() {
|
||||||
|
|
||||||
|
if (this.sids.length > 0) {
|
||||||
|
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) => {
|
||||||
|
loading.close()
|
||||||
|
if (resp.success) {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: resp.msg,
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
this.loadList()
|
||||||
|
} else {
|
||||||
|
// 根据resp.code进行异常情况处理
|
||||||
|
}
|
||||||
|
}).catch(e => {
|
||||||
|
loading.close()
|
||||||
|
})
|
||||||
|
}).catch(() => {})
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
message: '请至少选择一条记录进行删除操作'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
resetState() {
|
||||||
|
this.viewState = 1
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
/deep/ .el-form-item__error {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.must {
|
||||||
|
color: #f00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.span-sty {
|
||||||
|
width: 130px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addinputInfo {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
width: calc(100% - 115px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.first_row {
|
||||||
|
border-top: 1px solid #E0E3EB;
|
||||||
|
}
|
||||||
|
|
||||||
|
.titleOne {
|
||||||
|
padding: 7px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-menu-item.is-active {
|
||||||
|
background-color: #3370ff !important;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
span {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-submenu__title.is-active {
|
||||||
|
background: #1c88cf !important;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
225
src/views/purchase/purchaseReview/purchaseOrderInfo.vue
Normal file
225
src/views/purchase/purchaseReview/purchaseOrderInfo.vue
Normal file
@@ -0,0 +1,225 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div v-show="viewState == 1">
|
||||||
|
<div class="tab-header webtop">
|
||||||
|
<!-- 标题 -->
|
||||||
|
<div>采购订单详情</div>
|
||||||
|
<!-- start 添加修改按钮 -->
|
||||||
|
<div>
|
||||||
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
<!-- end 添加修改按钮 -->
|
||||||
|
<!-- end 详情按钮 -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="listconadd">
|
||||||
|
|
||||||
|
<el-form ref="form_obj" :model="formobj" class="formaddcopy02">
|
||||||
|
<!-- <div class="title">
|
||||||
|
<div>基础信息</div>
|
||||||
|
</div> -->
|
||||||
|
<el-row class="first_row">
|
||||||
|
|
||||||
|
<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.supplierName }}</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.purchaserName }}</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.purchaseBillAmount.bankAccount }}</span></el-form-item>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">货币类别</div>
|
||||||
|
<el-form-item><span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.currencyValue }}</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.purchaseBillAmount.freight }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">运费分摊方式</div>
|
||||||
|
<el-form-item><span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.freightShareTypeValue }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">结算账户</div>
|
||||||
|
<el-form-item><span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.settleAccountValue }}</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.purchaseBillAmount.otherAmountName }}</span></el-form-item>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">其他费用分摊方式</div>
|
||||||
|
<el-form-item><span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.otherShareTypeValue }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">预付金额</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.purchaseBillAmount.prepayment }}</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: 150px;height: 150px"
|
||||||
|
v-for="(item, index) in formobj.purchaseAppendixList" :key="index" :src="item.url"
|
||||||
|
:preview-src-list="formobj.purchaseAppendixList" /></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>
|
||||||
|
|
||||||
|
<div class="title titleOne">
|
||||||
|
<div>商品列表</div>
|
||||||
|
</div>
|
||||||
|
<el-table v-loading="listLoading" :data="formobj.purchaseBillDetailList" border style="width: 100%;">
|
||||||
|
<el-table-column fixed width="80" label="序号" type="index" :index="indexMethod" align="center" />
|
||||||
|
<el-table-column 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-column prop="count" label="采购数量" align="center" />
|
||||||
|
<el-table-column prop="cost" label="单价" align="center" />
|
||||||
|
<el-table-column prop="discountRate" label="折扣率(%)" align="center" />
|
||||||
|
<el-table-column prop="discountPrice" label="折扣单价" align="center" />
|
||||||
|
<el-table-column prop="shareAmount" label="分摊金额" align="center" />
|
||||||
|
<el-table-column prop="amount" label="总价" align="center" />
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import req from '@/api/purchase/purchaseOrder.js'
|
||||||
|
export default {
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
viewState: 1,
|
||||||
|
listLoading: false,
|
||||||
|
formobj: {
|
||||||
|
purchaseBillAmount: {}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
indexMethod(index) {
|
||||||
|
return index + 1
|
||||||
|
},
|
||||||
|
|
||||||
|
showAdd(row) {
|
||||||
|
req.fetchDetailsBySid(row.sid).then((resp) => {
|
||||||
|
if (resp.success) {
|
||||||
|
this.formobj = resp.data
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: "数据异常。",
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: "数据异常。",
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
handleReturn() {
|
||||||
|
this.$emit('doback')
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
/deep/ .el-form-item__error {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.must {
|
||||||
|
color: #f00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.span-sty {
|
||||||
|
width: 130px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addinputInfo {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
width: calc(100% - 115px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.first_row {
|
||||||
|
border-top: 1px solid #E0E3EB;
|
||||||
|
}
|
||||||
|
|
||||||
|
.titleOne {
|
||||||
|
padding: 7px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user