Browse Source

Merge branch 'develop_szhj06' of jianguan-web/qpls-it-html into pre-release

李磊 2 years ago
parent
commit
037824ab1a

+ 19 - 1
src/api/approveStore.js

@@ -26,4 +26,22 @@ export const xprhStoreApplyDetail = (params) => {
     url: `/xprhStoreApply/findBySn/${params.sn}`,
     method: 'get'
   })
-}
+}
+
+// 获取价格显示
+export const queryList = (params) => {
+  return axios({
+    url: `/bizparam/queryList`,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 更新价格显示
+export const updateBatch = (params) => {
+  return axios({
+    url: `/bizparam/updateBatch`,
+    data: params,
+    method: 'post'
+  })
+}

+ 123 - 7
src/views/numsGoodsShelves/approveStore/authPass.vue

@@ -143,6 +143,65 @@
                   placeholder="请输入大于100的数字(最多允许两位小数)"></a-input-number>
               </a-form-model-item>
             </a-col>
+            <a-col :span="12" v-for="(con, index) in priceList" :key="index" v-if="priceList.length>0">
+              <a-form-model-item :prop="form[con.paramCode]" v-if="con.paramCode == 'shelf_price_show'">
+                <template slot="label">
+                  <a-tooltip placement="top">
+                    <template slot="title">
+                      修理厂登录修配易码通小程序后,
+                      <br />
+                      是否可以看见产品的车主价
+                    </template>
+                    车主价
+                    <a-icon type="question-circle" style="color: rgba(0,0,0,.65);font-size: 16px;margin-left: 2px;vertical-align: sub;cursor: pointer;" />
+                  </a-tooltip>
+                </template>
+                <a-radio-group @change="(e)=>onChangePriceType(e,index)" v-model="con.paramValue">
+                  <a-radio value="1">可见</a-radio>
+                  <a-radio value="0">不可见</a-radio>
+                </a-radio-group>
+                <span class="spanStyle">(修理厂的建议销售价)</span>
+              </a-form-model-item>
+              <a-form-model-item :prop="form[con.paramCode]" v-if="con.paramCode == 'shelf_cost_show'">
+                <template slot="label">
+                  <a-tooltip placement="top">
+                    <template slot="title">
+                      修理厂登录修配易码通小程序后,<br>
+                      是否可以看见产品的进货价
+                    </template>
+                    进货价<a-icon type="question-circle" style="color: rgba(0,0,0,.65);font-size: 16px;margin-left: 2px;vertical-align: sub;cursor: pointer;" />
+                  </a-tooltip>
+                </template>
+                <a-radio-group @change="(e)=>onChangePriceType(e,index)" v-model="con.paramValue">
+                  <a-radio value="1">
+                    可见
+                  </a-radio>
+                  <a-radio value="0">
+                    不可见
+                  </a-radio>
+                </a-radio-group>
+                <span class="spanStyle">(修理厂的进货价,即汽配商的销售价)</span>
+              </a-form-model-item>
+              <a-form-model-item :prop="form[con.paramCode]" v-if="flag && con.paramCode == 'shelf_not_distribute_show'">
+                <template slot="label">
+                  <a-tooltip placement="top">
+                    <template slot="title">
+                      非铺货产品指不是货架上的产品
+                    </template>
+                    非铺货产品价格<a-icon type="question-circle" style="color: rgba(0,0,0,.65);font-size: 16px;margin-left: 2px;vertical-align: sub;cursor: pointer;" />
+                  </a-tooltip>
+                </template>
+                <a-radio-group @change="(e)=>onChangePriceType(e,index)" v-model="con.paramValue">
+                  <a-radio value="1">
+                    显示
+                  </a-radio>
+                  <a-radio value="0">
+                    不显示
+                  </a-radio>
+                </a-radio-group>
+                <span class="spanStyle">(非铺货产品是否显示车主价和进货价)</span>
+              </a-form-model-item>
+            </a-col>
           </a-row>
           <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top: 30px;">
             <a-button type="primary" @click="saveForm" size="large" id="authPass-btn-submit" style="padding: 0 60px;">审核通过</a-button>
@@ -158,7 +217,7 @@ import { STable, VSelect, Upload } from '@/components'
 import { getAreaCgj } from '@/api/data'
 import dealerList from '@/views/common/dealerList.vue'
 import customeList from '@/views/common/customeList.vue'
-import { xprhStoreApplyDetail, xprhStoreApplyAudit } from '@/api/approveStore'
+import { xprhStoreApplyDetail, xprhStoreApplyAudit, queryList, updateBatch } from '@/api/approveStore'
 export default {
   name: 'ApproveStoreAuthPass',
   components: { STable, VSelect, dealerList, customeList, Upload },
@@ -187,7 +246,10 @@ export default {
         creditLimit: undefined, //  授信额度
         delearSn: undefined,
         applySn: undefined,
-        auditStatus: 'PASS' // 通过
+        auditStatus: 'PASS', // 通过
+        shelf_price_show: null,
+        shelf_cost_show: null,
+        shelf_not_distribute_show: null
       },
       rules: {
         storeImage: [{ required: true, message: '请上传门头照片', trigger: 'change' }],
@@ -200,12 +262,18 @@ export default {
         settleType: [{ required: true, message: '请选择收结算方式', trigger: 'change' }],
         delearSn: [{ required: true, message: '请选择绑定汽配商', trigger: 'change' }],
         customerSn: [{ required: true, message: '请选择关联客户', trigger: 'change' }],
-        creditLimit: [{ required: true, message: '请输入授信额度', trigger: 'change' }]
+        creditLimit: [{ required: true, message: '请输入授信额度', trigger: 'change' }],
+        shelf_price_show: [{ required: true, message: '请选择车主价权限', trigger: 'change' }],
+        shelf_cost_show: [{ required: true, message: '请选择进货价权限', trigger: 'change' }],
+        shelf_not_distribute_show: [{ required: true, message: '请非铺货价格显示', trigger: 'change' }]
       },
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      settleStyleList: [] //  收款方式  下拉数据
+      settleStyleList: [], //  收款方式  下拉数据
+      val: '',
+      priceList: [],
+      flag: false
     }
   },
   methods: {
@@ -266,7 +334,7 @@ export default {
             centered: true,
             closable: true,
             onOk () {
-              _this.handleSubmit()
+              _this.handleSubit()
             }
           })
         } else {
@@ -280,8 +348,7 @@ export default {
       xprhStoreApplyAudit(_this.form).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
-          _this.handleBack()
-          _this.spinning = false
+          _this.handleSave()
         } else {
           _this.spinning = false
         }
@@ -363,11 +430,60 @@ export default {
       if (this.$route.params.sn) {
         this.getDetail()
       }
+    },
+    getPriceList () {
+      debugger
+      queryList({ shelfSn: this.$route.params.shelfSn, bizType: 'xprh_shelf_price_show' }).then(res => {
+        if (res.status == 200) {
+          this.priceList = res.data
+          const isFlag = res.data.findIndex(r => {
+            return r.paramValue == 1
+          })
+          if (isFlag != -1) {
+            this.flag = true
+          }
+        }
+      })
+    },
+    onChangePriceType (e, i) {
+      this.$set(this.priceList[i], 'paramValue', e.target.value)
+      this.form[this.priceList[i].paramCode] = i.toString()
+      if (this.priceList[i].paramCode != 'xprh_shelf_price_show') {
+        const isFlag = this.priceList.findIndex(r => {
+          return r.paramValue == 1
+        })
+        if (isFlag != -1) {
+          this.flag = true
+        } else {
+          this.flag = false
+        }
+      }
+    },
+    handleSave () {
+      const _this = this
+      var newArr = []
+      for (var i = 0; i < this.priceList.length; i++) {
+        var obj = {
+          id: _this.priceList[i].id,
+          paramValue: _this.priceList[i].paramValue
+        }
+        newArr.push(obj)
+      }
+      updateBatch(newArr).then(ret => {
+        if (ret.status == 200) {
+          _this.$message.success(ret.message)
+          _this.handleBack()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.initPage()
+      this.getPriceList()
     }
   },
   activated () {

+ 1 - 1
src/views/numsGoodsShelves/approveStore/list.vue

@@ -158,7 +158,7 @@ export default {
     handleAudit (row, type) {
       // 审核通过
       if (type == 1) {
-        this.$router.push({ name: 'approveStoreAuthPass', params: { sn: row.applySn } })
+        this.$router.push({ name: 'approveStoreAuthPass', params: { sn: row.applySn, shelfSn: row.shelfSn } })
       } else {
         const _this = this
         this.$confirm({