|
@@ -109,7 +109,7 @@
|
|
:rowKey="(record) => record.id"
|
|
:rowKey="(record) => record.id"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:data="loadData"
|
|
:data="loadData"
|
|
- :scroll="{ x: 1190, y:300 }"
|
|
|
|
|
|
+ :scroll="{ x: 950, y:300 }"
|
|
:defaultLoadData="false"
|
|
:defaultLoadData="false"
|
|
bordered>
|
|
bordered>
|
|
<!-- 采购数量 -->
|
|
<!-- 采购数量 -->
|
|
@@ -142,11 +142,7 @@
|
|
<a-card size="small" :bordered="false" class="purchaseOrderEdit-cont">
|
|
<a-card size="small" :bordered="false" class="purchaseOrderEdit-cont">
|
|
<a-collapse :activeKey="['1']">
|
|
<a-collapse :activeKey="['1']">
|
|
<a-collapse-panel key="1">
|
|
<a-collapse-panel key="1">
|
|
- <template slot="header">
|
|
|
|
- 已选产品
|
|
|
|
- <!-- <a-button size="small" class="import-btn" id="purchaseOrderEdit-import-btn" @click.stop="handleImport">导入明细</a-button> -->
|
|
|
|
- </template>
|
|
|
|
- <!-- 已选产品 -->
|
|
|
|
|
|
+ <template slot="header">已选产品</template>
|
|
<div>
|
|
<div>
|
|
<!-- 总计 -->
|
|
<!-- 总计 -->
|
|
<a-alert type="info" style="margin-bottom:10px">
|
|
<a-alert type="info" style="margin-bottom:10px">
|
|
@@ -181,6 +177,7 @@
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="6">
|
|
<a-col :span="6">
|
|
<div style="float:right;overflow: hidden;">
|
|
<div style="float:right;overflow: hidden;">
|
|
|
|
+ <a-button size="small" type="primary" class="button-info" id="purchaseOrderEdit-import-btn" @click="handleOutStock">上次缺货</a-button>
|
|
<a-button size="small" id="purchaseOrderEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
|
|
<a-button size="small" id="purchaseOrderEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
|
|
</div>
|
|
</div>
|
|
</a-col>
|
|
</a-col>
|
|
@@ -194,7 +191,7 @@
|
|
:rowKey="(record) => record.id"
|
|
:rowKey="(record) => record.id"
|
|
:columns="chooseColumns"
|
|
:columns="chooseColumns"
|
|
:data="chooseLoadData"
|
|
:data="chooseLoadData"
|
|
- :scroll="{ x: 1070, y: 300 }"
|
|
|
|
|
|
+ :scroll="{ x: 830, y: 300 }"
|
|
bordered>
|
|
bordered>
|
|
<!-- 采购数量 -->
|
|
<!-- 采购数量 -->
|
|
<template slot="storageQuantity" slot-scope="text, record">
|
|
<template slot="storageQuantity" slot-scope="text, record">
|
|
@@ -235,10 +232,10 @@
|
|
@click="handleSubmit"
|
|
@click="handleSubmit"
|
|
style="padding: 0 60px;">提交</a-button>
|
|
style="padding: 0 60px;">提交</a-button>
|
|
</div>
|
|
</div>
|
|
- <!-- 选择基本信息弹框 -->
|
|
|
|
- <basic-info-modal ref="baseInfo" :openModal="openModal" @ok="handleOk" @cancel="openModal=false" />
|
|
|
|
<!-- 导入产品 -->
|
|
<!-- 导入产品 -->
|
|
<importGuideModal :openModal="openGuideModal" :params="{purchaseBillSn: $route.params.sn}" @close="openGuideModal=false" @ok="hanldeOk" />
|
|
<importGuideModal :openModal="openGuideModal" :params="{purchaseBillSn: $route.params.sn}" @close="openGuideModal=false" @ok="hanldeOk" />
|
|
|
|
+ <!-- 上次缺货 -->
|
|
|
|
+ <outStockModal :openModal="openOutStockModal" :paramsData="paramsData" @close="openOutStockModal=false" @ok="hanldeOkOutStock" />
|
|
<!-- 打印 -->
|
|
<!-- 打印 -->
|
|
<div id="print"></div>
|
|
<div id="print"></div>
|
|
</div>
|
|
</div>
|
|
@@ -247,19 +244,18 @@
|
|
<script>
|
|
<script>
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
-import basicInfoModal from './basicInfoModal.vue'
|
|
|
|
import ImportGuideModal from './importGuideModal.vue'
|
|
import ImportGuideModal from './importGuideModal.vue'
|
|
|
|
+import outStockModal from './outStockModal.vue'
|
|
import ProductType from '../../common/productType.js'
|
|
import ProductType from '../../common/productType.js'
|
|
import ProductBrand from '../../common/productBrand.js'
|
|
import ProductBrand from '../../common/productBrand.js'
|
|
import { purchaseDetailBySn, purchaseWriteSubmit, purchaseDetailPrint, purchaseDetailBatchInsert, purchaseDetailExport } from '@/api/purchase'
|
|
import { purchaseDetailBySn, purchaseWriteSubmit, purchaseDetailPrint, purchaseDetailBatchInsert, purchaseDetailExport } from '@/api/purchase'
|
|
-import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel, purchaseDetailCount } from '@/api/purchaseDetail'
|
|
|
|
|
|
+import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel, purchaseDetailCount, purchaseDetailCancelList } from '@/api/purchaseDetail'
|
|
import { productListPurchase } from '@/api/product'
|
|
import { productListPurchase } from '@/api/product'
|
|
export default {
|
|
export default {
|
|
- components: { STable, VSelect, basicInfoModal, ProductType, ProductBrand, ImportGuideModal },
|
|
|
|
|
|
+ components: { STable, VSelect, ProductType, ProductBrand, ImportGuideModal, outStockModal },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
spinning: false,
|
|
spinning: false,
|
|
- openModal: false, // 选择基本信息弹框是否显示
|
|
|
|
detail: null, // 详细信息
|
|
detail: null, // 详细信息
|
|
subLoading: false,
|
|
subLoading: false,
|
|
// 选择产品
|
|
// 选择产品
|
|
@@ -277,14 +273,14 @@ export default {
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
// 表头
|
|
// 表头
|
|
columns: [
|
|
columns: [
|
|
- { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
|
- { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
|
|
|
|
|
|
+ { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
|
|
|
|
+ { title: '产品编码', dataIndex: 'code', width: 180, align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
|
|
{ title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
- { title: '原厂编码', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '箱/单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '采购单价', dataIndex: 'purchasePrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') }, fixed: 'right' },
|
|
|
|
- { title: '采购数量', dataIndex: 'qty', scopedSlots: { customRender: 'storageQuantity' }, width: 150, align: 'center', fixed: 'right' },
|
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
|
|
|
|
+ { title: '原厂编码', dataIndex: 'origCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '箱/单位', dataIndex: 'unit', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '采购单价', dataIndex: 'purchasePrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, fixed: 'right' },
|
|
|
|
+ { title: '采购数量', dataIndex: 'qty', scopedSlots: { customRender: 'storageQuantity' }, width: 100, align: 'center', fixed: 'right' },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
|
|
],
|
|
],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
@@ -310,14 +306,14 @@ export default {
|
|
purchaseDisabled: false, // 查询、重置按钮是否可操作
|
|
purchaseDisabled: false, // 查询、重置按钮是否可操作
|
|
// 表头
|
|
// 表头
|
|
chooseColumns: [
|
|
chooseColumns: [
|
|
- { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
|
- { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 220, align: 'center', sorter: true },
|
|
|
|
|
|
+ { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
|
|
|
|
+ { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 180, align: 'center', sorter: true },
|
|
{ title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
- { title: '采购单价', dataIndex: 'discountedPrice', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
|
|
|
|
- { title: '采购数量', scopedSlots: { customRender: 'storageQuantity' }, width: 150, align: 'center' },
|
|
|
|
- { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '采购金额', dataIndex: 'discountedAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
|
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
|
|
|
|
+ { title: '采购单价', dataIndex: 'discountedPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '采购数量', scopedSlots: { customRender: 'storageQuantity' }, width: 100, align: 'center' },
|
|
|
|
+ { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '采购金额', dataIndex: 'discountedAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
|
|
],
|
|
],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
chooseLoadData: parameter => {
|
|
chooseLoadData: parameter => {
|
|
@@ -339,7 +335,9 @@ export default {
|
|
},
|
|
},
|
|
localDataSource: [],
|
|
localDataSource: [],
|
|
printerType: 'NEEDLE', // 打印机类型
|
|
printerType: 'NEEDLE', // 打印机类型
|
|
- openGuideModal: false // 导入产品引导
|
|
|
|
|
|
+ openGuideModal: false, // 导入产品引导
|
|
|
|
+ openOutStockModal: false,
|
|
|
|
+ paramsData: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -357,17 +355,6 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 基本信息编辑成功
|
|
|
|
- handleOk (data) {
|
|
|
|
- this.openModal = false
|
|
|
|
- this.getOrderDetail()
|
|
|
|
- },
|
|
|
|
- // 编辑基本信息
|
|
|
|
- handleEditInfo () {
|
|
|
|
- this.openModal = true
|
|
|
|
- this.$refs.baseInfo.setData(this.detail)
|
|
|
|
- },
|
|
|
|
- // ---已选产品-----
|
|
|
|
// 删除产品
|
|
// 删除产品
|
|
handleDel (row) {
|
|
handleDel (row) {
|
|
const _this = this
|
|
const _this = this
|
|
@@ -405,11 +392,6 @@ export default {
|
|
this.handleAdd(record, 1)
|
|
this.handleAdd(record, 1)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 导入明细
|
|
|
|
- handleImport () {
|
|
|
|
- console.log(333)
|
|
|
|
- },
|
|
|
|
- // ---------产品库--------
|
|
|
|
filterOption (input, option) {
|
|
filterOption (input, option) {
|
|
return (
|
|
return (
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
@@ -473,7 +455,6 @@ export default {
|
|
this.addLoading = false
|
|
this.addLoading = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // ------------产品库 end --------
|
|
|
|
// 提交
|
|
// 提交
|
|
handleSubmit () {
|
|
handleSubmit () {
|
|
const _this = this
|
|
const _this = this
|
|
@@ -500,6 +481,25 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 上次缺货
|
|
|
|
+ handleOutStock () {
|
|
|
|
+ // 校验是否存在历史采购单,且上次采购存在缺货产品
|
|
|
|
+ purchaseDetailCancelList({ pageNo: 1, pageSize: 5 }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.paramsData = {
|
|
|
|
+ purchaseBillSn: this.$route.params.sn,
|
|
|
|
+ purchaseBillNo: this.detail && this.detail.purchaseBillNo ? this.detail.purchaseBillNo : undefined
|
|
|
|
+ }
|
|
|
|
+ this.openOutStockModal = true
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 上次缺货 导入成功
|
|
|
|
+ hanldeOkOutStock () {
|
|
|
|
+ this.$refs.purchaseTable.refresh(true)
|
|
|
|
+ this.paramsData = null
|
|
|
|
+ this.openOutStockModal = false
|
|
|
|
+ },
|
|
// 打印预览/快捷打印
|
|
// 打印预览/快捷打印
|
|
handlePrint (type) {
|
|
handlePrint (type) {
|
|
const _this = this
|
|
const _this = this
|
|
@@ -563,7 +563,6 @@ export default {
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
next(vm => {
|
|
next(vm => {
|
|
- vm.openModal = false
|
|
|
|
vm.getOrderDetail()
|
|
vm.getOrderDetail()
|
|
})
|
|
})
|
|
}
|
|
}
|