|
@@ -0,0 +1,145 @@
|
|
|
+<template>
|
|
|
+ <a-modal
|
|
|
+ centered
|
|
|
+ :footer="null"
|
|
|
+ :maskClosable="false"
|
|
|
+ class="sales-print-type-modal"
|
|
|
+ v-model="isShow"
|
|
|
+ @cancel="isShow=false"
|
|
|
+ :width="600">
|
|
|
+ <solt>提示:(销售单号: XS240717000014 客户名称:箭冠汽配武汉四新店)</solt>
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
+ <div class="tipModal-content">
|
|
|
+ <strong class="tipModal-tit">销售单以下产品价格发生变更,请确认</strong>
|
|
|
+ <s-table
|
|
|
+ class="sTable fixPagination"
|
|
|
+ ref="table"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ :scroll="{ y: 500 }"
|
|
|
+ :showPagination="false"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ bordered>
|
|
|
+ </s-table>
|
|
|
+ <div>
|
|
|
+ <a-radio-group v-model="priceVal">
|
|
|
+ <a-radio :value="item.id" v-for="item in priceSelectList" :key="item.id">
|
|
|
+ {{ item.name }}
|
|
|
+ </a-radio>
|
|
|
+ </a-radio-group>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top:36px;text-align:center;">
|
|
|
+ <a-button @click="isShow = false" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
|
|
|
+ <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定</a-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </a-spin>
|
|
|
+ </a-modal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { commonMixin } from '@/utils/mixin'
|
|
|
+// 组件
|
|
|
+import { STable } from '@/components'
|
|
|
+// 接口
|
|
|
+import { salesDetailAddPromo } from '@/api/salesDetailNew'
|
|
|
+export default {
|
|
|
+ name: 'NewPromoModal',
|
|
|
+ mixins: [commonMixin],
|
|
|
+ components: { STable },
|
|
|
+ props: {
|
|
|
+ openModal: { // 弹框显示状态
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ const _this = this
|
|
|
+ return {
|
|
|
+ isShow: this.openModal,
|
|
|
+ spinning: false,
|
|
|
+ newPromoSnList: [], // 新活动选项sn
|
|
|
+ confirmLoading: false,
|
|
|
+ columns: [
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: '33%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '初始价', dataIndex: 'product.name', width: '33%', align: 'left', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '最新价', dataIndex: 'product.origCode', width: '33%', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
|
|
|
+ ],
|
|
|
+ priceSelectList: [{
|
|
|
+ id: 1,
|
|
|
+ name: '以【初始价】为准'
|
|
|
+ }, {
|
|
|
+ id: 2,
|
|
|
+ name: '以【最新价】为准'
|
|
|
+ }],
|
|
|
+ priceVal: undefined,
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ // 查询列表
|
|
|
+ return salesList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ let data
|
|
|
+ if (res.status == 200) {
|
|
|
+ data = res.data
|
|
|
+ // 计算编号
|
|
|
+ const no = (data.pageNo - 1) * data.pageSize
|
|
|
+ data.list.forEach((con, i) => {
|
|
|
+ con.no = no + i + 1
|
|
|
+ })
|
|
|
+ this.disabled = false
|
|
|
+ }
|
|
|
+ this.spinning = false
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 保存
|
|
|
+ handleSubmit () {
|
|
|
+ const _this = this
|
|
|
+ if (_this.newPromoSnList.length) {
|
|
|
+ salesDetailAddPromo({
|
|
|
+ 'salesBillSn': _this.salesBillSn,
|
|
|
+ 'promoSnList': _this.newPromoSnList
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$emit('ok')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ _this.$message.info('请选择要参与的新活动')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ // 父页面传过来的弹框状态
|
|
|
+ openModal (newValue, oldValue) {
|
|
|
+ this.isShow = newValue
|
|
|
+ },
|
|
|
+ isShow (newValue, oldValue) {
|
|
|
+ if (!newValue) {
|
|
|
+ this.$emit('close')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="less" scoped>
|
|
|
+ .tipModal-content{
|
|
|
+ width:80%;
|
|
|
+ margin:30px auto 0;
|
|
|
+ text-align:center;
|
|
|
+ .tipModal-tit{
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+ .sTable{
|
|
|
+ margin:15px 0 25px;
|
|
|
+ }
|
|
|
+ .ant-radio-wrapper:first-child{
|
|
|
+ margin-right:70px !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|