|
@@ -15,7 +15,7 @@
|
|
|
</a-page-header>
|
|
|
<a-card size="small" :bordered="false" class="salesEdit-cont">
|
|
|
<!-- 查询配件列表 -->
|
|
|
- <queryPart :buyerSn="detailData&&detailData.buyerSn" @add="insterProduct"></queryPart>
|
|
|
+ <queryPart :buyerSn="detailData&&detailData.buyerSn" :newLoading="isInster" @add="insterProduct"></queryPart>
|
|
|
</a-card>
|
|
|
<a-card size="small" :bordered="false" class="salesEdit-cont">
|
|
|
<!-- 总计 -->
|
|
@@ -45,21 +45,27 @@
|
|
|
<a-col :span="18">
|
|
|
<a-form-model layout="inline" :model="productForm">
|
|
|
<a-form-model-item label="产品编码">
|
|
|
- <a-input v-model="productForm.dealerProductEntity.code" allowClear placeholder="输入产品编码" />
|
|
|
+ <a-input v-model="productForm.productCode" allowClear placeholder="输入产品编码" />
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item label="产品名称">
|
|
|
- <a-input v-model="productForm.dealerProductEntity.name" allowClear placeholder="输入产品名称" />
|
|
|
+ <a-input v-model="productForm.productName" allowClear placeholder="输入产品名称" />
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item>
|
|
|
<a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesEdit-refresh">查询</a-button>
|
|
|
- <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="salesEdit-reset">重置</a-button>
|
|
|
+ <a-button style="margin: 0 0 18px 8px" @click="resetForm" id="salesEdit-reset">重置</a-button>
|
|
|
</a-form-model-item>
|
|
|
</a-form-model>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
|
<div style="float:right;overflow: hidden;">
|
|
|
<a-button size="small" id="salesEdit-dru">导入明细</a-button>
|
|
|
- <a-button size="small" type="primary" @click="delSalerDetailAll" style="margin-left: 10px" id="salesEdit-del-all">整单删除</a-button>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click="delSalerDetailAll"
|
|
|
+ :loading="delLoading"
|
|
|
+ style="margin-left: 10px"
|
|
|
+ id="salesEdit-del-all">整单删除</a-button>
|
|
|
</div>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -73,6 +79,13 @@
|
|
|
:data="loadData"
|
|
|
:scroll="{ x: 1560, y: 300 }"
|
|
|
bordered>
|
|
|
+ <!-- 产品编码 -->
|
|
|
+ <template slot="productCode" slot-scope="text, record">
|
|
|
+ <a-badge count="急" v-if="record.oosFlag == 1">
|
|
|
+ <div style="padding-right: 15px;">{{ text }}</div>
|
|
|
+ </a-badge>
|
|
|
+ <span v-else>{{ text }}</span>
|
|
|
+ </template>
|
|
|
<!-- 售价 -->
|
|
|
<template slot="price" slot-scope="text, record">
|
|
|
<editable-cell
|
|
@@ -96,7 +109,13 @@
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
- <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="productInfoList-Del">删除</a-button>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ :loading="delLoading"
|
|
|
+ class="button-error"
|
|
|
+ @click="handleDel(record)"
|
|
|
+ id="productInfoList-Del">删除</a-button>
|
|
|
</template>
|
|
|
</s-table>
|
|
|
</a-card>
|
|
@@ -134,18 +153,17 @@ export default {
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
isInster: false, // 是否正在添加产品
|
|
|
openModal: false, // 客户弹框
|
|
|
+ delLoading: false,
|
|
|
detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
|
|
|
dataSource: [],
|
|
|
productForm: {
|
|
|
- dealerProductEntity: {
|
|
|
- code: '',
|
|
|
- name: ''
|
|
|
- }
|
|
|
+ productName: '',
|
|
|
+ productCode: ''
|
|
|
},
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
- { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 140, align: 'center', sorter: true },
|
|
|
+ { title: '产品编码', dataIndex: 'dealerProductEntity.code', scopedSlots: { customRender: 'productCode' }, width: 140, align: 'center', sorter: true },
|
|
|
{ title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center' },
|
|
|
{ title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 140, align: 'center' },
|
|
|
{ title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: 100, align: 'center', sorter: true },
|
|
@@ -221,6 +239,14 @@ export default {
|
|
|
this.$refs.table.refresh(!!flag)
|
|
|
this.getOrderDetail()
|
|
|
},
|
|
|
+ // 重置列表
|
|
|
+ resetForm () {
|
|
|
+ this.productForm = {
|
|
|
+ productName: '',
|
|
|
+ productCode: ''
|
|
|
+ }
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ },
|
|
|
// 返回
|
|
|
handleBack () {
|
|
|
this.$router.push({ name: 'salesQueryList' })
|
|
@@ -239,25 +265,46 @@ export default {
|
|
|
if (res.status == 200) {
|
|
|
this.resetSearchForm()
|
|
|
}
|
|
|
- this.$message.info(res.message)
|
|
|
})
|
|
|
},
|
|
|
// 整单删除
|
|
|
delSalerDetailAll () {
|
|
|
- salesDetailDelAll({ salesBillSn: this.detailData.salesBillSn }).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.resetSearchForm()
|
|
|
+ const _this = this
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '确认要整单删除吗?',
|
|
|
+ centered: true,
|
|
|
+ closable: true,
|
|
|
+ onOk () {
|
|
|
+ _this.delLoading = true
|
|
|
+ salesDetailDelAll({ salesBillSn: _this.detailData.salesBillSn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.resetSearchForm()
|
|
|
+ }
|
|
|
+ _this.$message.info(res.message)
|
|
|
+ _this.delLoading = false
|
|
|
+ })
|
|
|
}
|
|
|
- this.$message.info(res.message)
|
|
|
})
|
|
|
},
|
|
|
// 删除产品
|
|
|
handleDel (row) {
|
|
|
- salesDetailDel({ id: row.id }).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.resetSearchForm(true)
|
|
|
+ const _this = this
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '确认要删除吗?',
|
|
|
+ centered: true,
|
|
|
+ closable: true,
|
|
|
+ onOk () {
|
|
|
+ _this.delLoading = true
|
|
|
+ salesDetailDel({ id: row.id }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.resetSearchForm(true)
|
|
|
+ }
|
|
|
+ _this.$message.info(res.message)
|
|
|
+ _this.delLoading = false
|
|
|
+ })
|
|
|
}
|
|
|
- this.$message.info(res.message)
|
|
|
})
|
|
|
},
|
|
|
// 添加产品
|
|
@@ -288,6 +335,7 @@ export default {
|
|
|
this.$message.loading('正在添加产品...', 1)
|
|
|
this.isInster = true
|
|
|
salesDetailInsert({
|
|
|
+ buyerSn: this.detailData.buyerSn,
|
|
|
productSn: row.productSn,
|
|
|
price: row.dealerProduct.cityPrice,
|
|
|
qty: row.salesNums,
|
|
@@ -308,8 +356,7 @@ export default {
|
|
|
getOrderDetail () {
|
|
|
salesDetail({ id: this.$route.params.id }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- this.detailData = Object.assign({}, this.detailData, res.data)
|
|
|
- console.log(this.detailData)
|
|
|
+ this.detailData = res.data
|
|
|
}
|
|
|
})
|
|
|
},
|