lilei há 1 ano atrás
pai
commit
3c8d1eb933

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1718157323352
+  "version": 1718162697357
 }

+ 35 - 0
src/config/router.config.js

@@ -465,6 +465,41 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/numsGoodsShelves/shelfProductTempl',
+            redirect: '/numsGoodsShelves/shelfProductTempl/list',
+            name: 'shelfProductTempl',
+            component: BlankLayout,
+            meta: {
+              title: '货架产品模板设置',
+              icon: 'monitor',
+              permission: 'M_shelfSet'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'shelfProductTemplList',
+                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/shelfProductTempl/list.vue'),
+                meta: {
+                  title: '货架产品模板列表',
+                  icon: 'monitor',
+                  hidden: true
+                }
+              },
+              {
+                path: 'set/:sn',
+                name: 'shelfProductTemplSetting',
+                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/shelfProductTempl/set.vue'),
+                meta: {
+                  title: '货架产品模板设置',
+                  icon: 'monitor',
+                  hidden: true,
+                  replaceTab: true
+                }
+              }
+            ]
+          },
           {
             path: '/numsGoodsShelves/shelfMonitoring',
             redirect: '/numsGoodsShelves/shelfMonitoring/list',

+ 240 - 0
src/views/numsGoodsShelves/shelfProductTempl/addHwModal.vue

@@ -0,0 +1,240 @@
+<template>
+  <a-modal
+    centered
+    class="shelfSet-newHw-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="modalTit"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="shelfSet-newHw-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol">
+        <a-form-model-item label="货架名称">{{ nowData&&nowData.shelfName || '--' }}</a-form-model-item>
+        <a-form-model-item label="货位号" prop="shelfPlaceCode">
+          <a-input v-model="form.shelfPlaceCode" @input="placeCodeBlur" placeholder="请输入货位号(字母+数字格式)"></a-input>
+        </a-form-model-item>
+        <a-form-model-item label="绑定产品" v-if="type=='add'">
+          <productJqList ref="productJqList" :params="{customerSn:nowData&&nowData.customerSn}" @change="productJqChange"></productJqList>
+        </a-form-model-item>
+        <a-form-model-item label="产品名称" v-if="form.productSn">{{ productName || '--' }}</a-form-model-item>
+        <a-form-model-item v-if="form.productSn" label="车主价" prop="price">
+          <a-input-number
+            id="shelfSet-newHw-price"
+            v-model="form.price"
+            :precision="2"
+            :min="0"
+            :max="999999"
+            placeholder="请输入车主价(最多允许两位小数)"
+            suffix="元"
+            style="width: 80%;display: inline-block;" /> 元
+        </a-form-model-item>
+        <a-form-model-item v-if="form.productSn" label="结算价" prop="cost">
+          <a-input-number
+            id="shelfSet-newHw-cost"
+            v-model="form.cost"
+            :precision="2"
+            :min="0"
+            :max="999999"
+            placeholder="请输入结算价(最多允许两位小数)"
+            style="width: 80%;display: inline-block;" /> 元
+        </a-form-model-item>
+        <a-form-model-item v-if="form.productSn" label="最大库容" prop="maxQty">
+          <a-input-number
+            id="shelfSet-newHw-maxQty"
+            v-model="form.maxQty"
+            :precision="0"
+            :min="0"
+            :max="999999"
+            placeholder="请输入最大库容(正整数或0)"
+            suffix="元"
+            style="width: 100%;display: inline-block;" />
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="shelfSet-newHw-modal-save" @click="handleSave">保存</a-button>
+        <a-button id="shelfSet-newHw-modal-back" @click="isShow=false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import productJqList from '@/views/common/productJqList.vue'
+import { addPlaceAndProduct } from '@/api/shelf'
+export default {
+  name: 'AddHwModal',
+  components: { VSelect, productJqList },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    type: {
+      type: String,
+      default: ''
+    },
+    nowData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        shelfPlaceCode: '',
+        productSn: undefined,
+        productCode: undefined,
+        price: '',
+        cost: '',
+        maxQty: ''
+      },
+      rules: {
+        shelfPlaceCode: [
+          { required: true, message: '请输入货位号', trigger: 'blur' },
+          {
+          	pattern: /^[a-zA-Z]{1}[0-9]{1,29}$/g,
+          	message: '货位号必需字母+数字,且不能超过30个字符'
+          }
+        ],
+        price: [{ required: true, message: '请输入销售价', trigger: 'blur' }],
+        cost: [{ required: true, message: '请输入结算价', trigger: 'blur' }],
+        maxQty: [{ required: true, message: '请输入最大库容', trigger: 'blur' }]
+      },
+      productName: ''
+    }
+  },
+  computed: {
+    modalTit () {
+      let title = ''
+      if (this.type == 'edit') {
+        title = '编辑货位'
+      } else if (this.type == 'add') {
+        title = '新增货位'
+      }
+      return title
+    }
+  },
+  methods: {
+    // 产品 change
+    productJqChange (obj) {
+      this.form.productSn = obj.key || undefined
+      this.form.productCode = obj && obj.row && obj.row.code || ''
+      this.form.price = obj && obj.row && obj.row.price || ''
+      this.form.cost = obj && obj.row && obj.row.cost || ''
+      this.productName = obj && obj.row && obj.row.name || ''
+      this.form.oldPrice = obj && obj.row && obj.row.price || ''
+      this.form.oldCost = obj && obj.row && obj.row.cost || ''
+      this.form.oldMaxQty = ''
+    },
+    placeCodeBlur (v) {
+    	this.$nextTick(() => {
+    		this.form.shelfPlaceCode = this.form.shelfPlaceCode.toLocaleUpperCase()
+    	})
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = {}
+          const form = JSON.parse(JSON.stringify(_this.form))
+          params.shelfSn = _this.nowData && _this.nowData.shelfSn
+          params.shelfPlaceCode = form.shelfPlaceCode.toLocaleUpperCase()
+          if (this.type == 'edit') {
+            params.id = this.nowData.id
+          }
+          // 绑定了产品
+          if (form.productSn) {
+            params.shelfProductApiEntity = {
+              productSn: form.productSn,
+              productCode: form.productCode,
+              price: form.price,
+              cost: form.cost,
+              maxQty: form.maxQty,
+              oldPrice: form.oldPrice,
+              oldCost: form.oldCost,
+              oldMaxQty: form.oldMaxQty
+            }
+          }
+          // 开始提交数据
+          _this.spinning = true
+          addPlaceAndProduct(params).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.isShow = false
+              _this.$emit('ok', res.data)
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    resetData () {
+      this.form.productSn = undefined
+      this.form.productCode = undefined
+      this.form.price = ''
+      this.form.cost = ''
+      this.form.maxQty = ''
+      if (this.$refs.productJqList) {
+        this.$refs.productJqList.resetForm()
+      }
+      this.$refs.ruleForm.resetFields(['productSn'])
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetData()
+        this.productName = ''
+      } else {
+        if (this.type == 'edit') {
+          this.form.shelfPlaceCode = this.nowData.shelfPlaceCode
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.shelfSet-newHw-modal {
+	.ant-modal-body {
+		padding: 40px 40px 24px;
+	}
+  .ant-form-item{
+    margin-bottom: 15px;
+  }
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+}
+</style>

+ 214 - 0
src/views/numsGoodsShelves/shelfProductTempl/basicInfoModal.vue

@@ -0,0 +1,214 @@
+<template>
+  <a-modal
+    centered
+    class="shelfSet-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="数字货架基础设置"
+    v-model="isShow"
+    @cancel="isShow = false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <p v-if="type==0" style="text-align: center;margin: 0 0 20px;font-size: 14px;font-weight: bold;">{{ nowData && nowData.shelfName || '--' }}</p>
+      <a-form-model
+        id="shelfSet-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol">
+        <a-form-model-item label="货架名称" v-if="type==1" prop="shelfName">
+          <a-input v-model="form.shelfName" :maxLength="30" placeholder="请输入货架名称"></a-input>
+        </a-form-model-item>
+        <a-form-model-item prop="customerSn">
+          <template slot="label">
+            <a-tooltip placement="top">
+              <template slot="title">
+                <span>此数字货架,归属于您的哪一位客户。如果没有搜索到客户,请在客户管理功能中新建客户。</span>
+              </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>
+          <custList ref="custList" :dealerFlag="0" :isEnabled="true" @change="custChange"></custList>
+        </a-form-model-item>
+        <a-form-model-item prop="showPrice">
+          <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-checkbox-group v-model="form.showPrice">
+            <div style="display: flex;padding:10px 0;">
+              <div style="width: 80px;font-weight: bold;">货架产品:</div>
+              <a-checkbox value="shelf_price_show">
+                车主价
+              </a-checkbox>
+              <a-checkbox value="shelf_cost_show">
+                结算价
+              </a-checkbox>
+            </div>
+            <div style="display: flex;padding:10px 0;">
+              <div style="width: 80px;font-weight: bold;">非货架产品:</div>
+              <a-checkbox value="non_shelf_price_show">
+                车主价
+              </a-checkbox>
+              <a-checkbox value="non_shelf_cost_show">
+                结算价
+              </a-checkbox>
+            </div>
+          </a-checkbox-group>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="shelfSet-basicInfo-modal-save" @click="handleSave">保存</a-button>
+        <a-button id="shelfSet-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import custList from '@/views/common/custList.vue'
+import { shelfSave, updateShelfPriceShow } from '@/api/shelf'
+export default {
+  name: 'ShelfSetBasicInfoModal',
+  components: { VSelect, custList },
+  mixins: [commonMixin],
+  props: {
+    openModal: {
+      //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    nowData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    },
+    type: {
+      type: [String, Number],
+      default: '1'
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 17 }
+      },
+      form: {
+        customerSn: undefined,
+        shelfName: '',
+        showPrice: undefined
+      },
+      rules: {
+        shelfName: [{ required: true, message: '请输入货架名称', trigger: 'change' }],
+        customerSn: [{ required: true, message: '请选择关联客户', trigger: 'change' }],
+        // showPrice: [{ required: true, message: '请选择价格显示', trigger: 'change' }]
+      }
+    }
+  },
+  methods: {
+    // 客户 change
+    custChange (obj, row) {
+      this.form.customerSn = row && row.customerSn || undefined
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          form.shelfSn = _this.nowData && _this.nowData.shelfSn
+          _this.spinning = true
+          shelfSave(form).then(res => {
+            if (res.status == 200) {
+              const paramValue = []
+              this.nowData.showPrice.map(item => {
+                paramValue.push({
+                  paramCode: item.paramCode,
+                  paramValue: form.showPrice.includes(item.paramCode) ? 1 : 0
+                })
+              })
+              // 更新价格显示
+              updateShelfPriceShow({
+                shelfSn: form.shelfSn,
+                paramValue: paramValue
+              }).then(ret => {
+                if (ret.status == 200) {
+                  _this.$message.success(ret.message)
+                  setTimeout(() => {
+                    _this.isShow = false
+                    _this.$emit('ok', res.data)
+                    _this.spinning = false
+                  }, 100)
+                } else {
+                  _this.spinning = false
+                }
+              })
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+        this.$refs.custList.resetForm()
+      } else {
+        const _this = this
+        this.$nextTick(() => {
+          _this.form.shelfName = _this.nowData.shelfName
+          _this.form.showPrice = _this.nowData.showPrice.filter(item => item.paramValue == 1).map(item => item.paramCode)
+          const custome = _this.nowData.customerEntity
+          if (custome) {
+            _this.form.customerSn = custome.customerSn || ''
+            _this.$refs.custList.fetchUser(custome.customerName || '')
+            _this.$refs.custList.dealerName = {
+              key: custome.customerSn,
+              label: custome.customerName,
+              row: _this.nowData
+            }
+          }
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.shelfSet-basicInfo-modal {
+	.ant-modal-body {
+		padding: 40px 40px 24px;
+	}
+  .ant-form-item{
+    margin-bottom: 15px;
+  }
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+}
+</style>

+ 245 - 0
src/views/numsGoodsShelves/shelfProductTempl/bindProductModal.vue

@@ -0,0 +1,245 @@
+<template>
+  <a-modal
+    centered
+    class="shelfSet-bindProduct-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="modalTit"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="shelfSet-bindProduct-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol">
+        <a-form-model-item label="货架名称">{{ nowData&&nowData.shelfName || '--' }}</a-form-model-item>
+        <a-form-model-item label="货位号">{{ nowData&&nowData.shelfPlaceCode || '--' }}</a-form-model-item>
+        <a-form-model-item :label="type == 'replace' ? '原绑定产品':'绑定产品'" v-if="type != 'bind'">
+          {{ productInfo&&productInfo.productCode }}
+          <p style="margin: 0;">{{ productInfo&&productInfo.productName || '--' }}</p>
+        </a-form-model-item>
+        <a-form-model-item :label="type!='bind'?'新绑定产品':'绑定产品'" prop="productSn" v-if="type!='edit'">
+          <productJqList ref="productJqList" :params="{customerSn:nowData&&nowData.customerSn}" @change="productJqChange"></productJqList>
+          <span v-if="form.productSn">{{ productName || '--' }}</span>
+        </a-form-model-item>
+        <a-form-model-item label="车主价" prop="price">
+          <a-input-number
+            id="shelfSet-bindProduct-price"
+            v-model="form.price"
+            :precision="2"
+            :min="0"
+            :max="999999"
+            placeholder="请输入车主价(最多允许两位小数)"
+            style="width: 80%;display: inline-block;" /> 元
+        </a-form-model-item>
+        <a-form-model-item label="结算价" prop="cost">
+          <a-input-number
+            id="shelfSet-bindProduct-cost"
+            v-model="form.cost"
+            :precision="2"
+            :min="0"
+            :max="999999"
+            placeholder="请输入结算价(最多允许两位小数)"
+            style="width: 80%;display: inline-block;" /> 元
+        </a-form-model-item>
+        <a-form-model-item label="最大库容" prop="maxQty">
+          <a-input-number
+            id="shelfSet-bindProduct-maxQty"
+            v-model="form.maxQty"
+            :precision="0"
+            :min="0"
+            :max="999999"
+            placeholder="请输入最大库容(正整数或0)"
+            suffix="元"
+            style="width: 100%;display: inline-block;" />
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="shelfSet-bindProduct-modal-save" @click="handleSave">保存</a-button>
+        <a-button id="shelfSet-bindProduct-modal-back" @click="isShow=false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import productJqList from '@/views/common/productJqList.vue'
+import { shelfProductSave, shelfProductDetail } from '@/api/shelf'
+export default {
+  name: 'ShelfSetBasicInfoModal',
+  components: { VSelect, productJqList },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    type: {
+      type: String,
+      default: ''
+    },
+    nowData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        productSn: undefined,
+        productCode: undefined,
+        price: '',
+        cost: '',
+        maxQty: ''
+      },
+      rules: {
+        productSn: [{ required: true, message: '请选择绑定产品', trigger: 'change' }],
+        price: [{ required: true, message: '请输入销售价', trigger: 'change' }],
+        cost: [{ required: true, message: '请输入结算价', trigger: 'change' }],
+        maxQty: [{ required: true, message: '请输入最大库容', trigger: 'change' }]
+      },
+      productName: '',
+      productInfo: null
+    }
+  },
+  computed: {
+    modalTit () {
+      let title = ''
+      if (this.type == 'edit') {
+        title = '修改信息'
+      } else if (this.type == 'bind') {
+        title = '绑定产品'
+      } else if (this.type == 'replace') {
+        title = '更换产品'
+      }
+      return title
+    }
+  },
+  methods: {
+    // 产品 change
+    productJqChange (obj) {
+      this.form.productSn = obj.key || undefined
+      this.form.productCode = obj && obj.row && obj.row.code || ''
+      this.form.price = obj && obj.row && obj.row.price || ''
+      this.form.cost = obj && obj.row && obj.row.cost || ''
+      this.form.oldPrice = obj && obj.row && obj.row.price || ''
+      this.form.oldCost = obj && obj.row && obj.row.cost || ''
+      this.productName = obj && obj.row && obj.row.name || ''
+      this.$refs.ruleForm.validate()
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          form.shelfSn = _this.nowData && _this.nowData.shelfSn
+          form.shelfPlaceSn = _this.nowData && _this.nowData.shelfPlaceSn
+          if (this.type != 'bind') { // 修改信息、更换产品
+            form.shelfProductSn = _this.nowData && _this.nowData.shelfProductApiEntity && _this.nowData.shelfProductApiEntity.shelfProductSn
+          }
+          if (this.type == 'replace') { // 更换产品
+            form.updateProductFlag = 1
+          }
+          _this.spinning = true
+          shelfProductSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.isShow = false
+              _this.$emit('ok', res.data)
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 获取产品信息
+    getProductInfo () {
+      shelfProductDetail({ shelfPlaceSn: this.nowData && this.nowData.shelfPlaceSn }).then(res => {
+        if (res.status == 200 && res.data) {
+          this.productInfo = res.data
+          if (this.type == 'edit') {
+            this.form.productSn = res.data.productSn
+            this.form.productCode = res.data.productCode
+          }
+          this.form.price = res.data.price
+          this.form.cost = res.data.cost
+          this.form.maxQty = res.data.maxQty
+          this.form.oldPrice = res.data.price
+          this.form.oldCost = res.data.cost
+          this.form.oldMaxQty = res.data.maxQty
+        } else {
+          this.productInfo = null
+          this.$refs.ruleForm.resetFields()
+        }
+      })
+    },
+    resetData () {
+      this.productName = ''
+      this.productInfo = null
+      this.form.productSn = undefined
+      this.form.productCode = undefined
+      this.form.price = ''
+      this.form.cost = ''
+      this.form.maxQty = ''
+      if (this.$refs.productJqList) {
+        this.$refs.productJqList.resetForm()
+      }
+      if (this.$refs.ruleForm) {
+        this.$refs.ruleForm.resetFields(['productSn'])
+      }
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.resetData()
+        this.$emit('close')
+      } else {
+        if (this.type != 'bind') { // 修改信息、更换产品
+          this.getProductInfo()
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.shelfSet-bindProduct-modal {
+	.ant-modal-body {
+		padding: 40px 40px 24px;
+	}
+  .ant-form-item{
+    margin-bottom: 15px;
+  }
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+}
+</style>

+ 173 - 0
src/views/numsGoodsShelves/shelfProductTempl/chooseImportModal.vue

@@ -0,0 +1,173 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="确认导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="900">
+    <div class="chooseImport-con">
+      <!-- 可导入数据 -->
+      <p class="">可导入数据{{ loadData.length }}条</p>
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.shelfSn"
+        :columns="nowColumns"
+        :dataSource="loadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <a-divider />
+      <!-- 不可导入数据 -->
+      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
+      <a-table
+        class="sTable unTable"
+        ref="unTable"
+        size="small"
+        :rowKey="(record) => record.errorDesc"
+        :columns="nowUnColumns"
+        :dataSource="unLoadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          size="large"
+          :class="loadData.length==0?'button-grey':'button-primary'"
+          @click="handleSubmit"
+          style="padding: 0 40px;">确认导入</a-button>
+        <a-button
+          id="chooseImport-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 40px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { shelfProductParseProducts } from '@/api/shelf'
+import { toThousands } from '@/libs/tools.js'
+export default {
+  name: 'ChooseImportModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    const _this = this
+    return {
+      toThousands,
+      isShow: this.openModal, //  是否打开弹框
+      nowColumns: [ //  可导入
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '19%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '绑定产品编码', dataIndex: 'productCode', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '绑定产品名称', dataIndex: 'productName', width: '26%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '车主价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '结算价', dataIndex: 'cost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '最大库容', dataIndex: 'maxQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      nowUnColumns: [ //  不可导入
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '绑定产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '绑定产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '车主价', dataIndex: 'price', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '结算价', dataIndex: 'cost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '最大库容', dataIndex: 'maxQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '错误原因', dataIndex: 'remarks', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ],
+      loadData: [],
+      unLoadData: [],
+      loading: false
+    }
+  },
+  methods: {
+    getData () {
+      const _this = this
+      this.loading = true
+      shelfProductParseProducts(this.paramsData).then(res => {
+        this.loading = false
+        if (res.status == 200) {
+          if (res.data.successList && res.data.successList.length > 0) {
+            res.data.successList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          if (res.data.failList && res.data.failList.length > 0) {
+            res.data.failList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          _this.loadData = res.data.successList || []
+          _this.unLoadData = res.data.failList || []
+        }
+      })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.loadData.length == 0) {
+        this.$message.warning('无可导入产品!')
+      } else {
+        this.$emit('ok', this.loadData)
+        this.isShow = false
+      }
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+        this.unLoadData = []
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      .red{
+        color: #f30;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 209 - 0
src/views/numsGoodsShelves/shelfProductTempl/chooseShelfImportModal.vue

@@ -0,0 +1,209 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="确认导入货位"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="900">
+    <div class="chooseImport-con">
+      <!-- 可导入数据 -->
+      <p class="">可导入数据{{ loadData.length }}条</p>
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.allocateSn"
+        :columns="nowColumns"
+        :dataSource="loadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <a-divider />
+      <!-- 不可导入数据 -->
+      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
+      <a-table
+        class="unTable"
+        ref="unTable"
+        size="small"
+        :rowKey="(record) => record.errorDesc"
+        :columns="nowUnColumns"
+        :dataSource="unLoadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          size="large"
+          :disabled="disabled"
+          :class="loadData.length==0?'button-grey':'button-primary'"
+          @click="handleSubmit"
+          style="padding: 0 40px;">确认导入</a-button>
+        <a-button
+          id="chooseImport-cancel"
+          size="large"
+          :disabled="disabled"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 40px;margin-left: 15px;">取消</a-button>
+        <a-button
+          type="primary"
+          id="chooseImport-error"
+          size="large"
+          :disabled="disabled"
+          class="button-error"
+          @click="handleError"
+          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { hdExportExcel } from '@/libs/exportExcel'
+import { shelfPlaceReadExcel, shelfSaveBatchExcel, shelfPlaceFailExcel } from '@/api/shelf'
+import { toThousands } from '@/libs/tools.js'
+export default {
+  name: 'ChooseImportModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    const _this = this
+    return {
+      toThousands,
+      isShow: this.openModal, //  是否打开弹框
+      nowColumns: [
+        { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '45%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '车主价', dataIndex: 'price', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0)&&text.length ? _this.toThousands(text, 2) : '--') } },
+        { title: '结算价', dataIndex: 'cost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0)&&text.length ? _this.toThousands(text, 2) : '--') } },
+        { title: '最大库容', dataIndex: 'maxQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      loadData: [],
+      nowUnColumns: [
+        { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '车主价', dataIndex: 'price', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0)&&text.length ? _this.toThousands(text, 2) : '--') } },
+        { title: '结算价', dataIndex: 'cost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0)&&text.length ? _this.toThousands(text, 2) : '--') } },
+        { title: '最大库容', dataIndex: 'maxQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '错误原因', dataIndex: 'remarks', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      unLoadData: [],
+      loading: false,
+      disabled: false
+    }
+  },
+  methods: {
+    getData () {
+      const _this = this
+      this.loading = true
+      const params = {
+        shelfSn: this.paramsData.shelfSn,
+        path: this.paramsData.path
+      }
+      this.disabled = true
+      shelfPlaceReadExcel(params).then(res => {
+        this.loading = false
+        this.disabled = false
+        if (res.status == 200) {
+          if (res.data.successList && res.data.successList.length > 0) {
+            res.data.successList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          if (res.data.failList && res.data.failList.length > 0) {
+            res.data.failList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          _this.loadData = res.data.successList || []
+          _this.unLoadData = res.data.failList || []
+        }
+      })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.loadData.length == 0) {
+        this.$message.warning('无可导入产品!')
+      } else {
+        this.disabled = true
+        shelfSaveBatchExcel(this.loadData).then(res => {
+          if (res.status == 200) {
+            this.$emit('ok', this.loadData)
+            this.isShow = false
+          }
+          this.disabled = false
+        })
+      }
+    },
+    // 导出
+    handleError () {
+      const _this = this
+      if (_this.unLoadData.length < 1) {
+        _this.$message.info('暂无可导出错误项~')
+        return
+      }
+      _this.disabled = true
+      hdExportExcel(shelfPlaceFailExcel, _this.unLoadData, '货位绑定产品错误项导出', function () {
+        _this.disabled = false
+      }, true)
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+        this.unLoadData = []
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      .red{
+        color: #f30;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 205 - 0
src/views/numsGoodsShelves/shelfProductTempl/importGuideModal.vue

@@ -0,0 +1,205 @@
+<template>
+  <a-modal
+    centered
+    class="importGuide-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入绑定产品"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="750">
+    <div class="importGuide-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>下载导入模板
+          </div>
+          <p>请按照下载的Excel模板填写数据</p>
+          <a :href="filePath" style="padding: 5px 0 0 23px;display: block;">
+            <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+          </a>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>准备导入数据
+          </div>
+          <ul>
+            <li>1) 导入的Excel文件中必须包含名为“货位号”、“产品编码”、“车主价”、“结算价”、“最大库容”的列,且名称必须相同</li>
+            <li>2) 除了“货位号”、“产品编码”、“车主价”、“结算价”、“最大库容”四列,其他列可自定义,不影响数据导入</li>
+          </ul>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>3</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importGuide-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="import"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="添加文件"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importGuide-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import { hdPrint } from '@/libs/JGPrint.js'
+import ChooseImportModal from './chooseImportModal.vue'
+import { Upload } from '@/components'
+import { shelfProductDownload } from '@/api/shelf'
+export default {
+  name: 'ImportGuideModal',
+  components: { ChooseImportModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    params: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
+      filePath: location.protocol + '//' + location.host + '/templ/绑定产品导入模板.xlsx',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local'
+      }
+    }
+  },
+  methods: {
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      if (file) {
+        this.paramsData = {
+          shelfSn: this.params.shelfSn || '',
+          path: file
+        }
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      _this.spinning = true
+      // 导出
+      hdPrint('', 'export', shelfProductDownload, _this.params, '导入绑定产品模板', function () {
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.paramsData = null
+        this.$refs.importUpload.setFileList('')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importGuide-modal{
+    .importGuide-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importGuide-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 198 - 0
src/views/numsGoodsShelves/shelfProductTempl/importHuoweiModal.vue

@@ -0,0 +1,198 @@
+<template>
+  <a-modal
+    centered
+    class="importHuoweiModal-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="批量导入货位"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="750">
+    <div class="importHuoweiModal-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>下载导入模板
+            <p>请按照下载的Excel模板填写数据</p>
+            <a :href="filePath" style="padding: 5px 0 0 23px;display: block;">
+              <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+            </a>
+          </div>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>准备导入数据
+          </div>
+          <ul>
+            <li>1) 导入的Excel文件中必须包含名为“货位号”、“产品编码”、“车主价”、“结算价”、“最大库容”的列,且名称必须相同,其他列可自定义,不影响数据导入。</li>
+            <li>2) 如果“产品编码”列为空,则表示此货位暂时不绑定产品,也可以正常导入货位。</li>
+            <li>3) 当“车主价”和“结算价”都为空,系统会自动获取车主价和结算价,规则如下:历史销售价>自定义车主价和自定义终端价>车主价和终端价。</li>
+            <li>4) 如果货位已经绑定产品,则不会导入该行。</li>
+          </ul>
+
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>3</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importHuoweiModal-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="import"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="添加文件"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importHuoweiModal-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importHuoweiModal-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseShelfImportModal.vue'
+import { Upload } from '@/components'
+export default {
+  name: 'ImportHuoweiModalModal',
+  components: { ChooseImportModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    shelfSn: {
+      type: [String, Number],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      filePath: location.protocol + '//' + location.host + '/templ/货位导入模板.xlsx',
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local'
+      }
+    }
+  },
+  methods: {
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      if (file) {
+        this.paramsData = {
+          shelfSn: this.shelfSn || '',
+          path: file
+        }
+        console.log(this.paramsData, 'this.paramsData')
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.paramsData = null
+        this.$refs.importUpload.setFileList('')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importHuoweiModal-modal{
+    .importHuoweiModal-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importHuoweiModal-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 246 - 0
src/views/numsGoodsShelves/shelfProductTempl/list.vue

@@ -0,0 +1,246 @@
+<template>
+  <a-card size="small" :bordered="false" class="shelfSetList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="模板名称">
+                <a-input v-model.trim="queryParam.tempName" allowClear placeholder="请输入模板名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shelfSetList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="shelfSetList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 提示 -->
+      <a-alert type="info" style="margin-bottom: 10px">
+        <div slot="message">注意:只有当数字货架的“是否设置完成”为"是",修理厂才能正常下单。</div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 货架名称 -->
+        <template slot="shelfName" slot-scope="text, record">
+          <span class="table-td-link" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record)">{{ record.shelfName }}</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <div>
+            <a-button size="small" type="link" class="button-primary" @click="handleSet(record)">复制</a-button>
+            <a-button size="small" type="link" class="button-primary" @click="handleSet(record)">更改名称</a-button>
+            <a-button size="small" type="link" class="button-error" @click="handleCancel(record)">删除</a-button>
+          </div>
+        </template>
+      </s-table>
+    </a-spin>
+    <!-- 基础设置 -->
+    <basic-info-modal :type="0" :openModal="openModal" :nowData="nowData" @ok="handleOk" @close="openModal=false" />
+    <a-modal
+      centered
+      class="common-modal"
+      :footer="null"
+      :maskClosable="false"
+      v-model="showTip"
+      title="注销"
+      @cancel="showTip=false"
+      :width="416">
+      <div style="text-align:center;">
+        <div style="font-size:16px;">是否注销该数字货架?</div>
+        <div style="font-size:14px;">点击确定,该数字货架就不可做任何操作,用户不可登陆</div>
+        <div style="font-size:12px;color:#999;margin-top:10px;">如需要迁移该数字货架的数据,可去货架设置中导出货架信息</div>
+      </div>
+      <div class="btn-box" style="display: flex;align-items: center;justify-content: center;margin-top:25px;">
+        <a-button type="primary" @click="handleCommonOk">确定</a-button>
+        <a-button type="default" class="button-warning" @click="showTip=false">取消</a-button>
+      </div>
+    </a-modal>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import basicInfoModal from './basicInfoModal.vue'
+import commonModal from '@/views/common/commonModal.vue'
+import { shelfList, modifFinishFlag, shelfModifState } from '@/api/shelf'
+export default {
+  name: 'ShelfProductTemplList',
+  components: { STable, VSelect, basicInfoModal, commonModal },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      showTip: false,
+      queryParam: {
+        tempName: '' // 模板名称
+      },
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '模板名称', scopedSlots: { customRender: 'shelfName' }, width: '25%', align: 'left', ellipsis: true },
+        { title: '产品款数', dataIndex: 'qty', width: '15%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return shelfList(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,
+      nowData: null
+    }
+  },
+  methods: {
+    // 设置/修改
+    handleSet (row) {
+      if (row.customerSn) {
+        this.$router.push({ path: `/numsGoodsShelves/shelfSet/set/${row.shelfSn}` })
+      } else {
+        this.nowData = {
+          shelfSn: row.shelfSn,
+          shelfName: row.shelfName
+        }
+        this.openModal = true
+      }
+    },
+    handleOk (data) {
+      this.$router.push({ path: `/numsGoodsShelves/shelfSet/set/${data.shelfSn}` })
+    },
+    // 客户 change
+    custChange (obj, row) {
+      if (row) {
+        this.queryParam.customerSn = row && row.customerSn || undefined
+        this.queryParam.customerEntity.customerName = undefined
+      } else {
+        this.queryParam.customerEntity.customerName = obj || undefined
+        this.queryParam.customerSn = undefined
+      }
+    },
+    // 是否设置完成
+    changeStatus (record) {
+      const params = {
+        shelfSn: record.shelfSn,
+        finishFlag: record.finishFlag == 1 ? '0' : '1'
+      }
+      this.spinning = true
+      modifFinishFlag(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+      })
+    },
+    // 启用禁用
+    enableShelf (record) {
+      const params = {
+        shelfSn: record.shelfSn,
+        state: record.state == 'ENABLE' ? 'DISABLED' : 'ENABLE'
+      }
+      const _this = this
+      _this.$confirm({
+        title: '提示',
+        content: <div style="text-align:center;">是否{(record.state == 'ENABLE' ? '停用' : '启用') + record.shelfName}</div>,
+        centered: true,
+        closable: true,
+        class: 'confirm-center',
+        onOk () {
+          _this.updateState(params)
+        }
+      })
+    },
+    // 注销
+    handleCancel (record) {
+      this.nowData = {
+        shelfSn: record.shelfSn,
+        state: 'WRITE_OFF'
+      }
+      this.showTip = true
+    },
+    handleCommonOk () {
+      this.updateState(this.nowData)
+    },
+    updateState (params) {
+      this.spinning = true
+      shelfModifState(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+        this.showTip = false
+      })
+    },
+    // 重置
+    resetSearchForm () {
+      this.queryParam.tempName = ''
+      this.$refs.table.refresh(true)
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 235
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  }
+}
+</script>

+ 449 - 0
src/views/numsGoodsShelves/shelfProductTempl/set.vue

@@ -0,0 +1,449 @@
+<template>
+  <div class="shelfSet-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" @back="handleBack" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="shelfSet-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+        </template>
+      </a-page-header>
+      <!-- 内容 -->
+      <a-card size="small" :bordered="false" class="shelfSet-cont">
+        <a-collapse :activeKey="['1']">
+          <a-collapse-panel key="1">
+            <template slot="header">
+              <span>基础信息</span>
+              <a-button icon="edit" v-if="basicInfoData&&basicInfoData.state!='WRITE_OFF'&&basicInfoData.state!='SUSPEND'" size="small" type="link" style="margin-left: 20px;color: #39f;" @click.stop="openInfoModal = true">编辑</a-button>
+            </template>
+            <a-descriptions :column="2">
+              <a-descriptions-item label="货架名称">
+              {{ basicInfoData&&basicInfoData.shelfName || '--' }}
+              <a-badge count="已注销" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="basicInfoData&&basicInfoData.state=='WRITE_OFF'"></a-badge>
+              <a-badge count="已停用" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="basicInfoData&&basicInfoData.state=='DISABLED'"></a-badge>
+              <a-badge count="已暂停" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="basicInfoData&&basicInfoData.state=='SUSPEND'"></a-badge>
+              </a-descriptions-item>
+              <a-descriptions-item>
+                <template slot="label">
+                    货架产品 
+                </template>
+                <span>{{showPriceStr.length ? showPriceStr.join("/") : '--'}}</span>
+              </a-descriptions-item>
+              <a-descriptions-item>
+                <template slot="label">
+                  <a-tooltip placement="top">
+                    <template slot="title">
+                      <span>此数字货架,归属于您的哪一位客户。如果没有搜索到客户,请在客户管理功能中新建客户。</span>
+                    </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>
+                {{ (basicInfoData&&basicInfoData.customerEntity&&basicInfoData.customerEntity.customerName) || '--' }}
+              </a-descriptions-item>
+              <a-descriptions-item>
+                <template slot="label">
+                    非货架产品
+                </template>
+                <span>{{showNoShelfPriceStr.length ? showNoShelfPriceStr.join("/") : '--'}}</span>
+              </a-descriptions-item>
+            </a-descriptions>
+          </a-collapse-panel>
+        </a-collapse>
+      </a-card>
+      <a-card size="small" :bordered="false" class="shelfSet-cont">
+        <!-- 搜索条件 -->
+        <div ref="tableSearch" class="table-page-search-wrapper">
+          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品编码">
+                  <a-input id="shelfSet-productCode" v-model.trim="queryParam.shelfProductApiEntity.productCode" allowClear placeholder="请输入产品编码"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品名称">
+                  <a-input id="shelfSet-productName" v-model.trim="queryParam.shelfProductApiEntity.productName" allowClear placeholder="请输入产品名称"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <span class="table-page-search-submitButtons">
+                  <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shelfSet-refresh">查询</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="shelfSet-reset">重置</a-button>
+                  <a-button
+                    type="primary"
+                    class="button-warning"
+                    @click="handleExport"
+                    :disabled="disabled"
+                    :loading="exportLoading"
+                    >导出</a-button>
+                </span>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 操作按钮 -->
+        <div class="table-operator" v-if="basicInfoData&&basicInfoData.state!='WRITE_OFF'&&basicInfoData.state!='SUSPEND'">
+          <a-button id="shelfSet-addHW" type="primary" class="button-error" @click="addHW(1)">新增货位</a-button>
+          <a-button id="shelfSet-impoort" type="primary" class="button-info" @click="addHW(0)">批量导入货位</a-button>
+          <a-button id="shelfSet-import" type="primary" class="button-error" @click="openGuideModal=true">导入绑定产品</a-button>
+          <a-tooltip placement="top">
+            <template slot="title">
+              <span>如果货位还没有绑定产品,可使用此功能通过Excel批量导入</span>
+            </template>
+            <a-icon type="question-circle" style="color: rgba(0,0,0,.45);font-size: 16px;margin-left: 5px;vertical-align: middle;cursor: pointer;" />
+          </a-tooltip>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :scroll="{ y: tableHeight }"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :showPagination="false"
+          :defaultLoadData="false"
+          bordered>
+          <span slot="customTitle">
+            结算价
+            <a-popover>
+              <template slot="content">
+                即易码通进货价
+              </template>
+              <a-icon type="question-circle"/>
+            </a-popover>
+          </span>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              :class="record.enableFlag==1?'button-error':'button-primary'"
+              v-if="record.shelfProductApiEntity&&(!record.shelfProductApiEntity.qty||(record.enableFlag==0&&record.shelfProductApiEntity.qty))&&record.shelfProductApiEntity.productSn"
+              @click="handleEnable(record)"
+            >{{ record.enableFlag==1?'禁用':'启用' }}</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-primary"
+              v-if="!(record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn)"
+              @click="handleProduct(record, 'bind')"
+            >绑定产品</a-button>
+            <a-button
+              size="small"
+              type="link"
+              :class="record.enableFlag==1?'button-primary':''"
+              :disabled="record.enableFlag==0"
+              v-else
+              @click="handleReplace(record)"
+            >更换产品</a-button>
+            <a-button
+              size="small"
+              type="link"
+              :class="record.enableFlag==1?'button-primary':''"
+              :disabled="record.enableFlag==0"
+              @click="editHW(record)"
+            >编辑</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-error"
+              v-if="!(record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn)"
+              @click="handleDel(record)"
+            >删除</a-button>
+          </template>
+        </s-table>
+      </a-card>
+    </a-spin>
+    <!-- 基础设置 -->
+    <basic-info-modal :openModal="openInfoModal" :nowData="basicInfoData" @ok="handleInfoOk" @close="openInfoModal=false" />
+    <!-- 修改信息/绑定产品/更换产品 -->
+    <bind-product-modal :openModal="openModal" :type="modalType" :nowData="nowData" @ok="$refs.table.refresh()" @close="handleCancel" />
+    <!-- 编辑、新增货位 -->
+    <addHwModal :openModal="openHwModal" :type="modalType" :nowData="nowData" @ok="$refs.table.refresh()" @close="handleCancel" />
+    <!-- 更换产品 -->
+    <common-modal
+      :openModal="openTipsModal"
+      modalHtml="只有当前库存为0时,才能更换产品<br/>您可以在“货架监控”功能中将产品调回"
+      okText="好的"
+      :isCancel="false"
+      @ok="openTipsModal=false"
+      @close="openTipsModal=false" />
+    <!-- 导入产品 -->
+    <importGuideModal :openModal="openGuideModal" :params="{shelfSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" />
+    <!-- 导入货位模板 -->
+    <importHuoweiModal :openModal="openImportModal" @close="openImportModal=false" @ok="$refs.table.refresh(true)" :shelfSn="$route.params.sn"></importHuoweiModal>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import { STable, VSelect } from '@/components'
+import commonModal from '@/views/common/commonModal.vue'
+import addHwModal from './addHwModal.vue'
+import bindProductModal from './bindProductModal.vue'
+import ImportGuideModal from './importGuideModal.vue'
+import basicInfoModal from './basicInfoModal.vue'
+import importHuoweiModal from './importHuoweiModal.vue'
+import { shelfDetail, shelfProductList, shelfProductBatchInsert, delShelfPlaceSn, shelfProductEnable, getShelfPriceShow, shelfProductExport } from '@/api/shelf'
+export default {
+  name: 'ShelfMonitoringWarehousing',
+  components: { STable, VSelect, commonModal, bindProductModal, addHwModal, ImportGuideModal, basicInfoModal, importHuoweiModal },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 400,
+      exportLoading: false,
+      queryParam: {
+        shelfProductApiEntity: {
+          productCode: '',
+          productName: ''
+        }
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return shelfProductList(Object.assign(parameter, this.queryParam, { shelfSn: this.$route.params.sn })).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = i + 1
+              data[i].enableFlag = data[i].shelfProductApiEntity && data[i].shelfProductApiEntity.enableFlag
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      basicInfoData: null,
+      openTipsModal: false,
+      openModal: false,
+      nowData: null,
+      openGuideModal: false,
+      modalType: null,
+      openInfoModal: false,
+      openHwModal: false,
+      openImportModal: false,
+      showPriceStr: [],
+      showNoShelfPriceStr: []
+    }
+  },
+  computed:{
+    columns(){
+      const _this = this
+      const ret = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '绑定产品编码', dataIndex: 'shelfProductApiEntity.productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '绑定产品名称', dataIndex: 'shelfProductApiEntity.productName', width: '23%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '车主价', dataIndex: 'shelfProductApiEntity.price', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { slots: { title: 'customTitle' }, dataIndex: 'shelfProductApiEntity.cost', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '最大库容', dataIndex: 'shelfProductApiEntity.maxQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '当前库存', dataIndex: 'shelfProductApiEntity.qty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+      ]
+      if(this.basicInfoData&&this.basicInfoData.state!='WRITE_OFF'&&this.basicInfoData.state!='SUSPEND'){
+        ret.push({ title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' })
+      }
+      return ret
+    }
+  },
+  methods: {
+    // 获取价格显示设置
+    getShelfPriceShow () {
+      this.showPriceStr = []
+      this.showNoShelfPriceStr = []
+      getShelfPriceShow({ shelfSn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          const ret = res.data&&res.data
+          this.basicInfoData.showPrice = ret
+          ret.map(item => {
+            if(item.paramCode == 'shelf_price_show'&&item.paramValue == 1){
+              this.showPriceStr.push("车主价")
+            }
+            if(item.paramCode == 'shelf_cost_show'&&item.paramValue == 1){
+              this.showPriceStr.push("结算价")
+            }
+            if(item.paramCode == 'non_shelf_price_show'&&item.paramValue == 1){
+              this.showNoShelfPriceStr.push("车主价")
+            }
+            if(item.paramCode == 'non_shelf_cost_show'&&item.paramValue == 1){
+              this.showNoShelfPriceStr.push("结算价")
+            }
+          })
+        }
+      })
+    },
+    // 导出产品
+    handleExport () {
+      this.exportLoading = true
+      shelfProductExport({shelfSn: this.$route.params.sn}).then(res => {
+        downloadExcel(res, (this.basicInfoData?this.basicInfoData.shelfName:'')+"的产品")
+        this.exportLoading = false
+      })
+    },
+    // 导入或新增货位
+    addHW (type) {
+      // 导入货位
+      if (type == 0) {
+        this.openImportModal = true
+      } else {
+        // 新增货位
+        this.nowData = this.basicInfoData
+        this.modalType = 'add'
+        this.openHwModal = true
+      }
+    },
+    // 禁用启用
+    handleEnable (row) {
+      const _this = this
+      if (row.enableFlag == 1) {
+        this.$confirm({
+          title: '提示',
+          content: '禁用后不参于盘点和补货,但是可以退货、调回,确认禁用吗?',
+          centered: true,
+          onOk () {
+            _this.enableFun(row)
+          }
+        })
+      } else {
+        _this.enableFun(row)
+      }
+    },
+    enableFun (row) {
+      const _this = this
+      _this.spinning = true
+      shelfProductEnable({ shelfSn: this.$route.params.sn, shelfProductSn: row.shelfProductApiEntity.shelfProductSn, enableFlag: row.enableFlag == 1 ? 0 : 1 }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+        }
+        _this.spinning = false
+      })
+    },
+    // 编辑货位
+    editHW (row) {
+      // 已绑定产品,不能编辑货位号,只能编辑已绑定产品的销售价、结算价、最大库容
+      if (row.shelfProductApiEntity && row.shelfProductApiEntity.productSn) {
+        this.handleProduct(row, 'edit')
+      } else {
+        // 货位没有绑定产品,仅编辑货位号
+        this.nowData = Object.assign(this.basicInfoData, row)
+        this.modalType = 'edit'
+        this.openHwModal = true
+      }
+    },
+    // 基本信息
+    getDetail () {
+      shelfDetail({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data
+          this.getShelfPriceShow()
+        } else {
+          this.basicInfoData = null
+        }
+      })
+    },
+    // 删除货位
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '删除后无法恢复,确认删除?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          delShelfPlaceSn({ shelfPlaceSn: row.shelfPlaceSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    // 更换产品
+    handleReplace (row) {
+      if (row.shelfProductApiEntity.qty) {
+        this.openTipsModal = true
+      } else {
+        this.handleProduct(row, 'replace')
+      }
+    },
+    // 更换产品/绑定产品/修改信息
+    handleProduct (row, type) {
+      if (row) {
+        this.nowData = Object.assign(row, { customerSn: this.basicInfoData && this.basicInfoData.customerEntity && this.basicInfoData.customerEntity.customerSn })
+      } else {
+        this.nowData = null
+      }
+      this.modalType = type
+      this.openModal = true
+    },
+    handleCancel () {
+      this.modalType = null
+      this.nowData = null
+      this.openModal = false
+      this.openHwModal = false
+    },
+    // 导入成功
+    handleGuideOk (obj) {
+      shelfProductBatchInsert(obj).then(res => {
+        if (res.status == 200) {
+          this.$refs.table.refresh(true)
+        }
+      })
+    },
+    handleInfoOk () {
+      this.getDetail()
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.shelfProductApiEntity.productCode = ''
+      this.queryParam.shelfProductApiEntity.productName = ''
+      this.$refs.table.refresh(true)
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 350
+    },
+    //  返回列表
+    handleBack () {
+      this.$router.push({ path: '/numsGoodsShelves/shelfSet/list' })
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.setTableH()
+      this.getDetail()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.setTableH()
+      this.getDetail()
+      this.resetSearchForm()
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .shelfSet-wrap{
+    .store-info{
+      margin: 0 15px;
+      color: rgb(102, 102, 102);
+    }
+    .shelfSet-cont{
+      margin-top: 10px;
+    }
+  }
+</style>