|
@@ -29,7 +29,7 @@
|
|
</template>
|
|
</template>
|
|
<a-descriptions :column="3">
|
|
<a-descriptions :column="3">
|
|
<a-descriptions-item label="供应商">{{ detail&&detail.dealerName }}</a-descriptions-item>
|
|
<a-descriptions-item label="供应商">{{ detail&&detail.dealerName }}</a-descriptions-item>
|
|
- <a-descriptions-item label="支付方式">{{ detail&&detail.settleStyle }}</a-descriptions-item>
|
|
|
|
|
|
+ <a-descriptions-item label="支付方式">{{ detail&&detail.settleStyleEntity.name }}</a-descriptions-item>
|
|
<a-descriptions-item label="收货人">{{ detail&&detail.consigneeName }}({{ detail&&detail.consigneeTel }})</a-descriptions-item>
|
|
<a-descriptions-item label="收货人">{{ detail&&detail.consigneeName }}({{ detail&&detail.consigneeTel }})</a-descriptions-item>
|
|
<a-descriptions-item label="收货地址">
|
|
<a-descriptions-item label="收货地址">
|
|
{{ detail&&detail.shippingAddressProvinceName }} -
|
|
{{ detail&&detail.shippingAddressProvinceName }} -
|
|
@@ -101,16 +101,15 @@
|
|
<!-- 采购数量 -->
|
|
<!-- 采购数量 -->
|
|
<template slot="storageQuantity" slot-scope="text, record">
|
|
<template slot="storageQuantity" slot-scope="text, record">
|
|
<a-input-number
|
|
<a-input-number
|
|
- id="purchaseOrderEdit-storageQuantity"
|
|
|
|
- :value="record.storageQuantity"
|
|
|
|
|
|
+ v-model="record.qty"
|
|
:precision="0"
|
|
:precision="0"
|
|
:min="0"
|
|
:min="0"
|
|
:max="999999"
|
|
:max="999999"
|
|
- placeholder="请输入" />
|
|
|
|
|
|
+ placeholder="请输入数量" />
|
|
</template>
|
|
</template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
- <a-button size="small" type="link" @click="handleAdd(record)" id="purchaseOrderEdit-add-btn">添加</a-button>
|
|
|
|
|
|
+ <a-button size="small" type="link" :loading="addLoading" @click="handleAdd(record,0)" id="purchaseOrderEdit-add-btn">添加</a-button>
|
|
</template>
|
|
</template>
|
|
</s-table>
|
|
</s-table>
|
|
</div>
|
|
</div>
|
|
@@ -129,7 +128,9 @@
|
|
<div>
|
|
<div>
|
|
<!-- 总计 -->
|
|
<!-- 总计 -->
|
|
<a-alert type="info" showIcon style="margin-bottom:15px">
|
|
<a-alert type="info" showIcon style="margin-bottom:15px">
|
|
- <div slot="message">产品款数 <strong>6</strong> ,采购数量合计 <strong>6</strong> ,采购金额合计¥<strong>6.33</strong></div>
|
|
|
|
|
|
+ <div slot="message">产品款数 <strong>{{ detail&&detail.totalCategory }}</strong> ,
|
|
|
|
+ 采购数量合计 <strong>{{ detail&&detail.totalQty }}</strong> ,
|
|
|
|
+ 采购金额合计¥<strong>{{ detail&&detail.totalAmount }}</strong></div>
|
|
</a-alert>
|
|
</a-alert>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<s-table
|
|
<s-table
|
|
@@ -167,7 +168,7 @@
|
|
</a-collapse-panel>
|
|
</a-collapse-panel>
|
|
</a-collapse>
|
|
</a-collapse>
|
|
</a-card>
|
|
</a-card>
|
|
- <a-affix :offset-bottom="0">
|
|
|
|
|
|
+ <a-affix :offset-bottom="0" v-if="detail">
|
|
<div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
|
|
<div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
|
|
<a-button
|
|
<a-button
|
|
type="primary"
|
|
type="primary"
|
|
@@ -179,7 +180,7 @@
|
|
</div>
|
|
</div>
|
|
</a-affix>
|
|
</a-affix>
|
|
<!-- 选择基本信息弹框 -->
|
|
<!-- 选择基本信息弹框 -->
|
|
- <basic-info-modal ref="baseInfo" :openModal="openModal" @ok="handleOk" @close="openModal=false" />
|
|
|
|
|
|
+ <basic-info-modal ref="baseInfo" :openModal="openModal" @ok="handleOk" @cancel="openModal=false" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -188,8 +189,9 @@ import { STable, VSelect } from '@/components'
|
|
import basicInfoModal from './basicInfoModal.vue'
|
|
import basicInfoModal from './basicInfoModal.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 { purchaseDetail, purchaseWriteSubmit } from '@/api/purchase'
|
|
|
|
|
|
+import { purchaseDetailBySn, purchaseWriteSubmit } from '@/api/purchase'
|
|
import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel } from '@/api/purchaseDetail'
|
|
import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel } from '@/api/purchaseDetail'
|
|
|
|
+import { productList } from '@/api/product'
|
|
export default {
|
|
export default {
|
|
components: { STable, VSelect, basicInfoModal, ProductType, ProductBrand },
|
|
components: { STable, VSelect, basicInfoModal, ProductType, ProductBrand },
|
|
data () {
|
|
data () {
|
|
@@ -197,6 +199,7 @@ export default {
|
|
openModal: false, // 选择基本信息弹框是否显示
|
|
openModal: false, // 选择基本信息弹框是否显示
|
|
detail: null, // 详细信息
|
|
detail: null, // 详细信息
|
|
// 选择产品
|
|
// 选择产品
|
|
|
|
+ addLoading: false,
|
|
productType: [],
|
|
productType: [],
|
|
queryParam: {
|
|
queryParam: {
|
|
productBrandSn: undefined,
|
|
productBrandSn: undefined,
|
|
@@ -213,25 +216,23 @@ export default {
|
|
// 表头
|
|
// 表头
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
- { title: '产品编码', dataIndex: 'creatDate', width: 140, align: 'center', sorter: true },
|
|
|
|
- { title: '产品名称', dataIndex: 'custName', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '产品级别', dataIndex: 'custsName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '原厂编码', dataIndex: 'totalP', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '终端会员价', dataIndex: 'totalNums', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '车主零售价', scopedSlots: { customRender: 'purchaseNum' }, width: 110, align: 'center' },
|
|
|
|
- { title: '箱/单位', scopedSlots: { customRender: 'outOfStockNum' }, width: 100, align: 'center' },
|
|
|
|
- { title: '采购单价', dataIndex: 'mementPay', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '采购数量', scopedSlots: { customRender: 'storageQuantity' }, width: 150, align: 'center' },
|
|
|
|
|
|
+ { title: '产品编码', dataIndex: 'code', width: 200, align: 'center', sorter: true },
|
|
|
|
+ { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '原厂编码', dataIndex: 'origCode', width: 200, align: 'center', customRender: function (text) { return text == ' ' ? '--' : text } },
|
|
|
|
+ { title: '箱/单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '采购单价', dataIndex: 'terminalPrice', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) }, 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: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
],
|
|
],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
- return customerBundleDelayList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
|
|
|
+ return productList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
const data = res.data
|
|
const data = res.data
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
|
|
+ data.list[i].qty = 1
|
|
}
|
|
}
|
|
this.disabled = false
|
|
this.disabled = false
|
|
return data
|
|
return data
|
|
@@ -242,11 +243,11 @@ export default {
|
|
// 表头
|
|
// 表头
|
|
chooseColumns: [
|
|
chooseColumns: [
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
- { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', sorter: true },
|
|
|
|
- { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
|
|
+ { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 140, align: 'center', sorter: true },
|
|
|
|
+ { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '采购单价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
|
|
{ title: '采购单价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
|
|
{ title: '采购数量', scopedSlots: { customRender: 'storageQuantity' }, width: 150, align: 'center' },
|
|
{ title: '采购数量', scopedSlots: { customRender: 'storageQuantity' }, width: 150, align: 'center' },
|
|
- { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
|
|
+ { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '采购金额', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
|
|
{ title: '采购金额', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
],
|
|
],
|
|
@@ -268,7 +269,7 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
// 获取采购单基本信息
|
|
// 获取采购单基本信息
|
|
getOrderDetail () {
|
|
getOrderDetail () {
|
|
- purchaseDetail({ id: this.$route.params.id }).then(res => {
|
|
|
|
|
|
+ purchaseDetailBySn({ sn: this.$route.params.sn }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.detail = res.data
|
|
this.detail = res.data
|
|
}
|
|
}
|
|
@@ -277,7 +278,7 @@ export default {
|
|
},
|
|
},
|
|
// 基本信息编辑成功
|
|
// 基本信息编辑成功
|
|
handleOk (data) {
|
|
handleOk (data) {
|
|
- this.getOrderDetail()
|
|
|
|
|
|
+ // this.getOrderDetail()
|
|
},
|
|
},
|
|
// 编辑基本信息
|
|
// 编辑基本信息
|
|
handleEditInfo () {
|
|
handleEditInfo () {
|
|
@@ -310,16 +311,9 @@ export default {
|
|
this.$refs.purchaseTable.refresh(!!flag)
|
|
this.$refs.purchaseTable.refresh(!!flag)
|
|
},
|
|
},
|
|
// 修改数量后
|
|
// 修改数量后
|
|
- qtyBlur (v) {
|
|
|
|
- // 光标移出,值发生改变再调用编辑接口
|
|
|
|
- if (val != record.qty) {
|
|
|
|
- purchaseDetailSave(record).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.resetPurchaseDetail(true)
|
|
|
|
- }
|
|
|
|
- this.$message.info(res.message)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ qtyBlur (val, record) {
|
|
|
|
+ console.log(val, record)
|
|
|
|
+ this.handleAdd(record, 1)
|
|
},
|
|
},
|
|
// 导入明细
|
|
// 导入明细
|
|
handleImport () {
|
|
handleImport () {
|
|
@@ -350,13 +344,33 @@ export default {
|
|
this.productType = []
|
|
this.productType = []
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
},
|
|
},
|
|
- // 添加
|
|
|
|
- handleAdd (row) {},
|
|
|
|
|
|
+ // 添加或修改
|
|
|
|
+ handleAdd (row, type) {
|
|
|
|
+ let params = {}
|
|
|
|
+ // 添加
|
|
|
|
+ if (type == 0) {
|
|
|
|
+ params.productSn = row.productSn
|
|
|
|
+ params.purchaseBillSn = this.detail.purchaseBillSn
|
|
|
|
+ params.purchaseBillNo = this.detail.purchaseBillNo
|
|
|
|
+ params.price = row.terminalPrice
|
|
|
|
+ params.qty = row.qty
|
|
|
|
+ } else {
|
|
|
|
+ params = row
|
|
|
|
+ }
|
|
|
|
+ this.addLoading = true
|
|
|
|
+ purchaseDetailSave(params).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.resetPurchaseDetail()
|
|
|
|
+ this.$message.info(res.message)
|
|
|
|
+ }
|
|
|
|
+ this.addLoading = false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// ------------产品库 end --------
|
|
// ------------产品库 end --------
|
|
// 提交
|
|
// 提交
|
|
handleSubmit () {
|
|
handleSubmit () {
|
|
const _this = this
|
|
const _this = this
|
|
- purchaseWriteSubmit({ id: this.$route.params.id }).then(res => {
|
|
|
|
|
|
+ purchaseWriteSubmit({ id: this.detail.id }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.$message.success(res.message)
|
|
this.$message.success(res.message)
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -367,12 +381,13 @@ export default {
|
|
},
|
|
},
|
|
// 返回列表
|
|
// 返回列表
|
|
handleBack () {
|
|
handleBack () {
|
|
- this.$router.push({ naem: 'purchaseOrderList' })
|
|
|
|
|
|
+ this.$router.push({ name: 'purchaseOrderList' })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
next(vm => {
|
|
next(vm => {
|
|
vm.openModal = false
|
|
vm.openModal = false
|
|
|
|
+ vm.getOrderDetail()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|