|
@@ -99,13 +99,13 @@
|
|
class="button-error"
|
|
class="button-error"
|
|
@click="handleDel(record)"
|
|
@click="handleDel(record)"
|
|
>删除</a-button>
|
|
>删除</a-button>
|
|
- <!-- <a-button
|
|
+ <a-button
|
|
size="small"
|
|
size="small"
|
|
type="primary"
|
|
type="primary"
|
|
:loading="delLoading"
|
|
:loading="delLoading"
|
|
class="button-warning"
|
|
class="button-warning"
|
|
@click="handleSelCx(record)"
|
|
@click="handleSelCx(record)"
|
|
- >选择促销品</a-button> -->
|
|
+ >选择促销品</a-button>
|
|
</template>
|
|
</template>
|
|
</s-table>
|
|
</s-table>
|
|
</a-card>
|
|
</a-card>
|
|
@@ -123,6 +123,8 @@
|
|
</a-affix>
|
|
</a-affix>
|
|
<!-- 选择客户弹框 -->
|
|
<!-- 选择客户弹框 -->
|
|
<choose-custom-modal ref="custModal" :show="openModal" @cancel="openModal=false" />
|
|
<choose-custom-modal ref="custModal" :show="openModal" @cancel="openModal=false" />
|
|
|
|
+ <!-- 添加产品 -->
|
|
|
|
+ <ChooseActive ref="activeProduct" :openModal="newActive" @ok="addNewActive" @close="newActive=false"></ChooseActive>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -130,12 +132,13 @@
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import queryPart from './queryPart.vue'
|
|
import queryPart from './queryPart.vue'
|
|
import chooseCustomModal from './chooseCustomModal.vue'
|
|
import chooseCustomModal from './chooseCustomModal.vue'
|
|
-import { salesDetailBySn, salesWriteSubmit } from '@/api/sales'
|
|
+import ChooseActive from './chooseActive.vue'
|
|
|
|
+import { salesDetailBySn, salesWriteSubmit, getPromoacActiveList } from '@/api/sales'
|
|
import EditableCell from '@/views/common/editInput.js'
|
|
import EditableCell from '@/views/common/editInput.js'
|
|
import { salesDetailList, salesDetailInsert, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll } from '@/api/salesDetail'
|
|
import { salesDetailList, salesDetailInsert, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll } from '@/api/salesDetail'
|
|
export default {
|
|
export default {
|
|
name: 'SalesDetail',
|
|
name: 'SalesDetail',
|
|
- components: { STable, VSelect, queryPart, chooseCustomModal, EditableCell },
|
|
+ components: { STable, VSelect, queryPart, chooseCustomModal, EditableCell, ChooseActive },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
salesBillSn: null, // 销售单sn
|
|
salesBillSn: null, // 销售单sn
|
|
@@ -143,11 +146,13 @@ export default {
|
|
isInster: false, // 是否正在添加产品
|
|
isInster: false, // 是否正在添加产品
|
|
openModal: false, // 客户弹框
|
|
openModal: false, // 客户弹框
|
|
delLoading: false,
|
|
delLoading: false,
|
|
|
|
+ newActive: false, // 选择促销品
|
|
detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
|
|
detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
|
|
dataSource: [],
|
|
dataSource: [],
|
|
productForm: {
|
|
productForm: {
|
|
salesBillSn: ''
|
|
salesBillSn: ''
|
|
},
|
|
},
|
|
|
|
+ activeList: [], // 促销活动
|
|
// 表头
|
|
// 表头
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
@@ -314,6 +319,20 @@ export default {
|
|
this.$message.success(res.message)
|
|
this.$message.success(res.message)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+ // 获取促销活动
|
|
|
|
+ getPromoacActiveList () {
|
|
|
|
+ getPromoacActiveList({ salesBillSn: this.salesBillSn }).then(res => {
|
|
|
|
+ this.activeList = res.data || []
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 选择促销品
|
|
|
|
+ handleSelCx (row) {
|
|
|
|
+ this.newActive = true
|
|
|
|
+ this.$refs.activeProduct.getData(row)
|
|
|
|
+ },
|
|
|
|
+ addNewActive () {
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|
|
@@ -321,8 +340,8 @@ export default {
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
next(vm => {
|
|
next(vm => {
|
|
- console.log('beforeRouteEnter')
|
|
|
|
vm.salesBillSn = vm.$route.params.sn
|
|
vm.salesBillSn = vm.$route.params.sn
|
|
|
|
+ vm.getPromoacActiveList()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|