Browse Source

货架设置

chenrui 3 years ago
parent
commit
c0baa2abce

+ 40 - 0
src/api/shelf.js

@@ -19,6 +19,14 @@ export const shelfDetail = (params) => {
     method: 'post'
   })
 }
+//  货架  保存
+export const shelfSave = (params) => {
+  return axios({
+    url: `/shelf/save`,
+    data: params,
+    method: 'post'
+  })
+}
 //  货架  货位产品 列表 不分页
 export const shelfProductList = (params) => {
   return axios({
@@ -35,3 +43,35 @@ export const shelfProductDetail = (params) => {
     method: 'get'
   })
 }
+//  货架  货位产品 保存
+export const shelfProductSave = (params) => {
+  return axios({
+    url: `/shelf/placeProduct/save`,
+    data: params,
+    method: 'post'
+  })
+}
+// 货架  货位产品 下载模板
+export const shelfProductDownload = params => {
+  return axios.request({
+    url: `/shelf/placeProduct/downloadExcel`,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 货架  货位产品  解析导入的文件
+export const shelfProductParseProducts = params => {
+  return axios({
+    url: '/shelf/placeProduct/readExcel',
+    data: params,
+    method: 'post'
+  })
+}
+// 货架  货位产品  批量插入
+export const shelfProductBatchInsert = params => {
+  return axios({
+    url: '/shelf/placeProduct/saveBatch',
+    data: params,
+    method: 'post'
+  })
+}

+ 88 - 0
src/views/common/productJqList.vue

@@ -0,0 +1,88 @@
+<template>
+  <!-- 箭冠产品 -->
+  <a-select
+    show-search
+    label-in-value
+    :value="productCode"
+    placeholder="请输入名称搜索"
+    style="width: 100%"
+    :filter-option="false"
+    :dropdownMatchSelectWidth="false"
+    :not-found-content="fetching ? undefined : null"
+    @blur="blurSelect"
+    @search="fetchUser"
+    @change="handleChange"
+    allowClear>
+    <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+    <a-select-option v-for="item in data" :key="item.productSn" :value="item.productSn">{{ item.code }}</a-select-option>
+  </a-select>
+</template>
+<script>
+import debounce from 'lodash/debounce'
+import { productList } from '@/api/product'
+export default {
+  props: {
+    itemSn: {
+      type: String || Number,
+      default: undefined
+    }
+  },
+  data () {
+    this.lastFetchId = 0
+    this.fetchUser = debounce(this.fetchUser, 800)
+    return {
+      data: [],
+      productCode: undefined,
+      fetching: false
+    }
+  },
+  methods: {
+    fetchUser (productCode) {
+      console.log('fetching user', productCode)
+      if (productCode == '') return
+      this.lastFetchId += 1
+      const fetchId = this.lastFetchId
+      this.data = []
+      this.fetching = true
+      productList({ code: productCode, onlineFalg: 1, sysFlag: 1, pageNo: 1, pageSize: 20 }).then(res => {
+        if (fetchId !== this.lastFetchId) {
+          return
+        }
+        this.data = res.data && res.data.list ? res.data.list : []
+        this.fetching = false
+      })
+    },
+    handleChange (value) {
+      if (value && value.key) {
+        const ind = this.data.findIndex(item => item.productSn == value.key)
+        value.row = ind != -1 ? this.data[ind] : undefined
+      }
+      Object.assign(this, {
+        productCode: value,
+        data: [],
+        fetching: false
+      })
+      this.$emit('change', value || { key: undefined, label: '' })
+    },
+    resetForm () {
+      this.productCode = undefined
+    },
+    setData (value) {
+      Object.assign(this, {
+        productCode: value,
+        data: [],
+        fetching: false
+      })
+    },
+    blurSelect () {
+      this.data = []
+    }
+  },
+  mounted () {
+    if (this.itemSn) {
+      this.fetchUser(this.itemSn)
+      this.setData({ key: this.itemSn })
+    }
+  }
+}
+</script>

+ 26 - 8
src/views/common/shelfList.vue

@@ -9,6 +9,7 @@
     :filter-option="false"
     :dropdownMatchSelectWidth="false"
     :not-found-content="fetching ? undefined : null"
+    @blur="blurSelect"
     @search="fetchUser"
     @change="handleChange"
     allowClear>
@@ -21,9 +22,9 @@ import debounce from 'lodash/debounce'
 import { shelfList } from '@/api/shelf'
 export default {
   props: {
-    verify: { //  当前输入客户名称是否是卫星仓客户 提示信息
-      type: Boolean,
-      default: false
+    itemSn: {
+      type: String || Number,
+      default: undefined
     }
   },
   data () {
@@ -31,7 +32,7 @@ export default {
     this.fetchUser = debounce(this.fetchUser, 800)
     return {
       data: [],
-      shelfName: [],
+      shelfName: undefined,
       fetching: false
     }
   },
@@ -48,13 +49,14 @@ export default {
           return
         }
         this.data = res.data && res.data.list ? res.data.list : []
-        if (this.verify && this.data.length == 0) {
-          this.$message.info('货架不存在')
-        }
         this.fetching = false
       })
     },
     handleChange (value) {
+      if (value && value.key) {
+        const ind = this.data.findIndex(item => item.customerSn == value.key)
+        value.row = ind != -1 ? this.data[ind] : undefined
+      }
       Object.assign(this, {
         shelfName: value,
         data: [],
@@ -63,7 +65,23 @@ export default {
       this.$emit('change', value || { key: undefined, label: '' })
     },
     resetForm () {
-      this.shelfName = []
+      this.shelfName = undefined
+    },
+    setData (value) {
+      Object.assign(this, {
+        shelfName: value,
+        data: [],
+        fetching: false
+      })
+    },
+    blurSelect () {
+      this.data = []
+    }
+  },
+  mounted () {
+    if (this.itemSn) {
+      this.fetchUser(this.itemSn)
+      this.setData({ key: this.itemSn })
     }
   }
 }

+ 41 - 27
src/views/numsGoodsShelves/shelfSet/basicInfoModal.vue

@@ -9,7 +9,7 @@
     @cancle="isShow = false"
     :width="600">
     <a-spin :spinning="spinning" tip="Loading...">
-      <p style="text-align: center;margin: 0 0 20px;font-size: 14px;font-weight: bold;">西安车领主常青二路数字货架</p>
+      <p 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"
@@ -20,12 +20,12 @@
         <a-form-model-item label="关联客户" prop="customerSn">
           <custList ref="custList" @change="custChange"></custList>
         </a-form-model-item>
-        <a-form-model-item label="临配运费" prop="beginDay">
+        <a-form-model-item label="临配运费" prop="tempFreight">
           <a-row>
             <a-col :span="20">
               <a-input-number
-                id="shelfSet-basicInfo-beginDay"
-                v-model="form.beginDay"
+                id="shelfSet-basicInfo-tempFreight"
+                v-model="form.tempFreight"
                 :precision="2"
                 :min="0"
                 :max="999999"
@@ -38,7 +38,7 @@
         </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 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>
@@ -49,7 +49,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { VSelect } from '@/components'
 import custList from '@/views/common/custList.vue'
-import { getTenantList, allocLinkageOutSave } from '@/api/allocLinkageOut'
+import { shelfSave } from '@/api/shelf'
 export default {
   name: 'ShelfSetBasicInfoModal',
   components: { VSelect, custList },
@@ -59,6 +59,12 @@ export default {
       //  弹框显示状态
       type: Boolean,
       default: false
+    },
+    nowData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
     }
   },
   data () {
@@ -70,14 +76,13 @@ export default {
         wrapperCol: { span: 18 }
       },
       form: {
-        customerSn: undefined, //  调往对象
-        beginDay: undefined
+        customerSn: undefined,
+        tempFreight: ''
       },
       rules: {
         customerSn: [{ required: true, message: '请选择关联客户', trigger: 'change' }],
-        beginDay: [{ required: true, message: '请输入临配运费', trigger: 'blur' }]
-      },
-      putTenantSnData: [] //  调往对象  下拉数据
+        tempFreight: [{ required: true, message: '请输入临配运费', trigger: 'blur' }]
+      }
     }
   },
   methods: {
@@ -90,22 +95,21 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          _this.isShow = false
-          _this.$router.push({ path: `/numsGoodsShelves/shelfSet/set/1` })
-          // const form = JSON.parse(JSON.stringify(_this.form))
-          // _this.spinning = true
-          // allocLinkageOutSave(form).then(res => {
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     setTimeout(() => {
-          //       _this.isShow = false
-          //       _this.$emit('ok', res.data)
-          //       _this.spinning = false
-          //     }, 1000)
-          //   } else {
-          //     _this.spinning = false
-          //   }
-          // })
+          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) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.isShow = false
+                _this.$emit('ok', res.data)
+                _this.spinning = false
+              }, 1000)
+            } else {
+              _this.spinning = false
+            }
+          })
         } else {
           console.log('error submit!!')
           return false
@@ -123,6 +127,16 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
+        this.$refs.custList.resetForm()
+      } else {
+        if (this.nowData.customerSn) {
+          const _this = this
+          this.$nextTick(() => {
+            _this.$refs.custList.setData({ key: _this.nowData.customerSn, label: _this.nowData.customerName, row: _this.nowData })
+            _this.form.customerSn = _this.nowData.customerSn
+          })
+        }
+        this.form.tempFreight = this.nowData.tempFreight || ''
       }
     }
   }

+ 76 - 43
src/views/numsGoodsShelves/shelfSet/bindProductModal.vue

@@ -18,17 +18,22 @@
         :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="绑定产品" prop="customerSn">
-          <custList ref="custList" @change="custChange"></custList>
+        <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="销售价" prop="beginDay">
+        <a-form-model-item label="新绑定产品" prop="productSn" v-if="type == 'replace'">
+          <productJqList ref="productJqList" @change="productJqChange"></productJqList>
+          <span v-if="form.productSn">{{ productName || '--' }}</span>
+        </a-form-model-item>
+        <a-form-model-item label="销售价" prop="price">
           <a-row>
             <a-col :span="20">
               <a-input-number
-                id="shelfSet-bindProduct-beginDay"
-                v-model="form.beginDay"
+                id="shelfSet-bindProduct-price"
+                v-model="form.price"
                 :precision="2"
-                :min="0"
+                :min="0.01"
                 :max="999999"
                 placeholder="请输入正数(最多允许两位小数)"
                 suffix="元"
@@ -37,14 +42,14 @@
             <a-col :span="4"><span style="margin-left: 10px;">元</span></a-col>
           </a-row>
         </a-form-model-item>
-        <a-form-model-item label="结算价" prop="beginDay">
+        <a-form-model-item label="结算价" prop="cost">
           <a-row>
             <a-col :span="20">
               <a-input-number
-                id="shelfSet-bindProduct-beginDay"
-                v-model="form.beginDay"
+                id="shelfSet-bindProduct-cost"
+                v-model="form.cost"
                 :precision="2"
-                :min="0"
+                :min="0.01"
                 :max="999999"
                 placeholder="请输入正数(最多允许两位小数)"
                 suffix="元"
@@ -53,20 +58,20 @@
             <a-col :span="4"><span style="margin-left: 10px;">元</span></a-col>
           </a-row>
         </a-form-model-item>
-        <a-form-model-item label="最大库容" prop="beginDay">
+        <a-form-model-item label="最大库容" prop="maxQty">
           <a-input-number
-            id="shelfSet-bindProduct-beginDay"
-            v-model="form.beginDay"
+            id="shelfSet-bindProduct-maxQty"
+            v-model="form.maxQty"
             :precision="0"
             :min="0"
             :max="999999"
-            placeholder="请输入最大库容(正整数)"
+            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 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>
@@ -76,11 +81,11 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { VSelect } from '@/components'
-import custList from '@/views/common/custList.vue'
-import { getTenantList, allocLinkageOutSave } from '@/api/allocLinkageOut'
+import productJqList from '@/views/common/productJqList.vue'
+import { shelfProductSave, shelfProductDetail } from '@/api/shelf'
 export default {
   name: 'ShelfSetBasicInfoModal',
-  components: { VSelect, custList },
+  components: { VSelect, productJqList },
   mixins: [commonMixin],
   props: {
     openModal: { //  弹框显示状态
@@ -107,14 +112,19 @@ export default {
         wrapperCol: { span: 18 }
       },
       form: {
-        customerSn: undefined, //  调往对象
-        beginDay: undefined
+        productSn: undefined,
+        price: '',
+        cost: '',
+        maxQty: ''
       },
       rules: {
-        customerSn: [{ required: true, message: '请选择关联客户', trigger: 'change' }],
-        beginDay: [{ required: true, message: '请输入临配运费', trigger: 'blur' }]
+        productSn: [{ required: true, message: '请选择绑定产品', trigger: 'change' }],
+        price: [{ required: true, message: '请输入销售价', trigger: 'blur' }],
+        cost: [{ required: true, message: '请输入结算价', trigger: 'blur' }],
+        maxQty: [{ required: true, message: '请输入最大库容', trigger: 'blur' }]
       },
-      putTenantSnData: [] //  调往对象  下拉数据
+      productName: '',
+      productInfo: null
     }
   },
   computed: {
@@ -131,36 +141,51 @@ export default {
     }
   },
   methods: {
-    // 客户 change
-    custChange (obj) {
-      this.form.customerSn = obj.key || undefined
+    // 产品 change
+    productJqChange (obj) {
+      this.form.productSn = obj.key || undefined
+      this.productName = obj && obj.row && obj.row.name || '--'
     },
     //  保存
     handleSave () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          _this.isShow = false
-          _this.$router.push({ path: `/numsGoodsShelves/shelfSet/set/1` })
-          // const form = JSON.parse(JSON.stringify(_this.form))
-          // _this.spinning = true
-          // allocLinkageOutSave(form).then(res => {
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     setTimeout(() => {
-          //       _this.isShow = false
-          //       _this.$emit('ok', res.data)
-          //       _this.spinning = false
-          //     }, 1000)
-          //   } else {
-          //     _this.spinning = false
-          //   }
-          // })
+          const form = JSON.parse(JSON.stringify(_this.form))
+          form.shelfSn = _this.nowData && _this.nowData.shelfSn
+          form.shelfPlaceSn = _this.nowData && _this.nowData.shelfPlaceSn
+          _this.spinning = true
+          shelfProductSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.isShow = false
+                _this.$emit('ok', res.data)
+                _this.spinning = false
+              }, 1000)
+            } else {
+              _this.spinning = false
+            }
+          })
         } else {
           console.log('error submit!!')
           return false
         }
       })
+    },
+    // 获取产品信息
+    getProductInfo () {
+      shelfProductDetail({ shelfPlaceSn: this.nowData && this.nowData.shelfPlaceSn, productSn: this.nowData && this.nowData.productSn }).then(res => {
+        if (res.status == 200 && res.data) {
+          this.productInfo = res.data
+          this.form.price = res.data.price
+          this.form.cost = res.data.cost
+          this.form.maxQty = res.data.maxQty
+        } else {
+          this.productInfo = null
+          this.$refs.ruleForm.resetFields()
+        }
+      })
     }
   },
   watch: {
@@ -170,10 +195,18 @@ export default {
     },
     //  重定义的弹框状态
     isShow (newValue, oldValue) {
-      console.log(this.nowData)
       if (!newValue) {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
+        if (this.$refs.productJqList) {
+          this.$refs.productJqList.resetForm()
+        }
+        this.productName = ''
+        this.productInfo = null
+      } else {
+        if (this.type != 'bind') { // 修改信息、更换产品
+          this.getProductInfo()
+        }
       }
     }
   }

+ 13 - 13
src/views/numsGoodsShelves/shelfSet/chooseImportModal.vue

@@ -15,7 +15,7 @@
         class="sTable"
         ref="table"
         size="small"
-        :rowKey="(record) => record.supplierSn"
+        :rowKey="(record) => record.shelfSn"
         :columns="nowColumns"
         :dataSource="loadData"
         :loading="loading"
@@ -59,7 +59,7 @@
 </template>
 
 <script>
-import { supplierProductParseProducts } from '@/api/supplier'
+import { shelfProductParseProducts } from '@/api/shelf'
 export default {
   name: 'ChooseImportModal',
   props: {
@@ -79,21 +79,21 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       nowColumns: [ //  可导入
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
-        { title: '货位号', dataIndex: 'productCode', width: '19%', align: 'center', customRender: function (text) { return text || '--' } },
+        { 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: 'product.name', width: '26%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '销售价', dataIndex: 'costText', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '结算价', dataIndex: 'costText', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '最大库容', dataIndex: 'costText', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '绑定产品名称', dataIndex: 'productName', width: '26%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '销售价', dataIndex: 'price', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '结算价', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { 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: 'productCode', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
+        { 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: 'product.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '销售价', dataIndex: 'costText', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '结算价', dataIndex: 'costText', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '最大库容', dataIndex: 'costText', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '绑定产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '销售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '结算价', dataIndex: 'cost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '最大库容', dataIndex: 'maxQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '错误原因', dataIndex: 'errorDesc', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true }
       ],
       loadData: [],
@@ -105,7 +105,7 @@ export default {
     getData () {
       const _this = this
       this.loading = true
-      supplierProductParseProducts(this.paramsData).then(res => {
+      shelfProductParseProducts(this.paramsData).then(res => {
         this.loading = false
         if (res.status == 200) {
           if (res.data.okList && res.data.okList.length > 0) {

+ 8 - 8
src/views/numsGoodsShelves/shelfSet/importGuideModal.vue

@@ -71,7 +71,7 @@
 import { hdPrint } from '@/libs/JGPrint.js'
 import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
-import { supplierProductDownload } from '@/api/supplier'
+import { shelfProductDownload } from '@/api/shelf'
 export default {
   name: 'ImportGuideModal',
   components: { ChooseImportModal, Upload },
@@ -99,17 +99,17 @@ export default {
   methods: {
     // 下一步
     handlerNextStep () {
-      // if (this.paramsData) {
-      this.openImportModal = true
-      // } else {
-      //   this.$message.warning('添加文件后再进行下一步操作!')
-      // }
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
     },
     // 上传文件  change
     changeImport (file) {
       if (file) {
         this.paramsData = {
-          supplierSn: this.params.supplierSn || '',
+          shelfSn: this.params.shelfSn || '',
           path: file
         }
       }
@@ -131,7 +131,7 @@ export default {
       const _this = this
       _this.spinning = true
       // 导出
-      hdPrint('', 'export', supplierProductDownload, {}, '关联产品导入模板', function () {
+      hdPrint('', 'export', shelfProductDownload, {}, '导入绑定产品模板', function () {
         _this.spinning = false
       })
     }

+ 10 - 3
src/views/numsGoodsShelves/shelfSet/list.vue

@@ -66,7 +66,7 @@
       </s-table>
     </a-spin>
     <!-- 基础设置 -->
-    <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
+    <basic-info-modal :openModal="openModal" :nowData="nowData" @ok="handleOk" @close="openModal=false" />
   </a-card>
 </template>
 
@@ -117,7 +117,8 @@ export default {
           return data
         })
       },
-      openModal: false
+      openModal: false,
+      nowData: null
     }
   },
   methods: {
@@ -126,10 +127,16 @@ export default {
       if (row.customerSn && row.tempFreight) {
         this.$router.push({ path: `/numsGoodsShelves/shelfSet/set/${row.shelfSn}` })
       } else {
+        this.nowData = {
+          shelfSn: row.shelfSn,
+          shelfName: row.shelfName
+        }
         this.openModal = true
       }
     },
-    handleOk () {},
+    handleOk (data) {
+      this.$router.push({ path: `/numsGoodsShelves/shelfSet/set/${data.shelfSn}` })
+    },
     // 客户 change
     custChange (obj) {
       this.queryParam.customerSn = obj.key || undefined

+ 20 - 7
src/views/numsGoodsShelves/shelfSet/set.vue

@@ -106,7 +106,9 @@
       @ok="openTipsModal=false"
       @close="openTipsModal=false" />
     <!-- 导入产品 -->
-    <importGuideModal :openModal="openGuideModal" :params="{supplierSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" />
+    <importGuideModal :openModal="openGuideModal" :params="{shelfSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" />
+    <!-- 基础设置 -->
+    <basic-info-modal :openModal="openInfoModal" :nowData="basicInfoData" @ok="handleInfoOk" @close="openInfoModal=false" />
   </div>
 </template>
 
@@ -116,10 +118,11 @@ import { STable, VSelect } from '@/components'
 import commonModal from '@/views/common/commonModal.vue'
 import bindProductModal from './bindProductModal.vue'
 import ImportGuideModal from './importGuideModal.vue'
-import { shelfDetail, shelfProductList } from '@/api/shelf'
+import basicInfoModal from './basicInfoModal.vue'
+import { shelfDetail, shelfProductList, shelfProductBatchInsert } from '@/api/shelf'
 export default {
   name: 'ShelfMonitoringWarehousing',
-  components: { STable, VSelect, commonModal, bindProductModal, ImportGuideModal },
+  components: { STable, VSelect, commonModal, bindProductModal, ImportGuideModal, basicInfoModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -162,12 +165,15 @@ export default {
       openModal: false,
       nowData: null,
       openGuideModal: false,
-      modalType: null
+      modalType: null,
+      openInfoModal: false
     }
   },
   methods: {
     // 编辑基本信息
-    handleInfoEdit () {},
+    handleInfoEdit () {
+      this.openInfoModal = true
+    },
     // 基本信息
     getDetail () {
       shelfDetail({ sn: this.$route.params.sn }).then(res => {
@@ -201,8 +207,15 @@ export default {
       this.openModal = false
     },
     // 导入成功
-    handleGuideOk () {
-
+    handleGuideOk (obj) {
+      shelfProductBatchInsert(obj).then(res => {
+        if (res.status == 200) {
+          this.$refs.table.refresh(true)
+        }
+      })
+    },
+    handleInfoOk () {
+      this.getDetail()
     },
     //  重置
     resetSearchForm () {