|
@@ -4,7 +4,7 @@
|
|
<!-- 自定义的二级文字标题 -->
|
|
<!-- 自定义的二级文字标题 -->
|
|
<template slot="subTitle">
|
|
<template slot="subTitle">
|
|
<p class="billno">单号:{{ detail&&detail.purchaseBillNo }}</p>
|
|
<p class="billno">单号:{{ detail&&detail.purchaseBillNo }}</p>
|
|
- <a-button type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:10px;vertical-align:middle;">
|
|
|
|
|
|
+ <a-button id="purchaseNewOrderEdit-showDesc-btn" type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:10px;vertical-align:middle;">
|
|
<a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/>
|
|
<a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/>
|
|
{{ isShowBisiceInfo?'隐藏':'查看' }}信息
|
|
{{ isShowBisiceInfo?'隐藏':'查看' }}信息
|
|
</a-button>
|
|
</a-button>
|
|
@@ -21,17 +21,17 @@
|
|
<a-divider type="vertical" />
|
|
<a-divider type="vertical" />
|
|
<a-dropdown>
|
|
<a-dropdown>
|
|
<a-menu slot="overlay" @click="handleActions">
|
|
<a-menu slot="overlay" @click="handleActions">
|
|
- <a-menu-item key="3" v-if="$hasPermissions('M_shoppingCart')">
|
|
|
|
|
|
+ <a-menu-item key="3" v-if="$hasPermissions('M_shoppingCart')" id="purchaseNewOrderEdit-more-3">
|
|
<a-icon type="shopping" /> 购物车
|
|
<a-icon type="shopping" /> 购物车
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
- <a-menu-item key="2" v-if="!isDealerUp">
|
|
|
|
|
|
+ <a-menu-item key="2" v-if="!isDealerUp" id="purchaseNewOrderEdit-more-2">
|
|
<a-icon type="funnel-plot" />导入缺货
|
|
<a-icon type="funnel-plot" />导入缺货
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
- <a-menu-item key="1">
|
|
|
|
|
|
+ <a-menu-item key="1" id="purchaseNewOrderEdit-more-1">
|
|
<a-icon type="import" />导入产品
|
|
<a-icon type="import" />导入产品
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
</a-menu>
|
|
</a-menu>
|
|
- <a-button type="link" class="button-default"> <a-icon type="unordered-list" /> 更多</a-button>
|
|
|
|
|
|
+ <a-button id="purchaseNewOrderEdit-more-btn" type="link" class="button-default"> <a-icon type="unordered-list" /> 更多</a-button>
|
|
</a-dropdown>
|
|
</a-dropdown>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -58,9 +58,9 @@
|
|
{{ detail&&detail.shippingAddressCityName || '' }}
|
|
{{ detail&&detail.shippingAddressCityName || '' }}
|
|
{{ detail&&detail.shippingAddressCountyName || '' }}
|
|
{{ detail&&detail.shippingAddressCountyName || '' }}
|
|
{{ detail&&detail.shippingAddress || '' }}
|
|
{{ detail&&detail.shippingAddress || '' }}
|
|
- <a-button type="link" @click="openAddrModal=true">更换地址 >></a-button>
|
|
|
|
|
|
+ <a-button id="purchaseNewOrderEdit-upaddr" type="link" @click="openAddrModal=true">更换地址 >></a-button>
|
|
</div>
|
|
</div>
|
|
- <div v-else><a-button type="link" @click="openAddrModal=true">选择地址 >></a-button></div>
|
|
|
|
|
|
+ <div v-else><a-button id="purchaseNewOrderEdit-chooseAddr" type="link" @click="openAddrModal=true">选择地址 >></a-button></div>
|
|
</a-descriptions-item>
|
|
</a-descriptions-item>
|
|
</a-descriptions>
|
|
</a-descriptions>
|
|
</div>
|
|
</div>
|
|
@@ -75,12 +75,12 @@
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="5" :sm="24">
|
|
<a-col :md="5" :sm="24">
|
|
<a-form-model-item label="产品编码">
|
|
<a-form-model-item label="产品编码">
|
|
- <a-input v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
|
|
|
|
|
|
+ <a-input id="purchaseNewOrderEdit-productCode" v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="5" :sm="24">
|
|
<a-col :md="5" :sm="24">
|
|
<a-form-model-item label="产品名称">
|
|
<a-form-model-item label="产品名称">
|
|
- <a-input v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
|
|
|
|
|
|
+ <a-input id="purchaseNewOrderEdit-productName" v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="8" :sm="24">
|
|
<a-col :md="8" :sm="24">
|
|
@@ -118,7 +118,7 @@
|
|
}"
|
|
}"
|
|
>
|
|
>
|
|
<span slot="description">暂无产品</span>
|
|
<span slot="description">暂无产品</span>
|
|
- <a-button type="primary" class="button-error" @click="openChooseProduct=true"><a-icon type="plus" />立即添加产品</a-button>
|
|
|
|
|
|
+ <a-button id="purchaseNewOrderEdit-go-add" type="primary" class="button-error" @click="openChooseProduct=true"><a-icon type="plus" />立即添加产品</a-button>
|
|
</a-empty>
|
|
</a-empty>
|
|
</div>
|
|
</div>
|
|
<div style="text-align: center;padding: 30px 50px;" v-if="spinning">
|
|
<div style="text-align: center;padding: 30px 50px;" v-if="spinning">
|
|
@@ -187,6 +187,7 @@ import ImportGuideModal from './importGuideModal.vue'
|
|
import outStockModal from './outStockModal.vue'
|
|
import outStockModal from './outStockModal.vue'
|
|
import outStockListModal from './outStockListModal.vue'
|
|
import outStockListModal from './outStockListModal.vue'
|
|
import chooseAddressModal from '@/views/common/receivingAddress/chooseAddressModal.vue'
|
|
import chooseAddressModal from '@/views/common/receivingAddress/chooseAddressModal.vue'
|
|
|
|
+// 接口
|
|
import { purchaseDetailBySn, purchaseWriteSubmit, purchaseDetailPrint, purchaseDetailExport, purchaseDetailAddress } from '@/api/purchase'
|
|
import { purchaseDetailBySn, purchaseWriteSubmit, purchaseDetailPrint, purchaseDetailExport, purchaseDetailAddress } from '@/api/purchase'
|
|
import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel } from '@/api/purchaseDetail'
|
|
import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel } from '@/api/purchaseDetail'
|
|
// 选择产品
|
|
// 选择产品
|
|
@@ -194,13 +195,17 @@ import chooseProductModal from './chooseProductModal.vue'
|
|
// 打印
|
|
// 打印
|
|
import PrintPanel from '@/views/common/printPanel.vue'
|
|
import PrintPanel from '@/views/common/printPanel.vue'
|
|
import { hdPrint } from '@/libs/JGPrint'
|
|
import { hdPrint } from '@/libs/JGPrint'
|
|
|
|
+// 异步加载购物车弹框
|
|
const shopingCatModal = () => import(/* webpackChunkName: "shopingCatModal" */ '@/views/common/shopingCatModal.vue')
|
|
const shopingCatModal = () => import(/* webpackChunkName: "shopingCatModal" */ '@/views/common/shopingCatModal.vue')
|
|
|
|
+
|
|
|
|
+// 自定义数量组件
|
|
const qtyComp = {
|
|
const qtyComp = {
|
|
name: 'qtyComp',
|
|
name: 'qtyComp',
|
|
template: `
|
|
template: `
|
|
<a-input-number
|
|
<a-input-number
|
|
size="small"
|
|
size="small"
|
|
v-model="row.qty"
|
|
v-model="row.qty"
|
|
|
|
+ :id="'purchaseNewOrderEdit-editQty-'+row.id"
|
|
:precision="0"
|
|
:precision="0"
|
|
:min="1"
|
|
:min="1"
|
|
:max="999999"
|
|
:max="999999"
|
|
@@ -215,12 +220,14 @@ const qtyComp = {
|
|
that: Object
|
|
that: Object
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+// 自定义操作组件
|
|
const actionComp = {
|
|
const actionComp = {
|
|
name: 'actionComp',
|
|
name: 'actionComp',
|
|
template: `
|
|
template: `
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
|
|
+ :id="'purchaseNewOrderEdit-del-'+row.id"
|
|
class="button-error"
|
|
class="button-error"
|
|
:loading="row.delLoading"
|
|
:loading="row.delLoading"
|
|
@click="that.handleDel(row)"
|
|
@click="that.handleDel(row)"
|
|
@@ -240,38 +247,40 @@ export default {
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
- isShowBisiceInfo: false,
|
|
|
|
- showPage: false,
|
|
|
|
|
|
+ isShowBisiceInfo: false, // 是否显示详情信息
|
|
|
|
+ showPage: false, // 是否显示页面
|
|
spinning: false,
|
|
spinning: false,
|
|
detail: null, // 详细信息
|
|
detail: null, // 详细信息
|
|
- openChooseProduct: false,
|
|
|
|
- openShopCatModal: false,
|
|
|
|
- tableHeight: 0,
|
|
|
|
- simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
|
|
|
|
+ openChooseProduct: false, // 打开添加产品弹框
|
|
|
|
+ openShopCatModal: false, // 打开购物车弹框
|
|
|
|
+ tableHeight: 0, // 表格高度
|
|
|
|
+ simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, // 默认图片
|
|
// -------已选产品-------------
|
|
// -------已选产品-------------
|
|
- subLoading: false,
|
|
|
|
- orderCountData: null,
|
|
|
|
- delLoading: false,
|
|
|
|
- showSearch: false,
|
|
|
|
|
|
+ subLoading: false, // loading加载
|
|
|
|
+ orderCountData: null, // 统计信息
|
|
|
|
+ delLoading: false, // 操作按钮loading加载
|
|
|
|
+ showSearch: false, // 是否查询
|
|
productForm: {
|
|
productForm: {
|
|
- productName: '',
|
|
|
|
- productCode: '',
|
|
|
|
- orderBy: 'purchase_bill_detail.CREATE_DATE desc'
|
|
|
|
|
|
+ productName: '', // 产品名称
|
|
|
|
+ productCode: '', // 产品编码
|
|
|
|
+ orderBy: 'purchase_bill_detail.CREATE_DATE desc' // 默认排序
|
|
},
|
|
},
|
|
purchaseDisabled: false, // 查询、重置按钮是否可操作
|
|
purchaseDisabled: false, // 查询、重置按钮是否可操作
|
|
- localDataSource: [],
|
|
|
|
- chooseData: [],
|
|
|
|
|
|
+ localDataSource: [], // 原始列表数据
|
|
|
|
+ chooseData: [], // 已选列表数据
|
|
openGuideModal: false, // 导入产品引导
|
|
openGuideModal: false, // 导入产品引导
|
|
- openOutStockModal: false,
|
|
|
|
- paramsData: null,
|
|
|
|
|
|
+ openOutStockModal: false, // 上次缺货弹框
|
|
|
|
+ paramsData: null, // 传递购物车的参数
|
|
openAddrModal: false, // 选择地址弹框是否显示
|
|
openAddrModal: false, // 选择地址弹框是否显示
|
|
openOutStockListModal: false // 导入缺货
|
|
openOutStockListModal: false // 导入缺货
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
|
|
+ // 是否上级经销商
|
|
isDealerUp () {
|
|
isDealerUp () {
|
|
return this.detail && (this.detail.purchaseTargetType == 'DEALER_UP' || this.detail.purchaseTargetType == 'DEALER_SUPPLIER')
|
|
return this.detail && (this.detail.purchaseTargetType == 'DEALER_UP' || this.detail.purchaseTargetType == 'DEALER_SUPPLIER')
|
|
},
|
|
},
|
|
|
|
+ // 已选列表列
|
|
chooseColumns () {
|
|
chooseColumns () {
|
|
const _this = this
|
|
const _this = this
|
|
const arr = [
|
|
const arr = [
|
|
@@ -298,6 +307,7 @@ export default {
|
|
return <actionComp row={row} column={column} rowIndex={rowIndex} that={_this} />
|
|
return <actionComp row={row} column={column} rowIndex={rowIndex} that={_this} />
|
|
} }
|
|
} }
|
|
]
|
|
]
|
|
|
|
+ // 是否有成本价权限
|
|
if (this.$hasPermissions('M_ShowAllCost')) {
|
|
if (this.$hasPermissions('M_ShowAllCost')) {
|
|
arr.splice(4, 0, { title: '采购单价', key: 'h', field: 'discountedPriceText', width: '10%', align: 'right', operationColumn: false })
|
|
arr.splice(4, 0, { title: '采购单价', key: 'h', field: 'discountedPriceText', width: '10%', align: 'right', operationColumn: false })
|
|
arr.splice(6, 0, { title: '采购金额', key: 'i', field: 'discountedAmountText', width: '10%', align: 'right', operationColumn: false })
|
|
arr.splice(6, 0, { title: '采购金额', key: 'i', field: 'discountedAmountText', width: '10%', align: 'right', operationColumn: false })
|
|
@@ -306,17 +316,22 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 更多操作
|
|
handleActions (e) {
|
|
handleActions (e) {
|
|
|
|
+ // 导入
|
|
if (e.key == 1) {
|
|
if (e.key == 1) {
|
|
this.openGuideModal = true
|
|
this.openGuideModal = true
|
|
}
|
|
}
|
|
|
|
+ // 缺货
|
|
if (e.key == 2) {
|
|
if (e.key == 2) {
|
|
this.handleOutStock()
|
|
this.handleOutStock()
|
|
}
|
|
}
|
|
|
|
+ // 购物车
|
|
if (e.key == 3) {
|
|
if (e.key == 3) {
|
|
this.hanldCart()
|
|
this.hanldCart()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 获取列表数据
|
|
getTableData () {
|
|
getTableData () {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
this.spinning = true
|
|
this.spinning = true
|
|
@@ -349,6 +364,7 @@ export default {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.detail = res.data
|
|
this.detail = res.data
|
|
if (!noRefashTable) {
|
|
if (!noRefashTable) {
|
|
|
|
+ // 如果有列表数据
|
|
if (this.detail.totalCategory) {
|
|
if (this.detail.totalCategory) {
|
|
if (isReset) {
|
|
if (isReset) {
|
|
this.resetPurchaseForm()
|
|
this.resetPurchaseForm()
|
|
@@ -414,7 +430,9 @@ export default {
|
|
}
|
|
}
|
|
// 添加
|
|
// 添加
|
|
if (type == 0) {
|
|
if (type == 0) {
|
|
|
|
+ // 是上级
|
|
if (this.isDealerUp) {
|
|
if (this.isDealerUp) {
|
|
|
|
+ // 如果有成本价
|
|
if (row.purchasePrice) {
|
|
if (row.purchasePrice) {
|
|
params.productSn = row.productSn
|
|
params.productSn = row.productSn
|
|
params.purchaseBillSn = this.detail.purchaseBillSn
|
|
params.purchaseBillSn = this.detail.purchaseBillSn
|
|
@@ -428,6 +446,7 @@ export default {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
|
|
+ // 如果有成本价、终端会员价、车主零售价
|
|
if (row.purchasePrice && row.terminalPrice && row.carOwnersPrice) {
|
|
if (row.purchasePrice && row.terminalPrice && row.carOwnersPrice) {
|
|
params.productSn = row.productSn
|
|
params.productSn = row.productSn
|
|
params.purchaseBillSn = this.detail.purchaseBillSn
|
|
params.purchaseBillSn = this.detail.purchaseBillSn
|
|
@@ -560,9 +579,11 @@ export default {
|
|
handleBack () {
|
|
handleBack () {
|
|
this.$router.push({ name: 'purchaseOrderNewList' })
|
|
this.$router.push({ name: 'purchaseOrderNewList' })
|
|
},
|
|
},
|
|
|
|
+ // 计算表格高度
|
|
setTableH () {
|
|
setTableH () {
|
|
this.tableHeight = window.innerHeight - (this.isShowBisiceInfo ? 127 : 0) - (this.showSearch ? 42 : 0) - 210
|
|
this.tableHeight = window.innerHeight - (this.isShowBisiceInfo ? 127 : 0) - (this.showSearch ? 42 : 0) - 210
|
|
},
|
|
},
|
|
|
|
+ // 页面初始化
|
|
pageInit () {
|
|
pageInit () {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.setTableH()
|
|
this.setTableH()
|
|
@@ -571,9 +592,11 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
|
|
+ // 显示详情信息
|
|
isShowBisiceInfo (newValue, oldValue) {
|
|
isShowBisiceInfo (newValue, oldValue) {
|
|
this.setTableH()
|
|
this.setTableH()
|
|
},
|
|
},
|
|
|
|
+ // 显示页面
|
|
showSearch (newValue, oldValue) {
|
|
showSearch (newValue, oldValue) {
|
|
if (this.isShowBisiceInfo) {
|
|
if (this.isShowBisiceInfo) {
|
|
this.isShowBisiceInfo = false
|
|
this.isShowBisiceInfo = false
|