Browse Source

采购单,系统参数,购物车

chenrui 2 years ago
parent
commit
012e66575c

+ 25 - 25
src/config/router.config.js

@@ -3207,32 +3207,32 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/basicData/systemSettings',
+            redirect: '/basicData/systemSettings/index',
+            name: 'systemSettings',
+            component: BlankLayout,
+            meta: {
+              title: '系统参数',
+              icon: 'sound'
+              // permission: 'M_systemSettingsList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'index',
+                name: 'systemSettingsList',
+                component: () => import(/* webpackChunkName: "basicData" */ '@/views/basicData/systemSettings/index.vue'),
+                meta: {
+                  title: '系统参数',
+                  icon: 'sound',
+                  hidden: true
+                  // permission: 'M_systemSettingsList'
+                }
+              }
+            ]
           }
-          // {
-          //   path: '/basicData/systemSettings',
-          //   redirect: '/basicData/systemSettings/index',
-          //   name: 'systemSettings',
-          //   component: BlankLayout,
-          //   meta: {
-          //     title: '系统参数',
-          //     icon: 'sound',
-          //     permission: 'M_systemSettingsList'
-          //   },
-          //   hideChildrenInMenu: true,
-          //   children: [
-          //     {
-          //       path: 'index',
-          //       name: 'systemSettingsList',
-          //       component: () => import(/* webpackChunkName: "basicData" */ '@/views/basicData/systemSettings/index.vue'),
-          //       meta: {
-          //         title: '系统参数',
-          //         icon: 'sound',
-          //         hidden: true,
-          //         permission: 'M_systemSettingsList'
-          //       }
-          //     }
-          //   ]
-          // }
         ]
       },
       // auth

+ 24 - 1
src/views/basicData/systemSettings/index.vue

@@ -2,6 +2,24 @@
   <a-card size="small" :bordered="false" class="systemSettingsList-wrap" :style="{height:conHeight+'px'}">
     <a-spin :spinning="spinning" tip="Loading...">
       <div ref="contentBox">
+        <a-row :gutter="16">
+          <a-col class="gutter-row" :span="12">
+            产品报价,箭冠产品优先获取自定义车主价和终端价
+          </a-col>
+          <a-col class="gutter-row" :span="12">
+            <a-radio-group v-model="priceValue" @change="handleQty">
+              <a-radio :value="1">
+                启用
+              </a-radio>
+              <a-radio :value="2">
+                禁用
+              </a-radio>
+            </a-radio-group>
+          </a-col>
+          <a-col class="priceDesc" :span="24">
+            箭冠产品优先获取自定义车主价和终端价启用后,自定义车主价和终端价存在时,产品报价列表将优先显示自定义价格,自定义车主价和终端价不存在时,获取箭冠建议价。
+          </a-col>
+        </a-row>
         <a-row :gutter="16">
           <a-col class="gutter-row" :span="12">
             销售下单时,是否显示产品库存为0的产品信息
@@ -62,6 +80,7 @@ export default {
   data () {
     return {
       spinning: false,
+      priceValue: 2,
       qtyValue: 1,
       wasteInfoValue: 1,
       wasteNumValue: 1,
@@ -98,7 +117,7 @@ export default {
       })
     },
     setTableH () {
-      this.conHeight = window.innerHeight - 110.5
+      this.conHeight = window.innerHeight - 86.5
     },
     handleQty () {},
     handleWasteInfo () {},
@@ -129,6 +148,10 @@ export default {
     .ant-row{
       padding:23px 10px;
       border-bottom: 1px solid #e0e0e0;
+      .priceDesc{
+        color:gray;
+        margin-top:10px;
+      }
     }
   }
 

+ 29 - 1
src/views/productManagement/newProduct/detail.vue

@@ -22,6 +22,34 @@
             <a-descriptions-item label="重量:">{{ (detailsData && detailsData.weight) || '--' }}</a-descriptions-item>
             <a-descriptions-item label="计量单位:">{{ (detailsData && detailsData.unit) || '--' }}</a-descriptions-item>
           </a-descriptions>
+          <a-descriptions bordered :column="2" layout="vertical" size="small" style="margin-top:10px;">
+            <a-descriptions-item label="省级经销商:" :span="2">
+              <a-row :gutter="16">
+                <a-col class="gutter-row" :span="6">
+                  市场建议价:--
+                </a-col>
+                <a-col class="gutter-row" :span="6">
+                  特约建议价:--
+                </a-col>
+                <a-col class="gutter-row" :span="6">
+                  终端建议价:--
+                </a-col>
+                <a-col class="gutter-row" :span="6">
+                  车主建议价:--
+                </a-col>
+              </a-row>
+            </a-descriptions-item>
+            <a-descriptions-item label="市级经销商和特约经销商:" :span="2">
+              <a-row :gutter="16">
+                <a-col class="gutter-row" :span="6">
+                  终端建议价:--
+                </a-col>
+                <a-col class="gutter-row" :span="6">
+                  车主建议价:--
+                </a-col>
+              </a-row>
+            </a-descriptions-item>
+          </a-descriptions>
           <div class="productDetail">
             <h4>产品介绍</h4>
             <div class="productDesc">
@@ -29,7 +57,7 @@
               <span v-else>暂无产品介绍</span>
             </div>
           </div>
-        </div>
+          </a-descriptions></div>
         <div class="productImg" v-if="detailsData && detailsData.productPicList && detailsData.productPicList.length>0">
           <a-carousel arrows dots-class="slick-dots slick-thumb">
             <a slot="customPaging" slot-scope="props">

+ 222 - 0
src/views/productManagement/productInfoJg/editPriceModal.vue

@@ -0,0 +1,222 @@
+<template>
+  <a-modal
+    centered
+    class="editPrice-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="自定义报价"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="800">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 表单 -->
+      <div v-if="!isView">
+        <a-form-model
+          id="editPrice-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="终端建议价" prop="terminalPrice">
+            <div>{{ form.terminalPrice }}</div>
+          </a-form-model-item>
+          <a-form-model-item label="自定义终端价">
+            <a-input
+              id="editPrice-idCard"
+              :maxLength="18"
+              v-model.trim="form.terminalPriceZdy"
+              placeholder="请输入自定义终端价"
+              allowClear />
+          </a-form-model-item>
+          <a-form-model-item label="车主建议价" prop="terminalPrice">
+            <div>{{ form.carOwnersPrice }}</div>
+          </a-form-model-item>
+          <a-form-model-item label="自定义车主价" prop="mobile">
+            <a-input
+              id="editPrice-mobile"
+              v-model.trim="form.mobile"
+              placeholder="请输入自定义车主价"
+              allowClear />
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button type="primary" size="large" id="editPrice-btn-submit" @click="handleSubmit">保存</a-button>
+          <a-button id="editPrice-btn-back" size="large" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+        </div>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { employeeSave, employeeDetail } from '@/api/salesman'
+import moment from 'moment'
+export default {
+  name: 'EditPriceModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    },
+    modalTitle: {
+      type: String,
+      default: ''
+    },
+    isState: { //  是否显示状态
+      type: Boolean,
+      default: true
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      isView: false, // 是否查看详情
+      form: {
+        terminalPrice: '', // 终端建议价
+        terminalPriceZdy: '', //  自定义终端价
+        carOwnersPrice: '', //  车主建议价
+        carOwnersPriceZdy: '' // 自定义车主价
+      },
+      rules: {
+        name: [
+          { required: true, message: '请输入姓名', trigger: 'blur' }, { pattern: '^[^<|>]{1,30}$', message: '请输入不含<或>的字符,最多30个字符' }
+        ],
+        mobile: [
+          { required: true, message: '请输入手机号码', trigger: 'blur' }, { pattern: /^\d{11}$/, message: '请输入正确的手机号码!' }
+        ],
+        entryDate: [
+          { required: true, message: '请选择入职时间', trigger: 'change' }
+
+        ],
+        sex: [
+          { required: true, message: '请选择性别', trigger: 'change' }
+        ],
+        enableFlag: [
+          { required: true, message: '请选择状态', trigger: 'change' }
+        ]
+      }
+    }
+  },
+  methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    // 不可选日期
+    disabledDate (current) {
+      return current && current > moment().endOf('day')
+    },
+    filterEmpty () {
+      let str = this.form.supplierName
+      str = str.replace(/\ +/g, '')
+      str = str.replace(/[ ]/g, '')
+      str = str.replace(/[\r\n]/g, '')
+      this.form.supplierName = str
+    },
+    // 详情
+    getDetail () {
+      employeeDetail({ id: this.itemId }).then(res => {
+        if (res.status == 200) {
+          this.form = Object.assign(this.form, res.data)
+          this.form.sex = Number(this.form.sex)
+          this.form.enableFlag = Number(this.form.enableFlag)
+        }
+      })
+    },
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = _this.form
+          form.entryDate = moment(form.entryDate).format('YYYY-MM-DD')
+          form.id = this.itemId ? this.itemId : null
+          _this.spinning = true
+          employeeSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('ok')
+              _this.isShow = false
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    cancel () {
+      this.form = {
+        name: '', // 姓名
+        mobile: '', //  联系电话
+        enableFlag: 1, //  启禁用
+        sex: 1, // 性别
+        idCard: '', // 身份证号
+        entryDate: undefined // 入职时间
+      }
+      // this.$nextTick(() => {
+      //   this.$refs.ruleForm.resetFields()
+      // })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+      this.cancel()
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    },
+    itemId (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        this.getDetail()
+      }
+    },
+    modalTitle (newValue, oldValue) {
+      console.log(newValue)
+      if (newValue) {
+        if (newValue == '编辑' || newValue == '新增') {
+          this.isView = false
+        } else {
+          this.isView = true
+        }
+      }
+    }
+
+  }
+}
+</script>
+
+<style lang="less">
+  .editPrice-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 107 - 18
src/views/productManagement/productInfoJg/list.vue

@@ -50,14 +50,51 @@
     </div>
     <!-- 操作按钮 -->
     <div class="table-operator" v-if="$hasPermissions('B_JgProduct_enable')">
-      <a-dropdown>
-        <a-menu slot="overlay" @click="handleMenuClick">
-          <a-menu-item key="1"> 批量启用</a-menu-item>
-          <a-menu-item key="2"> 批量禁用</a-menu-item>
-        </a-menu>
-        <a-button ghost type="danger"> 批量操作 <a-icon type="down" /> </a-button>
-      </a-dropdown>
-      <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys">已选 {{ rowSelectionInfo.selectedRowKeys.length }} 项</span>
+      <a-row :gutter="16">
+        <a-col class="gutter-row" :span="12">
+          <a-dropdown>
+            <a-menu slot="overlay" @click="handleMenuClick">
+              <a-menu-item key="1"> 批量启用</a-menu-item>
+              <a-menu-item key="2"> 批量禁用</a-menu-item>
+            </a-menu>
+            <a-button ghost type="danger"> 批量操作 <a-icon type="down" /> </a-button>
+          </a-dropdown>
+          <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys">已选 {{ rowSelectionInfo.selectedRowKeys.length }} 项</span>
+        </a-col>
+        <a-col class="gutter-row" :span="12">
+          <div class="setTableList">
+            <span @click="iconShowFlag=!iconShowFlag">列表显示配置</span>
+            <a-icon :type="iconShowFlag?'up':'down'" :style="{ color: '#d5d5d5' }" @click="iconShowFlag=!iconShowFlag"/>
+            <div class="setTableList-box" v-show="iconShowFlag">
+              <a-checkbox-group @change="onChangeList" :value="chooseShowList">
+                <div>
+                  <a-checkbox value="A">
+                    省级价
+                  </a-checkbox>
+                </div>
+                <div><a-checkbox value="B">
+                  市级建议价
+                </a-checkbox></div>
+                <div><a-checkbox value="C">
+                  特约建议价
+                </a-checkbox></div>
+                <div><a-checkbox value="D">
+                  建议终端价
+                </a-checkbox></div>
+                <div> <a-checkbox value="E">
+                  建议车主价
+                </a-checkbox></div>
+                <div> <a-checkbox value="F">
+                  自定义终端价
+                </a-checkbox></div>
+                <div><a-checkbox value="G">
+                  自定义车主价
+                </a-checkbox></div>
+              </a-checkbox-group>
+            </div>
+          </div>
+        </a-col>
+      </a-row>
     </div>
     <!-- 列表 -->
     <s-table
@@ -107,8 +144,16 @@
           class="button-success"
           @click="handleDetail(record)"
           id="productInfoList-detail-btn">详情</a-button>
+        <a-button
+          size="small"
+          type="link"
+          class="button-primary"
+          @click="handleEditPrice(record)"
+          id="productInfoList-price-btn">自定义报价</a-button>
       </template>
     </s-table>
+    <!-- 自定义报价弹窗 -->
+    <edit-price-modal :openModal="openEditPriceModal" ref="editPrice" @close="openEditPriceModal=false" />
   </a-card>
 </template>
 
@@ -119,9 +164,10 @@ import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import { STable, VSelect } from '@/components'
 // import { downloadExcel } from '@/libs/JGPrint.js'
+import editPriceModal from './editPriceModal.vue'
 export default {
   name: 'ProductJgList',
-  components: { STable, VSelect, ProductType, ProductBrand },
+  components: { STable, VSelect, ProductType, ProductBrand, editPriceModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -140,10 +186,13 @@ export default {
         onlineFalg: '',
         enabledFlag: '1'
       },
+      openEditPriceModal: false, // 自定义报价弹窗
+      iconShowFlag: false, // 列表配置图标显示
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       dateFormat: 'YYYY-MM-DD',
       columns: [],
+      chooseShowList: ['A', 'B', 'C', 'D', 'E'],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -191,6 +240,9 @@ export default {
         })
       }
     },
+    onChangeList (checkedValues) {
+      this.chooseShowList = checkedValues
+    },
     //  详情
     handleDetail (row) {
       this.$router.push({ name: 'viewProduct', params: { sn: row.productSn } })
@@ -221,31 +273,33 @@ export default {
       const _this = this
       this.columns = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'code', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'name', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'origCode', width: '17%', align: 'center', customRender: function (text) { return (!text || text == ' ') ? '--' : text } }
+        { title: '产品编码', dataIndex: 'code', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'origCode', width: '12%', align: 'center', customRender: function (text) { return (!text || text == ' ') ? '--' : text } }
       ]
       const cArr = [
-        { title: '终端价', dataIndex: 'terminalPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '车主价', dataIndex: 'carOwnersPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '终端建议价', dataIndex: 'terminalPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '车主建议价', dataIndex: 'carOwnersPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '自定义终端价', dataIndex: 'price1', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '自定义车主价', dataIndex: 'price2', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: '7%', align: 'center' },
         { title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '6%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
       ]
       getCurrentDealer().then(res => {
         if (res.status == 200) {
           if (res.data.dealerLevel && res.data.dealerLevel == 'PROVINCE') { //  省级
             this.columns.push(
               { title: '省级价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-              { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+              { title: '市级建议价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
             )
           } else if (res.data.dealerLevel && res.data.dealerLevel == 'CITY') { //  市级
             this.columns.push(
-              { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+              { title: '市级建议价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
             )
           }
           if (res.data.isShowSpecialPrice && res.data.isShowSpecialPrice == '1') { //  是否展示特约价
-            this.columns.push({ title: '特约价', dataIndex: 'specialPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+            this.columns.push({ title: '特约建议价', dataIndex: 'specialPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
           }
           this.columns = [...this.columns, ...cArr]
         }
@@ -326,6 +380,14 @@ export default {
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 235
+    },
+    // 打开自定义报价弹窗
+    handleEditPrice () {
+      // const oldPrice = {
+
+      // }
+      // this.$refs.editPrice.setOldPrice(oldPrice)
+      this.openEditPriceModal = true
     }
   },
   watch: {
@@ -357,3 +419,30 @@ export default {
   }
 }
 </script>
+<style lang="less" scoped>
+.setTableList{
+  text-align: right;
+  position: relative;
+  span{
+    margin-right: 10px;
+    color:#56a2fb;
+  }
+  .setTableList-box{
+    padding:10px 12px;
+    border:1px solid #d5d5d5;
+    border-radius: 5px;
+    background:#fff;
+    text-align: left;
+    position: absolute;
+    top:22px;
+    right:0;
+    z-index: 99999;
+    div{
+      margin-bottom: 10px;
+      &:last-child{
+        margin-bottom: 0px;
+      }
+    }
+  }
+}
+</style>

+ 54 - 5
src/views/purchasingManagement/purchaseOrder/outStockModal.vue

@@ -4,13 +4,44 @@
     class="outStock-modal"
     :footer="null"
     :maskClosable="false"
-    title="上次采购缺货产品明细"
+    :title="title"
     v-model="isShow"
     @cancel="isShow=false"
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="outStock-con">
         <div>
+          <div ref="tableSearch" class="table-page-search-wrapper">
+            <a-form layout="inline" @keyup.enter.native="searchForm">
+              <a-row :gutter="15">
+                <a-col :md="8" :sm="24">
+                  <a-form-item label="产品编码">
+                    <a-input id="productInfoList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="8" :sm="24">
+                  <a-form-item label="产品名称">
+                    <a-input id="productInfoList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="8" :sm="24">
+                  <a-form-item label="产品分类">
+                    <ProductType id="productInfoList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="8" :sm="24">
+                  <a-form-item label="产品品牌">
+                    <ProductBrand id="productInfoList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
+                    </a-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
+                  <a-button type="primary" @click="searchForm" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
+                </a-col>
+              </a-row>
+            </a-form>
+          </div>
           <p style="font-weight: bold;">当前已选:{{ rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length }}个</p>
           <!-- 列表 -->
           <s-table
@@ -35,7 +66,7 @@
             size="large"
             class="button-primary"
             @click="handleSave"
-            style="padding: 0 36px;">加入本次采购</a-button>
+            style="padding: 0 36px;">批量添加</a-button>
           <a-button
             id="outStock-cancel"
             size="large"
@@ -44,7 +75,7 @@
             style="padding: 0 60px;margin-left: 15px;">取消</a-button>
         </div>
       </div>
-    </a-spin>
+      </div></a-spin>
   </a-modal>
 </template>
 
@@ -52,9 +83,11 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable } from '@/components'
 import { purchaseDetailCancelList, purchaseDetailCancelSave } from '@/api/purchaseDetail'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
 export default {
   name: 'OutStockModal',
-  components: { STable },
+  components: { STable, ProductType, ProductBrand },
   mixins: [commonMixin],
   props: {
     openModal: { //  弹框显示状态
@@ -89,6 +122,7 @@ export default {
         { title: '上次缺货数量', dataIndex: 'cancelQty', width: '18%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
+      title: '上次采购缺货产品明细(采购单号:' + 'XS22456789' + ')',
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -104,10 +138,25 @@ export default {
         })
       },
       spinning: false,
-      rowSelectionInfo: null
+      rowSelectionInfo: null,
+      productType: [],
+      queryParam: { //  查询条件
+        code: '', //  产品编码
+        name: '', //  产品名称
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '' //  产品三级分类
+      }
     }
   },
   methods: {
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
     // 表格选中项
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null

+ 448 - 0
src/views/shoppingCar/index.vue

@@ -0,0 +1,448 @@
+<template>
+  <a-card size="small" :bordered="false" class="shoppingCar-wrap">
+    <!-- 搜索条件 -->
+    <div ref="tableSearch" class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchForm">
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品编码">
+              <a-input id="shoppingCar-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品名称">
+              <a-input id="shoppingCar-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="原厂编码">
+              <a-input id="shoppingCar-origCode" v-model.trim="queryParam.origCode" allowClear placeholder="请输入原厂编码"/>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品品牌">
+                <ProductBrand id="shoppingCar-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <!-- <a-col :md="6" :sm="24">
+              <a-form-item label="产品分类">
+              <ProductType id="shoppingCar-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
+              </a-form-item>
+            </a-col> -->
+            <a-col :md="6" :sm="24">
+              <a-form-item label="状态">
+                <v-select code="ENABLE_FLAG" id="shoppingCar-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择状态"></v-select>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="searchForm" :disabled="disabled" id="shoppingCar-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="shoppingCar-reset">重置</a-button>
+            <a @click="advanced=!advanced" style="margin-left: 5px">
+              {{ advanced ? '收起' : '展开' }}
+              <a-icon :type="advanced ? 'up' : 'down'"/>
+            </a>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 操作按钮 -->
+    <div class="table-operator" v-if="$hasPermissions('B_JgProduct_enable')">
+      <a-row :gutter="16">
+        <a-col class="gutter-row" :span="12">
+          <a-dropdown>
+            <a-menu slot="overlay" @click="handleMenuClick">
+              <a-menu-item key="1"> 批量启用</a-menu-item>
+              <a-menu-item key="2"> 批量禁用</a-menu-item>
+            </a-menu>
+            <a-button ghost type="danger"> 批量操作 <a-icon type="down" /> </a-button>
+          </a-dropdown>
+          <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys">已选 {{ rowSelectionInfo.selectedRowKeys.length }} 项</span>
+        </a-col>
+        <a-col class="gutter-row" :span="12">
+          <div class="setTableList">
+            <span @click="iconShowFlag=!iconShowFlag">列表显示配置</span>
+            <a-icon :type="iconShowFlag?'up':'down'" :style="{ color: '#d5d5d5' }" @click="iconShowFlag=!iconShowFlag"/>
+            <div class="setTableList-box" v-show="iconShowFlag">
+              <a-checkbox-group @change="onChangeList" :value="chooseShowList">
+                <div>
+                  <a-checkbox value="A">
+                    省级价
+                  </a-checkbox>
+                </div>
+                <div><a-checkbox value="B">
+                  市级建议价
+                </a-checkbox></div>
+                <div><a-checkbox value="C">
+                  特约建议价
+                </a-checkbox></div>
+                <div><a-checkbox value="D">
+                  建议终端价
+                </a-checkbox></div>
+                <div> <a-checkbox value="E">
+                  建议车主价
+                </a-checkbox></div>
+                <div> <a-checkbox value="F">
+                  自定义终端价
+                </a-checkbox></div>
+                <div><a-checkbox value="G">
+                  自定义车主价
+                </a-checkbox></div>
+              </a-checkbox-group>
+            </div>
+          </div>
+        </a-col>
+      </a-row>
+    </div>
+    <!-- 列表 -->
+    <s-table
+      class="sTable fixPagination"
+      ref="table"
+      :style="{ height: tableHeight+84.5+'px' }"
+      size="small"
+      :row-selection="$hasPermissions('B_JgProduct_enable')?rowSelection:null"
+      @rowSelection="rowSelectionFun"
+      rowKeyName="productSn"
+      :rowKey="(record) => record.productSn"
+      :columns="columns"
+      :data="loadData"
+      :scroll="{ y: tableHeight }"
+      :defaultLoadData="false"
+      bordered>
+      <!-- 产品图片 -->
+      <template slot="imageUrl" slot-scope="text, record">
+        <div v-if="record.productPicList && record.productPicList.length>0">
+          <img :src="record.productPicList[0].imageUrl+'?x-oss-process=image/resize,h_30,m_lfit' || ''" width="30" height="30" class="imageUrl" @click="inited(record.productPicList)" />
+        </div>
+        <span v-else>--</span>
+      </template>
+      <!-- 产品分类 -->
+      <template slot="productType" slot-scope="text, record">
+        <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+        <span v-else>--</span>
+      </template>
+      <!-- 状态 -->
+      <template slot="enabledFlag" slot-scope="text, record">
+        <a-switch
+          checkedChildren="启用"
+          unCheckedChildren="禁用"
+          v-if="$hasPermissions('B_JgProduct_enable')&&record.enabledFlag!=undefined"
+          @change="changeStatus(record)"
+          :checked="record.enabledFlag == 1 ? true : false"
+        />
+        <span v-else :style="{ color: record.enabledFlag == 1 ? '#00aa00' : '#999' }">
+          {{ record.enabledFlag == 1 ? '已启用' : (record.enabledFlag!=undefined?'已禁用':'--') }}
+        </span>
+      </template>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button
+          size="small"
+          type="link"
+          class="button-success"
+          @click="handleDetail(record)"
+          id="shoppingCar-detail-btn">详情</a-button>
+        <a-button
+          size="small"
+          type="link"
+          class="button-primary"
+          @click="handleEditPrice(record)"
+          id="shoppingCar-price-btn">自定义报价</a-button>
+      </template>
+    </s-table>
+    <!-- 自定义报价弹窗 -->
+    <edit-price-modal :openModal="openEditPriceModal" ref="editPrice" @close="openEditPriceModal=false" />
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { productList, getCurrentDealer, productUpdate } from '@/api/product'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
+import { STable, VSelect } from '@/components'
+// import { downloadExcel } from '@/libs/JGPrint.js'
+import editPriceModal from './editPriceModal.vue'
+export default {
+  name: 'ProductJgList',
+  components: { STable, VSelect, ProductType, ProductBrand, editPriceModal },
+  mixins: [commonMixin],
+  data () {
+    return {
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      productType: [],
+      queryParam: { //  查询条件
+        code: '', //  产品编码
+        name: '', //  产品名称
+        origCode: '', //  原厂编码
+        sysFlag: '1',
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        onlineFalg: '',
+        enabledFlag: '1'
+      },
+      openEditPriceModal: false, // 自定义报价弹窗
+      iconShowFlag: false, // 列表配置图标显示
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出loading
+      dateFormat: 'YYYY-MM-DD',
+      columns: [],
+      chooseShowList: ['A', 'B', 'C', 'D', 'E'],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return productList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      openModal: false, //  查看客户详情  弹框
+      itemId: '', //  当前产品id
+      productTypeList: [], //  分类下拉数据
+      rowSelectionInfo: null
+    }
+  },
+  computed: {
+    rowSelection () {
+      return {
+        getCheckboxProps: record => ({
+          props: {
+            disabled: record.enabledFlag == undefined // Column configuration not to be checked
+          }
+        })
+      }
+    }
+  },
+  methods: {
+    inited (viewer) {
+      if (viewer) {
+        const imageUrl = []
+        viewer.map(item => {
+          imageUrl.push(item.imageUrl)
+        })
+        this.$viewerApi({
+          images: imageUrl
+        })
+      }
+    },
+    onChangeList (checkedValues) {
+      this.chooseShowList = checkedValues
+    },
+    //  详情
+    handleDetail (row) {
+      this.$router.push({ name: 'viewProduct', params: { sn: row.productSn } })
+    },
+    // 查询
+    searchForm () {
+      this.$refs.table.clearSelected() // 清空表格选中项
+      this.$refs.table.refresh(true)
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.code = ''
+      this.queryParam.name = ''
+      this.queryParam.origCode = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.onlineFalg = ''
+      this.queryParam.enabledFlag = '1'
+      this.productType = []
+      this.$refs.table.refresh(true)
+      this.rowSelectionInfo = null
+      this.$refs.table.clearSelected()
+    },
+    // 设置表头
+    getColumns () {
+      const _this = this
+      this.columns = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'code', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'origCode', width: '12%', align: 'center', customRender: function (text) { return (!text || text == ' ') ? '--' : text } }
+      ]
+      const cArr = [
+        { title: '终端建议价', dataIndex: 'terminalPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '车主建议价', dataIndex: 'carOwnersPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '自定义终端价', dataIndex: 'price1', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '自定义车主价', dataIndex: 'price2', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: '7%', align: 'center' },
+        { title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '6%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
+      ]
+      getCurrentDealer().then(res => {
+        if (res.status == 200) {
+          if (res.data.dealerLevel && res.data.dealerLevel == 'PROVINCE') { //  省级
+            this.columns.push(
+              { title: '省级价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+              { title: '市级建议价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+            )
+          } else if (res.data.dealerLevel && res.data.dealerLevel == 'CITY') { //  市级
+            this.columns.push(
+              { title: '市级建议价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+            )
+          }
+          if (res.data.isShowSpecialPrice && res.data.isShowSpecialPrice == '1') { //  是否展示特约价
+            this.columns.push({ title: '特约建议价', dataIndex: 'specialPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+          }
+          this.columns = [...this.columns, ...cArr]
+        }
+      })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    // 启用 禁用
+    changeStatus (record) {
+      this.$confirm({
+        title: '提示',
+        content: record.enabledFlag == '1' ? '产品被禁用后,不能再销售,确定禁用吗?' : '确定启用吗?',
+        centered: true,
+        onOk: () => {
+          this.setEnable(record.enabledFlag == 1 ? '0' : '1', [record.productSn])
+        }
+      })
+    },
+    // 启用 禁用
+    setEnable (enabledFlag, snList) {
+      const params = {
+        productSnList: snList,
+        enabledFlag: enabledFlag
+      }
+      this.spinning = true
+      productUpdate(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.$refs.table.clearSelected()
+          this.rowSelectionInfo = null
+          this.$refs.table.refresh()
+          this.spinning = false
+        } else {
+          this.$refs.table.refresh()
+          this.spinning = false
+        }
+      })
+    },
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 批量操作
+    handleOutbounds (type) {
+      console.log(this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length)
+      if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length <= 0)) {
+        this.$message.warning('请在列表勾选后再进行批量操作!')
+        return
+      }
+      this.$confirm({
+        title: '提示',
+        content: type == '2' ? '产品被禁用后,不能再销售,确定批量禁用吗?' : '确定批量启用吗?',
+        centered: true,
+        onOk: () => {
+          this.setEnable(type == '2' ? '0' : '1', this.rowSelectionInfo.selectedRowKeys)
+        }
+      })
+    },
+    handleMenuClick (e) {
+      this.handleOutbounds(e.key)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      this.getColumns()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 235
+    },
+    // 打开自定义报价弹窗
+    handleEditPrice () {
+      // const oldPrice = {
+
+      // }
+      // this.$refs.editPrice.setOldPrice(oldPrice)
+      this.openEditPriceModal = true
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+<style lang="less" scoped>
+.setTableList{
+  text-align: right;
+  position: relative;
+  span{
+    margin-right: 10px;
+    color:#56a2fb;
+  }
+  .setTableList-box{
+    padding:10px 12px;
+    border:1px solid #d5d5d5;
+    border-radius: 5px;
+    background:#fff;
+    text-align: left;
+    position: absolute;
+    top:22px;
+    right:0;
+    z-index: 99999;
+    div{
+      margin-bottom: 10px;
+      &:last-child{
+        margin-bottom: 0px;
+      }
+    }
+  }
+}
+</style>