浏览代码

Merge branch 'develop_yh42' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into develop_yh42

chenrui 1 年之前
父节点
当前提交
1d10bf1237

+ 1 - 1
public/version.json

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

+ 1 - 1
src/views/numsGoodsShelves/shelfProductTempl/addHwModal.vue

@@ -16,7 +16,7 @@
         :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.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>

+ 12 - 96
src/views/numsGoodsShelves/shelfProductTempl/basicInfoModal.vue

@@ -4,67 +4,24 @@
     class="shelfSet-basicInfo-modal"
     :footer="null"
     :maskClosable="false"
-    title="数字货架基础设置"
+    :title="form.shelfName?'更改名称':'新增模板'"
     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 label="模板名称" prop="shelfName">
+          <a-input v-model="form.shelfName" :maxLength="30" placeholder="请输入模板名称"></a-input>
         </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>
+        <a-button type="primary" @click="handleSave">保存</a-button>
+        <a-button @click="isShow = false" style="margin-left: 15px;">取消</a-button>
       </div>
     </a-spin>
   </a-modal>
@@ -73,11 +30,10 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { VSelect } from '@/components'
-import custList from '@/views/common/custList.vue'
-import { shelfSave, updateShelfPriceShow } from '@/api/shelf'
+import { shelfSave } from '@/api/shelf'
 export default {
   name: 'ShelfSetBasicInfoModal',
-  components: { VSelect, custList },
+  components: { VSelect },
   mixins: [commonMixin],
   props: {
     openModal: {
@@ -105,22 +61,14 @@ export default {
         wrapperCol: { span: 17 }
       },
       form: {
-        customerSn: undefined,
-        shelfName: '',
-        showPrice: undefined
+        shelfName: ''
       },
       rules: {
-        shelfName: [{ required: true, message: '请输入货架名称', trigger: 'change' }],
-        customerSn: [{ required: true, message: '请选择关联客户', trigger: 'change' }],
-        // showPrice: [{ required: true, message: '请选择价格显示', trigger: 'change' }]
+        shelfName: [{ required: true, message: '请输入模板名称', trigger: 'change' }]
       }
     }
   },
   methods: {
-    // 客户 change
-    custChange (obj, row) {
-      this.form.customerSn = row && row.customerSn || undefined
-    },
     //  保存
     handleSave () {
       const _this = this
@@ -131,29 +79,9 @@ export default {
           _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
-                }
-              })
+              _this.$message.success('保存成功')
+              _this.$emit('ok')
+              _this.spinning = false
             } else {
               _this.spinning = false
             }
@@ -175,22 +103,10 @@ export default {
       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
-            }
-          }
         })
       }
     }

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

@@ -1,245 +0,0 @@
-<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>

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

@@ -1,209 +0,0 @@
-<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>

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

@@ -1,198 +0,0 @@
-<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>

+ 48 - 100
src/views/numsGoodsShelves/shelfProductTempl/list.vue

@@ -17,10 +17,9 @@
           </a-row>
         </a-form>
       </div>
-      <!-- 提示 -->
-      <a-alert type="info" style="margin-bottom: 10px">
-        <div slot="message">注意:只有当数字货架的“是否设置完成”为"是",修理厂才能正常下单。</div>
-      </a-alert>
+      <div class="table-operator">
+        <a-button type="primary" class="button-error" @click="addTemp">新增</a-button>
+      </div>
       <!-- 列表 -->
       <s-table
         class="sTable fixPagination"
@@ -40,34 +39,15 @@
         <!-- 操作 -->
         <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-primary" @click="handleCopy(record)">复制</a-button>
+            <a-button size="small" type="link" class="button-primary" @click="addTemp(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>
+    <basic-info-modal :type="0" :openModal="openModal" :nowData="nowData" @ok="handleDetail" @close="openModal=false" />
   </a-card>
 </template>
 
@@ -86,15 +66,14 @@ export default {
       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: 'no', width: '4%', align: 'center' },
+        { title: '模板名称', scopedSlots: { customRender: 'shelfName' }, width: '70%', align: 'left', ellipsis: true },
         { title: '产品款数', dataIndex: 'qty', width: '15%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '11%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -119,88 +98,57 @@ export default {
     }
   },
   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}` })
+    // 新增/修改
+    addTemp (row) {
+      this.nowData = row
+      this.openModal = true
     },
-    // 客户 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
-      }
+    // 详情设置
+    handleDetail (data) {
+      this.$router.push({ name: 'shelfProductTemplSetting', params: { sn: data.shelfSn } })
     },
-    // 是否设置完成
-    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'
-      }
+    // 复制
+    handleCopy (row) {
       const _this = this
-      _this.$confirm({
+      this.$confirm({
         title: '提示',
-        content: <div style="text-align:center;">是否{(record.state == 'ENABLE' ? '停用' : '启用') + record.shelfName}</div>,
+        content: '复制选择的内置模板,将在列表生成一条相同的模板,可进行编辑!是否确认生成?',
         centered: true,
         closable: true,
-        class: 'confirm-center',
         onOk () {
-          _this.updateState(params)
+          _this.spinning = true
+          shelfModifState({
+            shelfSn: record.shelfSn
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.resetSearchForm()
+            }
+            _this.spinning = false
+          })
         }
       })
     },
-    // 注销
+    // 删除
     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
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '删除模板后,模板信息将全部清除,是否确认删除?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.spinning = true
+          shelfModifState({
+            shelfSn: record.shelfSn
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+            _this.spinning = false
+          })
         }
-        this.showTip = false
       })
     },
     // 重置

+ 53 - 243
src/views/numsGoodsShelves/shelfProductTempl/set.vue

@@ -4,77 +4,30 @@
       <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>
+          <a href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin-left:10px;" v-if="basicInfoData">模板名称:{{ basicInfoData&&basicInfoData.shelfName || '--' }}</span>
         </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 label="货位号">
+                  <a-input v-model.trim="queryParam.shelfPlaceCode" 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 label="产品编码">
+                  <a-input v-model.trim="queryParam.productCode" 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>
@@ -82,15 +35,8 @@
         </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>
+          <a-button type="primary" class="button-error" @click="addHW">新增</a-button>
+          <a-button type="primary" class="button-info" @click="openGuideModal=true">导入</a-button>
         </div>
         <!-- 列表 -->
         <s-table
@@ -115,81 +61,39 @@
           </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'
+import { shelfDetail, shelfProductList, shelfProductBatchInsert, delShelfPlaceSn, shelfProductEnable } from '@/api/shelf'
 export default {
   name: 'ShelfMonitoringWarehousing',
-  components: { STable, VSelect, commonModal, bindProductModal, addHwModal, ImportGuideModal, basicInfoModal, importHuoweiModal },
+  components: { STable, VSelect, commonModal, addHwModal, ImportGuideModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -198,10 +102,8 @@ export default {
       tableHeight: 400,
       exportLoading: false,
       queryParam: {
-        shelfProductApiEntity: {
-          productCode: '',
-          productName: ''
-        }
+        productCode: '',
+        shelfPlaceCode: ''
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -222,134 +124,72 @@ export default {
         })
       },
       basicInfoData: null,
-      openTipsModal: false,
       openModal: false,
       nowData: null,
       openGuideModal: false,
       modalType: null,
-      openInfoModal: false,
       openHwModal: false,
-      openImportModal: false,
       showPriceStr: [],
       showNoShelfPriceStr: []
     }
   },
-  computed:{
-    columns(){
+  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 : '--') } },
+        { title: '产品编码', dataIndex: 'shelfProductApiEntity.productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '车主价', dataIndex: 'shelfProductApiEntity.price', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { slots: { title: 'customTitle' }, dataIndex: 'shelfProductApiEntity.cost', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '最大库容', dataIndex: 'shelfProductApiEntity.maxQty', width: '15%', 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' })
-      }
+      // 内置模板没有操作这一列
+      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)
-      }
+    //  返回列表
+    handleBack () {
+      this.$router.push({ name: 'shelfProductTemplList' })
     },
-    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
-      })
+    // 新增
+    addHW () {
+      this.handleProduct(null, 'add')
     },
     // 编辑货位
     editHW (row) {
-      // 已绑定产品,不能编辑货位号,只能编辑已绑定产品的销售价、结算价、最大库容
-      if (row.shelfProductApiEntity && row.shelfProductApiEntity.productSn) {
-        this.handleProduct(row, 'edit')
+      this.handleProduct(row, 'edit')
+    },
+    // 绑定产品/修改信息
+    handleProduct (row, type) {
+      if (row) {
+        this.nowData = Object.assign(row, { customerSn: this.basicInfoData && this.basicInfoData.customerEntity && this.basicInfoData.customerEntity.customerSn })
       } else {
-        // 货位没有绑定产品,仅编辑货位号
-        this.nowData = Object.assign(this.basicInfoData, row)
-        this.modalType = 'edit'
-        this.openHwModal = true
+        this.nowData = this.basicInfoData
       }
+      this.modalType = type
+      this.openModal = true
+    },
+    // 关闭弹框
+    handleCancel () {
+      this.modalType = null
+      this.nowData = null
+      this.openModal = false
+      this.openHwModal = false
     },
     // 基本信息
     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({
@@ -368,30 +208,6 @@ export default {
         }
       })
     },
-    // 更换产品
-    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 => {
@@ -400,37 +216,31 @@ export default {
         }
       })
     },
-    handleInfoOk () {
-      this.getDetail()
-    },
     //  重置
     resetSearchForm () {
-      this.queryParam.shelfProductApiEntity.productCode = ''
-      this.queryParam.shelfProductApiEntity.productName = ''
+      this.queryParam.productCode = ''
+      this.queryParam.shelfPlaceCode = ''
       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' })
+    pageInit () {
+      this.setTableH()
+      this.getDetail()
+      this.resetSearchForm()
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.setTableH()
-      this.getDetail()
-      this.resetSearchForm()
+      this.pageInit()
     }
   },
   activated () {
     // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
-      this.setTableH()
-      this.getDetail()
-      this.resetSearchForm()
+      this.pageInit()
     }
   }
 }

+ 10 - 3
src/views/outboundOrderManagement/outboundOrder/list.vue

@@ -10,12 +10,17 @@
                 <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
+            <a-col :xl="6" :lg="6" :md="12" :sm="24">
+              <a-form-item label="关联单号">
+                <a-input v-model.trim="queryParam.outBizNo" placeholder="请输入关联单号" allowClear />
+              </a-form-item>
+            </a-col>
             <a-col :xl="6" :lg="6" :md="12" :sm="24">
               <a-form-item label="客户名称">
-                <a-input id="outboundOrderList-demanderName" v-model.trim="queryParam.demanderNameCurrent" placeholder="请输入客户名称" allowClear />
+                <a-input v-model.trim="queryParam.demanderNameCurrent" placeholder="请输入客户名称" allowClear />
               </a-form-item>
             </a-col>
-            <a-col :xl="4" :lg="6" :md="6" :sm="8">
+            <a-col :xl="6" :lg="6" :md="6" :sm="8">
               <a-form-item label="出库类型">
                 <v-select
                   v-model="queryParam.outBizType"
@@ -27,7 +32,7 @@
                   allowClear></v-select>
               </a-form-item>
             </a-col>
-            <a-col :xl="4" :lg="6" :md="6" :sm="8">
+            <a-col :xl="6" :lg="6" :md="6" :sm="8">
               <a-form-item label="单据状态">
                 <v-select
                   v-model="queryParam.state"
@@ -165,6 +170,7 @@ export default {
       queryParam: { //  查询条件
         beginDate: getDate.getCurrMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
+        outBizNo: undefined, //  出库单号
         demanderNameCurrent: undefined, //  单位名称
         outBizType: undefined, //  出库类型
         state: undefined //  状态
@@ -266,6 +272,7 @@ export default {
       this.$refs.rangeDate.resetDate(flag ? '' : this.time)
       this.queryParam.beginDate = flag ? '' : getDate.getCurrMonthDays().starttime
       this.queryParam.endDate = flag ? '' : getDate.getCurrMonthDays().endtime
+      this.queryParam.outBizNo = undefined
       this.queryParam.demanderNameCurrent = undefined
       this.queryParam.outBizType = undefined
       this.queryParam.state = undefined